fix: 功能完善修复。

This commit is contained in:
tianyongbao
2026-07-12 12:49:10 +08:00
parent aeb1e39920
commit cc1ccad308
25 changed files with 350 additions and 155 deletions

3
package-lock.json generated
View File

@@ -7,6 +7,7 @@
"": {
"name": "uni-preset-vue",
"version": "0.0.0",
"hasInstallScript": true,
"dependencies": {
"@dcloudio/uni-app": "3.0.0-4000820240401001",
"@dcloudio/uni-app-plus": "3.0.0-4000820240401001",
@@ -12490,7 +12491,7 @@
},
"node_modules/uview-plus": {
"version": "3.1.45",
"resolved": "https://registry.npmmirror.com/uview-plus/-/uview-plus-3.1.45.tgz",
"resolved": "https://registry.npmjs.org/uview-plus/-/uview-plus-3.1.45.tgz",
"integrity": "sha512-JHgLp2heaMciLdGimO/v4tMM8iwb2vTEOk6sXqn5X198AHjM5A/IGzH84GZPvUISFTEJbxGEHiGPxpv2K26AGw==",
"dependencies": {
"clipboard": "^2.0.11",

View File

@@ -39,7 +39,14 @@
"type-check": "vue-tsc --noEmit",
"clean:linux": "rm -rf dist || rm -rf node_modules",
"clean:windows": "rd /s /q dist || rd /s /q node_modules",
"postinstall": "node scripts/patch-u-input.js"
"patch:u-input": "node scripts/patch-u-input.js",
"postinstall": "node scripts/patch-u-input.js",
"predev:mp-weixin": "node scripts/patch-u-input.js",
"prebuild:mp-weixin": "node scripts/patch-u-input.js",
"predev:h5": "node scripts/patch-u-input.js",
"prebuild:h5": "node scripts/patch-u-input.js",
"predev:app": "node scripts/patch-u-input.js",
"prebuild:app": "node scripts/patch-u-input.js"
},
"dependencies": {
"@dcloudio/uni-app": "3.0.0-4000820240401001",

View File

@@ -2,10 +2,6 @@
* uView u-input 组件补丁
* 直接用预存的补丁文件覆盖原始文件
* 使下拉选择框readonly/disabled超长文字可自动换行完整显示
*
* 修改内容详见 scripts/u-input.vue已修改好的完整文件
*
* 通过 package.json 的 postinstall 自动执行
*/
const fs = require('fs');
const path = require('path');

View File

@@ -1,7 +1,7 @@
<template>
<view
class="u-input"
:class="[inputClass, isSelectLike ? 'u-input--selectlike' : '']"
:class="[inputClass, isSelectLike ? 'u-input--selectlike' : '', isSearchInput ? 'u-input--search-input' : '']"
:style="[wrapperStyle]"
>
<view class="u-input__content">
@@ -205,6 +205,14 @@ export default {
isSelectLike() {
return this.type === 'select' || this.disabled || this.readonly
},
isSearchInput() {
const customStyle = this.customStyle
if (typeof customStyle === 'string') {
return customStyle.includes('height: 66rpx') && customStyle.includes('border-radius: 24rpx')
}
const style = uni.$u.addStyle(customStyle)
return style.height === '66rpx' && (style.borderRadius === '24rpx' || style['border-radius'] === '24rpx')
},
// 是否显示清除控件
isShowClear() {
const { clearable, readonly, focused, innerValue } = this;
@@ -241,7 +249,15 @@ export default {
style.paddingLeft = "9px";
style.paddingRight = "9px";
}
return uni.$u.deepMerge(style, uni.$u.addStyle(this.customStyle));
const mergedStyle = uni.$u.deepMerge(style, uni.$u.addStyle(this.customStyle));
if (this.isSearchInput) {
mergedStyle.height = '66rpx';
mergedStyle.minHeight = '66rpx';
mergedStyle.boxSizing = 'border-box';
mergedStyle.paddingTop = '0';
mergedStyle.paddingBottom = '0';
}
return mergedStyle;
},
// 输入框的样式
inputStyle() {
@@ -354,18 +370,49 @@ export default {
flex: 1;
&--selectlike {
/* 覆盖 inline style 的固定 height让选择型模式高度自适应 */
/* 覆盖 inline style 的固定 height普通选择型内容可自适应换行 */
/* 短文字垂直居中,长文字撑开高度自动换行 */
height: auto !important;
min-height: 68rpx;
.u-input__content,
.u-input__content__field-wrapper,
/* 只让展示文本本身不抢事件,保留外层点击与 suffix 插槽事件 */
.u-input__content__field-wrapper__field {
pointer-events: none;
}
}
&--search-input {
/* 列表页顶部查询框必须同高;该 class 在组件内部计算,兼容小程序组件样式隔离 */
height: 66rpx !important;
min-height: 66rpx;
box-sizing: border-box;
padding-top: 0 !important;
padding-bottom: 0 !important;
.u-input__content,
.u-input__content__field-wrapper {
height: 100%;
align-items: center;
}
.u-input__content__field-wrapper__field--selectlike {
min-height: 0;
line-height: 32rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
word-break: normal;
}
.u-input__content__field-wrapper__field__text,
.u-input__content__field-wrapper__field__placeholder {
line-height: 32rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
&--radius,
&--square {
border-radius: 4px;

View File

@@ -19,9 +19,12 @@ export function login(username, password, code, uuid) {
}
// 获取用户详细信息
export function getInfo() {
export function getInfo(silentAuth = false) {
return request({
'url': '/system/user/getInfo',
headers: silentAuth ? {
silentAuth: true
} : undefined,
'method': 'get'
})
}

View File

@@ -3,7 +3,7 @@
<u-sticky offsetTop="0rpx" customNavHeight="0rpx">
<view class="search-container">
<view class="search-row">
<view class="search-input-wrapper">
<view class="search-input-wrapper" @click="handlePerson">
<u--input
v-model="queryParams.personName"
border="surround"
@@ -18,8 +18,7 @@
type="search"
size="18"
color="#667eea"
class="search-icon"
@click="handlePerson">
class="search-icon">
</uni-icons>
</view>
<view class="add-btn" @click="handleAdd()">
@@ -28,7 +27,7 @@
</view>
</view>
<view class="search-row">
<view class="search-input-wrapper">
<view class="search-input-wrapper" @click="handleHealthRecord">
<u--input
v-model="queryParams.healthRecordName"
border="surround"
@@ -43,8 +42,7 @@
type="search"
size="18"
color="#667eea"
class="search-icon"
@click="handleHealthRecord">
class="search-icon">
</uni-icons>
</view>
<view class="filter-btn" @click="filterPanel = !filterPanel">
@@ -63,24 +61,26 @@
:disabled="true"
:disabledColor="'#fff'"
class="dateInput"
@click="openOrCloseDate(true)"
border="surround"
v-model="queryParams.startTime"
placeholder="请选择开始时间"
>
<template v-slot:suffix>
<u-icon name="calendar" @click="openOrCloseDate(true)"></u-icon>
<u-icon name="calendar" @click.stop="openOrCloseDate(true)"></u-icon>
</template>
</u-input>
<u-input
:disabled="true"
:disabledColor="'#fff'"
class="dateInput"
@click="openOrCloseDate(false)"
border="surround"
v-model="queryParams.endTime"
placeholder="请选择结束时间"
>
<template v-slot:suffix>
<u-icon name="calendar" @click="openOrCloseDate(false)"></u-icon>
<u-icon name="calendar" @click.stop="openOrCloseDate(false)"></u-icon>
</template>
</u-input>
</view>
@@ -284,9 +284,13 @@ onLoad(() => {
function openOrCloseDate(data) {
timeShow.value = !timeShow.value
if (typeof data === 'boolean') {
flag.value = data
timeShow.value = true
} else {
timeShow.value = false
}
}
function dictStr(val, arr) {
let str = ''
arr.map(item => {

View File

@@ -2,7 +2,7 @@
<view class="container">
<u-sticky offsetTop="0rpx" customNavHeight="0rpx">
<view class="search-view">
<view class="search-input-wrapper">
<view class="search-input-wrapper" @click="handlePerson">
<u--input
v-model="queryParams.personName"
border="surround"
@@ -17,8 +17,7 @@
type="search"
size="18"
color="#667eea"
class="search-icon"
@click="handlePerson">
class="search-icon">
</uni-icons>
</view>
<view class="filter-btn" @click="filterPanel = !filterPanel">
@@ -44,24 +43,26 @@
:disabled="true"
:disabledColor="'#fff'"
class="dateInput"
@click="openOrCloseDate(true)"
border="surround"
v-model="queryParams.startTime"
placeholder="请选择开始时间"
>
<template v-slot:suffix>
<u-icon name="calendar" @click="openOrCloseDate(true)"></u-icon>
<u-icon name="calendar" @click.stop="openOrCloseDate(true)"></u-icon>
</template>
</u-input>
<u-input
:disabled="true"
:disabledColor="'#fff'"
class="dateInput"
@click="openOrCloseDate(false)"
border="surround"
v-model="queryParams.endTime"
placeholder="请选择结束时间"
>
<template v-slot:suffix>
<u-icon name="calendar" @click="openOrCloseDate(false)"></u-icon>
<u-icon name="calendar" @click.stop="openOrCloseDate(false)"></u-icon>
</template>
</u-input>
</view>
@@ -258,9 +259,13 @@ onLoad(() => {
}
function openOrCloseDate(data) {
timeShow.value = !timeShow.value
if (typeof data === 'boolean') {
flag.value = data
timeShow.value = true
} else {
timeShow.value = false
}
}
function loadmore() {
pageNum.value += 1
if (status.value == 'loadmore') {

View File

@@ -2,7 +2,7 @@
<view class="container">
<u-sticky offsetTop="0rpx" customNavHeight="0rpx">
<view class="search-view">
<view class="search-input-wrapper">
<view class="search-input-wrapper" @click="handlePerson">
<u--input
v-model="queryParams.personName"
border="surround"
@@ -17,8 +17,7 @@
type="search"
size="18"
color="#667eea"
class="search-icon"
@click="handlePerson">
class="search-icon">
</uni-icons>
</view>
<view class="filter-btn" @click="filterPanel = !filterPanel">
@@ -39,24 +38,26 @@
:disabled="true"
:disabledColor="'#fff'"
class="dateInput"
@click="openOrCloseDate(true)"
border="surround"
v-model="queryParams.startTime"
placeholder="请选择开始时间"
>
<template v-slot:suffix>
<u-icon name="calendar" @click="openOrCloseDate(true)"></u-icon>
<u-icon name="calendar" @click.stop="openOrCloseDate(true)"></u-icon>
</template>
</u-input>
<u-input
:disabled="true"
:disabledColor="'#fff'"
class="dateInput"
@click="openOrCloseDate(false)"
border="surround"
v-model="queryParams.endTime"
placeholder="请选择结束时间"
>
<template v-slot:suffix>
<u-icon name="calendar" @click="openOrCloseDate(false)"></u-icon>
<u-icon name="calendar" @click.stop="openOrCloseDate(false)"></u-icon>
</template>
</u-input>
</view>
@@ -190,9 +191,13 @@ onLoad(() => {
}
});
function openOrCloseDate(data) {
timeShow.value = !timeShow.value
if (typeof data === 'boolean') {
flag.value = data
timeShow.value = true
} else {
timeShow.value = false
}
}
function loadmore() {
pageNum.value += 1
if (status.value == 'loadmore') {

View File

@@ -3,7 +3,7 @@
<u-sticky offsetTop="0rpx" customNavHeight="0rpx">
<view class="search-container">
<view class="search-row">
<view class="search-input-wrapper">
<view class="search-input-wrapper" @click="handlePerson">
<u--input
v-model="queryParams.personName"
border="surround"
@@ -18,8 +18,7 @@
type="search"
size="18"
color="#667eea"
class="search-icon"
@click="handlePerson">
class="search-icon">
</uni-icons>
</view>
<view class="add-btn" @click="handleAdd()">
@@ -51,8 +50,8 @@
<view class="filter-panel" :style="{ height: `${windowHeight - 42}px` }">
<view class="filter-panel-content">
<view class="filter-title">健康档案</view>
<view class="health-record-input">
<u--input v-model="queryParams.healthRecordName" border="surround" type="select" @click="handleHealthRecord" placeholder="请选择健康档案"
<view class="health-record-input" @click="handleHealthRecord">
<u--input v-model="queryParams.healthRecordName" border="surround" type="select" placeholder="请选择健康档案"
suffixIcon="search" suffixIconStyle="color: #909399">
</u--input>
</view>
@@ -69,24 +68,26 @@
:disabled="true"
:disabledColor="'#fff'"
class="dateInput"
@click="openOrCloseDate(true)"
border="surround"
v-model="queryParams.startTime"
placeholder="请选择开始时间"
>
<template v-slot:suffix>
<u-icon name="calendar" @click="openOrCloseDate(true)"></u-icon>
<u-icon name="calendar" @click.stop="openOrCloseDate(true)"></u-icon>
</template>
</u-input>
<u-input
:disabled="true"
:disabledColor="'#fff'"
class="dateInput"
@click="openOrCloseDate(false)"
border="surround"
v-model="queryParams.endTime"
placeholder="请选择结束时间"
>
<template v-slot:suffix>
<u-icon name="calendar" @click="openOrCloseDate(false)"></u-icon>
<u-icon name="calendar" @click.stop="openOrCloseDate(false)"></u-icon>
</template>
</u-input>
</view>
@@ -284,9 +285,13 @@ onLoad(() => {
}
function openOrCloseDate(data) {
timeShow.value = !timeShow.value
if (typeof data === 'boolean') {
flag.value = data
timeShow.value = true
} else {
timeShow.value = false
}
}
function loadmore() {
pageNum.value += 1
if (status.value == 'loadmore') {

View File

@@ -36,24 +36,26 @@
:disabled="true"
:disabledColor="'#fff'"
class="dateInput"
@click="openOrCloseDate(true)"
border="surround"
v-model="queryParams.startTime"
placeholder="请选择开始时间"
>
<template v-slot:suffix>
<u-icon name="calendar" @click="openOrCloseDate(true)"></u-icon>
<u-icon name="calendar" @click.stop="openOrCloseDate(true)"></u-icon>
</template>
</u-input>
<u-input
:disabled="true"
:disabledColor="'#fff'"
class="dateInput"
@click="openOrCloseDate(false)"
border="surround"
v-model="queryParams.endTime"
placeholder="请选择结束时间"
>
<template v-slot:suffix>
<u-icon name="calendar" @click="openOrCloseDate(false)"></u-icon>
<u-icon name="calendar" @click.stop="openOrCloseDate(false)"></u-icon>
</template>
</u-input>
</view>
@@ -254,9 +256,13 @@ onLoad(() => {
}
function openOrCloseDate(data) {
timeShow.value = !timeShow.value
if (typeof data === 'boolean') {
flag.value = data
timeShow.value = true
} else {
timeShow.value = false
}
}
function loadmore() {
pageNum.value += 1
if (status.value == 'loadmore') {

View File

@@ -37,24 +37,26 @@
:disabled="true"
:disabledColor="'#fff'"
class="dateInput"
@click="openOrCloseDate(true)"
border="surround"
v-model="queryParams.startTime"
placeholder="请选择开始时间"
>
<template v-slot:suffix>
<u-icon name="calendar" @click="openOrCloseDate(true)"></u-icon>
<u-icon name="calendar" @click.stop="openOrCloseDate(true)"></u-icon>
</template>
</u-input>
<u-input
:disabled="true"
:disabledColor="'#fff'"
class="dateInput"
@click="openOrCloseDate(false)"
border="surround"
v-model="queryParams.endTime"
placeholder="请选择结束时间"
>
<template v-slot:suffix>
<u-icon name="calendar" @click="openOrCloseDate(false)"></u-icon>
<u-icon name="calendar" @click.stop="openOrCloseDate(false)"></u-icon>
</template>
</u-input>
</view>
@@ -239,9 +241,13 @@ onLoad(() => {
}
function openOrCloseDate(data) {
timeShow.value = !timeShow.value
if (typeof data === 'boolean') {
flag.value = data
timeShow.value = true
} else {
timeShow.value = false
}
}
function loadmore() {
pageNum.value += 1
if (status.value == 'loadmore') {

View File

@@ -2,7 +2,7 @@
<view class="container">
<u-sticky offsetTop="0rpx" customNavHeight="0rpx">
<view class="search-view">
<view class="search-input-wrapper">
<view class="search-input-wrapper" @click="handlePerson">
<u--input
v-model="queryParams.personName"
border="surround"
@@ -17,8 +17,7 @@
type="search"
size="18"
color="#667eea"
class="search-icon"
@click="handlePerson">
class="search-icon">
</uni-icons>
</view>
<view class="filter-btn" @click="filterPanel = !filterPanel">
@@ -38,24 +37,26 @@
:disabled="true"
:disabledColor="'#fff'"
class="dateInput"
@click="openOrCloseDate(true)"
border="surround"
v-model="queryParams.startTime"
placeholder="请选择开始时间"
>
<template v-slot:suffix>
<u-icon name="calendar" @click="openOrCloseDate(true)"></u-icon>
<u-icon name="calendar" @click.stop="openOrCloseDate(true)"></u-icon>
</template>
</u-input>
<u-input
:disabled="true"
:disabledColor="'#fff'"
class="dateInput"
@click="openOrCloseDate(false)"
border="surround"
v-model="queryParams.endTime"
placeholder="请选择结束时间"
>
<template v-slot:suffix>
<u-icon name="calendar" @click="openOrCloseDate(false)"></u-icon>
<u-icon name="calendar" @click.stop="openOrCloseDate(false)"></u-icon>
</template>
</u-input>
</view>
@@ -187,9 +188,13 @@ onLoad(() => {
}
});
function openOrCloseDate(data) {
timeShow.value = !timeShow.value
if (typeof data === 'boolean') {
flag.value = data
timeShow.value = true
} else {
timeShow.value = false
}
}
function loadmore() {
pageNum.value += 1
if (status.value == 'loadmore') {

View File

@@ -2,7 +2,7 @@
<view class="container">
<u-sticky offsetTop="0rpx" customNavHeight="0rpx">
<view class="search-view">
<view class="search-input-wrapper">
<view class="search-input-wrapper" @click="handlePerson">
<u--input
v-model="queryParams.personName"
border="surround"
@@ -17,8 +17,7 @@
type="search"
size="18"
color="#667eea"
class="search-icon"
@click="handlePerson">
class="search-icon">
</uni-icons>
</view>
<view class="filter-btn" @click="filterPanel = !filterPanel">
@@ -34,9 +33,9 @@
<view class="filter-panel" :style="{ height: `${windowHeight - 42}px` }">
<view class="filter-panel-content">
<view class="filter-title">健康档案</view>
<view class="health-record-input">
<view class="health-record-input" @click="handleHealthRecord">
<u--input v-model="queryParams.healthRecordName" border="surround" placeholder="请选择健康档案"
@click="handleHealthRecord" suffixIcon="search" suffixIconStyle="color: #909399">
suffixIcon="search" suffixIconStyle="color: #909399">
</u--input>
</view>
@@ -46,24 +45,26 @@
:disabled="true"
:disabledColor="'#fff'"
class="dateInput"
@click="openOrCloseDate(true)"
border="surround"
v-model="queryParams.startTime"
placeholder="请选择开始时间"
>
<template v-slot:suffix>
<u-icon name="calendar" @click="openOrCloseDate(true)"></u-icon>
<u-icon name="calendar" @click.stop="openOrCloseDate(true)"></u-icon>
</template>
</u-input>
<u-input
:disabled="true"
:disabledColor="'#fff'"
class="dateInput"
@click="openOrCloseDate(false)"
border="surround"
v-model="queryParams.endTime"
placeholder="请选择结束时间"
>
<template v-slot:suffix>
<u-icon name="calendar" @click="openOrCloseDate(false)"></u-icon>
<u-icon name="calendar" @click.stop="openOrCloseDate(false)"></u-icon>
</template>
</u-input>
</view>
@@ -213,9 +214,13 @@ onLoad(() => {
}
});
function openOrCloseDate(data) {
timeShow.value = !timeShow.value
if (typeof data === 'boolean') {
flag.value = data
timeShow.value = true
} else {
timeShow.value = false
}
}
function loadmore() {
pageNum.value += 1
if (status.value == 'loadmore') {

View File

@@ -2,7 +2,7 @@
<view class="container">
<u-sticky offsetTop="0rpx" customNavHeight="0rpx">
<view class="search-view">
<view class="search-input-wrapper">
<view class="search-input-wrapper" @click="handlePerson">
<u--input
v-model="queryParams.personName"
border="surround"
@@ -17,13 +17,12 @@
type="search"
size="18"
color="#667eea"
class="search-icon"
@click="handlePerson">
class="search-icon">
</uni-icons>
</view>
</view>
<view class="search-view">
<view class="search-input-wrapper">
<view class="search-input-wrapper" @click="handleHealthRecord">
<u--input
v-model="queryParams.healthRecordName"
border="surround"
@@ -38,8 +37,7 @@
type="search"
size="18"
color="#667eea"
class="search-icon"
@click="handleHealthRecord">
class="search-icon">
</uni-icons>
</view>
</view>
@@ -151,24 +149,26 @@
:disabled="true"
:disabledColor="'#fff'"
class="dateInput"
@click="openOrCloseDate(true)"
border="surround"
v-model="queryParams.startTime"
placeholder="请选择开始时间"
>
<template v-slot:suffix>
<u-icon name="calendar" @click="openOrCloseDate(true)"></u-icon>
<u-icon name="calendar" @click.stop="openOrCloseDate(true)"></u-icon>
</template>
</u-input>
<u-input
:disabled="true"
:disabledColor="'#fff'"
class="dateInput"
@click="openOrCloseDate(false)"
border="surround"
v-model="queryParams.endTime"
placeholder="请选择结束时间"
>
<template v-slot:suffix>
<u-icon name="calendar" @click="openOrCloseDate(false)"></u-icon>
<u-icon name="calendar" @click.stop="openOrCloseDate(false)"></u-icon>
</template>
</u-input>
</view>
@@ -260,7 +260,7 @@
</div> -->
<!-- 曲线图展示 -->
<view class="chart-container" v-if="listData.length>0 && viewMode === 'line'">
<view class="chart-container" v-if="chartVisible && listData.length>0 && viewMode === 'line'">
<qiun-data-charts
type="line"
canvasId="doctorLineChart"
@@ -273,7 +273,7 @@
</view>
<!-- 柱状图展示 -->
<view class="chart-container" v-if="listData.length>0 && viewMode === 'column'">
<view class="chart-container" v-if="chartVisible && listData.length>0 && viewMode === 'column'">
<qiun-data-charts
type="column"
canvasId="doctorColumnChart"
@@ -803,6 +803,7 @@ const { filterPanel, queryPersonParams, queryHealthRecordParams, queryParams} =
const windowHeight = computed(() => {
uni.getSystemInfoSync().windowHeight - 50
})
const chartVisible = computed(() => !filterPanel.value && !timeShow.value && !settingPickShow.value && !showPerson.value && !showHealthRecord.value)
onLoad(() => {
getDict()
// getList()
@@ -831,9 +832,13 @@ function dictStr(val, arr) {
return str
}
function openOrCloseDate(data) {
timeShow.value = !timeShow.value
if (typeof data === 'boolean') {
flag.value = data
timeShow.value = true
} else {
timeShow.value = false
}
}
function confirm(e) {
const date = timeHandler(new Date(e.value), '-', ':')
let formatValue = 'YYYY-MM-DD'

View File

@@ -46,7 +46,7 @@
</view>
<view class="chart-box tall">
<qiun-data-charts
v-if="hasChartData(trendChartData)"
v-if="chartVisible && hasChartData(trendChartData)"
type="line"
:canvasId="`${canvasIdPrefix}_trend`"
:chartData="trendChartData"
@@ -68,7 +68,7 @@
</view>
<view class="chart-box">
<qiun-data-charts
v-if="hasChartData(recordChartData)"
v-if="chartVisible && hasChartData(recordChartData)"
type="column"
:canvasId="`${canvasIdPrefix}_record`"
:chartData="recordChartData"
@@ -110,6 +110,7 @@
</view>
<view class="chart-box">
<qiun-data-charts
v-if="chartVisible"
type="ring"
:canvasId="`${canvasIdPrefix}_temp_ring`"
:chartData="temperatureRingData"
@@ -136,7 +137,7 @@
</view>
<view class="chart-box">
<qiun-data-charts
v-if="hasChartData(medicineChartData)"
v-if="chartVisible && hasChartData(medicineChartData)"
type="bar"
:canvasId="`${canvasIdPrefix}_medicine`"
:chartData="medicineChartData"
@@ -168,7 +169,7 @@
</view>
<view class="chart-box">
<qiun-data-charts
v-if="hasChartData(doctorCostChartData)"
v-if="chartVisible && hasChartData(doctorCostChartData)"
type="column"
:canvasId="`${canvasIdPrefix}_doctor`"
:chartData="doctorCostChartData"
@@ -208,7 +209,7 @@
</view>
<view class="chart-box">
<qiun-data-charts
v-if="hasChartData(activityChartData)"
v-if="chartVisible && hasChartData(activityChartData)"
type="mix"
:canvasId="`${canvasIdPrefix}_activity`"
:chartData="activityChartData"
@@ -288,6 +289,7 @@ const selectedPersonId = ref(null)
const screenData = ref({})
const dictMap = ref({})
const canvasIdPrefix = `h5_health_${Date.now()}`
const chartVisible = computed(() => !showPerson.value)
const summary = computed(() => screenData.value.summary || {})
const record = computed(() => screenData.value.record || {})

View File

@@ -2,7 +2,7 @@
<view class="container">
<u-sticky offsetTop="0rpx" customNavHeight="0rpx">
<view class="search-view">
<view class="search-input-wrapper">
<view class="search-input-wrapper" @click="handlePerson">
<u--input
v-model="queryParams.personName"
border="surround"
@@ -17,13 +17,12 @@
type="search"
size="18"
color="#667eea"
class="search-icon"
@click="handlePerson">
class="search-icon">
</uni-icons>
</view>
</view>
<view class="search-view">
<view class="search-input-wrapper">
<view class="search-input-wrapper" @click="handleHealthRecord">
<u--input
v-model="queryParams.healthRecordName"
border="surround"
@@ -38,8 +37,7 @@
type="search"
size="18"
color="#667eea"
class="search-icon"
@click="handleHealthRecord">
class="search-icon">
</uni-icons>
</view>
</view>
@@ -216,24 +214,26 @@
:disabled="true"
:disabledColor="'#fff'"
class="dateInput"
@click="openOrCloseDate(true)"
border="surround"
v-model="queryParams.startTime"
placeholder="请选择开始时间"
>
<template v-slot:suffix>
<u-icon name="calendar" @click="openOrCloseDate(true)"></u-icon>
<u-icon name="calendar" @click.stop="openOrCloseDate(true)"></u-icon>
</template>
</u-input>
<u-input
:disabled="true"
:disabledColor="'#fff'"
class="dateInput"
@click="openOrCloseDate(false)"
border="surround"
v-model="queryParams.endTime"
placeholder="请选择结束时间"
>
<template v-slot:suffix>
<u-icon name="calendar" @click="openOrCloseDate(false)"></u-icon>
<u-icon name="calendar" @click.stop="openOrCloseDate(false)"></u-icon>
</template>
</u-input>
</view>
@@ -264,7 +264,7 @@
></u-datetime-picker>
<!-- 曲线图展示 -->
<view class="chart-container" v-if="secondListData.length>0 && viewMode === 'line'">
<view class="chart-container" v-if="chartVisible && secondListData.length>0 && viewMode === 'line'">
<qiun-data-charts
type="line"
canvasId="healthLineChart"
@@ -277,7 +277,7 @@
</view>
<!-- 柱状图展示 -->
<view class="chart-container" v-if="secondListData.length>0 && viewMode === 'column'">
<view class="chart-container" v-if="chartVisible && secondListData.length>0 && viewMode === 'column'">
<qiun-data-charts
type="column"
canvasId="healthColumnChart"
@@ -657,6 +657,7 @@ const { filterPanel, queryPersonParams,queryHealthRecordParams, queryParams} = t
const windowHeight = computed(() => {
uni.getSystemInfoSync().windowHeight - 50
})
const chartVisible = computed(() => !filterPanel.value && !timeShow.value && !settingPickShow.value && !showPerson.value && !showHealthRecord.value)
onLoad(() => {
getDict()
// getList()
@@ -688,9 +689,13 @@ if (data != null) {
}
}
function openOrCloseDate(data) {
timeShow.value = !timeShow.value
if (typeof data === 'boolean') {
flag.value = data
timeShow.value = true
} else {
timeShow.value = false
}
}
function confirm(e) {
const date = timeHandler(new Date(e.value), '-', ':')
let formatValue = 'YYYY-MM-DD'

View File

@@ -2,7 +2,7 @@
<view class="container">
<u-sticky offsetTop="0rpx" customNavHeight="0rpx">
<view class="search-view">
<view class="search-input-wrapper">
<view class="search-input-wrapper" @click="handlePerson">
<u--input
v-model="queryParams.personName"
border="surround"
@@ -17,13 +17,12 @@
type="search"
size="18"
color="#667eea"
class="search-icon"
@click="handlePerson">
class="search-icon">
</uni-icons>
</view>
</view>
<view class="search-view">
<view class="search-input-wrapper">
<view class="search-input-wrapper" @click="handleHealthRecord">
<u--input
v-model="queryParams.healthRecordName"
border="surround"
@@ -38,8 +37,7 @@
type="search"
size="18"
color="#667eea"
class="search-icon"
@click="handleHealthRecord">
class="search-icon">
</uni-icons>
</view>
</view>
@@ -68,7 +66,8 @@
</view>
</view>
<view class="app-container">
<scroll-view class="summary-scroll" scroll-y :style="{ height: summaryScrollHeight }">
<view class="app-container">
<view class="header-con" ref="searchHeightRef">
<view class="item">
<view class="item-icon" style="background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);">
@@ -270,6 +269,7 @@
</view>
</view>
</view>
</scroll-view>
<!-- 视图切换 -->
<view class="section-title" v-show="listData.length>0">
@@ -311,24 +311,26 @@
:disabled="true"
:disabledColor="'#fff'"
class="dateInput"
@click="openOrCloseDate(true)"
border="surround"
v-model="queryParams.startTime"
placeholder="请选择开始时间"
>
<template v-slot:suffix>
<u-icon name="calendar" @click="openOrCloseDate(true)"></u-icon>
<u-icon name="calendar" @click.stop="openOrCloseDate(true)"></u-icon>
</template>
</u-input>
<u-input
:disabled="true"
:disabledColor="'#fff'"
class="dateInput"
@click="openOrCloseDate(false)"
border="surround"
v-model="queryParams.endTime"
placeholder="请选择结束时间"
>
<template v-slot:suffix>
<u-icon name="calendar" @click="openOrCloseDate(false)"></u-icon>
<u-icon name="calendar" @click.stop="openOrCloseDate(false)"></u-icon>
</template>
</u-input>
</view>
@@ -358,7 +360,7 @@
></u-datetime-picker>
<!-- 曲线图展示 -->
<view class="chart-container" v-if="listData.length>0 && viewMode === 'line'">
<view class="chart-container" v-if="chartVisible && listData.length>0 && viewMode === 'line'">
<qiun-data-charts
type="line"
canvasId="marLineChart"
@@ -371,7 +373,7 @@
</view>
<!-- 柱状图展示 -->
<view class="chart-container" v-if="listData.length>0 && viewMode === 'column'">
<view class="chart-container" v-if="chartVisible && listData.length>0 && viewMode === 'column'">
<qiun-data-charts
type="column"
canvasId="marColumnChart"
@@ -476,6 +478,21 @@ const timeShow= ref(false)
const time =ref( Number(new Date()))
const flag= ref(true)
const mar = ref({})
const summaryRowCount = computed(() => {
const hasValue = (key) => mar.value[key] != null
const dynamicRows = [
['top2Name', 'top3Name'],
['top4Name', 'top5Name'],
['top6Name', 'top7Name'],
['top8Name', 'top9Name'],
['top10Name', 'top11Name'],
['top12Name', 'top13Name'],
['top14Name', 'top15Name'],
['top16Name', 'top17Name']
].filter(([left, right]) => hasValue(left) || hasValue(right)).length
return 2 + dynamicRows
})
const summaryScrollHeight = computed(() => `${Math.min(summaryRowCount.value * 120, 480)}rpx`)
const tabShow = ref(false)
const viewMode = ref('list') // 'list', 'line', 'column'
@@ -687,6 +704,7 @@ const { filterPanel, queryPersonParams,queryHealthRecordParams, queryParams} = t
const windowHeight = computed(() => {
uni.getSystemInfoSync().windowHeight - 50
})
const chartVisible = computed(() => !filterPanel.value && !timeShow.value && !settingPickShow.value && !showPerson.value && !showHealthRecord.value)
onLoad(() => {
getDict()
// getList()
@@ -718,9 +736,13 @@ if (data != null) {
}
}
function openOrCloseDate(data) {
timeShow.value = !timeShow.value
if (typeof data === 'boolean') {
flag.value = data
timeShow.value = true
} else {
timeShow.value = false
}
}
function confirm(e) {
const date = timeHandler(new Date(e.value), '-', ':')
let formatValue = 'YYYY-MM-DD'
@@ -858,6 +880,12 @@ page {
height: 100%;
overflow: auto;
}
.summary-scroll {
width: 100%;
background-color: #f5f7fa;
flex-shrink: 0;
overflow: hidden;
}
.app-container {
background-color: #f5f7fa;
padding: 0;

View File

@@ -2,7 +2,7 @@
<view class="container">
<u-sticky offsetTop="0rpx" customNavHeight="0rpx">
<view class="search-view">
<view class="search-input-wrapper">
<view class="search-input-wrapper" @click="handlePerson">
<u--input
v-model="queryParams.personName"
border="surround"
@@ -17,8 +17,7 @@
type="search"
size="18"
color="#667eea"
class="search-icon"
@click="handlePerson">
class="search-icon">
</uni-icons>
</view>
</view>
@@ -190,24 +189,26 @@
:disabled="true"
:disabledColor="'#fff'"
class="dateInput"
@click="openOrCloseDate(true)"
border="surround"
v-model="queryParams.startTime"
placeholder="请选择开始时间"
>
<template v-slot:suffix>
<u-icon name="calendar" @click="openOrCloseDate(true)"></u-icon>
<u-icon name="calendar" @click.stop="openOrCloseDate(true)"></u-icon>
</template>
</u-input>
<u-input
:disabled="true"
:disabledColor="'#fff'"
class="dateInput"
@click="openOrCloseDate(false)"
border="surround"
v-model="queryParams.endTime"
placeholder="请选择结束时间"
>
<template v-slot:suffix>
<u-icon name="calendar" @click="openOrCloseDate(false)"></u-icon>
<u-icon name="calendar" @click.stop="openOrCloseDate(false)"></u-icon>
</template>
</u-input>
</view>
@@ -238,7 +239,7 @@
></u-datetime-picker>
<!-- 曲线图展示 -->
<view class="chart-container" v-if="listData.length>0 && viewMode === 'line'">
<view class="chart-container" v-if="chartVisible && listData.length>0 && viewMode === 'line'">
<qiun-data-charts
type="line"
canvasId="milkLineChart"
@@ -251,7 +252,7 @@
</view>
<!-- 柱状图展示 -->
<view class="chart-container" v-if="listData.length>0 && viewMode === 'column'">
<view class="chart-container" v-if="chartVisible && listData.length>0 && viewMode === 'column'">
<qiun-data-charts
type="column"
canvasId="milkColumnChart"
@@ -519,6 +520,7 @@ const { filterPanel, queryPersonParams, queryParams} = toRefs(data)
const windowHeight = computed(() => {
uni.getSystemInfoSync().windowHeight - 50
})
const chartVisible = computed(() => !filterPanel.value && !timeShow.value && !settingPickShow.value && !showPerson.value)
onLoad(() => {
getDict()
// getList()
@@ -538,9 +540,13 @@ if (data != null) {
}
}
function openOrCloseDate(data) {
timeShow.value = !timeShow.value
if (typeof data === 'boolean') {
flag.value = data
timeShow.value = true
} else {
timeShow.value = false
}
}
function confirm(e) {
const date = timeHandler(new Date(e.value), '-', ':')
let formatValue = 'YYYY-MM-DD'

View File

@@ -95,7 +95,7 @@
</view>
<view class="chart-box tall">
<qiun-data-charts
v-if="hasChartData(temperatureChartData)"
v-if="chartVisible && hasChartData(temperatureChartData)"
type="line"
:canvasId="`${canvasIdPrefix}_temp`"
:chartData="temperatureChartData"
@@ -117,6 +117,7 @@
</view>
<view class="chart-box">
<qiun-data-charts
v-if="chartVisible"
type="ring"
:canvasId="`${canvasIdPrefix}_mix`"
:chartData="recordMixChartData"
@@ -152,7 +153,7 @@
</view>
<view class="chart-box">
<qiun-data-charts
v-if="hasChartData(medicineChartData)"
v-if="chartVisible && hasChartData(medicineChartData)"
type="bar"
:canvasId="`${canvasIdPrefix}_medicine`"
:chartData="medicineChartData"
@@ -184,7 +185,7 @@
</view>
<view class="chart-box">
<qiun-data-charts
v-if="hasChartData(doctorCostChartData)"
v-if="chartVisible && hasChartData(doctorCostChartData)"
type="column"
:canvasId="`${canvasIdPrefix}_doctor`"
:chartData="doctorCostChartData"
@@ -293,6 +294,7 @@ const screenData = ref({})
const activeTab = ref('process')
const dictMap = ref({})
const canvasIdPrefix = `h5_record_${Date.now()}`
const chartVisible = computed(() => !showPerson.value && !showRecord.value)
const record = computed(() => screenData.value.record || {})
const summary = computed(() => screenData.value.summary || {})

View File

@@ -2,7 +2,7 @@
<view class="container">
<u-sticky offsetTop="0rpx" customNavHeight="0rpx">
<view class="search-view">
<view class="search-input-wrapper">
<view class="search-input-wrapper" @click="handlePerson">
<u--input
v-model="queryParams.personName"
border="surround"
@@ -17,13 +17,12 @@
type="search"
size="18"
color="#667eea"
class="search-icon"
@click="handlePerson">
class="search-icon">
</uni-icons>
</view>
</view>
<view class="search-view">
<view class="search-input-wrapper">
<view class="search-input-wrapper" @click="handleHealthRecord">
<u--input
v-model="queryParams.healthRecordName"
border="surround"
@@ -38,8 +37,7 @@
type="search"
size="18"
color="#667eea"
class="search-icon"
@click="handleHealthRecord">
class="search-icon">
</uni-icons>
</view>
</view>
@@ -192,24 +190,26 @@
:disabled="true"
:disabledColor="'#fff'"
class="dateInput"
@click="openOrCloseDate(true)"
border="surround"
v-model="queryParams.startTime"
placeholder="请选择开始时间"
>
<template v-slot:suffix>
<u-icon name="calendar" @click="openOrCloseDate(true)"></u-icon>
<u-icon name="calendar" @click.stop="openOrCloseDate(true)"></u-icon>
</template>
</u-input>
<u-input
:disabled="true"
:disabledColor="'#fff'"
class="dateInput"
@click="openOrCloseDate(false)"
border="surround"
v-model="queryParams.endTime"
placeholder="请选择结束时间"
>
<template v-slot:suffix>
<u-icon name="calendar" @click="openOrCloseDate(false)"></u-icon>
<u-icon name="calendar" @click.stop="openOrCloseDate(false)"></u-icon>
</template>
</u-input>
</view>
@@ -240,7 +240,7 @@
></u-datetime-picker>
<!-- 曲线图展示 -->
<view class="chart-container" v-if="hasSecondListData && viewMode === 'line'">
<view class="chart-container" v-if="chartVisible && hasSecondListData && viewMode === 'line'">
<qiun-data-charts
type="line"
:canvasId="canvasIdPrefix + '_line'"
@@ -253,7 +253,7 @@
</view>
<!-- 柱状图展示 -->
<view class="chart-container" v-if="hasSecondListData && viewMode === 'column'">
<view class="chart-container" v-if="chartVisible && hasSecondListData && viewMode === 'column'">
<qiun-data-charts
type="column"
:canvasId="canvasIdPrefix + '_column'"
@@ -634,6 +634,7 @@ uni.getSystemInfo({
windowHeight.value = res.windowHeight - 50
}
})
const chartVisible = computed(() => !filterPanel.value && !timeShow.value && !settingPickShow.value && !showPerson.value && !showHealthRecord.value)
onLoad(() => {
getDict()
// getList()
@@ -666,9 +667,13 @@ if (data != null) {
}
}
function openOrCloseDate(data) {
timeShow.value = !timeShow.value
if (typeof data === 'boolean') {
flag.value = data
timeShow.value = true
} else {
timeShow.value = false
}
}
function confirm(e) {
const date = timeHandler(new Date(e.value), '-', ':')
let formatValue = 'YYYY-MM-DD'

View File

@@ -3,7 +3,7 @@
<u-sticky offsetTop="0rpx" customNavHeight="0rpx">
<view class="search-container">
<view class="search-row">
<view class="search-input-wrapper">
<view class="search-input-wrapper" @click="handlePerson">
<u--input
v-model="queryParams.personName"
border="surround"
@@ -18,8 +18,7 @@
type="search"
size="18"
color="#667eea"
class="search-icon"
@click="handlePerson">
class="search-icon">
</uni-icons>
</view>
<view class="add-btn" @click="handleAdd()">
@@ -28,7 +27,7 @@
</view>
</view>
<view class="search-row">
<view class="search-input-wrapper">
<view class="search-input-wrapper" @click="handleHealthRecord">
<u--input
v-model="queryParams.healthRecordName"
border="surround"
@@ -43,8 +42,7 @@
type="search"
size="18"
color="#667eea"
class="search-icon"
@click="handleHealthRecord">
class="search-icon">
</uni-icons>
</view>
<view class="filter-btn" @click="filterPanel = !filterPanel">
@@ -63,24 +61,26 @@
:disabled="true"
:disabledColor="'#fff'"
class="dateInput"
@click="openOrCloseDate(true)"
border="surround"
v-model="queryParams.startTime"
placeholder="请选择开始时间"
>
<template v-slot:suffix>
<u-icon name="calendar" @click="openOrCloseDate(true)"></u-icon>
<u-icon name="calendar" @click.stop="openOrCloseDate(true)"></u-icon>
</template>
</u-input>
<u-input
:disabled="true"
:disabledColor="'#fff'"
class="dateInput"
@click="openOrCloseDate(false)"
border="surround"
v-model="queryParams.endTime"
placeholder="请选择结束时间"
>
<template v-slot:suffix>
<u-icon name="calendar" @click="openOrCloseDate(false)"></u-icon>
<u-icon name="calendar" @click.stop="openOrCloseDate(false)"></u-icon>
</template>
</u-input>
</view>
@@ -227,9 +227,13 @@ onLoad(() => {
}
});
function openOrCloseDate(data) {
timeShow.value = !timeShow.value
if (typeof data === 'boolean') {
flag.value = data
timeShow.value = true
} else {
timeShow.value = false
}
}
function loadmore() {
pageNum.value += 1
if (status.value == 'loadmore') {

View File

@@ -9,8 +9,8 @@
<text class="app-subtitle">专业的健康管理工具</text>
</view>
<!-- 登录表单卡片 -->
<view class="form-card">
<!-- 登录表单卡片token 静默校验期间不展示任何提示 -->
<view v-if="!checkingToken" class="form-card">
<!-- 账号输入 -->
<view class="input-item">
<uni-icons type="person" size="20" color="#E8841A"></uni-icons>
@@ -82,7 +82,7 @@ import config from '@/config.js'
import useUserStore from '@/store/modules/user'
import { getWxCode } from '@/utils/geek';
import { wxLogin } from '@/api/oauth';
import { setToken } from '@/utils/auth';
import { getToken, setToken } from '@/utils/auth';
import { encrypt, decrypt } from '@/utils/jsencrypt'
// ========== 平台判断(条件编译)==========
@@ -101,6 +101,7 @@ const useWxLogin = ref(false); // 是否使用微信登录
const globalConfig = ref(config);
const agree = ref(isH5 ? true : false); // H5 端默认勾选同意协议
const rememberPwd = ref(false); // 记住密码
const checkingToken = ref(true); // 是否正在校验本地 token
const loginForm = ref({
username: "",
password: "",
@@ -119,11 +120,31 @@ if (useWxLogin.value) {
});
})
}
// 页面加载时检查是否记住了密码
// 页面加载时先校验本地 token仍有效则直接进入系统无效时再显示账号密码登录
onMounted(() => {
loadRememberedLogin()
initLoginPage()
});
async function initLoginPage() {
const token = getToken()
if (token) {
checkingToken.value = true
try {
await userStore.getInfo(true)
goHome()
return
} catch (error) {
if (error && error.code === 401) {
userStore.resetToken()
}
}
}
checkingToken.value = false
loadRememberedLogin()
getCode()
}
// 读取本地记住的登录信息(仅 H5
function loadRememberedLogin() {
if (!isH5) return
@@ -209,12 +230,16 @@ async function pwdLogin() {
function loginSuccess(result) {
// 设置用户信息
userStore.getInfo().then(res => {
uni.switchTab({
url: '/pages/health/homepage/index'
});
goHome()
})
}
function goHome() {
uni.switchTab({
url: '/pages/health/homepage/index'
});
}
function agreeChange(){
agree.value = !agree.value;
}
@@ -244,7 +269,6 @@ function handleUserAgrement() {
url: '/pages/common/agreement/index'
});
};
getCode();
</script>
<style lang="scss" scoped>

View File

@@ -40,9 +40,9 @@ const useUserStore = defineStore("user", {
});
},
// 获取用户信息
getInfo() {
getInfo(silentAuth = false) {
return new Promise((resolve, reject) => {
getInfo()
getInfo(silentAuth)
.then((res: any) => {
const user = res.user;
const avatar =
@@ -86,6 +86,16 @@ const useUserStore = defineStore("user", {
});
});
},
// 清理本地登录状态,不调用后端退出接口(用于本地 token 校验失败)
resetToken() {
this.token = "";
this.roles = [];
this.permissions = [];
this.name = "";
this.userId = "";
this.avatar = "";
removeToken();
},
},
persist: {
key: 'user-store',

View File

@@ -1,7 +1,9 @@
interface BaseRequestConfig {
headers?: {
/** 是否在请求头中添加token 默认是 */
isToken: boolean
isToken?: boolean,
/** token 失效时是否静默返回错误,不弹重新登录确认框 */
silentAuth?: boolean
},
/** 请求头配置 */
header?: any,

View File

@@ -9,8 +9,10 @@ let timeout = 10000
const baseUrl = config.baseUrl
const request = <T>(config: RequestConfig): Promise<ResponseData<T>> => {
const metaHeaders = config.headers || {}
// 是否需要设置 token
const isToken = (config.headers || {}).isToken === false
const isToken = metaHeaders.isToken === false
const silentAuth = metaHeaders.silentAuth === true
config.header = config.header || {}
if (getToken() && !isToken) {
config.header['Authorization'] = 'Bearer ' + getToken()
@@ -42,20 +44,23 @@ const request = <T>(config: RequestConfig): Promise<ResponseData<T>> => {
// @ts-ignore
const msg: string = errorCode[code] || data.msg || errorCode['default']
if (code === 401) {
showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
if (res.confirm) {
useUserStore().logOut().then(res => {
uni.reLaunch({ url: '/pages/login' })
})
}
})
reject('无效的会话,或者会话已过期,请重新登录。')
const authError = { code: 401, msg: '无效的会话,或者会话已过期,请重新登录' }
if (!silentAuth) {
showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
if (res.confirm) {
useUserStore().logOut().then(res => {
uni.reLaunch({ url: '/pages/login' })
})
}
})
}
return reject(silentAuth ? authError : authError.msg)
} else if (code === 500) {
toast(msg)
reject('500')
return reject('500')
} else if (code !== 200) {
toast(msg)
reject(code)
return reject(code)
}
resolve(data)
})
@@ -68,7 +73,9 @@ const request = <T>(config: RequestConfig): Promise<ResponseData<T>> => {
} else if (message.includes('Request failed with status code')) {
message = '系统接口' + message.substr(message.length - 3) + '异常'
}
toast(message)
if (!silentAuth) {
toast(message)
}
reject(error)
})
})