king
2019-12-18 1a14ff6035932eadfb6ef7970e3adb24b4e158a6
2019-12-18
22个文件已修改
679 ■■■■■ 已修改文件
src/api/index.js 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/header/index.scss 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/sidemenu/editthdmenu/index.jsx 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/locales/zh-CN/comtable.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/commontable/index.jsx 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/commontable/mainAction/index.jsx 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/commontable/mainSearch/index.jsx 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/commontable/mainTable/index.jsx 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/commontable/mutilform/index.jsx 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/actionform/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/colspanform/index.jsx 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/dragelement/card.jsx 113 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/dragelement/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/index.jsx 147 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/searchform/index.jsx 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/settingform/index.jsx 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/index.scss 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/settingform/index.jsx 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/source.jsx 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/option.js 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils.js 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/index.js
@@ -194,7 +194,6 @@
    param.lang = localStorage.getItem('lang') || ''
    param.SessionUid = sessionStorage.getItem('SessionUid') || ''
    param.LoginUID = sessionStorage.getItem('LoginUID') || ''
    // param.appkey = window.GLOB.appkey || ''
    
    return axios({
      url: '/webapi/dostar',
@@ -203,6 +202,21 @@
  }
  /**
   * @description 导出Excel
   */
  getExcelOut (param) {
    param.userid = sessionStorage.getItem('UserID')
    param.lang = localStorage.getItem('lang') || ''
    param.SessionUid = sessionStorage.getItem('SessionUid') || ''
    param.LoginUID = sessionStorage.getItem('LoginUID') || ''
    return axios({
      url: '/webapi/doexcel',
      data: param
    })
  }
  /**
   * @description 获取页面配置信息
   * @param {String} MenuNo 页面菜单参数
   */
src/components/header/index.scss
@@ -2,7 +2,6 @@
.header-container {
  position: fixed;
  // background-color: $header-bg;
  z-index: 1060;
  left: 0;
  top: 0;
@@ -62,15 +61,16 @@
      }
      &:hover {
        height: 42px;
        color: #eeeeee;
        border-bottom: 4px solid #fafcfb;
        span {
          border-bottom: 4px solid #fafcfb;
        }
      }
      &.active {
        height: 42px;
        color: #ffffff;
        // font-weight: bold;
        border-bottom: 4px solid #06b4f7;
        span {
          border-bottom: 4px solid #06b4f7;
        }
      }
    }
  }
@@ -95,28 +95,12 @@
      }
    }
  }
  // .header-drag-menu {
  //   float: left;
  // }
  .edit-check {
    font-size: 18px;
    margin-top: 14px;
    margin-left: 10px;
    cursor: pointer;
  }
  // .mask {
  //   position: fixed;
  //   top: 48px;
  //   left: 0px;
  //   right: 0px;
  //   bottom: calc(100vh - 48px);
  //   background-color: rgba(0, 0, 0, 0);
  //   transition: background-color 0.5s;
  // }
  // .mask.active {
  //   bottom: 0px;
  //   background-color: rgba(0, 0, 0, 0.25);
  // }
}
.header-dropdown {
  li {
src/components/sidemenu/editthdmenu/index.jsx
@@ -129,7 +129,7 @@
          }
          _menu.LongParam = _LongParam
          _menu.ParentID = this.props.supMenu.MenuID
          // console.log(_menu)
          // 检测模板是否存在
          let _Template = this.state.baseTemplates.filter(temp => temp.type === _menu.PageParam.Template)
          this.setState({
@@ -514,6 +514,7 @@
            menu={this.state.editMenu}
            supMenuList={this.props.supMenuList}
            handleConfig={this.handleConfig}
            reloadmenu={() => {this.props.reload()}}
            handleSubConfig={this.handleSubConfig}
          />
        }
src/locales/zh-CN/comtable.js
@@ -99,8 +99,8 @@
  'header.form.popview': '弹窗(页面)',
  'header.form.tab': '标签页',
  'header.form.currenttab': '当前菜单',
  'header.form.excelIn': 'Excel导入',
  'header.form.excelOut': 'Excel导出',
  'header.form.excelIn': '导入Excel',
  'header.form.excelOut': '导出Excel',
  'header.form.newpage': '新页面',
  'header.form.newpage.inner': '新页面(内部)',
  'header.form.newpage.outer': '新页面(外部)',
src/tabviews/commontable/index.jsx
@@ -248,7 +248,7 @@
    let LText = `select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${setting.dataresource} ${_search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows`
    let DateCount = `select count(1) as total from ${setting.dataresource} ${_search}`
    console.log(LText)
    param.LText = Utils.formatOptions(LText)
    param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
    param.secretkey = Utils.encrypt(param.LText, param.timestamp)
@@ -368,7 +368,33 @@
      this.reloadtable()
    } else if (btn.execError === 'view' && type === 'error') {
      this.reloadview()
    } else if (type === 'excelOut') {
      this.handleExcelout()
    }
  }
  handleExcelout = () => {
    const { arr_field, orderColumn, orderType, search, setting } = this.state
    let _search = Utils.joinMainSearchkey(search)
    _search = _search ? 'where (' + _search + ')' : ''
    // 获取列表数据
    let param = {
      func: setting.innerFunc || 'sPC_Get_TableData',
      obj_name: 'data',
      arr_field: arr_field
    }
    let orderBy = orderColumn ? (orderColumn + ' ' + orderType) : setting.order
    let LText = `select ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${setting.dataresource} ${_search}) tmptable order by tmptable.rows`
    param.LText = Utils.formatOptions(LText)
    param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
    param.secretkey = Utils.encrypt(param.LText, param.timestamp)
    param.DateCount = ''
    Api.genericInterface(param)
  }
  gettableselected = () => {
@@ -378,6 +404,10 @@
      data.push(this.refs.mainTable.props.data[item])
    })
    return data
  }
  buttonTrigger = (btn, record) => {
    this.refs.mainButton.actionTrigger(btn, record)
  }
  UNSAFE_componentWillMount () {
@@ -404,6 +434,7 @@
        }
        {actions &&
          <MainAction
            ref="mainButton"
            MenuID={this.props.MenuID}
            setting={setting}
            refreshdata={this.refreshbyaction}
@@ -415,14 +446,15 @@
        {columns &&
          <MainTable
            ref="mainTable"
            dict={this.state.dict}
            MenuID={this.props.MenuID}
            setting={setting}
            refreshdata={this.refreshbytable}
            columns={columns}
            data={this.state.data}
            total={this.state.total}
            loading={this.state.loading}
            dict={this.state.dict}
            refreshdata={this.refreshbytable}
            buttonTrigger={this.buttonTrigger}
          />
        }
        <BackTop>
src/tabviews/commontable/mainAction/index.jsx
@@ -31,6 +31,7 @@
  refreshdata = (item, type) => {
    this.props.refreshdata(item, type)
  }
  actionTrigger = (item) => {
    const { setting } = this.props
@@ -86,6 +87,8 @@
      }, () => {
        this.improveAction(item)
      })
    } else if (item.OpenType === 'excelOut') {
      this.refreshdata(item, 'excelOut')
    } else {
      notification.warning({
        top: 92,
@@ -499,7 +502,8 @@
      message: this.props.dict['main.action.confirm.success'],
      duration: 2
    })
    if (btn.OpenType === 'pop') {
    if (btn.OpenType === 'pop' && btn.setting && btn.setting.finish !== 'unclose') {
      this.setState({
        visible: false
      })
@@ -708,7 +712,9 @@
    let title = ''
    let width = '62vw'
    let clickouter = false
    let container = document.body
    if (execAction && execAction.setting) {
      title = execAction.setting.title
      width = execAction.setting.width + 'vw'
@@ -717,13 +723,18 @@
        width = execAction.setting.width + '%'
        container = () => document.getElementById('commontable' + this.props.MenuID)
      }
      if (execAction.setting.clickouter === 'close') {
        clickouter = true
      }
    }
    return (
      <Modal
        title={title}
        maskClosable={clickouter}
        getContainer={container}
        wrapClassName='action-modal'
        title={title}
        visible={this.state.visible}
        width={width}
        onOk={this.handleOk}
@@ -734,6 +745,7 @@
        <MutilForm
          dict={this.props.dict}
          action={execAction}
          inputSubmit={this.handleOk}
          configMap={this.state.configMap}
          data={this.state.tabledata[0]}
          wrappedComponentRef={(inst) => this.formRef = inst}
src/tabviews/commontable/mainSearch/index.jsx
@@ -91,12 +91,23 @@
          </Col>
        )
      } else if (item.type === 'daterange') {
        let _defaultValue = [null, null]
        if (item.initval) {
          try {
            let _initval = JSON.parse(item.initval)
            _defaultValue = [moment().subtract(_initval[0], 'days'), moment().subtract(_initval[1], 'days')]
          } catch {
            _defaultValue = [null, null]
          }
        }
        fields.push(
          <Col className="daterange" span={6} key={index}>
            <Form.Item label={item.label}>
              {getFieldDecorator(item.field,
                {
                  initialValue: item.initval ? [moment().subtract(item.initval, 'days'), moment().subtract(item.initval === 1 ? 1 : 0, 'days')] : [null, null]
                  initialValue: _defaultValue
                })(
                <RangePicker
                  placeholder={['开始日期', '结束日期']}
src/tabviews/commontable/mainTable/index.jsx
@@ -6,30 +6,29 @@
export default class MainTable extends Component {
  static propTpyes = {
    MenuID: PropTypes.string, // 菜单参数
    setting: PropTypes.object, // 表格头部是否固定于页面上方
    loading: PropTypes.bool,
    total: PropTypes.number,
    select: PropTypes.object,
    dict: PropTypes.object, // 字典项
    columns: PropTypes.array, // 表格列
    data: PropTypes.oneOfType([
      PropTypes.object,
      PropTypes.array
    ])
    dict: PropTypes.object,        // 字典项
    MenuID: PropTypes.string,      // 菜单Id
    setting: PropTypes.object,     // 表格全局设置:tableType(表格是否可选、单选、多选)、columnfixed(列固定)、actionfixed(按钮固定)
    columns: PropTypes.array,      // 表格列
    data: PropTypes.any,           // 表格数据
    total: PropTypes.number,       // 总数
    loading: PropTypes.bool,       // 表格加载中
    refreshdata: PropTypes.func,   // 表格中排序列、页码的变化时刷新
    buttonTrigger: PropTypes.func  // 表格中按钮触发操作
  }
  state = {
    selectedRowKeys: [],
    pageIndex: 1,
    pageSize: 10,
    columns: null
    selectedRowKeys: [], // 表格中选中行
    pageIndex: 1,        // 初始页面索引
    pageSize: 10,        // 每页数据条数
    columns: null        // 显示列
  }
  UNSAFE_componentWillMount () {
    const { columns } = this.props
    let _columns = []
    columns.forEach((item, index) => {
    columns.forEach(item => {
      let cell = {
        align: item.Align,
        dataIndex: item.field || item.uuid,
@@ -164,8 +163,7 @@
  actionTrigger = (e, btn, record) => {
    e.stopPropagation()
    console.log(btn)
    console.log(record)
    this.props.buttonTrigger(btn, record)
  }
  copycontent = (e, content) => {
@@ -251,9 +249,9 @@
      <div className="main-table">
        {this.props.setting.columnfixed && <Affix offsetTop={offset} className="fix-header">
          <Table
            size="middle"
            bordered={true}
            rowSelection={rowSelection}
            size="middle"
            columns={this.state.columns.map(column => {
              return {
                align: column.align,
@@ -265,9 +263,9 @@
          />
        </Affix>}
        <Table
          size="middle"
          bordered={true}
          rowSelection={rowSelection}
          size="middle"
          columns={this.state.columns}
          dataSource={this.props.data ? this.props.data : []}
          loading={this.props.loading}
src/tabviews/commontable/mutilform/index.jsx
@@ -9,10 +9,11 @@
class MainSearch extends Component {
  static propTpyes = {
    action: PropTypes.object, // 搜索条件列表
    dict: PropTypes.object, // 字典项
    data: PropTypes.any, // 表格数据
    configMap: PropTypes.object
    action: PropTypes.object,    // 按钮信息、表单列表
    dict: PropTypes.object,      // 字典项
    data: PropTypes.any,         // 表格数据
    configMap: PropTypes.object, // 按钮及下拉表单配置信息集
    inputSubmit: PropTypes.func  // input回车提交
  }
  state = {
@@ -22,6 +23,7 @@
  }
  componentDidMount () {
    const { data } = this.props
    let action = JSON.parse(JSON.stringify(this.props.action))
    let datatype = {}
@@ -83,12 +85,18 @@
    formlist = formlist.map(item => {
      if (item.type === 'link') {
        let supItem = formlist.filter(form => form.field === item.linkField)[0]
        if (!supItem && data && data.hasOwnProperty(item.linkField)) {
          supItem = {initval: data[item.linkField]}
        }
        if (!supItem) {
          error = true
        } else {
          item.options = item.oriOptions.filter(option => option.parentId === supItem.initval)
        }
      }
      return item
    })
@@ -104,6 +112,13 @@
      readtype: readtype,
      datatype: datatype,
      formlist: formlist
    }, () => {
      if (action.setting && action.setting.focus) {
        let _item = document.getElementById(action.setting.focus)
        if (_item) {
          _item.select()
        }
      }
    })
  }
@@ -187,14 +202,14 @@
          <Col span={24 / cols} key={index}>
            <Form.Item label={item.label}>
              {getFieldDecorator(item.field, {
                initialValue: item.initval,
                initialValue: item.initval || 'text',
                rules: [
                  {
                    required: item.required === 'true',
                    message: this.props.dict['form.required.input'] + item.label + '!'
                  }
                ]
              })(<Input placeholder="" autoComplete="off" disabled={item.readonly === 'true'} />)}
              })(<Input placeholder="" autoComplete="off" disabled={item.readonly === 'true'} onPressEnter={this.handleSubmit} />)}
            </Form.Item>
          </Col>
        )
@@ -217,8 +232,8 @@
                ]
              })(
                precision === null ?
                <InputNumber initialValue={_initval} min={min} max={max} disabled={item.readonly === 'true'} /> :
                <InputNumber initialValue={_initval} min={min} max={max} precision={precision} disabled={item.readonly === 'true'} />
                <InputNumber initialValue={_initval} min={min} max={max} disabled={item.readonly === 'true'} onPressEnter={this.handleSubmit} /> :
                <InputNumber initialValue={_initval} min={min} max={max} precision={precision} disabled={item.readonly === 'true'} onPressEnter={this.handleSubmit} />
                )}
            </Form.Item>
          </Col>
@@ -394,9 +409,9 @@
    })
  }
  handleReset = () => {
    // 重置
    this.props.form.resetFields()
  handleSubmit = (e) => {
    e.preventDefault()
    this.props.inputSubmit()
  }
  render() {
src/templates/comtableconfig/actionform/index.jsx
@@ -333,7 +333,7 @@
            values.position = 'toolbar'
            values.Ot = 'notRequired'
          }
          console.log(values)
          if (values.innerFunc === '' && values.sql === '') {
            notification.warning({
              top: 92,
src/templates/comtableconfig/colspanform/index.jsx
@@ -1,6 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, notification, InputNumber, Select, Radio } from 'antd'
import { Form, Row, Col, Input, InputNumber, Select, Radio } from 'antd'
import TransferForm from '../transferform'
import './index.scss'
@@ -21,17 +21,10 @@
      this.props.form.validateFieldsAndScroll((err, values) => {
        if (!err) {
          let targetKeys = this.refs['column-transfer'].state.targetKeys
          if (targetKeys.length === 0) {
            notification.warning({
              top: 92,
              message: '请添加显示列',
              duration: 10
            })
            return
          }
          delete values.type
          let subfield = [] // 用于查看合并列字段
          delete values.type // 删除type,此处值为'合并列'文字
          let subfield = []  // 用于查看合并列字段
          this.props.columns.forEach(col => {
            if (col.field && targetKeys.includes(col.uuid)) {
              subfield.push(col.field)
src/templates/comtableconfig/dragelement/card.jsx
@@ -45,79 +45,98 @@
    copyCard(id)
  }
  let selectval = ''
  let _defaultValue = '' // 下拉搜索、时间范围类型,初始值需要预处理
  if (type === 'search' && card.type === 'select') {
    if (card.initval) {
      let _option = card.options.filter(option => option.Value === card.initval)[0]
      if (_option) {
        selectval = _option.Text || ''
        _defaultValue = _option.Text || ''
      } else {
        selectval = ''
        _defaultValue = ''
      }
    } else if (card.setAll === 'true') {
      selectval = '全部'
      _defaultValue = '全部'
    }
  } else if (type === 'search' && card.type === 'daterange') {
    _defaultValue = [null, null]
    if (card.initval) {
      try {
        let _initval = JSON.parse(card.initval)
        _defaultValue = [moment().subtract(_initval[0], 'days'), moment().subtract(_initval[1], 'days')]
      } catch {
        _defaultValue = [null, null]
      }
    }
  }
  return (
    <div className="page-card" style={type === 'columns' ? { flex: card.Width, opacity: opacity} : { opacity: opacity}}>
      <div ref={node => drag(drop(node))}>
        {type === 'search' && <div className="ant-row ant-form-item">
          <div className="ant-col ant-form-item-label">
            <label title={card.label}>{card.label}</label>
          </div>
          <div className="ant-col ant-form-item-control-wrapper">
            {card.type === 'text' ?
              <Input style={{marginTop: '4px'}} defaultValue={card.initval} /> : null
            }
            {(card.type === 'select' || card.type === 'link') ?
              <Select defaultValue={selectval}></Select> : null
            }
            {card.type === 'date' ?
              <DatePicker defaultValue={card.initval ? moment().subtract(card.initval, 'days') : null} /> : null
            }
            {card.type === 'dateweek' ?
              <WeekPicker defaultValue={card.initval ? moment().subtract(card.initval * 7, 'days') : null} /> : null
            }
            {card.type === 'datemonth' ?
              <MonthPicker defaultValue={card.initval ? moment().subtract(card.initval, 'month') : null} /> : null
            }
            {card.type === 'daterange' ?
              <RangePicker
                className="data-range"
                placeholder={['开始日期', '结束日期']}
                renderExtraFooter={() => 'extra footer'}
                defaultValue={card.initval ? [moment().subtract(card.initval, 'days'), moment().subtract(card.initval === 1 ? 1 : 0, 'days')] : [null, null]}
              /> : null
            }
            <div className="input-mask"></div>
          </div>
        </div>}
        {type === 'action' &&
        {type === 'search' ?
          <div className="ant-row ant-form-item">
            <div className="ant-col ant-form-item-label">
              <label title={card.label}>{card.label}</label>
            </div>
            <div className="ant-col ant-form-item-control-wrapper">
              {card.type === 'text' ?
                <Input style={{marginTop: '4px'}} defaultValue={card.initval} /> : null
              }
              {(card.type === 'select' || card.type === 'link') ?
                <Select defaultValue={_defaultValue}></Select> : null
              }
              {card.type === 'date' ?
                <DatePicker defaultValue={card.initval ? moment().subtract(card.initval, 'days') : null} /> : null
              }
              {card.type === 'dateweek' ?
                <WeekPicker defaultValue={card.initval ? moment().subtract(card.initval * 7, 'days') : null} /> : null
              }
              {card.type === 'datemonth' ?
                <MonthPicker defaultValue={card.initval ? moment().subtract(card.initval, 'month') : null} /> : null
              }
              {card.type === 'daterange' ?
                <RangePicker
                  className="data-range"
                  placeholder={['开始日期', '结束日期']}
                  renderExtraFooter={() => 'extra footer'}
                  defaultValue={_defaultValue}
                /> : null
              }
              <div className="input-mask"></div>
            </div>
          </div> : null
        }
        {type === 'action' ?
          <Button
            className={'mk-btn mk-' + card.class}
            icon={card.icon}
            key={card.uuid}
          >{card.label}{card.position === 'grid' && <Icon type="table" />}</Button>
          >
            {card.label}{card.position === 'grid' && <Icon type="table" />}
          </Button> : null
        }
        {type === 'columns' &&
        {type === 'columns' ?
          <span className="ant-table-header-column">
            <div className="ant-table-column-sorters" title={card.label} style={{textAlign: card.Align}}>
              <span className="ant-table-column-title">{card.label}</span>
              {card.IsSort === 'true' && <span className="ant-table-column-sorter">
                <Icon type="caret-up" />
                <Icon type="caret-down" />
              </span>}
              {card.IsSort === 'true' ?
                <span className="ant-table-column-sorter">
                  <Icon type="caret-up" />
                  <Icon type="caret-down" />
                </span> : null
              }
            </div>
            {showfield ? <div className="ant-table-column-fields">
              <span className="ant-table-column-title">{card.type === 'colspan' ? card.subfield : card.field}</span>
            </div> : null}
          </span>
            {showfield ?
              <div className="ant-table-column-fields">
                <span className="ant-table-column-title">{card.type === 'colspan' ? card.subfield : card.field}</span>
              </div> : null
            }
          </span> : null
        }
      </div>
      <Icon className="edit" type="edit" onClick={edit} />
      <Icon className="edit close" type="close" onClick={del} />
      {type === 'action' && <Icon className="edit copy" type="copy" onClick={copy} />}
      {type === 'action' ? <Icon className="edit copy" type="copy" onClick={copy} /> : null}
    </div>
  )
}
src/templates/comtableconfig/dragelement/index.jsx
@@ -15,7 +15,6 @@
    const _cards = update(cards, { $splice: [[index, 1], [atIndex, 0, card]] })
    setCards(_cards)
    handleList(type, _cards)
    // handleList({[type]: _cards})
  }
  const findCard = id => {
@@ -105,6 +104,11 @@
        newcard.callbackFunc = ''
        newcard.pageTemplate = ''
        newcard.url = ''
        if (item.subType === 'excelIn' || item.subType === 'excelOut') {
          // 导入和导出excel,按钮名称直接为导入、导出
          newcard.label = item.label
        }
      } else if (item.type === 'columns') {
        newcard.uuid = Utils.getuuid()
        newcard.Align = 'left'
src/templates/comtableconfig/index.jsx
@@ -32,6 +32,7 @@
  static propTpyes = {
    type: PropTypes.string,
    menu: PropTypes.any,
    reloadmenu: PropTypes.func,
    handleConfig: PropTypes.func,
    handleSubConfig: PropTypes.func,
    supMenuList: PropTypes.array
@@ -949,13 +950,17 @@
    if (this.state.formtemp !== 'gridbtn') {
      this.formRef.handleConfirm().then(res => {
        let isupdate = false
        if (res.type === 'search') {
          if ((res.values.type === 'select' || res.values.type === 'link') && res.values.resourceType === '1') {
            let sql = 'select ' + res.values.valueField + ',' + res.values.valueText + ' from (' + res.values.dataSource + ')'
            if (res.values.orderBy) {
              sql = sql + ' ld order by ' + res.values.orderBy + ' ' + res.values.orderType
            let sql = 'select ' + res.values.valueField + ',' + res.values.valueText + ' from ' + res.values.dataSource
            if (res.values.type === 'link') {
              sql = 'select ' + res.values.valueField + ',' + res.values.valueText + ',' + res.values.linkField + ' from ' + res.values.dataSource
            }
            if (res.values.orderBy) {
              sql = sql + ' order by ' + res.values.orderBy + ' ' + res.values.orderType
            }
            res.values.dataSourceSql = Utils.formatOptions(sql)
          }
        }
@@ -1058,6 +1063,7 @@
   * @description 创建按钮存储过程
   */
  creatFunc = () => {
    const { menu } = this.props
    let _config = JSON.parse(JSON.stringify(this.state.config))
    this.formRef.handleConfirm().then(res => {
@@ -1115,11 +1121,11 @@
                funcName: btn.innerFunc,
                name: _config.setting.tableName || '',
                fields: fields,
                menuNo: this.props.menu.MenuNo
                menuNo: menu.MenuNo
              }
              newLText = Utils.formatOptions(Utils.getfunc(_param))
              newLText = Utils.formatOptions(Utils.getfunc(_param, btn, menu, _config.columns))
              DelText = Utils.formatOptions(Utils.dropfunc(_param.funcName))
              resolve(true)
              resolve(false)
            } else {
              resolve(false)
              notification.warning({
@@ -1134,15 +1140,14 @@
            funcName: btn.innerFunc,
            name: _config.setting.tableName || '',
            fields: '',
            menuNo: this.props.menu.MenuNo
            menuNo: menu.MenuNo
          }
          newLText = Utils.formatOptions(Utils.getfunc(_param))
          newLText = Utils.formatOptions(Utils.getfunc(_param, btn, menu, _config.columns))
          DelText = Utils.formatOptions(Utils.dropfunc(_param.funcName))
          resolve(true)
          resolve(false)
        }
      }).then(res => {
        // 获取云端及本地,是否已存在该存储过程的信息
        console.log(res)
        if (res === false) return res
        let sysDefer = new Promise(resolve => {
@@ -1170,7 +1175,6 @@
        return Promise.all([sysDefer, localDefer])
      }).then(res => {
        // 云端结果与新语句不同时,更新云端信息
        console.log(res)
        if (res === false) return res
        let isError = false
@@ -1186,7 +1190,6 @@
          } else if (index === 0) {
            sysTVPText = result.TVPText
          } else {
            console.log(result.Ltext)
            if (result.Ltext) { // 本地存储过程是否存在
              isExit = true
            }
@@ -1231,7 +1234,6 @@
        }
      }).then(res => {
        // 云端信息更新后,判断是删除或是直接新建存储过程
        console.log(res)
        if (res === false || res === 'drop') return res
        if (!res.status) {
@@ -1248,7 +1250,6 @@
        }
      }).then(res => {
        // 删除存储过程
        console.log(res)
        if (res === false || res === 'create') return res
        let _param = {
@@ -1263,7 +1264,6 @@
        return Api.getLocalConfig(_param)
      }).then(res => {
        // 根据上述操作结果,判断是否新建存储过程
        console.log(res)
        if (res === false || res === 'create') return res
        if (!res.status) {
@@ -1278,7 +1278,6 @@
        }
      }).then(res => {
        // 新建存储过程
        console.log(res)
        if (res === false) return res
        let _param = {
@@ -1292,7 +1291,6 @@
        return Api.getLocalConfig(_param)
      }).then(res => {
        // 处理新建结果
        console.log(res)
        if (res === false) return res
        if (!res.status) {
@@ -1312,7 +1310,6 @@
        }
      }).then(res => {
        // 新建成功后,更新页面按钮信息
        console.log(res)
        if (res === false) {
          this.setState({
            funcLoading: false
@@ -1505,6 +1502,8 @@
              columnsloading: false
            })
          })
          this.props.reloadmenu()
          
          this.submitAction(btnParam)
        } else {
@@ -1535,65 +1534,65 @@
    const { config } = this.state
    new Promise(resolve => {
      // 内部请求
      if (param.LText) {
        Api.getSystemConfig(param).then(response => {
          if (response.status) {
            resolve('true')
          } else {
            resolve(response)
          }
        })
      } else {
        resolve('true')
      }
    }).then(res => {
      console.log(res)
      if (res === 'true' && this.state.delActions.length > 0) {
      if (this.state.delActions.length > 0) {
        let deffers = this.state.delActions.map(item => {
          let param = {
          let _param = {
            func: 'sPC_MainMenu_Del',
            MenuID: item
          }
          return new Promise(resolve => {
            Api.getSystemConfig(param).then(res => {
            Api.getSystemConfig(_param).then(res => {
              resolve(res)
            })
          })
        })
        return Promise.all(deffers)
      } else if (res === 'true' && this.state.delActions.length === 0) {
        Promise.all(deffers).then(result => {
          let error = false
          result.forEach(res => {
            if (!res.status) {
              error = res
            }
          })
          if (error) {
            notification.warning({
              top: 92,
              message: error.message,
              duration: 10
            })
            resolve(false)
          } else {
            this.setState({
              delActions: []
            })
            resolve(param)
          }
        })
      } else if (this.state.delActions.length === 0) {
        resolve(param)
      }
    }).then(res => {
      if (res === false) return res
      if (res.LText) {
        return Api.getSystemConfig(res)
      } else {
        return 'copy'
      } else if (!res.status) {
      }
    }).then(response => {
      if (response === false || response === 'copy') return response
      if (response.status) {
        return 'copy'
      } else {
        notification.warning({
          top: 92,
          message: res.message,
          message: response.message,
          duration: 10
        })
        return false
      }
    }).then(response => {
      console.log(response)
      if (response === false || response === 'copy') return response
      let res = 'copy'
      if (Array.isArray(response)) {
        response.forEach(result => {
          if (!result.status) {
            res = result
          }
        })
      }
      if (res === 'copy') return 'copy'
      notification.warning({
        top: 92,
        message: res.message,
        duration: 10
      })
      return false
    }).then(response => {
      console.log(response)
      if (response === false) return response
      let oriActions = []
@@ -1604,7 +1603,7 @@
        oriActions.push({
          prebtn: item.prebtn,
          curBtn: item.curBtn
          curBtn: curBtn
        })
      })
@@ -1645,7 +1644,6 @@
      })
      return 'true'
    }).then(response => {
      console.log(response)
      if (response === 'true') {
        notification.success({
          top: 92,
@@ -1992,8 +1990,29 @@
  }
  settingSave = () => {
    const { menu } = this.props
    const {config} = this.state
    this.settingRef.handleConfirm().then(res => {
      if (
        res.interType === 'inner' &&
        !res.innerFunc &&
        res.dataresource.length > 50 &&
        config.setting.dataresource !== res.dataresource
      ) {
        let param = {
          func: 's_DataSrc_Save',
          LText: res.dataresource,
          MenuID: menu.MenuID
        }
        param.LText = Utils.formatOptions(param.LText)
        param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
        param.secretkey = Utils.encrypt(param.LText, param.timestamp)
        Api.getLocalConfig(param)
      }
      this.setState({
        config: {...config, setting: res},
        settingVisible: false,
@@ -2069,7 +2088,6 @@
                  _LongParam = ''
                }
              }
              console.log(_LongParam)
              this.props.handleSubConfig(btn, originMenu, _LongParam)
            } else {
              this.setState({
@@ -2370,6 +2388,7 @@
          destroyOnClose
        >
          <SettingForm
            menu={this.props.menu}
            data={this.state.config.setting}
            columns={this.state.config.columns}
            dict={this.state.dict}
src/templates/comtableconfig/searchform/index.jsx
@@ -57,8 +57,10 @@
            form.options = matchReg.text
          } else if (type === 'select' || type === 'link') {
            form.options = matchReg.select
          } else if (type === 'date' || type === 'datemonth') {
          } else if (type === 'date') {
            form.options = matchReg.date
          } else if (type === 'datemonth') {
            form.options = matchReg.datemonth
          } else if (type === 'dateweek' || type === 'daterange') {
            form.options = matchReg.daterange
          }
@@ -87,7 +89,7 @@
      if (value === 'link') {
        _options = [..._options, 'linkField']
      }
      console.log(value)
      this.setState({
        openType: value,
        formlist: this.state.formlist.map(form => {
@@ -107,8 +109,10 @@
              form.options = matchReg.text
            } else if (value === 'select' || value === 'link') {
              form.options = matchReg.select
            } else if (value === 'date' || value === 'datemonth') {
            } else if (value === 'date') {
              form.options = matchReg.date
            } else if (value === 'datemonth') {
              form.options = matchReg.datemonth
            } else if (value === 'dateweek' || value === 'daterange') {
              form.options = matchReg.daterange
            }
src/templates/comtableconfig/settingform/index.jsx
@@ -8,6 +8,7 @@
class SettingForm extends Component {
  static propTpyes = {
    dict: PropTypes.object, // 字典项
    menu: PropTypes.object,
    data: PropTypes.object,
    columns: PropTypes.array
  }
@@ -45,7 +46,7 @@
  }
  render() {
    const { data, dict } = this.props
    const { data, dict, menu } = this.props
    const { getFieldDecorator } = this.props.form
    const { interType } = this.state
@@ -67,6 +68,7 @@
        primaryKey = ''
      }
    }
    console.log(menu)
    return (
      <Form {...formItemLayout} className="ant-advanced-search-form commontable-setting-form" id="commontable-setting-form">
@@ -138,8 +140,8 @@
              })(<Input placeholder="" autoComplete="off" />)}
            </Form.Item>
          </Col> : null}
          <Col span={24}>
            <Form.Item label={
          {interType !== 'outer' ? <Col span={24}>
            <Form.Item help={'数据ID:' + menu.MenuID} label={
              <Tooltip placement="topLeft" title="使用系统函数时,需填写数据源,自定义函数时,可忽略。">
                <Icon type="question-circle" />
                {'数据源'}
@@ -149,7 +151,7 @@
                initialValue: data.dataresource
              })(<TextArea rows={4} />)}
            </Form.Item>
          </Col>
          </Col> : null}
          <Col span={12}>
            <Form.Item label="固定按钮">
              {getFieldDecorator('actionfixed', {
src/templates/modalconfig/index.jsx
@@ -495,7 +495,7 @@
        if (res.orderBy) {
          sql = sql + ' order by ' + res.orderBy + ' ' + res.orderType
        }
        console.log(sql)
        res.dataSourceSql = Utils.formatOptions(sql)
      }
@@ -1210,8 +1210,8 @@
          destroyOnClose
        >
          <SettingForm
            data={config.setting}
            dict={this.state.dict}
            config={config}
            wrappedComponentRef={(inst) => this.settingRef = inst}
          />
        </Modal>
src/templates/modalconfig/index.scss
@@ -247,14 +247,14 @@
          }
          .edit {
            position: absolute;
            left: 0;
            left: calc(33% - 100px);
            top: 0px;
            color: #1890ff;
            cursor: pointer;
            display: none;
          }
          .edit.close {
            left: 20px;
            left: calc(33% - 75px);
            color: #ff4d4f;
          }
        }
src/templates/modalconfig/settingform/index.jsx
@@ -1,12 +1,41 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Radio, InputNumber } from 'antd'
import { Form, Row, Col, Input, Radio, InputNumber, Select } from 'antd'
import './index.scss'
class SettingForm extends Component {
  static propTpyes = {
    dict: PropTypes.object, // 字典项
    data: PropTypes.object
    dict: PropTypes.object,  // 字典项
    config: PropTypes.object // 表单配置信息
  }
  state = {
    fields: null
  }
  UNSAFE_componentWillMount () {
    const { config } = this.props
    let fields = []
    if (config.groups.length > 0) {
      config.groups.forEach(group => {
        group.sublist.forEach(item => {
          if (item.field && (item.type === 'text' || item.type === 'number')) {
            fields.push(item)
          }
        })
      })
    } else if (config.fields.length > 0) {
      config.fields.forEach(f => {
        if (f.field && (f.type === 'text' || f.type === 'number')) {
          fields.push(f)
        }
      })
    }
    console.log(fields)
    this.setState({
      fields: fields
    })
  }
  handleConfirm = () => {
@@ -23,7 +52,8 @@
  }
  render() {
    const { data } = this.props
    const { config, dict } = this.props
    const { fields } = this.state
    const { getFieldDecorator } = this.props.form
    const formItemLayout = {
@@ -36,27 +66,73 @@
        sm: { span: 16 }
      }
    }
    return (
      <Form {...formItemLayout} className="ant-advanced-search-form modal-setting-form">
        <Row gutter={24}>
          <Col span={12}>
            <Form.Item label="标题">
              {getFieldDecorator('title', {
                initialValue: data.title
                initialValue: config.setting.title
              })(<Input placeholder="" autoComplete="off"/>)}
            </Form.Item>
          </Col>
          <Col span={12}>
            <Form.Item label="宽度">
              {getFieldDecorator('width', {
                initialValue: data.width
              })(<InputNumber min={30} max={90} precision={0} />)}
                initialValue: config.setting.width
              })(<InputNumber min={10} max={90} precision={0} />)}
            </Form.Item>
          </Col>
          <Col span={12}>
            <Form.Item label="焦点">
              {getFieldDecorator('focus', {
                initialValue: config.setting.focus || ''
              })(
                <Select
                  showSearch
                  filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                >
                  <Select.Option value="">
                    {dict['header.form.empty']}
                  </Select.Option>
                  {fields.map(option =>
                    <Select.Option id={option.uuid} title={option.label} key={option.uuid} value={option.field}>
                      {option.label}
                    </Select.Option>
                  )}
                </Select>
              )}
            </Form.Item>
          </Col>
          <Col span={12}>
            <Form.Item label="完成后">
              {getFieldDecorator('finish', {
                initialValue: config.setting.finish || 'close'
              })(
                <Radio.Group>
                  <Radio value="close">关闭</Radio>
                  <Radio value="unclose">不关闭</Radio>
                </Radio.Group>
              )}
            </Form.Item>
          </Col>
          <Col span={12}>
            <Form.Item label="点击空白处">
              {getFieldDecorator('clickouter', {
                initialValue: config.setting.clickouter || 'unclose'
              })(
                <Radio.Group>
                  <Radio value="close">关闭</Radio>
                  <Radio value="unclose">不关闭</Radio>
                </Radio.Group>
              )}
            </Form.Item>
          </Col>
          <Col span={12}>
            <Form.Item label="列数">
              {getFieldDecorator('cols', {
                initialValue: data.cols
                initialValue: config.setting.cols
              })(
                <Radio.Group>
                  <Radio value="1">1列</Radio>
@@ -69,7 +145,7 @@
          <Col span={12}>
            <Form.Item label="挂载对象">
              {getFieldDecorator('container', {
                initialValue: data.container || 'view'
                initialValue: config.setting.container || 'view'
              })(
                <Radio.Group>
                  <Radio value="view">页面</Radio>
src/templates/modalconfig/source.jsx
@@ -11,7 +11,10 @@
      title: '',
      width: 60,
      cols: '2',
      container: 'view'
      container: 'view',
      focus: '',
      finish: 'close',
      clickouter: 'unclose'
    },
    tables: [],
    groups: [],
src/utils/option.js
@@ -28,11 +28,14 @@
  ],
  daterange: [
    {value: '', text: _dict['date.empty']},
    {value: '0', text: '今天'},
    {value: 1, text: '昨天'},
    {value: 3, text: '前三天'},
    {value: 7, text: '前七天'},
    {value: 30, text: '前30天'}
    {value: '[0, 0]', text: '今天'},
    {value: '[1, 1]', text: '昨天'},
    {value: '[3, 0]', text: '近三天'},
    {value: '[7, 0]', text: '近七天'},
    {value: '[30, 0]', text: '近30天'},
    {value: '[7, -7]', text: '前后七天'},
    {value: '[30, -30]', text: '前后30天'},
    {value: '[90, -90]', text: '前后90天'}
  ],
  datetime: [
    {value: '', text: _dict['date.empty']},
@@ -71,6 +74,13 @@
  }, {
    value: '<=',
    text: '<='
  }, {
    value: '=',
    text: '='
  }],
  datemonth: [{
    value: 'between',
    text: 'between'
  }],
  daterange: [{
    value: 'between',
src/utils/utils.js
@@ -223,7 +223,7 @@
  }
  /**
   * @description 拼接搜索条件
   * @description 拼接搜索条件main
   * @param {Array}   searches     搜索条件
   * @return {String}  searchText  拼接结果
   */
@@ -244,12 +244,17 @@
        let timetail = ' 00:00:00.000'
        if (item.match === '<' || item.match === '<=') {
          timetail = ' 23:59:59.999'
        } else if (item.match === '=') {
          timetail = ''
        }
        // eslint-disable-next-line
        searchText += '(' + item.key + ' ' + item.match + ' ' + '\'' + item.value + timetail + '\')'
      } else if (item.type === 'datemonth') {
        // 月-过滤条件,从月开始至结束
        let _startval = moment(item.value, 'YYYY-MM').startOf('month').format('YYYY-MM-DD') + ' 00:00:00.000'
        let _endval = moment(item.value, 'YYYY-MM').endOf('month').format('YYYY-MM-DD') + ' 23:59:59.999'
        // eslint-disable-next-line
        searchText += '(' + item.key + ' ' + item.match + ' ' + '\'' + item.value + '\')'
        searchText += '(' + item.key + ' ' + item.match + ' ' + '\'' + _startval + '\' AND \'' + _endval + '\')'
      } else if (item.type === 'dateweek') {
        let stimetail = ' 00:00:00.000'
        let etimetail = ' 23:59:59.999'
@@ -269,7 +274,7 @@
  }
  /**
   * @description 拼接搜索条件
   * @description 拼接搜索条件datamanage
   * @param {Array}   searches     搜索条件
   * @return {String}  searchText  拼接结果
   */
@@ -323,8 +328,6 @@
   * @return {String} table  表名
   */
  static getSysDefaultSql (btn, setting, formdata) {
    console.log(btn)
    console.log(formdata)
    let _sql = ''
    if (btn.OpenType === 'pop' && btn.sqlType === 'insert') {
      let keys = []
@@ -358,14 +361,6 @@
    } else if ((btn.OpenType === 'prompt' || btn.OpenType === 'exec') && btn.sqlType === 'delete') {
      _sql = `insert into snote (remark,createuserid) select '删除表:${btn.sql} 数据: id='+@id,@userid delete ${btn.sql} where ${setting.primaryKey}=@id`
    }
    //insert into 表名 (表单字段,逗号分隔,如果主键为可编辑则传填写内容,只读或没有配置表单,则传前端生成id,+createuserid)
    // +select 表单字段值+@userid
    // 修改:update 表名 set 表单非只读字段=表单值,modifydate=getdate(),modifyuserid=@userid where 主键=@id行id
    // 逻辑删除:update 表名 set deleted=1,modifydate=getdate(),modifyuserid=@userid where 主键=@id行id
    // 物理删除:insert into snote (remark,createuserid) select '删除表 '+表名+'数据 '+id=@id delete 表名 where  主键=@id行id
    console.log(_sql)
    return _sql
  }
@@ -382,10 +377,11 @@
   * @description 创建存储过程
   * @return {String}
   */
  static getfunc (param) {
  static getfunc (param, btn, menu, columns) {
    let form = ''
    let formParam = ''
    console.log(menu)
    console.log(columns)
    if (param.fields && param.fields.length > 0) {
      let _fields = []
      param.fields.forEach(item => {
@@ -420,8 +416,33 @@
      `
    }
    if (columns) {
      let _col = []
      let _field = []
      columns.forEach(col => {
        if (col.field) {
          if (col.type === 'number') {
            _col.push(col.field + ' decimal(18,2)')
          } else {
            _col.push(col.field + ' nvarchar(50)')
          }
          _field.push(col.field)
        }
      })
      _col = _col.join(',')
      _field = _field.join(',')
      form = form + `
        declare @dc table (${_col})
        insert into @dc (${_field})
        @tableid ='${menu.MenuID}'
      `
    }
    let Ltext = `create proc ${param.funcName}
    (
    ( /*${menu.MenuName}  ${btn.label}*/
    @BID nvarchar(50)='',
    @ID nvarchar(50)='',${formParam}
    @sEPTMenuNo nvarchar(50)='${param.menuNo}',
@@ -490,8 +511,9 @@
      ROLLBACK TRAN
      
    END`
    Ltext = Ltext.replace(/\n\s{4}/ig, 'mchr13k')
    console.log(Ltext)
    Ltext = Ltext.replace(/\n\s{4}/ig, 'mchr13k')
    return Ltext
  }
}