单点监控面板完成
This commit is contained in:
@@ -4,14 +4,13 @@ import router from './router'
|
|||||||
import './assets/main.css'
|
import './assets/main.css'
|
||||||
import ElementUI from 'element-ui';
|
import ElementUI from 'element-ui';
|
||||||
import 'element-ui/lib/theme-chalk/index.css';
|
import 'element-ui/lib/theme-chalk/index.css';
|
||||||
import axios from 'axios'
|
import inject from './utils/inject'
|
||||||
|
|
||||||
window.axios = axios
|
|
||||||
|
|
||||||
Vue.use(ElementUI);
|
Vue.use(ElementUI);
|
||||||
window.$glob = {}
|
|
||||||
|
|
||||||
import('./utils/inject.js').then(() => {
|
|
||||||
|
inject.then(() => {
|
||||||
new Vue({
|
new Vue({
|
||||||
router,
|
router,
|
||||||
render: (h) => h(App)
|
render: (h) => h(App)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
const fse = require("fs-extra")
|
// const fse = require("fs-extra")
|
||||||
const dicts = {
|
export const dicts = {
|
||||||
品类: [
|
品类: [
|
||||||
{label: "西点", value: "104"},
|
{label: "西点", value: "104"},
|
||||||
{label: "现烤", value: "108"},
|
{label: "现烤", value: "108"},
|
||||||
@@ -11,4 +11,4 @@ const dicts = {
|
|||||||
{label: "特定日期", value: "3"},
|
{label: "特定日期", value: "3"},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
fse.outputJSONSync("./dicts.json", dicts)
|
// fse.outputJSONSync("./dicts.json", dicts)
|
||||||
|
|||||||
@@ -20,18 +20,6 @@ const init = () => new Promise(resolve => {
|
|||||||
config.headers['h-token'] = $glob.token
|
config.headers['h-token'] = $glob.token
|
||||||
return config
|
return config
|
||||||
}
|
}
|
||||||
window.$waitFor = (target, t = 500) => new Promise(resolve => {
|
|
||||||
const interval = setInterval(() => {
|
|
||||||
if (target) {
|
|
||||||
clearInterval(interval)
|
|
||||||
resolve(target)
|
|
||||||
}
|
|
||||||
}, t)
|
|
||||||
if (target) {
|
|
||||||
clearInterval(interval)
|
|
||||||
resolve(target)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
http.interceptors.request.use(async config => {
|
http.interceptors.request.use(async config => {
|
||||||
await $waitFor(!getAuthing)
|
await $waitFor(!getAuthing)
|
||||||
if (!$glob.token && !getAuthing) {
|
if (!$glob.token && !getAuthing) {
|
||||||
|
|||||||
@@ -1,7 +1,24 @@
|
|||||||
|
import {dicts} from "@/utils/dicts";
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
|
window.axios = axios
|
||||||
const KENGEE_CDN_BASE = "http://10.0.97.209/presource/datascreen/"
|
const KENGEE_CDN_BASE = "http://10.0.97.209/presource/datascreen/"
|
||||||
const libs = [`${KENGEE_CDN_BASE}/js/pinyin.min.js`]
|
const libs = [`${KENGEE_CDN_BASE}/js/pinyin.min.js`]
|
||||||
|
window.$glob = {}
|
||||||
Promise.all([
|
window.$dicts = dicts
|
||||||
|
window.$waitFor = (target, t = 500) => new Promise(resolve => {
|
||||||
|
const interval = setInterval(() => {
|
||||||
|
if (target) {
|
||||||
|
clearInterval(interval)
|
||||||
|
resolve(target)
|
||||||
|
}
|
||||||
|
}, t)
|
||||||
|
if (target) {
|
||||||
|
clearInterval(interval)
|
||||||
|
resolve(target)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
export default Promise.all([
|
||||||
import("./fetch"),
|
import("./fetch"),
|
||||||
...libs.map(url => new Promise(resolve => {
|
...libs.map(url => new Promise(resolve => {
|
||||||
const script = document.createElement("script")
|
const script = document.createElement("script")
|
||||||
|
|||||||
@@ -40,10 +40,10 @@ export default {
|
|||||||
height: '600px',
|
height: '600px',
|
||||||
search: {
|
search: {
|
||||||
type: '1',
|
type: '1',
|
||||||
categoryId: '',
|
storeCode: 'K230QTD081',
|
||||||
hourNum: ""
|
hourNum: "18"
|
||||||
},
|
},
|
||||||
stores: [],
|
list: [],
|
||||||
cameras: [],
|
cameras: [],
|
||||||
storeKeyGoods: [],
|
storeKeyGoods: [],
|
||||||
categorySales: [],
|
categorySales: [],
|
||||||
@@ -67,56 +67,35 @@ export default {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
refs: v => v.$parent.getItemRefs(),
|
|
||||||
storeList: v => {
|
|
||||||
const list = []
|
|
||||||
let group = []
|
|
||||||
for (const e of v.stores) {
|
|
||||||
if (group.length < 4) {
|
|
||||||
group.push(e)
|
|
||||||
} else {
|
|
||||||
list.push(group.reverse())
|
|
||||||
group = [e]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (group.length > 0) list.push(group.reverse())
|
|
||||||
return list
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
getData() {
|
getData() {
|
||||||
const {$http, $waitFor} = window
|
const {$waitFor, $http} = window
|
||||||
console.log("筛选条件:", this.search)
|
console.log("筛选条件:", this.search)
|
||||||
$waitFor($http).then(() => this.getStores())
|
$waitFor($http).then(() => Promise.all([this.getCameras(), this.getStoreKeyGoods(), this.getCategorySales()]))
|
||||||
.then(() => Promise.all([this.getCameras(), this.getStoreKeyGoods(), this.getCategorySales()]))
|
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.stores = this.stores?.map(storeCode => {
|
this.list = [
|
||||||
const {storeCameraVOList = [], storeName} = this.cameras.find(e => e.storeCode == storeCode) || {}
|
{label: "西点柜", value: "104"},
|
||||||
const keyGoods = this.storeKeyGoods.filter(e => e.storeCode == storeCode) || []
|
{label: "现烤柜", value: "108"},
|
||||||
const categorySale = this.categorySales.filter(e => e.storeCode == storeCode) || []
|
{label: "蛋糕柜", value: "109"},
|
||||||
return {storeCode, storeName, camera: storeCameraVOList.map(e => e.cameraUrl), keyGoods, categorySale}
|
].map(({label, value: categoryId}) => {
|
||||||
|
const {storeCameraVOList = []} = this.cameras.find(e => e.storeCode == this.search.storeCode) || {}
|
||||||
|
const keyGoods = this.storeKeyGoods.filter(e => e.categoryId == categoryId) || []
|
||||||
|
const categorySale = this.categorySales.filter(e => e.secondCategoryId == categoryId) || []
|
||||||
|
return {categoryId, label, camera: storeCameraVOList.filter(e => e.cameraType == categoryId).map(e => e.cameraUrl), 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() {
|
getCameras() {
|
||||||
return $http.post("/data-boot/la/screen/multipleStoreBoard/storeCamera", {
|
return $http.post("/data-boot/la/screen/multipleStoreBoard/storeCamera", {
|
||||||
...this.search,
|
...this.search,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res?.data) {
|
if (res?.data) {
|
||||||
this.cameras = res.data?.records || []
|
this.cameras = res.data?.records?.filter(e => e.storeCameraVOList?.length > 0) || []
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getStoreKeyGoods() {
|
getStoreKeyGoods() {
|
||||||
return $http.post("/data-boot/la/screen/multipleStoreBoard/storeKeyGoods", {
|
return $http.post("/data-boot/la/screen/singleStoreBoard/singStoreKeyGoodsSale", {
|
||||||
...this.search,
|
...this.search,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res?.data) {
|
if (res?.data) {
|
||||||
@@ -125,7 +104,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
getCategorySales() {
|
getCategorySales() {
|
||||||
return $http.post("/data-boot/la/screen/multipleStoreBoard/categorySale", {
|
return $http.post("/data-boot/la/screen/singleStoreBoard/singStoreCategorySale", {
|
||||||
...this.search,
|
...this.search,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res?.data) {
|
if (res?.data) {
|
||||||
@@ -133,12 +112,6 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
gotoDetail(store) {
|
|
||||||
$glob.query = {storeCode: store.storeCode}
|
|
||||||
const sid = "9f299712-5549-413b-a93b-7c3e3b5bfadb"
|
|
||||||
$glob.group = sid
|
|
||||||
this.refs["ff6a5ca5-8cca-4fad-8058-a2ab2388236c"].$refs.main.groupId = sid
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.height = `${this.$el.clientHeight}px`
|
this.height = `${this.$el.clientHeight}px`
|
||||||
@@ -150,10 +123,10 @@ export default {
|
|||||||
<template>
|
<template>
|
||||||
<section class="AppCarouselList">
|
<section class="AppCarouselList">
|
||||||
<div class="layout">
|
<div class="layout">
|
||||||
<div class="store" v-for="store in storeList" :key="store.storeCode">
|
<div class="store" v-for="store in list" :key="store.storeCode">
|
||||||
<div class="header" v-text="store.storeName" @click="gotoDetail(store)"/>
|
<div class="header" v-text="store.label"/>
|
||||||
<el-carousel indicator-position="none" height="250px">
|
<el-carousel indicator-position="none" height="250px">
|
||||||
<el-carousel-item v-for="(url,j) in store.camera" :key="[i,j].join('_')">
|
<el-carousel-item v-for="(url,i) in store.camera" :key="i">
|
||||||
<hls-player :url="url"/>
|
<hls-player :url="url"/>
|
||||||
</el-carousel-item>
|
</el-carousel-item>
|
||||||
</el-carousel>
|
</el-carousel>
|
||||||
|
|||||||
Reference in New Issue
Block a user