Ben Lin
2024-06-25 7d26ed0e19bf952e7c037b21bfd687759b46e851
src/views/tigerprojects/system/menu/index.vue
@@ -15,14 +15,14 @@
            @expanded-rows-change="onExpandedRChg"
          >
            <template #toolbar>
              <a-button type="primary" @click="handleCreate"> 新增菜单 </a-button>
              <a-button type="primary" @click="handleCreate('BS 菜单')"> 新增菜单 </a-button>
            </template>
            <template #action="{ record }">
              <TableAction
                :actions="[
                  {
                    icon: 'clarity:note-edit-line',
                    onClick: handleEdit.bind(null, record),
                    onClick: handleEdit.bind(null, record, 'BS 菜单'),
                  },
                  {
                    icon: 'ant-design:delete-outlined',
@@ -47,14 +47,14 @@
            @expanded-rows-change="onExpandedRChg"
          >
            <template #toolbar>
              <a-button type="primary" @click="handleCreate"> 新增菜单 </a-button>
              <a-button type="primary" @click="handleCreate('PDA')"> 新增菜单 </a-button>
            </template>
            <template #action="{ record }">
              <TableAction
                :actions="[
                  {
                    icon: 'clarity:note-edit-line',
                    onClick: handleEdit.bind(null, record),
                    onClick: handleEdit.bind(null, record, 'PDA'),
                  },
                  {
                    icon: 'ant-design:delete-outlined',
@@ -96,14 +96,14 @@
    api: getMenuList,
    searchInfo: { menuName: 'BS 菜单' },
    columns,
    // formConfig: {
    //   labelWidth: 120,
    //   schemas: searchFormSchema,
    // },
    formConfig: {
      labelWidth: 120,
      schemas: searchFormSchema,
    },
    isTreeTable: true,
    // pagination: false,
    // striped: false,
    // // useSearchForm: true,
    useSearchForm: true,
    showTableSetting: true,
    // bordered: true,
    // showIndexColumn: false,
@@ -118,20 +118,20 @@
    rowKey: 'id',
  });
  const [registerTableSecond, { reloadSecond, expandAllSecond, expandRowsSecond }] = useTable({
  const [registerTableSecond, { reload:reloadSecond, expandAll:expandAllSecond, expandRows:expandRowsSecond }] = useTable({
    // const [registerTable, { reload, expandRows }] = useTable({
    title: '菜单列表',
    api: getMenuList,
    searchInfo: { menuName: 'PDA' },
    columns,
    // formConfig: {
    //   labelWidth: 120,
    //   schemas: searchFormSchema,
    // },
    formConfig: {
      labelWidth: 120,
      schemas: searchFormSchema,
    },
    isTreeTable: true,
    // pagination: false,
    // striped: false,
    // // useSearchForm: true,
    useSearchForm: true,
    showTableSetting: true,
    // bordered: true,
    // showIndexColumn: false,
@@ -146,16 +146,18 @@
    rowKey: 'id',
  });
  function handleCreate() {
  function handleCreate(menuName: string) {
    openDrawer(true, {
      isUpdate: false,
      menuName: menuName,
    });
  }
  function handleEdit(record: Recordable) {
  function handleEdit(record: Recordable, menuName: string) {
    openDrawer(true, {
      record,
      isUpdate: true,
      menuName: menuName,
    });
  }
@@ -170,15 +172,19 @@
    });
  }
  function handleSuccess({ values }) {
    reload();
  function handleSuccess(d) {
    if (d.menuName == 'PDA') {
      reloadSecond();
    } else {
      reload();
    }
    nextTick(() => {
      setTimeout(() => {
        var tdList = document.querySelectorAll(
          '.ant-table-cell.ant-table-cell-ellipsis.ant-table-cell-with-append',
        );
        for (var i = 0; i < tdList.length; i++) {
          if (tdList[i].attributes['title'].nodeValue == values.menuName) {
          if (tdList[i].attributes['title'].nodeValue == d.values.menuName) {
            tdList[i].scrollIntoView();
          }
        }