From 858b9bccead46cdefc99325b7c956d50a2964309 Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期六, 08 三月 2025 10:20:28 +0800
Subject: [PATCH] 一些优化

---
 src/views/tigerprojects/system/lowcode/entityts/MES_TOOL_PROP.ts |  228 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 216 insertions(+), 12 deletions(-)

diff --git a/src/views/tigerprojects/system/lowcode/entityts/MES_TOOL_PROP.ts b/src/views/tigerprojects/system/lowcode/entityts/MES_TOOL_PROP.ts
index f6e60c8..529e304 100644
--- a/src/views/tigerprojects/system/lowcode/entityts/MES_TOOL_PROP.ts
+++ b/src/views/tigerprojects/system/lowcode/entityts/MES_TOOL_PROP.ts
@@ -58,8 +58,8 @@
      * @return {*}
      */
     GetHomeUrl: () => {
-      const param = { ID: 'MES_TOOL_PROP', colSlots: [], crudColSlots: [] };
-      return `/MES_TOOL_PROP/LC/${encodeURI(JSON.stringify(param))}`;
+      const param = { ID: 'MES_TOOL',EntityName: 'MES_TOOL', colSlots: [], crudColSlots: [] };
+      return `/MES_TOOL/LC/${encodeURI(JSON.stringify(param))}`;
     },
     GetBaseColumns: (type: string) => {
       return baseColumns[type];
@@ -71,7 +71,7 @@
       return crudForms[type];
     },
     //涓昏〃 鐢熶骇宸ュ叿淇℃伅
-    GetBaseForm: () => {
+    GetBaseForm: (entityName:string, isedit: boolean) => {
       return [
         {
           field: 'TOOL_CODE',
@@ -80,6 +80,9 @@
           required: true,
           colProps: {
             span: 8,
+          },
+          dynamicDisabled: ({ values }) => {
+            return isedit? true: false;
           },
         },
         {
@@ -110,9 +113,115 @@
           },
         },
         {
+          label: '璁惧鐘舵��',
+          field: 'STATUS',
+          component: 'ApiSelect',
+          colProps: { span: 8 },
+          defaultValue: 0,
+          componentProps: {
+            api: GetEnum,
+            params: { name: 'MES_TOOL+STATUSs' },
+            resultField: 'Data',
+            labelField: unref(getLocale) == 'zh_CN' ? 'Desc' : 'Name',
+            valueField: 'Value',
+            // onChange: (e, v) => {
+            //   alert(e)
+            //   console.log('ApiSelect====>:', e, v);
+            // },
+          },
+        },
+        {
+          label: '鐢熶骇鍘傚',
+          field: 'MFT_NAME',
+          component: 'Input',
+          colProps: {
+            span: 8,
+          },
+        },
+        {
+          label: '鐢熶骇鏃ユ湡',
+          field: 'MFT_DATE',
+          component: 'DatePicker',
+          colProps: {
+            span: 8,
+          },
+        },
+        {
+          label: '浣跨敤閮ㄩ棬',
+          field: 'USE_DEPT',
+          component: 'Input',
+          colProps: {
+            span: 8,
+          },
+        },
+        {
+          label: '宸ュ巶缂栫爜',
+          field: 'FTY_CODE',
+          required: true,
+          component: 'ApiSelect',
+          colProps: {
+            span: 8,
+          },
+          componentProps: {
+            api: getEntity,
+            params: { entityName: 'MES_FACTORY', sqlcmd: ' 1=1 ' },
+            resultField: 'Data.Items',
+            labelField: 'FTY_NAME',
+            valueField: 'FTY_CODE',
+          },
+          // dynamicDisabled: ({ values }) => {
+          //   return true;
+          // },
+        },
+        {
           label: '杞﹂棿缂栫爜',
           field: 'WS_CODE',
           required: true,
+          component: 'ApiSelect',
+          colProps: {
+            span: 8,
+          },
+          componentProps: {
+            api: getEntity,
+            params: { entityName: 'MES_WORKSHOP', sqlcmd: ' 1=1 ' },
+            resultField: 'Data.Items',
+            labelField: 'WS_NAME',
+            valueField: 'WS_CODE',
+          },
+          // dynamicDisabled: ({ values }) => {
+          //   return true;
+          // },
+        },
+        {
+          label: '浜х嚎缂栫爜',
+          field: 'LINE_CODE',
+          required: true,
+          component: 'ApiSelect',
+          colProps: {
+            span: 8,
+          },
+          componentProps: {
+            api: getEntity,
+            params: { entityName: 'MES_LINE', sqlcmd: ' 1=1 ' },
+            resultField: 'Data.Items',
+            labelField: 'LINE_NAME',
+            valueField: 'LINE_CODE',
+          },
+          // dynamicDisabled: ({ values }) => {
+          //   return true;
+          // },
+        },
+        {
+          label: '浣跨敤鍦扮偣',
+          field: 'LOCATION',
+          component: 'Input',
+          colProps: {
+            span: 8,
+          },
+        },
+        {
+          label: '浣跨敤娆℃暟涓婇檺',
+          field: 'USE_LIMIT',
           component: 'Input',
           colProps: {
             span: 8,
@@ -148,7 +257,7 @@
           slots: [],
           preIcons: {},
           title: '鐢熶骇宸ュ叿淇℃伅',
-          entityName: 'MES_TOOL_PROP',
+          entityName: 'MES_TOOL',
         },
         // {
         //   name: 'prodinfo',
@@ -183,7 +292,7 @@
           formConfig: {
             labelWidth: 140,
             schemas: searchForms['MES_TOOL_PROP'],
-            submitFunc: () => Search('MES_TOOL_PROP', data, args[0]), //鑷畾涔夋煡璇㈡彁浜ゆ寜閽殑鏂规硶锛岃Е鍙戞煡璇㈡彁浜や簨浠�
+            submitFunc: () => Search('PROP_NAME', data, args[0]), //鑷畾涔夋煡璇㈡彁浜ゆ寜閽殑鏂规硶锛岃Е鍙戞煡璇㈡彁浜や簨浠�
           },
           useSearchForm: true,
           showTableSetting: false,
@@ -205,23 +314,25 @@
      * @param {*} d
      * @return {*}
      */
+    //鎻愪氦鏌ヨ
     FormSearch: (d) => {
       let data = {} as any;
       switch (d.type) {
         case 'MES_TOOL_PROP':
           data = d.data.value[d.type].filter(
             (item) =>
-              item.DFT_CODE.includes(d.values.DFT_CODE) || item.DFT_NAME == d.values.DFT_NAME,
+              item.TOOL_CODE.includes(d.values.TOOL_CODE) || item.PROP_NAME == d.values.PROP_NAME,
           );
-          if (isNullOrEmpty(d.values.DFT_CODE) && isNullOrEmpty(d.values.DFT_NAME)) {
+          if (isNullOrEmpty(d.values.TOOL_CODE) && isNullOrEmpty(d.values.PROP_NAME)) {
             data = d.data.value[d.type];
           }
           break;
       }
       return data;
     },
+    //
     KeyFieldValues: (val: string, id: string) => {
-      return { DFTG_CODE: val };
+      return { TOOL_CODE: val };
     } /**
      * @description: 鑷畾涔夋槑缁嗚〃涓紪杈戣繑鍥炴柟娉�
      * @param {string} type
@@ -235,9 +346,9 @@
         if (item['ID'] == d.ID)
           return {
             ...item,
-            DFT_CODE: d.DFT_CODE,
-            DFT_NAME: d.DFT_NAME,
-            DFT_LEVEL: d.DFT_LEVEL,
+            TOOL_CODE: d.TOOL_CODE,
+            PROP_NAME: d.PROP_NAME,
+           // DFT_LEVEL: d.DFT_LEVEL,
             REMARK: d.REMARK,
           };
         return item;
@@ -313,12 +424,13 @@
         colProps: {
           span: 24,
         },
+        //鍙
         dynamicDisabled: ({ values }) => {
           return true;
         },
       },
       {
-        label: '鐐规椤圭洰鍚嶇О',
+        label: '宸ュ叿灞炴�у悕绉�',
         field: 'PROP_NAME',
         component: 'Input',
         required: true,
@@ -327,6 +439,98 @@
         },
       },
       {
+        label: '灞曠ず鐨勬帶浠�',
+        field: 'PROP_CONTROL',
+        component: 'Input',
+        colProps: {
+          span: 24,
+        },
+      },
+      {
+        field: 'VALUE_TYPE',
+        label: '灞炴�у�肩被鍨�',
+        component: 'ApiSelect',
+        colProps: { span: 12 },
+        defaultValue: 0,
+        componentProps: {
+          api: GetEnum,
+          params: { name: 'MES_TOOL_PROP+VALUE_TYPEs' },
+          resultField: 'Data',
+          labelField: unref(getLocale) == 'zh_CN' ? 'Desc' : 'Name',
+          valueField: 'Value',
+          // onChange: (e, v) => {
+          //   alert(e)
+          //   console.log('ApiSelect====>:', e, v);
+          // },
+        },
+      },
+      {
+        label: '鏄惁鍙(Y/N)',
+        field: 'READONLY',
+        component: 'Select',
+        colProps: {
+          span: 24,
+        },
+        componentProps: {
+          options: [
+            {
+              label: '鏄�',
+              value: 'Y',
+              key: 'Y',
+            },
+            {
+              label: '鍚�',
+              value: 'N',
+              key: 'N',
+            },
+          ],
+        },
+      },
+      {
+        label: '鏄惁鏄剧ず(Y/N)',
+        field: 'VISIABLE',
+        component: 'Select',
+        colProps: {
+          span: 24,
+        },
+        componentProps: {
+          options: [
+            {
+              label: '鏄�',
+              value: 'Y',
+              key: 'Y',
+            },
+            {
+              label: '鍚�',
+              value: 'N',
+              key: 'N',
+            },
+          ],
+        },
+      },
+      {
+        label: '鏄惁蹇呭~(Y/N)',
+        field: 'NECESSARY',
+        component: 'Select',
+        colProps: {
+          span: 24,
+        },
+        componentProps: {
+          options: [
+            {
+              label: '鏄�',
+              value: 'Y',
+              key: 'Y',
+            },
+            {
+              label: '鍚�',
+              value: 'N',
+              key: 'N',
+            },
+          ],
+        },
+      },
+      {
         label: '澶囨敞',
         field: 'REMARK',
         component: 'Input',

--
Gitblit v1.9.3