tian
2025-09-23 7afa7c7ad7d7f1250a086a406453a7cbc8b5cbd5
src/views/archiveManager/arMAutoUser.vue
@@ -28,6 +28,7 @@
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          v-if="vws"
          type="primary"
          plain
          icon="el-icon-plus"
@@ -61,21 +62,30 @@
    <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="用户名称" prop="userName" :show-overflow-tooltip="true" />
      <el-table-column label="用户昵称" prop="nickName" :show-overflow-tooltip="true" />
      <el-table-column label="邮箱" prop="email" :show-overflow-tooltip="true" />
      <el-table-column label="手机" prop="phonenumber" :show-overflow-tooltip="true" />
      <el-table-column label="状态" align="center" prop="status">
      <el-table-column label="用户名称" prop="sysUser.userName" :show-overflow-tooltip="true" />
      <el-table-column label="用户昵称" prop="sysUser.nickName" :show-overflow-tooltip="true" >
        <template slot-scope="scope">{{scope.row.sysUser.nickName?scope.row.sysUser.nickName:'--'}}</template>
        </el-table-column>
      <el-table-column label="邮箱" prop="sysUser.email" :show-overflow-tooltip="true" >
            <template slot-scope="scope">{{scope.row.sysUser.email?scope.row.sysUser.email:'--'}}</template>
      </el-table-column>
      <el-table-column label="手机" prop="sysUser.phonenumber" :show-overflow-tooltip="true" >
        <template slot-scope="scope">{{scope.row.sysUser.phonenumber?scope.row.sysUser.phonenumber:'--'}}</template>
        </el-table-column>
   <!--   <el-table-column label="状态" align="center" prop="sysUser.status">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
        </template>
      </el-table-column>
      </el-table-column> -->
      <el-table-column label="创建时间" align="center" prop="createTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime) }}</span>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
      <el-table-column label="操作" align="center" prop="11" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
@@ -95,20 +105,22 @@
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
    <select-user ref="select" :roleId="queryParams.roleId" @ok="handleQuery" />
    <select-user ref="select" :roleId="queryParams.roleId" :recordId="queryParams.archiveRecordsId" @ok="handleQuery" />
  </div>
</template>
<script>
import {UserRoleIdList, allocatedUserList, authUserCancel, authUserCancelAll } from "@/api/system/role"
import selectUser from "./seleUser"
  import { listMaterials, getMaterials, delMaterials, addMaterials, updateMaterials,getArchiverecordstouserByReIdAndUid } from "@/api/system/materials"
import {listArchiverecordstouser,addArchiverecordstouser,delArchiverecordstouserByReIdAndUid} from "@/api/system/archiverecordstouser"
export default {
  name: "AuthUser1",
  dicts: ['sys_normal_disable'],
   components: { selectUser },
  data() {
    return {
      vws: true,
      // 遮罩层
      loading: true,
      // 选中用户组
@@ -126,15 +138,20 @@
        pageNum: 1,
        pageSize: 10,
        roleId: undefined,
        userName: undefined,
        phonenumber: undefined
        archiveRecordsId: undefined,
        // SysUser.userName: undefined,
        // phonenumber: undefined
      }
    }
  },
  created() {
    const roleId = this.$route.params && this.$route.params.roleId
    if (roleId) {
    const recordId = this.$route.params && this.$route.params.archiveRecordsId
    if (roleId&&recordId) {
      this.queryParams.roleId = roleId
      this.queryParams.archiveRecordsId = recordId
      this.getList()
    }
  },
@@ -144,9 +161,10 @@
      this.loading = true
      console.log(this.queryParams)
      console.log("------------")
      UserRoleIdList(this.queryParams).then(response => {
          this.userList = response.rows
          this.total = response.total
      listArchiverecordstouser(this.queryParams).then(response => {
        console.log(response)
          this.userList = response.data.data
          this.total = response.data.total
          this.loading = false
        }
      )
@@ -173,13 +191,19 @@
    },
    /** 打开授权用户表弹窗 */
    openSelectUser() {
      this.$refs.select.show()
      // alert(this.queryParams.roleId)
      // alert(this.queryParams.archiveRecordsId )
      this.$refs.select.show(this.queryParams.archiveRecordsId)
    },
    /** 取消授权按钮操作 */
    cancelAuthUser(row) {
      const roleId = this.queryParams.roleId
      this.$modal.confirm('确认要取消该用户"' + row.userName + '"角色吗?').then(function() {
        return authUserCancel({ userId: row.userId, roleId: roleId })
      const recordId = this.queryParams.archiveRecordsId
      var userId = row.userId
      // alert(userId)
      // alert(this.queryParams.archiveRecordsId)
      // alert(row.sysUser.userName)
      this.$modal.confirm('确认要取消该用户"' + row.sysUser.userName + '"授权吗?').then(function() {
        return delArchiverecordstouserByReIdAndUid({  recordId: recordId, userId: userId   })
      }).then(() => {
        this.getList()
        this.$modal.msgSuccess("取消授权成功")
@@ -199,3 +223,10 @@
  }
}
</script>
<style scoped>
/* el-table 列数据为空自动显示 -- */
.className :empty::before{
   content:'--';
   color:gray;
}
</style>