From a41c87a94a0b52688420a7af3b242bc771628e28 Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期五, 19 七月 2024 17:30:32 +0800
Subject: [PATCH] 登录logo更新

---
 src/views/tigerprojects/mes/eng/route/components/ActionItemProps.vue |  361 ++++++++++++++++++++++++++++++---------------------
 1 files changed, 210 insertions(+), 151 deletions(-)

diff --git a/src/views/tigerprojects/mes/eng/route/components/ActionItemProps.vue b/src/views/tigerprojects/mes/eng/route/components/ActionItemProps.vue
index 375da2f..7f6c6f1 100644
--- a/src/views/tigerprojects/mes/eng/route/components/ActionItemProps.vue
+++ b/src/views/tigerprojects/mes/eng/route/components/ActionItemProps.vue
@@ -3,8 +3,8 @@
  * @Author: your name
  * @version: 
  * @Date: 2024-05-01 17:18:49
- * @LastEditors: your name
- * @LastEditTime: 2024-06-18 00:20:58
+ * @LastEditors: Ben Lin
+ * @LastEditTime: 2024-07-19 15:58:20
 -->
 <!--
  * @Description: 琛ㄥ崟椤瑰睘鎬э紝鎺т欢灞炴�ч潰鏉�
@@ -13,172 +13,231 @@
   <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="鑺傜偣ID" name="鑺傜偣ID">
-        <Input :style="{ width: '100%' }" v-model:value="routeConfig.currentAct.NODE_ID" :min="0" :step="1"
-          :readonly="true" />
+        <Input
+          :style="{ width: '100%' }"
+          v-model:value="routeConfig.currentAct.NODE_ID"
+          :min="0"
+          :step="1"
+          :readonly="true"
+        />
       </FormItem>
       <FormItem label="琛屼负鍚嶇О" name="琛屼负鍚嶇О">
-        <Input :style="{ width: '100%' }" v-model:value="routeConfig.currentAct.ACT_NAME" :min="0" :step="1" />
+        <Input
+          :style="{ width: '100%' }"
+          v-model:value="routeConfig.currentAct.ACT_NAME"
+          :min="0"
+          :step="1"
+        />
       </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="璇烽�夋嫨琛屼负绫诲瀷" />
+        <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="鑷畾涔夋柟娉�">
-        <Input :style="{ width: '85%' }" v-model:value="routeConfig.currentAct.ACT_CODE" :min="0" :step="1" />
-        <a-button class="mt-1 ml-1" size="small" @click="handleSelectItem(item)" preIcon="search|svg" />
-        <NormalModal @register="registerItemAdd" @success="handleItemSuccess" />
+      <FormItem label="琛屼负瀹氫箟" name="琛屼负瀹氫箟">
+        <Input
+          :style="{ width: '85%' }"
+          v-model:value="routeConfig.currentAct.ACT_CODE"
+          :min="0"
+          :step="1"
+        />
+        <a-button
+          class="mt-1 ml-1"
+          size="small"
+          @click="handleSelectItem(item)"
+          preIcon="search|svg"
+        />
+        <GeneralModal @register="registerItemAdd" @success="handleItemSuccess" />
       </FormItem>
       <FormItem label="鏄惁璁剧疆鎵嶈兘涓嬪彂鐢熶骇(Y/N)" name="鏄惁璁剧疆鎵嶈兘涓嬪彂鐢熶骇(Y/N)">
-        <Select ref="select" v-model:value="routeConfig.currentAct.NEED_SETUP" style="width: 150px"
-          :options="needSetupOptions" />
+        <Select
+          ref="select"
+          v-model:value="routeConfig.currentAct.NEED_SETUP"
+          style="width: 150px"
+          :options="needSetupOptions"
+        />
+      </FormItem>
+      <FormItem label="鎵ц鍑洪敊鏃讹紝鏄惁閲嶇疆鏁翠釜宸ュ簭鐨勬搷浣�(Y/N)" name="鎵ц鍑洪敊鏃讹紝鏄惁閲嶇疆鏁翠釜宸ュ簭鐨勬搷浣�(Y/N)">
+        <Select
+          ref="select"
+          v-model:value="routeConfig.currentAct.NEED_RESET"
+          style="width: 150px"
+          :options="needResetOptions"
+        />
       </FormItem>
       <FormItem label="鏄惁鍚敤" name="鏄惁鍚敤">
-        <Select ref="select" v-model:value="routeConfig.currentAct.IS_ACTIVE" style="width: 150px"
-          :options="options1" />
+        <Select
+          ref="select"
+          v-model:value="routeConfig.currentAct.IS_ACTIVE"
+          style="width: 150px"
+          :options="options1"
+        />
       </FormItem>
     </Form>
   </div>
 </template>
 <script lang="ts" setup>
-import { Select, Input, Form, FormItem, Tag } from 'ant-design-vue';
-import { useRouteDesignState } from '../hooks/useRouteDesignState';
-import NormalModal from '/@/views/components/NormalModal.vue';
-import { SelectTypes } from 'ant-design-vue/es/select';
-import { ApiSelect } from '/@/components/Form/index';
-import { h, ref, unref, watch } from 'vue';
-import { useLocale } from '/@/locales/useLocale';
-import { GetEnum } from '/@/api/tigerapi/system';
-import { useModal } from '/@/components/Modal';
-import { useI18n } from '/@/hooks/web/useI18n';
+  import { Select, Input, Form, FormItem, Tag } from 'ant-design-vue';
+  import { useRouteDesignState } from '../hooks/useRouteDesignState';
+  import GeneralModal from '/@/views/components/GeneralModal.vue';
+  import { SelectTypes } from 'ant-design-vue/es/select';
+  import { ApiSelect } from '/@/components/Form/index';
+  import { h, ref, unref, watch } from 'vue';
+  import { useLocale } from '/@/locales/useLocale';
+  import { GetEnum } from '/@/api/tigerapi/system';
+  import { useModal } from '/@/components/Modal';
+  import { useI18n } from '/@/hooks/web/useI18n';
 
-const { getLocale } = useLocale();
-const { t } = useI18n();
-const emit = defineEmits(['changeName']);
-const [registerItemAdd, { openModal: openItemModal }] = useModal();
-const { routeConfig, mesRoute } = useRouteDesignState();
-const options1 = ref<SelectTypes['options']>([
-  {
-    value: 'Y',
-    label: '鍚敤',
-  },
-  {
-    value: 'N',
-    label: '涓嶅惎鐢�',
-  },
-]);
-const needSetupOptions = ref<SelectTypes['options']>([
-  {
-    value: 'Y',
-    label: '蹇呴渶璁剧疆',
-  },
-  {
-    value: 'N',
-    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) {
-        if (r.ACT_NAME != newVal.ACT_NAME) {
-          r.ACT_NAME = newVal.ACT_NAME;
-          console.log(r.ACT_NAME, newVal.ACT_NAME);
-          emit('changeName', { id: r.ID, val: r.ACT_NAME });
-        }
-        r.IS_ACTIVE = newVal.IS_ACTIVE;
-        r.ACT_TYPE = newVal.ACT_TYPE;
-        r.ACT_CODE = newVal.ACT_CODE;
-        r.NEED_SETUP = newVal.NEED_SETUP;
-        // 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 },
-);
-
-function handleSelectItem(item) {
-  openItemModal(true, {
-    title: '宸ュ簭琛屼负瀹氫箟',
-    schemas: [
-      {
-        field: 'ACT_CODE',
-        component: 'Input',
-        label: '琛屼负缂栫爜',
-        colProps: {
-          span: 12,
-        },
-      },
-    ],
-    ItemColumns: [
-      {
-        title: t('琛屼负缂栫爜'),
-        dataIndex: 'ACT_CODE',
-        resizable: true,
-        sorter: true,
-        width: 100,
-      },
-      {
-        title: t('琛屼负鍚嶇О'),
-        dataIndex: 'ACT_NAME',
-        resizable: true,
-        sorter: true,
-        width: 100,
-      },
-      {
-        title: t('琛屼负绫诲瀷'),
-        dataIndex: 'ACT_TYPE',
-        resizable: true,
-        sorter: true,
-        width: 100,
-        customRender: ({ record }) => {
-          const type = record.ACT_TYPE;
-          var text = '';
-          var color = 'green';
-          switch (type) {
-            case 0:
-              text = '榛樿琛屼负';
-              break;
-            case 1:
-              color = 'orange';
-              text = '鎵爜楠岃瘉';
-              break;
-            case 2:
-              color = 'blue';
-              text = '缁勮涓婃枡';
-              break;
-            case 3:
-              color = '#24c7cf';
-              text = '浜у搧娴嬭瘯';
-              break;
-            case 4:
-              color = '#550689';
-              text = '浜у搧鎶芥';
-              break;
-            case 5:
-              color = '#bfbfbf';
-              text = '鏍囩鎵撳嵃';
-              break;
+  const { getLocale } = useLocale();
+  const { t } = useI18n();
+  const emit = defineEmits(['changeName']);
+  const [registerItemAdd, { openModal: openItemModal }] = useModal();
+  const { routeConfig, mesRoute } = useRouteDesignState();
+  const options1 = ref<SelectTypes['options']>([
+    {
+      value: 'Y',
+      label: '鍚敤',
+    },
+    {
+      value: 'N',
+      label: '涓嶅惎鐢�',
+    },
+  ]);
+  const needSetupOptions = ref<SelectTypes['options']>([
+    {
+      value: 'Y',
+      label: '蹇呴渶璁剧疆',
+    },
+    {
+      value: 'N',
+      label: '鏃犻渶璁剧疆',
+    },
+  ]);
+  const needResetOptions = ref<SelectTypes['options']>([
+    {
+      value: 'Y',
+      label: '鏄�',
+    },
+    {
+      value: 'N',
+      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) {
+          if (r.ACT_NAME != newVal.ACT_NAME) {
+            r.ACT_NAME = newVal.ACT_NAME;
+            console.log(r.ACT_NAME, newVal.ACT_NAME);
+            emit('changeName', { id: r.ID, val: r.ACT_NAME });
           }
-          return h(Tag, { color: color }, () => text);
-        },
-      },
-    ],
-    tableName: 'MES_CUSTOM_ACT',
-    rowKey: 'ACT_CODE',
-    searchInfo: {TABLE_NAME: 'MES_CUSTOM_ACT', ACT_TYPE: routeConfig.currentAct.ACT_TYPE}
-  });
-}
+          r.IS_ACTIVE = newVal.IS_ACTIVE;
+          r.ACT_TYPE = newVal.ACT_TYPE;
+          r.ACT_CODE = newVal.ACT_CODE;
+          r.NEED_SETUP = newVal.NEED_SETUP;
+          r.NEED_RESET = newVal.NEED_RESET;
+          // 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 },
+  );
 
-function handleItemSuccess(d, u) {
-  routeConfig.currentAct.ACT_CODE = d.values['val']
-}
+  function handleSelectItem(item) {
+    openItemModal(true, {
+      title: '宸ュ簭琛屼负瀹氫箟',
+      schemas: [
+        {
+          field: 'ACT_CODE',
+          component: 'Input',
+          label: '琛屼负缂栫爜',
+          colProps: {
+            span: 12,
+          },
+        },
+      ],
+      ItemColumns: [
+        {
+          title: t('琛屼负缂栫爜'),
+          dataIndex: 'ACT_CODE',
+          resizable: true,
+          sorter: true,
+          width: 100,
+        },
+        {
+          title: t('琛屼负鍚嶇О'),
+          dataIndex: 'ACT_NAME',
+          resizable: true,
+          sorter: true,
+          width: 100,
+        },
+        {
+          title: t('琛屼负绫诲瀷'),
+          dataIndex: 'ACT_TYPE',
+          resizable: true,
+          sorter: true,
+          width: 100,
+          customRender: ({ record }) => {
+            const type = record.ACT_TYPE;
+            var text = '';
+            var color = 'green';
+            switch (type) {
+              case 0:
+                text = '榛樿琛屼负';
+                break;
+              case 1:
+                color = 'orange';
+                text = '鎵爜楠岃瘉';
+                break;
+              case 2:
+                color = 'blue';
+                text = '缁勮涓婃枡';
+                break;
+              case 3:
+                color = '#24c7cf';
+                text = '浜у搧娴嬭瘯';
+                break;
+              case 4:
+                color = '#550689';
+                text = '浜у搧鎶芥';
+                break;
+              case 5:
+                color = '#bfbfbf';
+                text = '鏍囩鎵撳嵃';
+                break;
+            }
+            return h(Tag, { color: color }, () => text);
+          },
+        },
+      ],
+      tableName: 'MES_CUSTOM_ACT',
+      rowKey: 'ACT_CODE',
+      searchInfo: { TABLE_NAME: 'MES_CUSTOM_ACT', ACT_TYPE: routeConfig.currentAct.ACT_TYPE },
+    });
+  }
+
+  function handleItemSuccess(d, u) {
+    routeConfig.currentAct.ACT_CODE = d.values['val'];
+  }
 </script>

--
Gitblit v1.9.3