Commit 2e175768 by huangqy

页面渲染的bug解决

parent 3ba11392
...@@ -61,11 +61,6 @@ export struct WzInPage { ...@@ -61,11 +61,6 @@ export struct WzInPage {
this.getWzcrkList() this.getWzcrkList()
} }
ininData() {
this.checkedList = []
this.getWzcrkList()
}
async getWzcrkList(qzh?: number, wczt?: string) { async getWzcrkList(qzh?: number, wczt?: string) {
Logger.info('出入库传入参数>>:', JSON.stringify(this.searchData)) Logger.info('出入库传入参数>>:', JSON.stringify(this.searchData))
this.dataSource = [] this.dataSource = []
...@@ -75,10 +70,7 @@ export struct WzInPage { ...@@ -75,10 +70,7 @@ export struct WzInPage {
res.forEach(element => { res.forEach(element => {
this.dataSource.push(new WzinClass(element)) this.dataSource.push(new WzinClass(element))
}); });
// for (let index = 0; index < res.length; index++) { Logger.info('数量是' + JSON.stringify(this.dataSource))
// const element = res[index];
// this.dataSource.push(new WzinClass(element))
// }
} }
@Builder container() { @Builder container() {
...@@ -111,6 +103,7 @@ export struct WzInPage { ...@@ -111,6 +103,7 @@ export struct WzInPage {
cancel: this.onCancel, cancel: this.onCancel,
confirm: this.onSubmit, confirm: this.onSubmit,
checkedList: $checkedList, checkedList: $checkedList,
dataSource: $dataSource,
container: this.container container: this.container
}), }),
autoCancel: true, autoCancel: true,
...@@ -127,13 +120,13 @@ export struct WzInPage { ...@@ -127,13 +120,13 @@ export struct WzInPage {
this.checkedList.forEach(async (element) => { this.checkedList.forEach(async (element) => {
let num = await wzcrkModel.updateWzcrkWczt(element, this.radioChecked ? '已完成' : '未完成') let num = await wzcrkModel.updateWzcrkWczt(element, this.radioChecked ? '已完成' : '未完成')
if (num) {// 如果更新成功就减少 if (num) {// 如果更新成功就减少
this.dataSource = this.dataSource.filter(i => i.guid != element) Logger.info("删除的数据是:" + JSON.stringify(this.dataSource))
this.dataSource.splice(this.dataSource.findIndex(i => i.guid == element), 1)
} }
}) })
} catch (e) { } catch (e) {
} finally { } finally {
this.checkedList = [] this.checkedList = []
} }
} }
......
import { UniListItem } from '@ohos/system/src/main/ets/model/UniInitList'; import { UniListItem } from '@ohos/system/src/main/ets/model/UniInitList';
import { WzinClass } from '../../pages/metailmange/WzInPage/Wzin.data';
@Extend(Button) function CommonButtonStyle() { @Extend(Button) function CommonButtonStyle() {
.borderWidth(2) .borderWidth(2)
.borderColor('#0fa983') .borderColor('#0fa983')
...@@ -31,7 +32,7 @@ interface FormData { ...@@ -31,7 +32,7 @@ interface FormData {
@CustomDialog @CustomDialog
@Component @Component
export struct SetStatusDialog { export struct SetStatusDialog {
@Link dataSource: WzinClass[]
@Link checkedList: Array<string> @Link checkedList: Array<string>
controller: CustomDialogController controller: CustomDialogController
cancel: () => void cancel: () => void
...@@ -39,6 +40,7 @@ export struct SetStatusDialog { ...@@ -39,6 +40,7 @@ export struct SetStatusDialog {
@BuilderParam container: () => void @BuilderParam container: () => void
build() { build() {
Column() { Column() {
Flex({ alignItems: ItemAlign.Start }) { Flex({ alignItems: ItemAlign.Start }) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论