| | |
| | | import CreateInterface from '@/templates/zshare/createinterface' |
| | | import { updateForm } from '@/utils/utils-update.js' |
| | | import DragElement from './dragaction' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import './index.scss' |
| | | |
| | | const { confirm } = Modal |
| | |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * @description 监听到按钮复制时,触发按钮编辑 |
| | | */ |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | | const { actionlist } = this.state |
| | | |
| | | if (!is(fromJS(nextProps.config.action), fromJS(this.props.config.action)) && !is(fromJS(nextProps.config.action), fromJS(actionlist))) { |
| | | let len = nextProps.config.action.length |
| | | let item = nextProps.config.action[len - 1] |
| | | if (item && item.focus) { |
| | | this.handleAction(item) |
| | | } |
| | | this.setState({actionlist: fromJS(nextProps.config.action).toJS()}) |
| | | } |
| | | } |
| | | |
| | | componentDidMount () { |
| | | this.getBillPrintTemp() |
| | | MKEmitter.addListener('pasteButton', this.pasteButton) |
| | | } |
| | | |
| | | pasteButton = (MenuId, btn) => { |
| | | const { config } = this.props |
| | | const { actionlist } = this.state |
| | | |
| | | if (MenuId !== config.uuid) return |
| | | |
| | | this.setState({ |
| | | actionlist: [...actionlist, btn], |
| | | }, () => { |
| | | this.handleAction(btn) |
| | | }) |
| | | } |
| | | |
| | | getBillPrintTemp = () => { |
| | |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState)) |
| | | return !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | | |
| | | /** |
| | |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | MKEmitter.removeListener('pasteButton', this.pasteButton) |
| | | } |
| | | |
| | | render() { |