| | |
| | | <el-form-item label="触发方式" prop="triggerMethod"> |
| | | <el-select v-model="formData.triggerMethod" placeholder="请选择"> |
| | | <el-option |
| | | v-for="dict in getIntDictOptions(DICT_TYPE.SCHE_TRIGGER_METHOD)" |
| | | v-for="dict in getDictOptions(DICT_TYPE.SCHE_TRIGGER_METHOD)" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="关联项目" prop="mpkprojectid"> |
| | | <el-select v-model="formData.mpkprojectid" placeholder="请选择"> |
| | | <el-option |
| | | v-for="item in mpkProjectList" |
| | | :key="item.id" |
| | | :label="item.projectName" |
| | | :value="item.id"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="备注" prop="remark"> |
| | | <el-input v-model="formData.remark" placeholder="请输入备注" type="textarea" maxlength="100" |
| | | <el-input v-model="formData.remark" placeholder="请输入备注" type="textarea" |
| | | maxlength="100" |
| | | show-word-limit/> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | </Dialog> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' |
| | | import {DICT_TYPE, getDictOptions} from '@/utils/dict' |
| | | import * as ScheduleSchemeApi from '@/api/model/sche/scheme' |
| | | import { CommonStatusEnum } from '@/utils/constants' |
| | | import * as ScheduleModelApi from "@/api/model/sche/model"; |
| | | import * as ProjectApi from '@/api/model/mpk/project' |
| | | |
| | | defineOptions({ name: 'ScheduleSchemeForm' }) |
| | | |
| | |
| | | modelId: undefined, |
| | | scheduleTime: undefined, |
| | | remark: undefined, |
| | | status: 0 |
| | | status: 0, |
| | | mpkprojectid: undefined, |
| | | }) |
| | | const formRules = reactive({ |
| | | code: [{ required: true, message: '编号不能为空', trigger: 'blur' }], |
| | | name: [{ required: true, message: '名称不能为空', trigger: 'blur' }] |
| | | name: [{required: true, message: '名称不能为空', trigger: 'blur'}], |
| | | triggerMethod: [{required: true, message: '触发方式不能为空', trigger: 'blur'}], |
| | | triggerCondition: [{required: true, message: '触发条件不能为空', trigger: 'blur'}], |
| | | modelId: [{required: true, message: '调度模型不能为空', trigger: 'blur'}], |
| | | triggerCondition: [{required: true, message: '触发条件不能为空', trigger: 'blur'}], |
| | | mpkprojectid: [{required: true, message: '关联项目不能为空', trigger: 'blur'}], |
| | | }) |
| | | const formRef = ref() // 表单 Ref |
| | | const scheduleModelList = ref([] as ScheduleModelApi.ScheduleModelVO[]) |
| | | |
| | | const mpkProjectList = ref([]) |
| | | const addRow = function (index, rows) { |
| | | let row = JSON.parse(JSON.stringify(rows[index])) |
| | | rows.splice(index, 0, row) |
| | |
| | | } |
| | | // 加载调度模型列表 |
| | | scheduleModelList.value = await ScheduleModelApi.getScheduleModelList() |
| | | |
| | | // 获取mpk项目列表 |
| | | mpkProjectList.value = await ProjectApi.list() |
| | | } |
| | | defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
| | | |
| | |
| | | modelId: undefined, |
| | | scheduleTime: undefined, |
| | | remark: undefined, |
| | | status: CommonStatusEnum.ENABLE |
| | | status: CommonStatusEnum.ENABLE, |
| | | mpkprojectid: undefined |
| | | } |
| | | formRef.value?.resetFields() |
| | | } |