|
@@ -6,7 +6,7 @@
|
|
|
@cancel="cancel"
|
|
@cancel="cancel"
|
|
|
centered
|
|
centered
|
|
|
:maskClosable="false"
|
|
:maskClosable="false"
|
|
|
- width="100%">
|
|
|
|
|
|
|
+ :width="isPingAnOem() ? '800px' : '100%'">
|
|
|
<template #footer>
|
|
<template #footer>
|
|
|
<a-button key="cancel"
|
|
<a-button key="cancel"
|
|
|
type="primary"
|
|
type="primary"
|
|
@@ -35,10 +35,14 @@
|
|
|
name></a-form-item>
|
|
name></a-form-item>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
<a-col :span="24">
|
|
<a-col :span="24">
|
|
|
- <div class="powerTable">
|
|
|
|
|
- <!-- <a-checkbox-group class="commonCheckboxGroup"
|
|
|
|
|
-
|
|
|
|
|
- >-->
|
|
|
|
|
|
|
+ <a-tree v-if="isPingAnOem()"
|
|
|
|
|
+ checkable
|
|
|
|
|
+ :tree-data="tableList"
|
|
|
|
|
+ v-model:checkedKeys="checkedKeys"
|
|
|
|
|
+ :replace-fields="replaceFields">
|
|
|
|
|
+ </a-tree>
|
|
|
|
|
+ <div class="powerTable"
|
|
|
|
|
+ v-else>
|
|
|
<div class="powerRow"
|
|
<div class="powerRow"
|
|
|
v-for="(item, i) in tableList"
|
|
v-for="(item, i) in tableList"
|
|
|
:key="i + '0'">
|
|
:key="i + '0'">
|
|
@@ -68,7 +72,6 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <!-- </a-checkbox-group> -->
|
|
|
|
|
</div>
|
|
</div>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
</a-row>
|
|
</a-row>
|
|
@@ -89,6 +92,7 @@ import { ManagerRoleOperateReq, MemberFuncMenu } from '@/services/proto/accounti
|
|
|
import { getUserId } from '@/services/bus/account';
|
|
import { getUserId } from '@/services/bus/account';
|
|
|
import { getAoletype_string, getAreaUserId, getUserAccountType } from '@/services/bus/user';
|
|
import { getAoletype_string, getAreaUserId, getUserAccountType } from '@/services/bus/user';
|
|
|
import { geLoginID_number } from '@/services/bus/login';
|
|
import { geLoginID_number } from '@/services/bus/login';
|
|
|
|
|
+import { isPingAnOem } from '@/common/config/projectName';
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
|
name: 'account_info_manager_btn_add',
|
|
name: 'account_info_manager_btn_add',
|
|
@@ -99,48 +103,75 @@ export default defineComponent({
|
|
|
const loading = ref<boolean>(false);
|
|
const loading = ref<boolean>(false);
|
|
|
const tableList = ref<ErmcpRoleMenuEx[]>([]);
|
|
const tableList = ref<ErmcpRoleMenuEx[]>([]);
|
|
|
const name = ref<string>('');
|
|
const name = ref<string>('');
|
|
|
|
|
+ const replaceFields = {
|
|
|
|
|
+ children: 'SubMenu',
|
|
|
|
|
+ title: 'resourcename',
|
|
|
|
|
+ key: 'resourcecode',
|
|
|
|
|
+ };
|
|
|
|
|
+ const checkedKeys = ref<string[]>([]);
|
|
|
watchEffect(() => {
|
|
watchEffect(() => {
|
|
|
if (visible.value) {
|
|
if (visible.value) {
|
|
|
- const param = { userid: getUserId(), roleid: getAoletype_string() };
|
|
|
|
|
|
|
+ // 平安 权限层级超过 4 层了,原先设计最多支持3个层级,故得重新写
|
|
|
|
|
+ // 菜单类型 1:管理端 2:交易端 3:终端(企业云平台) 4:仓单贸易 ps:新加的参数,为了兼容以前,不传则默认查3
|
|
|
|
|
+ const menutype = isPingAnOem() ? 5 : 3;
|
|
|
|
|
+ const param = { userid: getUserId(), roleid: getAoletype_string(), menutype };
|
|
|
|
|
+
|
|
|
queryResultLoadingAndInfo(QueryAccMgrRoleMenu, loading, param).then((res) => {
|
|
queryResultLoadingAndInfo(QueryAccMgrRoleMenu, loading, param).then((res) => {
|
|
|
|
|
+ const fn = (arr: any[]) => {
|
|
|
|
|
+ arr.forEach((el) => {
|
|
|
|
|
+ Object.assign(el, el.Menu);
|
|
|
|
|
+ if (el.SubMenu.length) {
|
|
|
|
|
+ fn(el.SubMenu);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ };
|
|
|
|
|
+ fn(res);
|
|
|
tableList.value = res;
|
|
tableList.value = res;
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
function submit() {
|
|
function submit() {
|
|
|
- const result: string[] = [];
|
|
|
|
|
- // 处理已经勾选的数据
|
|
|
|
|
- tableList.value.forEach((first) => {
|
|
|
|
|
- if (first.Menu.ishadrole) {
|
|
|
|
|
- result.push(first.Menu.resourcecode);
|
|
|
|
|
- first.SubMenu.forEach((second) => {
|
|
|
|
|
- if (second.Menu.ishadrole) {
|
|
|
|
|
- result.push(second.Menu.resourcecode);
|
|
|
|
|
- second.SubMenu.forEach((third) => {
|
|
|
|
|
- if (third.Menu.ishadrole) {
|
|
|
|
|
- result.push(third.Menu.resourcecode);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
if (!name.value) {
|
|
if (!name.value) {
|
|
|
message.error('请输入角色名称');
|
|
message.error('请输入角色名称');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if (result.length === 0) {
|
|
|
|
|
- message.error('请至少选择一个权限');
|
|
|
|
|
- return;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ let checkedCodes = [];
|
|
|
|
|
+ if (isPingAnOem()) {
|
|
|
|
|
+ checkedCodes = checkedKeys.value;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ const result: string[] = [];
|
|
|
|
|
+ // 处理已经勾选的数据
|
|
|
|
|
+ tableList.value.forEach((first) => {
|
|
|
|
|
+ if (first.Menu.ishadrole) {
|
|
|
|
|
+ result.push(first.Menu.resourcecode);
|
|
|
|
|
+ first.SubMenu.forEach((second) => {
|
|
|
|
|
+ if (second.Menu.ishadrole) {
|
|
|
|
|
+ result.push(second.Menu.resourcecode);
|
|
|
|
|
+ second.SubMenu.forEach((third) => {
|
|
|
|
|
+ if (third.Menu.ishadrole) {
|
|
|
|
|
+ result.push(third.Menu.resourcecode);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ if (result.length === 0) {
|
|
|
|
|
+ message.error('请至少选择一个权限');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ checkedCodes = result;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
const reqParam: ManagerRoleOperateReq = {
|
|
const reqParam: ManagerRoleOperateReq = {
|
|
|
autoid: getUserId(), // uint64 角色ID
|
|
autoid: getUserId(), // uint64 角色ID
|
|
|
operatetype: 1, // uint32 操作类型-1:新增 2:修改
|
|
operatetype: 1, // uint32 操作类型-1:新增 2:修改
|
|
|
areauserid: getAreaUserId(), // uint64 所属机构
|
|
areauserid: getAreaUserId(), // uint64 所属机构
|
|
|
modifierid: Number(geLoginID_number()), // uint64 修改人ID
|
|
modifierid: Number(geLoginID_number()), // uint64 修改人ID
|
|
|
rolename: name.value, // string 角色名称
|
|
rolename: name.value, // string 角色名称
|
|
|
- memberfuncmenus: result.map((item) => {
|
|
|
|
|
|
|
+ memberfuncmenus: checkedCodes.map((item) => {
|
|
|
return {
|
|
return {
|
|
|
resourcecode: item,
|
|
resourcecode: item,
|
|
|
} as MemberFuncMenu;
|
|
} as MemberFuncMenu;
|
|
@@ -190,6 +221,9 @@ export default defineComponent({
|
|
|
loading,
|
|
loading,
|
|
|
tableList,
|
|
tableList,
|
|
|
firstChaneg,
|
|
firstChaneg,
|
|
|
|
|
+ isPingAnOem,
|
|
|
|
|
+ replaceFields,
|
|
|
|
|
+ checkedKeys,
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|
|
@@ -347,5 +381,32 @@ export default defineComponent({
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-</style
|
|
|
|
|
->;
|
|
|
|
|
|
|
+
|
|
|
|
|
+.ant-tree-checkbox {
|
|
|
|
|
+ margin-right: 2px;
|
|
|
|
|
+ .ant-tree-checkbox-inner {
|
|
|
|
|
+ background: @m-grey21;
|
|
|
|
|
+ border: 1px solid @m-grey14;
|
|
|
|
|
+ border-radius: 3px;
|
|
|
|
|
+ &::after {
|
|
|
|
|
+ border-color: @m-blue0;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ &::after {
|
|
|
|
|
+ border-color: @m-blue0;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.ant-tree-title {
|
|
|
|
|
+ color: @m-white0;
|
|
|
|
|
+}
|
|
|
|
|
+.anticon {
|
|
|
|
|
+ color: @m-white0;
|
|
|
|
|
+}
|
|
|
|
|
+.ant-tree li .ant-tree-node-content-wrapper.ant-tree-node-selected {
|
|
|
|
|
+ background: none;
|
|
|
|
|
+}
|
|
|
|
|
+.ant-tree li .ant-tree-node-content-wrapper:hover {
|
|
|
|
|
+ background: none;
|
|
|
|
|
+}
|
|
|
|
|
+</style>;
|