From bfbd5a28cacbde2c5d69df79c817c1218da41dde Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 11 九月 2024 18:21:54 +0800 Subject: [PATCH] 2024-09-11 --- src/tabviews/custom/components/table/edit-table/normalTable/index.jsx | 48 +++++++++++++++++++++++++++++++++--------------- 1 files changed, 33 insertions(+), 15 deletions(-) diff --git a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx index 34edff4..d5c4720 100644 --- a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx +++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx @@ -586,19 +586,34 @@ const { config } = this.props const { value, err } = this.state - return ( - <InputNumber - title={err} - className={err ? 'has-error' : ''} - ref={ref => this.node = ref} - precision={config.decimal || 0} - value={value} - onChange={(value) => this.onChange(value)} - onPressEnter={this.enterPress} - onFocus={this.onFocus} - onBlur={this.onBlur} - /> - ) + if (!config.decimal && config.decimal !== 0) { + return ( + <InputNumber + title={err} + className={err ? 'has-error' : ''} + ref={ref => this.node = ref} + value={value} + onChange={(value) => this.onChange(value)} + onPressEnter={this.enterPress} + onFocus={this.onFocus} + onBlur={this.onBlur} + /> + ) + } else { + return ( + <InputNumber + title={err} + className={err ? 'has-error' : ''} + ref={ref => this.node = ref} + precision={config.decimal} + value={value} + onChange={(value) => this.onChange(value)} + onPressEnter={this.enterPress} + onFocus={this.onFocus} + onBlur={this.onBlur} + /> + ) + } } } @@ -1469,6 +1484,9 @@ _item.datatype = _item.declareType || 'datetime' } else { _item.datatype = item.datatype + } + if (_item.type === 'number' && item.type === 'number') { + _item.decimal = item.decimal || 0 } forms.push(_item) @@ -2481,8 +2499,8 @@ loading: true }) - if (submit.intertype === 'system' && window.backend && window.GLOB.CacheData.has('sql_' + submit.$menuId)) { - let ex = window.GLOB.CacheData.get('sql_' + submit.$menuId) + if (submit.intertype === 'system' && window.backend && window.GLOB.CacheData.has('sql_submit_' + submit.$menuId)) { + let ex = window.GLOB.CacheData.get('sql_submit_' + submit.$menuId) let param = this.getExps(ex, submit, data, forms) Api.genericInterface(param).then((res) => { -- Gitblit v1.8.0