Commit 4318430a by huangqy

步进器的逻辑更改

parent 9b85400f
...@@ -502,8 +502,7 @@ export struct WzInfo { ...@@ -502,8 +502,7 @@ export struct WzInfo {
* @return {*} * @return {*}
* @author: 王弘钢 * @author: 王弘钢
*/ */
async handleNumberBoxChangeValue(row) { async handleNumberBoxChangeValue(row, that) {
console.log('event,element,count', JSON.stringify(this))
try { try {
const updateParams = { const updateParams = {
mxguid: row.mxguid, mxguid: row.mxguid,
...@@ -530,7 +529,8 @@ export struct WzInfo { ...@@ -530,7 +529,8 @@ export struct WzInfo {
} }
await wzcrkmxModel.updateWzmx(updateParams) await wzcrkmxModel.updateWzmx(updateParams)
// createOrFindSQL("GY_M_PMV3", updateWzmx(updateParams)) // createOrFindSQL("GY_M_PMV3", updateWzmx(updateParams))
this.pageInit(row, 'update') console.log('event,element,count', 'asdhasudaugduay')
that.pageInit(row, 'update')
} catch (e) { } catch (e) {
console.log("更新数字报错了!!!!!!" + e.stack) console.log("更新数字报错了!!!!!!" + e.stack)
//TODO handle the exception //TODO handle the exception
...@@ -1257,7 +1257,7 @@ export struct WzInfo { ...@@ -1257,7 +1257,7 @@ export struct WzInfo {
List() { List() {
ForEach(this.historicalInformation, (item) => { ForEach(this.historicalInformation, (item) => {
ListItem() { ListItem() {
WzList({ wzmx: item, handleNumberBoxChangeValue: this.handleNumberBoxChangeValue }) WzList({ wzmx: item, handleNumberBoxChangeValue: this.handleNumberBoxChangeValue, that: this })
} }
}) })
} }
......
...@@ -3,7 +3,9 @@ import { historicalInformationClass, WzmxClass } from './Wzcrk.data' ...@@ -3,7 +3,9 @@ import { historicalInformationClass, WzmxClass } from './Wzcrk.data'
@Component @Component
export struct WzList { export struct WzList {
@ObjectLink wzmx: historicalInformationClass @ObjectLink wzmx: historicalInformationClass
handleNumberBoxChangeValue: (wzmx: historicalInformationClass) => void @State that: any = null
handleNumberBoxChangeValue: (wzmx: historicalInformationClass, that) => void
controller: TextInputController = new TextInputController()
build() { build() {
Column() { Column() {
...@@ -28,19 +30,26 @@ export struct WzList { ...@@ -28,19 +30,26 @@ export struct WzList {
Row() { Row() {
Counter() { Counter() {
Text(this.wzmx.crksl + '') TextInput({ text: this.wzmx.crksl + '', controller: this.controller})
.onChange((value) => {
this.wzmx.crksl = Number(value)
})
.onSubmit(() => {
this.handleNumberBoxChangeValue(this.wzmx, this.that)
})
.borderRadius(0).backgroundColor('#fff').fontSize(15).textAlign(TextAlign.Center)
} }
.width(120) .width(130)
.onInc(() => { .onInc(() => {
this.wzmx.crksl = this.wzmx.crksl + 1 this.wzmx.crksl = this.wzmx.crksl + 1
this.handleNumberBoxChangeValue(this.wzmx) this.handleNumberBoxChangeValue(this.wzmx, this.that)
}) })
.onDec(() => { .onDec(() => {
if( this.wzmx.crksl == 0) { if( this.wzmx.crksl == 0) {
return return
} }
this.wzmx.crksl = this.wzmx.crksl - 1 this.wzmx.crksl = this.wzmx.crksl - 1
this.handleNumberBoxChangeValue(this.wzmx) this.handleNumberBoxChangeValue(this.wzmx, this.that)
}) })
}.alignSelf(ItemAlign.End) }.alignSelf(ItemAlign.End)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论