Compare commits
15 Commits
8e94f1d7f2
...
aff8d2168a
Author | SHA1 | Date | |
---|---|---|---|
![]() |
aff8d2168a | ||
![]() |
71cdfa3116 | ||
8222fdc0a4 | |||
![]() |
7d871f7151 | ||
f50e2fe7ec | |||
![]() |
1dbe2fbd07 | ||
![]() |
d536aaad8a | ||
![]() |
ef66d42536 | ||
![]() |
3f29785a61 | ||
![]() |
45aa41d156 | ||
![]() |
3dc869143c | ||
![]() |
410769873a | ||
![]() |
d650513a5d | ||
a5d733a269 | |||
![]() |
911c4c365a |
26
.hbuilderx/launch.json
Normal file
26
.hbuilderx/launch.json
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
// launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
|
||||||
|
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
|
||||||
|
"version" : "0.0",
|
||||||
|
"configurations" : [
|
||||||
|
{
|
||||||
|
"app-plus" :
|
||||||
|
{
|
||||||
|
"launchtype" : "local"
|
||||||
|
},
|
||||||
|
"default" :
|
||||||
|
{
|
||||||
|
"launchtype" : "local"
|
||||||
|
},
|
||||||
|
"mp-weixin" :
|
||||||
|
{
|
||||||
|
"launchtype" : "local"
|
||||||
|
},
|
||||||
|
"type" : "uniCloud"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"playground" : "standard",
|
||||||
|
"type" : "uni-app:app-android"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
13
.vite/deps/_metadata.json
Normal file
13
.vite/deps/_metadata.json
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"hash": "5610b5a1",
|
||||||
|
"browserHash": "3deef0d9",
|
||||||
|
"optimized": {
|
||||||
|
"base-64": {
|
||||||
|
"src": "../../node_modules/base-64/base64.js",
|
||||||
|
"file": "base-64.js",
|
||||||
|
"fileHash": "768aae23",
|
||||||
|
"needsInterop": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"chunks": {}
|
||||||
|
}
|
117
.vite/deps/base-64.js
Normal file
117
.vite/deps/base-64.js
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||||
|
var __commonJS = (cb, mod) => function __require() {
|
||||||
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
||||||
|
};
|
||||||
|
|
||||||
|
// ../../../../Documents/HBuilderProjects/B404219-tianranqi/node_modules/base-64/base64.js
|
||||||
|
var require_base64 = __commonJS({
|
||||||
|
"../../../../Documents/HBuilderProjects/B404219-tianranqi/node_modules/base-64/base64.js"(exports, module) {
|
||||||
|
(function(root) {
|
||||||
|
var freeExports = typeof exports == "object" && exports;
|
||||||
|
var freeModule = typeof module == "object" && module && module.exports == freeExports && module;
|
||||||
|
var freeGlobal = typeof global == "object" && global;
|
||||||
|
if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
|
||||||
|
root = freeGlobal;
|
||||||
|
}
|
||||||
|
var InvalidCharacterError = function(message) {
|
||||||
|
this.message = message;
|
||||||
|
};
|
||||||
|
InvalidCharacterError.prototype = new Error();
|
||||||
|
InvalidCharacterError.prototype.name = "InvalidCharacterError";
|
||||||
|
var error = function(message) {
|
||||||
|
throw new InvalidCharacterError(message);
|
||||||
|
};
|
||||||
|
var TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||||
|
var REGEX_SPACE_CHARACTERS = /[\t\n\f\r ]/g;
|
||||||
|
var decode = function(input) {
|
||||||
|
input = String(input).replace(REGEX_SPACE_CHARACTERS, "");
|
||||||
|
var length = input.length;
|
||||||
|
if (length % 4 == 0) {
|
||||||
|
input = input.replace(/==?$/, "");
|
||||||
|
length = input.length;
|
||||||
|
}
|
||||||
|
if (length % 4 == 1 || // http://whatwg.org/C#alphanumeric-ascii-characters
|
||||||
|
/[^+a-zA-Z0-9/]/.test(input)) {
|
||||||
|
error(
|
||||||
|
"Invalid character: the string to be decoded is not correctly encoded."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
var bitCounter = 0;
|
||||||
|
var bitStorage;
|
||||||
|
var buffer;
|
||||||
|
var output = "";
|
||||||
|
var position = -1;
|
||||||
|
while (++position < length) {
|
||||||
|
buffer = TABLE.indexOf(input.charAt(position));
|
||||||
|
bitStorage = bitCounter % 4 ? bitStorage * 64 + buffer : buffer;
|
||||||
|
if (bitCounter++ % 4) {
|
||||||
|
output += String.fromCharCode(
|
||||||
|
255 & bitStorage >> (-2 * bitCounter & 6)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return output;
|
||||||
|
};
|
||||||
|
var encode = function(input) {
|
||||||
|
input = String(input);
|
||||||
|
if (/[^\0-\xFF]/.test(input)) {
|
||||||
|
error(
|
||||||
|
"The string to be encoded contains characters outside of the Latin1 range."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
var padding = input.length % 3;
|
||||||
|
var output = "";
|
||||||
|
var position = -1;
|
||||||
|
var a;
|
||||||
|
var b;
|
||||||
|
var c;
|
||||||
|
var buffer;
|
||||||
|
var length = input.length - padding;
|
||||||
|
while (++position < length) {
|
||||||
|
a = input.charCodeAt(position) << 16;
|
||||||
|
b = input.charCodeAt(++position) << 8;
|
||||||
|
c = input.charCodeAt(++position);
|
||||||
|
buffer = a + b + c;
|
||||||
|
output += TABLE.charAt(buffer >> 18 & 63) + TABLE.charAt(buffer >> 12 & 63) + TABLE.charAt(buffer >> 6 & 63) + TABLE.charAt(buffer & 63);
|
||||||
|
}
|
||||||
|
if (padding == 2) {
|
||||||
|
a = input.charCodeAt(position) << 8;
|
||||||
|
b = input.charCodeAt(++position);
|
||||||
|
buffer = a + b;
|
||||||
|
output += TABLE.charAt(buffer >> 10) + TABLE.charAt(buffer >> 4 & 63) + TABLE.charAt(buffer << 2 & 63) + "=";
|
||||||
|
} else if (padding == 1) {
|
||||||
|
buffer = input.charCodeAt(position);
|
||||||
|
output += TABLE.charAt(buffer >> 2) + TABLE.charAt(buffer << 4 & 63) + "==";
|
||||||
|
}
|
||||||
|
return output;
|
||||||
|
};
|
||||||
|
var base64 = {
|
||||||
|
"encode": encode,
|
||||||
|
"decode": decode,
|
||||||
|
"version": "1.0.0"
|
||||||
|
};
|
||||||
|
if (typeof define == "function" && typeof define.amd == "object" && define.amd) {
|
||||||
|
define(function() {
|
||||||
|
return base64;
|
||||||
|
});
|
||||||
|
} else if (freeExports && !freeExports.nodeType) {
|
||||||
|
if (freeModule) {
|
||||||
|
freeModule.exports = base64;
|
||||||
|
} else {
|
||||||
|
for (var key in base64) {
|
||||||
|
base64.hasOwnProperty(key) && (freeExports[key] = base64[key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
root.base64 = base64;
|
||||||
|
}
|
||||||
|
})(exports);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
export default require_base64();
|
||||||
|
/*! Bundled license information:
|
||||||
|
|
||||||
|
base-64/base64.js:
|
||||||
|
(*! https://mths.be/base64 v1.0.0 by @mathias | MIT license *)
|
||||||
|
*/
|
||||||
|
//# sourceMappingURL=base-64.js.map
|
7
.vite/deps/base-64.js.map
Normal file
7
.vite/deps/base-64.js.map
Normal file
File diff suppressed because one or more lines are too long
3
.vite/deps/package.json
Normal file
3
.vite/deps/package.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"type": "module"
|
||||||
|
}
|
10
api/pages.js
10
api/pages.js
@ -26,4 +26,14 @@ export function qjQueryByIdApi(config) { // 通过id查询请假数据 流程用
|
|||||||
method: 'get',
|
method: 'get',
|
||||||
data: config
|
data: config
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function queryHisDateApi(username) { // 根据username获取最新请假结束日期
|
||||||
|
return https({
|
||||||
|
url: '/CxcQxj/cxcQxj/queryHisDate',
|
||||||
|
method: 'get',
|
||||||
|
data: {
|
||||||
|
username
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
241
manifest.json
241
manifest.json
@ -1,122 +1,123 @@
|
|||||||
{
|
{
|
||||||
"name": "数智产销",
|
"name" : "数智产销",
|
||||||
"appid": "__UNI__9F097F0",
|
"appid" : "__UNI__9F097F0",
|
||||||
"description": "",
|
"description" : "",
|
||||||
"versionName": "1.1.4.1",
|
"versionName" : "1.1.6",
|
||||||
"versionCode": 20250121,
|
"versionCode" : 20250207,
|
||||||
"transformPx": false,
|
"transformPx" : false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus": {
|
"app-plus" : {
|
||||||
"usingComponents": true,
|
"usingComponents" : true,
|
||||||
"nvueStyleCompiler": "uni-app",
|
"nvueStyleCompiler" : "uni-app",
|
||||||
"compilerVersion": 3,
|
"compilerVersion" : 3,
|
||||||
"splashscreen": {
|
"splashscreen" : {
|
||||||
"alwaysShowBeforeRender": true,
|
"alwaysShowBeforeRender" : true,
|
||||||
"waiting": true,
|
"waiting" : true,
|
||||||
"autoclose": true,
|
"autoclose" : true,
|
||||||
"delay": 0
|
"delay" : 0
|
||||||
},
|
},
|
||||||
"compatible": {
|
"compatible" : {
|
||||||
"ignoreVersion": true
|
"ignoreVersion" : true
|
||||||
},
|
},
|
||||||
/* 模块配置 */
|
/* 模块配置 */
|
||||||
"modules": {
|
"modules" : {
|
||||||
"Geolocation": {},
|
"Geolocation" : {},
|
||||||
"Fingerprint": {},
|
"Fingerprint" : {},
|
||||||
"Camera": {},
|
"Camera" : {},
|
||||||
"Barcode": {}
|
"Barcode" : {}
|
||||||
},
|
},
|
||||||
/* 应用发布信息 */
|
/* 应用发布信息 */
|
||||||
"distribute": {
|
"distribute" : {
|
||||||
/* android打包配置 */
|
/* android打包配置 */
|
||||||
"android": {
|
"android" : {
|
||||||
"permissions": [
|
"permissions" : [
|
||||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
||||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
||||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
/* ios打包配置 */
|
/* ios打包配置 */
|
||||||
"ios": {
|
"ios" : {
|
||||||
"dSYMs": false
|
"dSYMs" : false
|
||||||
},
|
},
|
||||||
/* SDK配置 */
|
/* SDK配置 */
|
||||||
"sdkConfigs": {
|
"sdkConfigs" : {
|
||||||
"ad": {},
|
"ad" : {},
|
||||||
"geolocation": {
|
"geolocation" : {
|
||||||
"system": {
|
"system" : {
|
||||||
"__platform__": ["android"]
|
"__platform__" : [ "android" ]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"icons": {
|
"icons" : {
|
||||||
"android": {
|
"android" : {
|
||||||
"hdpi": "unpackage/res/icons/72x72.png",
|
"hdpi" : "unpackage/res/icons/72x72.png",
|
||||||
"xhdpi": "unpackage/res/icons/96x96.png",
|
"xhdpi" : "unpackage/res/icons/96x96.png",
|
||||||
"xxhdpi": "unpackage/res/icons/144x144.png",
|
"xxhdpi" : "unpackage/res/icons/144x144.png",
|
||||||
"xxxhdpi": "unpackage/res/icons/192x192.png"
|
"xxxhdpi" : "unpackage/res/icons/192x192.png"
|
||||||
},
|
},
|
||||||
"ios": {
|
"ios" : {
|
||||||
"appstore": "unpackage/res/icons/1024x1024.png",
|
"appstore" : "unpackage/res/icons/1024x1024.png",
|
||||||
"ipad": {
|
"ipad" : {
|
||||||
"app": "unpackage/res/icons/76x76.png",
|
"app" : "unpackage/res/icons/76x76.png",
|
||||||
"app@2x": "unpackage/res/icons/152x152.png",
|
"app@2x" : "unpackage/res/icons/152x152.png",
|
||||||
"notification": "unpackage/res/icons/20x20.png",
|
"notification" : "unpackage/res/icons/20x20.png",
|
||||||
"notification@2x": "unpackage/res/icons/40x40.png",
|
"notification@2x" : "unpackage/res/icons/40x40.png",
|
||||||
"proapp@2x": "unpackage/res/icons/167x167.png",
|
"proapp@2x" : "unpackage/res/icons/167x167.png",
|
||||||
"settings": "unpackage/res/icons/29x29.png",
|
"settings" : "unpackage/res/icons/29x29.png",
|
||||||
"settings@2x": "unpackage/res/icons/58x58.png",
|
"settings@2x" : "unpackage/res/icons/58x58.png",
|
||||||
"spotlight": "unpackage/res/icons/40x40.png",
|
"spotlight" : "unpackage/res/icons/40x40.png",
|
||||||
"spotlight@2x": "unpackage/res/icons/80x80.png"
|
"spotlight@2x" : "unpackage/res/icons/80x80.png"
|
||||||
},
|
},
|
||||||
"iphone": {
|
"iphone" : {
|
||||||
"app@2x": "unpackage/res/icons/120x120.png",
|
"app@2x" : "unpackage/res/icons/120x120.png",
|
||||||
"app@3x": "unpackage/res/icons/180x180.png",
|
"app@3x" : "unpackage/res/icons/180x180.png",
|
||||||
"notification@2x": "unpackage/res/icons/40x40.png",
|
"notification@2x" : "unpackage/res/icons/40x40.png",
|
||||||
"notification@3x": "unpackage/res/icons/60x60.png",
|
"notification@3x" : "unpackage/res/icons/60x60.png",
|
||||||
"settings@2x": "unpackage/res/icons/58x58.png",
|
"settings@2x" : "unpackage/res/icons/58x58.png",
|
||||||
"settings@3x": "unpackage/res/icons/87x87.png",
|
"settings@3x" : "unpackage/res/icons/87x87.png",
|
||||||
"spotlight@2x": "unpackage/res/icons/80x80.png",
|
"spotlight@2x" : "unpackage/res/icons/80x80.png",
|
||||||
"spotlight@3x": "unpackage/res/icons/120x120.png"
|
"spotlight@3x" : "unpackage/res/icons/120x120.png"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/* 快应用特有相关 */
|
/* 快应用特有相关 */
|
||||||
"quickapp": {},
|
"quickapp" : {},
|
||||||
/* 小程序特有相关 */
|
/* 小程序特有相关 */
|
||||||
"mp-weixin": {
|
"mp-weixin" : {
|
||||||
"appid": "",
|
"appid" : "",
|
||||||
"setting": {
|
"setting" : {
|
||||||
"urlCheck": false
|
"urlCheck" : false
|
||||||
},
|
},
|
||||||
"usingComponents": true
|
"usingComponents" : true
|
||||||
},
|
},
|
||||||
"mp-alipay": {
|
"mp-alipay" : {
|
||||||
"usingComponents": true
|
"usingComponents" : true
|
||||||
},
|
},
|
||||||
"mp-baidu": {
|
"mp-baidu" : {
|
||||||
"usingComponents": true
|
"usingComponents" : true
|
||||||
},
|
},
|
||||||
"mp-toutiao": {
|
"mp-toutiao" : {
|
||||||
"usingComponents": true
|
"usingComponents" : true
|
||||||
},
|
},
|
||||||
"uniStatistics": {
|
"uniStatistics" : {
|
||||||
"enable": false
|
"enable" : false
|
||||||
},
|
},
|
||||||
"vueVersion": "3"
|
"vueVersion" : "3"
|
||||||
}
|
}
|
||||||
/* 模块配置 */
|
/* 模块配置 */
|
||||||
|
|
||||||
|
@ -233,14 +233,6 @@
|
|||||||
"navigationBarTitleText": "人员年龄分组统计信息",
|
"navigationBarTitleText": "人员年龄分组统计信息",
|
||||||
"navigationBarTextStyle": "white"
|
"navigationBarTextStyle": "white"
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/views/renliziyuan/renyuanxinxi/xbtongji",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "人员性别分组统计信息",
|
|
||||||
"navigationBarTextStyle": "white"
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -109,7 +109,8 @@
|
|||||||
} from '@/api/api.js';
|
} from '@/api/api.js';
|
||||||
import {
|
import {
|
||||||
qjAddApi,
|
qjAddApi,
|
||||||
queryZwmcAndExaApi
|
queryZwmcAndExaApi,
|
||||||
|
queryHisDateApi
|
||||||
} from '@/api/pages.js';
|
} from '@/api/pages.js';
|
||||||
import {
|
import {
|
||||||
queryDepByCode,
|
queryDepByCode,
|
||||||
@ -177,7 +178,7 @@
|
|||||||
}
|
}
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
loadData()
|
loadData()
|
||||||
getTomorrowDate()
|
// getTomorrowDate()
|
||||||
})
|
})
|
||||||
|
|
||||||
const select = (e) => {
|
const select = (e) => {
|
||||||
@ -274,21 +275,39 @@
|
|||||||
proxy.$toast(res.message);
|
proxy.$toast(res.message);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
queryHisDateApi(store.userinfo.username).then((res) => { // 最新请假结束日期
|
||||||
|
if (res) {
|
||||||
|
console.log('--0', res)
|
||||||
|
getTomorrowDate(res);
|
||||||
|
} else {
|
||||||
|
console.log('--1', res)
|
||||||
|
getTomorrowDate();
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const bindType = (e) => {
|
const bindType = (e) => {
|
||||||
typeIndex.value = e.detail.value
|
typeIndex.value = e.detail.value
|
||||||
}
|
}
|
||||||
|
|
||||||
const getTomorrowDate = () => {
|
const getTomorrowDate = (e) => {
|
||||||
let today = new Date();
|
let tomorrow;
|
||||||
let tomorrow = new Date(today);
|
if (e) {
|
||||||
tomorrow.setDate(today.getDate() + 1);
|
// 将传入的日期字符串转换为Date对象
|
||||||
// 格式化日期为 yyyy-mm-dd
|
const dateParts = e.split('-').map(Number);
|
||||||
let year = tomorrow.getFullYear();
|
tomorrow = new Date(dateParts[0], dateParts[1] - 1, dateParts[2]);
|
||||||
let month = String(tomorrow.getMonth() + 1).padStart(2, '0'); // 月份从0开始,需要加1
|
} else {
|
||||||
let day = String(tomorrow.getDate()).padStart(2, '0');
|
// 如果没有提供日期,则使用当前日期
|
||||||
beginTime.value = year + '-' + month + '-' + day;
|
tomorrow = new Date();
|
||||||
|
}
|
||||||
|
// 设置为明天的日期
|
||||||
|
tomorrow.setDate(tomorrow.getDate() + 1);
|
||||||
|
// 格式化日期
|
||||||
|
const year = tomorrow.getFullYear();
|
||||||
|
const month = (tomorrow.getMonth() + 1).toString().padStart(2, '0');
|
||||||
|
const day = tomorrow.getDate().toString().padStart(2, '0');
|
||||||
|
beginTime.value = `${year}-${month}-${day}`;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -20,7 +20,9 @@
|
|||||||
</view>
|
</view>
|
||||||
</customNav>
|
</customNav>
|
||||||
<component :is="comp" :dataId="dataId"></component>
|
<component :is="comp" :dataId="dataId"></component>
|
||||||
<view class="btn f-row aic jcb" v-if="type == 0">
|
<view v-if="ifShow" style="display: block; margin: 10px;">
|
||||||
|
温馨提示:目前APP暂不支持电子签章审批,请登录PC端厂综合管理平台(https://10.75.166.6),在个人办公-我的任务中审批。</view>
|
||||||
|
<view class="btn f-row aic jcb" v-if="type == 0 && !ifShow">
|
||||||
<view class="refuse" @click="openpop(1)">
|
<view class="refuse" @click="openpop(1)">
|
||||||
拒绝
|
拒绝
|
||||||
</view>
|
</view>
|
||||||
@ -28,7 +30,6 @@
|
|||||||
同意
|
同意
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<uni-popup ref="popup" type="center">
|
<uni-popup ref="popup" type="center">
|
||||||
<view class="popup">
|
<view class="popup">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
@ -110,6 +111,7 @@
|
|||||||
}
|
}
|
||||||
const comp = ref(null)
|
const comp = ref(null)
|
||||||
const dataId = ref('')
|
const dataId = ref('')
|
||||||
|
const ifShow = ref(false) //20250122 判断是否是签章业务 提示文字
|
||||||
const getProcessNodeInfo = (taskId) => {
|
const getProcessNodeInfo = (taskId) => {
|
||||||
getProcessNodeInfoApi({
|
getProcessNodeInfoApi({
|
||||||
taskId
|
taskId
|
||||||
@ -149,6 +151,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**流程办理接口*/
|
/**流程办理接口*/
|
||||||
const processComplete = (params) => {
|
const processComplete = (params) => {
|
||||||
processCompleteApi({
|
processCompleteApi({
|
||||||
@ -165,7 +168,6 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**审批流程节点*/
|
/**审批流程节点*/
|
||||||
const stepNode = ref([])
|
const stepNode = ref([])
|
||||||
/**当前选择的节点*/
|
/**当前选择的节点*/
|
||||||
@ -185,6 +187,7 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/**历史任务详情*/
|
/**历史任务详情*/
|
||||||
const getHisProcessNodeInfo = (procInstId) => {
|
const getHisProcessNodeInfo = (procInstId) => {
|
||||||
getHisProcessNodeInfoApi({
|
getHisProcessNodeInfoApi({
|
||||||
@ -196,6 +199,18 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
/**判断是否是电子签章节点任务,是则显示温馨提示并隐藏审批按钮*/
|
||||||
|
const getIfShow = () => {
|
||||||
|
if (taskInfo.value.taskId == 'task1705482211321' || taskInfo.value.taskId == 'task1705482639673' ||
|
||||||
|
taskInfo.value.taskId == 'task1714092890849' || taskInfo.value.taskId == 'task1714092955682' ||
|
||||||
|
taskInfo.value.taskId == 'task1689151174324' || taskInfo.value.taskId == 'task1677809773570' ||
|
||||||
|
taskInfo.value.taskId == 'task1689579219152')
|
||||||
|
{ // 签章业务:非常规 承包商资质审查 招标采购 公务接待 房屋租赁
|
||||||
|
ifShow.value = true;
|
||||||
|
} else {
|
||||||
|
ifShow.value = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
const taskInfo = ref(null)
|
const taskInfo = ref(null)
|
||||||
let type = null
|
let type = null
|
||||||
onLoad((options) => {
|
onLoad((options) => {
|
||||||
@ -207,6 +222,8 @@
|
|||||||
getProcessNodeInfo(taskInfo.value.id)
|
getProcessNodeInfo(taskInfo.value.id)
|
||||||
getProcessTaskTransInfo()
|
getProcessTaskTransInfo()
|
||||||
|
|
||||||
|
getIfShow()
|
||||||
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
|
@ -8,31 +8,28 @@
|
|||||||
</uni-section>
|
</uni-section>
|
||||||
<uni-section title="统计信息" type="line">
|
<uni-section title="统计信息" type="line">
|
||||||
<uni-card :is-shadow="false">
|
<uni-card :is-shadow="false">
|
||||||
<button type="primary" @click="toTongji">年龄分组统计</button>
|
<button type="primary" @click="toTongji">分类统计</button>
|
||||||
<button type="primary" @click="toXbTongji">性别分组统计</button>
|
|
||||||
</uni-card>
|
</uni-card>
|
||||||
</uni-section>
|
</uni-section>
|
||||||
|
|
||||||
</uni-card>
|
</uni-card>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
function toTaizhang() {
|
function toTaizhang() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/views/renliziyuan/renyuanxinxi/taizhang'
|
url: "/pages/views/renliziyuan/renyuanxinxi/taizhang"
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function toTongji() {
|
function toTongji() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/views/renliziyuan/renyuanxinxi/tongji'
|
url: "/pages/views/renliziyuan/renyuanxinxi/tongji"
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
function toXbTongji() {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/views/renliziyuan/renyuanxinxi/xbtongji'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style></style>
|
<style>
|
||||||
|
</style>
|
@ -1,17 +1,18 @@
|
|||||||
<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="'所选单位ID:' + orgCode" 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>
|
||||||
<!-- 概览统计 -->
|
<!-- 概览统计 -->
|
||||||
<view class="stats-box" v-if="summary.total">
|
<view class="stats-box" v-if="summary.total">
|
||||||
<view class="stat-item">
|
<view class=" stat-item">
|
||||||
<text class="label">总人数</text>
|
<text class="label">总人数</text>
|
||||||
<text class="value">{{ summary.total }}</text>
|
<text class="value">{{ summary.total }}</text>
|
||||||
</view>
|
</view>
|
||||||
@ -26,47 +27,56 @@
|
|||||||
<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">
|
||||||
{{ index + 1 }}
|
{{index+1}}
|
||||||
</view>
|
</view>
|
||||||
</uni-col>
|
</uni-col>
|
||||||
<uni-col :span="5">
|
<uni-col :span="5">
|
||||||
<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>
|
||||||
</uni-col>
|
</uni-col>
|
||||||
<uni-col :span="6">
|
<uni-col :span="6">
|
||||||
@ -74,291 +84,310 @@
|
|||||||
<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);
|
||||||
// 新增加载状态
|
// 新增加载状态
|
||||||
const isLoading = ref(false);
|
const isLoading = ref(false);
|
||||||
const orgCode = ref('');
|
const orgCode = ref('');
|
||||||
const rawData = ref([]);
|
const rawData = ref([]);
|
||||||
const tableData = ref([]);
|
const tableData = ref([]);
|
||||||
const summary = reactive({
|
const summary = reactive({
|
||||||
total: 0,
|
total: 0,
|
||||||
avgAge: 0
|
avgAge: 0
|
||||||
});
|
|
||||||
const chart = ref(null);
|
|
||||||
const chartOption = ref({});
|
|
||||||
const drillPopup = ref(null);
|
|
||||||
const drillList = ref([]);
|
|
||||||
const drillTitle = ref('');
|
|
||||||
|
|
||||||
function detail(record) {
|
|
||||||
// console.log(record)
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/views/renliziyuan/renyuanxinxi/detail?data=' + encodeURIComponent(JSON.stringify(record))
|
|
||||||
});
|
});
|
||||||
}
|
const chart = ref(null);
|
||||||
// 计算年龄initChart
|
const chartOption = ref({});
|
||||||
const calculateAge = (birthDate) => {
|
const drillPopup = ref(null);
|
||||||
const today = new Date();
|
const drillList = ref([]);
|
||||||
const birth = new Date(birthDate);
|
const drillTitle = ref('');
|
||||||
let age = today.getFullYear() - birth.getFullYear();
|
|
||||||
const monthDiff = today.getMonth() - birth.getMonth();
|
function detail(record) {
|
||||||
if (monthDiff < 0 || (monthDiff === 0 && today.getDate() < birth.getDate())) {
|
// console.log(record)
|
||||||
age--;
|
uni.navigateTo({
|
||||||
|
url: "/pages/views/renliziyuan/renyuanxinxi/detail?data=" + encodeURIComponent(JSON.stringify(record))
|
||||||
|
})
|
||||||
}
|
}
|
||||||
return age;
|
// 计算年龄initChart
|
||||||
};
|
const calculateAge = (birthDate) => {
|
||||||
// 加载数据
|
const today = new Date();
|
||||||
const departChange = async (e, data) => {
|
const birth = new Date(birthDate);
|
||||||
tableData.value = [];
|
let age = today.getFullYear() - birth.getFullYear();
|
||||||
console.log(e);
|
const monthDiff = today.getMonth() - birth.getMonth();
|
||||||
orgCode.value = e;
|
if (monthDiff < 0 || (monthDiff === 0 && today.getDate() < birth.getDate())) {
|
||||||
try {
|
age--;
|
||||||
// 显示加载状态
|
|
||||||
|
|
||||||
isLoading.value = true;
|
|
||||||
if (orgCode.value.length <= 6) {
|
|
||||||
console.log(123242353);
|
|
||||||
uni.showLoading({
|
|
||||||
title: '全厂数据较多,耐心等待数据加载中...',
|
|
||||||
mask: true
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
uni.showLoading({
|
|
||||||
title: '数据加载中...',
|
|
||||||
mask: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
return age;
|
||||||
|
};
|
||||||
|
// 加载数据
|
||||||
|
const departChange = async (e, data) => {
|
||||||
|
|
||||||
let params = {
|
tableData.value = []
|
||||||
pageSize: 3000,
|
console.log(e)
|
||||||
fields: ['xm', 'nl', 'xb', 'xb_dictText', 'orgCode', 'jcdw', 'jcxd', 'jcxdCode']
|
orgCode.value = e;
|
||||||
};
|
try {
|
||||||
if (orgCode.value.length <= 9) {
|
// 显示加载状态
|
||||||
params.orgCode = orgCode.value;
|
|
||||||
} else {
|
isLoading.value = true;
|
||||||
params.jcxd_code = orgCode.value;
|
if (orgCode.value.length <= 6) {
|
||||||
}
|
|
||||||
queryRenyuanByDepartID(params)
|
console.log(123242353)
|
||||||
.then((res) => {
|
uni.showLoading({
|
||||||
|
title: '全厂数据较多,耐心等待数据加载中...',
|
||||||
|
mask: true
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.showLoading({
|
||||||
|
title: '数据加载中...',
|
||||||
|
mask: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
let params = {
|
||||||
|
pageSize: 3000,
|
||||||
|
fields: ['xm', 'nl', 'xb', 'xb_dictText', 'orgCode', 'jcdw', 'jcxd', 'jcxdCode']
|
||||||
|
};
|
||||||
|
if (orgCode.value.length <= 9) {
|
||||||
|
params.orgCode = orgCode.value
|
||||||
|
} else {
|
||||||
|
params.jcxd_code = orgCode.value
|
||||||
|
|
||||||
|
}
|
||||||
|
queryRenyuanByDepartID(params).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) => {
|
||||||
.catch((err) => {
|
console.log(err)
|
||||||
console.log(err);
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '数据加载失败',
|
title: '数据加载失败',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
});
|
});
|
||||||
});
|
})
|
||||||
} catch (error) {
|
|
||||||
console.log(error);
|
|
||||||
uni.showToast({
|
|
||||||
title: '数据加载失败',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
} finally {
|
|
||||||
// 隐藏加载状态
|
|
||||||
isLoading.value = false;
|
|
||||||
uni.hideLoading();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 数据处理
|
|
||||||
const processData = (data) => {
|
} catch (error) {
|
||||||
// 添加年龄字段并过滤有效数据
|
console.log(error)
|
||||||
const validData = data
|
uni.showToast({
|
||||||
.map((item) => ({
|
title: '数据加载失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
} finally {
|
||||||
|
// 隐藏加载状态
|
||||||
|
isLoading.value = false;
|
||||||
|
uni.hideLoading();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// 数据处理
|
||||||
|
const processData = (data) => {
|
||||||
|
|
||||||
|
// 添加年龄字段并过滤有效数据
|
||||||
|
const validData = data.map(item => ({
|
||||||
...item,
|
...item,
|
||||||
nl: calculateAge(item.cssj)
|
nl: calculateAge(item.cssj)
|
||||||
|
})).filter(item => item.nl >= 21 && item.nl <= 64);
|
||||||
|
// 计算概览数据
|
||||||
|
summary.total = validData.length;
|
||||||
|
summary.avgAge = validData.reduce((sum, cur) => sum + cur.nl, 0) / summary.total || 0;
|
||||||
|
// 生成表格数据
|
||||||
|
// tableData.value = validData;
|
||||||
|
|
||||||
|
groupsData(validData);
|
||||||
|
// 生成图表数据
|
||||||
|
generateChartData(validData);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
// 计算统计信息...
|
||||||
|
const subOrgStaffs = ref({}); // 按下级单位存储所有人员
|
||||||
|
const ageGroupStaffs = ref({}); // 按年龄段存储所有人员
|
||||||
|
|
||||||
|
|
||||||
|
const groupsData = (data) => {
|
||||||
|
// 清空旧数据
|
||||||
|
subOrgStaffs.value = {};
|
||||||
|
ageGroupStaffs.value = {};
|
||||||
|
data.reduce((acc, cur) => {
|
||||||
|
// console.log(cur)
|
||||||
|
let subOrg = "";
|
||||||
|
let ageRange = getAgeRange(cur.nl);
|
||||||
|
// console.log(cur.orgCode, cur.jcxdCode)
|
||||||
|
if (cur.orgCode <= 6) {
|
||||||
|
subOrg = cur.orgCode
|
||||||
|
} else {
|
||||||
|
subOrg = cur.jcxdCode
|
||||||
|
}
|
||||||
|
|
||||||
|
// 存储到subOrgStaffs
|
||||||
|
if (!subOrgStaffs.value[subOrg]) {
|
||||||
|
subOrgStaffs.value[subOrg] = [];
|
||||||
|
}
|
||||||
|
subOrgStaffs.value[subOrg].push(cur);
|
||||||
|
|
||||||
|
// 存储到ageGroupStaffs
|
||||||
|
if (!ageGroupStaffs.value[ageRange]) {
|
||||||
|
ageGroupStaffs.value[ageRange] = [];
|
||||||
|
}
|
||||||
|
ageGroupStaffs.value[ageRange].push(cur);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 新增年龄范围计算方法
|
||||||
|
const getAgeRange = (age) => {
|
||||||
|
const ranges = ['21-30岁', '31-40岁', '41-50岁', '51-60岁', '61-64岁'];
|
||||||
|
const index = Math.floor((age - 21) / 10);
|
||||||
|
return ranges[index] || '其他';
|
||||||
|
};
|
||||||
|
|
||||||
|
// 修改后的显示人员列表方法
|
||||||
|
const showStaffList = (subOrg, ageRange) => {
|
||||||
|
// 从结构化数据中直接获取
|
||||||
|
const targetStaffs = subOrgStaffs.value[subOrg].filter(staff =>
|
||||||
|
getAgeRange(staff.nl) === ageRange
|
||||||
|
);
|
||||||
|
|
||||||
|
staffList.value = targetStaffs;
|
||||||
|
popupTitle.value = `${subOrg} ${ageRange}人员列表(共${targetStaffs.length}人)`;
|
||||||
|
popup.value.open();
|
||||||
|
};
|
||||||
|
|
||||||
|
// 新增获取指定单位人员的方法
|
||||||
|
const getSubOrgStaffs = (subOrgCode) => {
|
||||||
|
return subOrgStaffs.value[subOrgCode] || [];
|
||||||
|
};
|
||||||
|
|
||||||
|
// 新增获取指定年龄段人员的方法
|
||||||
|
const getAgeGroupStaffs = (ageRange) => {
|
||||||
|
return ageGroupStaffs.value[ageRange] || [];
|
||||||
|
};
|
||||||
|
|
||||||
|
// 生成图表数据(修改部分)
|
||||||
|
const generateChartData = (data) => {
|
||||||
|
// 按基层单位分组
|
||||||
|
const ageRanges = ['21-30岁', '31-40岁', '41-50岁', '51-60岁', '61-64岁'];
|
||||||
|
const jcdwGroups = data.reduce((acc, cur) => {
|
||||||
|
if (!acc[cur.jcdw]) {
|
||||||
|
acc[cur.jcdw] = {
|
||||||
|
ageGroups: [0, 0, 0, 0, 0] // 21-30,31-40,41-50,51-60,61-64
|
||||||
|
};
|
||||||
|
}
|
||||||
|
const ageGroup = Math.floor((cur.nl - 21) / 10);
|
||||||
|
// console.log(ageGroup, cur.jcdw)
|
||||||
|
if (ageGroup >= 0 && ageGroup <= 4) {
|
||||||
|
acc[cur.jcdw].ageGroups[ageGroup]++;
|
||||||
|
}
|
||||||
|
return acc;
|
||||||
|
}, {});
|
||||||
|
|
||||||
|
|
||||||
|
// 生成分组柱状图配置
|
||||||
|
const xData = Object.keys(jcdwGroups);
|
||||||
|
|
||||||
|
const seriesData = ageRanges.map((range, index) => ({
|
||||||
|
name: range,
|
||||||
|
type: 'bar',
|
||||||
|
data: xData.map(jcdw => jcdwGroups[jcdw].ageGroups[index] || 0),
|
||||||
|
itemStyle: {
|
||||||
|
color: ['#5470C6', '#91CC75', '#FAC858', '#EE6666', '#73C0DE'][index]
|
||||||
|
},
|
||||||
|
// 显示数值标签
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
position: 'top'
|
||||||
|
},
|
||||||
|
// 设置柱宽为 20 像素
|
||||||
|
// barWidth: 20
|
||||||
}))
|
}))
|
||||||
.filter((item) => item.nl >= 21 && item.nl <= 64);
|
chartOption.value = {
|
||||||
// 计算概览数据
|
title: {
|
||||||
summary.total = validData.length;
|
text: '人员年龄分组统计',
|
||||||
summary.avgAge = validData.reduce((sum, cur) => sum + cur.nl, 0) / summary.total || 0;
|
padding: [0, 0, 0, 30],
|
||||||
// 生成表格数据
|
},
|
||||||
// tableData.value = validData;
|
toolbox: {
|
||||||
|
padding: [0, 30, 0, 0],
|
||||||
|
show: true,
|
||||||
|
feature: {
|
||||||
|
//工具配置项
|
||||||
|
|
||||||
groupsData(validData);
|
restore: {
|
||||||
// 生成图表数据
|
show: true //是否显示该工具
|
||||||
generateChartData(validData);
|
},
|
||||||
};
|
saveAsImage: {
|
||||||
|
show: true //是否显示该工具
|
||||||
// 计算统计信息...
|
}
|
||||||
const subOrgStaffs = ref({}); // 按下级单位存储所有人员
|
|
||||||
const ageGroupStaffs = ref({}); // 按年龄段存储所有人员
|
|
||||||
|
|
||||||
const groupsData = (data) => {
|
|
||||||
// 清空旧数据
|
|
||||||
subOrgStaffs.value = {};
|
|
||||||
ageGroupStaffs.value = {};
|
|
||||||
data.reduce((acc, cur) => {
|
|
||||||
// console.log(cur)
|
|
||||||
let subOrg = '';
|
|
||||||
let ageRange = getAgeRange(cur.nl);
|
|
||||||
// console.log(cur.orgCode, cur.jcxdCode)
|
|
||||||
if (cur.orgCode <= 6) {
|
|
||||||
subOrg = cur.orgCode;
|
|
||||||
} else {
|
|
||||||
subOrg = cur.jcxdCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 存储到subOrgStaffs
|
|
||||||
if (!subOrgStaffs.value[subOrg]) {
|
|
||||||
subOrgStaffs.value[subOrg] = [];
|
|
||||||
}
|
|
||||||
subOrgStaffs.value[subOrg].push(cur);
|
|
||||||
|
|
||||||
// 存储到ageGroupStaffs
|
|
||||||
if (!ageGroupStaffs.value[ageRange]) {
|
|
||||||
ageGroupStaffs.value[ageRange] = [];
|
|
||||||
}
|
|
||||||
ageGroupStaffs.value[ageRange].push(cur);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// 新增年龄范围计算方法
|
|
||||||
const getAgeRange = (age) => {
|
|
||||||
const ranges = ['21-30岁', '31-40岁', '41-50岁', '51-60岁', '61-64岁'];
|
|
||||||
const index = Math.floor((age - 21) / 10);
|
|
||||||
return ranges[index] || '其他';
|
|
||||||
};
|
|
||||||
|
|
||||||
// 修改后的显示人员列表方法
|
|
||||||
const showStaffList = (subOrg, ageRange) => {
|
|
||||||
// 从结构化数据中直接获取
|
|
||||||
const targetStaffs = subOrgStaffs.value[subOrg].filter((staff) => getAgeRange(staff.nl) === ageRange);
|
|
||||||
|
|
||||||
staffList.value = targetStaffs;
|
|
||||||
popupTitle.value = `${subOrg} ${ageRange}人员列表(共${targetStaffs.length}人)`;
|
|
||||||
popup.value.open();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 新增获取指定单位人员的方法
|
|
||||||
const getSubOrgStaffs = (subOrgCode) => {
|
|
||||||
return subOrgStaffs.value[subOrgCode] || [];
|
|
||||||
};
|
|
||||||
|
|
||||||
// 新增获取指定年龄段人员的方法
|
|
||||||
const getAgeGroupStaffs = (ageRange) => {
|
|
||||||
return ageGroupStaffs.value[ageRange] || [];
|
|
||||||
};
|
|
||||||
|
|
||||||
// 生成图表数据(修改部分)
|
|
||||||
const generateChartData = (data) => {
|
|
||||||
// 按基层单位分组
|
|
||||||
const ageRanges = ['21-30岁', '31-40岁', '41-50岁', '51-60岁', '61-64岁'];
|
|
||||||
const jcdwGroups = data.reduce((acc, cur) => {
|
|
||||||
if (!acc[cur.jcdw]) {
|
|
||||||
acc[cur.jcdw] = {
|
|
||||||
ageGroups: [0, 0, 0, 0, 0] // 21-30,31-40,41-50,51-60,61-64
|
|
||||||
};
|
|
||||||
}
|
|
||||||
const ageGroup = Math.floor((cur.nl - 21) / 10);
|
|
||||||
// console.log(ageGroup, cur.jcdw)
|
|
||||||
if (ageGroup >= 0 && ageGroup <= 4) {
|
|
||||||
acc[cur.jcdw].ageGroups[ageGroup]++;
|
|
||||||
}
|
|
||||||
return acc;
|
|
||||||
}, {});
|
|
||||||
|
|
||||||
// 生成分组柱状图配置
|
|
||||||
const xData = Object.keys(jcdwGroups);
|
|
||||||
|
|
||||||
const seriesData = ageRanges.map((range, index) => ({
|
|
||||||
name: range,
|
|
||||||
type: 'bar',
|
|
||||||
data: xData.map((jcdw) => jcdwGroups[jcdw].ageGroups[index] || 0),
|
|
||||||
itemStyle: {
|
|
||||||
color: ['#5470C6', '#91CC75', '#FAC858', '#EE6666', '#73C0DE'][index]
|
|
||||||
},
|
|
||||||
// 显示数值标签
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: 'top'
|
|
||||||
}
|
|
||||||
// 设置柱宽为 20 像素
|
|
||||||
// barWidth: 20
|
|
||||||
}));
|
|
||||||
chartOption.value = {
|
|
||||||
title: {
|
|
||||||
text: '人员年龄分组统计',
|
|
||||||
padding: [0, 0, 0, 30]
|
|
||||||
},
|
|
||||||
toolbox: {
|
|
||||||
padding: [0, 30, 0, 0],
|
|
||||||
show: true,
|
|
||||||
feature: {
|
|
||||||
//工具配置项
|
|
||||||
|
|
||||||
restore: {
|
|
||||||
show: true //是否显示该工具
|
|
||||||
},
|
|
||||||
saveAsImage: {
|
|
||||||
show: true //是否显示该工具
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
|
||||||
// tooltip: {
|
|
||||||
// trigger: 'axis',
|
|
||||||
// axisPointer: {
|
|
||||||
// type: 'shadow',
|
|
||||||
// label: {
|
|
||||||
// show: false
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
grid: {
|
|
||||||
top: '15%',
|
|
||||||
left: '4%',
|
|
||||||
right: '4%',
|
|
||||||
bottom: '10%',
|
|
||||||
containLabel: true
|
|
||||||
},
|
|
||||||
legend: {
|
|
||||||
data: ageRanges,
|
|
||||||
itemGap: 5,
|
|
||||||
padding: [0, 15, 0, 15],
|
|
||||||
y: 'bottom',
|
|
||||||
itemHeight: 8, //高
|
|
||||||
itemWidth: 8, //宽
|
|
||||||
type: 'scroll'
|
|
||||||
},
|
|
||||||
xAxis: {
|
|
||||||
type: 'category',
|
|
||||||
data: xData,
|
|
||||||
axisLabel: {
|
|
||||||
color: '#7F84B5',
|
|
||||||
fontWeight: 300,
|
|
||||||
interval: 0,
|
|
||||||
rotate: 0
|
|
||||||
},
|
},
|
||||||
padding: [0, 10, 0, 10],
|
// tooltip: {
|
||||||
axisTick: {
|
// trigger: 'axis',
|
||||||
show: false //刻度线
|
// axisPointer: {
|
||||||
|
// type: 'shadow',
|
||||||
|
// label: {
|
||||||
|
// show: false
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
grid: {
|
||||||
|
top: '15%',
|
||||||
|
left: '4%',
|
||||||
|
right: '4%',
|
||||||
|
bottom: '10%',
|
||||||
|
containLabel: true
|
||||||
},
|
},
|
||||||
axisLine: {
|
legend: {
|
||||||
show: false //不显示坐标轴线
|
data: ageRanges,
|
||||||
}
|
itemGap: 5,
|
||||||
},
|
padding: [0, 15, 0, 15],
|
||||||
yAxis: [
|
y: 'bottom',
|
||||||
{
|
itemHeight: 8, //高
|
||||||
|
itemWidth: 8, //宽
|
||||||
|
type: 'scroll'
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
type: 'category',
|
||||||
|
data: xData,
|
||||||
|
axisLabel: {
|
||||||
|
color: '#7F84B5',
|
||||||
|
fontWeight: 300,
|
||||||
|
interval: 0,
|
||||||
|
rotate: 0,
|
||||||
|
},
|
||||||
|
padding: [0, 10, 0, 10],
|
||||||
|
axisTick: {
|
||||||
|
show: false //刻度线
|
||||||
|
},
|
||||||
|
axisLine: {
|
||||||
|
show: false //不显示坐标轴线
|
||||||
|
}
|
||||||
|
},
|
||||||
|
yAxis: [{
|
||||||
show: true,
|
show: true,
|
||||||
boundaryGap: false, //解决数据与线不对应问题
|
boundaryGap: false, //解决数据与线不对应问题
|
||||||
type: 'value',
|
type: 'value',
|
||||||
@ -382,147 +411,153 @@ const generateChartData = (data) => {
|
|||||||
axisLine: {
|
axisLine: {
|
||||||
show: false //不显示坐标轴线
|
show: false //不显示坐标轴线
|
||||||
}
|
}
|
||||||
}
|
}],
|
||||||
],
|
|
||||||
|
series: seriesData,
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
// 初始化图表
|
||||||
|
setTimeout(async () => {
|
||||||
|
if (!chart.value) return
|
||||||
|
const myChart = await chart.value.init(echarts)
|
||||||
|
myChart.setOption(chartOption.value)
|
||||||
|
myChart.on('click', (params) => {
|
||||||
|
console.log(params.seriesName)
|
||||||
|
tableData.value = getAgeGroupStaffs(params.seriesName)
|
||||||
|
|
||||||
|
})
|
||||||
|
}, 300)
|
||||||
|
|
||||||
|
|
||||||
|
// #ifdef APP
|
||||||
|
getHeight();
|
||||||
|
// #endif
|
||||||
|
|
||||||
series: seriesData
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
|
||||||
|
// #ifdef APP
|
||||||
|
getHeight();
|
||||||
|
// #endif
|
||||||
|
})
|
||||||
|
// #ifdef APP
|
||||||
|
|
||||||
|
const getHeight = () => {
|
||||||
|
// 获取屏幕高度
|
||||||
|
const systemInfo = uni.getSystemInfoSync();
|
||||||
|
const screenHeight = systemInfo.screenHeight;
|
||||||
|
// 创建选择器查询对象
|
||||||
|
const query = uni.createSelectorQuery();
|
||||||
|
// 获取上方组件的高度
|
||||||
|
query
|
||||||
|
.select('#top1')
|
||||||
|
.boundingClientRect((rect1) => {
|
||||||
|
// 计算上方组件高度总和
|
||||||
|
const topComponentsHeight = rect1.height
|
||||||
|
// 计算下方组件的高度
|
||||||
|
bottomHeight.value = screenHeight - topComponentsHeight - 415;
|
||||||
|
})
|
||||||
|
.exec();
|
||||||
|
};
|
||||||
|
|
||||||
|
// #endif
|
||||||
// 初始化图表
|
// 初始化图表
|
||||||
setTimeout(async () => {
|
const initChart = () => {
|
||||||
if (!chart.value) return;
|
setTimeout(async () => {
|
||||||
const myChart = await chart.value.init(echarts);
|
if (!chart.value) return
|
||||||
myChart.setOption(chartOption.value);
|
const myChart = await chart.value.init(echarts)
|
||||||
myChart.on('click', (params) => {
|
myChart.setOption(chartOption.value)
|
||||||
console.log(params.seriesName);
|
}, 300)
|
||||||
tableData.value = getAgeGroupStaffs(params.seriesName);
|
};
|
||||||
});
|
|
||||||
}, 300);
|
|
||||||
|
|
||||||
// #ifdef APP
|
|
||||||
getHeight();
|
|
||||||
// #endif
|
|
||||||
};
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
// #ifdef APP
|
|
||||||
getHeight();
|
|
||||||
// #endif
|
|
||||||
});
|
|
||||||
// #ifdef APP
|
|
||||||
|
|
||||||
const getHeight = () => {
|
|
||||||
// 获取屏幕高度
|
|
||||||
const systemInfo = uni.getSystemInfoSync();
|
|
||||||
const screenHeight = systemInfo.screenHeight;
|
|
||||||
// 创建选择器查询对象
|
|
||||||
const query = uni.createSelectorQuery();
|
|
||||||
// 获取上方组件的高度
|
|
||||||
query
|
|
||||||
.select('#top1')
|
|
||||||
.boundingClientRect((rect1) => {
|
|
||||||
// 计算上方组件高度总和
|
|
||||||
const topComponentsHeight = rect1.height;
|
|
||||||
// 计算下方组件的高度
|
|
||||||
bottomHeight.value = screenHeight - topComponentsHeight - 415;
|
|
||||||
})
|
|
||||||
.exec();
|
|
||||||
};
|
|
||||||
|
|
||||||
// #endif
|
|
||||||
// 初始化图表
|
|
||||||
const initChart = () => {
|
|
||||||
setTimeout(async () => {
|
|
||||||
if (!chart.value) return;
|
|
||||||
const myChart = await chart.value.init(echarts);
|
|
||||||
myChart.setOption(chartOption.value);
|
|
||||||
}, 300);
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.container {
|
.container {
|
||||||
margin: 20, 20, 20, 20rpx;
|
margin: 20, 20, 20, 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-group {
|
.input-group {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 20rpx;
|
gap: 20rpx;
|
||||||
margin-bottom: 30rpx;
|
margin-bottom: 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input {
|
.input {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
border: 1rpx solid #ddd;
|
border: 1rpx solid #ddd;
|
||||||
padding: 15rpx;
|
padding: 15rpx;
|
||||||
border-radius: 8rpx;
|
border-radius: 8rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.query-btn {
|
.query-btn {
|
||||||
background: #007aff;
|
background: #007AFF;
|
||||||
color: white;
|
color: white;
|
||||||
padding: 0 40rpx;
|
padding: 0 40rpx;
|
||||||
border-radius: 8rpx;
|
border-radius: 8rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stats-box {
|
.stats-box {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
margin: 30rpx 0;
|
margin: 30rpx 0;
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
background: #f8f8f8;
|
background: #f8f8f8;
|
||||||
border-radius: 12rpx;
|
border-radius: 12rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stat-item {
|
.stat-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.label {
|
.label {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #666;
|
color: #666;
|
||||||
}
|
}
|
||||||
|
|
||||||
.value {
|
.value {
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #0000ff;
|
color: #0000ff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.chart-container {
|
.chart-container {
|
||||||
height: 400rpx;
|
height: 400rpx;
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.titleStyle {
|
.titleStyle {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
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;
|
||||||
}
|
;
|
||||||
|
}
|
||||||
|
|
||||||
/* 内容样式 */
|
/* 内容样式 */
|
||||||
.dataStyle {
|
.dataStyle {
|
||||||
max-font-size: 14px;
|
max-font-size: 14px;
|
||||||
/* 最大字体限制 */
|
/* 最大字体限制 */
|
||||||
min-font-size: 10px;
|
min-font-size: 10px;
|
||||||
/* 最小字体限制 */
|
/* 最小字体限制 */
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #00007f;
|
color: #00007f;
|
||||||
line-height: 30px;
|
line-height: 30px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
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>
|
@ -1,517 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view>
|
|
||||||
<view class="container" id="top1">
|
|
||||||
<uni-row style="margin-bottom: 10rpx; margin-left: 30rpx; margin-right: 30rpx">
|
|
||||||
<uni-col :span="24"><uni-title :title="'所选单位ID:' + orgCode" align="left" type="h4"></uni-title></uni-col>
|
|
||||||
</uni-row>
|
|
||||||
<uni-row style="margin-bottom: 20rpx; margin-left: 30rpx; margin-right: 30rpx">
|
|
||||||
<uni-col :span="24">
|
|
||||||
<trq-depart-select v-model="orgCode" returnCodeOrID="orgCode" @change="departChange"></trq-depart-select>
|
|
||||||
</uni-col>
|
|
||||||
</uni-row>
|
|
||||||
<!-- 概览统计 -->
|
|
||||||
<view class="stats-box" v-if="summary.total">
|
|
||||||
<view class="stat-item">
|
|
||||||
<text class="label">总人数</text>
|
|
||||||
<text class="value">{{ summary.total }}</text>
|
|
||||||
</view>
|
|
||||||
<view class="stat-item">
|
|
||||||
<text class="label">平均年龄</text>
|
|
||||||
<text class="value">{{ summary.avgAge.toFixed(1) }}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- ECharts图表 -->
|
|
||||||
<view class="chart-container">
|
|
||||||
<l-echart ref="chart" @finished="initChart" />
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 数据表格 -->
|
|
||||||
|
|
||||||
<uni-row style="margin-top: 10px; margin-left: 30rpx; margin-right: 30rpx" v-if="tableData.length > 0">
|
|
||||||
<uni-col :span="3">
|
|
||||||
<view class="titleStyle">序号</view>
|
|
||||||
</uni-col>
|
|
||||||
<uni-col :span="5">
|
|
||||||
<view class="titleStyle">姓名</view>
|
|
||||||
</uni-col>
|
|
||||||
<uni-col :span="5">
|
|
||||||
<view class="titleStyle">性别</view>
|
|
||||||
</uni-col>
|
|
||||||
<uni-col :span="5">
|
|
||||||
<view class="titleStyle">年龄</view>
|
|
||||||
</uni-col>
|
|
||||||
<uni-col :span="6">
|
|
||||||
<view class="titleStyle">操作</view>
|
|
||||||
</uni-col>
|
|
||||||
</uni-row>
|
|
||||||
|
|
||||||
<scroll-view scroll-y :style="{ height: bottomHeight + 'px' }">
|
|
||||||
<uni-row style="margin-bottom: 10rpx; margin-left: 30rpx; margin-right: 30rpx">
|
|
||||||
<view v-for="(item, index) in tableData">
|
|
||||||
<uni-col :span="3">
|
|
||||||
<view class="dataStyle">
|
|
||||||
{{ index + 1 }}
|
|
||||||
</view>
|
|
||||||
</uni-col>
|
|
||||||
<uni-col :span="5">
|
|
||||||
<view class="dataStyle">
|
|
||||||
{{ item.xm }}
|
|
||||||
</view>
|
|
||||||
</uni-col>
|
|
||||||
<uni-col :span="5">
|
|
||||||
<view class="dataStyle">
|
|
||||||
{{ item.xb_dictText }}
|
|
||||||
</view>
|
|
||||||
</uni-col>
|
|
||||||
<uni-col :span="5">
|
|
||||||
<view class="dataStyle">
|
|
||||||
{{ item.nl }}
|
|
||||||
</view>
|
|
||||||
</uni-col>
|
|
||||||
<uni-col :span="6">
|
|
||||||
<view class="dataStyle">
|
|
||||||
<button size="mini" type="primary" @click="detail(item)">详情</button>
|
|
||||||
</view>
|
|
||||||
</uni-col>
|
|
||||||
</view>
|
|
||||||
</uni-row>
|
|
||||||
</scroll-view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { ref, reactive, onMounted } from 'vue';
|
|
||||||
import * as echarts from 'echarts';
|
|
||||||
import { cxcRyDataTongji, queryRenyuanByDepartID } from '@/api/renyuan.js';
|
|
||||||
// 存储下方组件的高度
|
|
||||||
const bottomHeight = ref(0);
|
|
||||||
// 新增加载状态
|
|
||||||
const isLoading = ref(false);
|
|
||||||
const orgCode = ref('');
|
|
||||||
const rawData = ref([]);
|
|
||||||
const tableData = ref([]);
|
|
||||||
const summary = reactive({
|
|
||||||
total: 0,
|
|
||||||
avgAge: 0
|
|
||||||
});
|
|
||||||
const chart = ref(null);
|
|
||||||
const chartOption = ref({});
|
|
||||||
const drillPopup = ref(null);
|
|
||||||
const drillList = ref([]);
|
|
||||||
const drillTitle = ref('');
|
|
||||||
|
|
||||||
function detail(record) {
|
|
||||||
// console.log(record)
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/views/renliziyuan/renyuanxinxi/detail?data=' + encodeURIComponent(JSON.stringify(record))
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// 计算年龄initChart
|
|
||||||
const calculateAge = (birthDate) => {
|
|
||||||
const today = new Date();
|
|
||||||
const birth = new Date(birthDate);
|
|
||||||
let age = today.getFullYear() - birth.getFullYear();
|
|
||||||
const monthDiff = today.getMonth() - birth.getMonth();
|
|
||||||
if (monthDiff < 0 || (monthDiff === 0 && today.getDate() < birth.getDate())) {
|
|
||||||
age--;
|
|
||||||
}
|
|
||||||
return age;
|
|
||||||
};
|
|
||||||
// 加载数据
|
|
||||||
const departChange = async (e, data) => {
|
|
||||||
tableData.value = [];
|
|
||||||
console.log(e);
|
|
||||||
orgCode.value = e;
|
|
||||||
try {
|
|
||||||
// 显示加载状态
|
|
||||||
isLoading.value = true;
|
|
||||||
uni.showLoading({
|
|
||||||
title: '数据加载中...',
|
|
||||||
mask: true
|
|
||||||
});
|
|
||||||
|
|
||||||
let params = {
|
|
||||||
orgCode: orgCode.value
|
|
||||||
};
|
|
||||||
if (orgCode.value.length <= 9) {
|
|
||||||
params.orgCode = orgCode.value;
|
|
||||||
} else {
|
|
||||||
params.jcxd_code = orgCode.value;
|
|
||||||
}
|
|
||||||
cxcRyDataTongji(params)
|
|
||||||
.then((res) => {
|
|
||||||
console.log(res);
|
|
||||||
if (res.success) {
|
|
||||||
processData(res.result.records);
|
|
||||||
// 隐藏加载状态
|
|
||||||
isLoading.value = false;
|
|
||||||
uni.hideLoading();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
console.log(err);
|
|
||||||
uni.showToast({
|
|
||||||
title: '数据加载失败',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
});
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error);
|
|
||||||
uni.showToast({
|
|
||||||
title: '数据加载失败',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
} finally {
|
|
||||||
// 隐藏加载状态
|
|
||||||
isLoading.value = false;
|
|
||||||
uni.hideLoading();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 数据处理
|
|
||||||
const processData = (data) => {
|
|
||||||
// 添加年龄字段并过滤有效数据
|
|
||||||
const validData = data
|
|
||||||
.map((item) => ({
|
|
||||||
...item,
|
|
||||||
nl: calculateAge(item.cssj)
|
|
||||||
}))
|
|
||||||
.filter((item) => item.nl >= 21 && item.nl <= 64);
|
|
||||||
// 计算概览数据
|
|
||||||
summary.total = validData.length;
|
|
||||||
summary.avgAge = validData.reduce((sum, cur) => sum + cur.nl, 0) / summary.total || 0;
|
|
||||||
// 生成表格数据
|
|
||||||
// tableData.value = validData;
|
|
||||||
|
|
||||||
groupsData(validData);
|
|
||||||
// 生成图表数据
|
|
||||||
generateChartData(validData);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 计算统计信息...
|
|
||||||
const subOrgStaffs = ref({}); // 按下级单位存储所有人员
|
|
||||||
const ageGroupStaffs = ref({}); // 按年龄段存储所有人员
|
|
||||||
|
|
||||||
const groupsData = (data) => {
|
|
||||||
// 清空旧数据
|
|
||||||
subOrgStaffs.value = {};
|
|
||||||
ageGroupStaffs.value = {};
|
|
||||||
data.reduce((acc, cur) => {
|
|
||||||
// console.log(cur)
|
|
||||||
let subOrg = '';
|
|
||||||
let ageRange = getAgeRange(cur.nl);
|
|
||||||
// console.log(cur.orgCode, cur.jcxdCode)
|
|
||||||
if (cur.orgCode <= 6) {
|
|
||||||
subOrg = cur.orgCode;
|
|
||||||
} else {
|
|
||||||
subOrg = cur.jcxdCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 存储到subOrgStaffs
|
|
||||||
if (!subOrgStaffs.value[subOrg]) {
|
|
||||||
subOrgStaffs.value[subOrg] = [];
|
|
||||||
}
|
|
||||||
subOrgStaffs.value[subOrg].push(cur);
|
|
||||||
|
|
||||||
// 存储到ageGroupStaffs
|
|
||||||
if (!ageGroupStaffs.value[ageRange]) {
|
|
||||||
ageGroupStaffs.value[ageRange] = [];
|
|
||||||
}
|
|
||||||
ageGroupStaffs.value[ageRange].push(cur);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// 新增年龄范围计算方法
|
|
||||||
const getAgeRange = (age) => {
|
|
||||||
const ranges = ['21-30岁', '31-40岁', '41-50岁', '51-60岁', '61-64岁'];
|
|
||||||
const index = Math.floor((age - 21) / 10);
|
|
||||||
return ranges[index] || '其他';
|
|
||||||
};
|
|
||||||
|
|
||||||
// 修改后的显示人员列表方法
|
|
||||||
const showStaffList = (subOrg, ageRange) => {
|
|
||||||
// 从结构化数据中直接获取
|
|
||||||
const targetStaffs = subOrgStaffs.value[subOrg].filter((staff) => getAgeRange(staff.nl) === ageRange);
|
|
||||||
|
|
||||||
staffList.value = targetStaffs;
|
|
||||||
popupTitle.value = `${subOrg} ${ageRange}人员列表(共${targetStaffs.length}人)`;
|
|
||||||
popup.value.open();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 新增获取指定单位人员的方法
|
|
||||||
const getSubOrgStaffs = (subOrgCode) => {
|
|
||||||
return subOrgStaffs.value[subOrgCode] || [];
|
|
||||||
};
|
|
||||||
|
|
||||||
// 新增获取指定年龄段人员的方法
|
|
||||||
const getAgeGroupStaffs = (ageRange) => {
|
|
||||||
return ageGroupStaffs.value[ageRange] || [];
|
|
||||||
};
|
|
||||||
|
|
||||||
// 生成图表数据(修改部分)
|
|
||||||
const generateChartData = (data) => {
|
|
||||||
// 按基层单位分组
|
|
||||||
const ageRanges = ['21-30岁', '31-40岁', '41-50岁', '51-60岁', '61-64岁'];
|
|
||||||
const jcdwGroups = data.reduce((acc, cur) => {
|
|
||||||
if (!acc[cur.jcdw]) {
|
|
||||||
acc[cur.jcdw] = {
|
|
||||||
ageGroups: [0, 0, 0, 0, 0] // 21-30,31-40,41-50,51-60,61-64
|
|
||||||
};
|
|
||||||
}
|
|
||||||
const ageGroup = Math.floor((cur.nl - 21) / 10);
|
|
||||||
// console.log(ageGroup, cur.jcdw)
|
|
||||||
if (ageGroup >= 0 && ageGroup <= 4) {
|
|
||||||
acc[cur.jcdw].ageGroups[ageGroup]++;
|
|
||||||
}
|
|
||||||
return acc;
|
|
||||||
}, {});
|
|
||||||
|
|
||||||
// 生成分组柱状图配置
|
|
||||||
const xData = Object.keys(jcdwGroups);
|
|
||||||
|
|
||||||
const seriesData = ageRanges.map((range, index) => ({
|
|
||||||
name: range,
|
|
||||||
type: 'bar',
|
|
||||||
data: xData.map((jcdw) => jcdwGroups[jcdw].ageGroups[index] || 0),
|
|
||||||
itemStyle: {
|
|
||||||
color: ['#5470C6', '#91CC75', '#FAC858', '#EE6666', '#73C0DE'][index]
|
|
||||||
},
|
|
||||||
// 显示数值标签
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: 'top'
|
|
||||||
}
|
|
||||||
// 设置柱宽为 20 像素
|
|
||||||
// barWidth: 20
|
|
||||||
}));
|
|
||||||
chartOption.value = {
|
|
||||||
title: {
|
|
||||||
text: '人员年龄分组统计',
|
|
||||||
padding: [0, 0, 0, 30]
|
|
||||||
},
|
|
||||||
toolbox: {
|
|
||||||
padding: [0, 30, 0, 0],
|
|
||||||
show: true,
|
|
||||||
feature: {
|
|
||||||
//工具配置项
|
|
||||||
|
|
||||||
restore: {
|
|
||||||
show: true //是否显示该工具
|
|
||||||
},
|
|
||||||
saveAsImage: {
|
|
||||||
show: true //是否显示该工具
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// tooltip: {
|
|
||||||
// trigger: 'axis',
|
|
||||||
// axisPointer: {
|
|
||||||
// type: 'shadow',
|
|
||||||
// label: {
|
|
||||||
// show: false
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
grid: {
|
|
||||||
top: '15%',
|
|
||||||
left: '4%',
|
|
||||||
right: '4%',
|
|
||||||
bottom: '10%',
|
|
||||||
containLabel: true
|
|
||||||
},
|
|
||||||
legend: {
|
|
||||||
data: ageRanges,
|
|
||||||
itemGap: 5,
|
|
||||||
padding: [0, 15, 0, 15],
|
|
||||||
y: 'bottom',
|
|
||||||
itemHeight: 8, //高
|
|
||||||
itemWidth: 8, //宽
|
|
||||||
type: 'scroll'
|
|
||||||
},
|
|
||||||
xAxis: {
|
|
||||||
type: 'category',
|
|
||||||
data: xData,
|
|
||||||
axisLabel: {
|
|
||||||
color: '#7F84B5',
|
|
||||||
fontWeight: 300,
|
|
||||||
interval: 0,
|
|
||||||
rotate: 0
|
|
||||||
},
|
|
||||||
padding: [0, 10, 0, 10],
|
|
||||||
axisTick: {
|
|
||||||
show: false //刻度线
|
|
||||||
},
|
|
||||||
axisLine: {
|
|
||||||
show: false //不显示坐标轴线
|
|
||||||
}
|
|
||||||
},
|
|
||||||
yAxis: [
|
|
||||||
{
|
|
||||||
show: true,
|
|
||||||
boundaryGap: false, //解决数据与线不对应问题
|
|
||||||
type: 'value',
|
|
||||||
// name: 'Budget (million USD)',
|
|
||||||
// data: this.yList,
|
|
||||||
minInterval: 1,
|
|
||||||
axisLabel: {
|
|
||||||
interval: 0
|
|
||||||
},
|
|
||||||
splitLine: {
|
|
||||||
show: true,
|
|
||||||
lineStyle: {
|
|
||||||
//背景网格线
|
|
||||||
type: 'dashed'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
axisTick: {
|
|
||||||
show: true //刻度线
|
|
||||||
},
|
|
||||||
axisLine: {
|
|
||||||
show: false //不显示坐标轴线
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
|
|
||||||
series: seriesData
|
|
||||||
};
|
|
||||||
|
|
||||||
// 初始化图表
|
|
||||||
setTimeout(async () => {
|
|
||||||
if (!chart.value) return;
|
|
||||||
const myChart = await chart.value.init(echarts);
|
|
||||||
myChart.setOption(chartOption.value);
|
|
||||||
myChart.on('click', (params) => {
|
|
||||||
console.log(params.seriesName);
|
|
||||||
tableData.value = getAgeGroupStaffs(params.seriesName);
|
|
||||||
});
|
|
||||||
}, 300);
|
|
||||||
|
|
||||||
// #ifdef APP
|
|
||||||
getHeight();
|
|
||||||
// #endif
|
|
||||||
};
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
// #ifdef APP
|
|
||||||
getHeight();
|
|
||||||
// #endif
|
|
||||||
});
|
|
||||||
// #ifdef APP
|
|
||||||
|
|
||||||
const getHeight = () => {
|
|
||||||
// 获取屏幕高度
|
|
||||||
const systemInfo = uni.getSystemInfoSync();
|
|
||||||
const screenHeight = systemInfo.screenHeight;
|
|
||||||
// 创建选择器查询对象
|
|
||||||
const query = uni.createSelectorQuery();
|
|
||||||
// 获取上方组件的高度
|
|
||||||
query
|
|
||||||
.select('#top1')
|
|
||||||
.boundingClientRect((rect1) => {
|
|
||||||
// 计算上方组件高度总和
|
|
||||||
const topComponentsHeight = rect1.height;
|
|
||||||
// 计算下方组件的高度
|
|
||||||
bottomHeight.value = screenHeight - topComponentsHeight - 415;
|
|
||||||
})
|
|
||||||
.exec();
|
|
||||||
};
|
|
||||||
|
|
||||||
// #endif
|
|
||||||
// 初始化图表
|
|
||||||
const initChart = () => {
|
|
||||||
setTimeout(async () => {
|
|
||||||
if (!chart.value) return;
|
|
||||||
const myChart = await chart.value.init(echarts);
|
|
||||||
myChart.setOption(chartOption.value);
|
|
||||||
}, 300);
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.container {
|
|
||||||
margin: 20, 20, 20, 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.input-group {
|
|
||||||
display: flex;
|
|
||||||
gap: 20rpx;
|
|
||||||
margin-bottom: 30rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.input {
|
|
||||||
flex: 1;
|
|
||||||
border: 1rpx solid #ddd;
|
|
||||||
padding: 15rpx;
|
|
||||||
border-radius: 8rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.query-btn {
|
|
||||||
background: #007aff;
|
|
||||||
color: white;
|
|
||||||
padding: 0 40rpx;
|
|
||||||
border-radius: 8rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.stats-box {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-around;
|
|
||||||
margin: 30rpx 0;
|
|
||||||
padding: 20rpx;
|
|
||||||
background: #f8f8f8;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.stat-item {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.label {
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #666;
|
|
||||||
}
|
|
||||||
|
|
||||||
.value {
|
|
||||||
font-size: 36rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #0000ff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chart-container {
|
|
||||||
height: 400rpx;
|
|
||||||
margin-top: 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.titleStyle {
|
|
||||||
font-size: 12px;
|
|
||||||
color: #747474;
|
|
||||||
line-height: 30px;
|
|
||||||
height: 30px;
|
|
||||||
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: 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;
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -37,12 +37,6 @@ export const useUpdateApp = defineStore('updateApp', () => {
|
|||||||
} = res
|
} = res
|
||||||
result.apkUrl = baseUrl + result.apkUrl;
|
result.apkUrl = baseUrl + result.apkUrl;
|
||||||
result.wgtUrl = baseUrl + result.wgtUrl
|
result.wgtUrl = baseUrl + result.wgtUrl
|
||||||
// res = {
|
|
||||||
// "update": "wgt",
|
|
||||||
// "wgtUrl": "D:\\opt\\AppUpdate\\wgt\\2.2.34.wgt",
|
|
||||||
// "apkUrl": null,
|
|
||||||
// "versionCode": "1.0.0"
|
|
||||||
// }
|
|
||||||
// updateOptions.force = res.is_force === 1
|
// updateOptions.force = res.is_force === 1
|
||||||
// updateOptions.content = res.update_content
|
// updateOptions.content = res.update_content
|
||||||
updateOptions.wgtUrl = result.wgtUrl
|
updateOptions.wgtUrl = result.wgtUrl
|
||||||
|
Loading…
Reference in New Issue
Block a user