src/api/index.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/menu/datasource/verifycard/customscript/index.jsx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/templates/zshare/codemirror/index.jsx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/templates/zshare/customscript/index.jsx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/templates/zshare/verifycard/customform/index.jsx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/templates/zshare/verifycard/customscript/index.jsx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/api/index.js
@@ -831,6 +831,16 @@ param.LoginUID = param.LoginUID || sessionStorage.getItem('LoginUID') || '' param.appkey = window.GLOB.appkey || '' if (['sPC_Get_TableData', 'sPC_Get_TableData_debug', 'sPC_TableData_InUpDe', 'sPC_TableData_InUpDe_debug'].includes(param.func)) { if (sessionStorage.getItem('isEditState') === 'true') { param.username = sessionStorage.getItem('CloudUserName') || '' param.fullname = sessionStorage.getItem('CloudFullName') || '' } else { param.username = sessionStorage.getItem('User_Name') || '' param.fullname = sessionStorage.getItem('Full_Name') || '' } } let login = false let rduri = null src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx
@@ -61,6 +61,15 @@ // 表单提交时检查输入值是否正确 this.props.form.validateFieldsAndScroll((err, values) => { if (!err) { if (/^[\s\n]+$/.test(values.sql)) { notification.warning({ top: 92, message: '请输入sql!', duration: 5 }) return } values.uuid = this.state.editItem ? this.state.editItem.uuid : '' let _quot = values.sql.match(/'{1}/g) src/menu/datasource/verifycard/customscript/index.jsx
@@ -100,6 +100,15 @@ // 表单提交时检查输入值是否正确 this.props.form.validateFieldsAndScroll((err, values) => { if (!err) { if (/^[\s\n]+$/.test(values.sql)) { notification.warning({ top: 92, message: '请输入sql!', duration: 5 }) return } values.uuid = this.state.editItem ? this.state.editItem.uuid : '' let _quot = values.sql.match(/'{1}/g) @@ -266,7 +275,7 @@ message: '请输入sql!' } ] })(<CodeMirror />)} })(<CodeMirror/>)} </Form.Item> </Col> </Row> src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx
@@ -75,6 +75,15 @@ // 表单提交时检查输入值是否正确 this.props.form.validateFieldsAndScroll((err, values) => { if (!err) { if (/^[\s\n]+$/.test(values.sql)) { notification.warning({ top: 92, message: '请输入sql!', duration: 5 }) return } values.uuid = this.state.editItem ? this.state.editItem.uuid : '' let _quot = values.sql.match(/'{1}/g) src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx
@@ -63,6 +63,15 @@ // 表单提交时检查输入值是否正确 this.props.form.validateFieldsAndScroll((err, values) => { if (!err) { if (/^[\s\n]+$/.test(values.sql)) { notification.warning({ top: 92, message: '请输入sql!', duration: 5 }) return } values.uuid = this.state.editItem ? this.state.editItem.uuid : '' let _quot = values.sql.match(/'{1}/g) src/templates/zshare/codemirror/index.jsx
@@ -27,7 +27,6 @@ } state = { editor: null, // code对象 defaultVal: '', // 初始值 value: '', // 实时内容 options: null, // mode : text/xml, text/css, text/javascript、text/x-mysql ; theme : cobalt - 黑底 @@ -35,6 +34,8 @@ style: {fontSize: '18px', lineHeight: '32px'}, display: true } editor = null UNSAFE_componentWillMount () { let options = { @@ -56,15 +57,15 @@ } UNSAFE_componentWillReceiveProps (nextProps) { const { value, editor } = this.state const { value } = this.state if (value !== nextProps.value) { this.setState({ value: nextProps.value || '' }) if (editor && editor.setValue) { editor.setValue(nextProps.value || '') if (this.editor && this.editor.setValue) { this.editor.setValue(nextProps.value || '') } else { this.setState({ defaultVal: nextProps.value || '' @@ -74,7 +75,7 @@ } shouldComponentUpdate (nextProps, nextState) { return !is(fromJS({...this.state, value: '', editor: ''}), fromJS({...nextState, value: '', editor: ''})) return !is(fromJS({...this.state, value: ''}), fromJS({...nextState, value: ''})) } fullScreenChange = () => { @@ -100,7 +101,7 @@ } // 切换字体大小,刷新编辑器窗口,解决调整后的选择区域错乱问题 this.setState({style: _style, display: false, editor: null, defaultVal: this.state.value}, () => { this.setState({style: _style, display: false, defaultVal: this.state.value}, () => { this.setState({display: true}) }) } @@ -109,13 +110,35 @@ let _sql = this.state.value if (!_sql) return let getuuid = () => { let uuid = [] let _options = '0123456789abcdefghigklmnopqrstuv' for (let i = 0; i < 19; i++) { uuid.push(_options.substr(Math.floor(Math.random() * 0x20), 1)) } return '\'' + uuid.join('') + '\'' } let arr = [] _sql = _sql.replace(/@[0-9a-zA-Z_]+@/g, (word) => { let uuid = getuuid() arr.push({id: uuid, value: word}) return uuid }) _sql = sqlFormatter.format(_sql.replace(/\s{2,}/g, ' ')) // _sql = _sql.replace(/case\n\s+when\s/ig, (word) => { // return word.replace(/case/, '').replace(/when/, 'case when') // }) _sql = _sql.replace(/\$\s\*\s\//g, '$*/').replace(/\*\s\//g, '*/') this.setState({display: false, editor: null, defaultVal: _sql}, () => { arr.forEach(item => { _sql = _sql.replace(item.id, item.value) }) this.setState({display: false, defaultVal: _sql}, () => { this.setState({display: true}) }) @@ -178,8 +201,9 @@ className="code-mirror-area" value={defaultVal} options={options} ref={(ref) => { this.editor = ref }} onChange={(editor, data, value) => { this.setState({editor, value}) this.setState({value}) this.props.onChange(value) }} /> : null} src/templates/zshare/customscript/index.jsx
@@ -422,7 +422,7 @@ <Form.Item label={'sql'}> {getFieldDecorator('sql', { initialValue: '' })(<CodeMirror />)} })(<CodeMirror/>)} </Form.Item> </Col> </Row> src/templates/zshare/verifycard/customform/index.jsx
@@ -49,6 +49,15 @@ // 表单提交时检查输入值是否正确 this.props.form.validateFieldsAndScroll((err, values) => { if (!err) { if (/^[\s\n]+$/.test(values.sql)) { notification.warning({ top: 92, message: '请输入sql!', duration: 5 }) return } values.uuid = this.state.editItem ? this.state.editItem.uuid : '' values.resultName = values.result === 'false' ? '不存在' : '存在' src/templates/zshare/verifycard/customscript/index.jsx
@@ -57,6 +57,14 @@ return } if (!err) { if (/^[\s\n]+$/.test(values.sql)) { notification.warning({ top: 92, message: '请输入sql!', duration: 5 }) return } values.uuid = editItem ? editItem.uuid : '' values.position = values.position || (editItem ? editItem.position : 'front')