| | |
| | | @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', |
| | |
| | | @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', |
| | |
| | | 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, |
| | |
| | | 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, |
| | |
| | | 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, |
| | | }); |
| | | } |
| | | |
| | |
| | | }); |
| | | } |
| | | |
| | | 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(); |
| | | } |
| | | } |