feat(ywq): 新增授权关系功能
- 添加授权关系列表和新增授权医生页面 - 实现授权请求的处理逻辑 - 优化刷新组件,支持分页加载 - 修复确认对话框的返回逻辑
这个提交包含在:
父节点
3a34fc48b8
当前提交
6e5dfee898
@ -176,7 +176,8 @@ export class ToolsHelper {
|
|||||||
* 弹出Confirm弹窗
|
* 弹出Confirm弹窗
|
||||||
* @param options
|
* @param options
|
||||||
*/
|
*/
|
||||||
static showConfirmDialog(options: ConfirmOptions) {
|
static showConfirmDialog(options: ConfirmOptions): Promise<void> {
|
||||||
|
return new Promise((reject) => {
|
||||||
try {
|
try {
|
||||||
promptAction.showDialog({
|
promptAction.showDialog({
|
||||||
alignment: 1,
|
alignment: 1,
|
||||||
@ -201,9 +202,11 @@ export class ToolsHelper {
|
|||||||
ToolsHelper.showMessage(err.message)
|
ToolsHelper.showMessage(err.message)
|
||||||
})
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
reject()
|
||||||
let message = (error as BusinessError).message
|
let message = (error as BusinessError).message
|
||||||
ToolsHelper.showMessage(message)
|
ToolsHelper.showMessage(message)
|
||||||
}
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
public static mapDialog = new HashMap<string, number>()
|
public static mapDialog = new HashMap<string, number>()
|
||||||
@ -345,7 +348,7 @@ export class ToolsHelper {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private static getUniqueId(fun: Function): string {
|
static getUniqueId(fun: Function): string {
|
||||||
if (!ToolsHelper.uniqueIdMap.has(fun)) {
|
if (!ToolsHelper.uniqueIdMap.has(fun)) {
|
||||||
ToolsHelper.uniqueIdMap.set(fun, ToolsHelper.getUuid());
|
ToolsHelper.uniqueIdMap.set(fun, ToolsHelper.getUuid());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,9 @@ type ItemType = (string | number | Object)
|
|||||||
export struct RefreshView {
|
export struct RefreshView {
|
||||||
@Link isLoading: boolean
|
@Link isLoading: boolean
|
||||||
@Prop data: Array<object>
|
@Prop data: Array<object>
|
||||||
onLoadMore?: () => void
|
@Require keyGenerator?: (item: ESObject, index: number) => string
|
||||||
|
pageSize: number = 10
|
||||||
|
onLoadMore?: (pageNum: number) => void
|
||||||
onRefresh?: () => void
|
onRefresh?: () => void
|
||||||
private startY: number = 0
|
private startY: number = 0
|
||||||
private endY: number = 0
|
private endY: number = 0
|
||||||
@ -15,7 +17,7 @@ export struct RefreshView {
|
|||||||
private _openMore: boolean = false
|
private _openMore: boolean = false
|
||||||
|
|
||||||
aboutToAppear(): void {
|
aboutToAppear(): void {
|
||||||
// this.onRefresh && this.onRefresh()
|
this.onRefresh && this.onRefresh()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 使用父组件@Builder装饰的方法初始化子组件@BuilderParam
|
// 使用父组件@Builder装饰的方法初始化子组件@BuilderParam
|
||||||
@ -30,7 +32,7 @@ export struct RefreshView {
|
|||||||
ListItem() {
|
ListItem() {
|
||||||
this.customBuilderParam(item, index)
|
this.customBuilderParam(item, index)
|
||||||
}
|
}
|
||||||
}, (index: number) => index.toString())
|
}, (item: ESObject, index: number) => this.keyGenerator!(item, index))
|
||||||
}
|
}
|
||||||
.onTouch((event: TouchEvent) => {
|
.onTouch((event: TouchEvent) => {
|
||||||
const e1 = event.touches[0]
|
const e1 = event.touches[0]
|
||||||
@ -48,13 +50,18 @@ export struct RefreshView {
|
|||||||
case TouchType.Up:
|
case TouchType.Up:
|
||||||
this.endY = e1.y
|
this.endY = e1.y
|
||||||
if (this.endY - this.startY < -100 && this._openMore) {
|
if (this.endY - this.startY < -100 && this._openMore) {
|
||||||
this.onLoadMore && this.onLoadMore()
|
const v = this.data && (this.data.length % this.pageSize) === 0
|
||||||
|
if (v) {
|
||||||
|
this.onLoadMore && this.onLoadMore(Math.floor(this.data.length / this.pageSize))
|
||||||
|
} else {
|
||||||
|
ToolsHelper.showMessage('没有更多数据了')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.onScrollIndex((first: number, last: number) => {
|
.onScrollIndex((first: number, last: number) => {
|
||||||
this.lastNum = last
|
this.lastNum = last + 1
|
||||||
})
|
})
|
||||||
.width('100%')
|
.width('100%')
|
||||||
.height('100%')
|
.height('100%')
|
||||||
|
|||||||
正在加载...
在新工单中引用
屏蔽一个用户