From 9572a73791dc0e5943d1983df7f1ed90bd422375 Mon Sep 17 00:00:00 2001 From: icssoa <615206459@qq.com> Date: Tue, 17 May 2022 15:00:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=94=A8=E6=88=B7=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/pages/login/components/captcha.vue | 2 +- .../base/views/components/dept-tree.vue | 18 ++--- src/modules/base/views/user.vue | 69 +++++++------------ 3 files changed, 34 insertions(+), 55 deletions(-) diff --git a/src/modules/base/pages/login/components/captcha.vue b/src/modules/base/pages/login/components/captcha.vue index c70667e..74c4df4 100644 --- a/src/modules/base/pages/login/components/captcha.vue +++ b/src/modules/base/pages/login/components/captcha.vue @@ -19,7 +19,7 @@ export default defineComponent({ // base64 const base64 = ref(""); - // svg1233 + // svg const svg = ref(""); function refresh() { diff --git a/src/modules/base/views/components/dept-tree.vue b/src/modules/base/views/components/dept-tree.vue index 0ea1a0e..405414d 100644 --- a/src/modules/base/views/components/dept-tree.vue +++ b/src/modules/base/views/components/dept-tree.vue @@ -17,8 +17,8 @@
  • - 保存 - 取消 + 保存 + 取消
  • @@ -68,7 +68,7 @@ import { deepTree, revDeepTree } from "/@/cool/utils"; import { isArray } from "lodash"; import { ContextMenu, useForm } from "@cool-vue/crud"; import { Refresh, Operation, MoreFilled } from "@element-plus/icons-vue"; -import { useBaseStore } from "/$/base"; +import { useBaseStore, checkPerm } from "/$/base"; export default defineComponent({ name: "dept-tree", @@ -181,7 +181,7 @@ export default defineComponent({ ], form: e, on: { - submit: (data: any, { done, close }: any) => { + submit(data, { done, close }) { service.base.sys.department[method]({ id: e.id, parentId: e.parentId, @@ -295,13 +295,13 @@ export default defineComponent({ } // 权限 - const prem = service.base.sys.department._permission; + const perm = service.base.sys.department.permission; ContextMenu.open(e, { list: [ { label: "新增", - hidden: (n && n.level >= props.level) || !prem.add, + hidden: (n && n.level >= props.level) || !checkPerm(perm.add), callback(done) { rowEdit({ name: "", @@ -313,7 +313,7 @@ export default defineComponent({ }, { label: "编辑", - hidden: !prem.update, + hidden: !checkPerm(perm.update), callback(done) { rowEdit(d); done(); @@ -321,7 +321,7 @@ export default defineComponent({ }, { label: "删除", - hidden: !d.parentId || !prem.delete, + hidden: !d.parentId || !checkPerm(perm.delete), callback(done) { rowDel(d); done(); @@ -329,7 +329,7 @@ export default defineComponent({ }, { label: "新增成员", - hidden: !service.base.sys.user.permission.add, + hidden: !checkPerm(perm.add), callback(done) { emit("user-add", d); done(); diff --git a/src/modules/base/views/user.vue b/src/modules/base/views/user.vue index 77dca9e..3fb3ccb 100644 --- a/src/modules/base/views/user.vue +++ b/src/modules/base/views/user.vue @@ -49,15 +49,17 @@ > @@ -115,22 +117,7 @@ const dept = ref([]); // cl-crud 配置 const Crud = useCrud( { - service: service.base.sys.user, - async onRefresh(params, { next, render }) { - const { list } = await next(params); - - render( - list.map((e: any) => { - if (e.roleName) { - e.roleNameList = e.roleName.split(","); - } - - e.status = Boolean(e.status); - - return e; - }) - ); - } + service: service.base.sys.user }, (app) => { app.refresh(); @@ -175,7 +162,15 @@ const Table = useTable({ prop: "roleName", label: "角色", headerAlign: "center", - minWidth: 200 + minWidth: 120 + }, + { + prop: "status", + label: "状态", + minWidth: 120, + component: { + name: "cl-switch" + } }, { prop: "phone", @@ -187,23 +182,6 @@ const Table = useTable({ label: "备注", minWidth: 150 }, - { - prop: "status", - label: "状态", - minWidth: 120, - dict: [ - { - label: "启用", - value: 1, - type: "success" - }, - { - label: "禁用", - value: 0, - type: "danger" - } - ] - }, { prop: "createTime", label: "创建时间", @@ -213,7 +191,7 @@ const Table = useTable({ { type: "op", buttons: ["slot-btn", "edit", "delete"], - width: 180 + width: 240 } ] }); @@ -494,6 +472,8 @@ async function toMove(e?: any) { } .icon { + display: flex; + align-items: center; position: absolute; left: 0; top: 0; @@ -502,7 +482,6 @@ async function toMove(e?: any) { background-color: #fff; height: 40px; width: 80px; - line-height: 40px; padding-left: 10px; } }