diff --git a/src/views/system/dept/components/DeptModal.vue b/src/views/system/dept/components/DeptModal.vue index 7b10d78..97f0b42 100644 --- a/src/views/system/dept/components/DeptModal.vue +++ b/src/views/system/dept/components/DeptModal.vue @@ -30,14 +30,6 @@ placeholder="请输入部门名称" /> - - - { @@ -172,7 +179,6 @@ export default defineComponent({ show: props.visible, title: props.data.title ? '修改菜单' : '添加菜单', form: Object.assign(data.form, row), - width: 700, negativeText: '取消', positiveText: '确认' } diff --git a/src/views/system/menu/index.vue b/src/views/system/menu/index.vue index a706c23..52d4941 100644 --- a/src/views/system/menu/index.vue +++ b/src/views/system/menu/index.vue @@ -28,110 +28,18 @@ import headSearch from '@/components/Search/index.vue' import dataTable from '@/components/DataTable/index.vue' import MenuModal from './components/MenuModal.vue' -import TableTags from '@/components/DataTable/tools/Tags.vue' import Action from '@/components/DataTable/tools/Action.vue' import { getMenu, getMenuList, deleteMenu } from '@/api/system/menu/index.js' import { h, ref, unref, reactive, toRefs, onMounted } from 'vue' import info from './info.js' +import table from './table.js' export default { name: 'MenuPage', components: { dataTable, MenuModal, headSearch }, setup() { const data = reactive({ columns: [ - { - title: '菜单标题', - key: 'title', - align: 'center', - width: 200 - }, - { - title: '菜单类型', - key: 'type', - align: 'center', - width: 100, - render(row) { - return h(TableTags, { - data: row.type, - filters: [ - { - key: 0, - label: '菜单' - }, - { - key: 1, - label: '节点' - } - ] - }) - } - }, - { - title: '路由地址', - key: 'path', - align: 'center', - width: 200 - }, - { - title: '组件路径', - key: 'component', - align: 'center', - width: 200 - }, - { - title: '状态', - key: 'status', - align: 'center', - width: 100, - render(row) { - return h(TableTags, { - data: row.status, - filters: [ - { - key: 1, - label: '在用' - }, - { - key: 2, - label: '停用' - } - ] - }) - } - }, - { - title: '排序', - key: 'sort', - align: 'center', - width: 100 - }, - { - title: '是否可见', - key: 'hide', - align: 'center', - width: 100, - render(row) { - return h(TableTags, { - data: row.hide, - filters: [ - { - key: 1, - label: '可见' - }, - { - key: 2, - label: '不可见' - } - ] - }) - } - }, - { - title: '创建时间', - key: 'createTime', - align: 'center', - width: 160 - }, + ...table.columns, { title: '操作', align: 'center', diff --git a/src/views/system/menu/table.js b/src/views/system/menu/table.js new file mode 100644 index 0000000..6a87500 --- /dev/null +++ b/src/views/system/menu/table.js @@ -0,0 +1,101 @@ +import { h } from 'vue' +import TableTags from '@/components/DataTable/tools/Tags.vue' +const table = { + columns: [ + { + title: '菜单标题', + key: 'title', + align: 'center', + width: 200 + }, + { + title: '菜单类型', + key: 'type', + align: 'center', + width: 100, + render(row) { + return h(TableTags, { + data: row.type, + filters: [ + { + key: 0, + label: '菜单' + }, + { + key: 1, + label: '节点' + } + ] + }) + } + }, + { + title: '路由地址', + key: 'path', + align: 'center', + width: 200 + }, + { + title: '组件路径', + key: 'component', + align: 'center', + width: 200 + }, + { + title: '状态', + key: 'status', + align: 'center', + width: 100, + render(row) { + return h(TableTags, { + data: row.status, + filters: [ + { + key: 1, + label: '在用' + }, + { + key: 2, + label: '停用' + } + ] + }) + } + }, + { + title: '排序', + key: 'sort', + align: 'center', + width: 100 + }, + { + title: '是否可见', + key: 'hide', + align: 'center', + width: 100, + render(row) { + return h(TableTags, { + data: row.hide, + filters: [ + { + key: 1, + label: '可见' + }, + { + key: 2, + label: '不可见' + } + ] + }) + } + }, + { + title: '创建时间', + key: 'createTime', + align: 'center', + width: 160 + } + ] +} + +export default table