lixuliang
2024-08-29 669a325fc5cb1e9fcfdc2d2f8642763966338cd0
se-ui/src/views/system/role/index.vue
@@ -1,5 +1,5 @@
<template>
  <div class="app-container">
  <div :style="styleObject" class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
      <el-form-item label="角色名称" prop="roleName">
        <el-input
@@ -166,16 +166,20 @@
    />
    <!-- 添加或修改角色配置对话框 -->
    <!--     :wrapperClosable="false"  点击遮罩层是否可以关闭 Drawer-->
    <el-drawer
      title="信息修改"
      :visible.sync="open"
      direction="rtl"
      custom-class="demo-drawer"
      size="500px"
      ref="drawer"
      append-to-body
      :modal="false"
      :before-close="cancel"
    >
      <div class="demo-drawer__content">
        <el-form ref="form" :model="form" :rules="rules" label-width="100px">
        <el-form ref="form" :model="form" :rules="rules" label-width="120px">
          <el-form-item label="角色名称" prop="roleName">
            <el-input v-model="form.roleName" placeholder="请输入角色名称" />
          </el-form-item>
@@ -231,12 +235,12 @@
          </el-form-item>
        </el-form>
        <div class="demo-drawer__footer">
          <!-- <el-button >取 消</el-button>
          <el-button @click="cancel">取 消</el-button>
          <el-button
            type="primary"
            @click="$refs.drawer.closeDrawer()"
            @click="submitForm"
            :loading="loading"
          >{{ loading ? '提交中 ...' : '确 定' }}</el-button>-->
          >{{ loading ? '提交中 ...' : '确 定' }}</el-button>
        </div>
      </div>
    </el-drawer>
@@ -341,7 +345,18 @@
    </el-dialog>
  </div>
</template>
<style scoped>
.demo-drawer__footer {
  width: 100%;
  position: absolute;
  bottom: 0;
  left: 0;
  border-top: 1px solid #e8e8e8;
  padding: 10px 16px;
  text-align: right;
  background-color: bfa;
}
</style>
<script>
import {
  listRole,
@@ -424,6 +439,7 @@
        roleKey: undefined,
        status: undefined
      },
      styleObject: {},
      // 表单参数
      form: {},
      defaultProps: {
@@ -517,6 +533,7 @@
    // 取消按钮
    cancel() {
      this.open = false;
      this.styleObject = { width: "100%" };
      this.reset();
    },
    // 取消按钮(数据权限)
@@ -619,6 +636,7 @@
      this.reset();
      this.getMenuTreeselect();
      this.open = true;
      this.title = "添加角色";
    },
    /** 修改按钮操作 */
@@ -629,6 +647,7 @@
      getRole(roleId).then(response => {
        this.form = response.data;
        this.open = true;
        this.styleObject = { width: "70%" };
        this.$nextTick(() => {
          roleMenu.then(res => {
            let checkedKeys = res.checkedKeys;
@@ -677,6 +696,7 @@
            updateRole(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.styleObject = { width: "100%" };
              this.getList();
            });
          } else {
@@ -684,6 +704,7 @@
            addRole(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.styleObject = { width: "100%" };
              this.getList();
            });
          }