患者分组

This commit is contained in:
xiaoxiao
2025-07-14 17:38:11 +08:00
parent 1121cc3f20
commit c46d9848f0
6 changed files with 133 additions and 82 deletions
@@ -1,10 +1,8 @@
@CustomDialog
export struct InputPopWindow {
controller: CustomDialogController; // 控制器(必须)
@Prop title: string; // 提示语(从父组件传入)
@Link inputValue: string; // 输入框值(双向绑定)
// 按钮回调函数(通过构造函数传入)
controller: CustomDialogController;
@Prop title: string;
@State inputValue:string = ''
private cancel?: () => void;
private confirm?: (value: string) => void;
@@ -16,28 +14,31 @@ export struct InputPopWindow {
.margin({ top: 20, bottom: 15 });
// 输入框
TextInput({ placeholder: '请输入内容', text: this.inputValue })
TextInput({ placeholder: '分组名' })
.width('90%')
.height(50)
.onChange((value: string) => {
this.inputValue = value; // 双向绑定更新值
})
.border({ width: 1, color: '#CCCCCC' })
.backgroundColor(Color.White)
.borderRadius(4)
// 按钮行(取消 + 确定)
Flex({ justifyContent: FlexAlign.SpaceAround }) {
Button('取消')
.backgroundColor('#FFFFFF')
Text('取消')
.fontColor('#666666')
.textAlign(TextAlign.Center)
.width('30%')
.onClick(() => {
this.cancel?.(); // 触发取消回调
this.controller.close(); // 关闭弹窗
})
Button('确定')
.backgroundColor('#317AFF')
.fontColor('#FFFFFF')
Text('确定')
.fontColor('#317AFF')
.textAlign(TextAlign.Center)
.width('30%')
.onClick(() => {
this.confirm?.(this.inputValue); // 传递输入值给父组件
this.controller.close();
@@ -46,8 +47,8 @@ export struct InputPopWindow {
.margin({ top: 20, bottom: 10 })
.width('100%')
}
.backgroundColor('#f4f4f4')
.width('100%')
.padding(10)
.borderRadius(16) // 圆角弹窗
}
}
@@ -32,6 +32,7 @@ export class BasicConstant {
static readonly patientListByGroup = BasicConstant.urlExpertApp+'patientListByGroup'
static readonly deleteGroup = BasicConstant.urlExpertApp+'deleteGroup'
static readonly addGroup = BasicConstant.urlExpertApp+'addGroup'
static readonly patientCardUpdateGroup = BasicConstant.urlExpertAPI+'patientCardUpdateGroup'
static readonly updateGroup = BasicConstant.urlExpertApp+'updateGroup'
static readonly relationRecordLately = BasicConstant.urlExpertAPI+'relationRecordLately'
static readonly updateNicknameNote = BasicConstant.urlExpertAPI+'updateNicknameNote'