| | |
| | | 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, |
| | |
| | | function handleCreate() { |
| | | openDrawer(true, { |
| | | isUpdate: false, |
| | | entityName: objParams.value.ID, |
| | | }); |
| | | } |
| | | |
| | |
| | | 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(); |
| | |
| | | |
| | | 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> |