| | |
| | | }, 200) |
| | | } |
| | | |
| | | if (_config.wrap.datatype === 'dynamic') { |
| | | if (_config.wrap.datatype === 'dynamic' && this.loaded) { |
| | | this.autoExec() |
| | | } |
| | | if (!_config.wrap.cardType && _data.$$uuid) { |
| | |
| | | autoExec = () => { |
| | | const { config, data } = this.state |
| | | |
| | | if (!config.wrap.autoExec || data.$$empty) return |
| | | if (!config.wrap.autoExec) return |
| | | |
| | | setTimeout(() => { |
| | | MKEmitter.emit('triggerBtnId', config.wrap.autoExec, [data]) |
| | | MKEmitter.emit('triggerBtnId', config.wrap.autoExec, data.$$empty ? [] : [data]) |
| | | }, 200) |
| | | } |
| | | |
| | |
| | | sql = _prevCustomScript + sql |
| | | sql = sql + _backCustomScript |
| | | |
| | | sql = sql.replace(/@ID@/ig, `'${record.ID || ''}'`) |
| | | sql = sql.replace(/@BID@/ig, `'${this.props.BID || ''}'`) |
| | | sql = sql.replace(/@LoginUID@/ig, `'${sessionStorage.getItem('LoginUID') || ''}'`) |
| | | sql = sql.replace(/@SessionUid@/ig, `'${localStorage.getItem('SessionUid') || ''}'`) |
| | | sql = sql.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`) |
| | | sql = sql.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`) |
| | | sql = sql.replace(/@typename@/ig, `'admin'`) |
| | | |
| | | if (window.GLOB.debugger === true || (window.debugger === true && options.sysType !== 'cloud')) { |
| | | console.info(sql.replace(/\n\s{8}/ig, '\n')) |
| | | } |
| | |
| | | item.options = item.oriOptions.filter(option => option.ParentID === item.supInitVal || option.value === '') |
| | | } |
| | | |
| | | if (['select', 'link', 'radio'].includes(item.type) && item.resourceType === '0') { // 选中第一项 |
| | | if (['select', 'link', 'radio'].includes(item.type)) { // 选中第一项 |
| | | if (typeof(item.initval) === 'string' && item.initval.indexOf('$first') > -1) { |
| | | item.$first = true |
| | | item.initval = '' |
| | | } |
| | | if (item.resourceType === '0') { // 选中第一项 |
| | | if (item.$first) { |
| | | item.initval = item.options[0] ? item.options[0].value : '' |
| | | } |
| | | } |
| | | |
| | | if (typeof(item.initval) === 'string' && item.initval.indexOf('$first') > -1) { |
| | | record[item.field] = '' |
| | | } else { |
| | | record[item.field] = item.initval |
| | | } |
| | | |
| | | record[item.field] = item.initval |
| | | |
| | | if (linkFields[item.field]) { |
| | | item.linkFields = linkFields[item.field] |
| | |
| | | item.options = item.oriOptions |
| | | } |
| | | |
| | | if (['select', 'link', 'radio'].includes(item.type) && typeof(item.initval) === 'string' && item.initval.indexOf('$first') > -1) { // 选中第一项 |
| | | if (['select', 'link', 'radio'].includes(item.type) && item.$first) { // 选中第一项 |
| | | item.initval = item.options[0] ? item.options[0].value : '' |
| | | this.record[item.field] = item.initval |
| | | } |
| | |
| | | options: fromJS(nextProps.config.options).toJS() |
| | | }) |
| | | |
| | | if (typeof(config.initval) === 'string' && config.initval.indexOf('$first') > -1) { |
| | | if (config.$first) { |
| | | this.setState({ |
| | | value: nextProps.config.initval, |
| | | }) |
| | |
| | | options: fromJS(nextProps.config.options).toJS() |
| | | }) |
| | | |
| | | if (typeof(config.initval) === 'string' && config.initval.indexOf('$first') > -1) { |
| | | if (config.$first) { |
| | | this.setState({ |
| | | value: nextProps.config.initval, |
| | | }) |
| | |
| | | if (item.wrap.datatype === 'public' && item.wrap.publicId) { |
| | | item.wrap.publicId = md5(commonId + item.wrap.publicId) |
| | | } |
| | | if (item.wrap.autoExec) { |
| | | item.wrap.autoExec = md5(commonId + item.wrap.autoExec) |
| | | } |
| | | |
| | | if (item.supNodes && item.supNodes.length > 0) { |
| | | item.supNodes = item.supNodes.map(cell => { |
| | |
| | | return cell |
| | | }) |
| | | } else if (['card', 'carousel', 'timeline'].includes(item.type)) { |
| | | if (item.wrap.autoExec) { |
| | | item.wrap.autoExec = md5(commonId + item.wrap.autoExec) |
| | | } |
| | | |
| | | item.subcards.forEach(card => { |
| | | card.uuid = this.getuuid() |
| | | |