YangYuGang
2025-03-08 8cae1dcd8d2bde01880ac4b70bdda4e61df3c7ef
src/layouts/default/menu/index.vue
@@ -19,7 +19,7 @@
  import { useRootSetting } from '@/hooks/setting/useRootSetting';
  import { useAppInject } from '@/hooks/web/useAppInject';
  import { useDesign } from '@/hooks/web/useDesign';
import { getEntity } from '/@/api/tigerapi/system';
  import { getEntity } from '/@/api/tigerapi/system';
  export default defineComponent({
    name: 'LayoutMenu',
@@ -113,34 +113,49 @@
      function handleMenuClick(path: string) {
        if (path.split('/').length > 2 && path.split('/')[2] == 'LC') {
        getEntity({
          sqlcmd: `ASSEMBLY_NAME ='${path.split('/')[1]}'`,
          entityName: 'SYS_LOW_CODE',
        }).then((data) => {
          var searchForms = JSON.parse(data.Data.Items[0].SEARCH_FORM_JSON);
          let colSlots = [] as string[];
          for (const i in searchForms) {
            if (!isNullOrUnDef(searchForms[i]['colSlot'])) {
              colSlots.push('form-' + searchForms[i]['colSlot']);
          getEntity({
            sqlcmd: `CODE_NAME ='${path.split('/')[1]}'`,
            entityName: 'SYS_LOW_CODE',
            order: '',
          }).then((data) => {
            var searchForms = JSON.parse(data.Data.Items[0].SEARCH_FORM_JSON);
            let colSlots = [] as string[];
            for (const i in searchForms) {
              if (!isNullOrUnDef(searchForms[i]['colSlot'])) {
                colSlots.push('form-' + searchForms[i]['colSlot']);
              }
            }
          }
          var _cruds = JSON.parse(data.Data.Items[0].FORM_JSON);
          let crudColSlots = [] as string[];
          for (const i in _cruds) {
            if (!isNullOrUnDef(_cruds[i]['colSlot'])) {
              crudColSlots.push(_cruds[i]['colSlot']);
            var _cruds = JSON.parse(data.Data.Items[0].FORM_JSON);
            let crudColSlots = [] as string[];
            for (const i in _cruds) {
              if (!isNullOrUnDef(_cruds[i]['colSlot'])) {
                crudColSlots.push(_cruds[i]['colSlot']);
              }
            }
          }
          const id = { ID: path.split('/')[1], colSlots: colSlots, crudColSlots: crudColSlots };
          go(`/${path.split('/')[1]}/${path.split('/')[2]}/${encodeURI(JSON.stringify(id))}`);
        });
      } else if (path.split('/').length > 2 && path.split('/')[2] == 'High') {
        const id = { Name: path.split('/')[1] };
        go(`/${path.split('/')[1]}/${path.split('/')[2]}/${encodeURI(JSON.stringify(id))}`);
      } else {
        go(path);
      }
            const id = { ID:path.split('/')[1], EntityName: data.Data.Items[0].ASSEMBLY_NAME, colSlots: colSlots, crudColSlots: crudColSlots };
            go(`/${path.split('/')[1]}/${path.split('/')[2]}/${encodeURI(JSON.stringify(id))}`);
          });
        } else if (
          (path.split('/').length > 2 && path.split('/')[2] == 'High') ||
          path.split('/')[2] == 'CP'
        ) {
          const id = {
            Name: path.split('/')[1],
            Title: `${path.split('/')[1]}`,
            colSlots: [],
            crudColSlots: [],
            OtherTableName: [],
            SessionName:
              `${path.split('/')[1]}_update` /* session名,用来传递参数,不在浏览器地址栏显示 */,
          };
          // 将对象转换为JSON字符串并保存到sessionStorage
          sessionStorage.removeItem(`${id.SessionName}_params`);
          sessionStorage.setItem(`${id.SessionName}_params`, encodeURI(JSON.stringify(id)));
          go(`/${path.split('/')[1]}/${path.split('/')[2]}/${encodeURI(JSON.stringify({ sName: id.SessionName, Name: id.Name }))}`);
        } else {
          go(path);
        }
      }
      /**