diff --git a/commons/basic/src/main/ets/constants/BasicConstant.ets b/commons/basic/src/main/ets/constants/BasicConstant.ets index bb225a9..c1633f4 100644 --- a/commons/basic/src/main/ets/constants/BasicConstant.ets +++ b/commons/basic/src/main/ets/constants/BasicConstant.ets @@ -44,6 +44,7 @@ export class BasicConstant { static readonly addGroupSendMsg4YunXin = BasicConstant.urlExpertAPI+'addGroupSendMsg4YunXin' static readonly addConditionRecord = BasicConstant.urlExpert+'addConditionRecord' static readonly upConditionRecord = BasicConstant.urlExpert+'upConditionRecord' + static readonly delConditionRecord = BasicConstant.urlExpert+'delConditionRecord' static readonly patientCard = BasicConstant.urlExpertAPI+'patientCard' static readonly toAddNickname = BasicConstant.urlExpert+'toAddNickname' static readonly cancelRes = BasicConstant.urlExpert+'cancelRes' diff --git a/features/netease/src/main/ets/view/ReleaseOutpatient.ets b/features/netease/src/main/ets/view/ReleaseOutpatient.ets index de49edf..58eac3a 100644 --- a/features/netease/src/main/ets/view/ReleaseOutpatient.ets +++ b/features/netease/src/main/ets/view/ReleaseOutpatient.ets @@ -1,15 +1,13 @@ -import { hdHttp, HdResponse, BasicConstant, ExpertData, authStore, BaseBean, HdLoadingDialog, +import { hdHttp, HdResponse, BasicConstant, BaseBean, HdLoadingDialog, TimestampUtil, preferenceStore} from '@itcast/basic' import { BusinessError } from '@kit.BasicServicesKit'; import promptAction from '@ohos.promptAction'; import { HdNav ,DatePickerDialog} from '@itcast/basic'; -import { LengthMetrics, router } from '@kit.ArkUI'; +import { componentUtils, LengthMetrics, router } from '@kit.ArkUI'; import { HMRouter, HMRouterMgr } from '@hadss/hmrouter'; import { HashMap } from '@kit.ArkTS'; -import { StringIsEmpty } from '@nimkit/common'; -import { DateListBean } from '../model/StopOutPatientListModel'; -import { data } from '@kit.TelephonyKit'; +import { DateListBean } from '../model/StopOutPatientListModel' import { PerfactInputSheet } from '@itcast/basic/src/main/ets/Views/PerfactInputSheet'; @@ -289,6 +287,7 @@ export struct ReleaseOutpatient { // 下拉选择时段 Column() { Text(item.param2 ? item.param2 : '请选择时段') + .id(`id_${index}`) .fontSize(16) .fontColor(item.param2 ? $r('app.color.common_gray_03') : $r('app.color.999999')) .height(42) @@ -296,6 +295,7 @@ export struct ReleaseOutpatient { .borderColor($r('app.color.999999')) .borderWidth(1) .width('100%') + .textAlign(TextAlign.Center) .borderRadius(4) .onClick(() => { if(this.reasonIndex < 0) { @@ -303,41 +303,7 @@ export struct ReleaseOutpatient { return; } this.showTimePeriodDropdown = index - - }) - // 悬浮下拉菜单 - if (this.showTimePeriodDropdown === index) { - Column() { - ForEach(this.timePeriodOptions, (period: string, pidx: number) => { - Text(period) - .fontSize(16) - .fontColor($r('app.color.common_gray_03')) - .padding(8) - .onClick(() => { - let newList = [...this.date_list_temp] - let isDuplicate = this.date_list_temp.some((item, idx) => idx != this.datePickerIndex && item.param1 == this.tmp_list[this.datePickerIndex].param1 && item.param2 == period); - if (isDuplicate) { - promptAction.showToast({ message: '已存在相同停诊时间' }); - newList[index]. param2= '' - } else { - newList[index]. param2= period - } - - - this.date_list_temp = newList - this.showTimePeriodDropdown = -1 - }) - }) - } - .backgroundColor(Color.Red) - .borderColor($r('app.color.999999')) - .borderWidth(1) - .borderRadius(4) - .width('100%') - .zIndex(199) - .position({ x: 0, y: 0 }) - } }.layoutWeight(1) } else { @@ -380,6 +346,7 @@ export struct ReleaseOutpatient { .padding({ left: 10, bottom: 10, right: 10 }).width('100%') }) } + .zIndex(200) Text('备注').fontSize(17).fontColor($r('app.color.top_title')).padding(10).width('100%').textAlign(TextAlign.Start) @@ -387,6 +354,7 @@ export struct ReleaseOutpatient { .fontColor($r('app.color.common_gray_03')) .height(100) .textAlign(TextAlign.Start) + .zIndex(100) .fontSize(14).padding(9).margin({left:10,right:10,bottom:10}) .backgroundColor($r('app.color.home_gray')).borderRadius(8) } .backgroundColor($r('app.color.white')) @@ -417,6 +385,43 @@ export struct ReleaseOutpatient { this.dialogPublish.open() }) + + // 悬浮下拉菜单 + Column() { + ForEach(this.timePeriodOptions, (period: string, pidx: number) => { + Text(period) + .width('100%') + .textAlign(TextAlign.Center) + .height(50) + .fontSize(16) + .fontColor($r('app.color.common_gray_03')) + .padding(8) + .onClick(() => { + let newList = [...this.date_list_temp] + let isDuplicate = this.date_list_temp.some((item, idx) => idx != this.datePickerIndex && item.param1 == this.tmp_list[this.datePickerIndex].param1 && item.param2 == period); + if (isDuplicate) { + promptAction.showToast({ message: '已存在相同停诊时间' }); + newList[this.showTimePeriodDropdown]. param2= '' + } else { + newList[this.showTimePeriodDropdown]. param2= period + } + this.date_list_temp = newList + this.showTimePeriodDropdown = -1 + }) + }) + } + .zIndex(999) + .clip(false) + .backgroundColor(Color.Yellow) + .borderColor($r('app.color.999999')) + .borderWidth(1) + .borderRadius(4) + .visibility(this.showTimePeriodDropdown == -1 ? Visibility.None:Visibility.Visible) + .width(px2vp(getColunmWidth(`id_${this.showTimePeriodDropdown}`))) + .position({ + x: px2vp(getColumnX(`id_${this.showTimePeriodDropdown}`)), + y: px2vp(getColumnY(`id_${this.showTimePeriodDropdown}`)) + }) } .width('100%') .height('100%') @@ -426,6 +431,24 @@ 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 { controller:CustomDialogController; diff --git a/features/patient/src/main/ets/components/AddAndEditRecordComp.ets b/features/patient/src/main/ets/components/AddAndEditRecordComp.ets index 0e1aa26..facc43c 100644 --- a/features/patient/src/main/ets/components/AddAndEditRecordComp.ets +++ b/features/patient/src/main/ets/components/AddAndEditRecordComp.ets @@ -47,6 +47,13 @@ export struct AddAndEditRecordComp { onRemoveImg() { this.photos.splice(this.removeIndex, 1) this.maxSelectNumber = 8 - this.photos.length; + + ChangeUtil.convertUrisOrUrlsToBase64(this.photos).then(base64Array => { + console.info('转换结果:', base64Array+'转换个数:'+base64Array.length) + this.base64Array = base64Array + }).catch((err:BusinessError) => { + console.error('批量转换失败:', err) + }) } aboutToAppear(): void { @@ -117,6 +124,28 @@ export struct AddAndEditRecordComp { }) } + deleteTecordData() { + const entity = { + "uuid": this.recordUuid + } as Record + this.dialog.open() + hdHttp.post(BasicConstant.delConditionRecord, entity).then(async (res: HdResponse) => { + this.dialog.close(); + logger.info('Response delConditionRecord'+res); + let json:Record | Array>> = JSON.parse(res+'') as Record | Array>>; + if(json.code == '1') { + HMRouterMgr.pop({param:{"isRefresh":"1"}}) + promptAction.showToast({ message:'删除病情记录成功', duration: 1000 }) + } else { + console.error('删除病情记录信息失败:'+json.message) + promptAction.showToast({ message: String(json.message), duration: 1000 }) + } + }).catch((err: BusinessError) => { + this.dialog.close(); + console.error(`Response fails: ${err}`); + }) + } + build() { Column() { HdNav({title:'病情记录',isLeftAction:true,showRightIcon:false,showRightText:true,rightText:'提交',rightItemAction:()=>{ @@ -125,6 +154,23 @@ export struct AddAndEditRecordComp { HMRouterMgr.pop() }}) this.contentView() + + if (this.params){ + if (this.params["model"]) { + Text('删除该条记录') + .textAlign(TextAlign.Center) + .fontSize(16) + .fontColor(Color.White) + .backgroundColor($r('app.color.main_color')) + .width('90%') + .height(50) + .borderRadius(5) + .margin({left:10,right:10,bottom:20}) + .onClick(()=>{ + this.deleteTecordData() + }) + } + } } .width('100%') } @@ -176,6 +222,8 @@ export struct AddAndEditRecordComp { .padding({top:10}) .backgroundColor('#f4f4f4') + Blank() + .layoutWeight(1) } changeToImg( imgListurl:string[]) { @@ -187,15 +235,13 @@ export struct AddAndEditRecordComp { return imgListtmps } - changeToImgs( imgListurl:string[]) - { + changeToImgs( imgListurl:string[]) { let imgListtmps:string[]=[] imgListurl.forEach((url: string) => { let item = BasicConstant.urlHtml + url imgListtmps.push(item) }) return imgListtmps - } private initPhotoDialog() { @@ -212,9 +258,6 @@ export struct AddAndEditRecordComp { } this.photos.push(...selectedUris); this.maxSelectNumber = 8 - this.photos.length - // ChangeUtil.convertUriToBase64(selectedUris[0]).then((base64)=>{ - // this.base64Array = [base64] - // }) ChangeUtil.convertUrisOrUrlsToBase64(selectedUris).then(base64Array => { console.info('转换结果:', base64Array+'转换个数:'+base64Array.length) this.base64Array = base64Array