You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

113 lines
3.3 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!--
* @Author: xw
* @Date: 2021-10-08 15:56:35
* @LastEditTime: 2021-11-17 16:59:34
* @LastEditors: Please set LastEditors
* @Description: 实时事件
* @FilePath: /data-show/src/views/Index/realTimeEvent/index.vue
-->
<template>
<div class="rte-outter" v-loading="load" v-highly="0.83">
<v-label-div title="实时事件"></v-label-div>
<div class="rte-tb" v-highly>
<dv-scroll-board :config="config" :style="{ width: '100%', height: '100%' }" @click="handlerSs" />
</div>
<a-modal title="提示" :visible="visible" @ok="handleOk" @cancel="handleCancel">
<p>{{ ModalText }}</p>
</a-modal>
</div>
</template>
<script>
import { getEventsListH } from "@/api/home";
export default {
name: "real-time-event",
data() {
return {
load: false,
config: {},
darr: [],
visible: false,
ModalText: ""
};
},
created() {
this.getData();
},
methods: {
getData() {
this.load = true;
getEventsListH(this.getCommTime).then((res) => {
let arr = [];
let arr2 = [];
if (Array.isArray(res.data)) {
res.data.forEach((ele) => {
let a = [
`<span style="cursor: pointer;">${ele.events_title}</span>`,
ele.events_influence,
ele.events_brand,
];
let b = [
`<span style="cursor: pointer;">${ele.events_title}</span>`,
ele.events_influence,
ele.events_brand,
ele.events_id,
];
arr.push(a);
arr2.push(b);
});
this.darr = arr2;
this.config = {
headerBGC: "#0c203b",
oddRowBGC: "#173b6d",
evenRowBGC: "rgba(69, 149, 244, 0)",
columnWidth: [230],
rowNum: 5,
header: ["", "", ""],
data: arr,
};
}
this.load = false;
});
},
handleCancel() {
this.visible = false;
},
handleOk() {
this.$router.push('/login')
},
handlerSs(row) {
if (!this.getToken) {
this.visible = true;
this.ModalText = ""
return;
}
let ele = this.darr[row.rowIndex];
if (row.columnIndex === 0) {
let id = ele[3];
this.$router.push({
path: "/eventDEC",
query: { events_id: id },
});
}
},
},
};
</script>
<style lang="less" scoped>
.rte-outter {
width: 460px;
height: 312px;
border: 2px solid #0f2a4d;
display: flex;
flex-direction: column;
.rte-tb {
padding: 16px;
height: calc(100% - 48px);
overflow: hidden;
}
}
</style>