按钮级别的新版本,多级别的组织架构
loulijun2021
2023-08-09 1ec6e15f8a7d351ce8537567cf6e956e99d4167f
src/views/basicSettings/roleList.vue
@@ -131,7 +131,7 @@
                    <div v-for="(item,index) in treeCenter[0].children" :key="item.menucode">
                      <div
                        v-if="item.buttoncodelist ===null "
                        v-if="!item.buttoncodelist"
                        style="margin-left: 40px;height:26px;display: flex;"
                      />
@@ -179,7 +179,7 @@
                  <div v-if="treeCenter.length>0">
                    <div v-for="item in treeCenter[0].children" :key="item.menucode">
                      <div
                        v-if="item.datacodelist ===null "
                        v-if="!item.datacodelist"
                        style="margin-left: 40px;height:26px;display: flex;"
                      />
@@ -339,7 +339,7 @@
      this.treeCenter[0].children.forEach(item => {
        if (item.children && item.children.length) {
          item.children.forEach(it => {
            it.buttoncodelist = it.buttoncodelist !== null ? it.buttoncodelist.split(',') : []
            it.buttoncodelist = it.buttoncodelist !== '' && it.buttoncodelist !== null ? it.buttoncodelist.split(',') : []
            if (it.buttoncodelist && it.buttoncodelist.length > 0) {
              it.buttoncodelist = this.$ButtonData.filter(j =>
                it.buttoncodelist.includes(j.buttoncode)
@@ -463,7 +463,7 @@
    },
    // 单个按钮改变
    handleCheckedButtonChange(oldValue, index, code, newValue, flag) {
      console.log(oldValue, index, code, newValue, 2)
      // console.log(oldValue, index, code, newValue, 2)
      // 判断是否包含在内
      if (!flag) {
        if (!this.menuCheckedCodeArr.includes(code) && oldValue.length === 0 && newValue.length === 1) { // 否
@@ -528,7 +528,6 @@
    // 处理中间树形选中值改变
    handleTreeCenterCheckChange(obj, selfChecked, selfChildrenTreeCheck) {
      // console.log(obj, selfChecked, selfChildrenTreeCheck, '王老吉')
      console.log(selfChecked, 10)
      if (!selfChildrenTreeCheck) {
        if (!selfChecked) { // 从选中到不选中
          obj.buttonChecked = []
@@ -536,7 +535,6 @@
          this.menuCheckedCodeArr = this.menuCheckedCodeArr.filter(i => i !== obj.menucode)
        }
        if (selfChecked) { // 从不选中到选中
          console.log(obj, 9)
          obj.buttonCheckedCode = []
          this.treeCenter[0].children.forEach(item => {
            if (item.children && item.children.length) {
@@ -642,7 +640,7 @@
        }
      })
      console.log(arr, 'arr')
      // console.log(arr, 'arr')
      const rolecode = this.$refs.treeLeftRef.getCurrentKey()
      const res = await RolePermissionSava(JSON.stringify(arr), rolecode, this.activeName)
      if (res.code === '200') {