| | |
| | | /** |
| | | * @description sql检验 |
| | | */ |
| | | sDebug (sql, rduri = null) { |
| | | sDebug (sql) { |
| | | let param = { |
| | | func: 's_debug_sql', |
| | | exec_type: window.GLOB.execType || 'y', |
| | |
| | | param = this.encryptParam(param) |
| | | |
| | | let url = '/webapi/dostars' |
| | | |
| | | if (rduri) { |
| | | url = rduri |
| | | } |
| | | |
| | | let timer = setTimeout(() => { |
| | | let _param = { |
| | |
| | | return |
| | | } |
| | | |
| | | if (['select', 'multiselect', 'link', 'checkcard'].includes(res.type) && res.resourceType === '1' && /\s/.test(res.dataSource)) { |
| | | if (['select', 'multiselect', 'link', 'checkcard'].includes(res.type) && res.resourceType === '1' && res.database !== 'sso' && /\s/.test(res.dataSource)) { |
| | | this.setState({ |
| | | sqlVerifing: true |
| | | }) |
| | |
| | | let sql = `declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20) |
| | | ${res.dataSource}` |
| | | sql = sql.replace(/@\$|\$@/ig, '') |
| | | |
| | | let rduri = '' |
| | | if (window.GLOB.mainSystemApi && res.database === 'sso') { |
| | | rduri = window.GLOB.mainSystemApi |
| | | } |
| | | |
| | | Api.sDebug(sql, rduri).then(result => { |
| | | Api.sDebug(sql).then(result => { |
| | | if (result.status || result.ErrCode === '-2') { |
| | | this.setState({ |
| | | sqlVerifing: false, |
| | |
| | | return |
| | | } |
| | | |
| | | if (['select', 'multiselect', 'link', 'checkcard'].includes(res.type) && res.resourceType === '1' && /\s/.test(res.dataSource)) { |
| | | if (['select', 'multiselect', 'link', 'checkcard'].includes(res.type) && res.resourceType === '1' && res.database !== 'sso' && /\s/.test(res.dataSource)) { |
| | | this.setState({ |
| | | sqlVerifing: true |
| | | }) |
| | |
| | | let sql = `declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20) |
| | | ${res.dataSource}` |
| | | sql = sql.replace(/@\$|\$@/ig, '') |
| | | |
| | | let rduri = '' |
| | | if (window.GLOB.mainSystemApi && res.database === 'sso') { |
| | | rduri = window.GLOB.mainSystemApi |
| | | } |
| | | |
| | | Api.sDebug(sql, rduri).then(result => { |
| | | Api.sDebug(sql).then(result => { |
| | | if (result.status || result.ErrCode === '-2') { |
| | | this.setState({ |
| | | sqlVerifing: false, |
| | |
| | | key: 'database', |
| | | label: '数据库', |
| | | initVal: card.database || 'local', |
| | | tooltip: '测试系统数据库均指向本地,正式系统可使用单点数据库。', |
| | | options: [{ |
| | | value: 'local', |
| | | text: '本地' |
| | | }, { |
| | | value: 'sso', |
| | | text: '系统' |
| | | text: '单点' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | if (!pass) return |
| | | } |
| | | |
| | | if (values.editType === 'select' && values.resourceType === '1' && values.dataSource) { |
| | | if (values.editType === 'select' && values.resourceType === '1' && values.database !== 'sso' && values.dataSource) { |
| | | let _option = Utils.getSelectQueryOptions(values) |
| | | |
| | | let sql = `declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20) |
| | |
| | | |
| | | // LoginUID|SessionUid|UserID|Appkey 已替换 |
| | | sql = sql.replace(/@\$|\$@/ig, '') |
| | | |
| | | let rduri = '' |
| | | if (window.GLOB.mainSystemApi && values.database === 'sso') { |
| | | rduri = window.GLOB.mainSystemApi |
| | | } |
| | | |
| | | Api.sDebug(sql, rduri).then(result => { |
| | | Api.sDebug(sql).then(result => { |
| | | if (result.status || result.ErrCode === '-2') { |
| | | this.setState({visible: false, loading: false, formlist: null}) |
| | | this.props.submitCol(values) |
| | |
| | | return |
| | | } |
| | | |
| | | if (['checkcard'].includes(res.type) && res.resourceType === '1' && /\s/.test(res.dataSource)) { |
| | | if (['checkcard'].includes(res.type) && res.resourceType === '1' && res.database !== 'sso' && /\s/.test(res.dataSource)) { |
| | | this.setState({ |
| | | sqlVerifing: true |
| | | }) |
| | |
| | | ${res.dataSource}` |
| | | sql = sql.replace(/@\$|\$@/ig, '') |
| | | |
| | | let rduri = '' |
| | | if (window.GLOB.mainSystemApi && res.database === 'sso') { |
| | | rduri = window.GLOB.mainSystemApi |
| | | } |
| | | |
| | | Api.sDebug(sql, rduri).then(result => { |
| | | Api.sDebug(sql).then(result => { |
| | | if (result.status || result.ErrCode === '-2') { |
| | | this.setState({ |
| | | sqlVerifing: false, |
| | |
| | | let _sso = _sql |
| | | |
| | | deForms.forEach(item => { |
| | | if (item.database === 'sso') { |
| | | if (item.database === 'sso' && (window.GLOB.mkHS || window.GLOB.systemType === 'production')) { |
| | | let sql = _sso + item.base_sql |
| | | _sso = '' |
| | | |
| | |
| | | let _sso = _sql |
| | | |
| | | deForms.forEach(item => { |
| | | if (item.database === 'sso') { |
| | | if (item.database === 'sso' && (window.GLOB.mkHS || window.GLOB.systemType === 'production')) { |
| | | let sql = _sso + item.base_sql |
| | | _sso = '' |
| | | |
| | |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt(window.GLOB.execType === 'x' ? '' : param.LText, param.timestamp) |
| | | |
| | | if (form.database === 'sso' && window.GLOB.mainSystemApi) { |
| | | if (form.database === 'sso' && window.GLOB.mainSystemApi && (window.GLOB.mkHS || window.GLOB.systemType === 'production')) { |
| | | param.rduri = window.GLOB.mainSystemApi |
| | | } |
| | | if (window.GLOB.mkHS) { // 云端数据验证 |
| | |
| | | }) |
| | | } else { // 合并请求,区分本地及系统 |
| | | _sql = _sql.replace(/%/ig, ' mpercent ') |
| | | if (item.database === 'sso') { |
| | | if (item.database === 'sso' && (window.GLOB.mkHS || window.GLOB.systemType === 'production')) { |
| | | if (mainItems.length === 0) { |
| | | _sql = _declare + _sql |
| | | } |
| | |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt(window.GLOB.execType === 'x' ? '' : param.LText, param.timestamp) |
| | | |
| | | if (item.database === 'sso' && window.GLOB.mainSystemApi) { |
| | | if (item.database === 'sso' && window.GLOB.mainSystemApi && (window.GLOB.mkHS || window.GLOB.systemType === 'production')) { |
| | | param.rduri = window.GLOB.mainSystemApi |
| | | } |
| | | |
| | |
| | | return |
| | | } |
| | | |
| | | if (['checkcard', 'select', 'multiselect', 'link'].includes(res.type) && res.resourceType === '1' && /\s/.test(res.dataSource)) { |
| | | if (['checkcard', 'select', 'multiselect', 'link'].includes(res.type) && res.resourceType === '1' && res.database !== 'sso' && /\s/.test(res.dataSource)) { |
| | | this.setState({ |
| | | sqlVerifing: true |
| | | }) |
| | |
| | | let sql = `declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20) |
| | | ${res.dataSource}` |
| | | sql = sql.replace(/@\$|\$@/ig, '') |
| | | |
| | | let rduri = '' |
| | | if (window.GLOB.mainSystemApi && res.database === 'sso') { |
| | | rduri = window.GLOB.mainSystemApi |
| | | } |
| | | |
| | | Api.sDebug(sql, rduri).then(result => { |
| | | Api.sDebug(sql).then(result => { |
| | | if (result.status || result.ErrCode === '-2') { |
| | | this.setState({ |
| | | sqlVerifing: false, |
| | |
| | | key: 'database', |
| | | label: '数据库', |
| | | initVal: card.database || 'local', |
| | | tooltip: '测试系统数据库均指向本地,正式系统可使用单点数据库。', |
| | | options: [{ |
| | | value: 'local', |
| | | text: '本地' |
| | | }, { |
| | | value: 'sso', |
| | | text: '系统' |
| | | text: '单点' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | key: 'database', |
| | | label: '数据库', |
| | | initVal: card.database || 'local', |
| | | tooltip: '测试系统数据库均指向本地,正式系统可使用单点数据库。', |
| | | options: [{ |
| | | value: 'local', |
| | | text: '本地' |
| | | }, { |
| | | value: 'sso', |
| | | text: '系统' |
| | | text: '单点' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | |
| | | window.GLOB.formId = card.uuid |
| | | |
| | | if (['select', 'multiselect', 'link', 'checkbox', 'radio', 'checkcard'].includes(values.type) && values.resourceType === '1' && values.dataSource) { |
| | | if (['select', 'multiselect', 'link', 'checkbox', 'radio', 'checkcard'].includes(values.type) && values.resourceType === '1' && values.database !== 'sso' && values.dataSource) { |
| | | let _option = Utils.getSelectQueryOptions(values) |
| | | |
| | | let sql = `declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20) |
| | |
| | | |
| | | // LoginUID|SessionUid|UserID|Appkey|lang 已替换 |
| | | sql = sql.replace(/@\$|\$@/ig, '') |
| | | |
| | | let rduri = '' |
| | | if (window.GLOB.mainSystemApi && values.database === 'sso') { |
| | | rduri = window.GLOB.mainSystemApi |
| | | } |
| | | |
| | | resolve({values, loading: true, promise: () => new Promise((resolve, reject) => { |
| | | Api.sDebug(sql, rduri).then(result => { |
| | | Api.sDebug(sql).then(result => { |
| | | if (result.status || result.ErrCode === '-2') { |
| | | resolve() |
| | | } else { |