king
2021-10-17 35450c747d7497642119afb5db3bbbeec63c9214
2021-10-17
9个文件已修改
2个文件已添加
266 ■■■■■ 已修改文件
src/menu/components/share/clockcomponent/settingform/index.jsx 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/commontable/index.jsx 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/automatic/index.jsx 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/automatic/index.scss 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/menuform/index.jsx 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/subtableconfig/menuform/index.jsx 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/unattended/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/unattended/settingform/index.jsx 83 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/menudesign/menuform/index.jsx 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mobdesign/menuform/index.jsx 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/pcdesign/menuform/index.jsx 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/clockcomponent/settingform/index.jsx
@@ -11,7 +11,8 @@
  }
  state = {
    clearField: this.props.config.clearField || ''
    clearField: this.props.config.clearField || '',
    timer: this.props.config.timer || ''
  }
  handleConfirm = () => {
@@ -29,7 +30,7 @@
  render() {
    const { config } = this.props
    const { clearField } = this.state
    const { clearField, timer } = this.state
    const { getFieldDecorator } = this.props.form
    const formItemLayout = {
@@ -52,7 +53,7 @@
                {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>
@@ -67,7 +68,7 @@
                )}
              </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'}} />
@@ -83,7 +84,7 @@
                )}
              </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'}} />
src/tabviews/commontable/index.jsx
@@ -26,6 +26,7 @@
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
@@ -66,7 +67,8 @@
    statFValue: [],       // 合计值
    absFields: [],        // 绝对值字段
    loadCustomApi: true,  // 加载外部资源
    hasReqFields: false
    hasReqFields: false,
    autoMatic: null
  }
  /**
@@ -371,9 +373,20 @@
        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,
@@ -1056,7 +1069,7 @@
  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}>
@@ -1171,6 +1184,7 @@
            })}
          </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}
src/tabviews/zshare/automatic/index.jsx
New file
@@ -0,0 +1,56 @@
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
src/tabviews/zshare/automatic/index.scss
New file
@@ -0,0 +1,14 @@
.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;
}
src/templates/comtableconfig/menuform/index.jsx
@@ -5,6 +5,8 @@
import { formRule } from '@/utils/option.js'
import './index.scss'
const { TextArea } = Input
class MainSearch extends Component {
  static propTpyes = {
    dict: PropTypes.object, // 字典项
@@ -78,6 +80,13 @@
    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})
    })
  }
@@ -217,6 +226,19 @@
              }} />
            </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>
    )
src/templates/subtableconfig/menuform/index.jsx
@@ -5,6 +5,8 @@
import { formRule } from '@/utils/option.js'
import './index.scss'
const { TextArea } = Input
class MainSearch extends Component {
  static propTpyes = {
    dict: PropTypes.object, // 字典项
@@ -102,7 +104,7 @@
                    message: formRule.input.message
                  }
                ]
              })(<Input placeholder="" autoComplete="off" onChange={this.changeRemark}/>)}
              })(<TextArea rows={2} placeholder="" autoComplete="off" onChange={this.changeRemark}/>)}
            </Form.Item>
          </Col>
        </Row>
src/templates/zshare/unattended/index.jsx
@@ -35,7 +35,7 @@
    this.setState({
      actions,
      autoMatic: config.autoMatic || {enable: 'false', onFail: 'stop', action: ''},
      autoMatic: config.autoMatic || {enable: 'false', onFail: 'stop', onSuccess: 'stay', action: ''},
      visible: true
    })
  }
src/templates/zshare/unattended/settingform/index.jsx
@@ -1,6 +1,6 @@
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'
@@ -11,7 +11,8 @@
  }
  state = {
    enable: this.props.autoMatic.enable
    enable: this.props.autoMatic.enable,
    onFinish: this.props.autoMatic.onFinish || 'over'
  }
  handleConfirm = () => {
@@ -30,7 +31,7 @@
  render() {
    const { actions, autoMatic } = this.props
    const { getFieldDecorator } = this.props.form
    const { enable } = this.state
    const { enable, onFinish } = this.state
    const formItemLayout = {
      labelCol: {
@@ -58,7 +59,7 @@
              )}
            </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'}} />
@@ -68,7 +69,7 @@
              {getFieldDecorator('action', {
                initialValue: autoMatic.action || '',
                rules: [{
                  required: enable === 'true',
                  required: true,
                  message: '请选择执行按钮!'
                }]
              })(
@@ -79,25 +80,75 @@
                </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>
    )
src/views/menudesign/menuform/index.jsx
@@ -6,6 +6,8 @@
import options from '@/store/options.js'
import './index.scss'
const { TextArea } = Input
class CustomMenuForm extends Component {
  static propTpyes = {
    dict: PropTypes.object, // 字典项
@@ -169,6 +171,10 @@
  // 助记码
  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) => {
@@ -357,6 +363,19 @@
              }} />
            </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>
    )
src/views/mobdesign/menuform/index.jsx
@@ -5,6 +5,7 @@
import asyncComponent from '@/utils/asyncComponent'
import './index.scss'
const { TextArea } = Input
const SourceComponent = asyncComponent(() => import('@/menu/components/share/sourcecomponent'))
class CustomMenuForm extends Component {
@@ -40,6 +41,10 @@
  // 菜单参数
  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) => {
@@ -199,6 +204,19 @@
              )}
            </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>
    )
src/views/pcdesign/menuform/index.jsx
@@ -4,6 +4,8 @@
import './index.scss'
const { TextArea } = Input
class CustomMenuForm extends Component {
  static propTpyes = {
    dict: PropTypes.object, // 字典项
@@ -33,6 +35,10 @@
  // 菜单参数
  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) => {
@@ -163,6 +169,19 @@
              )}
            </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>
    )