管道基础大数据平台系统开发-【前端】-新系統界面
13693261870
2024-02-04 d91f0dfcd2ef95fb3624d94ade24fe69a9169a58
src/views/userManage/roleManage.vue
@@ -1,40 +1,19 @@
<template>
  <div class="logLog_box">
    <My-bread
      :list="[
        `${$t('operatManage.operatManage')}`,
        `${$t('userManage.roleManage')}`,
      ]"
    ></My-bread>
    <My-bread :list="[
      `${$t('operatManage.operatManage')}`,
      `${$t('userManage.roleManage')}`,
    ]"></My-bread>
    <el-divider />
    <div class="inquire subpage_Div" ref="container">
      <el-form ref="ruleForm" :model="roleForm" :inline="true">
        <div class="flex_box">
          <div style="margin-right: auto">
            <el-form-item
              :label="$t('userManage.RM.ownedSystem')"
              prop="ownedSystem"
            >
              <el-select
                :popper-append-to-body="false"
                size="small"
                v-model="roleForm.depValue"
                :placeholder="$t('userManage.RM.ownedSystemHolder')"
                style="width: 200px"
                ref="treeSelect"
              >
                <el-option
                  :value="roleForm.depid"
                  :label="roleForm.depValue"
                  style="height: auto"
                >
                  <el-tree
                    ref="tree"
                    :data="depList"
                    node-key="id"
                    :props="props"
                    @node-click="handleRouleDepList"
                  />
            <el-form-item :label="$t('userManage.RM.ownedSystem')" prop="ownedSystem">
              <el-select :popper-append-to-body="false" size="small" v-model="roleForm.depValue"
                :placeholder="$t('userManage.RM.ownedSystemHolder')" style="width: 200px" ref="treeSelect">
                <el-option :value="roleForm.depid" :label="roleForm.depValue" style="height: auto">
                  <el-tree ref="tree" :data="depList" node-key="id" :props="props" @node-click="handleRouleDepList" />
                </el-option>
              </el-select>
              <!-- <el-input
@@ -44,12 +23,8 @@
          /> -->
            </el-form-item>
            <el-form-item :label="$t('userManage.RM.roleName')" prop="username">
              <el-input
                v-model="roleForm.username"
                :placeholder="$t('userManage.RM.roleNameHolder')"
                size="small"
                style="width: 200px"
              >
              <el-input v-model="roleForm.username" :placeholder="$t('userManage.RM.roleNameHolder')" size="small"
                style="width: 200px">
                <i slot="suffix" class="el-icon-search" @click="onSubmit"></i>
              </el-input>
            </el-form-item>
@@ -65,33 +40,21 @@
            <!--                }}</el-button>-->
            <!--            </el-form-item>-->
            <el-form-item>
              <el-button
                type="success"
                size="small"
                @click="setInsertFormdialog"
                v-if="menuStatus.insert"
                ><i class="el-icon-circle-plus-outline"></i> &nbsp;{{
                  $t("userManage.RM.add")
                }}</el-button
              >
              <el-button type="success" size="small" @click="setInsertFormdialog" v-if="menuStatus.insert"><i
                  class="el-icon-circle-plus-outline"></i> &nbsp;{{
                    $t("userManage.RM.add")
                  }}</el-button>
            </el-form-item>
            <el-form-item>
              <el-button
                type="danger"
                size="small"
                @click="handleDelete()"
                v-if="menuStatus.delete"
                ><i class="el-icon-delete"></i>&nbsp;{{
                  $t("common.delete")
                }}</el-button
              >
              <el-button type="danger" size="small" @click="handleDelete()" v-if="menuStatus.delete"><i
                  class="el-icon-delete"></i>&nbsp;{{
                    $t("common.delete")
                  }}</el-button>
            </el-form-item>
            <el-form-item>
              <el-button type="info" size="small" @click="resetForm('ruleForm')"
                ><i class="el-icon-delete"></i>&nbsp;{{
                  $t("userManage.RM.reset")
                }}</el-button
              >
              <el-button type="info" size="small" @click="resetForm('ruleForm')"><i class="el-icon-delete"></i>&nbsp;{{
                $t("userManage.RM.reset")
              }}</el-button>
            </el-form-item>
          </div>
        </div>
@@ -145,48 +108,22 @@
    </div>
    <div class="dividing-line"></div>
    <div class="table_box subpage_Div" :style="styleVar">
      <el-table
        :data="tableData"
        style="width: 100%"
        border
        height="calc(100% - 45px)"
        @selection-change="handleSelectionChange"
      >
      <el-table :data="tableData" style="width: 100%" border height="calc(100% - 45px)"
        @selection-change="handleSelectionChange">
        <el-table-column type="selection" width="55" />
        <el-table-column
          align="center"
          type="index"
          :label="$t('userManage.RM.index')"
          width="70px"
        />
        <el-table-column align="center" type="index" :label="$t('userManage.RM.index')" width="70px" />
        <el-table-column align="center" prop="id" v-if="false" />
        <el-table-column
          align="center"
          prop="name"
          :label="$t('userManage.RM.roleName')"
        />
        <el-table-column align="center" prop="name" :label="$t('userManage.RM.roleName')" />
        <el-table-column
          align="center"
          prop="depName"
          :label="$t('userManage.RM.ownedSystem')"
        />
        <el-table-column align="center" prop="depName" :label="$t('userManage.RM.ownedSystem')" />
        <el-table-column
          align="center"
          prop="isAdmin"
          :label="$t('userManage.RM.isAdmin')"
        >
          <template slot-scope="scope">
        <el-table-column align="center" prop="isAdmin" :label="$t('userManage.RM.isAdmin')" :formatter="formateIsAdmin">
          <!-- <template slot-scope="scope">
            <span v-if="scope.row.isAdmin == 1">是 </span>
            <span v-else>否</span>
          </template>
          </template> -->
        </el-table-column>
        <el-table-column
          align="center"
          prop="descr"
          :label="$t('userManage.RM.describe')"
        />
        <el-table-column align="center" prop="descr" :label="$t('userManage.RM.describe')" />
        <!-- <el-table-column
          align="center"
@@ -215,93 +152,39 @@
          prop="bak"
          :label="$t('userManage.RM.remarks')"
        /> -->
        <el-table-column
          fixed="right"
          :label="$t('common.operate')"
          width="200"
        >
        <el-table-column fixed="right" :label="$t('common.operate')" width="200">
          <template slot-scope="scope">
            <el-button
              type="primary"
              @click="showDetail(scope.$index, scope.row)"
              size="small"
              plain
              >{{ $t("common.see") }}</el-button
            >
            <el-button
              v-if="menuStatus.update"
              type="warning"
              @click="handleEdit(scope.$index, scope.row)"
              size="small"
              plain
              >{{ $t("common.update") }}</el-button
            >
            <el-button type="primary" @click="showDetail(scope.$index, scope.row)" size="small" plain>{{ $t("common.see")
            }}</el-button>
            <el-button v-if="menuStatus.update" type="warning" @click="handleEdit(scope.$index, scope.row)" size="small"
              plain>{{ $t("common.update") }}</el-button>
          </template>
        </el-table-column>
      </el-table>
      <div style="margin-top: 10px" class="pagination_box">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="listData.pageIndex"
          :page-sizes="[10, 20, 50, 100]"
          :page-size="listData.pageSize"
          layout="total, sizes, prev, pager, next, jumper"
          :total="count"
        >
        <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
          :current-page="listData.pageIndex" :page-sizes="[10, 20, 50, 100]" :page-size="listData.pageSize"
          layout="total, sizes, prev, pager, next, jumper" :total="count">
        </el-pagination>
      </div>
    </div>
    <el-dialog
      :title="$t('userManage.RM.insertRole')"
      :before-close="handleClose"
      style="overflow: hidden"
      :visible.sync="InsertFormdialog"
    >
    <el-dialog :title="$t('userManage.RM.insertRole')" :before-close="handleClose" style="overflow: hidden"
      :visible.sync="InsertFormdialog">
      <div style="height: 500px; overflow: auto">
        <el-form :model="insertform" label-position="top">
          <el-form-item
            :label="$t('userManage.RM.roleName')"
            :label-width="formLabelWidth"
          >
            <el-input
              style="width: 85%"
              v-model="insertform.name"
              autocomplete="off"
              :placeholder="
                $t('shuJuGuanLi.shuJuJianSuo.valuetwo') +
                $t('userManage.RM.roleName')
              "
            ></el-input>
          <el-form-item :label="$t('userManage.RM.roleName')" :label-width="formLabelWidth">
            <el-input style="width: 85%" v-model="insertform.name" autocomplete="off" :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo') +
              $t('userManage.RM.roleName')
              "></el-input>
          </el-form-item>
          <el-form-item
            :label="$t('userManage.RM.ownedSystem')"
            :label-width="formLabelWidth"
            :prop="insertform.depValue"
            :rules="[{ required: true, message: '不能为空' }]"
          >
            <el-select
              :popper-append-to-body="false"
              v-model="insertform.depValue"
              :placeholder="
                $t('shuJuGuanLi.shuJuJianSuo.valuetree') +
                $t('userManage.RM.ownedSystem')
              "
              style="width: 85%"
            >
              <el-option
                :value="insertform.depid"
                :label="insertform.depValue"
                style="height: auto"
              >
                <el-tree
                  ref="tree"
                  :data="depList"
                  node-key="id"
                  :props="props"
                  @node-click="handleDepList"
                />
          <el-form-item :label="$t('userManage.RM.ownedSystem')" :label-width="formLabelWidth" :prop="insertform.depValue"
            :rules="[{ required: true, message: '不能为空' }]">
            <el-select :popper-append-to-body="false" v-model="insertform.depValue" :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetree') +
              $t('userManage.RM.ownedSystem')
              " style="width: 85%">
              <el-option :value="insertform.depid" :label="insertform.depValue" style="height: auto">
                <el-tree ref="tree" :data="depList" node-key="id" :props="props" @node-click="handleDepList" />
              </el-option>
            </el-select>
            <!-- <el-input
@@ -316,24 +199,12 @@
            @click="showDepTree(2)"
          >{{ $t('common.choose') }}</el-button> -->
          </el-form-item>
          <el-form-item
            :label="$t('userManage.RM.describe')"
            :label-width="formLabelWidth"
          >
            <el-input
              style="width: 85%"
              v-model="insertform.descr"
              autocomplete="off"
              :placeholder="
                $t('shuJuGuanLi.shuJuJianSuo.valuetwo') +
                $t('userManage.RM.describe')
              "
            ></el-input>
          <el-form-item :label="$t('userManage.RM.describe')" :label-width="formLabelWidth">
            <el-input style="width: 85%" v-model="insertform.descr" autocomplete="off" :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo') +
              $t('userManage.RM.describe')
              "></el-input>
          </el-form-item>
          <el-form-item
            :label="$t('userManage.RM.isAdmin')"
            :label-width="formLabelWidth"
          >
          <el-form-item :label="$t('userManage.RM.isAdmin')" :label-width="formLabelWidth">
            <!-- <el-radio
           
              label="1"
@@ -342,35 +213,16 @@
              v-model="insertform.isAdmin"
              label="0"
            >否</el-radio> -->
            <el-select
              style="width: 85%"
              v-model="insertform.isAdmin"
              :placeholder="
                $t('shuJuGuanLi.shuJuJianSuo.valuetree') +
                $t('userManage.RM.isAdmin')
              "
            >
              <el-option
                v-for="item in options"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            <el-select style="width: 85%" v-model="insertform.isAdmin" :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetree') +
              $t('userManage.RM.isAdmin')
              ">
              <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item
            :label="$t('userManage.RM.remarks')"
            :label-width="formLabelWidth"
          >
            <el-input
              style="width: 85%"
              v-model="insertform.bak"
              autocomplete="off"
              :placeholder="
                $t('shuJuGuanLi.shuJuJianSuo.valuetwo') +
                $t('userManage.RM.remarks')
              "
            ></el-input>
          <el-form-item :label="$t('userManage.RM.remarks')" :label-width="formLabelWidth">
            <el-input style="width: 85%" v-model="insertform.bak" autocomplete="off" :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo') +
              $t('userManage.RM.remarks')
              "></el-input>
          </el-form-item>
        </el-form>
      </div>
@@ -383,47 +235,18 @@
        }}</el-button>
      </div>
    </el-dialog>
    <el-dialog
      :title="$t('userManage.RM.updateRole')"
      :visible.sync="UpdateFormdialog"
      :before-close="handleCloseEdit"
    >
    <el-dialog :title="$t('userManage.RM.updateRole')" :visible.sync="UpdateFormdialog" :before-close="handleCloseEdit">
      <div style="height: 500px; overflow: auto">
        <el-form :model="updateform" label-position="top">
          <el-form-item
            :label="$t('userManage.RM.roleName')"
            :label-width="formLabelWidth"
          >
            <el-input
              v-model="updateform.name"
              autocomplete="off"
              style="width: 85%"
            ></el-input>
          <el-form-item :label="$t('userManage.RM.roleName')" :label-width="formLabelWidth">
            <el-input v-model="updateform.name" autocomplete="off" style="width: 85%"></el-input>
          </el-form-item>
          <el-form-item
            :label="$t('userManage.RM.ownedSystem')"
            :label-width="formLabelWidth"
            :prop="updateform.depValue"
          >
            <el-select
              :popper-append-to-body="false"
              v-model="updateform.depValue"
              placeholder="请选择"
              style="width: 85%"
            >
              <el-option
                :value="updateform.depid"
                :label="updateform.depValue"
                style="height: auto"
              >
                <el-tree
                  ref="tree"
                  :data="depList"
                  node-key="id"
                  :props="props"
                  @node-click="handleUpdataDepList"
                />
          <el-form-item :label="$t('userManage.RM.ownedSystem')" :label-width="formLabelWidth"
            :prop="updateform.depValue">
            <el-select :popper-append-to-body="false" v-model="updateform.depValue" placeholder="请选择" style="width: 85%">
              <el-option :value="updateform.depid" :label="updateform.depValue" style="height: auto">
                <el-tree ref="tree" :data="depList" node-key="id" :props="props" @node-click="handleUpdataDepList" />
              </el-option>
            </el-select>
@@ -439,10 +262,7 @@
            @click="showDepTree(3)"
          >{{ $t('common.choose') }}</el-button> -->
          </el-form-item>
          <el-form-item
            :label="$t('userManage.RM.isAdmin')"
            :label-width="formLabelWidth"
          >
          <el-form-item :label="$t('userManage.RM.isAdmin')" :label-width="formLabelWidth">
            <!-- <el-radio
              v-model="updateform.isAdmin"
              label="1"
@@ -452,33 +272,14 @@
              label="0"
            >否</el-radio> -->
            <el-select style="width: 85%" v-model="updateform.isAdmin">
              <el-option
                v-for="item in options"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
              <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item
            :label="$t('userManage.RM.describe')"
            :label-width="formLabelWidth"
          >
            <el-input
              v-model="updateform.descr"
              autocomplete="off"
              style="width: 85%"
            ></el-input>
          <el-form-item :label="$t('userManage.RM.describe')" :label-width="formLabelWidth">
            <el-input v-model="updateform.descr" autocomplete="off" style="width: 85%"></el-input>
          </el-form-item>
          <el-form-item
            :label="$t('userManage.RM.remarks')"
            :label-width="formLabelWidth"
          >
            <el-input
              v-model="updateform.bak"
              autocomplete="off"
              style="width: 85%"
            ></el-input>
          <el-form-item :label="$t('userManage.RM.remarks')" :label-width="formLabelWidth">
            <el-input v-model="updateform.bak" autocomplete="off" style="width: 85%"></el-input>
          </el-form-item>
        </el-form>
      </div>
@@ -496,12 +297,8 @@
        <role-dep-tree></role-dep-tree>
      </div>
      <div class="btnBox">
        <el-button type="primary" size="small" @click="selectCataName"
          >确定</el-button
        >
        <el-button type="info" size="small" @click="showCata = false"
          >取消</el-button
        >
        <el-button type="primary" size="small" @click="selectCataName">确定</el-button>
        <el-button type="info" size="small" @click="showCata = false">取消</el-button>
      </div>
    </div>
    <div class="infoBox_box" v-show="showinfoBox">
@@ -725,8 +522,8 @@
      this.itemdetail.createUser = this.itemdetail.createName;
      this.itemdetail.updateUser = this.itemdetail.updateName;
      this.itemdetail.admin =
        parseInt(this.itemdetail.isAdmin) === 0 ? "否" : "是";
      this.itemdetail.admin =this.formateIsAdmin(this.itemdetail)
    },
    handleSelectionChange(val) {
      this.multipleSelection = val;
@@ -735,249 +532,270 @@
      let date = row[column.property];
      return this.formomentTime(date);
    },
    formomentTime(date) {
      if (date === undefined || date === null) {
        return;
      }
      return moment(parseInt(date)).format("YYYY-MM-DD HH:mm:ss");
    },
    showDepTree(res) {
      this.showCata = true;
      this.elTreeFlag = res;
    },
    selectCataName() {
      this.cataName = this.$store.state.catalogueName;
      this.path_id = this.$store.state.cataNode.id;
      var value;
      if (this.cataName.indexOf(">") != -1) {
        var data = this.$store.state.catalogueName.split(">");
        value = data[data.length - 1];
      } else {
        value = this.$store.state.catalogueName;
      }
      this.$store.commit("changeCata", ""); //清空state的面包屑
      this.$store.commit("changeNode", ""); //清空state的节点对象
      this.showCata = false;
      switch (this.elTreeFlag) {
    formateIsAdmin(row, column) {
      switch (row.isAdmin) {
        case 0:
          return "普通用户";
          break;
        case 1:
          this.roleForm.value = value;
          this.roleForm.depid = this.path_id;
          return "超级管理员";
          break;
        case 2:
          this.insertform.depid = this.path_id;
          this.insertform.depValue = value;
          return "数据管理员";
          break;
        case 3:
          this.updateform.depid = this.path_id;
          this.updateform.depValue = value;
          return "领导";
          break;
      }
    },
    async getRoleTabelData() {
      if (this.listData.tab == "") {
        delete this.listData.tab;
      }
      this.listData.name = this.roleForm.username;
      this.listData.depid = this.roleForm.depid;
      const data = await select_Role_ByPageAndCount(this.listData);
      if (data.code != 200) {
        this.$message.error("列表调用失败");
      }
      this.tableData = data.result;
      this.count = data.count;
    },
formomentTime(date) {
  if (date === undefined || date === null) {
    return;
  }
  return moment(parseInt(date)).format("YYYY-MM-DD HH:mm:ss");
},
showDepTree(res) {
  this.showCata = true;
  this.elTreeFlag = res;
},
selectCataName() {
  this.cataName = this.$store.state.catalogueName;
  this.path_id = this.$store.state.cataNode.id;
  var value;
  if (this.cataName.indexOf(">") != -1) {
    var data = this.$store.state.catalogueName.split(">");
    value = data[data.length - 1];
  } else {
    value = this.$store.state.catalogueName;
  }
  this.$store.commit("changeCata", ""); //清空state的面包屑
  this.$store.commit("changeNode", ""); //清空state的节点对象
  this.showCata = false;
  switch (this.elTreeFlag) {
    case 1:
      this.roleForm.value = value;
      this.roleForm.depid = this.path_id;
      break;
    case 2:
      this.insertform.depid = this.path_id;
      this.insertform.depValue = value;
      break;
    case 3:
      this.updateform.depid = this.path_id;
      this.updateform.depValue = value;
      break;
  }
},
    async getRoleTabelData() {
  if (this.listData.tab == "") {
    delete this.listData.tab;
  }
  this.listData.name = this.roleForm.username;
  this.listData.depid = this.roleForm.depid;
  const data = await select_Role_ByPageAndCount(this.listData);
  if (data.code != 200) {
    this.$message.error("列表调用失败");
  }
  this.tableData = data.result;
  this.count = data.count;
},
    async getSelectDepTab() {
      this.selectData = [];
      const data = await selectdepTab();
      if (data.code != 200) {
        this.$message.error("下拉调用失败");
      }
      data.result.forEach((e) => {
        if (e) {
          this.selData.push({
            label: e.name,
            value: e.id,
          });
        }
  this.selectData = [];
  const data = await selectdepTab();
  if (data.code != 200) {
    this.$message.error("下拉调用失败");
  }
  data.result.forEach((e) => {
    if (e) {
      this.selData.push({
        label: e.name,
        value: e.id,
      });
    },
    insertFromClose() {
      this.$confirm("关闭后无法保存,是否关闭?")
        .then((_) => {
          this.InsertFormdialog = false;
          this.insertform = {};
        })
        .catch((_) => {});
    },
    }
  });
},
insertFromClose() {
  this.$confirm("关闭后无法保存,是否关闭?")
    .then((_) => {
      this.InsertFormdialog = false;
      this.insertform = {};
    })
    .catch((_) => { });
},
    async insertFromData() {
      if (this.insertform.depValue == null) {
        this.$message({
          message: "请选择角色所属单位",
          type: "warning",
        });
        return;
      }
      const data = await insertRole(this.insertform);
  if (this.insertform.depValue == null) {
    this.$message({
      message: "请选择角色所属单位",
      type: "warning",
    });
    return;
  }
  const data = await insertRole(this.insertform);
  if (data.code == 200) {
    this.InsertFormdialog = false;
    this.insertform = {};
    this.$message({
      message: "添加成功!",
      type: "success",
    });
    this.getRoleTabelData();
  } else {
    this.$message({
      message: "添加失败!",
      type: "warning",
    });
  }
},
updateFromClose() {
  this.$confirm("关闭后无法保存,是否关闭?")
    .then((_) => {
      this.UpdateFormdialog = false;
      this.updateform = {};
      this.getRoleTabelData();
    })
    .catch((_) => { });
},
    async updateFromData() {
  if (this.updateform.depValue == null) {
    this.$message({
      message: "请选择角色所属单位",
      type: "warning",
    });
    return;
  }
  console.log(this.updateform);
  const data = await updateRole(this.updateform);
  if (data.code == 200) {
    this.UpdateFormdialog = false;
    this.updateform = {};
    this.$message({
      message: "修改成功!",
      type: "success",
    });
    this.getRoleTabelData();
  } else {
    this.$message({
      message: "修改失败!",
      type: "warning",
    });
  }
},
handleDelete() {
  var std = [];
  for (var i in this.multipleSelection) {
    std.push(this.multipleSelection[i].id);
  }
  this.$confirm("此操作将永久删除该角色, 是否继续?", "提示", {
    confirmButtonText: "确定",
    cancelButtonText: "取消",
    type: "warning",
  })
    .then(async () => {
      const data = await deleteRoles({ ids: std.toString() });
      if (data.code == 200) {
        this.InsertFormdialog = false;
        this.insertform = {};
        this.$message({
          message: "添加成功!",
          message: "删除成功!",
          type: "success",
        });
        this.getRoleTabelData();
      } else {
        this.$message({
          message: "添加失败!",
          message: "删除失败!",
          type: "warning",
        });
      }
    },
    updateFromClose() {
      this.$confirm("关闭后无法保存,是否关闭?")
        .then((_) => {
          this.UpdateFormdialog = false;
          this.updateform = {};
          this.getRoleTabelData();
        })
        .catch((_) => {});
    },
    async updateFromData() {
      if (this.updateform.depValue == null) {
        this.$message({
          message: "请选择角色所属单位",
          type: "warning",
        });
        return;
      }
      console.log(this.updateform);
      const data = await updateRole(this.updateform);
      if (data.code == 200) {
        this.UpdateFormdialog = false;
        this.updateform = {};
        this.$message({
          message: "修改成功!",
          type: "success",
        });
        this.getRoleTabelData();
      } else {
        this.$message({
          message: "修改失败!",
          type: "warning",
        });
      }
    },
    handleDelete() {
      var std = [];
      for (var i in this.multipleSelection) {
        std.push(this.multipleSelection[i].id);
      }
      this.$confirm("此操作将永久删除该角色, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(async () => {
          const data = await deleteRoles({ ids: std.toString() });
          if (data.code == 200) {
            this.InsertFormdialog = false;
            this.$message({
              message: "删除成功!",
              type: "success",
            });
            this.getRoleTabelData();
          } else {
            this.$message({
              message: "删除失败!",
              type: "warning",
            });
          }
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除",
          });
        });
    },
    handleSizeChange(val) {
      this.listData.pageSize = val;
      this.getRoleTabelData();
    },
    handleCurrentChange(val) {
      this.listData.pageIndex = val;
      this.getRoleTabelData();
    },
    })
    .catch(() => {
      this.$message({
        type: "info",
        message: "已取消删除",
      });
    });
},
handleSizeChange(val) {
  this.listData.pageSize = val;
  this.getRoleTabelData();
},
handleCurrentChange(val) {
  this.listData.pageIndex = val;
  this.getRoleTabelData();
},
    async handleEdit(index, row) {
      this.updateform = row;
      // this.updateform.isAdmin = row.isAdmin.toString();
      const data = await selectDep({ id: row.depid });
      if (data.result == null) {
        this.updateform.depValue = null;
      } else {
        this.updateform.depValue = data.result.name;
      }
  this.updateform = row;
  // this.updateform.isAdmin = row.isAdmin.toString();
  const data = await selectDep({ id: row.depid });
  if (data.result == null) {
    this.updateform.depValue = null;
  } else {
    this.updateform.depValue = data.result.name;
  }
      this.UpdateFormdialog = true;
    },
    onSubmit() {
  this.UpdateFormdialog = true;
},
onSubmit() {
  this.getRoleTabelData();
},
resetForm(formName) {
  this.$refs[formName].resetFields();
  this.roleForm = {};
  this.getRoleTabelData();
},
showPermsMenu(res) {
  switch (res.tag) {
    case "/delete":
      this.menuStatus.delete = true;
      break;
    case "/insert":
      this.menuStatus.insert = true;
      break;
    case "/update":
      this.menuStatus.update = true;
      break;
  }
},
handleClose() {
  this.$confirm("关闭后无法保存,是否关闭?")
    .then((_) => {
      this.InsertFormdialog = false;
    })
    .catch((_) => { });
},
handleCloseEdit() {
  this.$confirm("关闭后无法保存,是否关闭?")
    .then((_) => {
      this.UpdateFormdialog = false;
      this.getRoleTabelData();
    },
    resetForm(formName) {
      this.$refs[formName].resetFields();
      this.roleForm = {};
      this.getRoleTabelData();
    },
    showPermsMenu(res) {
      switch (res.tag) {
        case "/delete":
          this.menuStatus.delete = true;
          break;
        case "/insert":
          this.menuStatus.insert = true;
          break;
        case "/update":
          this.menuStatus.update = true;
          break;
      }
    },
    handleClose() {
      this.$confirm("关闭后无法保存,是否关闭?")
        .then((_) => {
          this.InsertFormdialog = false;
        })
        .catch((_) => {});
    },
    handleCloseEdit() {
      this.$confirm("关闭后无法保存,是否关闭?")
        .then((_) => {
          this.UpdateFormdialog = false;
          this.getRoleTabelData();
        })
        .catch((_) => {});
    },
    })
    .catch((_) => { });
},
  },
  beforeDestroy() {
    this.timer && clearTimeout(this.timer);
    window.removeEventListener("resize", this.onResize);
  },
  mounted() {
    window.addEventListener("resize", this.onResize);
    this.calHeight();
  },
  created() {
    var val = this.$store.state.currentPerms;
    var permsEntity = this.$store.state.permsEntity;
    for (var i = 0; i < permsEntity.length; i++) {
      if (permsEntity[i].perms == val) {
        this.showPermsMenu(permsEntity[i]);
      }
beforeDestroy() {
  this.timer && clearTimeout(this.timer);
  window.removeEventListener("resize", this.onResize);
},
mounted() {
  window.addEventListener("resize", this.onResize);
  this.calHeight();
},
created() {
  var val = this.$store.state.currentPerms;
  var permsEntity = this.$store.state.permsEntity;
  for (var i = 0; i < permsEntity.length; i++) {
    if (permsEntity[i].perms == val) {
      this.showPermsMenu(permsEntity[i]);
    }
    this.getRoleTabelData();
    this.getDepList();
  },
  }
  this.getRoleTabelData();
  this.getDepList();
},
};
</script>
<style lang="less" scoped>
@@ -990,6 +808,7 @@
  .el-input {
    width: 300px;
  }
  .leftTree {
    position: absolute;
    z-index: 9999;
@@ -1002,12 +821,14 @@
      height: 550px;
      overflow: auto;
    }
    .btnBox {
      width: 123px;
      margin: 10px auto 0;
      // background-color: red;
    }
  }
  .inquire {
    height: auto;