按钮级别的新版本,多级别的组织架构
loulijun2021
2023-08-24 68338b19f9dc2ad9725326b7e699a3e191030cb8
src/views/basicSettings/roleList.vue
@@ -29,7 +29,24 @@
            <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">重置</el-button>
          </div>
        </el-form>
        <div
          class="bodyTopFormExpand"
          style="height:5px"
        >
          <!--          <svg-icon-->
          <!--            v-show="mouseHoverType==='mouseout'"-->
          <!--            style="cursor: pointer"-->
          <!--            :icon-class="!isExpandForm?'doubleDown3':'doubleUp3'"-->
          <!--            @mouseenter="mouseHoverType=$event.type"-->
          <!--          />-->
          <!--          <svg-icon-->
          <!--            v-show="mouseHoverType==='mouseenter'"-->
          <!--            style="cursor: pointer"-->
          <!--            :icon-class="!isExpandForm?'doubleDown':'doubleUp'"-->
          <!--            @click="isExpandForm=!isExpandForm"-->
          <!--            @mouseout="mouseHoverType=$event.type"-->
          <!--          />-->
        </div>
      </div>
      <div class="elTableDiv">
@@ -81,9 +98,13 @@
            prop="description"
            label="备注"
            sortable="custom"
          />
          >
            <template slot-scope="{row}">
              {{ row.description?row.description:'/' }}
            </template>
          </el-table-column>
          <el-table-column
            prop="lm_user"
            prop="username"
            label="创建人员"
            sortable="custom"
          />
@@ -131,7 +152,7 @@
                  <el-dropdown-menu slot="dropdown">
                    <el-dropdown-item icon="el-icon-circle-check" command="menuPower">菜单权限</el-dropdown-item>
                    <el-dropdown-item icon="el-icon-user" command="divideUser">分配用户</el-dropdown-item>
                    <el-dropdown-item icon="el-icon-download" command="downloadMenu">导出菜单</el-dropdown-item>
                    <!--                    <el-dropdown-item icon="el-icon-download" command="downloadMenu">导出菜单</el-dropdown-item>-->
                  </el-dropdown-menu>
                </el-dropdown>
              </div>
@@ -178,9 +199,9 @@
          >
            <el-option
              v-for="item in datacodeArr"
              :key="item.code"
              :label="item.name"
              :value="item.code"
              :key="item.datacode"
              :label="item.dataname"
              :value="item.datacode"
            />
          </el-select>
        </el-form-item>
@@ -227,7 +248,13 @@
      <span slot="footer" class="dialog-footer">
        <div class="footerButton">
          <el-button v-waves @click="dialogVisibleCancel">取 消</el-button>
          <el-button v-waves type="primary" @click="dialogVisibleConfirm">确 定</el-button>
          <el-button
            v-waves
            type="primary"
            :loading="$store.state.app.buttonIsDisabled"
            :disabled="$store.state.app.buttonIsDisabled"
            @click="dialogVisibleConfirm"
          >确 定</el-button>
        </div>
      </span>
    </el-dialog>
@@ -245,7 +272,7 @@
import { validateCode } from '@/utils/global'
import elDragDialog from '@/directive/el-drag-dialog'
import waves from '@/directive/waves'
import { PrentOrganization } from '@/api/GeneralBasicData'
import { DataPermissions, PrentOrganization } from '@/api/GeneralBasicData'
import arrayToTree from 'array-to-tree'
export default {
@@ -277,12 +304,7 @@
        datapermissions: '', // 数据权限
        status: 'Y'// 状态
      },
      datacodeArr: [
        { code: 'ALL', name: '全部' },
        { code: 'CUSTOM', name: '自定义' },
        { code: 'LEVEL', name: '本级' },
        { code: 'PERSON', name: '本人' }
      ],
      datacodeArr: [],
      checkboxGroupSelected: ['展开/折叠', '父子联动'],
      checkboxGroup: ['展开/折叠', '全选/全不选', '父子联动'],
      operation: '',
@@ -310,12 +332,17 @@
    this.getHeight()
    this.getPrentOrganization()
    this.getDataPermissions()
  },
  methods: {
    async getRoleData() {
      const res = await RoleData(this.form)
      this.tableData = res.data
      this.total = res.count
    },
    async getDataPermissions() {
      const { data: res } = await DataPermissions()
      this.datacodeArr = res
    },
    // 组织架构级联选择器
    async getPrentOrganization() {
@@ -412,6 +439,7 @@
    dialogVisibleConfirm() {
      this.$refs.dialogForm.validate(valid => {
        if (valid) {
          this.$store.state.app.buttonIsDisabled = true
          if (this.$refs.tree) {
            this.dialogForm.datapermissions = this.$refs.tree.getCheckedKeys().join(',')
          }
@@ -419,8 +447,10 @@
            if (res.code === '200') {
              this.$notify.success(this.operation === 'add' ? '添加成功!' : '修改成功!')
              this.dialogVisible = false
              this.$store.state.app.buttonIsDisabled = false
              this.getRoleData()
            } else {
              this.$store.state.app.buttonIsDisabled = false
              this.$notify.error(this.operation === 'add' ? '添加失败!' : '修改失败!')
            }
          })
@@ -430,7 +460,10 @@
    handleCommand(command, row) {
      console.log(command, row)
      if (command === 'menuPower') {
        this.$router.push('./roleList?powerId=' + row.id)// demo
        this.$router.push('./powerDivider?rolecode=' + row.rolecode)
      }
      if (command === 'divideUser') {
        this.$router.push('./roleDivider?rolecode=' + row.rolecode)
      }
    },
    // 获取页面高度