| | |
| | | return item || cell |
| | | }) |
| | | }) |
| | | } else if (item.reset_source) { |
| | | let map = new Map() |
| | | this.state.formlist.forEach(cell => { |
| | | if (!cell.field) return |
| | | map.set(cell.field, cell) |
| | | }) |
| | | |
| | | item.callback(map, this.record) |
| | | |
| | | this.setState({ |
| | | formlist: this.state.formlist.map(cell => { |
| | | if (!cell.field) return cell |
| | | |
| | | let item = map.get(cell.field) |
| | | |
| | | return item || cell |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | | |
| | |
| | | MKEmitter.addListener('mkFC', this.mkFormControl) |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | | const { config } = this.state |
| | | |
| | | if (!is(fromJS(config.oriOptions), fromJS(nextProps.config.oriOptions))) { |
| | | this.setState({ |
| | | config: fromJS(nextProps.config).toJS(), |
| | | options: fromJS(nextProps.config.options).toJS() |
| | | }) |
| | | } |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | |
| | | label: '数据源', |
| | | initval: wrap.publicId || '', |
| | | required: true, |
| | | options: interfaces |
| | | options: interfaces, |
| | | reset_source: true, |
| | | callback: (map, record) => { |
| | | if (!record.publicId) return |
| | | |
| | | let interfaces = window.GLOB.customMenu.interfaces || [] |
| | | |
| | | let d = interfaces.filter(m => m.uuid === record.publicId && m.status === 'true')[0] |
| | | |
| | | if (!d || !d.columns) return |
| | | |
| | | let columns = JSON.parse(JSON.stringify(d.columns)) |
| | | |
| | | let _bgField = map.get('bgField') |
| | | |
| | | if (_bgField && !_bgField.forbid) { |
| | | _bgField.options = columns |
| | | _bgField.oriOptions = columns |
| | | map.set('bgField', _bgField) |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | ], |
| | | linkFields: ['priKeyType'], |
| | | controlFields: [ |
| | | {field: 'goback', values: ['dynamic']}, |
| | | {field: 'goback', values: ['dynamic', 'public']}, |
| | | {field: 'empty', values: ['dynamic', 'public']}, |
| | | {field: 'jump', values: ['dynamic']}, |
| | | {field: 'autoExec', values: ['dynamic']}, |
| | | {field: 'jump', values: ['dynamic', 'public']}, |
| | | {field: 'broadcast', values: ['dynamic', 'public']}, |
| | | {field: 'autoExec', values: ['dynamic', 'public']}, |
| | | {field: 'supModule', values: ['static']}, |
| | | {field: 'publicId', values: ['public']}, |
| | | ], |
| | |
| | | initval: wrap.publicId || '', |
| | | required: true, |
| | | options: interfaces, |
| | | forbid: subtype !== 'propcard' |
| | | reset_source: true, |
| | | forbid: subtype !== 'propcard', |
| | | callback: (map, record) => { |
| | | if (!record.publicId) return |
| | | |
| | | let interfaces = window.GLOB.customMenu.interfaces || [] |
| | | |
| | | let d = interfaces.filter(m => m.uuid === record.publicId && m.status === 'true')[0] |
| | | |
| | | if (!d || !d.columns) return |
| | | let columns = JSON.parse(JSON.stringify(d.columns)) |
| | | |
| | | let _broadcast = map.get('broadcast') |
| | | |
| | | if (_broadcast && !_broadcast.forbid) { |
| | | _broadcast.options = columns |
| | | _broadcast.oriOptions = columns |
| | | map.set('broadcast', _broadcast) |
| | | } |
| | | |
| | | let _jumpField = map.get('jumpField') |
| | | |
| | | if (_jumpField && !_jumpField.forbid) { |
| | | _jumpField.options = columns |
| | | _jumpField.oriOptions = columns |
| | | map.set('jumpField', _jumpField) |
| | | } |
| | | |
| | | let _link = map.get('link') |
| | | |
| | | if (_link && !_link.forbid) { |
| | | _link.options = columns |
| | | _link.oriOptions = columns |
| | | map.set('link', _link) |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | field: 'broadcast', |
| | | label: '语音播报', |
| | | initval: wrap.broadcast || '', |
| | | tooltip: '语音播报在移动端app中有效。注:使用语音播报时,数据源不要使用同步查询,添加定时器时,可循环播报', |
| | | tooltip: '语音播报在移动端有效。注:在H5中请使用音频链接,添加定时器时,可循环播报', |
| | | required: false, |
| | | options: columns, |
| | | forbid: !columns || appType !== 'mob' || subtype !== 'propcard' |
| | |
| | | field: 'display', |
| | | label: '显示控制', |
| | | initval: wrap.display || 'normal', |
| | | tooltip: '当使用属性卡进行某些业务操作,且不需要展示卡片信息时,可设置为不可见。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'normal', label: '正常显示'}, |
| | |
| | | |
| | | mkUpdateInter = (inter, split) => { |
| | | const { card } = this.state |
| | | |
| | | |
| | | if (card.wrap.datatype === 'public' && card.wrap.publicId === inter.uuid) { |
| | | let _card = {...card, columns: fromJS(inter.columns).toJS()} |
| | | |
| | |
| | | label: '数据源', |
| | | initval: wrap.publicId || '', |
| | | required: true, |
| | | options: interfaces |
| | | options: interfaces, |
| | | reset_source: true, |
| | | callback: (map, record) => { |
| | | if (!record.publicId) return |
| | | |
| | | let interfaces = window.GLOB.customMenu.interfaces || [] |
| | | |
| | | let d = interfaces.filter(m => m.uuid === record.publicId && m.status === 'true')[0] |
| | | |
| | | if (!d || !d.columns) return |
| | | |
| | | let columns = JSON.parse(JSON.stringify(d.columns)) |
| | | |
| | | let _field = map.get('field') |
| | | |
| | | if (_field) { |
| | | _field.options = columns |
| | | _field.oriOptions = columns |
| | | map.set('field', _field) |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | type: 'select', |
| | | field: 'field', |
| | | label: '文本字段', |
| | | initval: wrap.field || '', |
| | | tooltip: '选择动态值时,需设置文本字段才可生效,使用公共数据源时,需先保存数据源后再选取文本字段。', |
| | | required: false, |
| | | options: columns |
| | | }, |
| | |
| | | this.setState({ interfaces }) |
| | | this.props.updateConfig({...config, interfaces}) |
| | | |
| | | MKEmitter.emit('editLineId', record.uuid) |
| | | setTimeout(() => { |
| | | MKEmitter.emit('mkUpdateInter', record, {delay: 0}) |
| | | }, 10) |
| | |
| | | } |
| | | |
| | | if (_config.wrap.datatype === 'dynamic' && this.loaded) { |
| | | this.autoExec() |
| | | if (_config.wrap.goback === 'true' && _data.$$empty) { |
| | | this.timer && this.timer.stop() |
| | | |
| | | MKEmitter.emit('closeTabView', _config.$pageId) |
| | | } else { |
| | | this.autoExec() |
| | | } |
| | | } |
| | | if (!_config.wrap.cardType && _data.$$uuid) { |
| | | if (_data.$$uuid) { |
| | | setTimeout(() => { |
| | | this.transferLine() |
| | | }, 200) |
| | |
| | | this.loaded = true |
| | | |
| | | this.setState({sync: false, data: _data}, () => { |
| | | if (selected !== 'false') { |
| | | this.checkTopLine() |
| | | } else if (!config.wrap.cardType && _data.$$uuid) { |
| | | this.transferLine() |
| | | if (config.wrap.goback === 'true' && _data.$$empty) { |
| | | this.timer && this.timer.stop() |
| | | |
| | | MKEmitter.emit('closeTabView', config.$pageId) |
| | | } else { |
| | | if (selected !== 'false') { |
| | | this.checkTopLine() |
| | | } else if (_data.$$uuid) { |
| | | this.transferLine() |
| | | } |
| | | this.autoExec() |
| | | } |
| | | this.autoExec() |
| | | }) |
| | | } else if (config.setting.useMSearch && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({}, () => { |
| | |
| | | this.loaded = true |
| | | |
| | | this.setState({data: _data}, () => { |
| | | if (selected !== 'false') { |
| | | this.checkTopLine() |
| | | if (config.wrap.goback === 'true' && _data.$$empty) { |
| | | this.timer && this.timer.stop() |
| | | |
| | | MKEmitter.emit('closeTabView', config.$pageId) |
| | | } else { |
| | | this.transferLine() |
| | | if (selected !== 'false') { |
| | | this.checkTopLine() |
| | | } else { |
| | | this.transferLine() |
| | | } |
| | | this.autoExec() |
| | | } |
| | | }) |
| | | } |
| | |
| | | if (!unique) return |
| | | |
| | | data.unshift(res.data) |
| | | this.setState({ data, editingKey: '', visible: false }, () => { |
| | | this.setState({ data, editingKey: '', editLineId: res.data.uuid || '', visible: false }, () => { |
| | | this.props.onChange(data) |
| | | }) |
| | | } else if (res.type === 'array') { |