From 25f128f26f0330b5431e5513c16ea035ce46099a Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期日, 21 七月 2024 21:00:41 +0800
Subject: [PATCH] 工单更新

---
 src/views/tigerprojects/system/lowcode/entityts/MES_SHIFT.ts |  913 +++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 693 insertions(+), 220 deletions(-)

diff --git a/src/views/tigerprojects/system/lowcode/entityts/MES_SHIFT.ts b/src/views/tigerprojects/system/lowcode/entityts/MES_SHIFT.ts
index 751365f..93073b2 100644
--- a/src/views/tigerprojects/system/lowcode/entityts/MES_SHIFT.ts
+++ b/src/views/tigerprojects/system/lowcode/entityts/MES_SHIFT.ts
@@ -4,21 +4,23 @@
  * @version:
  * @Date: 2024-06-19 20:34:27
  * @LastEditors: Ben Lin
- * @LastEditTime: 2024-07-01 12:33:25
+ * @LastEditTime: 2024-07-04 23:53:48
  */
 
-import { Ref, h, unref } from 'vue';
-import { DeleteEntity, GetEnum, getEntity } from '/@/api/tigerapi/system';
-import { ActionItem, BasicColumn } from '/@/components/Table';
+import { Ref, h, ref, unref } from 'vue';
+import { AddAfterDelete, 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 } from '../data';
+import { convertTimeToDate, dateUtil, formatTime, intToTime, tsToHHmm } from '/@/utils/dateUtil';
+import { buildUUID } from '/@/utils/uuid';
 
 const { getLocale } = useLocale();
 function _default() {
+  let _data = ref<any>({});
   const ActionColumn: BasicColumn = {
     width: 80,
     title: '鎿嶄綔',
@@ -59,186 +61,15 @@
       const param = { ID: 'MES_SHIFT_SYS', colSlots: [], crudColSlots: [] };
       return `/MES_SHIFT_SYS/LC/${encodeURI(JSON.stringify(param))}`;
     },
-    GetBaseColumns: () => {
-      return [
-        {
-          title: '鐝缂栫爜',
-          dataIndex: 'SFT_CODE',
-          // ifShow: false,
-          width: 180,
-        },
-        {
-          title: '鐝鍚嶇О',
-          dataIndex: 'SFT_NAME',
-        },
-        {
-          title: '鐝埗缂栫爜',
-          dataIndex: 'SFTS_CODE',
-        },
-        {
-          title: '鐝寮�濮嬫椂闂�',
-          dataIndex: 'SFT_BEGIN',
-        },
-        {
-          title: '鐝缁撴潫鏃堕棿',
-          dataIndex: 'SFT_END',
-        },
-        {
-          title: '鏄惁璺ㄥぉ',
-          dataIndex: 'IS_ACROSS_DAY',
-          customRender: ({ record }) => {
-            const type = record.IS_ACROSS_DAY;
-            var text = '';
-            var color = 'green';
-            switch (type) {
-              case 'Y':
-                text = '鏄�';
-                break;
-              case 'N':
-                color = 'blue';
-                text = '鍚�';
-                break;
-            }
-            return h(Tag, { color: color }, () => text);
-          },
-        },
-        {
-          title: '澶囨敞',
-          dataIndex: 'REMARK',
-        },
-        {
-          title: '鏇存柊鏃堕棿',
-          dataIndex: 'UPDATE_TIME',
-        },
-        {
-          title: '鏇存柊浜�',
-          dataIndex: 'UPDATE_USER',
-        },
-      ];
+    GetBaseColumns: (type: string) => {
+      return baseColumns[type];
     },
-    GetSearchForm: () => {
-      return [
-        {
-          field: 'SFT_CODE',
-          label: '鐝缂栫爜',
-          component: 'Input',
-          colProps: {
-            span: 8,
-          },
-        },
-        {
-          label: '鐝鍚嶇О',
-          field: 'SFT_NAME',
-          component: 'Input',
-          colProps: {
-            span: 8,
-          },
-        },
-      ];
+    GetSearchForm: (type: string) => {
+      return searchForms[type];
     },
-    GetCrudForm: () => {
-      return [
-        {
-          field: 'SFT_CODE',
-          label: '鐝缂栫爜',
-          component: 'Input',
-          required: true,
-          colProps: {
-            span: 24,
-          },
-        },
-        {
-          label: '鐝鍚嶇О',
-          field: 'SFT_NAME',
-          component: 'Input',
-          required: true,
-          colProps: {
-            span: 24,
-          },
-        },
-        {
-          label: '鐝埗缂栫爜',
-          field: 'SFTS_CODE',
-          component: 'ApiSelect',
-          colProps: {
-            span: 24,
-          },
-          componentProps: {
-            api: getEntity,
-            params: { entityName: 'MES_SHIFT_SYS', sqlcmd: ' 1=1 ' },
-            resultField: 'Data.Items',
-            labelField: 'SFTS_NAME',
-            valueField: 'SFTS_CODE',
-          },
-          dynamicDisabled: ({ values }) => {
-            return true;
-          },
-        },
-        {
-          label: '鐝寮�濮嬫椂闂�',
-          field: 'SFT_BEGIN',
-          component: 'Input',
-          colProps: {
-            span: 24,
-          },
-        },
-        {
-          label: '鐝缁撴潫鏃堕棿',
-          field: 'SFT_END',
-          component: 'Input',
-          colProps: {
-            span: 24,
-          },
-        },
-        {
-          label: '鏄惁璺ㄥぉ',
-          field: 'IS_ACROSS_DAY',
-          component: 'Select',
-          required: true,
-          colProps: {
-            span: 24,
-          },
-          componentProps: {
-            options: [
-              {
-                label: '鏄�',
-                value: 'Y',
-                key: 'Y',
-              },
-              {
-                label: '鍚�',
-                value: 'N',
-                key: 'N',
-              },
-            ],
-          },
-        },
-        // {
-        //   field: 'LOGIN_TIME',
-        //   label: '鐧诲綍鏃堕棿',
-        //   defaultValue: '',
-        //   component: 'RangePicker',
-        //   ifShow: true,
-        //   colProps: { span: 8 },
-        // },
-        {
-          label: '澶囨敞',
-          field: 'REMARK',
-          component: 'Input',
-          colProps: {
-            span: 24,
-          },
-        },
-        {
-          label: 'ID',
-          field: 'ID',
-          component: 'Input',
-          colProps: {
-            span: 24,
-          },
-          show: false,
-        },
-      ];
+    GetCrudForm: (type: string, ...args) => {
+      _data = args[0];
+      return crudForms[type];
     },
     /**
      * @description: 鑾峰彇涓讳俊鎭�
@@ -328,47 +159,142 @@
         // { name: 'rotinfo', slots: ['add'], preIcons: { add: 'search|svg' }, title: '宸ヨ壓淇℃伅' },
       ];
     },
-    OthersValues: (val: string, id: string) => {
+    /**
+     * @description: 鑾峰彇鍙充晶杈规use鏂规硶
+     * @return {*}
+     */
+    GetUseDrawers: () => {
+      return [
+        {
+          MES_SHIFT: useDrawer(),
+        },
+        { MES_SHIFT_PRD: useDrawer() },
+      ];
+    },
+    /**
+     * @description: 鑾峰彇琛ㄦ牸use鍒楄〃
+     * @param {string} type
+     * @param {array} args
+     * @return {*}
+     */
+    GetUseTables: (data: Ref<{}>, ...args) => {
+      // _data = data;
+      return {
+        MES_SHIFT: useTable({
+          title: '鍒楄〃淇℃伅',
+          dataSource: data.value['MES_SHIFT'],
+          columns: baseColumns['MES_SHIFT'],
+          maxHeight: 160,
+          formConfig: {
+            labelWidth: 140,
+            schemas: searchForms['MES_SHIFT'],
+            submitFunc: () => Search('MES_SHIFT', data, args[0]), //鑷畾涔夋煡璇㈡彁浜ゆ寜閽殑鏂规硶锛岃Е鍙戞煡璇㈡彁浜や簨浠�
+          },
+          useSearchForm: true,
+          showTableSetting: false,
+          bordered: true,
+          canResize: true,
+          showIndexColumn: false,
+          actionColumn: {
+            width: 130,
+            title: '鎿嶄綔',
+            dataIndex: 'action',
+            slots: { customRender: 'action' },
+            fixed: 'right',
+          }, //鑷畾涔夋搷浣滃垪
+        }),
+        MES_SHIFT_PRD: useTable({
+          title: '鍒楄〃淇℃伅',
+          dataSource: data.value['MES_SHIFT_PRD'],
+          columns: baseColumns['MES_SHIFT_PRD'],
+          maxHeight: 550,
+          formConfig: {
+            labelWidth: 140,
+            schemas: searchForms['MES_SHIFT_PRD'],
+            submitFunc: () => Search('MES_SHIFT_PRD', data, args[0]), //鑷畾涔夋煡璇㈡彁浜ゆ寜閽殑鏂规硶锛岃Е鍙戞煡璇㈡彁浜や簨浠�
+          },
+          useSearchForm: false,
+          showTableSetting: false,
+          bordered: true,
+          canResize: false,
+          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_SHIFT':
+          data = d.data.value[d.type].filter(
+            (item) =>
+              item.SFT_CODE.includes(d.values.SFT_CODE) || item.SFT_NAME == d.values.SFT_NAME,
+          );
+          if (isNullOrEmpty(d.values.SFT_CODE) && isNullOrEmpty(d.values.SFT_NAME)) {
+            data = d.data.value[d.type];
+          }
+          break;
+        case 'MES_SHIFT_PRD':
+          break;
+      }
+      return data;
+    },
+    KeyFieldValues: (val: string, id: string) => {
       return { SFTS_CODE: val };
-    } /**
+    },
+    /**
      * @description: 鑷畾涔夋槑缁嗚〃涓紪杈戣繑鍥炴柟娉�
      * @param {string} type
      * @param {*} d
      * @param {*} u
      * @return {*}
-     */,
-    EditOperation: (data: Ref<any[]>, d, u) => {
-      if (u.isUpdate) {
-        //鏇存柊
-        var _data = data.value.map((item) => {
-          if (item['ID'] == d.ID)
+     */
+    EditOperation: (data: Ref<any[]>, d, u, name) => {
+      //鏇存柊
+      var _data = data.value[name].map((item) => {
+        if (item['ID'] == d.ID) {
+          if (name == 'MES_SHIFT') {
+            // item.SFT_BEGIN = dateUtil(item.SFT_BEGIN);
+            // item.SFT_END = dateUtil(item.SFT_END);
             return {
               ...item,
               SFT_CODE: d.SFT_CODE,
               SFT_NAME: d.SFT_NAME,
-              SFT_BEGIN: d.SFT_BEGIN,
-              SFT_END: d.SFT_END,
+              SFT_BEGIN: dateUtil(d.SFT_BEGIN),
+              SFT_END: dateUtil(d.SFT_END),
               IS_ACROSS_DAY: d.IS_ACROSS_DAY,
               REMARK: d.REMARK,
             };
-          return item;
-        });
-        data.value = _data;
-      } else {
-        //鏂板
-        d.ID = buildUUID();
-        d.CREATE_USER = useUserStore().getUserInfo.userId as string;
-        d.UPDATE_TIME = formatToDateTime(new Date());
-        d.UPDATE_USER = useUserStore().getUserInfo.userId as string;
-        var _data2: any[] = [];
-        if (!isNullOrEmpty(data.value)) {
-          _data2 = data.value.map((item) => {
-            return item;
-          });
+          }
+          if (name == 'MES_SHIFT_PRD') {
+            return {
+              ...item,
+              PRD_CODE: d.PRD_CODE,
+              PRD_NAME: d.PRD_NAME,
+              SFT_CODE: d.SFT_CODE,
+              IS_ACROSS: d.IS_ACROSS,
+              IS_REST: d.IS_REST,
+              SEQ: d.SEQ,
+              PRD_BEGIN: dateUtil(d.PRD_BEGIN),
+              PRD_END: dateUtil(d.PRD_END),
+              REMARK: d.REMARK,
+            };
+          }
         }
-        _data2.push(d);
-        data.value = _data2;
-      }
+        return item;
+      });
+      EditOperation(data, d, u, name, _data);
     },
     /**
      * @description: 鑾峰彇鏍囬淇℃伅
@@ -379,10 +305,69 @@
       return {
         pageTitle: '鐝埗绠$悊',
         pageContent: '杩欓噷鍙互娣诲姞鍜屼慨鏀圭彮鍒跺拰鐝鍙婃椂娈点��',
-        baseTableTitle: '鐝绠$悊',
+        tableTitle: {
+          MES_SHIFT: '鐝绠$悊',
+          MES_SHIFT_PRD: '鏃舵绠$悊',
+        },
       };
     },
+    /**
+     * @description: 鎻愪氦鎵�鏈�
+     * @return {*}
+     */
+    SubmitAll: (data: Ref<any[]>, keyFieldValues: Ref<{}>, ...args) => {
+      const drawers = [
+        { name: 'MES_SHIFT', code: 'SFTS_CODE', type: 'one', keyName: 'MES_SHIFT', order: '' },
+        { name: 'MES_SHIFT_PRD', code: 'SFT_CODE', type: 'all', keyName: 'MES_SHIFT', order: '' },
+      ];
+      drawers.forEach((d) => {
+        let where = `${d['code']} = '${keyFieldValues.value[d['code']]}'`;
+        /* type: all-琛ㄧず闇�瑕乧ode鐨勬墍鏈夌殑鍊� */
+        if (d['type'] == 'all' && data.value[d['keyName']].length > 0) {
+          where = `${d['code']} in (${data.value[d['keyName']].map((value) => `'${value[d['code']]}'`).join(',')})`;
+        }
+        data.value[d['name']].map((item) => {
+          item.ID = buildUUID();
+          if (d['name'] == 'MES_SHIFT') {
+            item.SFT_BEGIN = tsToHHmm(item.SFT_BEGIN);
+            item.SFT_END = tsToHHmm(item.SFT_END);
+          }
+          if (d['name'] == 'MES_SHIFT_PRD') {
+            item.PRD_BEGIN = tsToHHmm(item.PRD_BEGIN);
+            item.PRD_END = tsToHHmm(item.PRD_END);
+          }
+        });
+        AddAfterDelete(d['name'], data.value[d['name']], where).then((action) => {
+          if (action.IsSuccessed) {
+            args[0]();
+          }
+        });
+      });
+    },
+    /**
+     * @description: 鍒濆鍖栨暟鎹�
+     * @param {Ref} data
+     * @param {Ref} keyFieldValues
+     * @return {*}
+     */
+    CustInitData: (data: Ref<any[]>, keyFieldValues: Ref<{}>, type: string) => {
+      data.value[type].map((item) => {
+        if (type == 'MES_SHIFT') {
+          item.SFT_BEGIN = convertTimeToDate(intToTime(item.SFT_BEGIN));
+          item.SFT_END = convertTimeToDate(intToTime(item.SFT_END));
+        }
+        if (type == 'MES_SHIFT_PRD') {
+          item.PRD_BEGIN = convertTimeToDate(intToTime(item.PRD_BEGIN));
+          item.PRD_END = convertTimeToDate(intToTime(item.PRD_END));
+        }
+      });
+    },
+    GetUseForm: () => {
+      return {};
+    },
   };
+
+  /* 浠ヤ笅鏄唴閮ㄦ柟娉曪紝涓峞xport */
 
   /**
    * @description: 鑷畾涔夊垹闄ゆ柟娉�
@@ -391,25 +376,513 @@
    * @return {*}
    */
   function Del(args: Fn[], params: {}) {
+    const name = params['name'];
+    const useTables = args[1];
     if (!isNullOrEmpty(params['data'])) {
-      var _data = params['data'].value.filter((item) => item['ID'] != params['record']['ID']);
-      params['data'].value = _data;
-      args[6]({
+      var _data = params['data'].value[name].filter((item) => item['ID'] != params['record']['ID']);
+      if (name == 'MES_SHIFT') {
+        var _data2 = params['data'].value['MES_SHIFT_PRD'].filter(
+          (item) => item['SFT_CODE'] != params['record']['SFT_CODE'],
+        );
+        params['data'].value['MES_SHIFT_PRD'] = _data2;
+        useTables['MES_SHIFT_PRD'][1].setProps({
+          dataSource: [],
+        });
+        useTables['MES_SHIFT_PRD'][1].setProps({
+          dataSource: params['data'].value['MES_SHIFT_PRD'],
+        });
+        useTables['MES_SHIFT_PRD'][1].reload();
+      }
+      params['data'].value[name] = _data;
+      useTables[name][1].setProps({
         dataSource: [],
       });
-      args[6]({
-        dataSource: params['data'],
+      useTables[name][1].setProps({
+        dataSource: params['data'].value[name],
       });
-      args[1]();
+      useTables[name][1].reload();
     } else {
       DeleteEntity(params['record'], params['entityName']).then((action) => {
         if (action.IsSuccessed) {
-          args[1]();
+          useTables[name][1].reload();
         }
       });
     }
   }
 
+  /**
+   * @description: 琛ㄦ牸鍩烘湰瀛楁
+   * @return {*}
+   */
+  const baseColumns = {
+    MES_SHIFT: [
+      {
+        title: '鐝缂栫爜',
+        dataIndex: 'SFT_CODE',
+        // ifShow: false,
+        width: 180,
+      },
+      {
+        title: '鐝鍚嶇О',
+        dataIndex: 'SFT_NAME',
+      },
+      {
+        title: '鐝埗缂栫爜',
+        dataIndex: 'SFTS_CODE',
+      },
+      {
+        title: '鐝寮�濮嬫椂闂�',
+        dataIndex: 'SFT_BEGIN',
+        customRender: ({ record }) => {
+          return formatTime(new Date(record.SFT_BEGIN));
+        },
+      },
+      {
+        title: '鐝缁撴潫鏃堕棿',
+        dataIndex: 'SFT_END',
+        customRender: ({ record }) => {
+          return formatTime(new Date(record.SFT_END));
+        },
+      },
+      {
+        title: '鏄惁璺ㄥぉ',
+        dataIndex: 'IS_ACROSS_DAY',
+        customRender: ({ record }) => {
+          const type = record.IS_ACROSS_DAY;
+          var text = '';
+          var color = 'green';
+          switch (type) {
+            case 'Y':
+              text = '鏄�';
+              break;
+            case 'N':
+              color = 'blue';
+              text = '鍚�';
+              break;
+          }
+          return h(Tag, { color: color }, () => text);
+        },
+      },
+      {
+        title: '澶囨敞',
+        dataIndex: 'REMARK',
+      },
+      {
+        title: '鏇存柊鏃堕棿',
+        dataIndex: 'UPDATE_TIME',
+      },
+      {
+        title: '鏇存柊浜�',
+        dataIndex: 'UPDATE_USER',
+      },
+    ],
+    MES_SHIFT_PRD: [
+      {
+        title: '鏃舵缂栫爜',
+        dataIndex: 'PRD_CODE',
+        // ifShow: false,
+        width: 180,
+      },
+      {
+        title: '鏃舵鍚嶇О',
+        dataIndex: 'PRD_NAME',
+      },
+      {
+        title: '鐝缂栫爜',
+        dataIndex: 'SFT_CODE',
+      },
+      {
+        title: '鏃舵寮�濮嬫椂闂�',
+        dataIndex: 'PRD_BEGIN',
+        customRender: ({ record }) => {
+          return formatTime(new Date(record.PRD_BEGIN));
+        },
+      },
+      {
+        title: '鏃舵缁撴潫鏃堕棿',
+        dataIndex: 'PRD_END',
+        customRender: ({ record }) => {
+          return formatTime(new Date(record.PRD_END));
+        },
+      },
+      {
+        title: '鏄惁璺ㄥぉ',
+        dataIndex: 'IS_ACROSS',
+        customRender: ({ record }) => {
+          const type = record.IS_ACROSS;
+          var text = '';
+          var color = 'green';
+          switch (type) {
+            case 'Y':
+              text = '鏄�';
+              break;
+            case 'N':
+              color = 'blue';
+              text = '鍚�';
+              break;
+          }
+          return h(Tag, { color: color }, () => text);
+        },
+      },
+      {
+        title: '鏄惁浼戞伅鏃舵',
+        dataIndex: 'IS_REST',
+        customRender: ({ record }) => {
+          const type = record.IS_REST;
+          var text = '';
+          var color = 'green';
+          switch (type) {
+            case 'Y':
+              text = '鏄�';
+              break;
+            case 'N':
+              color = 'blue';
+              text = '鍚�';
+              break;
+          }
+          return h(Tag, { color: color }, () => text);
+        },
+      },
+      {
+        title: '鏃舵鎺掑簭',
+        dataIndex: 'SEQ',
+      },
+      {
+        title: '澶囨敞',
+        dataIndex: 'REMARK',
+      },
+      {
+        title: '鏇存柊鏃堕棿',
+        dataIndex: 'UPDATE_TIME',
+      },
+      {
+        title: '鏇存柊浜�',
+        dataIndex: 'UPDATE_USER',
+      },
+    ],
+  };
+
+  /**
+   * @description: 鏌ヨ瀛楁
+   * @return {*}
+   */
+  const searchForms = {
+    MES_SHIFT: [
+      {
+        field: 'SFT_CODE',
+        label: '鐝缂栫爜',
+        component: 'Input',
+        colProps: {
+          span: 8,
+        },
+      },
+      {
+        label: '鐝鍚嶇О',
+        field: 'SFT_NAME',
+        component: 'Input',
+        colProps: {
+          span: 8,
+        },
+      },
+    ] as FormSchema[],
+    MES_SHIFT_PRD: [
+      {
+        field: 'PRD_CODE',
+        label: '鏃舵缂栫爜',
+        component: 'Input',
+        colProps: {
+          span: 8,
+        },
+      },
+      {
+        label: '鏃舵鍚嶇О',
+        field: 'PRD_NAME',
+        component: 'Input',
+        colProps: {
+          span: 8,
+        },
+      },
+    ] as FormSchema[],
+  };
+
+  const crudForms = {
+    MES_SHIFT: [
+      {
+        field: 'SFT_CODE',
+        label: '鐝缂栫爜',
+        component: 'Input',
+        required: true,
+        colProps: {
+          span: 24,
+        },
+      },
+      {
+        label: '鐝鍚嶇О',
+        field: 'SFT_NAME',
+        component: 'Input',
+        required: true,
+        colProps: {
+          span: 24,
+        },
+      },
+      {
+        label: '鐝埗缂栫爜',
+        field: 'SFTS_CODE',
+        component: 'ApiSelect',
+        required: true,
+        colProps: {
+          span: 24,
+        },
+        componentProps: {
+          api: getEntity,
+          params: { entityName: 'MES_SHIFT_SYS', sqlcmd: ' 1=1 ' },
+          resultField: 'Data.Items',
+          labelField: 'SFTS_NAME',
+          valueField: 'SFTS_CODE',
+        },
+        dynamicDisabled: ({ values }) => {
+          return true;
+        },
+      },
+      // {
+      //   label: '鐝鏃堕棿鑼冨洿',
+      //   field: '[SFT_BEGIN, SFT_END]',
+      //   component: 'TimeRangePicker',
+      //   colProps: {
+      //     span: 24,
+      //   },
+      //   componentProps: ({ formModel }) => {
+      //     return {
+      //       format: 'HH:mm',
+      //       placeholder: ['寮�濮嬫椂闂�', '缁撴潫鏃堕棿'],
+      //       onChange: (e) => {
+      //         const timeRange: any = e;
+      //         console.log(e);
+      //         // if (timeRange) {
+      //         //   formModel.SFT_BEGIN = Number(`${tsToHHmm(timeRange[0].$d)}`);
+      //         //   formModel.SFT_END = Number(`${tsToHHmm(timeRange[1].$d)}`);
+      //         // }
+      //       },
+      //     };
+      //   },
+      // },
+      {
+        label: '鐝寮�濮嬫椂闂�',
+        field: 'SFT_BEGIN',
+        component: 'TimePicker',
+        colProps: {
+          span: 12,
+        },
+        componentProps: ({ formModel }) => {
+          return {
+            format: 'HH:mm',
+          };
+        },
+        // show: false,
+      },
+      {
+        label: '缁撴潫鏃堕棿',
+        field: 'SFT_END',
+        component: 'TimePicker',
+        colProps: {
+          span: 12,
+        },
+        componentProps: ({ formModel }) => {
+          return {
+            format: 'HH:mm',
+          };
+        },
+        // show: false,
+      },
+      {
+        label: '鏄惁璺ㄥぉ',
+        field: 'IS_ACROSS_DAY',
+        component: 'Select',
+        required: true,
+        colProps: {
+          span: 24,
+        },
+        componentProps: {
+          options: [
+            {
+              label: '鏄�',
+              value: 'Y',
+              key: 'Y',
+            },
+            {
+              label: '鍚�',
+              value: 'N',
+              key: 'N',
+            },
+          ],
+        },
+      },
+      // {
+      //   field: 'LOGIN_TIME',
+      //   label: '鐧诲綍鏃堕棿',
+      //   defaultValue: '',
+      //   component: 'RangePicker',
+      //   ifShow: true,
+      //   colProps: { span: 8 },
+      // },
+      {
+        label: '澶囨敞',
+        field: 'REMARK',
+        component: 'Input',
+        colProps: {
+          span: 24,
+        },
+      },
+      {
+        label: 'ID',
+        field: 'ID',
+        component: 'Input',
+        colProps: {
+          span: 24,
+        },
+        show: false,
+      },
+    ] as FormSchema[],
+    MES_SHIFT_PRD: [
+      {
+        field: 'PRD_CODE',
+        label: '鏃舵缂栫爜',
+        component: 'Input',
+        required: true,
+        colProps: {
+          span: 24,
+        },
+      },
+      {
+        label: '鏃舵鍚嶇О',
+        field: 'PRD_NAME',
+        component: 'Input',
+        required: true,
+        colProps: {
+          span: 24,
+        },
+      },
+      {
+        label: '鐝缂栫爜',
+        field: 'SFT_CODE',
+        component: 'Select',
+        required: true,
+        colProps: {
+          span: 24,
+        },
+        componentProps: () => {
+          const options = _data['MES_SHIFT'].map((entity) => ({
+            value: entity.SFT_CODE,
+            label: entity.SFT_NAME,
+          }));
+          return {
+            options: options,
+          };
+        },
+        // dynamicDisabled: ({ values }) => {
+        //   return true;
+        // },
+      },
+      {
+        label: '鏃舵寮�濮嬫椂闂�',
+        field: 'PRD_BEGIN',
+        component: 'TimePicker',
+        colProps: {
+          span: 12,
+        },
+        componentProps: ({ formModel }) => {
+          return {
+            format: 'HH:mm',
+          };
+        },
+      },
+      {
+        label: '缁撴潫鏃堕棿',
+        field: 'PRD_END',
+        component: 'TimePicker',
+        colProps: {
+          span: 12,
+        },
+        componentProps: ({ formModel }) => {
+          return {
+            format: 'HH:mm',
+          };
+        },
+      },
+      {
+        label: '鏃舵鎺掑簭',
+        field: 'SEQ',
+        component: 'InputNumber',
+        colProps: {
+          span: 24,
+        },
+      },
+      {
+        label: '鏄惁璺ㄥぉ',
+        field: 'IS_ACROSS',
+        component: 'Select',
+        required: true,
+        colProps: {
+          span: 24,
+        },
+        componentProps: {
+          options: [
+            {
+              label: '鏄�',
+              value: 'Y',
+              key: 'Y',
+            },
+            {
+              label: '鍚�',
+              value: 'N',
+              key: 'N',
+            },
+          ],
+        },
+      },
+      {
+        label: '鏄惁浼戞伅鏃舵',
+        field: 'IS_REST',
+        component: 'Select',
+        required: true,
+        colProps: {
+          span: 24,
+        },
+        componentProps: {
+          options: [
+            {
+              label: '鏄�',
+              value: 'Y',
+              key: 'Y',
+            },
+            {
+              label: '鍚�',
+              value: 'N',
+              key: 'N',
+            },
+          ],
+        },
+      },
+      {
+        label: '澶囨敞',
+        field: 'REMARK',
+        component: 'Input',
+        colProps: {
+          span: 24,
+        },
+      },
+      {
+        label: 'ID',
+        field: 'ID',
+        component: 'Input',
+        colProps: {
+          span: 24,
+        },
+        show: false,
+      },
+    ] as FormSchema[],
+  };
+
   return [methods, ActionColumn];
 }
 

--
Gitblit v1.9.3