fei
2025-11-15 e3cac4fb5b540b45d6ec1a53a534d08c03d7c174
src/views/archiveManager/arMAutoUser.vue
@@ -48,7 +48,7 @@
          v-hasPermi="['system:role:remove']"
        >批量取消授权</el-button>
      </el-col> -->
      <el-col :span="1.5">
    <!--  <el-col :span="1.5">
        <el-button
          type="warning"
          plain
@@ -56,7 +56,7 @@
          size="mini"
          @click="handleClose"
        >关闭</el-button>
      </el-col>
      </el-col> -->
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>
@@ -113,7 +113,7 @@
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"
import {listArchiverecordstouser,addArchiverecordstouser,delArchiverecordstouserByReIdAndUid,getArchiverecordstouser} from "@/api/system/archiverecordstouser"
export default {
  name: "AuthUser1",
  dicts: ['sys_normal_disable'],
@@ -148,26 +148,38 @@
  created() {
    const roleId = this.$route.params && this.$route.params.roleId
    const recordId = this.$route.params && this.$route.params.archiveRecordsId
    if (roleId&&recordId) {
    if (roleId && recordId) {
      this.queryParams.roleId = roleId
      this.queryParams.archiveRecordsId = recordId
      // 进行类型转换
      this.queryParams.archiveRecordsId = !isNaN(Number(recordId)) ? Number(recordId) : 0
      this.getList()
    }
  },
  methods: {
    // 修改 getList 方法
    /** 查询授权用户列表 */
    getList() {
      this.loading = true
      console.log(this.queryParams)
      console.log("------------")
      listArchiverecordstouser(this.queryParams).then(response => {
        console.log(response)
          this.userList = response.data.data
          this.total = response.data.total
          this.loading = false
        }
      )
      // 创建一个新对象,将字符串类型的archiveRecordsId转换为数字类型
      const params = {
        ...this.queryParams,
        archiveRecordsId: !isNaN(Number(this.queryParams.archiveRecordsId)) ?
                    Number(this.queryParams.archiveRecordsId) : 0
      }
      listArchiverecordstouser(params).then(response => {
        this.userList = response.data.data
        this.total = response.data.total
        this.loading = false
      })
    },
    /** 打开授权用户表弹窗 */
    openSelectUser() {
      // 确保传递给select组件的recordId是数字类型
      const recordId = !isNaN(Number(this.queryParams.archiveRecordsId)) ?
                    Number(this.queryParams.archiveRecordsId) : 0
      this.$refs.select.show(recordId)
    },
    // 返回按钮
    handleClose() {