king
2020-04-02 4614a540b53edbd83a0a9a483414cfdec0f5d321
2020-04-02
9个文件已修改
248 ■■■■■ 已修改文件
src/tabviews/commontable/index.jsx 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/normalTable/index.scss 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/formtabconfig/dragelement/index.jsx 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/formtabconfig/index.jsx 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/formtabconfig/index.scss 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/index.jsx 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/index.scss 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/modalform/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/commontable/index.jsx
@@ -217,13 +217,6 @@
        }
      })
      if (config.gridBtn && config.gridBtn.display && _operations.length > 0) {
        _columns.push({
          ...config.gridBtn,
          operations: _operations
        })
      }
      // 1、筛选字段集,2、过滤隐藏列及合并列中的字段uuid
      config.columns.forEach(col => {
        if (col.field) {
@@ -258,6 +251,13 @@
        }
      })
      if (config.gridBtn && config.gridBtn.display && _operations.length > 0) {
        _columns.push({
          ...config.gridBtn,
          operations: _operations
        })
      }
      let valid = true // 搜索条件必填验证
      config.search.forEach(field => {
        if (field.required === 'true' && !field.initval) {
src/tabviews/zshare/normalTable/index.scss
@@ -96,6 +96,26 @@
            max-width: 100%;
          }
        }
        .text {
          .ant-btn > .anticon + span {
            margin-left: 3px;
          }
          button {
            border: 0;
            background-color: transparent;
            color: #1890ff;
            box-shadow: none;
            padding: 0 5px;
          }
          button + button {
            margin-left: 10px;
          }
        }
        .button {
          button + button {
            margin-left: 10px;
          }
        }
      }
      .ant-table-tbody > tr > td.ant-table-column-has-actions {
        position: relative;
src/templates/comtableconfig/index.jsx
@@ -867,7 +867,7 @@
  editModalCancel = () => {
    const { config, card, modaltype } = this.state
    if (card.focus) {
    if (card && card.focus) {
      let _config = null
      if (modaltype === 'search') {
        let _search = config.search.filter(item => item.uuid !== card.uuid)
src/templates/formtabconfig/dragelement/index.jsx
@@ -51,6 +51,21 @@
    _card.iscopy = true
    _card.focus = true
    // 复制到剪切板
    let oInput = document.createElement('input')
    let val = JSON.parse(JSON.stringify(_card))
    val.copyType = 'form'
    delete val.originUuid
    oInput.value = window.btoa(window.encodeURIComponent(JSON.stringify(val)))
    document.body.appendChild(oInput)
    oInput.select()
    document.execCommand('Copy')
    oInput.className = 'oInput'
    oInput.style.display = 'none'
    document.body.removeChild(oInput)
    handleMenu(_card)
  }
  
src/templates/formtabconfig/index.jsx
@@ -15,6 +15,7 @@
import { queryTableSql } from '@/utils/option.js'
import ModalForm from '@/templates/zshare/modalform'
import PasteForm from '@/templates/zshare/pasteform'
import ActionForm from './actionform'
import SettingForm from './settingform'
import DragElement from './dragelement'
@@ -67,7 +68,8 @@
    editgroup: null,         // 当前编辑组
    groupVisible: false,     // 编辑组模态框
    optionLibs: null,        // 自定义下拉选项库
    activeKey: '0'           // 默认展开基本信息
    activeKey: '0',          // 默认展开基本信息
    pasteVisible: false      // 粘贴模态框
  }
  /**
@@ -1864,6 +1866,56 @@
    })
  }
  pasteSubmit = () => {
    let _config = JSON.parse(JSON.stringify(this.state.config))
    this.pasteFormRef.handleConfirm().then(res => {
      if (res.copyType === 'form') {
        let repeat = false
        _config.groups.forEach(group => {
          let item = group.sublist.filter(cell => cell.field === res.field)[0]
          if (item) {
            repeat = true
          }
          if (group.isDefault) {
            group.sublist.push(res)
          }
        })
        if (res.type === 'linkMain') {
          notification.warning({
            top: 92,
            message: '不支持此表单类型!',
            duration: 10
          })
          return
        } else if (repeat) {
          notification.warning({
            top: 92,
            message: '此表单字段已存在!',
            duration: 10
          })
          return
        }
        this.setState({
          config: _config,
          pasteVisible: null
        }, () => {
          this.handleSearch(res)
        })
      } else {
        notification.warning({
          top: 92,
          message: '配置信息格式错误!',
          duration: 10
        })
      }
    })
  }
  render () {
    const { config, modaltype, activeKey } = this.state
    let _length = config.groups.length
@@ -1986,6 +2038,7 @@
              </div>
            } style={{ width: '100%' }}>
              <Icon type="setting" onClick={this.changeSetting} />
              <Icon type="snippets" title={this.state.dict['header.form.paste']} onClick={() => {this.setState({pasteVisible: true})}} />
              <Tooltip placement="bottomLeft" overlayClassName="middle" title="在左侧工具栏《搜索》中,选择对应搜索框拖至此处添加;或点击按钮《添加搜索条件》批量添加,选择批量添加时,需提前选择使用表。">
                <Icon type="question-circle" />
              </Tooltip>
@@ -2232,6 +2285,21 @@
            wrappedComponentRef={(inst) => this.groupRef = inst}
          />
        </Modal>
        {/* 按钮配置信息粘贴复制 */}
        <Modal
          title={this.state.dict['header.form.paste']}
          visible={this.state.pasteVisible}
          width={600}
          maskClosable={false}
          onOk={this.pasteSubmit}
          onCancel={() => {this.setState({pasteVisible: null})}}
          destroyOnClose
        >
          <PasteForm
            dict={this.state.dict}
            wrappedComponentRef={(inst) => this.pasteFormRef = inst}
          />
        </Modal>
        {this.state.loading && <Spin size="large" />}
      </div>
    )
src/templates/formtabconfig/index.scss
@@ -164,6 +164,25 @@
        left: 5px;
        top: 20px;
      }
      > .anticon-setting {
        position: absolute;
        font-size: 18px;
        right: 7px;
        top: 10px;
        padding: 10px;
        z-index: 1;
      }
      > .anticon-snippets {
        position: absolute;
        font-size: 14px;
        left: 22px;
        top: 13px;
        padding: 10px;
        z-index: 1;
      }
      >.ant-collapse {
        border-radius: 0;
        border: 0;
@@ -437,14 +456,6 @@
        .ant-tabs-nav-container-scrolling {
          margin-right: 50px;
        }
      }
      > .anticon-setting {
        position: absolute;
        font-size: 18px;
        right: 7px;
        top: 10px;
        padding: 10px;
        z-index: 1;
      }
    }
    .anticon-question-circle {
src/templates/modalconfig/index.jsx
@@ -14,6 +14,7 @@
import { queryTableSql } from '@/utils/option.js'
import ModalForm from '@/templates/zshare/modalform'
import PasteForm from '@/templates/zshare/pasteform'
import DragElement from './dragelement'
import SourceElement from './dragelement/source'
import SettingForm from './settingform'
@@ -65,7 +66,8 @@
    groupVisible: false,   // 全局配置模态框
    curgroup: null,        // 当前组,新建或编辑
    optionLibs: null,      // 自定义下拉选项库
    sources: null          // 表单类型
    sources: null,         // 表单类型
    pasteVisible: null     // 表单粘贴
  }
  /**
@@ -393,6 +395,21 @@
      card.originUuid = card.uuid
      card.uuid = Utils.getuuid()
      card.focus = true
      // 复制到剪切板
      let oInput = document.createElement('input')
      let val = JSON.parse(JSON.stringify(card))
      val.copyType = 'form'
      delete val.originUuid
      oInput.value = window.btoa(window.encodeURIComponent(JSON.stringify(val)))
      document.body.appendChild(oInput)
      oInput.select()
      document.execCommand('Copy')
      oInput.className = 'oInput'
      oInput.style.display = 'none'
      document.body.removeChild(oInput)
    }
    const { config } = this.state
@@ -1137,6 +1154,63 @@
    }
  }
  pasteSubmit = () => {
    let _config = JSON.parse(JSON.stringify(this.state.config))
    this.pasteFormRef.handleConfirm().then(res => {
      if (res.copyType === 'form') {
        let repeat = false
        if (_config.groups.length > 0) {
          _config.groups.forEach(group => {
            let item = group.sublist.filter(cell => cell.field === res.field)[0]
            if (item) {
              repeat = true
            }
            if (group.default) {
              group.sublist.push(res)
            }
          })
        } else {
          let item = _config.fields.filter(cell => cell.field === res.field)[0]
          if (item) {
            repeat = true
          }
          _config.fields.push(res)
        }
        if (!this.props.editTab && res.type === 'linkMain') {
          notification.warning({
            top: 92,
            message: '不支持此表单类型!',
            duration: 10
          })
          return
        } else if (repeat) {
          notification.warning({
            top: 92,
            message: '此表单字段已存在!',
            duration: 10
          })
          return
        }
        this.setState({
          config: _config,
          pasteVisible: null
        }, () => {
          this.handleForm(res, 'edit')
        })
      } else {
        notification.warning({
          top: 92,
          message: '配置信息格式错误!',
          duration: 10
        })
      }
    })
  }
  render () {
    const { config, source } = this.state
@@ -1202,6 +1276,7 @@
              </div>
            } style={{ width: '100%' }}>
              <Icon type="setting" onClick={this.changeSetting} />
              <Icon type="snippets" title={this.state.dict['header.form.paste']} onClick={() => {this.setState({pasteVisible: true})}} />
              <div className="ant-modal-content" style={{width: config.setting.width + '%'}}>
                <button type="button" className="ant-modal-close">
                  <span className="ant-modal-close-x"><Icon type="close"/></span>
@@ -1344,6 +1419,21 @@
            wrappedComponentRef={(inst) => this.groupRef = inst}
          />
        </Modal>
        {/* 按钮配置信息粘贴复制 */}
        <Modal
          title={this.state.dict['header.form.paste']}
          visible={this.state.pasteVisible}
          width={600}
          maskClosable={false}
          onOk={this.pasteSubmit}
          onCancel={() => {this.setState({pasteVisible: null})}}
          destroyOnClose
        >
          <PasteForm
            dict={this.state.dict}
            wrappedComponentRef={(inst) => this.pasteFormRef = inst}
          />
        </Modal>
      </div>
    )
  }
src/templates/modalconfig/index.scss
@@ -288,6 +288,12 @@
        right: 15px;
        top: 10px;
      }
      > .anticon-snippets {
        position: absolute;
        font-size: 16px;
        right: 15px;
        top: 40px;
      }
    }
  }
  .setting:hover {
src/templates/zshare/modalform/index.jsx
@@ -267,7 +267,7 @@
    const { openType } = this.state
    let value = e.target.value
    if (key === 'resourceType') {
      let _options = ['label', 'field', 'initval', 'type', 'resourceType', 'readonly', 'required', 'hidden', 'readin', 'blacklist']
      let _options = ['label', 'field', 'initval', 'type', 'resourceType', 'readonly', 'required', 'hidden', 'readin', 'blacklist', 'supField']
      if (value === '0') {
        _options = [..._options, 'options', 'quick']
      } else if (value === '1') {