| | |
| | | return |
| | | } |
| | | |
| | | if (['select', 'multiselect', 'link', 'checkcard'].includes(res.type) && res.resourceType === '1' && /\s/.test(res.dataSource)) { |
| | | if (['select', 'multiselect', 'link', 'checkcard'].includes(res.type) && res.resourceType === '1' && res.database !== 'sso' && /\s/.test(res.dataSource)) { |
| | | this.setState({ |
| | | sqlVerifing: true |
| | | }) |
| | |
| | | let sql = `declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20) |
| | | ${res.dataSource}` |
| | | sql = sql.replace(/@\$|\$@/ig, '') |
| | | |
| | | let rduri = '' |
| | | if (window.GLOB.mainSystemApi && res.database === 'sso') { |
| | | rduri = window.GLOB.mainSystemApi |
| | | } |
| | | |
| | | Api.sDebug(sql, rduri).then(result => { |
| | | Api.sDebug(sql).then(result => { |
| | | if (result.status || result.ErrCode === '-2') { |
| | | this.setState({ |
| | | sqlVerifing: false, |
| | |
| | | * @description 搜索条件删除 |
| | | */ |
| | | deleteElement = (cell) => { |
| | | let _this = this |
| | | let that = this |
| | | |
| | | confirm({ |
| | | content: `确定删除 - ${cell.label} ?`, |
| | | onOk() { |
| | | let _card = fromJS(_this.state.card).toJS() |
| | | let _card = fromJS(that.state.card).toJS() |
| | | _card.search = _card.search.filter(item => item.uuid !== cell.uuid) |
| | | |
| | | _this.updateComponent(_card) |
| | | that.updateComponent(_card) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | match: 'like', |
| | | focus: true |
| | | } |
| | | |
| | | if (card.search.length) { |
| | | item.ratio = card.search[card.search.length - 1].ratio |
| | | } |
| | | |
| | | card.search.push(item) |
| | | |
| | | this.setState({card}, () => { |
| | |
| | | |
| | | if (type === 'simple') { |
| | | _card.search.push(item) |
| | | |
| | | this.updateComponent(_card) |
| | | this.handleSearch(item) |
| | | } else if (type === 'replace') { |
| | | delete item.focus |
| | | _card.search = _card.search.map(cell => { |
| | | if (cell.field && cell.field.toLowerCase() === item.field.toLowerCase()) { |
| | | return item |
| | | } |
| | | return cell |
| | | }) |
| | | |
| | | this.updateComponent(_card) |
| | | this.handleSearch(item) |
| | |
| | | let _style = resetStyle(card.style) |
| | | |
| | | return ( |
| | | <div className={`main-search-edit-list ${card.wrap.float} ${showField ? 'show-field' : ''}`} onClick={this.clickComponent} id={card.uuid} style={_style}> |
| | | <div className={`main-search-edit-list ${card.wrap.float} ${showField ? 'show-field' : ''} mk-order-${card.wrap.searchSize || ''}`} onClick={this.clickComponent} id={card.uuid} style={_style}> |
| | | <FieldsComponent config={card} type="search" /> |
| | | <Switch checkedChildren="开" size="small" unCheckedChildren="关" defaultChecked={showField} onChange={this.onFieldChange} /> |
| | | <DragElement |
| | |
| | | title="搜索条件-编辑" |
| | | wrapClassName="mk-scroll-modal" |
| | | visible={visible} |
| | | width={850} |
| | | width={950} |
| | | maskClosable={false} |
| | | onOk={this.handleSubmit} |
| | | confirmLoading={sqlVerifing} |