| | |
| | | } |
| | | } |
| | | |
| | | componentDidMount() { |
| | | MKEmitter.addListener('mkUpdateInter', this.mkUpdateInter) |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | |
| | | componentWillUnmount () { |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | MKEmitter.removeListener('mkUpdateInter', this.mkUpdateInter) |
| | | } |
| | | |
| | | 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()} |
| | | |
| | | split.delay = split.delay + 10 |
| | | |
| | | setTimeout(() => { |
| | | this.updateComponent(_card) |
| | | }, split.delay) |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | updateWrap = (res) => { |
| | | this.updateComponent({...this.state.card, wrap: res}) |
| | | const { card } = this.state |
| | | |
| | | let _card = {...card, wrap: res} |
| | | |
| | | if (res.datatype === 'public') { |
| | | let interfaces = window.GLOB.customMenu.interfaces || [] |
| | | |
| | | let d = interfaces.filter(m => m.uuid === res.publicId && m.status === 'true')[0] |
| | | |
| | | if (d) { |
| | | _card.columns = fromJS(d.columns).toJS() |
| | | } |
| | | } |
| | | |
| | | this.updateComponent(_card) |
| | | } |
| | | |
| | | clickComponent = (e) => { |
| | |
| | | <UserComponent config={card}/> |
| | | <DeleteOutlined className="close" title="删除组件" onClick={() => this.props.deletecomponent(card.uuid)} /> |
| | | <EditorContent config={card} updateConfig={this.updateComponent}/> |
| | | {card.wrap.datatype !== 'static' ? <SettingComponent config={card} updateConfig={this.updateComponent} /> : null} |
| | | {card.wrap.datatype === 'static' ? <SettingOutlined style={{color: '#eeeeee', cursor: 'not-allowed'}} type="setting"/> : null} |
| | | {card.wrap.datatype === 'dynamic' ? <SettingComponent config={card} updateConfig={this.updateComponent} /> : <SettingOutlined style={{color: '#eeeeee', cursor: 'not-allowed'}} type="setting"/>} |
| | | </div> |
| | | } trigger="hover"> |
| | | <ToolOutlined /> |
| | |
| | | ], |
| | | controlFields: [ |
| | | {field: 'field', values: ['dynamic', 'public']}, |
| | | {field: 'empty', values: ['dynamic', 'public']}, |
| | | {field: 'publicId', values: ['public']}, |
| | | {field: 'encryption', values: ['dynamic', 'public']}, |
| | | ] |
| | |
| | | field: 'field', |
| | | label: '文本字段', |
| | | initval: wrap.field || '', |
| | | tooltip: '选择动态值时,需设置文本字段才可生效。', |
| | | tooltip: '选择动态值时,需设置文本字段才可生效,使用公共数据源时,需先保存数据源后再选取文本字段。', |
| | | required: false, |
| | | options: columns |
| | | }, |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'empty', |
| | | label: '空值隐藏', |
| | | initval: wrap.empty || 'show', |
| | | tooltip: '当查询数据为空时,隐藏该组件。', |
| | | required: false, |
| | | skip: true, |
| | | options: [ |
| | | {value: 'show', label: '否'}, |
| | | {value: 'hidden', label: '是'}, |
| | | ], |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'permission', |
| | | label: '权限验证', |
| | | initval: wrap.permission || 'false', |
| | |
| | | let param = { |
| | | func: 's_debug_sql', |
| | | exec_type: 'y', |
| | | LText: `declare @mk_organization nvarchar(512) |
| | | LText: `declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20) |
| | | ${res.dataSource}` |
| | | } |
| | | |
| | |
| | | } trigger="hover"> |
| | | <ToolOutlined /> |
| | | </Popover> |
| | | <div className="form-area"> |
| | | <div className={`form-area mk-${card.wrap.formStyle || ''}`}> |
| | | <PlusOutlined className="plus" title="添加表单" onClick={this.addForm}/> |
| | | <FieldsComponent config={card.subcards[0]} type="form" plusFields={this.plusFields} /> |
| | | <span style={{color: 'red', marginLeft: '30px', cursor: 'pointer'}} onClick={this.clearGroup}>清空</span> |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'formStyle', |
| | | label: '表单样式', |
| | | initval: wrap.formStyle || '', |
| | | required: false, |
| | | options: [ |
| | | {value: '', label: '默认'}, |
| | | {value: 'shadow', label: '阴影'}, |
| | | ], |
| | | forbid: appType !== 'mob' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'goback', |
| | | label: '空值返回', |
| | | initval: wrap.goback || 'false', |
| | |
| | | let param = { |
| | | func: 's_debug_sql', |
| | | exec_type: 'y', |
| | | LText: `declare @mk_organization nvarchar(512) |
| | | LText: `declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20) |
| | | ${res.dataSource}` |
| | | } |
| | | |
| | |
| | | closeGroup={this.closeGroup} |
| | | selectGroup={this.selectGroup} |
| | | /> |
| | | {group ? <div className="form-area"> |
| | | {group ? <div className={`form-area mk-${card.wrap.formStyle || ''}`}> |
| | | <PlusOutlined className="plus" title="添加表单" onClick={this.addForm}/> |
| | | <FieldsComponent config={group} type="form" plusFields={this.plusFields} /> |
| | | <span style={{color: 'red', marginLeft: '30px', cursor: 'pointer'}} onClick={this.clearGroup}>清空</span> |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'formStyle', |
| | | label: '表单样式', |
| | | initval: wrap.formStyle || '', |
| | | required: false, |
| | | options: [ |
| | | {value: '', label: '默认'}, |
| | | {value: 'shadow', label: '阴影'}, |
| | | ], |
| | | forbid: appType !== 'mob' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'goback', |
| | | label: '空值返回', |
| | | initval: wrap.goback || 'false', |
| | |
| | | let param = { |
| | | func: 's_debug_sql', |
| | | exec_type: 'y', |
| | | LText: `declare @mk_organization nvarchar(512) |
| | | LText: `declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20) |
| | | ${res.dataSource}` |
| | | } |
| | | |
| | |
| | | closeGroup={this.closeGroup} |
| | | selectGroup={this.selectGroup} |
| | | /> |
| | | {group ? <div className="form-area"> |
| | | {group ? <div className={`form-area mk-${card.wrap.formStyle || ''}`}> |
| | | <PlusOutlined className="plus" title="添加表单" onClick={this.addForm}/> |
| | | <FieldsComponent config={group} type="form" plusFields={this.plusFields} /> |
| | | <span style={{color: 'red', marginLeft: '30px', cursor: 'pointer'}} onClick={this.clearGroup}>清空</span> |
| | |
| | | let param = { |
| | | func: 's_debug_sql', |
| | | exec_type: 'y', |
| | | LText: `declare @mk_organization nvarchar(512) |
| | | LText: `declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20) |
| | | ${res.dataSource}` |
| | | } |
| | | |
| | |
| | | let param = { |
| | | func: 's_debug_sql', |
| | | exec_type: 'y', |
| | | LText: `declare @mk_organization nvarchar(512) |
| | | LText: `declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20) |
| | | ${res.dataSource}` |
| | | } |
| | | |
| | |
| | | const { data, initdata } = this.props |
| | | let _config = fromJS(this.props.config).toJS() |
| | | |
| | | let _data = {} |
| | | let _data = { $$empty: true } |
| | | let _sync = false |
| | | |
| | | let BID = '' |
| | |
| | | _sync = _config.setting.sync === 'true' |
| | | |
| | | if (_sync && data) { |
| | | _data = data[_config.dataName] || {} |
| | | _data = data[_config.dataName] || {$$empty: true} |
| | | if (_data && Array.isArray(_data)) { |
| | | _data = _data[0] || {} |
| | | _data = _data[0] || {$$empty: true} |
| | | } |
| | | _sync = false |
| | | } else if (_sync && initdata) { |
| | | _data = initdata || {} |
| | | _data = initdata |
| | | if (_data && Array.isArray(_data)) { |
| | | _data = _data[0] || {} |
| | | _data = _data[0] || {$$empty: true} |
| | | } |
| | | _sync = false |
| | | } |
| | | } else { |
| | | _data = {} |
| | | } |
| | | |
| | | if (_config.wrap.minHeight) { |
| | |
| | | const { sync, config } = this.state |
| | | |
| | | if (sync && !is(fromJS(this.props.data), fromJS(nextProps.data))) { |
| | | let _data = {} |
| | | let _data = {$$empty: true} |
| | | if (nextProps.data && nextProps.data[config.dataName]) { |
| | | _data = nextProps.data[config.dataName] |
| | | if (_data && Array.isArray(_data)) { |
| | | _data = _data[0] |
| | | _data = _data[0] || {$$empty: true} |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | if (config.wrap.datatype === 'static') { |
| | | this.setState({ |
| | | data: {}, |
| | | data: {$$empty: true}, |
| | | loading: false |
| | | }) |
| | | return |
| | | } else if (config.setting.supModule && !BID) { // BID 不存在时,不做查询 |
| | | this.setState({ |
| | | data: {}, |
| | | data: {$$empty: true}, |
| | | loading: false |
| | | }) |
| | | return |
| | |
| | | |
| | | let result = await Api.genericInterface(param) |
| | | if (result.status) { |
| | | let _data = result.data && result.data[0] ? result.data[0] : {} |
| | | let _data = result.data && result.data[0] ? result.data[0] : {$$empty: true} |
| | | |
| | | this.setState({ |
| | | data: _data, |
| | |
| | | render() { |
| | | const { config, loading, data } = this.state |
| | | |
| | | if (config.wrap.empty === 'hidden' && (!data || data.$$empty)) return null |
| | | |
| | | return ( |
| | | <div className="custom-braft-editor-box" id={'anchor' + config.uuid} style={config.style}> |
| | | {loading ? |
| | |
| | | let cache = action.setting.cache !== 'false' |
| | | let debug = window.GLOB.debugger === true || (window.debugger === true && options.sysType !== 'cloud') |
| | | |
| | | let _sql = `Declare @mk_organization nvarchar(512) select @mk_organization='${sessionStorage.getItem('organization') || ''}'\n` |
| | | let _sql = `Declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20) select @mk_departmentcode='${sessionStorage.getItem('departmentcode') || ''}',@mk_organization='${sessionStorage.getItem('organization') || ''}',@mk_user_type='${sessionStorage.getItem('mk_user_type') || ''}'\n` |
| | | let _sso = _sql |
| | | |
| | | deForms.forEach(item => { |
| | |
| | | improveSimpleActionForm = (deForms) => { |
| | | let cache = this.props.action.setting.cache !== 'false' |
| | | let debug = window.GLOB.debugger === true || (window.debugger === true && options.sysType !== 'cloud') |
| | | let _sql = `Declare @mk_organization nvarchar(512) select @mk_organization='${sessionStorage.getItem('organization') || ''}'\n` |
| | | let _sql = `Declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20) select @mk_departmentcode='${sessionStorage.getItem('departmentcode') || ''}',@mk_organization='${sessionStorage.getItem('organization') || ''}',@mk_user_type='${sessionStorage.getItem('mk_user_type') || ''}'\n` |
| | | |
| | | let deffers = deForms.map((form, index) => { |
| | | let param = { |
| | |
| | | |
| | | formlist.forEach((item, index) => { |
| | | if (item.hidden) return |
| | | if (item.empty === 'hidden' && item.options.length === 0) return |
| | | if (item.empty === 'hidden' && item.oriOptions.length === 0) return |
| | | |
| | | if (item.type === 'split') { |
| | | fields.push( |
| | |
| | | let param = { |
| | | func: 's_debug_sql', |
| | | exec_type: 'y', |
| | | LText: `declare @mk_organization nvarchar(512) |
| | | LText: `declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20) |
| | | ${res.dataSource}` |
| | | } |
| | | |
| | |
| | | let param = { |
| | | func: 's_debug_sql', |
| | | exec_type: 'y', |
| | | LText: `declare @mk_organization nvarchar(512) |
| | | LText: `declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20) |
| | | ${res.dataSource}` |
| | | } |
| | | |