From e33d593df8bf528ad793bf80eb8f391513ccc2ba Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期四, 30 五月 2024 21:01:05 +0800 Subject: [PATCH] 通用增删改 --- src/views/tigerprojects/system/lowcode/normal/index.vue | 19 +++++++++++-------- 1 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/views/tigerprojects/system/lowcode/normal/index.vue b/src/views/tigerprojects/system/lowcode/normal/index.vue index bfde156..d3a78a3 100644 --- a/src/views/tigerprojects/system/lowcode/normal/index.vue +++ b/src/views/tigerprojects/system/lowcode/normal/index.vue @@ -32,21 +32,20 @@ import { BasicTable, useTable, TableAction, BasicColumn, FormSchema } from '/@/components/Table'; import { useDrawer } from '/@/components/Drawer'; import normalDrawer from './normalDrawer.vue'; - import { DeleteRegion } from '/@/api/tigerapi/wms/region'; - import { fetchJson, getListByPage } from '/@/api/tigerapi/system'; + import { DeleteEntity, fetchJson, getListByPage } from '/@/api/tigerapi/system'; import { useGlobSetting } from '/@/hooks/setting'; import { useRoute } from 'vue-router'; const route = useRoute(); - const RuleObj = ref(JSON.parse(decodeURI(route.params?.id as string))); + const objParams = ref(JSON.parse(decodeURI(route.params?.id as string))); const globSetting = useGlobSetting(); const _columns = ref([]); const _searchFormSchema = ref([]); const [registerDrawer, { openDrawer }] = useDrawer(); const [registerTable, { reload }] = useTable({ - title: '鍌ㄥ尯鍒楄〃', + title: '鍒楄〃淇℃伅', api: getListByPage, - searchInfo: { TABLE_NAME: RuleObj.value.ID }, + searchInfo: { TABLE_NAME: objParams.value.ID }, columns: _columns as unknown as BasicColumn[], formConfig: { labelWidth: 120, @@ -69,6 +68,7 @@ function handleCreate() { openDrawer(true, { isUpdate: false, + entityName: objParams.value.ID, }); } @@ -76,13 +76,14 @@ openDrawer(true, { record, isUpdate: true, + entityName: objParams.value.ID, }); } function handleDelete(record: Recordable) { console.log(record); //鍒犻櫎 - const apiAction = DeleteRegion(record); + const apiAction = DeleteEntity(record, objParams.value.ID); apiAction.then((action) => { if (action.IsSuccessed) { reload(); @@ -96,8 +97,10 @@ onMounted(async () => { _searchFormSchema.value = await fetchJson( - `${globSetting.downloadUrl}/LowCode/regionSearchform.json`, + `${globSetting.downloadUrl}/LowCode/${objParams.value.ID}/${objParams.value.ID}_Searchform.json`, ); - _columns.value = await fetchJson(`${globSetting.downloadUrl}/LowCode/regionBaseform.json`); + _columns.value = await fetchJson( + `${globSetting.downloadUrl}/LowCode/${objParams.value.ID}/${objParams.value.ID}_Baseform.json`, + ); }); </script> -- Gitblit v1.9.3