11 文件已重命名
12个文件已修改
2个文件已删除
| | |
| | | if (testScripts) { |
| | | _scripts = testScripts.filter(item => item.status !== 'false') |
| | | } |
| | | if (!change && setting.interType === 'inner' && !setting.innerFunc && setting.execute === 'false' && _scripts.length === 0) { |
| | | if (!change && setting.interType === 'system' && setting.execute === 'false' && _scripts.length === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '不执行默认sql时,请添加自定义脚本!', |
| | |
| | | return |
| | | } |
| | | |
| | | if ((setting.interType === 'inner' && !setting.innerFunc && setting.execute !== 'false') || _scripts.length > 0) { |
| | | if ((setting.interType === 'system' && setting.execute !== 'false') || _scripts.length > 0) { |
| | | let param = { |
| | | func: 's_debug_sql', |
| | | LText: SettingUtils.getDebugSql(setting, _scripts, columns, config.search) |
| | |
| | | ` |
| | | } |
| | | |
| | | if (setting.interType === 'inner' && !setting.innerFunc && setting.execute !== 'false') { |
| | | if (setting.interType === 'system' && setting.execute !== 'false') { |
| | | _dataresource = setting.dataresource |
| | | } |
| | | |
| | |
| | | if (testScripts) { |
| | | _scripts = testScripts.filter(item => item.status !== 'false') |
| | | } |
| | | if (!change && setting.interType === 'inner' && !setting.innerFunc && setting.execute === 'false' && _scripts.length === 0) { |
| | | if (!change && setting.interType === 'system' && setting.execute === 'false' && _scripts.length === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '不执行默认sql时,请添加自定义脚本!', |
| | |
| | | return |
| | | } |
| | | |
| | | if ((setting.interType === 'inner' && !setting.innerFunc && setting.execute !== 'false') || _scripts.length > 0) { |
| | | if ((setting.interType === 'system' && setting.execute !== 'false') || _scripts.length > 0) { |
| | | let param = { |
| | | func: 's_debug_sql', |
| | | LText: SettingUtils.getDebugSql(setting, _scripts, columns, searches) |
| | |
| | | } |
| | | |
| | | state = { |
| | | interType: this.props.setting.interType || 'inner', |
| | | interType: this.props.setting.interType || 'system', |
| | | structure: this.props.setting.structure || 'array' |
| | | } |
| | | |
| | |
| | | let _dataresource = setting.dataresource |
| | | let _customScript = setting.customScript |
| | | |
| | | if (setting.interType === 'inner' && !setting.innerFunc && setting.default === 'false') { |
| | | if (setting.interType === 'system' && setting.default === 'false') { |
| | | _dataresource = '' |
| | | } |
| | | |
| | |
| | | ` |
| | | } |
| | | |
| | | if (setting.interType === 'inner' && !setting.innerFunc && setting.execute !== 'false') { |
| | | if (setting.interType === 'system' && setting.execute !== 'false') { |
| | | _dataresource = setting.dataresource |
| | | } |
| | | |
| | |
| | | |
| | | config.setting.customScript = _customScript |
| | | |
| | | // 数据源 |
| | | if (config.setting.interType === 'inner' && !config.setting.innerFunc) { |
| | | config.setting.interType = 'system' |
| | | } |
| | | |
| | | this.setState({ |
| | | BID: param && param.BID ? param.BID : '', |
| | | loadingview: false, |
| | |
| | | loading: true |
| | | }) |
| | | |
| | | if (setting.interType !== 'inner' || (setting.interType === 'inner' && setting.innerFunc)) { |
| | | param = this.getCustomParam() |
| | | } else { |
| | | if (setting.interType === 'system') { |
| | | param = this.getDefaultParam() |
| | | } else { |
| | | param = this.getCustomParam() |
| | | } |
| | | |
| | | if (BID) { |
| | |
| | | } |
| | | }) |
| | | |
| | | if (config.setting.interType === 'inner' && !config.setting.innerFunc) { |
| | | config.setting.interType = 'system' |
| | | } |
| | | |
| | | this.setState({ |
| | | config: config, |
| | | setting: config.setting, |
| | |
| | | } |
| | | } |
| | | |
| | | if (setting.interType !== 'inner' || (setting.interType === 'inner' && setting.innerFunc)) { |
| | | param = this.getCustomParam(_BID) |
| | | } else { |
| | | if (setting.interType === 'system') { |
| | | param = this.getDefaultParam(_BID) |
| | | } else { |
| | | param = this.getCustomParam(_BID) |
| | | } |
| | | |
| | | this.handleTableId() |
| | |
| | | func: 'sPC_Get_TableData', |
| | | obj_name: 'data', |
| | | arr_field: arr_field, |
| | | custom_script: setting.customScript || '', |
| | | custom_script: setting.customScript, |
| | | default_sql: setting.default || 'true' |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | let _dataresource = setting.dataresource |
| | | |
| | | if (/\s/.test(_dataresource)) { |
| | | _dataresource = '(' + _dataresource + ') tb' |
| | | } |
| | | |
| | | if (this.props.dataManager) { // 数据权限 |
| | | _dataresource = _dataresource.replace(/\$@/ig, '/*') |
| | | _dataresource = _dataresource.replace(/@\$/ig, '*/') |
| | | param.custom_script = param.custom_script.replace(/\$@/ig, '/*') |
| | | param.custom_script = param.custom_script.replace(/@\$/ig, '*/') |
| | | } else { |
| | | _dataresource = _dataresource.replace(/@\$|\$@/ig, '') |
| | | param.custom_script = param.custom_script.replace(/@\$|\$@/ig, '') |
| | | } |
| | | |
| | | let regoptions = null |
| | | if (setting.queryType === 'statistics' || param.custom_script) { |
| | |
| | | insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@ |
| | | ` |
| | | } |
| | | |
| | | param.custom_script = Utils.formatOptions(param.custom_script) |
| | | } |
| | | |
| | | // 测试系统打印查询语句 |
| | | if ((options.sysType === 'local' && !window.GLOB.systemType) || window.debugger === true) { |
| | | param.custom_script && console.log(`${LText ? '' : '/*不执行默认sql*/\n'}${param.custom_script}`) |
| | | LText && console.log(LText) |
| | | } |
| | | |
| | | param.custom_script = Utils.formatOptions(param.custom_script) |
| | | param.LText = Utils.formatOptions(LText) |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | |
| | | const { Panel } = Collapse |
| | | const { confirm } = Modal |
| | | |
| | | const SettingComponent = asyncComponent(() => import('@/templates/sharecomponent/datasourcecomponent')) |
| | | const SettingComponent = asyncComponent(() => import('@/templates/sharecomponent/settingcalcomponent')) |
| | | const TabComponent = asyncComponent(() => import('./tabcomponent')) |
| | | const CalComponent = asyncComponent(() => import('./calcomponent')) |
| | | const TableComponent = asyncComponent(() => import('@/templates/sharecomponent/tablecomponent')) |
| | |
| | | type: 'view', |
| | | subtype: 'view', |
| | | uuid: menu.MenuID, |
| | | intertype: _config.setting.interType || 'inner', |
| | | intertype: _config.setting.interType || 'system', |
| | | interface: _config.setting.interface || '', |
| | | tableName: _config.setting.tableName || '', |
| | | innerFunc: _config.setting.innerFunc || '', |
| | |
| | | calvaild = false |
| | | } |
| | | |
| | | if (config.setting.interType === 'inner' && !config.setting.innerFunc && config.setting.default !== 'false' && !config.setting.dataresource) { |
| | | if (((config.setting.interType === 'inner' && !config.setting.innerFunc) || config.setting.interType === 'system') && config.setting.default !== 'false' && !config.setting.dataresource) { |
| | | return '菜单尚未设置数据源,不可启用!' |
| | | } else if (config.columns.length === 0) { |
| | | return '菜单尚未设置数据字段,不可启用!' |
| | |
| | | tableName: '', |
| | | primaryKey: '', |
| | | dataresource: '', |
| | | interType: 'inner', |
| | | interType: 'system', |
| | | innerFunc: '', |
| | | interface: '', |
| | | outerFunc: '' |
| | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // // 兼容接口类型 |
| | | // _config.action = _config.action.map(item => { |
| | | // if (item.intertype === 'inner' && !item.innerFunc) { |
| | | // item.intertype = 'system' |
| | | // } |
| | | // return item |
| | | // }) |
| | | } |
| | | |
| | | let _oriActions = [] |
| | |
| | | type: 'view', |
| | | subtype: 'view', |
| | | uuid: menu.MenuID, |
| | | intertype: _config.setting.interType || 'inner', |
| | | intertype: _config.setting.interType || 'system', |
| | | interface: _config.setting.interface || '', |
| | | tableName: _config.setting.tableName || '', |
| | | innerFunc: _config.setting.innerFunc || '', |
| | |
| | | _config.action.forEach(item => { |
| | | let tablename = item.OpenType === 'excelIn' ? (item.sheet || '') : (item.sql || '') |
| | | |
| | | if (item.OpenType === 'excelOut' && item.intertype === 'inner' && !item.innerFunc) { |
| | | if (item.OpenType === 'excelOut' && item.intertype === 'system') { |
| | | tablename = _config.setting.tableName || '' |
| | | } |
| | | |
| | |
| | | }) |
| | | |
| | | |
| | | if (config.setting.interType === 'inner' && !config.setting.innerFunc && config.setting.default !== 'false' && !config.setting.dataresource) { |
| | | if (((config.setting.interType === 'inner' && !config.setting.innerFunc) || config.setting.interType === 'system') && config.setting.default !== 'false' && !config.setting.dataresource) { |
| | | return '菜单尚未设置数据源,不可启用!' |
| | | } else if (!config.setting.primaryKey) { |
| | | return '菜单尚未设置主键,不可启用!' |
File was renamed from src/templates/sharecomponent/datasourcecomponent/verifycard/index.jsx |
| | |
| | | UNSAFE_componentWillMount() { |
| | | const { config } = this.props |
| | | |
| | | let _setting = fromJS(config.setting).toJS() |
| | | if (_setting.interType === 'inner' && !_setting.innerFunc) { |
| | | _setting.interType = 'system' |
| | | } |
| | | |
| | | this.setState({ |
| | | setting: _setting, |
| | | columns: fromJS(config.columns).toJS(), |
| | | setting: fromJS(config.setting).toJS(), |
| | | scripts: fromJS(config.scripts).toJS() |
| | | }) |
| | | |
| | |
| | | |
| | | sqlverify = (resolve, reject, change = false, testScripts) => { |
| | | const { searches } = this.props |
| | | const { columns, setting, scripts } = this.state |
| | | |
| | | let _scripts = scripts.filter(item => item.status !== 'false') |
| | | const { columns, setting, scripts, activeKey } = this.state |
| | | let _scripts = [] |
| | | |
| | | if (testScripts) { |
| | | _scripts = testScripts.filter(item => item.status !== 'false') |
| | | } else { |
| | | _scripts = scripts.filter(item => item.status !== 'false') |
| | | } |
| | | if (!change && setting.interType === 'inner' && !setting.innerFunc && setting.execute === 'false' && _scripts.length === 0) { |
| | | |
| | | if (!change && setting.interType === 'system' && !setting.innerFunc && setting.execute === 'false' && _scripts.length === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '不执行默认sql时,请添加自定义脚本!', |
| | |
| | | return |
| | | } |
| | | |
| | | if ((setting.interType === 'inner' && !setting.innerFunc && setting.execute !== 'false') || _scripts.length > 0) { |
| | | // 不使用默认sql切换 |
| | | if (change && activeKey === 'setting' && setting.interType === 'system' && setting.execute === 'false') { |
| | | resolve() |
| | | } else if (change && activeKey === 'scripts' && _scripts.length === 0) { |
| | | resolve() |
| | | } else if ((setting.interType === 'system' && setting.execute !== 'false') || _scripts.length > 0) { |
| | | let param = { |
| | | func: 's_debug_sql', |
| | | LText: SettingUtils.getDebugSql(setting, _scripts, columns, searches) |
File was renamed from src/templates/sharecomponent/datasourcecomponent/verifycard/settingform/index.jsx |
| | |
| | | } |
| | | |
| | | state = { |
| | | interType: this.props.setting.interType || 'inner', |
| | | interType: this.props.setting.interType || 'system', |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (!err) { |
| | | // 数据源前端验证 |
| | | if (values.interType === 'inner' && !values.innerFunc && values.execute !== 'false' && !values.dataresource) { |
| | | if (values.interType === 'system' && values.execute !== 'false' && !values.dataresource) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请填写内部函数或数据源!', |
| | |
| | | }) |
| | | reject() |
| | | return |
| | | } else if (values.interType === 'inner' && !values.innerFunc && values.execute !== 'false' && values.dataresource) { |
| | | } else if (values.interType === 'system' && values.execute !== 'false' && values.dataresource) { |
| | | let _quot = values.dataresource.match(/'{1}/g) |
| | | let _lparen = values.dataresource.match(/\({1}/g) |
| | | let _rparen = values.dataresource.match(/\){1}/g) |
| | |
| | | |
| | | // 数据源保存 |
| | | if ( |
| | | values.interType === 'inner' && !values.innerFunc && values.execute !== 'false' && |
| | | values.interType === 'system' && values.execute !== 'false' && |
| | | /[^\s]+\s+[^\s]+/ig.test(values.dataresource) && setting.dataresource !== values.dataresource |
| | | ) { |
| | | let param = { |
| | |
| | | ] |
| | | })( |
| | | <Radio.Group onChange={(e) => {this.onRadioChange(e, 'interType')}}> |
| | | <Radio value="system">系统</Radio> |
| | | <Radio value="inner">内部</Radio> |
| | | <Radio value="outer">外部</Radio> |
| | | </Radio.Group>)} |
| | |
| | | })(<Input placeholder={''} autoComplete="off" />)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {interType === 'inner' ? <Col span={24} className="data-source" style={{paddingLeft: '7px'}}> |
| | | {interType === 'system' ? <Col span={24} className="data-source" style={{paddingLeft: '7px'}}> |
| | | <Form.Item labelCol={{xs: { span: 24 }, sm: { span: 2 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 22 }} } label={ |
| | | <Tooltip placement="topLeft" title={'使用系统函数时,需填写数据源。注:数据权限替换符 $@ -> /* 或 \'\'、 @$ -> */ 或 \'\''}> |
| | | <Icon type="question-circle" /> |
| | |
| | | })(<CodeMirror />)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {interType === 'inner' ? <Col span={8}> |
| | | {interType === 'system' ? <Col span={8}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title={'查询时,搜索条件以where条件拼接进入sql,统计时,将数据源中以“@+搜索字段+@”的内容,以搜索条件中的值进行替换后,提交查询,注:查询类型仅在使用系统函数时有效。'}> |
| | | <Icon type="question-circle" /> |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> */} |
| | | {interType === 'inner' ? <Col span={8}> |
| | | {interType === 'system' ? <Col span={8}> |
| | | <Form.Item label="默认sql"> |
| | | {getFieldDecorator('execute', { |
| | | initialValue: setting.execute || 'true' |