Compare commits
2 Commits
8cf96126fe
...
8050b65ea8
Author | SHA1 | Date | |
---|---|---|---|
8050b65ea8 | |||
ebf06cffaa |
@ -1,16 +0,0 @@
|
|||||||
import {
|
|
||||||
https
|
|
||||||
} from '@/utils/http.js';
|
|
||||||
/*
|
|
||||||
这是后端系统通用的系统类的基础性的api路径,后续的大家分类建js存放
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export function initDictOption(dictCode) { // 获取部门所有人员信息
|
|
||||||
return https({
|
|
||||||
url: ' /sys/dict/getDictItems',
|
|
||||||
method: 'get',
|
|
||||||
data: dictCode
|
|
||||||
})
|
|
||||||
}
|
|
4
package-lock.json
generated
4
package-lock.json
generated
@ -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": {
|
||||||
|
@ -85,6 +85,7 @@
|
|||||||
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 { cxcRyDatAstatistics, cxcRyDatAstatisticsDetails } from '@/api/renyuan.js';
|
||||||
|
import { initDictOption } from '@/api/common.js';
|
||||||
|
|
||||||
// 存储下方组件的高度 tableData
|
// 存储下方组件的高度 tableData
|
||||||
const bottomHeight = ref(0);
|
const bottomHeight = ref(0);
|
||||||
@ -756,7 +757,7 @@ const onChartClick = (e) => {
|
|||||||
|
|
||||||
/* 图表容器 */
|
/* 图表容器 */
|
||||||
.chart-container {
|
.chart-container {
|
||||||
height: 250px;
|
height: 200px;
|
||||||
margin: 20rpx 0;
|
margin: 20rpx 0;
|
||||||
border-radius: 24rpx;
|
border-radius: 24rpx;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@ -849,9 +850,14 @@ scroll-view {
|
|||||||
/* 响应式调整优化 */
|
/* 响应式调整优化 */
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
.chart-container {
|
.chart-container {
|
||||||
height: 250px;
|
height: 200px;
|
||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.titleStyle {
|
||||||
|
font-size: 26rpx;
|
||||||
|
padding: 24rpx 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 数据行高亮效果 */
|
/* 数据行高亮效果 */
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view class="container" id="top1">
|
<view class="container" id="top1">
|
||||||
<uni-row style="margin-bottom: 10rpx; margin-left: 30rpx; margin-right: 30rpx">
|
<uni-row style="margin-bottom: 10rpx;margin-left: 30rpx;margin-right: 30rpx;">
|
||||||
<uni-col :span="24"><uni-title :title="'所选单位'" align="left" type="h4"></uni-title></uni-col>
|
<uni-col :span="24"><uni-title :title="'所选单位ID:'+orgCode" align="left" type="h4"></uni-title></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="24">
|
<uni-col :span="24">
|
||||||
<trq-depart-select v-model="orgCode" returnCodeOrID="orgCode" @change="departChange"></trq-depart-select>
|
<trq-depart-select v-model="orgCode" returnCodeOrID="orgCode"
|
||||||
|
@change="departChange"></trq-depart-select>
|
||||||
</uni-col>
|
</uni-col>
|
||||||
</uni-row>
|
</uni-row>
|
||||||
<!-- 概览统计 -->
|
<!-- 概览统计 -->
|
||||||
@ -26,28 +27,39 @@
|
|||||||
<l-echart ref="chart" @finished="initChart" />
|
<l-echart ref="chart" @finished="initChart" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<!-- 数据表格 -->
|
<!-- 数据表格 -->
|
||||||
|
|
||||||
<uni-row style="margin-top: 10px; margin-left: 30rpx; margin-right: 30rpx" v-if="tableData.length > 0">
|
<uni-row style="margin-top: 10px; margin-left: 30rpx;margin-right: 30rpx;" v-if="tableData.length>0">
|
||||||
<uni-col :span="3">
|
<uni-col :span="3">
|
||||||
<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>
|
||||||
</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="6">
|
<uni-col :span="6">
|
||||||
<view class="titleStyle">操作</view>
|
<view class="titleStyle">
|
||||||
|
操作
|
||||||
|
</view>
|
||||||
</uni-col>
|
</uni-col>
|
||||||
</uni-row>
|
</uni-row>
|
||||||
|
|
||||||
<scroll-view scroll-y :style="{height: bottomHeight + 'px' }">
|
<scroll-view scroll-y :style="{height: bottomHeight + 'px' }">
|
||||||
<uni-row style="margin-bottom: 10rpx; margin-left: 30rpx; margin-right: 30rpx">
|
<uni-row style="margin-bottom: 10rpx;margin-left: 30rpx;margin-right: 30rpx;">
|
||||||
<view v-for="(item,index) in tableData">
|
<view v-for="(item,index) in tableData">
|
||||||
<uni-col :span="3">
|
<uni-col :span="3">
|
||||||
<view class="dataStyle">
|
<view class="dataStyle">
|
||||||
@ -58,13 +70,11 @@
|
|||||||
<view class="dataStyle">
|
<view class="dataStyle">
|
||||||
{{item.xm}}
|
{{item.xm}}
|
||||||
</view>
|
</view>
|
||||||
</uni-col>
|
</uni-col><uni-col :span="5">
|
||||||
<uni-col :span="5">
|
|
||||||
<view class="dataStyle">
|
<view class="dataStyle">
|
||||||
{{item.xb_dictText}}
|
{{item.xb_dictText}}
|
||||||
</view>
|
</view>
|
||||||
</uni-col>
|
</uni-col><uni-col :span="5">
|
||||||
<uni-col :span="5">
|
|
||||||
<view class="dataStyle">
|
<view class="dataStyle">
|
||||||
{{item.nl}}
|
{{item.nl}}
|
||||||
</view>
|
</view>
|
||||||
@ -74,17 +84,26 @@
|
|||||||
<button size="mini" type="primary" @click="detail(item)">详情</button>
|
<button size="mini" type="primary" @click="detail(item)">详情</button>
|
||||||
</view>
|
</view>
|
||||||
</uni-col>
|
</uni-col>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</uni-row>
|
</uni-row>
|
||||||
|
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, onMounted } from 'vue';
|
import {
|
||||||
import * as echarts from 'echarts';
|
ref,
|
||||||
|
reactive,
|
||||||
|
onMounted
|
||||||
|
} from 'vue';
|
||||||
|
import * as echarts from 'echarts'
|
||||||
|
|
||||||
import { queryRenyuanByDepartID } from '@/api/renyuan.js';
|
import {
|
||||||
|
queryRenyuanByDepartID
|
||||||
|
} from '@/api/renyuan.js'
|
||||||
|
|
||||||
// 存储下方组件的高度
|
// 存储下方组件的高度
|
||||||
const bottomHeight = ref(0);
|
const bottomHeight = ref(0);
|
||||||
@ -106,8 +125,8 @@ const drillTitle = ref('');
|
|||||||
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))
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
// 计算年龄initChart
|
// 计算年龄initChart
|
||||||
const calculateAge = (birthDate) => {
|
const calculateAge = (birthDate) => {
|
||||||
@ -122,22 +141,21 @@ const calculateAge = (birthDate) => {
|
|||||||
};
|
};
|
||||||
// 加载数据
|
// 加载数据
|
||||||
const departChange = async (e, data) => {
|
const departChange = async (e, data) => {
|
||||||
tableData.value = [];
|
|
||||||
console.log(e);
|
tableData.value = []
|
||||||
|
console.log(e)
|
||||||
orgCode.value = e;
|
orgCode.value = e;
|
||||||
try {
|
try {
|
||||||
// 显示加载状态
|
// 显示加载状态
|
||||||
|
|
||||||
isLoading.value = true;
|
isLoading.value = true;
|
||||||
if (orgCode.value.length <= 6) {
|
if (orgCode.value.length <= 6) {
|
||||||
console.log(123242353);
|
|
||||||
uni.showToast({
|
console.log(123242353)
|
||||||
title: '全厂数据较多,请选 下一层级...',
|
uni.showLoading({
|
||||||
icon: 'none',
|
title: '全厂数据较多,耐心等待数据加载中...',
|
||||||
duration: 1000
|
mask: true
|
||||||
});
|
});
|
||||||
isLoading.value = false;
|
|
||||||
return;
|
|
||||||
} else {
|
} else {
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '数据加载中...',
|
title: '数据加载中...',
|
||||||
@ -150,34 +168,34 @@ const departChange = async (e, data) => {
|
|||||||
fields: ['xm', 'nl', 'xb', 'xb_dictText', 'orgCode', 'jcdw', 'jcxd', 'jcxdCode']
|
fields: ['xm', 'nl', 'xb', 'xb_dictText', 'orgCode', 'jcdw', 'jcxd', 'jcxdCode']
|
||||||
};
|
};
|
||||||
if (orgCode.value.length <= 9) {
|
if (orgCode.value.length <= 9) {
|
||||||
params.orgCode = orgCode.value;
|
params.orgCode = orgCode.value
|
||||||
} else {
|
} else {
|
||||||
params.jcxd_code = orgCode.value;
|
params.jcxd_code = orgCode.value
|
||||||
|
|
||||||
}
|
}
|
||||||
queryRenyuanByDepartID(params)
|
queryRenyuanByDepartID(params).then((res) => {
|
||||||
.then((res) => {
|
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
processData(res.result.records);
|
processData(res.result.records);
|
||||||
|
|
||||||
// 隐藏加载状态
|
// 隐藏加载状态
|
||||||
isLoading.value = false;
|
isLoading.value = false;
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}).catch((err) => {
|
||||||
|
console.log(err)
|
||||||
|
uni.showToast({
|
||||||
|
title: '数据加载失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
|
||||||
console.log(err);
|
|
||||||
uni.showToast({
|
|
||||||
title: '数据加载失败',
|
|
||||||
icon: 'none',
|
|
||||||
duration: 1000
|
|
||||||
});
|
|
||||||
});
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error)
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '数据加载失败',
|
title: '数据加载失败',
|
||||||
icon: 'none',
|
icon: 'none'
|
||||||
duration: 1000
|
|
||||||
});
|
});
|
||||||
} finally {
|
} finally {
|
||||||
// 隐藏加载状态
|
// 隐藏加载状态
|
||||||
@ -186,15 +204,15 @@ const departChange = async (e, data) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// 数据处理
|
// 数据处理
|
||||||
const processData = (data) => {
|
const processData = (data) => {
|
||||||
|
|
||||||
// 添加年龄字段并过滤有效数据
|
// 添加年龄字段并过滤有效数据
|
||||||
const validData = data
|
const validData = data.map(item => ({
|
||||||
.map((item) => ({
|
|
||||||
...item,
|
...item,
|
||||||
nl: calculateAge(item.cssj)
|
nl: calculateAge(item.cssj)
|
||||||
}))
|
})).filter(item => item.nl >= 21 && item.nl <= 64);
|
||||||
.filter((item) => item.nl >= 21 && item.nl <= 64);
|
|
||||||
// 计算概览数据
|
// 计算概览数据
|
||||||
summary.total = validData.length;
|
summary.total = validData.length;
|
||||||
summary.avgAge = validData.reduce((sum, cur) => sum + cur.nl, 0) / summary.total || 0;
|
summary.avgAge = validData.reduce((sum, cur) => sum + cur.nl, 0) / summary.total || 0;
|
||||||
@ -204,25 +222,27 @@ const processData = (data) => {
|
|||||||
groupsData(validData);
|
groupsData(validData);
|
||||||
// 生成图表数据
|
// 生成图表数据
|
||||||
generateChartData(validData);
|
generateChartData(validData);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 计算统计信息...
|
// 计算统计信息...
|
||||||
const subOrgStaffs = ref({}); // 按下级单位存储所有人员
|
const subOrgStaffs = ref({}); // 按下级单位存储所有人员
|
||||||
const ageGroupStaffs = ref({}); // 按年龄段存储所有人员
|
const ageGroupStaffs = ref({}); // 按年龄段存储所有人员
|
||||||
|
|
||||||
|
|
||||||
const groupsData = (data) => {
|
const groupsData = (data) => {
|
||||||
// 清空旧数据
|
// 清空旧数据
|
||||||
subOrgStaffs.value = {};
|
subOrgStaffs.value = {};
|
||||||
ageGroupStaffs.value = {};
|
ageGroupStaffs.value = {};
|
||||||
data.reduce((acc, cur) => {
|
data.reduce((acc, cur) => {
|
||||||
// console.log(cur)
|
// console.log(cur)
|
||||||
let subOrg = '';
|
let subOrg = "";
|
||||||
let ageRange = getAgeRange(cur.nl);
|
let ageRange = getAgeRange(cur.nl);
|
||||||
// console.log(cur.orgCode, cur.jcxdCode)
|
// console.log(cur.orgCode, cur.jcxdCode)
|
||||||
if (cur.orgCode <= 6) {
|
if (cur.orgCode <= 6) {
|
||||||
subOrg = cur.orgCode;
|
subOrg = cur.orgCode
|
||||||
} else {
|
} else {
|
||||||
subOrg = cur.jcxdCode;
|
subOrg = cur.jcxdCode
|
||||||
}
|
}
|
||||||
|
|
||||||
// 存储到subOrgStaffs
|
// 存储到subOrgStaffs
|
||||||
@ -236,8 +256,9 @@ const groupsData = (data) => {
|
|||||||
ageGroupStaffs.value[ageRange] = [];
|
ageGroupStaffs.value[ageRange] = [];
|
||||||
}
|
}
|
||||||
ageGroupStaffs.value[ageRange].push(cur);
|
ageGroupStaffs.value[ageRange].push(cur);
|
||||||
});
|
})
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
// 新增年龄范围计算方法
|
// 新增年龄范围计算方法
|
||||||
const getAgeRange = (age) => {
|
const getAgeRange = (age) => {
|
||||||
@ -249,7 +270,9 @@ const getAgeRange = (age) => {
|
|||||||
// 修改后的显示人员列表方法
|
// 修改后的显示人员列表方法
|
||||||
const showStaffList = (subOrg, ageRange) => {
|
const showStaffList = (subOrg, ageRange) => {
|
||||||
// 从结构化数据中直接获取
|
// 从结构化数据中直接获取
|
||||||
const targetStaffs = subOrgStaffs.value[subOrg].filter((staff) => getAgeRange(staff.nl) === ageRange);
|
const targetStaffs = subOrgStaffs.value[subOrg].filter(staff =>
|
||||||
|
getAgeRange(staff.nl) === ageRange
|
||||||
|
);
|
||||||
|
|
||||||
staffList.value = targetStaffs;
|
staffList.value = targetStaffs;
|
||||||
popupTitle.value = `${subOrg} ${ageRange}人员列表(共${targetStaffs.length}人)`;
|
popupTitle.value = `${subOrg} ${ageRange}人员列表(共${targetStaffs.length}人)`;
|
||||||
@ -284,13 +307,14 @@ const generateChartData = (data) => {
|
|||||||
return acc;
|
return acc;
|
||||||
}, {});
|
}, {});
|
||||||
|
|
||||||
|
|
||||||
// 生成分组柱状图配置
|
// 生成分组柱状图配置
|
||||||
const xData = Object.keys(jcdwGroups);
|
const xData = Object.keys(jcdwGroups);
|
||||||
|
|
||||||
const seriesData = ageRanges.map((range, index) => ({
|
const seriesData = ageRanges.map((range, index) => ({
|
||||||
name: range,
|
name: range,
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
data: xData.map((jcdw) => jcdwGroups[jcdw].ageGroups[index] || 0),
|
data: xData.map(jcdw => jcdwGroups[jcdw].ageGroups[index] || 0),
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
color: ['#5470C6', '#91CC75', '#FAC858', '#EE6666', '#73C0DE'][index]
|
color: ['#5470C6', '#91CC75', '#FAC858', '#EE6666', '#73C0DE'][index]
|
||||||
},
|
},
|
||||||
@ -298,14 +322,14 @@ const generateChartData = (data) => {
|
|||||||
label: {
|
label: {
|
||||||
show: true,
|
show: true,
|
||||||
position: 'top'
|
position: 'top'
|
||||||
}
|
},
|
||||||
// 设置柱宽为 20 像素
|
// 设置柱宽为 20 像素
|
||||||
// barWidth: 20
|
// barWidth: 20
|
||||||
}));
|
}))
|
||||||
chartOption.value = {
|
chartOption.value = {
|
||||||
title: {
|
title: {
|
||||||
text: '人员年龄分组统计',
|
text: '人员年龄分组统计',
|
||||||
padding: [0, 0, 0, 30]
|
padding: [0, 0, 0, 30],
|
||||||
},
|
},
|
||||||
toolbox: {
|
toolbox: {
|
||||||
padding: [0, 30, 0, 0],
|
padding: [0, 30, 0, 0],
|
||||||
@ -353,7 +377,7 @@ const generateChartData = (data) => {
|
|||||||
color: '#7F84B5',
|
color: '#7F84B5',
|
||||||
fontWeight: 300,
|
fontWeight: 300,
|
||||||
interval: 0,
|
interval: 0,
|
||||||
rotate: 0
|
rotate: 0,
|
||||||
},
|
},
|
||||||
padding: [0, 10, 0, 10],
|
padding: [0, 10, 0, 10],
|
||||||
axisTick: {
|
axisTick: {
|
||||||
@ -363,8 +387,7 @@ const generateChartData = (data) => {
|
|||||||
show: false //不显示坐标轴线
|
show: false //不显示坐标轴线
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
yAxis: [
|
yAxis: [{
|
||||||
{
|
|
||||||
show: true,
|
show: true,
|
||||||
boundaryGap: false, //解决数据与线不对应问题
|
boundaryGap: false, //解决数据与线不对应问题
|
||||||
type: 'value',
|
type: 'value',
|
||||||
@ -388,33 +411,37 @@ const generateChartData = (data) => {
|
|||||||
axisLine: {
|
axisLine: {
|
||||||
show: false //不显示坐标轴线
|
show: false //不显示坐标轴线
|
||||||
}
|
}
|
||||||
}
|
}],
|
||||||
],
|
|
||||||
|
series: seriesData,
|
||||||
|
|
||||||
series: seriesData
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 初始化图表
|
// 初始化图表
|
||||||
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)
|
||||||
myChart.on('click', (params) => {
|
myChart.on('click', (params) => {
|
||||||
console.log(params.seriesName);
|
console.log(params.seriesName)
|
||||||
tableData.value = getAgeGroupStaffs(params.seriesName);
|
tableData.value = getAgeGroupStaffs(params.seriesName)
|
||||||
});
|
|
||||||
}, 300);
|
})
|
||||||
|
}, 300)
|
||||||
|
|
||||||
|
|
||||||
// #ifdef APP
|
// #ifdef APP
|
||||||
getHeight();
|
getHeight();
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|
||||||
// #ifdef APP
|
// #ifdef APP
|
||||||
getHeight();
|
getHeight();
|
||||||
// #endif
|
// #endif
|
||||||
});
|
})
|
||||||
// #ifdef APP
|
// #ifdef APP
|
||||||
|
|
||||||
const getHeight = () => {
|
const getHeight = () => {
|
||||||
@ -428,7 +455,7 @@ const getHeight = () => {
|
|||||||
.select('#top1')
|
.select('#top1')
|
||||||
.boundingClientRect((rect1) => {
|
.boundingClientRect((rect1) => {
|
||||||
// 计算上方组件高度总和
|
// 计算上方组件高度总和
|
||||||
const topComponentsHeight = rect1.height;
|
const topComponentsHeight = rect1.height
|
||||||
// 计算下方组件的高度
|
// 计算下方组件的高度
|
||||||
bottomHeight.value = screenHeight - topComponentsHeight - 415;
|
bottomHeight.value = screenHeight - topComponentsHeight - 415;
|
||||||
})
|
})
|
||||||
@ -439,10 +466,10 @@ const getHeight = () => {
|
|||||||
// 初始化图表
|
// 初始化图表
|
||||||
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)
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -465,7 +492,7 @@ const initChart = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.query-btn {
|
.query-btn {
|
||||||
background: #007aff;
|
background: #007AFF;
|
||||||
color: white;
|
color: white;
|
||||||
padding: 0 40rpx;
|
padding: 0 40rpx;
|
||||||
border-radius: 8rpx;
|
border-radius: 8rpx;
|
||||||
@ -507,11 +534,12 @@ const initChart = () => {
|
|||||||
color: #747474;
|
color: #747474;
|
||||||
line-height: 30px;
|
line-height: 30px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
background: #f2f9fc;
|
background: #F2F9FC;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
border-left: 1px solid #919191;
|
border-left: 1px solid #919191;
|
||||||
border-bottom: 1px solid #919191;
|
border-bottom: 1px solid #919191;
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 内容样式 */
|
/* 内容样式 */
|
||||||
@ -530,5 +558,6 @@ const initChart = () => {
|
|||||||
border-bottom: 1px solid #919191;
|
border-bottom: 1px solid #919191;
|
||||||
border-left: 1px solid #919191;
|
border-left: 1px solid #919191;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
Loading…
Reference in New Issue
Block a user