| | |
| | | ElForm: typeof import('element-plus/es')['ElForm'] |
| | | ElFormItem: typeof import('element-plus/es')['ElFormItem'] |
| | | ElIcon: typeof import('element-plus/es')['ElIcon'] |
| | | ElInput: typeof import('element-plus/es')['ElInput'] |
| | | ElOption: typeof import('element-plus/es')['ElOption'] |
| | | ElPagination: typeof import('element-plus/es')['ElPagination'] |
| | | ElPopover: typeof import('element-plus/es')['ElPopover'] |
| | |
| | | MapLocation: typeof import('./components/map/MapLocation.vue')['default'] |
| | | MapScene: typeof import('./components/map/MapScene.vue')['default'] |
| | | MapToolbox: typeof import('./components/map/MapToolbox.vue')['default'] |
| | | MissionCreate: typeof import('./components/mission/MissionCreate.vue')['default'] |
| | | MIssionCreate: typeof import('./components/mission/MIssionCreate.vue')['default'] |
| | | MissionImport: typeof import('./components/mission/MissionImport.vue')['default'] |
| | | MissionManage: typeof import('./components/mission/MissionManage.vue')['default'] |
| | |
| | | <template> |
| | | <el-dialog |
| | | :model-value="modelValue" |
| | | @update-modelvalue="handleChange" |
| | | @opened="handleChange(true)" |
| | | @closed="handleChange(false)" |
| | | :show-close="false" |
| | | align-center |
| | | > |
| | |
| | | ref="formRef" |
| | | :rules="rules" |
| | | label-position="right" |
| | | label-width="150px" |
| | | label-width="100px" |
| | | > |
| | | <slot name="form-item" :formObj="formObj"></slot> |
| | | <el-form-item label="任务编号" prop="missionCode"> |
| | | <el-input |
| | | size="small" |
| | | clearable |
| | | v-model="formObj.missionCode" |
| | | placeholder="任务编号" |
| | | /> |
| | | </el-form-item> |
| | | <OptionType v-model="formObj.deviceType"></OptionType> |
| | | <el-form-item label="设备编号" prop="acountname"> |
| | | <el-input |
| | | size="small" |
| | | clearable |
| | | v-model="formObj.deviceCode" |
| | | placeholder="设备编号" |
| | | /> |
| | | </el-form-item> |
| | | <OptionTime v-model="formObj.timeArray"></OptionTime> |
| | | <el-form-item> |
| | | <el-button |
| | | :disabled="!edit" |
| | |
| | | :loading="loading" |
| | | >提交</el-button |
| | | > |
| | | <el-button v-if="useCancel" @click="onCancel">取消</el-button> |
| | | <el-button @click="onCancel">取消</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </CardDialog> |
| | | </template> |
| | | <script setup> |
| | | import { onActivated, onDeactivated, ref, reactive, watch } from 'vue'; |
| | | import { ref, reactive, computed } from 'vue'; |
| | | import missionApi from '@/api/missionApi'; |
| | | import { useFormConfirm } from '@/composables/formConfirm'; |
| | | import { useFetchData } from '@/composables/fetchData'; |
| | |
| | | } |
| | | ] |
| | | }); |
| | | const param = computed(() => { |
| | | return { |
| | | missionCode: formObj.value.missionCode, |
| | | deviceType: formObj.value.deviceType, |
| | | deviceCode: formObj.value.deviceCode, |
| | | startTime: formObj.value.timeArray[0], |
| | | endTime: formObj.value.timeArray[1] |
| | | }; |
| | | }); |
| | | // 创建任务 |
| | | function createMission() {} |
| | | const { formObj, formRef, edit, onSubmit, onCancel, onReset, clear } = |
| | | useFormConfirm({ |
| | | submit: { |
| | | do: createMission |
| | | }, |
| | | cancel: { |
| | | do: () => (dialogVisible.value = false) |
| | | } |
| | | function createMission() { |
| | | fetchData((page, pageSize) => { |
| | | return missionApi.putNewMission(param.value).then((res) => { |
| | | dialogVisible.value = false; |
| | | }); |
| | | }); |
| | | } |
| | | const { formObj, formRef, edit, onSubmit, onCancel } = useFormConfirm({ |
| | | submit: { |
| | | do: createMission |
| | | }, |
| | | cancel: { |
| | | do: () => { |
| | | dialogVisible.value = false; |
| | | } |
| | | } |
| | | }); |
| | | </script> |
| | |
| | | </el-col> |
| | | <el-col :span="4" class="flex-col"> |
| | | <div> |
| | | <el-button type="primary" class="el-button-custom"> |
| | | <!-- <el-button type="primary" class="el-button-custom"> |
| | | 新建任务 |
| | | </el-button> |
| | | </el-button> --> |
| | | <MissionCreate></MissionCreate> |
| | | </div> |
| | | <div> |
| | | <el-button type="primary" class="el-button-custom"> |
| | |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapState(useMissionStore, ['missionLi1st']) |
| | | ...mapState(useMissionStore, ['missionList']) |
| | | }, |
| | | methods: { |
| | | createMission() {}, |
| | |
| | | const onSubmit = function (messageBox = true) { |
| | | formRef.value.validate(async (valid) => { |
| | | if (valid) { |
| | | if (messageBox) { |
| | | // useMessageBoxTip({ |
| | | // confirmMsg: submit.msg, |
| | | // confirmTitle: submit.title, |
| | | // onConfirm: async () => { |
| | | // const res = await submit.do(); |
| | | // submited(); |
| | | // return res; |
| | | // } |
| | | // }); |
| | | } else { |
| | | await submit.do(); |
| | | submited(); |
| | | } |
| | | // if (messageBox) { |
| | | // useMessageBoxTip({ |
| | | // confirmMsg: submit.msg, |
| | | // confirmTitle: submit.title, |
| | | // onConfirm: async () => { |
| | | // const res = await submit.do(); |
| | | // submited(); |
| | | // return res; |
| | | // } |
| | | // }); |
| | | // } else { |
| | | // await submit.do(); |
| | | // submited(); |
| | | // } |
| | | await submit.do(); |
| | | submited(); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | // 取消提交 |
| | | const onCancel = function () { |
| | | if (edit.value) { |
| | | // 弹出确认框 |
| | | // useMessageBox({ |
| | | // confirmMsg: cancel.msg, |
| | | // confirmTitle: cancel.title, |
| | | // onConfirm: () => { |
| | | // // clear(); |
| | | // return cancel.do(); |
| | | // } |
| | | // }); |
| | | } else { |
| | | cancel.do(); |
| | | } |
| | | // if (edit.value) { |
| | | // // 弹出确认框 |
| | | // useMessageBox({ |
| | | // confirmMsg: cancel.msg, |
| | | // confirmTitle: cancel.title, |
| | | // onConfirm: () => { |
| | | // // clear(); |
| | | // return cancel.do(); |
| | | // } |
| | | // }); |
| | | // } else { |
| | | // cancel.do(); |
| | | // } |
| | | cancel.do(); |
| | | }; |
| | | |
| | | // 重置表单 |
| | | const onReset = function (tips) { |
| | | if (edit.value) { |
| | | if (tips) { |
| | | // 弹出确认框 |
| | | // useMessageBox({ |
| | | // confirmMsg: '是否重置表单内容?', |
| | | // confirmTitle: '重置表单', |
| | | // onConfirm: () => { |
| | | // _reset(); |
| | | // return reset.do(); |
| | | // } |
| | | // }); |
| | | } else { |
| | | _reset(); |
| | | reset.do(); |
| | | } |
| | | // if (tips) { |
| | | // // 弹出确认框 |
| | | // useMessageBox({ |
| | | // confirmMsg: '是否重置表单内容?', |
| | | // confirmTitle: '重置表单', |
| | | // onConfirm: () => { |
| | | // _reset(); |
| | | // return reset.do(); |
| | | // } |
| | | // }); |
| | | // } else { |
| | | // _reset(); |
| | | // reset.do(); |
| | | // } |
| | | _reset(); |
| | | reset.do(); |
| | | } else { |
| | | reset.do(); |
| | | } |