| | |
| | | import Utils from '@/utils/utils.js' |
| | | import { getSearchForm } from '@/templates/zshare/formconfig' |
| | | import { resetStyle } from '@/utils/utils-custom.js' |
| | | import { getTables } from '@/utils/utils-custom.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | import DragElement from './dragsearch' |
| | |
| | | card: _card |
| | | }) |
| | | |
| | | this.props.updateConfig(_card) |
| | | this.updateComponent(_card) |
| | | } |
| | | |
| | | changeStyle = () => { |
| | | const { card } = this.state |
| | | |
| | | MKEmitter.emit('changeStyle', ['background', 'border', 'padding', 'margin', 'shadow'], card.style, this.getStyle) |
| | | MKEmitter.emit('changeStyle', ['background', 'border', 'padding', 'margin', 'shadow', 'clear'], card.style, this.getStyle) |
| | | } |
| | | |
| | | /** |
| | | * @description 卡片行外层信息更新(数据源,样式等) |
| | | */ |
| | | updateComponent = (component) => { |
| | | this.setState({ |
| | | card: component |
| | | }) |
| | | component.$tables = getTables(component) |
| | | |
| | | component.width = component.wrap.width |
| | | component.name = component.wrap.name |
| | | |
| | | this.setState({ |
| | | card: component |
| | | }) |
| | | |
| | | this.props.updateConfig(component) |
| | | } |
| | |
| | | this.setState({card: _card}) |
| | | this.handleSearch(newcell) |
| | | } else { |
| | | this.setState({card: _card}, ()=> { |
| | | this.props.updateConfig(_card) |
| | | }) |
| | | this.updateComponent(_card) |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.LText = param.LText.replace(/@\$|\$@/ig, '').replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${param.timestamp}'`) |
| | | param.LText = param.LText.replace(/\n/g, ' ') |
| | | |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | |
| | | Api.genericInterface(param).then(result => { |
| | | if (result.status) { |
| | | this.setState({ |
| | | card: card, |
| | | sqlVerifing: false, |
| | | visible: false |
| | | }, ()=> { |
| | | this.props.updateConfig(card) |
| | | this.updateComponent(card) |
| | | }) |
| | | } else { |
| | | this.setState({sqlVerifing: false}) |
| | |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | card: card, |
| | | visible: false |
| | | }, ()=> { |
| | | this.props.updateConfig(card) |
| | | this.updateComponent(card) |
| | | }) |
| | | } |
| | | }) |
| | |
| | | let _card = fromJS(_this.state.card).toJS() |
| | | _card.search = _card.search.filter(item => item.uuid !== cell.uuid) |
| | | |
| | | _this.setState({ |
| | | card: _card |
| | | }, () => { |
| | | _this.props.updateConfig(_card) |
| | | }) |
| | | _this.updateComponent(_card) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | |
| | | if (type === 'simple') { |
| | | _card.search.push(item) |
| | | this.setState({ |
| | | card: _card, |
| | | }, () => { |
| | | this.props.updateConfig(_card) |
| | | }) |
| | | |
| | | this.updateComponent(_card) |
| | | } else if (type === 'multil') { |
| | | _card.search.push(...item) |
| | | this.setState({ |
| | | card: _card, |
| | | }, () => { |
| | | this.props.updateConfig(_card) |
| | | }) |
| | | |
| | | this.updateComponent(_card) |
| | | } |
| | | } |
| | | |
| | |
| | | let _card = {...this.state.card} |
| | | _card.style = {..._card.style, ...style} |
| | | |
| | | this.setState({ card: _card }) |
| | | this.props.updateConfig(_card) |
| | | this.updateComponent(_card) |
| | | }) |
| | | } |
| | | } |