From dbc911dbb044895f98a49ef69ef5a5800a4aba3e Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 15 九月 2024 20:26:39 +0800 Subject: [PATCH] 2024-09-15 --- src/tabviews/custom/components/table/edit-table/normalTable/index.jsx | 58 +++++++++++++++++++++++++++++++++++++++++----------------- 1 files changed, 41 insertions(+), 17 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..6e3aeef 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} + /> + ) + } } } @@ -862,6 +877,9 @@ } if (col.format === 'percent') { content = content * 100 + if (!col.round) { + content = +content.toFixed(2) + } } else if (col.format === 'abs') { content = Math.abs(content) } @@ -1470,6 +1488,9 @@ } else { _item.datatype = item.datatype } + if (_item.type === 'number' && item.type === 'number') { + _item.decimal = item.decimal || 0 + } forms.push(_item) } else { @@ -2044,8 +2065,8 @@ let cell = { id: ex.id, - exps: exps, menuname: item.label + '锛堣〃鍗曪級', + exps: exps, md5_id: '' } @@ -2059,6 +2080,7 @@ if (localItems.length) { deffers.push({ $backend: true, + $type: 's_Get_SelectedList', data: localItems }) } @@ -2066,6 +2088,7 @@ if (mainItems.length) { deffers.push({ $backend: true, + $type: 's_Get_SelectedList', data: mainItems, rduri: window.GLOB.mainSystemApi }) @@ -2481,8 +2504,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) => { @@ -2614,10 +2637,11 @@ return { $backend: true, + $type: 's_TableData_InUpDe', data: [{ id: ex.id, - exps: exps, menuname: btn.logLabel || '', + exps: exps, md5_id: md5_id }] } -- Gitblit v1.8.0