wangting
2024-10-29 1d54251546a06fc8e7cdbb3f28db7cba76ca07a0
调整页面,修改bug
已修改3个文件
109 ■■■■ 文件已修改
Source/plt-web/plt-web-ui/src/views/system/role/index.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/system/user/index.vue 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/system/user/option.js 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/system/role/index.vue
@@ -113,6 +113,7 @@
        refreshBtn: false,
        addBtn: false,
        menu: false,
        header:false,
        column: [
          {
            label: '部门',
Source/plt-web/plt-web-ui/src/views/system/user/index.vue
@@ -2,7 +2,6 @@
  <basic-container>
    <avue-crud
      ref="userCrud"
      :before-open="beforeOpen"
      :data="tableData"
      :option="option"
      :page.sync="page"
@@ -18,26 +17,6 @@
      @row-save="rowSaveHandler"
      @row-update="rowUpdateHandler"
    >
      <!-- 部门头部搜索插槽  -->
      <template slot-scope="{disabled,size}" slot="pkDepartmentNameSearch">
        <div style="display: flex;gap: 5px">
          <el-select v-model="departSearchValue" clearable placeholder="请选择部门">
            <el-option :label="departSearchObj.name" :value="departSearchObj.oid"></el-option>
          </el-select>
          <el-button size="small" type="success" @click="dialogDepartSearchHandler">选择部门</el-button>
        </div>
      </template>
      <!-- 对话框部门插槽     -->
      <template slot="pkDepartmentNameForm" slot-scope="scope">
        <div style="display: flex;gap: 5px">
          <el-select v-model="departValue" clearable placeholder="请选择部门">
            <el-option :label="departObj.name" :value="departObj.oid"></el-option>
          </el-select>
          <el-button size="small" type="success" @click="dialogDepartHandler">选择部门</el-button>
        </div>
      </template>
      <template slot="status" slot-scope="{row}">
        <el-tag v-if="row.status === 0" type="success">启用</el-tag>
        <el-tag v-if="row.status === 1" type="danger">停用</el-tag>
@@ -154,8 +133,6 @@
      departSearchValue:'',
      loadKey: 0,
      departStatus: '', // 区分不同方式打开部门对话框
      departValue: '', // 部门对话框下拉框绑定值
      departObj: {},  // 部门对话框下拉框选项绑定值
      departCurrenRow: {},
      departOption: {
        ...basicOption,
@@ -168,6 +145,7 @@
        menu: false,
        refreshBtn: false,
        gridBtn: false,
        header:false,
        column: [
          {
            label: '名称',
@@ -221,15 +199,6 @@
  created() {
  },
  methods: {
    // 新增或修改对话框打开前
    beforeOpen(done, type) {
      if(type == 'add'){
        this.departObj = {};
        this.departValue = "";
      }
      done();
    },
    // 表格请求
    getTableList() {
      this.tableLoading = true;
@@ -239,6 +208,7 @@
        this.page.total = res.data.total;
        this.tableLoading = false;
      })
      this.departmentQueryOnLoad()
    },
    // 表格右侧刷新图标
@@ -249,10 +219,6 @@
    // 搜索查询
    handleSearch(params, done) {
      this.searchParams = {};
      if(this.departSearchObj && this.departSearchValue){
        this.searchParams['conditionMap["pkDepartment"]'] = this.departSearchValue;
      }
      if (!func.isEmptyObject(params)) {
        for (let key in params) {
          if (params.hasOwnProperty(key)) {
@@ -263,7 +229,7 @@
        }
      }
      if (func.isEmptyObject(params) && !this.departSearchValue) {
      if (func.isEmptyObject(params)) {
        this.searchParams = {};
      }
@@ -273,8 +239,6 @@
    // 重置搜索条件
    handleReset() {
      this.departSearchObj = {};
      this.departSearchValue = "";
      this.searchParams = {};
      this.getTableList();
    },
@@ -399,7 +363,6 @@
        this.$message.error('请检查两次密码是否输入一致!')
        return this.$refs.userCrud.$refs.dialogForm.$refs.tableForm.allDisabled = false;
      }
      row.pkDepartment = this.departValue; // 将当前行的部门参数pkDepartment 赋值为下拉框绑定的值
      addUser(row).then(res => {
        if (res.data.code === 200) {
          this.$message.success(res.data.obj);
@@ -413,14 +376,7 @@
    // 操作栏编辑
    rowEditHandler(row, index) {
      let obj = { name: row.pkDepartmentName, oid: row.pkDepartment, rowOid: row.oid };
      this.departValue = row.pkDepartment;
      this.departObj = obj;
      if (this.departObj.rowOid) {
        this.$refs.userCrud.rowEdit(row, index);
      }
      this.$refs.userCrud.rowEdit(row, index);
    },
    // 编辑
@@ -429,7 +385,6 @@
        this.$message.error('请检查两次密码是否输入一致!')
        return this.$refs.userCrud.$refs.dialogForm.$refs.tableForm.allDisabled = false;
      }
      row.pkDepartment = this.departValue; // 将当前行的部门参数pkDepartment 赋值为下拉框绑定的值
      updateUser(row).then(res => {
        if (res.data.code === 200) {
          this.$message.success(res.data.obj);
@@ -497,11 +452,8 @@
    // 下载导入模板
    downloadHandler() {
      download().then(res => {
        console.log(res);
        func.downloadFileByBlobHandler(res);
        this.$message.success('下载成功');
      }).catch(err => {
        this.$message.error(err);
      })
    },
@@ -517,7 +469,7 @@
        return;
      }
      this.departStatus = 'default'; // 区分不同方式打开部门对话框
      this.departmentQueryOnLoad();
      this.departVisible = true;
    },
    // 分配部门表格初始化请求
@@ -525,7 +477,8 @@
      departmentQueryController({queryAllLevel: true}).then(res => {
        const data = res.data.treeData;
        this.departData = this.departDtaFormAtter(data);
        this.departVisible = true;
        this.option.column[7].dicData=[{oid:'ALLDept',name:'所有部门',expand:true,disabled:true,children:this.departData}]
        this.option.column[7].defaultExpandedKeys=['ALLDept'];
      }).catch(err => {
        this.$message.error(err);
      })
@@ -562,6 +515,7 @@
        return;
      }
      //分配部门
      if (this.departStatus == 'default') {
        let params = {
          userOIds: this.selectList.map(item => item.oid).join(','),
@@ -573,37 +527,9 @@
            this.getTableList();
            this.$message.success('分配成功!')
          }
        }).catch(err => {
          console.log(err);
        })
        return;
      }
      if (this.departStatus == 'handle') {
        this.departObj = this.departCurrenRow;
        this.departValue = this.departCurrenRow.oid;
        this.departVisible = false;
        return;;
      }
      if(this.departStatus == 'search'){
        this.departSearchObj =  this.departCurrenRow;
        this.departSearchValue =  this.departCurrenRow.oid;
        this.departVisible = false;
        return;
      }
    },
    // 对话框分配部门按钮
    dialogDepartHandler() {
      this.departmentQueryOnLoad();
      this.departStatus = 'handle'; // 区分不同方式打开部门对话框
    },
    // 搜索对话框分配部门按钮
    dialogDepartSearchHandler(){
      this.departmentQueryOnLoad();
      this.departStatus = 'search'; // 区分不同方式打开部门对话框
    },
  }
Source/plt-web/plt-web-ui/src/views/system/user/option.js
@@ -4,6 +4,7 @@
    prop: 'id',
    search:true,
    sortable:true,
    editDisabled: true,
    rules: [
      {
        required: true,
@@ -61,23 +62,32 @@
    prop: 'status',
    display:false,
    sortable:true,
    width: 80,
  },
  {
    label: '密码策略',
    prop: 'pkPasswordStrategyName',
    sortable:true,
    display:false,
    width: 100
  },
  {
    label: '锁定状态',
    prop: 'lockFlag',
    sortable:true,
    display:false,
    width: 100,
  },
  {
    label: '所属部门',
    prop: 'pkDepartmentName',
    prop: 'pkDepartment',
    align:'center',
    type:'tree',
    dicData: [],
    props: {
      label: 'name',
      value: 'oid'
    },
    search:true,
    sortable:true,
    overHidden: true,
@@ -107,7 +117,8 @@
    prop: 'email',
    sortable:true,
    overHidden: true,
    row:true
    row:true,
    span:24
  },
  {
    label: '描述',
@@ -115,6 +126,7 @@
    prop: 'description',
    sortable:true,
    overHidden: true,
    span:24
  },
  {
    label: '部门领导',
@@ -125,7 +137,7 @@
  {
    label: '所属密级',
    prop: 'secretGradeText',
    sortable:true,
    display:false,
    width: 80
  },
];