| | |
| | | |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | import { getSearchForm } from '@/templates/zshare/formconfig' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import MKEmitter from '@/utils/events.js' |
| | |
| | | } |
| | | |
| | | state = { |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, |
| | | searchlist: null, |
| | | sqlVerifing: false, |
| | | visible: false, |
| | |
| | | */ |
| | | deleteElement = (card) => { |
| | | const { config } = this.props |
| | | const { dict } = this.state |
| | | let _this = this |
| | | |
| | | confirm({ |
| | | content: dict['model.confirm'] + dict['model.delete'] + ` - ${card.label} ?`, |
| | | content: `确定删除 - ${card.label} ?`, |
| | | onOk() { |
| | | let _searchlist = fromJS(_this.state.searchlist).toJS() |
| | | |
| | |
| | | |
| | | render() { |
| | | const { config } = this.props |
| | | const { dict, searchlist, visible, sqlVerifing, card, showField, setVisible } = this.state |
| | | const { searchlist, visible, sqlVerifing, card, showField, setVisible } = this.state |
| | | |
| | | return ( |
| | | <div className={'model-table-search-list length' + searchlist.length + (showField ? ' show-field' : '')}> |
| | | <FieldsComponent config={{uuid: config.uuid, search: searchlist}} type="search" /> |
| | | <Switch className="switch-field-show" checkedChildren={dict['model.switch.open']} unCheckedChildren={dict['model.switch.close']} defaultChecked={showField} onChange={this.onFieldChange} /> |
| | | <Switch className="switch-field-show" checkedChildren="开" unCheckedChildren="关" defaultChecked={showField} onChange={this.onFieldChange} /> |
| | | <DragElement |
| | | list={searchlist} |
| | | setting={config.wrap || config.setting} |
| | |
| | | destroyOnClose |
| | | > |
| | | <SearchForm |
| | | dict={dict} |
| | | card={this.state.card} |
| | | formlist={this.state.formlist} |
| | | inputSubmit={this.handleSubmit} |