页面刷新

This commit is contained in:
xiaoxiao
2025-07-30 17:30:56 +08:00
parent 1e99ff4dfa
commit 69a4ca17e8
18 changed files with 246 additions and 103 deletions
+1 -1
View File
@@ -16,6 +16,6 @@ export { PatientDetailsComp } from './src/main/ets/components/PatientDetailsComp
export { GroupManagementComp } from './src/main/ets/components/GroupManagementComp'
export { MassSendingComp } from './src/main/ets/components/MassSendingComp'
export { GroupMessageSendingComp } from './src/main/ets/components/GroupMessageSendingComp'
export { FollowPlanListComp } from './src/main/ets/components/FollowPlanListComp'
@@ -7,16 +7,25 @@ import {
import { isDate } from "@nimsdk/vendor";
import { promptAction } from "@kit.ArkUI";
import { BusinessError } from "@kit.BasicServicesKit";
import { patientListModel } from "../models/PatientsGroupModel";
@HMRouter({ pageUrl:'AddFollowPlanComp' })
@Component
export struct AddFollowPlanComp {
scroller:Scroller = new Scroller()
private params: ESObject = HMRouterMgr.getCurrentParam()
@State name:string = ChangeUtil.stringIsUndefinedAndNull(this.params.nickname)?String(this.params.realName):String(this.params.nickname)
@State name:string = ChangeUtil.stringIsUndefinedAndNull(this.params.nickname)?ChangeUtil.stringIsUndefinedAndNull(this.params.realName)?'请选择患者':String(this.params.realName):String(this.params.nickname)
@State followList:Array<Record<string,string>> = [{"content":"请于近日来院复诊、复查","time":"请选择时间","date":String(new Date)},{"content":"请于近日来院复诊、复查","time":"请选择时间","date":String(new Date)},{"content":"请于近日来院复诊、复查","time":"请选择时间","date":String(new Date)},{"content":"请于近日来院复诊、复查","time":"请选择时间","date":String(new Date)}]
@State isNotiMe:boolean = false
@State isNotiPa:boolean = false
@State patient_uuid:string = this.params.patientUuid
@State page:string = '个人'
aboutToAppear(): void {
if (this.name == '请选择患者') {//页面标识
this.page = '列表'
}
}
dialog: CustomDialogController = new CustomDialogController({
builder: HdLoadingDialog({ message: '加载中...' }),
@@ -39,7 +48,7 @@ export struct AddFollowPlanComp {
.join('☆');
const entity = {
"expert_uuid": authStore.getUser().uuid,
"patient_uuid": this.params.patientUuid,
"patient_uuid": this.patient_uuid,
"datetime":timeStr,
"note":noteStr,
"type":"2",
@@ -81,7 +90,34 @@ export struct AddFollowPlanComp {
.layoutWeight(1)
Text(this.name)
.fontSize(15)
.width('50%')
.textAlign(TextAlign.End)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.maxLines(1)
.margin({ right: 10 })
.onClick(()=>{
if (this.page == '列表') {
HMRouterMgr.push({pageUrl:'PatientsListComp',
param:{group_uuid:"",selectedPatients:[]}
},{
onResult:(popInfo:HMPopInfo)=>{
if (popInfo && popInfo.result && popInfo.result["selectedPatients"] !== undefined) {
const patients = popInfo.result["selectedPatients"] as patientListModel[]
const patientsList:patientListModel[] = []
if (patients?.length) {
for (const model of patients) {
if (model.isSelected) {
patientsList.push(model)
this.name = this.converNameToString(patientsList)
this.patient_uuid = this.converUuidToString(patientsList)
}
}
}
}
}
})
}
})
}
.width('100%')
.height(40)
@@ -244,4 +280,24 @@ export struct AddFollowPlanComp {
}
});
}
converNameToString(patients:patientListModel[]):string {
if (!patients?.length) return '[]';
const nameList = patients
.map(patient => {
return patient.nickname || patient.realname || patient.realName || ''
})
.filter(name => name.trim() !== '')
return nameList.join(',')
}
converUuidToString(patients:patientListModel[]):string {
if (!patients?.length) return '[]';
const nameList = patients
.map(patient => {
return patient.uuid || ''
})
.filter(name => name.trim() !== '')
return nameList.join(',')
}
}
@@ -13,12 +13,20 @@ export struct AddScheduleFollowComp {
scroller:Scroller = new Scroller()
controller:TextAreaController = new TextAreaController()
private params: ESObject = HMRouterMgr.getCurrentParam()
@State name:string = ChangeUtil.stringIsUndefinedAndNull(this.params.nickname)?String(this.params.realName):String(this.params.nickname)
@State name:string = ChangeUtil.stringIsUndefinedAndNull(this.params.nickname)?ChangeUtil.stringIsUndefinedAndNull(this.params.realName)?'请选择患者':String(this.params.realName):String(this.params.nickname)
@State note:string = '请于近日来院复诊、复查'
@State date:string = ''
@State time:string = '请选择日期'
@State isNotiMe:boolean = false
@State isNotiPa:boolean = false
@State patient_uuid:string = this.params.patientUuid
@State page:string = '个人'
aboutToAppear(): void {
if (this.name == '请选择患者') {//页面标识
this.page = '列表'
}
}
dialog: CustomDialogController = new CustomDialogController({
builder: HdLoadingDialog({ message: '加载中...' }),
@@ -37,7 +45,7 @@ export struct AddScheduleFollowComp {
}
const entity = {
"expert_uuid": authStore.getUser().uuid,
"patient_uuid": this.params.patientUuid,
"patient_uuid": this.patient_uuid,
"datetime":this.date,
"note":this.note,
"type":"1",
@@ -78,8 +86,22 @@ export struct AddScheduleFollowComp {
.margin({ left: 10 })
.layoutWeight(1)
Text(this.name)
.width('50%')
.textAlign(TextAlign.End)
.fontSize(15)
.margin({ right: 10 })
.onClick(()=>{
if (this.page == '列表') {
HMRouterMgr.push({pageUrl:'PatientsListSearchComp',param:{"name":"随访计划"}},{
onResult: (popInfo: HMPopInfo) => {
if (popInfo && popInfo.result && popInfo.result["patient_uuid"] !== undefined) {
this.name = ChangeUtil.stringIsUndefinedAndNull(popInfo.result["nickname"])?String(popInfo.result["realName"]):String(popInfo.result["nickname"])
this.patient_uuid = popInfo.result["patient_uuid"]
}
}
})
}
})
}
.width('100%')
.height(40)
@@ -256,7 +256,7 @@ export struct FollowPlanListComp {
"uuid":this.uuid,
"patientUuid":this.patientUuid,
"nickname":this.nickname,
"realName":this.realName
"realName":this.realName,
}},{
onResult:(popInfo:HMPopInfo)=>{
if (popInfo && popInfo.result && popInfo.result["isRefresh"] !== undefined) {
@@ -6,18 +6,27 @@ import { HashMap,JSON } from "@kit.ArkTS";
import { BusinessError } from "@kit.BasicServicesKit";
import { promptAction, router } from "@kit.ArkUI";
import { PullToRefreshLayout, RefreshController } from "refreshlib";
import { HMPopInfo, HMRouterMgr } from "@hadss/hmrouter";
import { HMLifecycleState, HMPopInfo, HMRouterMgr } from "@hadss/hmrouter";
@Component
export struct MassSendingComp {
export struct GroupMessageSendingComp {
@State pageNumber: number = 1
@State totalPage: number = 1
scroller = new Scroller()
@State messageList: ApiItem[] = []
public controller: RefreshController = new RefreshController()
private lifecycleOwner = HMRouterMgr.getCurrentLifecycleOwner()
private handleCallback = () => {
this.initGetGroupListAction()
}
aboutToAppear(): void {
this.initGetGroupListAction()
this.lifecycleOwner?.addObserver(HMLifecycleState.onShown,this.handleCallback)
}
aboutToDisappear(): void {
this.lifecycleOwner?.removeObserver(HMLifecycleState.onShown,this.handleCallback)
}
initGetGroupListAction() {
@@ -1,4 +1,4 @@
import { HMPopInfo, HMRouter, HMRouterMgr } from "@hadss/hmrouter"
import { HMLifecycleState, HMPopInfo, HMRouter, HMRouterMgr } from "@hadss/hmrouter"
import { BasicConstant, hdHttp, HdNav, HdLoadingDialog, logger, HdResponse, ChangeUtil,
DefaultHintProWindows,
authStore,
@@ -12,6 +12,10 @@ import { BusinessError } from "@kit.BasicServicesKit";
@Component
export struct PatientCommonSettingComp {
private params: ESObject = HMRouterMgr.getCurrentParam()
private lifecycleOwner = HMRouterMgr.getCurrentLifecycleOwner()
private handleCallback = () => {
this.getPatientsInfo()
}
@State itemList:Record<string,string> = {}
scroller:Scroller = new Scroller()
private hintWindowDialog!: CustomDialogController
@@ -45,6 +49,11 @@ export struct PatientCommonSettingComp {
aboutToAppear(): void {
this.getPatientsInfo()
this.hintPopWindowDialog()
this.lifecycleOwner?.addObserver(HMLifecycleState.onShown,this.handleCallback)
}
aboutToDisappear(): void {
this.lifecycleOwner?.removeObserver(HMLifecycleState.onShown,this.handleCallback)
}
getPatientsInfo() {
@@ -190,8 +199,9 @@ export struct PatientCommonSettingComp {
.margin({ left: 15 })
.layoutWeight(1)
Text(ChangeUtil.stringIsUndefinedAndNull(this.itemList.groupType) ? '通过分组给患者分类' : this.itemList.groupType)
.width('50%')
.width('60%')
.textAlign(TextAlign.End)
.maxLines(1)
.margin({ right: 10 })
.fontSize(15)
.fontColor('#666666')
@@ -217,7 +227,7 @@ export struct PatientCommonSettingComp {
.textOverflow({overflow:TextOverflow.Ellipsis})
.maxLines(1)
.textAlign(TextAlign.End)
.width('50%')
.width('60%')
.margin({ right: 10 })
.fontSize(15)
.fontColor('#666666')
@@ -8,15 +8,18 @@ import { TextSectionAttribute,LastSpanAttribute } from '../utils/Models'
import { applyListModel } from '../models/ApplyModel'
import { TextExpandView } from '../views/TextExpandView'
import call from '@ohos.telephony.call'
import { HMLifecycleContext, HMRouter, HMRouterMgr, IHMLifecycle } from "@hadss/hmrouter"
import { HMLifecycleContext, HMLifecycleState, HMRouter, HMRouterMgr, IHMLifecycle } from "@hadss/hmrouter"
import { ChatKitClient } from '@nimkit/chatkit';
@HMRouter({ pageUrl: 'PatientDetailsComp' })
@Component
export struct PatientDetailsComp {
scroller:Scroller = new Scroller()
@Consume@Watch('onRefreshAction') refreshFlag: boolean
private params: ESObject = HMRouterMgr.getCurrentParam()
private lifecycleOwner = HMRouterMgr.getCurrentLifecycleOwner()
private handleCallback = () => {
this.getPatientCardData()
}
// @State params:Record<string, string> = router.getParams() as Record<string, string>
@State groupArray:Array<Record<string,string>> = []
@State footerArray:Array<Record<string,string | ResourceStr>> = [{"img":$r('app.media.sendMessage_blackBtn'),"title":"发消息"},{"img":$r('app.media.fuifangPlan_blackBtn'),"title":"制定随访计划"},{"img":$r('app.media.listBing_blackBtn'),"title":"记录病情"}]
@@ -36,12 +39,13 @@ export struct PatientDetailsComp {
alignment: DialogAlignment.Center
})
onRefreshAction() {
this.getPatientCardData()
}
aboutToAppear(): void {
this.getPatientCardData()
this.lifecycleOwner?.addObserver(HMLifecycleState.onShown,this.handleCallback)
}
aboutToDisappear(): void {
this.lifecycleOwner?.removeObserver(HMLifecycleState.onShown,this.handleCallback)
}
getPatientCardData(){
@@ -384,6 +388,11 @@ export struct PatientDetailsComp {
HMRouterMgr.push({pageUrl:"RecordTheIllnessComp",
param:{"patient_uuid":this.params.patient_uuid}})
} else {
const currentStack = HMRouterMgr.getCurrentPathStack()
if (currentStack?.getParamByName('ChatP2PPage').length == 1) {
HMRouterMgr.popAsync({pageUrl:'ChatP2PPage'})
return
}
preferenceStore.setItemString('gdxz_consult_uuid',this.params.patient_uuid)
preferenceStore.setItemString('gdxz_sessionType',BasicConstant.general)
HMRouterMgr.push({ pageUrl: 'ChatP2PPage' , param: {
@@ -6,7 +6,7 @@ import HashMap from '@ohos.util.HashMap'
import { patientListModel } from '../models/PatientsGroupModel'
import { HMPopInfo, HMRouter, HMRouterMgr } from "@hadss/hmrouter"
@HMRouter({ pageUrl: 'PatientsListComp' })
@HMRouter({ pageUrl: 'PatientsListComp',singleton:true })
@Component
export struct PatientsListComp {
private params: ESObject = HMRouterMgr.getCurrentParam()
@@ -5,6 +5,7 @@ import { BusinessError } from '@kit.BasicServicesKit';
import HashMap from '@ohos.util.HashMap'
import { patientListModel } from '../models/PatientsGroupModel'
import { HMPopInfo, HMRouter, HMRouterMgr } from "@hadss/hmrouter"
import { it } from '@ohos/hypium';
@HMRouter({ pageUrl: 'PatientsListSearchComp' })
@Component
@@ -193,11 +194,11 @@ export struct PatientsListSearchComp {
.height(80)
.backgroundColor(Color.White)
.onClick(()=>{
HMRouterMgr.push({pageUrl:'PatientDetailsComp',param:{"patient_uuid":item.uuid}})
// item.isSelected = !item.isSelected;
// this.patientsList = [...this.patientsList];
// const selectedNum = this.patientsList.filter(item => item.isSelected == true).length;
// this.naviRightTitle = '确定('+selectedNum+')'
if(this.params?.name == '随访计划') {
HMRouterMgr.pop({param:{"patient_uuid":item.uuid,"nickname":item.nickname,"realname":item.realname,"realName":item.realName}})
} else {
HMRouterMgr.push({pageUrl:'PatientDetailsComp',param:{"patient_uuid":item.uuid}})
}
})
Blank()
.width('80%')
@@ -7,7 +7,7 @@ import HashMap from '@ohos.util.HashMap';
import { groupRequest,groupRequestCall,groupModel,patientListModel } from '../models/PatientsGroupModel'
import { HMRouterMgr, HMRouterPathInfo, HMRouterPathCallback, HMRouter, HMPopInfo } from "@hadss/hmrouter"
@HMRouter({pageUrl:'SelectedPatientGroupComp'})
@HMRouter({pageUrl:'SelectedPatientGroupComp',singleton:true})
@Component
export struct SelectedPatientGroupComp {
private params: ESObject = HMRouterMgr.getCurrentParam()
@@ -13,7 +13,7 @@ import { TeachDialog } from "@nimkit/chatkit_ui"
import { PerfactInputSheet } from "@itcast/basic/src/main/ets/Views/PerfactInputSheet"
import { NewWaDialog } from "@nimkit/chatkit_ui/src/main/ets/view/NewWaDialog"
@HMRouter({pageUrl:'SendGroupMessageComp'})
@HMRouter({pageUrl:'SendGroupMessageComp',singleton:true})
@Component
export struct SendGroupMessageComp {
private params: ESObject = HMRouterMgr.getCurrentParam()
@@ -29,24 +29,21 @@ export struct SendGroupMessageComp {
dialogController: CustomDialogController = new CustomDialogController({
builder: TripleOptionDialog({ title: '温馨提示',subTitle:'',oneButtonTitle:'单独选择',twoButtonTitle:'分组选择',buttonSelected:(actionType:string)=>{
if (actionType == '单独选择') {
const currentStack = HMRouterMgr.getCurrentPathStack()
if (currentStack?.getParamByName('PatientsListComp').length == 1) {
HMRouterMgr.popAsync({pageUrl:'PatientsListComp'})
return
}
HMRouterMgr.push({pageUrl:'PatientsListComp',
param:{group_uuid:"",selectedPatients:[],pageName:"群发消息"}
},{
onResult:(popInfo:HMPopInfo)=>{
if (popInfo && popInfo.result && popInfo.result["isRefresh"] !== undefined) {
}
}
})
} else {
HMRouterMgr.push({pageUrl:'SelectedPatientGroupComp'
},{
onResult:(popInfo:HMPopInfo)=>{
if (popInfo && popInfo.result && popInfo.result["isRefresh"] !== undefined) {
}
}
})
const currentStack = HMRouterMgr.getCurrentPathStack()
if (currentStack?.getParamByName('SelectedPatientGroupComp').length == 1) {
HMRouterMgr.popAsync({pageUrl:'SelectedPatientGroupComp'})
return
}
HMRouterMgr.push({pageUrl:'SelectedPatientGroupComp'})
}
}}),
alignment: DialogAlignment.Center,