浏览代码

fix: 提交

bug/0816
yinsiyu 1 个月前
父节点
当前提交
efd59f8f3f
共有 1 个文件被更改,包括 11 次插入6 次删除
  1. +11
    -6
      src/views/userManage/roleManage/roleList/components/CrudPopup/index.vue

+ 11
- 6
src/views/userManage/roleManage/roleList/components/CrudPopup/index.vue 查看文件

@@ -29,9 +29,10 @@
show-checkbox
node-key="id"
@check="(_, val) => handleSelectMenuChange(val, 'doctorWorkChecks')"
:props="{ children: 'children', label: 'menuName', isLeaf: true }"
:props="{ children: 'children', label: 'menuName', }"
default-expand-all
></el-tree>
<!-- isLeaf: true -->
</div>
</div>
<div class="tree-menu-item">
@@ -115,9 +116,6 @@ export default {
loading: false,
};
},
created() {
this.loadAllMenuList();
},
methods: {
loadAllMenuList() {
return geMenuTreeList().then((res) => {
@@ -127,6 +125,7 @@ export default {
});
},
async loadMenuIdList(roleId) {
await this.loadAllMenuList();
this.loading = true;
const [err, res] = await to(getRoleMenuList({ roleId }));
if (!err) {
@@ -134,6 +133,9 @@ export default {
this.form.saleManageChecks = res?.data?.saleManage || [];
this.form.saleProcessChecks = res?.data?.saleProcess || [];
}
this.form.doctorWorkChecks = this.form.doctorWorkChecks.filter(item => this.treeData.findIndex(item2 => item2.id === item) < 0)
this.form.saleManageChecks = this.form.doctorWorkChecks.filter(item => this.treeData2.findIndex(item2 => item2.id === item) <0)
this.form.saleProcessChecks = this.form.doctorWorkChecks.filter(item => this.treeData3.findIndex(item2 => item2.id === item) <0)
this.$nextTick(() => {
console.log("this.$refs.tree=", this.$refs.tree);
this.$refs.tree.setCheckedKeys(this.form.doctorWorkChecks);
@@ -145,7 +147,6 @@ export default {
handleSelectMenuChange({ checkedKeys, halfCheckedKeys }, property) {
console.log("property=", property);
this.form[property] = checkedKeys;
// this.form.menuIdList = checkedKeys;
this.$nextTick(() => {
this.$refs.form?.validateField("menuIdList");
});
@@ -187,8 +188,12 @@ export default {
try {
const { menuIdList, doctorWorkChecks, saleManageChecks, saleProcessChecks, ...params } =
this.form;
await this.$nextTick();
const halfChecks1 = this.$refs.tree.getHalfCheckedKeys();
const halfChecks2 = this.$refs.tree2.getHalfCheckedKeys();
const halfChecks3 = this.$refs.tree3.getHalfCheckedKeys();
const res = await saveRole({
menuIdList: [...doctorWorkChecks, ...saleManageChecks, ...saleProcessChecks],
menuIdList: [...doctorWorkChecks, ...saleManageChecks, ...saleProcessChecks, ...halfChecks1, ...halfChecks2, ...halfChecks3],
...params,
});
if (this.form.roleId) {


正在加载...
取消
保存