门诊安排弹窗层级问题

This commit is contained in:
xiaoxiao
2025-07-29 17:25:09 +08:00
parent 7c2db724a5
commit 8ac8d11256
3 changed files with 112 additions and 45 deletions
@@ -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;