From 04aac2eda9b5d9473eb96d12b32cb76fb45135c6 Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期日, 21 七月 2024 19:52:31 +0800 Subject: [PATCH] 工单更新 --- src/views/tigerprojects/mes/eng/route/components/FormItemProps.vue | 133 +++++++++++++++++++------------------------- 1 files changed, 57 insertions(+), 76 deletions(-) diff --git a/src/views/tigerprojects/mes/eng/route/components/FormItemProps.vue b/src/views/tigerprojects/mes/eng/route/components/FormItemProps.vue index 7bc5eb0..f41c469 100644 --- a/src/views/tigerprojects/mes/eng/route/components/FormItemProps.vue +++ b/src/views/tigerprojects/mes/eng/route/components/FormItemProps.vue @@ -5,47 +5,20 @@ <div class="properties-content"> <Form class="properties-body" label-align="left" layout="vertical"> <FormItem label="宸ヨ壓璺嚎缂栫爜" name="宸ヨ壓璺嚎缂栫爜"> - <Input - :style="{ width: '100%' }" - v-model:value="mesRoute.ROT_CODE" - :min="0" - :step="1" - :readonly="true" - /> + <Input :style="{ width: '100%' }" v-model:value="mesRoute.ROT_CODE" :min="0" :step="1" :readonly="true" /> </FormItem> <FormItem label="鑺傜偣鍚嶇О" name="鑺傜偣鍚嶇О"> - <Input - :style="{ width: '100%' }" - v-model:value="routeConfig.currentItem.NODE_NAME" - :min="0" - :step="1" - :readonly="true" - /> + <Input :style="{ width: '100%' }" v-model:value="routeConfig.currentItem.NODE_NAME" :min="0" :step="1" /> </FormItem> - <FormItem label="宸ユ" name="鑺傜偣鍚嶇О"> - <Input - :style="{ width: '100%' }" - v-model:value="routeConfig.currentItem.SEGMENT" - :min="0" - :step="1" - /> + <FormItem label="宸ユ" name="宸ユ"> + <Input :style="{ width: '100%' }" v-model:value="routeConfig.currentItem.SEGMENT" :min="0" :step="1" /> </FormItem> <FormItem label="宸ュ簭缂栫爜" name="宸ュ簭缂栫爜"> - <Input - :style="{ width: '100%' }" - v-model:value="routeConfig.currentItem.GPH_TYPE" - :min="0" - :step="1" - :readonly="true" - /> + <Input :style="{ width: '100%' }" v-model:value="routeConfig.currentItem.GPH_TYPE" :min="0" :step="1" /> </FormItem> <FormItem label="鏄惁鍚敤" name="鏄惁鍚敤"> - <Select - ref="select" - v-model:value="routeConfig.currentItem.IS_ACTIVE" - style="width: 120px" - :options="options1" - /> + <Select ref="select" v-model:value="routeConfig.currentItem.IS_ACTIVE" style="width: 120px" + :options="options1" /> </FormItem> <FormItem label="鏄惁璁$畻鐩撮�氱巼" name="鏄惁璁$畻鐩撮�氱巼"> <Switch v-model:checked="routeConfig.isCalcFpy" /> @@ -63,49 +36,57 @@ </div> </template> <script lang="ts" setup> - import { Select, Switch, Input, Form, FormItem } from 'ant-design-vue'; - import { useRouteDesignState } from '../hooks/useRouteDesignState'; - import { SelectTypes } from 'ant-design-vue/es/select'; - import { ref, watch } from 'vue'; - import { isNullOrUnDef } from '/@/utils/is'; +import { Select, Switch, Input, Form, FormItem } from 'ant-design-vue'; +import { useRouteDesignState } from '../hooks/useRouteDesignState'; +import { SelectTypes } from 'ant-design-vue/es/select'; +import { ref, watch } from 'vue'; +import { isNullOrUnDef } from '/@/utils/is'; - const { routeConfig, mesRoute } = useRouteDesignState(); - const options1 = ref<SelectTypes['options']>([ - { - value: 'Y', - label: '鍚敤', - }, - { - value: 'N', - label: '涓嶅惎鐢�', - }, - ]); +const { routeConfig, mesRoute } = useRouteDesignState(); +const emit = defineEmits(['changeNodeName']); +const options1 = ref<SelectTypes['options']>([ + { + value: 'Y', + label: '鍚敤', + }, + { + value: 'N', + label: '涓嶅惎鐢�', + }, +]); - watch( - [ - () => routeConfig.isCalcFpy, - () => routeConfig.canSkip, - () => routeConfig.isInput, - () => routeConfig.isOutput, - ], - (newVal, oldVal) => { - routeConfig.routeData.nodes.forEach((r) => { - if (r.ID == routeConfig.currentItem.ID) { - if (oldVal[0] != newVal[0] && !isNullOrUnDef(oldVal[0])) { - r.IS_CALC_FPY = newVal[0] ? 'Y' : 'N'; - } - if (oldVal[1] != newVal[1] && !isNullOrUnDef(oldVal[1])) { - r.CAN_SKIP = newVal[1] ? 'Y' : 'N'; - } - if (oldVal[2] != newVal[2] && !isNullOrUnDef(oldVal[2])) { - r.IS_INPUT = newVal[2] ? 'Y' : 'N'; - } - if (oldVal[3] != newVal[3] && !isNullOrUnDef(oldVal[3])) { - r.IS_OUTPUT = newVal[3] ? 'Y' : 'N'; - } +watch( + [ + () => routeConfig.isCalcFpy, + () => routeConfig.canSkip, + () => routeConfig.isInput, + () => routeConfig.isOutput, + () => routeConfig.currentItem, + ], + (newVal, oldVal) => { + routeConfig.routeData.nodes.forEach((r) => { + if (r.ID == routeConfig.currentItem.ID) { + if (oldVal[0] != newVal[0] && !isNullOrUnDef(oldVal[0])) { + r.IS_CALC_FPY = newVal[0] ? 'Y' : 'N'; } - }); - }, - { deep: true, immediate: true }, - ); + if (oldVal[1] != newVal[1] && !isNullOrUnDef(oldVal[1])) { + r.CAN_SKIP = newVal[1] ? 'Y' : 'N'; + } + if (oldVal[2] != newVal[2] && !isNullOrUnDef(oldVal[2])) { + r.IS_INPUT = newVal[2] ? 'Y' : 'N'; + } + if (oldVal[3] != newVal[3] && !isNullOrUnDef(oldVal[3])) { + r.IS_OUTPUT = newVal[3] ? 'Y' : 'N'; + } + r.IS_ACTIVE = newVal[4].IS_ACTIVE; + r.SEGMENT = newVal[4].SEGMENT; + if (r.NODE_NAME != newVal[4].NODE_NAME) { + r.NODE_NAME = newVal[4].NODE_NAME; + emit('changeNodeName', { id: r.ID, val: r.NODE_NAME }); + } + } + }); + }, + { deep: true, immediate: true }, +); </script> -- Gitblit v1.9.3