| | |
| | | |
| | | const cardTypeOptions = { |
| | | sequence: ['eleType', 'width'], |
| | | text: ['eleType', 'datatype', 'format', 'width', 'height', 'prefix', 'postfix', 'link'], |
| | | text: ['eleType', 'datatype', 'format', 'width', 'height', 'prefix', 'postfix', 'link', 'noValue'], |
| | | number: ['eleType', 'datatype', 'format', 'width', 'height', 'prefix', 'postfix'], |
| | | picture: ['eleType', 'datatype', 'width', 'lenWidRadio', 'maxWidth', 'link'], |
| | | video: ['eleType', 'datatype', 'width', 'aspectRatio', 'autoPlay', 'loop'], |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'noValue', |
| | | label: '空值', |
| | | initVal: card.noValue || 'show', |
| | | required: false, |
| | | options: [ |
| | | { value: 'show', text: '显示' }, |
| | | { value: 'hide', text: '隐藏' } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'link', |
| | | label: '链接', |
| | | initVal: card.link || '', |
| | |
| | | } |
| | | } |
| | | |
| | | onSysInter = (e) => { |
| | | let value = e.target.value |
| | | |
| | | if (value === 'true') { |
| | | this.props.form.setFieldsValue({interface: window.GLOB.mainSystemApi}) |
| | | } |
| | | } |
| | | |
| | | changeSupModule = (val) => { |
| | | this.setState({supModule: val}) |
| | | } |
| | |
| | | </Radio.Group>)} |
| | | </Form.Item> |
| | | </Col> |
| | | {interType === 'outer' ? <Col span={8}> |
| | | <Form.Item label="系统接口"> |
| | | {getFieldDecorator('sysInterface', { |
| | | initialValue: setting.sysInterface || 'false' |
| | | })( |
| | | <Radio.Group onChange={this.onSysInter}> |
| | | <Radio value="true">是</Radio> |
| | | <Radio value="false">否</Radio> |
| | | </Radio.Group>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {interType === 'system' ? <Col span={8}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title={'自定义脚本中的变量(除报错及可用字段外),需以此标识开头。'}> |
| | |
| | | subtype: card.subtype, |
| | | wrap: { type: 'navbar', height: 50, title: 'NavBar', back: 'true', search: 'false', logout: 'false' }, |
| | | style: {boxShadow: '0 0 3px #D9D9D9', shadowColor: '#D9D9D9', shadowBlur: '3px', paddingLeft: '10px', paddingRight: '10px', lineHeight: '2.8', fontSize: '18px' }, |
| | | searchStyle: {} |
| | | } |
| | | |
| | | if (card.config) { |
| | |
| | | |
| | | if (comIds[0] !== card.uuid) return |
| | | |
| | | let _card = {...card, style} |
| | | let _card = fromJS(card).toJS() |
| | | |
| | | if (comIds[1] === 'search') { |
| | | _card.searchStyle = style |
| | | } else { |
| | | _card.style = style |
| | | } |
| | | |
| | | this.setState({ |
| | | card: _card |
| | |
| | | const { card } = this.state |
| | | |
| | | MKEmitter.emit('changeStyle', [card.uuid], ['font', 'background', 'border', 'padding', 'shadow'], card.style) |
| | | } |
| | | |
| | | changeSearchStyle = () => { |
| | | const { card } = this.state |
| | | |
| | | MKEmitter.emit('changeStyle', [card.uuid, 'search'], ['font', 'background', 'border'], card.searchStyle || {}) |
| | | } |
| | | |
| | | clickComponent = (e) => { |
| | |
| | | </div> |
| | | {card.wrap.type !== 'search' ? |
| | | <div className="am-navbar-title">{card.wrap.title || ''}</div> : |
| | | <div className="am-navbar-search" onDoubleClick={this.setSearch}><div className="search-bar"><Icon type="search" /></div></div> |
| | | <div className="am-navbar-search" onDoubleClick={this.setSearch}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <Icon className="style" title="调整样式" onClick={this.changeSearchStyle} type="font-colors" /> |
| | | </div> |
| | | } trigger="hover"> |
| | | <div style={card.searchStyle} className="search-bar"> |
| | | {card.search && card.search.setting.scan === 'true' ? <Icon type="scan" /> : <Icon type="search" />} |
| | | </div> |
| | | </Popover> |
| | | </div> |
| | | } |
| | | <div className="am-navbar-right"> |
| | | {card.wrap.search === 'true' ? <Icon type="search" onDoubleClick={this.setSearch}/> : null} |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | {type === 'search' ? <Col span={12}> |
| | | <Form.Item label="扫码"> |
| | | {getFieldDecorator('scan', { |
| | | initialValue: config.setting.scan || 'false' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="true">开启</Radio> |
| | | <Radio value="false">关闭</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {type === 'search' ? <Col span={12}> |
| | | <Form.Item label="黑名单"> |
| | | {getFieldDecorator('blacklist', { |
| | | initialValue: config.setting.blacklist || [] |
| | |
| | | val = data[card.field] |
| | | } |
| | | |
| | | if (val === '' && card.noValue === 'hide') { // 空值隐藏 |
| | | return null |
| | | } |
| | | |
| | | if (val !== '' && card.format) { |
| | | if (card.format === 'YYYY-MM-DD' && /^[1-9]\d{3}(-|\/)(0[1-9]|1[0-2])(-|\/)(0[1-9]|[1-2][0-9]|3[0-1])/.test(val)) { |
| | | val = `${val.substr(0, 4)}-${val.substr(5, 2)}-${val.substr(8, 2)}` |