提交一下

This commit is contained in:
aixianling
2024-06-21 18:02:03 +08:00
parent 2ca226af90
commit a55715f620
3 changed files with 137 additions and 14 deletions

View File

@@ -1,5 +1,4 @@
<script>
const {groupCodeList = ["20010073"]} = window?.$glob?.params || {}
export default {
name: "AppStoresTable",
label: "多店监控",
@@ -40,9 +39,9 @@ export default {
return {
height: '600px',
search: {
type: '1',
categoryId: '104',
hourNum: "12"
type: '',
categoryId: '',
hourNum: ""
},
stores: [],
cameras: [],
@@ -88,26 +87,36 @@ export default {
methods: {
getData() {
const {$http, $waitFor} = window
$waitFor($http).then(() => Promise.all([this.getCameras(), this.getStoreKeyGoods(), this.getCategorySales()])).then(() => {
this.stores = this.stores.map(({storeName, storeCode, storeCameraVOList = []}) => {
const keyGoods = this.storeKeyGoods.filter(e => e.storeCode == storeCode)
const categorySale = this.categorySales.filter(e => e.storeCode == storeCode)
return {storeCode, storeName, camera: storeCameraVOList.map(e => e.url), keyGoods, categorySale}
})
$waitFor($http).then(() => this.getStores())
.then(() => Promise.all([this.getCameras(), this.getStoreKeyGoods(), this.getCategorySales()]))
.then(() => {
this.stores = this.stores.map(({storeName, storeCode}) => {
const {storeCameraVOList} = this.cameras.find(e => e.storeCode == storeCode) || {}
const keyGoods = this.storeKeyGoods.filter(e => e.storeCode == storeCode) || []
const categorySale = this.categorySales.filter(e => e.storeCode == storeCode) || []
return {storeCode, storeName, camera: storeCameraVOList.map(e => e.url), keyGoods, categorySale}
})
})
},
getStores() {
return $http.get(`/data-boot/ca/screen/scStoreInfo/group/${this.search.groupCodeList}`).then(res => {
if (res?.data) {
this.stores = res.data || []
}
})
},
getCameras() {
return $http.post("/data-boot/la/screen/multipleStoreBoard/storeCamera", {
...this.search, groupCodeList
...this.search,
}).then(res => {
if (res?.data) {
this.stores = res.data?.records || []
this.cameras = res.data?.records || []
}
})
},
getStoreKeyGoods() {
return $http.post("/data-boot/la/screen/multipleStoreBoard/storeKeyGoods", {
...this.search, groupCodeList
...this.search,
}).then(res => {
if (res?.data) {
this.storeKeyGoods = res.data
@@ -116,7 +125,7 @@ export default {
},
getCategorySales() {
return $http.post("/data-boot/la/screen/multipleStoreBoard/categorySale", {
...this.search, groupCodeList
...this.search,
}).then(res => {
if (res?.data) {
this.categorySales = res.data