king
2020-02-10 34f78e1203a839592ca6764f88f1632088e07d2a
2020-02-10
12个文件已修改
135 ■■■■ 已修改文件
src/tabviews/tableshare/actionList/index.jsx 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/tableshare/topSearch/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/formtabconfig/actionform/index.jsx 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/formtabconfig/dragelement/card.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/formtabconfig/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/formtabconfig/index.scss 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/formtabconfig/source.jsx 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/dragelement/index.jsx 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/index.jsx 49 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/tableshare/formconfig.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/ushare/editable/index.jsx 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/tableshare/actionList/index.jsx
@@ -272,6 +272,15 @@
                param[setting.primaryKey] = primaryId
              }
            } else if (btn.sql) {
              if (index !== 0) {
                formdata = formdata.map(_data => {
                  if (_data.readin && cell.hasOwnProperty(_data.key)) {
                    _data.value = cell[_data.key]
                  }
                  return _data
                })
              }
              param.ID = primaryId
              param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, formdata, param, cell, logcolumns)) // 数据源
              param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
@@ -318,7 +327,6 @@
      }
    } else if (btn.intertype === 'outer') {
      /** *********************调用外部接口************************* */
      if (2 > 1) return
      if (!btn.interface) { // 接口地址不存在时报错
        this.actionSettingError()
        _resolve()
src/tabviews/tableshare/topSearch/index.jsx
@@ -288,7 +288,7 @@
    if (this.props.searchlist.length >= 4) { // 添加搜索、重置按钮
      fields.push(
        <Col span={this.props.searchlist.length % 4 ? 6 : 24} style={{paddingLeft: '112px'}} key="actions">
        <Col span={this.props.searchlist.length % 4 ? 6 : 24} style={{paddingLeft: '112px', whiteSpace: 'nowrap'}} key="actions">
          <Button type="primary" htmlType="submit">
            {this.props.dict['main.search']}
          </Button>
@@ -299,7 +299,7 @@
      )
    } else {
      fields.push(
        <Col span={6} style={{ paddingTop: '4px' }} key="actions">
        <Col span={6} style={{ paddingTop: '4px', whiteSpace: 'nowrap' }} key="actions">
          <Button type="primary" htmlType="submit">
            {this.props.dict['main.search']}
          </Button>
src/templates/formtabconfig/actionform/index.jsx
@@ -58,9 +58,13 @@
  
  UNSAFE_componentWillMount () {
    const { card } = this.props
    let _intertype = ''
    let _options = null
    console.log(this.props.card.btnType)
    if (card.btnType === 'cancel') {
      _options = ['label', 'OpenType', 'icon', 'class', 'execSuccess']
    } else {
    this.props.formlist.forEach(form => {
      if (form.key === 'intertype') {
        _intertype = form.initVal
@@ -68,9 +72,10 @@
    })
    if (_intertype === 'outer') {
      _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'sysInterface', 'icon', 'class', 'execSuccess', 'execError', 'method']
        _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'sysInterface', 'icon', 'class', 'execSuccess', 'execError']
    } else {
      _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType']
      }
    }
    this.setState({
@@ -91,6 +96,11 @@
              text: this.props.dict['header.form.exec']
            }
          ]
          if (card.btnType === 'cancel') {
            item.readonly = 'true'
          }
        } else if (item.key === 'execSuccess' && card.btnType === 'cancel') {
          item.label = '返回后'
        }
        item.hidden = !_options.includes(item.key)
        return item
src/templates/formtabconfig/dragelement/card.jsx
@@ -133,10 +133,10 @@
        }
      </div>
      <Icon className="edit" title="编辑" type="edit" onClick={edit} />
      <Icon className="edit close" title="删除" type="close" onClick={del} />
      {type === 'action' && ['pop', 'prompt', 'exec'].includes(card.OpenType) && card.intertype === 'inner' && !card.innerFunc ?
      {type === 'action' && ['prompt', 'exec'].includes(card.OpenType) && card.intertype === 'inner' && !card.innerFunc ?
        <Icon className="edit profile" title="校验规则" type="profile" onClick={profile} /> : null
      }
      {card.btnType !== 'confirm' && card.btnType !== 'cancel' && <Icon className="edit close" title="删除" type="close" onClick={del} />}
    </div>
  )
}
src/templates/formtabconfig/index.jsx
@@ -81,7 +81,7 @@
      _config.isAdd = true
    } else {
      _config = config
      _config.action = Source.baseConfig.action
      // _config.action = Source.baseConfig.action
    }
    this.setState({
src/templates/formtabconfig/index.scss
@@ -301,11 +301,11 @@
            display: none;
          }
          .edit.close {
            left: 20px;
            left: 40px;
            color: #ff4d4f;
          }
          .edit.profile {
            left: 40px;
            left: 20px;
            color: purple;
          }
          button {
src/templates/formtabconfig/source.jsx
@@ -73,7 +73,6 @@
        intertype: 'inner',
        innerFunc: '',
        interface: '',
        method: 'POST',
        outerFunc: '',
        sql: '',
        sqlType: '',
@@ -82,7 +81,7 @@
        execSuccess: 'grid',
        execError: 'never',
        errorTime: 15,
        OpenType: 'pop',
        OpenType: 'exec',
        icon: 'plus',
        class: 'green',
        verify: null
@@ -93,7 +92,7 @@
        execSuccess: 'grid',
        execError: 'never',
        errorTime: 15,
        OpenType: 'pop',
        OpenType: 'exec',
        pageTemplate: '',
        url: '',
        icon: 'rollback',
src/templates/modalconfig/dragelement/index.jsx
@@ -1,5 +1,6 @@
import React, { useState } from 'react'
import { useDrop } from 'react-dnd'
import { is, fromJS } from 'immutable'
import update from 'immutability-helper'
import { Col } from 'antd'
import Utils from '@/utils/utils.js'
@@ -23,6 +24,10 @@
    } else {
      handleList(_cards, group)
    }
  }
  if (!is(fromJS(cards), fromJS(list))) {
    setCards(list)
  }
  const findCard = id => {
@@ -64,21 +69,9 @@
      let newcard = {}
      newcard.uuid = Utils.getuuid()
      newcard.label = 'label'
      newcard.field = ''
      newcard.initval = ''
      newcard.type = item.subType
      newcard.resourceType = '0'
      newcard.options = []
      newcard.dataSource = ''
      newcard.setAll = 'false'
      newcard.linkField = ''
      newcard.valueField = ''
      newcard.valueText = ''
      newcard.orderBy = ''
      newcard.orderType = 'asc'
      newcard.decimal = 0
      newcard.min = ''
      newcard.max = ''
      newcard.readonly = 'false'
      newcard.required = 'true'
      newcard.focus = true
src/templates/modalconfig/index.jsx
@@ -52,7 +52,6 @@
    modalformlist: null,   // 基本信息表单字段
    formlist: null,        // 表单编辑模态框,可编辑字段
    card: null,            // 编辑元素
    loading: false,        // 表单刷新时使用
    menuloading: false,    // 菜单保存中
    closeloading: false,   // 菜单保存中
    settingVisible: false, // 全局配置模态框
@@ -260,12 +259,8 @@
        _config.fields = list.filter(item => !item.origin)
  
        this.setState({
          loading: true,
          config: _config
        }, () => {
          this.setState({
            loading: false
          })
          this.handleForm(newcard)
        })
      } else {
@@ -285,12 +280,8 @@
        })
  
        this.setState({
          loading: true,
          config: _config
        }, () => {
          this.setState({
            loading: false
          })
          this.handleForm(newcard)
        })
      } else {
@@ -329,12 +320,7 @@
      })
      this.setState({
        loading: true,
        config: _config
      }, () => {
        this.setState({
          loading: false
        })
      })
    }
  }
@@ -404,12 +390,7 @@
      this.setState({
        config: _config,
        loading: true,
        visible: false
      }, () => {
        this.setState({
          loading: false
        })
      })
    })
  }
@@ -437,11 +418,6 @@
        _this.setState({
          config: _config,
          loading: true
        }, () => {
          _this.setState({
            loading: false
          })
        })
      },
      onCancel() {}
@@ -738,13 +714,12 @@
    }
    this.setState({
      tableVisible: false,
      loading: true,
      config: _config
    }, () => {
      this.setState({
        loading: false
      })
    notification.success({
      top: 92,
      message: '添加成功',
      duration: 2
    })
  }
@@ -884,12 +859,7 @@
        }
        _this.setState({
          config: _config,
          loading: true
        }, () => {
          _this.setState({
            loading: false
          })
          config: _config
        })
      },
      onCancel() {}
@@ -939,12 +909,7 @@
      this.setState({
        groupVisible: false,
        curgroup: '',
        loading: true,
        config: config
      }, () => {
        this.setState({
          loading: false
        })
      })
    })
  }
@@ -1023,7 +988,7 @@
                </div>
                <div className="ant-modal-body">
                  <div className="modal-form">
                    {!this.state.loading && config.groups.length > 0 &&
                    {config.groups.length > 0 &&
                      config.groups.map(group => {
                        return (
                          <div key={group.uuid}>
@@ -1045,7 +1010,7 @@
                        )
                      })
                    }
                    {!this.state.loading && config.groups.length === 0 ?
                    {config.groups.length === 0 ?
                      <DragElement
                        list={config.fields}
                        setting={config.setting}
src/templates/tableshare/formconfig.js
@@ -721,7 +721,7 @@
      type: 'text',
      key: 'field',
      label: Formdict['header.form.field'],
      initVal: card.field,
      initVal: card.field || '',
      required: true,
      readonly: false
    },
@@ -771,7 +771,7 @@
      type: 'text',
      key: 'initval',
      label: Formdict['header.form.initval'],
      initVal: card.initval,
      initVal: card.initval || '',
      required: false
    },
    {
src/templates/ushare/editable/index.jsx
@@ -44,12 +44,13 @@
    this.form = form
    const { children, dataIndex, record } = this.props
    const { editing } = this.state
    return editing ? (
      <Form.Item style={{ margin: 0 }}>
        {form.getFieldDecorator(dataIndex, {
          rules: [
            {
              required: true,
              required: dataIndex === 'Value' || dataIndex === 'Text',
              message: 'NOT NULL.',
            },
          ],
@@ -150,7 +151,8 @@
      columns: columns,
      dataSource: props.data,
      count: props.data.length,
      type: props.type
      type: props.type,
      linkSubFields: props.linkSubFields
    }
  }
@@ -187,8 +189,17 @@
  }
  resetColumn = (type, linkSubFields) => {
    let dataSource = JSON.parse(JSON.stringify(this.state.dataSource))
    let _width = '40%'
    let fields = []
    if (type === 'select' && linkSubFields.length > this.state.linkSubFields) {
      let addcol = linkSubFields[linkSubFields.length - 1]
      dataSource = dataSource.map(data => {
        data[addcol.field] = data.Text
        return data
      })
    }
    if (type === 'link') {
      _width = '27%'
@@ -242,6 +253,7 @@
    this.setState({
      columns: columns,
      dataSource: dataSource,
      type: type
    })
  }
src/utils/utils.js
@@ -611,7 +611,11 @@
        let _labels = item.fieldlabel.split(',') // 表单提示文字
        item.field.split(',').forEach((_field, index) => {
          _fieldValue.push(`${_field}='${_formFieldValue[_field]}'`)
          let _fval = `'${_formFieldValue[_field]}'`
          if (['id', 'bid', 'loginuid', 'sessionuid', 'userid', 'appkey'].includes(_field.toLowerCase())) {
            _fval = '@' + _field + '@'
          }
          _fieldValue.push(`${_field}=${_fval}`)
          _value.push(`${_labels[index] || ''}:${_formFieldValue[_field] || ''}`)
        })