完善通用查询和详情界面
This commit is contained in:
parent
8cf96126fe
commit
cc6681cfb5
@ -90,6 +90,14 @@ export function cxcRyDatAstatistics(parm) { // 员工分组统计
|
||||
})
|
||||
}
|
||||
|
||||
export function cxcRyDatAstatisticsCertificate(parm) { // 员工按证件分组统计
|
||||
return https({
|
||||
url: '/cxc_rlzy.zb/cxcRlzyZb/getStatisticsCertificate',
|
||||
method: 'get',
|
||||
data: parm
|
||||
})
|
||||
}
|
||||
|
||||
export function cxcRyDatAstatisticsDetails(parm) { // 员工信息统计
|
||||
return https({
|
||||
url: '/cxc_rlzy.zb/cxcRlzyZb/details',
|
||||
|
@ -28,16 +28,16 @@
|
||||
<uni-row>
|
||||
<view v-for="(item,index) in jxkhxxList">
|
||||
<uni-col :span="4">
|
||||
<view class="dataStyle">
|
||||
<view class="dataStyle1">
|
||||
{{index+1}}
|
||||
</view>
|
||||
</uni-col>
|
||||
<uni-col :span="10">
|
||||
<view class="dataStyle">
|
||||
<view class="dataStyle1">
|
||||
{{item.nf}}
|
||||
</view>
|
||||
</uni-col><uni-col :span="10">
|
||||
<view class="dataStyle">
|
||||
<view class="dataStyle1">
|
||||
{{item.khcj+"---"+item.khcj_dictText}}
|
||||
</view>
|
||||
</uni-col>
|
||||
@ -69,20 +69,20 @@
|
||||
<uni-row>
|
||||
<view v-for="(item,index) in gzjlList">
|
||||
<uni-col :span="4">
|
||||
<view class="dataStyle">
|
||||
<view class="dataStyle1">
|
||||
{{item.kssj}}
|
||||
</view>
|
||||
</uni-col>
|
||||
<uni-col :span="4">
|
||||
<view class="dataStyle">
|
||||
<view class="dataStyle1">
|
||||
{{item.jssj}}
|
||||
</view>
|
||||
</uni-col><uni-col :span="11">
|
||||
<view class="dataStyle">
|
||||
<view class="dataStyle2" ref="dataView">
|
||||
{{item.jlms}}
|
||||
</view>
|
||||
</uni-col><uni-col :span="5">
|
||||
<view class="dataStyle">
|
||||
<view class="dataStyle1">
|
||||
{{item.jlms2}}
|
||||
</view>
|
||||
</uni-col>
|
||||
@ -125,30 +125,30 @@
|
||||
<uni-row>
|
||||
<view v-for="(item,index) in xlxxList">
|
||||
<uni-col :span="4">
|
||||
<view class="dataStyle">
|
||||
<view class="dataStyle1">
|
||||
{{item.xllb}}
|
||||
</view>
|
||||
</uni-col>
|
||||
<uni-col :span="4">
|
||||
<view class="dataStyle">
|
||||
<view class="dataStyle1">
|
||||
{{item.byyx}}
|
||||
</view>
|
||||
</uni-col><uni-col :span="4">
|
||||
<view class="dataStyle">
|
||||
<view class="dataStyle2" ref="dataView">
|
||||
{{item.sxzy}}
|
||||
</view>
|
||||
</uni-col><uni-col :span="4">
|
||||
<view class="dataStyle">
|
||||
<view class="dataStyle1">
|
||||
{{item.qdxl}}
|
||||
</view>
|
||||
</uni-col>
|
||||
<uni-col :span="4">
|
||||
<view class="dataStyle">
|
||||
<view class="dataStyle1">
|
||||
{{item.qdxw}}
|
||||
</view>
|
||||
</uni-col>
|
||||
<uni-col :span="4">
|
||||
<view class="dataStyle">
|
||||
<view class="dataStyle1">
|
||||
{{item.bytime}}
|
||||
</view>
|
||||
</uni-col>
|
||||
@ -185,25 +185,25 @@
|
||||
<uni-row>
|
||||
<view v-for="(item,index) in zjtzList">
|
||||
<uni-col :span="6">
|
||||
<view class="dataStyle">
|
||||
<view class="dataStyle2" ref="dataView">
|
||||
{{item.zjmc}}
|
||||
</view>
|
||||
</uni-col>
|
||||
<uni-col :span="5">
|
||||
<view class="dataStyle">
|
||||
<view class="dataStyle1">
|
||||
{{item.zsdj}}
|
||||
</view>
|
||||
</uni-col><uni-col :span="5">
|
||||
<view class="dataStyle">
|
||||
<view class="dataStyle1">
|
||||
{{item.fzrq}}
|
||||
</view>
|
||||
</uni-col><uni-col :span="5">
|
||||
<view class="dataStyle">
|
||||
<view class="dataStyle1">
|
||||
{{item.fssj}}
|
||||
</view>
|
||||
</uni-col>
|
||||
<uni-col :span="3">
|
||||
<view class="dataStyle">
|
||||
<view class="dataStyle1">
|
||||
{{item.bz}}
|
||||
</view>
|
||||
</uni-col>
|
||||
@ -241,25 +241,25 @@
|
||||
<uni-row>
|
||||
<view v-for="(item,index) in zyjtcyList">
|
||||
<uni-col :span="4">
|
||||
<view class="dataStyle">
|
||||
<view class="dataStyle1">
|
||||
{{item.ybrgx}}
|
||||
</view>
|
||||
</uni-col>
|
||||
<uni-col :span="3">
|
||||
<view class="dataStyle">
|
||||
<view class="dataStyle1">
|
||||
{{item.gxname}}
|
||||
</view>
|
||||
</uni-col><uni-col :span="6">
|
||||
<view class="dataStyle">
|
||||
<view class="dataStyle1">
|
||||
{{item.cstime}}
|
||||
</view>
|
||||
</uni-col><uni-col :span="4">
|
||||
<view class="dataStyle">
|
||||
<view class="dataStyle1">
|
||||
{{item.cyzzmm}}
|
||||
</view>
|
||||
</uni-col>
|
||||
<uni-col :span="7">
|
||||
<view class="dataStyle">
|
||||
<view class="dataStyle2" ref="dataView">
|
||||
{{item.cygzdw}}
|
||||
</view>
|
||||
</uni-col>
|
||||
@ -403,123 +403,146 @@
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// adjustFontSize()
|
||||
}).catch((err) => {
|
||||
console.log(err);
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
function getJbxx() {
|
||||
cellData.value.push({
|
||||
"title": "姓名",
|
||||
"value": renyuanData.value.xm,
|
||||
"titleSpan": 3,
|
||||
"valueSpan": 3
|
||||
"valueSpan": 3,
|
||||
"class": "dataStyle"
|
||||
})
|
||||
cellData.value.push({
|
||||
"title": "性别",
|
||||
"value": renyuanData.value.xb_dictText,
|
||||
"titleSpan": 3,
|
||||
"valueSpan": 4
|
||||
"valueSpan": 4,
|
||||
"class": "dataStyle"
|
||||
})
|
||||
|
||||
cellData.value.push({
|
||||
"title": "出生年月",
|
||||
"value": renyuanData.value.cssj,
|
||||
"titleSpan": 4,
|
||||
"valueSpan": 4
|
||||
"valueSpan": 4,
|
||||
"class": "dataStyle"
|
||||
})
|
||||
cellData.value.push({
|
||||
"title": "民族",
|
||||
"value": renyuanData.value.mz,
|
||||
"titleSpan": 3,
|
||||
"valueSpan": 3
|
||||
"valueSpan": 3,
|
||||
"class": "dataStyle"
|
||||
})
|
||||
cellData.value.push({
|
||||
"title": "籍贯",
|
||||
"value": renyuanData.value.jg,
|
||||
"titleSpan": 3,
|
||||
"valueSpan": 5
|
||||
"valueSpan": 5,
|
||||
"class": "dataStyle"
|
||||
})
|
||||
cellData.value.push({
|
||||
"title": "出生地",
|
||||
"value": renyuanData.value.csd,
|
||||
"titleSpan": 3,
|
||||
"valueSpan": 4
|
||||
"valueSpan": 4,
|
||||
"class": "dataStyle"
|
||||
})
|
||||
cellData.value.push({
|
||||
"title": "工作时间",
|
||||
"value": renyuanData.value.cjgzsj,
|
||||
"titleSpan": 4,
|
||||
"valueSpan": 5
|
||||
"valueSpan": 5,
|
||||
"class": "dataStyle"
|
||||
})
|
||||
|
||||
cellData.value.push({
|
||||
"title": "政治面貌",
|
||||
"value": renyuanData.value.zzmm + renyuanData.value.jrsj,
|
||||
"value": renyuanData.value.zzmm === "群众" ? renyuanData.value.zzmm : renyuanData.value.zzmm +
|
||||
renyuanData.value.jrsj,
|
||||
"titleSpan": 4,
|
||||
"valueSpan": 4
|
||||
"valueSpan": 4,
|
||||
"class": "dataStyle1"
|
||||
})
|
||||
cellData.value.push({
|
||||
"title": "现专业",
|
||||
"value": "",
|
||||
"titleSpan": 3,
|
||||
"valueSpan": 8
|
||||
"valueSpan": 8,
|
||||
"class": "dataStyle"
|
||||
})
|
||||
cellData.value.push({
|
||||
"title": "用工形式",
|
||||
"value": renyuanData.value.rylb1_dictText,
|
||||
"titleSpan": 4,
|
||||
"valueSpan": 5
|
||||
"valueSpan": 5,
|
||||
"class": "dataStyle"
|
||||
})
|
||||
cellData.value.push({
|
||||
"title": "健康状况",
|
||||
"value": "",
|
||||
"titleSpan": 4,
|
||||
"valueSpan": 4
|
||||
"valueSpan": 4,
|
||||
"class": "dataStyle"
|
||||
})
|
||||
cellData.value.push({
|
||||
"title": "所在单位",
|
||||
"value": renyuanData.value.orgCode_dictText,
|
||||
"titleSpan": 4,
|
||||
"valueSpan": 6
|
||||
"valueSpan": 6,
|
||||
"class": "dataStyle"
|
||||
})
|
||||
cellData.value.push({
|
||||
"title": "专业技术资格",
|
||||
"value": gbxxList.value.zc + gbxxList.value.zcsj,
|
||||
"value": gbxxList.value.zc === 0 ? "/" : gbxxList.value.zc + gbxxList.value.zcsj,
|
||||
"titleSpan": 5,
|
||||
"valueSpan": 7
|
||||
"valueSpan": 7,
|
||||
"class": "dataStyle1"
|
||||
})
|
||||
cellData.value.push({
|
||||
"title": "职业资格等级",
|
||||
"value": zyzgdjList.value.ztgz + zyzgdjList.value.ztgzdj,
|
||||
"value": zyzgdjList.value.ztgz === "0" ? "/" : zyzgdjList.value.ztgz + zyzgdjList.value.ztgzdj,
|
||||
"titleSpan": 5,
|
||||
"valueSpan": 7
|
||||
"valueSpan": 7,
|
||||
"class": "dataStyle"
|
||||
})
|
||||
cellData.value.push({
|
||||
"title": "",
|
||||
"value": "",
|
||||
"titleSpan": 0,
|
||||
"valueSpan": 0
|
||||
"valueSpan": 0,
|
||||
"class": "dataStyle"
|
||||
})
|
||||
|
||||
cellData.value.push({
|
||||
"title": "职务(岗位)",
|
||||
"value": gbxxList.value.zw,
|
||||
"titleSpan": 5,
|
||||
"valueSpan": 7
|
||||
"valueSpan": 7,
|
||||
"class": "dataStyle"
|
||||
})
|
||||
|
||||
cellData.value.push({
|
||||
"title": "职位级别",
|
||||
"value": gbxxList.value.zwcj,
|
||||
"titleSpan": 5,
|
||||
"valueSpan": 7
|
||||
"valueSpan": 7,
|
||||
"class": "dataStyle"
|
||||
})
|
||||
cellData.value.push({
|
||||
"title": "",
|
||||
"value": "",
|
||||
"titleSpan": 0,
|
||||
"valueSpan": 0
|
||||
"valueSpan": 0,
|
||||
"class": "dataStyle"
|
||||
})
|
||||
}
|
||||
|
||||
@ -553,22 +576,20 @@
|
||||
.titleStyle {
|
||||
font-size: 12px;
|
||||
color: #747474;
|
||||
line-height: 50px;
|
||||
height: 50px;
|
||||
line-height: 35px;
|
||||
height: 35px;
|
||||
background: #F2F9FC;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
border-left: 1px solid #919191;
|
||||
border-bottom: 1px solid #919191;
|
||||
;
|
||||
;
|
||||
}
|
||||
|
||||
/* 内容样式 */
|
||||
.dataStyle {
|
||||
max-font-size: 14px;
|
||||
/* 最大字体限制 */
|
||||
min-font-size: 10px;
|
||||
/* 最小字体限制 */
|
||||
|
||||
font-size: 14px;
|
||||
color: #00007f;
|
||||
line-height: 25px;
|
||||
@ -583,4 +604,42 @@
|
||||
overflow-wrap: break-word;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* 内容样式 */
|
||||
.dataStyle1 {
|
||||
max-font-size: 14px;
|
||||
/* 最大字体限制 */
|
||||
min-font-size: 10px;
|
||||
/* 最小字体限制 */
|
||||
font-size: 14px;
|
||||
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-align: center;
|
||||
word-wrap: break-word;
|
||||
overflow-wrap: break-word;
|
||||
|
||||
}
|
||||
|
||||
/* 内容样式 */
|
||||
.dataStyle2 {
|
||||
font-size: 12px;
|
||||
color: #00007f;
|
||||
line-height: 15px;
|
||||
height: 30px;
|
||||
font-weight: 500;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
border-bottom: 1px solid #919191;
|
||||
border-left: 1px solid #919191;
|
||||
text-align: center;
|
||||
word-wrap: break-word;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
</style>
|
@ -5,14 +5,16 @@
|
||||
<uni-col :span="5"><uni-title :title="'选择单位'" align="left" type="h4"></uni-title></uni-col>
|
||||
|
||||
<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-row>
|
||||
|
||||
<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="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-row>
|
||||
</view>
|
||||
@ -24,7 +26,8 @@
|
||||
<!-- 翻页按钮 -->
|
||||
<view style="display: flex; justify-content: center; margin-top: 10px">
|
||||
<button @click="prevPage" :disabled="currentPage === 1" size="mini">上一页</button>
|
||||
<button @click="nextPage" :disabled="currentPage * pageSize >= chartDataCount.value" size="mini">下一页</button>
|
||||
<button @click="nextPage" :disabled="currentPage * pageSize >= chartDataCount.value"
|
||||
size="mini">下一页</button>
|
||||
</view>
|
||||
|
||||
<!-- 数据表格 -->
|
||||
@ -82,17 +85,36 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted, computed } from 'vue';
|
||||
import * as echarts from 'echarts';
|
||||
import { cxcRyDatAstatistics, cxcRyDatAstatisticsDetails } from '@/api/renyuan.js';
|
||||
import {
|
||||
ref,
|
||||
reactive,
|
||||
onMounted,
|
||||
computed
|
||||
} from 'vue';
|
||||
import * as echarts from 'echarts';
|
||||
import {
|
||||
cxcRyDatAstatistics,
|
||||
cxcRyDatAstatisticsCertificate,
|
||||
cxcRyDatAstatisticsDetails
|
||||
} from '@/api/renyuan.js';
|
||||
|
||||
// 存储下方组件的高度 tableData
|
||||
const bottomHeight = ref(0);
|
||||
// 新增加载状态
|
||||
const chart = ref(null);
|
||||
const chartDataCount = ref(0);
|
||||
const fieldList = ref([
|
||||
// 存储下方组件的高度 tableData
|
||||
const bottomHeight = ref(0);
|
||||
// 新增加载状态
|
||||
const chart = ref(null);
|
||||
const chartDataCount = ref(0);
|
||||
const fieldList = ref([{
|
||||
text: '取证情况',
|
||||
value: 'zjmc',
|
||||
isDict: false,
|
||||
dictCode: 'gzrlzy'
|
||||
},
|
||||
{
|
||||
text: '岗位类别',
|
||||
value: 'gwlb',
|
||||
isDict: false,
|
||||
dictCode: ''
|
||||
}, {
|
||||
text: '性别',
|
||||
value: 'xb',
|
||||
isDict: true,
|
||||
@ -110,45 +132,45 @@ const fieldList = ref([
|
||||
isDict: true,
|
||||
dictCode: 'mz'
|
||||
}
|
||||
]); // 字段列表
|
||||
]); // 字段列表
|
||||
|
||||
const dictCode = ref('');
|
||||
const fieldisDict = ref(true);
|
||||
const dictCode = ref('');
|
||||
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 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 chartTitle = computed(() => {
|
||||
const chartTitle = computed(() => {
|
||||
return selectedOrgCodeLabel.value + '人员(' + selectedFieldLabel.value + ')分组统计';
|
||||
});
|
||||
});
|
||||
|
||||
//图标翻页
|
||||
const pageSize = ref(3); // 每页显示的项目数量
|
||||
const currentPage = ref(1); // 当前页码
|
||||
//图标翻页
|
||||
const pageSize = ref(3); // 每页显示的项目数量
|
||||
const currentPage = ref(1); // 当前页码
|
||||
|
||||
function detail(record) {
|
||||
function detail(record) {
|
||||
// console.log(record)
|
||||
uni.navigateTo({
|
||||
url: '/pages/views/renliziyuan/renyuanxinxi/detail?data=' + encodeURIComponent(JSON.stringify(record))
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
onMounted(() => {
|
||||
// #ifdef APP
|
||||
getHeight();
|
||||
// #endif
|
||||
});
|
||||
// #ifdef APP
|
||||
});
|
||||
// #ifdef APP
|
||||
|
||||
const getHeight = () => {
|
||||
const getHeight = () => {
|
||||
// 获取屏幕高度
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
const screenHeight = systemInfo.screenHeight;
|
||||
@ -164,27 +186,27 @@ const getHeight = () => {
|
||||
bottomHeight.value = screenHeight - topComponentsHeight - 415;
|
||||
})
|
||||
.exec();
|
||||
};
|
||||
};
|
||||
|
||||
// #endif
|
||||
// 初始化 ECharts length departChange
|
||||
// 初始化图表
|
||||
const initChart = () => {
|
||||
// #endif
|
||||
// 初始化 ECharts length departChange
|
||||
// 初始化图表
|
||||
const initChart = () => {
|
||||
setTimeout(async () => {
|
||||
if (!chart.value) return;
|
||||
const myChart = await chart.value.init(echarts);
|
||||
myChart.setOption(chartOption.value);
|
||||
}, 300);
|
||||
};
|
||||
};
|
||||
|
||||
const prevPage = () => {
|
||||
const prevPage = () => {
|
||||
if (currentPage.value > 1) {
|
||||
currentPage.value--;
|
||||
}
|
||||
updateChart(chartData.value);
|
||||
};
|
||||
};
|
||||
|
||||
const nextPage = () => {
|
||||
const nextPage = () => {
|
||||
if (currentPage.value * pageSize.value < chartDataCount.value) {
|
||||
currentPage.value++;
|
||||
// 计算当前页数据的起始和结束索引
|
||||
@ -193,9 +215,9 @@ const nextPage = () => {
|
||||
updateChart(chartData.value);
|
||||
// const tempChartData = temp.slice(startIndex, endIndex);
|
||||
}
|
||||
};
|
||||
// 更具数据生成图标的option
|
||||
const getChartOption = (ChartData) => {
|
||||
};
|
||||
// 更具数据生成图标的option
|
||||
const getChartOption = (ChartData) => {
|
||||
// let temp = JSON.parse(JSON.stringify(tempchartData[0].children));
|
||||
// chartDataCount.value = temp.length;
|
||||
// 计算当前页数据的起始和结束索引
|
||||
@ -211,7 +233,7 @@ const getChartOption = (ChartData) => {
|
||||
|
||||
let legendData = [];
|
||||
for (let i = 0; i < fieldValues.value.length; i++) {
|
||||
legendData.push(fieldValues.value[i].filedText);
|
||||
legendData.push(fieldValues.value[i].fieldText);
|
||||
}
|
||||
|
||||
tempChartData.forEach((item) => {
|
||||
@ -221,7 +243,7 @@ const getChartOption = (ChartData) => {
|
||||
for (let i = 0; i < fieldValues.value.length; i++) {
|
||||
let tempData = [];
|
||||
tempChartData.forEach((item) => {
|
||||
console.log(item);
|
||||
// console.log(item);
|
||||
if (item.data[i]) {
|
||||
tempData.push(item.data[i]);
|
||||
} else {
|
||||
@ -229,7 +251,7 @@ const getChartOption = (ChartData) => {
|
||||
}
|
||||
});
|
||||
seriesData.push({
|
||||
name: fieldValues.value[i].filedText,
|
||||
name: fieldValues.value[i].fieldText,
|
||||
type: 'bar',
|
||||
label: {
|
||||
show: true, // 显示数值标签
|
||||
@ -275,8 +297,7 @@ const getChartOption = (ChartData) => {
|
||||
show: false //不显示坐标轴线
|
||||
}
|
||||
},
|
||||
yAxis: [
|
||||
{
|
||||
yAxis: [{
|
||||
show: true,
|
||||
boundaryGap: false, //解决数据与线不对应问题
|
||||
type: 'value',
|
||||
@ -300,8 +321,7 @@ const getChartOption = (ChartData) => {
|
||||
axisLine: {
|
||||
show: false //不显示坐标轴线
|
||||
}
|
||||
}
|
||||
],
|
||||
}],
|
||||
series: seriesData,
|
||||
|
||||
legend: {
|
||||
@ -318,10 +338,10 @@ const getChartOption = (ChartData) => {
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
// 更新图表
|
||||
const updateChart = (tempchartData) => {
|
||||
// 更新图表
|
||||
const updateChart = (tempchartData) => {
|
||||
// 初始化图表
|
||||
setTimeout(async () => {
|
||||
if (!chart.value) return;
|
||||
@ -348,10 +368,10 @@ const updateChart = (tempchartData) => {
|
||||
// updateChart(updateData);
|
||||
});
|
||||
}, 300);
|
||||
};
|
||||
//根据一个键值查找数据
|
||||
//查找人员劳动合同号
|
||||
function findRyByOrgCode(treeData, targetOrgCode) {
|
||||
};
|
||||
//根据一个键值查找数据
|
||||
//查找人员劳动合同号
|
||||
function findRyByOrgCode(treeData, targetOrgCode) {
|
||||
// console.log(treeData, targetOrgCode);
|
||||
for (const node of treeData) {
|
||||
// 如果当前节点匹配,直接返回该节点及其子节点
|
||||
@ -365,15 +385,15 @@ function findRyByOrgCode(treeData, targetOrgCode) {
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 从echart图标的树状数据中根据 orgCode 获取节点及其子节点数据
|
||||
* @param {Array} treeData 树状数据
|
||||
* @param {string} targetOrgCode 目标 orgCode
|
||||
* @returns {Object|null} 匹配的节点及其子节点数据,未找到返回 null
|
||||
*/
|
||||
function findNodeByOrgCode(treeData, targetOrgCode) {
|
||||
function findNodeByOrgCode(treeData, targetOrgCode) {
|
||||
// console.log(treeData, targetOrgCode);
|
||||
for (const node of treeData) {
|
||||
// 如果当前节点匹配,直接返回该节点及其子节点
|
||||
@ -387,29 +407,32 @@ function findNodeByOrgCode(treeData, targetOrgCode) {
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
//获取所有的fieldValue
|
||||
function collectUniqueKeyFieldValues(tree) {
|
||||
//获取所有的fieldValue
|
||||
function collectUniqueKeyFieldValues(tree) {
|
||||
const uniqueMap = new Map();
|
||||
tree.forEach((item) => {
|
||||
const { fieldValue, filedText } = item;
|
||||
const key = `${fieldValue}-${filedText}`;
|
||||
const {
|
||||
fieldValue,
|
||||
fieldText
|
||||
} = item;
|
||||
const key = `${fieldValue}-${fieldText}`;
|
||||
|
||||
if (!uniqueMap.has(key)) {
|
||||
uniqueMap.set(key, {
|
||||
fieldValue,
|
||||
filedText
|
||||
fieldText
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
const result = Array.from(uniqueMap.values());
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
// 封装一个类来管理组织代码和组织名称的映射
|
||||
class OrgCodeMapper {
|
||||
// 封装一个类来管理组织代码和组织名称的映射
|
||||
class OrgCodeMapper {
|
||||
constructor(data) {
|
||||
// 初始化一个空对象用于存储映射关系
|
||||
this.orgCodeToOrgTextMap = {};
|
||||
@ -425,20 +448,20 @@ class OrgCodeMapper {
|
||||
findOrgText(orgCode) {
|
||||
return this.orgCodeToOrgTextMap[orgCode];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 示例用法
|
||||
// const result = findNodeByOrgCode(echartData, "A01A01A01A01");
|
||||
// console.log(result);
|
||||
/**
|
||||
// 示例用法
|
||||
// const result = findNodeByOrgCode(echartData, "A01A01A01A01");
|
||||
// console.log(result);
|
||||
/**
|
||||
* 转换数据为支持钻取的ECharts格式
|
||||
* @param {Array} data 原始数据
|
||||
* @param {string} selectOrgCode 当前选择的组织编码
|
||||
* @returns {Object} 包含当前层级数据和子节点信息的对象 符合echart的格式
|
||||
*/
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
function transformData(selectOrgCode, data) {
|
||||
//-----------------------------------------------------------------------------------------
|
||||
function transformData(selectOrgCode, data) {
|
||||
const nodes = new Map();
|
||||
//获取所有的fieldValue 用于图例和钻取和data[]中的数据顺序保持一致 动态建立fieldValue的数据
|
||||
fieldValues.value = collectUniqueKeyFieldValues(data);
|
||||
@ -467,7 +490,8 @@ function transformData(selectOrgCode, data) {
|
||||
// console.log(entry);
|
||||
hierarchy.forEach((code) => {
|
||||
// console.log(code);
|
||||
let tempOrgText = orgMapper.findOrgText(code) === undefined ? '' : orgMapper.findOrgText(code);
|
||||
let tempOrgText = orgMapper.findOrgText(code) === undefined ? '' : orgMapper.findOrgText(
|
||||
code);
|
||||
// console.log(tempOrgText);
|
||||
if (!nodes.has(code)) {
|
||||
nodes.set(code, {
|
||||
@ -550,13 +574,13 @@ function transformData(selectOrgCode, data) {
|
||||
// console.log(root);
|
||||
// formatTree(root);
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------------------
|
||||
|
||||
//根据 orgCode 的分级格式,递归地汇总本级及其所有下级的数据,并将下级数据放在本级的 children 属性中。 deepseek
|
||||
//根据 orgCode 的分级格式,递归地汇总本级及其所有下级的数据,并将下级数据放在本级的 children 属性中。 deepseek
|
||||
|
||||
const groupByOrgCode = (orgCode, data) => {
|
||||
const groupByOrgCode = (orgCode, data) => {
|
||||
// 过滤出本级和所有下级的数据
|
||||
|
||||
const filteredData = data.filter((item) => item.orgCode.startsWith(orgCode));
|
||||
@ -579,7 +603,7 @@ const groupByOrgCode = (orgCode, data) => {
|
||||
groupedByFieldValue[item.fieldValue] = {
|
||||
orgCode: item.orgCode,
|
||||
orgText: item.orgText,
|
||||
filedText: item.filedText,
|
||||
fieldText: item.fieldText,
|
||||
number: 0,
|
||||
ldhth: []
|
||||
};
|
||||
@ -591,17 +615,21 @@ const groupByOrgCode = (orgCode, data) => {
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
console.log(1, orgMapper.findOrgText(orgCode));
|
||||
// console.log(1, orgMapper.findOrgText(orgCode));
|
||||
// 构建本级结果
|
||||
|
||||
const result = {
|
||||
orgCode: orgCode,
|
||||
orgText: orgMapper.findOrgText(orgCode),
|
||||
fieldValues: Object.keys(groupedByFieldValue).map((fieldValue) => {
|
||||
const { filedText, orgCode, orgText } = groupedByFieldValue[fieldValue] || {};
|
||||
const {
|
||||
fieldText,
|
||||
orgCode,
|
||||
orgText
|
||||
} = groupedByFieldValue[fieldValue] || {};
|
||||
return {
|
||||
fieldValue: fieldValue,
|
||||
filedText: filedText,
|
||||
fieldText: fieldText,
|
||||
orgCode: orgCode,
|
||||
orgText: orgText,
|
||||
number: groupedByFieldValue[fieldValue].number,
|
||||
@ -640,22 +668,34 @@ const groupByOrgCode = (orgCode, data) => {
|
||||
// console.log('全部', result);
|
||||
|
||||
return result;
|
||||
};
|
||||
// 获取统计数据 then filter
|
||||
const fetchStatisticsData = async () => {
|
||||
};
|
||||
// 获取统计数据 then filter
|
||||
const fetchStatisticsData = async () => {
|
||||
if (!selectedOrgCode.value || !selectedField.value) return;
|
||||
let res = [];
|
||||
chartData.value = [];
|
||||
try {
|
||||
|
||||
if (selectedField.value === "zjmc") {
|
||||
console.log(dictCode.value)
|
||||
res = await cxcRyDatAstatisticsCertificate({
|
||||
orgCode: selectedOrgCode.value,
|
||||
field: selectedField.value,
|
||||
dictCode: dictCode.value,
|
||||
fieldisDict: fieldisDict.value
|
||||
});
|
||||
} else {
|
||||
res = await cxcRyDatAstatistics({
|
||||
orgCode: selectedOrgCode.value,
|
||||
field: selectedField.value,
|
||||
dictCode: dictCode.value,
|
||||
fieldisDict: fieldisDict.value
|
||||
});
|
||||
}
|
||||
|
||||
// console.log(res); //deepseek
|
||||
if (res.success) {
|
||||
// console.log(selectedOrgCode.value, res);
|
||||
console.log(selectedOrgCode.value, res);
|
||||
if (res.result.length < 1) {
|
||||
uni.showToast({
|
||||
title: '查询数据为空'
|
||||
@ -680,10 +720,10 @@ const fetchStatisticsData = async () => {
|
||||
} catch (error) {
|
||||
console.error('获取统计数据失败:', error);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
// 获取人员列表 delimiter
|
||||
const fetchPersonnelList = async (ldhthList) => {
|
||||
// 获取人员列表 delimiter
|
||||
const fetchPersonnelList = async (ldhthList) => {
|
||||
personnelList.value = [];
|
||||
try {
|
||||
const res = await cxcRyDatAstatisticsDetails({
|
||||
@ -696,17 +736,19 @@ const fetchPersonnelList = async (ldhthList) => {
|
||||
} catch (error) {
|
||||
console.error('获取人员列表失败:', error);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
// 事件处理
|
||||
const onOrgCodeChange = (e, data) => {
|
||||
// 事件处理
|
||||
const onOrgCodeChange = (e, data) => {
|
||||
personnelList.value = []
|
||||
selectedOrgCode.value = e;
|
||||
// console.log(data.value.title);
|
||||
selectedOrgCodeLabel.value = data.value.title;
|
||||
fetchStatisticsData();
|
||||
};
|
||||
};
|
||||
|
||||
const onFieldChange = (e) => {
|
||||
const onFieldChange = (e) => {
|
||||
personnelList.value = []
|
||||
// console.log(e);
|
||||
try {
|
||||
selectedField.value = e;
|
||||
@ -724,38 +766,41 @@ const onFieldChange = (e) => {
|
||||
//TODO handle the exception
|
||||
console.log(error);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
const onChartClick = (e) => {
|
||||
const { ldhth } = chartData.value;
|
||||
const onChartClick = (e) => {
|
||||
personnelList.value = []
|
||||
const {
|
||||
ldhth
|
||||
} = chartData.value;
|
||||
if (ldhth && ldhth.length > 0) {
|
||||
fetchPersonnelList(ldhth);
|
||||
}
|
||||
};
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
/* 颜色变量 */
|
||||
:root {
|
||||
/* 颜色变量 */
|
||||
:root {
|
||||
--primary-blue: #409eff;
|
||||
--deep-blue: #2c7be5;
|
||||
--light-blue: #ecf5ff;
|
||||
--gradient-start: #6b8cff;
|
||||
--gradient-end: #4364f7;
|
||||
--hover-blue: #66b1ff;
|
||||
}
|
||||
}
|
||||
|
||||
/* 全局容器 */
|
||||
.container {
|
||||
/* 全局容器 */
|
||||
.container {
|
||||
margin: 10rpx 10rpx;
|
||||
padding: 10rpx;
|
||||
background: linear-gradient(145deg, #f5f9ff, var(--light-blue));
|
||||
border-radius: 24rpx;
|
||||
box-shadow: 0 8rpx 24rpx rgba(64, 158, 255, 0.15);
|
||||
border: 2rpx solid rgba(64, 158, 255, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
/* 图表容器 */
|
||||
.chart-container {
|
||||
/* 图表容器 */
|
||||
.chart-container {
|
||||
height: 250px;
|
||||
margin: 20rpx 0;
|
||||
border-radius: 24rpx;
|
||||
@ -763,11 +808,11 @@ const onChartClick = (e) => {
|
||||
background: #ffffff;
|
||||
box-shadow: 0 8rpx 32rpx rgba(64, 158, 255, 0.12);
|
||||
border: 2rpx solid rgba(64, 158, 255, 0.08);
|
||||
}
|
||||
}
|
||||
|
||||
/* 表格标题行 */
|
||||
/* 表格标题行 */
|
||||
|
||||
.titleStyle {
|
||||
.titleStyle {
|
||||
font-size: 12px;
|
||||
color: #747474;
|
||||
line-height: 30px;
|
||||
@ -777,10 +822,10 @@ const onChartClick = (e) => {
|
||||
vertical-align: middle;
|
||||
border-left: 1px solid #919191;
|
||||
border-bottom: 1px solid #919191;
|
||||
}
|
||||
}
|
||||
|
||||
/* 内容样式 */
|
||||
.dataStyle {
|
||||
/* 内容样式 */
|
||||
.dataStyle {
|
||||
max-font-size: 14px;
|
||||
/* 最大字体限制 */
|
||||
min-font-size: 10px;
|
||||
@ -795,23 +840,23 @@ const onChartClick = (e) => {
|
||||
border-bottom: 1px solid #919191;
|
||||
border-left: 1px solid #919191;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
|
||||
/* 滚动区域 */
|
||||
scroll-view {
|
||||
/* 滚动区域 */
|
||||
scroll-view {
|
||||
background: #ffffff;
|
||||
border-radius: 0 0 16rpx 16rpx;
|
||||
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);
|
||||
border-color: var(--primary-blue);
|
||||
}
|
||||
}
|
||||
|
||||
/* 加载动画优化 */
|
||||
@keyframes fadeIn {
|
||||
/* 加载动画优化 */
|
||||
@keyframes fadeIn {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(20rpx);
|
||||
@ -821,45 +866,45 @@ scroll-view {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.container > * {
|
||||
.container>* {
|
||||
animation: fadeIn 0.6s cubic-bezier(0.23, 1, 0.32, 1);
|
||||
}
|
||||
}
|
||||
|
||||
/* 自定义滚动条美化 */
|
||||
::-webkit-scrollbar {
|
||||
/* 自定义滚动条美化 */
|
||||
::-webkit-scrollbar {
|
||||
width: 8rpx;
|
||||
background: rgba(64, 158, 255, 0.05);
|
||||
}
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: linear-gradient(45deg, var(--primary-blue), var(--deep-blue));
|
||||
border-radius: 12rpx;
|
||||
border: 2rpx solid white;
|
||||
}
|
||||
}
|
||||
|
||||
/* 筛选行间距优化 */
|
||||
.filter-row {
|
||||
/* 筛选行间距优化 */
|
||||
.filter-row {
|
||||
margin: 30rpx 0;
|
||||
padding: 20rpx 0;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
}
|
||||
|
||||
/* 响应式调整优化 */
|
||||
@media (max-width: 768px) {
|
||||
/* 响应式调整优化 */
|
||||
@media (max-width: 768px) {
|
||||
.chart-container {
|
||||
height: 250px;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 数据行高亮效果 */
|
||||
.data-row:nth-child(even) {
|
||||
/* 数据行高亮效果 */
|
||||
.data-row:nth-child(even) {
|
||||
background: rgba(236, 245, 255, 0.3);
|
||||
}
|
||||
}
|
||||
|
||||
.data-row:hover {
|
||||
.data-row:hover {
|
||||
box-shadow: 0 4rpx 12rpx rgba(64, 158, 255, 0.1);
|
||||
}
|
||||
}
|
||||
</style>
|
@ -7,7 +7,7 @@
|
||||
</view>
|
||||
</uni-col>
|
||||
<uni-col :span="item.valueSpan">
|
||||
<view class="dataStyle">
|
||||
<view :class="item.class">
|
||||
{{ doEmptyString(item.value) }}
|
||||
</view>
|
||||
</uni-col>
|
||||
@ -77,8 +77,8 @@
|
||||
.titleStyle {
|
||||
font-size: 12px;
|
||||
color: #747474;
|
||||
line-height: 50px;
|
||||
height: 50px;
|
||||
line-height: 30px;
|
||||
height: 30px;
|
||||
background: #F2F9FC;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
@ -90,14 +90,26 @@
|
||||
|
||||
/* 内容样式 */
|
||||
.dataStyle {
|
||||
max-font-size: 14px;
|
||||
/* 最大字体限制 */
|
||||
min-font-size: 10px;
|
||||
/* 最小字体限制 */
|
||||
|
||||
font-size: 14px;
|
||||
color: #00007f;
|
||||
line-height: 25px;
|
||||
height: 50px;
|
||||
line-height: 35px;
|
||||
height: 30px;
|
||||
font-weight: 500;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
border-bottom: 1px solid #919191;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* 内容样式 */
|
||||
.dataStyle1 {
|
||||
|
||||
font-size: 12px;
|
||||
color: #00007f;
|
||||
line-height: 15px;
|
||||
height: 30px;
|
||||
font-weight: 500;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
|
Loading…
Reference in New Issue
Block a user