3
tj
2025-05-22 14764dd7679369a650ad1d60be62aacc863755a1
mixin/mixin.js
@@ -35,7 +35,7 @@
   },
   data() {
      return {
         list: [],
         baseList: [],
         query: {},
         page: {
            size: 10,
@@ -45,7 +45,7 @@
         style: {
            'color': '#fff'
         },
         listApi: '',
         baseListApi: '',
         // regUserName: '用户-' + this.getRandomName(Math.floor(Math.random() * (6 - 2) + 3)),
         // regAvatarUrl: 'https://youzhen123.oss-cn-huhehaote.aliyuncs.com/WechatOwnerProperty/images/mrtx.png',
         regUserName: '',
@@ -107,11 +107,11 @@
         await this.getList(type)
      },
      async getList(type = 'get') {
         if (this.listApi) {
         if (this.baseListApi) {
            this.$message.showLoading()
            const {
               data
            } = await this.$http.request(type, this.listApi, {
            } = await this.$http.request(type, this.baseListApi, {
               params: {
                  ...this.query,
                  ...this.page
@@ -123,16 +123,16 @@
            })
            if (data) {
               if (data && Array.isArray(data)) {
                  this.list = data || []
                  this.baseList = data || []
                  this.page.total = data.length || 0
               } else {
                  if (this.page.current === 1) {
                     this.list = data.records || []
                     this.baseList = data.records || []
                  } else {
                     //根据id去重正常
                     var ids = []
                     var idsMap = {}
                     for (var item of this.list) {
                     for (var item of this.baseList) {
                        ids.push(item.id)
                        if (item.id) {
                           idsMap[item.id] = item
@@ -141,7 +141,7 @@
                     var hasnew = false
                     for (var item of data.records) {
                        if (ids.indexOf(item.id) < 0) {
                           this.list.push(item)
                           this.baseList.push(item)
                        } else {
                           //最好更新一下
                           idsMap[item.id] = {