king
2022-01-04 5d1e5dc9b248f91b33105dc838200af07947cdb2
2022-01-04
11个文件已修改
266 ■■■■ 已修改文件
src/menu/components/card/cardcellcomponent/dragaction/action.jsx 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/cardcellcomponent/index.jsx 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/cardcellcomponent/index.scss 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/actionform/index.jsx 78 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/formconfig.jsx 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/cardcellList/asyncButtonComponent.jsx 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/cardcellList/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/cardcellList/index.scss 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/normalbutton/index.jsx 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/formconfig.jsx 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/index.jsx 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/cardcellcomponent/dragaction/action.jsx
@@ -1,6 +1,6 @@
import React from 'react'
import { useDrag, useDrop } from 'react-dnd'
import { Popover, Button } from 'antd'
import { Popover, Button, Switch, Checkbox } from 'antd'
import { EditOutlined, CopyOutlined, CloseOutlined, FontColorsOutlined, ProfileOutlined } from '@ant-design/icons'
import { resetStyle } from '@/utils/utils-custom.js'
@@ -30,7 +30,7 @@
  })
  let hasProfile = false
  if (['pop', 'prompt', 'exec'].includes(card.OpenType)) {
  if (['pop', 'prompt', 'exec', 'form'].includes(card.OpenType)) {
    hasProfile = true
  } else if (card.OpenType === 'excelIn' || card.OpenType === 'excelOut') {
    hasProfile = true
@@ -40,7 +40,13 @@
  let btnElement = null
  let _style = resetStyle(card.style)
  if (card.show === 'icon') {
  if (card.OpenType === 'form') {
    if (card.formType === 'switch') {
      btnElement = (<Switch style={_style} size={card.size} checkedChildren={card.openText || ''} unCheckedChildren={card.closeText || ''}/>)
    } else {
      btnElement = (<Checkbox style={_style}></Checkbox>)
    }
  } else if (card.show === 'icon') {
    btnElement = (<Button style={_style} type="link"><MkIcon type={card.icon}/></Button>)
  } else if (card.show === 'link') {
    btnElement = (<Button style={_style} type="link">{card.label}{card.icon ? <MkIcon type={card.icon}/> : null}</Button>)
src/menu/components/card/cardcellcomponent/index.jsx
@@ -145,7 +145,11 @@
    let options = ['font', 'border', 'padding', 'margin', 'background']
    if (element.eleType === 'button') {
      options.push('width', 'float')
      if (element.OpenType === 'form') {
        options = ['margin', 'float']
      } else {
        options.push('width', 'float')
      }
    } else if (element.eleType === 'picture') {
      options = ['border', 'margin']
    } else if (element.eleType === 'slider') {
@@ -406,9 +410,13 @@
          }
          
          delete res.focus
          let style = {}
          if (res.class !== cell.class || res.show !== cell.show || !res.style) {
          if (res.OpenType === 'form') {
            if (cell.OpenType !== 'form') {
              res.style = {}
            }
          } else if (res.class !== cell.class || res.show !== cell.show || !res.style) {
            let style = {}
            if (res.show === 'link' || res.show === 'icon') {
              style.color = color[res.class]
              style.backgroundColor = 'transparent'
@@ -416,8 +424,8 @@
              style.color = '#ffffff'
              style.backgroundColor = color[res.class]
            }
            res.style = {...res.style, ...style}
          }
          res.style = {...res.style, ...style}
          return res
        }
src/menu/components/card/cardcellcomponent/index.scss
@@ -6,7 +6,7 @@
  .card-button-cell {
    float: left;
    button {
    button:not(.ant-switch) {
      width: 100%;
      background-size: cover;
      background-position: center center;
@@ -20,6 +20,9 @@
        font-weight: inherit;
      }
    }
    .ant-checkbox .ant-checkbox-inner {
      border-radius: 15px;
    }
  }
  .card-cell:hover, .card-button-cell:hover {
    box-shadow: 0px 0px 1px #1890ff;
src/menu/components/share/actioncomponent/actionform/index.jsx
@@ -19,7 +19,8 @@
  popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'popClose', 'resetPageIndex', 'width', 'display', 'ratio', 'syncComponent', 'clickouter'],
  tab: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'linkmenu', 'width'],
  innerpage: ['label', 'Ot', 'OpenType', 'pageTemplate', 'show', 'swipe', 'icon', 'class', 'color', 'width', 'open'],
  funcbutton: ['label', 'OpenType', 'funcType', 'show', 'swipe', 'icon', 'class', 'color', 'width']
  funcbutton: ['label', 'OpenType', 'funcType', 'show', 'swipe', 'icon', 'class', 'color', 'width'],
  form: ['label', 'OpenType', 'formType', 'intertype', 'Ot', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'open', 'refreshTab', 'reload', 'title']
}
class ActionForm extends Component {
@@ -38,13 +39,13 @@
    requireOptions: [],
    insertUpdateOptions: [{
      value: 'insert',
      text: this.props.dict['header.form.action.insert']
      text: '添加'
    }, {
      value: 'update',
      text: this.props.dict['header.form.action.update']
      text: '修改'
    }, {
      value: 'audit',
      text: this.props.dict['header.form.action.audit']
      text: '审核'
    }],
    deleteOptions: [{
      value: 'LogicDelete',
@@ -54,7 +55,7 @@
      text: '物理删除'
    }, {
      value: 'custom',
      text: this.props.dict['header.form.custom']
      text: '自定义'
    }],
    interTypeOptions: [{
      value: 'system',
@@ -197,6 +198,43 @@
      } else {
        reOptions.sqlType = this.state.insertUpdateOptions
      }
    } else if (openType === 'form') {
      let intertype = this.record.intertype
      if (this.record.formType === 'switch') {
        shows.push('field', 'size', 'openVal', 'closeVal', 'openText', 'closeText')
      } else {
        shows.push('field', 'openVal', 'closeVal')
      }
      reOptions.intertype = this.state.interTypeOptions.filter(item => item.value !== 'custom')
      if (intertype === 'outer') {
        shows.push('innerFunc', 'sysInterface', 'interface', 'proInterface', 'outerFunc', 'callbackFunc')
        reRequired.innerFunc = false
        if (this.record.sysInterface === 'false') {
          reReadonly.interface = false
          reRequired.interface = true
        } else {
          reReadonly.interface = true
          reRequired.interface = false
        }
      } else if (intertype === 'inner') {
        shows.push('innerFunc')
        reRequired.innerFunc = true
      } else {
        shows.push('sql', 'sqlType')
      }
      reOptions.Ot = requireOptions
      reOptions.sqlType = [{
        value: 'update',
        text: '修改'
      }, {
        value: 'custom',
        text: '自定义'
      }]
    } else if (openType === 'excelIn') {
      reOptions.intertype = this.state.interTypeOptions.filter(op => op.value !== 'custom')
      reOptions.Ot = requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value))
@@ -375,6 +413,10 @@
        _fieldval.intertype = 'system'
        _fieldval.sqlType = ''
  
      } else if (value === 'form') {
        _fieldval.Ot = 'requiredSgl'
        this.record.Ot = 'requiredSgl'
      } else if (value === 'excelIn') {
        _fieldval.intertype = 'system'
        _fieldval.Ot = 'notRequired'
@@ -446,10 +488,12 @@
      } else if (value === 'update') {
        _fieldval.label = '修改'
        _fieldval.Ot = 'requiredSgl'
        if (hasclass) {
          _fieldval.class = 'purple'
        } else {
          _fieldval.color = 'primary'
        if (this.record.OpenType !== 'form') {
          if (hasclass) {
            _fieldval.class = 'purple'
          } else {
            _fieldval.color = 'primary'
          }
        }
      } else if (value === 'audit') {
        _fieldval.label = '审核'
@@ -469,10 +513,10 @@
        }
      }
      this.record.label = _fieldval.label
      this.record.Ot = _fieldval.Ot
      this.record.class = _fieldval.class || ''
      this.record.color = _fieldval.color || ''
      this.record.label = _fieldval.label || this.record.label || ''
      this.record.Ot = _fieldval.Ot || this.record.Ot || ''
      this.record.class = _fieldval.class || this.record.class || ''
      this.record.color = _fieldval.color || this.record.color || ''
      if (appType !== 'mob' && _fieldval.Ot === 'notRequired') {
        this.record.control = ''
@@ -549,6 +593,14 @@
      let content = null
      let initVal = item.initVal || ''
      if (item.type === 'splitLine') {
        fields.push(
          <Col span={24} key={index}>
            <p style={{borderBottom: '1px solid #e9e9e9', color: '#1890ff', textAlign: 'center'}}>{item.label}</p>
          </Col>
        )
        return
      }
      if (item.type === 'text') {
        rules = [
          { required: item.required, message: dict['form.required.input'] + item.label + '!' }
src/menu/components/share/actioncomponent/formconfig.jsx
@@ -146,6 +146,13 @@
    })
  }
  if (type === 'card') {
    opentypes.push({
      value: 'form',
      text: '表单'
    })
  }
  if (!card.control && card.controlField) {
    card.control = 'disabled'
  }
@@ -169,6 +176,20 @@
      initVal: card.funcType || '',
      required: true,
      options: funTypes
    },
    {
      type: 'radio',
      key: 'formType',
      label: '表单类型',
      initVal: card.formType || 'switch',
      required: true,
      options: [{
        value: 'switch',
        text: '开关'
      }, {
        value: 'radio',
        text: '勾选框'
      }]
    },
    {
      type: 'select',
@@ -766,6 +787,61 @@
      initVal: card.controlVal || '',
      required: false
    },
    {
      type: 'splitLine',
      key: 'title',
      label: '表单',
      initVal: ''
    },
    {
      type: 'text',
      key: 'field',
      label: Formdict['model.form.field'],
      initVal: card.field || '',
      required: true,
      readonly: false
    },
    {
      type: 'radio',
      key: 'size',
      label: '开关尺寸',
      initVal: card.size || 'default',
      options: [{
        value: 'default',
        text: '大'
      }, {
        value: 'small',
        text: '小'
      }]
    },
    {
      type: 'text',
      key: 'openVal',
      label: '开启值',
      initVal: card.openVal || '',
      required: false
    },
    {
      type: 'text',
      key: 'closeVal',
      label: '关闭值',
      initVal: card.closeVal || '',
      required: false
    },
    {
      type: 'text',
      key: 'openText',
      label: '开启提示',
      initVal: card.openText || '',
      required: false,
    },
    {
      type: 'text',
      key: 'closeText',
      label: '关闭提示',
      initVal: card.closeText || '',
      required: false,
    },
  ]
  return forms
src/tabviews/custom/components/card/cardcellList/asyncButtonComponent.jsx
@@ -1,6 +1,4 @@
import React, {Component} from 'react'
import { Button } from 'antd'
/**
 * @description 异步加载模块
 * @param {*} importComponent
@@ -24,11 +22,8 @@
    // <Button className="loading-skeleton" disabled={true}></Button> // 骨架按钮
    render() {
      const C = this.state.component
      const btn = this.props.btn || {}
      return C ?
        <C {...this.props} /> :
        <Button className={'mk-btn mk-' + btn.class} type={btn.show !== 'button' ? 'link' : ''} icon={btn.icon} disabled={true} >{btn.label}</Button>
      return C ? <C {...this.props} /> : null
    }
  }
}
src/tabviews/custom/components/card/cardcellList/index.jsx
@@ -665,7 +665,7 @@
        _data = this.props.syncData
      }
      if (['exec', 'prompt', 'pop'].includes(card.OpenType)) {
      if (['exec', 'prompt', 'pop', 'form'].includes(card.OpenType)) {
        return (
          <Col key={card.uuid} className="mk-cell-btn" span={card.width}>
            <NormalButton
src/tabviews/custom/components/card/cardcellList/index.scss
@@ -59,12 +59,15 @@
  }
  .mk-cell-btn {
    > div {width: 100%;max-width: 100%;}
    button {
    button:not(.ant-switch) {
      width: 100%;
      max-width: 100%;
      height: auto;
      min-height: 28px;
    }
    .ant-checkbox-inner, .ant-checkbox-checked::after {
      border-radius: 15px;
    }
  }
  .ant-mk-slider {
    box-sizing: border-box;
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -3,7 +3,7 @@
import moment from 'moment'
import {connect} from 'react-redux'
import { is, fromJS } from 'immutable'
import { Button, Modal, notification, message, Drawer } from 'antd'
import { Button, Modal, notification, message, Drawer, Switch, Checkbox } from 'antd'
import Api from '@/api'
import Utils, { getSysDefaultSql } from '@/utils/utils.js'
@@ -47,7 +47,8 @@
    disabled: false,
    hidden: false,
    checkParam: null,
    autoMatic: false
    autoMatic: false,
    check: false
  }
  moduleParams = null
@@ -78,6 +79,11 @@
    }
    if (this.props.disabled || disabled) {
      this.setState({disabled: true})
    }
    if (btn.OpenType === 'form') {
      let data = selectedData && selectedData[0] ? selectedData[0] : null
      this.setState({check: data && data[btn.field] === btn.openVal})
    }
  }
@@ -130,6 +136,11 @@
      this.setState({disabled: true})
    } else {
      this.setState({disabled: false})
    }
    if (btn.OpenType === 'form') {
      let data = nextProps.selectedData && nextProps.selectedData[0] ? nextProps.selectedData[0] : null
      this.setState({check: data && data[btn.field] === btn.openVal})
    }
  }
@@ -312,6 +323,22 @@
      }, () => {
        this.improveAction()
      })
    } else if (btn.OpenType === 'form') {
      this.setState({
        loading: true,
        check: !this.state.check
      }, () => {
        let item = {
          type: 'text',
          readonly: false,
          readin: true,
          writein: true,
          fieldlen: 50,
          key: btn.field,
          value: this.state.check ? btn.openVal : btn.closeVal
        }
        this.execSubmit(data, () => { this.setState({loading: false})}, [item])
      })
    }
    if (window.GLOB.systemType === 'production') {
@@ -381,7 +408,7 @@
        }
        param.LText = Utils.formatOptions(param.LText)
      } else if (btn.OpenType === 'pop' || btn.OpenType === 'formSubmit') { // 表单
      } else if (btn.OpenType === 'pop' || btn.OpenType === 'formSubmit' || btn.OpenType === 'form') { // 表单
        if (btn.sqlType === 'insert') { // 系统函数添加时,生成uuid
          primaryId = ''
@@ -629,7 +656,7 @@
        param[setting.primaryKey] = primaryId // 设置主键参数
      }
      if (btn.OpenType === 'pop' || btn.OpenType === 'formSubmit') { // 表单
      if (btn.OpenType === 'pop' || btn.OpenType === 'formSubmit' || btn.OpenType === 'form') { // 表单
        formdata.forEach(_data => {
          param[_data.key] = _data.value
        })
@@ -804,7 +831,7 @@
          param.BID = this.props.BID
        }
        if ((btn.OpenType === 'pop' || btn.OpenType === 'formSubmit') && formdata) { // 表单
        if ((btn.OpenType === 'pop' || btn.OpenType === 'formSubmit' || btn.OpenType === 'form') && formdata) { // 表单
          formdata.forEach(_data => {
            param[_data.key] = _data.value
          })
@@ -1683,6 +1710,9 @@
      MKEmitter.emit('popclose')
    } else if (btn.execError !== 'never') {
      MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.execError, btn, '', this.state.selines)
    } else if (btn.OpenType === 'form') {
      let data = this.props.selectedData && this.props.selectedData[0] ? this.props.selectedData[0] : null
      this.setState({check: data && data[btn.field] === btn.openVal})
    }
  }
@@ -1989,11 +2019,17 @@
  render() {
    const { btn, show, style } = this.props
    const { loadingNumber, loading, disabled, hidden } = this.state
    const { loadingNumber, loading, disabled, hidden, check } = this.state
    if (hidden) return null
    if (show === 'actionList') {
    if (btn.OpenType === 'form') {
      if (btn.formType === 'switch') {
        return <Switch loading={loading} checked={check} disabled={disabled || loading} onChange={(val,e) => {e.stopPropagation();this.actionTrigger()}} style={style} size={btn.size} checkedChildren={btn.openText || ''} unCheckedChildren={btn.closeText || ''}/>
      } else {
        return <Checkbox disabled={disabled || loading} checked={check} onChange={(e) => {e.stopPropagation();this.actionTrigger()}} style={style}></Checkbox>
      }
    } else if (show === 'actionList') {
      return <div style={{display: 'inline-block'}} onClick={(e) => e.stopPropagation()}>
        <Button
          style={style}
src/templates/zshare/formconfig.jsx
@@ -2428,16 +2428,14 @@
      key: 'openText',
      label: '开启提示',
      initVal: card.openText || '',
      required: false,
      forbid: appType === 'mob'
      required: false
    },
    {
      type: 'text',
      key: 'closeText',
      label: '关闭提示',
      initVal: card.closeText || '',
      required: false,
      forbid: appType === 'mob'
      required: false
    },
    {
      type: 'radio',
src/templates/zshare/verifycard/index.jsx
@@ -595,7 +595,14 @@
    new Promise(resolve => {
      let _fields = []
      if (config.Template === 'FormTab') {
      if (card.OpenType === 'form') {
        _fields.push({
          field: card.field,
          label: card.label,
          type: 'text'
        })
        resolve(_fields)
      } else if (config.Template === 'FormTab') {
        config.groups.forEach(group => {
          _fields.push(...group.sublist)
        })