From 8099042b51891d1e58d6066f0247ba423f4457bd Mon Sep 17 00:00:00 2001
From: yyg1378265336 <1378265336@qq.com>
Date: 星期四, 27 二月 2025 09:27:17 +0800
Subject: [PATCH] Merge branch 'master' of http://47.115.28.255:8110/r/TigerClouds-Tech/BS/TigerAdmin_2024

---
 src/views/tigerprojects/system/lowcode/entityts/MES_TOOL_PROP.ts |  353 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 353 insertions(+), 0 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
new file mode 100644
index 0000000..aa4fcbb
--- /dev/null
+++ b/src/views/tigerprojects/system/lowcode/entityts/MES_TOOL_PROP.ts
@@ -0,0 +1,353 @@
+/*
+ * @Description: 鐢熶骇宸ュ叿淇℃伅
+ * @Author: Ben Lin
+ * @version:
+ * @Date: 2024-06-19 20:34:27
+ * @LastEditors: Ben Lin
+ * @LastEditTime: 2024-07-04 11:21:28
+ */
+
+import { Ref, h, unref } from 'vue';
+import { DeleteEntity, GetEnum, getEntity } from '/@/api/tigerapi/system';
+import { ActionItem, BasicColumn, FormSchema, useTable } from '/@/components/Table';
+import { isNullOrEmpty, isNullOrUnDef } from '/@/utils/is';
+import { buildUUID } from '/@/utils/uuid';
+import { useUserStore } from '/@/store/modules/user';
+import { formatToDateTime } from '/@/utils/dateUtil';
+import { Tag } from 'ant-design-vue';
+import { useLocale } from '/@/locales/useLocale';
+import { useDrawer } from '/@/components/Drawer';
+import { EditOperation, Search, custDel } from '../data';
+
+const { getLocale } = useLocale();
+function _default() {
+  const ActionColumn: BasicColumn = {
+    width: 80,
+    title: '鎿嶄綔',
+    dataIndex: 'action',
+    slots: { customRender: 'action' },
+    fixed: undefined,
+  };
+  
+  /**
+   * @description: 浜涜嚜瀹氫箟鏂规硶
+   * @return {*}
+   */
+  const methods = {
+    /**
+     * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓�
+     * @return {*}
+     */
+    CreateAction: (type: string) => {
+      return {
+        action: 'drawer', //drawer(鎵撳紑宸︿晶鎶藉眽妗�) | go(璺宠浆鍒版柊鐨勯〉闈�)
+      };
+    },
+    /**
+     * @description: 鎿嶄綔瀛楁鑷畾涔夋寜閽�
+     * @return {*}
+     */
+    ActionItem: (params: Recordable<any>, data, ...args): ActionItem[] => {
+      if (!isNullOrUnDef(data[1])) {
+        data[1].popConfirm.confirm = custDel.bind(null, args, params);
+      }
+      return data;
+    },
+    /**
+     * @description: 楂樼骇琛ㄥ崟鍜岃鎯呴〉闈㈣繑鍥炰富椤甸潰鐨剈rl
+     * @return {*}
+     */
+    GetHomeUrl: () => {
+      const param = { ID: 'MES_TOOL_PROP', colSlots: [], crudColSlots: [] };
+      return `/MES_TOOL_PROP/LC/${encodeURI(JSON.stringify(param))}`;
+    },
+    GetBaseColumns: (type: string) => {
+      return baseColumns[type];
+    },
+    GetSearchForm: (type: string) => {
+      return searchForms[type];
+    },
+    GetCrudForm: (type: string) => {
+      return crudForms[type];
+    },
+    //涓昏〃 鐢熶骇宸ュ叿淇℃伅
+    GetBaseForm: () => {
+      return [
+        {
+          field: 'TOOL_CODE',
+          label: '宸ュ叿缂栫爜',
+          component: 'Input',
+          required: true,
+          colProps: {
+            span: 8,
+          },
+        },
+        {
+          label: '宸ュ叿鍨嬪彿',
+          field: 'TOOL_MODEL',
+          required: true,
+          component: 'Input',
+          colProps: {
+            span: 8,
+          },
+        },
+        {
+          label: '宸ュ叿瑙勬牸',
+          field: 'TOOL_SPEC',
+          required: true,
+          component: 'Input',
+          colProps: {
+            span: 8,
+          },
+        },
+        {
+          label: '宸ュ叿绫诲瀷',
+          field: 'TOOL_TYPE',
+          required: true,
+          component: 'Input',
+          colProps: {
+            span: 8,
+          },
+        },
+        {
+          label: '杞﹂棿缂栫爜',
+          field: 'WS_CODE',
+          required: true,
+          component: 'Input',
+          colProps: {
+            span: 8,
+          },
+        },
+        {
+          label: '澶囨敞',
+          field: 'REMARK',
+          component: 'Input',
+          colProps: {
+            span: 8,
+          },
+        },
+        {
+          label: 'ID',
+          field: 'ID',
+          component: 'Input',
+          colProps: {
+            span: 8,
+          },
+          show: false,
+        },
+      ];
+    },
+    /**
+     * @description: 鑾峰彇鍗$墖鍐呴厤缃垪琛紝浠ュ惊鐜樉绀哄涓崱鐗囧苟閰嶇疆澶氫釜鎻掓Ы
+     * @return {*}
+     */    
+    GetBaseCards: (type: string) => {
+      return [
+        {
+          name: 'BaseForm',
+          slots: [],
+          preIcons: {},
+          title: '鐢熶骇宸ュ叿淇℃伅',
+          entityName: 'MES_TOOL_PROP',
+        },
+        // {
+        //   name: 'prodinfo',
+        //   slots: ['addRot', 'setRot'],
+        //   preIcons: { addRot: 'search|svg', setRot: 'config|svg' },
+        //   title: '浜у搧淇℃伅',
+        // },
+        // { name: 'rotinfo', slots: ['add'], preIcons: { add: 'search|svg' }, title: '宸ヨ壓淇℃伅' },
+      ];
+    },
+    /**
+     * @description: 鑾峰彇鍙充晶杈规use鏂规硶
+     * @return {*}
+     */    
+    GetUseDrawers: () => {
+      return [{
+        'MES_TOOL_PROP': useDrawer(),
+      }];
+    },
+    /**
+     * @description: 鑾峰彇琛ㄦ牸use鍒楄〃
+     * @param {string} type
+     * @param {array} args
+     * @return {*}
+     */    
+    GetUseTables: (data: Ref<{}>, ...args) => {
+      return {
+        MES_TOOL_PROP: useTable({
+          title: '鍒楄〃淇℃伅',
+          dataSource: data.value['MES_TOOL_PROP'],
+          columns: baseColumns['MES_TOOL_PROP'],
+          formConfig: {
+            labelWidth: 140,
+            schemas: searchForms['MES_TOOL_PROP'],
+            submitFunc: () => Search('MES_TOOL_PROP', data, args[0]), //鑷畾涔夋煡璇㈡彁浜ゆ寜閽殑鏂规硶锛岃Е鍙戞煡璇㈡彁浜や簨浠�
+          },
+          useSearchForm: true,
+          showTableSetting: false,
+          bordered: true,
+          canResize: true,
+          showIndexColumn: false,
+          actionColumn: {
+            width: 130,
+            title: '鎿嶄綔',
+            dataIndex: 'action',
+            slots: { customRender: 'action' },
+            fixed: 'right',
+          }, //鑷畾涔夋搷浣滃垪
+        })
+      };
+    },
+    /**
+     * @description: 琛ㄦ牸鏌ヨ鍥炶皟锛岀埗缁勪欢涓�氳繃瀛愮粍浠惰Е鍙戠殑浜嬩欢鑾峰彇浼犲叆鐨勫�硷紝鍋氬叿浣撶殑鏌ヨ閫昏緫瀹炵幇
+     * @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,
+          );
+          if (isNullOrEmpty(d.values.DFT_CODE) && isNullOrEmpty(d.values.DFT_NAME)) {
+            data = d.data.value[d.type];
+          }
+          break;
+      }
+      return data;
+    },
+    KeyFieldValues: (val: string, id: string) => {
+      return { DFTG_CODE: val };
+    } /**
+     * @description: 鑷畾涔夋槑缁嗚〃涓紪杈戣繑鍥炴柟娉�
+     * @param {string} type
+     * @param {*} d
+     * @param {*} u
+     * @return {*}
+     */,
+    EditOperation: (data: Ref<any[]>, d, u, item) => {
+      //鏇存柊
+      var _data = data.value[item].map((item) => {
+        if (item['ID'] == d.ID)
+          return {
+            ...item,
+            DFT_CODE: d.DFT_CODE,
+            DFT_NAME: d.DFT_NAME,
+            DFT_LEVEL: d.DFT_LEVEL,
+            REMARK: d.REMARK,
+          };
+        return item;
+      });
+      EditOperation(data,d, u, item, _data);
+    },
+    /**
+     * @description: 鑾峰彇鏍囬淇℃伅
+     * @param {string} type
+     * @return {*}
+     */
+    GetTitle: () => {
+      return {
+        pageTitle: '鐢熶骇宸ュ叿绠$悊',
+        pageContent: '杩欓噷鍙互娣诲姞鍜屼慨鏀圭敓浜у伐鍏风鐞嗗拰鐢熶骇宸ュ叿灞炴�х鐞嗐��',
+        tableTitle: {
+          MES_TOOL_PROP: '鐢熶骇宸ュ叿绠$悊',
+        }
+      };
+    },
+    GetUseForm: () => {
+      return {};
+    },
+  };
+
+  /* 浠ヤ笅鏄唴閮ㄦ柟娉曪紝涓峞xport锛屼緵涓婇潰鐨勬柟娉曡皟鐢� */
+  // 鍒楄〃
+  const baseColumns = {
+    MES_TOOL_PROP: [
+      {
+        title: '宸ュ叿缂栫爜',
+        dataIndex: 'TOOL_CODE',
+      },
+      {
+        title: '鐐规椤圭洰鍚嶇О',
+        dataIndex: 'PROP_NAME',
+      },
+      {
+        title: '澶囨敞',
+        dataIndex: 'REMARK',
+      },
+      {
+        title: '鏇存柊鏃堕棿',
+        dataIndex: 'UPDATE_TIME',
+      },
+      {
+        title: '鏇存柊浜�',
+        dataIndex: 'UPDATE_USER',
+      },
+    ]
+  }
+
+  const searchForms = {
+    MES_TOOL_PROP: [
+      {
+        label: '鐐规椤圭洰鍚嶇О',
+        field: 'PROP_NAME',
+        component: 'Input',
+        colProps: {
+          span: 8,
+        },
+      },
+    ] as FormSchema[],
+  }
+  //鍒楄〃淇℃伅 --鏂板
+  const crudForms = {
+    MES_TOOL_PROP: [
+      {
+        field: 'TOOL_CODE',
+        label: '宸ュ叿缂栫爜',
+        component: 'Input',
+        required: true,
+        colProps: {
+          span: 24,
+        },
+        //鍙
+        dynamicDisabled: ({ values }) => {
+          return true;
+        },
+      },
+      {
+        label: '鐐规椤圭洰鍚嶇О',
+        field: 'PROP_NAME',
+        component: 'Input',
+        required: true,
+        colProps: {
+          span: 24,
+        },
+      },
+      {
+        label: '澶囨敞',
+        field: 'REMARK',
+        component: 'Input',
+        colProps: {
+          span: 24,
+        },
+      },
+      {
+        label: 'ID',
+        field: 'ID',
+        component: 'Input',
+        colProps: {
+          span: 24,
+        },
+        show: false,
+      },
+    ] as FormSchema[],
+  }
+
+  return [methods, ActionColumn];
+}
+
+export default _default;

--
Gitblit v1.9.3