| | |
| | | const result = await getVideoPoint({ current: 1, size: 1000 }); |
| | | this.relationVideoList = result.records; |
| | | |
| | | if (this.storeInfo) { |
| | | this.$set(this, "store", this.storeInfo); |
| | | if (this.storeInfo && this.isStorePage) { |
| | | this.store.relationVideo = this.store.videoPoint.name; |
| | | } |
| | | } |
| | | |
| | | if (!this.isView()) { |
| | | await this.getShopTypeList(); |
| | | } |
| | | |
| | | if (this.storeInfo) { |
| | | this.$set(this, "store", this.storeInfo); |
| | | if (this.storeInfo && this.isStorePage && this.store.videoPoint) { |
| | | this.store.relationVideo = this.store.videoPoint.name; |
| | | } |
| | | |
| | | const selectedStoreType = this.getSelectedStoreType(this.shopTypeList); |
| | | |
| | | this.$set(this.store, "type", [ |
| | | selectedStoreType.parentId, |
| | | selectedStoreType.id, |
| | | ]); |
| | | } |
| | | }, |
| | | |
| | |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | async created() { |
| | | if (this.storeInfo) { |
| | | this.$set(this, 'store', this.storeInfo); |
| | | const result = await getVideoPoint({ current: 1, size: 100 }); |
| | | this.relationVideoList = result.records; |
| | | if (this.storeInfo && this.isStorePage) { |
| | | this.store.relationVideo = this.store.videoPoint.name; |
| | | } |
| | | if (!this.isView()) { |
| | | await this.getShopTypeList(); |
| | | } |
| | | } |
| | | }, |
| | | |
| | | isView() { |
| | | return this.dialogType === "view"; |
| | |
| | | async getShopTypeList() { |
| | | let arr = await getCodeList("16"); |
| | | this.shopTypeList = this.createShopTypeTree(arr); |
| | | |
| | | if (this.dialogType === "update") { |
| | | const selectedStoreType = arr.find( |
| | | (item) => item.name === this.store.typeName |
| | | ); |
| | | this.$set(this.store, "type", [ |
| | | selectedStoreType.parentId, |
| | | selectedStoreType.id, |
| | | ]); |
| | | } |
| | | }, |
| | | |
| | | // 创建商铺类型树 |
| | |
| | | return treeRoot; |
| | | } |
| | | }, |
| | | getSelectedStoreType(shopTypeList) { |
| | | let selectedItem = null; |
| | | shopTypeList.forEach((item) => { |
| | | |
| | | if (item.name === this.store.typeName) { |
| | | selectedItem = item; |
| | | } else if (item.children) { |
| | | let selected = this.getSelectedStoreType(item.children); |
| | | if (selected) { |
| | | selectedItem = selected; |
| | | } |
| | | } |
| | | }); |
| | | return selectedItem; |
| | | }, |
| | | }, |
| | | |
| | | beforeDestroy() { |