shish 4 лет назад
Родитель
Сommit
8104fbba6b
1 измененных файлов с 12 добавлено и 13 удалено
  1. 12 13
      ghsApp/src/components/module/shopSelect.vue

+ 12 - 13
ghsApp/src/components/module/shopSelect.vue

@@ -25,6 +25,7 @@
 <script>
 import DropdownList from "@/components/plugin/dropdown-list";
 import {mapGetters,mapState} from "vuex";
+import { shopAll } from '@/api/common'
 export default {
     name:'DorpdownSelect',
     components:{
@@ -61,23 +62,21 @@ export default {
         }
     },
     computed:{
-		...mapGetters(["getMyShopInfo"]),
-        ...mapState({
-			userShopAll:state=>state.user.userShopAll
-        }),
+		...mapGetters(["getMyShopInfo"])
     },
     mounted(){
-        this.shopList = this.userShopAll.map(i=>({...i,name:i.shopName}))
+        this.shopList = []
+        shopAll().then(res=>{
+            if(res.code == 1){
+                if (!this.$util.isEmpty(res.data)){
+					res.data.forEach((i) => {
+						this.shopList.push({id:i.id,name:i.shopName})
+					})
+                }
+            }
+        })
     },
 	watch:{
-        userShopAll (val) {
-			if(!this.$util.isEmpty(val)) {
-				this.shopList = val.map(i=>({
-					...i,
-					name:i.shopName
-				}));
-			}
-		}
 	},
     methods:{
         switchCut(){