患者分组代码提交
This commit is contained in:
parent
43663a9656
commit
8d0f7452b5
@ -14,21 +14,16 @@ export struct PatientsGroup {
|
|||||||
@State innerSort: string = '组内排序'
|
@State innerSort: string = '组内排序'
|
||||||
@State groupSortList:sortModel[] = [];
|
@State groupSortList:sortModel[] = [];
|
||||||
@State innerSortList:sortModel[] = [];
|
@State innerSortList:sortModel[] = [];
|
||||||
@State groupSortSelected: boolean = false
|
@State groupSortSelected: boolean = false//是否展开
|
||||||
@State innerSortSelected: boolean = false
|
@State innerSortSelected: boolean = false//是否展开
|
||||||
@State isGroupSelected: boolean = false
|
@State isGroupSelected: boolean = false//是否选中
|
||||||
@State IsInnerSelected: boolean = false
|
@State IsInnerSelected: boolean = false//是否选中
|
||||||
@State isMaiLanHidden:boolean = false;
|
@State isMaiLanHidden:boolean = false;//麦兰项目是否显示
|
||||||
@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[] = []
|
||||||
private params: ESObject = HMRouterMgr.getCurrentParam()
|
private params: ESObject = HMRouterMgr.getCurrentParam()
|
||||||
|
|
||||||
// 使用Map存储分组展开状态,键为分组UUID
|
|
||||||
private groupExpandStates: Map<string, boolean> = new Map();
|
|
||||||
|
|
||||||
private groupDataSource: GroupDataSource = new GroupDataSource();
|
|
||||||
|
|
||||||
dialog: CustomDialogController = new CustomDialogController({
|
dialog: CustomDialogController = new CustomDialogController({
|
||||||
builder: HdLoadingDialog({ message: '加载中...' }),
|
builder: HdLoadingDialog({ message: '加载中...' }),
|
||||||
customStyle: true,
|
customStyle: true,
|
||||||
@ -37,37 +32,26 @@ export struct PatientsGroup {
|
|||||||
|
|
||||||
aboutToAppear(): void {
|
aboutToAppear(): void {
|
||||||
this.getGroupData()
|
this.getGroupData()
|
||||||
|
this.getIsMaiLanData()
|
||||||
this.groupSortList = [{"name":"按首字母","isSeleted":false} as sortModel,{"name":"分组人数","isSeleted":false} as sortModel]
|
this.groupSortList = [{"name":"按首字母","isSeleted":false} as sortModel,{"name":"分组人数","isSeleted":false} as sortModel]
|
||||||
this.innerSortList = [{"name":"按首字母","isSeleted":false} as sortModel,{"name":"随访时间","isSeleted":false} as sortModel]
|
this.innerSortList = [{"name":"按首字母","isSeleted":false} as sortModel,{"name":"随访时间","isSeleted":false} as sortModel]
|
||||||
}
|
}
|
||||||
|
|
||||||
getGroupData() {
|
getGroupData(){
|
||||||
this.dialog.open()
|
this.dialog.open()
|
||||||
hdHttp.post<string>(BasicConstant.groupList, {
|
hdHttp.post<string>(BasicConstant.groupList, {
|
||||||
expert_uuid: authStore.getUser().uuid,
|
expert_uuid: authStore.getUser().uuid,
|
||||||
group_sort: this.group_sort,
|
group_sort:this.group_sort,
|
||||||
list_sort: this.list_sort
|
list_sort:this.list_sort
|
||||||
} as groupRequest).then(async (res: HdResponse<string>) => {
|
} as groupRequest).then(async (res: HdResponse<string>) => {
|
||||||
this.dialog.close();
|
this.dialog.close();
|
||||||
logger.info('Response groupList' + res);
|
this.groupListArray = []
|
||||||
let json: groupRequestCall = JSON.parse(res + '') as groupRequestCall;
|
logger.info('Response groupList'+res);
|
||||||
if (json.code == 1) {
|
let json:groupRequestCall = JSON.parse(res+'') as groupRequestCall;
|
||||||
// 创建新数据时应用保存的展开状态
|
if(json.code == 1) {
|
||||||
this.groupListArray = json.data.map(item => {
|
this.groupListArray = json.data
|
||||||
const group = new GroupModel(item);
|
|
||||||
|
|
||||||
// 生成唯一分组标识
|
|
||||||
const groupKey = this.generateGroupKey(group);
|
|
||||||
|
|
||||||
// 如果之前保存过该分组的展开状态,则应用它
|
|
||||||
if (this.groupExpandStates.has(groupKey)) {
|
|
||||||
group.isShow = this.groupExpandStates.get(groupKey) as boolean;
|
|
||||||
}
|
|
||||||
return group;
|
|
||||||
});
|
|
||||||
this.groupDataSource.updateData(this.groupListArray);
|
|
||||||
} else {
|
} else {
|
||||||
console.error('患者分组列表失败:' + json.message)
|
console.error('患者分组列表失败:'+json.message)
|
||||||
promptAction.showToast({ message: json.message, duration: 1000 })
|
promptAction.showToast({ message: json.message, duration: 1000 })
|
||||||
}
|
}
|
||||||
}).catch((err: BusinessError) => {
|
}).catch((err: BusinessError) => {
|
||||||
@ -76,23 +60,26 @@ export struct PatientsGroup {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 生成唯一分组标识
|
getIsMaiLanData() {
|
||||||
private generateGroupKey(group: GroupModel): string {
|
const hashMap: HashMap<string, string> = new HashMap();
|
||||||
return `${group.uuid}_${group.name}`;
|
this.dialog.open()
|
||||||
}
|
hdHttp.httpReq<string>(BasicConstant.isMaiLanExpert,hashMap).then(async (res: HdResponse<string>) => {
|
||||||
|
this.dialog.close();
|
||||||
// 处理分组展开/收起操作
|
logger.info('Response isMaiLanExpert'+res);
|
||||||
handleGroupToggle(group: GroupModel) {
|
let json:Record<string,string> = JSON.parse(res+'') as Record<string,string>;
|
||||||
// 生成唯一分组标识
|
if(json.code == '200') {
|
||||||
const groupKey = this.generateGroupKey(group);
|
let isMaiLanExpert:string = json.isMaiLanExpert;
|
||||||
|
if (isMaiLanExpert == '1') {
|
||||||
// 获取当前状态
|
this.isMaiLanHidden = true;
|
||||||
const currentState = this.groupExpandStates.get(groupKey) ?? false;
|
}
|
||||||
// 更新状态
|
} else {
|
||||||
this.groupExpandStates.set(groupKey, !currentState);
|
console.error('麦兰:'+json.message)
|
||||||
|
promptAction.showToast({ message: json.message, duration: 1000 })
|
||||||
// 直接更新数据源中的状态
|
}
|
||||||
this.groupDataSource.toggleGroupExpand(groupKey);
|
}).catch((err: BusinessError) => {
|
||||||
|
this.dialog.close();
|
||||||
|
console.info(`Response fails: ${err}`);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
@ -103,12 +90,16 @@ export struct PatientsGroup {
|
|||||||
hasBorder: true,
|
hasBorder: true,
|
||||||
rightText: '新建',
|
rightText: '新建',
|
||||||
showRightText: true,
|
showRightText: true,
|
||||||
isLeftAction: this.params ? true : false,
|
isLeftAction:this.params?true:false,
|
||||||
leftItemAction: () => {
|
leftItemAction:()=>{
|
||||||
HMRouterMgr.pop()
|
HMRouterMgr.pop()
|
||||||
},
|
},
|
||||||
rightItemAction: () => {
|
rightItemAction: () => {
|
||||||
HMRouterMgr.push({ pageUrl: 'BuildOrEditGroupPage', param: { "title": "新建分组" } })
|
HMRouterMgr.push({pageUrl:'BuildOrEditGroupPage',param:{"title":"新建分组"}})
|
||||||
|
// router.pushUrl({
|
||||||
|
// url: 'pages/PatientsPage/BuildOrEditGroupPage',
|
||||||
|
// params:{"title":"新建分组"}
|
||||||
|
// })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
Stack() {
|
Stack() {
|
||||||
@ -116,7 +107,7 @@ export struct PatientsGroup {
|
|||||||
Row() {
|
Row() {
|
||||||
Text(this.groupSort)
|
Text(this.groupSort)
|
||||||
.fontSize(16).fontColor(this.isGroupSelected ? $r('app.color.main_color') : '#333333')
|
.fontSize(16).fontColor(this.isGroupSelected ? $r('app.color.main_color') : '#333333')
|
||||||
Image(this.isGroupSelected ? $r('app.media.triangle_green_theme') : $r('app.media.triangle_normal')).width(10).height(10)
|
Image(this.isGroupSelected ?$r('app.media.triangle_green_theme'):$r('app.media.triangle_normal')).width(10).height(10)
|
||||||
}
|
}
|
||||||
.width('50%')
|
.width('50%')
|
||||||
.height(48)
|
.height(48)
|
||||||
@ -132,7 +123,7 @@ export struct PatientsGroup {
|
|||||||
Row() {
|
Row() {
|
||||||
Text(this.innerSort)
|
Text(this.innerSort)
|
||||||
.fontSize(16).fontColor(this.IsInnerSelected ? $r('app.color.main_color') : '#333333')
|
.fontSize(16).fontColor(this.IsInnerSelected ? $r('app.color.main_color') : '#333333')
|
||||||
Image(this.IsInnerSelected ? $r('app.media.triangle_green_theme') : $r('app.media.triangle_normal')).width(10).height(10)
|
Image(this.IsInnerSelected ?$r('app.media.triangle_green_theme'):$r('app.media.triangle_normal')).width(10).height(10)
|
||||||
}
|
}
|
||||||
.width('50%')
|
.width('50%')
|
||||||
.height(48)
|
.height(48)
|
||||||
@ -145,48 +136,55 @@ export struct PatientsGroup {
|
|||||||
}.width('100%').height(55).backgroundColor('#f4f4f4')
|
}.width('100%').height(55).backgroundColor('#f4f4f4')
|
||||||
|
|
||||||
List() {
|
List() {
|
||||||
LazyForEach(this.groupDataSource, (item: FlatItem) => {
|
ForEach(this.groupListArray, (sectionModel: groupModel,index:number) => {
|
||||||
if (item.type === 'group') {
|
ListItemGroup({ header: this.itemHeaderView(sectionModel,index) }) {
|
||||||
GroupHeader({
|
ForEach(sectionModel.isShow ? sectionModel.patientList : [], (rowModel: patientListModel) => {
|
||||||
group: item.group as GroupModel,
|
ListItem() {
|
||||||
toggleExpand: () => {
|
Stack() {
|
||||||
animateTo({ duration: 300, curve: Curve.EaseOut }, () => {
|
Row({ space: 15 }) {
|
||||||
// 调用统一处理方法
|
Image(BasicConstant.urlImage + rowModel.photo)
|
||||||
this.handleGroupToggle(item.group as GroupModel);
|
.alt($r('app.media.userPhoto_default'))
|
||||||
});
|
.width(54)
|
||||||
},
|
.height(54)
|
||||||
onEdit: (group: GroupModel) => {
|
.borderRadius(6)
|
||||||
const pathInfo1: HMRouterPathInfo = {
|
.margin({ left: 15 })
|
||||||
pageUrl: 'BuildOrEditGroupPage',
|
Text(rowModel.nickname ? rowModel.nickname : rowModel.realName)
|
||||||
param: {
|
.fontSize(16).fontColor('#666666')
|
||||||
"title": "编辑分组",
|
if (Number(rowModel.type) === 0) {
|
||||||
"group_uuid": group.uuid,
|
Image($r('app.media.group_vip'))
|
||||||
"group_name": group.name
|
.objectFit(ImageFit.Cover)
|
||||||
}
|
.width(10).height(10)
|
||||||
};
|
|
||||||
const callback: HMRouterPathCallback = {
|
|
||||||
onResult: (popInfo: PopInfo) => {
|
|
||||||
const result = popInfo.result as Record<string, string>;
|
|
||||||
const isFreash = Boolean(result.nameString);
|
|
||||||
if (isFreash) {
|
|
||||||
this.getGroupData();
|
|
||||||
}
|
}
|
||||||
}
|
}.width('100%').height(80)
|
||||||
};
|
|
||||||
HMRouterMgr.push(pathInfo1, callback);
|
Text('随访于' + rowModel.join_date?.substring(0, 10))
|
||||||
}
|
.fontSize(14)
|
||||||
});
|
.fontColor('#999999')
|
||||||
} else {
|
.textAlign(TextAlign.End)
|
||||||
PatientItem({ patient: item.patient as patientListModel });
|
.margin({ right: 15 })
|
||||||
|
.height(30)
|
||||||
|
Row()
|
||||||
|
.width('95%').height(0.5)
|
||||||
|
.backgroundColor('#999999')
|
||||||
|
}.width('100%').height(80).alignContent(Alignment.BottomEnd)
|
||||||
|
.onClick(()=>{
|
||||||
|
HMRouterMgr.push({pageUrl:'PatientDetailsComp',param:{"patient_uuid":rowModel.uuid}})
|
||||||
|
// router.pushUrl({
|
||||||
|
// url:'pages/PatientsPage/PatientDetailsPage',
|
||||||
|
// params:{"patient_uuid":rowModel.uuid}
|
||||||
|
// })
|
||||||
|
})
|
||||||
|
}.width('100%')
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}, (item: FlatItem) => this.generateKey(item));
|
})
|
||||||
}
|
}
|
||||||
.width('100%')
|
.width('100%')
|
||||||
.height('calc(100% - 55vp - 56vp)')
|
.height('calc(100% - 55vp - 56vp)')
|
||||||
.backgroundColor('#f4f4f4')
|
.backgroundColor('#f4f4f4')
|
||||||
.scrollBar(BarState.Off)
|
.scrollBar(BarState.Off)
|
||||||
.sticky(StickyStyle.Header)
|
.sticky(StickyStyle.Header)
|
||||||
.margin({ top: 55 })
|
.margin({top:55})
|
||||||
|
|
||||||
List() {
|
List() {
|
||||||
ForEach(this.groupSortList, (item: sortModel) => {
|
ForEach(this.groupSortList, (item: sortModel) => {
|
||||||
@ -205,8 +203,8 @@ export struct PatientsGroup {
|
|||||||
}.width('100%').height(50).backgroundColor(Color.White)
|
}.width('100%').height(50).backgroundColor(Color.White)
|
||||||
|
|
||||||
Blank()
|
Blank()
|
||||||
.width('100%').height(1).backgroundColor($r('app.color.main_color')).margin({ left: 20 })
|
.width('100%').height(1).backgroundColor($r('app.color.main_color')).margin({left:20})
|
||||||
}.onClick(() => {
|
}.onClick(()=>{
|
||||||
this.isGroupSelected = true;
|
this.isGroupSelected = true;
|
||||||
this.innerSortSelected = false
|
this.innerSortSelected = false
|
||||||
this.groupSortSelected = false
|
this.groupSortSelected = false
|
||||||
@ -224,8 +222,8 @@ export struct PatientsGroup {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}.width('100%').height('calc(100% - 55vp)').backgroundColor('rgba(0,0,0,0.5)').margin({ top: 55 })
|
}.width('100%').height('calc(100% - 55vp)').backgroundColor('rgba(0,0,0,0.5)').margin({top:55})
|
||||||
.visibility(this.groupSortSelected ? Visibility.Visible : Visibility.Hidden)
|
.visibility(this.groupSortSelected?Visibility.Visible:Visibility.Hidden)
|
||||||
|
|
||||||
List() {
|
List() {
|
||||||
ForEach(this.innerSortList, (item: sortModel) => {
|
ForEach(this.innerSortList, (item: sortModel) => {
|
||||||
@ -246,7 +244,7 @@ export struct PatientsGroup {
|
|||||||
Blank()
|
Blank()
|
||||||
.width('95%').height(1).backgroundColor($r('app.color.main_color'))
|
.width('95%').height(1).backgroundColor($r('app.color.main_color'))
|
||||||
}
|
}
|
||||||
.onClick(() => {
|
.onClick(()=>{
|
||||||
this.IsInnerSelected = true
|
this.IsInnerSelected = true
|
||||||
this.innerSortSelected = false
|
this.innerSortSelected = false
|
||||||
this.groupSortSelected = false
|
this.groupSortSelected = false
|
||||||
@ -264,231 +262,73 @@ export struct PatientsGroup {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}.width('100%').height('calc(100% - 55vp)').backgroundColor('rgba(0,0,0,0.5)').margin({ top: 55 })
|
}.width('100%').height('calc(100% - 55vp)').backgroundColor('rgba(0,0,0,0.5)').margin({top:55})
|
||||||
.visibility(this.innerSortSelected ? Visibility.Visible : Visibility.Hidden)
|
.visibility(this.innerSortSelected?Visibility.Visible:Visibility.Hidden)
|
||||||
|
|
||||||
Image($r('app.media.lifetime_right_icon'))
|
Image($r('app.media.lifetime_right_icon'))
|
||||||
.width(76).height(40)
|
.width(76).height(40)
|
||||||
.position({ x: '80%', y: '80%' })
|
.position({ x: '80%', y: '80%' }) // 定位到右下角
|
||||||
.visibility(this.isMaiLanHidden ? Visibility.Visible : Visibility.Hidden)
|
.visibility(this.isMaiLanHidden?Visibility.Visible:Visibility.Hidden)
|
||||||
|
|
||||||
}.width('100%').height('calc(100% - 56vp)').backgroundColor('#f4f4f4').alignContent(Alignment.TopStart)
|
}.width('100%').height('calc(100% - 56vp)').backgroundColor('#f4f4f4').alignContent(Alignment.TopStart)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private generateKey(item: FlatItem): string {
|
@Builder
|
||||||
if (item.type === 'group') {
|
itemHeaderView(model:groupModel,index:number) {
|
||||||
return `group_${item.group?.uuid}_${item.group?.name}`;
|
|
||||||
}
|
|
||||||
return `patient_${item.patient?.uuid}_${item.group?.uuid}`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class GroupDataSource implements IDataSource {
|
|
||||||
private listeners: DataChangeListener[] = [];
|
|
||||||
private _groupList: GroupModel[] = [];
|
|
||||||
private flatData: FlatItem[] = [];
|
|
||||||
// 使用Map存储分组对象,键为唯一分组标识
|
|
||||||
private groupMap: Map<string, GroupModel> = new Map();
|
|
||||||
|
|
||||||
updateData(groupList: GroupModel[]) {
|
|
||||||
this._groupList = groupList;
|
|
||||||
|
|
||||||
// 重置分组映射
|
|
||||||
this.groupMap.clear();
|
|
||||||
groupList.forEach(group => {
|
|
||||||
// 生成唯一分组标识
|
|
||||||
const groupKey = `${group.uuid}_${group.name}`;
|
|
||||||
this.groupMap.set(groupKey, group);
|
|
||||||
});
|
|
||||||
|
|
||||||
this.flattenData();
|
|
||||||
this.notifyDataReload();
|
|
||||||
}
|
|
||||||
|
|
||||||
private flattenData() {
|
|
||||||
this.flatData = [];
|
|
||||||
this._groupList.forEach((group) => {
|
|
||||||
const groupKey = `${group.uuid}_${group.name}`;
|
|
||||||
|
|
||||||
this.flatData.push({
|
|
||||||
type: 'group',
|
|
||||||
group: group as groupModel,
|
|
||||||
groupKey
|
|
||||||
});
|
|
||||||
|
|
||||||
if (group.isShow) {
|
|
||||||
group.patientList.forEach((patient) => {
|
|
||||||
this.flatData.push({
|
|
||||||
type: 'patient',
|
|
||||||
patient,
|
|
||||||
groupKey
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
toggleGroupExpand(groupKey: string) {
|
|
||||||
const group = this.groupMap.get(groupKey);
|
|
||||||
if (group) {
|
|
||||||
group.isShow = !group.isShow;
|
|
||||||
this.flattenData();
|
|
||||||
this.notifyDataReload();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
totalCount(): number { return this.flatData.length; }
|
|
||||||
getData(index: number): FlatItem { return this.flatData[index]; }
|
|
||||||
|
|
||||||
registerDataChangeListener(listener: DataChangeListener): void {
|
|
||||||
if (!this.listeners.includes(listener)) {
|
|
||||||
this.listeners.push(listener);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
unregisterDataChangeListener(listener: DataChangeListener): void {
|
|
||||||
const index = this.listeners.indexOf(listener);
|
|
||||||
if (index >= 0) this.listeners.splice(index, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
notifyDataReload(): void {
|
|
||||||
this.listeners.forEach(listener => listener.onDataReloaded());
|
|
||||||
}
|
|
||||||
|
|
||||||
notifyDataChange(index: number): void {
|
|
||||||
this.listeners.forEach(listener => listener.onDataChange(index));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
interface FlatItem {
|
|
||||||
type: 'group' | 'patient';
|
|
||||||
group?: groupModel;
|
|
||||||
patient?: patientListModel;
|
|
||||||
groupKey: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class sortModel {
|
|
||||||
name?: string;
|
|
||||||
isSeleted: boolean = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Observed
|
|
||||||
class GroupModel {
|
|
||||||
uuid: string = "";
|
|
||||||
name: string = "";
|
|
||||||
patientNum: number = 0;
|
|
||||||
isShow: boolean = false;
|
|
||||||
patientList: patientListModel[] = [];
|
|
||||||
expert_uuid: string = "";
|
|
||||||
type: number = 0;
|
|
||||||
isSelected: boolean = false;
|
|
||||||
|
|
||||||
constructor(model?: groupModel) {
|
|
||||||
if (model) {
|
|
||||||
this.uuid = model.uuid || "";
|
|
||||||
this.name = model.name || "";
|
|
||||||
this.patientNum = model.patientNum || 0;
|
|
||||||
this.isShow = model.isShow || false;
|
|
||||||
this.patientList = model.patientList || [];
|
|
||||||
this.expert_uuid = model.expert_uuid || "";
|
|
||||||
this.type = model.type || 0;
|
|
||||||
this.isSelected = model.isSelected || false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Reusable
|
|
||||||
@Component
|
|
||||||
struct GroupHeader {
|
|
||||||
@ObjectLink group: GroupModel
|
|
||||||
private toggleExpand: () => void = () => {}
|
|
||||||
private onEdit: (group: GroupModel) => void = () => {}
|
|
||||||
|
|
||||||
build() {
|
|
||||||
Column() {
|
Column() {
|
||||||
Row() {
|
Row() {
|
||||||
Image(this.group.isShow ? $r('app.media.group_turnDown') : $r('app.media.group_turnRight'))
|
Image(model.isShow ? $r('app.media.group_turnDown') : $r('app.media.group_turnRight'))
|
||||||
.width(this.group.isShow ? 10 : 5)
|
.width(model.isShow ? 10 : 5).height(model.isShow ? 5 : 10).margin({ left: 15 })
|
||||||
.height(this.group.isShow ? 5 : 10)
|
Text(model.name + ' | ' + model.patientNum)
|
||||||
.margin({ left: 15 })
|
|
||||||
|
|
||||||
Text(this.group.name + ' | ' + this.group.patientNum)
|
|
||||||
.fontSize(16)
|
.fontSize(16)
|
||||||
.fontColor('#333333')
|
.fontColor('#333333')
|
||||||
.margin({ left: 15 })
|
.margin({ left: 15 })
|
||||||
.layoutWeight(1);
|
.layoutWeight(1)
|
||||||
|
Text('编辑')
|
||||||
if (this.group.name !== '待分组患者') {
|
.width(60)
|
||||||
Text('编辑')
|
.height(60)
|
||||||
.width(60)
|
.fontSize(15)
|
||||||
.height(60)
|
.fontColor('#981308')
|
||||||
.fontSize(15)
|
.margin({ right: 15 })
|
||||||
.fontColor('#981308')
|
.textAlign(TextAlign.End)
|
||||||
.margin({ right: 15 })
|
.visibility(model.name != '待分组患者'?Visibility.Visible:Visibility.Hidden)
|
||||||
.textAlign(TextAlign.End)
|
.onClick(()=>{
|
||||||
.onClick(() => this.onEdit(this.group));
|
const pathInfo1: HMRouterPathInfo = {
|
||||||
}
|
pageUrl: 'BuildOrEditGroupPage',
|
||||||
|
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%')
|
||||||
.height(60)
|
.height(60)
|
||||||
.onClick(() => {
|
.onClick(() => {
|
||||||
this.toggleExpand();
|
let newModel = new groupModel(model);
|
||||||
});
|
newModel.isShow = !model.isShow;
|
||||||
|
this.groupListArray[index] = newModel;
|
||||||
|
this.groupListArray = [...this.groupListArray];
|
||||||
|
})
|
||||||
Blank()
|
Blank()
|
||||||
.width('100%')
|
.width('100%').height(1).backgroundColor('#666666')
|
||||||
.height(1)
|
}.width('100%').height(61).backgroundColor(Color.White)
|
||||||
.backgroundColor('#666666');
|
|
||||||
}
|
|
||||||
.width('100%')
|
|
||||||
.height(61)
|
|
||||||
.backgroundColor(Color.White)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Component
|
export class sortModel {
|
||||||
struct PatientItem {
|
name?:string;
|
||||||
private patient: patientListModel = {} as patientListModel;
|
isSeleted:boolean = false;
|
||||||
|
|
||||||
build() {
|
|
||||||
Stack() {
|
|
||||||
Row({ space: 15 }) {
|
|
||||||
Image(BasicConstant.urlImage + this.patient.photo)
|
|
||||||
.alt($r('app.media.userPhoto_default'))
|
|
||||||
.width(54)
|
|
||||||
.height(54)
|
|
||||||
.borderRadius(6)
|
|
||||||
.margin({ left: 15 });
|
|
||||||
Text(this.patient.nickname ? this.patient.nickname : this.patient.realName)
|
|
||||||
.fontSize(16)
|
|
||||||
.fontColor('#666666');
|
|
||||||
if (Number(this.patient.type) === 0) {
|
|
||||||
Image($r('app.media.group_vip'))
|
|
||||||
.objectFit(ImageFit.Cover)
|
|
||||||
.width(10)
|
|
||||||
.height(10);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.width('100%')
|
|
||||||
.height(80);
|
|
||||||
|
|
||||||
Text('随访于' + this.patient.join_date?.substring(0, 10))
|
|
||||||
.fontSize(14)
|
|
||||||
.fontColor('#999999')
|
|
||||||
.textAlign(TextAlign.End)
|
|
||||||
.margin({ right: 15 })
|
|
||||||
.height(30);
|
|
||||||
Row()
|
|
||||||
.width('95%')
|
|
||||||
.height(0.5)
|
|
||||||
.backgroundColor('#999999');
|
|
||||||
}
|
|
||||||
.width('100%')
|
|
||||||
.height(80)
|
|
||||||
.alignContent(Alignment.BottomEnd)
|
|
||||||
.onClick(() => {
|
|
||||||
HMRouterMgr.push({ pageUrl: 'PatientDetailsComp', param: { "patient_uuid": this.patient.uuid } });
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user