From 5a813f3b28f3cbf1db3a3657ccf83267c6e0d315 Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期四, 24 十月 2024 11:22:02 +0800 Subject: [PATCH] 工艺路线相关优化 --- src/store/modules/queryInpage.ts | 22 +++- src/api/tigerapi/mes/router.ts | 8 src/views/tigerprojects/system/lowcode/entityts/ProdRouteBinding.ts | 25 +++- src/api/tigerapi/mes/mesApi.ts | 2 src/views/tigerprojects/system/lowcode/data.ts | 54 ++++++++++ src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO.ts | 3 src/views/tigerprojects/mes/eng/route/components/PostProps.vue | 4 src/views/tigerprojects/system/lowcode/entityts/WoRouteBinding.ts | 54 +++------- src/views/tigerprojects/system/lowcode/normal/mainTable.vue | 48 ++------- src/api/tigerapi/model/mesModel.ts | 4 src/views/components/GeneralCrudModal.vue | 21 +++- src/views/tigerprojects/system/lowcode/setting/index.vue | 39 ++++++- 12 files changed, 180 insertions(+), 104 deletions(-) diff --git a/src/api/tigerapi/mes/mesApi.ts b/src/api/tigerapi/mes/mesApi.ts index 0d6cad0..f3e2209 100644 --- a/src/api/tigerapi/mes/mesApi.ts +++ b/src/api/tigerapi/mes/mesApi.ts @@ -28,7 +28,7 @@ RouteToProd = '/MES/RouteToProd', RouteToCust = '/MES/RouteToCust', SaveMesBatchWo = '/MES/SaveMesBatchWo', - SP_MES_PROD2WO = '/MES/SP_MES_PROD2WO', + ProdRouteToWo = '/MES/ProdRouteToWo', SP_MES_WO2CUST = '/MES/SP_MES_WO2CUST', DeleteWoRoute = '/MES/DeleteWoRoute', DeleteProdRoute = '/MES/DeleteProdRoute', diff --git a/src/api/tigerapi/mes/router.ts b/src/api/tigerapi/mes/router.ts index 606ff18..7e87179 100644 --- a/src/api/tigerapi/mes/router.ts +++ b/src/api/tigerapi/mes/router.ts @@ -4,7 +4,7 @@ import { MES_ROUTE, MES_ROUTE_NODE_POST, RouteData, V_MES_ROUTE_PTREE, V_MES_WO_PTREE } from '../model/router'; import { mesApi } from './mesApi'; import { useUserStore } from '/@/store/modules/user'; -import { DelProdRotInput, DelWoRotInput, ProdRotInput, RoutePageListGetResultModel, RoutelistPageParams } from '../model/mesModel'; +import { DelProdRotInput, DelWoRotInput, ProdRotInput, RoutePageListGetResultModel, RoutelistPageParams, WoRotInput } from '../model/mesModel'; import { buildUUID } from '/@/utils/uuid'; /** @@ -308,9 +308,9 @@ * @param {*} params * @return {*} */ -export const SP_MES_PROD2WO = async (params: {}) => { - const data = await defHttp.get( - { url: mesApi.SP_MES_PROD2WO, params: params }, +export const ProdRouteToWo = async (params: WoRotInput) => { + const data = await defHttp.post( + { url: mesApi.ProdRouteToWo, params: genAction('', params) }, { errorMessageMode: 'none', isTransformResponse: false, diff --git a/src/api/tigerapi/model/mesModel.ts b/src/api/tigerapi/model/mesModel.ts index b15dcba..bf91445 100644 --- a/src/api/tigerapi/model/mesModel.ts +++ b/src/api/tigerapi/model/mesModel.ts @@ -510,6 +510,10 @@ isDefault: boolean; } +export interface WoRotInput extends RouteInput { + wo: string; +} + /** * @description: 宸ヨ壓璺嚎鏍戝舰 * @return {*} diff --git a/src/store/modules/queryInpage.ts b/src/store/modules/queryInpage.ts index d1b907c..4c4a1e5 100644 --- a/src/store/modules/queryInpage.ts +++ b/src/store/modules/queryInpage.ts @@ -4,11 +4,12 @@ * @version: * @Date: 2024-06-18 15:09:47 * @LastEditors: Ben Lin - * @LastEditTime: 2024-10-21 20:32:10 + * @LastEditTime: 2024-10-23 22:52:45 */ import { defineStore } from 'pinia'; import { store } from '@/store'; import { isNullOrEmpty } from '/@/utils/is'; +import { useUserStore } from './user'; interface QueryState { curSearchInfo: any[]; @@ -21,7 +22,7 @@ state: (): QueryState => ({ curSearchInfo: [], curPageName: '', - curCPInfo: [] + curCPInfo: [], }), getters: { getCurSearchInfo(state): any[] { @@ -43,6 +44,15 @@ this.curSearchInfo.map((item) => { if (item.name == val.name) { item.searchInfo = val.searchInfo; + item.ByOrg = isNullOrEmpty(val.ByOrg) ? false : val.ByOrg; + item.searchInfo.option = !item.ByOrg + ? '' + : { + //鏍规嵁鎹偣鏌ヨ锛屽繀闇�甯﹁繖涓弬鏁� + UserId: useUserStore().getUserInfo.userId, + ByOrg: true, + CurOrg: useUserStore().getUserInfo.orgCode, + }; } }); } @@ -76,11 +86,11 @@ * @param {string} tid * @return {*} */ - async submitFunc(name, f) { - this.setCurSearchInfo({ name: name, searchInfo: f.getFieldsValue() }); + async submitFunc(name, f, ByOrg: boolean) { + this.setCurSearchInfo({ name: name, searchInfo: f.getFieldsValue(), ByOrg: ByOrg }); }, - async resetFunc(name, f) { - this.setCurSearchInfo({ name: name, searchInfo: f.getFieldsValue() }); + async resetFunc(name, f, ByOrg: boolean) { + this.setCurSearchInfo({ name: name, searchInfo: f.getFieldsValue(), ByOrg: ByOrg }); }, }, }); diff --git a/src/views/components/GeneralCrudModal.vue b/src/views/components/GeneralCrudModal.vue index 8a49781..3611598 100644 --- a/src/views/components/GeneralCrudModal.vue +++ b/src/views/components/GeneralCrudModal.vue @@ -110,10 +110,21 @@ console.log(`绗�${index + 1}寮犲浘鐗囧凡鍔犺浇锛孶RL涓猴細${url}`, dom); }; // 鍙互浣跨敤createImgPreview杩斿洖鐨� PreviewActions 鏉ユ帶鍒堕瑙堥�昏緫锛屽疄鐜扮被浼煎够鐏墖銆佽嚜鍔ㄦ棆杞箣绫荤殑楠氭搷浣� + const Keys = Object.getOwnPropertyNames(others.value); + let path = ''; + dataSource.map((item) => { + for (const k in Keys) { + if (item[Keys[k]] == others.value[Keys[k]] && !isNullOrEmpty(others.value[Keys[k]])) { + path = item['LABEL_VIEW_PATH']; + return; + } + } + }); + if(isNullOrEmpty(path)){ + path = dataSource.filter((q) => isNullOrEmpty(q.WORK_ORDER) || isNullOrEmpty(q.PROD_CODE))[0].LABEL_VIEW_PATH; + } createImgPreview({ - imageList: [ - dataSource.filter((q) => q.WORK_ORDER == others.value.WORK_ORDER)[0].LABEL_VIEW_PATH, - ], + imageList: [path], defaultWidth: 700, rememberState: true, onImgLoad, @@ -166,7 +177,7 @@ * @return {*} */ function handleDel(record: EditRecordRow) { - if (!isNullOrEmpty(record.WORK_ORDER)) { + if (!isNullOrEmpty(record.WORK_ORDER) || !isNullOrEmpty(record.PROD_CODE)) { //鍒犻櫎 DeleteEntity(record, ctype.value).then((action) => { if (action.IsSuccessed) { @@ -190,7 +201,7 @@ reload(); } }); - }else{ + } else { msg.error({ content: t('娌℃湁闇�瑕佸垹闄ょ殑鍙橀噺'), key: 'saving' }); } } diff --git a/src/views/tigerprojects/mes/eng/route/components/PostProps.vue b/src/views/tigerprojects/mes/eng/route/components/PostProps.vue index b9c0b19..cb2dce0 100644 --- a/src/views/tigerprojects/mes/eng/route/components/PostProps.vue +++ b/src/views/tigerprojects/mes/eng/route/components/PostProps.vue @@ -1,10 +1,10 @@ <!-- - * @Description: file content + * @Description: 宸ヨ壓璺嚎宀椾綅璧勬簮缁存姢 * @Author: Ben Lin * @version: * @Date: 2024-06-11 21:07:04 * @LastEditors: Ben Lin - * @LastEditTime: 2024-08-04 18:34:26 + * @LastEditTime: 2024-10-23 21:36:49 --> <!-- * @Description: 鍙充晶灞炴�ч潰鏉挎帶浠� 琛ㄥ崟灞炴�ч潰鏉� diff --git a/src/views/tigerprojects/system/lowcode/data.ts b/src/views/tigerprojects/system/lowcode/data.ts index c5ec40c..8136cb0 100644 --- a/src/views/tigerprojects/system/lowcode/data.ts +++ b/src/views/tigerprojects/system/lowcode/data.ts @@ -4,7 +4,7 @@ * @version: * @Date: 2024-06-02 17:52:35 * @LastEditors: Ben Lin - * @LastEditTime: 2024-10-15 20:55:16 + * @LastEditTime: 2024-10-23 23:01:49 */ import { ActionItem, FormSchema, PopConfirm } from '/@/components/Table'; @@ -19,6 +19,8 @@ import { formatToDateTime } from '/@/utils/dateUtil'; import { DeleteEntity, getEntity } from '/@/api/tigerapi/system'; import { useGo } from '/@/hooks/web/usePage'; +import { useQueryStore } from '/@/store/modules/queryInpage'; +import { RouteRecordName } from 'vue-router'; const { t } = useI18n(); /** @@ -379,3 +381,53 @@ go(`${path}/${encodeURI(JSON.stringify({ sName: id.sName}))}`); } } + + + + /** + * @description: 璋冪敤api鍓嶏紝鍙傛暟鏁寸悊 + * @param {*} t + * @return {*} + */ + export function SearchInfoFn(param: any, name: RouteRecordName | null | undefined, ByOrg: boolean) { + const useQuery = useQueryStore(); + if ( + !isNullOrUnDef(useQuery.getCurSearchInfo) && + useQuery.getCurSearchInfo.some((q) => q.name == name) + ) { + const curSearchInfo = useQuery.getCurSearchInfo.filter((q) => q.name == name); + const Keys = Object.getOwnPropertyNames(curSearchInfo[0].searchInfo); + for (const k in Keys) { + if (Keys[k] != 'page' && Keys[k] != 'pageSize') { + param[Keys[k]] = curSearchInfo[0].searchInfo[Keys[k]]; + } + } + useQuery.setCurSearchInfo({ name: name, searchInfo: param }); + } + if (isNullOrEmpty(param.option) && ByOrg) { + param.option = { + //鏍规嵁鎹偣鏌ヨ锛屽繀闇�甯﹁繖涓弬鏁� + UserId: useUserStore().getUserInfo.userId, + ByOrg: true, + CurOrg: useUserStore().getUserInfo.orgCode, + }; + } + return param; + } + + + /** + * @description: 璇锋眰涔嬪悗瀵硅繑鍥炲�艰繘琛屽鐞� + * @param {*} t + * @return {*} + */ + export function afterFetchFn(t: any, name: RouteRecordName | null | undefined, f) { + const useQuery = useQueryStore(); + if ( + !isNullOrUnDef(useQuery.getCurSearchInfo) && + useQuery.getCurSearchInfo.some((q) => q.name == name) + ) { + const curSearchInfo = useQuery.getCurSearchInfo.filter((q) => q.name == name); + f.setFieldsValue(curSearchInfo[0].searchInfo); + } + } diff --git a/src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO.ts b/src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO.ts index bd2cc87..85c5dc0 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO.ts @@ -4,7 +4,7 @@ * @version: * @Date: 2024-06-19 20:34:27 * @LastEditors: Ben Lin - * @LastEditTime: 2024-10-22 11:01:43 + * @LastEditTime: 2024-10-23 20:48:14 */ import { Ref, h, ref, render, unref } from 'vue'; @@ -20,7 +20,6 @@ import { CustModalParams, FunctionType } from '/@/api/tigerapi/model/systemModel'; import { SaveMesBatchWo } from '/@/api/tigerapi/mes/wo'; import { useForm } from '/@/components/Form/index'; -import { SP_MES_PROD2WO } from '/@/api/tigerapi/mes/router'; import { cloneDeep } from 'lodash-es'; import { useProdRouteStore } from '/@/store/modules/prodRoute'; diff --git a/src/views/tigerprojects/system/lowcode/entityts/ProdRouteBinding.ts b/src/views/tigerprojects/system/lowcode/entityts/ProdRouteBinding.ts index a15001d..1b8ed42 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/ProdRouteBinding.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/ProdRouteBinding.ts @@ -4,7 +4,7 @@ * @version: * @Date: 2024-06-19 20:34:27 * @LastEditors: Ben Lin - * @LastEditTime: 2024-10-22 09:57:47 + * @LastEditTime: 2024-10-24 01:21:57 */ import { Ref, h, ref, render, unref } from 'vue'; @@ -33,6 +33,7 @@ import { buildUUID } from '/@/utils/uuid'; import { AddOrEditLabelVarByWorkOrder } from '/@/api/tigerapi/mes/wo'; import { useProdRouteStore } from '/@/store/modules/prodRoute'; +import { useWebSocketStore } from '/@/store/modules/websocket'; const { t } = useI18n(); const { createErrorModal } = useMessage(); @@ -233,9 +234,7 @@ ? ents.Data.Items : JSON.parse(res.Data.Items[0].OPTION_1); /* 濡傛灉OPTION_1瀛楁涓虹┖灏辨妸鍖呰淇℃伅杞琂SON瀛樺埌OPTION_1瀛楁 */ - res.Data.Items[0].OPTION_1 = isNullOrEmpty(res.Data.Items[0].OPTION_1) - ? JSON.stringify(ents.Data.Items) - : res.Data.Items[0].OPTION_1; + res.Data.Items[0].OPTION_1 = JSON.stringify(result['BAS_PKG_DTL']); } /* 濡傛灉鏄粍瑁呬笂鏂� */ if (res.Data.Items[0].ACT_TYPE == 2) { result['name'] = 'ItemCode'; @@ -853,7 +852,7 @@ resolve('OK'); break; case 'BAS_LABEL_VAR_WO': - param.values['WORK_ORDER'] = param.others['WORK_ORDER']; + param.values['PROD_CODE'] = param.others['PROD_CODE']; param.values['ID'] = buildUUID(); var action = await AddOrEditLabelVarByWorkOrder( param.values as unknown as BAS_LABEL_VAR_WO, @@ -863,6 +862,14 @@ /* 璁剧疆榛樿宸ヨ壓璺嚎 */ var action = await useProdRoute.setDefaulRoute(param); resolve(action); + case 'delete': + const webSocketStore = useWebSocketStore(); + if (webSocketStore.GetSocketState == 1) { + webSocketStore.sendMessage( + `wsGetNew ${param.values['LABEL_ID']}_#_${param.values['PROD_CODE']}`, + ); + } + break; } } catch (e) { reject(e); @@ -1846,11 +1853,17 @@ title: '宸ュ崟鍙�', dataIndex: 'WORK_ORDER', width: 280, - editRow: true, + // editRow: true, // editable: true, ifShow: false, }, { + title: '宸ュ崟鍙�', + dataIndex: 'PROD_CODE', + width: 280, + ifShow: false, + }, + { title: '鍙橀噺鍚�', dataIndex: 'VAR_NAME', }, diff --git a/src/views/tigerprojects/system/lowcode/entityts/WoRouteBinding.ts b/src/views/tigerprojects/system/lowcode/entityts/WoRouteBinding.ts index 3bc1df4..45b78df 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/WoRouteBinding.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/WoRouteBinding.ts @@ -4,14 +4,14 @@ * @version: * @Date: 2024-06-19 20:34:27 * @LastEditors: Ben Lin - * @LastEditTime: 2024-10-22 23:36:24 + * @LastEditTime: 2024-10-23 23:55:56 */ -import { Ref, h, ref, render, unref } from 'vue'; +import { Ref, unref } from 'vue'; import { DeleteWoRoute, GetWoPTree, - SP_MES_PROD2WO, + ProdRouteToWo, SP_MES_WO2CUST, } from '/@/api/tigerapi/mes/router'; import { GetEnum, SaveEntity, convertToTree, getEntity } from '/@/api/tigerapi/system'; @@ -331,10 +331,9 @@ ? ents.Data.Items : JSON.parse(res.Data.Items[0].OPTION_1); /* 濡傛灉OPTION_1瀛楁涓虹┖灏辨妸鍖呰淇℃伅杞琂SON瀛樺埌OPTION_1瀛楁 */ - res.Data.Items[0].OPTION_1 = isNullOrEmpty(res.Data.Items[0].OPTION_1) - ? JSON.stringify(ents.Data.Items) - : res.Data.Items[0].OPTION_1; - } /* 濡傛灉鏄粍瑁呬笂鏂� */ + res.Data.Items[0].OPTION_1 = JSON.stringify(result['BAS_PKG_DTL']); + } + /* 濡傛灉鏄粍瑁呬笂鏂� */ if (res.Data.Items[0].ACT_TYPE == 2) { result['name'] = 'ItemCode'; result['ItemCode'] = JSON.parse(res.Data.Items[0].OPTION_1); @@ -551,33 +550,18 @@ return; } /* 鏇存柊宸ュ崟鐘舵�佸苟鐢熸垚宸ュ崟鐨勫伐鑹鸿矾绾� */ - UpdateWoStatus({ - UserId: useUserStore().getUserInfo.userId as string, - WorkOrder: args[1]['CODE'], - Status: -1, - RouteStatus: 1, - WoBatch: '', - ActLine: '', + ProdRouteToWo({ + rotId: d.values.id, wo: args[1]['CODE'], + rotCode: '', + options: { + //鏍规嵁鎹偣鏌ヨ锛屽繀闇�甯﹁繖涓弬鏁� + UserId: useUserStore().getUserInfo.userId, + ByOrg: true, + CurOrg: useUserStore().getUserInfo.orgCode, + } }).then((action) => { if (action.IsSuccessed) { - SP_MES_PROD2WO({ rotId: d.values.id, wo: args[1]['CODE'] }).then((action) => { - if (action.IsSuccessed) { - args[2](); - } else { - UpdateWoStatus({ - UserId: useUserStore().getUserInfo.userId as string, - WorkOrder: args[1]['CODE'], - Status: -1, - RouteStatus: 0, - WoBatch: '', - ActLine: '', - }); - createErrorModal({ - title: t('sys.api.errorTip'), - content: t(action.LocaleMsg), - }); - } - }); + args[2](); } else { createErrorModal({ title: t('sys.api.errorTip'), @@ -884,7 +868,7 @@ const webSocketStore = useWebSocketStore(); if (webSocketStore.GetSocketState == 1) { webSocketStore.sendMessage( - `wsGetNew ${param.values['LABEL_ID']}_#_${ param.values['WORK_ORDER']}`, + `wsGetNew ${param.values['LABEL_ID']}_#_${param.values['WORK_ORDER']}`, ); } } @@ -892,10 +876,10 @@ const webSocketStore = useWebSocketStore(); if (webSocketStore.GetSocketState == 1) { webSocketStore.sendMessage( - `wsGetNew ${param.values['LABEL_ID']}_#_${ param.values['WORK_ORDER']}`, + `wsGetNew ${param.values['LABEL_ID']}_#_${param.values['WORK_ORDER']}`, ); } - break; + break; } resolve('OK'); } catch (e) { diff --git a/src/views/tigerprojects/system/lowcode/normal/mainTable.vue b/src/views/tigerprojects/system/lowcode/normal/mainTable.vue index d4e5502..ac407e2 100644 --- a/src/views/tigerprojects/system/lowcode/normal/mainTable.vue +++ b/src/views/tigerprojects/system/lowcode/normal/mainTable.vue @@ -87,7 +87,7 @@ import { getRoleButtons } from '/@/api/sys/menu'; import { useUserStore } from '/@/store/modules/user'; import { useRouter } from 'vue-router'; - import { GenerateActionButton, initRoute } from '../data'; + import { afterFetchFn, GenerateActionButton, initRoute, SearchInfoFn } from '../data'; import LogicFlow from '@logicflow/core'; import { isFunction } from 'xe-utils'; import { CustModalParams } from '/@/api/tigerapi/model/systemModel'; @@ -138,7 +138,9 @@ /* 鍔ㄦ�乮mport瀹炰綋鍚�.ts鐨勮嚜瀹氫箟鏂规硶 */ try { custImport.value = await import(`../entityts/${objParams.value['ID']}.ts`); - } catch (e) {} + } catch (e) { + console.log(e) + } const [ { ActionItem: nActionItem, @@ -187,14 +189,14 @@ } : '', }, - beforeFetch: SearchInfoFn, - afterFetch: afterFetchFn, + beforeFetch: (t) => SearchInfoFn(t, route.name, AuthOption.value['BY_ORG'] == 'Y'), + afterFetch: afterFetch, columns: _columns as unknown as BasicColumn[], formConfig: { labelWidth: 140, schemas: _searchFormSchema as unknown as FormSchema[], submitFunc: () => Search(), //鑷畾涔夋煡璇㈡彁浜ゆ寜閽殑鏂规硶锛岃Е鍙戞煡璇㈡彁浜や簨浠� - resetFunc: () => useQuery.resetFunc(route.name, getForm()), + resetFunc: () => useQuery.resetFunc(route.name, getForm(), AuthOption.value['BY_ORG'] == 'Y'), }, useSearchForm: true, showTableSetting: true, @@ -259,46 +261,18 @@ * @return {*} */ async function Search() { - useQuery.submitFunc(route.name, getForm()).then(() => { + useQuery.submitFunc(route.name, getForm(), AuthOption.value['BY_ORG'] == 'Y').then(() => { reload(); }); } - - /** - * @description: 璋冪敤api鍓嶏紝鍙傛暟鏁寸悊 - * @param {*} t - * @return {*} - */ - function SearchInfoFn(t) { - if ( - !isNullOrUnDef(useQuery.getCurSearchInfo) && - useQuery.getCurSearchInfo.some((q) => q.name == route.name) - ) { - const curSearchInfo = useQuery.getCurSearchInfo.filter((q) => q.name == route.name); - const Keys = Object.getOwnPropertyNames(curSearchInfo[0].searchInfo); - for (const k in Keys) { - if (Keys[k] != 'page' && Keys[k] != 'pageSize') { - t[Keys[k]] = curSearchInfo[0].searchInfo[Keys[k]]; - } - } - useQuery.setCurSearchInfo({ name: route.name, searchInfo: t }); - } - return t; - } - + /** * @description: 璇锋眰涔嬪悗瀵硅繑鍥炲�艰繘琛屽鐞� * @param {*} t * @return {*} */ - function afterFetchFn(t) { - if ( - !isNullOrUnDef(useQuery.getCurSearchInfo) && - useQuery.getCurSearchInfo.some((q) => q.name == route.name) - ) { - const curSearchInfo = useQuery.getCurSearchInfo.filter((q) => q.name == route.name); - getForm().setFieldsValue(curSearchInfo[0].searchInfo); - } + function afterFetch(t) { + afterFetchFn(t,route.name, getForm()) } const currlf = ref(null) as Ref<LogicFlow | null>; diff --git a/src/views/tigerprojects/system/lowcode/setting/index.vue b/src/views/tigerprojects/system/lowcode/setting/index.vue index b8d8fd7..6c2c1e5 100644 --- a/src/views/tigerprojects/system/lowcode/setting/index.vue +++ b/src/views/tigerprojects/system/lowcode/setting/index.vue @@ -4,7 +4,7 @@ * @version: * @Date: 2024-06-18 15:09:48 * @LastEditors: Ben Lin - * @LastEditTime: 2024-10-10 20:08:31 + * @LastEditTime: 2024-10-23 22:27:39 --> <template> <div> @@ -18,7 +18,7 @@ { icon: 'clarity:note-edit-line', onClick: handleEdit.bind(null, record), - name: '' + name: '', }, { icon: 'ant-design:delete-outlined', @@ -28,7 +28,7 @@ placement: 'left', confirm: handleDelete.bind(null, record), }, - name: '' + name: '', }, ]" /> @@ -37,25 +37,35 @@ </div> </template> <script lang="ts" setup> - import { onMounted, ref } from 'vue'; + import { onMounted, ref, unref } from 'vue'; import { BasicTable, useTable, TableAction, BasicColumn, FormSchema } from '/@/components/Table'; import { DeleteEntity, fetchJson, getListByPage } from '/@/api/tigerapi/system'; import { useGlobSetting } from '/@/hooks/setting'; import { useGo } from '/@/hooks/web/usePage'; import { buildUUID } from '/@/utils/uuid'; + import { useRouter } from 'vue-router'; + import { afterFetchFn, SearchInfoFn } from '../data'; + import { useQueryStore } from '/@/store/modules/queryInpage'; const go = useGo(); const globSetting = useGlobSetting(); + const { currentRoute } = useRouter(); + const useQuery = useQueryStore(); + const route = unref(currentRoute); const _columns = ref([]); const _searchFormSchema = ref([]); - const [registerTable, { reload }] = useTable({ + const [registerTable, { reload, getForm }] = useTable({ title: '鍒楄〃淇℃伅', api: getListByPage, searchInfo: { TABLE_NAME: 'SYS_LOW_CODE' }, + beforeFetch: (t) => SearchInfoFn(t, route.name, false), + afterFetch: afterFetch, columns: _columns as unknown as BasicColumn[], formConfig: { labelWidth: 120, schemas: _searchFormSchema as unknown as FormSchema[], + submitFunc: () => Search(), //鑷畾涔夋煡璇㈡彁浜ゆ寜閽殑鏂规硶锛岃Е鍙戞煡璇㈡彁浜や簨浠� + resetFunc: () => useQuery.resetFunc(route.name, getForm(), false), }, useSearchForm: true, showTableSetting: true, @@ -92,6 +102,25 @@ }); } + /** + * @description: 鏌ヨ鎻愪氦 + * @return {*} + */ + async function Search() { + useQuery.submitFunc(route.name, getForm(), false).then(() => { + reload(); + }); + } + + /** + * @description: 璇锋眰涔嬪悗瀵硅繑鍥炲�艰繘琛屽鐞� + * @param {*} t + * @return {*} + */ + function afterFetch(t) { + afterFetchFn(t, route.name, getForm()); + } + function handleSuccess() { reload(); } -- Gitblit v1.9.3