From cba73428d36a0e0b0f66394f29715b430808de3d Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期三, 29 五月 2024 00:25:49 +0800 Subject: [PATCH] 一些优化 --- src/views/tigerprojects/mes/eng/route/components/ActionItemProps.vue | 73 +++++++++++++++++++++++++++++++----- 1 files changed, 62 insertions(+), 11 deletions(-) diff --git a/src/views/tigerprojects/mes/eng/route/components/ActionItemProps.vue b/src/views/tigerprojects/mes/eng/route/components/ActionItemProps.vue index 0fa8b4a..618f998 100644 --- a/src/views/tigerprojects/mes/eng/route/components/ActionItemProps.vue +++ b/src/views/tigerprojects/mes/eng/route/components/ActionItemProps.vue @@ -7,32 +7,63 @@ <FormItem label="宸ヨ壓璺嚎缂栫爜" name="宸ヨ壓璺嚎缂栫爜"> <Input :style="{ width: '100%' }" - v-model:value="routeConfig.currentItem.ROT_CODE" + v-model:value="mesRoute.ROT_CODE" :min="0" :step="1" :readonly="true" /> </FormItem> - <FormItem label="鑺傜偣缂栫爜" name="鑺傜偣缂栫爜"> + <FormItem label="鑺傜偣ID" name="鑺傜偣ID"> <Input :style="{ width: '100%' }" - v-model:value="routeConfig.currentItem.NODE_CODE" + v-model:value="routeConfig.currentAct.NODE_ID" + :min="0" + :step="1" + :readonly="true" + /> + </FormItem> + <FormItem label="琛屼负绫诲瀷" name="琛屼负绫诲瀷"> + <ApiSelect + :api="GetEnum" + :params="{ name: 'MES_ROUTE_NODE_ACT+ACT_TYPEs' }" + v-model:value="routeConfig.currentAct.ACT_TYPE" + resultField="Data" + :label-field="actTypeLable" + valueField="Value" + placeholder="璇烽�夋嫨琛屼负绫诲瀷" + /> + </FormItem> + <FormItem label="鑷畾涔夋柟娉曠被鍨�" name="鑷畾涔夋柟娉曠被鍨�"> + <ApiSelect + :api="GetEnum" + :params="{ name: 'MES_ROUTE_NODE_ACT+DO_TYPEs' }" + v-model:value="routeConfig.currentAct.DO_TYPE" + resultField="Data" + :label-field="actTypeLable" + valueField="Value" + placeholder="璇烽�夋嫨琛屼负绫诲瀷" + /> + </FormItem> + <FormItem label="鑷畾涔夋柟娉�(璋冪敤鏂规硶鐨勫叏鍚�)" name="鑷畾涔夋柟娉�"> + <Input + :style="{ width: '100%' }" + v-model:value="routeConfig.currentAct.DO_METHOD" :min="0" :step="1" /> </FormItem> - <FormItem label="鑺傜偣鍚嶇О" name="鑺傜偣鍚嶇О"> + <FormItem label="閫氳繃鏃舵墽琛�(璋冪敤鏂规硶鐨勫叏鍚�)" name="閫氳繃鏃舵墽琛�"> <Input :style="{ width: '100%' }" - v-model:value="routeConfig.currentItem.NODE_NAME" + v-model:value="routeConfig.currentAct.DO_IF_PASS" :min="0" :step="1" /> </FormItem> - <FormItem label="宸ュ簭缂栫爜" name="宸ュ簭缂栫爜"> + <FormItem label="澶辫触鏃舵墽琛�(璋冪敤鏂规硶鐨勫叏鍚�)" name="澶辫触鏃舵墽琛�"> <Input :style="{ width: '100%' }" - v-model:value="routeConfig.currentItem.OPER_CODE" + v-model:value="routeConfig.currentAct.DO_IF_FAIL" :min="0" :step="1" /> @@ -40,10 +71,9 @@ <FormItem label="鏄惁鍚敤" name="鏄惁鍚敤"> <Select ref="select" - v-model:value="routeConfig.currentItem.IS_ACTIVE" + v-model:value="routeConfig.currentAct.IS_ACTIVE" style="width: 120px" :options="options1" - :readonly="true" /> </FormItem> </Form> @@ -53,9 +83,13 @@ import { Select, Input, Form, FormItem } from 'ant-design-vue'; import { useRouteDesignState } from '../hooks/useRouteDesignState'; import { SelectTypes } from 'ant-design-vue/es/select'; - import { ref } from 'vue'; + import { ApiSelect } from '/@/components/Form/index'; + import { ref, unref, watch } from 'vue'; + import { useLocale } from '/@/locales/useLocale'; + import { GetEnum } from '/@/api/tigerapi/system'; - const { routeConfig } = useRouteDesignState(); + const { getLocale } = useLocale(); + const { routeConfig, mesRoute } = useRouteDesignState(); const options1 = ref<SelectTypes['options']>([ { value: 'Y', @@ -66,4 +100,21 @@ label: '涓嶅惎鐢�', }, ]); + const actTypeLable = unref(getLocale) == 'zh_CN' ? 'Desc' : 'Name'; + watch( + () => routeConfig.currentAct, + (newVal, oldVal) => { + routeConfig.routeData.acts.forEach((r) => { + if (r.ID == routeConfig.currentAct.ID) { + r.IS_ACTIVE = newVal.IS_ACTIVE; + r.ACT_TYPE = newVal.ACT_TYPE; + r.DO_TYPE = newVal.DO_TYPE; + r.DO_METHOD = newVal.DO_METHOD; + r.DO_IF_PASS = newVal.DO_IF_PASS; + r.DO_IF_FAIL = newVal.DO_IF_FAIL; + } + }); + }, + { deep: true, immediate: true }, + ); </script> -- Gitblit v1.9.3