Merge remote-tracking branch 'remotes/origin/master' into yzqUniapp

# Conflicts:
#	pages.json
This commit is contained in:
yangzhq68909 2025-02-24 15:28:56 +08:00
commit 6116c47a34
76 changed files with 6797 additions and 1527 deletions

View File

@ -1,3 +1,4 @@
# 开发环境
# 请求接口地址
VITE_REQUEST_BASE_URL = https://36.112.48.190
#VITE_REQUEST_BASE_URL = http://10.75.15.247:8080

View File

@ -1,3 +1,4 @@
# 生产环境
# 请求接口地址
VITE_REQUEST_BASE_URL = https://36.112.48.190
#VITE_REQUEST_BASE_URL = http://10.75.15.247:8080

12
.gitignore vendored
View File

@ -32,7 +32,7 @@
/unpackage/cache/wgt/__UNI__9F097F0/pages/useredit/addressbook.css
/unpackage/cache/wgt/__UNI__9F097F0/pages/useredit/useredit.css
/unpackage/cache/wgt/__UNI__9F097F0/pages/userlist/index.css
/unpackage/cache/wgt/__UNI__9F097F0/pages/zhiban/index.css
/unpackage/cache/wgt/__UNI__9F097F0/pages/views/zhongheguanli/zhiban/index.css
/unpackage/dist/build/app-plus/__uniappautomator.js
/unpackage/dist/build/app-plus/__uniappchooselocation.js
/unpackage/dist/build/app-plus/app-config-service.js
@ -53,5 +53,13 @@
/unpackage/dist/dev/app-plus/app.css
/unpackage/dist/dev/app-plus/manifest.json
/unpackage/dist/dev/app-plus/uni-app-view.umd.js
/node_modules/.vite/deps/_metadata.json
/node_modules/.vite/deps/base-64.js
/node_modules/.vite/deps/base-64.js.map
/node_modules/.vite/deps/chunk-RSJERJUL.js
/node_modules/.vite/deps/chunk-RSJERJUL.js.map
/node_modules/.vite/deps/dayjs.js
/node_modules/.vite/deps/dayjs.js.map
/node_modules/.vite/deps/package.json
/uni_modules
/node_modules
/unpackage

16
api/common.js Normal file
View File

@ -0,0 +1,16 @@
import {
https
} from '@/utils/http.js';
/*
这是后端系统通用的系统类的基础性的api路径后续的大家分类建js存放
*/
export function initDictOption(dictCode) { // 获取部门所有人员信息
return https({
url: ' /sys/dict/getDictItems',
method: 'get',
data: dictCode
})
}

View File

@ -80,4 +80,28 @@ export function cxcRyDataTongji(url, parm) { // 员工信息统计
method: 'get',
data: parm
})
}
export function cxcRyDatAstatistics(parm) { // 员工分组统计
return https({
url: '/cxc_rlzy.zb/cxcRlzyZb/statistics',
method: 'get',
data: 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',
method: 'get',
data: parm
})
}

95
package-lock.json generated
View File

@ -1,95 +0,0 @@
{
"name": "cxc-szcx-uniapp",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"dependencies": {
"@dcloudio/uni-ui": "^1.5.6",
"base-64": "^1.0.0",
"dayjs": "^1.11.13",
"echarts": "^5.6.0"
}
},
"node_modules/@dcloudio/uni-ui": {
"version": "1.5.6",
"resolved": "https://registry.npmjs.org/@dcloudio/uni-ui/-/uni-ui-1.5.6.tgz",
"integrity": "sha512-jmb98PasFvZkrIDXGh94GbdWg2/jyhgs1HUG+bU8eyL7Ltias/5XBz4q8w9RXyWUfqepJRqapPA2IIQpLCuTIg==",
"license": "Apache-2.0"
},
"node_modules/base-64": {
"version": "1.0.0",
"resolved": "https://registry.npmmirror.com/base-64/-/base-64-1.0.0.tgz",
"integrity": "sha512-kwDPIFCGx0NZHog36dj+tHiwP4QMzsZ3AgMViUBKI0+V5n4U0ufTCUMhnQ04diaRI8EX/QcPfql7zlhZ7j4zgg=="
},
"node_modules/dayjs": {
"version": "1.11.13",
"resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.13.tgz",
"integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg=="
},
"node_modules/echarts": {
"version": "5.6.0",
"resolved": "https://registry.npmmirror.com/echarts/-/echarts-5.6.0.tgz",
"integrity": "sha512-oTbVTsXfKuEhxftHqL5xprgLoc0k7uScAwtryCgWF6hPYFLRwOUHiFmHGCBKP5NPFNkDVopOieyUqYGH8Fa3kA==",
"license": "Apache-2.0",
"dependencies": {
"tslib": "2.3.0",
"zrender": "5.6.1"
}
},
"node_modules/tslib": {
"version": "2.3.0",
"resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.3.0.tgz",
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==",
"license": "0BSD"
},
"node_modules/zrender": {
"version": "5.6.1",
"resolved": "https://registry.npmmirror.com/zrender/-/zrender-5.6.1.tgz",
"integrity": "sha512-OFXkDJKcrlx5su2XbzJvj/34Q3m6PvyCZkVPHGYpcCJ52ek4U/ymZyfuV1nKE23AyBJ51E/6Yr0mhZ7xGTO4ag==",
"license": "BSD-3-Clause",
"dependencies": {
"tslib": "2.3.0"
}
}
},
"dependencies": {
"@dcloudio/uni-ui": {
"version": "1.5.6",
"resolved": "https://registry.npmjs.org/@dcloudio/uni-ui/-/uni-ui-1.5.6.tgz",
"integrity": "sha512-jmb98PasFvZkrIDXGh94GbdWg2/jyhgs1HUG+bU8eyL7Ltias/5XBz4q8w9RXyWUfqepJRqapPA2IIQpLCuTIg=="
},
"base-64": {
"version": "1.0.0",
"resolved": "https://registry.npmmirror.com/base-64/-/base-64-1.0.0.tgz",
"integrity": "sha512-kwDPIFCGx0NZHog36dj+tHiwP4QMzsZ3AgMViUBKI0+V5n4U0ufTCUMhnQ04diaRI8EX/QcPfql7zlhZ7j4zgg=="
},
"dayjs": {
"version": "1.11.13",
"resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.13.tgz",
"integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg=="
},
"echarts": {
"version": "5.6.0",
"resolved": "https://registry.npmmirror.com/echarts/-/echarts-5.6.0.tgz",
"integrity": "sha512-oTbVTsXfKuEhxftHqL5xprgLoc0k7uScAwtryCgWF6hPYFLRwOUHiFmHGCBKP5NPFNkDVopOieyUqYGH8Fa3kA==",
"requires": {
"tslib": "2.3.0",
"zrender": "5.6.1"
}
},
"tslib": {
"version": "2.3.0",
"resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.3.0.tgz",
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
},
"zrender": {
"version": "5.6.1",
"resolved": "https://registry.npmmirror.com/zrender/-/zrender-5.6.1.tgz",
"integrity": "sha512-OFXkDJKcrlx5su2XbzJvj/34Q3m6PvyCZkVPHGYpcCJ52ek4U/ymZyfuV1nKE23AyBJ51E/6Yr0mhZ7xGTO4ag==",
"requires": {
"tslib": "2.3.0"
}
}
}
}

View File

@ -233,6 +233,13 @@
"navigationBarTitleText": "人员年龄分组统计信息",
"navigationBarTextStyle": "white"
}
{
"path": "pages/views/renliziyuan/renyuanxinxi/qttongji",
"style": {
"navigationBarTitleText": "其他统计信息",
"navigationBarTextStyle": "white"
}
},
{
@ -242,6 +249,25 @@
"navigationBarTextStyle": "white"
}
}<<<<<<< .mine
},
{
"path": "pages/views/renliziyuan/qingjiaxinxi/index",
"style": {
"navigationBarTitleText": "请假信息",
"navigationBarTextStyle": "white"
}
=======
},
{
"path": "pages/views/renliziyuan/renyuanxinxi/qttongji",
"style": {
"navigationBarTitleText": "其他统计信息",
"navigationBarTextStyle": "white"
}
>>>>>>> .theirs
}
],
"tabBar": {

View File

@ -98,17 +98,17 @@
});
/*生产环境 begin */
// loginApi({
// username: un,
// password: pw,
// ip: getDeviceIp()
/*生产环境 end */
loginApi({
username: un,
password: pw,
ip: getDeviceIp()
/*生产环境 end */
/*开发环境 begin */
localLoginApi({
username: username.value,
password: password.value,
captcha: 'app'
/*开发环境 begin */
// localLoginApi({
// username: username.value,
// password: password.value,
// captcha: 'app'
/*开发环境 end */
}).then((loginres) => {
if (loginres.success) {

View File

@ -1,212 +0,0 @@
<template>
<view :class="['content',{'gray':store.isgray==1}]">
<view class="list_box">
<view class="list">
<view class="title f-row aic jcb">
<view class="">
年度部门讨论会议
</view>
<text>1分钟前</text>
</view>
<view class="info">
<view class="f-row aic jcb">
<view class="">
会议状态
</view>
<text>待开始/已开始/已结束</text>
</view>
<view class="f-row aic jcb">
<view class="">
发起人
</view>
<text>周如意</text>
</view>
<view class="f-row aic jcb">
<view class="">
会议日期
</view>
<text>周如意</text>
</view>
<view class="f-row aic jcb">
<view class="">
会议地点
</view>
<text>周如意</text>
</view>
<view class="f-row aic jcb">
<view class="">
会议内容
</view>
<text>周如意</text>
</view>
<view class="">
<view class="">
参与人员
</view>
<view class="person f-row aic">
<view class="item f-col aic" v-for="item,i in 7" :key="i">
<image src="" mode=""></image>
<view class="name">
周如意
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="btn f-row aic jcb">
<view class="refuse">
拒绝
</view>
<view class="agree" @click="openpop">
同意
</view>
</view>
</view>
</template>
<script setup>
import {
ref
} from 'vue';
import {
huiyiDetailApi
} from '@/api/api.js';
import {
onLoad
} from '@dcloudio/uni-app';
import {
useStore
} from '@/store'
const store = useStore()
onLoad(() => {
huiyiDetail()
})
const huiyiDetail = () => {
huiyiDetailApi({
mainid:1
}).then((res) => {
if (res.success) {
}
}).catch((err) => {
console.log(err);
})
}
</script>
<style lang="scss" scoped>
.content{
padding-bottom: 120rpx;
}
.btn {
position: fixed;
bottom: 0;
width: 690rpx;
height: 120rpx;
background: #FFFFFF;
padding: 0 30rpx;
border-top: 1px solid #EFEFEF;
view {
width: 330rpx;
height: 88rpx;
font-size: 28rpx;
border-radius: 16rpx;
text-align: center;
line-height: 88rpx;
}
.refuse {
box-sizing: border-box;
background: #FFFFFF;
border: 2rpx solid #01508B;
color: #01508B;
}
.agree {
background: #01508B;
color: #FFFFFF;
}
}
.list_box {
.list {
padding: 30rpx;
margin-bottom: 30rpx;
.title {
border-bottom: 1px solid #efefef;
padding-bottom: 24rpx;
margin-bottom: 8rpx;
view {
font-size: 28rpx;
color: #333333;
}
text {
font-size: 28rpx;
color: #999999;
}
}
.info {
font-size: 28rpx;
color: #666666;
view {
padding-top: 16rpx;
font-size: 28rpx;
color: #666666;
}
text{
font-size: 28rpx;
color: #333333;
}
.person{
flex-wrap: wrap;
.item{
width: 16.66%;
}
image{
width: 78rpx;
height: 78rpx;
border-radius: 38rpx;
background-color: #01508B;
}
}
}
.btn {
margin-top: 30rpx;
view {
width: 300rpx;
height: 64rpx;
border-radius: 8rpx;
font-size: 28rpx;
text-align: center;
line-height: 64rpx;
}
.entrust {
background: #FFFFFF;
border: 2rpx solid #01508B;
box-sizing: border-box;
color: #01508B;
}
.handle {
background: #01508B;
color: #FFFFFF;
}
}
}
}
</style>

View File

@ -1,247 +0,0 @@
<template>
<view :class="{'gray':store.isgray==1}">
<customNav>
<view class="nav_box f-row aic jcb">
<view class="back f-row aic" @click="back">
<uni-icons type="left" size="20" color="#fff"></uni-icons>
</view>
<view class="search f-row aic">
<input type="text" v-model="searchKey" @confirm="search" @blur="showicon=true&&!searchKey"
@focus="showicon=false" />
<view class="f-row aic" v-if="showicon">
<image src="../../static/search.png" mode=""></image>
<text>搜索</text>
</view>
</view>
</view>
</customNav>
<view class="list_box">
<view class="list" v-for="item,i in 3" :key="i" @click="jump(`/pages/meeting/detail?id=1`)">
<view class="title f-row aic jcb">
<view class="">
年度部门讨论会议
</view>
<text>1分钟前</text>
</view>
<view class="info">
<view class="f-row aic jcb">
<view class="">
发起人
</view>
<text>周如意</text>
</view>
<view class="f-row aic jcb">
<view class="">
会议日期
</view>
<text>周如意</text>
</view>
<view class="f-row aic jcb">
<view class="">
会议地点
</view>
<text>周如意</text>
</view>
<view class="f-row aic jcb">
<view class="">
会议内容
</view>
<text>周如意</text>
</view>
</view>
<!-- <view class="btn f-row aic jcb">
<view class="entrust">
拒绝
</view>
<view class="handle">
同意
</view>
</view> -->
<view class="handled f-row">
<view class="refused">
已拒绝
</view>
<!-- <view class="agreed">
已同意
</view> -->
</view>
</view>
</view>
</view>
</template>
<script setup>
import {
ref
} from 'vue';
import {
useStore
} from '@/store'
const store = useStore()
import {
huiyilistApi
} from '@/api/api.js';
import customNav from '../../bpm/customNav.vue';
import {
onLoad
} from '@dcloudio/uni-app';
import {
beforeJump
} from '@/utils/index.js';
const showicon = ref(true)
const searchKey = ref('')
onLoad(() => {
// huiyilist()
})
const huiyilist = () => {
huiyilistApi().then((res) => {
if (res.success) {
}
}).catch((err) => {
console.log(err);
})
}
const jump = (url) => {
beforeJump(url, () => {
uni.navigateTo({
url
})
})
}
const back = () => {
uni.navigateBack()
}
</script>
<style lang="scss" scoped>
.nav_box {
position: absolute;
bottom: 14rpx;
width: 100%;
left: 0;
}
.back {
padding: 0 30rpx;
}
.search {
position: relative;
padding-right: 30rpx;
flex: 1;
view {
position: absolute;
left: 28rpx;
top: 50%;
transform: translateY(-50%);
font-size: 28rpx;
color: #999999;
}
input {
flex: 1;
height: 72rpx;
background: #F8F8F8;
border-radius: 44rpx;
padding: 0 28rpx;
}
image {
width: 34rpx;
height: 34rpx;
margin-right: 16rpx;
}
}
.list_box {
padding: 14rpx 30rpx 0 30rpx;
margin-top: 24rpx;
.list {
background: #FFFFFF;
box-shadow: 0rpx 2rpx 4rpx 0rpx rgba(0, 0, 0, 0.5);
border-radius: 16rpx;
padding: 30rpx;
margin-bottom: 30rpx;
.title {
border-bottom: 1px solid #efefef;
padding-bottom: 24rpx;
margin-bottom: 8rpx;
view {
font-size: 28rpx;
color: #333333;
}
text {
font-size: 28rpx;
color: #999999;
}
}
.info {
font-size: 28rpx;
color: #666666;
view {
padding-top: 16rpx;
}
}
.btn {
margin-top: 30rpx;
view {
width: 300rpx;
height: 64rpx;
border-radius: 8rpx;
font-size: 28rpx;
text-align: center;
line-height: 64rpx;
}
.entrust {
background: #FFFFFF;
border: 2rpx solid #01508B;
box-sizing: border-box;
color: #01508B;
}
.handle {
background: #01508B;
color: #FFFFFF;
}
}
}
}
.refused {
color: #333333;
}
.agreed {
color: #01508B;
}
.handled {
justify-content: flex-end;
margin-top: 30rpx;
view {
width: 150rpx;
height: 64rpx;
background: #EFEFEF;
border-radius: 8rpx;
text-align: center;
line-height: 64rpx;
font-size: 28rpx;
}
}
</style>

File diff suppressed because it is too large Load Diff

View File

@ -8,28 +8,35 @@
</uni-section>
<uni-section title="统计信息" type="line">
<uni-card :is-shadow="false">
<button type="primary" @click="toTongji">分类统计</button>
<button type="primary" @click="toTongji">年龄段统计</button>
</uni-card>
<uni-card :is-shadow="false">
<button type="primary" @click="toQtTongji">通用字段统计</button>
</uni-card>
</uni-section>
</uni-card>
</view>
</template>
<script setup>
function toTaizhang() {
uni.navigateTo({
url: "/pages/views/renliziyuan/renyuanxinxi/taizhang"
})
url: '/pages/views/renliziyuan/renyuanxinxi/taizhang'
});
}
function toTongji() {
uni.navigateTo({
url: "/pages/views/renliziyuan/renyuanxinxi/tongji"
})
url: '/pages/views/renliziyuan/renyuanxinxi/tongji'
});
}
function toQtTongji() {
uni.navigateTo({
url: '/pages/views/renliziyuan/renyuanxinxi/qttongji'
});
}
</script>
<style>
</style>
<style></style>

View File

@ -0,0 +1,985 @@
<template>
<view>
<view class="container" id="top1">
<uni-row style="margin-bottom: 10px">
<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>
</uni-col>
</uni-row>
<uni-row style="margin-bottom: 10px">
<uni-col :span="5"><uni-title :title="'选择字段'" align="left" type="h4"></uni-title></uni-col>
<uni-col :span="12">
<uni-data-select v-model="selectedField" :localdata="fieldList"
@change="onFieldChange"></uni-data-select>
</uni-col>
<uni-col style="margin-left:5px" :span="6" v-if="selectedField==='zjmc'"><button type="primary"
size="mini" @click="showPopup=!showPopup">筛选</button></uni-col>
</uni-row>
</view>
<!-- ECharts图表 -->
<view class="chart-container">
<l-echart ref="chart" @finished="initChart" />
</view>
<!-- 翻页按钮 -->
<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>
</view>
<!-- 数据表格 -->
<uni-row style="margin-top: 10px; margin-left: 20px; margin-right: 20px" v-if="personnelList.length > 0">
<uni-col :span="2">
<view class="titleStyle">序号</view>
</uni-col>
<uni-col :span="4">
<view class="titleStyle">姓名</view>
</uni-col>
<uni-col :span="5">
<view class="titleStyle">基层单位</view>
</uni-col>
<uni-col :span="5" v-if="selectedField.value !== 'zjmc'">
<view class="titleStyle">基层班组</view>
</uni-col>
<uni-col :span="5" v-else>
<view class="titleStyle">岗位</view>
</uni-col>
<uni-col :span="4">
<view class="titleStyle">年龄</view>
</uni-col>
<uni-col :span="4">
<view class="titleStyle">操作</view>
</uni-col>
</uni-row>
<scroll-view scroll-y :style="{ height: bottomHeight + 'px' }">
<uni-row style="margin-bottom: 10px; margin-left: 20px; margin-right: 20px; font-size: 12px">
<view v-for="(item, index) in personnelList">
<uni-col :span="2">
<view class="dataStyle">
{{ index + 1 }}
</view>
</uni-col>
<uni-col :span="4">
<view class="dataStyle">
{{ item.xm }}
</view>
</uni-col>
<uni-col :span="5">
<view class="dataStyle1">
{{ item.jcdw }}
</view>
</uni-col>
<uni-col :span="5" v-if="selectedField.value != 'zjmc'">
<view class="dataStyle1">
{{ item.jcxd }}
</view>
</uni-col>
<uni-col :span="4" v-else>
<view class="dataStyle">
{{ item.sdgw }}
</view>
</uni-col>
<uni-col :span="4">
<view class="dataStyle">
{{ item.nl }}
</view>
</uni-col>
<uni-col :span="4">
<view class="dataStyle">
<span @click="detail(item)" style="color: red;">详情</span>
<!-- <button size="mini" type="primary" @click="detail(item)">详情</button> -->
</view>
</uni-col>
</view>
</uni-row>
</scroll-view>
<uni-popup ref="showPopup" type="bottom" border-radius="10px 10px 0 0">
<uni-card>
<uni-title :title="'已选证书:'" align="left" type="h4"></uni-title>
<view style="color: red;font-weight: 300;margin-bottom: 10px;">{{dictData}}</view>
<scroll-view scroll-y style="height: 40vh;">
<view>
<cxc-szcx-dictSelect :dictCode="dictCode" @change="dictChange"></cxc-szcx-dictSelect>
</view>
</scroll-view>
</uni-card>
</uni-popup>
</view>
</template>
<script setup>
import {
ref,
reactive,
onMounted,
computed
} from 'vue';
import * as echarts from 'echarts/dist/echarts.min'; // EChartsH5
import {
cxcRyDatAstatistics,
cxcRyDatAstatisticsCertificate,
cxcRyDatAstatisticsDetails
} from '@/api/renyuan.js';
// 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,
dictCode: 'sex'
},
{
text: '政治面貌',
value: 'zzmm',
isDict: true,
dictCode: 'zzmm'
},
{
text: '民族',
value: 'mz',
isDict: true,
dictCode: 'mz'
}
]); //
const dictCode = ref('');
const dictData = ref('');
const showPopup = ref(null);
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 orgType = ref(''); // by
const chartTitle = computed(() => {
return selectedOrgCodeLabel.value + '人员(' + selectedFieldLabel.value + ')分组统计';
});
//
const pageSize = ref(3); //
const currentPage = ref(1); //
function detail(record) {
// console.log(record)
uni.navigateTo({
url: '/pages/views/renliziyuan/renyuanxinxi/detail?data=' + encodeURIComponent(JSON.stringify(record))
});
}
onMounted(() => {
getHeight();
});
const dictChange = (e) => {
console.log(e)
dictData.value = e
fetchStatisticsData()
}
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();
};
// 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 = () => {
if (currentPage.value > 1) {
currentPage.value--;
}
updateChart(chartData.value);
};
const nextPage = () => {
if (currentPage.value * pageSize.value < chartDataCount.value) {
currentPage.value++;
//
const startIndex = (currentPage.value - 1) * pageSize.value;
const endIndex = startIndex + pageSize.value;
updateChart(chartData.value);
// const tempChartData = temp.slice(startIndex, endIndex);
}
};
// option
const getChartOption = (ChartData) => {
// let temp = JSON.parse(JSON.stringify(tempchartData[0].children));
// chartDataCount.value = temp.length;
//
const startIndex = (currentPage.value - 1) * pageSize.value;
const endIndex = startIndex + pageSize.value;
//
const tempChartData = ChartData.slice(startIndex, endIndex);
try {
let xData = [];
let seriesData = [];
console.log(1, tempChartData);
// transformDataForEcharts
let legendData = [];
for (let i = 0; i < fieldValues.value.length; i++) {
legendData.push(fieldValues.value[i].fieldText);
}
tempChartData.forEach((item) => {
xData.push(item.name);
});
for (let i = 0; i < fieldValues.value.length; i++) {
let tempData = [];
tempChartData.forEach((item) => {
// console.log(item);
if (item.data[i]) {
tempData.push(item.data[i]);
} else {
tempData.push(0);
}
});
seriesData.push({
name: fieldValues.value[i].fieldText,
type: 'bar',
label: {
show: true, //
position: 'top' //
},
data: tempData
});
}
console.log(2, legendData, xData, seriesData);
let tempOption = {
title: {
text: chartTitle.value,
padding: [0, 0, 0, 30]
},
toolbox: {
padding: [0, 30, 0, 0],
show: true,
feature: {
//
restore: {
show: true //
},
saveAsImage: {
show: true //
}
}
},
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,
legend: {
data: legendData,
itemGap: 1,
padding: [0, 0, 0, 0],
y: 'bottom',
itemHeight: 8, //
itemWidth: 18, //
type: 'scroll'
}
};
return tempOption;
} catch (error) {
console.log(error);
}
};
//
const updateChart = (tempchartData) => {
//
setTimeout(async () => {
if (!chart.value) return;
const myChart = await chart.value.init(echarts);
console.log(tempchartData);
let tempOption = getChartOption(tempchartData);
myChart.setOption(tempOption);
//
myChart.on('click', (params) => {
console.log(params.name, params.seriesIndex, params.dataIndex);
console.log(orgCodeGroupData.value);
let updateData = findRyByOrgCode(orgCodeGroupData.value.children, params.name);
console.log(updateData);
const ldhth = updateData.fieldValues[params.seriesIndex].ldhth;
console.log(ldhth);
if (ldhth && ldhth.length > 0) {
fetchPersonnelList(ldhth);
}
// updateChart(updateData);
});
}, 300);
};
//
//
function findRyByOrgCode(treeData, targetOrgCode) {
// console.log(treeData, targetOrgCode);
for (const node of treeData) {
//
if (node.orgText === targetOrgCode) {
return node;
}
//
if (node.children && node.children.length > 0) {
const found = findNodeByOrgCode(node.children, targetOrgCode);
if (found) return found;
}
}
return null;
}
/**
* 从echart图标的树状数据中根据 orgCode 获取节点及其子节点数据
* @param {Array} treeData 树状数据
* @param {string} targetOrgCode 目标 orgCode
* @returns {Object|null} 匹配的节点及其子节点数据未找到返回 null
*/
function findNodeByOrgCode(treeData, targetOrgCode) {
// console.log(treeData, targetOrgCode);
for (const node of treeData) {
//
if (node.name === targetOrgCode) {
return node;
}
//
if (node.children && node.children.length > 0) {
const found = findNodeByOrgCode(node.children, targetOrgCode);
if (found) return found;
}
}
return null;
}
//fieldValue
function collectUniqueKeyFieldValues(tree) {
const uniqueMap = new Map();
tree.forEach((item) => {
const {
fieldValue,
fieldText
} = item;
const key = `${fieldValue}-${fieldText}`;
if (!uniqueMap.has(key)) {
uniqueMap.set(key, {
fieldValue,
fieldText
});
}
});
const result = Array.from(uniqueMap.values());
return result;
}
//
class OrgCodeMapper {
constructor(data) {
//
this.orgCodeToOrgTextMap = {};
//
for (let i = 0; i < data.length; i++) {
const item = data[i];
// orgCode orgText
this.orgCodeToOrgTextMap[item.orgCode] = item.orgText;
}
}
// orgCode orgText
findOrgText(orgCode) {
return this.orgCodeToOrgTextMap[orgCode];
}
}
//
// const result = findNodeByOrgCode(echartData, "A01A01A01A01");
// console.log(result);
/**
* 转换数据为支持钻取的ECharts格式
* @param {Array} data 原始数据
* @param {string} selectOrgCode 当前选择的组织编码
* @returns {Object} 包含当前层级数据和子节点信息的对象 符合echart的格式
*/
//-----------------------------------------------------------------------------------------
function transformData(selectOrgCode, data) {
const nodes = new Map();
//fieldValue data[] fieldValue
fieldValues.value = collectUniqueKeyFieldValues(data);
// console.log(fieldValues.value);
const orgMapper = new OrgCodeMapper(data); //orgtext
// console.log(orgMapper.findOrgText('A01A01A01A01'));
// orgCode
function getHierarchy(orgCode) {
const hierarchy = [];
for (let i = selectOrgCode.length; i <= orgCode.length; i += 3) {
hierarchy.push(orgCode.substring(0, i));
}
// console.log('hierarchy', hierarchy);
return hierarchy;
}
// orgCode
function getParentCode(code) {
if (code.length <= 3) return null;
return code.substring(0, code.length - 3);
}
// series
let tempArrayValue = new Array(fieldValues.value.length).fill(0);
//
data.forEach((entry) => {
const hierarchy = getHierarchy(entry.orgCode);
// console.log(entry);
hierarchy.forEach((code) => {
// console.log(code);
let tempOrgText = orgMapper.findOrgText(code) === undefined ? '' : orgMapper.findOrgText(
code);
// console.log(tempOrgText);
if (!nodes.has(code)) {
nodes.set(code, {
orgCode: code,
name: tempOrgText,
type: 'bar',
data: JSON.parse(JSON.stringify(tempArrayValue)), // data[0, 0]
children: []
});
}
});
// console.log(nodes);
// console.log('fieldValues', fieldValues.value, fieldValues.value.length, hierarchy);
// data
const node = nodes.get(entry.orgCode);
const fieldValue = entry.fieldValue;
for (let i = 0; i < fieldValues.value.length; i++) {
if (fieldValue === fieldValues.value[i].fieldValue) {
// console.log(555, i, fieldValue, fieldValues.value[i], entry.number);
node.data[i] += entry.number;
}
}
// console.log(11, node);
//
for (let i = 0; i < hierarchy.length - 1; i++) {
const parentCode = hierarchy[i];
const childCode = hierarchy[i + 1];
const parentNode = nodes.get(parentCode);
const childNode = nodes.get(childCode);
if (!parentNode.children.some((c) => c.orgCode === childCode)) {
parentNode.children.push(childNode);
}
}
});
// data
function computeData(node) {
if (node.children.length === 0) return;
node.data = JSON.parse(JSON.stringify(tempArrayValue));
node.children.forEach((child) => {
computeData(child);
for (let i = 0; i < fieldValues.value.length; i++) {
// console.log(666, i, node.data[i], child.data[i]);
node.data[i] += child.data[i];
}
});
}
//
const rootNodes = [];
nodes.forEach((node, code) => {
const parentCode = getParentCode(code);
// console.log(parentCode);
if (!parentCode || !nodes.has(parentCode)) {
rootNodes.push(node);
}
});
// data
rootNodes.forEach((root) => computeData(root));
console.log(rootNodes)
return rootNodes;
// console.log('rootNodes', rootNodes);
// //
// function formatTree(node) {
// // console.log(node);
// return {
// orgCode: node.orgCode,
// name: node.name,
// type: 'bar',
// data: node.data,
// children: node.children.map((child) => formatTree(child))
// };
// }
// return rootNodes.map((root) => {
// console.log(root);
// formatTree(root);
// });
}
//-----------------------------------------------------------------------------------------
// orgCode children deepseek
const groupByOrgCode = (orgCode, data) => {
//
console.log("aaaa")
const filteredData = data.filter((item) => item.orgCode.startsWith(orgCode));
const orgMapper = new OrgCodeMapper(data);
// null
if (filteredData.length === 0) {
uni.showToast({
title: '过滤后数据为空',
duration: 1000
});
return null;
}
// console.log(0, filteredData);
// fieldValue
const groupedByFieldValue = {};
try {
filteredData.forEach((item) => {
// console.log(item);
if (!groupedByFieldValue[item.fieldValue]) {
groupedByFieldValue[item.fieldValue] = {
orgCode: item.orgCode,
orgText: item.orgText,
fieldText: item.fieldText,
number: 0,
ldhth: []
};
}
// console.log(item.orgCode, 22, groupedByFieldValue[item.fieldValue]);
groupedByFieldValue[item.fieldValue].number += item.number;
groupedByFieldValue[item.fieldValue].ldhth.push(...item.ldhth.split(','));
});
} catch (error) {
console.log(error);
}
// console.log(1, orgMapper.findOrgText(orgCode));
//
console.log("aaaa")
const result = {
orgCode: orgCode,
orgText: orgMapper.findOrgText(orgCode),
fieldValues: Object.keys(groupedByFieldValue).map((fieldValue) => {
const {
fieldText,
orgCode,
orgText
} = groupedByFieldValue[fieldValue] || {};
return {
fieldValue: fieldValue,
fieldText: fieldText,
orgCode: orgCode,
orgText: orgText,
number: groupedByFieldValue[fieldValue].number,
ldhth: [...new Set(groupedByFieldValue[fieldValue].ldhth)] //
};
}),
children: []
};
// console.log('', result);
// orgCode
const nextLevelOrgCodes = new Set();
try {
filteredData.forEach((item) => {
if (item.orgCode !== orgCode && item.orgCode.startsWith(orgCode)) {
const nextLevelOrgCode = item.orgCode.substring(0, orgCode.length + 3);
nextLevelOrgCodes.add(nextLevelOrgCode);
}
});
} catch (error) {
console.log(error);
}
//
try {
nextLevelOrgCodes.forEach((nextLevelOrgCode) => {
const child = groupByOrgCode(nextLevelOrgCode, data);
if (child) {
result.children.push(child);
}
});
} catch (error) {
console.log(error);
}
console.log('全部', result);
return result;
};
// then filter
const fetchStatisticsData = async () => {
console.log(selectedOrgCode)
if (!selectedOrgCode.value || !selectedField.value) return;
let res = [];
chartData.value = [];
try {
// A01A01A01 orgType by
var tempOrgType = '1';
if(selectedOrgCode.value.includes('A01A01A01')){
tempOrgType = '1';
}else{
tempOrgType = orgType
}
if (selectedField.value === 'zjmc') {
console.log(dictCode.value);
console.log(dictData.value);
res = await cxcRyDatAstatisticsCertificate({
orgCode: selectedOrgCode.value,
field: selectedField.value,
dictCode: dictCode.value,
fieldisDict: fieldisDict.value,
typeOfWorkList: dictData.value,
orgType: tempOrgType.value
});
} else {
res = await cxcRyDatAstatistics({
orgCode: selectedOrgCode.value,
field: selectedField.value,
dictCode: dictCode.value,
fieldisDict: fieldisDict.value,
orgType: tempOrgType.value
});
}
// console.log(res); //deepseek
if (res.success) {
console.log(selectedOrgCode.value, res);
if (res.result.length < 1) {
uni.showToast({
title: '查询数据为空'
});
return;
}
//
orgCodeGroupData.value = groupByOrgCode(selectedOrgCode.value, res.result);
console.log(orgCodeGroupData.value);
//echart
const temp = transformData(selectedOrgCode.value, res.result);
if (temp[0].children.length > 0) {
chartData.value = JSON.parse(JSON.stringify(temp[0].children));
chartDataCount.value = chartData.value.length;
console.log(chartData.value);
// updateChart(chartData.value);
} else {
var tempArr = [];
tempArr.push(temp[0])
chartData.value =tempArr;
}
updateChart(chartData.value);
}
} catch (error) {
console.error('获取统计数据失败:', error);
}
};
// delimiter
const fetchPersonnelList = async (ldhthList) => {
personnelList.value = [];
try {
const res = await cxcRyDatAstatisticsDetails({
ldhth: ldhthList
});
console.log(res);
if (res.success) {
personnelList.value = res.result;
}
} catch (error) {
console.error('获取人员列表失败:', error);
}
};
//
const onOrgCodeChange = (e, data) => {
personnelList.value = [];
selectedOrgCode.value = e;
console.log(e)
console.log(data);
orgType.value = data.value.orgType; // by
selectedOrgCodeLabel.value = data.value.title;
fetchStatisticsData();
};
const onFieldChange = (e) => {
personnelList.value = [];
// console.log(e);
try {
selectedField.value = e;
for (var index = 0; index < fieldList.value.length; index++) {
var element = fieldList.value[index];
// console.log(element);
if (element.value === e) {
selectedFieldLabel.value = element.text;
dictCode.value = element.dictCode;
fieldisDict.value = element.isDict;
}
}
if (selectedField.value === 'zjmc') {
showPopup.value.open()
} else {
fetchStatisticsData();
}
} catch (error) {
//TODO handle the exception
console.log(error);
}
};
const onChartClick = (e) => {
personnelList.value = [];
const {
ldhth
} = chartData.value;
if (ldhth && ldhth.length > 0) {
fetchPersonnelList(ldhth);
}
};
</script>
<style scoped>
/* 颜色变量 */
:root {
--primary-blue: #409eff;
--deep-blue: #2c7be5;
--light-blue: #ecf5ff;
--gradient-start: #6b8cff;
--gradient-end: #4364f7;
--hover-blue: #66b1ff;
}
/* 全局容器 */
.container {
margin: 10px 10px;
padding: 10px;
background: linear-gradient(145deg, #f5f9ff, var(--light-blue));
border-radius: 12px;
box-shadow: 0 4px 12px rgba(64, 158, 255, 0.15);
border: 1px solid rgba(64, 158, 255, 0.1);
}
/* 图表容器 */
.chart-container {
height: 250px;
margin: 10px 0;
border-radius: 12px;
overflow: hidden;
background: #ffffff;
box-shadow: 0 4px 16px rgba(64, 158, 255, 0.12);
border: 1px solid rgba(64, 158, 255, 0.08);
}
/* 表格标题行 */
.titleStyle {
font-size: 10px;
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 {
font-size: 10px;
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;
}
/* 内容样式 */
.dataStyle1 {
font-size: 8px;
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;
}
/* 滚动区域 */
scroll-view {
background: #ffffff;
border-radius: 0 0 8px 8px;
box-shadow: 0 4px 12px rgba(0, 35, 111, 0.08);
}
/* 输入框聚焦效果 */
.trq-depart-select:focus-within {
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
border-color: var(--primary-blue);
}
/* 加载动画优化 */
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.container>* {
animation: fadeIn 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}
/* 自定义滚动条美化 */
::-webkit-scrollbar {
width: 4px;
background: rgba(64, 158, 255, 0.05);
}
::-webkit-scrollbar-thumb {
background: linear-gradient(45deg, var(--primary-blue), var(--deep-blue));
border-radius: 6px;
border: 1px solid white;
}
/* 筛选行间距优化 */
.filter-row {
margin: 15px 0;
padding: 10px 0;
border-radius: 8px;
}
/* 响应式调整优化 */
@media (max-width: 768px) {
.chart-container {
height: 250px;
border-radius: 10px;
}
}
/* 数据行高亮效果 */
.data-row:nth-child(even) {
background: rgba(236, 245, 255, 0.3);
}
.data-row:hover {
box-shadow: 0 4rpx 12rpx rgba(64, 158, 255, 0.1);
}
</style>

View File

@ -1,54 +1,98 @@
<template>
<view>
<scroll-view :scroll-y="true" style="height: 100vh;">
<uni-card>
<view>
<uni-row>
<uni-col :span="11"><uni-title title="姓名 " align="left" type="h5"></uni-title></uni-col>
<uni-col :span="11" :push="2"><uni-title title="劳动合同号" align="left"
type="h5"></uni-title></uni-col>
</uni-row>
<uni-row>
<uni-col :span="11"><uni-easyinput v-model="xm" suffixIcon="search" clearable
placeholder="姓名模糊查询" @change="Search" @iconClick="Search" /></uni-col>
<uni-col :span="11" :push="2">
<uni-easyinput v-model="ldhth" suffixIcon="search" clearable placeholder="劳动合同号模糊查询"
@change="Search" @iconClick="Search" />
</uni-col>
</uni-row>
</view>
<view style="margin-bottom: 10rpx;">
<uni-row>
<uni-col :span="24"><uni-title title="所属单位" align="left" type="h5"></uni-title></uni-col>
</uni-row>
<uni-row>
<uni-col :span="24">
<trq-depart-select v-model="departID" returnCodeOrID="orgCode"
@change="departChange"></trq-depart-select>
</uni-col>
</uni-row>
</view>
</uni-card>
<uni-card>
<zb-table :show-header="true" :highlight="true" :columns="column" :stripe="true" :fit="false"
:border="true" :data="ryDataList" @detail="detail"></zb-table>
<uni-pagination :current="current" :pagerCount="pages" :total="total" prev-text="前一页" next-text="后一页"
:show-icon="false" @change="pagechange" />
<view>
<text class="example-info">当前页{{ current }}数据总量{{ total }}每页数据{{ pageSize }}</text>
</view>
</uni-card>
</scroll-view>
<view class="container" id="top1">
<uni-card>
<view>
<uni-row>
<uni-col :span="11"><uni-title title="姓名 " align="left" type="h5"></uni-title></uni-col>
<uni-col :span="11" :push="2"><uni-title title="劳动合同号" align="left" type="h5"></uni-title></uni-col>
</uni-row>
<uni-row>
<uni-col :span="11"><uni-easyinput v-model="xm" suffixIcon="search" clearable placeholder="姓名模糊查询"
@change="Search" @iconClick="Search" /></uni-col>
<uni-col :span="11" :push="2">
<uni-easyinput v-model="ldhth" suffixIcon="search" clearable placeholder="劳动合同号模糊查询"
@change="Search" @iconClick="Search" />
</uni-col>
</uni-row>
</view>
<view style="margin-bottom: 10rpx">
<uni-row>
<uni-col :span="24"><uni-title title="所属单位" align="left" type="h5"></uni-title></uni-col>
</uni-row>
<uni-row>
<uni-col :span="24">
<trq-depart-select v-model="departID" returnCodeOrID="orgCode"
@change="departChange"></trq-depart-select>
</uni-col>
</uni-row>
</view>
</uni-card>
</view>
<uni-card>
<!-- 数据表格 -->
<uni-row>
<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 v-if="ryDataList.length > 0">
<view v-for="(item, index) in ryDataList">
<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">
<span @click="detail(item)" style="color: red;">详情</span>
<!-- <button size="mini" type="primary" @click="detail(item)">详情</button> -->
</view>
</uni-col>
</view>
</uni-row>
<view class="pagination">
<uni-pagination :current="current" :pagerCount="5" :total="total" prev-text="前一页" next-text="后一页"
:show-icon="false" @change="pagechange" />
</view>
</scroll-view>
</uni-card>
</template>
<script setup>
import {
onReady,
onLoad
} from '@dcloudio/uni-app';
import {
reactive,
@ -61,135 +105,130 @@
import {
queryDepByCode,
queryZbDepByLdhth
} from '@/api/depart.js'
} from '@/api/depart.js';
import {
queryRenyuanByDepartID
} from '@/api/renyuan.js'
let xm = ref("")
let ldhth = ref("")
let departID = ref("") //ID
const ryDataList = ref([])
} from '@/api/renyuan.js';
let xm = ref('');
let ldhth = ref('');
let departID = ref(''); //ID
const ryDataList = ref([]);
let status = ref("")
const bottomHeight = ref(0);
let status = ref('');
let contentText = reactive({
contentdown: '点击查看更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
})
});
let pageNo = ref(1)
let pageSize = ref(10)
let total = ref(0)
let pages = ref(0)
let current = ref(0)
let pageNo = ref(1);
let pageSize = ref(10);
let total = ref(0);
let pages = ref(0);
let current = ref(0);
let params = reactive({
pageNo: pageNo,
pageSize: pageSize
})
let column = ref([{
label: '序号',
width: 60,
type: 'index',
color: 'blue',
align: 'center'
},
});
{
name: 'xm',
label: '姓名',
width: 70,
align: 'center'
},
{
name: 'xb_dictText',
label: '性别',
align: 'center',
width: 60
},
{
name: 'nl',
label: '年龄',
align: 'center',
width: 60
},
{
name: 'operation',
type: 'operation',
width: 60,
fixed: true,
label: '操作',
align: 'center',
renders: [{
name: '详情',
func: 'detail',
size: 'mini'
}]
}
])
onLoad((e) => {
})
onLoad((e) => {});
onMounted((e) => {
departID.value = ""
getRenyuanByDepID()
})
getHeight();
departID.value = '';
getRenyuanByDepID();
});
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;
})
.exec();
};
function detail(record) {
// console.log(record)
uni.navigateTo({
url: "/pages/views/renliziyuan/renyuanxinxi/detail?data=" + encodeURIComponent(JSON.stringify(record))
})
url: '/pages/views/renliziyuan/renyuanxinxi/detail?data=' + encodeURIComponent(JSON.stringify(record))
});
}
function pagechange(e) {
current.value = e.current
pageNo.value = e.current
current.value = e.current;
pageNo.value = e.current;
let params = {
pageNo: pageNo.value,
pageSize: pageSize.value,
current: current.value
};
if (departID.value.length <= 9) {
params.orgCode = departID.value
params.orgCode = departID.value;
} else {
params.jcxd_code = departID.value
params.jcxd_code = departID.value;
}
getRenyuanByDepID(params)
getRenyuanByDepID(params);
}
function departChange(e, data) {
departID.value = e
departID.value = e;
let params = {
pageNo: pageNo.value,
pageSize: pageSize.value,
current: current.value
};
console.log(e)
console.log(e);
if (e.length <= 9) {
params.orgCode = departID.value
params.orgCode = departID.value;
} else {
params.jcxd_code = departID.value
params.jcxd_code = departID.value;
}
getRenyuanByDepID(params)
getRenyuanByDepID(params);
}
function getRenyuanByDepID(queryParm) {
ryDataList.value = []
console.log(queryParm)
queryRenyuanByDepartID(queryParm).then((res) => {
console.log(res)
if (res.success) {
ryDataList.value = res.result.records
total.value = res.result.total
pages.value = res.result.pages
current.value = res.result.current
}
}).catch((err) => {
console.log(err);
})
// ryDataList.value = [];
console.log(queryParm);
if (departID.value.length <= 6) {
console.log(123242353);
uni.showToast({
title: '全厂数据较多,请选 下一层级...',
icon: 'none',
duration: 1000
});
return;
}
if (queryParm) {
queryRenyuanByDepartID(queryParm)
.then((res) => {
console.log(res);
if (res.success) {
ryDataList.value = res.result.records;
total.value = res.result.total;
pages.value = res.result.pages;
current.value = res.result.current;
}
getHeight();
})
.catch((err) => {
console.log(err);
});
}
}
function Search() {
@ -207,22 +246,72 @@
if (ldhth.value !== '') {
queryParm.ldhth = '*' + ldhth.value + '*';
}
console.log(queryParm)
queryRenyuanByDepartID(queryParm).then((res) => {
if (res.success) {
ryDataList.value = res.result.records
total.value = res.result.total
pages.value = res.result.pages
}
}).catch((err) => {
console.log(err);
})
console.log(queryParm);
queryRenyuanByDepartID(queryParm)
.then((res) => {
if (res.success) {
ryDataList.value = res.result.records;
total.value = res.result.total;
pages.value = res.result.pages;
}
})
.catch((err) => {
console.log(err);
});
}
</script>
<style scoped>
/* 全局容器 */
.container {
/* margin: 10rpx 10rpx; */
/* padding: 10rpx; */
background: linear-gradient(145deg, #ffaaff, 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);
}
.uni-group {
display: flex;
align-items: center;
}
.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 {
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;
}
/* 内容样式 */
.pagination {
font-size: 16px;
color: #00007f;
line-height: 30px;
height: 30px;
font-weight: 500;
text-align: center;
vertical-align: middle;
text-overflow: ellipsis;
}
</style>

View File

@ -1,10 +1,10 @@
<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 style="margin-bottom: 10rpx; margin-left: 30rpx; margin-right: 30rpx">
<uni-col :span="24"><uni-title :title="'所选单位'" align="left" type="h4"></uni-title></uni-col>
</uni-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">
<trq-depart-select v-model="orgCode" returnCodeOrID="orgCode"
@change="departChange"></trq-depart-select>
@ -12,7 +12,7 @@
</uni-row>
<!-- 概览统计 -->
<view class="stats-box" v-if="summary.total">
<view class=" stat-item">
<view class="stat-item">
<text class="label">总人数</text>
<text class="value">{{ summary.total }}</text>
</view>
@ -27,68 +27,57 @@
<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-row style="margin-top: 10px; margin-left: 30rpx; margin-right: 30rpx" v-if="tableData.length > 0">
<uni-col :span="3">
<view class="titleStyle">
序号
</view>
<view class="titleStyle">序号</view>
</uni-col>
<uni-col :span="5">
<view class="titleStyle">
姓名
</view>
<view class="titleStyle">姓名</view>
</uni-col>
<uni-col :span="5">
<view class="titleStyle">
性别
</view>
<view class="titleStyle">性别</view>
</uni-col>
<uni-col :span="5">
<view class="titleStyle">
年龄
</view>
<view class="titleStyle">年龄</view>
</uni-col>
<uni-col :span="6">
<view class="titleStyle">
操作
</view>
<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">
<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}}
{{ index + 1 }}
</view>
</uni-col>
<uni-col :span="5">
<view class="dataStyle">
{{item.xm}}
{{ item.xm }}
</view>
</uni-col><uni-col :span="5">
</uni-col>
<uni-col :span="5">
<view class="dataStyle">
{{item.xb_dictText}}
{{ item.xb_dictText }}
</view>
</uni-col><uni-col :span="5">
</uni-col>
<uni-col :span="5">
<view class="dataStyle">
{{item.nl}}
{{ item.nl }}
</view>
</uni-col>
<uni-col :span="6">
<view class="dataStyle">
<button size="mini" type="primary" @click="detail(item)">详情</button>
<span @click="detail(item)" style="color: red;">详情</span>
<!-- <button size="mini" type="primary" @click="detail(item)">详情</button> -->
</view>
</uni-col>
</view>
</uni-row>
</scroll-view>
</view>
</template>
@ -99,11 +88,11 @@
reactive,
onMounted
} from 'vue';
import * as echarts from 'echarts'
import * as echarts from 'echarts';
import {
queryRenyuanByDepartID
} from '@/api/renyuan.js'
} from '@/api/renyuan.js';
//
const bottomHeight = ref(0);
@ -125,8 +114,8 @@
function detail(record) {
// console.log(record)
uni.navigateTo({
url: "/pages/views/renliziyuan/renyuanxinxi/detail?data=" + encodeURIComponent(JSON.stringify(record))
})
url: '/pages/views/renliziyuan/renyuanxinxi/detail?data=' + encodeURIComponent(JSON.stringify(record))
});
}
// initChart
const calculateAge = (birthDate) => {
@ -141,21 +130,22 @@
};
//
const departChange = async (e, data) => {
tableData.value = []
console.log(e)
tableData.value = [];
console.log(e);
orgCode.value = e;
try {
//
isLoading.value = true;
if (orgCode.value.length <= 6) {
console.log(123242353)
uni.showLoading({
title: '全厂数据较多,耐心等待数据加载中...',
mask: true
console.log(123242353);
uni.showToast({
title: '全厂数据较多,请选 下一层级...',
icon: 'none',
duration: 1000
});
isLoading.value = false;
return;
} else {
uni.showLoading({
title: '数据加载中...',
@ -168,34 +158,34 @@
fields: ['xm', 'nl', 'xb', 'xb_dictText', 'orgCode', 'jcdw', 'jcxd', 'jcxdCode']
};
if (orgCode.value.length <= 9) {
params.orgCode = orgCode.value
params.orgCode = orgCode.value;
} else {
params.jcxd_code = orgCode.value
params.jcxd_code = orgCode.value;
}
queryRenyuanByDepartID(params).then((res) => {
if (res.success) {
processData(res.result.records);
queryRenyuanByDepartID(params)
.then((res) => {
if (res.success) {
processData(res.result.records);
//
isLoading.value = false;
uni.hideLoading();
}
}).catch((err) => {
console.log(err)
uni.showToast({
title: '数据加载失败',
icon: 'none'
//
isLoading.value = false;
uni.hideLoading();
}
})
.catch((err) => {
console.log(err);
uni.showToast({
title: '数据加载失败',
icon: 'none',
duration: 1000
});
});
})
} catch (error) {
console.log(error)
console.log(error);
uni.showToast({
title: '数据加载失败',
icon: 'none'
icon: 'none',
duration: 1000
});
} finally {
//
@ -204,15 +194,15 @@
}
};
//
const processData = (data) => {
//
const validData = data.map(item => ({
...item,
nl: calculateAge(item.cssj)
})).filter(item => item.nl >= 21 && item.nl <= 64);
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;
@ -222,27 +212,25 @@
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 subOrg = '';
let ageRange = getAgeRange(cur.nl);
// console.log(cur.orgCode, cur.jcxdCode)
if (cur.orgCode <= 6) {
subOrg = cur.orgCode
subOrg = cur.orgCode;
} else {
subOrg = cur.jcxdCode
subOrg = cur.jcxdCode;
}
// subOrgStaffs
@ -256,9 +244,8 @@
ageGroupStaffs.value[ageRange] = [];
}
ageGroupStaffs.value[ageRange].push(cur);
})
}
});
};
//
const getAgeRange = (age) => {
@ -270,9 +257,7 @@
//
const showStaffList = (subOrg, ageRange) => {
//
const targetStaffs = subOrgStaffs.value[subOrg].filter(staff =>
getAgeRange(staff.nl) === ageRange
);
const targetStaffs = subOrgStaffs.value[subOrg].filter((staff) => getAgeRange(staff.nl) === ageRange);
staffList.value = targetStaffs;
popupTitle.value = `${subOrg} ${ageRange}人员列表(共${targetStaffs.length}人)`;
@ -307,14 +292,13 @@
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),
data: xData.map((jcdw) => jcdwGroups[jcdw].ageGroups[index] || 0),
itemStyle: {
color: ['#5470C6', '#91CC75', '#FAC858', '#EE6666', '#73C0DE'][index]
},
@ -322,14 +306,14 @@
label: {
show: true,
position: 'top'
},
}
// 20
// barWidth: 20
}))
}));
chartOption.value = {
title: {
text: '人员年龄分组统计',
padding: [0, 0, 0, 30],
padding: [0, 0, 0, 30]
},
toolbox: {
padding: [0, 30, 0, 0],
@ -377,7 +361,7 @@
color: '#7F84B5',
fontWeight: 300,
interval: 0,
rotate: 0,
rotate: 0
},
padding: [0, 10, 0, 10],
axisTick: {
@ -413,35 +397,30 @@
}
}],
series: seriesData,
series: seriesData
};
//
setTimeout(async () => {
if (!chart.value) return
const myChart = await chart.value.init(echarts)
myChart.setOption(chartOption.value)
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)
console.log(params.seriesName);
tableData.value = getAgeGroupStaffs(params.seriesName);
});
}, 300);
// #ifdef APP
getHeight();
// #endif
};
onMounted(() => {
// #ifdef APP
getHeight();
// #endif
})
});
// #ifdef APP
const getHeight = () => {
@ -455,7 +434,7 @@
.select('#top1')
.boundingClientRect((rect1) => {
//
const topComponentsHeight = rect1.height
const topComponentsHeight = rect1.height;
//
bottomHeight.value = screenHeight - topComponentsHeight - 415;
})
@ -466,10 +445,10 @@
//
const initChart = () => {
setTimeout(async () => {
if (!chart.value) return
const myChart = await chart.value.init(echarts)
myChart.setOption(chartOption.value)
}, 300)
if (!chart.value) return;
const myChart = await chart.value.init(echarts);
myChart.setOption(chartOption.value);
}, 300);
};
</script>
@ -492,7 +471,7 @@
}
.query-btn {
background: #007AFF;
background: #007aff;
color: white;
padding: 0 40rpx;
border-radius: 8rpx;
@ -534,12 +513,11 @@
color: #747474;
line-height: 30px;
height: 30px;
background: #F2F9FC;
background: #f2f9fc;
text-align: center;
vertical-align: middle;
border-left: 1px solid #919191;
border-bottom: 1px solid #919191;
;
}
/* 内容样式 */
@ -558,6 +536,5 @@
border-bottom: 1px solid #919191;
border-left: 1px solid #919191;
text-overflow: ellipsis;
}
</style>

View File

@ -0,0 +1,71 @@
<template>
<view>
<uni-data-checkbox v-model="selectedValuesArray" :localdata="dictItems" :multiple="true" data-key="value"
data-value="label"></uni-data-checkbox>
</view>
</template>
<script setup>
import {
ref,
onMounted,
watch
} from 'vue';
import {
getDictItemsApi
} from '@/api/api.js';
// props emits
const props = defineProps({
dictCode: {
type: String,
required: true
},
modelValue: {
type: String,
default: ''
}
});
const emits = defineEmits(['update:modelValue', 'change']);
//
const dictItems = ref([]);
const selectedValuesArray = ref(props.modelValue ? props.modelValue.split(',') : []);
//
const loadDictItems = async () => {
try {
const response = await getDictItemsApi(props.dictCode);
dictItems.value = response.result; // { data: [...] }
} catch (error) {
console.error('加载字典数据失败:', error);
}
};
//
watch(selectedValuesArray, (newValue) => {
console.log('selectedValuesArray 变化:', newValue);
const selectedValuesString = newValue.join(',');
emits('update:modelValue', selectedValuesString);
emits('change', selectedValuesString);
}, {
deep: true
});
// props.modelValue
watch(() => props.modelValue, (newValue) => {
console.log('props.modelValue 变化:', newValue);
selectedValuesArray.value = newValue ? newValue.split(',') : [];
}, {
immediate: true
});
onMounted(() => {
loadDictItems();
});
</script>
<style scoped>
/* 可以添加组件的样式 */
</style>

View File

@ -0,0 +1,83 @@
{
"id": "cxc-szcx-dictSelect",
"displayName": "cxc-szcx-dictSelect",
"version": "1.0.0",
"description": "cxc-szcx-dictSelect",
"keywords": [
"cxc-szcx-dictSelect"
],
"repository": "",
"engines": {
"HBuilderX": "^3.1.0"
},
"dcloudext": {
"type": "component-vue",
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "",
"data": "",
"permissions": ""
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "u",
"aliyun": "u",
"alipay": "u"
},
"client": {
"Vue": {
"vue2": "u",
"vue3": "u"
},
"App": {
"app-vue": "u",
"app-nvue": "u",
"app-uvue": "u"
},
"H5-mobile": {
"Safari": "u",
"Android Browser": "u",
"微信浏览器(Android)": "u",
"QQ浏览器(Android)": "u"
},
"H5-pc": {
"Chrome": "u",
"IE": "u",
"Edge": "u",
"Firefox": "u",
"Safari": "u"
},
"小程序": {
"微信": "u",
"阿里": "u",
"百度": "u",
"字节跳动": "u",
"QQ": "u",
"钉钉": "u",
"快手": "u",
"飞书": "u",
"京东": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
}
}
}
}
}

View File

@ -0,0 +1 @@
# cxc-szcx-dictSelect

View File

@ -7,7 +7,7 @@ import {isDef} from '../isDef'
* @returns null null
*/
// #ifndef APP-IOS || APP-ANDROID
// #ifndef UNI-APP-X && APP
export function addUnit(value?: string | number): string | null {
if (!isDef(value)) {
return null;
@ -19,7 +19,7 @@ export function addUnit(value?: string | number): string | null {
// #endif
// #ifdef APP-IOS || APP-ANDROID
// #ifdef UNI-APP-X && APP
function addUnit(value: string): string
function addUnit(value: number): string
function addUnit(value: any|null): string|null {

View File

@ -1,2 +1,3 @@
import {cubicBezier} from './bezier';
export let ease = cubicBezier(0.25, 0.1, 0.25, 1);
export let ease = cubicBezier(0.25, 0.1, 0.25, 1);
export let linear = cubicBezier(0,0,1,1);

View File

@ -1,10 +1,10 @@
// @ts-nocheck
// #ifdef APP-IOS || APP-ANDROID
// #ifdef UNI-APP-X && APP
export * from './uvue.uts'
// #endif
// #ifndef APP-IOS || APP-ANDROID
// #ifndef UNI-APP-X && APP
export * from './vue.ts'
// #endif

View File

@ -1,14 +1,14 @@
// @ts-nocheck
import { ComponentPublicInstance } from 'vue'
import { ease } from './ease';
import type { ComponentPublicInstance } from 'vue'
import { ease, linear } from './ease';
import { Timeline, Animation } from './';
export type UseTransitionOptions = {
duration ?: number
immediate ?: boolean
context ?: ComponentPublicInstance
}
// #ifndef APP-IOS || APP-ANDROID
import { ref, watch, Ref } from '@/uni_modules/lime-shared/vue'
// #ifndef UNI-APP-X && APP
import { ref, watch, type Ref } from '@/uni_modules/lime-shared/vue'
export function useTransition(percent : Ref<number>|(() => number), options : UseTransitionOptions) : Ref<number> {
const current = ref(0)
@ -47,7 +47,7 @@ export function useTransition(percent : Ref<number>|(() => number), options : Us
// #endif
// #ifdef APP-IOS || APP-ANDROID
// #ifdef UNI-APP-X && APP
type UseTransitionReturnType = Ref<number>
export function useTransition(source : any, options : UseTransitionOptions) : UseTransitionReturnType {
const outputRef : Ref<number> = ref(0)
@ -69,7 +69,7 @@ export function useTransition(source : any, options : UseTransitionOptions) : Us
0,
ease,
nowValue => {
outputRef.value = nowValue //nowValue < 0.0001 ? 0 : Math.abs(v - nowValue) < 0.00001 ? v : nowValue;
outputRef.value = nowValue
clearTimeout(timer)
if(outputRef.value == v){
timer = setTimeout(()=>{
@ -78,14 +78,17 @@ export function useTransition(source : any, options : UseTransitionOptions) : Us
}, duration)
}
}
), null
),
null
);
}
if (context != null && typeof source == 'string') {
context.$watch(source, watchFunc, { immediate } as WatchOptions)
} else {
watch(source, watchFunc, { immediate } as WatchOptions)
} else if(typeof source == 'function'){
watch(source, watchFunc, { immediate })
} else if(source instanceof Ref<number>){
watch(source as Ref<number>, watchFunc, { immediate })
}
const stop = ()=>{

View File

@ -1,3 +1,4 @@
import { raf, cancelRaf} from '../raf'
// @ts-nocheck
export class Timeline {
state : string
@ -13,7 +14,7 @@ export class Timeline {
this.state = 'Initiated';
}
start() {
if (!(this.state === 'Initiated')) return;
if (!(this.state == 'Initiated')) return;
this.state = 'Started';
let startTime = Date.now();
@ -43,20 +44,26 @@ export class Timeline {
if (animation == null) return
this.animations.delete(animation);
}
clearTimeout(this.tickHandler);
// cancelAnimationFrame(this.tickHandler);
if (this.state != 'Started') return
this.tickHandler = setTimeout(() => {
this.tickHandler = raf(()=>{
this.tick!()
}, 1000 / 60)
// this.tickHandlers.push(this.tickHandler)
})
this.tickHandlers.push(this.tickHandler)
}
this.tick!()
if(this.tick != null) {
this.tick!()
}
}
pause() {
if (!(this.state === 'Started')) return;
this.state = 'Paused';
this.pauseStart = Date.now();
clearTimeout(this.tickHandler);
cancelRaf(this.tickHandler);
// cancelRaf(this.tickHandler);
}
resume() {
if (!(this.state === 'Paused')) return;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,71 @@
// @ts-nocheck
import _areaList from './city-china.json';
export const areaList = _areaList
// #ifndef UNI-APP-X
type UTSJSONObject = Record<string, string>
// #endif
// #ifdef UNI-APP-X
type Object = UTSJSONObject
// #endif
type AreaList = {
province_list : Map<string, string>;
city_list : Map<string, string>;
county_list : Map<string, string>;
}
// type CascaderOption = {
// text : string;
// value : string;
// children ?: CascaderOption[];
// };
const makeOption = (
label : string,
value : string,
children ?: UTSJSONObject[],
) : UTSJSONObject => ({
label,
value,
children,
});
export function useCascaderAreaData() : UTSJSONObject[] {
const city = areaList['city_list'] as UTSJSONObject
const county = areaList['county_list'] as UTSJSONObject
const province = areaList['province_list'] as UTSJSONObject
const provinceMap = new Map<string, UTSJSONObject>();
Object.keys(province).forEach((code) => {
provinceMap.set(code.slice(0, 2), makeOption(`${province[code]}`, code, []));
});
const cityMap = new Map<string, UTSJSONObject>();
Object.keys(city).forEach((code) => {
const option = makeOption(`${city[code]}`, code, []);
cityMap.set(code.slice(0, 4), option);
const _province = provinceMap.get(code.slice(0, 2));
if (_province != null) {
(_province['children'] as UTSJSONObject[]).push(option)
}
});
Object.keys(county).forEach((code) => {
const _city = cityMap.get(code.slice(0, 4));
if (_city != null) {
(_city['children'] as UTSJSONObject[]).push(makeOption(`${county[code]}`, code, null));
}
});
// #ifndef APP-ANDROID || APP-IOS
return Array.from(provinceMap.values());
// #endif
// #ifdef APP-ANDROID || APP-IOS
const obj : UTSJSONObject[] = []
provinceMap.forEach((value, code) => {
obj.push(value)
})
return obj
// #endif
}

View File

@ -1,10 +1,8 @@
// @ts-nocheck
// #ifndef APP-IOS || APP-ANDROID
// #ifndef UNI-APP-X && APP
export * from './vue.ts'
// #endif
// #ifdef UNI-APP-X
// #ifdef APP-IOS || APP-ANDROID
// #ifdef UNI-APP-X && APP
export * from './uvue.uts'
// #endif
// #endif

View File

@ -1,9 +1,9 @@
// @ts-nocheck
// #ifndef APP-IOS || APP-ANDROID
// #ifndef UNI-APP-X && APP
export * from './vue.ts'
// #endif
// #ifdef APP-IOS || APP-ANDROID
// #ifdef UNI-APP-X && APP
export * from './uvue.uts'
// #endif

View File

@ -1,6 +1,6 @@
// @ts-nocheck
// #ifndef APP-IOS || APP-ANDROID
// #ifndef UNI-APP-X && APP
// #ifdef MP-ALIPAY
interface My {
@ -57,11 +57,11 @@ export function canIUseCanvas2d(): boolean {
// #ifdef MP-TOUTIAO
return gte('1.78.0');
// #endif
// #ifdef UNI-APP-X && WEB || UNI-APP-X && APP
return true;
// #endif
// #ifndef MP-WEIXIN || MP-ALIPAY || MP-TOUTIAO
return false
// #endif
// #ifdef APP-IOS || APP-ANDROID || APP-NVUE || APP-VUE
return false;
// #endif
}

View File

@ -0,0 +1,111 @@
// @ts-nocheck
import { isString } from "../isString";
import { isNumber } from "../isNumber";
/**
*
* @param {number | string} amount -
* @returns {string}
*/
function capitalizedAmount(amount : number) : string
function capitalizedAmount(amount : string) : string
function capitalizedAmount(amount : any | null) : string {
try {
let _amountStr :string;
let _amountNum :number = 0;
// 如果输入是字符串,先将其转换为数字,并去除逗号
if (typeof amount == 'string') {
_amountNum = parseFloat((amount as string).replace(/,/g, ''));
}
if(isNumber(amount)) {
_amountNum = amount as number
}
// 判断输入是否为有效的金额 || isNaN(amount)
if (amount == null) throw new Error('不是有效的金额!');
let result = '';
// 处理负数情况
if (_amountNum < 0) {
result = '欠';
_amountNum = Math.abs(_amountNum);
}
// 金额不能超过千亿以上
if (_amountNum >= 10e11) throw new Error('计算金额过大!');
// 保留两位小数并转换为字符串
_amountStr = _amountNum.toFixed(2);
// 定义数字、单位和小数单位的映射
const digits = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
const units = ['', '拾', '佰', '仟'];
const bigUnits = ['', '万', '亿'];
const decimalUnits = ['角', '分'];
// 分离整数部分和小数部分
const amountArray = _amountStr.split('.');
let integerPart = amountArray[0]; // string| number[]
const decimalPart = amountArray[1];
// 处理整数部分
if (integerPart != '0') {
let _integerPart = integerPart.split('').map((item):number => parseInt(item));
// 将整数部分按四位一级进行分组
const levels = _integerPart.reverse().reduce((prev:string[][], item, index):string[][] => {
// const level = prev?.[0]?.length < 4 ? prev[0] : [];
const level = prev.length > 0 && prev[0].length < 4 ? prev[0]: []
const value = item == 0 ? digits[item] : digits[item] + units[index % 4];
level.unshift(value);
if (level.length == 1) {
prev.unshift(level);
} else {
prev[0] = level;
}
return prev;
}, [] as string[][]);
// 将分组后的整数部分转换为中文大写形式
result += levels.reduce((prev, item, index):string => {
let _level = bigUnits[levels.length - index - 1];
let _item = item.join('').replace(/(零)\1+/g, '$1');
if (_item == '零') {
_level = '';
_item = '';
} else if (_item.endsWith('零')) {
_item = _item.slice(0, _item.length - 1);
}
return prev + _item + _level;
}, '');
} else {
result += '零';
}
// 添加元
result += '元';
// 处理小数部分
if (decimalPart != '00') {
if (result == '零元') result = '';
for (let i = 0; i < decimalPart.length; i++) {
const digit = parseInt(decimalPart.charAt(i));
if (digit != 0) {
result += digits[digit] + decimalUnits[i];
}
}
} else {
result += '整';
}
return result;
} catch (error : Error) {
return error.message;
}
};

View File

@ -1,3 +1,26 @@
## 0.2.72025-01-17
- fix: 针对canvas 平台判断优化
## 0.2.62025-01-09
- feat: 增加`areaData`中国省市区数据
## 0.2.52025-01-07
- fix: animation在app上类型问题
## 0.2.42025-01-04
- feat: getRect类型问题
## 0.2.32025-01-01
- chore: unitConvert使用uni.rpx2px
## 0.2.22024-12-11
- chore: 动画使用`requestAnimationFrame`
## 0.2.12024-11-20
- feat: 增加`characterLimit`
## 0.2.02024-11-14
- fix: vue2的类型问题
## 0.1.92024-11-14
- feat: 增加`shuffle`
## 0.1.82024-10-08
- fix: vue2 条件编译 // #ifdef APP-IOS || APP-ANDROID 会生效
## 0.1.72024-09-23
- fix: raf 类型跟随版本变更
## 0.1.62024-07-24
- fix: vue2 app ts需要明确的后缀所有补全
- chore: 减少依赖

View File

@ -0,0 +1,63 @@
// @ts-nocheck
/**
*
* @param char maxcharacter条件下
* @param max
* @returns maxCharacter/maxLength maxCharacter/maxLength时返回截取之后的字符串和长度
*/
export type CharacterLengthResult = {
length : number;
characters : string;
}
// #ifdef APP-ANDROID
type ChartType = any
// #endif
// #ifndef APP-ANDROID
type ChartType = string | number
// #endif
export function characterLimit(type : string, char : ChartType, max : number) : CharacterLengthResult {
const str = `${char}`;
if (str.length == 0) {
return {
length: 0,
characters: '',
} as CharacterLengthResult
}
if (type == 'maxcharacter') {
let len = 0;
for (let i = 0; i < str.length; i += 1) {
let currentStringLength : number// = 0;
const code = str.charCodeAt(i)!
if (code > 127 || code == 94) {
currentStringLength = 2;
} else {
currentStringLength = 1;
}
if (len + currentStringLength > max) {
return {
length: len,
characters: str.slice(0, i),
} as CharacterLengthResult
}
len += currentStringLength;
}
return {
length: len,
characters: str,
} as CharacterLengthResult
} else if (type == 'maxlength') {
const length = str.length > max ? max : str.length;
return {
length: length,
characters: str.slice(0, length),
} as CharacterLengthResult
}
return {
length: str.length,
characters: str,
} as CharacterLengthResult
};

View File

@ -1,10 +1,10 @@
// @ts-nocheck
// #ifdef APP-IOS || APP-ANDROID
// #ifdef UNI-APP-X && APP
export * from './uvue.ts'
// #endif
// #ifndef APP-IOS || APP-ANDROID
// #ifndef UNI-APP-X && APP
export * from './vue.ts'
// #endif

View File

@ -15,6 +15,9 @@
import { debounce } from '@/uni_modules/lime-shared/debounce'
import { fillZero } from '@/uni_modules/lime-shared/fillZero'
import { floatAdd } from '@/uni_modules/lime-shared/floatAdd'
import { floatMul } from '@/uni_modules/lime-shared/floatMul'
import { floatDiv } from '@/uni_modules/lime-shared/floatDiv'
import { floatSub } from '@/uni_modules/lime-shared/floatSub'
import { getClassStr } from '@/uni_modules/lime-shared/getClassStr'
import { getCurrentPage } from '@/uni_modules/lime-shared/getCurrentPage'
import { getStyleStr } from '@/uni_modules/lime-shared/getStyleStr'
@ -40,91 +43,102 @@
import { toNumber } from '@/uni_modules/lime-shared/toNumber'
import { unitConvert } from '@/uni_modules/lime-shared/unitConvert'
import { getCurrentInstance } from '@/uni_modules/lime-shared/vue'
import { capitalizedAmount } from '@/uni_modules/lime-shared/capitalizedAmount'
// #ifdef VUE2
type UTSJSONObject = any
// #endif
const context = getCurrentInstance()
getRect('#shared', context!).then(res =>{
console.log('res', res.bottom)
})
getAllRect('#shared', context).then(res =>{
console.log('res', res)
})
// getRect('#shared', context!).then(res =>{
// console.log('res', res.bottom)
// })
// getAllRect('#shared', context).then(res =>{
// console.log('res', res)
// })
console.log('camelCase::', camelCase("hello world"));
console.log('camelCase::', camelCase("my_name_is_john", true));
console.log('canIUseCanvas2d::', canIUseCanvas2d());
console.log('clamp::', clamp(5 ,0, 10));
console.log('cloneDeep::', cloneDeep<UTSJSONObject>({a:5}));
console.log('closest::', closest([1, 3, 5, 7, 9], 6));
// console.log('camelCase::', camelCase("hello world"));
// console.log('camelCase::', camelCase("my_name_is_john", true));
// console.log('canIUseCanvas2d::', canIUseCanvas2d());
// console.log('clamp::', clamp(5 ,0, 10));
// console.log('cloneDeep::', cloneDeep<UTSJSONObject>({a:5}));
// console.log('closest::', closest([1, 3, 5, 7, 9], 6));
const saveData = (data: any) => {
//
console.log(`Saving data: ${data}`);
}
// const saveData = (data: any) => {
// //
// console.log(`Saving data: ${data}`);
// }
const debouncedSaveData = debounce(saveData, 500);
debouncedSaveData('Data 1');
debouncedSaveData('Data 2');
// const debouncedSaveData = debounce(saveData, 500);
// debouncedSaveData('Data 1');
// debouncedSaveData('Data 2');
console.log('fillZero', fillZero(1))
console.log('floatAdd', floatAdd(0.1, 0.2))
console.log('getClassStr', getClassStr({hover: true}))
console.log('getStyleStr', getStyleStr({ color: 'red', fontSize: '16px', backgroundColor: '', border: null }))
console.log('hasOwn', hasOwn({a: true}, 'key'))
console.log('isBase64::', isBase64("SGVsbG8sIFdvcmxkIQ=="));
console.log('isBrowser::', isBrowser);
console.log('isDef::', isDef('6'));
console.log('isEmpty::', isEmpty({a: true}));
// console.log('fillZero', fillZero(1))
// console.log('floatAdd', floatAdd(0.1, 0.2), floatAdd(1.05, 0.05), floatAdd(0.1, 0.7), floatAdd(0.0001, 0.0002), floatAdd(123.456 , 789.012))
// console.log('floatMul', floatMul(0.1, 0.02), floatMul(1.0255, 100))
// console.log('floatDiv', floatDiv(10.44, 100), floatDiv(1.0255, 100), floatDiv(5.419909340994699, 0.2))
// console.log('floatSub', floatSub(0.4, 0.1), floatSub(1.0255, 100))
const now = () : number => System.nanoTime() / 1_000_000.0
console.log('capitalizedAmount', capitalizedAmount(0.4))
console.log('capitalizedAmount', capitalizedAmount(100))
console.log('capitalizedAmount', capitalizedAmount(100000000))
console.log('capitalizedAmount', capitalizedAmount('2023.04'))
console.log('capitalizedAmount', capitalizedAmount(-1024))
console.log('now', now(), Date.now())
// console.log('getClassStr', getClassStr({hover: true}))
// console.log('getStyleStr', getStyleStr({ color: 'red', fontSize: '16px', backgroundColor: '', border: null }))
// console.log('hasOwn', hasOwn({a: true}, 'key'))
// console.log('isBase64::', isBase64("SGVsbG8sIFdvcmxkIQ=="));
// console.log('isBrowser::', isBrowser);
// console.log('isDef::', isDef('6'));
// console.log('isEmpty::', isEmpty({a: true}));
const b = () =>{}
console.log('isFunction::', isFunction(b));
console.log('isNumber::', isNumber('6'));
console.log('isNumeric::', isNumeric('6'));
console.log('isObject::', isObject({}));
// const b = () =>{}
// console.log('isFunction::', isFunction(b));
// console.log('isNumber::', isNumber('6'));
// console.log('isNumeric::', isNumeric('6'));
// console.log('isObject::', isObject({}));
const promise = ():Promise<boolean> => {
return new Promise((resolve) => {
resolve(true)
})
}
const a = promise()
console.log('isPromise::', isPromise(a));
console.log('isString::', isString('null'));
console.log('kebabCase::', kebabCase('my love'));
console.log('raf::', raf(()=>{
console.log('raf:::1')
}));
console.log('doubleRaf::', doubleRaf(()=>{
console.log('doubleRaf:::1')
}));
console.log('random', random(0, 10))
console.log('random', random(0, 1, 2))
console.log('range', range(0, 10, 2))
console.log('sleep', sleep(300).then(res => {
console.log('log')
}))
// const promise = ():Promise<boolean> => {
// return new Promise((resolve) => {
// resolve(true)
// })
// }
// const a = promise()
// console.log('isPromise::', isPromise(a));
// console.log('isString::', isString('null'));
// console.log('kebabCase::', kebabCase('my love'));
// console.log('raf::', raf(()=>{
// console.log('raf:::1')
// }));
// console.log('doubleRaf::', doubleRaf(()=>{
// console.log('doubleRaf:::1')
// }));
// console.log('random', random(0, 10))
// console.log('random', random(0, 1, 2))
// console.log('range', range(0, 10, 2))
// console.log('sleep', sleep(300).then(res => {
// console.log('log')
// }))
const handleScroll = (a: string) => {
console.log("Scroll event handled!", a);
}
// const handleScroll = (a: string) => {
// console.log("Scroll event handled!", a);
// }
// // 使 handleScroll 500
const throttledScroll = throttle(handleScroll, 500);
throttledScroll('5');
const page = getCurrentPage()
console.log('getCurrentPage::', page)
// // // 使 handleScroll 500
// const throttledScroll = throttle(handleScroll, 500);
// throttledScroll('5');
// const page = getCurrentPage()
// console.log('getCurrentPage::', page)
console.log('toArray', toArray<number>(5))
console.log('toBoolean', toBoolean(5))
console.log('toNumber', toNumber('5'))
console.log('unitConvert', unitConvert('5'))
// console.log('toArray', toArray<number>(5))
// console.log('toBoolean', toBoolean(5))
// console.log('toNumber', toNumber('5'))
// console.log('unitConvert', unitConvert('5'))
// uni.getImageInfo({
// src: '/static/logo.png',
@ -132,6 +146,9 @@
// console.log('res', res)
// }
// })
export default {
}
</script>
<style>

View File

@ -0,0 +1,73 @@
// @ts-nocheck
// #ifndef UNI-APP-X && APP
import type { ComponentInternalInstance } from '@/uni_modules/lime-shared/vue'
import { getRect } from '@/uni_modules/lime-shared/getRect'
import { canIUseCanvas2d } from '@/uni_modules/lime-shared/canIUseCanvas2d'
export const isCanvas2d = canIUseCanvas2d()
// #endif
export function createCanvas(canvasId : string, component : ComponentInternalInstance) {
// #ifdef UNI-APP-X
uni.createCanvasContextAsync({
canvasId,
component,
success(context : CanvasContext) {
},
fail(error : UniError) {
}
})
// #endif
// #ifndef UNI-APP-X
const isCanvas2d = canIUseCanvas2d()
getRect('#' + canvasId, context, isCanvas2d).then(res => {
if (res.node) {
res.node.width = res.width
res.node.height = res.height
return res.node
} else {
const ctx = uni.createCanvasContext(canvasId, context)
if (!ctx._drawImage) {
ctx._drawImage = ctx.drawImage
ctx.drawImage = function (...args) {
const { path } = args.shift()
ctx._drawImage(path, ...args)
}
}
if (!ctx.getImageData) {
ctx.getImageData = function () {
return new Promise((resolve, reject) => {
uni.canvasGetImageData({
canvasId,
x: parseInt(arguments[0]),
y: parseInt(arguments[1]),
width: parseInt(arguments[2]),
height: parseInt(arguments[3]),
success(res) {
resolve(res)
},
fail(err) {
reject(err)
}
}, context)
})
}
return {
getContext(type: string) {
if(type == '2d') {
return ctx
}
},
width: res.width,
height: res.height,
createImage
}
}
}
})
// #endif
}

View File

@ -1,5 +1,5 @@
// @ts-nocheck
// #ifndef APP-IOS || APP-ANDROID
// #ifndef UNI-APP-X && APP
import {isBrowser} from '../isBrowser'
class Image {
currentSrc: string | null = null
@ -63,8 +63,9 @@ export function createImage(canvas?: any): HTMLImageElement | UniImage {
// #endif
// #ifdef APP-IOS || APP-ANDROID
export function createImage(){
console.error('当前环境不支持')
// #ifdef UNI-APP-X && APP
export function createImage():Image{
// console.error('当前环境不支持')
return new Image()
}
// #endif

View File

@ -1,10 +1,10 @@
// @ts-nocheck
// #ifdef APP-IOS || APP-ANDROID
// #ifdef UNI-APP-X && APP
export * from './uvue.ts'
// #endif
// #ifndef APP-IOS || APP-ANDROID
// #ifndef UNI-APP-X && APP
export * from './vue.ts'
// #endif

View File

@ -1,9 +1,9 @@
// @ts-nocheck
// #ifndef APP-IOS || APP-ANDROID
// #ifndef UNI-APP-X && APP
export * from './vue.ts'
// #endif
// #ifdef APP-IOS || APP-ANDROID
// #ifdef UNI-APP-X && APP
export * from './uvue.ts'
// #endif

View File

@ -1,36 +1,36 @@
import {isNumber} from '../isNumber'
import { isNumber } from '../isNumber'
/**
*
* @param num1
* @param num2
* @returns
*/
export function floatAdd(num1: number, num2: number): number {
// 检查 num1 和 num2 是否为数字类型
if (!(isNumber(num1) || isNumber(num2))) {
console.warn('Please pass in the number type');
return NaN;
}
export function floatAdd(num1 : number, num2 : number) : number {
// 检查 num1 和 num2 是否为数字类型
if (!(isNumber(num1) || isNumber(num2))) {
console.warn('Please pass in the number type');
return NaN;
}
let r1: number, r2: number, m: number;
let r1 : number, r2 : number, m : number;
try {
// 获取 num1 小数点后的位数
r1 = num1.toString().split('.')[1].length;
} catch (error) {
r1 = 0;
}
try {
// 获取 num1 小数点后的位数
r1 = num1.toString().split('.')[1].length;
} catch (error) {
r1 = 0;
}
try {
// 获取 num2 小数点后的位数
r2 = num2.toString().split('.')[1].length;
} catch (error) {
r2 = 0;
}
try {
// 获取 num2 小数点后的位数
r2 = num2.toString().split('.')[1].length;
} catch (error) {
r2 = 0;
}
// 计算需要扩大的倍数
m = Math.pow(10, Math.max(r1, r2));
// 计算需要扩大的倍数
m = Math.pow(10, Math.max(r1, r2));
// 返回相加结果
return (num1 * m + num2 * m) / m;
}
// 返回相加结果
return (num1 * m + num2 * m) / m;
}

View File

@ -0,0 +1,45 @@
import { floatMul } from '../floatMul';
import { isNumber } from '../isNumber';
/**
*
* @param {number} num1 -
* @param {number} num2 -
* @returns {number}
*/
export function floatDiv(num1:number, num2:number):number {
// 如果传入的不是数字类型则打印警告并返回NaN
if (!isNumber(num1) || !isNumber(num2)) {
console.warn('请传入数字类型');
return NaN;
}
let m1 = 0, // 被除数小数点后的位数
m2 = 0, // 除数小数点后的位数
s1 = num1.toString(), // 将被除数转换为字符串
s2 = num2.toString(); // 将除数转换为字符串
// 计算被除数小数点后的位数
try {
m1 += s1.split('.')[1].length;
} catch (error) {}
// 计算除数小数点后的位数
try {
m2 += s2.split('.')[1].length;
} catch (error) {}
// 进行除法运算并处理小数点后的位数,使用之前定义的乘法函数保持精度
// #ifdef APP-ANDROID
return floatMul(
parseFloat(s1.replace('.', '')) / parseFloat(s2.replace('.', '')),
Math.pow(10, m2 - m1),
);
// #endif
// #ifndef APP-ANDROID
return floatMul(
Number(s1.replace('.', '')) / Number(s2.replace('.', '')),
Math.pow(10, m2 - m1),
);
// #endif
}

View File

@ -0,0 +1,44 @@
// @ts-nocheck
import {isNumber} from '../isNumber';
// #ifdef APP-ANDROID
import BigDecimal from 'java.math.BigDecimal'
// import BigDecimal from 'java.math.BigDecimal'
// import StringBuilder from 'java.lang.StringBuilder'
// import java.math.BigDecimal;
// #endif
/**
*
* @param {number} num1 -
* @param {number} num2 -
* @returns {number}
*/
export function floatMul(num1 : number, num2 : number) : number {
if (!(isNumber(num1) || isNumber(num2))) {
console.warn('Please pass in the number type');
return NaN;
}
let m = 0;
// #ifdef APP-ANDROID
let s1 = BigDecimal.valueOf(num1.toDouble()).toPlainString(); //new UTSNumber(num1).toString() // //`${num1.toFloat()}`// num1.toString(),
let s2 = BigDecimal.valueOf(num2.toDouble()).toPlainString(); //new UTSNumber(num2).toString() //`${num2.toFloat()}`//.toString();
// #endif
// #ifndef APP-ANDROID
let s1:string = `${num1}`// num1.toString(),
let s2:string = `${num2}`//.toString();
// #endif
try {
m += s1.split('.')[1].length;
} catch (error) { }
try {
m += s2.split('.')[1].length;
} catch (error) { }
// #ifdef APP-ANDROID
return parseFloat(s1.replace('.', '')) * parseFloat(s2.replace('.', '')) / Math.pow(10, m);
// #endif
// #ifndef APP-ANDROID
return Number(s1.replace('.', '')) * Number(s2.replace('.', '')) / Math.pow(10, m);
// #endif
}

View File

@ -0,0 +1,32 @@
import { isNumber } from '../isNumber';
/**
*
* @param {number} num1 -
* @param {number} num2 -
* @returns {number}
*/
export function floatSub(num1 : number, num2 : number) : number {
if (!(isNumber(num1) || isNumber(num2))) {
console.warn('Please pass in the number type');
return NaN;
}
let r1:number, r2:number, m:number, n:number;
try {
r1 = num1.toString().split('.')[1].length;
} catch (error) {
r1 = 0;
}
try {
r2 = num2.toString().split('.')[1].length;
} catch (error) {
r2 = 0;
}
m = Math.pow(10, Math.max(r1, r2));
n = r1 >= r2 ? r1 : r2;
// #ifndef APP-ANDROID
return Number(((num1 * m - num2 * m) / m).toFixed(n));
// #endif
// #ifdef APP-ANDROID
return parseFloat(((num1 * m - num2 * m) / m).toFixed(n));
// #endif
}

View File

@ -1,6 +1,6 @@
// @ts-nocheck
// #ifdef APP-IOS || APP-ANDROID
// #ifdef UNI-APP-X && APP
import { isNumber } from '../isNumber'
import { isString } from '../isString'
import { isDef } from '../isDef'
@ -13,7 +13,7 @@ import { isDef } from '../isDef'
*/
export function getClassStr<T>(obj : T) : string {
let classNames : string[] = [];
// #ifdef APP-IOS || APP-ANDROID
// #ifdef UNI-APP-X && APP
if (obj instanceof UTSJSONObject) {
(obj as UTSJSONObject).toMap().forEach((value, key) => {
if (isDef(value)) {
@ -30,7 +30,7 @@ export function getClassStr<T>(obj : T) : string {
})
}
// #endif
// #ifndef APP-IOS || APP-ANDROID
// #ifndef UNI-APP-X && APP
// 遍历对象的属性
for (let key in obj) {
// 检查属性确实属于对象自身且其值为true

View File

@ -1,9 +1,9 @@
// @ts-nocheck
// #ifndef APP-IOS || APP-ANDROID
// #ifndef UNI-APP-X && APP
export * from './vue.ts'
// #endif
// #ifdef APP-IOS || APP-ANDROID
// #ifdef UNI-APP-X && APP
export * from './uvue.uts'
// #endif

View File

@ -16,7 +16,7 @@ export const getLocalFilePath = (path : string) => {
// #endif
// #ifdef APP-ANDROID || APP-IOS
// #ifdef UNI-APP-X && APP
export { getResourcePath as getLocalFilePath } from '@/uni_modules/lime-file-utils'
// export const getLocalFilePath = (path : string) : string => {
// let uri = path

View File

@ -1,9 +1,9 @@
// @ts-nocheck
// #ifdef APP-IOS || APP-ANDROID
// #ifdef UNI-APP-X && APP
export * from './uvue.uts'
// #endif
// #ifndef APP-IOS || APP-ANDROID
// #ifndef UNI-APP-X && APP
export * from './vue.ts'
// #endif

View File

@ -1,5 +1,5 @@
// @ts-nocheck
export function getRect(selector : string, context: ComponentInternalInstance):Promise<NodeInfo> {
export function getRect(selector : string, context: ComponentPublicInstance):Promise<NodeInfo> {
return new Promise((resolve)=>{
uni.createSelectorQuery().in(context).select(selector).boundingClientRect(res =>{
resolve(res as NodeInfo)
@ -7,7 +7,7 @@ export function getRect(selector : string, context: ComponentInternalInstance):P
})
}
export function getAllRect(selector : string, context: ComponentInternalInstance):Promise<NodeInfo[]> {
export function getAllRect(selector : string, context: ComponentPublicInstance):Promise<NodeInfo[]> {
return new Promise((resolve)=>{
uni.createSelectorQuery().in(context).selectAll(selector).boundingClientRect(res =>{
resolve(res as NodeInfo[])

View File

@ -12,7 +12,7 @@ const dom = uni.requireNativePlugin('dom')
* @param node node
* @returns Promise
*/
export function getRect(selector : string, context : ComponentInternalInstance, node: boolean = false) {
export function getRect(selector : string, context : ComponentInternalInstance|ComponentPublicInstance, node: boolean = false) {
// 之前是个对象,现在改成实例,防止旧版会报错
if(context== null) {
return Promise.reject('context is null')
@ -67,7 +67,7 @@ export function getRect(selector : string, context : ComponentInternalInstance,
};
export function getAllRect(selector : string, context: ComponentInternalInstance, node:boolean = false) {
export function getAllRect(selector : string, context: ComponentInternalInstance|ComponentPublicInstance, node:boolean = false) {
if(context== null) {
return Promise.reject('context is null')
}

View File

@ -1,12 +1,12 @@
// @ts-nocheck
// #ifndef APP-IOS || APP-ANDROID
// #ifndef UNI-APP-X && APP
interface CSSProperties {
[key : string] : string | number | null
}
// #endif
// #ifdef VUE3
// #ifdef APP-IOS || APP-ANDROID
// #ifdef UNI-APP-X && APP
type CSSProperties = UTSJSONObject
// #endif
// #endif
@ -26,7 +26,7 @@ export function toLowercaseSeparator(key : string):string {
*/
export function getStyleStr(style : CSSProperties) : string {
// #ifdef APP-IOS || APP-ANDROID
// #ifdef UNI-APP-X && APP
let styleStr = '';
style.toMap().forEach((value, key) => {
if(value !== null && value != '') {
@ -35,7 +35,7 @@ export function getStyleStr(style : CSSProperties) : string {
})
return styleStr
// #endif
// #ifndef APP-IOS || APP-ANDROID
// #ifndef UNI-APP-X && APP
return Object.keys(style)
.filter(
(key) =>

View File

@ -1,9 +1,9 @@
// @ts-nocheck
// #ifdef APP-IOS || APP-ANDROID
// #ifdef UNI-APP-X && APP
export * from './uvue.ts'
// #endif
// #ifndef APP-IOS || APP-ANDROID
// #ifndef UNI-APP-X && APP
export * from './vue.ts'
// #endif

View File

@ -13,10 +13,10 @@ export function isDef(value: unknown): boolean {
// #ifdef UNI-APP-X
export function isDef(value : any|null) : boolean {
// #ifdef APP-ANDROID || APP-IOS
// #ifdef UNI-APP-X && APP
return value != null;
// #endif
// #ifndef APP-ANDROID || APP-IOS
// #ifndef UNI-APP-X && APP
return value != null && value != undefined;
// #endif
}

View File

@ -16,7 +16,7 @@ import {isNumber} from '../isNumber'
*/
// #ifdef APP-IOS || APP-ANDROID
// #ifdef UNI-APP-X && APP
export function isEmpty(value : any | null) : boolean {
// 为null
if(!isDef(value)){
@ -55,7 +55,7 @@ export function isEmpty(value : any | null) : boolean {
// #endif
// #ifndef APP-IOS || APP-ANDROID
// #ifndef UNI-APP-X && APP
export function isEmpty(value: any): boolean {
// 检查是否为null或undefined
if (value == null) {

View File

@ -5,12 +5,12 @@
* @returns true false
*/
// #ifdef APP-IOS || APP-ANDROID
// #ifdef UNI-APP-X && APP
export const isFunction = (val: any):boolean => typeof val == 'function';
// #endif
// #ifndef APP-IOS || APP-ANDROID
// #ifndef UNI-APP-X && APP
export const isFunction = (val: unknown): val is Function =>
typeof val === 'function';
// #endif

View File

@ -19,7 +19,7 @@ export function isNumber(value: any|null): boolean {
// #ifdef APP-IOS
return ['Int8', 'UInt8','Int16','UInt16','Int32','UInt32','Int64','UInt64','Int','UInt','Float','Float16','Float32','Float64','Double', 'number'].includes(typeof value)
// #endif
// #ifndef APP-ANDROID || APP-IOS
// #ifndef UNI-APP-X && APP
return typeof value === 'number' && !isNaN(value);
// #endif
}

View File

@ -6,14 +6,14 @@
* @returns true false
*/
// #ifndef APP-IOS || APP-ANDROID
// #ifndef UNI-APP-X && APP
export function isNumeric(value: string | number | undefined | null): boolean {
return /^(-)?\d+(\.\d+)?$/.test(value);
}
// #endif
// #ifdef APP-IOS || APP-ANDROID
// #ifdef UNI-APP-X && APP
import {isNumber} from '../isNumber';
import {isString} from '../isString';
export function isNumeric(value : any|null) : boolean {

View File

@ -5,14 +5,14 @@
* @returns true false
*/
// #ifndef APP-IOS || APP-ANDROID
// #ifndef UNI-APP-X && APP
export const isObject = (val : unknown) : val is Record<any, any> =>
val !== null && typeof val === 'object';
// #endif
// #ifdef APP-IOS || APP-ANDROID
// #ifdef UNI-APP-X && APP
export const isObject = (val : any | null) : boolean =>{
return val !== null && typeof val === 'object';
}

View File

@ -4,7 +4,7 @@
* @param str
* @returns true false
*/
// #ifndef APP-IOS || APP-ANDROID
// #ifndef UNI-APP-X && APP
// export const isString = (str: unknown): str is string => typeof str === 'string';
export function isString (str: unknown): str is string {
return typeof str == 'string'
@ -12,8 +12,8 @@ export function isString (str: unknown): str is string {
// #endif
// #ifdef APP-IOS || APP-ANDROID
export function isString (str: any): boolean {
// #ifdef UNI-APP-X && APP
export function isString (str: any|null): boolean {
return typeof str == 'string'
}
// #endif

View File

@ -12,10 +12,10 @@
export function kebabCase(str : string, separator : string = "-") : string {
return str
// #ifdef APP-IOS || APP-ANDROID
// #ifdef UNI-APP-X && APP
.replace(/[A-Z]/g, (match : string, _ : number, _ : string) : string => `${separator}${match.toLowerCase()}`) // 将大写字母替换为连接符加小写字母
// #endif
// #ifndef APP-IOS || APP-ANDROID
// #ifndef UNI-APP-X && APP
.replace(/[A-Z]/g, (match : string) : string => `${separator}${match.toLowerCase()}`) // 将大写字母替换为连接符加小写字母
// #endif
.replace(/[\s_-]+/g, separator) // 将空格、下划线和短横线替换为指定连接符

View File

@ -0,0 +1,11 @@
// @ts-nocheck
// #ifndef UNI-APP-X
type UTSJSONObject = Record<string, any>
// #endif
export function obj2url(data: UTSJSONObject, isPrefix: boolean = false): string {
const prefix = isPrefix ? '?' : '';
const _result = [];
}

View File

@ -1,7 +1,7 @@
{
"id": "lime-shared",
"displayName": "lime-shared",
"version": "0.1.6",
"version": "0.2.7",
"description": "本人插件的几个公共函数获取当前页图片的base64转临时路径图片的exif信息等",
"keywords": [
"lime-shared",
@ -48,9 +48,10 @@
"vue3": "y"
},
"App": {
"app-vue": "y",
"app-uvue": "y",
"app-nvue": "y"
"app-vue": "y",
"app-uvue": "y",
"app-nvue": "y",
"app-harmony": "u"
},
"H5-mobile": {
"Safari": "y",

View File

@ -1,9 +1,9 @@
// @ts-nocheck
// #ifndef APP-IOS || APP-ANDROID
// #ifndef UNI-APP-X && APP
export * from './vue.ts'
// #endif
// #ifdef APP-IOS || APP-ANDROID
// #ifdef UNI-APP-X && APP
export * from './uvue.uts'
// #endif

View File

@ -1,10 +1,10 @@
// @ts-nocheck
// #ifdef APP-IOS || APP-ANDROID
export * from './vue.ts'
// #ifdef UNI-APP-X && APP
export * from './uvue'
// #endif
// #ifndef APP-IOS || APP-ANDROID
export * from './uvue.ts'
// #ifndef UNI-APP-X && APP
export * from './vue'
// #endif

View File

@ -1,12 +1,11 @@
// @ts-nocheck
// import {isBrowser} from '../isBrowser'
// 是否支持被动事件监听
export const supportsPassive = true;
// #ifdef uniVersion < 4.25
// 请求动画帧
export function raf(fn: TimerCallback): number {
return setTimeout(fn, 1000 / 30);
return setTimeout(fn, 1000 / 60);
}
// 取消动画帧
@ -14,7 +13,36 @@ export function cancelRaf(id: number) {
clearTimeout(id);
}
// 双倍动画帧
export function doubleRaf(fn: TimerCallback): void {
raf(() => raf(fn)); // 在下一帧回调中再次请求动画帧,实现双倍动画帧效果
}
raf(():number => raf(fn)); // 在下一帧回调中再次请求动画帧,实现双倍动画帧效果
}
// #endif
// #ifdef uniVersion >= 4.25
// 请求动画帧
export function raf(fn: UniAnimationFrameCallback): number
export function raf(fn: UniAnimationFrameCallbackWithNoArgument): number
export function raf(fn: any): number {
if(typeof fn == 'UniAnimationFrameCallback') {
return requestAnimationFrame(fn as UniAnimationFrameCallback);
} else {
return requestAnimationFrame(fn as UniAnimationFrameCallbackWithNoArgument);
}
}
// 取消动画帧
export function cancelRaf(id: number) {
cancelAnimationFrame(id);
}
// 双倍动画帧
export function doubleRaf(fn: UniAnimationFrameCallback): void
export function doubleRaf(fn: UniAnimationFrameCallbackWithNoArgument): void
export function doubleRaf(fn: any): void {
raf(():number => raf(fn)); // 在下一帧回调中再次请求动画帧,实现双倍动画帧效果
}
// #endif

View File

@ -1,5 +1,4 @@
// @ts-nocheck
// import { isBrowser } from '../isBrowser'
type Callback = () => void//Function
// 是否支持被动事件监听
export const supportsPassive = true;
@ -7,7 +6,7 @@ export const supportsPassive = true;
// 请求动画帧
export function raf(fn : Callback) : number {
// #ifndef WEB
return setTimeout(fn, 1000 / 30); // 请求动画帧
return setTimeout(fn, 1000 / 60); // 请求动画帧
// #endif
// #ifdef WEB
return requestAnimationFrame(fn); // 请求动画帧

View File

@ -32,6 +32,7 @@ import {getRect} from '@/uni_modules/lime-shared/getRect'
+ [camelCase](#api_camelCase): 字符串转换为 camelCase 或 PascalCase 风格的命名约定
+ [kebabCase](#api_kebabCase): 将字符串转换为指定连接符的命名约定
+ [closest](#api_closest): 在给定数组中找到最接近目标数字的元素
+ [shuffle](#api_shuffle): 将给定的数组打乱
+ [isBase64](#api_isBase64): 判断字符串是否为base64
+ [isNumber](#api_isNumber): 检查一个值是否为数字类型
+ [isNumeric](#api_isNumeric): 检查一个值是否为数字类型或表示数字的字符串
@ -371,6 +372,19 @@ closest([1, 3, 5, 7, 9], 6) // 5
| √ | √ |
### shuffle <a id="api_shuffle"></a>
- 在给定数组中找到最接近目标数字的元素
```js
shuffle([1, 3, 5, 7, 9])
```
##### 兼容性
| uni-app | uni-app x |
|------------|----------------------------------|
| √ | √ |
### isBase64 <a id="api_isBase64"></a>
- 判断字符串是否为base64

View File

@ -0,0 +1,16 @@
// @ts-nocheck
/**
* 使 Fisher-Yates
* @description
* @param arr
* @returns
*/
export function shuffle<T>(arr : T[]) : T[] {
for (let i = arr.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1))
const temp = arr[i]
arr[i] = arr[j]
arr[j] = temp
}
return arr
}

View File

@ -6,7 +6,7 @@
*/
// #ifdef APP-IOS || APP-ANDROID
// #ifdef UNI-APP-X && APP
function sleep(delay: number = 300):Promise<boolean> {
return new Promise((resolve):void => {setTimeout(() => {resolve(true)}, delay)});
}
@ -16,7 +16,7 @@ export {
// #endif
// #ifndef APP-IOS || APP-ANDROID
// #ifndef UNI-APP-X && APP
export const sleep = (delay: number = 300) =>
new Promise(resolve => setTimeout(resolve, delay));

View File

@ -6,7 +6,7 @@
* @returns
*/
// #ifndef APP-IOS || APP-ANDROID
// #ifndef UNI-APP-X && APP
export function throttle(fn: (...args: any[]) => void, delay: number) {
let flag = true; // 标记是否可以执行函数
@ -24,7 +24,7 @@ export function throttle(fn: (...args: any[]) => void, delay: number) {
// #endif
// #ifdef APP-IOS || APP-ANDROID
// #ifdef UNI-APP-X && APP
// type Rfun = (...args: any[]) => void
// type Rfun = (...args: any[]) => void

View File

@ -4,12 +4,12 @@
* @param item
* @returns
*/
// #ifndef APP-IOS || APP-ANDROID
// #ifndef UNI-APP-X && APP
export const toArray = <T>(item: T | T[]): T[] => Array.isArray(item) ? item : [item];
// #endif
// #ifdef APP-IOS || APP-ANDROID
// #ifdef UNI-APP-X && APP
export function toArray<T extends any>(item: any): T[] {
return Array.isArray(item) ? item as T[] : [item as T]// as T[]
};

View File

@ -7,7 +7,7 @@ import { isString } from '../isString'
// function toBoolean(value : number) : boolean;
// function toBoolean(value : boolean) : boolean;
// #ifdef APP-IOS || APP-ANDROID
// #ifdef UNI-APP-X && APP
function toBoolean(value : any | null) : boolean {
// 根据输入值的类型,返回相应的布尔值
// if (isNumber(value)) {
@ -29,7 +29,7 @@ function toBoolean(value : any | null) : boolean {
// #endif
// #ifndef APP-IOS || APP-ANDROID
// #ifndef UNI-APP-X && APP
function toBoolean(value : any | null) : value is NonNullable<typeof value> {
return !!value//value !== null && value !== undefined;
}

View File

@ -5,7 +5,7 @@
* @returns
*/
// #ifdef APP-IOS || APP-ANDROID
// #ifdef UNI-APP-X && APP
// function toNumber(val: string): number
// function toNumber(val: string): string
function toNumber(val: string): number|null {
@ -15,7 +15,7 @@ function toNumber(val: string): number|null {
export {toNumber}
// #endif
// #ifndef APP-IOS || APP-ANDROID
// #ifndef UNI-APP-X && APP
export function toNumber(val: string): number | string {
const n = parseFloat(val); // 使用 parseFloat 函数将字符串转换为浮点数
return isNaN(n) ? val : n; // 使用 isNaN 函数判断是否为非数字,返回转换后的数字或原始字符串

View File

@ -7,8 +7,8 @@ import { isNumeric } from '../isNumeric'
* @param value
* @returns 0
*/
// #ifndef APP-IOS || APP-ANDROID
export function unitConvert(value : string | number) : number {
// #ifndef UNI-APP-X && APP
export function unitConvert(value : string | number, base: number = 0) : number {
// 如果是字符串数字
if (isNumeric(value)) {
return Number(value);
@ -21,12 +21,15 @@ export function unitConvert(value : string | number) : number {
return 0;
}
const unit = results[3];
value = parseFloat(value);
const _value = parseFloat(value);
if (unit === 'rpx') {
return uni.upx2px(value);
return uni.upx2px(_value);
}
if (unit === 'px') {
return value * 1;
return _value * 1;
}
if(unit == '%') {
return _value / 100 * base
}
// 如果是其他单位,可以继续添加对应的转换逻辑
}
@ -35,9 +38,9 @@ export function unitConvert(value : string | number) : number {
// #endif
// #ifdef APP-IOS || APP-ANDROID
// #ifdef UNI-APP-X && APP
import { isNumber } from '../isNumber'
export function unitConvert(value : any | null) : number {
export function unitConvert(value : any | null, base: number = 0) : number {
if (isNumber(value)) {
return value as number
}
@ -53,13 +56,17 @@ export function unitConvert(value : any | null) : number {
return 0;
}
const unit = results[3];
const v = parseFloat(value);
const _value = parseFloat(value);
if (unit == 'rpx') {
const { windowWidth } = uni.getWindowInfo()
return windowWidth / 750 * v;
// const { windowWidth } = uni.getWindowInfo()
// return windowWidth / 750 * _value;
return uni.rpx2px(_value)
}
if (unit == 'px') {
return v;
return _value;
}
if(unit == '%') {
return _value / 100 * base
}
// 如果是其他单位,可以继续添加对应的转换逻辑
}

View File

@ -2,12 +2,13 @@
<view v-if="returnCodeOrID === 'orgCode'">
<uni-data-picker v-model="selectDepartID" ref="depart" :openSearch="true" :ellipsis="true"
placeholder="请选择单位code" popup-title="请选择单位" :localdata="departList" @nodeclick="onnodeclick"
@popupclosed="onpopupclosed" @change="onchange" :map="{'text':'title','value':'orgCode'}"></uni-data-picker>
@popupclosed="onpopupclosed" :map="{'text':'title','value':'orgCode'}"
class="no-wrap-picker"></uni-data-picker>
</view>
<view v-else>
<uni-data-picker v-model="selectDepartID" ref="depart" :openSearch="true" :ellipsis="true" placeholder="请选择单位id"
popup-title="请选择单位" :localdata="departList" @nodeclick="onnodeclick" @popupclosed="onpopupclosed"
@change="onchange" :map="{'text':'title','value':'id'}"></uni-data-picker>
:map="{'text':'title','value':'id'}" class="no-wrap-picker"></uni-data-picker>
</view>
</template>
@ -29,6 +30,7 @@
import {
reactive,
ref,
watch,
defineEmits,
defineProps
} from 'vue';
@ -45,15 +47,29 @@
let selectDepartID = ref("") //ID
let selectDepartIDS = ref([]) //ID
let tempSelectDepartID = ref("") //ID
let depart = ref(null);
let departInfo = ref({}) //""
let $emit = defineEmits(['change']);
watch(
tempSelectDepartID,
(newVal,oldVal)=>{ //change by
console.log(newVal)
$emit('change', newVal, departInfo)
},{
immediate:true,
deep:true
}
)
const getDepartList = () => {
queryMyDeptTreeListApi().then((res) => {
if (res.success) {
// console.log(res)
console.log(res)
departList.value = res.result
}
}).catch((err) => {
@ -61,26 +77,41 @@
})
}
const onnodeclick = ((e) => {
console.log(e)
departInfo.value = e;
if (props.returnCodeOrID = "orgCode") {
if (props.returnCodeOrID == "orgCode") {
tempSelectDepartID.value = e.orgCode
} else {
tempSelectDepartID.value = e.value
}
// if(!depart.value.isOpened){// change by
// $emit('change', selectDepartID.value, departInfo)
// }
})
const onchange = ((e) => {
$emit('change', e.detail.value[e.detail.value.length - 1].value, {})
console.log(e)
selectDepartID.value = e.detail.value[e.detail.value.length - 1].value
// $emit('change', e.detail.value[e.detail.value.length - 1].value, {})
})
const onpopupclosed = ((e) => {
console.log(e)
selectDepartID.value = tempSelectDepartID.value
$emit('change', selectDepartID.value, departInfo)
// $emit('change', selectDepartID.value, departInfo)
})
onLoad((e) => {
getDepartList();
})
</script>
<style>
<style scoped>
/* 选择器根据实际情况调整 */
.no-wrap-picker::v-deep .uni-data-picker-item {
white-space: nowrap;
/* 强制不换行 */
overflow: hidden;
/* 超出部分隐藏 */
text-overflow: ellipsis;
/* 超出部分显示省略号 */
}
</style>

View File

@ -22,8 +22,8 @@
<slot name="picker-loading" :loading="loading"></slot>
</view>
</view>
<view class="uni-data-tree-cover" v-if="isOpened" @click="handleClose"></view>
<view class="uni-data-tree-dialog" v-if="isOpened">
<view class="uni-data-tree-cover" v-show="isOpened" @click="handleClose"></view>
<view class="uni-data-tree-dialog" v-show="isOpened">
<view class="uni-popper__arrow"></view>
<view class="dialog-caption">
<view class="dialog-title-view">

View File

@ -25,8 +25,8 @@
</view>
</slot>
</view>
<view class="uni-data-tree-cover" v-if="isOpened" @click="handleClose"></view>
<view class="uni-data-tree-dialog" v-if="isOpened">
<view class="uni-data-tree-cover" v-show="isOpened" @click="handleClose"></view>
<view class="uni-data-tree-dialog" v-show="isOpened">
<view class="uni-popper__arrow"></view>
<view class="dialog-caption">
<view class="title-area">

View File

@ -1,108 +1,117 @@
<template>
<uni-row>
<view v-for="(item,index) in data">
<view v-for="(item, index) in data">
<uni-col :span="item.titleSpan">
<view class="titleStyle">
{{item.title}}
{{ item.title }}
</view>
</uni-col>
<uni-col :span="item.valueSpan">
<view class="dataStyle">
<view :class="item.class">
{{ doEmptyString(item.value) }}
</view>
</uni-col>
</view>
</uni-row>
</template>
<script>
export default {
props: {
//
cellData: {
type: Object,
default: () => [{
title: "",
value: "",
export default {
props: {
//
cellData: {
type: Object,
default: () => [
{
title: '',
value: '',
titleSpan: 4,
valueSpan: 4
}]
},
// title value
rowDataCount: {
type: Number,
default: 3
}
}
]
},
data() {
return {
data: []
}
},
watch: {
cellData: {
deep: true,
immediate: true,
handler(val) {
let totalSpan = 0;
for (var i = 0; i < val.length; i++) { // 24
if ((i + 1) % this.rowDataCount != 0) {
totalSpan = totalSpan + val[i].titleSpan + val[i].valueSpan
} else {
val[i].valueSpan = 24 - totalSpan - val[i].titleSpan;
totalSpan = 0;
}
// title value
rowDataCount: {
type: Number,
default: 3
}
},
data() {
return {
data: []
};
},
watch: {
cellData: {
deep: true,
immediate: true,
handler(val) {
let totalSpan = 0;
for (var i = 0; i < val.length; i++) {
// 24
if ((i + 1) % this.rowDataCount != 0) {
totalSpan = totalSpan + val[i].titleSpan + val[i].valueSpan;
} else {
val[i].valueSpan = 24 - totalSpan - val[i].titleSpan;
totalSpan = 0;
}
this.data = val;
// console.log(this.data)
}
this.data = val;
// console.log(this.data)
}
},
methods: {
///
doEmptyString(obj) {
let str = '/';
if (typeof(obj) == "undefined" || (obj) === null || (obj) === '') {
return str;
}
return obj + '';
}
},
methods: {
///
doEmptyString(obj) {
let str = '/';
if (typeof obj == 'undefined' || obj === null || obj === '' || obj === 'Na' || obj === 'N' || obj === '0') {
return str;
}
return obj + '';
}
}
};
</script>
<style scoped>
/* 标签样式 */
.titleStyle {
font-size: 12px;
color: #747474;
line-height: 50px;
height: 50px;
background: #F2F9FC;
text-align: center;
vertical-align: middle;
border-left: 1px solid #919191;
border-right: 1px solid #919191;
border-bottom: 1px solid #919191;
;
}
/* 标签样式 */
.titleStyle {
font-size: 10px;
color: #747474;
line-height: 30px;
height: 30px;
background: #f2f9fc;
text-align: center;
vertical-align: middle;
border-left: 1px solid #919191;
border-right: 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;
height: 50px;
font-weight: 500;
text-align: center;
vertical-align: middle;
border-bottom: 1px solid #919191;
text-overflow: ellipsis;
overflow: hidden;
}
</style>
/* 内容样式 */
.dataStyle {
font-size: 12px;
color: #00007f;
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: 10px;
color: #00007f;
line-height: 15px;
height: 30px;
font-weight: 500;
text-align: center;
vertical-align: middle;
border-bottom: 1px solid #919191;
text-overflow: ellipsis;
overflow: hidden;
}
</style>