From 04259fe9c84d819791cab926b959cab8dc6584b6 Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期二, 02 七月 2024 13:57:56 +0800 Subject: [PATCH] 高级表单多子表更新 --- src/views/tigerprojects/system/lowcode/entityts/MES_SHIFT.ts | 699 ++++++++++++---- src/views/tigerprojects/system/lowcode/entityts/BAS_REASON.ts | 357 ++++--- src/views/tigerprojects/system/lowcode/entityts/QMS_INS_STD.ts | 6 src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT.ts | 347 ++++--- src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT_GRP.ts | 16 src/views/tigerprojects/system/lowcode/high/index.vue | 16 src/views/tigerprojects/system/lowcode/composition/Config.vue | 6 src/views/tigerprojects/system/lowcode/entityts/MES_SHIFT_SYS.ts | 40 src/api/tigerapi/model/basModel.ts | 14 src/views/tigerprojects/system/lowcode/entityts/QMS_INS_ITEM.ts | 482 ++++++----- src/views/tigerprojects/system/lowcode/entityts/BAS_REASON_GRP.ts | 6 src/views/tigerprojects/system/lowcode/composition/CarGridNav.vue | 4 src/views/tigerprojects/system/lowcode/high/dtl.vue | 193 ++- src/views/tigerprojects/system/lowcode/detail/detail.vue | 6 src/views/tigerprojects/system/lowcode/normal/mainTable.vue | 6 src/views/tigerprojects/system/lowcode/entityts/BAS_PKG_RULE.ts | 6 src/views/tigerprojects/system/lowcode/entityts/BAS_PKG_DTL.ts | 288 ++++-- 17 files changed, 1,551 insertions(+), 941 deletions(-) diff --git a/src/api/tigerapi/model/basModel.ts b/src/api/tigerapi/model/basModel.ts index 1239bb3..658acd4 100644 --- a/src/api/tigerapi/model/basModel.ts +++ b/src/api/tigerapi/model/basModel.ts @@ -122,17 +122,17 @@ export interface EntityCustFunctionType { CreateAction: (fnName: string) => {}; ActionItem: (params: Recordable<any>, data, ...args) => ActionItem[]; - EditOperation: (data: Ref<any[]>, d, u) => void; + EditOperation: (data: Ref<any[]>, d, u, item: string | undefined) => void; OpenSelectItem: (openItemModal: Fn, ...args) => void; GetSelectSuccess: (d, u, ...args) => {}; GetHomeUrl: () => string; - GetBaseColumns: () => []; - GetSearchForm: () => []; - GetCrudForm: (type: string) => []; - GetBaseForm: () => []; + GetBaseColumns: (type: string | undefined) => [] | {}; + GetSearchForm: (type: string | undefined) => [] | {}; + GetCrudForm: (type: string | undefined,) => [] | {}; + GetBaseForm: () => [] | {}; GetBaseCards: (type: string | undefined) => []; OthersValues: (val: string, id: string) => {}; - GetTitle: (type: string) => {}; + GetTitle: (type: string | undefined) => {}; GetCrudColSlots: () => []; nodeChange: ({}) => void; CreateIcon: (params: Recordable<any>) => string; @@ -140,6 +140,8 @@ GetNavItems: (type: string) => NavItem[]; navChangeItem: (action: any, ...args) => void; GetUseModals: () => {}; + GetUseDrawers: () => []; + GetUseTables: (data: Ref<Recordable[]>, ...args) => []; SubmitFunc: (values: Recordable<any>, type: string, emit) => void; GetSlots: (type: string | undefined) => {}; GenerateHtml: (type: string | null) => HTMLElement | null; diff --git a/src/views/tigerprojects/system/lowcode/composition/CarGridNav.vue b/src/views/tigerprojects/system/lowcode/composition/CarGridNav.vue index c057cba..d32f4ac 100644 --- a/src/views/tigerprojects/system/lowcode/composition/CarGridNav.vue +++ b/src/views/tigerprojects/system/lowcode/composition/CarGridNav.vue @@ -4,7 +4,7 @@ * @version: * @Date: 2024-06-20 12:13:27 * @LastEditors: Ben Lin - * @LastEditTime: 2024-06-30 13:04:00 + * @LastEditTime: 2024-07-01 16:49:22 --> <template> <Card :title="GetTitle(props.configType)['navTitle']"> @@ -62,7 +62,7 @@ const custImport = ref<any[]>([]); const EntityCustFunction = ref([ { - GetTitle(type: string) {}, + GetTitle(type: string | undefined) {}, GetNavItems(type: string) {}, navChangeItem(action: any, ...args) {}, GetUseModals() {}, diff --git a/src/views/tigerprojects/system/lowcode/composition/Config.vue b/src/views/tigerprojects/system/lowcode/composition/Config.vue index 801bf03..bbff634 100644 --- a/src/views/tigerprojects/system/lowcode/composition/Config.vue +++ b/src/views/tigerprojects/system/lowcode/composition/Config.vue @@ -4,7 +4,7 @@ * @version: * @Date: 2024-06-24 23:44:31 * @LastEditors: Ben Lin - * @LastEditTime: 2024-06-27 22:52:24 + * @LastEditTime: 2024-07-01 16:49:12 --> <template> <Card :title="GetTitle(props.configType)['configTitle']"> @@ -45,11 +45,11 @@ const custImport = ref<any[]>([]); const EntityCustFunction = ref([ { - GetCrudForm(type: string) {}, + GetCrudForm(type: string | undefined) {}, GetCrudColSlots(val, id) {}, OpenSelectItem(openItemModal: Fn, ...args) {}, GetSelectSuccess(d, u, ...args) {}, - GetTitle(type: string) {}, + GetTitle(type: string | undefined) {}, nodeChange(params: { resetFields: any; setFieldsValue: any; diff --git a/src/views/tigerprojects/system/lowcode/detail/detail.vue b/src/views/tigerprojects/system/lowcode/detail/detail.vue index 725c299..526315c 100644 --- a/src/views/tigerprojects/system/lowcode/detail/detail.vue +++ b/src/views/tigerprojects/system/lowcode/detail/detail.vue @@ -61,9 +61,9 @@ { ActionItem(params, data, ...args) {}, EditOperation(data, d, u) {}, - GetBaseColumns() {}, - GetSearchForm() {}, - GetCrudForm(type: string) {}, + GetBaseColumns(type: string | undefined) {}, + GetSearchForm(type: string | undefined) {}, + GetCrudForm(type: string | undefined, ...args) {}, OthersValues(val, id) {}, GetSelectSuccess(d, u, ...args) {}, OpenSelectItem(openItemModal: Fn, ...args) {}, diff --git a/src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT.ts b/src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT.ts index c342d4c..614a8d4 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT.ts @@ -4,18 +4,19 @@ * @version: * @Date: 2024-06-19 20:34:27 * @LastEditors: Ben Lin - * @LastEditTime: 2024-06-28 14:21:49 + * @LastEditTime: 2024-07-01 17:04:43 */ import { Ref, h, unref } from 'vue'; import { DeleteEntity, GetEnum, getEntity } from '/@/api/tigerapi/system'; -import { ActionItem, BasicColumn } from '/@/components/Table'; +import { ActionItem, BasicColumn, 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'; const { getLocale } = useLocale(); function _default() { @@ -59,151 +60,14 @@ const param = { ID: 'BAS_DEFECT_GRP', colSlots: [], crudColSlots: [] }; return `/BAS_DEFECT_GRP/LC/${encodeURI(JSON.stringify(param))}`; }, - GetBaseColumns: () => { - return [ - { - title: '涓嶈壇浠g爜缂栫爜', - dataIndex: 'DFT_CODE', - // ifShow: false, - width: 180, - }, - { - title: '涓嶈壇浠g爜鍚嶇О', - dataIndex: 'DFT_NAME', - }, - { - title: '缂洪櫡绛夌骇', - dataIndex: 'DFT_LEVEL', - customRender: ({ record }) => { - const type = record.DFT_LEVEL; - var text = ''; - var color = 'green'; - switch (type) { - case 0: - text = '杞诲井缂洪櫡'; - break; - case 1: - color = 'blue'; - text = '涓ラ噸缂洪櫡'; - break; - case 2: - color = 'red'; - text = '鑷村懡缂洪櫡'; - break; - } - return h(Tag, { color: color }, () => text); - }, - }, - { - title: '涓嶈壇浠g爜缁勭紪鐮�', - dataIndex: 'DFTG_CODE', - }, - { - title: '澶囨敞', - dataIndex: 'REMARK', - }, - { - title: '鏇存柊鏃堕棿', - dataIndex: 'UPDATE_TIME', - }, - { - title: '鏇存柊浜�', - dataIndex: 'UPDATE_USER', - }, - ]; + GetBaseColumns: (type: string) => { + return baseColumns[type]; }, - GetSearchForm: () => { - return [ - { - field: 'DFT_CODE', - label: '涓嶈壇浠g爜缂栫爜', - component: 'Input', - colProps: { - span: 8, - }, - }, - { - label: '涓嶈壇浠g爜鍚嶇О', - field: 'DFT_NAME', - component: 'Input', - colProps: { - span: 8, - }, - }, - ]; + GetSearchForm: (type: string) => { + return searchForms[type]; }, - GetCrudForm: () => { - return [ - { - field: 'DFT_CODE', - label: '涓嶈壇浠g爜缂栫爜', - component: 'Input', - required: true, - colProps: { - span: 24, - }, - }, - { - label: '涓嶈壇浠g爜鍚嶇О', - field: 'DFT_NAME', - component: 'Input', - required: true, - colProps: { - span: 24, - }, - }, - { - label: '涓嶈壇浠g爜缁勭紪鐮�', - field: 'DFTG_CODE', - component: 'ApiSelect', - colProps: { - span: 24, - }, - componentProps: { - api: getEntity, - params: { entityName: 'BAS_DEFECT_GRP', sqlcmd: ' 1=1 ' }, - resultField: 'Data.Items', - labelField: 'DFTG_NAME', - valueField: 'DFTG_CODE', - }, - dynamicDisabled: ({ values }) => { - return true; - }, - }, - { - label: '缂洪櫡绛夌骇', - field: 'DFT_LEVEL', - component: 'ApiSelect', - required: true, - colProps: { - span: 24, - }, - componentProps: { - api: GetEnum, - params: { name: 'BAS_DEFECT+DFT_LEVELs' }, - resultField: 'Data', - labelField: unref(getLocale) == 'zh_CN' ? 'Desc' : 'Name', - valueField: 'Value', - }, - }, - { - label: '澶囨敞', - field: 'REMARK', - component: 'Input', - colProps: { - span: 24, - }, - }, - { - label: 'ID', - field: 'ID', - component: 'Input', - colProps: { - span: 24, - }, - show: false, - }, - ]; + GetCrudForm: (type: string) => { + return crudForms[type]; }, GetBaseForm: () => { return [ @@ -266,6 +130,46 @@ // { name: 'rotinfo', slots: ['add'], preIcons: { add: 'search|svg' }, title: '宸ヨ壓淇℃伅' }, ]; }, + /** + * @description: 鑾峰彇鍙充晶杈规use鏂规硶 + * @return {*} + */ + GetUseDrawers: () => { + return [{ + 'BAS_DEFECT': useDrawer(), + }]; + }, + /** + * @description: 鑾峰彇琛ㄦ牸use鍒楄〃 + * @param {string} type + * @param {array} args + * @return {*} + */ + GetUseTables: (data: any[], ...args) => { + return { + BAS_DEFECT: useTable({ + title: '鍒楄〃淇℃伅', + dataSource: data, + columns: baseColumns['BAS_DEFECT'], + formConfig: { + labelWidth: 140, + schemas: searchForms['BAS_DEFECT'], + }, + useSearchForm: true, + showTableSetting: true, + bordered: true, + canResize: true, + showIndexColumn: false, + actionColumn: { + width: 130, + title: '鎿嶄綔', + dataIndex: 'action', + slots: { customRender: 'action' }, + fixed: 'right', + }, //鑷畾涔夋搷浣滃垪 + }) + }; + }, OthersValues: (val: string, id: string) => { return { DFTG_CODE: val }; } /** @@ -315,7 +219,9 @@ return { pageTitle: '涓嶈壇浠g爜缁勭鐞�', pageContent: '杩欓噷鍙互娣诲姞鍜屼慨鏀逛笉鑹唬鐮佺粍鍜屼笉鑹唬鐮併��', - baseTableTitle: '涓嶈壇浠g爜绠$悊', + tableTitle: { + BAS_DEFECT: '涓嶈壇浠g爜绠$悊', + } }; }, }; @@ -346,6 +252,155 @@ } } + const baseColumns = { + BAS_DEFECT: [ + { + title: '涓嶈壇浠g爜缂栫爜', + dataIndex: 'DFT_CODE', + // ifShow: false, + width: 180, + }, + { + title: '涓嶈壇浠g爜鍚嶇О', + dataIndex: 'DFT_NAME', + }, + { + title: '缂洪櫡绛夌骇', + dataIndex: 'DFT_LEVEL', + customRender: ({ record }) => { + const type = record.DFT_LEVEL; + var text = ''; + var color = 'green'; + switch (type) { + case 0: + text = '杞诲井缂洪櫡'; + break; + case 1: + color = 'blue'; + text = '涓ラ噸缂洪櫡'; + break; + case 2: + color = 'red'; + text = '鑷村懡缂洪櫡'; + break; + } + return h(Tag, { color: color }, () => text); + }, + }, + { + title: '涓嶈壇浠g爜缁勭紪鐮�', + dataIndex: 'DFTG_CODE', + }, + { + title: '澶囨敞', + dataIndex: 'REMARK', + }, + { + title: '鏇存柊鏃堕棿', + dataIndex: 'UPDATE_TIME', + }, + { + title: '鏇存柊浜�', + dataIndex: 'UPDATE_USER', + }, + ] + } + + const searchForms = { + BAS_DEFECT: [ + { + field: 'DFT_CODE', + label: '涓嶈壇浠g爜缂栫爜', + component: 'Input', + colProps: { + span: 8, + }, + }, + { + label: '涓嶈壇浠g爜鍚嶇О', + field: 'DFT_NAME', + component: 'Input', + colProps: { + span: 8, + }, + }, + ] + } + + const crudForms = { + BAS_DEFECT: [ + { + field: 'DFT_CODE', + label: '涓嶈壇浠g爜缂栫爜', + component: 'Input', + required: true, + colProps: { + span: 24, + }, + }, + { + label: '涓嶈壇浠g爜鍚嶇О', + field: 'DFT_NAME', + component: 'Input', + required: true, + colProps: { + span: 24, + }, + }, + { + label: '涓嶈壇浠g爜缁勭紪鐮�', + field: 'DFTG_CODE', + component: 'ApiSelect', + colProps: { + span: 24, + }, + componentProps: { + api: getEntity, + params: { entityName: 'BAS_DEFECT_GRP', sqlcmd: ' 1=1 ' }, + resultField: 'Data.Items', + labelField: 'DFTG_NAME', + valueField: 'DFTG_CODE', + }, + dynamicDisabled: ({ values }) => { + return true; + }, + }, + { + label: '缂洪櫡绛夌骇', + field: 'DFT_LEVEL', + component: 'ApiSelect', + required: true, + colProps: { + span: 24, + }, + componentProps: { + api: GetEnum, + params: { name: 'BAS_DEFECT+DFT_LEVELs' }, + resultField: 'Data', + labelField: unref(getLocale) == 'zh_CN' ? 'Desc' : 'Name', + valueField: 'Value', + }, + }, + { + label: '澶囨敞', + field: 'REMARK', + component: 'Input', + colProps: { + span: 24, + }, + }, + { + label: 'ID', + field: 'ID', + component: 'Input', + colProps: { + span: 24, + }, + show: false, + }, + ] + } + return [methods, ActionColumn]; } diff --git a/src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT_GRP.ts b/src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT_GRP.ts index 115aa60..ec51dd6 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT_GRP.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT_GRP.ts @@ -4,7 +4,7 @@ * @version: * @Date: 2024-06-19 20:34:27 * @LastEditors: Ben Lin - * @LastEditTime: 2024-06-28 10:52:16 + * @LastEditTime: 2024-07-01 20:14:03 */ import { ActionItem, BasicColumn } from '/@/components/Table'; @@ -21,10 +21,10 @@ slots: { customRender: 'action' }, fixed: 'right', }; - /** + /** * @description: 涓�浜涜嚜瀹氫箟鏂规硶 * @return {*} - */ + */ const methods = { /** * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓� @@ -39,8 +39,9 @@ ID: buildUUID(), Name: 'BAS_DEFECT', Title: '鏂板涓嶈壇浠g爜缁�', - pCode: 'DFTG_CODE', + // pCode: 'DFTG_CODE', IsID: false, + drawers: [{ name: 'BAS_DEFECT', code: 'DFTG_CODE' }], //drawers鏄彸杈瑰脊鍑哄鏀逛晶妗嗙殑鍚嶅瓧鍒楄〃 }, }; }, @@ -59,7 +60,7 @@ * @param {*} d * @param {*} u * @return {*} - */ + */ GetSelectSuccess: (d, u) => { return { ITEM_CODE: d.values['val'], @@ -69,7 +70,7 @@ * @description: 寮瑰嚭閫夋嫨妗嗘墦寮�鏂规硶 * @param {Fn} openItemModal * @return {*} - */ + */ OpenSelectItem: (openItemModal: Fn, ...args) => { openItemModal(true, { title: '鐗╂枡鍒楄〃', @@ -107,7 +108,7 @@ }; /* 浠ヤ笅鏄唴閮ㄦ柟娉曪紝涓峞xport锛屼緵涓婇潰鐨勬柟娉曡皟鐢� */ - + /** * @description: 鑷畾涔夌紪杈戞柟娉� * @param {Fn} args @@ -122,6 +123,7 @@ Title: `缂栬緫涓嶈壇浠g爜缁勶細${params['record']['DFTG_CODE']}`, pCode: 'DFTG_CODE', IsID: false, + drawers: [{ name: 'BAS_DEFECT', code: 'DFTG_CODE' }], //drawers鏄彸杈瑰脊鍑哄鏀逛晶妗嗙殑鍚嶅瓧鍒楄〃 }; args[5](`/BAS_DEFECT/High/${encodeURI(JSON.stringify(param))}`); } diff --git a/src/views/tigerprojects/system/lowcode/entityts/BAS_PKG_DTL.ts b/src/views/tigerprojects/system/lowcode/entityts/BAS_PKG_DTL.ts index 59ceb76..d957ead 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/BAS_PKG_DTL.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/BAS_PKG_DTL.ts @@ -4,16 +4,17 @@ * @version: * @Date: 2024-06-19 20:34:27 * @LastEditors: Ben Lin - * @LastEditTime: 2024-06-26 03:14:01 + * @LastEditTime: 2024-07-01 17:08:25 */ import { Ref } from 'vue'; import { DeleteEntity, getEntity } from '/@/api/tigerapi/system'; -import { ActionItem, BasicColumn } from '/@/components/Table'; +import { ActionItem, BasicColumn, 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 { useDrawer } from '/@/components/Drawer'; function _default(): any[] { const ActionColumn: BasicColumn = { @@ -27,7 +28,7 @@ /** * @description: 涓�浜涜嚜瀹氫箟鏂规硶 * @return {*} - */ + */ const methods = { /** * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓� @@ -91,7 +92,7 @@ /** * @description: 楂樼骇琛ㄥ崟鍜岃鎯呴〉闈㈣繑鍥炰富椤甸潰鐨剈rl * @return {*} - */ + */ GetHomeUrl: () => { return `/BAS_PKG_RULE/LC/${encodeURI(JSON.stringify({ ID: 'BAS_PKG_RULE', colSlots: [], crudColSlots: [] }))}`; }, @@ -99,125 +100,22 @@ * @description: 楂樼骇琛ㄥ崟鏄庣粏琛ㄦ牸瀛楁 * @return {*} */ - GetBaseColumns: () => { - return [ - { - title: '鍖呰/杞藉叿缂栫爜', - dataIndex: 'PKG_CODE', - // ifShow: false, - width: 180, - }, - { - title: '鍖呰灞傜骇', - dataIndex: 'PKG_LEVEL', - }, - { - title: '鍖呰鏁伴噺', - dataIndex: 'PKG_QTY', - }, - { - title: '鍖呰瑙勫垯ID', - dataIndex: 'PKG_RULE_ID', - ifShow: false, - }, - { - title: '澶囨敞', - dataIndex: 'REMARK', - }, - { - title: '鏇存柊鏃堕棿', - dataIndex: 'UPDATE_TIME', - }, - { - title: '鏇存柊浜�', - dataIndex: 'UPDATE_USER', - }, - ]; + GetBaseColumns: (type: string) => { + return baseColumns[type]; }, /** * @description: 楂樼骇琛ㄥ崟鏌ヨ鏉′欢瀛楁 * @return {*} */ - GetSearchForm: () => { - return [ - { - field: 'PKG_CODE', - label: '鍖呰瑙勫垯缂栫爜', - component: 'Input', - colProps: { - span: 8, - }, - }, - ]; + GetSearchForm: (type: string) => { + return searchForms[type]; }, /** * @description: 楂樼骇琛ㄥ崟澧炲垹鏀硅〃鍗曞瓧娈� * @return {*} */ - GetCrudForm: () => { - return [ - { - field: 'PKG_CODE', - label: '鍖呰/杞藉叿缂栫爜', - component: 'ApiSelect', - required: true, - colProps: { - span: 24, - }, - componentProps: { - api: getEntity, - params: { entityName: 'BAS_PKG_TYPE', sqlcmd: ' 1=1 ' }, - resultField: 'Data.Items', - labelField: 'PKG_NAME', - valueField: 'PKG_CODE', - }, - }, - { - label: '鍖呰灞傜骇', - field: 'PKG_LEVEL', - component: 'Input', - required: true, - colProps: { - span: 24, - }, - }, - { - label: '鍖呰瑙勫垯ID', - field: 'PKG_RULE_ID', - component: 'Input', - colProps: { - span: 24, - }, - dynamicDisabled: ({ values }) => { - return true; - }, - }, - { - label: '鍖呰鏁伴噺', - field: 'PKG_QTY', - component: 'Input', - colProps: { - span: 24, - }, - }, - { - label: '澶囨敞', - field: 'REMARK', - component: 'Input', - colProps: { - span: 24, - }, - }, - { - label: 'ID', - field: 'ID', - component: 'Input', - colProps: { - span: 24, - }, - show: false, - }, - ]; + GetCrudForm: (type: string) => { + return crudForms[type]; }, OthersValues: (val: string, id: string) => { return { PKG_RULE_ID: id }; @@ -291,7 +189,7 @@ /** * @description: 楂樼骇琛ㄥ崟涓讳俊鎭崱鐗囩敓鎴愶紝鍙互澶氫釜 * @return {*} - */ + */ GetBaseCards: () => { return [ { @@ -304,6 +202,48 @@ ]; }, /** + * @description: 鑾峰彇鍙充晶杈规use鏂规硶 + * @return {*} + */ + GetUseDrawers: () => { + return [ + { + BAS_PKG_DTL: useDrawer(), + }, + ]; + }, + /** + * @description: 鑾峰彇琛ㄦ牸use鍒楄〃 + * @param {string} type + * @param {array} args + * @return {*} + */ + GetUseTables: (data: any[], ...args) => { + return { + BAS_PKG_DTL: useTable({ + title: '鍒楄〃淇℃伅', + dataSource: data, + columns: baseColumns['BAS_PKG_DTL'], + formConfig: { + labelWidth: 140, + schemas: searchForms['BAS_PKG_DTL'], + }, + useSearchForm: true, + showTableSetting: true, + bordered: true, + canResize: true, + showIndexColumn: false, + actionColumn: { + width: 130, + title: '鎿嶄綔', + dataIndex: 'action', + slots: { customRender: 'action' }, + fixed: 'right', + }, //鑷畾涔夋搷浣滃垪 + }), + }; + }, + /** * @description: 鑾峰彇鏍囬淇℃伅 * @param {string} type * @return {*} @@ -312,13 +252,15 @@ return { pageTitle: '鍖呰瑙勫垯绠$悊', pageContent: '杩欓噷鍙互娣诲姞鍜屼慨鏀瑰寘瑁呰鍒欏拰鍖呰淇℃伅銆�', - baseTableTitle: '鍖呰淇℃伅绠$悊', + tableTitle: { + BAS_PKG_DTL: '鍖呰淇℃伅绠$悊', + }, }; }, }; /* 浠ヤ笅鏄唴閮ㄦ柟娉曪紝涓峞xport锛屼緵涓婇潰鐨勬柟娉曡皟鐢� */ - + /** * @description: 鑷畾涔夊垹闄ゆ柟娉� * @param {Fn} args @@ -345,6 +287,120 @@ } } + const searchForms = { + BAS_PKG_DTL: [ + { + field: 'PKG_CODE', + label: '鍖呰瑙勫垯缂栫爜', + component: 'Input', + colProps: { + span: 8, + }, + }, + ], + }; + + const baseColumns = { + BAS_PKG_DTL: [ + { + title: '鍖呰/杞藉叿缂栫爜', + dataIndex: 'PKG_CODE', + // ifShow: false, + width: 180, + }, + { + title: '鍖呰灞傜骇', + dataIndex: 'PKG_LEVEL', + }, + { + title: '鍖呰鏁伴噺', + dataIndex: 'PKG_QTY', + }, + { + title: '鍖呰瑙勫垯ID', + dataIndex: 'PKG_RULE_ID', + ifShow: false, + }, + { + title: '澶囨敞', + dataIndex: 'REMARK', + }, + { + title: '鏇存柊鏃堕棿', + dataIndex: 'UPDATE_TIME', + }, + { + title: '鏇存柊浜�', + dataIndex: 'UPDATE_USER', + }, + ], + }; + + const crudForms = { + BAS_PKG_DTL: [ + { + field: 'PKG_CODE', + label: '鍖呰/杞藉叿缂栫爜', + component: 'ApiSelect', + required: true, + colProps: { + span: 24, + }, + componentProps: { + api: getEntity, + params: { entityName: 'BAS_PKG_TYPE', sqlcmd: ' 1=1 ' }, + resultField: 'Data.Items', + labelField: 'PKG_NAME', + valueField: 'PKG_CODE', + }, + }, + { + label: '鍖呰灞傜骇', + field: 'PKG_LEVEL', + component: 'Input', + required: true, + colProps: { + span: 24, + }, + }, + { + label: '鍖呰瑙勫垯ID', + field: 'PKG_RULE_ID', + component: 'Input', + colProps: { + span: 24, + }, + dynamicDisabled: ({ values }) => { + return true; + }, + }, + { + label: '鍖呰鏁伴噺', + field: 'PKG_QTY', + component: 'Input', + colProps: { + span: 24, + }, + }, + { + label: '澶囨敞', + field: 'REMARK', + component: 'Input', + colProps: { + span: 24, + }, + }, + { + label: 'ID', + field: 'ID', + component: 'Input', + colProps: { + span: 24, + }, + show: false, + }, + ], + }; return [methods, ActionColumn]; } diff --git a/src/views/tigerprojects/system/lowcode/entityts/BAS_PKG_RULE.ts b/src/views/tigerprojects/system/lowcode/entityts/BAS_PKG_RULE.ts index 7c1770c..8a3daed 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/BAS_PKG_RULE.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/BAS_PKG_RULE.ts @@ -4,7 +4,7 @@ * @version: * @Date: 2024-06-19 20:34:27 * @LastEditors: Ben Lin - * @LastEditTime: 2024-06-25 18:31:56 + * @LastEditTime: 2024-07-01 20:14:42 */ import { ActionItem, BasicColumn } from '/@/components/Table'; @@ -23,7 +23,7 @@ /** * @description: 涓�浜涜嚜瀹氫箟鏂规硶 * @return {*} - */ + */ const methods = { /** * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓� @@ -40,6 +40,7 @@ Title: '鏂板鍖呰瑙勫垯', pCode: 'PKG_RULE_ID', IsID: true, + drawers: [{ name: 'BAS_PKG_DTL', code: 'PKG_RULE_ID' }], //drawers鏄彸杈瑰脊鍑哄鏀逛晶妗嗙殑鍚嶅瓧鍒楄〃 }, }; }, @@ -71,6 +72,7 @@ Title: `缂栬緫鍖呰瑙勫垯锛�${params['record']['RULE_CODE']}`, pCode: 'PKG_RULE_ID', IsID: true, + drawers: [{ name: 'BAS_PKG_DTL', code: 'PKG_RULE_ID' }], //drawers鏄彸杈瑰脊鍑哄鏀逛晶妗嗙殑鍚嶅瓧鍒楄〃 }; go(`/BAS_PKG_DTL/High/${encodeURI(JSON.stringify(param))}`); } diff --git a/src/views/tigerprojects/system/lowcode/entityts/BAS_REASON.ts b/src/views/tigerprojects/system/lowcode/entityts/BAS_REASON.ts index 756df30..b1ff66d 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/BAS_REASON.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/BAS_REASON.ts @@ -4,16 +4,17 @@ * @version: * @Date: 2024-06-22 00:58:43 * @LastEditors: Ben Lin - * @LastEditTime: 2024-06-26 03:13:26 + * @LastEditTime: 2024-07-01 17:13:16 */ import { Ref, h } from 'vue'; import { DeleteEntity, getEntity } from '/@/api/tigerapi/system'; -import { ActionItem, BasicColumn } from '/@/components/Table'; +import { ActionItem, BasicColumn, 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 { useDrawer } from '/@/components/Drawer'; function _default() { const ActionColumn: BasicColumn = { @@ -27,7 +28,7 @@ /** * @description: 涓�浜涜嚜瀹氫箟鏂规硶 * @return {*} - */ + */ const methods = { /** * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓� @@ -93,154 +94,14 @@ GetHomeUrl: () => { return `/BAS_REASON_GRP/LC/${encodeURI(JSON.stringify({ ID: 'BAS_REASON_GRP', colSlots: [], crudColSlots: [] }))}`; }, - GetBaseColumns: () => { - return [ - { - title: '涓嶈壇鍘熷洜缂栫爜', - dataIndex: 'RSN_CODE', - // ifShow: false, - width: 180, - }, - { - title: '涓嶈壇鍘熷洜鍚嶇О', - dataIndex: 'RSN_NAME', - }, - { - title: '鏄惁蹇呴』鏇存崲闆朵欢', - dataIndex: 'NEED_REPLACE', - customRender: ({ record }) => { - const type = record.NEED_REPLACE; - 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: 'RSNG_CODE', - }, - { - title: '澶囨敞', - dataIndex: 'REMARK', - }, - { - title: '鏇存柊鏃堕棿', - dataIndex: 'UPDATE_TIME', - }, - { - title: '鏇存柊浜�', - dataIndex: 'UPDATE_USER', - }, - ]; + GetBaseColumns: (type) => { + return baseColumns[type]; }, - GetSearchForm: () => { - return [ - { - field: 'RSN_CODE', - label: '涓嶈壇鍘熷洜缂栫爜', - component: 'Input', - colProps: { - span: 8, - }, - }, - { - label: '涓嶈壇鍘熷洜鍚嶇О', - field: 'RSN_NAME', - component: 'Input', - colProps: { - span: 8, - }, - }, - ]; + GetSearchForm: (type: string) => { + return searchForms[type]; }, - GetCrudForm: () => { - return [ - { - field: 'RSN_CODE', - label: '涓嶈壇鍘熷洜缂栫爜', - component: 'Input', - required: true, - colProps: { - span: 24, - }, - }, - { - label: '涓嶈壇鍘熷洜鍚嶇О', - field: 'RSN_NAME', - component: 'Input', - required: true, - colProps: { - span: 24, - }, - }, - { - label: '涓嶈壇鍘熷洜缁勭紪鐮�', - field: 'RSNG_CODE', - component: 'ApiSelect', - colProps: { - span: 24, - }, - componentProps: { - api: getEntity, - params: { entityName: 'BAS_REASON_GRP', sqlcmd: ' 1=1 ' }, - resultField: 'Data.Items', - labelField: 'RSNG_NAME', - valueField: 'RSNG_CODE', - }, - dynamicDisabled: ({ values }) => { - return true; - }, - }, - { - label: '鏄惁蹇呴』鏇存崲闆朵欢', - field: 'NEED_REPLACE', - 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, - }, - ]; + GetCrudForm: (type: string) => { + return crudForms[type]; }, GetBaseForm: () => { return [ @@ -292,6 +153,48 @@ }, ]; }, + /** + * @description: 鑾峰彇鍙充晶杈规use鏂规硶 + * @return {*} + */ + GetUseDrawers: () => { + return [ + { + BAS_REASON: useDrawer(), + }, + ]; + }, + /** + * @description: 鑾峰彇琛ㄦ牸use鍒楄〃 + * @param {string} type + * @param {array} args + * @return {*} + */ + GetUseTables: (data: any[], ...args) => { + return { + BAS_REASON: useTable({ + title: '鍒楄〃淇℃伅', + dataSource: data, + columns: baseColumns['BAS_REASON'], + formConfig: { + labelWidth: 140, + schemas: searchForms['BAS_REASON'], + }, + useSearchForm: true, + showTableSetting: true, + bordered: true, + canResize: true, + showIndexColumn: false, + actionColumn: { + width: 130, + title: '鎿嶄綔', + dataIndex: 'action', + slots: { customRender: 'action' }, + fixed: 'right', + }, //鑷畾涔夋搷浣滃垪 + }), + }; + }, OthersValues: (val: string, id: string) => { return { RSNG_CODE: val }; }, @@ -304,7 +207,9 @@ return { pageTitle: '涓嶈壇鍘熷洜缁勭鐞�', pageContent: '杩欓噷鍙互娣诲姞鍜屼慨鏀逛笉鑹師鍥犵粍鍜屼笉鑹唬鐮併��', - baseTableTitle: '涓嶈壇鍘熷洜绠$悊', + tableTitle: { + BAS_REASON: '涓嶈壇鍘熷洜绠$悊', + } }; }, }; @@ -337,6 +242,158 @@ } } + const baseColumns = { + BAS_REASON: [ + { + title: '涓嶈壇鍘熷洜缂栫爜', + dataIndex: 'RSN_CODE', + // ifShow: false, + width: 180, + }, + { + title: '涓嶈壇鍘熷洜鍚嶇О', + dataIndex: 'RSN_NAME', + }, + { + title: '鏄惁蹇呴』鏇存崲闆朵欢', + dataIndex: 'NEED_REPLACE', + customRender: ({ record }) => { + const type = record.NEED_REPLACE; + 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: 'RSNG_CODE', + }, + { + title: '澶囨敞', + dataIndex: 'REMARK', + }, + { + title: '鏇存柊鏃堕棿', + dataIndex: 'UPDATE_TIME', + }, + { + title: '鏇存柊浜�', + dataIndex: 'UPDATE_USER', + }, + ], + }; + + const searchForms = { + BAS_REASON: [ + { + field: 'RSN_CODE', + label: '涓嶈壇鍘熷洜缂栫爜', + component: 'Input', + colProps: { + span: 8, + }, + }, + { + label: '涓嶈壇鍘熷洜鍚嶇О', + field: 'RSN_NAME', + component: 'Input', + colProps: { + span: 8, + }, + }, + ], + }; + + const crudForms = { + BAS_REASON: [ + { + field: 'RSN_CODE', + label: '涓嶈壇鍘熷洜缂栫爜', + component: 'Input', + required: true, + colProps: { + span: 24, + }, + }, + { + label: '涓嶈壇鍘熷洜鍚嶇О', + field: 'RSN_NAME', + component: 'Input', + required: true, + colProps: { + span: 24, + }, + }, + { + label: '涓嶈壇鍘熷洜缁勭紪鐮�', + field: 'RSNG_CODE', + component: 'ApiSelect', + colProps: { + span: 24, + }, + componentProps: { + api: getEntity, + params: { entityName: 'BAS_REASON_GRP', sqlcmd: ' 1=1 ' }, + resultField: 'Data.Items', + labelField: 'RSNG_NAME', + valueField: 'RSNG_CODE', + }, + dynamicDisabled: ({ values }) => { + return true; + }, + }, + { + label: '鏄惁蹇呴』鏇存崲闆朵欢', + field: 'NEED_REPLACE', + 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, + }, + ], + }; + return [methods, ActionColumn]; } diff --git a/src/views/tigerprojects/system/lowcode/entityts/BAS_REASON_GRP.ts b/src/views/tigerprojects/system/lowcode/entityts/BAS_REASON_GRP.ts index 54b82a0..ca3d931 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/BAS_REASON_GRP.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/BAS_REASON_GRP.ts @@ -4,7 +4,7 @@ * @version: * @Date: 2024-06-19 20:34:27 * @LastEditors: Ben Lin - * @LastEditTime: 2024-06-25 18:32:20 + * @LastEditTime: 2024-07-01 20:15:46 */ import { ActionItem, BasicColumn } from '/@/components/Table'; @@ -26,7 +26,7 @@ /** * @description: 涓�浜涜嚜瀹氫箟鏂规硶 * @return {*} - */ + */ const methods = { /** * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓� @@ -43,6 +43,7 @@ Title: '鏂板涓嶈壇鍘熷洜缁�', pCode: 'RSNG_CODE', IsID: false, + drawers: [{ name: 'BAS_REASON', code: 'RSNG_CODE' }], //drawers鏄彸杈瑰脊鍑哄鏀逛晶妗嗙殑鍚嶅瓧鍒楄〃 }, }; }, @@ -113,6 +114,7 @@ Title: `缂栬緫涓嶈壇鍘熷洜缁勶細${params['record']['RSNG_CODE']}`, pCode: 'RSNG_CODE', IsID: false, + drawers: [{ name: 'BAS_REASON', code: 'RSNG_CODE' }], //drawers鏄彸杈瑰脊鍑哄鏀逛晶妗嗙殑鍚嶅瓧鍒楄〃 }; args[5](`/BAS_REASON/High/${encodeURI(JSON.stringify(param))}`); } diff --git a/src/views/tigerprojects/system/lowcode/entityts/MES_SHIFT.ts b/src/views/tigerprojects/system/lowcode/entityts/MES_SHIFT.ts index 751365f..900d7f2 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/MES_SHIFT.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/MES_SHIFT.ts @@ -4,21 +4,42 @@ * @version: * @Date: 2024-06-19 20:34:27 * @LastEditors: Ben Lin - * @LastEditTime: 2024-07-01 12:33:25 + * @LastEditTime: 2024-07-02 03:40:15 */ -import { Ref, h, unref } from 'vue'; +import { Ref, h, ref, unref } from 'vue'; import { DeleteEntity, GetEnum, getEntity } from '/@/api/tigerapi/system'; -import { ActionItem, BasicColumn } from '/@/components/Table'; +import { ActionItem, BasicColumn, 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'; const { getLocale } = useLocale(); function _default() { + let _data = ref([ + { + SFT_CODE: '1', + SFT_NAME: '1', + SFTS_CODE: '1', + SFT_BEGIN: 1, + SFT_END: 1, + IS_ACROSS_DAY: 'N', + REMARK: '1', + AUTH_ORG: '1', + AUTH_PROD: '1', + AUTH_WH: '1', + GHOST_ROW: false, + CREATE_TIME: '2024-07-01 12:34:29', + CREATE_USER: '1', + UPDATE_TIME: '2024-07-01 12:34:29', + UPDATE_USER: '1', + ID: '6632a14fec8c470c9216f5c7354baa22', + }, + ] as Recordable<any>[]); const ActionColumn: BasicColumn = { width: 80, title: '鎿嶄綔', @@ -59,186 +80,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,6 +178,71 @@ // { name: 'rotinfo', slots: ['add'], preIcons: { add: 'search|svg' }, title: '宸ヨ壓淇℃伅' }, ]; }, + /** + * @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'], + formConfig: { + labelWidth: 140, + schemas: searchForms['MES_SHIFT'], + }, + useSearchForm: true, + showTableSetting: true, + 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'], + formConfig: { + labelWidth: 140, + schemas: searchForms['MES_SHIFT_PRD'], + }, + useSearchForm: true, + showTableSetting: true, + bordered: true, + canResize: true, + showIndexColumn: false, + actionColumn: { + width: 130, + title: '鎿嶄綔', + dataIndex: 'action', + slots: { customRender: 'action' }, + fixed: 'right', + }, //鑷畾涔夋搷浣滃垪 + }), + }; + }, OthersValues: (val: string, id: string) => { return { SFTS_CODE: val }; } /** @@ -337,7 +252,7 @@ * @param {*} u * @return {*} */, - EditOperation: (data: Ref<any[]>, d, u) => { + EditOperation: (data: Ref<any[]>, d, u, item) => { if (u.isUpdate) { //鏇存柊 var _data = data.value.map((item) => { @@ -361,13 +276,13 @@ 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) => { + if (!isNullOrEmpty(data.value[item])) { + _data2 = data.value[item].map((item) => { return item; }); } _data2.push(d); - data.value = _data2; + data.value[item] = _data2; } }, /** @@ -379,10 +294,15 @@ return { pageTitle: '鐝埗绠$悊', pageContent: '杩欓噷鍙互娣诲姞鍜屼慨鏀圭彮鍒跺拰鐝鍙婃椂娈点��', - baseTableTitle: '鐝绠$悊', + tableTitle: { + MES_SHIFT: '鐝绠$悊', + MES_SHIFT_PRD: '鏃舵绠$悊', + }, }; }, }; + + /* 浠ヤ笅鏄唴閮ㄦ柟娉曪紝涓峞xport */ /** * @description: 鑷畾涔夊垹闄ゆ柟娉� @@ -410,6 +330,413 @@ } } + /** + * @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', + }, + { + 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', + }, + ], + MES_SHIFT_PRD: [ + { + title: '鏃舵缂栫爜', + dataIndex: 'PRD_CODE', + // ifShow: false, + width: 180, + }, + { + title: '鏃舵鍚嶇О', + dataIndex: 'PRD_NAME', + }, + { + title: '鐝缂栫爜', + dataIndex: 'SFT_CODE', + }, + { + title: '鏃舵寮�濮嬫椂闂�', + dataIndex: 'PRD_BEGIN', + }, + { + title: '鏃舵缁撴潫鏃堕棿', + dataIndex: '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, + }, + }, + ], + MES_SHIFT_PRD: [ + { + field: 'PRD_CODE', + label: '鏃舵缂栫爜', + component: 'Input', + colProps: { + span: 8, + }, + }, + { + label: '鏃舵鍚嶇О', + field: 'PRD_NAME', + component: 'Input', + colProps: { + span: 8, + }, + }, + ], + }; + + 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', + 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, + }, + ], + 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', + colProps: { + span: 24, + }, + componentProps: () => { + const options = _data.map((entity) => ({ + value: entity.SFT_CODE, + label: entity.SFT_NAME, + })); + return { + options: options, + }; + }, + // dynamicDisabled: ({ values }) => { + // return true; + // }, + }, + { + label: '鏃舵寮�濮嬫椂闂�', + field: 'PRD_BEGIN', + component: 'Input', + colProps: { + span: 24, + }, + }, + { + label: '鏃舵缁撴潫鏃堕棿', + field: 'PRD_END', + component: 'Input', + 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, + }, + ], + }; + return [methods, ActionColumn]; } diff --git a/src/views/tigerprojects/system/lowcode/entityts/MES_SHIFT_SYS.ts b/src/views/tigerprojects/system/lowcode/entityts/MES_SHIFT_SYS.ts index 843f88e..ad2cdae 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/MES_SHIFT_SYS.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/MES_SHIFT_SYS.ts @@ -4,7 +4,7 @@ * @version: * @Date: 2024-06-19 20:34:27 * @LastEditors: Ben Lin - * @LastEditTime: 2024-07-01 12:17:23 + * @LastEditTime: 2024-07-02 03:29:35 */ import { ActionItem, BasicColumn } from '/@/components/Table'; @@ -21,10 +21,10 @@ slots: { customRender: 'action' }, fixed: 'right', }; - /** + /** * @description: 涓�浜涜嚜瀹氫箟鏂规硶 * @return {*} - */ + */ const methods = { /** * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓� @@ -37,10 +37,14 @@ params: { CODE: '0', ID: buildUUID(), - Name: 'MES_SHIFT', - Title: '鏂板鐝埗', - pCode: 'SFTS_CODE', - IsID: false, + Name: 'MES_SHIFT', //瀹炰綋鍚� + Title: '鏂板鐝埗', //鏍囬 + pCode: 'SFTS_CODE', //涓讳俊鎭叧閿瓧娈礐ODE + IsID: false, //鏄惁甯﹁繃鍘讳晶杈规鐨勬槸ID锛宖alse灏辨槸CODE锛宼rue鏄疘D + drawers: [ + { name: 'MES_SHIFT', code: 'SFTS_CODE' }, + { name: 'MES_SHIFT_PRD', code: 'SFT_CODE' }, + ], //drawers鏄彸杈瑰脊鍑哄鏀逛晶妗嗙殑鍚嶅瓧鍒楄〃 }, }; }, @@ -59,7 +63,7 @@ * @param {*} d * @param {*} u * @return {*} - */ + */ GetSelectSuccess: (d, u) => { return { ITEM_CODE: d.values['val'], @@ -69,7 +73,7 @@ * @description: 寮瑰嚭閫夋嫨妗嗘墦寮�鏂规硶 * @param {Fn} openItemModal * @return {*} - */ + */ OpenSelectItem: (openItemModal: Fn, ...args) => { openItemModal(true, { title: '鐗╂枡鍒楄〃', @@ -107,7 +111,7 @@ }; /* 浠ヤ笅鏄唴閮ㄦ柟娉曪紝涓峞xport锛屼緵涓婇潰鐨勬柟娉曡皟鐢� */ - + /** * @description: 鑷畾涔夌紪杈戞柟娉� * @param {Fn} args @@ -116,12 +120,16 @@ */ function Edit(args: Fn[], params: {}) { const param = { - CODE: params['record']['SFTS_CODE'], - ID: params['record']['ID'], - Name: 'MES_SHIFT', - Title: `缂栬緫鐝埗锛�${params['record']['SFTS_CODE']}`, - pCode: 'SFTS_CODE', - IsID: false, + CODE: params['record']['SFTS_CODE'], //CODE鐨勫�� + ID: params['record']['ID'], //ID鍊� + Name: 'MES_SHIFT', //瀹炰綋鍚� + Title: `缂栬緫鐝埗锛�${params['record']['SFTS_CODE']}`, //鏍囬 + // pCode: 'SFTS_CODE', //涓讳俊鎭叧閿瓧娈礐ODE锛岄珮绾ц〃鍗曠敤涓嬮潰drawers閲岀殑code + IsID: false, //鏄惁甯﹁繃鍘讳晶杈规鐨勬槸ID锛宖alse灏辨槸CODE锛宼rue鏄疘D + drawers: [ + { name: 'MES_SHIFT', code: 'SFTS_CODE' }, + { name: 'MES_SHIFT_PRD', code: 'SFT_CODE' }, + ], //drawers鏄彸杈瑰脊鍑哄鏀逛晶妗嗙殑鍚嶅瓧鍒楄〃 }; args[5](`/MES_SHIFT/High/${encodeURI(JSON.stringify(param))}`); } diff --git a/src/views/tigerprojects/system/lowcode/entityts/QMS_INS_ITEM.ts b/src/views/tigerprojects/system/lowcode/entityts/QMS_INS_ITEM.ts index ab621e2..73e3193 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/QMS_INS_ITEM.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/QMS_INS_ITEM.ts @@ -4,18 +4,19 @@ * @version: * @Date: 2024-06-19 20:34:27 * @LastEditors: Ben Lin - * @LastEditTime: 2024-06-28 10:57:44 + * @LastEditTime: 2024-07-01 17:17:58 */ import { Ref, h, unref } from 'vue'; import { DeleteEntity, GetEnum, getEntity } from '/@/api/tigerapi/system'; -import { ActionItem, BasicColumn } from '/@/components/Table'; +import { ActionItem, BasicColumn, 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'; const { getLocale } = useLocale(); function _default() { @@ -30,9 +31,9 @@ /** * @description: 涓�浜涜嚜瀹氫箟鏂规硶 * @return {*} - */ + */ const methods = { - EditOperation: ( data: Ref<any[]>, d, u) => { + EditOperation: (data: Ref<any[]>, d, u) => { if (u.isUpdate) { //鏇存柊 var _data = data.value.map((item) => { @@ -79,224 +80,25 @@ ActionItem: (params: Recordable<any>, data, ...args): ActionItem[] => { if (!isNullOrUnDef(data[1])) { data[1].popConfirm.confirm = Del.bind(null, args, params); - } + } return data; }, /** * @description: 楂樼骇琛ㄥ崟鍜岃鎯呴〉闈㈣繑鍥炰富椤甸潰鐨剈rl * @return {*} - */ + */ GetHomeUrl: () => { const param = { ID: 'QMS_INS_STD', colSlots: [], crudColSlots: [] }; return `/QMS_INS_STD/LC/${encodeURI(JSON.stringify(param))}`; }, - GetBaseColumns: () => { - return [ - { - title: '妫�楠岄」鐩紪鐮�', - dataIndex: 'INS_CODE', - // ifShow: false, - width: 180, - }, - { - title: '妫�楠岄」鐩悕绉�', - dataIndex: 'INS_NAME', - }, - { - title: '妫�楠岀被鍒紪鐮�', - dataIndex: 'CTGY_CODE', - }, - { - title: '妫�楠屾柟寮�', - dataIndex: 'INS_MODE', - customRender: ({ record }) => { - const type = record.INS_MODE; - var text = ''; - var color = 'green'; - switch (type) { - case 0: - text = '瀹氶噺妫�娴�'; - break; - case 1: - color = 'blue'; - text = '瀹氭�ф娴�'; - break; - } - return h(Tag, { color: color }, () => text); - }, - }, - { - title: '妫�楠屾爣鍑嗙紪鐮�', - dataIndex: 'TECH_STD', - }, - { - title: '鏄惁蹇呮', - dataIndex: 'IS_NECESSARY', - customRender: ({ record }) => { - const type = record.IS_NECESSARY; - 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_JUDGE', - customRender: ({ record }) => { - const type = record.IS_JUDGE; - 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: 'INS_TOOL', - }, - { - title: '娴嬭瘯鍊煎崟浣�', - dataIndex: 'QNTV_UNIT', - }, - { - title: '娴嬭瘯娆℃暟', - dataIndex: 'QNTV_TIMES', - }, - { - title: '鍋忓樊鍊�', - dataIndex: 'QNTV_DEVIATION', - }, - { - title: '澶囨敞', - dataIndex: 'REMARK', - }, - { - title: '鏇存柊鏃堕棿', - dataIndex: 'UPDATE_TIME', - }, - { - title: '鏇存柊浜�', - dataIndex: 'UPDATE_USER', - }, - ]; + GetBaseColumns: (type: string) => { + return baseColumns[type]; }, - GetSearchForm: () => { - return [ - { - field: 'INS_CODE', - label: '妫�楠岄」鐩紪鐮�', - component: 'Input', - colProps: { - span: 8, - }, - }, - { - label: '妫�楠岄」鐩悕绉�', - field: 'INS_NAME', - component: 'Input', - colProps: { - span: 8, - }, - }, - ]; + GetSearchForm: (type: string) => { + return searchForms[type]; }, - GetCrudForm: () => { - return [ - { - field: 'INS_CODE', - label: '妫�楠岄」鐩紪鐮�', - component: 'Input', - required: true, - colProps: { - span: 24, - }, - }, - { - label: '妫�楠岄」鐩悕绉�', - field: 'INS_NAME', - component: 'Input', - required: true, - colProps: { - span: 24, - }, - }, - { - label: '妫�楠岀被鍒紪鐮�', - field: 'CTGY_CODE', - component: 'Input', - colProps: { - span: 24, - }, - }, - { - label: '妫�楠屾爣鍑�', - field: 'TECH_STD', - component: 'ApiSelect', - colProps: { - span: 24, - }, - componentProps: { - api: getEntity, - params: { entityName: 'QMS_INS_STD', sqlcmd: ' 1=1 ' }, - resultField: 'Data.Items', - labelField: 'STD_NAME', - valueField: 'STD_CODE', - }, - dynamicDisabled: ({ values }) => { - return true; - }, - }, - { - label: '妫�楠屾柟寮�', - field: 'INS_MODE', - component: 'ApiSelect', - required: true, - colProps: { - span: 24, - }, - componentProps: { - api: GetEnum, - params: { name: 'QMS_INS_ITEM+INS_MODEs' }, - resultField: 'Data', - labelField: unref(getLocale) == 'zh_CN' ? 'Desc' : 'Name', - valueField: 'Value', - }, - }, - { - label: '澶囨敞', - field: 'REMARK', - component: 'Input', - colProps: { - span: 24, - }, - }, - { - label: 'ID', - field: 'ID', - component: 'Input', - colProps: { - span: 24, - }, - show: false, - }, - ]; + GetCrudForm: (type: string) => { + return crudForms[type]; }, GetBaseForm: () => { return [ @@ -364,6 +166,49 @@ // { name: 'rotinfo', slots: ['add'], preIcons: { add: 'search|svg' }, title: '宸ヨ壓淇℃伅' }, ]; }, + /** + * @description: 鑾峰彇鍙充晶杈规use鏂规硶 + * @return {*} + */ + GetUseDrawers: () => { + return [ + { + QMS_INS_ITEM: useDrawer(), + }, + ]; + }, + /** + * @description: 鑾峰彇琛ㄦ牸use鍒楄〃 + * @param {string} type + * @param {array} args + * @return {*} + */ + GetUseTables: (data: any[], ...args) => { + return { + QMS_INS_ITEM: useTable({ + title: '鍒楄〃淇℃伅', + dataSource: data, + columns: baseColumns['QMS_INS_ITEM'], + formConfig: { + labelWidth: 140, + schemas: searchForms['QMS_INS_ITEM'], + }, + useSearchForm: true, + showTableSetting: true, + bordered: true, + canResize: true, + showIndexColumn: false, + actionColumn: { + width: 130, + title: '鎿嶄綔', + dataIndex: 'action', + slots: { customRender: 'action' }, + fixed: 'right', + }, //鑷畾涔夋搷浣滃垪 + }), + MES_SHIFT_PRD: useTable(), + }; + }, OthersValues: (val: string, id: string) => { return { TECH_STD: val }; }, @@ -376,7 +221,9 @@ return { pageTitle: '妫�楠屾爣鍑嗙鐞�', pageContent: '杩欓噷鍙互娣诲姞鍜屼慨鏀规楠屾爣鍑嗗拰妫�楠岄」鐩��', - baseTableTitle: '妫�楠岄」鐩鐞�', + tableTitle: { + QMS_INS_ITEM: '妫�楠岄」鐩鐞�', + }, }; }, }; @@ -407,6 +254,217 @@ } } + const baseColumns = { + QMS_INS_ITEM: [ + { + title: '妫�楠岄」鐩紪鐮�', + dataIndex: 'INS_CODE', + // ifShow: false, + width: 180, + }, + { + title: '妫�楠岄」鐩悕绉�', + dataIndex: 'INS_NAME', + }, + { + title: '妫�楠岀被鍒紪鐮�', + dataIndex: 'CTGY_CODE', + }, + { + title: '妫�楠屾柟寮�', + dataIndex: 'INS_MODE', + customRender: ({ record }) => { + const type = record.INS_MODE; + var text = ''; + var color = 'green'; + switch (type) { + case 0: + text = '瀹氶噺妫�娴�'; + break; + case 1: + color = 'blue'; + text = '瀹氭�ф娴�'; + break; + } + return h(Tag, { color: color }, () => text); + }, + }, + { + title: '妫�楠屾爣鍑嗙紪鐮�', + dataIndex: 'TECH_STD', + }, + { + title: '鏄惁蹇呮', + dataIndex: 'IS_NECESSARY', + customRender: ({ record }) => { + const type = record.IS_NECESSARY; + 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_JUDGE', + customRender: ({ record }) => { + const type = record.IS_JUDGE; + 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: 'INS_TOOL', + }, + { + title: '娴嬭瘯鍊煎崟浣�', + dataIndex: 'QNTV_UNIT', + }, + { + title: '娴嬭瘯娆℃暟', + dataIndex: 'QNTV_TIMES', + }, + { + title: '鍋忓樊鍊�', + dataIndex: 'QNTV_DEVIATION', + }, + { + title: '澶囨敞', + dataIndex: 'REMARK', + }, + { + title: '鏇存柊鏃堕棿', + dataIndex: 'UPDATE_TIME', + }, + { + title: '鏇存柊浜�', + dataIndex: 'UPDATE_USER', + }, + ], + }; + + const searchForms = { + QMS_INS_ITEM: [ + { + field: 'INS_CODE', + label: '妫�楠岄」鐩紪鐮�', + component: 'Input', + colProps: { + span: 8, + }, + }, + { + label: '妫�楠岄」鐩悕绉�', + field: 'INS_NAME', + component: 'Input', + colProps: { + span: 8, + }, + }, + ], + }; + + const crudForms = { + QMS_INS_ITEM: [ + { + field: 'INS_CODE', + label: '妫�楠岄」鐩紪鐮�', + component: 'Input', + required: true, + colProps: { + span: 24, + }, + }, + { + label: '妫�楠岄」鐩悕绉�', + field: 'INS_NAME', + component: 'Input', + required: true, + colProps: { + span: 24, + }, + }, + { + label: '妫�楠岀被鍒紪鐮�', + field: 'CTGY_CODE', + component: 'Input', + colProps: { + span: 24, + }, + }, + { + label: '妫�楠屾爣鍑�', + field: 'TECH_STD', + component: 'ApiSelect', + colProps: { + span: 24, + }, + componentProps: { + api: getEntity, + params: { entityName: 'QMS_INS_STD', sqlcmd: ' 1=1 ' }, + resultField: 'Data.Items', + labelField: 'STD_NAME', + valueField: 'STD_CODE', + }, + dynamicDisabled: ({ values }) => { + return true; + }, + }, + { + label: '妫�楠屾柟寮�', + field: 'INS_MODE', + component: 'ApiSelect', + required: true, + colProps: { + span: 24, + }, + componentProps: { + api: GetEnum, + params: { name: 'QMS_INS_ITEM+INS_MODEs' }, + resultField: 'Data', + labelField: unref(getLocale) == 'zh_CN' ? 'Desc' : 'Name', + valueField: 'Value', + }, + }, + { + label: '澶囨敞', + field: 'REMARK', + component: 'Input', + colProps: { + span: 24, + }, + }, + { + label: 'ID', + field: 'ID', + component: 'Input', + colProps: { + span: 24, + }, + show: false, + }, + ], + }; + return [methods, ActionColumn]; } diff --git a/src/views/tigerprojects/system/lowcode/entityts/QMS_INS_STD.ts b/src/views/tigerprojects/system/lowcode/entityts/QMS_INS_STD.ts index 5eddc8d..4352564 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/QMS_INS_STD.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/QMS_INS_STD.ts @@ -4,7 +4,7 @@ * @version: * @Date: 2024-06-19 20:34:27 * @LastEditors: Ben Lin - * @LastEditTime: 2024-06-26 18:33:23 + * @LastEditTime: 2024-07-01 20:16:53 */ import { ActionItem, BasicColumn } from '/@/components/Table'; @@ -25,7 +25,7 @@ /** * @description: 涓�浜涜嚜瀹氭柟娉� * @return {*} - */ + */ const methods = { /** * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓� @@ -43,6 +43,7 @@ pCode: 'TECH_STD', //璺宠浆鍒伴珮绾ц〃鍗曠殑鍏抽敭瀛楁鍚� mCode: 'STD_CODE', //璺宠浆鍒伴珮绾ц〃鍗曠殑鍏抽敭瀛楁鍚嶆槧灏勫瓧娈� IsID: false, + drawers: [{ name: 'QMS_INS_ITEM', code: 'STD_CODE' }], //IfShow: true:楂樼骇琛ㄥ崟鏄惁鏄剧ず瀛愯〃鏍煎鍒犳敼锛宒rawers鏄彸杈瑰脊鍑哄鏀逛晶妗嗙殑鍚嶅瓧鍒楄〃 }, }; }, @@ -125,6 +126,7 @@ pCode: 'TECH_STD', //璺宠浆鍒伴珮绾ц〃鍗曠殑鍏抽敭瀛楁鍚� mCode: 'STD_CODE', //璺宠浆鍒伴珮绾ц〃鍗曠殑鍏抽敭瀛楁鍚嶆槧灏勫瓧娈� IsID: false, + drawers: [{ name: 'QMS_INS_ITEM', code: 'STD_CODE' }], //drawers鏄彸杈瑰脊鍑哄鏀逛晶妗嗙殑鍚嶅瓧鍒楄〃 }; args[5](`/QMS_INS_ITEM/High/${encodeURI(JSON.stringify(param))}`); } diff --git a/src/views/tigerprojects/system/lowcode/high/dtl.vue b/src/views/tigerprojects/system/lowcode/high/dtl.vue index fe75899..f7b1691 100644 --- a/src/views/tigerprojects/system/lowcode/high/dtl.vue +++ b/src/views/tigerprojects/system/lowcode/high/dtl.vue @@ -1,35 +1,46 @@ <template> <div> - <BasicTable @register="registerTable"> - <template #toolbar> - <a-button type="primary" @click="handleCreate" preIcon="add_02|svg"> 鏂板 </a-button> - </template> - <template #action="{ record }"> - <TableAction :actions="createActions(record)" /> - </template> - <template #[item]="{ field }" v-for="item in colSlots" :key="item"> - <!-- <template #form-BAS_REASON3aadd="{ field }"> --> - <a-button - v-if="field" - class="mt-1 ml-1" - size="small" - @click="handleSelectItem(item)" - preIcon="search|svg" - /> - <GeneralModal - @register="registerItemAdd" - @success="(d, u) => handleItemSuccess(d, u, item)" - /> - </template> - </BasicTable> - <normalDrawer @register="registerDrawer" @success="handleSuccess" /> + <a-card + :title="GetTitle()['tableTitle'][item.name]" + :bordered="false" + class="!mt-5" + v-for="(item, index) in drawers" + > + <BasicTable @register="useTables[item.name]"> + <template #toolbar> + <a-button type="primary" @click="handleCreate(index, item.name)" preIcon="add_02|svg"> + 鏂板 + </a-button> + </template> + <template #action="{ record }"> + <TableAction :actions="createActions(record, index, item.name)" /> + </template> + <template #[item]="{ field }" v-for="item in colSlots" :key="item"> + <!-- <template #form-BAS_REASON3aadd="{ field }"> --> + <a-button + v-if="field" + class="mt-1 ml-1" + size="small" + @click="handleSelectItem(item)" + preIcon="search|svg" + /> + <GeneralModal + @register="registerItemAdd" + @success="(d, u) => handleItemSuccess(d, u, item)" + /> + </template> + </BasicTable> + <normalDrawer + @register="useDrawers[index][item.name]" + @success="(d, u) => handleSuccess(d, u, item.name)" + /> + </a-card> </div> </template> <script lang="ts" setup> import { Ref, inject, nextTick, onMounted, ref, watch } from 'vue'; import { BasicTable, useTable, TableAction } from '/@/components/Table'; import { BasicForm, useForm } from '/@/components/Form/index'; - import { useDrawer } from '/@/components/Drawer'; import GeneralModal from '/@/views/components/GeneralModal.vue'; import normalDrawer from '../normalDrawer.vue'; import { isNullOrEmpty, isNullOrUnDef } from '/@/utils/is'; @@ -37,9 +48,11 @@ import { useGo } from '/@/hooks/web/usePage'; import { DeleteEntity, getEntity } from '/@/api/tigerapi/system'; import { useI18n } from '/@/hooks/web/useI18n'; + import { Card } from 'ant-design-vue'; + import { EntityCustFunctionType } from '/@/api/tigerapi/model/basModel'; const { t } = useI18n(); - + const ACard = Card; const props = defineProps({ colSlots: { type: Array as PropType<any[]> }, useTableData: { type: Object as PropType<{}>, default: { table: [] } }, @@ -47,43 +60,53 @@ crudColSlots: { type: Object as PropType<any> }, }); const objParams = inject('objParams') as Ref<any>; - const data = inject('data') as Ref<Recordable[]>; + const data = inject('data') as Ref<any>; const useFormData = inject('useFormData') as Ref<{}>; const others = inject('others') as Ref<Recordable[]>; const go = useGo(); - const [registerDrawer, { openDrawer }] = useDrawer(); const [registerItemAdd, { openModal: openItemModal }] = useModal(); const cType = ref(''); const dtlSlots = ref([] as any[]); const selectVals = ref({}); const baseCards = ref([] as any[]); - const otherCards = ref([] as any[]); const useModalData = ref({}); //琛ㄥ崟涓彃妲芥覆鏌撴寜閽墦寮�妯℃�佹useModal鏂规硶 - const custImport = ref<any[]>(await import(`../entityts/${props.entityName}.ts`)); - const [{ EditOperation, GetBaseColumns, GetSearchForm, GetCrudForm, OthersValues }] = - custImport.value['default'](); - others.value = OthersValues(objParams['CODE'], objParams['ID']); - const [registerTable, { getForm, reload, setProps }] = useTable({ - title: '鍒楄〃淇℃伅', - dataSource: data, - columns: GetBaseColumns(), - formConfig: { - labelWidth: 140, - schemas: GetSearchForm(), + const custImport = ref<any[]>([]); + const EntityCustFunction = ref([ + { + ActionItem(params, data, ...args) {}, + EditOperation(data, d, u, item) {}, + GetBaseColumns(type: string | undefined) {}, + GetSearchForm(type: string | undefined) {}, + GetCrudForm(type: string | undefined, ...args) {}, + OthersValues(val, id) {}, + GetTitle(type: string | undefined) {}, + GetUseTables(data: Ref<Recordable[]>, ...args) {}, + GetUseDrawers() {}, + } as EntityCustFunctionType, + ]); + /* 鍔ㄦ�乮mport瀹炰綋鍚�.ts鐨勮嚜瀹氫箟鏂规硶 */ + try { + custImport.value = await import(`../entityts/${props.entityName}.ts`); + } catch (e) {} + const [ + { + ActionItem: nActionItem, + EditOperation, + GetBaseColumns, + GetSearchForm, + GetCrudForm, + OthersValues, + GetTitle, + GetUseTables, + GetUseDrawers, }, - useSearchForm: true, - showTableSetting: true, - bordered: true, - canResize: true, - showIndexColumn: false, - actionColumn: { - width: 130, - title: '鎿嶄綔', - dataIndex: 'action', - slots: { customRender: 'action' }, - fixed: 'right', - }, //鑷畾涔夋搷浣滃垪 - }); + ] = isNullOrUnDef(custImport.value['default']) + ? EntityCustFunction.value + : custImport.value['default'](); + others.value = OthersValues(objParams['CODE'], objParams['ID']); + const drawers = ref<any[]>(objParams['drawers']); + const useTables = GetUseTables(data); + const useDrawers = GetUseDrawers(); // watch( // () => props.dataSource, // (newVal, oldVal) => { @@ -100,15 +123,27 @@ // { deep: true, immediate: true }, // ); - onMounted(() => { - getEntity({ - sqlcmd: ` ${objParams['pCode']} = '${others.value[objParams['pCode']]}'`, - entityName: props.entityName as string, - }).then((res) => { - if (!isNullOrEmpty(res.Data.Items)) { - data.value = res.Data.Items; + onMounted(async () => { + for (const i in drawers.value) { + let sqlcmd = ' 1 =1 '; + if (!isNullOrEmpty(others.value[drawers.value[i].code])) { + sqlcmd += ` And ${drawers.value[i].code} = '${others.value[drawers.value[i].code]}'`; } - }); + const list = await getEntity({ + sqlcmd: sqlcmd, + entityName: drawers.value[i].name, + }); + if (!isNullOrEmpty(list.Data) && !isNullOrEmpty(list.Data.Items)) { + data.value[drawers.value[i].name] = list.Data.Items; + useTables[drawers.value[i].name][1].setProps({ + dataSource: [], + }); + useTables[drawers.value[i].name][1].setProps({ + dataSource: data.value[drawers.value[i].name], + }); + useTables[drawers.value[i].name][1].reload(); + } + } }); /** @@ -116,13 +151,13 @@ * @param {*} record * @return {*} */ - function createActions(record) { + function createActions(record,index, item) { const params = { record, isUpdate: true, ifSave: true, entityName: props.entityName, - formJson: GetCrudForm(), //getFormSchema(`${entityName.value}_Crud`), + formJson: GetCrudForm(item), //getFormSchema(`${entityName.value}_Crud`), cType, dtlSlots, useModalData, @@ -133,7 +168,7 @@ const actionItem = [ { icon: 'clarity:note-edit-line', - onClick: editRecord.bind(null, openDrawer, params), + onClick: editRecord.bind(null, useDrawers[index][item][1].openDrawer, params), }, { icon: 'ant-design:delete-outlined', @@ -141,7 +176,7 @@ popConfirm: { title: '鏄惁纭鍒犻櫎?', placement: 'left', - confirm: deleteRecord.bind(null, reload, params), + confirm: deleteRecord.bind(null, useTables[item][1].reload, params), }, }, ]; @@ -152,13 +187,13 @@ return ActionItem( params, actionItem, - openDrawer, - reload, + useDrawers[index][item][1].openDrawer, + useTables[item][1].reload, null, useForm, useModal, go, - setProps, + useTables[item][1].setProps, ); } @@ -202,7 +237,7 @@ return validates; } - function handleCreate() { + function handleCreate(index, item) { validate().then((res) => { const Keys = Object.getOwnPropertyNames(useFormData.value); let i; @@ -214,11 +249,11 @@ ? res[Keys[i]][objParams['mCode']] : res[Keys[i]][objParams['pCode']]; } - openDrawer(true, { + useDrawers[index][item][1].openDrawer(true, { isUpdate: false, ifSave: true, entityName: props.entityName, - formJson: GetCrudForm(), //getFormSchema(`${entityName.value}_Crud`), + formJson: GetCrudForm(item), //getFormSchema(`${entityName.value}_Crud`), crudColSlots: props.crudColSlots, others: others.value, }); @@ -231,17 +266,17 @@ * @param {*} u * @return {*} */ - function handleSuccess(d, u) { + function handleSuccess(d, u, item) { if (!isNullOrUnDef(custImport.value)) { /* 鑷畾涔夌紪杈戞柟娉曪紝鏍规嵁瀹炰綋鍚嶅幓璋冪敤 */ - EditOperation(data, d, u); - setProps({ + EditOperation(data, d, u, item); + useTables[item][1].setProps({ dataSource: [], }); - setProps({ - dataSource: data, + useTables[item][1].setProps({ + dataSource: data.value[item], }); - reload(); + useTables[item][1].reload(); } } @@ -256,14 +291,14 @@ /* 鍔ㄦ�乮mport瀹炰綋鍚�.ts鐨勮嚜瀹氫箟鏂规硶 */ try { import( - `../entityts/${getForm().getFieldsValue()[`${item.replace(/form-/, '').replace(/add/, '')}PSelect_0`]}.ts` + `../entityts/${useTables[item][1].getForm().getFieldsValue()[`${item.replace(/form-/, '').replace(/add/, '')}PSelect_0`]}.ts` ) .then((m) => { const [{ GetSelectSuccess }] = m.default(); - getForm().setFieldsValue(GetSelectSuccess(d, u)); + useTables[item][1].getForm().setFieldsValue(GetSelectSuccess(d, u)); }) .catch(() => { - getForm().setFieldsValue({ + useTables[item][1].getForm().setFieldsValue({ ITEM_CODE: d.values['val'], }); }); diff --git a/src/views/tigerprojects/system/lowcode/high/index.vue b/src/views/tigerprojects/system/lowcode/high/index.vue index 8c1b248..8a05ce8 100644 --- a/src/views/tigerprojects/system/lowcode/high/index.vue +++ b/src/views/tigerprojects/system/lowcode/high/index.vue @@ -4,7 +4,7 @@ * @version: * @Date: 2024-06-18 15:09:48 * @LastEditors: Ben Lin - * @LastEditTime: 2024-06-26 03:14:29 + * @LastEditTime: 2024-07-02 03:42:25 --> <!-- * _oo0oo_ @@ -51,11 +51,11 @@ <Suspense> <baseForm /> </Suspense> - <a-card :title="titleInfo['baseTableTitle']" :bordered="false" class="!mt-5"> + <!-- <a-card :title="titleInfo['baseTableTitle']" :bordered="false" class="!mt-5"> --> <Suspense> <dtl :entityName="entityName" /> </Suspense> - </a-card> + <!-- </a-card> --> <a-card :title="item.title" :bordered="false" @@ -99,7 +99,7 @@ </PageWrapper> </template> <script lang="ts" setup> - import { Ref, h, nextTick, onMounted, provide, ref, unref } from 'vue'; + import { Ref, h, nextTick, onMounted, provide, reactive, ref, unref } from 'vue'; import { Card } from 'ant-design-vue'; import { PageWrapper } from '/@/components/Page'; import dtl from './dtl.vue'; @@ -119,6 +119,7 @@ import { buildUUID } from '/@/utils/uuid'; import { isNullOrEmpty, isNullOrUnDef } from '/@/utils/is'; import { useI18n } from '/@/hooks/web/useI18n'; +import { Reactified } from '@vueuse/core'; const { t } = useI18n(); @@ -151,9 +152,12 @@ const isMounted = ref(false); const custImport = ref<any[]>([]); const others = ref<any>(null); - const data = ref<Recordable[]>([]); + const data = ref<any>({}); + for(const i in objParams.value['drawers']){ + data.value[objParams.value['drawers'][i]['name']] = ref<Recordable[]>([]); + } provide<Ref<any>>('objParams', objParams.value); - provide<Ref<Recordable[]>>('data', data); + provide<Ref<any>>('data', data); provide<Ref<any>>('others', others); provide<Ref<{}>>('useFormData', useFormData); provide<Ref<any>>('baseCards', baseCards); diff --git a/src/views/tigerprojects/system/lowcode/normal/mainTable.vue b/src/views/tigerprojects/system/lowcode/normal/mainTable.vue index 1e11a42..ff8814e 100644 --- a/src/views/tigerprojects/system/lowcode/normal/mainTable.vue +++ b/src/views/tigerprojects/system/lowcode/normal/mainTable.vue @@ -85,9 +85,9 @@ { ActionItem(params, data, ...args) {}, EditOperation(data, d, u) {}, - GetBaseColumns() {}, - GetSearchForm() {}, - GetCrudForm(type: string) {}, + GetBaseColumns(type: string | undefined) {}, + GetSearchForm(type: string | undefined) {}, + GetCrudForm(type: string | undefined, ...args) {}, OthersValues(val, id) {}, } as EntityCustFunctionType, ]); -- Gitblit v1.9.3