| | |
| | | } |
| | | |
| | | state = { |
| | | clearField: this.props.config.clearField || '' |
| | | clearField: this.props.config.clearField || '', |
| | | timer: this.props.config.timer || '' |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | |
| | | |
| | | render() { |
| | | const { config } = this.props |
| | | const { clearField } = this.state |
| | | const { clearField, timer } = this.state |
| | | const { getFieldDecorator } = this.props.form |
| | | |
| | | const formItemLayout = { |
| | |
| | | {getFieldDecorator('timer', { |
| | | initialValue: config.timer || '' |
| | | })( |
| | | <Select> |
| | | <Select onChange={(val) => this.setState({timer: val})}> |
| | | <Select.Option value=""> 无 </Select.Option> |
| | | <Select.Option value="5s"> 5秒 </Select.Option> |
| | | <Select.Option value="15s"> 15秒 </Select.Option> |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | {config.subtype === 'balcony' || config.subtype === 'propcard' ? <Col span={22}> |
| | | {(config.subtype === 'balcony' || config.subtype === 'propcard') && timer ? <Col span={22}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="可以指定字段用于控制定时器的关闭。"> |
| | | <Icon type="question-circle" style={{marginRight: '3px', color: '#c49f47'}} /> |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {(config.subtype === 'balcony' || config.subtype === 'propcard') && clearField ? <Col span={22}> |
| | | {(config.subtype === 'balcony' || config.subtype === 'propcard') && clearField && timer ? <Col span={22}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="当字段值与关闭值相等时,关闭定时器,多个值可用逗号分隔。"> |
| | | <Icon type="question-circle" style={{marginRight: '3px', color: '#c49f47'}} /> |
| | |
| | | const CardComponent = asyncSpinComponent(() => import('@/tabviews/zshare/cardcomponent')) |
| | | const ChartComponent = asyncSpinComponent(() => import('@/tabviews/zshare/chartcomponent')) |
| | | const PagemsgComponent = asyncComponent(() => import('@/tabviews/zshare/pageMessage')) |
| | | const AutoMatic = asyncComponent(() => import('@/tabviews/zshare/automatic')) |
| | | |
| | | const { TabPane } = Tabs |
| | | |
| | |
| | | statFValue: [], // 合计值 |
| | | absFields: [], // 绝对值字段 |
| | | loadCustomApi: true, // 加载外部资源 |
| | | hasReqFields: false |
| | | hasReqFields: false, |
| | | autoMatic: null |
| | | } |
| | | |
| | | /** |
| | |
| | | config.setting.selected = 'false' |
| | | } |
| | | |
| | | let autoMatic = null |
| | | if (config.autoMatic && config.autoMatic.enable === 'true') { |
| | | _actions.forEach(item => { |
| | | if (item.uuid === config.autoMatic.action && (['pop', 'prompt', 'exec'].includes(item.OpenType) || (item.OpenType === 'funcbutton' && item.funcType === 'print'))) { |
| | | autoMatic = config.autoMatic |
| | | config.setting.selected = 'false' |
| | | } |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | loadingview: false, |
| | | absFields, |
| | | autoMatic, |
| | | chartId, |
| | | config, |
| | | statFields, |
| | |
| | | |
| | | render() { |
| | | const { menuType } = this.props |
| | | const { BID, setting, searchlist, pageSize, actions, columns, loadingview, viewlost, pickup, config, chartId, search, selectedData, shortcuts } = this.state |
| | | const { BID, setting, searchlist, pageSize, actions, columns, loadingview, viewlost, pickup, config, chartId, search, selectedData, shortcuts, autoMatic } = this.state |
| | | |
| | | return ( |
| | | <div className="commontable" id={this.state.ContainerId}> |
| | |
| | | })} |
| | | </Tabs>)) |
| | | } |
| | | {menuType !== 'HS' && autoMatic ? <AutoMatic autoMatic={autoMatic} config={config} /> : null} |
| | | {menuType !== 'HS' && window.GLOB.systemType !== 'production' ? <PagemsgComponent menu={{MenuName: this.props.MenuName, MenuNo: this.props.MenuNo}} config={config} dict={this.state.dict} /> : null} |
| | | {menuType !== 'HS' && shortcuts ? <SettingComponent config={config} dict={this.state.dict} shortcuts={shortcuts} permAction={this.props.permAction}/> : null} |
| | | {viewlost ? <NotFount msg={this.state.lostmsg} /> : null} |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Button } from 'antd' |
| | | |
| | | // import MKEmitter from '@/utils/events.js' |
| | | import './index.scss' |
| | | |
| | | class AutoMatic extends Component { |
| | | static propTpyes = { |
| | | autoMatic: PropTypes.object, |
| | | config: PropTypes.object |
| | | } |
| | | |
| | | state = { |
| | | running: false, |
| | | line: 0 |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | | |
| | | /** |
| | | * @description 组件销毁,清除state更新 |
| | | */ |
| | | componentWillUnmount () { |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | } |
| | | |
| | | trigger = () => { |
| | | // const { config } = this.props |
| | | let running = !this.state.running |
| | | |
| | | // MKEmitter.emit('modifyTabs', config.MenuID, 0) |
| | | |
| | | this.setState({running: running}) |
| | | } |
| | | |
| | | render() { |
| | | const { running } = this.state |
| | | |
| | | return ( |
| | | <Button |
| | | icon={running ? 'pause' : 'forward'} |
| | | shape="circle" |
| | | className={'auto-matic ' + (window.GLOB.systemType === 'production' ? 'low' : '')} |
| | | onClick={this.trigger} |
| | | /> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default AutoMatic |
New file |
| | |
| | | .auto-matic { |
| | | position: fixed; |
| | | z-index: 2; |
| | | bottom: 145px; |
| | | right: 20px; |
| | | width: 40px; |
| | | height: 40px; |
| | | .anticon-forward { |
| | | font-size: 20px; |
| | | } |
| | | } |
| | | .auto-matic.low { |
| | | bottom: 100px; |
| | | } |
| | |
| | | import { formRule } from '@/utils/option.js' |
| | | import './index.scss' |
| | | |
| | | const { TextArea } = Input |
| | | |
| | | class MainSearch extends Component { |
| | | static propTpyes = { |
| | | dict: PropTypes.object, // 字典项 |
| | |
| | | if (value.length > 100) return |
| | | this.setState({}, () => { |
| | | this.props.updatemenu({...this.props.config, easyCode: value}) |
| | | }) |
| | | } |
| | | |
| | | changeRemark = (e) => { |
| | | let value = e.target.value || '' |
| | | this.setState({}, () => { |
| | | this.props.updatemenu({...this.props.config, Remark: value}) |
| | | }) |
| | | } |
| | | |
| | |
| | | }} /> |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | <Form.Item label="备注"> |
| | | {getFieldDecorator('Remark', { |
| | | initialValue: config.Remark || '', |
| | | rules: [ |
| | | { |
| | | max: 512, |
| | | message: '备注最多512个字符!' |
| | | } |
| | | ] |
| | | })(<TextArea rows={2} placeholder={''} onChange={this.changeRemark} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | </Row> |
| | | </Form> |
| | | ) |
| | |
| | | import { formRule } from '@/utils/option.js' |
| | | import './index.scss' |
| | | |
| | | const { TextArea } = Input |
| | | |
| | | class MainSearch extends Component { |
| | | static propTpyes = { |
| | | dict: PropTypes.object, // 字典项 |
| | |
| | | message: formRule.input.message |
| | | } |
| | | ] |
| | | })(<Input placeholder="" autoComplete="off" onChange={this.changeRemark}/>)} |
| | | })(<TextArea rows={2} placeholder="" autoComplete="off" onChange={this.changeRemark}/>)} |
| | | </Form.Item> |
| | | </Col> |
| | | </Row> |
| | |
| | | |
| | | this.setState({ |
| | | actions, |
| | | autoMatic: config.autoMatic || {enable: 'false', onFail: 'stop', action: ''}, |
| | | autoMatic: config.autoMatic || {enable: 'false', onFail: 'stop', onSuccess: 'stay', action: ''}, |
| | | visible: true |
| | | }) |
| | | } |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Tooltip, Icon, Select, Radio } from 'antd' |
| | | import { Form, Row, Col, Tooltip, Icon, Select, Radio, InputNumber } from 'antd' |
| | | |
| | | // import './index.scss' |
| | | |
| | |
| | | } |
| | | |
| | | state = { |
| | | enable: this.props.autoMatic.enable |
| | | enable: this.props.autoMatic.enable, |
| | | onFinish: this.props.autoMatic.onFinish || 'over' |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | |
| | | render() { |
| | | const { actions, autoMatic } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { enable } = this.state |
| | | const { enable, onFinish } = this.state |
| | | |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={20}> |
| | | {enable === 'true' ? <Col span={20}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="用于自动执行的按钮。"> |
| | | <Icon type="question-circle" style={{color: '#c49f47', marginRight: '3px'}} /> |
| | |
| | | {getFieldDecorator('action', { |
| | | initialValue: autoMatic.action || '', |
| | | rules: [{ |
| | | required: enable === 'true', |
| | | required: true, |
| | | message: '请选择执行按钮!' |
| | | }] |
| | | })( |
| | |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={20}> |
| | | </Col> : null} |
| | | {enable === 'true' ? <Col span={20}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="按钮执行失败时,后续的处理方式。"> |
| | | <Tooltip placement="topLeft" title="按钮执行成功,后续的处理方式。"> |
| | | <Icon type="question-circle" style={{color: '#c49f47', marginRight: '3px'}} /> |
| | | 报错时 |
| | | 成功后 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('onFail', { |
| | | initialValue: autoMatic.onFail, |
| | | {getFieldDecorator('onSuccess', { |
| | | initialValue: autoMatic.onSuccess || 'stay', |
| | | })( |
| | | <Radio.Group onChange={(e) => this.setState({enable: e.target.value})}> |
| | | <Radio value="stop">停止</Radio> |
| | | <Radio value="skip">跳过</Radio> |
| | | <Radio value="again">重新执行</Radio> |
| | | <Radio.Group> |
| | | <Radio value="stay">当前行</Radio> |
| | | <Radio value="next">下一行</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | </Col> : null} |
| | | {enable === 'true' ? <Col span={20}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="按钮执行失败时,后续的处理方式。"> |
| | | <Icon type="question-circle" style={{color: '#c49f47', marginRight: '3px'}} /> |
| | | 失败后 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('onFail', { |
| | | initialValue: autoMatic.onFail || 'stop', |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="stop">停止</Radio> |
| | | <Radio value="next">下一行</Radio> |
| | | <Radio value="stay">当前行</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {enable === 'true' ? <Col span={20}> |
| | | <Form.Item label="完成后"> |
| | | {getFieldDecorator('onFinish', { |
| | | initialValue: autoMatic.onFinish || 'over', |
| | | })( |
| | | <Radio.Group onChange={(e) => this.setState({onFinish: e.target.value})}> |
| | | <Radio value="over">结束</Radio> |
| | | <Radio value="restart">重新启动</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {enable === 'true' && onFinish === 'restart' ? <Col span={20}> |
| | | <Form.Item label="启动间隔(s)"> |
| | | {getFieldDecorator('interval', { |
| | | initialValue: autoMatic.interval === 0 ? 0 : (autoMatic.interval || 600), |
| | | })( |
| | | <InputNumber style={{width: '100%'}} min={0} precision={0}/> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {enable === 'true' && onFinish === 'restart' ? <Col span={20}> |
| | | <Form.Item label="重启时"> |
| | | {getFieldDecorator('restart', { |
| | | initialValue: autoMatic.restart || 'first', |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="first">第一行</Radio> |
| | | <Radio value="next">下一行</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | </Row> |
| | | </Form> |
| | | ) |
| | |
| | | import options from '@/store/options.js' |
| | | import './index.scss' |
| | | |
| | | const { TextArea } = Input |
| | | |
| | | class CustomMenuForm extends Component { |
| | | static propTpyes = { |
| | | dict: PropTypes.object, // 字典项 |
| | |
| | | // 助记码 |
| | | changeEasyCode = (e) => { |
| | | this.props.updateConfig({...this.props.config, easyCode: e.target.value}) |
| | | } |
| | | |
| | | changeRemark = (e) => { |
| | | this.props.updateConfig({...this.props.config, Remark: e.target.value}) |
| | | } |
| | | |
| | | changeCacheDay = (val) => { |
| | |
| | | }} /> |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | <Form.Item label="备注"> |
| | | {getFieldDecorator('Remark', { |
| | | initialValue: config.Remark || '', |
| | | rules: [ |
| | | { |
| | | max: 512, |
| | | message: '备注最多512个字符!' |
| | | } |
| | | ] |
| | | })(<TextArea rows={2} placeholder={''} onChange={this.changeRemark} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | </Row> |
| | | </Form> |
| | | ) |
| | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import './index.scss' |
| | | |
| | | const { TextArea } = Input |
| | | const SourceComponent = asyncComponent(() => import('@/menu/components/share/sourcecomponent')) |
| | | |
| | | class CustomMenuForm extends Component { |
| | |
| | | // 菜单参数 |
| | | changeNo = (e) => { |
| | | this.props.updateConfig({...this.props.config, MenuNo: e.target.value}) |
| | | } |
| | | |
| | | changeRemark = (e) => { |
| | | this.props.updateConfig({...this.props.config, Remark: e.target.value}) |
| | | } |
| | | |
| | | changeCacheDay = (val) => { |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={24}> |
| | | <Form.Item label="备注"> |
| | | {getFieldDecorator('Remark', { |
| | | initialValue: config.Remark || '', |
| | | rules: [ |
| | | { |
| | | max: 512, |
| | | message: '备注最多512个字符!' |
| | | } |
| | | ] |
| | | })(<TextArea rows={2} placeholder={''} onChange={this.changeRemark} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | </Row> |
| | | </Form> |
| | | ) |
| | |
| | | |
| | | import './index.scss' |
| | | |
| | | const { TextArea } = Input |
| | | |
| | | class CustomMenuForm extends Component { |
| | | static propTpyes = { |
| | | dict: PropTypes.object, // 字典项 |
| | |
| | | // 菜单参数 |
| | | changeNo = (e) => { |
| | | this.props.updateConfig({...this.props.config, MenuNo: e.target.value}) |
| | | } |
| | | |
| | | changeRemark = (e) => { |
| | | this.props.updateConfig({...this.props.config, Remark: e.target.value}) |
| | | } |
| | | |
| | | changeCacheDay = (val) => { |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={24}> |
| | | <Form.Item label="备注"> |
| | | {getFieldDecorator('Remark', { |
| | | initialValue: config.Remark || '', |
| | | rules: [ |
| | | { |
| | | max: 512, |
| | | message: '备注最多512个字符!' |
| | | } |
| | | ] |
| | | })(<TextArea rows={2} placeholder={''} onChange={this.changeRemark} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | </Row> |
| | | </Form> |
| | | ) |