|
@@ -0,0 +1,271 @@
|
|
|
|
|
+<script setup lang="ts">
|
|
|
|
|
+import { ref, withDefaults, onMounted, watch } from "vue"
|
|
|
|
|
+import Rs from "@/core/services/RequestService"
|
|
|
|
|
+import moment from "moment"
|
|
|
|
|
+
|
|
|
|
|
+const props = withDefaults(defineProps<{ id: string }>(), { id: "" })
|
|
|
|
|
+const headData = ref({
|
|
|
|
|
+ company: 0,
|
|
|
|
|
+ monitor: 0,
|
|
|
|
|
+})
|
|
|
|
|
+function getNum() {
|
|
|
|
|
+ Rs.post("sys/onlineData/getOrgTitle", { data: { id: props.id }, successAlert: false }).then((res) => {
|
|
|
|
|
+ headData.value = res.data
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const ringOptions = {
|
|
|
|
|
+ legend: { top: "auto", bottom: 0, right: 30, orient: "vertical" },
|
|
|
|
|
+ pieCenter: ["40%", "50%"],
|
|
|
|
|
+ titleText: "",
|
|
|
|
|
+}
|
|
|
|
|
+const lineOptions = {
|
|
|
|
|
+ titleText: " ",
|
|
|
|
|
+}
|
|
|
|
|
+const date = ref<Array<any>>([
|
|
|
|
|
+ new Date(),
|
|
|
|
|
+ new Date(),
|
|
|
|
|
+ [moment(new Date()).add(-6, "d").toDate(), new Date()],
|
|
|
|
|
+ new Date(),
|
|
|
|
|
+])
|
|
|
|
|
+const chartData = ref<any>([{}, {}, {}, {}])
|
|
|
|
|
+function queryChart(type: number) {
|
|
|
|
|
+ let url = ""
|
|
|
|
|
+ let data: any = {}
|
|
|
|
|
+ switch (type) {
|
|
|
|
|
+ case 0:
|
|
|
|
|
+ url = "sys/onlineData/getCleanlinessPie"
|
|
|
|
|
+ data = { id: props.id, getTime: moment(date.value[type]).format("YYYYMMDD") }
|
|
|
|
|
+ break
|
|
|
|
|
+ case 1:
|
|
|
|
|
+ url = "sys/onlineData/getRunningStatePie"
|
|
|
|
|
+ data = { id: props.id, getTime: moment(date.value[type]).format("YYYYMMDD") }
|
|
|
|
|
+ break
|
|
|
|
|
+ case 2:
|
|
|
|
|
+ url = "sys/onlineData/org/overstandard"
|
|
|
|
|
+ data = {
|
|
|
|
|
+ id: props.id,
|
|
|
|
|
+ start: moment(date.value[type][0]).format("YYYYMMDD"),
|
|
|
|
|
+ end: moment(date.value[type][1]).format("YYYYMMDD"),
|
|
|
|
|
+ }
|
|
|
|
|
+ break
|
|
|
|
|
+ case 3:
|
|
|
|
|
+ url = "sys/onlineData/getScorePie"
|
|
|
|
|
+ data = { id: props.id, getTime: moment(date.value[type]).format("YYYYMMDD") }
|
|
|
|
|
+ break
|
|
|
|
|
+ }
|
|
|
|
|
+ Rs.post(url, { data: data, successAlert: false }).then((res) => {
|
|
|
|
|
+ if (type == 2) {
|
|
|
|
|
+ chartData.value[type] = res.data
|
|
|
|
|
+ } else {
|
|
|
|
|
+ chartData.value[type] = res.data.chartData
|
|
|
|
|
+ chartData.value[type].title = ""
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+function onOverDateChange() {
|
|
|
|
|
+ queryChart(2)
|
|
|
|
|
+}
|
|
|
|
|
+const cols = [
|
|
|
|
|
+ {
|
|
|
|
|
+ name: "商户名称",
|
|
|
|
|
+ field: "company_name",
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ name: "排放最大值",
|
|
|
|
|
+ field: "max",
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ name: "发生时间",
|
|
|
|
|
+ field: "warn_starttime",
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ name: "排放限值",
|
|
|
|
|
+ field: "smoke_density",
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ name: "排放占比(%)",
|
|
|
|
|
+ field: "ratio",
|
|
|
|
|
+ },
|
|
|
|
|
+]
|
|
|
|
|
+const dateRange = ref<[Date, Date]>([new Date(), new Date()])
|
|
|
|
|
+const queryParams = ref<any>({
|
|
|
|
|
+ id: props.id,
|
|
|
|
|
+ start: moment(dateRange.value[0]).format("YYYYMMDD"),
|
|
|
|
|
+ end: moment(dateRange.value[1]).format("YYYYMMDD"),
|
|
|
|
|
+})
|
|
|
|
|
+function queryTable() {
|
|
|
|
|
+ queryParams.value = {
|
|
|
|
|
+ id: props.id,
|
|
|
|
|
+ start: moment(dateRange.value[0]).format("YYYYMMDD"),
|
|
|
|
|
+ end: moment(dateRange.value[1]).format("YYYYMMDD"),
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+function init() {
|
|
|
|
|
+ dateRange.value = [new Date(), new Date()]
|
|
|
|
|
+ date.value = [new Date(), new Date(), [moment(new Date()).add(-6, "d").toDate(), new Date()], new Date()]
|
|
|
|
|
+ chartData.value = [{}, {}, {}, {}]
|
|
|
|
|
+ getNum()
|
|
|
|
|
+ queryChart(0)
|
|
|
|
|
+ queryChart(1)
|
|
|
|
|
+ queryChart(2)
|
|
|
|
|
+ queryChart(3)
|
|
|
|
|
+ queryTable()
|
|
|
|
|
+}
|
|
|
|
|
+watch(
|
|
|
|
|
+ () => props.id,
|
|
|
|
|
+ () => {
|
|
|
|
|
+ init()
|
|
|
|
|
+ }
|
|
|
|
|
+)
|
|
|
|
|
+onMounted(() => {
|
|
|
|
|
+ init()
|
|
|
|
|
+})
|
|
|
|
|
+</script>
|
|
|
|
|
+<template>
|
|
|
|
|
+ <el-row :gutter="20" class="mb-5">
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <div class="card card-bordered border-primary">
|
|
|
|
|
+ <div class="card-header h-70px">
|
|
|
|
|
+ <div class="card-title d-flex w-100 justify-content-between">
|
|
|
|
|
+ <span class="text-primary pt-1 fw-bolder fs-1 d-flex align-items-center">
|
|
|
|
|
+ <i
|
|
|
|
|
+ class="fas fa-home me-8 fs-1 text-white bg-primary h-50px w-50px d-flex justify-content-center align-items-center"
|
|
|
|
|
+ style="border-radius: 50px"
|
|
|
|
|
+ ></i>
|
|
|
|
|
+ 商户数量
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <span class="fs-2hx fw-bold text-primary ms-5 lh-1 ls-n2">
|
|
|
|
|
+ {{ headData.company }}
|
|
|
|
|
+ <span class="fs-2 opacity-75 ms-3">家</span>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <div class="card card-bordered border-primary">
|
|
|
|
|
+ <div class="card-header h-70px">
|
|
|
|
|
+ <div class="card-title d-flex w-100 justify-content-between">
|
|
|
|
|
+ <span class="text-primary pt-1 fw-bolder fs-1 d-flex align-items-center">
|
|
|
|
|
+ <i
|
|
|
|
|
+ class="fas fa-smog me-8 fs-1 text-white bg-primary h-50px w-50px d-flex justify-content-center align-items-center"
|
|
|
|
|
+ style="border-radius: 50px"
|
|
|
|
|
+ ></i>
|
|
|
|
|
+ 监测点数量
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <span class="fs-2hx fw-bold text-primary ms-5 lh-1 ls-n2">
|
|
|
|
|
+ {{ headData.monitor }}
|
|
|
|
|
+ <span class="fs-2 opacity-75 ms-3">家</span>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <el-row :gutter="20" class="mb-5">
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <div class="card card-bordered border-primary">
|
|
|
|
|
+ <div class="card-header bg-light-primary min-h-50px">
|
|
|
|
|
+ <div class="card-title"><h2 class="text-primary">清洁度统计图</h2></div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="card-body p-3 h-250px">
|
|
|
|
|
+ <BaseChart
|
|
|
|
|
+ v-if="headData.company > 0"
|
|
|
|
|
+ :data="chartData[0]"
|
|
|
|
|
+ type="ring"
|
|
|
|
|
+ :options="ringOptions"
|
|
|
|
|
+ h="100%"
|
|
|
|
|
+ ></BaseChart>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <div class="card card-bordered border-primary">
|
|
|
|
|
+ <div class="card-header bg-light-primary min-h-50px">
|
|
|
|
|
+ <div class="card-title"><h2 class="text-primary">商户运营状态统计图</h2></div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="card-body p-3 h-250px">
|
|
|
|
|
+ <BaseChart
|
|
|
|
|
+ v-if="headData.company > 0"
|
|
|
|
|
+ :data="chartData[1]"
|
|
|
|
|
+ type="ring"
|
|
|
|
|
+ :options="ringOptions"
|
|
|
|
|
+ h="100%"
|
|
|
|
|
+ ></BaseChart>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <el-row :gutter="20" class="mb-5">
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <div class="card card-bordered border-primary">
|
|
|
|
|
+ <div class="card-header bg-light-primary min-h-50px">
|
|
|
|
|
+ <div class="card-title"><h2 class="text-primary">超标趋势图</h2></div>
|
|
|
|
|
+ <div class="card-toolbar">
|
|
|
|
|
+ <el-date-picker
|
|
|
|
|
+ v-model="date[2]"
|
|
|
|
|
+ type="daterange"
|
|
|
|
|
+ range-separator="~"
|
|
|
|
|
+ start-placeholder="开始时间"
|
|
|
|
|
+ end-placeholder="结束时间"
|
|
|
|
|
+ size="default"
|
|
|
|
|
+ @change="onOverDateChange"
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="card-body p-3 h-250px">
|
|
|
|
|
+ <BaseChart
|
|
|
|
|
+ v-if="headData.company > 0"
|
|
|
|
|
+ :data="chartData[2]"
|
|
|
|
|
+ type="line"
|
|
|
|
|
+ :options="lineOptions"
|
|
|
|
|
+ h="100%"
|
|
|
|
|
+ ></BaseChart>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <div class="card card-bordered border-primary">
|
|
|
|
|
+ <div class="card-header bg-light-primary min-h-50px">
|
|
|
|
|
+ <div class="card-title"><h2 class="text-primary">商户评分统计图</h2></div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="card-body p-3 h-250px">
|
|
|
|
|
+ <BaseChart
|
|
|
|
|
+ v-if="headData.company > 0"
|
|
|
|
|
+ :data="chartData[3]"
|
|
|
|
|
+ type="ring"
|
|
|
|
|
+ :options="ringOptions"
|
|
|
|
|
+ h="100%"
|
|
|
|
|
+ ></BaseChart>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <VbDataTable
|
|
|
|
|
+ :header="cols"
|
|
|
|
|
+ url="sys/onlineData/warnOver"
|
|
|
|
|
+ method="post"
|
|
|
|
|
+ :query-params="queryParams"
|
|
|
|
|
+ :has-checkbox="false"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template v-slot:table-tool="">
|
|
|
|
|
+ <el-form class="align-items-center" :inline="true">
|
|
|
|
|
+ <el-form-item class="mb-0 me-0 align-items-center" label="超标商户列表"></el-form-item>
|
|
|
|
|
+ <el-form-item class="mb-0 me-0 align-items-center">
|
|
|
|
|
+ <el-date-picker
|
|
|
|
|
+ v-model="dateRange"
|
|
|
|
|
+ type="daterange"
|
|
|
|
|
+ range-separator="~"
|
|
|
|
|
+ start-placeholder="开始时间"
|
|
|
|
|
+ end-placeholder="结束时间"
|
|
|
|
|
+ size="default"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item class="mb-0 me-0 align-items-center">
|
|
|
|
|
+ <el-button class="ms-3 mt-0 btn btn-sm btn-primary" @click="queryTable">查询</el-button>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </VbDataTable>
|
|
|
|
|
+</template>
|