From 200ecb667d4962743499f79795218313b2e4f9fc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=BD=99=E8=8F=B2?= <1622041228@qq.com>
Date: Mon, 30 May 2022 10:38:48 +0800
Subject: [PATCH] =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E6=95=B0=E6=8D=AE=E7=BB=84?=
=?UTF-8?q?=E4=BB=B6=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../system/dept/components/DeptModal.vue | 10 +-
src/views/system/dept/index.vue | 34 +-----
src/views/system/dept/info.js | 18 ----
src/views/system/dept/table.js | 30 ++++++
.../system/menu/components/MenuModal.vue | 14 ++-
src/views/system/menu/index.vue | 96 +----------------
src/views/system/menu/table.js | 101 ++++++++++++++++++
7 files changed, 146 insertions(+), 157 deletions(-)
create mode 100644 src/views/system/dept/table.js
create mode 100644 src/views/system/menu/table.js
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