HMRouter集成
This commit is contained in:
parent
c43fb1905e
commit
1bee90d673
@ -8,31 +8,28 @@ export struct InputPopWindow {
|
|||||||
|
|
||||||
build() {
|
build() {
|
||||||
Column() {
|
Column() {
|
||||||
// 提示语标题
|
|
||||||
Text(this.title)
|
Text(this.title)
|
||||||
.fontSize(18)
|
.fontSize(18)
|
||||||
.margin({ top: 20, bottom: 15 });
|
.margin({ top: 20, bottom: 15 });
|
||||||
|
|
||||||
// 输入框
|
|
||||||
TextInput({ placeholder: '分组名' })
|
TextInput({ placeholder: '分组名' })
|
||||||
.width('90%')
|
.width('90%')
|
||||||
.height(50)
|
.height(50)
|
||||||
.onChange((value: string) => {
|
.onChange((value: string) => {
|
||||||
this.inputValue = value; // 双向绑定更新值
|
this.inputValue = value
|
||||||
})
|
})
|
||||||
.border({ width: 1, color: '#CCCCCC' })
|
.border({ width: 1, color: '#CCCCCC' })
|
||||||
.backgroundColor(Color.White)
|
.backgroundColor(Color.White)
|
||||||
.borderRadius(4)
|
.borderRadius(4)
|
||||||
|
|
||||||
// 按钮行(取消 + 确定)
|
|
||||||
Flex({ justifyContent: FlexAlign.SpaceAround }) {
|
Flex({ justifyContent: FlexAlign.SpaceAround }) {
|
||||||
Text('取消')
|
Text('取消')
|
||||||
.fontColor('#666666')
|
.fontColor('#666666')
|
||||||
.textAlign(TextAlign.Center)
|
.textAlign(TextAlign.Center)
|
||||||
.width('30%')
|
.width('30%')
|
||||||
.onClick(() => {
|
.onClick(() => {
|
||||||
this.cancel?.(); // 触发取消回调
|
this.cancel?.()
|
||||||
this.controller.close(); // 关闭弹窗
|
this.controller.close()
|
||||||
})
|
})
|
||||||
|
|
||||||
Text('确定')
|
Text('确定')
|
||||||
@ -40,8 +37,7 @@ export struct InputPopWindow {
|
|||||||
.textAlign(TextAlign.Center)
|
.textAlign(TextAlign.Center)
|
||||||
.width('30%')
|
.width('30%')
|
||||||
.onClick(() => {
|
.onClick(() => {
|
||||||
this.confirm?.(this.inputValue); // 传递输入值给父组件
|
this.confirm?.(this.inputValue)
|
||||||
this.controller.close();
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
.margin({ top: 20, bottom: 10 })
|
.margin({ top: 20, bottom: 10 })
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
export { MainPage } from './src/main/ets/components/MainPage';
|
|
||||||
|
|
||||||
export { PatientApplyPage } from './src/main/ets/components/PatientApplyPage'
|
export { PatientApplyPage } from './src/main/ets/components/PatientApplyPage'
|
||||||
|
|
||||||
export { PatientSetMsgPage } from './src/main/ets/components/PatientSetMsgPage'
|
export { PatientSetMsgPage } from './src/main/ets/components/PatientSetMsgPage'
|
||||||
|
|||||||
@ -1,18 +1,20 @@
|
|||||||
import { authStore, HdNav, PositionSelectedSheet } from '@itcast/basic';
|
import { authStore, HdNav } from '@itcast/basic';
|
||||||
import { promptAction, router } from '@kit.ArkUI'
|
import { promptAction } from '@kit.ArkUI'
|
||||||
import { HdLoadingDialog,DefaultHintProWindows } from '@itcast/basic'
|
import { HdLoadingDialog,DefaultHintProWindows } from '@itcast/basic'
|
||||||
import { BasicConstant,hdHttp, HdResponse ,logger} from '@itcast/basic/Index'
|
import { BasicConstant,hdHttp, HdResponse ,logger} from '@itcast/basic/Index'
|
||||||
import { BusinessError } from '@kit.BasicServicesKit';
|
import { BusinessError } from '@kit.BasicServicesKit';
|
||||||
import { patientListModel } from '../models/PatientsGroupModel'
|
import { patientListModel } from '../models/PatientsGroupModel'
|
||||||
|
import { HMRouter, HMRouterMgr,HMRouterPathInfo,HMRouterPathCallback } from "@hadss/hmrouter"
|
||||||
|
|
||||||
|
@HMRouter({ pageUrl: 'BuildOrEditGroupPage' })
|
||||||
@Component
|
@Component
|
||||||
export struct BuildOrEditGroupPage {
|
export struct BuildOrEditGroupPage {
|
||||||
@State params:Record<string, string> = router.getParams() as Record<string, string>
|
private params: ESObject = HMRouterMgr.getCurrentParam();
|
||||||
|
// @State params:Record<string, string> = router.getParams() as Record<string, string>
|
||||||
scrollerCon:Scroller = new Scroller()
|
scrollerCon:Scroller = new Scroller()
|
||||||
@State groupPatientList:patientListModel[] = []
|
@State groupPatientList:patientListModel[] = []
|
||||||
@State groupName:string = ''
|
@State groupName:string = ''
|
||||||
private hintWindowDialog!: CustomDialogController
|
private hintWindowDialog!: CustomDialogController
|
||||||
@Consume@Watch('onRefreshAction') refreshFlag: boolean;
|
|
||||||
|
|
||||||
dialog: CustomDialogController = new CustomDialogController({
|
dialog: CustomDialogController = new CustomDialogController({
|
||||||
builder: HdLoadingDialog({ message: '加载中...' }),
|
builder: HdLoadingDialog({ message: '加载中...' }),
|
||||||
@ -40,18 +42,6 @@ export struct BuildOrEditGroupPage {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
onRefreshAction(flag: boolean) {
|
|
||||||
const returnParams = this.getUIContext().getRouter().getParams() as Record<string, string | patientListModel[]>;
|
|
||||||
const patients = returnParams?.selectedPatients as patientListModel[] | undefined;
|
|
||||||
if (patients?.length) {
|
|
||||||
for (const model of returnParams.selectedPatients as patientListModel[]) {
|
|
||||||
if (model.isSelected) {
|
|
||||||
this.groupPatientList.push(model)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
aboutToAppear(): void {
|
aboutToAppear(): void {
|
||||||
if (this.params.title != '新建分组') {
|
if (this.params.title != '新建分组') {
|
||||||
this.getGroupPatientsData()
|
this.getGroupPatientsData()
|
||||||
@ -91,7 +81,8 @@ export struct BuildOrEditGroupPage {
|
|||||||
let json:Record<string,string> = JSON.parse(res+'') as Record<string,string>;
|
let json:Record<string,string> = JSON.parse(res+'') as Record<string,string>;
|
||||||
if(json.code == '1') {
|
if(json.code == '1') {
|
||||||
promptAction.showToast({ message: '删除分组成功', duration: 1000 })
|
promptAction.showToast({ message: '删除分组成功', duration: 1000 })
|
||||||
router.back();
|
// router.back();
|
||||||
|
HMRouterMgr.pop()
|
||||||
} else {
|
} else {
|
||||||
console.error('删除患者分组列表失败:'+json.message)
|
console.error('删除患者分组列表失败:'+json.message)
|
||||||
promptAction.showToast({ message: json.message, duration: 1000 })
|
promptAction.showToast({ message: json.message, duration: 1000 })
|
||||||
@ -123,7 +114,8 @@ export struct BuildOrEditGroupPage {
|
|||||||
let json:Record<string,string> = JSON.parse(res+'') as Record<string,string>;
|
let json:Record<string,string> = JSON.parse(res+'') as Record<string,string>;
|
||||||
if(json.code == '1') {
|
if(json.code == '1') {
|
||||||
promptAction.showToast({ message:'分组成功', duration: 1000 })
|
promptAction.showToast({ message:'分组成功', duration: 1000 })
|
||||||
router.back();
|
// router.back();
|
||||||
|
HMRouterMgr.pop()
|
||||||
} else if (json.code == '2') {
|
} else if (json.code == '2') {
|
||||||
promptAction.showToast({ message:'该分组已存在', duration: 1000 })
|
promptAction.showToast({ message:'该分组已存在', duration: 1000 })
|
||||||
} else {
|
} else {
|
||||||
@ -134,33 +126,6 @@ export struct BuildOrEditGroupPage {
|
|||||||
this.dialog.close();
|
this.dialog.close();
|
||||||
console.error(`Response fails: ${err}`);
|
console.error(`Response fails: ${err}`);
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
// const postContent = new rcp.MultipartForm({
|
|
||||||
// "uuid": this.params.group_uuid,
|
|
||||||
// "name":this.groupName,
|
|
||||||
// "patient_uuid":uuidString
|
|
||||||
// })
|
|
||||||
// const session = rcp.createSession();
|
|
||||||
// session.post(BasicConstant.updateGroup, postContent)
|
|
||||||
// .then((response) => {
|
|
||||||
// this.dialog.close();
|
|
||||||
// logger.info('Response patientListByGroup'+response);
|
|
||||||
// let json:Record<string,string> = JSON.parse(response+'') as Record<string,string>;
|
|
||||||
// if(json.code == '1') {
|
|
||||||
// promptAction.showToast({ message:'分组成功', duration: 1000 })
|
|
||||||
// router.back();
|
|
||||||
// } else if (json.code == '2') {
|
|
||||||
// promptAction.showToast({ message:'该分组已存在', duration: 1000 })
|
|
||||||
// } else {
|
|
||||||
// console.error('删除患者分组列表失败:'+json.message)
|
|
||||||
// promptAction.showToast({ message: json.message, duration: 1000 })
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// .catch((err: BusinessError) => {
|
|
||||||
// this.dialog.close();
|
|
||||||
// console.error(`Response err: Code is ${JSON.stringify(err.code)}, message is ${JSON.stringify(err)}`);
|
|
||||||
// })
|
|
||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
@ -172,6 +137,10 @@ export struct BuildOrEditGroupPage {
|
|||||||
hasBorder: true,
|
hasBorder: true,
|
||||||
rightText: '保存',
|
rightText: '保存',
|
||||||
showRightText: true,
|
showRightText: true,
|
||||||
|
isLeftAction:true,
|
||||||
|
leftItemAction:()=>{
|
||||||
|
HMRouterMgr.pop()
|
||||||
|
},
|
||||||
rightItemAction: () => {
|
rightItemAction: () => {
|
||||||
if (this.params.title == '新建分组') {
|
if (this.params.title == '新建分组') {
|
||||||
this.setCreatOrEditGroup(0);
|
this.setCreatOrEditGroup(0);
|
||||||
@ -219,10 +188,28 @@ export struct BuildOrEditGroupPage {
|
|||||||
.height(80)
|
.height(80)
|
||||||
.backgroundColor(Color.White)
|
.backgroundColor(Color.White)
|
||||||
.onClick(()=>{
|
.onClick(()=>{
|
||||||
router.pushUrl({
|
const pathInfo1: HMRouterPathInfo = {
|
||||||
url:'pages/PatientsPage/PatientsListPage',
|
pageUrl: 'PatientsListComp',
|
||||||
params:{group_uuid:this.params.group_uuid,selectedPatients:this.groupPatientList}
|
param:{group_uuid:this.params.group_uuid,selectedPatients:this.groupPatientList}
|
||||||
})
|
};
|
||||||
|
const callback: HMRouterPathCallback = {
|
||||||
|
onResult: (popInfo: PopInfo) => {
|
||||||
|
const result = popInfo.result as Record<string,string | patientListModel[]>
|
||||||
|
const patients = result?.selectedPatients as patientListModel[] | undefined;
|
||||||
|
if (patients?.length) {
|
||||||
|
for (const model of result.selectedPatients as patientListModel[]) {
|
||||||
|
if (model.isSelected) {
|
||||||
|
this.groupPatientList.push(model)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
HMRouterMgr.push(pathInfo1,callback)
|
||||||
|
// router.pushUrl({
|
||||||
|
// url:'pages/PatientsPage/PatientsListPage',
|
||||||
|
// params:{group_uuid:this.params.group_uuid,selectedPatients:this.groupPatientList}
|
||||||
|
// })
|
||||||
})
|
})
|
||||||
|
|
||||||
List(){
|
List(){
|
||||||
|
|||||||
@ -1,12 +1,13 @@
|
|||||||
import { BasicConstant, hdHttp, HdResponse, logger , authStore, HdNav , HdLoadingDialog, ChangeUtil,DefaultHintProWindows,InputPopWindow } from '@itcast/basic/Index'
|
import { BasicConstant, hdHttp, HdResponse, logger , authStore, HdNav , HdLoadingDialog, ChangeUtil,DefaultHintProWindows,InputPopWindow } from '@itcast/basic/Index'
|
||||||
import { promptAction, router } from '@kit.ArkUI'
|
import { promptAction } from '@kit.ArkUI'
|
||||||
import { groupModel } from '../models/PatientsGroupModel'
|
|
||||||
import HashMap from '@ohos.util.HashMap';
|
import HashMap from '@ohos.util.HashMap';
|
||||||
import { BusinessError } from '@kit.BasicServicesKit'
|
import { BusinessError } from '@kit.BasicServicesKit'
|
||||||
|
import { HMRouter, HMRouterMgr } from "@hadss/hmrouter"
|
||||||
|
|
||||||
|
@HMRouter({ pageUrl: 'GroupManagementComp' })
|
||||||
@Component
|
@Component
|
||||||
export struct GroupManagementComp {
|
export struct GroupManagementComp {
|
||||||
@State params:Record<string, string> = router.getParams() as Record<string, string>
|
private params: ESObject = HMRouterMgr.getCurrentParam();
|
||||||
private hintWindowDialog!: CustomDialogController
|
private hintWindowDialog!: CustomDialogController
|
||||||
@State dialogInputValue: string = '';
|
@State dialogInputValue: string = '';
|
||||||
private inputPopWindow!: CustomDialogController;
|
private inputPopWindow!: CustomDialogController;
|
||||||
@ -40,7 +41,9 @@ export struct GroupManagementComp {
|
|||||||
builder: InputPopWindow({
|
builder: InputPopWindow({
|
||||||
title: '添加分组',
|
title: '添加分组',
|
||||||
controller:this.inputPopWindow,
|
controller:this.inputPopWindow,
|
||||||
confirm: this.onConfirm
|
confirm: (value: string)=>{
|
||||||
|
this.confirmAddGroup(value)
|
||||||
|
}
|
||||||
}),
|
}),
|
||||||
alignment: DialogAlignment.Center,
|
alignment: DialogAlignment.Center,
|
||||||
cornerRadius:24,
|
cornerRadius:24,
|
||||||
@ -70,6 +73,7 @@ export struct GroupManagementComp {
|
|||||||
let json:Record<string,string | Array<Record<string,string>>> = JSON.parse(res+'') as Record<string,string | Array<Record<string,string>>>
|
let json:Record<string,string | Array<Record<string,string>>> = JSON.parse(res+'') as Record<string,string | Array<Record<string,string>>>
|
||||||
if(json.code == '1') {
|
if(json.code == '1') {
|
||||||
console.info('上一层传过来的group:',this.params.groupNames)
|
console.info('上一层传过来的group:',this.params.groupNames)
|
||||||
|
this.groupList = []
|
||||||
this.groupList = json.data as Array<Record<string,string>>
|
this.groupList = json.data as Array<Record<string,string>>
|
||||||
} else {
|
} else {
|
||||||
console.error('获取分组列表信息失败:'+json.message)
|
console.error('获取分组列表信息失败:'+json.message)
|
||||||
@ -109,10 +113,6 @@ export struct GroupManagementComp {
|
|||||||
this.inputPopWindow.open()
|
this.inputPopWindow.open()
|
||||||
}
|
}
|
||||||
|
|
||||||
private onConfirm(value: string) {
|
|
||||||
this.confirmAddGroup(value)
|
|
||||||
}
|
|
||||||
|
|
||||||
confirmAddGroup(value:string) {
|
confirmAddGroup(value:string) {
|
||||||
if (!value.trim()) {
|
if (!value.trim()) {
|
||||||
promptAction.showToast({ message: '请输入分组名', duration: 1000 })
|
promptAction.showToast({ message: '请输入分组名', duration: 1000 })
|
||||||
@ -123,6 +123,7 @@ export struct GroupManagementComp {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.dialog.open()
|
this.dialog.open()
|
||||||
|
this.inputPopWindow.close()
|
||||||
hdHttp.post<string>(BasicConstant.addGroup, {
|
hdHttp.post<string>(BasicConstant.addGroup, {
|
||||||
"expert_uuid": authStore.getUser().uuid,
|
"expert_uuid": authStore.getUser().uuid,
|
||||||
"name":value,
|
"name":value,
|
||||||
@ -153,7 +154,7 @@ export struct GroupManagementComp {
|
|||||||
}
|
}
|
||||||
this.dialog.open()
|
this.dialog.open()
|
||||||
const uuidString = this.selectedGroups.map(item => item.uuid).join(',');
|
const uuidString = this.selectedGroups.map(item => item.uuid).join(',');
|
||||||
const nameString = this.selectedGroups.map(item => item.uuid).join(',');
|
const nameString = this.selectedGroups.map(item => item.name).join(',');
|
||||||
const hashMap: HashMap<string, string> = new HashMap()
|
const hashMap: HashMap<string, string> = new HashMap()
|
||||||
hashMap.set('group_uuid',uuidString)
|
hashMap.set('group_uuid',uuidString)
|
||||||
hashMap.set('patient_uuid',this.params.patientUuid)
|
hashMap.set('patient_uuid',this.params.patientUuid)
|
||||||
@ -162,7 +163,7 @@ export struct GroupManagementComp {
|
|||||||
logger.info('Response patientCardUpdateGroup'+res);
|
logger.info('Response patientCardUpdateGroup'+res);
|
||||||
let json:Record<string,string> = JSON.parse(res+'') as Record<string,string>;
|
let json:Record<string,string> = JSON.parse(res+'') as Record<string,string>;
|
||||||
if(json.code == '200') {
|
if(json.code == '200') {
|
||||||
router.back()
|
HMRouterMgr.pop({param:{'nameString':nameString,"uuidString":uuidString}})
|
||||||
} else {
|
} else {
|
||||||
console.error('保存患者分组信息失败:'+json.message)
|
console.error('保存患者分组信息失败:'+json.message)
|
||||||
promptAction.showToast({ message: json.message, duration: 1000 })
|
promptAction.showToast({ message: json.message, duration: 1000 })
|
||||||
@ -177,6 +178,10 @@ export struct GroupManagementComp {
|
|||||||
Column() {
|
Column() {
|
||||||
HdNav({ title: '分组管理', showRightIcon: false, hasBorder: true, rightText: '保存', showRightText: true, rightItemAction:()=>{
|
HdNav({ title: '分组管理', showRightIcon: false, hasBorder: true, rightText: '保存', showRightText: true, rightItemAction:()=>{
|
||||||
this.saveGroupNameAction()
|
this.saveGroupNameAction()
|
||||||
|
},
|
||||||
|
isLeftAction:true,
|
||||||
|
leftItemAction:()=>{
|
||||||
|
HMRouterMgr.pop()
|
||||||
} })
|
} })
|
||||||
// 已选分组
|
// 已选分组
|
||||||
Row() {
|
Row() {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { authStore, ChangeUtil, HdNav } from '@itcast/basic';
|
import { authStore, ChangeUtil, HdNav } from '@itcast/basic';
|
||||||
import { LevelMode, promptAction, router } from '@kit.ArkUI'
|
import { promptAction } from '@kit.ArkUI'
|
||||||
import { HdLoadingDialog } from '@itcast/basic'
|
import { HdLoadingDialog } from '@itcast/basic'
|
||||||
import { BasicConstant,hdHttp, HdResponse ,logger} from '@itcast/basic/Index'
|
import { BasicConstant,hdHttp, HdResponse ,logger} from '@itcast/basic/Index'
|
||||||
import { BusinessError } from '@kit.BasicServicesKit';
|
import { BusinessError } from '@kit.BasicServicesKit';
|
||||||
@ -8,12 +8,15 @@ import { TextSectionAttribute,LastSpanAttribute } from '../utils/Models'
|
|||||||
import { applyListModel } from '../models/ApplyModel'
|
import { applyListModel } from '../models/ApplyModel'
|
||||||
import { TextExpandView } from '../views/TextExpandView'
|
import { TextExpandView } from '../views/TextExpandView'
|
||||||
import call from '@ohos.telephony.call'
|
import call from '@ohos.telephony.call'
|
||||||
|
import { HMRouter, HMRouterMgr } from "@hadss/hmrouter"
|
||||||
|
|
||||||
|
@HMRouter({ pageUrl: 'PatientDetailsComp' })
|
||||||
@Component
|
@Component
|
||||||
export struct PatientDetailsComp {
|
export struct PatientDetailsComp {
|
||||||
scroller:Scroller = new Scroller()
|
scroller:Scroller = new Scroller()
|
||||||
@Consume@Watch('onRefreshAction') refreshFlag: boolean
|
@Consume@Watch('onRefreshAction') refreshFlag: boolean
|
||||||
@State params:Record<string, string> = router.getParams() as Record<string, string>
|
private params: ESObject = HMRouterMgr.getCurrentParam()
|
||||||
|
// @State params:Record<string, string> = router.getParams() as Record<string, string>
|
||||||
@State groupArray:Array<Record<string,string>> = []
|
@State groupArray:Array<Record<string,string>> = []
|
||||||
@State footerArray:Array<Record<string,string | ResourceStr>> = []
|
@State footerArray:Array<Record<string,string | ResourceStr>> = []
|
||||||
@State patientCase:Array<Record<string,string>> = []
|
@State patientCase:Array<Record<string,string>> = []
|
||||||
@ -52,7 +55,8 @@ export struct PatientDetailsComp {
|
|||||||
const isFriend = String(json.isFriend)
|
const isFriend = String(json.isFriend)
|
||||||
if (isFriend == '0') {
|
if (isFriend == '0') {
|
||||||
promptAction.showToast({ message: '随访关系已解除', duration: 1000 })
|
promptAction.showToast({ message: '随访关系已解除', duration: 1000 })
|
||||||
router.back()
|
// router.back()
|
||||||
|
HMRouterMgr.pop()
|
||||||
} else {
|
} else {
|
||||||
if(json.code == '200') {
|
if(json.code == '200') {
|
||||||
this.patientGroupData = json
|
this.patientGroupData = json
|
||||||
@ -157,11 +161,16 @@ export struct PatientDetailsComp {
|
|||||||
hasBorder: true,
|
hasBorder: true,
|
||||||
rightIcon: $r("app.media.patient_details_navigation_right"),
|
rightIcon: $r("app.media.patient_details_navigation_right"),
|
||||||
showRightText: false,
|
showRightText: false,
|
||||||
|
isLeftAction:true,
|
||||||
|
leftItemAction:()=>{
|
||||||
|
HMRouterMgr.pop()
|
||||||
|
},
|
||||||
rightItemAction: () => {
|
rightItemAction: () => {
|
||||||
router.pushUrl({
|
HMRouterMgr.push({pageUrl: 'BuildOrEditGroupPage',param:{"title": "新建分组"}})
|
||||||
url: 'pages/PatientsPage/BuildOrEditGroupPage',
|
// router.pushUrl({
|
||||||
params: { "title": "新建分组" }
|
// url: 'pages/PatientsPage/BuildOrEditGroupPage',
|
||||||
})
|
// params: { "title": "新建分组" }
|
||||||
|
// })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
Scroll(this.scroller) {
|
Scroll(this.scroller) {
|
||||||
@ -225,7 +234,7 @@ export struct PatientDetailsComp {
|
|||||||
.margin({top:8,bottom:30})
|
.margin({top:8,bottom:30})
|
||||||
}
|
}
|
||||||
.margin({left:15})
|
.margin({left:15})
|
||||||
.justifyContent(FlexAlign.Start)
|
.width('calc(100% - 105vp)')
|
||||||
.alignItems(HorizontalAlign.Start)
|
.alignItems(HorizontalAlign.Start)
|
||||||
}
|
}
|
||||||
.width('100%')
|
.width('100%')
|
||||||
@ -271,10 +280,11 @@ export struct PatientDetailsComp {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
router.pushUrl({
|
HMRouterMgr.push({pageUrl: 'PatientSetMsgPage',param:{"model":this.patientData2}})
|
||||||
url:'pages/PatientsPage/PatientMsgSetPage',
|
// router.pushUrl({
|
||||||
params:{"model":this.patientData2}
|
// url:'pages/PatientsPage/PatientMsgSetPage',
|
||||||
})
|
// params:{"model":this.patientData2}
|
||||||
|
// })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}.width('100%').height(50)
|
}.width('100%').height(50)
|
||||||
|
|||||||
@ -4,8 +4,9 @@ import HashMap from '@ohos.util.HashMap';
|
|||||||
import { HdLoadingDialog } from '@itcast/basic'
|
import { HdLoadingDialog } from '@itcast/basic'
|
||||||
import { BasicConstant,hdHttp, HdResponse ,logger} from '@itcast/basic/Index'
|
import { BasicConstant,hdHttp, HdResponse ,logger} from '@itcast/basic/Index'
|
||||||
import { BusinessError } from '@kit.BasicServicesKit';
|
import { BusinessError } from '@kit.BasicServicesKit';
|
||||||
import { Font, promptAction, router } from '@kit.ArkUI'
|
import { promptAction } from '@kit.ArkUI'
|
||||||
import { patientDbManager, PatientData } from '@itcast/basic';
|
import { patientDbManager, PatientData } from '@itcast/basic';
|
||||||
|
import { HMRouter, HMRouterMgr, HMRouterPathCallback, HMRouterPathInfo } from "@hadss/hmrouter"
|
||||||
|
|
||||||
interface callBackData {
|
interface callBackData {
|
||||||
code: string,
|
code: string,
|
||||||
@ -18,10 +19,10 @@ interface paramsCallData {
|
|||||||
model:applyListModel;
|
model:applyListModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@HMRouter({ pageUrl: 'PatientSetMsgPage' })
|
||||||
@Component
|
@Component
|
||||||
export struct PatientSetMsgPage {
|
export struct PatientSetMsgPage {
|
||||||
pageStack:NavPathStack = new NavPathStack()
|
private params: ESObject = HMRouterMgr.getCurrentParam()
|
||||||
@State params:paramsCallData = router.getParams() as paramsCallData
|
|
||||||
@State noteName: string | undefined = ChangeUtil.stringIsUndefinedAndNull(this.params.model.nickname)?'':String(this.params.model.nickname)
|
@State noteName: string | undefined = ChangeUtil.stringIsUndefinedAndNull(this.params.model.nickname)?'':String(this.params.model.nickname)
|
||||||
@State contentFrist:string | undefined = ''
|
@State contentFrist:string | undefined = ''
|
||||||
@State groupName: string = ChangeUtil.stringIsUndefinedAndNull(this.params.model.groupType)?'通过分组给患者分类':String(this.params.model.groupType)
|
@State groupName: string = ChangeUtil.stringIsUndefinedAndNull(this.params.model.groupType)?'通过分组给患者分类':String(this.params.model.groupType)
|
||||||
@ -37,7 +38,6 @@ export struct PatientSetMsgPage {
|
|||||||
})
|
})
|
||||||
|
|
||||||
aboutToAppear(): void {
|
aboutToAppear(): void {
|
||||||
this.pageStack.getParamByName('PatientSetMsgPage')
|
|
||||||
this.contentFrist = getFirstSegment(this.params.model.content)
|
this.contentFrist = getFirstSegment(this.params.model.content)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,7 +73,8 @@ export struct PatientSetMsgPage {
|
|||||||
console.info('添加失败');
|
console.info('添加失败');
|
||||||
}
|
}
|
||||||
promptAction.showToast({ message: '设置成功', duration: 1000 })
|
promptAction.showToast({ message: '设置成功', duration: 1000 })
|
||||||
router.back()
|
// router.back()
|
||||||
|
HMRouterMgr.pop()
|
||||||
} else {
|
} else {
|
||||||
console.error('患者申请记录列表失败:'+json.message)
|
console.error('患者申请记录列表失败:'+json.message)
|
||||||
promptAction.showToast({ message: json.message, duration: 1000 })
|
promptAction.showToast({ message: json.message, duration: 1000 })
|
||||||
@ -86,7 +87,11 @@ export struct PatientSetMsgPage {
|
|||||||
|
|
||||||
build() {
|
build() {
|
||||||
Column() {
|
Column() {
|
||||||
HdNav({ title: '设置备注和分组', showRightIcon: false, hasBorder: true })
|
HdNav({ title: '设置备注和分组', showRightIcon: false, hasBorder: true,
|
||||||
|
isLeftAction:true,
|
||||||
|
leftItemAction:()=>{
|
||||||
|
HMRouterMgr.pop()
|
||||||
|
} })
|
||||||
|
|
||||||
Text('备注')
|
Text('备注')
|
||||||
.margin({left:15,top:15})
|
.margin({left:15,top:15})
|
||||||
@ -141,10 +146,21 @@ export struct PatientSetMsgPage {
|
|||||||
.borderRadius(4)
|
.borderRadius(4)
|
||||||
.margin({left:15,top:10})
|
.margin({left:15,top:10})
|
||||||
.onClick(()=>{
|
.onClick(()=>{
|
||||||
router.pushUrl({
|
const pathInfo1: HMRouterPathInfo = {
|
||||||
url:'pages/PatientsPage/GroupManagementPage',
|
pageUrl: 'GroupManagementComp',
|
||||||
params:{groupNames:this.params.model.groupType,groupUuids:this.params.model.groupUuid,patientUuid:this.params.model.patientUuid}
|
param:{groupNames:this.params.model.groupType,groupUuids:this.params.model.groupUuid,patientUuid:this.params.model.patientUuid}
|
||||||
})
|
};
|
||||||
|
const callback: HMRouterPathCallback = {
|
||||||
|
onResult: (popInfo: PopInfo) => {
|
||||||
|
const result = popInfo.result as Record<string,string>
|
||||||
|
this.groupName = String(result.nameString)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
HMRouterMgr.push(pathInfo1,callback)
|
||||||
|
// router.pushUrl({
|
||||||
|
// url:'pages/PatientsPage/GroupManagementPage',
|
||||||
|
// params:{groupNames:this.params.model.groupType,groupUuids:this.params.model.groupUuid,patientUuid:this.params.model.patientUuid}
|
||||||
|
// })
|
||||||
})
|
})
|
||||||
|
|
||||||
Text('描述')
|
Text('描述')
|
||||||
|
|||||||
@ -1,10 +1,11 @@
|
|||||||
import { authStore, HdNav, PositionSelectedSheet } from '@itcast/basic';
|
import { authStore, HdNav, PositionSelectedSheet } from '@itcast/basic';
|
||||||
import { promptAction, router } from '@kit.ArkUI'
|
import { promptAction } from '@kit.ArkUI'
|
||||||
import { HdLoadingDialog } from '@itcast/basic'
|
import { HdLoadingDialog } from '@itcast/basic'
|
||||||
import { BasicConstant,hdHttp, HdResponse ,logger} from '@itcast/basic/Index'
|
import { BasicConstant,hdHttp, HdResponse ,logger} from '@itcast/basic/Index'
|
||||||
import { BusinessError } from '@kit.BasicServicesKit';
|
import { BusinessError } from '@kit.BasicServicesKit';
|
||||||
import HashMap from '@ohos.util.HashMap';
|
import HashMap from '@ohos.util.HashMap';
|
||||||
import { groupRequest,groupRequestCall,groupModel,patientListModel } from '../models/PatientsGroupModel'
|
import { groupRequest,groupRequestCall,groupModel,patientListModel } from '../models/PatientsGroupModel'
|
||||||
|
import { HMRouterMgr, HMRouterPathInfo, HMRouterPathCallback } from "@hadss/hmrouter"
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
export struct PatientsGroup {
|
export struct PatientsGroup {
|
||||||
@ -20,11 +21,6 @@ export struct PatientsGroup {
|
|||||||
@State group_sort:string = '0'
|
@State group_sort:string = '0'
|
||||||
@State list_sort:string = '0'
|
@State list_sort:string = '0'
|
||||||
@State groupListArray: groupModel[] = [];
|
@State groupListArray: groupModel[] = [];
|
||||||
@Consume@Watch('onRefreshAction') refreshFlag: boolean;
|
|
||||||
|
|
||||||
onRefreshAction(flag: boolean) {
|
|
||||||
this.getGroupData();
|
|
||||||
}
|
|
||||||
|
|
||||||
dialog: CustomDialogController = new CustomDialogController({
|
dialog: CustomDialogController = new CustomDialogController({
|
||||||
builder: HdLoadingDialog({ message: '加载中...' }),
|
builder: HdLoadingDialog({ message: '加载中...' }),
|
||||||
@ -92,10 +88,11 @@ export struct PatientsGroup {
|
|||||||
rightText: '新建',
|
rightText: '新建',
|
||||||
showRightText: true,
|
showRightText: true,
|
||||||
rightItemAction: () => {
|
rightItemAction: () => {
|
||||||
router.pushUrl({
|
HMRouterMgr.push({pageUrl:'BuildOrEditGroupPage',param:{"title":"新建分组"}})
|
||||||
url: 'pages/PatientsPage/BuildOrEditGroupPage',
|
// router.pushUrl({
|
||||||
params:{"title":"新建分组"}
|
// url: 'pages/PatientsPage/BuildOrEditGroupPage',
|
||||||
})
|
// params:{"title":"新建分组"}
|
||||||
|
// })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
Stack() {
|
Stack() {
|
||||||
@ -164,10 +161,11 @@ export struct PatientsGroup {
|
|||||||
.backgroundColor('#999999')
|
.backgroundColor('#999999')
|
||||||
}.width('100%').height(80).alignContent(Alignment.BottomEnd)
|
}.width('100%').height(80).alignContent(Alignment.BottomEnd)
|
||||||
.onClick(()=>{
|
.onClick(()=>{
|
||||||
router.pushUrl({
|
HMRouterMgr.push({pageUrl:'PatientDetailsComp',param:{"patient_uuid":rowModel.uuid}})
|
||||||
url:'pages/PatientsPage/PatientDetailsPage',
|
// router.pushUrl({
|
||||||
params:{"patient_uuid":rowModel.uuid}
|
// url:'pages/PatientsPage/PatientDetailsPage',
|
||||||
})
|
// params:{"patient_uuid":rowModel.uuid}
|
||||||
|
// })
|
||||||
})
|
})
|
||||||
}.width('100%')
|
}.width('100%')
|
||||||
})
|
})
|
||||||
@ -289,10 +287,24 @@ export struct PatientsGroup {
|
|||||||
.textAlign(TextAlign.End)
|
.textAlign(TextAlign.End)
|
||||||
.visibility(model.name != '待分组患者'?Visibility.Visible:Visibility.Hidden)
|
.visibility(model.name != '待分组患者'?Visibility.Visible:Visibility.Hidden)
|
||||||
.onClick(()=>{
|
.onClick(()=>{
|
||||||
router.pushUrl({
|
const pathInfo1: HMRouterPathInfo = {
|
||||||
url: 'pages/PatientsPage/BuildOrEditGroupPage',
|
pageUrl: 'BuildOrEditGroupPage',
|
||||||
params:{"title":"编辑分组","group_uuid":model.uuid,"group_name":model.name}
|
param:{"title":"编辑分组","group_uuid":model.uuid,"group_name":model.name}
|
||||||
})
|
};
|
||||||
|
const callback: HMRouterPathCallback = {
|
||||||
|
onResult: (popInfo: PopInfo) => {
|
||||||
|
const result = popInfo.result as Record<string,string>
|
||||||
|
const isFreash = Boolean(result.nameString)
|
||||||
|
if (isFreash) {
|
||||||
|
this.getGroupData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
HMRouterMgr.push(pathInfo1,callback)
|
||||||
|
// router.pushUrl({
|
||||||
|
// url: 'pages/PatientsPage/BuildOrEditGroupPage',
|
||||||
|
// params:{"title":"编辑分组","group_uuid":model.uuid,"group_name":model.name}
|
||||||
|
// })
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
.width('100%')
|
.width('100%')
|
||||||
|
|||||||
@ -1,13 +1,16 @@
|
|||||||
import { authStore, ChangeUtil, HdNav, PositionSelectedSheet, EmptyViewComp,HdLoadingDialog } from '@itcast/basic';
|
import { HdNav, EmptyViewComp,HdLoadingDialog } from '@itcast/basic';
|
||||||
import { promptAction, router } from '@kit.ArkUI'
|
import { promptAction } from '@kit.ArkUI'
|
||||||
import { BasicConstant,hdHttp, HdResponse ,logger} from '@itcast/basic/Index'
|
import { BasicConstant,hdHttp, HdResponse ,logger} from '@itcast/basic/Index'
|
||||||
import { BusinessError } from '@kit.BasicServicesKit';
|
import { BusinessError } from '@kit.BasicServicesKit';
|
||||||
import HashMap from '@ohos.util.HashMap';
|
import HashMap from '@ohos.util.HashMap'
|
||||||
import { patientListModel } from '../models/PatientsGroupModel'
|
import { patientListModel } from '../models/PatientsGroupModel'
|
||||||
|
import { HMRouter, HMRouterMgr } from "@hadss/hmrouter"
|
||||||
|
|
||||||
|
@HMRouter({ pageUrl: 'PatientsListComp' })
|
||||||
@Component
|
@Component
|
||||||
export struct PatientsListComp {
|
export struct PatientsListComp {
|
||||||
@State params:Record<string, string | patientListModel[]> = router.getParams() as Record<string, string | patientListModel[]>
|
private params: ESObject = HMRouterMgr.getCurrentParam()
|
||||||
|
// @State params:Record<string, string | patientListModel[]> = router.getParams() as Record<string, string | patientListModel[]>
|
||||||
@State patientsArray:patientListModel[] = []
|
@State patientsArray:patientListModel[] = []
|
||||||
@State patientsList:patientListModel[] = []
|
@State patientsList:patientListModel[] = []
|
||||||
@State inputString:string = ''
|
@State inputString:string = ''
|
||||||
@ -74,11 +77,16 @@ export struct PatientsListComp {
|
|||||||
|
|
||||||
build() {
|
build() {
|
||||||
Column() {
|
Column() {
|
||||||
HdNav({showLeftIcon:true,title:'选择患者',rightText:this.naviRightTitle,showRightText:true,rightTextColor:Color.White,rightBackColor:$r('app.color.main_color'),showRightIcon:false,rightItemAction:()=>{
|
HdNav({showLeftIcon:true,title:'选择患者',rightText:this.naviRightTitle,showRightText:true,rightTextColor:Color.White,rightBackColor:$r('app.color.main_color'),showRightIcon:false,
|
||||||
router.back({
|
isLeftAction:true,
|
||||||
url:'pages/PatientsPage/BuildOrEditGroupPage',
|
leftItemAction:()=>{
|
||||||
params:{'selectedPatients':this.patientsList}
|
HMRouterMgr.pop()
|
||||||
})
|
},rightItemAction:()=>{
|
||||||
|
HMRouterMgr.pop({param:{'selectedPatients':this.patientsList}})
|
||||||
|
// router.back({
|
||||||
|
// url:'pages/PatientsPage/BuildOrEditGroupPage',
|
||||||
|
// params:{'selectedPatients':this.patientsList}
|
||||||
|
// })
|
||||||
}})
|
}})
|
||||||
|
|
||||||
Row(){
|
Row(){
|
||||||
|
|||||||
@ -10,7 +10,7 @@ struct PatientDetailsPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
RelativeContainer() {
|
Column() {
|
||||||
PatientDetailsComp()
|
PatientDetailsComp()
|
||||||
}
|
}
|
||||||
.height('100%')
|
.height('100%')
|
||||||
|
|||||||
@ -1,17 +1,43 @@
|
|||||||
import { PatientsGroup } from 'patient'
|
import { PatientsGroup } from 'patient'
|
||||||
|
import { HMDefaultGlobalAnimator, HMNavigation } from '@hadss/hmrouter'
|
||||||
|
import { AttributeUpdater } from '@kit.ArkUI'
|
||||||
|
import { TabBarComp } from 'netease'
|
||||||
|
|
||||||
|
class NavModifier extends AttributeUpdater<NavigationAttribute> {
|
||||||
|
initializeModifier(instance: NavigationAttribute): void {
|
||||||
|
instance.mode(NavigationMode.Stack);
|
||||||
|
instance.navBarWidth('100%');
|
||||||
|
instance.hideTitleBar(true);
|
||||||
|
instance.hideToolBar(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Entry
|
@Entry
|
||||||
@Component
|
@Component
|
||||||
struct PatientsGroupPage {
|
struct PatientsGroupPage {
|
||||||
@Provide refreshFlag:boolean = false;
|
@Provide refreshFlag:boolean = false;
|
||||||
|
modifier: NavModifier = new NavModifier()
|
||||||
|
@State
|
||||||
|
activeIndex: number = 0
|
||||||
|
|
||||||
onPageShow(): void {
|
onPageShow(): void {
|
||||||
this.refreshFlag = !this.refreshFlag;
|
this.refreshFlag = !this.refreshFlag;
|
||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
RelativeContainer() {
|
Column() {
|
||||||
PatientsGroup();
|
HMNavigation({
|
||||||
|
navigationId:"PatientsGroupPageNavigation",
|
||||||
|
homePageUrl:'PatientsGroup',
|
||||||
|
options:{
|
||||||
|
standardAnimator:HMDefaultGlobalAnimator.STANDARD_ANIMATOR,
|
||||||
|
dialogAnimator:HMDefaultGlobalAnimator.DIALOG_ANIMATOR,
|
||||||
|
modifier:this.modifier
|
||||||
|
}
|
||||||
|
}) {
|
||||||
|
// PatientsGroup()
|
||||||
|
TabBarComp({ activeIndex: this.activeIndex})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.height('100%')
|
.height('100%')
|
||||||
.width('100%')
|
.width('100%')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user