|  | @@ -106,7 +106,7 @@
 | 
	
		
			
				|  |  |            label="会员名称"
 | 
	
		
			
				|  |  |            prop="name"
 | 
	
		
			
				|  |  |            :label-width="formLabelWidth"
 | 
	
		
			
				|  |  | -          :rules="[{ required: true, message: '请输入会员名称' },]"
 | 
	
		
			
				|  |  | +          :rules="[{ required: true, message: '请输入会员名称' }]"
 | 
	
		
			
				|  |  |          >
 | 
	
		
			
				|  |  |            <el-input
 | 
	
		
			
				|  |  |              :disabled="addDisabled"
 | 
	
	
		
			
				|  | @@ -119,14 +119,13 @@
 | 
	
		
			
				|  |  |          </el-form-item>
 | 
	
		
			
				|  |  |          <el-form-item
 | 
	
		
			
				|  |  |            label="会员介绍"
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |            prop="intro"
 | 
	
		
			
				|  |  |            :label-width="formLabelWidth"
 | 
	
		
			
				|  |  |            :rules="[{ required: true, message: '请输入会员介绍' }]"
 | 
	
		
			
				|  |  |          >
 | 
	
		
			
				|  |  |            <el-input
 | 
	
		
			
				|  |  | -          maxlength="50"
 | 
	
		
			
				|  |  | -           show-word-limit
 | 
	
		
			
				|  |  | +            maxlength="50"
 | 
	
		
			
				|  |  | +            show-word-limit
 | 
	
		
			
				|  |  |              :disabled="addDisabled"
 | 
	
		
			
				|  |  |              v-model.trim="form.intro"
 | 
	
		
			
				|  |  |              autocomplete="off"
 | 
	
	
		
			
				|  | @@ -149,7 +148,9 @@
 | 
	
		
			
				|  |  |              :imageHeightM="200"
 | 
	
		
			
				|  |  |            ></upload>
 | 
	
		
			
				|  |  |            <img v-else :src="form.icon" alt="" width="120px" height="120px" />
 | 
	
		
			
				|  |  | -          <p style="color:red" v-if="!addDisabled">请上传200*200像素,大小2M以内,格式为jpg、png、gif图片</p>
 | 
	
		
			
				|  |  | +          <p style="color: red" v-if="!addDisabled">
 | 
	
		
			
				|  |  | +            请上传200*200像素,大小2M以内,格式为jpg、png、gif图片
 | 
	
		
			
				|  |  | +          </p>
 | 
	
		
			
				|  |  |          </el-form-item>
 | 
	
		
			
				|  |  |          <!-- <br />
 | 
	
		
			
				|  |  |          <el-form-item
 | 
	
	
		
			
				|  | @@ -337,6 +338,8 @@ export default {
 | 
	
		
			
				|  |  |        this.title = "新增会员等级";
 | 
	
		
			
				|  |  |        this.addDisabled = false;
 | 
	
		
			
				|  |  |        this.pageType = "create";
 | 
	
		
			
				|  |  | +      this.getNewTree()
 | 
	
		
			
				|  |  | +      this.slideCount = 0;
 | 
	
		
			
				|  |  |        this.treeData = this.setTableData(this.silderList, this.addDisabled);
 | 
	
		
			
				|  |  |        this.branchStatus = true;
 | 
	
		
			
				|  |  |      },
 | 
	
	
		
			
				|  | @@ -402,6 +405,7 @@ export default {
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      setTableData(result, disabled) {
 | 
	
		
			
				|  |  |        let list = [];
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |        list = result.map((res) => {
 | 
	
		
			
				|  |  |          let tempList = {};
 | 
	
		
			
				|  |  |          tempList = {
 | 
	
	
		
			
				|  | @@ -422,40 +426,20 @@ export default {
 | 
	
		
			
				|  |  |        return list;
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      async resetMember(row, type) {
 | 
	
		
			
				|  |  | -      try {
 | 
	
		
			
				|  |  | -        const resTree = await getMemberPrivilegesItem();
 | 
	
		
			
				|  |  | -        this.silderList = resTree.data;
 | 
	
		
			
				|  |  | -        this.treeData = this.setTableData(resTree.data);
 | 
	
		
			
				|  |  | -        const res = await getmemberRankDetail({ memberRankSettingId: row.id });
 | 
	
		
			
				|  |  | -        this.form = { ...res.data };
 | 
	
		
			
				|  |  | -        this.checkAll =
 | 
	
		
			
				|  |  | -          res.data.memberPrivilegesItemIdList.length >= this.slideCount;
 | 
	
		
			
				|  |  | -        // 反写树的值
 | 
	
		
			
				|  |  | -        this.isIndeterminate =
 | 
	
		
			
				|  |  | -          res.data.memberPrivilegesItemIdList.length > 0 &&
 | 
	
		
			
				|  |  | -          res.data.memberPrivilegesItemIdList.length < this.slideCount;
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -        this.checkList = res.data.memberPrivilegesItemIdList;
 | 
	
		
			
				|  |  | -        let tSplice = this.getParent(
 | 
	
		
			
				|  |  | -          res.data.memberPrivilegesItemIdList,
 | 
	
		
			
				|  |  | -          this.treeData
 | 
	
		
			
				|  |  | -        );
 | 
	
		
			
				|  |  | -        this.checkList = tSplice;
 | 
	
		
			
				|  |  | -      } catch (e) {
 | 
	
		
			
				|  |  | -        console.log(e);
 | 
	
		
			
				|  |  | -      }
 | 
	
		
			
				|  |  | +      this.resetTree(row);
 | 
	
		
			
				|  |  |        if (type) {
 | 
	
		
			
				|  |  |          this.title = "修改会员等级";
 | 
	
		
			
				|  |  |          this.pageType = "update";
 | 
	
		
			
				|  |  |          this.addDisabled = false;
 | 
	
		
			
				|  |  | +        this.slideCount = 0;
 | 
	
		
			
				|  |  |          this.treeData = this.setTableData(this.silderList, this.addDisabled);
 | 
	
		
			
				|  |  |        } else {
 | 
	
		
			
				|  |  |          this.addDisabled = true;
 | 
	
		
			
				|  |  |          this.title = "查看会员等级";
 | 
	
		
			
				|  |  |          this.pageType = "";
 | 
	
		
			
				|  |  | +        this.slideCount = 0;
 | 
	
		
			
				|  |  |          this.treeData = this.setTableData(this.silderList, this.addDisabled);
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |        this.branchStatus = true;
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      //递归获取到所有的为子级的ID
 | 
	
	
		
			
				|  | @@ -483,6 +467,37 @@ export default {
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |        });
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | +    async resetTree(row) {
 | 
	
		
			
				|  |  | +      try {
 | 
	
		
			
				|  |  | +        this.getNewTree();
 | 
	
		
			
				|  |  | +        const res = await getmemberRankDetail({ memberRankSettingId: row.id });
 | 
	
		
			
				|  |  | +        this.form = { ...res.data };
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        this.checkAll =
 | 
	
		
			
				|  |  | +          res.data.memberPrivilegesItemIdList.length >= this.slideCount;
 | 
	
		
			
				|  |  | +        // 反写树的值
 | 
	
		
			
				|  |  | +        this.isIndeterminate =
 | 
	
		
			
				|  |  | +          res.data.memberPrivilegesItemIdList.length > 0 &&
 | 
	
		
			
				|  |  | +          res.data.memberPrivilegesItemIdList.length < this.slideCount;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        this.checkList = res.data.memberPrivilegesItemIdList;
 | 
	
		
			
				|  |  | +        let tSplice = this.getParent(
 | 
	
		
			
				|  |  | +          res.data.memberPrivilegesItemIdList,
 | 
	
		
			
				|  |  | +          this.treeData
 | 
	
		
			
				|  |  | +        );
 | 
	
		
			
				|  |  | +        this.checkList = tSplice;
 | 
	
		
			
				|  |  | +      } catch (e) {
 | 
	
		
			
				|  |  | +        console.log(e);
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    async getNewTree() {
 | 
	
		
			
				|  |  | +      try {
 | 
	
		
			
				|  |  | +        const resTree = await getMemberPrivilegesItem();
 | 
	
		
			
				|  |  | +        this.silderList = resTree.data;
 | 
	
		
			
				|  |  | +        this.slideCount = 0;
 | 
	
		
			
				|  |  | +        this.treeData = this.setTableData(resTree.data);
 | 
	
		
			
				|  |  | +      } catch {}
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |  };
 | 
	
		
			
				|  |  |  </script>
 |