snow 2 年之前
父节点
当前提交
eb17df1766
共有 3 个文件被更改,包括 6 次插入2 次删除
  1. 0 0
      dist/static/js/app.js
  2. 4 2
      src/layout/components/company-select/index.vue
  3. 2 0
      src/store/modules/user.js

文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/app.js


+ 4 - 2
src/layout/components/company-select/index.vue

@@ -156,7 +156,8 @@ export default {
       this.state.loading = false
       this.params.page++
       const _list = this.isSupertube ? data.list : convertCompanylist(data.list)
-      this.$store.commit('user/setCompanylist', [...this.companylist, ..._list])
+      const __list = this.isSupertube && this.currentLevel === '1' ? _list.map(item => ({ ...item, code: item.relation_code })) : _list
+      this.$store.commit('user/setCompanylist', [...this.companylist, ...__list])
       return this.isSupertube ? data.list : convertCompanylist(data.list)
     },
 
@@ -239,8 +240,9 @@ export default {
       if (height + scrollTop >= scrollHeight && isAllowLoad) {
         const list = await this.loadMore()
         const _list = this.isSupertube ? list : convertCompanylist(list)
+        const __list = this.isSupertube && this.currentLevel === '1' ? _list.map(item => ({ ...item, code: item.relation_code })) : _list
         // 保存到全局
-        this.$store.commit(userStoreActions.setCompanyList, [...this.companylist, ..._list])
+        this.$store.commit(userStoreActions.setCompanyList, [...this.companylist, ...__list])
       }
     },
 

+ 2 - 0
src/store/modules/user.js

@@ -342,6 +342,8 @@ const actions = {
            let _companylist = []
            if(companyCode === 0) {
             _companylist = isSupertube ? companyData.list : convertCompanylist(companyData.list);
+            if(isSupertube) _companylist = _companylist.map(item => ({...item, code: item.relation_code}))
+            
             commit('setCompanylist', _companylist)
            }
 

部分文件因为文件数量过多而无法显示