Ben Lin
2024-05-30 e33d593df8bf528ad793bf80eb8f391513ccc2ba
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>