From 6917786864520d1ad19498d0ac5efa59452e87e8 Mon Sep 17 00:00:00 2001
From: H0nGzA1 <2505811377@qq.com>
Date: Thu, 30 Mar 2023 16:43:57 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8=20=E6=89=80=E6=9C=89=E8=8F=9C?=
=?UTF-8?q?=E5=8D=95=E9=A1=B5=E9=9D=A2=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96?=
=?UTF-8?q?~?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
web/src/views/system/areas/crud.tsx | 18 +
web/src/views/system/dept/crud.tsx | 16 +-
web/src/views/system/dept/index.vue | 131 ++++-
web/src/views/system/dictionary/crud.tsx | 25 +-
.../views/system/dictionary/subDict/crud.tsx | 20 +-
web/src/views/system/fileList/crud.tsx | 18 +
web/src/views/system/log/loginLog/crud.tsx | 4 +
.../views/system/log/operationLog/crud.tsx | 4 +
web/src/views/system/role/curd.tsx | 450 +++++++++---------
web/src/views/system/user/crud.tsx | 2 +-
web/src/views/system/user/index.vue | 112 +++--
web/src/views/system/whiteList/crud.tsx | 42 +-
12 files changed, 565 insertions(+), 277 deletions(-)
diff --git a/web/src/views/system/areas/crud.tsx b/web/src/views/system/areas/crud.tsx
index b8f36ad..19795b2 100644
--- a/web/src/views/system/areas/crud.tsx
+++ b/web/src/views/system/areas/crud.tsx
@@ -40,6 +40,24 @@ export const createCrudOptions = function ({ crudExpose }: { crudExpose: CrudExp
editRequest,
delRequest,
},
+ rowHandle: {
+ //固定右侧
+ fixed: 'right',
+ width: 200,
+ buttons: {
+ view: {
+ show: false,
+ },
+ edit: {
+ iconRight: 'Edit',
+ type: 'text',
+ },
+ remove: {
+ iconRight: 'Delete',
+ type: 'text',
+ },
+ },
+ },
pagination: {
show: false,
},
diff --git a/web/src/views/system/dept/crud.tsx b/web/src/views/system/dept/crud.tsx
index 190a6ea..d56b916 100644
--- a/web/src/views/system/dept/crud.tsx
+++ b/web/src/views/system/dept/crud.tsx
@@ -64,11 +64,23 @@ export const createCrudOptions = function ({ crudExpose }: { crudExpose: CrudExp
},
rowHandle: {
fiexd: 'right',
- width: 310,
+ fixed: 'right',
+ width: 200,
buttons: {
+ view: {
+ show: false,
+ },
+ edit: {
+ iconRight: 'Edit',
+ type: 'text',
+ },
+ remove: {
+ iconRight: 'Delete',
+ type: 'text',
+ },
addChildren: {
text: '添加子级',
- type: 'warning',
+ type: 'text',
click(context) {
const rowId = context.row.id;
crudExpose.openAdd({ row: { parent: rowId } });
diff --git a/web/src/views/system/dept/index.vue b/web/src/views/system/dept/index.vue
index 1fa8634..f3165f0 100644
--- a/web/src/views/system/dept/index.vue
+++ b/web/src/views/system/dept/index.vue
@@ -1,13 +1,126 @@
-
+
+
+
+
+ 部门列表
+
+
+
+
+
+
+
+ {{ node.label }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/web/src/views/system/dictionary/crud.tsx b/web/src/views/system/dictionary/crud.tsx
index e994f06..6460738 100644
--- a/web/src/views/system/dictionary/crud.tsx
+++ b/web/src/views/system/dictionary/crud.tsx
@@ -1,7 +1,7 @@
import * as api from './api';
import { dict, PageQuery, AddReq, DelReq, EditReq, CrudExpose, CrudOptions } from '@fast-crud/fast-crud';
import { dictionary } from '/@/utils/dictionary';
-import {nextTick, ref} from 'vue';
+import { nextTick, ref } from 'vue';
interface CreateCrudOptionsTypes {
crudOptions: CrudOptions;
@@ -30,25 +30,34 @@ export const createCrudOptions = function ({ crudExpose, subDictRef }: { crudExp
delRequest,
},
rowHandle: {
- width: 360,
+ width: 200,
buttons: {
+ view: {
+ show: false,
+ },
+ edit: {
+ iconRight: 'Edit',
+ type: 'text',
+ },
+ remove: {
+ iconRight: 'Delete',
+ type: 'text',
+ },
custom: {
text: '字典配置',
- type: 'success',
+ type: 'text',
tooltip: {
placement: 'top',
content: '字典配置',
},
//@ts-ignore
click: (context: any) => {
- const {row} = context
+ const { row } = context;
subDictRef.value.drawer = true;
- nextTick(()=>{
+ nextTick(() => {
subDictRef.value.setSearchFormData({ form: { parent: row.id } });
subDictRef.value.doRefresh();
- })
-
-
+ });
},
},
},
diff --git a/web/src/views/system/dictionary/subDict/crud.tsx b/web/src/views/system/dictionary/subDict/crud.tsx
index 27828ab..7626d89 100644
--- a/web/src/views/system/dictionary/subDict/crud.tsx
+++ b/web/src/views/system/dictionary/subDict/crud.tsx
@@ -2,7 +2,7 @@ import * as api from './api';
import { dict, PageQuery, AddReq, DelReq, EditReq, CrudExpose, CrudOptions } from '@fast-crud/fast-crud';
import { request } from '/@/utils/service';
import { dictionary } from '/@/utils/dictionary';
-import {watch} from "vue";
+import { watch } from 'vue';
interface CreateCrudOptionsTypes {
crudOptions: CrudOptions;
}
@@ -30,6 +30,24 @@ export const createCrudOptions = function ({ crudExpose }: { crudExpose: CrudExp
editRequest,
delRequest,
},
+ rowHandle: {
+ //固定右侧
+ fixed: 'right',
+ width: 200,
+ buttons: {
+ view: {
+ show: false,
+ },
+ edit: {
+ iconRight: 'Edit',
+ type: 'text',
+ },
+ remove: {
+ iconRight: 'Delete',
+ type: 'text',
+ },
+ },
+ },
columns: {
_index: {
title: '序号',
diff --git a/web/src/views/system/fileList/crud.tsx b/web/src/views/system/fileList/crud.tsx
index e0d9d65..60ef81b 100644
--- a/web/src/views/system/fileList/crud.tsx
+++ b/web/src/views/system/fileList/crud.tsx
@@ -35,6 +35,24 @@ export const createCrudOptions = function ({ crudExpose }: { crudExpose: CrudExp
editRequest,
delRequest,
},
+ rowHandle: {
+ //固定右侧
+ fixed: 'right',
+ width: 200,
+ buttons: {
+ view: {
+ show: false,
+ },
+ edit: {
+ iconRight: 'Edit',
+ type: 'text',
+ },
+ remove: {
+ iconRight: 'Delete',
+ type: 'text',
+ },
+ },
+ },
columns: {
_index: {
title: '序号',
diff --git a/web/src/views/system/log/loginLog/crud.tsx b/web/src/views/system/log/loginLog/crud.tsx
index 259243b..5e11903 100644
--- a/web/src/views/system/log/loginLog/crud.tsx
+++ b/web/src/views/system/log/loginLog/crud.tsx
@@ -36,7 +36,11 @@ export const createCrudOptions = function ({ crudExpose }: { crudExpose: CrudExp
},
},
rowHandle: {
+ width: 100,
buttons: {
+ view: {
+ type: 'text',
+ },
edit: {
show: false,
},
diff --git a/web/src/views/system/log/operationLog/crud.tsx b/web/src/views/system/log/operationLog/crud.tsx
index 53c1276..11daf67 100644
--- a/web/src/views/system/log/operationLog/crud.tsx
+++ b/web/src/views/system/log/operationLog/crud.tsx
@@ -36,7 +36,11 @@ export const createCrudOptions = function ({ crudExpose }: { crudExpose: CrudExp
},
},
rowHandle: {
+ width: 100,
buttons: {
+ view: {
+ type: 'text',
+ },
edit: {
show: false,
},
diff --git a/web/src/views/system/role/curd.tsx b/web/src/views/system/role/curd.tsx
index 2655d65..c7562ee 100644
--- a/web/src/views/system/role/curd.tsx
+++ b/web/src/views/system/role/curd.tsx
@@ -1,227 +1,237 @@
-import {CrudOptions, AddReq, DelReq, EditReq, dict, CrudExpose} from '@fast-crud/fast-crud';
+import { CrudOptions, AddReq, DelReq, EditReq, dict, CrudExpose } from '@fast-crud/fast-crud';
import _ from 'lodash-es';
-import * as api from "./api";
+import * as api from './api';
interface CreateCrudOptionsTypes {
- crudOptions: CrudOptions;
+ crudOptions: CrudOptions;
}
//此处为crudOptions配置
-export const createCrudOptions = function ({crudExpose,rolePermission}: {crudExpose: CrudExpose,rolePermission:any}): CreateCrudOptionsTypes {
+export const createCrudOptions = function ({ crudExpose, rolePermission }: { crudExpose: CrudExpose; rolePermission: any }): CreateCrudOptionsTypes {
+ const pageRequest = async (query: any) => {
+ return await api.GetList(query);
+ };
+ const editRequest = async ({ form, row }: EditReq) => {
+ form.id = row.id;
+ return await api.UpdateObj(form);
+ };
+ const delRequest = async ({ row }: DelReq) => {
+ return await api.DelObj(row.id);
+ };
+ const addRequest = async ({ form }: AddReq) => {
+ return await api.AddObj(form);
+ };
- const pageRequest = async (query: any) => {
- return await api.GetList(query);
- };
- const editRequest = async ({ form, row }: EditReq) => {
- form.id = row.id;
- return await api.UpdateObj(form);
- };
- const delRequest = async ({ row }: DelReq) => {
- return await api.DelObj(row.id);
- };
- const addRequest = async ({ form }: AddReq) => {
- return await api.AddObj(form);
- };
-
- return {
- crudOptions: {
- request: {
- pageRequest,
- addRequest,
- editRequest,
- delRequest,
- },
- rowHandle: {
- //固定右侧
- fixed: "right",
- width:310,
- buttons: {
- custom: {
- text: "权限配置",
- type:'warning',
- tooltip: {
- placement: "top",
- content: "删除"
- },
- click: (context:any):void => {
- const {row} = context
- // eslint-disable-next-line no-mixed-spaces-and-tabs
- rolePermission.value.drawer=true
- rolePermission.value.editedRoleInfo = row
- rolePermission.value.initGet()
- }
- }
- },
- },
- form: {
- col: {span: 24},
- labelWidth: '100px',
- wrapper: {
- is: 'el-dialog',
- width: '600px',
- },
- },
- columns: {
- _index: {
- title: '序号',
- form: {show: false},
- column: {
- //type: 'index',
- align: 'center',
- width: '70px',
- columnSetDisabled: true, //禁止在列设置中选择
- formatter: (context) => {
- //计算序号,你可以自定义计算规则,此处为翻页累加
- let index = context.index ?? 1;
- let pagination = crudExpose.crudBinding.value.pagination;
- // @ts-ignore
- return ((pagination.currentPage ?? 1) - 1) * pagination.pageSize + index + 1;
- },
- },
- },
- id: {
- title: 'ID',
- type: 'text',
- column: {show: false},
- search: {show: false},
- form: {show: false},
- },
- name: {
- title: '角色名称',
- type: 'text',
- search: {show: true},
- column: {
- minWidth: 120,
- sortable: "custom",
- },
- form: {
- rules: [{required: true, message: '角色名称必填'}],
- component: {
- placeholder: '输入角色名称搜索',
- },
- },
- },
- key: {
- title: '权限标识',
- type: 'text',
- search: {show: false},
- column: {
- width: 120,
- sortable: "custom",
- },
- form: {
- rules: [{required: true, message: '权限标识必填'}],
- placeholder: '输入权限标识',
- },
- },
- sort: {
- title: '排序',
- search: {show: false},
- type: 'number',
- column: {
- width: 90,
- sortable: "custom",
- },
- form: {
- rules: [{required: true, message: '排序必填'}],
- value: 1,
- },
- },
- admin: {
- title: '是否管理员',
- search: {show: false},
- type: 'dict-radio',
- dict: dict({
- data: [
- {
- label: '是',
- value: true,
- color: 'success',
- },
- {
- label: '否',
- value: false,
- color: 'danger',
- },
- ],
- }),
- column: {
- width: 130,
- sortable: "custom",
- },
- form: {
- rules: [{required: true, message: '是否管理员必填'}],
- value: false,
- },
- },
- status: {
- title: '状态',
- search: {show: true},
- type: 'dict-radio',
- dict: dict({
- data: [
- {
- label: '启用',
- value: true,
- color: 'success',
- },
- {
- label: '禁用',
- value: false,
- color: 'danger',
- },
- ],
- }),
- column: {
- width: 90,
- sortable: "custom",
- },
- form: {
- rules: [{required: true, message: '状态必填'}],
- value: true,
- },
- },
- update_datetime: {
- title: '更新时间',
- type: 'text',
- search: {show: false},
- column: {
- width: 170,
- sortable: "custom",
- },
- form: {
- show: false,
- component: {
- placeholder: '输入关键词搜索',
- },
- },
- },
- create_datetime: {
- title: '创建时间',
- type: 'text',
- search: {show: false},
- column: {
- sortable: "custom",
- width: 170,
- },
- form: {
- show: false,
- component: {
- placeholder: '输入关键词搜索',
- },
- },
- },
- // description: {
- // title: '备注',
- // type: 'textarea',
- // search: {show: false},
- // form: {
- // component: {
- // maxlength: 200,
- // placeholder: '输入备注',
- // },
- // },
- // },
- },
- },
- };
+ return {
+ crudOptions: {
+ request: {
+ pageRequest,
+ addRequest,
+ editRequest,
+ delRequest,
+ },
+ rowHandle: {
+ //固定右侧
+ fixed: 'right',
+ width: 200,
+ buttons: {
+ view: {
+ show: false,
+ },
+ edit: {
+ iconRight: 'Edit',
+ type: 'text',
+ },
+ remove: {
+ iconRight: 'Delete',
+ type: 'text',
+ },
+ custom: {
+ text: '权限配置',
+ type: 'text',
+ tooltip: {
+ placement: 'top',
+ content: '删除',
+ },
+ click: (context: any): void => {
+ const { row } = context;
+ // eslint-disable-next-line no-mixed-spaces-and-tabs
+ rolePermission.value.drawer = true;
+ rolePermission.value.editedRoleInfo = row;
+ rolePermission.value.initGet();
+ },
+ },
+ },
+ },
+ form: {
+ col: { span: 24 },
+ labelWidth: '100px',
+ wrapper: {
+ is: 'el-dialog',
+ width: '600px',
+ },
+ },
+ columns: {
+ _index: {
+ title: '序号',
+ form: { show: false },
+ column: {
+ //type: 'index',
+ align: 'center',
+ width: '70px',
+ columnSetDisabled: true, //禁止在列设置中选择
+ formatter: (context) => {
+ //计算序号,你可以自定义计算规则,此处为翻页累加
+ let index = context.index ?? 1;
+ let pagination = crudExpose.crudBinding.value.pagination;
+ // @ts-ignore
+ return ((pagination.currentPage ?? 1) - 1) * pagination.pageSize + index + 1;
+ },
+ },
+ },
+ id: {
+ title: 'ID',
+ type: 'text',
+ column: { show: false },
+ search: { show: false },
+ form: { show: false },
+ },
+ name: {
+ title: '角色名称',
+ type: 'text',
+ search: { show: true },
+ column: {
+ minWidth: 120,
+ sortable: 'custom',
+ },
+ form: {
+ rules: [{ required: true, message: '角色名称必填' }],
+ component: {
+ placeholder: '输入角色名称搜索',
+ },
+ },
+ },
+ key: {
+ title: '权限标识',
+ type: 'text',
+ search: { show: false },
+ column: {
+ width: 120,
+ sortable: 'custom',
+ },
+ form: {
+ rules: [{ required: true, message: '权限标识必填' }],
+ placeholder: '输入权限标识',
+ },
+ },
+ sort: {
+ title: '排序',
+ search: { show: false },
+ type: 'number',
+ column: {
+ width: 90,
+ sortable: 'custom',
+ },
+ form: {
+ rules: [{ required: true, message: '排序必填' }],
+ value: 1,
+ },
+ },
+ admin: {
+ title: '是否管理员',
+ search: { show: false },
+ type: 'dict-radio',
+ dict: dict({
+ data: [
+ {
+ label: '是',
+ value: true,
+ color: 'success',
+ },
+ {
+ label: '否',
+ value: false,
+ color: 'danger',
+ },
+ ],
+ }),
+ column: {
+ width: 130,
+ sortable: 'custom',
+ },
+ form: {
+ rules: [{ required: true, message: '是否管理员必填' }],
+ value: false,
+ },
+ },
+ status: {
+ title: '状态',
+ search: { show: true },
+ type: 'dict-radio',
+ dict: dict({
+ data: [
+ {
+ label: '启用',
+ value: true,
+ color: 'success',
+ },
+ {
+ label: '禁用',
+ value: false,
+ color: 'danger',
+ },
+ ],
+ }),
+ column: {
+ width: 90,
+ sortable: 'custom',
+ },
+ form: {
+ rules: [{ required: true, message: '状态必填' }],
+ value: true,
+ },
+ },
+ update_datetime: {
+ title: '更新时间',
+ type: 'text',
+ search: { show: false },
+ column: {
+ width: 170,
+ sortable: 'custom',
+ },
+ form: {
+ show: false,
+ component: {
+ placeholder: '输入关键词搜索',
+ },
+ },
+ },
+ create_datetime: {
+ title: '创建时间',
+ type: 'text',
+ search: { show: false },
+ column: {
+ sortable: 'custom',
+ width: 170,
+ },
+ form: {
+ show: false,
+ component: {
+ placeholder: '输入关键词搜索',
+ },
+ },
+ },
+ // description: {
+ // title: '备注',
+ // type: 'textarea',
+ // search: {show: false},
+ // form: {
+ // component: {
+ // maxlength: 200,
+ // placeholder: '输入备注',
+ // },
+ // },
+ // },
+ },
+ },
+ };
};
diff --git a/web/src/views/system/user/crud.tsx b/web/src/views/system/user/crud.tsx
index 06c32c3..84180e9 100644
--- a/web/src/views/system/user/crud.tsx
+++ b/web/src/views/system/user/crud.tsx
@@ -31,7 +31,7 @@ export const createCrudOptions = function ({ crudExpose }: { crudExpose: CrudExp
rowHandle: {
//固定右侧
fixed: 'right',
- width: 200,
+ width: 140,
buttons: {
view: {
show: false,
diff --git a/web/src/views/system/user/index.vue b/web/src/views/system/user/index.vue
index 841763d..7d130b6 100644
--- a/web/src/views/system/user/index.vue
+++ b/web/src/views/system/user/index.vue
@@ -3,14 +3,33 @@
+
+ 用户列表
+
+
+
+
-
-
+
+
+ {{ node.label }}
+
+
-
+
-
+
@@ -18,38 +37,44 @@