<template>
  <div>
    <el-card class="box-card">
      <div v-for="res in nextNTriggerTime" :key="res" class="text item">
        {{ res }}
      </div>
    </el-card>
  </div>
</template>

<script setup>
import { onMounted, ref, watch, defineProps } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { getvalidatetimeExpression } from '@/api/model/workflowManagement'
// 数据传递
const props = defineProps({
  timeExpressionType: {
    type: String,
    default: undefined
  },
  timeExpression: {
    type: String,
    default: undefined
  }
})
const nextNTriggerTime = ref([])

const checkTimeExpression = async () => {
  let params = {
    timeExpressionType: props.timeExpressionType,
    timeExpression: timeExpressionCh.value
  }
  const res = await getvalidatetimeExpression(params)
  nextNTriggerTime.value = res.data
}
const timeExpressionCh = ref(null)
onMounted(() => {
  console.log('type:' + props.timeExpressionType)
  console.log('expression:' + props.timeExpression)
  timeExpressionCh.value = encodeURIComponent(props.timeExpression)
  console.log('expressionAfterEncodeURIComponent: ' + props.timeExpression)
  checkTimeExpression()
})
</script>

<style scoped>
</style>
