管道基础大数据平台系统开发-【前端】-新系統界面
584911253@qq.com
2023-03-02 8bb00665765e8348aeb3a6e799069287e503e1ab
src/views/AuthorizationManagement/roleResAuthorization.vue
@@ -1,13 +1,11 @@
<template>
  <div class="menuSettings_box">
    <div class="menuSettings_tree">
      <div class="content_box">
        <My-bread
          :list="[
      <div class="content_left_box subpage_Div content-border">
        <My-bread :list="[
            `${$t('operatManage.operatManage')}`,
            `${$t('operatManage.RoleResAuthorization')}`,
          ]"
        ></My-bread>
          ]"></My-bread>
        <el-divider />
        <div style="height: 90%; overflow-y: auto">
          <el-tree
@@ -24,9 +22,8 @@
          </el-tree>
        </div>
      </div>
      <div class="content_box">
        <div
          style="
      <div class="content_box subpage_Div content-border">
        <div style="
            font-size: 14px;
            color: #216fe6;
            line-height: 1;
@@ -34,26 +31,28 @@
            position: relative;
            top: 10px;
            margin-left: 10px;
          "
        >
          ">
          {{ $t('operatManage.UserRoleAuthorizationObj.RoleTable') }}
        </div>
        <el-divider />
        <el-table
          :data="tableData"
          style="width: 100%"
          border
          @row-click="singleElection"
          highlight-current-row
          height="84%"
           height="calc(100% - 80px)"
        >
          <el-table-column align="center" width="55">
          <el-table-column
            align="center"
            width="55"
          >
            <template slot-scope="scope">
              <el-radio
                class="radio"
                v-model="templateSelection"
                :label="scope.row.id"
                >&nbsp;</el-radio
              >
              >&nbsp;</el-radio>
            </template>
          </el-table-column>
          <el-table-column
@@ -68,74 +67,74 @@
          </el-table-column>
        </el-table>
        <div
          style="text-align: center; margin-top: 20px"
          style="text-align: center; margin-top: 10px"
          class="pagination_box"
        >
          <el-pagination
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page="listData.pageIndex"
            :page-sizes="[10, 20, 30, 40]"
            :page-sizes="[10, 20, 50, 100]"
            :page-size="userlistData.pageSize"
            layout="total, sizes, prev, pager, next, jumper"
            layout="prev, pager, next"
            :total="count"
          >
          </el-pagination>
        </div>
      </div>
      <div class="content_box">
        <div
          style="
      <div class="content_box subpage_Div content-border">
        <div style="
            font-size: 14px;
            color: #216fe6;
            line-height: 1;
            cursor: text;
            position: relative;
            top: 5px;
            top: 0px;
            margin-left: 10px;
            display: flex;
            align-items: center;
          "
        >
          ">
          <span>
            {{ $t('operatManage.UserRoleAuthorizationObj.ResTable') }}</span
            {{ $t('operatManage.UserRoleAuthorizationObj.ResTable') }}</span>
          <div
            class="btn"
            style="margin-left: auto"
          >
          <div class="btn" style="margin-left: auto">
            <el-button
              v-if="menuStatus.insert"
              type="primary"
              type="success"
              icon="el-icon-circle-plus-outline"
              size="mini"
              size="small"
              :disabled="roleid == null ? true : false"
              style="background: #216fe6"
              @click="adduser"
              >{{
            >{{
                $t('operatManage.UserRoleAuthorizationObj.Added')
              }}</el-button
            >
              }}</el-button>
            <el-button
              v-if="menuStatus.delete"
              type="danger"
              icon="el-icon-delete"
              size="mini"
              size="small"
              @click="deletesUser"
              :disabled="roleid == null ? true : false"
              >{{
            >{{
                $t('operatManage.UserRoleAuthorizationObj.delete')
              }}</el-button
            >
              }}</el-button>
          </div>
        </div>
        <el-divider class="divider" />
        <el-table
          :data="usertableData"
          stripe
          border
          style="width: 100%"
          height="84%"
           height="calc(100% - 80px)"
          @selection-change="handleSelectionChange"
        >
          <el-table-column type="selection" width="55"> </el-table-column>
          <el-table-column
            type="selection"
            width="55"
          > </el-table-column>
          <el-table-column
            align="center"
            type="index"
@@ -154,16 +153,16 @@
        </el-table>
        <div
          style="margin-top: 20px; text-align: center"
          style="margin-top: 10px; text-align: center"
          class="pagination_box"
        >
          <el-pagination
            @size-change="userhandleSizeChange"
            @current-change="userhandleCurrentChange"
            :current-page="userlistData.pageIndex"
            :page-sizes="[10, 20, 30, 40]"
            :page-sizes="[10, 20, 50, 100]"
            :page-size="userlistData.pageSize"
            layout="total, sizes, prev, pager, next, jumper"
            layout="prev, pager, next"
            :total="usercount"
          >
          </el-pagination>
@@ -250,7 +249,7 @@
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="listData.pageIndex"
          :page-sizes="[10, 20, 30, 40]"
          :page-sizes="[10, 20, 50, 100]"
          :page-size="userlistData.pageSize"
          layout="total, sizes, prev, pager, next, jumper"
          :total="count"
@@ -331,7 +330,7 @@
          @size-change="userhandleSizeChange"
          @current-change="userhandleCurrentChange"
          :current-page="userlistData.pageIndex"
          :page-sizes="[10, 20, 30, 40]"
          :page-sizes="[10, 20, 50, 100]"
          :page-size="userlistData.pageSize"
          layout="total, sizes, prev, pager, next, jumper"
          :total="usercount"
@@ -348,7 +347,10 @@
        height="40vh"
        @selection-change="addhandleSelectionChange"
      >
        <el-table-column type="selection" width="55"> </el-table-column>
        <el-table-column
          type="selection"
          width="55"
        > </el-table-column>
        <el-table-column
          align="center"
          type="index"
@@ -365,27 +367,36 @@
        >
        </el-table-column>
      </el-table>
      <div style="margin-top: 20px; text-align: center" class="pagination_box">
      <div
        style="margin-top: 20px; text-align: center"
        class="pagination_box"
      >
        <el-pagination
          @size-change="addhandleSizeChange"
          @current-change="addhandleCurrentChange"
          :current-page="addlistData.pageIndex"
          :page-sizes="[10, 20, 30, 40]"
          :page-sizes="[10, 20, 50, 100]"
          :page-size="addlistData.pageSize"
          layout="total, sizes, prev, pager, next, jumper"
          :total="addcount"
        >
        </el-pagination>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogTableVisible = false">{{
      <div
        slot="footer"
        class="dialog-footer"
      >
        <el-button
          size="small"
          @click="dialogTableVisible = false"
        >{{
          $t('dataManage.dictionaryManageObj.cancel')
        }}</el-button>
        <el-button
          style="background: #409eff; border: 1px solid #409eff; color: white"
          size="small"
          type="primary"
          @click="addConfirm"
          >{{ $t('dataManage.dictionaryManageObj.confirm') }}</el-button
        >
        >{{ $t('dataManage.dictionaryManageObj.confirm') }}</el-button>
      </div>
    </el-dialog>
  </div>
@@ -476,7 +487,7 @@
          this.dialogTableVisible = false;
          this.getuserList();
        })
        .catch(() => {});
        .catch(() => { });
    },
    adduser() {
      this.dialogTableVisible = true;
@@ -488,15 +499,40 @@
      this.usermultipleSelection.forEach((e) => {
        arr.push(e.id);
      });
      const data = await roleResDeletes({ ids: arr.toString() });
      if (data.code !== 200) {
        return this.$message.error('删除失败');
      }
      this.$message({
        message: '删除成功',
        type: 'success',
      this.$confirm('此操作将永久删除该权限, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(async () => {
        const data = await roleResDeletes({ ids: arr.toString() });
        if (data.code == 200) {
          this.InsertFormdialog = false;
          this.$message({
            message: '删除成功!',
            type: 'success',
          });
          this.getuserList();
        } else {
          this.$message({
            message: '删除失败!',
            type: 'warning',
          });
        }
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        });
      });
      this.getuserList();
      // const data = await roleResDeletes({ ids: arr.toString() });
      // if (data.code !== 200) {
      //   return this.$message.error('删除失败');
      // }
      // this.$message({
      //   message: '删除成功',
      //   type: 'success',
      // });
      // this.getuserList();
    },
    //用户表多选
    handleSelectionChange(val) {
@@ -646,187 +682,40 @@
<style lang="less" scoped>
//@import url(); 引入公共css类
.menuSettings_box {
  border-radius: 10px;
  height: 81%;
  width: 97%;
  position: absolute;
  box-sizing: border-box;
  height: calc(100% - 20px);
  //height: 98%;
  width: 98%;
  padding:10px 1%;
  .menuSettings_tree {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-around;
    .content_left_box{
      padding: 10px;
      width: 20%;
      height: calc(100% - 20px);
      border-radius: 5px;
    }
    .content_box {
      padding: 10px;
      width: 31%;
      height: 720px;
      border: 1px solid rgb(202, 201, 204);
      width: 36%;
      height: calc(100% - 20px);
      border-radius: 5px;
      /deep/ .el-input__inner {
        background-color: transparent !important;
        border: 1px solid;
        color: white;
      }
      /deep/.el-form-item__label {
        color: white;
      }
      /*修改table 表体的背景颜色和文字颜色*/
      /deep/ .el-table {
        background-color: transparent;
        th,
        td {
          background-color: transparent;
        }
        .el-table__expanded-cell {
          background-color: transparent !important;
        }
        // 表头背景色
        th.el-table__cell {
          background-color: #303030;
          color: #fff;
        }
        tr > td {
          background-color: #303030;
          color: #fff;
        }
        // hover效果
        tr:hover > td {
          background-color: rgba(255, 255, 255, 0.1) !important;
        }
        tbody tr:hover {
          background-color: rgba(255, 255, 255, 0.1) !important;
          // text-align: center;
        }
        // 滚动条宽高
        .el-table__body-wrapper::-webkit-scrollbar {
          width: 5px;
          height: 5px;
        }
        .el-table__body-wrapper::-webkit-scrollbar {
          width: 5px;
          /*滚动条宽度*/
          height: 10px;
          /*滚动条高度*/
        }
        /*定义滚动条轨道 内阴影+圆角*/
        .el-table__body-wrapper::-webkit-scrollbar-track {
          box-shadow: 0px 1px 3px #216fe6 inset;
          /*滚动条的背景区域的内阴影*/
          border-radius: 10px;
        }
        /*定义滑块 内阴影+圆角*/
        .el-table__body-wrapper::-webkit-scrollbar-thumb {
          box-shadow: 0px 1px 3px #216fe6 inset;
          border-radius: 6px;
          background-color: #216fe6;
        }
      }
    }
    .divider {
      margin-top: 8px;
    }
  }
  /deep/ .el-table {
    background-color: transparent;
    th,
    td {
      background-color: transparent;
    }
    .el-table__expanded-cell {
      background-color: transparent !important;
    }
    // 表头背景色
    th.el-table__cell {
      background-color: #303030;
      color: #fff;
    }
    tr > td {
      background-color: #303030;
      color: #fff;
    }
    // hover效果
    tr:hover > td {
      background-color: rgba(255, 255, 255, 0.1) !important;
    }
    tbody tr:hover {
      background-color: rgba(255, 255, 255, 0.1) !important;
      // text-align: center;
    }
    // 滚动条宽高
    .el-table__body-wrapper::-webkit-scrollbar {
      width: 5px;
      height: 5px;
    }
    .el-table__body-wrapper::-webkit-scrollbar {
      width: 5px;
      /*滚动条宽度*/
      height: 10px;
      /*滚动条高度*/
    }
    /*定义滚动条轨道 内阴影+圆角*/
    .el-table__body-wrapper::-webkit-scrollbar-track {
      box-shadow: 0px 1px 3px #216fe6 inset;
      /*滚动条的背景区域的内阴影*/
      border-radius: 10px;
    }
    /*定义滑块 内阴影+圆角*/
    .el-table__body-wrapper::-webkit-scrollbar-thumb {
      box-shadow: 0px 1px 3px #216fe6 inset;
      border-radius: 6px;
      background-color: #216fe6;
    }
  }
  .pagination_box {
    /deep/.el-input__inner {
      background-color: transparent !important;
      border: 1px solid;
      color: white;
    }
    /deep/.el-pagination__total {
      color: white;
    }
    /deep/.el-pagination__jump {
      color: white;
    }
    /deep/.el-pager li.active {
      color: #1890ff;
    }
    /deep/.el-pager li {
      color: white;
      background: transparent;
    }
    /deep/.el-pager li {
      color: white;
    }
    /deep/.btn-prev {
      background: transparent;
    }
    /deep/.btn-next {
      background: transparent;
    }
  }
  /deep/ .el-dialog {
    background: #303030;
  }
  /deep/.el-range-editor.is-active,
  .el-range-editor.is-active:hover,
  .el-select .el-input.is-focus .el-input__inner {
    border: 1px solid;
  }
  /deep/.el-dialog__title {
    color: white;
  }
}
.el-table,
.el-table /deep/ .el-table__expanded-cell {
  background-color: transparent !important;
}
.el-table /deep/ th,
.el-table /deep/ tr {
  background-color: transparent !important;
}
</style>