Browse Source

首页大屏前端1.5

main
parent
commit
73f4ad086b
  1. 18
      src/api/data/supervisionNotify.ts
  2. 16
      src/components/datav/chart-bar-pro.vue
  3. 62
      src/views/datav/SceneInsp.vue

18
src/api/data/supervisionNotify.ts

@ -1,21 +1,17 @@
import request from "@/api/request"; import request from "@/api/request";
export function importCaseVerif(body) {
return request.post({
url: '/data/caseVerif/import',
body
});
}
export function listCaseVerif(query) {
export function getAllSupervisionNotifyCount(times) {
return request.get({ return request.get({
url: '/data/caseVerif', url: `/datav/supervisonNotify?beginTime=${times[0]}&endTime=${times[1]}`
query
}); });
} }
export function getAllSupervisionNotifyCount(times) {
export function getChangedRank(times, groupType) {
return request.get({ return request.get({
url: `/datav/supervisonNotify?beginTime=${times[0]}&endTime=${times[1]}` url: `/datav/supervisonNotify/rank?beginTime=${times[0]}&endTime=${times[1]}&groupType=${groupType}`
}); });
} }

16
src/components/datav/chart-bar-pro.vue

@ -92,6 +92,7 @@ function getMax() {
onMounted ( () => { onMounted ( () => {
getMax(); getMax();
}); });
function getColor(val) { function getColor(val) {
@ -118,12 +119,15 @@ function getColor(val) {
.bar-title { .bar-title {
font-size: 19px; font-size: 19px;
} }
.bar-sub-title { .bar-sub-title {
color: #597ae9; color: #597ae9;
font-size: 14px; font-size: 14px;
} }
.bar-item { .bar-item {
font-size: 17px; font-size: 17px;
&[size="large"] { &[size="large"] {
.bar-item_content { .bar-item_content {
.bar-item_content-bar { .bar-item_content-bar {
@ -131,9 +135,11 @@ function getColor(val) {
} }
} }
} }
&[size="small"] { &[size="small"] {
font-size: 12px; font-size: 12px;
} }
.bar-item-label { .bar-item-label {
text-align: right; text-align: right;
width: var(--label-width); width: var(--label-width);
@ -141,25 +147,32 @@ function getColor(val) {
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
&[position="left"] { &[position="left"] {
height: 32px; height: 32px;
line-height: 32px; line-height: 32px;
} }
&[position="top"] { &[position="top"] {
margin-bottom: 4px; margin-bottom: 4px;
.bar-item-label { .bar-item-label {
width: 100%; width: 100%;
text-align: left; text-align: left;
} }
.bar-item_content { .bar-item_content {
width: calc(100% - 80px); width: calc(100% - 80px);
} }
} }
.bar-item_content { .bar-item_content {
width: calc(100% - var(--label-width) - 16px - 30px); width: calc(100% - var(--label-width) - 16px - 30px);
&[long=false] { &[long=false] {
width: calc(100% - var(--label-width) - 36px - 58px); width: calc(100% - var(--label-width) - 36px - 58px);
} }
.bar-item_content-bar { .bar-item_content-bar {
width: 0; width: 0;
height: 9px; height: 9px;
@ -167,8 +180,10 @@ function getColor(val) {
transition: width 0.3s; transition: width 0.3s;
} }
} }
.bar-item_remark { .bar-item_remark {
font-size: 14px; font-size: 14px;
.text-success { .text-success {
color: #09c700; color: #09c700;
} }
@ -176,5 +191,4 @@ function getColor(val) {
} }
</style> </style>

62
src/views/datav/SceneInsp.vue

@ -4,13 +4,14 @@
<datav-header/> <datav-header/>
<main> <main>
<el-row :gutter="16"> <el-row :gutter="16">
<el-col :span="6"> <el-col :span="6">
<datav-card title="日常督察情况"> <datav-card title="日常督察情况">
<el-row class="mb-32"> <el-row class="mb-32">
<el-col :span="6"> <el-col :span="6">
<div class="descriptions_cell text-center"> <div class="descriptions_cell text-center">
<div class="descriptions_content"> <div class="descriptions_content">
56 {{rankOverview.proTotal}}
</div> </div>
<div class="descriptions_label"> <div class="descriptions_label">
问题数 问题数
@ -20,7 +21,7 @@
<el-col :span="6"> <el-col :span="6">
<div class="descriptions_cell text-center"> <div class="descriptions_cell text-center">
<div class="descriptions_content"> <div class="descriptions_content">
0 {{rankOverview.changing}}
</div> </div>
<div class="descriptions_label"> <div class="descriptions_label">
整改中 整改中
@ -30,7 +31,7 @@
<el-col :span="6"> <el-col :span="6">
<div class="descriptions_cell text-center"> <div class="descriptions_cell text-center">
<div class="descriptions_content"> <div class="descriptions_content">
56 {{ rankOverview.changed }}
</div> </div>
<div class="descriptions_label"> <div class="descriptions_label">
已整改 已整改
@ -40,7 +41,7 @@
<el-col :span="6"> <el-col :span="6">
<div class="descriptions_cell text-center"> <div class="descriptions_cell text-center">
<div class="descriptions_content"> <div class="descriptions_content">
100% {{ rankOverview.correctionRate }}%
</div> </div>
<div class="descriptions_label"> <div class="descriptions_label">
整改率 整改率
@ -53,18 +54,17 @@
type="bottom-button" type="bottom-button"
v-model="activeTabLeft" v-model="activeTabLeft"
> >
<datav-tab-item label="分县市局" name="1"> <datav-tab-item label="分县市局" name="3">
<el-scrollbar height="350px"> <el-scrollbar height="350px">
<datav-chart-bar <datav-chart-bar
:data="data1" :data="data1"
size="large"
:color="colors" :color="colors"
title="整改率排名" title="整改率排名"
sub-title="完成数/问题数" sub-title="已整改/问题数"
/> />
</el-scrollbar> </el-scrollbar>
</datav-tab-item> </datav-tab-item>
<datav-tab-item label="局属单位" name="2"> <datav-tab-item label="局属单位" name="4">
<el-scrollbar height="350px"> <el-scrollbar height="350px">
<datav-chart-bar <datav-chart-bar
:data="jsdwBarList" :data="jsdwBarList"
@ -79,6 +79,7 @@
</datav-tabs> </datav-tabs>
</datav-card> </datav-card>
<datav-card title="问题类型占比"> <datav-card title="问题类型占比">
<v-charts <v-charts
style="height: 300px" style="height: 300px"
@ -87,6 +88,7 @@
/> />
</datav-card> </datav-card>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<datav-date-picker v-model="time"/> <datav-date-picker v-model="time"/>
<div class="flex gap-42"> <div class="flex gap-42">
@ -135,10 +137,10 @@
/> />
</datav-card> </datav-card>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<datav-card> <datav-card>
<datav-tabs v-model="activeTabRight" size="small"> <!-- <datav-tabs v-model="activeTabRight" size="small">
<datav-tab-item label="枪支管理" name="1"> <datav-tab-item label="枪支管理" name="1">
<datav-tabs <datav-tabs
v-model="activeMailTabRight" v-model="activeMailTabRight"
@ -305,7 +307,7 @@
</datav-tab-item> </datav-tab-item>
</datav-tabs> </datav-tabs>
</datav-tab-item> </datav-tab-item>
</datav-tabs> </datav-tabs>-->
<!-- <datav-chart-bar <!-- <datav-chart-bar
title="问题数排名" title="问题数排名"
@ -350,17 +352,19 @@
</el-scrollbar> </el-scrollbar>
</datav-card> </datav-card>
</el-col> </el-col>
</el-row> </el-row>
</main> </main>
</div> </div>
</el-scrollbar> </el-scrollbar>
</template> </template>
<script setup> <script setup>
import vCharts from "vue-echarts"; import vCharts from "vue-echarts";
import changshaMap from "@/assets/data/changsha.json"; import changshaMap from "@/assets/data/changsha.json";
import * as echarts from "echarts/core"; import * as echarts from "echarts/core";
import moment from "moment"; import moment from "moment";
import {getAllSupervisionNotifyCount} from "@/api/data/supervisionNotify.ts"; import {getAllSupervisionNotifyCount, getChangedRank} from "@/api/data/supervisionNotify.ts";
echarts.registerMap("changsha", changshaMap); echarts.registerMap("changsha", changshaMap);
const option = { const option = {
@ -488,42 +492,42 @@ const data1 = ref([
}, },
{ {
label: "芙蓉分局", label: "芙蓉分局",
value: 100, value: 80,
unit: "%", unit: "%",
numerator: 11, numerator: 11,
denominator: 11, denominator: 11,
}, },
{ {
label: "岳麓分局", label: "岳麓分局",
value: 100, value: 80,
unit: "%", unit: "%",
numerator: 10, numerator: 10,
denominator: 10, denominator: 10,
}, },
{ {
label: "雨花分局", label: "雨花分局",
value: 100, value: 80,
unit: "%", unit: "%",
numerator: 9, numerator: 9,
denominator: 9, denominator: 9,
}, },
{ {
label: "望城分局", label: "望城分局",
value: 100, value: 80,
unit: "%", unit: "%",
numerator: 4, numerator: 4,
denominator: 4, denominator: 4,
}, },
{ {
label: "浏阳市局", label: "浏阳市局",
value: 100, value: 80,
unit: "%", unit: "%",
numerator: 3, numerator: 3,
denominator: 3, denominator: 3,
}, },
{ {
label: "长沙县局", label: "长沙县局",
value: 100, value: 80,
unit: "%", unit: "%",
numerator: 3, numerator: 3,
denominator: 3, denominator: 3,
@ -586,7 +590,7 @@ const option2 = {
// region // region
const activeTabLeft = ref("1"); const activeTabLeft = ref("3");
const overview = ref({ const overview = ref({
supervisionNotifyTotal: 0, supervisionNotifyTotal: 0,
supervisionNotifyOrgTotal: 0, supervisionNotifyOrgTotal: 0,
@ -595,6 +599,13 @@ const overview = ref({
supervisionNotifyChangedTotal: 0, supervisionNotifyChangedTotal: 0,
correctionRate: 0, correctionRate: 0,
}); });
const rankOverview = ref({
proTotal: 0,
changing: 0,
changed: 0,
correctionRate: 0,
});
const time = ref([ const time = ref([
moment().startOf("year").format("YYYY-MM-DD"), moment().startOf("year").format("YYYY-MM-DD"),
@ -605,11 +616,23 @@ function getData() {
getAllSupervisionNotifyCount(time.value).then((res) => { getAllSupervisionNotifyCount(time.value).then((res) => {
overview.value = res.overview; overview.value = res.overview;
}); });
getChangedRank(time.value, 3).then((res) => {
rankOverview.value = res.rankOverview;
});
} }
watch(time, () => { watch(time, () => {
getData(); getData();
}); });
watch(activeTabLeft, () => {
alert(activeTabLeft.value)
getChangedRank(time.value, activeTabLeft.value).then((res) => {
rankOverview.value = res.rankOverview;
});
});
onMounted(() => { onMounted(() => {
getData(); getData();
}); });
@ -632,6 +655,7 @@ const colors = [
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "@/style/datav.scss"; @import "@/style/datav.scss";

Loading…
Cancel
Save