From f4b9504cad034ddcdef21c2081d14a4984fcd2d3 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 15 七月 2024 17:14:48 +0800 Subject: [PATCH] 2024-07-15 --- src/tabviews/custom/components/table/edit-table/index.jsx | 36 +++++++++++++++++++++++++++++++----- 1 files changed, 31 insertions(+), 5 deletions(-) diff --git a/src/tabviews/custom/components/table/edit-table/index.jsx b/src/tabviews/custom/components/table/edit-table/index.jsx index 116551f..dae82f3 100644 --- a/src/tabviews/custom/components/table/edit-table/index.jsx +++ b/src/tabviews/custom/components/table/edit-table/index.jsx @@ -1,6 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' +import { notification } from 'antd' import moment from 'moment' import Api from '@/api' @@ -251,6 +252,7 @@ config.dataSource = config.dataSource.replace(/@SessionUid@/ig, `'${localStorage.getItem('SessionUid') || ''}'`) config.dataSource = config.dataSource.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`) config.dataSource = config.dataSource.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`) + config.dataSource = config.dataSource.replace(/@lang@/ig, `'${sessionStorage.getItem('lang')}'`) if (/\s/.test(config.dataSource)) { // 鎷兼帴鍒悕 config.dataSource = '(' + config.dataSource + ') tb' @@ -338,8 +340,18 @@ if (col.supField) { names = [] - if (BData && BData[col.supField]) { - names = BData[col.supField].split(',') + let val = '' + if (BData) { + let field = col.supField.toLowerCase() + Object.keys(BData).forEach(key => { + if (key.toLowerCase() === field) { + val = BData[key] + '' + } + }) + } + + if (val) { + names = val.split(',') if (names.length > fields.length) { names.length = fields.length @@ -622,6 +634,20 @@ * 鍚湁鍒濆涓嶅姞杞界殑椤甸潰锛屼慨鏀硅缃� */ refreshbysearch = (searches) => { + const { setting, BID } = this.state + + if (setting.supModule && !BID) { + notification.warning({ + top: 92, + message: window.GLOB.dict['sup_key_req'] || '闇�瑕佷笂绾т富閿�硷紒', + duration: 5 + }) + this.setState({ + search: searches + }) + return + } + this.setState({ pageIndex: 1, search: searches @@ -738,13 +764,13 @@ if (config.uuid !== menuId) return if (position === 'line' || position === 'line_grid') { - if (lines && lines.length === 1) { + if (lines && lines.length === 1 && !config.forbidLine) { this.loadLinedata(lines[0].$$uuid, position) } else { this.reloadtable(btn) } - } else if ((position === 'mainline' || position === 'popclose') && config.setting.supModule && BID) { // 鍒锋柊婧愮粍浠舵椂锛岄檮甯﹀埛鏂颁笂绾ц涓庡綋鍓嶇粍浠� - MKEmitter.emit('reloadData', config.setting.supModule, BID) + } else if (['mainline', 'maingrid', 'popclose'].includes(position) && config.setting.supModule) { + MKEmitter.emit('reloadData', config.setting.supModule, position === 'maingrid' ? '' : BID) } else { this.reloadtable(btn) } -- Gitblit v1.8.0