king
2020-10-21 5423c7caa9723e0b232ea6c5ef4aaf90bd7a3334
2020-10-21
26个文件已修改
2个文件已删除
4个文件已添加
1147 ■■■■ 已修改文件
src/components/sidemenu/index.jsx 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/tabview/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/tabmanage/mutilform/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/tabmanage/mutilform/index.scss 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/normalbutton/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/printbutton/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/tabbutton/index.jsx 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/checkCard/index.jsx 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/checkCard/index.scss 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/mutilform/checkCard/index.jsx 113 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/mutilform/checkCard/index.scss 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/mutilform/customSwitch/index.jsx 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/mutilform/customSwitch/index.scss 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/mutilform/index.jsx 368 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/mutilform/index.scss 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/formtabconfig/index.jsx 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/checkCard/index.jsx 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/checkCard/index.scss 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/dragelement/card.jsx 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/dragelement/index.scss 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/index.scss 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/createinterface/index.jsx 268 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/createinterface/mutilform/index.jsx 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/modalform/datatable/index.jsx 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/modalform/datatable/index.scss 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/modalform/fieldtable/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/modalform/fieldtable/index.scss 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/modalform/index.jsx 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/modalform/index.scss 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/modalform/modaleditable/index.scss 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils.js 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/sidemenu/index.jsx
@@ -214,14 +214,22 @@
      this.props.modifyTabview([menu])
      e.preventDefault()
    } else {
      let tabs = JSON.parse(JSON.stringify(this.props.tabviews))
      let tabs = fromJS(this.props.tabviews).toJS()
      tabs = tabs.filter(tab => {
        tab.selected = false
        return tab.MenuID !== menu.MenuID
      })
      menu.selected = true
      tabs.push(menu)
      this.props.modifyTabview(tabs)
      if (this.props.tabviews.length !== tabs.length) {
        this.props.modifyTabview(fromJS(tabs).toJS())
      }
      this.setState({}, () => {
        menu.selected = true
        tabs.push(menu)
        this.props.modifyTabview(tabs)
      })
      e.preventDefault()
    }
  }
src/components/tabview/index.jsx
@@ -52,7 +52,7 @@
  handleTabview = (e, menu) => {
    e.stopPropagation()
    // 关闭tab页,重新选择显示页
    let tabs = JSON.parse(JSON.stringify(this.state.tabviews))
    let tabs = fromJS(this.state.tabviews).toJS()
    tabs = tabs.filter(tab => {
      return tab.MenuID !== menu.MenuID
    })
@@ -78,7 +78,7 @@
  changeTab = (e, menu) => {
    e.stopPropagation()
    // 窗口切换
    let tabs = JSON.parse(JSON.stringify(this.state.tabviews))
    let tabs = fromJS(this.state.tabviews).toJS()
    tabs = tabs.map(tab => {
      tab.selected = false
src/tabviews/tabmanage/mutilform/index.jsx
@@ -55,7 +55,7 @@
      }
    }
    return (
      <Form {...formItemLayout} className="ant-advanced-search-form main-form-field" id="tab-handle-form-box">
      <Form {...formItemLayout} className="tab-manage-form-field" id="tab-handle-form-box">
        <Row gutter={24}>
          <Col span={24}>
              <Form.Item label="标签名称">
src/tabviews/tabmanage/mutilform/index.scss
@@ -1,4 +1,4 @@
.ant-advanced-search-form.main-form-field {
.tab-manage-form-field {
  position: relative;
  padding: 0px 24px 20px;
  .ant-form-item {
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -951,7 +951,7 @@
            _LongParam.groups.forEach(group => {
              group.sublist = group.sublist.map(cell => {
                // 数据源sql语句,预处理, 权限黑名单字段设置为隐藏表单
                if (['select', 'link', 'multiselect'].includes(cell.type) && cell.resourceType === '1') {
                if (['select', 'link', 'multiselect', 'radio', 'checkbox', 'checkcard'].includes(cell.type) && cell.resourceType === '1') {
                  let _option = Utils.getSelectQueryOptions(cell)
                  if (this.props.dataManager) { // 数据权限
@@ -983,7 +983,7 @@
          } else {
            _LongParam.fields = _LongParam.fields.map(cell => {
              // 数据源sql语句,预处理,权限黑名单字段设置为隐藏表单
              if (['select', 'link', 'multiselect'].includes(cell.type) && cell.resourceType === '1') {
              if (['select', 'link', 'multiselect', 'radio', 'checkbox', 'checkcard'].includes(cell.type) && cell.resourceType === '1') {
                let _option = Utils.getSelectQueryOptions(cell)
                if (this.props.dataManager) { // 数据权限
src/tabviews/zshare/actionList/printbutton/index.jsx
@@ -1054,7 +1054,7 @@
            _LongParam.groups.forEach(group => {
              group.sublist = group.sublist.map(cell => {
                // 数据源sql语句,预处理
                if (['select', 'link', 'multiselect'].includes(cell.type) && cell.resourceType === '1') {
                if (['select', 'link', 'multiselect', 'radio', 'checkbox', 'checkcard'].includes(cell.type) && cell.resourceType === '1') {
                  let _option = Utils.getSelectQueryOptions(cell)
                  if (this.props.dataManager) { // 数据权限
@@ -1086,7 +1086,7 @@
          } else {
            _LongParam.fields = _LongParam.fields.map(cell => {
              // 数据源sql语句,预处理
              if (['select', 'link', 'multiselect'].includes(cell.type) && cell.resourceType === '1') {
              if (['select', 'link', 'multiselect', 'radio', 'checkbox', 'checkcard'].includes(cell.type) && cell.resourceType === '1') {
                let _option = Utils.getSelectQueryOptions(cell)
                if (this.props.dataManager) { // 数据权限
src/tabviews/zshare/actionList/tabbutton/index.jsx
@@ -117,29 +117,28 @@
    }
    let index = 0
    let isexit = false
    let tabs = tabviews.map((tab, i) => {
    let tabs = tabviews.filter((tab, i) => {
      tab.selected = false
      if (tab.MenuID === MenuID) {
        index = i
      } else if (tab.MenuID === btn.uuid) {
        tab.selected = true
        isexit = true
      }
      return tab
      return tab.MenuID !== newtab.MenuID
    })
    if (!isexit) {
      tabs.splice(index + 1, 0, newtab)
    if (tabviews.length !== tabs.length) {
      this.props.modifyTabview(fromJS(tabs).toJS())
    }
    this.setState({}, () => {
      tabs.splice(index + 1, 0, newtab)
      this.props.modifyTabview(tabs)
    })
    if (this.props.updateStatus) {
      this.props.updateStatus('trigger')
    }
    this.props.modifyTabview(tabs)
  }
  render() {
src/tabviews/zshare/checkCard/index.jsx
File was deleted
src/tabviews/zshare/checkCard/index.scss
File was deleted
src/tabviews/zshare/mutilform/checkCard/index.jsx
New file
@@ -0,0 +1,113 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Col, Row } from 'antd'
import './index.scss'
class CheckCard extends Component {
  static propTpyes = {
    card: PropTypes.bool,        // 卡片信息
    onChange: PropTypes.func     // 数据切换
  }
  state = {
    selectKeys: null
  }
  UNSAFE_componentWillMount() {
    const { card } = this.props
    if (card.multiple === 'true') {
      this.setState({
        selectKeys: card.initval ? card.initval.split(',') : []
      })
    } else {
      this.setState({
        selectKeys: card.initval
      })
    }
  }
  changeCard = (item) => {
    const { multiple } = this.props.card
    const { selectKeys } = this.state
    if (multiple === 'true') {
      let keys = []
      if (selectKeys.includes(item.$value)) {
        keys = selectKeys.filter(key => key !== item.$value)
      } else {
        keys = [...selectKeys, item.$value]
      }
      this.setState({
        selectKeys: keys
      }, () => {
        this.props.onChange && this.props.onChange(keys.join(','))
      })
    } else if (multiple !== 'true' && selectKeys !== item.$value) {
      this.setState({
        selectKeys: item.$value
      }, () => {
        this.props.onChange && this.props.onChange(item.$value)
      })
    }
  }
  getCards = () => {
    const { display, width, options, fields, ratio, multiple } = this.props.card
    const { selectKeys } = this.state
    let paddingTop = '100%'
    if (ratio === '4:3') {
      paddingTop = '75%'
    } else if (ratio === '3:2') {
      paddingTop = '66.7%'
    } else if (ratio === '16:9') {
      paddingTop = '56.25%'
    }
    if (display !== 'picture') {
      return options.map(item => {
        let _active = false
        if (multiple === 'true' && selectKeys.includes(item.$value)) {
          _active = true
        } else if (multiple !== 'true' && selectKeys === item.$value) {
          _active = true
        }
        return <Col span={width} key={item.key}>
          <div className={'card-cell ' + (_active ? 'active' : '')} onClick={() => this.changeCard(item)}>
            {fields.map(col => {
              return <span key={col.key} style={{color: col.color, fontSize: col.fontSize + 'px', height: col.fontSize * 1.5 + 'px', textAlign: col.align}}>{item[col.field]}</span>
            })}
          </div>
        </Col>
      })
    } else {
      return options.map(item => {
        let _active = false
        if (multiple === 'true' && selectKeys.includes(item.$value)) {
          _active = true
        } else if (multiple !== 'true' && selectKeys === item.$value) {
          _active = true
        }
        return <Col span={width} key={item.key}>
          <div className={'card-pic-cell ' + (_active ? 'active' : '')} onClick={() => this.changeCard(item)} style={{paddingTop, backgroundImage: `url(${item.$url})`}}>
          </div>
        </Col>
      })
    }
  }
  render() {
    return (
      <div className="check-card-form-box">
        <Row gutter={12}>{this.getCards()}</Row>
      </div>
    )
  }
}
export default CheckCard
src/tabviews/zshare/mutilform/checkCard/index.scss
New file
@@ -0,0 +1,39 @@
.check-card-form-box {
  margin-top: 10px;
  margin-bottom: -10px;
  .card-cell {
    border: 1px solid #bcbcbc;
    border-radius: 4px;
    padding: 6px;
    margin-bottom: 12px;
    line-height: 1.5;
    transition: all 0.3s;
    cursor: pointer;
    span {
      display: block;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }
  .card-cell:hover, .card-cell.active {
    border-color: #1890ff;
    background: #1890ff;
    span {
      color: #ffffff!important;
    }
  }
  .card-pic-cell {
    border: 1px solid #bcbcbc;
    border-radius: 4px;
    background-size: cover;
    background-position: center;
    margin-bottom: 12px;
    line-height: 1.5;
    cursor: pointer;
  }
  .card-pic-cell:hover, .card-pic-cell.active {
    border-color: #1890ff;
    box-shadow: 0px 0px 4px #1890ff;
  }
}
src/tabviews/zshare/mutilform/customSwitch/index.jsx
New file
@@ -0,0 +1,44 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Switch } from 'antd'
import './index.scss'
class CheckCard extends Component {
  static propTpyes = {
    Item: PropTypes.bool,      // 表单
    onChange: PropTypes.func   // 数据切换
  }
  state = {
    defaultChecked: this.props.Item.initval === true
  }
  UNSAFE_componentWillMount () {
    const { Item, onChange } = this.props
    if (Item.initval === true) {
      onChange && onChange(Item.openVal)
    } else {
      onChange && onChange(Item.closeVal)
    }
  }
  onChange = (val) => {
    const { Item, onChange } = this.props
    if (val) {
      onChange && onChange(Item.openVal)
    } else {
      onChange && onChange(Item.closeVal)
    }
  }
  render() {
    const { defaultChecked } = this.state
    return (
      <Switch defaultChecked={defaultChecked} onChange={this.onChange}/>
    )
  }
}
export default CheckCard
src/tabviews/zshare/mutilform/customSwitch/index.scss
src/tabviews/zshare/mutilform/index.jsx
@@ -1,7 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { fromJS } from 'immutable'
import { Form, Row, Col, Input, InputNumber, Select, DatePicker, notification } from 'antd'
import { Form, Row, Col, Input, InputNumber, Select, DatePicker, notification, Checkbox, Radio, Tooltip, Icon } from 'antd'
import moment from 'moment'
import Api from '@/api'
@@ -9,6 +9,8 @@
import { formRule, calendarColors } from '@/utils/option.js'
import Utils from '@/utils/utils.js'
import FileUpload from '../fileupload'
import CustomSwitch from './customSwitch'
import CheckCard from './checkCard'
import './index.scss'
const {MonthPicker} = DatePicker
@@ -120,7 +122,7 @@
      writein[item.field] = item.writein !== 'false'
      fieldlen[item.field] = _fieldlen
      if (item.type === 'select' || item.type === 'link' || item.type === 'multiselect') {
      if (item.type === 'select' || item.type === 'link' || item.type === 'multiselect' || item.type === 'radio' || item.type === 'checkbox') {
        if (item.setAll === 'true') {
          item.options.unshift({
            key: Utils.getuuid(),
@@ -192,6 +194,14 @@
          newval = window.decodeURIComponent(window.atob(newval))
        } catch (e) {
          console.warn(e)
        }
      } else if (item.type === 'switch' && newval !== '') { // 开关只接收固定值
        if (newval !== item.closeVal && newval !== item.openVal) {
          newval = ''
        } else if (newval === item.openVal) {
          newval = true
        } else {
          newval = false
        }
      }
@@ -277,7 +287,7 @@
    const { formlist } = this.state
    // 需要动态获取下拉菜单的表单
    let deForms = formlist.filter(item => ['select', 'link', 'multiselect'].includes(item.type) && item.resourceType === '1' && (item.type === 'link' || item.hidden !== 'true'))
    let deForms = formlist.filter(item => ['select', 'link', 'multiselect', 'radio', 'checkbox', 'checkcard'].includes(item.type) && item.resourceType === '1' && (item.type === 'link' || item.hidden !== 'true'))
    if (deForms.length === 0) {
      return
@@ -395,17 +405,21 @@
      delete result.status
      let _formlist = formlist.map(item => {
        if (['select', 'link', 'multiselect'].includes(item.type) && result[item.field] && result[item.field].length > 0) {
        if (['select', 'link', 'multiselect', 'radio', 'checkbox', 'checkcard'].includes(item.type) && result[item.field] && result[item.field].length > 0) {
          let options = result[item.field].map(cell => {
            let _cell = {
              key: Utils.getuuid(),
              Value: cell[item.valueField],
              Text: cell[item.valueText]
            let _cell = { key: Utils.getuuid() }
            if (item.type !== 'checkcard') {
              _cell.Value = cell[item.valueField]
              _cell.Text = cell[item.valueText]
            } else {
              _cell.$value = cell[item.valueField]
              _cell = {..._cell, ...cell}
            }
    
            if (item.type === 'link') {
              _cell.ParentID = cell[item.linkField]
            } else if (item.type === 'select' && item.linkSubField && item.linkSubField.length > 0) {
            } else if ((item.type === 'select' || item.type === 'radio') && item.linkSubField && item.linkSubField.length > 0) {
              item.linkSubField.forEach(_field => {
                _cell[_field] = (cell[_field] || cell[_field] === 0) ? cell[_field] : ''
              })
@@ -427,7 +441,7 @@
            } else {
              item.options = item.oriOptions
            }
          } else if (item.type === 'select' || item.type === 'multiselect') {
          } else if (['select', 'multiselect', 'radio', 'checkbox', 'checkcard'].includes(item.type)) {
            item.options = item.oriOptions
          }
          return item
@@ -485,17 +499,21 @@
      delete result.status
      let _formlist = formlist.map(item => {
        if (['select', 'link', 'multiselect'].includes(item.type) && result[item.field] && result[item.field].length > 0) {
        if (['select', 'link', 'multiselect', 'radio', 'checkbox', 'checkcard'].includes(item.type) && result[item.field] && result[item.field].length > 0) {
          let options = result[item.field].map(cell => {
            let _cell = {
              key: Utils.getuuid(),
              Value: cell[item.valueField],
              Text: cell[item.valueText]
            let _cell = { key: Utils.getuuid() }
            if (item.type !== 'checkcard') {
              _cell.Value = cell[item.valueField]
              _cell.Text = cell[item.valueText]
            } else {
              _cell.$value = cell[item.valueField]
              _cell = {..._cell, ...cell}
            }
    
            if (item.type === 'link') {
              _cell.ParentID = cell[item.linkField]
            } else if (item.type === 'select' && item.linkSubField && item.linkSubField.length > 0) {
            } else if ((item.type === 'select' || item.type === 'radio') && item.linkSubField && item.linkSubField.length > 0) {
              item.linkSubField.forEach(_field => {
                _cell[_field] = (cell[_field] || cell[_field] === 0) ? cell[_field] : ''
              })
@@ -517,7 +535,7 @@
            } else {
              item.options = item.oriOptions
            }
          } else if (item.type === 'select' || item.type === 'multiselect') {
          } else if (['select', 'multiselect', 'radio', 'checkbox', 'checkcard'].includes(item.type)) {
            item.options = item.oriOptions
          }
          return item
@@ -554,7 +572,7 @@
    }
  }
  selectChange = (_field, value, option) => {
  selectChange = (_field, value) => {
    const { record } = this.state
    let formlist = fromJS(this.state.formlist).toJS()
@@ -576,15 +594,18 @@
    })
    
    // 表单切换时,更新关联字段
    if (_field.type === 'select' && _field.linkSubField && _field.linkSubField.length > 0 && option.props.data) {
      let _data = option.props.data
      _field.linkSubField.forEach(subfield => {
        if (this.props.form.getFieldValue(subfield) !== undefined) {
          fieldsvalue[subfield] = (_data[subfield] || _data[subfield] === 0) ? _data[subfield] : ''
        } else {
          _record[subfield] = (_data[subfield] || _data[subfield] === 0) ? _data[subfield] : ''
        }
      })
    if ((_field.type === 'select' || _field.type === 'radio') && _field.linkSubField && _field.linkSubField.length > 0) {
      let _data = _field.options.filter(op => op.Value === value)[0]
      if (_data) {
        _field.linkSubField.forEach(subfield => {
          if (this.props.form.getFieldValue(subfield) !== undefined) {
            fieldsvalue[subfield] = (_data[subfield] || _data[subfield] === 0) ? _data[subfield] : ''
          } else {
            _record[subfield] = (_data[subfield] || _data[subfield] === 0) ? _data[subfield] : ''
          }
        })
      }
    }
    if (subfields.length === 0) {
@@ -629,17 +650,47 @@
    callback()
  }
  getFields(formlist) {
  getFields() {
    const { getFieldDecorator } = this.props.form
    const { cols } = this.state
    const { cols, formlist } = this.state
    const fields = []
    let filtration = {}
    formlist.forEach((item, index) => {
      if ((!item.field && item.type !== 'title' && item.type !== 'hint') || item.hidden === 'true' || item.type === 'funcvar') return
      if (item.supField) { // 多层表单控制
        let _supVal = this.props.form.getFieldValue(item.supField)
        if (_supVal === undefined && filtration[item.supField]) {
          _supVal = filtration[item.supField]
        }
        if (item.supvalue.includes(_supVal)) {
          let _subVal = this.props.form.getFieldValue(item.field)
          filtration[item.field] = _subVal === undefined ? item.initval : _subVal
        } else {
          return
        }
      }
      let _colspan = 24 / cols
      if (item.entireLine === 'true') {
        _colspan = 24
      }
      if (item.type === 'title') {
        fields.push(
          <Col span={24} key={index}>
            <p>{item.label}</p>
          </Col>
        )
      } else if (item.type === 'hint') {
        fields.push(
          <Col span={24} key={index}>
            <Form.Item colon={!!item.label} label={item.label || ' '} className="hint">
              <div className="message">{item.message}</div>
            </Form.Item>
          </Col>
        )
      } else if (item.type === 'text') {
@@ -669,8 +720,13 @@
          }
        }
        fields.push(
          <Col span={24 / cols} key={index}>
            <Form.Item label={item.label}>
          <Col span={_colspan} key={index}>
            <Form.Item label={item.tooltip ?
              <Tooltip placement="topLeft" title={item.tooltip}>
                <Icon type="question-circle" />
                {item.label}
              </Tooltip> : item.label
            }>
              {getFieldDecorator(item.field, {
                initialValue: item.initval,
                rules: [
@@ -693,8 +749,13 @@
        let precision = (item.decimal || item.decimal === 0) ? item.decimal : null
        fields.push(
          <Col span={24 / cols} key={index}>
            <Form.Item label={item.label}>
          <Col span={_colspan} key={index}>
            <Form.Item label={item.tooltip ?
              <Tooltip placement="topLeft" title={item.tooltip}>
                <Icon type="question-circle" />
                {item.label}
              </Tooltip> : item.label
            }>
              {getFieldDecorator(item.field, {
                initialValue: _initval,
                rules: [
@@ -716,8 +777,13 @@
        )
      } else if (item.type === 'color') { // 颜色选择
        fields.push(
          <Col span={24 / cols} key={index}>
            <Form.Item label={item.label}>
          <Col span={_colspan} key={index}>
            <Form.Item label={item.tooltip ?
              <Tooltip placement="topLeft" title={item.tooltip}>
                <Icon type="question-circle" />
                {item.label}
              </Tooltip> : item.label
            }>
              {getFieldDecorator(item.field, {
                initialValue: item.initval,
                rules: [
@@ -727,7 +793,7 @@
                  }
                ]
              })(
                <Select onChange={(value, option) => {this.selectChange(item, value, option)}} disabled={item.readonly === 'true'}>
                <Select disabled={item.readonly === 'true'}>
                  {calendarColors.map(option =>
                    <Select.Option key={option.name} style={{background: option.value, color: '#ffffff'}} value={option.name}>{option.name}</Select.Option>
                  )}
@@ -736,15 +802,109 @@
            </Form.Item>
          </Col>
        )
      } else if (item.type === 'select' || item.type === 'link') { // 下拉搜索
        let hasSubField = false
        if (item.linkSubField && item.linkSubField.length > 0) { // 存在关联字段,数据存储
          hasSubField = true
        }
      } else if (item.type === 'checkcard') { // 多选框
        fields.push(
          <Col span={24} key={index}>
            <Form.Item label={item.tooltip ?
              <Tooltip placement="topLeft" title={item.tooltip}>
                <Icon type="question-circle" />
                {item.label}
              </Tooltip> : item.label
            } className="checkcard">
              {getFieldDecorator(item.field, {
                initialValue: item.initval,
                rules: [
                  {
                    required: item.required === 'true',
                    message: this.props.dict['form.required.select'] + item.label + '!'
                  }
                ]
              })(<CheckCard card={item} />)}
            </Form.Item>
          </Col>
        )
      } else if (item.type === 'switch') { // 多选框
        fields.push(
          <Col span={_colspan} key={index}>
            <Form.Item label={item.tooltip ?
              <Tooltip placement="topLeft" title={item.tooltip}>
                <Icon type="question-circle" />
                {item.label}
              </Tooltip> : item.label
            }>
              {getFieldDecorator(item.field, {
                initialValue: item.initval,
                rules: [
                  {
                    required: item.required === 'true',
                    message: this.props.dict['form.required.select'] + item.label + '!'
                  }
                ]
              })(<CustomSwitch Item={item} />)}
            </Form.Item>
          </Col>
        )
      } else if (item.type === 'checkbox') { // 多选框
        let _initval = item.initval ? item.initval.split(',').filter(Boolean) : []
        
        fields.push(
          <Col span={24 / cols} key={index}>
            <Form.Item label={item.label}>
          <Col span={_colspan} key={index}>
            <Form.Item label={item.tooltip ?
              <Tooltip placement="topLeft" title={item.tooltip}>
                <Icon type="question-circle" />
                {item.label}
              </Tooltip> : item.label
            }>
              {getFieldDecorator(item.field, {
                initialValue: _initval,
                rules: [
                  {
                    required: item.required === 'true',
                    message: this.props.dict['form.required.select'] + item.label + '!'
                  }
                ]
              })(
                <Checkbox.Group disabled={item.readonly === 'true'}>
                  {item.options.map(option => <Checkbox key={option.key} title={option.Text} value={option.Value}>{option.Text}</Checkbox>)}
                </Checkbox.Group>
              )}
            </Form.Item>
          </Col>
        )
      } else if (item.type === 'radio') { // 单选框
        fields.push(
          <Col span={_colspan} key={index}>
            <Form.Item label={item.tooltip ?
              <Tooltip placement="topLeft" title={item.tooltip}>
                <Icon type="question-circle" />
                {item.label}
              </Tooltip> : item.label
            }>
              {getFieldDecorator(item.field, {
                initialValue: item.initval,
                rules: [
                  {
                    required: item.required === 'true',
                    message: this.props.dict['form.required.select'] + item.label + '!'
                  }
                ]
              })(
                <Radio.Group disabled={item.readonly === 'true'} onChange={(e) => {this.selectChange(item, e.target.value)}}>
                  {item.options.map(option => <Radio key={option.key} value={option.Value}>{option.Text}</Radio>)}
                </Radio.Group>
              )}
            </Form.Item>
          </Col>
        )
      } else if (item.type === 'select' || item.type === 'link') { // 下拉搜索
        fields.push(
          <Col span={_colspan} key={index}>
            <Form.Item label={item.tooltip ?
              <Tooltip placement="topLeft" title={item.tooltip}>
                <Icon type="question-circle" />
                {item.label}
              </Tooltip> : item.label
            }>
              {getFieldDecorator(item.field, {
                initialValue: item.initval,
                rules: [
@@ -757,11 +917,11 @@
                <Select
                  showSearch
                  filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                  onChange={(value, option) => {this.selectChange(item, value, option)}}
                  onChange={(value) => {this.selectChange(item, value)}}
                  disabled={item.readonly === 'true'}
                >
                  {item.options.map(option =>
                    <Select.Option id={option.key} data={hasSubField ? option : ''} title={option.Text} key={option.key} value={option.Value}>{option.Text}</Select.Option>
                    <Select.Option id={option.key} title={option.Text} key={option.key} value={option.Value}>{option.Text}</Select.Option>
                  )}
                </Select>
              )}
@@ -771,8 +931,13 @@
      } else if (item.type === 'multiselect') { // 多选
        let _initval = item.initval ? item.initval.split(',').filter(Boolean) : []
        fields.push(
          <Col span={24 / cols} key={index}>
            <Form.Item label={item.label}>
          <Col span={_colspan} key={index}>
            <Form.Item label={item.tooltip ?
              <Tooltip placement="topLeft" title={item.tooltip}>
                <Icon type="question-circle" />
                {item.label}
              </Tooltip> : item.label
            }>
              {getFieldDecorator(item.field, {
                initialValue: _initval,
                rules: [
@@ -798,8 +963,13 @@
        )
      } else if (item.type === 'date') { // 时间搜索
        fields.push(
          <Col span={24 / cols} key={index}>
            <Form.Item label={item.label}>
          <Col span={_colspan} key={index}>
            <Form.Item label={item.tooltip ?
              <Tooltip placement="topLeft" title={item.tooltip}>
                <Icon type="question-circle" />
                {item.label}
              </Tooltip> : item.label
            }>
              {getFieldDecorator(item.field, {
                initialValue: item.initval,
                rules: [
@@ -816,8 +986,13 @@
        )
      } else if (item.type === 'datemonth') {
        fields.push(
          <Col span={24 / cols} key={index}>
            <Form.Item label={item.label}>
          <Col span={_colspan} key={index}>
            <Form.Item label={item.tooltip ?
              <Tooltip placement="topLeft" title={item.tooltip}>
                <Icon type="question-circle" />
                {item.label}
              </Tooltip> : item.label
            }>
              {getFieldDecorator(item.field, {
                initialValue: item.initval,
                rules: [
@@ -834,8 +1009,13 @@
        )
      } else if (item.type === 'datetime') {
        fields.push(
          <Col span={24 / cols} key={index}>
            <Form.Item label={item.label}>
          <Col span={_colspan} key={index}>
            <Form.Item label={item.tooltip ?
              <Tooltip placement="topLeft" title={item.tooltip}>
                <Icon type="question-circle" />
                {item.label}
              </Tooltip> : item.label
            }>
              {getFieldDecorator(item.field, {
                initialValue: item.initval,
                rules: [
@@ -871,8 +1051,13 @@
        }
        fields.push(
          <Col span={24 / cols} key={index}>
            <Form.Item label={item.label}>
          <Col span={_colspan} key={index}>
            <Form.Item label={item.tooltip ?
              <Tooltip placement="topLeft" title={item.tooltip}>
                <Icon type="question-circle" />
                {item.label}
              </Tooltip> : item.label
            }>
              {getFieldDecorator(item.field, {
                initialValue: filelist,
                rules: [
@@ -889,8 +1074,13 @@
        )
      } else if (item.type === 'linkMain') {
        fields.push(
          <Col span={24 / cols} key={index}>
            <Form.Item label={item.label}>
          <Col span={_colspan} key={index}>
            <Form.Item label={item.tooltip ?
              <Tooltip placement="topLeft" title={item.tooltip}>
                <Icon type="question-circle" />
                {item.label}
              </Tooltip> : item.label
            }>
              {getFieldDecorator(item.field, {
                initialValue: item.initval,
                rules: [
@@ -907,15 +1097,14 @@
        // 函数变量字段,默认不显示
      } else if (item.type === 'textarea') {
        let _max = item.fieldlength || 512
        let _labelcol = cols !== 3 ? 8 / cols : 3
        let _wrapcol = cols !== 3 ? 16 + (cols - 1) * 4 : 21
        let _style = {}
        if (cols === 2 || cols === 4) {
          _style.paddingLeft = '7px'
        }
        fields.push(
          <Col span={24} key={index} className="textarea-row" style={{..._style}}>
            <Form.Item label={item.label} labelCol={{xs: { span: 24 }, sm: { span: _labelcol }}} wrapperCol={ {xs: { span: 24 }, sm: { span: _wrapcol }} }>
          <Col span={24} key={index}>
            <Form.Item label={item.tooltip ?
              <Tooltip placement="topLeft" title={item.tooltip}>
                <Icon type="question-circle" />
                {item.label}
              </Tooltip> : item.label
            }>
              {getFieldDecorator(item.field, {
                initialValue: item.initval,
                rules: [
@@ -1034,7 +1223,7 @@
            } else if (this.state.datatype[key] === 'number') {
              _value = values[key]
            } else if (this.state.datatype[key] === 'multiselect') {
            } else if (this.state.datatype[key] === 'multiselect' || this.state.datatype[key] === 'checkbox') {
              _value = values[key] ? values[key].join(',') : ''
            } else if (this.state.datatype[key] === 'fileupload') {
@@ -1104,7 +1293,7 @@
  }
  render() {
    const { formlist, cols } = this.state
    const { cols } = this.state
    const formItemLayout = {
      labelCol: {
        xs: { span: 24 },
@@ -1116,52 +1305,9 @@
      }
    }
    let _formlist = []
    let rowIndex = 0
    let colIndex = 0
    let filtration = {}
    // 表单分行,避免排列不整齐
    formlist.forEach(item => {
      if ((!item.field && item.type !== 'title') || item.hidden === 'true' || item.type === 'funcvar') return
      if (item.supField) { // 多层表单控制
        let _supVal = this.props.form.getFieldValue(item.supField)
        if (_supVal === undefined && filtration[item.supField]) {
          _supVal = filtration[item.supField]
        }
        if (item.supvalue.includes(_supVal)) {
          let _subVal = this.props.form.getFieldValue(item.field)
          filtration[item.field] = _subVal === undefined ? item.initval : _subVal
        } else {
          return
        }
      }
      _formlist[rowIndex] = _formlist[rowIndex] || []
      if (item.type === 'textarea' || item.type === 'title') {
        if (colIndex === 0) {
          _formlist[rowIndex].push(item)
        } else {
          rowIndex++
          _formlist[rowIndex] = [item]
        }
        rowIndex++
        colIndex = 0
      } else {
        _formlist[rowIndex].push(item)
        colIndex++
      }
      if (colIndex >= cols) {
        rowIndex++
        colIndex = 0
      }
    })
    return (
      <Form {...formItemLayout} className="ant-advanced-search-form main-form-field" id="main-form-box">
        {_formlist.map((formrow, index) => <Row key={index} gutter={24}>{this.getFields(formrow)}</Row>)}
        <Row className={'cols' + cols} gutter={24}>{this.getFields()}</Row>
      </Form>
    )
  }
src/tabviews/zshare/mutilform/index.scss
@@ -1,8 +1,40 @@
.ant-advanced-search-form.main-form-field {
  position: relative;
  padding: 0px 24px 20px;
  >.ant-row >.ant-col {
    display: inline-block;
    float: none;
    vertical-align: top;
  }
  .ant-form-item-label .anticon-question-circle {
    color: #c49f47;
    margin-right: 3px;
  }
  .ant-checkbox-group {
    line-height: unset;
    .ant-checkbox-wrapper {
      margin-right: 8px;
    }
    .ant-checkbox-wrapper + .ant-checkbox-wrapper {
      margin-left: 0;
    }
  }
  .ant-form-item {
    display: flex;
  }
  .ant-form-item.checkcard {
    margin-bottom: 10px;
    .ant-form-item-control {
      line-height: 1.5;
    }
  }
  .ant-form-item.hint {
    margin-bottom: 0px;
    .message {
      margin-top: 9px;
      line-height: 1.5;
      color: rgba(0, 0, 0, 0.85);
    }
  }
  .ant-form-item-control-wrapper {
    flex: 1;
@@ -13,12 +45,25 @@
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .textarea-row {
    .ant-col-sm-3 {
      width: 10.5%;
  >.ant-row.cols2 .ant-col-24 {
    .ant-form-item {
      .ant-form-item-label {
        width: 16%;
      }
    }
    .ant-col-sm-21 {
      width: 89.5%;
  }
  >.ant-row.cols3 .ant-col-24 {
    .ant-form-item {
      .ant-form-item-label {
        width: 10.5%;
      }
    }
  }
  >.ant-row.cols4 .ant-col-24 {
    .ant-form-item {
      .ant-form-item-label {
        width: 7.5%;
      }
    }
  }
  .ant-input-number {
src/templates/formtabconfig/index.jsx
@@ -486,7 +486,12 @@
    this.setState({
      modaltype: 'search',
      card: card,
      formlist: getModalForm(card, _inputfields, _linkableFields, _linksupFields, false, roleList)
      formlist: getModalForm(card, _inputfields, _linkableFields, _linksupFields, false, roleList).map(item => {
        if (item.key === 'type') {
          item.options = item.options.filter(option => !['switch', 'checkbox', 'radio', 'checkcard', 'hint'].includes(option.value))
        }
        return item
      })
    })
  }
src/templates/modalconfig/checkCard/index.jsx
@@ -1,10 +1,8 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
// import { fromJS } from 'immutable'
import { Col, Row } from 'antd'
import './index.scss'
class CheckCard extends Component {
  static propTpyes = {
@@ -17,17 +15,7 @@
    onChange: PropTypes.func,    // 数据切换
  }
  state = {
    selectKeys: null,       // 选中数据id
  }
  UNSAFE_componentWillMount () {
  }
  UNSAFE_componentWillReceiveProps (nextProps) {
  }
  state = {}
  getCards = () => {
    const { display, width, options, fields, ratio } = this.props
@@ -62,7 +50,6 @@
  }
  render() {
    return (
      <div className="check-card-edit-box" style={{marginTop: '10px'}}>
        <Row gutter={12}>{this.getCards()}</Row>
src/templates/modalconfig/checkCard/index.scss
@@ -3,6 +3,7 @@
    border: 1px solid #bcbcbc;
    border-radius: 4px;
    padding: 6px;
    margin-bottom: 12px;
    span {
      display: block;
      overflow: hidden;
@@ -15,5 +16,6 @@
    border-radius: 4px;
    background-size: cover;
    background-position: center;
    margin-bottom: 12px;
  }
}
src/templates/modalconfig/dragelement/card.jsx
@@ -105,14 +105,19 @@
  } else if (card.type === 'switch') {
    formItem = (<Switch style={{marginTop: '8px'}} checked={card.initval}/>)
  } else if (card.type === 'radio') {
    formItem = (<Radio.Group style={{marginTop: '8px'}} value={1}>
    formItem = card.options && card.options.length > 0 ? (<Radio.Group value={card.initval}>
      {card.options.map(cell => <Radio key={cell.key} value={cell.Value}>{cell.Text}</Radio>)}
    </Radio.Group>) : (<Radio.Group value={1}>
      <Radio value={1}>A</Radio>
      <Radio value={2}>B</Radio>
      <Radio value={3}>C</Radio>
      <Radio value={4}>D</Radio>
    </Radio.Group>)
  } else if (card.type === 'checkbox') {
    formItem = (<Checkbox.Group style={{marginTop: '8px'}} value={['A', 'C']}>
    let _val = card.initval ? card.initval.split(',') : []
    formItem = card.options && card.options.length > 0 ? (<Checkbox.Group value={_val}>
      {card.options.map(cell => <Checkbox key={cell.key} value={cell.Value}>{cell.Text}</Checkbox>)}
    </Checkbox.Group>) : (<Checkbox.Group value={['A', 'C']}>
      <Checkbox value="A">A</Checkbox>
      <Checkbox value="B">B</Checkbox>
      <Checkbox value="C">C</Checkbox>
src/templates/modalconfig/dragelement/index.scss
@@ -19,4 +19,9 @@
    padding-left: 12px;
    padding-right: 12px;
  }
  >.ant-col {
    display: inline-block;
    float: none;
    vertical-align: top;
  }
}
src/templates/modalconfig/index.jsx
@@ -369,13 +369,13 @@
        let sublist = group.sublist.filter(item => item.type === 'text' || item.type === 'number')
        _inputfields = [..._inputfields, ...sublist]
        let suplist = group.sublist.filter(item => item.type === 'select' || item.type === 'link')
        let suplist = group.sublist.filter(item => item.type === 'select' || item.type === 'link' || item.type === 'radio')
        _formfields = [..._formfields, ...suplist]
      })
    } else {
      _inputfields = config.fields.filter(item => item.type === 'text' || item.type === 'number')
      
      _formfields = config.fields.filter(item => item.type === 'select' || item.type === 'link')
      _formfields = config.fields.filter(item => item.type === 'select' || item.type === 'link' || item.type === 'radio')
    }
    let uniq = new Map()
src/templates/modalconfig/index.scss
@@ -218,6 +218,18 @@
                width: 100%;
                margin-top: 4px;
              }
              .ant-checkbox-group {
                line-height: 40px;
                .ant-checkbox-wrapper {
                  margin-right: 8px;
                }
                .ant-checkbox-wrapper + .ant-checkbox-wrapper {
                  margin-left: 0px;
                }
              }
              .ant-radio-group {
                line-height: 40px;
              }
              .ant-calendar-picker {
                width: 100%;
                margin-top: 4px;
src/templates/zshare/createinterface/index.jsx
@@ -1,10 +1,12 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { fromJS } from 'immutable'
import { Button, notification, Modal } from 'antd'
import moment from 'moment'
import MutilForm from './mutilform'
import Utils from '@/utils/utils.js'
import options from '@/store/options.js'
import Api from '@/api'
import './index.scss'
@@ -195,7 +197,6 @@
    if (type === 'out') {
      this.FormRef.handleConfirm().then(res => {
        this.setState({
          type: '',
          loading: true,
@@ -208,7 +209,6 @@
      })
    } else {
      this.FormRef.handleConfirm().then(res => {
        this.setState({
          type: '',
          btn: null,
@@ -217,7 +217,11 @@
          visible: false,
          param: null
        })
        if (res.TryType === 'Y' && res.array_name) {
          res.Return = 'N'
        }
        this.createBtnInterfaceExec({...param, ...res}, config, btn)
      })
    }
@@ -253,7 +257,7 @@
    delete param.hidden
    let _mainParam = JSON.parse(JSON.stringify(param))
    let _mainParam = fromJS(param).toJS()
    new Promise(resolve => {
      // 获取云端存储过程信息
@@ -335,15 +339,16 @@
      Ltextgridparam: '',
      Ltexttableparam: '',
      Ltext: '',
      menuType: menu.type
      menuType: menu.type,
      systemType: options.sysType
    }
    this.setState({
      type: 'inner',
      param: param,
      visible: true,
      btn: JSON.parse(JSON.stringify(btn)),
      config: JSON.parse(JSON.stringify(config)),
      btn: fromJS(btn).toJS(),
      config: fromJS(config).toJS(),
      formlist: [{
        type: 'text',
        key: 'KunName',
@@ -374,6 +379,7 @@
        key: 'Return',
        label: '回执',
        initval: 'N',
        tooltip: '当选择需要事务,且填入了数组名称时,将不存在回执信息。',
        required: true,
        options: [{
          value: 'Y',
@@ -382,6 +388,13 @@
          value: 'N',
          text: '不需要'
        }]
      }, {
        type: 'text',
        key: 'array_name',
        label: '数组名称',
        initval: menu.menuNo + btn.uuid.substr(-4),
        tooltip: '批量操作时,需要填写数组名称。',
        required: false
      }]
    })
  }
@@ -444,6 +457,7 @@
                  fieldlen: _fieldlen,
                  key: cell.field,
                  required: cell.required === 'true' ? 'required' : '',
                  writein: cell.required !== 'false',
                  value: cell.initval || ''
                }
@@ -550,7 +564,7 @@
      
      delete param.menuType
      _mainParam = JSON.parse(JSON.stringify(param))
      _mainParam = fromJS(param).toJS()
      return Api.getLocalConfig(param)
    }).then(res => {
@@ -603,12 +617,37 @@
    let primaryKey = setting.primaryKey || 'id'
    let columns = config.columns.filter(col => !!col.field)
    let verify = btn.verify || {}
    let _initCustomScript = '' // 初始化脚本
    let _prevCustomScript = '' // 默认sql前执行脚本
    let _backCustomScript = '' // 默认sql后执行脚本
    verify.scripts && verify.scripts.forEach(item => {
      if (item.status === 'false') return
      if (item.position === 'init') {
        _initCustomScript += `
        /* 自定义脚本 */
        ${item.sql}
        `
      } else if (item.position === 'front') {
        _prevCustomScript += `
        /* 自定义脚本 */
        ${item.sql}
        `
      } else {
        _backCustomScript += `
        /* 自定义脚本 */
        ${item.sql}
        `
      }
    })
    // 需要声明的变量集
    let _vars = ['tbid', 'errorcode', 'retmsg', 'billcode', 'bvoucher', 'fibvoucherdate', 'fiyear', 'username', 'fullname', 'modulardetailcode']
    // 系统变量声明与设置初始值
    let _sql = `Declare @tbid nvarchar(50),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@BillCode nvarchar(50),@BVoucher nvarchar(50),@FIBVoucherDate nvarchar(50), @FiYear nvarchar(50), @UserName nvarchar(50),@FullName nvarchar(50),@ModularDetailCode nvarchar(50)
      `
    let _sql = ''
    let _initvars = [] // 已赋值字段集
    let _initfields = []
@@ -671,9 +710,13 @@
    // 变量声明
    _declarefields = _declarefields.join(',')
    if (_declarefields) {
      _sql += `,${_declarefields}
        `
      _declarefields = ',' + _declarefields
    }
    _sql = `/* 系统生成 */
        Declare @tbid nvarchar(50),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@BillCode nvarchar(50),@BVoucher nvarchar(50),@FIBVoucherDate nvarchar(50), @FiYear nvarchar(50), @UserName nvarchar(50),@FullName nvarchar(50),@ModularDetailCode nvarchar(50)${_declarefields}
        select @UserName=UserName,@FullName=FullName from SUsers where UID=@UserID@
      `
    // 变量赋值
    if (_initfields.length > 0) {
@@ -704,25 +747,48 @@
    }
    // 初始化凭证及用户信息字段
    _sql += `select @BVoucher='',@FIBVoucherDate='',@FiYear='',@ErrorCode='',@retmsg=''
    _sql += `select @BVoucher='',@FIBVoucherDate='',@FiYear='',@ErrorCode='',@retmsg='', @BillCode='', @ModularDetailCode=''
      `
    if (_initCustomScript) {
      _sql += _initCustomScript
    }
    // 启用账期验证
    if (verify.accountdate === 'true') {
      _sql += `exec s_FIBVoucherDateCheck @ErrorCode=@ErrorCode OUTPUT,@retmsg=@retmsg OUTPUT
      _sql += `
        /* 账期验证 */
        exec s_FIBVoucherDateCheck @ErrorCode=@ErrorCode OUTPUT,@retmsg=@retmsg OUTPUT
        if @ErrorCode!=''
          GOTO aaa
        `
    }
    // 失效验证,添加数据时不用
    if (btn.sqlType !== 'insert' && verify.invalid === 'true') {
    if (btn.sqlType !== 'insert' && verify.invalid === 'true' && setting.dataresource) {
      let datasource = setting.dataresource
      if (/\s/.test(datasource)) { // 拼接别名
      if (/\s/.test(datasource) && !/tb$/.test(datasource)) { // 拼接别名
        datasource = '(' + datasource + ') tb'
      }
      _sql += `select @tbid='', @ErrorCode='',@retmsg=''
      // 自定义脚本
      if (setting.interType === 'system' && setting.scripts && setting.scripts.length > 0) {
        let _customScript = ''
        setting.scripts.forEach(item => {
          if (item.status === 'false') return
          _customScript += `
            ${item.sql}
          `
        })
        _sql += `
          /* 数据源自定义脚本,请注意变量定义是否重复 */
          ${_customScript}
        `
      }
      _sql += `
        /* 失效验证 */
        select @tbid='', @ErrorCode='',@retmsg=''
        select @tbid=${primaryKey} from ${datasource} where ${primaryKey} =@${primaryKey}@
        If @tbid=''
        Begin
@@ -735,11 +801,76 @@
    // 比较验证
    if (verify.contrasts && verify.contrasts.length > 0) {
      verify.contrasts.forEach(item => {
        _sql += `If ${item.frontfield} ${item.operator} ${item.backfield}
        _sql += `
          /* 比较验证 */
          If ${item.frontfield} ${item.operator} ${item.backfield}
          Begin
            select @ErrorCode='${item.errorCode}',@retmsg='${item.errmsg}'
              goto aaa
          end
          `
      })
    }
    // 自定义验证
    if (verify.customverifys && verify.customverifys.length > 0) {
      verify.customverifys.forEach(item => {
        _sql += `
          /* 自定义验证 */
          select @tbid='', @ErrorCode='',@retmsg=''
          select top 1 @tbid='X' from (${item.sql}) a
          If @tbid ${item.result === 'true' ? '!=' : '='}''
          Begin
            select @ErrorCode='${item.errorCode}',@retmsg='${item.errmsg}'
            goto aaa
          end
          `
      })
    }
    // 单号生成,使用上级id(BID)或列表数据,声明变量(检验)
    if (verify.billcodes && verify.billcodes.length > 0) {
      verify.billcodes.forEach(item => {
        let _ModularDetailCode = ''
        let _lpline = ''
        if (item.TypeCharOne === 'Lp') {
          if (item.linkField === 'BID' && BID) { // 替换bid
            _lpline = `set @ModularDetailCode= 'Lp'+ right('${item.mark || btn.uuid}'+@BID@,48)`
          } else {
            _lpline = `set @ModularDetailCode= 'Lp'+ right('${item.mark || btn.uuid}'+@${item.linkField}@,48)`
          }
          _ModularDetailCode = '@ModularDetailCode'
        } else if (item.TypeCharOne === 'BN') {
          _ModularDetailCode = `'${item.TypeCharOne + '@' + item.linkField}@'`
        } else {
          _ModularDetailCode = `'${item.ModularDetailCode}'`
        }
        let _declare = ''
        let _key = item.field.toLowerCase()
        if (!_vars.includes(_key)) {
          _declare = `Declare @${_key} nvarchar(50)`
          _vars.push(_key)
        }
        _sql += `
          /* 单号生成 */
          ${_declare}
          select @BillCode='', @${_key}='', @ModularDetailCode=''
          ${_lpline}
          exec s_get_BillCode
            @ModularDetailCode=${_ModularDetailCode},
            @Type=${item.Type},
            @TypeCharOne='${item.TypeCharOne}',
            @TypeCharTwo ='${item.TypeCharTwo}',
            @BillCode =@BillCode output,
            @ErrorCode =@ErrorCode output,
            @retmsg=@retmsg output
          if @ErrorCode!=''
            goto aaa
          set @${_key}=@BillCode
          `
      })
    }
@@ -777,65 +908,6 @@
          `
      })
    }
    // 自定义验证
    if (verify.customverifys && verify.customverifys.length > 0) {
      verify.customverifys.forEach(item => {
        _sql += `select @tbid='', @ErrorCode='',@retmsg=''
          select top 1 @tbid='X' from (${item.sql}) a
          If @tbid ${item.result === 'true' ? '!=' : '='}''
          Begin
            select @ErrorCode='${item.errorCode}',@retmsg='${item.errmsg}'
            goto aaa
          end
          `
      })
    }
    // 单号生成,使用上级id(BID)或列表数据,声明变量(检验)
    if (verify.billcodes && verify.billcodes.length > 0) {
      verify.billcodes.forEach(item => {
        let _ModularDetailCode = ''
        let _lpline = ''
        if (item.TypeCharOne === 'Lp') {
          if (item.linkField === 'BID' && BID) { // 替换bid
            _lpline = `set @ModularDetailCode= 'Lp'+ right('${btn.uuid}'+@BID@,48)`
          } else {
            _lpline = `set @ModularDetailCode= 'Lp'+ right('${btn.uuid}'+@${item.linkField}@,48)`
          }
          _ModularDetailCode = '@ModularDetailCode'
        } else if (item.TypeCharOne === 'BN') {
          _ModularDetailCode = `'${item.TypeCharOne + '@' + item.linkField}@'`
        } else {
          _ModularDetailCode = `'${item.ModularDetailCode}'`
        }
        let _declare = ''
        let _key = item.field.toLowerCase()
        if (!_vars.includes(_key)) {
          _declare = `Declare @${_key} nvarchar(50)`
          _vars.push(_key)
        }
        _sql += `${_declare}
          select @BillCode='', @${_key}='', @ModularDetailCode=''
          ${_lpline}
          exec s_get_BillCode
            @ModularDetailCode=${_ModularDetailCode},
            @Type=${item.Type},
            @TypeCharOne='${item.TypeCharOne}',
            @TypeCharTwo ='${item.TypeCharTwo}',
            @BillCode =@BillCode output,
            @ErrorCode =@ErrorCode output,
            @retmsg=@retmsg output
          if @ErrorCode!=''
            goto aaa
          set @${_key}=@BillCode
          `
      })
    }
    let hasvoucher = false
@@ -864,6 +936,10 @@
        `
    }
    if (_prevCustomScript) {
      _sql += _prevCustomScript
    }
    let _actionType = null
    let receiptKeys = [] // 回执字段
@@ -883,16 +959,14 @@
      receiptKeys.push('bid')
    }
    // 用于取用户信息
    let _user = `select @UserName=UserName,@FullName=FullName from SUsers where UID=@UserID@
      `
    // 添加、修改、逻辑删除、物理删除
    if (_actionType === 'insert') {
      let keys = []
      let values = []
      formlist.forEach(item => {
        if (item.writein === false) return
        keys.push(item.key.toLowerCase())
        values.push('@' + item.key + '@')
      })
@@ -921,15 +995,17 @@
      keys = keys.join(',')
      values = values.join(',')
      _sql += _user
      _sql += `insert into ${btn.sql} (${keys}) select ${values};`
      _sql += `
        /* 默认sql */
        insert into ${btn.sql} (${keys}) select ${values};`
    } else if (_actionType === 'update') {
      let _form = []
      let _arr = []
      formlist.forEach(item => {
        _arr.push(item.key.toLowerCase())
        if (item.writein === false) return
        _arr.push(item.key.toLowerCase())
        _form.push(item.key + `=@${item.key}@`)
      })
      
@@ -962,9 +1038,13 @@
      }
      _form = _form.join(',')
      _sql += `update ${btn.sql} set ${_form} where ${primaryKey}=@${primaryKey}@;`
      _sql += `
        /* 默认sql */
        update ${btn.sql} set ${_form} where ${primaryKey}=@${primaryKey}@;`
    } else if (_actionType === 'LogicDelete') { // 逻辑删除
      _sql += `update ${btn.sql} set deleted=1,modifydate=getdate(),modifyuserid=@userid@ where ${primaryKey}=@${primaryKey}@;`
      _sql += `
        /* 默认sql */
        update ${btn.sql} set deleted=1,modifydate=getdate(),modifyuserid=@userid@ where ${primaryKey}=@${primaryKey}@;`
      
    } else if (_actionType === 'delete') {      // 物理删除
      let _msg = ''
@@ -977,18 +1057,14 @@
          }
        })
      }
      _sql += _user
      _sql += `insert into snote (remark,createuserid,CreateUser,CreateStaff) select '删除表:${btn.sql} 数据: ${_msg}${primaryKey}='+@${primaryKey}@,@userid@,@username,@fullname delete ${btn.sql} where ${primaryKey}=@${primaryKey}@;`
      _sql += `
        /* 默认sql */
        insert into snote (remark,createuserid,CreateUser,CreateStaff) select '删除表:${btn.sql} 数据: ${_msg}${primaryKey}='+@${primaryKey}@,@userid@,@username,@fullname
        delete ${btn.sql} where ${primaryKey}=@${primaryKey}@;`
    }
    // 拼接自定义脚本
    if (verify.scripts && verify.scripts.length > 0) {
      let _scripts = ''
      verify.scripts.forEach(item => {
        _scripts += `
        ${item.sql}`
      })
      _sql += `${_scripts}`
    if (_backCustomScript) {
      _sql += _backCustomScript
    }
    let _ltext = ''
src/templates/zshare/createinterface/mutilform/index.jsx
@@ -1,6 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Radio, Select } from 'antd'
import { Form, Row, Col, Input, Radio, Select, Tooltip, Icon } from 'antd'
import './index.scss'
class MainSearch extends Component {
@@ -10,23 +10,34 @@
  }
  state = {
    requireArr: true
  }
  UNSAFE_componentWillMount () {
  onChange = (value, key) => {
    if (key === 'TryType' && value === 'N') {
      this.setState({requireArr: false})
    } else if (key === 'TryType' && value === 'Y') {
      this.setState({requireArr: true})
    }
  }
  getFields() {
    const { getFieldDecorator } = this.props.form
    const { requireArr } = this.state
    const fields = []
    this.props.formlist.forEach((item, index) => {
      if (!requireArr && item.key === 'array_name') return
      if (item.type === 'text') {
        fields.push(
          <Col span={24} key={index}>
            <Form.Item label={item.label}>
            <Form.Item label={item.tooltip ?
              <Tooltip placement="topLeft" title={item.tooltip}>
                <Icon type="question-circle" />
                {item.label}
              </Tooltip> : item.label
            }>
              {getFieldDecorator(item.key, {
                initialValue: item.initval,
                rules: [
@@ -67,7 +78,12 @@
      } else if (item.type === 'radio') {
        fields.push(
          <Col span={24} key={index}>
            <Form.Item label={item.label}>
            <Form.Item label={item.tooltip ?
              <Tooltip placement="topLeft" title={item.tooltip}>
                <Icon type="question-circle" />
                {item.label}
              </Tooltip> : item.label
            }>
              {getFieldDecorator(item.key, {
                initialValue: item.initval,
                rules: [
@@ -77,7 +93,7 @@
                  }
                ]
              })(
                <Radio.Group>
                <Radio.Group onChange={(e) => this.onChange(e.target.value, item.key)}>
                  {item.options.map(op => {
                    return <Radio key={op.value} value={op.value}>{op.text}</Radio>
                  })}
src/templates/zshare/modalform/datatable/index.jsx
@@ -293,6 +293,13 @@
        duration: 5
      })
      return
    } else if (this.state.data.length >= 20) {
      notification.warning({
        top: 92,
        message: '最多可添加20项!',
        duration: 5
      })
      return
    }
    let item = { key: Utils.getuuid(), $value: `${this.state.data.length + 1}` }
src/templates/zshare/modalform/datatable/index.scss
@@ -17,6 +17,9 @@
    .ant-form-item-control {
      line-height: 1;
    }
    > td {
      padding: 16px 10px;
    }
    .fileupload-form-container .ant-upload-list-picture-card .ant-upload-list-item {
      width: 70px;
      height: 70px;
src/templates/zshare/modalform/fieldtable/index.jsx
@@ -289,7 +289,7 @@
    return (
      <EditableContext.Provider value={this.props.form}>
        <div className="modal-card-data-table">
        <div className="modal-card-field-table">
          {this.state.data.length < 3 ? <Icon className="add-row" type="plus" onClick={this.handleAdd} /> : null}
          <Table
            components={components}
src/templates/zshare/modalform/fieldtable/index.scss
@@ -1,4 +1,4 @@
.modal-card-data-table {
.modal-card-field-table {
  .add-row {
    position: absolute;
    z-index: 1;
@@ -17,11 +17,14 @@
    .color-sketch-block {
      width: 200px;
      position: relative;
      top: 2px;
      top: 8px;
    }
    .ant-select {
      width: 80px;
    }
    > td {
      padding: 16px 10px;
    }
  }
  .operation-btn {
    span {
src/templates/zshare/modalform/index.jsx
@@ -23,7 +23,7 @@
  multiselect: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'fieldlength', 'entireLine', 'tooltip'],
  link: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'setAll', 'linkField', 'entireLine', 'tooltip'],
  fileupload: ['readonly', 'required', 'readin', 'fieldlength', 'maxfile', 'fileType', 'entireLine', 'tooltip'],
  switch: ['initval', 'openVal', 'closeVal', 'readonly', 'required', 'hidden', 'readin', 'entireLine', 'tooltip'],
  switch: ['initval', 'openVal', 'closeVal', 'readonly', 'hidden', 'readin', 'entireLine', 'tooltip'],
  date: ['initval', 'readonly', 'required', 'hidden', 'readin', 'entireLine', 'tooltip'],
  datemonth: ['initval', 'readonly', 'required', 'hidden', 'readin', 'entireLine', 'tooltip'],
  datetime: ['initval', 'readonly', 'required', 'hidden', 'readin', 'entireLine', 'tooltip'],
@@ -311,7 +311,15 @@
  }
  changeField = (data) => {
    this.setState({cFields: data})
    this.setState({
      cFields: data,
      formlist: this.state.formlist.map(form => {
        if (form.key === 'fields') {
          form.initVal = data
        }
        return form
      })
    })
  }
  handleSubmit = (e) => {
src/templates/zshare/modalform/index.scss
@@ -7,9 +7,6 @@
  .ant-form-item.text-area {
    >.ant-form-item-control-wrapper {
      width: 84%;
      .ant-table-tbody > tr > td {
        padding: 16px 10px;
      }
    }
    >.ant-form-item-label {
      width: 16%;
src/templates/zshare/modalform/modaleditable/index.scss
@@ -12,7 +12,7 @@
    padding: 10px 16px;
  }
  .ant-table-tbody > tr > td {
    padding: 0px 16px;
    padding: 5px 16px;
  }
  .editable-cell-value-wrap {
    cursor: pointer;
@@ -41,8 +41,6 @@
    cursor: pointer;
  }
  .ant-form-explain {
    .editable-row {
      font-size: 12px;
    }
    font-size: 12px;
  }
}
src/utils/utils.js
@@ -668,8 +668,11 @@
    if (item.type === 'link') {
      arrfield.push(item.linkField)
    } else if (item.type === 'select' && item.linkSubField && item.linkSubField.length > 0) {
    } else if ((item.type === 'select' || item.type === 'radio') && item.linkSubField && item.linkSubField.length > 0) {
      arrfield.push(...item.linkSubField)
    } else if (item.type === 'checkcard') {
      arrfield = item.fields.map(f => f.field)
      arrfield.push(item.valueField)
    }
    arrfield = Array.from(new Set(arrfield))
@@ -684,9 +687,9 @@
    arrfield = arrfield.join(',')
    if (item.orderBy) {
      sql = `select ${arrfield} from (select distinct ${arrfield},${item.orderBy} as orderfield from ${_datasource} ) a order by orderfield ${item.orderType}`
      sql = `select ${item.type === 'checkcard' ? 'top 20' : ''} ${arrfield} from (select distinct ${arrfield},${item.orderBy} as orderfield from ${_datasource} ) a order by orderfield ${item.orderType}`
    } else {
      sql = 'select distinct ' + arrfield + ' from ' + _datasource
      sql = `select ${item.type === 'checkcard' ? 'top 20' : ''} ${arrfield} from (select distinct ${arrfield} from ${_datasource})`
    }
    return {
@@ -1026,18 +1029,14 @@
    })
    // 需要声明的变量集
    // let _vars = ['tbid', 'ErrorCode', 'retmsg', 'BillCode', 'BVoucher', 'FIBVoucherDate', 'FiYear', 'UserName', 'FullName', 'ID', 'BID', 'LoginUID', 'SessionUid', 'UserID', 'Appkey']
    let _vars = ['tbid', 'errorcode', 'retmsg', 'billcode', 'bvoucher', 'fibvoucherdate', 'fiyear', 'username', 'fullname', 'modulardetailcode']
    // 主键字段
    let primaryKey = setting.primaryKey || 'id'
    // 系统变量声明与设置初始值
    let _sql = `/* 系统生成 */
        Declare @tbid nvarchar(50),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@BillCode nvarchar(50),@BVoucher nvarchar(50),@FIBVoucherDate nvarchar(50), @FiYear nvarchar(50), @UserName nvarchar(50),@FullName nvarchar(50),@ModularDetailCode nvarchar(50)
      `
    // sql语句
    let _sql = ''
    // let _initvars = ['ID', 'BID', 'LoginUID', 'SessionUid', 'UserID', 'Appkey'] // 已赋值字段集
    let _initvars = [] // 已赋值字段集
    let _initfields = []
    let _declarefields = []
@@ -1140,10 +1139,11 @@
    // 变量声明
    _declarefields = _declarefields.join(',')
    if (_declarefields) {
      _sql = `/* 系统生成 */
        Declare @tbid nvarchar(50),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@BillCode nvarchar(50),@BVoucher nvarchar(50),@FIBVoucherDate nvarchar(50), @FiYear nvarchar(50), @UserName nvarchar(50),@FullName nvarchar(50),@ModularDetailCode nvarchar(50),${_declarefields}
      `
      _declarefields = ',' + _declarefields
    }
    _sql = `/* 系统生成 */
        Declare @tbid nvarchar(50),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@BillCode nvarchar(50),@BVoucher nvarchar(50),@FIBVoucherDate nvarchar(50), @FiYear nvarchar(50), @UserName nvarchar(50),@FullName nvarchar(50),@ModularDetailCode nvarchar(50)${_declarefields}
      `
    // 变量赋值
    _initfields = _initfields.join(',')