|
|
@@ -6,7 +6,7 @@
|
|
|
@cancel="cancel"
|
|
|
centered
|
|
|
:maskClosable="false"
|
|
|
- width="1230px">
|
|
|
+ width="100%">
|
|
|
<template #footer>
|
|
|
<a-button key="cancel"
|
|
|
type="primary"
|
|
|
@@ -81,118 +81,117 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
- import {closeModal} from '@/common/setup/modal/index';
|
|
|
- import {defineComponent, PropType, ref, watchEffect} from 'vue';
|
|
|
- import {handleBusinessForm} from '../setup';
|
|
|
- import {ErmcpRole, ErmcpRoleMenuEx} from '@/services/go/ermcp/account/interface';
|
|
|
- import {queryResultLoadingAndInfo, requestResultLoadingAndInfo} from '@/common/methods/request/resultInfo';
|
|
|
- import {QueryAccMgrRoleMenu} from '@/services/go/ermcp/account';
|
|
|
- import {message} from 'ant-design-vue';
|
|
|
- import {roleOperate} from '@/services/proto/accountinfo'
|
|
|
- import {ManagerRoleOperateReq, MemberFuncMenu} from "@/services/proto/accountinfo/interface";
|
|
|
- import {getUserId} from "@/services/bus/account";
|
|
|
- import {getAreaUserId} from "@/services/bus/user";
|
|
|
- import {getLongTypeLoginID} from "@/services/bus/login";
|
|
|
+import { closeModal } from '@/common/setup/modal/index';
|
|
|
+import { defineComponent, PropType, ref, watchEffect } from 'vue';
|
|
|
+import { handleBusinessForm } from '../setup';
|
|
|
+import { ErmcpRole, ErmcpRoleMenuEx } from '@/services/go/ermcp/account/interface';
|
|
|
+import { queryResultLoadingAndInfo, requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
|
|
|
+import { QueryAccMgrRoleMenu } from '@/services/go/ermcp/account';
|
|
|
+import { message } from 'ant-design-vue';
|
|
|
+import { roleOperate } from '@/services/proto/accountinfo';
|
|
|
+import { ManagerRoleOperateReq, MemberFuncMenu } from '@/services/proto/accountinfo/interface';
|
|
|
+import { getUserId } from '@/services/bus/account';
|
|
|
+import { getAreaUserId } from '@/services/bus/user';
|
|
|
+import { getLongTypeLoginID } from '@/services/bus/login';
|
|
|
|
|
|
- export default defineComponent({
|
|
|
- name: 'account_info_manager_btn_setting_delete',
|
|
|
- props: {
|
|
|
+export default defineComponent({
|
|
|
+ name: 'account_info_manager_btn_setting_delete',
|
|
|
+ props: {
|
|
|
selectedData: {
|
|
|
default: {},
|
|
|
type: Object as PropType<ErmcpRole>,
|
|
|
},
|
|
|
},
|
|
|
- setup(props, context) {
|
|
|
- // 控制关闭弹窗
|
|
|
- const {visible, cancel} = closeModal('account_info_manager_btn_setting_delete');
|
|
|
- const {rules, formState, formRef} = handleBusinessForm();
|
|
|
- const loading = ref<boolean>(false);
|
|
|
- const tableList = ref<ErmcpRoleMenuEx[]>([]);
|
|
|
- const name = ref<string>('')
|
|
|
- watchEffect(() => {
|
|
|
- if (visible.value) {
|
|
|
- const { rolename, areauserid, autoid} = props.selectedData;
|
|
|
- name.value = rolename
|
|
|
- const param = {userid: areauserid, roleid: autoid.toString()}
|
|
|
- queryResultLoadingAndInfo(QueryAccMgrRoleMenu, loading, param).then((res) => {
|
|
|
- tableList.value = res;
|
|
|
+ setup(props, context) {
|
|
|
+ // 控制关闭弹窗
|
|
|
+ const { visible, cancel } = closeModal('account_info_manager_btn_setting_delete');
|
|
|
+ const { rules, formState, formRef } = handleBusinessForm();
|
|
|
+ const loading = ref<boolean>(false);
|
|
|
+ const tableList = ref<ErmcpRoleMenuEx[]>([]);
|
|
|
+ const name = ref<string>('');
|
|
|
+ watchEffect(() => {
|
|
|
+ if (visible.value) {
|
|
|
+ const { rolename, areauserid, autoid } = props.selectedData;
|
|
|
+ name.value = rolename;
|
|
|
+ const param = { userid: areauserid, roleid: autoid.toString() };
|
|
|
+ queryResultLoadingAndInfo(QueryAccMgrRoleMenu, loading, param).then((res) => {
|
|
|
+ tableList.value = res;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
- 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) {
|
|
|
- message.error('请输入模板名称')
|
|
|
- return
|
|
|
- }
|
|
|
- if (result.length === 0) {
|
|
|
- message.error('请至少选择一个权限')
|
|
|
- return
|
|
|
- }
|
|
|
- const reqParam: ManagerRoleOperateReq = {
|
|
|
- autoid: props.selectedData.autoid, // uint64 角色ID
|
|
|
- operatetype: 3, // uint32 操作类型-1:新增 2:修改
|
|
|
- areauserid: getAreaUserId(), // uint64 所属机构
|
|
|
- modifierid: Number(getLongTypeLoginID()), // uint64 修改人ID
|
|
|
- rolename: name.value, // string 角色名称
|
|
|
- memberfuncmenus: result.map(item => {
|
|
|
- return {
|
|
|
- resourcecode: item
|
|
|
- } as MemberFuncMenu
|
|
|
- }) // MemberFuncMenu 机构菜单
|
|
|
-
|
|
|
- }
|
|
|
- requestResultLoadingAndInfo(roleOperate, reqParam, loading, ['删除成功', '删除失败:']).then(() => {
|
|
|
- cancel();
|
|
|
- context.emit('refresh');
|
|
|
- });
|
|
|
+ if (!name) {
|
|
|
+ message.error('请输入模板名称');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (result.length === 0) {
|
|
|
+ message.error('请至少选择一个权限');
|
|
|
+ return;
|
|
|
}
|
|
|
+ const reqParam: ManagerRoleOperateReq = {
|
|
|
+ autoid: props.selectedData.autoid, // uint64 角色ID
|
|
|
+ operatetype: 3, // uint32 操作类型-1:新增 2:修改
|
|
|
+ areauserid: getAreaUserId(), // uint64 所属机构
|
|
|
+ modifierid: Number(getLongTypeLoginID()), // uint64 修改人ID
|
|
|
+ rolename: name.value, // string 角色名称
|
|
|
+ memberfuncmenus: result.map((item) => {
|
|
|
+ return {
|
|
|
+ resourcecode: item,
|
|
|
+ } as MemberFuncMenu;
|
|
|
+ }), // MemberFuncMenu 机构菜单
|
|
|
+ };
|
|
|
+ requestResultLoadingAndInfo(roleOperate, reqParam, loading, ['删除成功', '删除失败:']).then(() => {
|
|
|
+ cancel();
|
|
|
+ context.emit('refresh');
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
- function secondChange(item: ErmcpRoleMenuEx, sub: ErmcpRoleMenuEx) {
|
|
|
- if (sub.Menu.ishadrole) {
|
|
|
- item.Menu.ishadrole = true
|
|
|
- }
|
|
|
+ function secondChange(item: ErmcpRoleMenuEx, sub: ErmcpRoleMenuEx) {
|
|
|
+ if (sub.Menu.ishadrole) {
|
|
|
+ item.Menu.ishadrole = true;
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- function thirdChange(item: ErmcpRoleMenuEx, sub: ErmcpRoleMenuEx, subNext: ErmcpRoleMenuEx) {
|
|
|
- if (subNext.Menu.ishadrole) {
|
|
|
- sub.Menu.ishadrole = true
|
|
|
- item.Menu.ishadrole = true
|
|
|
- }
|
|
|
+ function thirdChange(item: ErmcpRoleMenuEx, sub: ErmcpRoleMenuEx, subNext: ErmcpRoleMenuEx) {
|
|
|
+ if (subNext.Menu.ishadrole) {
|
|
|
+ sub.Menu.ishadrole = true;
|
|
|
+ item.Menu.ishadrole = true;
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- return {
|
|
|
- formState,
|
|
|
- rules,
|
|
|
- formRef,
|
|
|
- visible,
|
|
|
- name,
|
|
|
- cancel,
|
|
|
- submit,
|
|
|
- secondChange,
|
|
|
- thirdChange,
|
|
|
- loading,
|
|
|
- tableList,
|
|
|
- };
|
|
|
- },
|
|
|
- });
|
|
|
+ return {
|
|
|
+ formState,
|
|
|
+ rules,
|
|
|
+ formRef,
|
|
|
+ visible,
|
|
|
+ name,
|
|
|
+ cancel,
|
|
|
+ submit,
|
|
|
+ secondChange,
|
|
|
+ thirdChange,
|
|
|
+ loading,
|
|
|
+ tableList,
|
|
|
+ };
|
|
|
+ },
|
|
|
+});
|
|
|
</script>
|
|
|
|
|
|
<style lang="less">
|
|
|
@@ -236,7 +235,7 @@
|
|
|
}
|
|
|
|
|
|
.powerLeft {
|
|
|
- width: 120px;
|
|
|
+ width: 250px;
|
|
|
padding: 0 8px;
|
|
|
}
|
|
|
|
|
|
@@ -256,15 +255,15 @@
|
|
|
}
|
|
|
|
|
|
.left {
|
|
|
- width: 140px;
|
|
|
- min-width: 140px;
|
|
|
+ width: 200px;
|
|
|
+ min-width: 200px;
|
|
|
border-left: 3px solid @m-grey11;
|
|
|
border-right: 3px solid @m-grey11;
|
|
|
}
|
|
|
|
|
|
.right {
|
|
|
flex: 1;
|
|
|
- width: calc(100% - 120px);
|
|
|
+ // width: calc(100% - 120px);
|
|
|
}
|
|
|
}
|
|
|
|