| | |
| | | this.setState({ |
| | | actvisible: true, |
| | | card: card, |
| | | formlist: getActionForm(card, functip, cards.setting, usefulFields, 'card', menulist, modules, cards.columns) |
| | | formlist: getActionForm(card, functip, cards, usefulFields, 'card', menulist, modules) |
| | | }) |
| | | } |
| | | |
| | |
| | | <CopyComponent type="cardcell" card={card}/> |
| | | <PasteComponent elements={elements} options={['action', 'customCardElement']} updateConfig={(list) => this.updateCard(list, 'paste')} /> |
| | | <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" /> |
| | | {cards.subtype === 'propcard' ? <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <Icon className="plus" title="左移" type="arrow-left" onClick={() => this.props.move(card, 'left')} /> |
| | | <Icon className="close" title="右移" type="arrow-right" onClick={() => this.props.move(card, 'right')} /> |
| | | <Icon className="plus" title="前移" type="arrow-left" onClick={() => this.props.move(card, 'left')} /> |
| | | <Icon className="close" title="后移" type="arrow-right" onClick={() => this.props.move(card, 'right')} /> |
| | | </div> |
| | | } trigger="hover" getPopupContainer={() => document.getElementById(card.uuid + 'swap')}> |
| | | <Icon type="swap" id={card.uuid + 'swap'}/> |
| | | </Popover> : null} |
| | | </Popover> |
| | | {cards.subtype === 'propcard' || card.$cardType === 'extendCard' ? <Icon className="close" title="删除卡片" type="delete" onClick={() => this.props.deleteElement(card)} /> : null} |
| | | {card.setting.type === 'multi' ? <Switch size="small" onClick={this.changeSide} defaultChecked /> : null} |
| | | </div> |
| | |
| | | this.props.updateConfig(card) |
| | | } |
| | | |
| | | move = (item, direction) => { |
| | | let card = fromJS(this.state.card).toJS() |
| | | |
| | | let dragIndex = card.subcards.findIndex(c => c.uuid === item.uuid) |
| | | let hoverIndex = null |
| | | |
| | | if (direction === 'left') { |
| | | hoverIndex = dragIndex - 1 |
| | | } else { |
| | | hoverIndex = dragIndex + 1 |
| | | } |
| | | |
| | | if (hoverIndex === -1 || hoverIndex === card.subcards.length) return |
| | | |
| | | card.subcards.splice(hoverIndex, 0, ...card.subcards.splice(dragIndex, 1)) |
| | | |
| | | this.setState({card}) |
| | | this.props.updateConfig(card) |
| | | } |
| | | |
| | | clickComponent = (e) => { |
| | | if (sessionStorage.getItem('style-control') === 'true' || sessionStorage.getItem('style-control') === 'component') { |
| | | e.stopPropagation() |
| | |
| | | } trigger="hover"> |
| | | <Icon type="tool" /> |
| | | </Popover> |
| | | <ActionComponent config={card} setSubConfig={this.setSubConfig} updateaction={this.updateComponent}/> |
| | | {card.subcards.map((subcard, index) => (<CardComponent key={subcard.uuid} offset={!index ? offset : 0} cards={card} card={subcard} updateElement={this.updateCard} deleteElement={this.deleteCard}/>))} |
| | | <ActionComponent config={card} type="datacard" setSubConfig={this.setSubConfig} updateaction={this.updateComponent}/> |
| | | {card.subcards.map((subcard, index) => (<CardComponent key={subcard.uuid} offset={!index ? offset : 0} cards={card} card={subcard} move={this.move} updateElement={this.updateCard} deleteElement={this.deleteCard}/>))} |
| | | <div style={{clear: 'both'}}></div> |
| | | {card.wrap.pagestyle === 'page' && card.setting.laypage === 'true' && appType !== 'mob' ? <Pagination total={85} size="small" showTotal={total => `共 ${total} 条`} pageSize={20} defaultCurrent={1}/> : null} |
| | | {card.wrap.pagestyle === 'page' && card.setting.laypage === 'true' && appType === 'mob' ? <MobPagination /> : null} |
| | |
| | | <Icon className="edit" title="编辑" type="edit" onClick={() => this.setState({settingVisible: true})} /> |
| | | <CopyComponent type="cardcell" card={card}/> |
| | | <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" /> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <Icon className="plus" title="前移" type="arrow-left" onClick={() => this.props.move(card, 'left')} /> |
| | | <Icon className="close" title="后移" type="arrow-right" onClick={() => this.props.move(card, 'right')} /> |
| | | </div> |
| | | } trigger="hover" getPopupContainer={() => document.getElementById(card.uuid + 'swap')}> |
| | | <Icon type="swap" id={card.uuid + 'swap'}/> |
| | | </Popover> |
| | | <Icon className="close" title="删除卡片" type="delete" onClick={() => this.props.deleteElement(card)} /> |
| | | </div> |
| | | } trigger="hover"> |
| | |
| | | {option.label} |
| | | </Select.Option> |
| | | )} |
| | | <Select.Option key={'index'} value={'$Index'}>序号(前端)</Select.Option> |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | |
| | | } |
| | | } |
| | | |
| | | move = (item, direction) => { |
| | | let card = fromJS(this.state.card).toJS() |
| | | |
| | | let dragIndex = card.subcards.findIndex(c => c.uuid === item.uuid) |
| | | let hoverIndex = null |
| | | |
| | | if (direction === 'left') { |
| | | hoverIndex = dragIndex - 1 |
| | | } else { |
| | | hoverIndex = dragIndex + 1 |
| | | } |
| | | |
| | | if (hoverIndex === -1 || hoverIndex === card.subcards.length) return |
| | | |
| | | card.subcards.splice(hoverIndex, 0, ...card.subcards.splice(dragIndex, 1)) |
| | | |
| | | this.setState({card}) |
| | | this.props.updateConfig(card) |
| | | } |
| | | |
| | | clickComponent = (e) => { |
| | | if (sessionStorage.getItem('style-control') === 'true' || sessionStorage.getItem('style-control') === 'component') { |
| | | e.stopPropagation() |
| | |
| | | <Icon type="tool" /> |
| | | </Popover> |
| | | <div style={{minHeight: 'calc(100% - 90px)'}}> |
| | | {card.subcards.map(subcard => (<CardComponent key={subcard.uuid} cards={card} card={subcard} updateElement={this.updateCard} deleteElement={this.deleteCard}/>))} |
| | | {card.subcards.map(subcard => (<CardComponent key={subcard.uuid} cards={card} card={subcard} updateElement={this.updateCard} move={this.move} deleteElement={this.deleteCard}/>))} |
| | | </div> |
| | | {card.setting.laypage === 'true' && card.wrap.pagestyle !== 'slide' && appType !== 'mob' ? <Pagination size="small" total={50} /> : null} |
| | | {card.setting.laypage === 'true' && card.wrap.pagestyle !== 'slide' && appType === 'mob' ? <MobPagination /> : null} |
| | |
| | | getdata = () => { |
| | | const { card } = this.state |
| | | |
| | | const data = []; |
| | | const val = (Math.random() * card.plot.maxValue).toFixed(1); |
| | | data.push({ value: +val }); |
| | | return data; |
| | | const data = [] |
| | | const val = (Math.random() * card.plot.maxValue).toFixed(1) |
| | | data.push({ value: +val }) |
| | | return data |
| | | } |
| | | |
| | | dashboardrender = () => { |
| | |
| | | if (_Ot !== 'notRequired' && _opentype !== 'excelOut') { |
| | | _options.push('controlField', 'controlVal') |
| | | } |
| | | if (_Ot === 'requiredSgl' && ['pop', 'prompt', 'exec'].includes(_opentype)) { |
| | | _options.push('swipe') |
| | | } |
| | | |
| | | return _options |
| | | } |
| | |
| | | * @param {*} usefulFields 存储过程可用的开始字段 |
| | | * @param {*} type 按钮类型,用于区分可选的打开方式 |
| | | */ |
| | | export function getActionForm (card, functip, setting, usefulFields, type, menulist = [], modules = [], columns = []) { |
| | | export function getActionForm (card, functip, config, usefulFields, type, menulist = [], modules = []) { |
| | | let setting = config.setting || {} |
| | | let columns = config.columns || [] |
| | | let appMenus = [] |
| | | let opentypes = [ |
| | | { |
| | |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'swipe', |
| | | label: "滑动显示", |
| | | initVal: card.swipe || 'false', |
| | | required: false, |
| | | forbid: (type !== 'datacard' || sessionStorage.getItem('appType') !== 'mob'), |
| | | options: [{ |
| | | value: 'false', |
| | | text: '否' |
| | | }, { |
| | | value: 'left', |
| | | text: '左滑' |
| | | }, { |
| | | value: 'right', |
| | | text: '右滑' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'icon', |
| | | label: Formdict['model.icon'], |
| | |
| | | this.setState({ |
| | | visible: true, |
| | | card: card, |
| | | formlist: getActionForm(card, functip, config.setting, usefulFields, this.props.type, menulist, modules, config.columns) |
| | | formlist: getActionForm(card, functip, config, usefulFields, this.props.type, menulist, modules) |
| | | }) |
| | | } |
| | | |
| | |
| | | sync: false, // 是否统一请求数据 |
| | | card: null, // 卡片设置 |
| | | data: null, // 数据 |
| | | total: null |
| | | total: null, |
| | | precards: [], |
| | | nextcards: [], |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { data, initdata, BID } = this.props |
| | | let _config = fromJS(this.props.config).toJS() |
| | | |
| | | _config.subcards = _config.subcards.map(item => { |
| | | let _card = null |
| | | let precards = [] |
| | | let nextcards = [] |
| | | |
| | | _config.subcards.forEach(item => { |
| | | item.setting.$click = '' |
| | | if (item.setting.click === 'button') { |
| | | if (item.elements.filter(ele => ele.eleType === 'button').length < 2) { |
| | |
| | | } |
| | | item.setting.click = '' |
| | | } |
| | | return item |
| | | |
| | | if (item.$cardType !== 'extendCard') { |
| | | _card = item |
| | | } else if (!_card) { |
| | | precards.push(item) |
| | | } else { |
| | | nextcards.push(item) |
| | | } |
| | | }) |
| | | |
| | | let _card = _config.subcards.shift() |
| | | _config.subcards = null |
| | | |
| | | let _cols = new Map() |
| | | |
| | | let _data = null |
| | |
| | | |
| | | if (_config.wrap.cardFloat && _config.wrap.cardFloat !== 'left') { |
| | | let _width = 0 |
| | | _config.subcards.forEach(card => { |
| | | precards.forEach(card => { |
| | | _width += card.setting.width |
| | | }) |
| | | nextcards.forEach(card => { |
| | | _width += card.setting.width |
| | | }) |
| | | |
| | | _config.$offset = _width |
| | | } else { |
| | | _config.wrap.cardFloat = null |
| | | } |
| | | |
| | | if (_data) { |
| | |
| | | }) |
| | | |
| | | this.setState({ |
| | | precards, |
| | | nextcards, |
| | | sync: _sync, |
| | | data: _data, |
| | | BID: BID || '', |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { config, loading, data, pageIndex, total, card, activeKey, BID, BData, selectedData, selectKeys } = this.state |
| | | const { config, precards, nextcards, loading, data, pageIndex, total, card, activeKey, BID, BData, selectedData, selectKeys } = this.state |
| | | |
| | | let _total = 0 |
| | | let switchable = false |
| | |
| | | } |
| | | let offset = 0 |
| | | |
| | | if (config.wrap.cardFloat && config.wrap.cardFloat !== 'left') { |
| | | if (config.wrap.cardFloat) { |
| | | let length = data ? data.length : 0 |
| | | if (card.setting.width * length + config.$offset < 24) { |
| | | offset = 24 - card.setting.width * length - config.$offset |
| | |
| | | <div className={`data-zoom ${config.wrap.cardType || ''} ${config.wrap.scale || ''}`}> |
| | | {switchable ? <div className={'prev-page ' + (pageIndex === 1 ? 'disabled' : '')} onClick={this.prevPage}><div><div><img src={preImg} alt=""/></div></div></div> : null} |
| | | <Row className="card-row-list"> |
| | | {offset ? <Col span={offset} style={{height: '10px'}}> </Col> : null} |
| | | {precards.map((item, index) => ( |
| | | <Col key={'pre' + index} className={item.setting.$click} span={item.setting.width || 6}> |
| | | <CardItem card={item} cards={config} data={{$$BID: BID, $$type: 'extendCard'}}/> |
| | | </Col> |
| | | ))} |
| | | {data && data.map((item, index) => ( |
| | | <Col className={(activeKey === index ? ' active' : (selectKeys.indexOf(index) > -1 ? ' selected' : '')) + (card.setting.$click ? ' pointer' : '') + card.setting.$click} key={index} span={card.setting.width} offset={!index ? offset : 0} onClick={() => {this.changeCard(index, item)}}> |
| | | <Col className={(activeKey === index ? ' active' : (selectKeys.indexOf(index) > -1 ? ' selected' : '')) + (card.setting.$click ? ' pointer' : '') + card.setting.$click} key={index} span={card.setting.width} onClick={() => {this.changeCard(index, item)}}> |
| | | <CardItem card={card} cards={config} data={item}/> |
| | | </Col> |
| | | ))} |
| | | {config.subcards.map((item, index) => ( |
| | | <Col key={'mk' + index} className={item.setting.$click} span={item.setting.width || 6} offset={(!data || data.length === 0) ? offset : 0}> |
| | | {nextcards.map((item, index) => ( |
| | | <Col key={'next' + index} className={item.setting.$click} span={item.setting.width || 6}> |
| | | <CardItem card={item} cards={config} data={{$$BID: BID, $$type: 'extendCard'}}/> |
| | | </Col> |
| | | ))} |
| | | </Row> |
| | | {switchable ? <div className={'prev-page ' + (total <= _total ? 'disabled' : '')} onClick={this.nextPage}><div><div><img src={nextImg} alt=""/></div></div></div> : null} |
| | | {config.subcards.length === 0 && (!data || data.length === 0) ? <Empty description={false}/> : null} |
| | | {precards.length === 0 && nextcards.length === 0 && (!data || data.length === 0) ? <Empty description={false}/> : null} |
| | | </div> |
| | | {config.wrap.pagestyle !== 'switch' && config.setting.laypage && data ? <Pagination size="small" total={total} showTotal={t => `共 ${t} 条`} pageSize={config.setting.pageSize} onChange={this.changePageIndex} current={pageIndex}/> : null} |
| | | </div> |
| | |
| | | top: 0; |
| | | right: 0px; |
| | | bottom: 0px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | text-align: justify; |
| | | z-index: 1; |
| | | |
| | | .ant-spin-blur { |
| | |
| | | title: '', // 组件标题 |
| | | sync: false, // 是否统一请求数据 |
| | | plot: null, // 图表设置 |
| | | data: null, // 数据 |
| | | data: {}, // 数据 |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | |
| | | if (config.subtype === 'ratioboard') { |
| | | data = result.data || [] |
| | | } else { |
| | | let data = {} |
| | | data = {} |
| | | if (result.data && result.data[0] && result.data[0].hasOwnProperty(config.plot.valueField)) { |
| | | data.value = result.data[0][config.plot.valueField] |
| | | } |
| | |
| | | |
| | | ratioboardrender = () => { |
| | | const { plot, chartId } = this.state |
| | | |
| | | const data = this.getratiodata() |
| | | |
| | | const chart = new Chart({ |
| | |
| | | const { plot, chartId, data } = this.state |
| | | |
| | | let _data = fromJS(data).toJS() |
| | | if (_data.value && _data.value > plot.maxValue) { |
| | | _data.value = plot.maxValue |
| | | |
| | | if (_data.hasOwnProperty('value')) { |
| | | if (_data.value === '' || _data.value === null) { |
| | | delete _data.value |
| | | } else { |
| | | _data.value = +_data.value |
| | | |
| | | if (isNaN(_data.value)) { |
| | | delete _data.value |
| | | } else if (_data.value > plot.maxValue) { |
| | | _data.value = plot.maxValue |
| | | } |
| | | } |
| | | } |
| | | |
| | | const chart = new Chart({ |
| | |
| | | height: plot.height, |
| | | padding: [0, 0, 0, 0], |
| | | }) |
| | | chart.data([_data]); |
| | | chart.data([_data]) |
| | | chart.scale('value', { |
| | | min: 0, |
| | | max: plot.maxValue, |
| | |
| | | radius: 0.75, |
| | | }) |
| | | |
| | | chart.axis('1', false); |
| | | chart.axis('1', false) |
| | | chart.axis('value', { |
| | | line: null, |
| | | label: { |
| | |
| | | top: 0; |
| | | right: 0px; |
| | | bottom: 0px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | text-align: justify; |
| | | z-index: 1; |
| | | |
| | | .ant-spin-blur { |
| | |
| | | top: 0; |
| | | right: 0px; |
| | | bottom: 0px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | text-align: justify; |
| | | z-index: 1; |
| | | |
| | | .ant-spin-blur { |
| | |
| | | top: 0; |
| | | right: 0px; |
| | | bottom: 0px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | text-align: justify; |
| | | z-index: 1; |
| | | |
| | | .ant-spin-blur { |
| | |
| | | top: 0; |
| | | right: 0px; |
| | | bottom: 0px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | text-align: justify; |
| | | z-index: 1; |
| | | |
| | | .ant-spin-blur { |
| | |
| | | values.options = [] |
| | | } |
| | | |
| | | console.log(values) |
| | | |
| | | if (isvalid) { |
| | | ['linkField', 'valueField', 'valueText', 'orderBy'].forEach(item => { |
| | | if (values[item]) { |