New file |
| | |
| | | import http from '@/http' |
| | | |
| | | export default { |
| | | // 检测仪总体情况报表 |
| | | findDataDetectorDailyStats: (params) => { |
| | | return http.get('/sccg/smoke/statistics/listDataDetectorDailyStats', params); |
| | | }, |
| | | // 油烟减排统计 |
| | | findDetectorDaily: (params) => { |
| | | return http.get('/sccg/smoke/statistics/listDetectorDaily', params); |
| | | }, |
| | | |
| | | // 监测报警统计&运维情况报表 |
| | | findCurAlarmList: (params) => { |
| | | return http.get('/sccg/smoke/statistics/listCurAlarm', params); |
| | | } |
| | | |
| | | } |
| | |
| | | </el-table-column> |
| | | <el-table-column prop="eventSource" label="事件类型" min-width="8"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.row.alarmName }}</span> |
| | | <span>{{ scope.row.alarmName||scope.row.grade }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="alarmTime" label="报警时间" min-width="15"> |
| | |
| | | list.forEach((e) => { |
| | | e.AcquitAtStr = this.dateFormat( |
| | | "YYYY-mm-dd HH:MM", |
| | | new Date(e.AcquitAt) |
| | | new Date(e.AcquitAt*1000) |
| | | ); |
| | | e.MsgTypeStr = this.MsgTypeStr(e.MsgType); |
| | | }); |
New file |
| | |
| | | <template> |
| | | <div class="study-judge"> |
| | | <div class="study-judge-main"> |
| | | <div class="sjm-content"> |
| | | <div class="sjm-content-left"> |
| | | <div class="sjm-header-left"> |
| | | <span class="moni-name" |
| | | >监控点位名称: {{ currentEvent.Addr }} |
| | | </span> |
| | | <div style="color: #333; margin-top: 60px"> |
| | | 消息内容 |
| | | </div> |
| | | <div style="color: #333; width: 300px"> |
| | | {{ currentEvent.Content }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="sjm-content-center"> |
| | | <div class="map"> |
| | | <MyMap :point="point" :zoom="zoom" :mark="mark"></MyMap> |
| | | </div> |
| | | </div> |
| | | <div class="sjm-content-right"> |
| | | <div class="card-box"> |
| | | <el-form |
| | | ref="currentEvent" |
| | | label-width="120px" |
| | | :model="eventInfoData" |
| | | :rules="rules" |
| | | > |
| | | <el-form-item label="关联店铺" prop="store"> |
| | | <el-select |
| | | v-model="eventInfoData.store" |
| | | clearable |
| | | @change="selectStoreChange" |
| | | placeholder="请选择关联店铺" |
| | | > |
| | | <el-option |
| | | v-for="store in storeList" |
| | | :value="store.id" |
| | | :label="store.storeName" |
| | | :key="store.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item |
| | | v-if="eventInfoData.store" |
| | | label="店铺得分:" |
| | | > |
| | | <span>{{ |
| | | selectStoreChange(eventInfoData.store) |
| | | .storeScore |
| | | }}</span> |
| | | </el-form-item> |
| | | <el-form-item label="处理意见:" prop="state"> |
| | | <el-radio-group v-model="eventInfoData.state"> |
| | | <el-radio |
| | | :label="item.id" |
| | | v-for="item in stateList" |
| | | :key="item.id" |
| | | >{{ item.label }}</el-radio |
| | | > |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="大类名称:" prop="categoryId"> |
| | | <el-select |
| | | v-model="eventInfoData.categoryId" |
| | | placeholder="请选择大类名称" |
| | | @change="categoryChange" |
| | | > |
| | | <el-option |
| | | v-for="category in categoryOptions" |
| | | :key="category.id" |
| | | :value="category.id" |
| | | :label="category.name" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="小类名称:" prop="typeId"> |
| | | <el-select |
| | | v-model="eventInfoData.typeId" |
| | | placeholder="请选择小类名称" |
| | | > |
| | | <el-option |
| | | v-for="type in typeOptions" |
| | | :key="type.id" |
| | | :value="type.id" |
| | | :label="type.name" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="备注:" prop="description"> |
| | | <el-input |
| | | type="textarea" |
| | | :rows="5" |
| | | v-model="eventInfoData.description" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button |
| | | :disabled="currentPage === 1" |
| | | @click="pageChange('prev')" |
| | | >上一条</el-button |
| | | > |
| | | <el-button @click.native.prevent="handleConfirm" |
| | | >确认</el-button |
| | | > |
| | | <el-button @click="pageChange('next')" |
| | | >下一条</el-button |
| | | > |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import basecase from "@/api/operate/basecase"; |
| | | import baseInfo from "@/api/baseInfo"; |
| | | import { FILE_ORIGINAL_URL } from "@/utils"; |
| | | import { getStoreInfoList } from "@/api/operate/storeManagement"; |
| | | import MyDispatch from "@/components/dispatch"; |
| | | import MyMap from "@/components/map/leafletMap.vue"; |
| | | |
| | | export default { |
| | | components: { MyDispatch, MyMap }, |
| | | created() { |
| | | this.currentEvent = this.info; |
| | | this.initEventParams(); |
| | | |
| | | getStoreInfoList({ current: 1, size: 100 }) |
| | | .then(({ list }) => { |
| | | this.storeList = list; |
| | | }) |
| | | .catch((err) => { |
| | | this.$message.error(err); |
| | | }); |
| | | |
| | | baseInfo |
| | | .getCategoryList() |
| | | .then((res) => { |
| | | this.categoryOptions = res; |
| | | }) |
| | | .catch((err) => this.$message.error(err)); |
| | | |
| | | baseInfo |
| | | .getTypeList() |
| | | .then((res) => { |
| | | this.typeList = res; |
| | | }) |
| | | .catch((err) => this.$message.error(err)); |
| | | }, |
| | | data() { |
| | | return { |
| | | seachData: {}, |
| | | isShowTable: false, |
| | | timer: null, |
| | | countData: { |
| | | study: 0, |
| | | review: 0, |
| | | register: 0, |
| | | }, |
| | | currentEvent: {}, |
| | | stateList: [ |
| | | { |
| | | id: 10, |
| | | label: "上报", |
| | | }, |
| | | { |
| | | id: 6, |
| | | label: "调度", |
| | | }, |
| | | { |
| | | id: 3, |
| | | label: "再学习", |
| | | }, |
| | | { |
| | | id: 4, |
| | | label: "暂不处理", |
| | | }, |
| | | ], |
| | | eventInfoData: {}, |
| | | rules: { |
| | | state: [ |
| | | { |
| | | required: true, |
| | | trigger: ["blur"], |
| | | message: "处理意见不能为空", |
| | | }, |
| | | ], |
| | | categoryId: [ |
| | | { |
| | | required: true, |
| | | trigger: ["blur"], |
| | | message: "大类名称不能为空", |
| | | }, |
| | | ], |
| | | typeId: [ |
| | | { |
| | | required: true, |
| | | trigger: ["blur"], |
| | | message: "小类名称不能为空", |
| | | }, |
| | | ], |
| | | }, |
| | | imageList: [], |
| | | currentPage: 1, |
| | | categoryOptions: [], |
| | | typeOptions: [], |
| | | storeList: [], |
| | | typeList: [], |
| | | isShowDialog: false, |
| | | dialogCreate: false, |
| | | cutPosX: 10, |
| | | cutPosY: 10, |
| | | cutWidth: 100, |
| | | cutHeight: 100, |
| | | crtPosX: 0, |
| | | crtPosY: 0, |
| | | crtWidth: 1000, |
| | | crtHeight: 600, |
| | | domId: "dom1", |
| | | ctrl: "ctrl1", |
| | | playType: "live", |
| | | point: null, |
| | | mark: null, |
| | | zoom: null, |
| | | }; |
| | | }, |
| | | methods: { |
| | | pageChange(type) { |
| | | if (type === "next") { |
| | | this.currentPage += 1; |
| | | } else { |
| | | this.currentPage -= 1; |
| | | } |
| | | this.getInspectionData(); |
| | | }, |
| | | |
| | | getInspectionData() { |
| | | let data = { |
| | | current: this.currentPage, |
| | | pageSize: 1, |
| | | videoId: this.seachData.videoId, |
| | | }; |
| | | if (this.seachData.alarmTime) { |
| | | data.beginTime = this.seachData.alarmTime[0]; |
| | | data.endTime = this.seachData.alarmTime[1]; |
| | | } |
| | | if (this.seachData.gradeId) { |
| | | data.gradeId = this.seachData.gradeId[1]; |
| | | } |
| | | basecase |
| | | .getInspectionData(data) |
| | | .then(({ records, total }) => { |
| | | this.countData.review = total; |
| | | if (records.length > 0) { |
| | | this.currentEvent = records[0]; |
| | | this.loadData(); |
| | | } else { |
| | | this.currentEvent = {}; |
| | | this.$message("当前查询条件无数据"); |
| | | } |
| | | }) |
| | | .catch((err) => this.$message.error(err)); |
| | | }, |
| | | loadData() { |
| | | this.point = { |
| | | x: this.currentEvent.longitude, |
| | | y: this.currentEvent.latitude, |
| | | }; |
| | | this.zoom = 18; |
| | | this.mark = { title: this.currentEvent.address }; |
| | | if (this.currentEvent?.picData) { |
| | | this.imageList = this.currentEvent.picData |
| | | .split(",") |
| | | .map((item) => `${FILE_ORIGINAL_URL}sccg/API/img?fileUrl=${item}`); |
| | | // this.imageList =['https://www.shutterstock.com/image-photo/grandmother-holding-grandson-her-lap-600w-1954531321.jpg','https://www.shutterstock.com/image-photo/grandmother-holding-grandson-her-lap-600w-1954531321.jpg'] |
| | | } |
| | | if (this.currentEvent?.alarmTime || this.currentEvent?.currentAlarmTime) { |
| | | const { alarmTime, currentAlarmTime } = this.currentEvent; |
| | | const continueAlarmTime = |
| | | new Date().getTime() - |
| | | (currentAlarmTime |
| | | ? new Date(currentAlarmTime).getTime() |
| | | : new Date(alarmTime).getTime()); |
| | | const CONTINUE_DAY = continueAlarmTime / 1000 / 60 / 60 / 24; |
| | | const CONTINUE_HOURS = (CONTINUE_DAY - parseInt(CONTINUE_DAY)) * 24; |
| | | this.currentEvent.conntinueTime = `${parseInt( |
| | | CONTINUE_DAY |
| | | )}天${parseInt(CONTINUE_HOURS)}小时`; |
| | | } |
| | | }, |
| | | // 确认点击事件 |
| | | handleConfirm() { |
| | | debugger |
| | | this.$refs.currentEvent.validate((flag) => { |
| | | if (flag) { |
| | | this.eventInfoData.baseId = this.currentEvent.baseId; |
| | | |
| | | // 调度 |
| | | if (this.eventInfoData.state === 6) { |
| | | this.isShowDialog = true; |
| | | } else { |
| | | this.confirmInspection(); |
| | | } |
| | | } else { |
| | | this.$message.warning("请检查必填项"); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | initEventParams() { |
| | | this.eventInfoData = { |
| | | baseId: null, |
| | | store: null, |
| | | state: null, |
| | | categoryId: null, |
| | | typeId: null, |
| | | carNumber: null, |
| | | description: null, |
| | | linkShop: 0, |
| | | shopName: null, |
| | | }; |
| | | }, |
| | | |
| | | categoryChange(id) { |
| | | this.typeOptions = this.typeList.filter((type) => type.parentId === id); |
| | | }, |
| | | |
| | | confirmInspection(data) { |
| | | const eventParams = Object.assign({}, this.eventInfoData); |
| | | delete eventParams.store; |
| | | basecase |
| | | .confirmInspection({ ...eventParams, ...data }) |
| | | .then(() => { |
| | | this.$message.success("操作成功"); |
| | | this.getInspectionData(); |
| | | this.initEventParams(); |
| | | }) |
| | | .catch((err) => this.$message.error(err)); |
| | | }, |
| | | |
| | | getInspectionData() { |
| | | let data = { |
| | | current: this.currentPage, |
| | | pageSize: 1, |
| | | videoId: this.seachData.videoId, |
| | | }; |
| | | if (this.seachData.alarmTime) { |
| | | data.beginTime = this.seachData.alarmTime[0]; |
| | | data.endTime = this.seachData.alarmTime[1]; |
| | | } |
| | | if (this.seachData.gradeId) { |
| | | data.gradeId = this.seachData.gradeId[1]; |
| | | } |
| | | basecase |
| | | .getInspectionData(data) |
| | | .then(({ records, total }) => { |
| | | this.countData.review = total; |
| | | if (records.length > 0) { |
| | | this.currentEvent = records[0]; |
| | | this.loadData(); |
| | | } else { |
| | | this.currentEvent = {}; |
| | | this.$message("当前查询条件无数据"); |
| | | } |
| | | }) |
| | | .catch((err) => this.$message.error(err)); |
| | | }, |
| | | closeDialog() { |
| | | this.isShowDialog = false; |
| | | }, |
| | | |
| | | selectStoreChange(id) { |
| | | if (id === "") { |
| | | this.eventInfoData.shopName = null; |
| | | this.eventInfoData.linkShop = 0; |
| | | this.eventInfoData.store = null; |
| | | return; |
| | | } |
| | | const selectedStore = this.storeList.find((store) => store.id === id); |
| | | this.eventInfoData.shopName = selectedStore.id; |
| | | this.eventInfoData.linkShop = 1; |
| | | return selectedStore; |
| | | }, |
| | | login() { |
| | | // 调用登录接口 |
| | | this.ws.detectConnectQt().then((res) => { |
| | | if (res) { |
| | | // 连接客户端成功 |
| | | this.ws.login({ |
| | | loginIp: "172.28.194.180", |
| | | loginPort: "7902", |
| | | userName: "suichang", |
| | | userPwd: "a12345677", |
| | | https: 1, |
| | | }); |
| | | this.$message.info("登录中..."); |
| | | this.ws.on("loginState", (res) => { |
| | | this.isLogin = res; |
| | | if (res) { |
| | | this.$message.success("登录成功"); |
| | | this.activePanel = "key2"; |
| | | } else { |
| | | this.$message.info("登录失败"); |
| | | } |
| | | }); |
| | | } else { |
| | | // 连接客户端失败 |
| | | this.$message.info("请重新安装客户端"); |
| | | } |
| | | }); |
| | | }, |
| | | logout() { |
| | | // 调用登出接口 |
| | | this.ws.logout({ |
| | | loginIp: this.loginIp, |
| | | }); |
| | | }, |
| | | createVideo(item, ctrlType) { |
| | | this.playType = ctrlType; |
| | | const DHWsInstance = DHWs.getInstance(); |
| | | this.ws = DHWsInstance; |
| | | console.log(this.ws); |
| | | this.login(); |
| | | // 调用创建控件接口 |
| | | // if (!this.isLogin) { |
| | | // this.$message.info('正在登陆客户端,请稍等......'); |
| | | // return false; |
| | | // } |
| | | this.dialogCreate = true; |
| | | setTimeout(() => { |
| | | let _this = this; |
| | | const params = [ |
| | | { |
| | | // ctrlType: "realMonitorUI", |
| | | ctrlType: "playerWin", |
| | | ctrlCode: this.ctrl, |
| | | ctrlProperty: { |
| | | displayMode: ctrlType == "playback" ? 2 : 1, |
| | | splitNum: 1, |
| | | channelList: [{ channelId: item.videoCode }], |
| | | }, |
| | | visible: true, |
| | | domId: this.domId, |
| | | }, |
| | | ]; |
| | | this.setPos(); |
| | | |
| | | // _this.ws.on("createCtrlResult", (res) => { |
| | | // console.warn(res); |
| | | // }); |
| | | |
| | | _this.ws |
| | | .createCtrl(params) |
| | | .then((res) => { |
| | | this.$message.success("创建成功"); |
| | | console.log("res", res); |
| | | }) |
| | | .catch((e) => { |
| | | console.log("error;", e); |
| | | }); |
| | | |
| | | if (ctrlType == "playback") { |
| | | const end = new Date(); |
| | | const start = new Date(); |
| | | start.setTime(start.getTime() - 3600 * 1000 * 24 * 1); |
| | | |
| | | let beginTime = _this.formatDate(start); |
| | | let endTime = _this.formatDate(end); |
| | | const params = [ |
| | | { |
| | | ctrlCode: this.ctrl, |
| | | array: [ |
| | | { |
| | | beginTime: beginTime, |
| | | endTime: endTime, |
| | | channelId: item.videoCode, |
| | | }, |
| | | ], |
| | | }, |
| | | ]; |
| | | _this.ws.openCtrlRecord(params); |
| | | } |
| | | }, 1000); |
| | | }, |
| | | destroy() { |
| | | // 调用销毁控件接口 |
| | | if (!this.isLogin) { |
| | | this.$Message.info("正在登陆客户端,请稍等......"); |
| | | return false; |
| | | } |
| | | const ctrls = this.ws.ctrls.map((i) => { |
| | | if (i.ctrlCode === this.ctrl) { |
| | | return i.ctrlCode; |
| | | } |
| | | }); |
| | | this.ws.destroyCtrl(ctrls); |
| | | }, |
| | | setPos() { |
| | | let target = document.getElementById(this.domId); |
| | | console.log(target, "target"); |
| | | target.style.right = `${this.crtPosX}px`; |
| | | target.style.top = `${this.crtPosY}px`; |
| | | target.style.width = `${this.crtWidth}px`; |
| | | target.style.height = `${this.crtHeight}px`; |
| | | if (document.createEvent) { |
| | | var event = document.createEvent("HTMLEvents"); |
| | | event.initEvent("resize", true, true); |
| | | window.dispatchEvent(event); |
| | | } else if (document.createEventObject) { |
| | | window.fireEvent("onresize"); |
| | | } |
| | | }, |
| | | |
| | | // 时间戳转 yyyy-MM-dd HH:mm:ss |
| | | formatDate(inputTime) { |
| | | var date = new Date(inputTime); |
| | | var y = date.getFullYear(); |
| | | var m = date.getMonth() + 1; |
| | | m = m < 10 ? "0" + m : m; |
| | | var d = date.getDate(); |
| | | d = d < 10 ? "0" + d : d; |
| | | var h = date.getHours(); |
| | | h = h < 10 ? "0" + h : h; |
| | | var minute = date.getMinutes(); |
| | | var second = date.getSeconds(); |
| | | minute = minute < 10 ? "0" + minute : minute; |
| | | second = second < 10 ? "0" + second : second; |
| | | return y + "-" + m + "-" + d + " " + h + ":" + minute + ":" + second; |
| | | }, |
| | | }, |
| | | beforeDestroy() { |
| | | clearInterval(this.timer); |
| | | this.timer = null; |
| | | }, |
| | | |
| | | props: ["info"], |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .study-judge { |
| | | text-align: left; |
| | | color: #4b9bb7; |
| | | padding: 10px 20px; |
| | | |
| | | .study-judge-header { |
| | | line-height: 3vh; |
| | | } |
| | | |
| | | .study-judge-main { |
| | | .sjm-header { |
| | | line-height: 8vh; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | |
| | | .sjm-header-left { |
| | | flex: 1; |
| | | display: flex; |
| | | justify-content: flex-start; |
| | | |
| | | .moni-area { |
| | | margin-left: 4vw; |
| | | } |
| | | } |
| | | |
| | | .sjm-header-right { |
| | | flex: 1; |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | |
| | | .el-button { |
| | | padding: 0 1vw; |
| | | height: 4vh; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .sjm-content { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | |
| | | .sjm-content-left { |
| | | line-height: 4.8vh; |
| | | .count-data-span { |
| | | cursor: pointer; |
| | | color: #66b1ff; |
| | | } |
| | | .left-form > ::v-deep.el-form-item__label { |
| | | font-size: 16px !important; |
| | | } |
| | | .img-item { |
| | | display: flex; |
| | | flex-direction: column; |
| | | img { |
| | | width: 15vw; |
| | | height: 20vh; |
| | | } |
| | | } |
| | | |
| | | .img-item + .img-item { |
| | | margin-top: 2vh; |
| | | } |
| | | } |
| | | .sjm-content-center { |
| | | width: calc(100% - 920px); |
| | | } |
| | | .sjm-content-right { |
| | | .card-box { |
| | | .but-live { |
| | | padding-left: 48px; |
| | | line-height: 4.8vh; |
| | | } |
| | | .card-header { |
| | | padding-left: 48px; |
| | | line-height: 4.8vh; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .el-form { |
| | | ::v-deep .el-form-item { |
| | | margin-bottom: 15px; |
| | | } |
| | | |
| | | ::v-deep .el-form-item__label { |
| | | color: #4b9bb7; |
| | | } |
| | | } |
| | | |
| | | ::v-deep .el-radio__label { |
| | | color: #4b9bb7; |
| | | } |
| | | } |
| | | |
| | | .map { |
| | | height: 100%; |
| | | min-width: 460px; |
| | | } |
| | | .header { |
| | | line-height: normal; |
| | | } |
| | | </style> |
New file |
| | |
| | | <template> |
| | | <div class="header"> |
| | | <el-form :inline="true" :model="seachData" class="demo-form-inline"> |
| | | |
| | | <el-form-item label=""> |
| | | <el-select |
| | | style="width: 120px" |
| | | v-model="seachData.msgType" |
| | | placeholder="消息类型" |
| | | > |
| | | <el-option |
| | | v-for="item in msgTypeOptions" |
| | | :key="item.label" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label=""> |
| | | <el-date-picker |
| | | v-model="seachData.alarmTime" |
| | | type="daterange" |
| | | align="right" |
| | | unlink-panels |
| | | range-separator="至" |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期" |
| | | :picker-options="pickerOptions" |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="getList">刷新</el-button> |
| | | <el-button type="primary" @click="resetAll">重置</el-button> |
| | | |
| | | <el-button type="primary" @click="exportTableData" |
| | | >导出</el-button |
| | | > |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import realTimeApi from "@/api/smoke/realTime"; |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | msgTypeOptions: [ |
| | | { |
| | | label: "超标", |
| | | value: "ExceedStandard", |
| | | }, |
| | | { |
| | | label: "异常离线", |
| | | value: "AbnormalOffline", |
| | | } |
| | | ], |
| | | |
| | | seachData: {}, |
| | | pickerOptions: { |
| | | shortcuts: [ |
| | | { |
| | | text: "最近一周", |
| | | onClick(picker) { |
| | | const end = new Date(); |
| | | const start = new Date(); |
| | | start.setTime(start.getTime() - 3600 * 1000 * 24 * 7); |
| | | picker.$emit("pick", [start, end]); |
| | | }, |
| | | }, |
| | | { |
| | | text: "最近一个月", |
| | | onClick(picker) { |
| | | const end = new Date(); |
| | | const start = new Date(); |
| | | start.setTime(start.getTime() - 3600 * 1000 * 24 * 30); |
| | | picker.$emit("pick", [start, end]); |
| | | }, |
| | | }, |
| | | { |
| | | text: "最近三个月", |
| | | onClick(picker) { |
| | | const end = new Date(); |
| | | const start = new Date(); |
| | | start.setTime(start.getTime() - 3600 * 1000 * 24 * 90); |
| | | picker.$emit("pick", [start, end]); |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | | }; |
| | | }, |
| | | created() { }, |
| | | mounted() { |
| | | }, |
| | | methods: { |
| | | |
| | | resetAll() { |
| | | this.seachData = {}; |
| | | this.$emit("getList", { seachData: this.seachData }); |
| | | }, |
| | | getList() { |
| | | this.$emit("getList", { seachData: this.seachData }); |
| | | }, |
| | | exportTableData() { |
| | | this.$emit("exportTable", { seachData: this.seachData }); |
| | | } |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .header { |
| | | line-height: normal; |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <div>预警研判</div> |
| | | <div> |
| | | <MyHeader @getList="getAlarmList" @exportTable="exportAlarm"></MyHeader> |
| | | <!-- 数据展示 --> |
| | | <div style="width: 100%; overflow-x: scroll"> |
| | | <el-table |
| | | border |
| | | stripe |
| | | ref="multipleTable" |
| | | :header-cell-style="{ |
| | | background: '#F5F5F5', |
| | | 'font-weight': '650', |
| | | 'line-height': '45px', |
| | | }" |
| | | :data="tableData" |
| | | :row-class-name="tableRowClassName" |
| | | > |
| | | <el-table-column label="序号" type="index" width="60px"> |
| | | </el-table-column> |
| | | <el-table-column prop="Addr" label="点位名称" min-width="2"> |
| | | </el-table-column> |
| | | <el-table-column prop="MsgTypeStr" label="事件类型" min-width="3"> |
| | | </el-table-column> |
| | | <el-table-column prop="Content" label="消息内容" min-width="8"> |
| | | </el-table-column> |
| | | <el-table-column prop="AcquitAtStr" label="时间" min-width="2"> |
| | | </el-table-column> |
| | | |
| | | <el-table-column prop="operation" label="操作" min-width="3"> |
| | | <template slot-scope="scope"> |
| | | <div class="operation"> |
| | | <span @click="handleLearn(scope.row)">处理</span> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <div class="tools"> |
| | | <div class="pagination"> |
| | | <el-pagination |
| | | background |
| | | @prev-click="handlePrev" |
| | | @next-click="handleNext" |
| | | :current-page="currentPage" |
| | | layout="prev, pager, next" |
| | | :total="totalNum" |
| | | :page-size="pageSize" |
| | | @current-change="changeCurrentPage" |
| | | > |
| | | </el-pagination> |
| | | </div> |
| | | </div> |
| | | <el-dialog |
| | | :visible.sync="dialogAdd" |
| | | width="90%" |
| | | title="预警研判" |
| | | v-if="dialogAdd" |
| | | :before-close="handleClose" |
| | | > |
| | | <JudgeIndex :info="videoInspection" ></JudgeIndex> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import MyHeader from "./header"; |
| | | import realTimeApi from "@/api/smoke/alarm"; |
| | | import JudgeIndex from "./components/index.vue"; |
| | | export default { |
| | | data() { |
| | | return { |
| | | dialogAdd:false, |
| | | tableData: [], |
| | | totalNum: 0, |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | params: {}, |
| | | videoInspection:{} |
| | | }; |
| | | }, |
| | | components: { MyHeader ,JudgeIndex}, |
| | | created() { |
| | | this.getAlarmList(); |
| | | }, |
| | | methods: { |
| | | getAlarmList(seachData) { |
| | | if (seachData) { |
| | | this.params = this.getParam(seachData); |
| | | } else { |
| | | this.params = { |
| | | pageNum: this.currentPage, |
| | | pageSize: this.pageSize, |
| | | }; |
| | | } |
| | | |
| | | } |
| | | realTimeApi |
| | | .findAlarmList(this.params) |
| | | .then(({ list, total }) => { |
| | | list.forEach((e) => { |
| | | e.AcquitAtStr = this.dateFormat( |
| | | "YYYY-mm-dd HH:MM", |
| | | new Date(e.AcquitAt*1000) |
| | | ); |
| | | e.MsgTypeStr = this.MsgTypeStr(e.MsgType); |
| | | }); |
| | | this.tableData = list; |
| | | this.totalNum = total; |
| | | }) |
| | | .catch((err) => this.$message.error(err)); |
| | | }, |
| | | exportAlarm(seachData) { |
| | | let params; |
| | | if (seachData) { |
| | | params = this.getParam(seachData); |
| | | } |
| | | realTimeApi |
| | | .exportAlarm(params) |
| | | .then((res) => { |
| | | let time = new Date(); |
| | | let deathdate = time.toLocaleDateString(); |
| | | const blob = new Blob([res.data], { |
| | | type: "application/vnd.ms-excel;charset=utf-8", |
| | | }); |
| | | if (window.navigator.msSaveBlob) { |
| | | window.navigator.msSaveBlob(blob, deathdate + "报警信息" + ".xls"); |
| | | } else { |
| | | const url = window.URL.createObjectURL(blob); |
| | | const link = document.createElement("a"); |
| | | link.style.display = "none"; |
| | | link.href = url; |
| | | link.download = deathdate + "报警信息" + ".xls"; |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | document.body.removeChild(link); |
| | | } |
| | | this.$message.success("操作成功"); |
| | | }) |
| | | .catch((err) => this.$message.error(err)); |
| | | }, |
| | | getParam(seachData) { |
| | | let params; |
| | | if (seachData) { |
| | | const seachParams = seachData.seachData || seachData; |
| | | params = { |
| | | msgType: |
| | | seachParams.msgType == undefined ? null : seachParams.msgType, |
| | | startTime: |
| | | seachParams.alarmTime == undefined |
| | | ? null |
| | | : this.dateFormat( |
| | | "YYYY-mm-dd HH:MM:SS", |
| | | seachParams.alarmTime[0] |
| | | ), |
| | | endTime: |
| | | seachParams.alarmTime == undefined |
| | | ? null |
| | | : this.dateFormat( |
| | | "YYYY-mm-dd HH:MM:SS", |
| | | seachParams.alarmTime[1] |
| | | ), |
| | | }; |
| | | params.pageNum = this.currentPage; |
| | | params.pageSize = this.pageSize; |
| | | } |
| | | return params; |
| | | }, |
| | | |
| | | MsgTypeStr(Status) { |
| | | switch (Status) { |
| | | case "ExceedStandard": |
| | | return "超标"; |
| | | case "AbnormalOffline": |
| | | return "异常离线"; |
| | | default: |
| | | return "异常离线"; |
| | | } |
| | | }, |
| | | // 设置表格斑马纹 |
| | | tableRowClassName({ row, rowIndex }) { |
| | | if ((rowIndex + 1) % 2 === 0) { |
| | | return "warning-row"; |
| | | } else { |
| | | return "success-row"; |
| | | } |
| | | }, |
| | | // 当前页改变触发事件 |
| | | changeCurrentPage(page) { |
| | | this.currentPage = page; |
| | | this.getAlarmList(this.params); |
| | | }, |
| | | // 上一页点击事件 |
| | | handlePrev(page) { |
| | | this.currentPage = page; |
| | | this.getAlarmList(this.params); |
| | | }, |
| | | // 下一页点击事件 |
| | | handleNext(page) { |
| | | this.currentPage = page; |
| | | this.getAlarmList(this.params); |
| | | }, |
| | | dateFormat(fmt, date) { |
| | | let ret; |
| | | const opt = { |
| | | "Y+": date.getFullYear().toString(), // 年 |
| | | "m+": (date.getMonth() + 1).toString(), // 月 |
| | | "d+": date.getDate().toString(), // 日 |
| | | "H+": date.getHours().toString(), // 时 |
| | | "M+": date.getMinutes().toString(), // 分 |
| | | "S+": date.getSeconds().toString(), // 秒 |
| | | // 有其他格式化字符需求可以继续添加,必须转化成字符串 |
| | | }; |
| | | for (let k in opt) { |
| | | ret = new RegExp("(" + k + ")").exec(fmt); |
| | | if (ret) { |
| | | fmt = fmt.replace( |
| | | ret[1], |
| | | ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, "0") |
| | | ); |
| | | } |
| | | } |
| | | return fmt; |
| | | }, |
| | | handleLearn(row) { |
| | | this.dialogAdd = true; |
| | | this.videoInspection = row; |
| | | |
| | | }, |
| | | handleClose(done) { |
| | | this.changeCurrentPage(1); |
| | | done(); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style> |
| | | <style lang="scss" scoped> |
| | | .el-table { |
| | | .operation { |
| | | display: flex; |
| | | color: var(--operation-color); |
| | | .line { |
| | | padding: 0 5px; |
| | | } |
| | | |
| | | span:hover { |
| | | cursor: pointer; |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | |
| | | .findInTimeList(params) |
| | | .then(({ list, total }) => { |
| | | list.forEach(e => { |
| | | e.AcquitAtStr = this.dateFormat("YYYY-mm-dd HH:MM", new Date(e.AcquitAt)); |
| | | e.AcquitAtStr = this.dateFormat("YYYY-mm-dd HH:MM", new Date(e.AcquitAt*1000)); |
| | | e.FanStatusStr = this.FanStatusStr(e.FanStatus) |
| | | e.FilterStatusStr = this.FanStatusStr(e.FilterStatus) |
| | | e.OnlineStatusStr = this.OnlineStatusStr(e.OnlineStatus) |
| | |
| | | <template> |
| | | <div> |
| | | <MyHeader @getList="getRealTimeList" @exportTable="exportInTime"></MyHeader> |
| | | <MyHeader @getList="getRealTimeList" ></MyHeader> |
| | | <!-- 数据展示 --> |
| | | <div style="width: 100%; overflow-x: scroll"> |
| | | <el-table |
| | |
| | | <el-table-column label="序号" type="index" width="80"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="AcquitAtStr" |
| | | prop="Name" |
| | | label="监测点" |
| | | min-width="20%" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="Addr" |
| | | prop="CGranule" |
| | | label="超标天数" |
| | | min-width="10%" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="FanStatusStr" |
| | | prop="FilterAbnormallyUsedDays" |
| | | label="净化器不正常使用天数" |
| | | min-width="20%" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="AA" |
| | | prop="AbnormalOfflineDays" |
| | | label="异常使用天数" |
| | | min-width="10%" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="EmissionsConc" |
| | | prop="FilterWashTimes" |
| | | label="清洗记录(次)" |
| | | min-width="10%" |
| | | > |
| | |
| | | |
| | | <script> |
| | | import MyHeader from "./header/header2.vue"; |
| | | import realTimeApi from "@/api/smoke/realTime"; |
| | | import statisticsApi from "@/api/smoke/statistics"; |
| | | export default { |
| | | data() { |
| | | return { |
| | |
| | | }; |
| | | } |
| | | |
| | | realTimeApi |
| | | .findInTimeList(params) |
| | | .then(({ list, total }) => { |
| | | list.forEach((e) => { |
| | | e.AcquitAtStr = this.dateFormat( |
| | | "YYYY-mm-dd HH:MM", |
| | | new Date(e.AcquitAt) |
| | | ); |
| | | e.FanStatusStr = this.FanStatusStr(e.FanStatus); |
| | | e.FilterStatusStr = this.FanStatusStr(e.FilterStatus); |
| | | e.OnlineStatusStr = this.OnlineStatusStr(e.OnlineStatus); |
| | | e.StatusStr = this.StatusStr(e.Status); |
| | | }); |
| | | statisticsApi |
| | | .findCurAlarmList(params) |
| | | .then((list) => { |
| | | this.tableData = list; |
| | | this.totalNum = total; |
| | | this.totalNum = list.length; |
| | | }) |
| | | .catch((err) => this.$message.error(err)); |
| | | }, |
| | | exportInTime(seachData) { |
| | | let params; |
| | | if (seachData) { |
| | | params = this.getParam(seachData); |
| | | } |
| | | realTimeApi |
| | | .exportInTime(params) |
| | | .then((res) => { |
| | | debugger; |
| | | let time = new Date(); |
| | | let deathdate = time.toLocaleDateString(); |
| | | const blob = new Blob([res.data], { |
| | | type: "application/vnd.ms-excel;charset=utf-8", |
| | | }); |
| | | if (window.navigator.msSaveBlob) { |
| | | window.navigator.msSaveBlob( |
| | | blob, |
| | | deathdate + "监测总体情况报表" + ".xls" |
| | | ); |
| | | } else { |
| | | const url = window.URL.createObjectURL(blob); |
| | | const link = document.createElement("a"); |
| | | link.style.display = "none"; |
| | | link.href = url; |
| | | link.download = deathdate + "监测总体情况报表" + ".xls"; |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | document.body.removeChild(link); |
| | | } |
| | | this.$message.success("操作成功"); |
| | | }) |
| | | .catch((err) => this.$message.error(err)); |
| | | }, |
| | | |
| | | getParam(seachData) { |
| | | let params; |
| | | if (seachData) { |
| | |
| | | list.forEach((e) => { |
| | | e.AcquitAtStr = this.dateFormat( |
| | | "YYYY-mm-dd HH:MM", |
| | | new Date(e.AcquitAt) |
| | | new Date(e.AcquitAt*1000) |
| | | ); |
| | | e.FanStatusStr = this.FanStatusStr(e.FanStatus); |
| | | e.FilterStatusStr = this.FanStatusStr(e.FilterStatus); |
| | |
| | | .findInTimeList(params) |
| | | .then(({ list, total }) => { |
| | | list.forEach(e => { |
| | | e.AcquitAtStr = this.dateFormat("YYYY-mm-dd HH:MM", new Date(e.AcquitAt)); |
| | | e.AcquitAtStr = this.dateFormat("YYYY-mm-dd HH:MM", new Date(e.AcquitAt*1000)); |
| | | e.FanStatusStr = this.FanStatusStr(e.FanStatus) |
| | | e.FilterStatusStr = this.FanStatusStr(e.FilterStatus) |
| | | e.OnlineStatusStr = this.OnlineStatusStr(e.OnlineStatus) |
| | |
| | | .findInTimeList(params) |
| | | .then(({ list, total }) => { |
| | | list.forEach(e => { |
| | | e.AcquitAtStr = this.dateFormat("YYYY-mm-dd HH:MM", new Date(e.AcquitAt)); |
| | | e.AcquitAtStr = this.dateFormat("YYYY-mm-dd HH:MM", new Date(e.AcquitAt*1000)); |
| | | e.FanStatusStr = this.FanStatusStr(e.FanStatus) |
| | | e.FilterStatusStr = this.FanStatusStr(e.FilterStatus) |
| | | e.OnlineStatusStr = this.OnlineStatusStr(e.OnlineStatus) |
| | |
| | | proxy: { |
| | | // 跨域配置 |
| | | "/sccg": { |
| | | target: `http://42.193.1.25/`, //测试环境 |
| | | // target: `http://127.0.0.1:8082/`, |
| | | // target: `http://42.193.1.25/`, //测试环境 |
| | | target: `http://127.0.0.1:8082/`, |
| | | changeOrigin: true |
| | | } |
| | | }, |