From 2d92fca5a5f2b6843290be34f6d1f1d1802f0cf2 Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Wed, 2 Apr 2025 16:18:19 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=91=98=E5=B7=A5=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=B7=BB=E5=8A=A0=E7=BC=96=E8=BE=91=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=94=B6=E9=9F=B3=E6=9C=BA=E6=9D=83=E9=99=90=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/shop/staff/config/add.ts | 15 ++------ src/views/shop/staff/config/edit.ts | 6 ---- src/views/shop/staff/index.vue | 54 +++++++++++++++++++++++++++-- 3 files changed, 54 insertions(+), 21 deletions(-) diff --git a/src/views/shop/staff/config/add.ts b/src/views/shop/staff/config/add.ts index 5cdcbd9..bb9dff7 100644 --- a/src/views/shop/staff/config/add.ts +++ b/src/views/shop/staff/config/add.ts @@ -165,19 +165,8 @@ const modalConfig: IModalConfig = { ], initialValue: 1, }, - { - label: "员工权限设置", - prop: "", - type: "title", - slotName: "title", - }, - { - type: 'custom', - prop: 'permission', - slotName: 'permission', - label: '', - hidden: true - } + + ], }; diff --git a/src/views/shop/staff/config/edit.ts b/src/views/shop/staff/config/edit.ts index bb05d21..8faa32c 100644 --- a/src/views/shop/staff/config/edit.ts +++ b/src/views/shop/staff/config/edit.ts @@ -164,12 +164,6 @@ const modalConfig: IModalConfig = { ], initialValue: 1, }, - { - label: "员工权限设置", - prop: "", - type: "title", - slotName: "title", - }, ], }; diff --git a/src/views/shop/staff/index.vue b/src/views/shop/staff/index.vue index 2a5a85d..9d29858 100644 --- a/src/views/shop/staff/index.vue +++ b/src/views/shop/staff/index.vue @@ -44,7 +44,19 @@ @@ -56,6 +68,19 @@ @submit-click="handleSubmitClick" > @@ -78,7 +103,7 @@ import RoleApi, { type SysRole } from "@/api/account/role"; import ShopStaffApi from "@/api/account/shopStaff"; import permissionApi, { type ShopPermission } from "@/api/account/permission"; import selectPermission from "./components/select-permission.vue"; - +import shopPagePermissionApi from "@/api/account/shopPagePermission"; const { searchRef, contentRef, @@ -99,6 +124,18 @@ let permissionList = ref([]); //选中的权限列表 let selPermissionList = ref([]); let addSelPermissionList = ref([]); + +// 选中的收音机页面列表 +interface PagePath { + label: string; + value: string; + [property: string]: any; +} + +const pagePathIdLists = ref([]); +const addPagePathIdList = ref([]); +const editPagePathIdList = ref([]); + // 数据初始化 async function init() { // 覆写添加确定方法 @@ -106,6 +143,7 @@ async function init() { addModalConfig.formAction = (data) => { return oldAddSubmitFunc({ ...data, + pagePathIdList: addPagePathIdList.value, shopPermissionIds: addSelPermissionList.value.reduce((pre: string[], cur: string) => { return pre.concat(cur); }, [] as string[]), @@ -116,6 +154,7 @@ async function init() { editModalConfig.formAction = (data) => { return oldeditSubmitFunc({ ...data, + pagePathIdList: editPagePathIdList.value, shopPermissionIds: selPermissionList.value.reduce((pre: string[], cur: string) => { return pre.concat(cur); }, [] as string[]), @@ -134,6 +173,14 @@ async function init() { }); addModalConfig.formItems[1]!.options = roleArr; editModalConfig.formItems[1]!.options = roleArr; + const pagesRes = await shopPagePermissionApi.getPageAll({}); + pagePathIdLists.value = pagesRes.map((item: any) => { + return { + ...item, + label: item.name, + value: item.id, + }; + }); } init(); @@ -165,6 +212,9 @@ async function handleEditClick(row: IObject) { } } } + const pageList = await shopPagePermissionApi.detail({ staffId: row.id }); + console.log(pageList); + editPagePathIdList.value = pageList.map((item) => item.id); console.log(selPermissionList.value); // 根据id获取数据进行填充 await ShopStaffApi.get(row.id).then((res) => {