Compare commits

..

No commits in common. "9808821b70818faed387bb7416affbc80278163c" and "d3878d33583dfd4ec82ec21a1b4fdb8bd916ddbe" have entirely different histories.

2 changed files with 642 additions and 674 deletions

6
package-lock.json generated
View File

@ -1,5 +1,5 @@
{ {
"name": "cxc-szcx-uniapp-master", "name": "cxc-szcx-uniapp",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
@ -19,7 +19,7 @@
}, },
"node_modules/base-64": { "node_modules/base-64": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/base-64/-/base-64-1.0.0.tgz", "resolved": "https://registry.npmmirror.com/base-64/-/base-64-1.0.0.tgz",
"integrity": "sha512-kwDPIFCGx0NZHog36dj+tHiwP4QMzsZ3AgMViUBKI0+V5n4U0ufTCUMhnQ04diaRI8EX/QcPfql7zlhZ7j4zgg==" "integrity": "sha512-kwDPIFCGx0NZHog36dj+tHiwP4QMzsZ3AgMViUBKI0+V5n4U0ufTCUMhnQ04diaRI8EX/QcPfql7zlhZ7j4zgg=="
}, },
"node_modules/dayjs": { "node_modules/dayjs": {
@ -61,7 +61,7 @@
}, },
"base-64": { "base-64": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/base-64/-/base-64-1.0.0.tgz", "resolved": "https://registry.npmmirror.com/base-64/-/base-64-1.0.0.tgz",
"integrity": "sha512-kwDPIFCGx0NZHog36dj+tHiwP4QMzsZ3AgMViUBKI0+V5n4U0ufTCUMhnQ04diaRI8EX/QcPfql7zlhZ7j4zgg==" "integrity": "sha512-kwDPIFCGx0NZHog36dj+tHiwP4QMzsZ3AgMViUBKI0+V5n4U0ufTCUMhnQ04diaRI8EX/QcPfql7zlhZ7j4zgg=="
}, },
"dayjs": { "dayjs": {

View File

@ -5,14 +5,16 @@
<uni-col :span="5"><uni-title :title="'选择单位'" align="left" type="h4"></uni-title></uni-col> <uni-col :span="5"><uni-title :title="'选择单位'" align="left" type="h4"></uni-title></uni-col>
<uni-col :span="19"> <uni-col :span="19">
<trq-depart-select v-model="selectedOrgCode" returnCodeOrID="orgCode" @change="onOrgCodeChange"></trq-depart-select> <trq-depart-select v-model="selectedOrgCode" returnCodeOrID="orgCode"
@change="onOrgCodeChange"></trq-depart-select>
</uni-col> </uni-col>
</uni-row> </uni-row>
<uni-row style="margin-bottom: 20rpx; margin-left: 30rpx; margin-right: 30rpx"> <uni-row style="margin-bottom: 20rpx; margin-left: 30rpx; margin-right: 30rpx">
<uni-col :span="5"><uni-title :title="'选择字段'" align="left" type="h4"></uni-title></uni-col> <uni-col :span="5"><uni-title :title="'选择字段'" align="left" type="h4"></uni-title></uni-col>
<uni-col :span="19"> <uni-col :span="19">
<uni-data-select v-model="selectedField" :localdata="fieldList" @change="onFieldChange"></uni-data-select> <uni-data-select v-model="selectedField" :localdata="fieldList"
@change="onFieldChange"></uni-data-select>
</uni-col> </uni-col>
</uni-row> </uni-row>
</view> </view>
@ -22,9 +24,9 @@
</view> </view>
<!-- 翻页按钮 --> <!-- 翻页按钮 -->
<view style="display: flex; justify-content: center; margin-top: 10px"> <view style="display: flex; justify-content: center; margin-top: 20px">
<button @click="prevPage" :disabled="currentPage === 1" size="mini">上一页</button> <button @click="prevPage" :disabled="currentPage === 1">上一页</button>
<button @click="nextPage" :disabled="currentPage * pageSize >= chartDataCount.value" size="mini">下一页</button> <button @click="nextPage" :disabled="currentPage * pageSize >= chartDataCount.value">下一页</button>
</view> </view>
<!-- 数据表格 --> <!-- 数据表格 -->
@ -37,7 +39,7 @@
<view class="titleStyle">姓名</view> <view class="titleStyle">姓名</view>
</uni-col> </uni-col>
<uni-col :span="5"> <uni-col :span="5">
<view class="titleStyle">基层单位</view> <view class="titleStyle">性别</view>
</uni-col> </uni-col>
<uni-col :span="5"> <uni-col :span="5">
<view class="titleStyle">年龄</view> <view class="titleStyle">年龄</view>
@ -62,7 +64,7 @@
</uni-col> </uni-col>
<uni-col :span="5"> <uni-col :span="5">
<view class="dataStyle"> <view class="dataStyle">
{{ item.jcxd }} {{ item.xb_dictText }}
</view> </view>
</uni-col> </uni-col>
<uni-col :span="5"> <uni-col :span="5">
@ -82,18 +84,27 @@
</template> </template>
<script setup> <script setup>
import { ref, reactive, onMounted, computed } from 'vue'; import {
ref,
reactive,
onMounted,
computed
} from 'vue';
import * as echarts from 'echarts'; import * as echarts from 'echarts';
import { cxcRyDatAstatistics, cxcRyDatAstatisticsDetails } from '@/api/renyuan.js'; import {
import { initDictOption } from '@/api/common.js'; cxcRyDatAstatistics,
cxcRyDatAstatisticsDetails
} from '@/api/renyuan.js';
import {
initDictOption
} from '@/api/common.js';
// tableData // tableData
const bottomHeight = ref(0); const bottomHeight = ref(0);
// //
const chart = ref(null); const chart = ref(null);
const chartDataCount = ref(0); const chartDataCount = ref(0);
const fieldList = ref([ const fieldList = ref([{
{
text: '性别', text: '性别',
value: 'xb', value: 'xb',
isDict: true, isDict: true,
@ -102,8 +113,8 @@ const fieldList = ref([
{ {
text: '政治面貌', text: '政治面貌',
value: 'zzmm', value: 'zzmm',
isDict: true, isDict: false,
dictCode: 'zzmm' dictCode: ''
}, },
{ {
text: '民族', text: '民族',
@ -113,9 +124,10 @@ const fieldList = ref([
} }
]); // ]); //
const dictCode = ref(''); const dictCode = ref("")
const fieldisDict = ref(true); const fieldisDict = ref(true);
const selectedOrgCode = ref(''); // orgCode const selectedOrgCode = ref(''); // orgCode
const selectedOrgCodeLabel = ref('请选择单位'); // const selectedOrgCodeLabel = ref('请选择单位'); //
const selectedField = ref(''); // const selectedField = ref(''); //
@ -123,8 +135,7 @@ const selectedFieldLabel = ref('请选择字段'); // 当前选择的字段名
const orgCodeGroupData = ref([]); //orgcode const orgCodeGroupData = ref([]); //orgcode
const chartData = ref({}); // const chartData = ref({}); //
const personnelList = ref([]); // initChart const personnelList = ref([]); // initChart
const fieldValues = ref([]); // const fieldValues = ref([]);
const fieldTexts = ref([]); //
const chartOption = ref({}); const chartOption = ref({});
const chartTitle = computed(() => { const chartTitle = computed(() => {
@ -146,6 +157,8 @@ onMounted(() => {
// #ifdef APP // #ifdef APP
getHeight(); getHeight();
// #endif // #endif
}); });
// #ifdef APP // #ifdef APP
@ -181,9 +194,9 @@ const initChart = () => {
const prevPage = () => { const prevPage = () => {
if (currentPage.value > 1) { if (currentPage.value > 1) {
currentPage.value--; currentPage.value--;
}
} }
updateChart(chartData.value);
};
const nextPage = () => { const nextPage = () => {
if (currentPage.value * pageSize.value < chartDataCount.value) { if (currentPage.value * pageSize.value < chartDataCount.value) {
@ -191,30 +204,25 @@ const nextPage = () => {
// //
const startIndex = (currentPage.value - 1) * pageSize.value; const startIndex = (currentPage.value - 1) * pageSize.value;
const endIndex = startIndex + pageSize.value; const endIndex = startIndex + pageSize.value;
updateChart(chartData.value);
// const tempChartData = temp.slice(startIndex, endIndex); // const tempChartData = temp.slice(startIndex, endIndex);
}
} }
};
// option // option
const getChartOption = (ChartData) => { const getChartOption = (tempChartData) => {
// let temp = JSON.parse(JSON.stringify(tempchartData[0].children)); // let temp = JSON.parse(JSON.stringify(tempchartData[0].children));
// chartDataCount.value = temp.length; // chartDataCount.value = temp.length;
// // //
const startIndex = (currentPage.value - 1) * pageSize.value; // const startIndex = (currentPage.value - 1) * pageSize.value;
const endIndex = startIndex + pageSize.value; // const endIndex = startIndex + pageSize.value;
// // //
const tempChartData = ChartData.slice(startIndex, endIndex); // const tempChartData = temp.slice(startIndex, endIndex);
try {
let xData = []; let xData = [];
let seriesData = []; let seriesData = [];
console.log(1, tempChartData); // console.log(1, temp);
// transformDataForEcharts // transformDataForEcharts
let legendData = [];
for (let i = 0; i < fieldValues.value.length; i++) {
legendData.push(fieldValues.value[i].filedText);
}
tempChartData.forEach((item) => { tempChartData.forEach((item) => {
xData.push(item.name); xData.push(item.name);
}); });
@ -222,7 +230,6 @@ const getChartOption = (ChartData) => {
for (let i = 0; i < fieldValues.value.length; i++) { for (let i = 0; i < fieldValues.value.length; i++) {
let tempData = []; let tempData = [];
tempChartData.forEach((item) => { tempChartData.forEach((item) => {
console.log(item);
if (item.data[i]) { if (item.data[i]) {
tempData.push(item.data[i]); tempData.push(item.data[i]);
} else { } else {
@ -230,16 +237,11 @@ const getChartOption = (ChartData) => {
} }
}); });
seriesData.push({ seriesData.push({
name: fieldValues.value[i].filedText, name: fieldValues.value[i],
type: 'bar', type: 'bar',
label: {
show: true, //
position: 'top' //
},
data: tempData data: tempData
}); });
} }
console.log(2, legendData, xData, seriesData);
let tempOption = { let tempOption = {
title: { title: {
text: chartTitle.value, text: chartTitle.value,
@ -276,8 +278,7 @@ const getChartOption = (ChartData) => {
show: false //线 show: false //线
} }
}, },
yAxis: [ yAxis: [{
{
show: true, show: true,
boundaryGap: false, //线 boundaryGap: false, //线
type: 'value', type: 'value',
@ -301,12 +302,11 @@ const getChartOption = (ChartData) => {
axisLine: { axisLine: {
show: false //线 show: false //线
} }
} }],
],
series: seriesData, series: seriesData,
legend: { legend: {
data: legendData, data: fieldValues.value,
itemGap: 5, itemGap: 5,
padding: [0, 15, 0, 15], padding: [0, 15, 0, 15],
y: 'bottom', y: 'bottom',
@ -315,11 +315,8 @@ const getChartOption = (ChartData) => {
type: 'scroll' type: 'scroll'
} }
}; };
return tempOption; return tempOption
} catch (error) {
console.log(error);
} }
};
// //
const updateChart = (tempchartData) => { const updateChart = (tempchartData) => {
@ -328,18 +325,17 @@ const updateChart = (tempchartData) => {
if (!chart.value) return; if (!chart.value) return;
const myChart = await chart.value.init(echarts); const myChart = await chart.value.init(echarts);
console.log(tempchartData); console.log(tempchartData);
let tempOption = getChartOption(tempchartData);
myChart.setOption(tempOption);
myChart.setOption(getChartOption(tempchartData));
// //
myChart.on('click', (params) => { myChart.on('click', (params) => {
console.log(params.name, params.seriesIndex, params.dataIndex); console.log(params.name, params.seriesIndex, params.dataIndex);
console.log(orgCodeGroupData.value); console.log(orgCodeGroupData.value);
let updateData = findRyByOrgCode(orgCodeGroupData.value.children, params.name); let updateData = findRyByOrgCode(orgCodeGroupData.value.children, params.name);
console.log(updateData); // console.log(updateData);
const ldhth = updateData.fieldValues[params.seriesIndex].ldhth; const ldhth = updateData.fieldValues[params.dataIndex].ldhth;
console.log(ldhth); console.log(ldhth);
@ -356,7 +352,7 @@ function findRyByOrgCode(treeData, targetOrgCode) {
// console.log(treeData, targetOrgCode); // console.log(treeData, targetOrgCode);
for (const node of treeData) { for (const node of treeData) {
// //
if (node.orgText === targetOrgCode) { if (node.orgCode === targetOrgCode) {
return node; return node;
} }
// //
@ -391,41 +387,21 @@ function findNodeByOrgCode(treeData, targetOrgCode) {
} }
//fieldValue //fieldValue
function collectUniqueKeyFieldValues(tree) { function collectUniqueKeyValues(tree, key) {
const uniqueMap = new Map(); const uniqueValues = new Set(); // 使Set
tree.forEach((item) => {
const { fieldValue, filedText } = item;
const key = `${fieldValue}-${filedText}`;
if (!uniqueMap.has(key)) { function traverse(node) {
uniqueMap.set(key, { if (node[key] !== undefined) {
fieldValue, uniqueValues.add(node[key]);
filedText
});
} }
}); if (node.children && Array.isArray(node.children)) {
node.children.forEach((child) => traverse(child));
const result = Array.from(uniqueMap.values());
return result;
}
//
class OrgCodeMapper {
constructor(data) {
//
this.orgCodeToOrgTextMap = {};
//
for (let i = 0; i < data.length; i++) {
const item = data[i];
// orgCode orgText
this.orgCodeToOrgTextMap[item.orgCode] = item.orgText;
} }
} }
// orgCode orgText tree.forEach((node) => traverse(node)); // tree
findOrgText(orgCode) {
return this.orgCodeToOrgTextMap[orgCode]; return Array.from(uniqueValues); // Set
}
} }
// //
@ -442,10 +418,7 @@ class OrgCodeMapper {
function transformData(selectOrgCode, data) { function transformData(selectOrgCode, data) {
const nodes = new Map(); const nodes = new Map();
//fieldValue data[] fieldValue //fieldValue data[] fieldValue
fieldValues.value = collectUniqueKeyFieldValues(data); fieldValues.value = collectUniqueKeyValues(data, 'fieldValue');
// console.log(fieldValues.value);
const orgMapper = new OrgCodeMapper(data); //orgtext
// console.log(orgMapper.findOrgText('A01A01A01A01'));
// orgCode // orgCode
function getHierarchy(orgCode) { function getHierarchy(orgCode) {
const hierarchy = []; const hierarchy = [];
@ -465,30 +438,25 @@ function transformData(selectOrgCode, data) {
// //
data.forEach((entry) => { data.forEach((entry) => {
const hierarchy = getHierarchy(entry.orgCode); const hierarchy = getHierarchy(entry.orgCode);
// console.log(entry);
hierarchy.forEach((code) => { hierarchy.forEach((code) => {
// console.log(code);
let tempOrgText = orgMapper.findOrgText(code) === undefined ? '' : orgMapper.findOrgText(code);
// console.log(tempOrgText);
if (!nodes.has(code)) { if (!nodes.has(code)) {
nodes.set(code, { nodes.set(code, {
orgCode: code, orgCode: code,
name: tempOrgText,
type: 'bar', type: 'bar',
data: JSON.parse(JSON.stringify(tempArrayValue)), // data[0, 0] data: JSON.parse(JSON.stringify(tempArrayValue)), // data[0, 0]
children: [] children: []
}); });
} }
}); });
// console.log(nodes);
// console.log('fieldValues', fieldValues.value, fieldValues.value.length, hierarchy); // console.log('fieldValues', fieldValues.value, fieldValues.value.length, hierarchy);
// data // data
const node = nodes.get(entry.orgCode); const node = nodes.get(entry.orgCode);
const fieldValue = entry.fieldValue; const fieldValue = parseInt(entry.fieldValue, 10);
for (let i = 0; i < fieldValues.value.length; i++) { for (let i = 0; i < fieldValues.value.length; i++) {
if (fieldValue === fieldValues.value[i].fieldValue) { if (fieldValue === parseInt(fieldValues.value[i], 10)) {
// console.log(555, i, fieldValue, fieldValues.value[i], entry.number); // console.log(555, i, fieldValue, fieldValues.value[i], entry.number);
node.data[i] += entry.number; node.data[i] += entry.number;
} }
@ -533,24 +501,18 @@ function transformData(selectOrgCode, data) {
// data // data
rootNodes.forEach((root) => computeData(root)); rootNodes.forEach((root) => computeData(root));
return rootNodes;
// console.log('rootNodes', rootNodes); // console.log('rootNodes', rootNodes);
// // //
// function formatTree(node) { function formatTree(node) {
// // console.log(node); return {
// return { name: node.orgCode,
// orgCode: node.orgCode, type: 'bar',
// name: node.name, data: node.data,
// type: 'bar', children: node.children.map((child) => formatTree(child))
// data: node.data, };
// children: node.children.map((child) => formatTree(child)) }
// };
// }
// return rootNodes.map((root) => { return rootNodes.map((root) => formatTree(root));
// console.log(root);
// formatTree(root);
// });
} }
//----------------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------------
@ -559,28 +521,25 @@ function transformData(selectOrgCode, data) {
const groupByOrgCode = (orgCode, data) => { const groupByOrgCode = (orgCode, data) => {
// //
console.log(1, data)
const filteredData = data.filter((item) => item.orgCode.startsWith(orgCode)); const filteredData = data.filter((item) => item.orgCode.startsWith(orgCode));
const orgMapper = new OrgCodeMapper(data); console.log(2, filteredData)
// null // null
if (filteredData.length === 0) { if (filteredData.length === 0) {
uni.showToast({ uni.showToast({
title: '过滤后数据为空', title: "过滤后数据为空",
duration: 1000 duration: 1000
}); })
return null; return null;
} }
// console.log(0, filteredData);
// fieldValue // fieldValue
const groupedByFieldValue = {}; const groupedByFieldValue = {};
try { try {
filteredData.forEach((item) => { filteredData.forEach((item) => {
// console.log(item); // console.log(item.orgCode, 11, groupedByFieldValue[item.fieldValue]);
if (!groupedByFieldValue[item.fieldValue]) { if (!groupedByFieldValue[item.fieldValue]) {
groupedByFieldValue[item.fieldValue] = { groupedByFieldValue[item.fieldValue] = {
orgCode: item.orgCode,
orgText: item.orgText,
filedText: item.filedText,
number: 0, number: 0,
ldhth: [] ldhth: []
}; };
@ -590,25 +549,18 @@ const groupByOrgCode = (orgCode, data) => {
groupedByFieldValue[item.fieldValue].ldhth.push(...item.ldhth.split(',')); groupedByFieldValue[item.fieldValue].ldhth.push(...item.ldhth.split(','));
}); });
} catch (error) { } catch (error) {
console.log(error); console.log(error)
} }
console.log(1, orgMapper.findOrgText(orgCode));
//
//
const result = { const result = {
orgCode: orgCode, orgCode: orgCode,
orgText: orgMapper.findOrgText(orgCode), fieldValues: Object.keys(groupedByFieldValue).map((fieldValue) => ({
fieldValues: Object.keys(groupedByFieldValue).map((fieldValue) => {
const { filedText, orgCode, orgText } = groupedByFieldValue[fieldValue] || {};
return {
fieldValue: fieldValue, fieldValue: fieldValue,
filedText: filedText,
orgCode: orgCode,
orgText: orgText,
number: groupedByFieldValue[fieldValue].number, number: groupedByFieldValue[fieldValue].number,
ldhth: [...new Set(groupedByFieldValue[fieldValue].ldhth)] // ldhth: [...new Set(groupedByFieldValue[fieldValue].ldhth)] //
}; })),
}),
children: [] children: []
}; };
@ -624,18 +576,20 @@ const groupByOrgCode = (orgCode, data) => {
} }
}); });
} catch (error) { } catch (error) {
console.log(error); console.log(error)
} }
// //
try { try {
nextLevelOrgCodes.forEach((nextLevelOrgCode) => { nextLevelOrgCodes.forEach((nextLevelOrgCode) => {
const child = groupByOrgCode(nextLevelOrgCode, data); const child = groupByOrgCode(nextLevelOrgCode, data);
if (child) { if (child) {
result.children.push(child); result.children.push(child);
} }
}); });
} catch (error) { } catch (error) {
console.log(error); console.log(error)
} }
// console.log('', result); // console.log('', result);
@ -645,8 +599,7 @@ const groupByOrgCode = (orgCode, data) => {
// then filter // then filter
const fetchStatisticsData = async () => { const fetchStatisticsData = async () => {
if (!selectedOrgCode.value || !selectedField.value) return; if (!selectedOrgCode.value || !selectedField.value) return;
let res = []; let res = []
chartData.value = [];
try { try {
res = await cxcRyDatAstatistics({ res = await cxcRyDatAstatistics({
orgCode: selectedOrgCode.value, orgCode: selectedOrgCode.value,
@ -654,29 +607,28 @@ const fetchStatisticsData = async () => {
dictCode: dictCode.value, dictCode: dictCode.value,
fieldisDict: fieldisDict.value fieldisDict: fieldisDict.value
}); });
// console.log(res); //deepseek console.log(res); //deepseek
if (res.success) { if (res.length === 0) {
// console.log(selectedOrgCode.value, res);
if (res.result.length < 1) {
uni.showToast({ uni.showToast({
title: '查询数据为空' title: "查询数据为空"
}); })
return; return
}
//
orgCodeGroupData.value = groupByOrgCode(selectedOrgCode.value, res.result);
// console.log(orgCodeGroupData.value);
//echart
const temp = transformData(selectedOrgCode.value, res.result);
if (temp[0].children.length > 0) {
chartData.value = JSON.parse(JSON.stringify(temp[0].children));
} else { } else {
chartData.value = temp[0]; console.log(selectedOrgCode.value, res);
orgCodeGroupData.value = groupByOrgCode(selectedOrgCode.value, res);
console.log(orgCodeGroupData.value);
chartData.value = transformData(selectedOrgCode.value, res);
let temp = []
if (chartData.value[0].children.length > 0) {
temp = JSON.parse(JSON.stringify(chartData.value[0].children));
} else {
temp = chartData.value[0]
} }
chartDataCount.value = chartData.value.length; console.log(temp)
chartDataCount.value = temp.length;
// console.log(chartData.value); // console.log(chartData.value);
updateChart(chartData.value); updateChart(temp);
} }
} catch (error) { } catch (error) {
console.error('获取统计数据失败:', error); console.error('获取统计数据失败:', error);
@ -685,15 +637,12 @@ const fetchStatisticsData = async () => {
// delimiter // delimiter
const fetchPersonnelList = async (ldhthList) => { const fetchPersonnelList = async (ldhthList) => {
personnelList.value = [];
try { try {
const res = await cxcRyDatAstatisticsDetails({ const res = await cxcRyDatAstatisticsDetails({
ldhth: ldhthList ldhth: ldhthList
}); });
console.log(res); console.log(res);
if (res.success) { personnelList.value = res.data;
personnelList.value = res.result;
}
} catch (error) { } catch (error) {
console.error('获取人员列表失败:', error); console.error('获取人员列表失败:', error);
} }
@ -702,22 +651,22 @@ const fetchPersonnelList = async (ldhthList) => {
// //
const onOrgCodeChange = (e, data) => { const onOrgCodeChange = (e, data) => {
selectedOrgCode.value = e; selectedOrgCode.value = e;
// console.log(data.value.title); console.log(data.value.title);
selectedOrgCodeLabel.value = data.value.title; selectedOrgCodeLabel.value = data.value.title;
fetchStatisticsData(); fetchStatisticsData();
}; };
const onFieldChange = (e) => { const onFieldChange = (e) => {
// console.log(e); console.log(e);
try { try {
selectedField.value = e; selectedField.value = e;
for (var index = 0; index < fieldList.value.length; index++) { for (var index = 0; index < fieldList.value.length; index++) {
var element = fieldList.value[index]; var element = fieldList.value[index];
// console.log(element); console.log(element);
if (element.value === e) { if (element.value === e) {
selectedFieldLabel.value = element.text; selectedFieldLabel.value = element.text;
dictCode.value = element.dictCode; dictCode.value = element.dictCode
fieldisDict.value = element.isDict; fieldisDict.value = element.isDict
} }
} }
fetchStatisticsData(); fetchStatisticsData();
@ -728,7 +677,9 @@ const onFieldChange = (e) => {
}; };
const onChartClick = (e) => { const onChartClick = (e) => {
const { ldhth } = chartData.value; const {
ldhth
} = chartData.value;
if (ldhth && ldhth.length > 0) { if (ldhth && ldhth.length > 0) {
fetchPersonnelList(ldhth); fetchPersonnelList(ldhth);
} }
@ -757,7 +708,7 @@ const onChartClick = (e) => {
/* 图表容器 */ /* 图表容器 */
.chart-container { .chart-container {
height: 200px; height: 50vh;
margin: 20rpx 0; margin: 20rpx 0;
border-radius: 24rpx; border-radius: 24rpx;
overflow: hidden; overflow: hidden;
@ -767,35 +718,47 @@ const onChartClick = (e) => {
} }
/* 表格标题行 */ /* 表格标题行 */
.titleStyle { .titleStyle {
font-size: 12px; font-size: 28rpx;
color: #747474; font-weight: 600;
line-height: 30px; color: #ffffff;
height: 30px; background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
background: #f2f9fc; padding: 28rpx 0;
text-align: center; border-radius: 16rpx 16rpx 0 0;
vertical-align: middle; box-shadow: 0 4rpx 12rpx rgba(67, 100, 247, 0.2);
border-left: 1px solid #919191; letter-spacing: 1rpx;
border-bottom: 1px solid #919191;
} }
/* 内容样式 */ /* 数据行 */
.dataStyle { .dataStyle {
max-font-size: 14px; font-size: 28rpx;
/* 最大字体限制 */ color: #3a466b;
min-font-size: 10px; padding: 32rpx 0;
/* 最小字体限制 */ background: #ffffff;
font-size: 12px; border-bottom: 2rpx solid #f0f6ff;
color: #00007f; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
line-height: 30px; }
height: 30px;
font-weight: 500; .dataStyle:hover {
text-align: center; background: #f8fbff;
vertical-align: middle; transform: translateY(-2rpx);
border-bottom: 1px solid #919191; }
border-left: 1px solid #919191;
text-overflow: ellipsis; /* 操作按钮 */
button[type='primary'] {
background: linear-gradient(135deg, var(--primary-blue), var(--deep-blue));
border: none;
border-radius: 12rpx;
padding: 12rpx 32rpx;
font-size: 26rpx;
box-shadow: 0 6rpx 16rpx rgba(64, 158, 255, 0.3);
transition: all 0.25s ease;
}
button[type='primary']:active {
transform: scale(0.96);
box-shadow: 0 4rpx 8rpx rgba(64, 158, 255, 0.3);
background: linear-gradient(135deg, var(--deep-blue), var(--primary-blue));
} }
/* 滚动区域 */ /* 滚动区域 */
@ -850,7 +813,7 @@ scroll-view {
/* 响应式调整优化 */ /* 响应式调整优化 */
@media (max-width: 768px) { @media (max-width: 768px) {
.chart-container { .chart-container {
height: 200px; height: 55vh;
border-radius: 20rpx; border-radius: 20rpx;
} }
@ -858,6 +821,11 @@ scroll-view {
font-size: 26rpx; font-size: 26rpx;
padding: 24rpx 0; padding: 24rpx 0;
} }
button[type='primary'] {
padding: 10rpx 24rpx;
font-size: 24rpx;
}
} }
/* 数据行高亮效果 */ /* 数据行高亮效果 */