123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381 |
- <template>
- <el-aside class="right">
- <div class="right_top">
- <div class="title" :style="{ background: `url(${frame})` }">
- <div class="text">物联设备统计</div>
- </div>
- <div class="content">
- <div class="logo">
- <span>{{ equipmentTotal.total }}</span>
- <img class="animate" :src="d1img" alt="" />
- <img :src="d12img" alt="" />
- <span><b>总数</b>(个)</span>
- </div>
- <div class="list">
- <div class="item_r">
- <img :src="d2img" alt="" />
- <div
- class="percent"
- style="display: flex; justify-content: space-between"
- >
- <a>在线</a> <a>{{ equipmentTotal.online }} <span>(个)</span> </a>
- </div>
- </div>
- <div class="item_r">
- <img :src="d3img" alt="" />
- <div
- class="percent"
- style="display: flex; justify-content: space-between"
- >
- <a>离线</a>
- <a>{{ equipmentTotal.underline }} <span>(个)</span> </a>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="right_center">
- <div class="title title-mt " :style="{ background: `url(${frame})` }">
- <div class="text">物联设备类型统计</div>
- </div>
- <div class="contentwrap">
- <div class="count" v-for="(item, index) in interDevice" :key="index">
- <CircleProgress
- :target-value="item.number"
- :color="item.color"
- text-position="top"
- >
- <img :src="deviceImg + item.icon + '.png'" alt="" />
-
- </CircleProgress>
- <div class="text">{{ item?.text }}</div>
-
- </div>
- </div>
- </div>
- <div class="right_bottom">
- <div class="title title-mt" :style="{ background: `url(${frame})` }">
- <div class="text">教室实时监控</div>
- </div>
- <div class="monitorContent">
- <el-carousel class="monitor">
- <el-carousel-item v-for="(item, index) in carouselData" :key="index">
- <p style="margin-left: 12px; margin-bottom: 3px; font-size: 14px">
- {{ item.activeMonitor?.title }}
- </p>
- <div class="interactclass">
- <div
- class="room"
- v-for="(item, index) in item.activeMonitor?.array"
- :key="index"
- >
- <span style="z-index: 99">{{ item?.title }}</span>
-
- <div
- v-if="item.src"
- style="width: 100%; height: 100%"
- @click="lookVideo(item)"
- >
- <div class="vue3VideoPlay">
- <vue3VideoPlay
- width="100%"
- height="8.8vh"
- style="object-fit: fill"
- :src="item.src"
- :type="videoData.type"
- :autoPlay="true"
- :control="false"
- :preload="meta"
- />
- </div>
- </div>
- </div>
- </div>
- <p
- style="
- margin-top: 18px;
- margin-left: 12px;
- margin-bottom: 3px;
- font-size: 14px;
- "
- >
- {{ item.activeMonitor?.title1 }}
- </p>
- <div class="interactclass">
- <div
- class="room"
- v-for="(item, index) in item.activeMonitor?.array1"
- :key="index"
- >
- <span style="z-index: 99">{{ item?.title }}</span>
-
- {{ item.src }}
- <div style="width: 100%; height: 100%" @click="lookVideo(item)">
- <div class="vue3VideoPlay">
- <vue3VideoPlay
- width="100%"
- height="9vh"
- style="object-fit: fill"
- :src="item.src"
- :type="videoData.type"
- :autoPlay="true"
- :control="false"
- :preload="meta"
- />
- </div>
- </div>
- </div>
- </div>
- </el-carousel-item>
- </el-carousel>
- </div>
- </div>
- </el-aside>
-
- <el-dialog
- class="videoDialog"
- v-model="videoDialog"
- :title="dialogTitle"
- width="62%"
- align="center"
- top="8%"
- style="z-index: 2015"
- >
- <videoPlay v-bind="videoData" />
- {{ videoData.src }}
- </el-dialog>
- </template>
- <script >
- import { reactive, onMounted, ref, nextTick, onBeforeUnmount } from "vue";
- import { ElCarousel, ElCarouselItem } from "element-plus";
- import "vue3-video-play/dist/style.css";
- import { videoPlay } from "vue3-video-play";
- import { getDevice, getVideoUrl, getvideo } from "../request/api";
- export default {
- name: "Histogram",
- components: { videoPlay, ElCarousel, ElCarouselItem },
- setup() {
-
- const videoData = reactive({
- width: "100%",
- height: "66.5vh",
- color: "red",
-
-
- src: "",
- type: "m3u8",
- muted: true,
- webFullScreen: false,
-
- autoPlay: true,
- loop: false,
- mirror: false,
- ligthOff: false,
- volume: 0.3,
- control: true,
- currentTime: 0,
- controlBtns: [
- "audioTrack",
- "quality",
- "speedRate",
- "volume",
- "setting",
- "pip",
- "pageFullScreen",
- "fullScreen",
- ],
- });
-
- const videoDialog = ref(false);
-
- const dialogTitle = ref("");
-
- const lookVideo = function (item) {
- videoDialog.value = true;
- dialogTitle.value = item.title;
- let copysrc = JSON.parse(JSON.stringify(item));
- console.log("sadi2", copysrc);
-
- videoData.src = copysrc.src;
- console.log("kankna222", videoData.src);
-
-
-
-
-
-
- };
-
- const onPlay = function () {
- console.log("播放视频");
- };
-
- let equipmentTotal = ref({});
-
- let interDevice = ref([]);
-
- let carouselData = ref([]);
-
- const getDeviceData = async () => {
-
-
-
-
-
-
- let res = await getDevice();
- console.log("s12312123", res);
- if (res.code !== 200) {
- ElMessage.error("数据请求出错");
- }
- let { category, monitor, status } = res.data;
-
- equipmentTotal.value = status;
-
- console.log("sadui12u31", category);
-
- interDevice.value = category;
-
- carouselData.value = monitor;
- carouselData.value.map((res) => {
- console.log("sadhi2", res.activeMonitor);
- res.activeMonitor?.array.map((array) => {
-
- getvideo({
- rtsp: array.src,
- }).then((res) => {
- console.log("sadnuq21", res.data);
- console.log("sadnuq2121", res.data.httpFlv);
-
- array.src = res.data.httpFlv;
- });
- });
- res.activeMonitor?.array1.map((array1) => {
- console.log("asdui1231", array1);
-
- getvideo({
- rtsp: array1.src,
- }).then((res) => {
- console.log("sadnuq212123s2", res.data);
-
- array1.src = res.data.httpFlv;
- });
- });
- });
-
- startdeviceInterval();
-
-
-
- };
-
- let deviceInterval = ref(null);
- const startdeviceInterval = () => {
-
- clearTimeout(deviceInterval.value);
- deviceInterval.value = setInterval(() => {
- getDeviceData();
- }, 5000);
- };
- onMounted(() => {
- getDeviceData();
- });
- onBeforeUnmount(() => {
-
- clearTimeout(deviceInterval.value);
- });
- const d1img = ref("./img/d1_1.png");
- const d12img = ref("./img/d1_2.png");
- const d2img = ref("./img/d2.png");
- const d3img = ref("./img/d3.png");
- const deviceImg = ref("./img/");
- const frame = ref("./img/frame.png");
- return {
- interDevice,
- videoData,
- onPlay,
- videoDialog,
- lookVideo,
- carouselData,
- equipmentTotal,
- d1img,
- d12img,
- d2img,
- d3img,
- deviceImg,
- dialogTitle,
- startdeviceInterval,
- frame
- };
- },
- };
- </script>
- <style scoped lang="scss">
- @import "../assets/css/right.scss";
- </style>
- <style lang="scss">
- .videoDialog {
- .el-dialog__header {
- height: 49px;
- line-height: 49px;
- padding: 0;
- background-color: #1b67d9;
- margin-right: 0;
- .el-dialog__title {
- color: #fff;
- font-family: Inter;
- }
- .el-dialog__headerbtn {
- top: 0px;
- i {
- color: #fff;
- font-size: 20px;
- font-weight: bold;
- }
- }
- }
- .el-dialog__body {
- padding: 0 !important;
- }
- }
- </style>
|