|
@@ -45,7 +45,7 @@
|
|
* 支持的看板类型如下:'DustStatus'、'FireStatus'、'FileOverview'、'VentilationStatus'、'GasStatus'、'Summary'
|
|
* 支持的看板类型如下:'DustStatus'、'FireStatus'、'FileOverview'、'VentilationStatus'、'GasStatus'、'Summary'
|
|
*
|
|
*
|
|
*/
|
|
*/
|
|
- import { VNode, computed, h, onMounted, ref } from 'vue';
|
|
|
|
|
|
+ import { VNode, computed, h, onMounted, onUnmounted, ref } from 'vue';
|
|
import BaseCard from './components/BaseCard.vue';
|
|
import BaseCard from './components/BaseCard.vue';
|
|
import ArrowButton from './components/ArrowButton.vue';
|
|
import ArrowButton from './components/ArrowButton.vue';
|
|
// import { useRoute } from 'vue-router';
|
|
// import { useRoute } from 'vue-router';
|
|
@@ -59,8 +59,8 @@
|
|
import Summary from './components/Summary.vue';
|
|
import Summary from './components/Summary.vue';
|
|
import Warning from './components/Warning.vue';
|
|
import Warning from './components/Warning.vue';
|
|
import DuskRisk from './components/DustRisk.vue';
|
|
import DuskRisk from './components/DustRisk.vue';
|
|
- import _ from 'lodash-es';
|
|
|
|
import { useRouter } from 'vue-router';
|
|
import { useRouter } from 'vue-router';
|
|
|
|
+ import { DEFAULT_TEST_DATA } from './billboard.data';
|
|
// import mapComponent from './components/3Dmap/index.vue';
|
|
// import mapComponent from './components/3Dmap/index.vue';
|
|
|
|
|
|
const props = defineProps<{
|
|
const props = defineProps<{
|
|
@@ -86,8 +86,25 @@
|
|
|
|
|
|
const mainTitle = props.title || '国能神东一通三防管控平台';
|
|
const mainTitle = props.title || '国能神东一通三防管控平台';
|
|
|
|
|
|
- // 看板相关的基础配置
|
|
|
|
- const billboards = ref<(() => VNode)[]>([]);
|
|
|
|
|
|
+ // 看板相关的基础配置,默认数据是 8 项,填满页面
|
|
|
|
+ const billboards = ref<(() => VNode)[]>(
|
|
|
|
+ new Array(8).fill(DEFAULT_TEST_DATA).map((el) => {
|
|
|
|
+ return () =>
|
|
|
|
+ h(
|
|
|
|
+ BaseCard,
|
|
|
|
+ {
|
|
|
|
+ title: el.orgname || '/',
|
|
|
|
+ onOpen: () => openHandler(el.ip, el.orgcode),
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ default: () =>
|
|
|
|
+ h(componentMap[props.billboardType], {
|
|
|
|
+ data: JSON.parse(JSON.stringify(el)),
|
|
|
|
+ }),
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ })
|
|
|
|
+ );
|
|
|
|
|
|
function fetchBillboards() {
|
|
function fetchBillboards() {
|
|
getSummary().then((r) => {
|
|
getSummary().then((r) => {
|
|
@@ -138,6 +155,7 @@
|
|
FireStatus: '/fire/warn/home',
|
|
FireStatus: '/fire/warn/home',
|
|
Summary: '/monitorChannel/device-monitor/warningHistory',
|
|
Summary: '/monitorChannel/device-monitor/warningHistory',
|
|
};
|
|
};
|
|
|
|
+
|
|
// 页面跳转
|
|
// 页面跳转
|
|
function openHandler(ip: string, orgcode) {
|
|
function openHandler(ip: string, orgcode) {
|
|
// const url = `http://localhost:3100/login`;
|
|
// const url = `http://localhost:3100/login`;
|
|
@@ -155,13 +173,22 @@
|
|
router.push('/company/home');
|
|
router.push('/company/home');
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ let interval: any = null;
|
|
|
|
+
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
// if (route.query.type) {
|
|
// if (route.query.type) {
|
|
// billboardType.value = route.query.type as string;
|
|
// billboardType.value = route.query.type as string;
|
|
// showBtn.value = false;
|
|
// showBtn.value = false;
|
|
// }
|
|
// }
|
|
|
|
+ interval = setInterval(() => {
|
|
|
|
+ fetchBillboards();
|
|
|
|
+ }, 60000);
|
|
fetchBillboards();
|
|
fetchBillboards();
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ onUnmounted(() => {
|
|
|
|
+ clearInterval(interval);
|
|
|
|
+ });
|
|
</script>
|
|
</script>
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|
|
@font-face {
|
|
@font-face {
|