按钮级别的新版本,多级别的组织架构
loulijun2021
2023-08-23 42636c58501d68650ef5323676eee3bdea292347
src/views/basicSettings/roleList.vue
@@ -83,7 +83,7 @@
            sortable="custom"
          />
          <el-table-column
            prop="lm_user"
            prop="username"
            label="创建人员"
            sortable="custom"
          />
@@ -178,9 +178,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 +227,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 +251,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 +283,7 @@
        datapermissions: '', // 数据权限
        status: 'Y'// 状态
      },
      datacodeArr: [
        { code: 'ALL', name: '全部' },
        { code: 'CUSTOM', name: '自定义' },
        { code: 'LEVEL', name: '本级' },
        { code: 'PERSON', name: '本人' }
      ],
      datacodeArr: [],
      checkboxGroupSelected: ['展开/折叠', '父子联动'],
      checkboxGroup: ['展开/折叠', '全选/全不选', '父子联动'],
      operation: '',
@@ -310,12 +311,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 +418,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 +426,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' ? '添加失败!' : '修改失败!')
            }
          })