| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={8}> |
| | | {/* <Col span={8}> |
| | | <Form.Item label="事务"> |
| | | {getFieldDecorator('transaction', { |
| | | initialValue: setting.transaction || 'false' |
| | |
| | | <Radio value="false">不使用</Radio> |
| | | </Radio.Group>)} |
| | | </Form.Item> |
| | | </Col> |
| | | </Col> */} |
| | | {!['navbar', 'balcony', 'menubar', 'interface'].includes(config.type) ? <Col span={8}> |
| | | <Form.Item label="初始化数据"> |
| | | {getFieldDecorator('onload', { |
| | |
| | | async loadData (hastimer) { |
| | | const { config, arr_field, BID, BData } = this.state |
| | | |
| | | if (config.wrap.datatype === 'public') { |
| | | MKEmitter.emit('reloadData', config.wrap.publicId) |
| | | return |
| | | } |
| | | |
| | | if (config.wrap.datatype === 'static') { |
| | | this.setState({ |
| | | data: {$$BID: BID || '', $$BData: BData, $$empty: true}, |
| | |
| | | const { mainSearch } = this.props |
| | | const { config, arr_field, BID, BData, selected } = this.state |
| | | |
| | | if (config.wrap.datatype === 'public') { |
| | | MKEmitter.emit('reloadData', config.wrap.publicId) |
| | | return |
| | | } |
| | | |
| | | if (config.wrap.datatype === 'static') { |
| | | this.setState({ |
| | | data: {$$BID: BID || '', $$BData: BData, $$empty: true}, |
| | |
| | | config: PropTypes.object, // 配置信息 |
| | | } |
| | | |
| | | loading = false |
| | | |
| | | state = {} |
| | | |
| | | componentDidMount () { |
| | |
| | | setTimeout(() => { |
| | | this.loadData() |
| | | }, config.setting.delay) |
| | | |
| | | MKEmitter.addListener('reloadData', this.reloadData) |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { return false } |
| | |
| | | return |
| | | } |
| | | this.timer && this.timer.stop() |
| | | MKEmitter.removeListener('reloadData', this.reloadData) |
| | | } |
| | | |
| | | reloadData = (publicId) => { |
| | | if (this.props.config.uuid !== publicId) return |
| | | |
| | | this.loadData() |
| | | } |
| | | |
| | | async loadData () { |
| | | const { config, BID } = this.props |
| | | |
| | | if (this.loading) return |
| | | |
| | | this.loading = true |
| | | |
| | | let param = UtilsDM.getQueryDataParams(config.setting, config.columns.map(col => col.field).join(','), [], config.setting.order, 1, 1, BID) |
| | | |
| | | let result = await Api.genericInterface(param) |
| | | if (result.status) { |
| | | this.loading = false |
| | | let _data = { $$empty: true } |
| | | |
| | | if (result.data && result.data[0]) { |
| | |
| | | |
| | | _data.$$loaded = true |
| | | |
| | | window.GLOB.CacheData.set(config.uuid, _data) |
| | | |
| | | MKEmitter.emit('mkPublicData', config.uuid, _data) |
| | | } else { |
| | | this.loading = false |
| | | this.timer && this.timer.stop() |
| | | notification.error({ |
| | | top: 92, |
| | |
| | | let customScript = setting.customScript || '' |
| | | let _dataresource = setting.dataresource || '' |
| | | let queryType = setting.queryType |
| | | let transaction = setting.transaction |
| | | |
| | | if (btn.verify.dataType === 'custom') { |
| | | defaultSql = btn.verify.defaultSql || 'true' |
| | | _dataresource = btn.verify.dataresource || '' |
| | | queryType = btn.verify.queryType |
| | | transaction = btn.verify.transaction |
| | | |
| | | if (/\s/.test(_dataresource)) { |
| | | _dataresource = '(' + _dataresource + ') tb' |
| | |
| | | |
| | | if (window.GLOB.mkHS) { // 云端数据验证 |
| | | param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) |
| | | } |
| | | |
| | | if (transaction === 'true') { |
| | | param.func = 'sPC_Get_TableData_try' |
| | | } |
| | | |
| | | return param |
| | |
| | | </Radio.Group>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {dataType === 'custom' ? <Col span={8}> |
| | | {/* {dataType === 'custom' ? <Col span={8}> |
| | | <Form.Item label="事务"> |
| | | {getFieldDecorator('transaction', { |
| | | initialValue: setting.transaction || 'false' |
| | |
| | | <Radio value="false">不使用</Radio> |
| | | </Radio.Group>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | </Col> : null} */} |
| | | </Row> |
| | | </Form> |
| | | </div> |
| | |
| | | </Radio.Group>)} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={8}> |
| | | {/* <Col span={8}> |
| | | <Form.Item label="事务"> |
| | | {getFieldDecorator('transaction', { |
| | | initialValue: setting.transaction || 'false' |
| | |
| | | <Radio value="false">不使用</Radio> |
| | | </Radio.Group>)} |
| | | </Form.Item> |
| | | </Col> |
| | | </Col> */} |
| | | <Col span={8}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="使用急速模式时,表格中的标记、双击事件、格式化、行合并、前缀、后缀、字段透视等效果将无效,且数据都会以文本格式显示。"> |
| | |
| | | |
| | | class BillCodeForm extends Component { |
| | | static propTpyes = { |
| | | dict: PropTypes.object, // 字典项 |
| | | btn: PropTypes.object, // 按钮信息 |
| | | fields: PropTypes.array, // 表单 |
| | | billcodes: PropTypes.array, // 表单 |
| | |
| | | } |
| | | |
| | | return ( |
| | | <Form {...formItemLayout} className="verify-form"> |
| | | <Form {...formItemLayout} className="verify-form mk-fix-form-height"> |
| | | <Row gutter={24}> |
| | | <Col span={7}> |
| | | <Form.Item label={this.props.dict['header.form.funcvar']}> |
| | | <Form.Item label="函数变量"> |
| | | {getFieldDecorator('field', { |
| | | initialValue: '', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: this.props.dict['form.required.input'] + this.props.dict['header.form.funcvar'] + '!' |
| | | message: '请选择函数变量!' |
| | | } |
| | | ] |
| | | })( |
| | |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: this.props.dict['form.required.select'] + '类型!' |
| | | message: '请选择类型!' |
| | | } |
| | | ] |
| | | })( |
| | |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: this.props.dict['form.required.input'] + '关联字段!' |
| | | message: '请选择关联字段!' |
| | | } |
| | | ] |
| | | })( |
| | |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: this.props.dict['form.required.input'] + '凭证类型!' |
| | | message: '请选择凭证类型!' |
| | | } |
| | | ] |
| | | })( |
| | |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: this.props.dict['form.required.input'] + '位数!' |
| | | message: '请输入位数!' |
| | | } |
| | | ] |
| | | })(<InputNumber min={1} max={10} precision={0} />)} |
| | |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: this.props.dict['form.required.input'] + '凭证标识!' |
| | | message: '请选择凭证标识!' |
| | | } |
| | | ] |
| | | })( |
| | |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: this.props.dict['form.required.input'] + '标识!' |
| | | message: '请输入标识!' |
| | | }, |
| | | { |
| | | pattern: /^[a-zA-Z0-9]*$/ig, |
| | |
| | | btn={this.props.card} |
| | | billcodes={verify.billcodes} |
| | | columns={this.props.columns} |
| | | dict={this.props.dict} |
| | | modular={orderModular} |
| | | modularDetail={orderModularDetail} |
| | | orderChange={this.orderChange} |
| | |
| | | color: #1890ff; |
| | | font-size: 12px; |
| | | } |
| | | .mk-fix-form-height { |
| | | >.ant-row >.ant-col { |
| | | height: 64px; |
| | | } |
| | | } |
| | | .verify-form { |
| | | .sql { |
| | | .ant-col-sm-8 { |
| | |
| | | default_sql: setting.execute ? 'true' : 'false' |
| | | } |
| | | |
| | | if (setting.transaction === 'true') { |
| | | param.func = 'sPC_Get_TableData_try' |
| | | } |
| | | // if (setting.transaction === 'true') { |
| | | // param.func = 'sPC_Get_TableData_try' |
| | | // } |
| | | |
| | | let userName = sessionStorage.getItem('User_Name') || '' |
| | | let fullName = sessionStorage.getItem('Full_Name') || '' |
| | |
| | | regoptions.forEach(item => { |
| | | _customScript = _customScript.replace(item.reg, item.value) |
| | | }) |
| | | if (window.GLOB.breakpoint) { |
| | | _customScript = _customScript.replace(/\$breakpoint_proc@/ig, window.GLOB.breakpoint) |
| | | } |
| | | } |
| | | |
| | | let LText = '' |
| | |
| | | default_sql: setting.execute ? 'true' : 'false' |
| | | } |
| | | |
| | | if (setting.transaction === 'true') { |
| | | param.func = 'sPC_Get_TableData_try' |
| | | } |
| | | // if (setting.transaction === 'true') { |
| | | // param.func = 'sPC_Get_TableData_try' |
| | | // } |
| | | |
| | | let _dataresource = setting.dataresource |
| | | let _customScript = '' |
| | |
| | | foreign_key: '', |
| | | sql: _dataresource, |
| | | script: _customScript, |
| | | transaction: setting.transaction === 'true' |
| | | // transaction: setting.transaction === 'true' |
| | | } |
| | | } |
| | | |
| | |
| | | export function getStructuredParams (params, config, BID) { |
| | | let LText_field = [] |
| | | let diffUser = false |
| | | let transaction = false |
| | | // let transaction = false |
| | | let loginId = `'${sessionStorage.getItem('LoginUID') || ''}'` |
| | | let sessionId = `'${localStorage.getItem('SessionUid') || ''}'` |
| | | let userId = `'${sessionStorage.getItem('UserID') || ''}'` |
| | |
| | | if (!diffUser && (/@userid@/ig.test(item.sql) || /@userid@/ig.test(_script))) { |
| | | diffUser = true |
| | | } |
| | | if (item.transaction) { |
| | | transaction = true |
| | | } |
| | | // if (item.transaction) { |
| | | // transaction = true |
| | | // } |
| | | |
| | | _sql = _sql.replace(/@ID@/ig, `''`) |
| | | _script = _script.replace(/@ID@/ig, `''`) |
| | |
| | | BID: BID |
| | | } |
| | | |
| | | if (transaction) { |
| | | param.func = 'sPC_Get_structured_data_try' |
| | | } |
| | | // if (transaction) { |
| | | // param.func = 'sPC_Get_structured_data_try' |
| | | // } |
| | | |
| | | let { LText, LText1, LText2 } = Utils.sPCInUpDeFormatOptions(param.LText) |
| | | |
| | |
| | | foreign_key: '', |
| | | sql: _dataresource, |
| | | script: _customScript, |
| | | transaction: setting.transaction === 'true' |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | if (!params || params.length === 0) return '' |
| | | let LText_field = [] |
| | | let transaction = false |
| | | |
| | | let userName = sessionStorage.getItem('User_Name') || '' |
| | | let fullName = sessionStorage.getItem('Full_Name') || '' |
| | |
| | | ${_script} |
| | | ` |
| | | } |
| | | if (item.transaction) { |
| | | transaction = true |
| | | } |
| | | |
| | | item.columns.forEach(cell => { |
| | | LText_field.push(`Select '${item.name}' as tablename,'${cell.field}' as fieldname,'${cell.datatype}' as field_type`) |
| | |
| | | LText: LText.join(' union all '), |
| | | LText_field: LText_field.join(' union all '), |
| | | BID: BID || '' |
| | | } |
| | | |
| | | if (transaction) { |
| | | param.func = 'sPC_Get_structured_data_try' |
| | | } |
| | | |
| | | param.LText = Utils.formatOptions(param.LText) |