Compare commits
4 Commits
d3878d3358
...
9808821b70
Author | SHA1 | Date | |
---|---|---|---|
9808821b70 | |||
2a746146f0 | |||
1ef1384fa8 | |||
![]() |
2183aab470 |
6
package-lock.json
generated
6
package-lock.json
generated
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "cxc-szcx-uniapp",
|
"name": "cxc-szcx-uniapp-master",
|
||||||
"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.npmmirror.com/base-64/-/base-64-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/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.npmmirror.com/base-64/-/base-64-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/base-64/-/base-64-1.0.0.tgz",
|
||||||
"integrity": "sha512-kwDPIFCGx0NZHog36dj+tHiwP4QMzsZ3AgMViUBKI0+V5n4U0ufTCUMhnQ04diaRI8EX/QcPfql7zlhZ7j4zgg=="
|
"integrity": "sha512-kwDPIFCGx0NZHog36dj+tHiwP4QMzsZ3AgMViUBKI0+V5n4U0ufTCUMhnQ04diaRI8EX/QcPfql7zlhZ7j4zgg=="
|
||||||
},
|
},
|
||||||
"dayjs": {
|
"dayjs": {
|
||||||
|
@ -5,16 +5,14 @@
|
|||||||
<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"
|
<trq-depart-select v-model="selectedOrgCode" returnCodeOrID="orgCode" @change="onOrgCodeChange"></trq-depart-select>
|
||||||
@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"
|
<uni-data-select v-model="selectedField" :localdata="fieldList" @change="onFieldChange"></uni-data-select>
|
||||||
@change="onFieldChange"></uni-data-select>
|
|
||||||
</uni-col>
|
</uni-col>
|
||||||
</uni-row>
|
</uni-row>
|
||||||
</view>
|
</view>
|
||||||
@ -24,9 +22,9 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 翻页按钮 -->
|
<!-- 翻页按钮 -->
|
||||||
<view style="display: flex; justify-content: center; margin-top: 20px">
|
<view style="display: flex; justify-content: center; margin-top: 10px">
|
||||||
<button @click="prevPage" :disabled="currentPage === 1">上一页</button>
|
<button @click="prevPage" :disabled="currentPage === 1" size="mini">上一页</button>
|
||||||
<button @click="nextPage" :disabled="currentPage * pageSize >= chartDataCount.value">下一页</button>
|
<button @click="nextPage" :disabled="currentPage * pageSize >= chartDataCount.value" size="mini">下一页</button>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 数据表格 -->
|
<!-- 数据表格 -->
|
||||||
@ -39,7 +37,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>
|
||||||
@ -64,7 +62,7 @@
|
|||||||
</uni-col>
|
</uni-col>
|
||||||
<uni-col :span="5">
|
<uni-col :span="5">
|
||||||
<view class="dataStyle">
|
<view class="dataStyle">
|
||||||
{{ item.xb_dictText }}
|
{{ item.jcxd }}
|
||||||
</view>
|
</view>
|
||||||
</uni-col>
|
</uni-col>
|
||||||
<uni-col :span="5">
|
<uni-col :span="5">
|
||||||
@ -84,27 +82,18 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {
|
import { ref, reactive, onMounted, computed } from 'vue';
|
||||||
ref,
|
import * as echarts from 'echarts';
|
||||||
reactive,
|
import { cxcRyDatAstatistics, cxcRyDatAstatisticsDetails } from '@/api/renyuan.js';
|
||||||
onMounted,
|
import { initDictOption } from '@/api/common.js';
|
||||||
computed
|
|
||||||
} from 'vue';
|
|
||||||
import * as echarts from 'echarts';
|
|
||||||
import {
|
|
||||||
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,
|
||||||
@ -113,8 +102,8 @@
|
|||||||
{
|
{
|
||||||
text: '政治面貌',
|
text: '政治面貌',
|
||||||
value: 'zzmm',
|
value: 'zzmm',
|
||||||
isDict: false,
|
isDict: true,
|
||||||
dictCode: ''
|
dictCode: 'zzmm'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: '民族',
|
text: '民族',
|
||||||
@ -122,47 +111,45 @@
|
|||||||
isDict: true,
|
isDict: true,
|
||||||
dictCode: 'mz'
|
dictCode: 'mz'
|
||||||
}
|
}
|
||||||
]); // 字段列表
|
]); // 字段列表
|
||||||
|
|
||||||
const dictCode = ref("")
|
const dictCode = ref('');
|
||||||
const fieldisDict = ref(true);
|
const fieldisDict = ref(true);
|
||||||
|
|
||||||
|
const selectedOrgCode = ref(''); // 当前选择的单位 orgCode
|
||||||
|
const selectedOrgCodeLabel = ref('请选择单位'); // 当前选择的单位名称
|
||||||
|
const selectedField = ref(''); // 当前选择的字段
|
||||||
|
const selectedFieldLabel = ref('请选择字段'); // 当前选择的字段名称
|
||||||
|
const orgCodeGroupData = ref([]); //按照orgcode进行分组的数据 含劳动合同号
|
||||||
|
const chartData = ref({}); // 图表数据
|
||||||
|
const personnelList = ref([]); // 人员列表 initChart
|
||||||
|
const fieldValues = ref([]); //字段值
|
||||||
|
const fieldTexts = ref([]); //字段值
|
||||||
|
const chartOption = ref({});
|
||||||
|
|
||||||
const selectedOrgCode = ref(''); // 当前选择的单位 orgCode
|
const chartTitle = computed(() => {
|
||||||
const selectedOrgCodeLabel = ref('请选择单位'); // 当前选择的单位名称
|
|
||||||
const selectedField = ref(''); // 当前选择的字段
|
|
||||||
const selectedFieldLabel = ref('请选择字段'); // 当前选择的字段名称
|
|
||||||
const orgCodeGroupData = ref([]); //按照orgcode进行分组的数据 含劳动合同号
|
|
||||||
const chartData = ref({}); // 图表数据
|
|
||||||
const personnelList = ref([]); // 人员列表 initChart
|
|
||||||
const fieldValues = ref([]);
|
|
||||||
const chartOption = ref({});
|
|
||||||
|
|
||||||
const chartTitle = computed(() => {
|
|
||||||
return selectedOrgCodeLabel.value + '人员(' + selectedFieldLabel.value + ')分组统计';
|
return selectedOrgCodeLabel.value + '人员(' + selectedFieldLabel.value + ')分组统计';
|
||||||
});
|
});
|
||||||
|
|
||||||
//图标翻页
|
//图标翻页
|
||||||
const pageSize = ref(3); // 每页显示的项目数量
|
const pageSize = ref(3); // 每页显示的项目数量
|
||||||
const currentPage = ref(1); // 当前页码
|
const currentPage = ref(1); // 当前页码
|
||||||
|
|
||||||
function detail(record) {
|
function detail(record) {
|
||||||
// console.log(record)
|
// console.log(record)
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/views/renliziyuan/renyuanxinxi/detail?data=' + encodeURIComponent(JSON.stringify(record))
|
url: '/pages/views/renliziyuan/renyuanxinxi/detail?data=' + encodeURIComponent(JSON.stringify(record))
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// #ifdef APP
|
// #ifdef APP
|
||||||
getHeight();
|
getHeight();
|
||||||
// #endif
|
// #endif
|
||||||
|
});
|
||||||
|
// #ifdef APP
|
||||||
|
|
||||||
|
const getHeight = () => {
|
||||||
});
|
|
||||||
// #ifdef APP
|
|
||||||
|
|
||||||
const getHeight = () => {
|
|
||||||
// 获取屏幕高度
|
// 获取屏幕高度
|
||||||
const systemInfo = uni.getSystemInfoSync();
|
const systemInfo = uni.getSystemInfoSync();
|
||||||
const screenHeight = systemInfo.screenHeight;
|
const screenHeight = systemInfo.screenHeight;
|
||||||
@ -178,51 +165,56 @@
|
|||||||
bottomHeight.value = screenHeight - topComponentsHeight - 415;
|
bottomHeight.value = screenHeight - topComponentsHeight - 415;
|
||||||
})
|
})
|
||||||
.exec();
|
.exec();
|
||||||
};
|
};
|
||||||
|
|
||||||
// #endif
|
// #endif
|
||||||
// 初始化 ECharts length departChange
|
// 初始化 ECharts length departChange
|
||||||
// 初始化图表
|
// 初始化图表
|
||||||
const initChart = () => {
|
const initChart = () => {
|
||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
if (!chart.value) return;
|
if (!chart.value) return;
|
||||||
const myChart = await chart.value.init(echarts);
|
const myChart = await chart.value.init(echarts);
|
||||||
myChart.setOption(chartOption.value);
|
myChart.setOption(chartOption.value);
|
||||||
}, 300);
|
}, 300);
|
||||||
};
|
};
|
||||||
|
|
||||||
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) {
|
||||||
currentPage.value++;
|
currentPage.value++;
|
||||||
// 计算当前页数据的起始和结束索引
|
// 计算当前页数据的起始和结束索引
|
||||||
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 = (tempChartData) => {
|
const getChartOption = (ChartData) => {
|
||||||
// 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 = temp.slice(startIndex, endIndex);
|
const tempChartData = ChartData.slice(startIndex, endIndex);
|
||||||
|
try {
|
||||||
let xData = [];
|
let xData = [];
|
||||||
let seriesData = [];
|
let seriesData = [];
|
||||||
// console.log(1, temp);
|
console.log(1, tempChartData);
|
||||||
//当前机构下的数据 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);
|
||||||
});
|
});
|
||||||
@ -230,6 +222,7 @@
|
|||||||
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 {
|
||||||
@ -237,11 +230,16 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
seriesData.push({
|
seriesData.push({
|
||||||
name: fieldValues.value[i],
|
name: fieldValues.value[i].filedText,
|
||||||
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,
|
||||||
@ -278,7 +276,8 @@
|
|||||||
show: false //不显示坐标轴线
|
show: false //不显示坐标轴线
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
yAxis: [{
|
yAxis: [
|
||||||
|
{
|
||||||
show: true,
|
show: true,
|
||||||
boundaryGap: false, //解决数据与线不对应问题
|
boundaryGap: false, //解决数据与线不对应问题
|
||||||
type: 'value',
|
type: 'value',
|
||||||
@ -302,11 +301,12 @@
|
|||||||
axisLine: {
|
axisLine: {
|
||||||
show: false //不显示坐标轴线
|
show: false //不显示坐标轴线
|
||||||
}
|
}
|
||||||
}],
|
}
|
||||||
|
],
|
||||||
series: seriesData,
|
series: seriesData,
|
||||||
|
|
||||||
legend: {
|
legend: {
|
||||||
data: fieldValues.value,
|
data: legendData,
|
||||||
itemGap: 5,
|
itemGap: 5,
|
||||||
padding: [0, 15, 0, 15],
|
padding: [0, 15, 0, 15],
|
||||||
y: 'bottom',
|
y: 'bottom',
|
||||||
@ -315,27 +315,31 @@
|
|||||||
type: 'scroll'
|
type: 'scroll'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return tempOption
|
return tempOption;
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// 更新图表
|
// 更新图表
|
||||||
const updateChart = (tempchartData) => {
|
const updateChart = (tempchartData) => {
|
||||||
// 初始化图表
|
// 初始化图表
|
||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
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);
|
|
||||||
// console.log(updateData);
|
|
||||||
|
|
||||||
const ldhth = updateData.fieldValues[params.dataIndex].ldhth;
|
let updateData = findRyByOrgCode(orgCodeGroupData.value.children, params.name);
|
||||||
|
console.log(updateData);
|
||||||
|
|
||||||
|
const ldhth = updateData.fieldValues[params.seriesIndex].ldhth;
|
||||||
|
|
||||||
console.log(ldhth);
|
console.log(ldhth);
|
||||||
|
|
||||||
@ -345,14 +349,14 @@
|
|||||||
// updateChart(updateData);
|
// updateChart(updateData);
|
||||||
});
|
});
|
||||||
}, 300);
|
}, 300);
|
||||||
};
|
};
|
||||||
//根据一个键值查找数据
|
//根据一个键值查找数据
|
||||||
//查找人员劳动合同号
|
//查找人员劳动合同号
|
||||||
function findRyByOrgCode(treeData, targetOrgCode) {
|
function findRyByOrgCode(treeData, targetOrgCode) {
|
||||||
// console.log(treeData, targetOrgCode);
|
// console.log(treeData, targetOrgCode);
|
||||||
for (const node of treeData) {
|
for (const node of treeData) {
|
||||||
// 如果当前节点匹配,直接返回该节点及其子节点
|
// 如果当前节点匹配,直接返回该节点及其子节点
|
||||||
if (node.orgCode === targetOrgCode) {
|
if (node.orgText === targetOrgCode) {
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
// 递归检查子节点
|
// 递归检查子节点
|
||||||
@ -362,15 +366,15 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 从echart图标的树状数据中根据 orgCode 获取节点及其子节点数据
|
* 从echart图标的树状数据中根据 orgCode 获取节点及其子节点数据
|
||||||
* @param {Array} treeData 树状数据
|
* @param {Array} treeData 树状数据
|
||||||
* @param {string} targetOrgCode 目标 orgCode
|
* @param {string} targetOrgCode 目标 orgCode
|
||||||
* @returns {Object|null} 匹配的节点及其子节点数据,未找到返回 null
|
* @returns {Object|null} 匹配的节点及其子节点数据,未找到返回 null
|
||||||
*/
|
*/
|
||||||
function findNodeByOrgCode(treeData, targetOrgCode) {
|
function findNodeByOrgCode(treeData, targetOrgCode) {
|
||||||
// console.log(treeData, targetOrgCode);
|
// console.log(treeData, targetOrgCode);
|
||||||
for (const node of treeData) {
|
for (const node of treeData) {
|
||||||
// 如果当前节点匹配,直接返回该节点及其子节点
|
// 如果当前节点匹配,直接返回该节点及其子节点
|
||||||
@ -384,41 +388,64 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取所有的fieldValue
|
//获取所有的fieldValue
|
||||||
function collectUniqueKeyValues(tree, key) {
|
function collectUniqueKeyFieldValues(tree) {
|
||||||
const uniqueValues = new Set(); // 使用Set来自动处理唯一性
|
const uniqueMap = new Map();
|
||||||
|
tree.forEach((item) => {
|
||||||
|
const { fieldValue, filedText } = item;
|
||||||
|
const key = `${fieldValue}-${filedText}`;
|
||||||
|
|
||||||
function traverse(node) {
|
if (!uniqueMap.has(key)) {
|
||||||
if (node[key] !== undefined) {
|
uniqueMap.set(key, {
|
||||||
uniqueValues.add(node[key]);
|
fieldValue,
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tree.forEach((node) => traverse(node)); // 假设tree是一个数组
|
// 查找指定 orgCode 对应的 orgText 的方法
|
||||||
|
findOrgText(orgCode) {
|
||||||
return Array.from(uniqueValues); // 将Set转换为数组
|
return this.orgCodeToOrgTextMap[orgCode];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 示例用法
|
// 示例用法
|
||||||
// const result = findNodeByOrgCode(echartData, "A01A01A01A01");
|
// const result = findNodeByOrgCode(echartData, "A01A01A01A01");
|
||||||
// console.log(result);
|
// console.log(result);
|
||||||
/**
|
/**
|
||||||
* 转换数据为支持钻取的ECharts格式
|
* 转换数据为支持钻取的ECharts格式
|
||||||
* @param {Array} data 原始数据
|
* @param {Array} data 原始数据
|
||||||
* @param {string} selectOrgCode 当前选择的组织编码
|
* @param {string} selectOrgCode 当前选择的组织编码
|
||||||
* @returns {Object} 包含当前层级数据和子节点信息的对象 符合echart的格式
|
* @returns {Object} 包含当前层级数据和子节点信息的对象 符合echart的格式
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------------------
|
||||||
function transformData(selectOrgCode, data) {
|
function transformData(selectOrgCode, data) {
|
||||||
const nodes = new Map();
|
const nodes = new Map();
|
||||||
//获取所有的fieldValue 用于图例和钻取和data[]中的数据顺序保持一致 动态建立fieldValue的数据
|
//获取所有的fieldValue 用于图例和钻取和data[]中的数据顺序保持一致 动态建立fieldValue的数据
|
||||||
fieldValues.value = collectUniqueKeyValues(data, 'fieldValue');
|
fieldValues.value = collectUniqueKeyFieldValues(data);
|
||||||
|
// 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 = [];
|
||||||
@ -438,25 +465,30 @@
|
|||||||
// 创建所有节点并建立父子关系
|
// 创建所有节点并建立父子关系
|
||||||
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 = parseInt(entry.fieldValue, 10);
|
const fieldValue = entry.fieldValue;
|
||||||
|
|
||||||
for (let i = 0; i < fieldValues.value.length; i++) {
|
for (let i = 0; i < fieldValues.value.length; i++) {
|
||||||
if (fieldValue === parseInt(fieldValues.value[i], 10)) {
|
if (fieldValue === fieldValues.value[i].fieldValue) {
|
||||||
// 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;
|
||||||
}
|
}
|
||||||
@ -501,45 +533,54 @@
|
|||||||
|
|
||||||
// 递归计算每个根节点的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) {
|
||||||
return {
|
// // console.log(node);
|
||||||
name: node.orgCode,
|
// return {
|
||||||
type: 'bar',
|
// orgCode: node.orgCode,
|
||||||
data: node.data,
|
// name: node.name,
|
||||||
children: node.children.map((child) => formatTree(child))
|
// type: 'bar',
|
||||||
};
|
// data: node.data,
|
||||||
}
|
// children: node.children.map((child) => formatTree(child))
|
||||||
|
// };
|
||||||
|
// }
|
||||||
|
|
||||||
return rootNodes.map((root) => formatTree(root));
|
// return rootNodes.map((root) => {
|
||||||
}
|
// console.log(root);
|
||||||
|
// formatTree(root);
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------------------
|
||||||
|
|
||||||
//根据 orgCode 的分级格式,递归地汇总本级及其所有下级的数据,并将下级数据放在本级的 children 属性中。 deepseek
|
//根据 orgCode 的分级格式,递归地汇总本级及其所有下级的数据,并将下级数据放在本级的 children 属性中。 deepseek
|
||||||
|
|
||||||
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));
|
||||||
console.log(2, filteredData)
|
const orgMapper = new OrgCodeMapper(data);
|
||||||
// 如果过滤后的数据为空,返回 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.orgCode, 11, groupedByFieldValue[item.fieldValue]);
|
// console.log(item);
|
||||||
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: []
|
||||||
};
|
};
|
||||||
@ -549,18 +590,25 @@
|
|||||||
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,
|
||||||
fieldValues: Object.keys(groupedByFieldValue).map((fieldValue) => ({
|
orgText: orgMapper.findOrgText(orgCode),
|
||||||
|
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: []
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -576,30 +624,29 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} 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);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
// 获取统计数据 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,
|
||||||
@ -607,66 +654,70 @@
|
|||||||
dictCode: dictCode.value,
|
dictCode: dictCode.value,
|
||||||
fieldisDict: fieldisDict.value
|
fieldisDict: fieldisDict.value
|
||||||
});
|
});
|
||||||
console.log(res); //deepseek
|
// console.log(res); //deepseek
|
||||||
if (res.length === 0) {
|
if (res.success) {
|
||||||
|
// console.log(selectedOrgCode.value, res);
|
||||||
|
if (res.result.length < 1) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "查询数据为空"
|
title: '查询数据为空'
|
||||||
})
|
});
|
||||||
return
|
return;
|
||||||
} else {
|
|
||||||
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]
|
|
||||||
}
|
}
|
||||||
console.log(temp)
|
//按单位进行分组
|
||||||
chartDataCount.value = temp.length;
|
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 {
|
||||||
|
chartData.value = temp[0];
|
||||||
|
}
|
||||||
|
chartDataCount.value = chartData.value.length;
|
||||||
// console.log(chartData.value);
|
// console.log(chartData.value);
|
||||||
updateChart(temp);
|
updateChart(chartData.value);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取统计数据失败:', error);
|
console.error('获取统计数据失败:', error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 获取人员列表 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);
|
||||||
personnelList.value = res.data;
|
if (res.success) {
|
||||||
|
personnelList.value = res.result;
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取人员列表失败:', error);
|
console.error('获取人员列表失败:', error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 事件处理
|
// 事件处理
|
||||||
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();
|
||||||
@ -674,108 +725,94 @@
|
|||||||
//TODO handle the exception
|
//TODO handle the exception
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const onChartClick = (e) => {
|
const onChartClick = (e) => {
|
||||||
const {
|
const { ldhth } = chartData.value;
|
||||||
ldhth
|
|
||||||
} = chartData.value;
|
|
||||||
if (ldhth && ldhth.length > 0) {
|
if (ldhth && ldhth.length > 0) {
|
||||||
fetchPersonnelList(ldhth);
|
fetchPersonnelList(ldhth);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
/* 颜色变量 */
|
/* 颜色变量 */
|
||||||
:root {
|
:root {
|
||||||
--primary-blue: #409eff;
|
--primary-blue: #409eff;
|
||||||
--deep-blue: #2c7be5;
|
--deep-blue: #2c7be5;
|
||||||
--light-blue: #ecf5ff;
|
--light-blue: #ecf5ff;
|
||||||
--gradient-start: #6b8cff;
|
--gradient-start: #6b8cff;
|
||||||
--gradient-end: #4364f7;
|
--gradient-end: #4364f7;
|
||||||
--hover-blue: #66b1ff;
|
--hover-blue: #66b1ff;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 全局容器 */
|
/* 全局容器 */
|
||||||
.container {
|
.container {
|
||||||
margin: 10rpx 10rpx;
|
margin: 10rpx 10rpx;
|
||||||
padding: 10rpx;
|
padding: 10rpx;
|
||||||
background: linear-gradient(145deg, #f5f9ff, var(--light-blue));
|
background: linear-gradient(145deg, #f5f9ff, var(--light-blue));
|
||||||
border-radius: 24rpx;
|
border-radius: 24rpx;
|
||||||
box-shadow: 0 8rpx 24rpx rgba(64, 158, 255, 0.15);
|
box-shadow: 0 8rpx 24rpx rgba(64, 158, 255, 0.15);
|
||||||
border: 2rpx solid rgba(64, 158, 255, 0.1);
|
border: 2rpx solid rgba(64, 158, 255, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 图表容器 */
|
/* 图表容器 */
|
||||||
.chart-container {
|
.chart-container {
|
||||||
height: 50vh;
|
height: 200px;
|
||||||
margin: 20rpx 0;
|
margin: 20rpx 0;
|
||||||
border-radius: 24rpx;
|
border-radius: 24rpx;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
box-shadow: 0 8rpx 32rpx rgba(64, 158, 255, 0.12);
|
box-shadow: 0 8rpx 32rpx rgba(64, 158, 255, 0.12);
|
||||||
border: 2rpx solid rgba(64, 158, 255, 0.08);
|
border: 2rpx solid rgba(64, 158, 255, 0.08);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 表格标题行 */
|
/* 表格标题行 */
|
||||||
.titleStyle {
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-weight: 600;
|
|
||||||
color: #ffffff;
|
|
||||||
background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
|
|
||||||
padding: 28rpx 0;
|
|
||||||
border-radius: 16rpx 16rpx 0 0;
|
|
||||||
box-shadow: 0 4rpx 12rpx rgba(67, 100, 247, 0.2);
|
|
||||||
letter-spacing: 1rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 数据行 */
|
.titleStyle {
|
||||||
.dataStyle {
|
font-size: 12px;
|
||||||
font-size: 28rpx;
|
color: #747474;
|
||||||
color: #3a466b;
|
line-height: 30px;
|
||||||
padding: 32rpx 0;
|
height: 30px;
|
||||||
background: #ffffff;
|
background: #f2f9fc;
|
||||||
border-bottom: 2rpx solid #f0f6ff;
|
text-align: center;
|
||||||
transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
|
vertical-align: middle;
|
||||||
}
|
border-left: 1px solid #919191;
|
||||||
|
border-bottom: 1px solid #919191;
|
||||||
|
}
|
||||||
|
|
||||||
.dataStyle:hover {
|
/* 内容样式 */
|
||||||
background: #f8fbff;
|
.dataStyle {
|
||||||
transform: translateY(-2rpx);
|
max-font-size: 14px;
|
||||||
}
|
/* 最大字体限制 */
|
||||||
|
min-font-size: 10px;
|
||||||
|
/* 最小字体限制 */
|
||||||
|
font-size: 12px;
|
||||||
|
color: #00007f;
|
||||||
|
line-height: 30px;
|
||||||
|
height: 30px;
|
||||||
|
font-weight: 500;
|
||||||
|
text-align: center;
|
||||||
|
vertical-align: middle;
|
||||||
|
border-bottom: 1px solid #919191;
|
||||||
|
border-left: 1px solid #919191;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
/* 操作按钮 */
|
/* 滚动区域 */
|
||||||
button[type='primary'] {
|
scroll-view {
|
||||||
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));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 滚动区域 */
|
|
||||||
scroll-view {
|
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
border-radius: 0 0 16rpx 16rpx;
|
border-radius: 0 0 16rpx 16rpx;
|
||||||
box-shadow: 0 8rpx 24rpx rgba(0, 35, 111, 0.08);
|
box-shadow: 0 8rpx 24rpx rgba(0, 35, 111, 0.08);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 输入框聚焦效果 */
|
/* 输入框聚焦效果 */
|
||||||
.trq-depart-select:focus-within {
|
.trq-depart-select:focus-within {
|
||||||
box-shadow: 0 0 0 4rpx rgba(64, 158, 255, 0.2);
|
box-shadow: 0 0 0 4rpx rgba(64, 158, 255, 0.2);
|
||||||
border-color: var(--primary-blue);
|
border-color: var(--primary-blue);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 加载动画优化 */
|
/* 加载动画优化 */
|
||||||
@keyframes fadeIn {
|
@keyframes fadeIn {
|
||||||
from {
|
from {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transform: translateY(20rpx);
|
transform: translateY(20rpx);
|
||||||
@ -785,35 +822,35 @@
|
|||||||
opacity: 1;
|
opacity: 1;
|
||||||
transform: translateY(0);
|
transform: translateY(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.container>* {
|
.container > * {
|
||||||
animation: fadeIn 0.6s cubic-bezier(0.23, 1, 0.32, 1);
|
animation: fadeIn 0.6s cubic-bezier(0.23, 1, 0.32, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 自定义滚动条美化 */
|
/* 自定义滚动条美化 */
|
||||||
::-webkit-scrollbar {
|
::-webkit-scrollbar {
|
||||||
width: 8rpx;
|
width: 8rpx;
|
||||||
background: rgba(64, 158, 255, 0.05);
|
background: rgba(64, 158, 255, 0.05);
|
||||||
}
|
}
|
||||||
|
|
||||||
::-webkit-scrollbar-thumb {
|
::-webkit-scrollbar-thumb {
|
||||||
background: linear-gradient(45deg, var(--primary-blue), var(--deep-blue));
|
background: linear-gradient(45deg, var(--primary-blue), var(--deep-blue));
|
||||||
border-radius: 12rpx;
|
border-radius: 12rpx;
|
||||||
border: 2rpx solid white;
|
border: 2rpx solid white;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 筛选行间距优化 */
|
/* 筛选行间距优化 */
|
||||||
.filter-row {
|
.filter-row {
|
||||||
margin: 30rpx 0;
|
margin: 30rpx 0;
|
||||||
padding: 20rpx 0;
|
padding: 20rpx 0;
|
||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 响应式调整优化 */
|
/* 响应式调整优化 */
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
.chart-container {
|
.chart-container {
|
||||||
height: 55vh;
|
height: 200px;
|
||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -821,19 +858,14 @@
|
|||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
padding: 24rpx 0;
|
padding: 24rpx 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
button[type='primary'] {
|
/* 数据行高亮效果 */
|
||||||
padding: 10rpx 24rpx;
|
.data-row:nth-child(even) {
|
||||||
font-size: 24rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 数据行高亮效果 */
|
|
||||||
.data-row:nth-child(even) {
|
|
||||||
background: rgba(236, 245, 255, 0.3);
|
background: rgba(236, 245, 255, 0.3);
|
||||||
}
|
}
|
||||||
|
|
||||||
.data-row:hover {
|
.data-row:hover {
|
||||||
box-shadow: 0 4rpx 12rpx rgba(64, 158, 255, 0.1);
|
box-shadow: 0 4rpx 12rpx rgba(64, 158, 255, 0.1);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
Loading…
Reference in New Issue
Block a user