From 65c9d768ad5bbb8d01babc4435801b0cb39c9b06 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 23 十二月 2024 10:44:11 +0800 Subject: [PATCH] Merge branch 'master' into positec --- src/menu/replaceField/index.jsx | 118 +++++++++++++++++++++++++++++----------------------------- 1 files changed, 59 insertions(+), 59 deletions(-) diff --git a/src/menu/replaceField/index.jsx b/src/menu/replaceField/index.jsx index 93a303e..d7d29ec 100644 --- a/src/menu/replaceField/index.jsx +++ b/src/menu/replaceField/index.jsx @@ -5,7 +5,6 @@ import moment from 'moment' import Api from '@/api' -import options from '@/store/options.js' import Utils from '@/utils/utils.js' import SettingForm from './settingform' import { queryTableSql } from '@/utils/option.js' @@ -37,16 +36,17 @@ func: 'sPC_Get_SelectedList', LText: queryTableSql, obj_name: 'data', - arr_field: 'TbName,Remark' + arr_field: 'TbName,Remark', + exec_type: 'x' } - param.LText = Utils.formatOptions(param.LText) + param.LText = Utils.formatOptions(param.LText, 'x') param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') - param.secretkey = Utils.encrypt(param.LText, param.timestamp) + param.secretkey = Utils.encrypt('', param.timestamp) param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) // 浜戠鏁版嵁楠岃瘉 - if (options.cloudServiceApi) { // 涓斿瓨鍦ㄤ簯绔湴鍧� - param.rduri = options.cloudServiceApi + if (window.GLOB.cloudServiceApi) { // 涓斿瓨鍦ㄤ簯绔湴鍧� + param.rduri = window.GLOB.cloudServiceApi param.userid = sessionStorage.getItem('CloudUserID') || '' param.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' } @@ -89,9 +89,9 @@ if (res.resource === 'custom') { if (res.reType === 'name') { - let map = {[res.label.toLowerCase()]: { - FieldDec: res.label, - FieldName: res.field, + let map = {[res.field.toLowerCase()]: { + FieldDec: res.field, + FieldName: res.label, datatype: '' }} @@ -107,8 +107,8 @@ } } else { let param = {func: 'sPC_Get_FieldName', TBName: res.table} - if (options.cloudServiceApi) { // 涓斿瓨鍦ㄤ簯绔湴鍧� - param.rduri = options.cloudServiceApi + if (window.GLOB.cloudServiceApi) { // 涓斿瓨鍦ㄤ簯绔湴鍧� + param.rduri = window.GLOB.cloudServiceApi param.userid = sessionStorage.getItem('CloudUserID') || '' param.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' } @@ -358,34 +358,32 @@ if (item.cols) { let _update = (cols) => { return cols.map(col => { - if (col.type === 'action' && col.elements) { + if (col.type === 'custom' && col.elements) { col.elements = col.elements.map(m => { - if (m.modal && m.modal.fields) { - m.modal.fields = m.modal.fields.map(col => { - if (col.field && map[col.field.toLowerCase()]) { - col.field = map[col.field.toLowerCase()].FieldName - } - return col - }) - } - if (m.verify && m.verify.columns) { - m.verify.columns = m.verify.columns.map(col => { - if (col.Column && map[col.Column.toLowerCase()]) { - col.Column = map[col.Column.toLowerCase()].FieldName - } - return col - }) - } - if (m.config && m.config.components) { - m.config.components = _replace(m.config.components) - } - - return m - }) - } else if (col.type === 'custom' && col.elements) { - col.elements = col.elements.map(m => { - if (m.datatype === 'dynamic' && map[m.field.toLowerCase()]) { - m.field = map[m.field.toLowerCase()].FieldName + if (m.eleType === 'button') { + if (m.modal && m.modal.fields) { + m.modal.fields = m.modal.fields.map(col => { + if (col.field && map[col.field.toLowerCase()]) { + col.field = map[col.field.toLowerCase()].FieldName + } + return col + }) + } + if (m.verify && m.verify.columns) { + m.verify.columns = m.verify.columns.map(col => { + if (col.Column && map[col.Column.toLowerCase()]) { + col.Column = map[col.Column.toLowerCase()].FieldName + } + return col + }) + } + if (m.config && m.config.components) { + m.config.components = _replace(m.config.components) + } + } else { + if (m.datatype === 'dynamic' && map[m.field.toLowerCase()]) { + m.field = map[m.field.toLowerCase()].FieldName + } } return m @@ -532,26 +530,28 @@ if (item.cols) { let _update = (cols) => { return cols.map(col => { - if (col.type === 'action' && col.elements) { + if (col.type === 'custom' && col.elements) { col.elements = col.elements.map(m => { - if (m.modal && m.modal.fields) { - m.modal.fields = m.modal.fields.map(col => { - if (col.field && map[col.field.toLowerCase()]) { - col.label = map[col.field.toLowerCase()].FieldDec - } - return col - }) - } - if (m.verify && m.verify.columns) { - m.verify.columns = m.verify.columns.map(col => { - if (col.Column && map[col.Column.toLowerCase()]) { - col.Text = map[col.Column.toLowerCase()].FieldDec - } - return col - }) - } - if (m.config && m.config.components) { - m.config.components = _replace(m.config.components) + if (m.eleType === 'button') { + if (m.modal && m.modal.fields) { + m.modal.fields = m.modal.fields.map(col => { + if (col.field && map[col.field.toLowerCase()]) { + col.label = map[col.field.toLowerCase()].FieldDec + } + return col + }) + } + if (m.verify && m.verify.columns) { + m.verify.columns = m.verify.columns.map(col => { + if (col.Column && map[col.Column.toLowerCase()]) { + col.Text = map[col.Column.toLowerCase()].FieldDec + } + return col + }) + } + if (m.config && m.config.components) { + m.config.components = _replace(m.config.components) + } } return m @@ -637,7 +637,7 @@ const { visible, loadingTable, tables, confirming } = this.state return ( - <div className="mk-replace-field" style={{display: 'inline-block'}}> + <> <Button className="mk-border-yellow" icon="swap" loading={loadingTable} onClick={this.trigger}>瀛楁鏇挎崲</Button> <Modal title="瀛楁鏇挎崲" @@ -652,7 +652,7 @@ > <SettingForm tables={tables} wrappedComponentRef={(inst) => this.settingRef = inst}/> </Modal> - </div> + </> ) } } -- Gitblit v1.8.0