| | |
| | | import { SettingOutlined } from '@ant-design/icons' |
| | | |
| | | import SettingForm from './settingform' |
| | | import MKEmitter from '@/utils/events.js' |
| | | |
| | | import './index.scss' |
| | | |
| | |
| | | visible: true, |
| | | menu: menu |
| | | }) |
| | | MKEmitter.emit('modalStatus', '数据源') |
| | | } |
| | | |
| | | /** |
| | |
| | | loading: true |
| | | }) |
| | | this.settingRef.handleConfirm().then(res => { |
| | | if (window.GLOB.funcs && window.GLOB.funcs.length > 0) { |
| | | window.GLOB.funcs.forEach(m => { |
| | | let reg = new RegExp('\\$ex@' + m.func_code + '@ex\\$', 'ig') |
| | | res.scripts.forEach(item => { |
| | | item.sql = item.sql.replace(reg, `/*$ex@${m.func_code}-begin*/\n${m.key_sql}\n/*@ex$-end*/`) |
| | | }) |
| | | if (res.dataresource) { |
| | | res.dataresource = res.dataresource.replace(reg, `/*$ex@${m.func_code}-begin*/\n${m.key_sql}\n/*@ex$-end*/`) |
| | | } |
| | | }) |
| | | } |
| | | // if (window.GLOB.funcs && window.GLOB.funcs.length > 0) { |
| | | // window.GLOB.funcs.forEach(m => { |
| | | // let reg = new RegExp('\\$ex@' + m.func_code + '@ex\\$', 'ig') |
| | | // res.scripts.forEach(item => { |
| | | // item.sql = item.sql.replace(reg, `/*$ex@${m.func_code}-begin*/\n${m.key_sql}\n/*@ex$-end*/`) |
| | | // }) |
| | | // if (res.dataresource) { |
| | | // res.dataresource = res.dataresource.replace(reg, `/*$ex@${m.func_code}-begin*/\n${m.key_sql}\n/*@ex$-end*/`) |
| | | // } |
| | | // }) |
| | | // } |
| | | this.setState({ |
| | | visible: false, |
| | | loading: false |
| | |
| | | res.searchLwidth = config.setting.searchLwidth !== undefined ? config.setting.searchLwidth : 33.3 |
| | | |
| | | this.props.updatesetting({...config, setting: res}) |
| | | |
| | | MKEmitter.emit('modalStatus', false) |
| | | }, () => { |
| | | this.setState({ |
| | | loading: false |
| | |
| | | visible={visible} |
| | | width={'75vw'} |
| | | maskClosable={false} |
| | | onCancel={() => { MKEmitter.emit('modalStatus', false); this.setState({ visible: false })}} |
| | | onCancel={() => { this.setState({ visible: false })}} |
| | | confirmLoading={loading} |
| | | onOk={this.settingSave} |
| | | destroyOnClose |