| | |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'checkAll', |
| | | label: '全选', |
| | | initval: setting.checkAll || 'hidden', |
| | | tooltip: '全选仅在数据卡可多选,且选中风格为勾选框时有效。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'hidden', label: '隐藏'}, |
| | | {value: 'show', label: '显示'}, |
| | | ], |
| | | forbid: cardType !== 'extendCard' |
| | | }, |
| | | { |
| | | type: 'table', |
| | | field: 'menus', |
| | | label: '菜单组', |
| | |
| | | </Col> |
| | | <Col span={24} className="sqlfield"> |
| | | <Form.Item label={'可用字段'}> |
| | | <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'公共值,请按照@xxx@格式使用。'}><span style={{color: '#1890ff'}}>BID, ID, LoginUID, SessionUid, UserID, Appkey, time_id</span></Tooltip>, |
| | | <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'公共值,请按照@xxx@格式使用。'}><span style={{color: '#1890ff'}}>BID, LoginUID, SessionUid, UserID, Appkey, time_id</span></Tooltip>, |
| | | <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'系统变量,系统会定义变量并赋值。'}><span style={{color: '#fa8c16'}}>UserName, FullName, RoleID, mk_departmentcode, mk_organization, mk_user_type, mk_nation, mk_province, mk_city, mk_district, mk_address</span></Tooltip>, |
| | | <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'排序、分页以及搜索条件变量,请按照@xxx@格式使用。'}>orderBy, pageSize, pageIndex{usefulFields ? ', ' + usefulFields : ''}</Tooltip> |
| | | <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'url变量,请按照@xxx@格式使用。'}>{urlFields ? ', ' : ''}<span style={{color: '#13c2c2'}}>{urlFields}</span></Tooltip> |
| | |
| | | // error = '系统函数' + _customScript.match(/\$ex@.{1,50}@ex\$/g)[0].replace(/\$ex@|@ex\$/g, '') + '未定义' |
| | | // } |
| | | |
| | | _dataresource = _dataresource.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|upid)@/ig, `'${timestamp}'`) |
| | | _customScript = _customScript.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|upid)@/ig, `'${timestamp}'`) |
| | | _dataresource = _dataresource.replace(/@(BID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|upid)@/ig, `'${timestamp}'`) |
| | | _customScript = _customScript.replace(/@(BID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|upid)@/ig, `'${timestamp}'`) |
| | | |
| | | _dataresource = _dataresource.replace(/@\$|\$@/ig, '') |
| | | _customScript = _customScript.replace(/@\$|\$@/ig, '') |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { card, data, cards } = this.props |
| | | const { card, data, cards, children } = this.props |
| | | let style = {...card.style} |
| | | |
| | | let bg = null |
| | |
| | | return ( |
| | | <div className={'card-item-box ' + (card.setting.btnControl || '')} style={style} onClick={this.openView} onDoubleClick={this.doubleClick}> |
| | | {bg} |
| | | {children} |
| | | <CardCellComponent data={data} cards={cards} cardCell={card} elements={card.elements}/> |
| | | {card.setting.type === 'multi' ? <div className={'back-side ' + card.setting.transform} style={card.backStyle}> |
| | | <CardCellComponent data={data} cards={cards} cardCell={card} elements={card.backElements}/> |
| | |
| | | if (config.uuid !== menuId) return |
| | | |
| | | if (checked) { |
| | | this.setState({ |
| | | activeKey: '', |
| | | selectKeys: data.map((item, index) => index), |
| | | selectedData: data |
| | | let index = '' |
| | | let keys = [] |
| | | let items = [] |
| | | let last = '' |
| | | |
| | | data.forEach((item, i) => { |
| | | if (item.$disabled) return |
| | | |
| | | items.push(item) |
| | | keys.push(i) |
| | | index = i |
| | | last = item |
| | | }) |
| | | |
| | | MKEmitter.emit('resetSelectLine', config.uuid, '', '') |
| | | MKEmitter.emit('syncBalconyData', config.uuid, data, data.length > 0) |
| | | if (data.length === 0) { |
| | | this.setState({ |
| | | activeKey: index, |
| | | selectKeys: keys, |
| | | selectedData: items |
| | | }) |
| | | |
| | | MKEmitter.emit('resetSelectLine', config.uuid, last ? last.$$uuid : '', last) |
| | | MKEmitter.emit('syncBalconyData', config.uuid, items, data.length > 0 && data.length === keys.length) |
| | | if (items.length === 0) { |
| | | message.warning('未获取到数据!') |
| | | } |
| | | } else { |
| | |
| | | |
| | | MKEmitter.emit('resetSelectLine', config.uuid, '', '') |
| | | MKEmitter.emit('syncBalconyData', config.uuid, [], false) |
| | | } |
| | | } |
| | | |
| | | checkAll = () => { |
| | | const { config, data, selectedData } = this.state |
| | | |
| | | if (!data || data.length === 0) return |
| | | |
| | | if (selectedData.length === 0 || selectedData.length < data.length) { |
| | | let index = '' |
| | | let keys = [] |
| | | let items = [] |
| | | let last = '' |
| | | |
| | | data.forEach((item, i) => { |
| | | if (item.$disabled) return |
| | | |
| | | items.push(item) |
| | | keys.push(i) |
| | | index = i |
| | | last = item |
| | | }) |
| | | |
| | | this.setState({ |
| | | activeKey: index, |
| | | selectKeys: keys, |
| | | selectedData: items |
| | | }) |
| | | |
| | | MKEmitter.emit('resetSelectLine', config.uuid, last ? last.$$uuid : '', last) |
| | | if (config.setting.$hasSyncModule) { |
| | | MKEmitter.emit('syncBalconyData', config.uuid, items, data.length === keys.length) |
| | | } |
| | | } else { |
| | | this.setState({ |
| | | activeKey: '', |
| | | selectKeys: [], |
| | | selectedData: [] |
| | | }) |
| | | |
| | | MKEmitter.emit('resetSelectLine', config.uuid, '', '') |
| | | if (config.setting.$hasSyncModule) { |
| | | MKEmitter.emit('syncBalconyData', config.uuid, [], false) |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | extendData = {...extendData, ...data[0]} |
| | | } |
| | | |
| | | let checkAll = '' |
| | | if (config.wrap.selStyle.indexOf('check') > -1) { |
| | | if (selectedData.length > 0) { |
| | | checkAll = selectedData.length < data.length ? ' half' : ' whole' |
| | | } |
| | | } |
| | | |
| | | return ( |
| | | <div className="custom-data-card-box" id={'anchor' + config.uuid} style={config.style}> |
| | | {loading ? |
| | |
| | | <Row className={'card-row-list ' + config.wrap.layout}> |
| | | {precards.map((item, index) => ( |
| | | <Col key={'pre' + index} className="extend-card" span={item.setting.width || 6}> |
| | | <CardItem card={item} cards={config} data={extendData}/> |
| | | <CardItem card={item} cards={config} data={extendData}> |
| | | {item.setting.checkAll === 'show' ? <span onClick={this.checkAll} className={'circle-select' + checkAll}></span> : null} |
| | | </CardItem> |
| | | </Col> |
| | | ))} |
| | | {data && data.map((item, index) => { |
| | |
| | | |
| | | return ( |
| | | <Col className={className} key={index} span={card.setting.width} onClick={() => {this.changeCard(index, item)}}> |
| | | <CardItem card={card} cards={config} data={item}/> |
| | | <CardItem card={card} cards={config} data={item}> |
| | | <span className="circle-select"></span> |
| | | </CardItem> |
| | | </Col> |
| | | ) |
| | | })} |
| | | {nextcards.map((item, index) => ( |
| | | <Col key={'next' + index} className="extend-card" span={item.setting.width || 6}> |
| | | <CardItem card={item} cards={config} data={extendData}/> |
| | | <CardItem card={item} cards={config} data={extendData}> |
| | | {item.setting.checkAll === 'show' ? <span onClick={this.checkAll} className={'circle-select' + checkAll}></span> : null} |
| | | </CardItem> |
| | | </Col> |
| | | ))} |
| | | </Row> |
| | |
| | | cursor: not-allowed; |
| | | color: #bcbcbc; |
| | | } |
| | | .mk-disabled { |
| | | .circle-select { |
| | | border-color: #e8e8e8!important; |
| | | cursor: not-allowed; |
| | | } |
| | | } |
| | | .circle-select { |
| | | position: relative; |
| | | display: none; |
| | | width: 16px; |
| | | height: 16px; |
| | | border: 1px solid #cccccc; |
| | | border-radius: 50%; |
| | | box-sizing: content-box; |
| | | margin: auto; |
| | | margin-right: 5px; |
| | | background-color: #ffffff; |
| | | transition: border-color 0.2s; |
| | | cursor: pointer; |
| | | } |
| | | .circle-select::before { |
| | | position: relative; |
| | | top: 1px; |
| | | left: 6px; |
| | | content: ' '; |
| | | display: block; |
| | | width: 5px; |
| | | height: 11px; |
| | | border-style: solid; |
| | | border-width: 0 2px 2px 0; |
| | | border-color: #ffffff; |
| | | transform: rotate(45deg); |
| | | } |
| | | |
| | | .data-zoom.check.square { |
| | | .circle-select { |
| | | border-radius: 0!important; |
| | | } |
| | | } |
| | | .data-zoom.check { |
| | | .mk-card.active, .mk-card.selected { |
| | | .circle-select { |
| | | border-color: var(--mk-sys-color); |
| | | background: var(--mk-sys-color); |
| | | } |
| | | } |
| | | .circle-select.whole { |
| | | border-color: var(--mk-sys-color); |
| | | background: var(--mk-sys-color); |
| | | } |
| | | .circle-select.half { |
| | | border-color: var(--mk-sys-color); |
| | | } |
| | | .circle-select.half::before { |
| | | display: none; |
| | | } |
| | | .circle-select.half::after { |
| | | position: absolute; |
| | | top: 4px; |
| | | left: 4px; |
| | | content: ' '; |
| | | display: block; |
| | | width: 8px; |
| | | height: 8px; |
| | | background: var(--mk-sys-color); |
| | | } |
| | | .card-item-box { |
| | | width: 100%; |
| | | display: flex; |
| | | } |
| | | .card-cell-list { |
| | | flex: 1; |
| | | } |
| | | .circle-select { |
| | | display: block; |
| | | } |
| | | .circle-select:hover { |
| | | border-color: var(--mk-sys-color); |
| | | } |
| | | } |
| | | } |
| | | .custom-data-card-box::-webkit-scrollbar { |
| | | width: 7px; |
| | |
| | | _customScript = _customScript.replace(/\$sum@/ig, '/*') |
| | | _customScript = _customScript.replace(/@sum\$/ig, '*/') |
| | | |
| | | _dataresource = _dataresource.replace(/@ID@/ig, `''`) |
| | | _customScript = _customScript.replace(/@ID@/ig, `''`) |
| | | // _dataresource = _dataresource.replace(/@ID@/ig, `''`) |
| | | // _customScript = _customScript.replace(/@ID@/ig, `''`) |
| | | _dataresource = _dataresource.replace(/@BID@/ig, `'${BID || ''}'`) |
| | | _customScript = _customScript.replace(/@BID@/ig, `'${BID || ''}'`) |
| | | _dataresource = _dataresource.replace(/@LoginUID@/ig, `'${sessionStorage.getItem('LoginUID') || ''}'`) |
| | |
| | | _customScript = _customScript.replace(/\$select@/ig, '/*') |
| | | _customScript = _customScript.replace(/@select\$/ig, '*/') |
| | | |
| | | _dataresource = _dataresource.replace(/@ID@/ig, `''`) |
| | | _customScript = _customScript.replace(/@ID@/ig, `''`) |
| | | // _dataresource = _dataresource.replace(/@ID@/ig, `''`) |
| | | // _customScript = _customScript.replace(/@ID@/ig, `''`) |
| | | _dataresource = _dataresource.replace(/@BID@/ig, `'${BID || ''}'`) |
| | | _customScript = _customScript.replace(/@BID@/ig, `'${BID || ''}'`) |
| | | _dataresource = _dataresource.replace(/@LoginUID@/ig, `'${sessionStorage.getItem('LoginUID') || ''}'`) |