From 1e99ff4dfafdcb84327d3d27ee71f42de0d339df Mon Sep 17 00:00:00 2001 From: XiuYun CHEN Date: Wed, 30 Jul 2025 16:22:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=BA=E8=AF=8A=E8=AE=A1=E5=88=92=E7=9B=B8?= =?UTF-8?q?=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chatkit_ui/src/main/ets/common/ChatUtils.ets | 10 +- chatkit_ui/src/main/ets/pages/ChatP2PPage.ets | 43 ++- commons/basic/Index.ets | 4 +- .../src/main/ets/components/HdTwoNav.ets | 135 ++++++++ .../src/main/ets/constants/BasicConstant.ets | 5 +- .../basic/src/main/ets/utils/ChangeUtil.ets | 25 ++ .../resources/base/media/icon_group_send.png | Bin 0 -> 2031 bytes .../src/main/resources/base/media/invite.png | Bin 0 -> 1090 bytes .../main/resources/base/media/zhiyedidian.png | Bin 0 -> 1796 bytes features/netease/oh-package.json5 | 4 +- .../main/ets/components/ItemCompArrange.ets | 19 +- .../main/ets/model/ListOutPatientModel.ets | 16 + .../netease/src/main/ets/view/AddLocation.ets | 324 +++++++++++++++++- .../src/main/ets/view/AddOutpatient.ets | 230 +++++++------ .../netease/src/main/ets/view/MessageComp.ets | 19 +- .../src/main/ets/view/PatientListComp.ets | 17 +- .../src/main/ets/view/Practicelocation.ets | 24 +- .../src/main/ets/view/ReleaseOutpatient.ets | 29 +- .../netease/src/main/ets/view/TabBarComp.ets | 13 +- .../src/main/ets/view/TabBarOutComp.ets | 41 ++- features/patient/Index.ets | 4 +- .../ets/components/FollowPlanListComp.ets | 47 ++- .../ets/components/PatientsListSearchComp.ets | 209 +++++++++++ 23 files changed, 1028 insertions(+), 190 deletions(-) create mode 100644 commons/basic/src/main/ets/components/HdTwoNav.ets create mode 100644 commons/basic/src/main/resources/base/media/icon_group_send.png create mode 100644 commons/basic/src/main/resources/base/media/invite.png create mode 100644 commons/basic/src/main/resources/base/media/zhiyedidian.png create mode 100644 features/patient/src/main/ets/components/PatientsListSearchComp.ets diff --git a/chatkit_ui/src/main/ets/common/ChatUtils.ets b/chatkit_ui/src/main/ets/common/ChatUtils.ets index f4522be..7e34ea7 100644 --- a/chatkit_ui/src/main/ets/common/ChatUtils.ets +++ b/chatkit_ui/src/main/ets/common/ChatUtils.ets @@ -94,11 +94,11 @@ export function setupMoreOperationData() { shopOperationData.imageSource = "app.media.ytx_chattingfooter_shopping"; operationMoreDataList.push(shopOperationData); //互联网医院 - const hospatilOperationData = new NEChatMoreOperationData(); - hospatilOperationData.operationTitle = $r("app.string.hospital"); - hospatilOperationData.type = NEChatMoreOperationType.Hospital; - hospatilOperationData.imageSource = "app.media.ytx_chatting_hospital"; - operationMoreDataList.push(hospatilOperationData); + // const hospatilOperationData = new NEChatMoreOperationData(); + // hospatilOperationData.operationTitle = $r("app.string.hospital"); + // hospatilOperationData.type = NEChatMoreOperationType.Hospital; + // hospatilOperationData.imageSource = "app.media.ytx_chatting_hospital"; + // operationMoreDataList.push(hospatilOperationData); // // 位置功能 // const locationOperationData = new NEChatMoreOperationData(); // locationOperationData.operationTitle = $r("app.string.chat_send_location"); diff --git a/chatkit_ui/src/main/ets/pages/ChatP2PPage.ets b/chatkit_ui/src/main/ets/pages/ChatP2PPage.ets index 2400d74..ea2fa7c 100644 --- a/chatkit_ui/src/main/ets/pages/ChatP2PPage.ets +++ b/chatkit_ui/src/main/ets/pages/ChatP2PPage.ets @@ -643,7 +643,7 @@ export struct ChatP2PPage { this.closeConsult() } else { - this.goToSettingPage(this.pathStack) + this.goToSettingPage() } }, @@ -663,16 +663,17 @@ export struct ChatP2PPage { showSelect: this.showMultiSelect, onMessageClick: { onAvatarClick: ((msg: NIMMessageInfo | undefined) => { - if (this.showMultiSelect) { - return - } + // if (this.showMultiSelect) { + // return + // } if (msg != null) { if (msg?.message.senderId == ChatKitClient.getLoginUserId()) { - this.pathStack.pushPath({ - name: 'MineInfoPage' - }) + // this.pathStack.pushPath({ + // name: 'MineInfoPage' + // }) } else { - this.pathStack.pushPath({ name: 'PersonInfoPage', param: msg?.message.senderId }) + HMRouterMgr.push({pageUrl:'PatientDetailsComp',param:{"patient_uuid":this.patientUuid}}) + // this.pathStack.pushPath({ name: 'PersonInfoPage', param: msg?.message.senderId }) } } }), @@ -1510,17 +1511,21 @@ export struct ChatP2PPage { ) } - goToSettingPage(pathStack: NavPathStack) { - if (this.showMultiSelect) { - this.chatViewModel.clearSelectMessage() - this.showMultiSelect = false - } else { - pathStack.pushPath({ - name: 'UserSettingPage', - param: this.chatViewModel.conversationId - }) - } - this.controller.stopEditing() + // goToSettingPage(pathStack: NavPathStack) { + // if (this.showMultiSelect) { + // this.chatViewModel.clearSelectMessage() + // this.showMultiSelect = false + // } else { + // pathStack.pushPath({ + // name: 'UserSettingPage', + // param: this.chatViewModel.conversationId + // }) + // } + // this.controller.stopEditing() + // } + goToSettingPage() + { + HMRouterMgr.push({pageUrl: 'PatientCommonSettingComp',param:{"title":"","patient_uuid":this.patientUuid}}) } onPageHide(): void { diff --git a/commons/basic/Index.ets b/commons/basic/Index.ets index 5c4a753..d1c96ab 100644 --- a/commons/basic/Index.ets +++ b/commons/basic/Index.ets @@ -93,4 +93,6 @@ export { PatientListModel,PatientsData } from './src/main/ets/models/PatientList export { applyListCallBacl, applyListModel, applyHistoryCallBacl , historyObjectModel, historyModel } from './src/main/ets/models/ApplyModel' -export { TripleOptionDialog } from './src/main//ets/Views/TripleOptionDialog' \ No newline at end of file +export { TripleOptionDialog } from './src/main//ets/Views/TripleOptionDialog' + +export { HdTwoNav } from './src/main/ets/components/HdTwoNav' \ No newline at end of file diff --git a/commons/basic/src/main/ets/components/HdTwoNav.ets b/commons/basic/src/main/ets/components/HdTwoNav.ets new file mode 100644 index 0000000..863acd7 --- /dev/null +++ b/commons/basic/src/main/ets/components/HdTwoNav.ets @@ -0,0 +1,135 @@ +import { router } from '@kit.ArkUI' + +@Builder +function defaultBuilder(): void { + +} + +@Component +export struct HdTwoNav { + @StorageProp('topHeight') + topHeight: number = 0 + @Prop + title: string = '' + @Prop + textColor: ResourceStr = $r('app.color.top_title') + @Prop + bgColor: ResourceStr = $r('app.color.top_bg') + @Prop + hasBorder: boolean = false + @Prop + leftIcon: ResourceStr = $r('app.media.top_back') + @Prop + rightIcon: ResourceStr = $r('sys.media.ohos_ic_public_more') + @Prop + rightIcon2: ResourceStr = $r('sys.media.ohos_ic_public_more') + @Prop + showRightIcon: boolean = true + @Prop + showRightIcon2: boolean = true + @Prop + showLeftIcon: boolean = true + @Prop + showRightText: boolean = false + @Prop + rightText: string = '' + @Prop + rightBackColor:ResourceColor = this.bgColor + @Prop + rightTextColor:ResourceColor = this.textColor + @BuilderParam + titleBuilder: () => void = defaultBuilder + @BuilderParam + menuBuilder: () => void = defaultBuilder + @Prop + isLeftAction: boolean = false + // 添加右侧点击函数 + private rightItemAction:()=> void = () => {}; + // 添加右侧点击函数 + private rightItemAction2:()=> void = () => {}; + // 添加左侧点击函数 + private leftItemAction:()=> void = () => {}; + + build() { + Row() { + if (this.showLeftIcon) { + Row() + { + Image(this.leftIcon) + .size({ width: 24, height: 24 }) + .onClick(() => this.isLeftAction? this.leftItemAction():router.back()) + .fillColor($r('app.color.black')) + } + .size({ width: 50, height: 50 }) + Blank() + .width(50) + + } else { + Blank() + .width(50) + } + Row() { + if (this.title) { + Text(this.title) + .layoutWeight(1) + .textAlign(TextAlign.Center) + .fontSize(20) + .fontColor(this.textColor) + .maxLines(1) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + } else if (this.titleBuilder) { + this.titleBuilder() + } + } + .height(56) + .width(150) + .layoutWeight(1) + + if (this.showRightIcon2) { + Row() + { + Image(this.rightIcon2) + .size({ width: 24, height: 24 }) + .objectFit(ImageFit.Contain) + .bindMenu(this.menuBuilder) + .onClick(()=>this.rightItemAction2()) + } + .size({ width: 50, height: 50 }).justifyContent(FlexAlign.End) + + } + if (this.showRightIcon) { + Row() + { + Image(this.rightIcon) + .size({ width: 24, height: 24 }) + .objectFit(ImageFit.Contain) + .bindMenu(this.menuBuilder) + .onClick(()=>this.rightItemAction()) + } + .size({ width: 50, height: 50 }).justifyContent(FlexAlign.End) + + } + else if (this.showRightText) { + Text(this.rightText) + .maxFontSize(16) + .minFontSize(6) + .maxLines(1) + .fontColor(this.rightTextColor) + .onClick(()=>this.rightItemAction()) + .width(50) + .textAlign(TextAlign.Center) + .borderRadius(5) + .backgroundColor(this.rightBackColor) + .height(35) + // .margin({right:10}) + } else { + Blank() + .width(50) + } + } + .padding({ left: 16, right: 16, top: this.topHeight }) + .height(56 + this.topHeight) + .width('100%') + .backgroundColor(this.bgColor) + } +} \ No newline at end of file diff --git a/commons/basic/src/main/ets/constants/BasicConstant.ets b/commons/basic/src/main/ets/constants/BasicConstant.ets index c1633f4..d361600 100644 --- a/commons/basic/src/main/ets/constants/BasicConstant.ets +++ b/commons/basic/src/main/ets/constants/BasicConstant.ets @@ -23,7 +23,7 @@ export class BasicConstant { // static readonly wxUrl = "https://wx.igandan.com/";// 微信服务器地址 // static readonly polvId = "21";//保利威视学员id - + static readonly getSystemTimeStamp = BasicConstant.urlImage+'manager/getSystemTimeStamp' static readonly addBonusPoints = BasicConstant.urlExpertApp+'addBonusPoints' static readonly indexV2 = BasicConstant.urlExpertAPI+'indexV2';//首页轮播 static readonly applyList = BasicConstant.urlExpert+'applyList' @@ -113,6 +113,9 @@ export class BasicConstant { static readonly updateOutPatientA= BasicConstant.urlExpertApp+"updateOutPatientA";//修改门诊安排A static readonly addOutPatient= BasicConstant.urlExpertAPI+"addOutPatient";//添加门诊安排 static readonly deleteWorkPlace= BasicConstant.urlExpertApp+"deleteWorkPlace";//执业地点-删除 + static readonly hospitalList= BasicConstant.urlExpertApp+"hospitalList";//添加职业地点-医院列表 + static readonly addWorkPlace= BasicConstant.urlExpertApp+"addWorkPlace";//执业地点-增加 + static readonly editWorkPlace= BasicConstant.urlExpertApp+"editWorkPlace";//执业地点-修改 static readonly province=['全国','北京市','天津市','河北省','山西省' ,'内蒙古自治区','辽宁省','吉林省','黑龙江省','上海市','江苏省','浙江省' ,'安徽省','福建省','江西省','山东省','河南省','湖北省','湖南省','广东省', diff --git a/commons/basic/src/main/ets/utils/ChangeUtil.ets b/commons/basic/src/main/ets/utils/ChangeUtil.ets index 8e17d3f..f8f7c0c 100644 --- a/commons/basic/src/main/ets/utils/ChangeUtil.ets +++ b/commons/basic/src/main/ets/utils/ChangeUtil.ets @@ -10,6 +10,8 @@ import { i18n } from '@kit.LocalizationKit'; import { connection } from '@kit.NetworkKit'; import http from '@ohos.net.http' import {BasicConstant} from '../constants/BasicConstant' +import { componentUtils } from '@kit.ArkUI'; + export class ChangeUtil { /** * 将HashMap转成JsonString @@ -287,4 +289,27 @@ export class ChangeUtil { const pattern = /\.(jpg|jpeg|png|gif|bmp|webp)$/i; return pattern.test(path); } + + static getColumnX(id:string):number { + const componentInfo = componentUtils.getRectangleById(id) + const screenX = componentInfo.screenOffset.x//3.38 + return screenX + } + + static getColumnY(id:string):number { + const componentInfo = componentUtils.getRectangleById(id) + const screenY = componentInfo.screenOffset.y//3.38 + return screenY + } + + static getColunmWidth(id:string):number { + const componentInfo = componentUtils.getRectangleById(id) + const width = componentInfo.size.width//3.38 + return width + } + static getColunmHeight(id:string):number { + const componentInfo = componentUtils.getRectangleById(id) + const height = componentInfo.size.height//3.38 + return height + } } \ No newline at end of file diff --git a/commons/basic/src/main/resources/base/media/icon_group_send.png b/commons/basic/src/main/resources/base/media/icon_group_send.png new file mode 100644 index 0000000000000000000000000000000000000000..6f7169cac823d24312a05f108fd12cf886ef8e05 GIT binary patch literal 2031 zcmaJ?YgiLk8V(|eC{-w16%}HDf`(*rgGeMIBm__sLP!Nfz>rK}gk)k8ns5;XEUt)^ zmaWhtw^dQr1+}6=2?9oI0R;;ckfjKr;8uYEOSy;(JE3Ct$FlQ0Gv}P|`QG4^OpBAdCf-=qNB6lF~8ynmP;` z645ciu51EZ#sFg=zeG70l*r)=6Jv$$B8=y5w1=985J*6!0Iin9Nfk6T9ka+wL-qzU zfI%<1C}ZiE-$jM6xo8F~2hpy0H=K~*MnzNI@kCcDl|pqvlL$mtfItSw1RRM>qY!8m z68hbPL88e;Vj7RhdKU{h(J?VfrHlpuDwPVaBI99sG(dEBcLxY0fJDL}9ympUR4Gv7 zqzd~b1}3Nw$|0E&f~9B!qaX^7SJE+v(%(~%$llXR74OP~6bw)cWB?IQFr>8P$Y%e4 zSBd1kw?fGS|IqtCi52_=83^z|1spFIB8?N<8$!uw3^^!J!g4+g$1PQn8v`q0MGP!M zGZ>3iLp!qtLP%;bZeK*P*))HtLMf06L4PJ4gYe)XNJJyJdwG-Gh(s3Ei%cZ?xO(lR zxG|`%3@T+Oh3QRUEMb|jFkS*ml}lLBA6U||Si?X_WJqKtD2F};MJzciK`$mwgO=4o zU@gn{4l7z-3t?F-fQSJM?ftKIFPV@TGHl-uFLHQ4{-6|@c{wuNj-^5^a=pU+nO=N# zch5JFA3xCg(Tn|M&&4JmLz_TBCC}8x?@asNFGjF|%*wpbF7HXNFaKQZ_tz&emT9jT zYj8}+a^*j|ZIW4E#HBWEGVQRIvAQC)k(fj+JVuyHZDIO38LlpUXS^BN*P!(=vV_osgcwsw+)n6F+-NSW( zG4(iZOX|KGZmGLcHpFCWoC5F8NX;$oX*>PD+2XhXz6v<%PydLE7}Q8wJ8jrbycLmk zd(U5Q!_A-Z77on3;pC_T>U&wLF!15ExQJSpo`F`|Tfny0!~lDlV9~C;q7SwYKbXe=noL{e|^nF~T`P`-1t!N)wk9#Uu5S(nLj&L%^%w; z8g@udD%U|arKxjPAdm{(SJCt^HuD8Gd44s|Av%(Havxy%Og*1-DJk|&nZ~H8D?#>C zvtEzuC}+PVH#$b$2{j)-7OX88poV?@p!RY}=F7$?cj?quVc4OcLn-F6(M_*rHT)po z@8x+t4ZgFAyos+%w#>#gsHVl~JGJ)RZrX#G_6z!e)lVZfT*yCLVii!LJ7^c}EMZ;S zLprzHH4)VXg&ZH>1Hp+&5K~3LF?fiik2-+gmbHE8aduzAUxZb0 z=gZ=%{+{JqWp;nwN1itUXho+ZLD?x;dVxj>!(*05b}KKz5F{ZxA=jhJ5IN1bCd1XRak1UO}Q|!Ctzls3?KTYEo}X+qb^9cv z8+-BlJCR*u81TxY1+nFhSo>_Bf1jgI2A?oO@kz6{o>NAphF`G14~JRdeK_quw_ZrW literal 0 HcmV?d00001 diff --git a/commons/basic/src/main/resources/base/media/invite.png b/commons/basic/src/main/resources/base/media/invite.png new file mode 100644 index 0000000000000000000000000000000000000000..11a057f3a973e40b688193d815638fdd0170e19f GIT binary patch literal 1090 zcmaJ>O-K}B7#?>~LNYtrFVh&L;?B>mo6h9wt~0y3;n=z^xDt+*IEXIPj`5S`sQOHn5PA~Rr2H$&9dXU{28*Fw~AP-bOI1mk+& ztPO@{2U6~*kV58+Nz)N>A*!G&;JLfaP-FpuCPLJ{skEFRMQ8&u zNC$l?%e9g1Jk15Uwhpe9^s`)mVFL^o@Ns^Dnv$atnDaDGh@G3-&BV-8- zlg(!7Y=DOL7{l>A&#->R@AqMZ&zUiilJl8PV@W{*j%w=`(xFMZib@7fqY#Ci?x$c_ zWm(fHmI)V($tf1Y(X5+N2`J0|hZ;s1?Vuz$@cU0;CpBXMCJ7ukZL9d;MjPEwmLS?d zLC{V?I9aMjH)1U=MN+wU znO}Q*-RmROt(*RpOVK&cT|e=mI-0#oFWt=dr*@lODnG)jVV^hOP{TD$Z>@Zcooe5H zI{0EyFgK@`@0>WhD33G_E?hL&s-{Oo+v|no`h49R@6rRybM)=d#`;d8zj@^3)<*5M z@7|rNmWS2b;wSG;&r1IOg(D4X_4B*l7G!mW^Y!7+;7QZ5zauPPQSV)T?^zA?`n*-1 Z!^Fh=>D0HKpYBhAh(`yc$2}uAegic#WBLF9 literal 0 HcmV?d00001 diff --git a/commons/basic/src/main/resources/base/media/zhiyedidian.png b/commons/basic/src/main/resources/base/media/zhiyedidian.png new file mode 100644 index 0000000000000000000000000000000000000000..32c20d4d4578d2a38fd22dbaa79370a30607697f GIT binary patch literal 1796 zcmaJ?X;2eq7>+p_8Ln0&+F&7df2r;986bQ*eA|@M?g&d9)#OlaV zEU2KAK*uUnTE@!6>Qq6j7dC2&coYxtD1wTBI65Bfbc3M%QMxm`-!aegywCf7?>D<6 zF=2(Ldw@F*hw~K03MAM_alAwV_PvLzslkTXs4y8_jbx(+nGVKr6-X8gh}5ziSOUuw zrj4C&6b|PcqLL<~$>Mmn98ptc4h+?()?#cNE-KonmC18q6v%>eR2mL>_?LDvpi*$i zYnfu2Sj&f%s#voQUTsd0%FVfQmVz9;42UwaF#$D<$^fH!gGSFba>(PlY;5k>2FbuU z1kL4;-TSP`Q`)WCS!Y}M3WXjAG?svhvtVhSjX$I)?Pgl`w+V^SOvIJV~?#SMd{1+ z+Ge=n>{mfNx4^~I-`52ydBpd{3%@RJ`C$Rs;=g$`m2uyjL`f%>1PH(Eo9&lnAK-iK z2xuj>)p(JjcwSpbJX*Rx?eLR~5fbA!Tf(YgLDxu9c-7s(FAg;~H_wOxswVW5#`4@1|+4ri?jSA}%EQKg}5G?iJZ7 zJ;%=byQy9_@2~s*?UtyX>zW>ZdttjxoN8(UhYYoa!+8B%+s^na=Y#!joym2(O*mXG zVp^?>+Vy_joeh_ddNWfxL-T{^Nyov=hKO4)c1Lx8yA(!LjXm$gaiz0v$A>K@Q6!dV zd{E%aqeW>OQ|DGT)SlkgNQc9Hhc8JECfaiL1ghiS9mrj&tRFBBgsAHX&P z-s?Ut;EC*$!EB03nu~n`QcVvc)zAq>dhpxS(cLW~dwpNt-bMid?0ojl{{lUF zh;FABypF3bsB}7Ke`^ido98;YH&rtGx>ME<`cKuju z!B0JFs40JJpZlEhr2Aq@Vdv@Ovv+zkxMht^M-10)UOW4ZrM$0pLv&wtub*Y%p}I#e zrxP~#RW)8a^J(bbc5-^@iJc;etiZihlS*t^E%mNoyJZiVtG4>leElBLpWW|!b!rY_ zY^Iqy((976>x`XkRzS@*P9HDCDmp0s>Spe-`m?(hb~NEP^|ZhE+l_|n@)?Y>rj5os O{!1cZf}n+$x#b_?%(8<3 literal 0 HcmV?d00001 diff --git a/features/netease/oh-package.json5 b/features/netease/oh-package.json5 index 3292f19..5138b28 100644 --- a/features/netease/oh-package.json5 +++ b/features/netease/oh-package.json5 @@ -13,6 +13,8 @@ "@nimsdk/base": "10.9.10", "@nimkit/common": "file:../../common", "@nimkit/localconversationkit_ui": "file:../../localconversationkit_ui", - "refreshlib": "file:../../RefreshLib" + "refreshlib": "file:../../RefreshLib", + "patient": "file:../patient" + } } \ No newline at end of file diff --git a/features/netease/src/main/ets/components/ItemCompArrange.ets b/features/netease/src/main/ets/components/ItemCompArrange.ets index 6466be1..0e7c709 100644 --- a/features/netease/src/main/ets/components/ItemCompArrange.ets +++ b/features/netease/src/main/ets/components/ItemCompArrange.ets @@ -36,9 +36,18 @@ export struct ItemCompArrange { okText:'确定', okColor:$r('app.color.top_title'), inputCallBack:(input: string,title:string)=>{ + if(this.inputPlaceholder=='您确定修改此条信息吗') + { + HMRouterMgr.push({ pageUrl: 'AddOutpatient', param: { + item: this.item, isHistory: 'true' + } }) + } + else + { + this.deleteUuid=this.item.uuid + this.delete=!this.delete + } - this.deleteUuid=this.item.uuid - this.delete=!this.delete } }), keyboardAvoidDistance: LengthMetrics.vp(0), // 设置弹窗底部与键盘顶部间距(单位:vp) @@ -141,7 +150,10 @@ export struct ItemCompArrange { .fontSize(14) } .margin({right:30}) - + .onClick(()=>{ + this.inputPlaceholder='您确定修改此条信息吗' + this.dialog.open() + }) Row() { Image($r('app.media.delete_icon')).width(15).height(15).margin({right:5}) @@ -150,6 +162,7 @@ export struct ItemCompArrange { .fontSize(14) } .onClick(()=>{ + this.inputPlaceholder='您确定删除此条信息吗' this.dialog.open() }) diff --git a/features/netease/src/main/ets/model/ListOutPatientModel.ets b/features/netease/src/main/ets/model/ListOutPatientModel.ets index ec1fd43..26b277b 100644 --- a/features/netease/src/main/ets/model/ListOutPatientModel.ets +++ b/features/netease/src/main/ets/model/ListOutPatientModel.ets @@ -34,8 +34,24 @@ export interface ListOut{ day:string; hospital_address:string; hospital_name:string; + hospital_uuid:string } +export interface HospitalListBean { + code:string; + data:HospitalList[]; + message:string; + + +} + +export interface HospitalList{ + + uuid:string; + name:string; + + +} diff --git a/features/netease/src/main/ets/view/AddLocation.ets b/features/netease/src/main/ets/view/AddLocation.ets index 85a610c..eddae6d 100644 --- a/features/netease/src/main/ets/view/AddLocation.ets +++ b/features/netease/src/main/ets/view/AddLocation.ets @@ -1,18 +1,125 @@ import { HMRouter, HMRouterMgr } from "@hadss/hmrouter"; -import { HdNav } from "@itcast/basic"; +import { BaseBean, BasicConstant, ChangeUtil, hdHttp, HdLoadingDialog, HdNav, HdResponse } from "@itcast/basic"; +import { HospitalList, HospitalListBean, ListOut } from "../model/ListOutPatientModel"; +import { HashMap } from "@kit.ArkTS"; +import { BusinessError } from "@kit.BasicServicesKit"; +import { StringIsEmpty } from "@nimkit/common"; +import { LengthMetrics, promptAction } from "@kit.ArkUI"; @HMRouter({ pageUrl: 'AddLocation' }) @Component export struct AddLocation{ + param = HMRouterMgr.getCurrentParam() as HmParam; + @State showDropdown: number = -1 // 当前下拉的index,-1为无 @State typeIndex: number = -1 typeOptions: string[] = ['普通门诊', '专家门诊', '特需门诊', '专科/专病门诊'] + @State hospitalOptions:HospitalList[]=[] @State hospital_name:string='' + @State hospital_uuid:string='' + @State office_name:string='' + @State location:string='' + @State select:boolean=false + @State title:string='新增执业地点' + @State buttonTitle:string='确定发布' + @State url:string=BasicConstant.addWorkPlace + dialog: CustomDialogController = new CustomDialogController({ + builder: HdLoadingDialog({ message: '加载中...' }), + customStyle: true, + alignment: DialogAlignment.Center + }) + hospitalList(name:string) { + + const hashMap: HashMap = new HashMap(); + hashMap.set('name',name) + hdHttp.httpReqObject(BasicConstant.hospitalList,hashMap).then(async (res: HdResponse) => { + + let json:HospitalListBean = JSON.parse(res+'') as HospitalListBean; + if(json.code == '200') { + if(json.data!=null&&json.data.length>0) + { + this.hospitalOptions=[] + this.hospitalOptions=[...json.data] + this.showDropdown=-2 + } + } else { + this.showDropdown=-1 + } + }).catch((err: BusinessError) => { + + console.info(`Response fails: ${err}`); + }) + + } + addWorkPlace() { + this.dialog.open() + const hashMap: HashMap = new HashMap(); + hashMap.set('hospital_uuid',this.hospital_uuid) + hashMap.set('office_name',this.hospital_name) + hashMap.set('location',this.location) + hashMap.set('type',(this.typeIndex+1)+'') + if('true'==this.param.isHistory) { + hashMap.set('uuid',this.param.item.uuid) + this.url=BasicConstant.editWorkPlace + } + hdHttp.httpReq(this.url,hashMap).then(async (res: HdResponse) => { + this.dialog.close() + let json:BaseBean = JSON.parse(res+'') as BaseBean; + if(json.code == '200') { + HMRouterMgr.pop() + } else { + promptAction.showToast({ message: json.message }) + } + }).catch((err: BusinessError) => { + + console.info(`Response fails: ${err}`); + }) + + } + + private dialogPublish!:CustomDialogController; + + initDialog() { + this.dialogPublish = new CustomDialogController({ + builder:PerfactInputSheets({ + controller:this.dialogPublish, + hospital:this.hospital_name, + office:this.office_name, + local:this.location, + type:this.typeOptions[this.typeIndex], + inputCallBack:()=>{ + this.addWorkPlace() + } + }), + keyboardAvoidDistance: LengthMetrics.vp(0), // 设置弹窗底部与键盘顶部间距(单位:vp) + alignment: DialogAlignment.Center, + customStyle: true, + autoCancel: false, + backgroundColor: ('rgba(0,0,0,0.5)'), + height: '100%' + }) + } + + aboutToAppear(): void { + if('true'==this.param.isHistory) + { + this.select=true + this.title='修改执业地点' + this.buttonTitle='确认修改' + this.hospital_uuid=this.param.item.hospital_uuid + this.hospital_name=this.param.item.hospital_name + this.office_name=this.param.item.office_name + this.location=this.param.item.location + this.typeIndex=this.param.item.type-1 + + } + this. initDialog() + } build() { Column() { HdNav({ - title: '新增执业地点', + title: this.title, showRightIcon: false, hasBorder: true, isLeftAction: true, @@ -33,10 +140,34 @@ export struct AddLocation{ } .fontSize(18) TextInput({ placeholder: '请输入您的医院', text: $$this.hospital_name }) + .id('hospitalchoose') .customStyle() + .onChange((value: string) => { + if(!StringIsEmpty(value)) + { + if(this.select) + { + this.select=!this.select + } + else + { + // 文本内容发生变化时触发该回调 + this.hospitalList(value) + } + } + else + { + + this.hospitalOptions=[] + this.showDropdown=-1 + } + + }) } + .customStyleR() + Text().customStyleT() Row(){ Text() @@ -46,7 +177,7 @@ export struct AddLocation{ } .fontSize(18) - TextInput({ placeholder: '请输入您的科室', text: $$this.hospital_name }) + TextInput({ placeholder: '请输入您的科室', text: $$this.office_name }) .customStyle() } .customStyleR() @@ -59,7 +190,7 @@ export struct AddLocation{ } .fontSize(18) - TextInput({ placeholder: '如门诊楼东侧502室', text: $$this.hospital_name }) + TextInput({ placeholder: '如门诊楼东侧502室', text: $$this.location }) .customStyle() } .customStyleR() @@ -88,13 +219,14 @@ export struct AddLocation{ }.layoutWeight(1) }) }.padding({ left: 10}).width('100%') + Text().height(20).width('100%') } .backgroundColor(Color.White) .width('100%') - + Blank() Column() { - Text('确定增加') + Text(this.buttonTitle) .height(42) .width(168) .fontSize(17) @@ -108,8 +240,59 @@ export struct AddLocation{ .height(57) .backgroundColor(Color.White) .onClick(() => { + if(this.hospital_uuid=='') + { + promptAction.showToast({ message: '请输入您的医院' }); + return + } + if(StringIsEmpty(this.hospital_name)) + { + promptAction.showToast({ message: '请输入您的科室' }); + return + } + if(StringIsEmpty(this.location)) + { + promptAction.showToast({ message: '请填写您的地址' }); + return + } + if(this.typeIndex==-1) + { + promptAction.showToast({ message: '请选择门诊类型' }); + return + } + this.dialogPublish.open() + }) + // 悬浮下拉菜单 + Column() { + ForEach(this.hospitalOptions, (hospital: HospitalList, pidx: number) => { + Text(hospital.name) + .width('100%') + .padding({left:14}) + .textAlign(TextAlign.Start) + .height(40) + .fontSize(12) + .fontColor($r('app.color.common_gray_03')) + .onClick(() => { + this.hospital_name=hospital.name + this.hospital_uuid=hospital.uuid + this.hospitalOptions=[] + this.showDropdown=-1 + this.select=!this.select + }) - + }) + } + .zIndex(999) + .clip(false) + .backgroundColor(Color.White) + .borderColor($r('app.color.999999')) + .borderWidth(1) + .borderRadius(4) + .visibility(this.showDropdown == -1 ? Visibility.None:Visibility.Visible) + .width(px2vp(ChangeUtil.getColunmWidth('hospitalchoose'))) + .position({ + x: px2vp(ChangeUtil.getColumnX('hospitalchoose')), + y: px2vp(ChangeUtil.getColumnY('hospitalchoose')+ChangeUtil.getColunmHeight('hospitalchoose')) }) } .width('100%') @@ -142,4 +325,129 @@ function customStyleT() { .width("95%") .height(0.5) .backgroundColor($r('app.color.home_gray')) -} \ No newline at end of file +} + +@CustomDialog +export struct PerfactInputSheets { + controller:CustomDialogController; + + @Prop inputTitle:string = '执业地点'; + + + // 添加回调函数属性 + @State okColor:ResourceStr=$r('app.color.top_title') + @State cancelColor:ResourceStr='#333333' + @State okText:ResourceStr='确定发布' + @State cancelText:ResourceStr='返回修改' + @State hospital:string='' + @State local:string='' + @State office:string='' + @State type:string='' + private inputCallBack: () => void = () => {}; + @State needcancelCallBack:boolean=false + // 修改构造函数 + constructor(controller: CustomDialogController, inputCallBack: () => void) { + super(); + this.controller = controller; + this.inputCallBack = inputCallBack; + } + + build() { + + Row(){ + Column() { + Text(this.inputTitle) + .fontSize(18) + .padding(20) + .width('100%') + .textAlign(TextAlign.Center) + .fontColor('#444444') + Row() { + Text('医院:') + .fontColor('#444444') + .fontSize(14) + Text(this.hospital) + .fontColor(Color.Red).padding({ left: 3 }) + .fontSize(14) + .layoutWeight(1) + }.margin({ top: 10 }).padding({ left: 10, right: 10 }) + .width('79%') + .alignItems(VerticalAlign.Top) + Row() { + Text('科室:') + .fontColor('#444444') + .fontSize(14) + Text(this.office) + .fontColor($r('app.color.common_gray_03')).padding({ left: 3 }) + .fontSize(14) + .layoutWeight(1) + }.margin({ top: 10 }).padding({ left: 10, right: 10 }) + .width('79%') + .alignItems(VerticalAlign.Top) + Row() { + Text('地址:') + .fontColor('#444444') + .fontSize(14) + Text(this.local) + .fontColor($r('app.color.common_gray_03')).padding({ left: 3 }) + .fontSize(14) + .layoutWeight(1) + }.margin({ top: 10 }).padding({ left: 10, right: 10 }) + .width('79%') + .alignItems(VerticalAlign.Top) + Row() { + Text('门诊类型:') + .fontColor('#444444') + .fontSize(14) + Text(this.type) + .fontColor($r('app.color.common_gray_03')).padding({ left: 3 }) + .fontSize(14) + .layoutWeight(1) + }.margin({ top: 10 }).padding({ left: 10, right: 10 }) + .width('79%') + .alignItems(VerticalAlign.Top) + Text().width(20).height(20) + + .margin({ top: 10 }).padding({ left: 10, right: 10 }) + Text('').height(1).width('100%') + .backgroundColor($r('app.color.home_gray')).margin({ top: 10 }) + Row() { + Text(this.cancelText) + .fontSize(15) + .fontColor(this.cancelColor) + .textAlign(TextAlign.Center) + + .height(30) + .layoutWeight(1) + .onClick(() => { + + this.controller.close() + }) + Text('').height(30).width(1) + .backgroundColor($r('app.color.home_gray')) + Text(this.okText) + .textAlign(TextAlign.Center) + .fontColor(this.okColor) + .fontSize(15) + .onClick(() => { + + this.controller.close() + this.inputCallBack(); + }) + + .height(30) + .layoutWeight(1) + + + }.margin({ top: 10, bottom: 10 }).width('100%') + } + + .width('80%').backgroundColor(Color.White) + }.borderRadius(24) + + } +} +export interface HmParam{ + item:ListOut, + isHistory:string +} diff --git a/features/netease/src/main/ets/view/AddOutpatient.ets b/features/netease/src/main/ets/view/AddOutpatient.ets index 61ddb3a..4c88f9b 100644 --- a/features/netease/src/main/ets/view/AddOutpatient.ets +++ b/features/netease/src/main/ets/view/AddOutpatient.ets @@ -17,13 +17,22 @@ import { ListOut, ListWorkPlaceBean } from '../model/ListOutPatientModel'; @HMRouter({ pageUrl: 'AddOutpatient' }) @Component export struct AddOutpatient { + @State url:string=BasicConstant.addOutPatient + @State title:string='增加门诊安排' + @State buttonTitle:string='确定发布' + @State time:string='' + @State local:string='' + @State lineHeight:Length[]=[] @State locaIndex: number = -1 @State uuid: string = '' + private listScroller: Scroller = new Scroller() + param = HMRouterMgr.getCurrentParam() as HmParam; @State data: ListOut[] = []; weekOptions: string[] = ['周一', '周二', '周三', '周四', '周五', '周六', '周日', ''] controller: TextAreaController = new TextAreaController(); @State timeIndex: number = -1 @State timePeriodOptions: string[] = ['上午', '下午', '晚上', '全天'] + @State timePeriod: string[] = ['a', 'b', 'c', 'd'] @State weekIndexList: number[] = [] // 新增多选星期索引 // 新增 weekOptions 多选(每行4个,自动换行) weekChunks = this.chunkArray(this.weekOptions, 4); @@ -53,7 +62,11 @@ export struct AddOutpatient { if (json.list != null) { this.data = json.list; } + if('true'==this.param.isHistory) + { + this.locaIndex=this.data.findIndex((item) => item.uuid == this.param.item.workplace_uuid) + } } else { promptAction.showToast({ message: json.message, duration: 1000 }) @@ -67,23 +80,43 @@ export struct AddOutpatient { } addStopOutPatient() { + let weeks='' + this.weekIndexList.forEach(item=>{ + let tmp=item+1 + if('true'==this.param.isHistory) + { + weeks=weeks+tmp + } + else + { + weeks=weeks+tmp+',' + } + + }) this.dialog.open() - // const hashMap: HashMap = new HashMap(); - // hashMap.set('type',this.reasonIndex+1+'') - // hashMap.set('note',this.noteText) - // hashMap.set('date_list', this.reasonIndex === 2 ? this.date_list_temp : this.date_list_normal) - // hdHttp.httpReqObject(BasicConstant.addStopOutPatient,hashMap).then(async (res: HdResponse) => { - // this.dialog.close() - // let json:BaseBean = JSON.parse(res+'') as BaseBean; - // if(json.code == '200') { - // HMRouterMgr.pop() - // } else { - // promptAction.showToast({ message: json.message }) - // } - // }).catch((err: BusinessError) => { - // - // console.info(`Response fails: ${err}`); - // }) + const hashMap: HashMap = new HashMap(); + hashMap.set('workplace_uuid',this.data[this.locaIndex].uuid) + hashMap.set('week',weeks) + hashMap.set('day',this.timePeriod[this.timeIndex] ) + hashMap.set('type','1') + hashMap.set('note','') + if('true'==this.param.isHistory) { + hashMap.set('uuid',this.param.item.uuid) + this.url=BasicConstant.updateOutPatientA + } + + hdHttp.httpReq(this.url,hashMap).then(async (res: HdResponse) => { + this.dialog.close() + let json:BaseBean = JSON.parse(res+'') as BaseBean; + if(json.code == '200') { + HMRouterMgr.pop() + } else { + promptAction.showToast({ message: json.message }) + } + }).catch((err: BusinessError) => { + + console.info(`Response fails: ${err}`); + }) } @@ -93,9 +126,8 @@ export struct AddOutpatient { this.dialogPublish = new CustomDialogController({ builder: PerfactInputSheets({ controller: this.dialogPublish, - // reasonOptions:this.reasonOptions[this.reasonIndex], - // noteText:this.noteText, - // date_list:this.reasonIndex === 2 ? this.date_list_temp : this.date_list_normal, + time:this.time, + local:this.local, inputCallBack: () => { this.addStopOutPatient() @@ -115,6 +147,14 @@ export struct AddOutpatient { aboutToAppear(): void { + if('true'==this.param.isHistory) + { + this.title='修改门诊安排' + this.buttonTitle='确认修改' + this.timeIndex=this.timePeriod.indexOf(this.param.item.day) + this.weekIndexList.push(this.param.item.week-1) + // this.locaIndex=this.data.findIndex((item) => item.workplace_uuid === param.item.workplace_uuid) + } this.initDialog() this.getList() @@ -123,7 +163,7 @@ export struct AddOutpatient { build() { Column() { HdNav({ - title: '增加门诊安排', + title: this.title, showRightIcon: false, hasBorder: true, isLeftAction: true, @@ -167,7 +207,15 @@ export struct AddOutpatient { if (this.weekIndexList.indexOf(rowIndex * 4 + index) !== -1) { this.weekIndexList = this.weekIndexList.filter(i => i !== rowIndex * 4 + index) } else { - this.weekIndexList = [...this.weekIndexList, rowIndex * 4 + index] + if('true'==this.param.isHistory) { + this.weekIndexList =[] + this.weekIndexList = [...this.weekIndexList, rowIndex * 4 + index] + } + else + { + this.weekIndexList = [...this.weekIndexList, rowIndex * 4 + index] + } + } }) } else { @@ -217,10 +265,10 @@ export struct AddOutpatient { .padding(10) .width('100%') .textAlign(TextAlign.Start) - List() { + List({ scroller: this.listScroller }) { ForEach(this.data, (item: ListOut, index) => { ListItem() { - Stack() + RelativeContainer() { Column() { Text(item.hospital_name) @@ -258,6 +306,10 @@ export struct AddOutpatient { this.locaIndex=index }) .id('locationlist'+index) + .onAreaChange((oldVal, newVal) => { + this.lineHeight.push(newVal.height) + + }) .padding({ left: 10, right: 10, bottom: 10 }) .alignItems(HorizontalAlign.Start) .borderWidth(1) @@ -267,13 +319,16 @@ export struct AddOutpatient { Image($r('app.media.addoutpa_true')) .width(38) .height(38) - .position({ x: 0, y: '5%' }) // 右下角 - // .offset({ x: -10, y: -10 }) // 距离右下角10px - } - + .alignRules( + { + right: { anchor: 'locationlist'+index, align: HorizontalAlign.End }, + bottom:{ anchor: 'locationlist'+index, align:VerticalAlign.Bottom} + } + ) + .visibility(this.locaIndex==index ?Visibility.Visible:Visibility.None) + }.height(this.lineHeight[index]) } - }) } .layoutWeight(1) @@ -283,15 +338,15 @@ export struct AddOutpatient { color:Color.White }) .edgeEffect(EdgeEffect.None) - .layoutWeight(1) .clip(true) } .backgroundColor(Color.White) .width('100%') + // .padding({bottom:57}) + .layoutWeight(1) - Blank() Column() { - Text('确定发布') + Text(this.buttonTitle) .height(42) .width(168) .fontSize(17) @@ -305,7 +360,25 @@ export struct AddOutpatient { .height(57) .backgroundColor(Color.White) .onClick(() => { - + this.time='' + this.local='' + if(this.timeIndex==-1|| this.weekIndexList.length<1) + { + promptAction.showToast({ message: '请选择门诊时间' }) + return + } + if(this.locaIndex==-1) + { + promptAction.showToast({ message: '请选择门诊地点' }) + return + } + this.weekIndexList.forEach(item=>{ + this.time=this.time+this.weekOptions[item]+',' + }) + this.time=this.time.slice(0,-1) + this.time=this.time+' '+this.timePeriodOptions[this.timeIndex] + this.local=this.data[this.locaIndex].hospital_name+';'+this.data[this.locaIndex].office_name+';' + +this.data[this.locaIndex].location+';'+this.getoutpatientType(this.data[this.locaIndex].type) this.dialogPublish.open() }) @@ -341,18 +414,17 @@ export struct AddOutpatient { export struct PerfactInputSheets { controller:CustomDialogController; - @Prop inputTitle:string = '公告内容'; - @Prop inputPlaceholder:string = '' + @Prop inputTitle:string = '门诊时间'; + // 添加回调函数属性 @State okColor:ResourceStr=$r('app.color.top_title') @State cancelColor:ResourceStr='#333333' @State okText:ResourceStr='确定发布' @State cancelText:ResourceStr='返回修改' - @State reasonOptions:string='' - @State noteText:string='' + @State time:string='' + @State local:string='' - @State date_list: DateListBean[] = [] private inputCallBack: () => void = () => {}; @State needcancelCallBack:boolean=false // 修改构造函数 @@ -372,81 +444,32 @@ export struct PerfactInputSheets { .width('100%') .textAlign(TextAlign.Center) .fontColor('#444444') - - - Text('停诊原因:' + this.reasonOptions) - .fontSize(14) - .fontColor('#444444') - .backgroundColor(Color.White) - .padding({ left: 10, right: 10 }) - .width('79%') - Row() { - Text('停诊时间:') + Text('门诊时间:') .fontColor('#444444') .fontSize(14) - Text(this.date_list[0].param1 + ' 至 ' + this.date_list[0].param2) - .fontColor($r('app.color.common_gray_03')).padding({ left: 3 }) + Text(this.time) + .fontColor(Color.Red).padding({ left: 3 }) .fontSize(14) + .layoutWeight(1) }.margin({ top: 10 }).padding({ left: 10, right: 10 }) .width('79%') - if (this.date_list.length > 1) { - Row() { - Text('停诊时间:') - .fontColor('#444444') - .fontSize(14) - .visibility(Visibility.Hidden) - Text(this.date_list[1].param1 + " 至 " + this.date_list[1].param2) - .fontColor('#444444').padding({ left: 3 }) - .fontSize(14) - }.margin({ top: 10 }).padding({ left: 10, right: 10 }) - .width('79%') - } - - if (this.date_list.length > 2) { - Row() { - Text('停诊时间:') - .fontColor('#444444') - .fontSize(14) - .visibility(Visibility.Hidden) - Text(this.date_list[2].param1 + " 至 " + this.date_list[2].param2) - .fontColor('#444444').padding({ left: 3 }) - .fontSize(14) - } - .width('79%') - .margin({ top: 10 }).padding({ left: 10, right: 10 }) - } - - Row() { - Text() - { - Span('备').fontColor('#444444') - Span('备注').fontColor(Color.Transparent) - Span('注:').fontColor('#444444') - } - .fontColor('#444444') - .fontSize(14) - - Text(this.noteText) - .fontColor('#444444').padding({ left: 3 }) - .fontSize(14) - .textAlign(TextAlign.Start) - .layoutWeight(1) - }.margin({ top: 10 }).padding({ left: 10, right: 10 }) - .alignItems(VerticalAlign.Top) - .width('79%') - .visibility(this.noteText?Visibility.Visible:Visibility.None) - - Text().width(20).height(20) + .alignItems(VerticalAlign.Top) Row() { - Text('停诊时间:') + Text('门诊地点:') .fontColor('#444444') .fontSize(14) - .visibility(Visibility.Hidden) - Text(TimestampUtil.getTodayChinese()+'由医生本人发布') + Text(this.local) .fontColor($r('app.color.common_gray_03')).padding({ left: 3 }) .fontSize(14) - } + .layoutWeight(1) + }.margin({ top: 10 }).padding({ left: 10, right: 10 }) + .width('79%') + .alignItems(VerticalAlign.Top) + + + Text().width(20).height(20) + .margin({ top: 10 }).padding({ left: 10, right: 10 }) Text('').height(1).width('100%') .backgroundColor($r('app.color.home_gray')).margin({ top: 10 }) @@ -486,3 +509,8 @@ export struct PerfactInputSheets { } } + +export interface HmParam{ + item:ListOut, + isHistory:string +} diff --git a/features/netease/src/main/ets/view/MessageComp.ets b/features/netease/src/main/ets/view/MessageComp.ets index fdf5a39..0cf2535 100644 --- a/features/netease/src/main/ets/view/MessageComp.ets +++ b/features/netease/src/main/ets/view/MessageComp.ets @@ -1,10 +1,12 @@ -import { BasicConstant,HdNav } from '@itcast/basic' +import { HMRouterMgr } from '@hadss/hmrouter'; +import { BasicConstant, HdTwoNav } from '@itcast/basic' import { ChatKitClient, ContactRepo, IMKitConfigCenter, LocalConversationRepo } from '@nimkit/chatkit'; import { ChatKitConfig } from '@nimkit/chatkit_ui/src/main/ets/ChatKitConfig'; import { CommonConstants } from '@nimkit/common'; import { LocalConversationPage } from '@nimkit/localconversationkit_ui'; import { V2NIMFriendAddApplication } from '@nimsdk/base'; +import { router } from '@kit.ArkUI'; @ComponentV2 export struct MessageComp { @@ -63,12 +65,15 @@ export struct MessageComp { build() { // Navigation(this.pathStack) { Column() { - HdNav({ title: '患者消息', showRightIcon: true, showLeftIcon: true,showRightText:false,rightIcon:$r('app.media.selected_hospital_ws'),rightItemAction:()=>{ - // router.pushUrl({ - // url:'pages/SearchPage/VideoSearchPage', - // params:{'pageName':'视频'} - // }) - }}) + HdTwoNav({ title: '患者消息', showRightIcon: true,showRightIcon2: true, showLeftIcon: true,showRightText:false, + rightIcon2:$r('app.media.selected_hospital_ws'), rightIcon:$r('app.media.icon_group_send'),rightItemAction:()=>{ + router.pushUrl({ + url:'pages/PatientsPage/GroupSendMessagePage', + }) + + },rightItemAction2:()=>{ + HMRouterMgr.push({pageUrl:'PatientsListSearchComp'}) + }}) LocalConversationPage({ onUreadMessageChange: this.onUreadMessageChange, diff --git a/features/netease/src/main/ets/view/PatientListComp.ets b/features/netease/src/main/ets/view/PatientListComp.ets index 63bbb26..b91f74b 100644 --- a/features/netease/src/main/ets/view/PatientListComp.ets +++ b/features/netease/src/main/ets/view/PatientListComp.ets @@ -3,18 +3,20 @@ import { applyListModel, authStore, BasicConstant, ChangeUtil, - hdHttp, HdLoadingDialog,HdNav, HdResponse, + hdHttp, HdLoadingDialog, HdResponse, + HdTwoNav, PatientData, patientDbManager, PatientListModel, PatientsData, preferenceStore} from '@itcast/basic' import { Groups } from '../model/Groups'; -import { display, promptAction } from '@kit.ArkUI'; +import { display, promptAction, router } from '@kit.ArkUI'; import { StringIsEmpty } from '@nimkit/common'; import I18n from '@ohos.i18n'; import Intl from '@ohos.intl'; import { BusinessError } from '@kit.BasicServicesKit'; +import { HMRouterMgr } from '@hadss/hmrouter'; let collator = new Intl.Collator(I18n.System.getSystemLocale(), { usage: 'sort', @@ -174,7 +176,16 @@ export struct PatientListComp { build() { Column() { - HdNav({ title: '患者消息', showRightIcon: true, showLeftIcon: true,showRightText:false,rightIcon:$r('app.media.selected_hospital_ws')}) + HdTwoNav({ title: '我的患者', showRightIcon: true,showRightIcon2: true, showLeftIcon: true,showRightText:false, + rightIcon2:$r('app.media.selected_hospital_ws'), rightIcon:$r('app.media.invite'),rightItemAction:()=>{ + router.pushUrl({ + url:'pages/WebView/WebPage', + params:{"title":'随访二维码',"url":BasicConstant.wxUrl+'expert/expertcodeimg?expert_uuid='+authStore.getUser().uuid} + }) + + },rightItemAction2:()=>{ + HMRouterMgr.push({pageUrl:'PatientsListSearchComp'}) + }}) Stack({ }) { List({ scroller: this.scroller, space: 0, initialIndex: 0 }) { ListItem() { diff --git a/features/netease/src/main/ets/view/Practicelocation.ets b/features/netease/src/main/ets/view/Practicelocation.ets index 7cd1956..3063123 100644 --- a/features/netease/src/main/ets/view/Practicelocation.ets +++ b/features/netease/src/main/ets/view/Practicelocation.ets @@ -22,6 +22,7 @@ export struct Practicelocation { @State data: ListOut[] = []; @State isEmptyViewVisible: boolean = false; // 控制显隐的状态变量 @State deleteUuid:string='' + @State editIndex:number=-1 dialog: CustomDialogController = new CustomDialogController({ builder: HdLoadingDialog({ message: '加载中...' }), customStyle: true, @@ -91,7 +92,17 @@ export struct Practicelocation { okText:'确定', okColor:$r('app.color.top_title'), inputCallBack:(input: string,title:string)=>{ - this.deleteWorkPlace() + if(this.inputPlaceholder=='您确定修改此条信息吗') + { + HMRouterMgr.push({ pageUrl: 'AddLocation', param: { + item: this.data[this.editIndex], isHistory: 'true' + } }) + } + else + { + this.deleteWorkPlace() + } + } }), @@ -189,7 +200,11 @@ export struct Practicelocation { .fontSize(14) } .margin({right:30}) - + .onClick(()=>{ + this.editIndex=index + this.inputPlaceholder='您确定修改此条信息吗' + this.dialogs.open() + }) Row() { Image($r('app.media.delete_icon')).width(15).height(15).margin({right:5}) @@ -199,6 +214,7 @@ export struct Practicelocation { } .onClick(()=>{ this.deleteUuid=item.uuid + this.inputPlaceholder='您确定删除此条信息吗' this.dialogs.open() }) @@ -243,7 +259,9 @@ export struct Practicelocation { .height(57) .backgroundColor(Color.White) .onClick(() => { - HMRouterMgr.push({ pageUrl: 'AddLocation' }) + HMRouterMgr.push({ pageUrl: 'AddLocation', param: { + isHistory: 'false' + } }) }) diff --git a/features/netease/src/main/ets/view/ReleaseOutpatient.ets b/features/netease/src/main/ets/view/ReleaseOutpatient.ets index 58eac3a..4015969 100644 --- a/features/netease/src/main/ets/view/ReleaseOutpatient.ets +++ b/features/netease/src/main/ets/view/ReleaseOutpatient.ets @@ -1,6 +1,7 @@ import { hdHttp, HdResponse, BasicConstant, BaseBean, HdLoadingDialog, TimestampUtil, - preferenceStore} from '@itcast/basic' + preferenceStore, + ChangeUtil} from '@itcast/basic' import { BusinessError } from '@kit.BasicServicesKit'; import promptAction from '@ohos.promptAction'; import { HdNav ,DatePickerDialog} from '@itcast/basic'; @@ -96,7 +97,7 @@ export struct ReleaseOutpatient { if (this.datePickerType === 'start') { - if (date < TimestampUtil.getToday()|| date > this.tmp_list[this.datePickerIndex].param2) { + if (date < TimestampUtil.getToday()|| date > this.tmp_list[this.datePickerIndex].param2&&this.tmp_list[this.datePickerIndex].param2!='') { if (date < TimestampUtil.getToday()) { promptAction.showToast({ message: '不能发布过期时间' }); @@ -412,15 +413,15 @@ export struct ReleaseOutpatient { } .zIndex(999) .clip(false) - .backgroundColor(Color.Yellow) + .backgroundColor(Color.White) .borderColor($r('app.color.999999')) .borderWidth(1) .borderRadius(4) .visibility(this.showTimePeriodDropdown == -1 ? Visibility.None:Visibility.Visible) - .width(px2vp(getColunmWidth(`id_${this.showTimePeriodDropdown}`))) + .width(px2vp(ChangeUtil.getColunmWidth(`id_${this.showTimePeriodDropdown}`))) .position({ - x: px2vp(getColumnX(`id_${this.showTimePeriodDropdown}`)), - y: px2vp(getColumnY(`id_${this.showTimePeriodDropdown}`)) + x: px2vp(ChangeUtil.getColumnX(`id_${this.showTimePeriodDropdown}`)), + y: px2vp(ChangeUtil.getColumnY(`id_${this.showTimePeriodDropdown}`)) }) } .width('100%') @@ -431,23 +432,7 @@ export struct ReleaseOutpatient { } -function getColumnX(id:string):number { - const componentInfo = componentUtils.getRectangleById(id) - const screenX = componentInfo.screenOffset.x//3.38 - return screenX -} -function getColumnY(id:string):number { - const componentInfo = componentUtils.getRectangleById(id) - const screenY = componentInfo.screenOffset.y//3.38 - return screenY -} - -function getColunmWidth(id:string):number { - const componentInfo = componentUtils.getRectangleById(id) - const width = componentInfo.size.width//3.38 - return width -} @CustomDialog export struct PerfactInputSheets { diff --git a/features/netease/src/main/ets/view/TabBarComp.ets b/features/netease/src/main/ets/view/TabBarComp.ets index 6041dfc..f5c3b4e 100644 --- a/features/netease/src/main/ets/view/TabBarComp.ets +++ b/features/netease/src/main/ets/view/TabBarComp.ets @@ -3,6 +3,8 @@ import { TabBarItems } from '../components/TabBarItems' import { BasicConstant } from '@itcast/basic' import { MessageComp } from '../view/MessageComp' import { PatientListComp } from './PatientListComp' +import { FollowPlanListComp } from 'patient' +import { HMRouterMgr } from '@hadss/hmrouter' @Component export struct TabBarComp { @@ -37,7 +39,7 @@ export struct TabBarComp { // if (index === 0) MessageComp({ pathStack: this.pathStack }) if (index === 0) MessageComp() else if (index === 1) PatientListComp() - // else if (index === 2) MyHomePage() + else if (index === 2) FollowPlanListComp() } .tabBar(this.TabBarBuilder(item, index)) @@ -51,6 +53,15 @@ export struct TabBarComp { .margin({ bottom: this.bottomHeight }) .onTabBarClick((index) => { this.activeIndex = index + // if(index==2) + // { + // HMRouterMgr.push({pageUrl:"FollowPlanListComp", + // param:{ + // "patient_uuid":'', + // "FollowUpUuid":'', + // "nickname":'', + // "realName":''}}) + // } }) // }.mode(NavigationMode.Auto) // .hideTitleBar(true) diff --git a/features/netease/src/main/ets/view/TabBarOutComp.ets b/features/netease/src/main/ets/view/TabBarOutComp.ets index 96b5ab9..92256af 100644 --- a/features/netease/src/main/ets/view/TabBarOutComp.ets +++ b/features/netease/src/main/ets/view/TabBarOutComp.ets @@ -10,6 +10,7 @@ import { PatientNoticeModel } from '../model/PatientNoticeModel' import { promptAction } from '@kit.ArkUI' import { ArrangementsComp } from './ArrangementsComp' import { StopOutPatientListModel } from '../model/StopOutPatientListModel' +import { ListWorkPlaceBean } from '../model/ListOutPatientModel' @Component export struct TabBarOutComp { @@ -21,9 +22,11 @@ export struct TabBarOutComp { @State uuid:string='' @State textInfo:string='发布新的停诊' @State stopnum: number = 0 + @State worknum: number = 0 aboutToAppear() { this.mailanNoticeGet() this.stopOutPatientList() + this.listWorkPlace() } @@ -49,7 +52,9 @@ export struct TabBarOutComp { { Column() { - HdNav({ title: '出/停诊公告', showLeftIcon: true, showRightIcon: false}) + HdNav({ title: '出/停诊公告', showLeftIcon: true, showRightIcon: true,rightIcon:$r('app.media.zhiyedidian'),rightItemAction:()=> { + HMRouterMgr.push({ pageUrl: 'Practicelocation' }) + }}) Tabs({ index: this.activeIndex }) { @@ -118,7 +123,17 @@ export struct TabBarOutComp { } else if(this.activeIndex==1) { - HMRouterMgr.push({ pageUrl: 'AddOutpatient' }) + if(this.worknum<1) + { + promptAction.showToast({ message: "请先点击右上角设置执业地点", duration: 1000 }) + } + else + { + HMRouterMgr.push({ pageUrl: 'AddOutpatient', param: { + isHistory: 'false' + } }) + } + } @@ -180,8 +195,30 @@ export struct TabBarOutComp { console.info(`Response fails: ${err}`); }) } + listWorkPlace() { + + const hashMap: HashMap = new HashMap(); + hdHttp.httpReq(BasicConstant.listWorkPlace, hashMap).then(async (res: HdResponse) => { + let json: ListWorkPlaceBean = JSON.parse(res + '') as ListWorkPlaceBean; + if (json.code == '200') { + if (json.list != null) { + this.worknum = json.list.length; + } + + } else { + + + } + }).catch((err: BusinessError) => { + + console.info(`Response fails: ${err}`); + }) + + + } } + export const TabBarItems: TabBarCompModel[] = [ { diff --git a/features/patient/Index.ets b/features/patient/Index.ets index 37328bc..2140232 100644 --- a/features/patient/Index.ets +++ b/features/patient/Index.ets @@ -16,4 +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' \ No newline at end of file +export { MassSendingComp } from './src/main/ets/components/MassSendingComp' + +export { FollowPlanListComp } from './src/main/ets/components/FollowPlanListComp' \ No newline at end of file diff --git a/features/patient/src/main/ets/components/FollowPlanListComp.ets b/features/patient/src/main/ets/components/FollowPlanListComp.ets index 8d89648..affb3b3 100644 --- a/features/patient/src/main/ets/components/FollowPlanListComp.ets +++ b/features/patient/src/main/ets/components/FollowPlanListComp.ets @@ -3,7 +3,7 @@ import { HdNav,EmptyViewComp, authStore, HdLoadingDialog, hdHttp, BasicConstant, HdResponse, ChangeUtil} from "@itcast/basic"; import { PullToRefreshLayout, RefreshController } from "refreshlib"; -import { promptAction } from "@kit.ArkUI"; +import { promptAction, router } from "@kit.ArkUI"; import { BusinessError } from "@kit.BasicServicesKit"; import { it } from "@ohos/hypium"; @@ -18,6 +18,11 @@ export struct FollowPlanListComp { public controller:RefreshController = new RefreshController() @State isShowAddPlan:boolean = false + @State uuid:string=this.params?this.params.FollowUpUuid?this.params.FollowUpUuid:'':'' + @State patientUuid:string=this.params?this.params.patient_uuid?this.params.patient_uuid:'':'' + @State nickname:string=this.params?this.params.nickname?this.params.nickname:'':'' + @State realName:string=this.params?this.params.realName?this.params.realName:'':'' + dialog: CustomDialogController = new CustomDialogController({ builder: HdLoadingDialog({ message: '加载中...' }), customStyle: true, @@ -29,11 +34,21 @@ export struct FollowPlanListComp { } getFollowListData() { - const entity = { + let entity = { "expert_uuid": authStore.getUser().uuid, - "patient_uuid": this.params.patient_uuid, "page":this.pageNumber.toString() } as Record + if(this.patientUuid!='') + { + entity = { + "expert_uuid": authStore.getUser().uuid, + "patient_uuid": this.params.patient_uuid, + "page":this.pageNumber.toString() + } as Record + + } + + this.dialog.open() hdHttp.post(BasicConstant.followUpList, entity).then(async (res: HdResponse) => { this.dialog.close(); @@ -88,7 +103,15 @@ export struct FollowPlanListComp { HdNav({title:'随访计划',isLeftAction:true,rightText:'添加',showRightText:true,showRightIcon:false,rightItemAction:()=>{ this.isShowAddPlan = !this.isShowAddPlan },leftItemAction:()=>{ - HMRouterMgr.pop() + if(this.patientUuid=='') + { + router.back() + } + else + { + HMRouterMgr.pop() + } + }}) PullToRefreshLayout({ @@ -230,10 +253,10 @@ export struct FollowPlanListComp { HMRouterMgr.push({ pageUrl:'AddScheduleFollowComp', param:{ - "uuid":this.params.FollowUpUuid, - "patientUuid":this.params.patient_uuid, - "nickname":this.params.nickname, - "realName":this.params.realName + "uuid":this.uuid, + "patientUuid":this.patientUuid, + "nickname":this.nickname, + "realName":this.realName }},{ onResult:(popInfo:HMPopInfo)=>{ if (popInfo && popInfo.result && popInfo.result["isRefresh"] !== undefined) { @@ -263,10 +286,10 @@ export struct FollowPlanListComp { HMRouterMgr.push({ pageUrl:'AddFollowPlanComp', param:{ - "uuid":this.params.FollowUpUuid, - "patientUuid":this.params.patient_uuid, - "nickname":this.params.nickname, - "realName":this.params.realName + "uuid":this.uuid, + "patientUuid":this.patientUuid, + "nickname":this.nickname, + "realName":this.realName }},{ onResult:(popInfo:HMPopInfo)=>{ if (popInfo && popInfo.result && popInfo.result["isRefresh"] !== undefined) { diff --git a/features/patient/src/main/ets/components/PatientsListSearchComp.ets b/features/patient/src/main/ets/components/PatientsListSearchComp.ets new file mode 100644 index 0000000..71aae5b --- /dev/null +++ b/features/patient/src/main/ets/components/PatientsListSearchComp.ets @@ -0,0 +1,209 @@ +import { HdNav, EmptyViewComp,HdLoadingDialog, authStore } from '@itcast/basic'; +import { promptAction } from '@kit.ArkUI' +import { BasicConstant,hdHttp, HdResponse ,logger} from '@itcast/basic/Index' +import { BusinessError } from '@kit.BasicServicesKit'; +import HashMap from '@ohos.util.HashMap' +import { patientListModel } from '../models/PatientsGroupModel' +import { HMPopInfo, HMRouter, HMRouterMgr } from "@hadss/hmrouter" + +@HMRouter({ pageUrl: 'PatientsListSearchComp' }) +@Component +export struct PatientsListSearchComp { + private params: ESObject = HMRouterMgr.getCurrentParam() + // @State params:Record = router.getParams() as Record + @State patientsArray:patientListModel[] = [] + @State patientsList:patientListModel[] = [] + @State inputString:string = '' + @State naviRightTitle:string = '确定(0)' + @State isEmptyViewVisible: boolean = false; // 控制显隐的状态变量 + + aboutToAppear(): void { + const groupPatientsList = this.params?.selectedPatients as patientListModel[] | undefined + if (groupPatientsList?.length) { + this.getPatientsListData() + } else { + this.getAllPatientsListData() + } + } + + dialog: CustomDialogController = new CustomDialogController({ + builder: HdLoadingDialog({ message: '加载中...' }), + customStyle: true, + alignment: DialogAlignment.Center + }) + + getPatientsListData() { + const hashMap: HashMap = new HashMap() + hashMap.set('group_uuid',this.params.group_uuid) + this.dialog.open() + hdHttp.httpReq(BasicConstant.patientListNoInThisGroup,hashMap).then(async (res: HdResponse) => { + this.dialog.close() + logger.info('Response patientListNoInThisGroup'+res) + let json:Record = JSON.parse(res+'') as Record + if(json.code == '1') { + const patientsList = this.params?.selectedPatients as patientListModel[] | undefined + if (patientsList?.length) { + const uuidSet = new Set(patientsList.map(item => item.uuid)) + const dataArray = json.data as patientListModel[]; + for (const model of dataArray) { + if (!uuidSet.has(model.uuid)) { + this.patientsList.push(model) + this.patientsArray.push(model) + } + } + } else { + this.patientsList = json.data as patientListModel[]; + this.patientsArray = json.data as patientListModel[]; + } + this.isEmptyViewVisible = this.patientsList.length>0?false:true + } else { + console.error('分组患者列表失败:'+json.message) + promptAction.showToast({ message: String(json.message), duration: 1000 }) + } + }).catch((err: BusinessError) => { + this.dialog.close(); + console.info(`Response fails: ${err}`); + }) + } + + getAllPatientsListData() { + this.dialog.open() + hdHttp.post(BasicConstant.patientList, { + "expertUuid": authStore.getUser().uuid + } as Record).then(async (res: HdResponse) => { + this.dialog.close() + logger.info('Response patientList'+res) + let json:Record = JSON.parse(res+'') as Record + if(json.code == '1') { + this.patientsList = json.data as patientListModel[]; + this.patientsArray = json.data as patientListModel[]; + } else { + console.error('患者列表失败:'+json.message) + promptAction.showToast({ message: String(json.message), duration: 1000 }) + } + }).catch((err: BusinessError) => { + this.dialog.close(); + console.error(`Response fails: ${err}`); + }) + } + + searchPatientAction(){ + if (this.inputString.length > 0) { + this.patientsList = [] + for (const model of this.patientsArray) { + if (model.realname?.includes(this.inputString) || model.mobile?.includes(this.inputString) || model.nickname?.includes(this.inputString)) { + this.patientsList.push(model) + } + } + } else { + this.patientsList = this.patientsArray + } + this.isEmptyViewVisible = this.patientsList.length>0?false:true + } + + build() { + Column() { + HdNav({showLeftIcon:true,title:'搜索患者',showRightText:false,rightTextColor:Color.White,rightBackColor:$r('app.color.main_color'),showRightIcon:false, + isLeftAction:true, + leftItemAction:()=>{ + HMRouterMgr.pop() + }}) + + Row(){ + Row(){ + TextInput({placeholder:'搜索患者的备注名、昵称或手机号'}) + .fontSize(15) + .backgroundColor(Color.White) + .layoutWeight(1) + .onChange((value:string)=>{ + this.inputString = value + }) + .onSubmit(()=>{ + this.searchPatientAction() + }) + Blank() + .width(0.5) + .height(20) + .backgroundColor($r('app.color.main_color')) + Image($r('app.media.selected_hospital_ws')) + .width(30) + .height(30) + .margin({left:10,right:10}) + .onClick(()=>{ + this.searchPatientAction() + }) + } + .width('95%') + .height(50) + .borderRadius(5) + .borderWidth(1) + .margin({left:10}) + .borderColor($r('app.color.main_color')) + } + .backgroundColor(Color.White) + .width('100%') + .height(70) + + if (this.isEmptyViewVisible) { + EmptyViewComp({promptText:'无搜索结果',isVisibility:this.isEmptyViewVisible}) + .width('100%') + .height('calc(100% - 56vp - 70vp)') + } else { + List(){ + ForEach(this.patientsList,(model:patientListModel)=>{ + ListItem() { + this.patientListItem(model) + } + }) + } + .width('100%') + .height('calc(100% - 56vp - 70vp)') + .backgroundColor('#f4f4f4') + .scrollBar(BarState.Off) + } + } + .width('100%') + .height('calc(100% - 56vp)') + .backgroundColor('#f4f4f4') + .justifyContent(FlexAlign.Start) + } + + @Builder + patientListItem(item:patientListModel) { + Column() { + Row() { + Image(BasicConstant.urlImage + item.photo) + .alt($r('app.media.userPhoto_default')) + .borderRadius(6) + .width(50) + .height(50) + .margin({ left: 15 }) + Text(item.nickname ? item.nickname : item.realname?item.realname:item.realName) + .fontSize(16) + .fontColor('#333333') + .margin({ left: 15 }) + Blank() + // Image(item.isSelected?$r('app.media.patiemts_list_selected'):$r('app.media.patients_list_noSelect')) + // .width(22).height(22) + // .objectFit(ImageFit.Fill) + // .margin({ right: 15 }) + + } + .width('100%') + .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+')' + }) + Blank() + .width('80%') + .height(1) + .backgroundColor('#f4f4f4') + .margin({left:60}) + } + } +}