ludc
2024-08-14 24fa2e63f7c155c87457980e6c656f3891132a47
Source/plt-web/plt-web-ui/src/views/system/user/index.vue
@@ -53,7 +53,7 @@
        <el-button icon="el-icon-delete" size="small" type="text" @click.stop="rowDeleteHandler(row)">删除</el-button>
        <el-button size="small" type="text" @click.stop="stopUserHandler(row)">
          <span v-if="row.status === 0" style="color: #fa3434"><i class="el-icon-video-pause"></i> 停用</span>
          <span v-if="row.status === 1" style="color: #55b61d"><i class="el-icon-video-pause"></i> 启用</span>
          <span v-if="row.status === 1" style="color: #55b61d"><i class="el-icon-video-play"></i> 启用</span>
        </el-button>
      </template>
@@ -77,7 +77,6 @@
    <el-dialog
      v-dialogDrag
      v-loading="pwdLoading"
      :destroy-on-close="true"
      :visible.sync="pwdVisible"
      append-to-body="true"
      class="avue-dialog"
@@ -100,13 +99,12 @@
    </el-dialog>
    <!-- 导入人员   -->
    <upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" title="导入人员" @updata="getTableList"></upload-file>
    <upload-file ref="upload" :tipList="tipList" :fileType="upFileType" :fileUrl="fileUrl" title="导入人员" @updata="getTableList"></upload-file>
    <!-- 分配部门对话框    -->
    <el-dialog
      v-dialogDrag
      v-loading="departLoading"
      :destroy-on-close="true"
      :visible.sync="departVisible"
      append-to-body="true"
      class="avue-dialog"
@@ -161,6 +159,7 @@
      departCurrenRow: {},
      departOption: {
        ...basicOption,
        addBtn:false,
        rowKey: 'oid',
        rowParentKey: 'parentId',
        selection: false,
@@ -173,6 +172,7 @@
          {
            label: '名称',
            prop: 'name',
            align:'left'
          },
          {
            label: '编号',
@@ -213,7 +213,9 @@
      selectList: [],
      leftRoleData: [],  // 分配角色穿梭框左侧初始数据
      rightRoleData: [], // 分配角色穿梭框右侧初始数据
      transferTitle: ['现有角色', '拥有角色']
      transferTitle: ['现有角色', '拥有角色'],
      tipList:["导入模板中标明红色字体的为必输项","部门列上下级关系必须按照反斜杠隔开(/)"],
      lastIndex:null,
    }
  },
  created() {
@@ -227,6 +229,7 @@
      }
      done();
    },
    // 表格请求
    getTableList() {
      this.tableLoading = true;
@@ -310,7 +313,13 @@
    // 点击行
    rowClickHandler(row) {
      this.$refs.userCrud.toggleRowSelection(row);
      func.rowClickHandler(
        row,
        this.$refs.userCrud,
        this.lastIndex,
        (newIndex) => { this.lastIndex = newIndex; },
        () => { this.selectList = []; }
      );
    },
    // 分配角色
@@ -387,7 +396,7 @@
    },
    // 新增
    rowSaveHandler(row, done) {
    rowSaveHandler(row, done,loading) {
      if (row.password != row.confirmPassword) {
        this.$message.error('请检查两次密码是否输入一致!')
        return this.$refs.userCrud.$refs.dialogForm.$refs.tableForm.allDisabled = false;
@@ -397,11 +406,12 @@
        if (res.data.code === 200) {
          this.$message.success(res.data.obj);
          this.getTableList();
          done();
        }
      }).catch(err => {
        loading()
        console.log(err);
      })
      done()
    },
    // 操作栏编辑
@@ -417,7 +427,7 @@
    },
    // 编辑
    rowUpdateHandler(row, index, done) {
    rowUpdateHandler(row, index, done,loading) {
      if (row.password != row.confirmPassword) {
        this.$message.error('请检查两次密码是否输入一致!')
        return this.$refs.userCrud.$refs.dialogForm.$refs.tableForm.allDisabled = false;
@@ -427,11 +437,12 @@
        if (res.data.code === 200) {
          this.$message.success(res.data.obj);
          this.getTableList();
          done()
        }
      }).catch(err => {
        loading()
        console.log(err);
      });
      done()
    },
    // 删除
@@ -439,14 +450,24 @@
      let params = {
        ids: row.oid
      }
      deleteUser(params).then(res => {
        if (res.data.code === 200) {
          this.$message.success(res.data.obj);
          this.getTableList();
        }
      }).catch(err => {
        console.log(err);
      })
      this.$confirm('您确定要删除当前的成员吗?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        deleteUser(params).then(res => {
          if (res.data.code === 200) {
            this.$message.success(res.data.obj);
            this.getTableList();
          }
        });
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        });
      });
    },
    // 多选删除
@@ -482,7 +503,7 @@
      download().then(res => {
        console.log(res);
        func.downloadFileByBlobHandler(res);
        this.$message.success('下载成功')
        this.$message.success('下载成功');
      }).catch(err => {
        this.$message.error(err);
      })
@@ -496,7 +517,7 @@
    // 分配部门
    departmentHandler() {
      if (this.selectList.length <= 0) {
        this.$message.warning('清先选择人员再进行操作!')
        this.$message.warning('清先选择人员再进行操作!');
        return;
      }
      this.departStatus = 'default'; // 区分不同方式打开部门对话框