sujunling 2 سال پیش
والد
کامیت
8aff8762cb

+ 39 - 0
src/api/twoAndThree/menu.ts

@@ -0,0 +1,39 @@
+import { defHttp } from '/@/utils/http/axios';
+import { getMenuListResultModel } from './model/menuModel';
+import { useUserStore } from '/@/store/modules/user';
+import { RoleEnum } from '/@/enums/roleEnum';
+
+enum Api {
+  BaseMenuUrl = '/menu',
+  GetMenuList = '/xld-2And3/findAllMenu',
+  SysAdminMenuList = '/admin/me/menus',
+  GetMenuIdsByRoleId = '/menu/get_ids/',
+}
+
+const locationType = { mapToolsUrl: true };
+
+
+/**
+ * @description: 获取二三维一体化的菜单
+ */
+
+export const getMenuList = () => {
+  let url = Api.GetMenuList;
+  try {
+    return defHttp.post({
+      url,
+      ...locationType
+    });
+  } catch (e) {
+
+  }
+};
+
+export const delMenu = (menuIds: string[]) => {
+  const url = Api.BaseMenuUrl;
+  return defHttp.delete({ url: url, data: menuIds });
+};
+export const getMenusIdsByRoleId = (roleId: string) => {
+  const url = Api.GetMenuIdsByRoleId + roleId;
+  return defHttp.get<Array<string>>({ url });
+};

+ 141 - 0
src/views/systemAdmin/system/mapTools/menus/MenuDrawer.vue

@@ -0,0 +1,141 @@
+<template>
+  <BasicDrawer
+    v-bind="$attrs"
+    @register="registerDrawer"
+    showFooter
+    :title="getTitle"
+    width="50%"
+    @ok="handleSubmit"
+  >
+    <BasicForm @register="registerForm" />
+  </BasicDrawer>
+</template>
+<script lang="ts">
+  import { defineComponent, ref, computed, unref } from 'vue';
+  import { BasicForm, useForm } from '/@/components/Form/index';
+  import { formSchema } from './menu.data';
+  import { BasicDrawer, useDrawerInner } from '/@/components/Drawer';
+
+  // 加载菜单
+  import { getMenuList } from '/@/api/sys/menu';
+
+  import { saveMenuApi } from '/@/api/system/menu';
+  import { listToTree } from '/@/utils/menuUtil';
+
+  import { useI18n } from '/@/hooks/web/useI18n';
+  import { metaModel } from '/@/api/system/model/menuModel';
+
+  export default defineComponent({
+    name: 'MenuDrawer',
+    components: { BasicDrawer, BasicForm },
+    emits: ['success', 'register'],
+    setup(_, { emit }) {
+      const isUpdate = ref(true);
+      let menuId;
+
+      const [registerForm, { resetFields, setFieldsValue, updateSchema, validate }] = useForm({
+        labelWidth: 100,
+        schemas: formSchema,
+        showActionButtonGroup: false,
+        baseColProps: { lg: 12, md: 24 },
+      });
+      const { t } = useI18n(); //加载国际化
+
+      //默认传递页面数据
+      const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
+        resetFields();
+        setDrawerProps({ confirmLoading: false });
+        isUpdate.value = !!data?.isUpdate;
+
+        //初始化,菜单名称为可用
+        updateSchema({ field: 'title', componentProps: { disabled: false } });
+        //如果是编辑操作,设置页面数据
+        if (unref(isUpdate)) {
+          // // 动态设置 表单值
+          //
+          let menuObj: metaModel = Reflect.get(data.record, 'meta');
+          Reflect.set(data.record, 'menuType', menuObj.menuType); //meta.menuType
+          Reflect.set(data.record, 'title', menuObj.title); //meta.title
+          Reflect.set(data.record, 'icon', menuObj.icon); //meta.icon
+          Reflect.set(data.record, 'hideMenu', menuObj.hideMenu); //meta.hideMenu
+          Reflect.set(data.record, 'ignoreKeepAlive', menuObj.ignoreKeepAlive); //meta.ignoreKeepAlive
+          Reflect.set(data.record, 'isLink', menuObj.isLink); //meta.isLink
+          Reflect.set(data.record, 'status', menuObj.status); //meta.status
+          //为表单赋值
+          setFieldsValue({
+            ...data.record,
+          });
+
+          //编辑模式,菜单名称为不可用
+          updateSchema({ field: 'title', componentProps: { disabled: false } });
+        }
+        if (isUpdate.value) {
+          menuId = Reflect.get(data.record, 'id');
+        }
+        //加载菜单
+        let treeData = await getMenuList(1);
+        treeData = listToTree(treeData);
+        updateSchema({
+          field: 'parentId',
+          componentProps: { treeData },
+        });
+      });
+
+      //得到页面标题
+      const getTitle = computed(() =>
+        !unref(isUpdate)
+          ? t('routes.common.system.pageSystemTitleCreateMenu')
+          : t('routes.common.system.pageSystemTitleEditMenu')
+      );
+
+      //提交按钮
+      async function handleSubmit() {
+        try {
+          const values = await validate();
+          setDrawerProps({ confirmLoading: true });
+          // TODO custom api
+
+          // 处理权限标识为null时,后台空指针
+          let permissionStr: string = Reflect.get(values, 'permission');
+          if (permissionStr === undefined || permissionStr === null) {
+            Reflect.set(values, 'permission', ' ');
+          }
+
+          // 添加属性;
+          //当前作为默认管理员操作;
+          Reflect.set(values, 'type', 'SYSADMIN');
+          Reflect.set(values, 'name', Reflect.get(values, 'title'));
+          //当前选择为菜单时操作
+          let menuType: string = Reflect.get(values, 'menuType');
+          if (menuType === '0') {
+            Reflect.set(values, 'component', 'LAYOUT');
+          }
+          if (isUpdate.value) {
+            Reflect.set(values, 'id', menuId);
+          }
+
+          //为meta设置值
+          const metaTemp: metaModel = {
+            icon: Reflect.get(values, 'icon'),
+            title: Reflect.get(values, 'title'),
+            isLink: Reflect.get(values, 'isLink'),
+            menuType: Reflect.get(values, 'menuType'),
+            ignoreKeepAlive: Reflect.get(values, 'ignoreKeepAlive'), //[创建菜单,才需要]
+            hideMenu: Reflect.get(values, 'hideMenu'),
+            status: Reflect.get(values, 'status'),
+          };
+          Reflect.set(values, 'meta', metaTemp);
+          // saveMenu
+          await saveMenuApi(values, isUpdate.value);
+
+          closeDrawer(); //关闭侧框
+          emit('success');
+        } finally {
+          setDrawerProps({ confirmLoading: false });
+        }
+      }
+
+      return { registerDrawer, registerForm, getTitle, handleSubmit };
+    },
+  });
+</script>

+ 190 - 420
src/views/systemAdmin/system/mapTools/menus/index.vue

@@ -1,420 +1,190 @@
-<template>
-    <div class="tools p-4">
-        <BasicTable @register="registerTable">
-            <template #toolbar>
-                <Button type="primary" @click="openDialog(null)">
-                    新增工具
-                </Button>
-                <Button type="primary" danger :disabled="hasSelected" @click="delAllData">
-                    批量删除
-                </Button>
-            </template>
-            <template #func="{ record }">
-                <TableAction :actions="[
-                    {
-                        label: '',
-                        tooltip: '编辑',
-                        icon: 'ant-design:edit-outlined',
-                        onClick: openDialog.bind(null, record),
-                    },
-                    {
-                        label: '',
-                        tooltip: '删除',
-                        icon: 'ant-design:delete-outlined',
-                        onClick: onDelete.bind(null, record.id),
-                    },
-                ]" />
-            </template>
-        </BasicTable>
-    </div>
-</template>
-
-<script>
-import { defineComponent, onMounted, watch, ref, reactive, toRefs, computed } from 'vue';
-// 导入表格组件,表格事件
-import { BasicTable, useTable, TableAction } from '/@/components/Table';
-import { Button } from 'ant-design-vue';
-
-import { message, Modal } from 'ant-design-vue';
-import moment from 'moment'
-import { session } from '/@/utils/Memory';
-
-export default defineComponent({
-    components: { BasicTable, TableAction, Button },
-    name: "tools",
-    setup() {
-        const toolsData = [
-            {
-                group: "常用工具",
-                isQuick: false,
-                label: "全图",
-                option: {},
-                idx: 0,
-                id: "418d4040-df24-4f44-a718-2d4c1729532a",
-                tip: "显示全图范围",
-                icon: "at-icon-quantu",
-                action: "zoomfull"
-            },
-            {
-                "group": "常用工具",
-                "isQuick": false,
-                "label": "环境设置",
-                "option": {},
-                "idx": 1,
-                "id": "418d4040-df24-4f44-a718-2d4c1720032a",
-                "tip": "环境设置",
-                "icon": "at-icon-quanjingtu",
-                "action": "envConfig"
-            },
-            {
-                "action": "lookdown3D",
-                "label": "俯视",
-                "option": {},
-                "icon": "at-icon-fushi",
-                "idx": 2,
-                "group": "常用工具",
-                "isQuick": true,
-                "id": "7a3e12c5-e39b-4466-bbf7-c7f38e691ca7",
-                "tip": "俯视看图,仰角-90°"
-            },
-            {
-                "idx": 3,
-                "icon": "at-icon-zhengbei",
-                "isQuick": false,
-                "action": "looknorth3D",
-                "label": "正北",
-                "tip": "朝正北看图,方位角为0°",
-                "option": {},
-                "id": "3f4bc0ec-20fa-4ec5-856a-48b7ec1997f0",
-                "group": "常用工具"
-            },
-            {
-                "label": "量长度",
-                "option": {
-                    "measureType": "length"
-                },
-                "idx": 16,
-                "icon": "at-icon-liangchangdu",
-                "isQuick": false,
-                "id": "1b136e85-159d-4d01-90f8-3f1e8b545898",
-                "action": "MeasureAction",
-                "group": "测量/多屏",
-                "tip": "测量长度"
-            },
-            {
-                "tip": "测量高度",
-                "icon": "at-icon-lianggaodu",
-                "label": "量高度",
-                "group": "测量/多屏",
-                "option": {
-                    "measureType": "height"
-                },
-                "idx": 17,
-                "isQuick": false,
-                "action": "MeasureAction",
-                "id": "2a894bf2-7d7e-44fc-ba6e-219135a57741"
-            },
-            {
-                "icon": "at-icon-liangmianji",
-                "tip": "测量面积",
-                "isQuick": false,
-                "label": "量面积",
-                "idx": 18,
-                "group": "测量/多屏",
-                "option": {
-                    "measureType": "area"
-                },
-                "id": "e2a2050f-3822-4bbe-83fa-34991790e058",
-                "action": "MeasureAction"
-            },
-            {
-                "group": "测量/多屏",
-                "label": "双屏",
-                "isQuick": true,
-                "idx": 19,
-                "tip": "两屏对比",
-                "icon": "at-icon-liangping",
-                "id": "d34d9973-2841-4c4b-8d1b-161b41ce57c9",
-                "option": {
-                    "screenNum": 2
-                },
-                "action": "AttachedMapAction"
-            },
-            {
-                "option": {
-                    "screenNum": 3
-                },
-                "tip": "三屏对比",
-                "action": "AttachedMapAction",
-                "idx": 20,
-                "group": "测量/多屏",
-                "label": "三屏",
-                "id": "0bedfcc9-91a1-4e57-939c-af1506097a94",
-                "icon": "at-icon-sanping",
-                "isQuick": false
-            },
-            {
-                "group": "测量/多屏",
-                "icon": "at-icon-siping",
-                "id": "4c56a30b-e82f-4d03-b09c-5c73911e11b7",
-                "label": "四屏",
-                "option": {
-                    "screenNum": 4
-                },
-                "isQuick": false,
-                "tip": "四屏对比",
-                "action": "AttachedMapAction",
-                "idx": 21
-            },
-            {
-                "id": "4342fbea-6e6e-4e9b-ac1e-730b8abc02b6",
-                "idx": 22,
-                "action": "DrawAction",
-                "group": "绘制工具",
-                "option": {
-                    "drawType": "point"
-                },
-                "tip": "绘制点",
-                "isQuick": false,
-                "label": "绘点",
-                "icon": "at-icon-huizhidian"
-            },
-            {
-                "idx": 23,
-                "icon": "at-icon-huizhixian",
-                "isQuick": false,
-                "label": "绘线",
-                "tip": "绘制线",
-                "id": "0f3e694b-df62-4fa0-96d1-1a1dfbc1ec14",
-                "action": "DrawAction",
-                "option": {
-                    "drawType": "polyline"
-                },
-                "group": "绘制工具"
-            },
-            {
-                "action": "DrawAction",
-                "isQuick": true,
-                "option": {
-                    "drawType": "polygon"
-                },
-                "idx": 24,
-                "group": "绘制工具",
-                "label": "绘面",
-                "tip": "绘制多边形",
-                "icon": "at-icon-huizhimian1",
-                "id": "34498b42-a0a6-4388-b099-e0b7ac8515db"
-            },
-            {
-                "group": "绘制工具",
-                "icon": "at-icon-huizhijuxing",
-                "option": {
-                    "drawType": "extent"
-                },
-                "tip": "绘制矩形",
-                "isQuick": false,
-                "idx": 25,
-                "action": "DrawAction",
-                "label": "绘矩形",
-                "id": "c00f16b2-29b2-4f5a-90b5-f27185785456"
-            },
-            {
-                "icon": "at-icon-huizhiyuan",
-                "label": "绘圆",
-                "isQuick": false,
-                "idx": 26,
-                "option": {
-                    "drawType": "circle"
-                },
-                "id": "4057f545-219d-4e1a-a6d9-4c0145123cfe",
-                "tip": "绘制圆形",
-                "action": "DrawAction",
-                "group": "绘制工具"
-            },
-            {
-                "id": "fd585e8d-a9e8-4de9-b13a-de17350459ec",
-                "option": {},
-                "label": "出图",
-                "isQuick": false,
-                "icon": "at-icon-tupian",
-                "tip": "导出当前地图为图片",
-                "idx": 32,
-                "group": "其他工具",
-                "action": "ExportImgAction"
-            },
-            {
-                "option": {},
-                "id": "a05acc83-4859-49fe-a12d-02bf154cc7ee",
-                "tip": "打印当前地图",
-                "action": "PrintAction",
-                "group": "其他工具",
-                "idx": 33,
-                "isQuick": false,
-                "label": "打印",
-                "icon": "at-icon-dayin"
-            },
-            {
-                "group": "其他工具",
-                "option": {},
-                "icon": "at-icon-huanchongfenxi",
-                "action": "BufferPointAction",
-                "tip": "缓冲绘制图形进行分析",
-                "id": "551f5ca2-a39e-43f8-8a0b-9db1ed36efa8",
-                "label": "点缓冲",
-                "idx": 35,
-                "isQuick": false
-            },
-            {
-                "group": "其他工具",
-                "option": {},
-                "icon": "at-icon-minus",
-                "action": "BufferLineAction",
-                "tip": "缓冲绘制图形进行分析",
-                "id": "551f5ca2-a39e-43f8-8a0b-9db1ed36efa4",
-                "label": "线缓冲",
-                "idx": 35,
-                "isQuick": false
-            },
-            {
-                "group": "其他工具",
-                "option": {},
-                "icon": "at-icon-icon_duobianxing",
-                "action": "BufferPolygonAction",
-                "tip": "缓冲绘制图形进行分析",
-                "id": "551f5ca2-a39e-43f8-8a0b-9db1ed36efb4",
-                "label": "面缓冲",
-                "idx": 35,
-                "isQuick": false
-            },
-            {
-                "isQuick": true,
-                "id": "6d51001d-a5e4-4aa8-a977-0694724b916a",
-                "option": {},
-                "group": "其他工具",
-                "tip": "清除缓冲分析",
-                "icon": "at-icon-qingchu1",
-                "idx": 36,
-                "action": "ClearBufferAction",
-                "label": "清除缓冲"
-            },
-            {
-                "isQuick": true,
-                "id": "6d51001d-a5e4-4aa8-a977-0694724b916a",
-                "option": {},
-                "group": "常用工具",
-                "tip": "清除所有绘制",
-                "icon": "at-icon-qingchu1",
-                "idx": 37,
-                "action": "ClearDrawAction",
-                "label": "清除"
-            },
-            {
-                "option": {
-                    "data": [
-                        {
-                            "wkid": "EPSG:4525",
-                            "name": "国家2000高斯投影3°分带37°带"
-                        }
-                    ]
-                },
-                "label": "定位",
-                "isQuick": false,
-                "id": "b4940bbe-ca14-497c-b51f-726744db787b",
-                "tip": "定位到输入的位置",
-                "icon": "at-icon-dingwei",
-                "group": "常用工具",
-                "action": "MapToPointAction",
-                "idx": 38
-            }
-        ]
-        const columns = [
-            {
-                title: '分组名称',
-                dataIndex: 'group',
-                key: 'group',
-                align: 'center'
-            },
-            {
-                title: 'id',
-                dataIndex: 'id',
-                key: 'id',
-                align: 'center'
-            },
-            {
-                title: '显示名称',
-                dataIndex: 'label',
-                key: 'label',
-                align: 'center'
-            },
-            {
-                title: '提示文字',
-                dataIndex: 'tip',
-                key: 'tip',
-                align: 'center'
-            },
-            {
-                title: '图标',
-                dataIndex: 'icon',
-                key: 'icon',
-                align: 'center'
-            },
-            {
-                title: '功能',
-                dataIndex: 'action',
-                key: 'action',
-                align: 'center'
-            }
-        ]
-        const openDialog = () => {
-
-        }
-        const onDelete = () => {
-
-        }
-        //判断是否选中数据
-        const hasSelected = computed(() => {
-            const rowSelection = getRowSelection();
-            return !rowSelection.selectedRowKeys?.length;
-        });
-        //注册tag表格
-        const [
-            registerTable,
-            { reload, getRowSelection, getSelectRowKeys, setSelectedRowKeys }
-        ] = useTable({
-            title: '工具列表', //'菜单列表'
-            // api: getTagsData, //加载数据
-            dataSource: toolsData,
-            columns: columns,
-            useSearchForm: false,     //开启搜索区域
-            bordered: true,
-            showTableSetting: true,  // 显示表格设置
-            tableSetting: { fullScreen: false },
-            showIndexColumn: true,
-            pagination: {
-                // pageSize: 10,
-                hideOnSinglePage: false
-            },
-            rowKey: (record) => record.id,
-            actionColumn: {
-                width: 100,
-                title: '操作',
-                dataIndex: 'func',
-                slots: { customRender: 'func' },
-            },
-            rowSelection: {
-                type: 'checkbox',
-            },
-        });
-        return {
-            hasSelected,
-            registerTable,
-            reload,
-            getRowSelection,
-            getSelectRowKeys,
-            setSelectedRowKeys,
-            openDialog,
-            onDelete
-        }
-    }
-})
-</script>
+<template>
+  <div class="p-4">
+    <BasicTable @register="registerTable" @fetch-success="onFetchSuccess">
+      <template #toolbar>
+        <Button type="primary" @click="handleCreate">
+          {{ getI18nCreateMenu }}
+        </Button>
+        <Button type="primary" danger :disabled="getCanBatchDelete" @click="handleBatchDelete">
+          批量删除
+        </Button>
+      </template>
+      <template #action="{ record }">
+        <TableAction
+          :actions="[
+            {
+              label: '编辑',
+              tooltip: '编辑',
+              icon: 'clarity:note-edit-line',
+              onClick: handleEdit.bind(null, record),
+            },
+            {
+              label: '删除',
+              tooltip: '删除',
+              icon: 'ant-design:delete-outlined',
+              color: 'error',
+              popConfirm: {
+                title: getDeleteTitle(),
+                confirm: handleDelete.bind(null, record),
+              },
+            },
+          ]"
+        />
+      </template>
+    </BasicTable>
+
+    <!-- 弹出框 -->
+    <MenuDrawer @register="registerDrawer" @success="handleSuccess" />
+  </div>
+</template>
+<script lang="ts">
+  //导入所需插件
+  import { computed, defineComponent, nextTick } from 'vue';
+
+  // 导入表格组件,表格事件
+  import { BasicTable, useTable, TableAction } from '/@/components/Table';
+
+  // 加载表格数据
+  import { getMenuList, delMenu } from '/@/api/sys/menu';
+  // 加载自定义侧边弹出框 组件
+  import { useDrawer } from '/@/components/Drawer';
+
+  // 导入子页面【新增、修改】
+  import MenuDrawer from './MenuDrawer.vue';
+
+  // 导入列 属性,和搜索栏内容
+  import { columns } from './menu.data';
+  import { useI18n } from '/@/hooks/web/useI18n';
+  import { Button, notification } from 'ant-design-vue';
+  import { useSyncConfirm } from '/@/hooks/component/useSyncConfirm';
+  import { isArray } from '/@/utils/is';
+  // 自定义表格组件和属性
+  export default defineComponent({
+    name: 'MenuManagement',
+    components: { BasicTable, MenuDrawer, TableAction, Button },
+    setup() {
+      const [registerDrawer, { openDrawer }] = useDrawer(); //使用右侧弹出框
+      const { t } = useI18n(); //加载国际化
+      // 新增菜单
+      const getI18nCreateMenu = computed(() => t('routes.common.system.pageSystemTitleCreateMenu'));
+
+      const [
+        registerTable,
+        { reload, collapseAll, getRowSelection, getSelectRowKeys, setSelectedRowKeys },
+      ] = useTable({
+        title: t('routes.common.system.pageSystemTitleMenuList'), //'菜单列表'
+        api: getMenuList, //加载数据
+        columns, //加载列
+        isTreeTable: true,
+        pagination: false,
+        striped: false,
+        showTableSetting: true,
+        bordered: true,
+        showIndexColumn: false,
+        canResize: false,
+        rowKey: (record) => record.id,
+        actionColumn: {
+          width: 200,
+          title: t('routes.common.system.pageSystemTitleOperation'), //操作
+          dataIndex: 'action',
+          slots: { customRender: 'action' },
+          fixed: 'right',
+        },
+        rowSelection: {
+          type: 'checkbox',
+        },
+      });
+
+      const getCanBatchDelete = computed(() => {
+        const rowSelection = getRowSelection();
+        return !rowSelection.selectedRowKeys?.length;
+      });
+      const { createSyncConfirm } = useSyncConfirm();
+      const handleBatchDelete = async () => {
+        const rowKeys = getSelectRowKeys();
+        try {
+          await createSyncConfirm({
+            iconType: 'warning',
+            content: '确认后所有选中的菜单将被删除',
+          });
+          await handleDelete({ id: rowKeys });
+          setSelectedRowKeys([]);
+          reload();
+        } catch (error) {}
+      };
+
+      /**
+       * 获得删除提示框的文字
+       */
+      function getDeleteTitle(): string {
+        let labelText = t('routes.common.system.pageSystemTitleWhetherDelete');
+        return labelText;
+      }
+
+      /**
+       * 打开新增菜单
+       */
+      function handleCreate() {
+        openDrawer(true, {
+          isUpdate: false,
+        });
+      }
+
+      /**
+       * 打开 编辑菜单
+       * @param record
+       */
+      function handleEdit(record: Recordable) {
+        openDrawer(true, {
+          record,
+          isUpdate: true,
+        });
+      }
+
+      /**
+       * 执行 删除操作
+       * @param record
+       */
+      async function handleDelete(record: Recordable) {
+        try {
+          let ids = isArray(record.id) ? record.id : [record.id];
+          await delMenu(ids);
+          notification.success({
+            message: '成功',
+            description: '删除菜单成功',
+            duration: 3,
+          });
+          await reload();
+        } catch (e) {
+          return Promise.reject(e);
+        }
+      }
+
+      /**
+       * 操作成功,重新加载页面
+       */
+      function handleSuccess() {
+        reload();
+      }
+
+      function onFetchSuccess() {
+        // 演示默认展开所有表项
+        nextTick(collapseAll);
+      }
+
+      return {
+        getDeleteTitle,
+        getI18nCreateMenu,
+        registerTable,
+        registerDrawer,
+        handleCreate,
+        handleEdit,
+        handleDelete,
+        handleSuccess,
+        onFetchSuccess,
+        getCanBatchDelete,
+        handleBatchDelete,
+      };
+    },
+  });
+</script>

+ 292 - 0
src/views/systemAdmin/system/mapTools/menus/menu.data.ts

@@ -0,0 +1,292 @@
+import { BasicColumn } from '/@/components/Table';
+import { FormSchema } from '/@/components/Table';
+import { h } from 'vue';
+import { Tag } from 'ant-design-vue';
+import { Icon } from '/@/components/Icon';
+import { useI18n } from '/@/hooks/web/useI18n';
+const { t } = useI18n();
+
+//菜单管理页,所需的列 配置
+export const columns: BasicColumn[] = [
+  {
+    title: t('routes.common.system.tableTitleSystemMenuName'), //菜单名称
+    // title:'菜单名称',
+    dataIndex: 'meta.title',
+    width: 180,
+    align: 'left',
+    customRender: ({ record }) => {
+      record = t(record.meta.title); //国际化处理
+      return record;
+    },
+  },
+  {
+    title: t('routes.common.system.tableTitleSystemIcon'), //图标
+    // title:'图标',
+    dataIndex: 'meta.icon',
+    width: 50,
+    customRender: ({ record }) => {
+      return h(Icon, { icon: record.meta.icon });
+    },
+  },
+  {
+    title: t('routes.common.system.tableTitleSystemPermissionTag'), //权限标识
+    // title:'权限标识',
+    dataIndex: 'permission',
+    width: 220,
+  },
+  {
+    title: t('routes.common.system.tableTitleSystemComponents'), //'组件'
+    // title:'组件',
+    width: 120,
+    dataIndex: 'component',
+  },
+  {
+    title: t('routes.common.system.tableTitleSystemSort'), //'排序'
+    // title:'排序',
+    dataIndex: 'sort',
+    width: 50,
+  },
+  {
+    title: t('routes.common.system.tableTitleSystemStatus'), //'状态'
+    // title:'状态',
+    dataIndex: 'status',
+    width: 80,
+    customRender: ({ record }) => {
+      const status = record.meta.status;
+      const enable = ~~status === 0;
+      const color = enable ? 'green' : 'red';
+      const enableText: string = t('routes.common.system.tableTitleSystemEnable'); //国际化处理--启用
+      const stopText: string = t('routes.common.system.tableTitleSystemStop'); //国际化处理--停用
+      const text = enable ? enableText : stopText;
+      return h(Tag, { color: color }, () => text);
+    },
+  },
+  {
+    title: t('routes.common.system.tableTitleSystemCreateTime'), //'创建时间'
+    // title:'创建时间',
+    dataIndex: 'createTime',
+    width: 180,
+  },
+];
+
+const isDir = (type: string) => type === '0';
+const isMenu = (type: string) => type === '1';
+const isButton = (type: string) => type === '2';
+
+//菜单管理页,所需的搜索内容
+export const searchFormSchema: FormSchema[] = [
+  {
+    field: 'menuName',
+    label: t('routes.common.system.tableTitleSystemMenuName'), //菜单名称
+    // label: '菜单名称',
+    component: 'Input',
+    colProps: { span: 8 },
+    componentProps: {
+      maxLength: 255,
+    },
+    dynamicRules: () => {
+      return [
+        {
+          required: false,
+          validator: (_, value) => {
+            if (String(value).length > 255) {
+              return Promise.reject('字数不超过255个字');
+            }
+            return Promise.resolve();
+          },
+        },
+      ];
+    },
+  },
+  {
+    field: 'status',
+    label: t('routes.common.system.tableTitleSystemStatus'), //状态
+    // label: '状态',
+    component: 'Select',
+    componentProps: {
+      options: [
+        { label: t('routes.common.system.tableTitleSystemEnable'), value: '0' },
+        // { label: '启用', value: '0' },
+
+        { label: t('routes.common.system.tableTitleSystemStop'), value: '1' },
+        // { label: '停用', value: '1' },
+      ],
+    },
+    colProps: { span: 8 },
+  },
+];
+
+//----------------------------------新增、编辑----------------------------------------------------------
+export const formSchema: FormSchema[] = [
+  {
+    field: 'menuType',
+    label: t('routes.common.system.menuEditPagesMenuType'), //菜单类型
+    component: 'RadioButtonGroup',
+    defaultValue: '0',
+    componentProps: {
+      options: [
+        { label: t('routes.common.system.menuEditPagesDirectory'), value: '0' }, //目录
+        { label: t('routes.common.system.menuEditPagesMenu'), value: '1' }, //菜单
+        { label: t('routes.common.system.menuEditPagesButton'), value: '2' }, //按钮
+      ],
+    },
+    colProps: { lg: 24, md: 24 },
+  },
+  {
+    field: 'title',
+    label: t('routes.common.system.tableTitleSystemMenuName'), //菜单名称
+    component: 'Input',
+    required: true,
+    componentProps: {
+      maxLength: 255,
+    },
+  },
+
+  {
+    field: 'parentId',
+    label: t('routes.common.system.menuEditPagesParentMenu'), //上级菜单
+    component: 'TreeSelect',
+    componentProps: {
+      replaceFields: {
+        title: 'menuName',
+        key: 'id',
+        value: 'id',
+      },
+      getPopupContainer: () => document.body,
+    },
+  },
+
+  {
+    field: 'sort',
+    label: t('routes.common.system.tableTitleSystemSort'), //排序
+    component: 'InputNumber',
+    required: true,
+    componentProps: {
+      maxLength: 32,
+    },
+  },
+  {
+    field: 'icon',
+    label: t('routes.common.system.tableTitleSystemIcon'), //图标
+    component: 'IconPicker',
+    required: true,
+    ifShow: ({ values }) => !isButton(Reflect.get(values, 'menuType')),
+  },
+
+  {
+    field: 'path',
+    label: t('routes.common.system.menuEditPagesRouterAddress'), //路由地址
+    component: 'Input',
+    required: true,
+    ifShow: ({ values }) => !isButton(Reflect.get(values, 'menuType')),
+    componentProps: {
+      maxLength: 255,
+    },
+  },
+  {
+    field: 'permission',
+    label: '权限标识', //路由地址
+    component: 'Input',
+    // required: true,//是否必须
+    componentProps: {
+      maxLength: 255,
+    },
+  },
+  {
+    field: 'component',
+    label: t('routes.common.system.menuEditPagesComponentsPath'), //组件路径
+    component: 'Input',
+    ifShow: ({ values }) => isMenu(Reflect.get(values, 'menuType')),
+    componentProps: {
+      maxLength: 100,
+    },
+    dynamicRules: () => {
+      return [
+        {
+          required: false,
+          validator: (_, value) => {
+            if (String(value).length > 100) {
+              return Promise.reject('字数不超过100个字');
+            }
+            return Promise.resolve();
+          },
+        },
+      ];
+    },
+  },
+  {
+    field: 'permission',
+    label: t('routes.common.system.tableTitleSystemPermissionTag'), //权限标识
+    component: 'Input',
+    ifShow: ({ values }) => !isDir(Reflect.get(values, 'menuType')),
+    componentProps: {
+      maxLength: 100,
+    },
+    dynamicRules: () => {
+      return [
+        {
+          required: false,
+          validator: (_, value) => {
+            if (String(value).length > 100) {
+              return Promise.reject('字数不超过100个字');
+            }
+            return Promise.resolve();
+          },
+        },
+      ];
+    },
+  },
+  {
+    field: 'status',
+    label: t('routes.common.system.tableTitleSystemStatus'), //状态
+    component: 'RadioButtonGroup',
+    defaultValue: '0',
+    componentProps: {
+      options: [
+        { label: t('routes.common.system.tableTitleSystemEnable'), value: '0' }, //启用
+        { label: t('routes.common.system.tableTitleSystemStop'), value: '1' }, //禁用
+      ],
+    },
+  },
+  {
+    field: 'isLink',
+    label: t('routes.common.system.menuEditPagesIsExt'), //是否外链
+    component: 'RadioButtonGroup',
+    defaultValue: false,
+    componentProps: {
+      options: [
+        { label: t('routes.common.system.menuEditPagesYes'), value: true }, //是
+        { label: t('routes.common.system.menuEditPagesNo'), value: false }, //否
+      ],
+    },
+    ifShow: ({ values }) => !isButton(Reflect.get(values, 'menuType')),
+  },
+
+  {
+    field: 'ignoreKeepAlive',
+    label: t('routes.common.system.menuEditPagesIsKeepAlive'), //是否缓存
+    component: 'RadioButtonGroup',
+    defaultValue: false,
+    componentProps: {
+      options: [
+        { label: t('routes.common.system.menuEditPagesYes'), value: true }, //是
+        { label: t('routes.common.system.menuEditPagesNo'), value: false }, //否
+      ],
+    },
+    ifShow: ({ values }) => isMenu(Reflect.get(values, 'menuType')),
+  },
+
+  {
+    field: 'hideMenu',
+    label: t('routes.common.system.menuEditPagesIsHide'), //是否隐藏
+    component: 'RadioButtonGroup',
+    defaultValue: false,
+    componentProps: {
+      options: [
+        { label: t('routes.common.system.menuEditPagesYes'), value: true }, //是
+        { label: t('routes.common.system.menuEditPagesNo'), value: false }, //否
+      ],
+    },
+    ifShow: ({ values }) => !isButton(Reflect.get(values, 'menuType')),
+  },
+];