Files
sgxt_web/src/views/backOfficeSystem/HumanIntelligence/RlStatisticalAnalysis/index.vue

258 lines
7.2 KiB
Vue
Raw Normal View History

2025-04-17 11:19:14 +08:00
<template>
<div class="statistical-analysis">
<!-- 左侧树形菜单 -->
<div class="left-menu">
<!-- 这个部分用的是组件-后期替换 -->
2025-07-07 11:40:59 +08:00
<MOSTY.DepartmentTree width="310px" @change="init" placeholder="管理部门" clearable filterable :isBmId="true" v-model="listQuery.ssbmdm" />
2025-04-17 11:19:14 +08:00
</div>
<!-- 右侧内容区 -->
<div class="right-content">
<!-- 顶部筛选 -->
<div class="filter-section">
2025-07-07 11:40:59 +08:00
<el-radio-group v-model="radio" @change="changeRadio">
<el-radio v-for="(it,idx) in timeList" :key="idx" :label="it.num" >{{ it.label }}</el-radio>
2025-04-17 11:19:14 +08:00
</el-radio-group>
<el-date-picker
v-model="dateRange"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
@change="handleDateChange"
/>
2025-07-07 11:40:59 +08:00
<el-button type="primary" @click="init">查询</el-button>
<el-button type="primary" @click="handleRest">重置</el-button>
2025-04-17 11:19:14 +08:00
</div>
<!-- 统计图表区域 -->
<div class="charts-container">
<div class="chart-item">
<div class="chart-title">
2025-07-07 11:40:59 +08:00
<span>线索类型</span>
2025-04-17 11:19:14 +08:00
<el-button type="primary">导出统计表</el-button>
</div>
<div class="chart">
2025-07-07 11:40:59 +08:00
<PieEcharts echartsId="bsqkEpieChart" color="#333" :data="obj.xslxList"></PieEcharts>
2025-04-17 11:19:14 +08:00
</div>
</div>
<div class="chart-item">
<div class="chart-title">
<span>采纳情况</span>
<el-button type="primary">导出统计表</el-button>
</div>
<div class="chart">
2025-07-07 11:40:59 +08:00
<DbarEcharts echartsId="bar3DChart" :data="obj.cnList"></DbarEcharts>
2025-04-17 11:19:14 +08:00
</div>
</div>
<div class="chart-item">
<div class="chart-title">
2025-07-07 11:40:59 +08:00
<span>处置状态</span>
2025-04-17 11:19:14 +08:00
<el-button type="primary">导出统计表</el-button>
</div>
<ul class="chart mt8">
2025-07-07 11:40:59 +08:00
<li v-for="(it, idx) in obj.czztList" :key="idx" class="mb6">
2025-04-17 11:19:14 +08:00
<div style="color: #333">{{ it.label }}</div>
2025-07-07 11:40:59 +08:00
<el-progress :text-inside="true" :stroke-width="20" :percentage="50" status="exception" >
<span><span style="color: #e37233">{{ it.value }}</span> </span >
2025-04-17 11:19:14 +08:00
</el-progress>
</li>
</ul>
</div>
<div class="chart-item">
<div class="chart-title">
<span>奖惩情况</span>
<el-button type="primary">导出统计表</el-button>
</div>
2025-07-07 11:40:59 +08:00
<lineEcharts color="#333" echartsId="areaChart" :data="obj.jcqkList"></lineEcharts>
2025-04-17 11:19:14 +08:00
</div>
</div>
</div>
</div>
</template>
<script setup>
2025-07-07 11:40:59 +08:00
import { timeValidate, timeSlotChange } from "@/utils/tools.js";
2025-07-06 15:43:45 +08:00
import * as MOSTY from "@/components/MyComponents/index";
2025-04-17 11:19:14 +08:00
import lineEcharts from "@/views/home/echarts/lineEcharts.vue";
import PieEcharts from "@/views/home/echarts/pieEcharts.vue";
import DbarEcharts from "@/views/home/echarts/3DbarEcharts.vue";
2025-07-07 11:40:59 +08:00
import { qcckPost } from "@/api/qcckApi.js";
2025-04-17 11:19:14 +08:00
import { reactive, ref, onMounted, getCurrentInstance } from "vue";
2025-07-07 11:40:59 +08:00
const radio = ref(0);
2025-04-17 11:19:14 +08:00
const timeList = ref([
2025-07-07 11:40:59 +08:00
{ label: "日", num: 0 },
{ label: "月", num: 1 },
{ label: "季", num: 2 },
{ label: "年", num: 3 }
2025-04-17 11:19:14 +08:00
]);
2025-07-07 11:40:59 +08:00
const dateRange = ref([timeValidate(),timeValidate()]);// 日期范围
const listQuery = ref({})
2025-04-17 11:19:14 +08:00
const obj = reactive({
2025-07-07 11:40:59 +08:00
xslxList: [],
jcqkList: [],
czztList: [],
2025-04-17 11:19:14 +08:00
cnList: {
2025-07-07 11:40:59 +08:00
list: [],
2025-04-17 11:19:14 +08:00
topColor:'#1bd6c2',
colors: ["#28EEBF","#0DBAC5"],
}
});
2025-07-07 11:40:59 +08:00
onMounted(() => {
init() //初始化数据
});
2025-04-17 11:19:14 +08:00
2025-07-07 11:40:59 +08:00
const init = () => {
let data = {
ssbmdm: listQuery.value.ssbmdm,
kssj: dateRange.value[0] + ' 00:00:00',
jssj: dateRange.value[1] + ' 23:59:59',
cjLx: 1 // 1-临安吗
};
// 获取线索类型统计
qcckPost(data, '/mosty-gsxt/qbcj/getXscjTjByXslx').then(res => {
let arr = res || [];
obj.xslxList = arr.map(v=>{
return { label:v.zdmc,value:v.count }
})
});
2025-04-17 11:19:14 +08:00
2025-07-07 11:40:59 +08:00
// 获取奖惩情况统计
qcckPost(data, '/mosty-gsxt/tbJlqk/getShygkhtj').then(res => {
let arr = res || [];
obj.jcqkList = arr.map(v=>{
return { label:v.zdmc,value:v.count }
})
});
2025-04-17 11:19:14 +08:00
2025-07-14 10:09:55 +08:00
// 获取处置状态统计
2025-07-07 11:40:59 +08:00
qcckPost(data, '/mosty-gsxt/qbcj/getXscjTjByCzzt').then(res => {
let arr = res || [];
obj.czztList = arr.map(v=>{
return { label:v.zdmc,value:v.count }
})
});
2025-04-17 11:19:14 +08:00
2025-07-07 11:40:59 +08:00
// 获取采纳情况统计
qcckPost(data, '/mosty-gsxt/qbcj/getXscjTjByShzt').then(res => {
let arr = res || [];
obj.cnList.list = arr.map(v=>{
return { label:v.zdmc,value:v.count }
})
});
}
const changeRadio = (val) =>{
switch(val){
case 0: //日
dateRange.value = [timeValidate(),timeValidate()]
break;
case 1: //月
dateRange.value = timeSlotChange('本月')
break;
case 2: //季度
dateRange.value = timeSlotChange('本季度')
break;
case 3: //年
dateRange.value = timeSlotChange('本年')
break;
}
}
const handleDateChange = (val) => {
radio.value = '';
if(val[0] == timeSlotChange('天')[0] && val[1] == timeSlotChange('天')[1]) radio.value = 0;
if(val[0] == timeSlotChange('本月')[0] && val[1] == timeSlotChange('本月')[1]) radio.value = 1;
if(val[0] == timeSlotChange('本季度')[0] && val[1] == timeSlotChange('本季度')[1]) radio.value = 2;
if(val[0] == timeSlotChange('本年')[0] && val[1] == timeSlotChange('本年')[1]) radio.value = 3;
2025-04-17 11:19:14 +08:00
};
2025-07-07 11:40:59 +08:00
// 重置
const handleRest = () => {
radio.value = 0;
dateRange.value = [timeValidate(),timeValidate()];
init();
};
;
2025-04-17 11:19:14 +08:00
</script>
<style lang="scss" scoped>
.statistical-analysis {
display: flex;
height: 100%;
.left-menu {
2025-07-06 15:43:45 +08:00
width: 350px;
2025-04-17 11:19:14 +08:00
padding: 20px;
margin-top: 20px;
border-radius: 4px;
background-color: #fff;
border-right: 1px solid #e8e8e8;
}
.right-content {
flex: 1;
padding: 20px;
.filter-section {
display: flex;
align-items: center;
gap: 16px;
margin-bottom: 20px;
background: #fff;
padding: 10px;
box-sizing: border-box;
border-radius: 4px;
}
.charts-container {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
height: calc(100% - 50px);
.chart-item {
width: 49.5%;
height: calc(50% - 5px);
background-color: #fff;
border-radius: 8px;
padding: 20px;
box-sizing: border-box;
overflow: hidden;
overflow-y: auto;
.chart-title {
font-size: 16px;
font-weight: bold;
color: #333;
display: flex;
justify-content: space-between;
align-items: center;
}
.chart {
height: calc(100% - 40px);
overflow: hidden;
overflow-y: auto;
}
}
}
}
::v-deep .el-radio {
color: #333;
}
::v-deep .el-radio__inner {
border-radius: 4px;
}
::v-deep .el-progress-bar__innerText {
color: #333;
margin: 0 -40px;
}
::v-deep .el-progress.is-exception .el-progress-bar__inner {
background: linear-gradient(90deg, #fe5d00 0%, #face35 100%);
}
}
</style>