| | |
| | | import { fromJS } from 'immutable' |
| | | import { Form, Tabs, Row, Col, Button, notification, Modal, message, InputNumber, Spin, Typography, Popconfirm } from 'antd' |
| | | import { EditOutlined, StopOutlined, CheckCircleOutlined, SwapOutlined, DeleteOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | import md5 from 'md5' |
| | | |
| | | import Api from '@/api' |
| | |
| | | const { verify } = this.state |
| | | |
| | | let columns = fromJS(verify.columns).toJS() |
| | | let fields = columns.map(item => item.Column) |
| | | let _names = {} |
| | | let fields = columns.map(item => { |
| | | let key = item.Column.toLowerCase() |
| | | _names[key] = item.Text |
| | | |
| | | return key |
| | | }) |
| | | let names = {$up: false} |
| | | |
| | | config.columns.forEach(item => { |
| | | if (fields.includes(item.field) || !item.field) return |
| | | fields.push(item.field) |
| | | if (!item.field) return |
| | | let key = item.field.toLowerCase() |
| | | if (fields.includes(key)) { |
| | | if (_names[key] !== item.label) { |
| | | names.$up = true |
| | | names[key] = item.label |
| | | } |
| | | return |
| | | } |
| | | |
| | | let cell = { |
| | | Column: item.field, |
| | |
| | | |
| | | if (config.subtype === 'dualdatacard') { |
| | | config.subColumns.forEach(item => { |
| | | if (fields.includes(item.field) || !item.field) return |
| | | fields.push(item.field) |
| | | if (!item.field) return |
| | | let key = item.field.toLowerCase() |
| | | if (fields.includes(key)) { |
| | | if (_names[key] !== item.label) { |
| | | names.$up = true |
| | | names[key] = item.label |
| | | } |
| | | return |
| | | } |
| | | |
| | | let cell = { |
| | | Column: item.field, |
| | |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | verify: {...verify, columns: columns} |
| | | }) |
| | | if (names.$up) { |
| | | const that = this |
| | | |
| | | confirm({ |
| | | content: '部分字段名称与显示列不一致,是否更新?', |
| | | onOk() { |
| | | columns = columns.map(item => { |
| | | let key = item.Column.toLowerCase() |
| | | |
| | | if (names[key]) { |
| | | item.Text = names[key] |
| | | } |
| | | |
| | | return item |
| | | }) |
| | | |
| | | that.setState({ |
| | | verify: {...verify, columns: columns} |
| | | }) |
| | | }, |
| | | onCancel() { |
| | | that.setState({ |
| | | verify: {...verify, columns: columns} |
| | | }) |
| | | } |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | verify: {...verify, columns: columns} |
| | | }) |
| | | } |
| | | } |
| | | |
| | | clearField = () => { |
| | |
| | | return |
| | | } |
| | | |
| | | let timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | let sql = SettingUtils.getDebugSql(verify, scripts, (verify.useSearch === 'true' ? searches : []), Utils, '2023-04-20 15:29:37') |
| | | let sql = SettingUtils.getDebugSql(verify, scripts, (verify.useSearch === 'true' ? searches : []), Utils) |
| | | |
| | | let _debugId = md5(sql) |
| | | |
| | |
| | | return |
| | | } |
| | | |
| | | let param = { |
| | | func: 's_debug_sql', |
| | | exec_type: 'y', |
| | | LText: sql |
| | | } |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | param.timestamp = timestamp |
| | | param.secretkey = Utils.encrypt('', timestamp) |
| | | |
| | | Api.genericInterface(param).then(result => { |
| | | if (result.status) { |
| | | Api.sDebug(sql).then(result => { |
| | | if (result.status || result.ErrCode === '-2') { |
| | | this.setState({debugId: _debugId}) |
| | | _resolve() |
| | | } else { |