king
2020-01-03 862b6cf69dc925a6138a7ebf79b782a5d7791202
2020-01-03
24个文件已修改
2个文件已添加
689 ■■■■■ 已修改文件
src/api/index.js 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/sidemenu/editthdmenu/index.jsx 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/sidemenu/editthdmenu/preview/index.jsx 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/sidemenu/menuelement/card.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/locales/zh-CN/comtable.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/setupProxy.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/commontable/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/commontable/mainTable/index.scss 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/subtable/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/subtabtable/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/tableshare/actionList/index.jsx 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/tableshare/fileupload/index.jsx 140 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/tableshare/fileupload/index.scss 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/tableshare/mutilform/index.jsx 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/actionform/index.jsx 56 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/index.jsx 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/settingform/index.jsx 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/dragelement/card.jsx 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/dragelement/index.jsx 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/index.jsx 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/modalform/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/source.jsx 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/subtableconfig/actionform/index.jsx 83 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/subtableconfig/index.jsx 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/option.js 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils.js 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/index.js
@@ -12,6 +12,8 @@
  config.method = 'post'
  if (config.url.includes('LoginAndRedirect') || config.url.includes('getjsonresult')) {
    config.data = qs.stringify(config.data)
  } else if (config.url.includes('Upload')) {
    config.headers = { 'Content-Type': 'multipart/form-data' }
  } else {
    config.headers.token = sessionStorage.getItem('TOKEN') || ''
    config.data = JSON.stringify(config.data)
@@ -251,6 +253,20 @@
  }
  /**
   * @description 文件上传
   */
  getFileUpload (file) {
    const param = new FormData()
    param.append('file', file)
    param.append('RootPath', 'Content/images/upload/')
    return axios({
      url: '/zh-CN/Home/Upload',
      data: param
    })
  }
  /**
   * @description 获取页面配置信息
   * @param {String} MenuNo 页面菜单参数
   */
src/components/sidemenu/editthdmenu/index.jsx
@@ -395,6 +395,7 @@
            type: template.type,
            PageParam: {OpenType: 'newtab', Template: template.type},
            LongParam: template.baseconfig,
            isSubtable: template.isSubtable, // 是否为主子表
            ParentID: this.props.supMenu.MenuID
          }
        })
@@ -551,9 +552,9 @@
            {this.state.tabview === 'template' && <Tabs defaultActiveKey="1">
              <TabPane tab="系统模板" key="1">
                <Row>
                  {this.state.sysTemplates.map(template => {
                  {this.state.sysTemplates.map((template, index) => {
                    return (
                      <Col key={template.type} span={8}>
                      <Col key={`${index}`} span={8}>
                        <Card
                          title={template.title}>
                          <img onClick={() => {this.previewPicture(template)}} src={template.url} alt=""/>
src/components/sidemenu/editthdmenu/preview/index.jsx
@@ -43,12 +43,18 @@
  }
  render () {
    const { template } = this.props
    let type = 'sys'
    if (!template || !template.isSystem) {
      type = 'user'
    }
    return (
      <div>
        {this.state.url &&
        {this.state.url && this.props.template &&
          <div className={'preview-box ' + (this.state.show ? 'active' : '')} onClick={this.close}>
            <Button shape="circle" icon="close"></Button>
            <Button type="primary" onClick={() => {this.props.confirm(this.props.template)}}>使用模板</Button>
            <Button type="primary" onClick={() => {this.props.confirm(this.props.template, type)}}>使用模板</Button>
            {this.state.url && <img src={this.state.url} alt=""/>}
          </div>
        }
src/components/sidemenu/menuelement/card.jsx
@@ -37,7 +37,7 @@
        {icon && <Icon type={icon} />}
        {text}
      </div>
      {menutype !== 'iframe' ? <Icon className="edit" type="edit" onClick={edit} /> : null}
      {menutype === 'CommonTable' ? <Icon className="edit" type="edit" onClick={edit} /> : null}
      <Icon className="close" type="close" onClick={close} />
    </div>
  )
src/locales/zh-CN/comtable.js
@@ -86,8 +86,8 @@
  'header.form.picture': '图片',
  'header.form.number': '数字',
  'header.form.colspan': '合并列',
  'header.form.select': '选择',
  'header.form.multiselect': '多选',
  'header.form.select': '下拉选择',
  'header.form.multiselect': '下拉多选',
  'header.form.link': '关联菜单',
  'header.form.dateday': '日期(天)',
  'header.form.datetime': '日期(秒)',
src/setupProxy.js
@@ -21,6 +21,15 @@
    }
  }))
  app.use(proxy('/Upload', { // 登录接口
    target: `http://qingqiumarket.cn/${service}/zh-CN/Home/Upload`,
    secure: false,
    changeOrigin: true,
    pathRewrite: {
    '^/Upload': '/'
    }
  }))
  app.use(proxy('/local', { 
    target: 'http://127.0.0.1:8888',
    secure: false,
src/tabviews/commontable/index.jsx
@@ -211,9 +211,13 @@
        if (item.type === 'link') {
          arrfield = arrfield + ',' + item.linkField
        }
        let _sql = Utils.getSelectQuerySql(item)
        _sql = Utils.formatOptions(_sql)
        let param = {
          func: 'sPC_Get_SelectedList',
          LText: item.dataSourceSql,
          LText: _sql,
          obj_name: 'data',
          arr_field: arrfield
        }
src/tabviews/commontable/mainTable/index.scss
@@ -41,6 +41,15 @@
      .ant-table-tbody > tr > td:last-child {
        border-right: 0;
      }
      .ant-table-tbody > tr > td {
        vertical-align: top;
        .content {
          position: relative;
          z-index: 1;
          word-wrap: break-word;
          word-break: break-word;
        }
      }
      .ant-table-tbody > tr > td.ant-table-column-has-actions {
        position: relative;
        .background {
src/tabviews/subtable/index.jsx
@@ -194,9 +194,13 @@
        if (item.type === 'link') {
          arrfield = arrfield + ',' + item.linkField
        }
        let _sql = Utils.getSelectQuerySql(item)
        _sql = Utils.formatOptions(_sql)
        let param = {
          func: 'sPC_Get_SelectedList',
          LText: item.dataSourceSql,
          LText: _sql,
          obj_name: 'data',
          arr_field: arrfield
        }
src/tabviews/subtabtable/index.jsx
@@ -176,9 +176,13 @@
        if (item.type === 'link') {
          arrfield = arrfield + ',' + item.linkField
        }
        let _sql = Utils.getSelectQuerySql(item)
        _sql = Utils.formatOptions(_sql)
        let param = {
          func: 'sPC_Get_SelectedList',
          LText: item.dataSourceSql,
          LText: _sql,
          obj_name: 'data',
          arr_field: arrfield
        }
src/tabviews/tableshare/actionList/index.jsx
@@ -654,14 +654,14 @@
    if (execAction.groups.length > 0) {
      execAction.groups.forEach(group => {
        group.sublist.forEach(field => {
          if ((field.type === 'select' || field.type === 'link') && field.resourceType === '1') {
          if ((field.type === 'select' || field.type === 'link') && field.resourceType === '1' && field.dataSource) {
            subfields.push(field)
          }
        })
      })
    } else {
      execAction.fields.forEach(field => {
        if ((field.type === 'select' || field.type === 'link') && field.resourceType === '1') {
        if ((field.type === 'select' || field.type === 'link') && field.resourceType === '1' && field.dataSource) {
          subfields.push(field)
        }
      })
@@ -682,9 +682,12 @@
        arrfield = arrfield + ',' + item.linkField
      }
      let _sql = Utils.getSelectQuerySql(item)
      console.log(_sql)
      _sql = Utils.formatOptions(_sql)
      let param = {
        func: 'sPC_Get_SelectedList',
        LText: item.dataSourceSql,
        LText: _sql,
        obj_name: 'data',
        arr_field: arrfield
      }
@@ -752,11 +755,12 @@
      this.setState({
        confirmLoading: true
      })
      this.execSubmit(this.state.execAction, this.state.tabledata, () => {
        this.setState({
          confirmLoading: false
        })
      }, res)
      console.log(res)
      // this.execSubmit(this.state.execAction, this.state.tabledata, () => {
      //   this.setState({
      //     confirmLoading: false
      //   })
      // }, res)
    }, () => {})
  }
src/tabviews/tableshare/fileupload/index.jsx
New file
@@ -0,0 +1,140 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Upload, message, Button, Icon, Progress } from 'antd'
import Api from '@/api'
import './index.scss'
let service = window.GLOB.service ? (/\/$/.test(window.GLOB.service) ? window.GLOB.service : window.GLOB.service + '/') : ''
let Url = '/Upload'
if (process.env.NODE_ENV === 'production') {
  Url = document.location.origin + '/' + service + 'zh-CN/Home/Upload'
}
class FileUpload extends Component {
  static propTpyes = {
    value: PropTypes.array    // 按钮信息、表单列表
  }
  state = {
    baseUrl: Url,
    percent: 0,
    showprogress: false
  }
  init = async () => {
    try {
      const OSSData = await this.mockGetOSSData()
      this.setState({
        OSSData
      })
    } catch (error) {
      message.error(error)
    }
  }
  onChange = ({ fileList }) => {
    const { onChange } = this.props
    if (onChange) {
      onChange([...fileList])
    }
  }
  onRemove = file => {
    const { value, onChange } = this.props
    const files = value.filter(v => v.url !== file.url)
    if (onChange) {
      onChange(files)
    }
  }
  getExtraData = file => {
    const param = new FormData()
    param.append('file', file)
    param.append('RootPath', 'Content/images/upload/')
    return param
  }
  shardupload = (file, shardSize, shardCount, i) => {
    let start = i * shardSize
    let end = Math.min(file.size, start + shardSize)
    let form = new FormData()
    form.append('data', file.slice(start, end)) //slice方法用于切出文件的一部分
    form.append('name', file.name)
    form.append('total', shardCount)
    form.append('index', i + 1)
    if (i < shardCount) {
      i++
      Api.getFileUpload(file).then(res => {
        console.log(res)
        if (res) {
          this.setState({
            percent: Math.floor(100 * (i / shardCount))
          })
          this.shardupload(file, shardSize, shardCount, i)
        }
      })
    } else {
      this.setState({
        percent: 100
      }, () => {
        setTimeout(() => {
          this.setState({
            showprogress: false,
            percent: 0
          })
        }, 200)
      })
    }
  }
  beforeUpload = (file, fileList) => {
    let shardSize = 200 * 1024 * 1024
    console.log(file)
    if (file.size > shardSize) {
      this.setState({
        showprogress: true,
        percent: 0
      })
      let shardCount = Math.ceil(file.size / shardSize)
      this.shardupload(file, shardSize, shardCount, 0)
      return false
    } else {
      return true
    }
  }
  render() {
    const { value } = this.props
    const { showprogress, percent, baseUrl } = this.state
    const props = {
      name: 'file',
      disabled: showprogress,
      fileList: value,
      action: baseUrl,
      method: 'post',
      onChange: this.onChange,
      onRemove: this.onRemove,
      data: this.getExtraData,
      beforeUpload: this.beforeUpload,
    }
    return (
      <Upload {...props}>
        <Button>
          <Icon type="upload" /> Click to Upload
        </Button>
        {showprogress ? <Progress percent={percent} size="small" /> : null}
      </Upload>
    )
  }
}
export default FileUpload
src/tabviews/tableshare/fileupload/index.scss
New file
@@ -0,0 +1,5 @@
.main-form-field .ant-progress-small.ant-progress-line {
  position: absolute;
  bottom: -20px;
  left: 0px;
}
src/tabviews/tableshare/mutilform/index.jsx
@@ -3,6 +3,7 @@
import { Form, Row, Col, Input, InputNumber, Select, DatePicker, notification } from 'antd'
import moment from 'moment'
import Utils from '@/utils/utils.js'
import FileUpload from '../fileupload'
import './index.scss'
const {MonthPicker} = DatePicker
@@ -372,6 +373,42 @@
            </Form.Item>
          </Col>
        )
      } else if (item.type === 'fileupload') {
        // let filelist = this.props.data ? this.props.data[item.field] : item.initval
        let filelist = 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png,https://img.alicdn.com/tfs/TB1Ly5oS3HqK1RjSZFPXXcwapXa-238-54.png'
        if (filelist) {
          try {
            filelist = filelist.split(',').map((url, index) => {
              return {
                uid: `${index}`,
                name: url.slice(url.lastIndexOf('/') + 1),
                status: 'done',
                url: url,
                origin: true
              }
            })
          } catch {
            filelist = []
          }
        }
        fields.push(
          <Col span={24 / cols} key={index}>
            <Form.Item label={item.label}>
              {getFieldDecorator(item.field, {
                initialValue: filelist,
                rules: [
                  {
                    required: item.required === 'true',
                    message: this.props.dict['form.required.select'] + item.label + '!'
                  }
                ]
              })(
                <FileUpload />
              )}
            </Form.Item>
          </Col>
        )
      }
    })
    
@@ -432,6 +469,25 @@
                key: key,
                value: values[key] ? values[key].join(',') : ''
              })
            } else if (this.state.datatype[key] === 'fileupload') {
              let vals = []
              if (values[key].length > 0) {
                values[key].forEach(_val => {
                  if (_val.origin && _val.url) {
                    vals.push(_val.url)
                  } else if (!_val.origin && _val.status === 'done' && _val.response) {
                    vals.push(Utils.getrealurl(_val.response))
                  }
                })
              }
              search.push({
                type: this.state.datatype[key],
                readonly: this.state.readtype[key],
                key: key,
                value: vals.join(',')
              })
            } else {
              search.push({
                type: this.state.datatype[key],
src/templates/comtableconfig/actionform/index.jsx
@@ -1,6 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Select, Icon, Radio, notification, Tooltip, InputNumber, Button, Modal, message } from 'antd'
import { Form, Row, Col, Input, Select, Icon, Radio, notification, Tooltip, InputNumber } from 'antd'
import { btnIcons, btnClasses } from '@/utils/option.js'
import Utils from '@/utils/utils.js'
import './index.scss'
@@ -18,7 +18,6 @@
  state = {
    formlist: null,  // 表单信息
    openType: null,  // 打开方式
    errorType: 'E',  // 报错类型
    interType: null, // 接口类型:内部、外部
    position: null,  // 按钮位置
    reqOptionSgl: [{
@@ -72,7 +71,6 @@
    let _opentype = ''
    let _intertype = ''
    let _position = ''
    let _errorType = ''
    let _tabType = ''
    let _linkTab = ''
    let _options = null
@@ -84,8 +82,6 @@
        _intertype = form.initVal
      } else if (form.key === 'position') {
        _position = form.initVal
      } else if (form.key === 'errorTip') {
        _errorType = form.initVal
      } else if (form.key === 'tabType') {
        _tabType = form.initVal
      } else if (form.key === 'linkTab') {
@@ -112,16 +108,15 @@
      }
    } else {
      if (_intertype === 'outer') {
        _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'errorTip', 'errorTime', 'method']
        _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'method']
      } else {
        _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'errorTip', 'errorTime', 'sql', 'sqlType']
        _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType']
      }
    }
    this.setState({
      openType: _opentype,
      interType: _intertype,
      position: _position,
      errorType: _errorType,
      formlist: this.props.formlist.map(item => {
        if (item.key === 'class') {
          item.options = btnClasses
@@ -192,9 +187,9 @@
        }
      } else {
        if (this.state.interType === 'inner') {
          _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'errorTip', 'errorTime', 'sql', 'sqlType']
          _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType']
        } else {
          _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'errorTip', 'errorTime', 'interface', 'outerFunc', 'callbackFunc', 'method']
          _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'interface', 'outerFunc', 'callbackFunc', 'method']
        }
      }
      this.setState({
@@ -271,10 +266,6 @@
          })
        })
      })
    } else if (key === 'errorTip') {
      this.setState({
        errorType: value
      })
    } else if (key === 'tabType') {
      let _tabs = this.props.tabs.filter(tab => tab.type === value)
@@ -315,9 +306,6 @@
      } else {
        _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'interface', 'outerFunc', 'callbackFunc', 'method']
      }
      if (['pop', 'prompt', 'exec'].includes(this.state.openType)) {
        _options.push('errorTip', 'errorTime')
      }
      this.setState({
        interType: value,
        formlist: this.state.formlist.map(item => {
@@ -325,37 +313,6 @@
          return item
        })
      })
    }
  }
  showError = () => {
    const { errorType } = this.state
    if (errorType === 'S') {
      notification.success({
        top: 92,
        message: '执行成功!',
        duration: 2
      })
    } else if (errorType === 'F') {
      notification.error({
        className: 'notification-custom-error',
        top: 92,
        message: '执行失败!',
        duration: 15
      })
    } else if (errorType === 'N') {
      notification.error({
        top: 92,
        message: '执行失败!',
        duration: 15
      })
    } else if (errorType === 'E') {
      Modal.error({
        title: '执行失败!'
      })
    } else if (errorType === 'NM') {
      message.error('执行失败!')
    }
  }
@@ -417,7 +374,7 @@
        )
      } else if (item.type === 'select') { // 下拉搜索
        fields.push(
          <Col span={12} key={index} className={item.key === 'errorTip' ? 'with-button' : ''}>
          <Col span={12} key={index}>
            <Form.Item label={item.tooltip ?
              <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}>
                <Icon type="question-circle" />
@@ -447,7 +404,6 @@
                </Select>
              )}
            </Form.Item>
            {item.key === 'errorTip' ? <Button onClick={this.showError}>查看</Button> : null}
          </Col>
        )
      } else if (item.type === 'radio') {
src/templates/comtableconfig/index.jsx
@@ -85,6 +85,9 @@
    if (!_LongParam) {
      _config = JSON.parse(JSON.stringify(Source.baseConfig))
      if (!menu.isSubtable) { // 不是选择主子表时,隐藏标签页
        _config.tabs = []
      }
    } else {
      _config = _LongParam
    }
@@ -629,7 +632,7 @@
          type: 'radio',
          key: 'intertype',
          label: this.state.dict['header.form.intertype'],
          initVal: card.intertype,
          initVal: card.intertype || 'inner',
          required: true,
          options: [{
            value: 'inner',
@@ -749,42 +752,6 @@
            value: 'view',
            text: this.state.dict['header.form.refresh.view']
          }]
        },
        {
          type: 'select',
          key: 'errorTip',
          label: this.state.dict['header.form.messageTip'],
          initVal: card.errorTip || 'E',
          tooltip: '该选项为提示效果展示,选择提示类型后,可点击按钮查看,自定义函数中设置 ErrCode 为(S、-1、E、N、F、NM)时,会以对应方式展示提示信息。',
          tooltipClass: 'middle',
          required: false,
          options: [{
            value: 'S',
            text: 'S(提醒框-0)'
          }, {
            value: '-1',
            text: '-1(不提示)'
          }, {
            value: 'N',
            text: 'N(提醒框-1)'
          }, {
            value: 'F',
            text: 'F(提醒框-2)'
          }, {
            value: 'E',
            text: 'E(确认框)'
          }, {
            value: 'NM',
            text: 'NM(顶部提示)'
          }]
        },
        {
          type: 'number',
          key: 'errorTime',
          label: this.state.dict['header.form.errorTime'],
          initVal: card.errorTime || 15,
          tooltip: '执行结果中设置 ErrCode 为 N 或 F 时有效',
          required: false
        },
        {
          type: 'select',
@@ -1175,26 +1142,6 @@
    if (this.state.formtemp !== 'gridbtn') {
      this.formRef.handleConfirm().then(res => {
        let isupdate = false
        if (res.type === 'search') {
          if ((res.values.type === 'multiselect' || res.values.type === 'select' || res.values.type === 'link') && res.values.resourceType === '1') {
            let _datasource = res.values.dataSource
            if (/\s/.test(_datasource)) {
              _datasource = '(' + _datasource + ') tb'
            }
            let sql = 'select ' + res.values.valueField + ',' + res.values.valueText + ' from ' + _datasource
            if (res.values.type === 'link') {
              sql = 'select ' + res.values.valueField + ',' + res.values.valueText + ',' + res.values.linkField + ' from ' + _datasource
            }
            if (res.values.orderBy) {
              sql = sql + ' order by ' + res.values.orderBy + ' ' + res.values.orderType
            }
            res.values.dataSourceSql = Utils.formatOptions(sql)
          }
        }
        if (res.type === 'action' && card.originCard && res.values.OpenType === 'pop') {
          Api.getSystemConfig({
src/templates/comtableconfig/settingform/index.jsx
@@ -79,6 +79,15 @@
    })
  }
  selectChange = (val) => {
    let _order = this.props.form.getFieldValue('order')
    if (_order) return
    this.props.form.setFieldsValue({
      order: `${val} desc`,
    })
  }
  render() {
    const { data, dict, menu, usefulFields } = this.props
    const { getFieldDecorator } = this.props.form
@@ -233,6 +242,7 @@
              })(
                <Select
                  getPopupContainer={() => document.getElementById('commontable-setting-form')}
                  onChange={this.selectChange}
                >
                  <Select.Option key='unset' value="">不设置</Select.Option>
                  {columns.length === 0 ?
src/templates/modalconfig/dragelement/card.jsx
@@ -1,6 +1,6 @@
import React from 'react'
import { useDrag, useDrop } from 'react-dnd'
import { Icon, Select, DatePicker, Input, InputNumber } from 'antd'
import { Icon, Select, DatePicker, Input, InputNumber, Button } from 'antd'
import moment from 'moment'
import ItemTypes from './itemtypes'
import './index.scss'
@@ -82,6 +82,11 @@
              <DatePicker showTime defaultValue={card.initval ? moment().subtract(card.initval, 'days') : null} />
              // <DatePicker showTime defaultValue={card.initval ? moment(card.initval, 'YYYY-MM-DD HH:mm:ss') : null} />
            }
            {card.type === 'fileupload' &&
              <Button>
                <Icon type="upload" /> 点击上传
              </Button>
            }
            <div className="input-mask"></div>
          </div>
        </div>}
src/templates/modalconfig/dragelement/index.jsx
@@ -87,12 +87,12 @@
      const { index: overIndex } = findCard(`${targetId}`)
      let targetIndex = overIndex
      if (!target) {
        targetIndex++
      }
      if (targetIndex < 0) {
        targetIndex = 0
      }
      // if (!target) {
      targetIndex++
      // }
      // if (targetIndex < 0) {
      //   targetIndex = 0
      // }
      const _cards = update(cards, { $splice: [[targetIndex, 0, newcard]] })
      setCards(_cards)
src/templates/modalconfig/index.jsx
@@ -356,6 +356,9 @@
            value: 'link',
            text: this.state.dict['header.form.link']
          }, {
            value: 'fileupload',
            text: '文件上传'
          }, {
            value: 'date',
            text: this.state.dict['header.form.dateday']
          }, {
@@ -507,24 +510,6 @@
  handleSubmit = () => {
    this.formRef.handleConfirm().then(res => {
      let _config = JSON.parse(JSON.stringify(this.state.config))
      if ((res.type === 'multiselect' || res.type === 'select' || res.type === 'link') && res.resourceType === '1') {
        let _datasource = res.dataSource
        if (/\s/.test(_datasource)) {
          _datasource = '(' + _datasource + ') tb'
        }
        let sql = 'select ' + res.valueField + ',' + res.valueText + ' from ' + _datasource
        if (res.type === 'link') {
          sql = 'select ' + res.valueField + ',' + res.valueText + ',' + res.linkField + ' from ' + _datasource
        }
        if (res.orderBy) {
          sql = sql + ' order by ' + res.orderBy + ' ' + res.orderType
        }
        res.dataSourceSql = Utils.formatOptions(sql)
      }
      if (_config.groups.length > 0) {
        _config.groups.forEach(group => {
@@ -805,7 +790,7 @@
          orderBy: '',
          orderType: 'asc',
          readonly: 'false',
          required: 'false'
          required: 'true'
        }
      })
      _config.groups[_config.groups.length - 1].sublist = [..._config.groups[_config.groups.length - 1].sublist, ..._additems]
src/templates/modalconfig/modalform/index.jsx
@@ -33,6 +33,8 @@
      _options = [..._options, 'resourceType', 'dataSource', 'valueField', 'valueText', 'orderBy', 'orderType']
    } else if (type === 'number') {
      _options = [..._options, 'decimal']
    } else if (type === 'fileupload') {
      _options = ['label', 'field', 'type', 'readonly', 'required']
    }
    if (type === 'select' || type === 'link') {
@@ -83,6 +85,8 @@
        _options = [..._options, 'resourceType', 'dataSource', 'valueField', 'valueText', 'orderBy', 'orderType']
      } else if (value === 'number') {
        _options = [..._options, 'decimal']
      } else if (value === 'fileupload') {
        _options = ['label', 'field', 'type', 'readonly', 'required']
      }
      if (value === 'select' || value === 'link') {
@@ -116,7 +120,7 @@
      }, () => {
        this.setState({
          formlist: this.state.formlist.map(form => {
            if (form.key === 'initval') {
            if (form.key === 'initval' && value !== 'fileupload') {
              form.hidden = false
            }
            return form
src/templates/modalconfig/source.jsx
@@ -98,6 +98,12 @@
    },
    {
      type: 'form',
      label: '文件上传',
      subType: 'fileupload',
      url: ''
    },
    {
      type: 'form',
      label: '时间框(天)',
      subType: 'date',
      url: ''
src/templates/subtableconfig/actionform/index.jsx
@@ -1,6 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Select, Icon, Radio, notification, Tooltip, InputNumber, Button, Modal, message } from 'antd'
import { Form, Row, Col, Input, Select, Icon, Radio, notification, Tooltip, InputNumber } from 'antd'
import { btnIcons, btnClasses } from '@/utils/option.js'
import './index.scss'
@@ -17,7 +17,6 @@
  state = {
    formlist: null,
    openType: null,
    errorType: 'E',
    interType: null,
    position: null,
    reqOptionSgl: [{
@@ -64,7 +63,6 @@
    let _opentype = ''
    let _intertype = ''
    let _position = ''
    let _errorType = ''
    let _tabType = ''
    let _linkTab = ''
    let _options = null
@@ -76,8 +74,6 @@
        _intertype = form.initVal
      } else if (form.key === 'position') {
        _position = form.initVal
      } else if (form.key === 'errorTip') {
        _errorType = form.initVal
      } else if (form.key === 'tabType') {
        _tabType = form.initVal
      } else if (form.key === 'linkTab') {
@@ -98,16 +94,15 @@
      }
    } else {
      if (_intertype === 'outer') {
        _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'errorTip', 'errorTime', 'method']
        _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'method']
      } else {
        _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'errorTip', 'errorTime', 'sql', 'sqlType']
        _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType']
      }
    }
    this.setState({
      openType: _opentype,
      interType: _intertype,
      position: _position,
      errorType: _errorType,
      formlist: this.props.formlist.map(item => {
        if (item.key === 'class') {
          item.options = btnClasses
@@ -167,9 +162,9 @@
        }
      } else {
        if (this.state.interType === 'inner') {
          _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'errorTip', 'errorTime', 'sql', 'sqlType']
          _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType']
        } else {
          _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'errorTip', 'errorTime', 'interface', 'outerFunc', 'callbackFunc', 'method']
          _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'interface', 'outerFunc', 'callbackFunc', 'method']
        }
      }
      
@@ -242,10 +237,6 @@
          })
        })
      })
    } else if (key === 'errorTip') {
      this.setState({
        errorType: value
      })
    } else if (key === 'tabType') {
      let _tabs = this.props.tabs.filter(tab => tab.type === value)
@@ -286,9 +277,6 @@
      } else {
        _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'interface', 'outerFunc', 'callbackFunc', 'method']
      }
      if (['pop', 'prompt', 'exec'].includes(this.state.openType)) {
        _options.push('errorTip', 'errorTime')
      }
      this.setState({
        interType: value,
        formlist: this.state.formlist.map(item => {
@@ -299,36 +287,36 @@
    }
  }
  showError = () => {
    const { errorType } = this.state
  // showError = () => {
  //   const { errorType } = this.state
    if (errorType === 'S') {
      notification.success({
        top: 92,
        message: '执行成功!',
        duration: 2
      })
    } else if (errorType === 'F') {
      notification.error({
        className: 'notification-custom-error',
        top: 92,
        message: '执行失败!',
        duration: 15
      })
    } else if (errorType === 'N') {
      notification.error({
        top: 92,
        message: '执行失败!',
        duration: 15
      })
    } else if (errorType === 'E') {
      Modal.error({
        title: '执行失败!'
      })
    } else if (errorType === 'NM') {
      message.error('执行失败!')
    }
  }
  //   if (errorType === 'S') {
  //     notification.success({
  //       top: 92,
  //       message: '执行成功!',
  //       duration: 2
  //     })
  //   } else if (errorType === 'F') {
  //     notification.error({
  //       className: 'notification-custom-error',
  //       top: 92,
  //       message: '执行失败!',
  //       duration: 15
  //     })
  //   } else if (errorType === 'N') {
  //     notification.error({
  //       top: 92,
  //       message: '执行失败!',
  //       duration: 15
  //     })
  //   } else if (errorType === 'E') {
  //     Modal.error({
  //       title: '执行失败!'
  //     })
  //   } else if (errorType === 'NM') {
  //     message.error('执行失败!')
  //   }
  // }
  getFields() {
    const { getFieldDecorator } = this.props.form
@@ -387,7 +375,7 @@
        )
      } else if (item.type === 'select') { // 下拉搜索
        fields.push(
          <Col span={12} key={index} className={item.key === 'errorTip' ? 'with-button' : ''}>
          <Col span={12} key={index}>
            <Form.Item label={item.tooltip ?
              <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}>
                <Icon type="question-circle" />
@@ -417,7 +405,6 @@
                </Select>
              )}
            </Form.Item>
            {item.key === 'errorTip' ? <Button onClick={this.showError}>查看</Button> : null}
          </Col>
        )
      } else if (item.type === 'radio') {
src/templates/subtableconfig/index.jsx
@@ -678,42 +678,42 @@
            text: this.state.dict['header.form.refresh.subgrid']
          }]
        },
        {
          type: 'select',
          key: 'errorTip',
          label: this.state.dict['header.form.messageTip'],
          initVal: card.errorTip || 'E',
          tooltip: '该选项为提示效果展示,选择提示类型后,可点击按钮查看,自定义函数中设置 ErrCode 为(S、-1、E、N、F、NM)时,会以对应方式展示提示信息。',
          tooltipClass: 'middle',
          required: false,
          options: [{
            value: 'S',
            text: 'S(提醒框-0)'
          }, {
            value: '-1',
            text: '-1(不提示)'
          }, {
            value: 'N',
            text: 'N(提醒框-1)'
          }, {
            value: 'F',
            text: 'F(提醒框-2)'
          }, {
            value: 'E',
            text: 'E(确认框)'
          }, {
            value: 'NM',
            text: 'NM(顶部提示)'
          }]
        },
        {
          type: 'number',
          key: 'errorTime',
          label: this.state.dict['header.form.errorTime'],
          initVal: card.errorTime || 15,
          tooltip: '执行结果中设置 ErrCode 为 N 或 F 时有效',
          required: false
        },
        // {
        //   type: 'select',
        //   key: 'errorTip',
        //   label: this.state.dict['header.form.messageTip'],
        //   initVal: card.errorTip || 'E',
        //   tooltip: '该选项为提示效果展示,选择提示类型后,可点击按钮查看,自定义函数中设置 ErrCode 为(S、-1、E、N、F、NM)时,会以对应方式展示提示信息。',
        //   tooltipClass: 'middle',
        //   required: false,
        //   options: [{
        //     value: 'S',
        //     text: 'S(提醒框-0)'
        //   }, {
        //     value: '-1',
        //     text: '-1(不提示)'
        //   }, {
        //     value: 'N',
        //     text: 'N(提醒框-1)'
        //   }, {
        //     value: 'F',
        //     text: 'F(提醒框-2)'
        //   }, {
        //     value: 'E',
        //     text: 'E(确认框)'
        //   }, {
        //     value: 'NM',
        //     text: 'NM(顶部提示)'
        //   }]
        // },
        // {
        //   type: 'number',
        //   key: 'errorTime',
        //   label: this.state.dict['header.form.errorTime'],
        //   initVal: card.errorTime || 15,
        //   tooltip: '执行结果中设置 ErrCode 为 N 或 F 时有效',
        //   required: false
        // },
        {
          type: 'select',
          key: 'icon',
@@ -993,26 +993,6 @@
    if (this.state.formtemp !== 'gridbtn') {
      this.formRef.handleConfirm().then(res => {
        let isupdate = false
        if (res.type === 'search') {
          if ((res.values.type === 'multiselect' || res.values.type === 'select' || res.values.type === 'link') && res.values.resourceType === '1') {
            let _datasource = res.values.dataSource
            if (/\s/.test(_datasource)) {
              _datasource = '(' + _datasource + ') tb'
            }
            let sql = 'select ' + res.values.valueField + ',' + res.values.valueText + ' from ' + _datasource
            if (res.values.type === 'link') {
              sql = 'select ' + res.values.valueField + ',' + res.values.valueText + ',' + res.values.linkField + ' from ' + _datasource
            }
            if (res.values.orderBy) {
              sql = sql + ' order by ' + res.values.orderBy + ' ' + res.values.orderType
            }
            res.values.dataSourceSql = Utils.formatOptions(sql)
          }
        }
        if (res.type === 'action' && card.originCard && res.values.OpenType === 'pop') {
          Api.getSystemConfig({
src/utils/option.js
@@ -9,7 +9,16 @@
    title: '基础表格',
    type: 'CommonTable',
    url: nortable,
    baseconfig: ''
    baseconfig: '',
    isSystem: true
  },
  {
    title: '主子表表格',
    type: 'CommonTable',
    url: nortable,
    baseconfig: '',
    isSystem: true,
    isSubtable: true
  }
]
src/utils/utils.js
@@ -411,11 +411,39 @@
    } else {
      baseurl = 'http://qingqiumarket.cn/' + service
    }
    if (!/Content\/images\/upload\//.test(url)) {
      baseurl = baseurl + 'Content/images/upload/'
    }
    let realurl = url.match(/^http/) || url.match(/^\/\//) ? url : baseurl + url
    return realurl
  }
  /**
   * @description 获取下拉搜索查询sql
   * @return {String} item   搜索条件信息
   */
  static getSelectQuerySql (item) {
    let _datasource = item.dataSource
    let sql = ''
    if (/\s/.test(_datasource)) {
      _datasource = '(' + _datasource + ') tb'
    }
    if (item.type === 'link') {
      sql = 'select ' + item.valueField + ',' + item.valueText + ',' + item.linkField + ' from ' + _datasource
    } else {
      sql = 'select ' + item.valueField + ',' + item.valueText + ' from ' + _datasource
    }
    if (item.orderBy) {
      sql = sql + ' order by ' + item.orderBy + ' ' + item.orderType
    }
    return sql
  }
  /**
   * @description 使用系统函数时(sPC_TableData_InUpDe ),生成sql语句
   * @return {String} type   执行类型
   * @return {String} table  表名