king
2019-12-31 46f59e30133c25f1f01074b1c92445f9e85b8c98
2019-12-31
25个文件已修改
478 ■■■■ 已修改文件
src/assets/css/action.scss 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/locales/en-US/comtable.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/locales/zh-CN/comtable.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/commontable/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/subtabtable/index.scss 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/tableshare/actionList/index.jsx 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/tableshare/actionList/index.scss 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/actionform/index.jsx 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/index.jsx 123 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/index.scss 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/tabdragelement/index.jsx 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/dragelement/index.jsx 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/index.jsx 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/modalform/index.jsx 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/subtableconfig/actionform/index.jsx 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/subtableconfig/index.jsx 47 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/subtableconfig/index.scss 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/tableshare/colspanform/index.jsx 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/tableshare/columnform/index.jsx 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/tableshare/dragelement/card.jsx 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/tableshare/dragelement/index.jsx 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/tableshare/searchform/index.jsx 60 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/tableshare/searchform/index.scss 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/option.js 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils.js 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/css/action.scss
@@ -106,6 +106,19 @@
    background-color: #fff;
    border-color: #c49f47;
  }
  // 橙色
  .mk-orange, .mk-orange:hover, .mk-orange:active, .mk-orange:focus {
    color: #fff;
    background-color: orange;
    border-color: orange;
  }
  .mk-border-orange, .mk-border-orange:hover, .mk-border-orange:active, .mk-border-orange:focus {
    color: orange;
    background-color: #fff;
    border-color: orange;
  }
  // 灰色
  .mk-gray, .mk-gray:hover, .mk-gray:active, .mk-gray:focus {
src/locales/en-US/comtable.js
@@ -87,6 +87,7 @@
  'header.form.number': '数字',
  'header.form.colspan': '合并列',
  'header.form.select': 'Select',
  'header.form.multiselect': '多选',
  'header.form.link': '关联菜单',
  'header.form.dateday': 'Date(Day)',
  'header.form.datetime': 'Date(Second)',
src/locales/zh-CN/comtable.js
@@ -87,6 +87,7 @@
  'header.form.number': '数字',
  'header.form.colspan': '合并列',
  'header.form.select': '选择',
  'header.form.multiselect': '多选',
  'header.form.link': '关联菜单',
  'header.form.dateday': '日期(天)',
  'header.form.datetime': '日期(秒)',
src/tabviews/commontable/index.jsx
@@ -370,7 +370,7 @@
    let LText = `select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${_dataresource} ${_search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows`
    let DateCount = `select count(1) as total from ${_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)
src/tabviews/subtabtable/index.scss
@@ -7,16 +7,6 @@
  }
  > .button-list {
    padding: 10px 0px 5px;
    button {
      margin-right: 15px;
      margin-bottom: 10px;
    }
    .ant-spin {
      position: fixed;
      z-index: 1010;
      left: 50vw;
      top: calc(50vh - 70px);
    }
  }
  .box404 {
    padding-top: 30px;
src/tabviews/tableshare/actionList/index.jsx
@@ -117,6 +117,9 @@
    }
  }
  /**
   * @description 按钮提交执行
   */
  execSubmit = (btn, data, _resolve, formdata) => {
    const { setting } = this.props
    if (btn.intertype === 'inner') {
@@ -828,7 +831,7 @@
    if (this.props.setting.actionfixed && this.props.type === 'main') { // 按钮是否固定在头部
      return (
        <Affix offsetTop={48}>
          <div className="button-list" id={this.props.MenuID + 'mainaction'}>
          <div className="button-list toolbar-button" id={this.props.MenuID + 'mainaction'}>
            {this.props.actions.map((item, index) => {
              if (loadingUuid === item.uuid) {
                return (
@@ -858,7 +861,7 @@
      )
    } else {
      return (
        <div className="button-list">
        <div className="button-list toolbar-button">
          {this.props.actions.map((item, index) => {
            if (loadingUuid === item.uuid) {
              return (
src/tabviews/tableshare/actionList/index.scss
@@ -1,14 +1,15 @@
.commontable .button-list {
.button-list.toolbar-button {
  padding: 10px 20px 5px;
  background: #ffffff;
  button {
    min-width: 65px;
    margin-right: 15px;
    margin-bottom: 10px;
  }
  .ant-spin {
    position: fixed;
    z-index: 1010;
    left: 50vw;
    left: calc(50vw - 22px);
    top: calc(50vh - 70px);
  }
}
src/templates/comtableconfig/actionform/index.jsx
@@ -159,6 +159,19 @@
    })
  }
  componentDidMount () {
    const { card } = this.props
    if (card.focus) {
      try {
        let _form = document.getElementById('label')
        _form.select()
      } catch {
        console.warn('表单focus失败!')
      }
    }
  }
  // 打开方式或显示位置变化
  openTypeChange = (key, value) => {
    if (key === 'OpenType') {
src/templates/comtableconfig/index.jsx
@@ -108,13 +108,13 @@
      })
    }
    // _config.tabs = _config.tabs || []
    // _config.tabgroups = _config.tabgroups || ['tabs']
    // _config.setting.subtabs = _config.setting.subtabs || []
    _config.tabs = _config.tabs || []
    _config.tabgroups = _config.tabgroups || ['tabs']
    _config.setting.subtabs = _config.setting.subtabs || []
    this.setState({
      originActions: _oriActions,
      config: _config,
      originActions: _oriActions,
      originMenu: JSON.parse(JSON.stringify(menu)),
      selectedTables: _config.tables || [],
      menuformlist: [
@@ -358,7 +358,16 @@
          key: 'field',
          label: this.state.dict['header.form.field'],
          initVal: card.field,
          tooltip: '字段名可以使用逗号分隔,进行多字段综合搜索,注:综合搜索仅在文本类型时有效',
          tooltipClass: 'middle',
          required: true,
          rules: [{
            pattern: /^[\u4E00-\u9FA50-9a-zA-Z,_]*$/ig,
            message: '字段名只允许包含数字、字母、汉字以及_'
          }, {
            max: 50,
            message: '字段名最多50个字符!'
          }],
          readonly: false
        },
        {
@@ -373,6 +382,9 @@
          }, {
            value: 'select',
            text: this.state.dict['header.form.select']
          }, {
            value: 'multiselect',
            text: this.state.dict['header.form.multiselect']
          }, {
            value: 'link',
            text: this.state.dict['header.form.link']
@@ -832,6 +844,13 @@
            label: this.state.dict['header.form.field'],
            initVal: card.field,
            required: true,
            rules: [{
              pattern: /^[\u4E00-\u9FA50-9a-zA-Z_]*$/ig,
              message: '字段名只允许包含数字、字母、汉字以及_'
            }, {
              max: 50,
              message: '字段名最多50个字符!'
            }],
            readonly: false
          },
          {
@@ -1159,9 +1178,15 @@
        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
            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 ' + res.values.dataSource
              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
@@ -1823,13 +1848,24 @@
      cancelText: this.state.dict['header.cancel'],
      onOk() {
        let _config = JSON.parse(JSON.stringify(_this.state.config))
        _config[element.type] = _config[element.type].filter(item => {
          if (item.uuid === element.card.uuid) {
            return false
          } else {
            return true
          }
        })
        if (element.type === 'tabs') {
          _config[element.card.groupId] = _config[element.card.groupId].filter(item => {
            if (item.uuid === element.card.uuid) {
              return false
            } else {
              return true
            }
          })
        } else {
          _config[element.type] = _config[element.type].filter(item => {
            if (item.uuid === element.card.uuid) {
              return false
            } else {
              return true
            }
          })
        }
        let refreshtype = element.type + 'loading'
@@ -1849,6 +1885,10 @@
      },
      onCancel() {}
    })
  }
  profileAction = (element) => {
    console.log(element)
  }
  changeTemplate = () => {
@@ -1882,6 +1922,17 @@
      let _LongParam = ''
      let _config = {...config, tables: this.state.selectedTables}
      let _pageParam = {...menu.PageParam, OpenType: res.opentype}
      // 未设置数据源或标签不合法时,启用状态为false
      if (_config.setting.interType === 'inner' && !_config.setting.innerFunc && !_config.setting.dataresource) {
        _config.enabled = false
      } else if (_config.tabgroups.length > 1) {
        _config.tabgroups.forEach(group => {
          if (_config[group].length === 0) {
            _config.enabled = false
          }
        })
      }
      // 保存时删除配置类型,system 、user
      delete _config.type
@@ -2617,12 +2668,35 @@
    }
  }
  onEnabledChange = () => {
  onEnabledChange = (val, e) => {
    const { config } = this.state
    this.setState({
      config: {...config, enabled: !config.enabled}
    })
    let tabinvalid = true
    if (config.tabgroups.length > 1) {
      config.tabgroups.forEach(group => {
        if (config[group].length === 0) {
          tabinvalid = false
        }
      })
    }
    if (config.setting.interType === 'inner' && !config.setting.innerFunc && !config.setting.dataresource) {
      notification.warning({
        top: 92,
        message: '菜单尚未设置数据源,不可启用!',
        duration: 10
      })
    } else if (!tabinvalid) {
      notification.warning({
        top: 92,
        message: '菜单标签页设置错误(多行标签内,行标签不可为空),不可启用!',
        duration: 10
      })
    } else {
      this.setState({
        config: {...config, enabled: !config.enabled}
      })
    }
  }
  onColumnNameChange = () => {
@@ -2690,6 +2764,11 @@
    const configAction = this.state.config.action.filter(_action =>
      !_action.origin && (_action.OpenType === 'pop' || _action.OpenType === 'popview' || _action.OpenType === 'blank' || _action.OpenType === 'tab')
    )
    let configTabs = []
    this.state.config.tabgroups.forEach(group => {
      configTabs.push(...this.state.config[group])
    })
    return (
      <div className="common-table-board">
@@ -2773,7 +2852,7 @@
                      <Button
                        icon={item.icon}
                        style={{marginBottom: '10px'}}
                        className={'mk-btn mk-' + item.class}
                        className={'config-button mk-btn mk-' + item.class}
                        onClick={() => this.setSubConfig(item, 'button')}
                      >{item.label}</Button>
                    </div>
@@ -2796,7 +2875,7 @@
                    return (<SourceElement key={index} content={item}/>)
                  })}
                </div>
                {this.state.config.tabs.length > 0 ?
                {configTabs.length > 0 ?
                  <p className="config-btn-title">
                    <Tooltip placement="topLeft" title="点击按钮,可完成或查看标签配置信息。">
                      <Icon type="question-circle" />
@@ -2804,10 +2883,11 @@
                    {this.state.dict['header.menu.tab.configurable']}
                  </p> : null
                }
                {this.state.config.tabs.map((item, index) => {
                {configTabs.map((item, index) => {
                  return (
                    <div key={index}>
                      <Button
                        className="config-button"
                        icon={item.icon}
                        style={{marginBottom: '10px'}}
                        onClick={() => this.setSubConfig(item, 'tab')}
@@ -2821,7 +2901,7 @@
          <div className="setting">
            <Card title={this.state.dict['header.menu.page.configurable']} bordered={false} extra={
              <div>
                <Switch className="big" checkedChildren="启" unCheckedChildren="停" defaultChecked={this.state.config.enabled} onChange={this.onEnabledChange} />
                <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={this.state.config.enabled} onChange={this.onEnabledChange} />
                <Button type="primary" onClick={this.changeTemplate}>{this.state.dict['header.menu.template.change']}</Button>
                <Button type="primary" onClick={this.submitConfig} loading={this.state.menuloading}>{this.state.dict['header.save']}</Button>
                <Button onClick={this.cancelConfig}>{this.state.dict['header.return']}</Button>
@@ -2855,6 +2935,7 @@
                    handleMenu={this.handleAction}
                    copyElement={(val) => this.handleAction(val, 'copy')}
                    deleteMenu={this.deleteElement}
                    profileMenu={this.profileAction}
                    placeholder={this.state.dict['header.form.action.placeholder']}
                  /> : null
                }
src/templates/comtableconfig/index.scss
@@ -96,6 +96,9 @@
      color: #c49f47;
      margin-right: 3px;
    }
    .config-button {
      min-width: 65px;
    }
  }
  .tools:hover {
    overflow-y: auto;
@@ -269,8 +272,13 @@
            left: 20px;
            color: #26C281;
          }
          .edit.profile {
            left: 60px;
            color: purple;
          }
          button {
            cursor: move;
            min-width: 65px;
            .anticon-table {
              font-size: 10px;
              position: absolute;
src/templates/comtableconfig/tabdragelement/index.jsx
@@ -62,12 +62,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/dragelement/index.jsx
@@ -77,7 +77,8 @@
      newcard.orderBy = ''
      newcard.orderType = 'asc'
      newcard.readonly = 'false'
      newcard.required = 'false'
      newcard.required = 'true'
      newcard.focus = true
      let targetId = cards.length > 0 ? cards[cards.length - 1].uuid : 0
      if (target) {
src/templates/modalconfig/index.jsx
@@ -506,9 +506,15 @@
      let _config = JSON.parse(JSON.stringify(this.state.config))
      if ((res.type === 'select' || res.type === 'link') && res.resourceType === '1') {
        let sql = 'select ' + res.valueField + ',' + res.valueText + ' from ' + res.dataSource
        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 ' + res.dataSource
          sql = 'select ' + res.valueField + ',' + res.valueText + ',' + res.linkField + ' from ' + _datasource
        }
        if (res.orderBy) {
          sql = sql + ' order by ' + res.orderBy + ' ' + res.orderType
src/templates/modalconfig/modalform/index.jsx
@@ -56,6 +56,19 @@
    })
  }
  componentDidMount () {
    const { card } = this.props
    if (card.focus) {
      try {
        let _form = document.getElementById('label')
        _form.select()
      } catch {
        console.warn('表单focus失败!')
      }
    }
  }
  openTypeChange = (key, value) => {
    if (key === 'type') {
      let _options = ['label', 'field', 'initval', 'type', 'readonly', 'required']
@@ -133,6 +146,7 @@
  getFields() {
    const { getFieldDecorator } = this.props.form
    const fields = []
    this.state.formlist.forEach((item, index) => {
      if (item.hidden) return
src/templates/subtableconfig/actionform/index.jsx
@@ -139,6 +139,19 @@
    })
  }
  componentDidMount () {
    const { card } = this.props
    if (card.focus) {
      try {
        let _form = document.getElementById('label')
        _form.select()
      } catch {
        console.warn('表单focus失败!')
      }
    }
  }
  // 打开方式或显示位置变化
  openTypeChange = (key, value) => {
    if (key === 'OpenType') {
src/templates/subtableconfig/index.jsx
@@ -313,7 +313,16 @@
          key: 'field',
          label: this.state.dict['header.form.field'],
          initVal: card.field,
          tooltip: '字段名可以使用逗号分隔,进行多字段综合搜索,注:综合搜索仅在文本类型时有效',
          tooltipClass: 'middle',
          required: true,
          rules: [{
            pattern: /^[\u4E00-\u9FA50-9a-zA-Z,_]*$/ig,
            message: '字段名只允许包含数字、字母、汉字以及_'
          }, {
            max: 50,
            message: '字段名最多50个字符!'
          }],
          readonly: false
        },
        {
@@ -328,6 +337,9 @@
          }, {
            value: 'select',
            text: this.state.dict['header.form.select']
          }, {
            value: 'multiselect',
            text: this.state.dict['header.form.multiselect']
          }, {
            value: 'link',
            text: this.state.dict['header.form.link']
@@ -760,6 +772,13 @@
            label: this.state.dict['header.form.field'],
            initVal: card.field,
            required: true,
            rules: [{
              pattern: /^[\u4E00-\u9FA50-9a-zA-Z_]*$/ig,
              message: '字段名只允许包含数字、字母、汉字以及_'
            }, {
              max: 50,
              message: '字段名最多50个字符!'
            }],
            readonly: false
          },
          {
@@ -977,9 +996,15 @@
        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
            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 ' + res.values.dataSource
              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
@@ -2334,9 +2359,17 @@
  onEnabledChange = () => {
    const { config } = this.state
    this.setState({
      config: {...config, enabled: !config.enabled}
    })
    if (config.setting.interType === 'inner' && !config.setting.innerFunc && !config.setting.dataresource) {
      notification.warning({
        top: 92,
        message: '菜单尚未设置数据源,不可启用!',
        duration: 10
      })
    } else {
      this.setState({
        config: {...config, enabled: !config.enabled}
      })
    }
  }
  onColumnNameChange = () => {
@@ -2439,7 +2472,7 @@
                      <Button
                        icon={item.icon}
                        style={{marginBottom: '10px'}}
                        className={'mk-btn mk-' + item.class}
                        className={'config-button mk-btn mk-' + item.class}
                        onClick={() => this.setSubConfig(item)}
                      >{item.label}</Button>
                    </div>
@@ -2460,7 +2493,7 @@
          <div className="setting">
            <Card title={'标签(子表)页面配置'} bordered={false} extra={
              <div>
                <Switch className="big" checkedChildren="启" unCheckedChildren="停" defaultChecked={this.state.config.enabled} onChange={this.onEnabledChange} />
                <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={this.state.config.enabled} onChange={this.onEnabledChange} />
                {/* <Button type="primary" onClick={this.changeTemplate}>{this.state.dict['header.menu.template.change']}</Button> */}
                <Button type="primary" onClick={this.submitConfig} loading={this.state.menuloading}>{this.state.dict['header.save']}</Button>
                <Button onClick={this.cancelConfig}>{this.state.dict['header.return']}</Button>
src/templates/subtableconfig/index.scss
@@ -96,6 +96,9 @@
      color: #c49f47;
      margin-right: 3px;
    }
    .config-button {
      min-width: 65px;
    }
  }
  .tools:hover {
    overflow-y: auto;
src/templates/tableshare/colspanform/index.jsx
@@ -15,6 +15,19 @@
  }
  componentDidMount () {
    const { card } = this.props
    if (card.focus) {
      try {
        let _form = document.getElementById('label')
        _form.select()
      } catch {
        console.warn('表单focus失败!')
      }
    }
  }
  handleConfirm = () => {
    // 表单提交时检查输入值是否正确
    return new Promise((resolve, reject) => {
src/templates/tableshare/columnform/index.jsx
@@ -39,6 +39,19 @@
    })
  }
  componentDidMount () {
    const { card } = this.props
    if (card.focus) {
      try {
        let _form = document.getElementById('label')
        _form.select()
      } catch {
        console.warn('表单focus失败!')
      }
    }
  }
  typeChange = (key, value) => {
    if (key === 'type') {
      let _options = ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width']
@@ -83,6 +96,7 @@
      if (item.hidden) return
      if (item.type === 'text') { // 文本搜索
        let rules = item.rules || []
        fields.push(
          <Col span={12} key={index}>
            <Form.Item label={item.tooltip ?
@@ -97,7 +111,8 @@
                  {
                    required: !!item.required,
                    message: this.props.dict['form.required.input'] + item.label + '!'
                  }
                  },
                  ...rules
                ]
              })(<Input placeholder="" autoComplete="off" disabled={item.readonly} />)}
            </Form.Item>
src/templates/tableshare/dragelement/card.jsx
@@ -7,7 +7,7 @@
const { MonthPicker, WeekPicker, RangePicker } = DatePicker
const Card = ({ id, type, card, moveCard, findCard, editCard, delCard, copyCard, hasDrop, showfield }) => {
const Card = ({ id, type, card, moveCard, findCard, editCard, delCard, copyCard, profileCard, hasDrop, showfield }) => {
  const originalIndex = findCard(id).index
  const [{ isDragging }, drag] = useDrag({
    item: { type: ItemTypes[type], id, originalIndex },
@@ -44,10 +44,14 @@
  const copy = () => {
    copyCard(id)
  }
  const profile = () => {
    profileCard(id)
  }
  let _defaultValue = '' // 下拉搜索、时间范围类型,初始值需要预处理
  if (type === 'search' && card.type === 'select') {
  if (type === 'search' && (card.type === 'multiselect' || card.type === 'select' || card.type === 'link')) {
    if (card.initval) {
      let _option = card.options.filter(option => option.Value === card.initval)[0]
      if (_option) {
@@ -82,7 +86,7 @@
              {card.type === 'text' ?
                <Input style={{marginTop: '4px'}} defaultValue={card.initval} /> : null
              }
              {(card.type === 'select' || card.type === 'link') ?
              {(card.type === 'multiselect' || card.type === 'select' || card.type === 'link') ?
                <Select defaultValue={_defaultValue}></Select> : null
              }
              {card.type === 'date' ?
@@ -134,9 +138,12 @@
          </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} /> : null}
      <Icon className="edit" title="编辑" type="edit" onClick={edit} />
      <Icon className="edit close" title="删除" type="close" onClick={del} />
      {type === 'action' ? <Icon className="edit copy" title="复制" type="copy" onClick={copy} /> : null}
      {type === 'action' && ['pop', 'prompt', 'exec'].includes(card.OpenType) && card.intertype === 'inner' && !card.innerFunc ?
        <Icon className="edit profile" title="校验规则" type="profile" onClick={profile} /> : null
      }
    </div>
  )
}
src/templates/tableshare/dragelement/index.jsx
@@ -7,7 +7,7 @@
import ItemTypes from './itemtypes'
import './index.scss'
const Container = ({list, setting, gridBtn, type, placeholder, handleList, handleMenu, deleteMenu, copyElement, handleGridBtn, showfield }) => {
const Container = ({list, setting, gridBtn, type, placeholder, handleList, handleMenu, deleteMenu, copyElement, profileMenu, handleGridBtn, showfield }) => {
  let target = null
  const [cards, setCards] = useState(list)
  const moveCard = (id, atIndex) => {
@@ -28,6 +28,11 @@
  const editCard = id => {
    const { card } = findCard(id)
    handleMenu(card)
  }
  const profileCard = id => {
    const { card } = findCard(id)
    profileMenu(card)
  }
  const delCard = id => {
@@ -59,6 +64,9 @@
      }
      let newcard = {}
      newcard.uuid = Utils.getuuid()
      newcard.focus = true
      if (item.type === 'search') {
        let _match = 'like'
        if (item.subType === 'select' || item.subType === 'link') {
@@ -68,7 +76,7 @@
        } else if (item.subType === 'dateweek' || item.subType === 'daterange') {
          _match = 'between'
        }
        newcard.uuid = Utils.getuuid()
        newcard.label = 'label'
        newcard.field = ''
        newcard.initval = ''
@@ -85,7 +93,6 @@
        newcard.match = _match
        newcard.display = 'dropdown'
      } else if (item.type === 'action') {
        newcard.uuid = Utils.getuuid()
        newcard.label = 'button'
        newcard.innerFunc = ''
        newcard.outerFunc = ''
@@ -114,7 +121,6 @@
          newcard.label = item.label
        }
      } else if (item.type === 'columns') {
        newcard.uuid = Utils.getuuid()
        newcard.Align = 'left'
        newcard.label = 'label'
        newcard.field = ''
@@ -137,12 +143,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)
@@ -190,6 +196,7 @@
          editCard={editCard}
          delCard={delCard}
          copyCard={copyCard}
          profileCard={profileCard}
          findCard={findCard}
          hasDrop={hasDrop}
        />
src/templates/tableshare/searchform/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 } from 'antd'
import { Form, Row, Col, Input, Select, Icon, Radio, notification, Tooltip } from 'antd'
import { dateOptions, matchReg } from '@/utils/option.js'
import EditTable from '../editable'
import './index.scss'
@@ -32,10 +32,14 @@
    let resourceType = formlist.filter(cell => cell.key === 'resourceType')[0].initVal
    let _options = ['label', 'field', 'initval', 'type', 'match']                // 默认显示项
    if ((type === 'select' || type === 'link') && resourceType === '0') {        // 下拉选择类型、选项为自定义资源
      _options = [..._options, 'resourceType', 'setAll', 'options', 'display']
    } else if ((type === 'select' || type === 'link') && resourceType === '1') { // 下拉选择类型、选项为后台数据源中获取
      _options = [..._options, 'resourceType', 'setAll', 'dataSource', 'valueField', 'valueText', 'orderBy', 'orderType', 'display']
    if ((type === 'multiselect' || type === 'select' || type === 'link') && resourceType === '0') {        // 下拉选择类型、选项为自定义资源
      _options = [..._options, 'resourceType', 'options', 'display']
    } else if ((type === 'multiselect' || type === 'select' || type === 'link') && resourceType === '1') { // 下拉选择类型、选项为后台数据源中获取
      _options = [..._options, 'resourceType', 'dataSource', 'valueField', 'valueText', 'orderBy', 'orderType', 'display']
    }
    if (type === 'select' || type === 'link') {
      _options.push('setAll')
    }
    if (type === 'link') { // 关联类型、增加关联上级的字段名
@@ -55,7 +59,7 @@
        if (form.key === 'match') {
          if (type === 'text') {
            form.options = matchReg.text
          } else if (type === 'select' || type === 'link') {
          } else if (type === 'multiselect' || type === 'select' || type === 'link') {
            form.options = matchReg.select
          } else if (type === 'date') {
            form.options = matchReg.date
@@ -71,6 +75,19 @@
    })
  }
  componentDidMount () {
    const { card } = this.props
    if (card.focus) {
      try {
        let _form = document.getElementById('label')
        _form.select()
      } catch {
        console.warn('表单focus失败!')
      }
    }
  }
  /**
   * @description 搜索条件类型切换
   */
@@ -80,10 +97,14 @@
    if (key === 'type') {
      let _options = ['label', 'field', 'initval', 'type', 'match']
      if ((value === 'select' || value === 'link') && resourceType === '0') {        // 下拉选择类型、选项为自定义资源
        _options = [..._options, 'resourceType', 'setAll', 'options', 'display']
      } else if ((value === 'select' || value === 'link') && resourceType === '1') { // 下拉选择类型、选项为后台数据源中获取
        _options = [..._options, 'resourceType', 'setAll', 'dataSource', 'valueField', 'valueText', 'orderBy', 'orderType', 'display']
      if ((value === 'multiselect' || value === 'select' || value === 'link') && resourceType === '0') {        // 下拉选择类型、选项为自定义资源
        _options = [..._options, 'resourceType', 'options', 'display']
      } else if ((value === 'multiselect' || value === 'select' || value === 'link') && resourceType === '1') { // 下拉选择类型、选项为后台数据源中获取
        _options = [..._options, 'resourceType', 'dataSource', 'valueField', 'valueText', 'orderBy', 'orderType', 'display']
      }
      if (value === 'select' || value === 'link') {
        _options.push('setAll')
      }
      
      if (value === 'link') {
@@ -107,7 +128,7 @@
          } else if (form.key === 'match') {                     // 搜索条件类型切换时,匹配规则类型对应切换
            if (value === 'text') {
              form.options = matchReg.text
            } else if (value === 'select' || value === 'link') {
            } else if (value === 'multiselect' || value === 'select' || value === 'link') {
              form.options = matchReg.select
            } else if (value === 'date') {
              form.options = matchReg.date
@@ -147,12 +168,16 @@
    let value = e.target.value
    if (key === 'resourceType') {
      let _options = ['label', 'field', 'initval', 'type', 'match', 'resourceType', 'setAll', 'display']
      let _options = ['label', 'field', 'initval', 'type', 'match', 'resourceType', 'display']
      if (value === '0') {
        _options = [..._options, 'options']
      } else if (value === '1') {
        _options = [..._options, 'dataSource', 'valueField', 'valueText', 'orderBy', 'orderType']
      }
      if (openType === 'select' || openType === 'link') {
        _options.push('setAll')
      }
      
      if (openType === 'link') {
@@ -176,16 +201,23 @@
      if (item.hidden) return
      if (item.type === 'text') { // 文本搜索
        let rules = item.rules || []
        fields.push(
          <Col span={12} key={index}>
            <Form.Item label={item.label}>
            <Form.Item label={item.tooltip ?
              <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}>
                <Icon type="question-circle" />
                {item.label}
              </Tooltip> : item.label
            }>
              {getFieldDecorator(item.key, {
                initialValue: item.initVal || '',
                rules: [
                  {
                    required: !!item.required,
                    message: this.props.dict['form.required.input'] + item.label + '!'
                  }
                  },
                  ...rules
                ]
              })(<Input placeholder="" autoComplete="off" disabled={item.readonly} />)}
            </Form.Item>
src/templates/tableshare/searchform/index.scss
@@ -10,4 +10,9 @@
      width: 100%;
    }
  }
  .anticon-question-circle {
    color: #c49f47;
    position: relative;
    left: -3px;
  }
}
src/utils/option.js
@@ -134,6 +134,9 @@
  value: 'yellow',
  text: '黄色'
}, {
  value: 'orange',
  text: '橙色'
}, {
  value: 'danger',
  text: '红色'
}, {
@@ -158,6 +161,9 @@
  value: 'border-yellow',
  text: '白底黄框'
}, {
  value: 'border-orange',
  text: '白底橙框'
}, {
  value: 'border-danger',
  text: '白底红框'
}, {
src/utils/utils.js
@@ -290,6 +290,10 @@
        newsearches[item.key] = item.value ? item.value[0] + ' 00:00:00.000' : null
        newsearches[item.key + '1'] = item.value ? _endval + ' 00:00:00.000' : null
      } else if (item.type === 'text') {
        item.key.split(',').forEach(field => { // 综合搜索,所字段拼接
          newsearches[field] = item.value
        })
      } else {
        newsearches[item.key] = item.value
      }
@@ -309,13 +313,18 @@
    let searchText = ''
    searches.forEach(item => {
      if (!item.value) return
      // eslint-disable-next-line
      searchText += (searchText !== '' ? ' ' + 'AND' + ' ' : '')
      if (item.type === 'text' || item.type === 'select') {
        // eslint-disable-next-line
      searchText += (searchText !== '' ? ' AND ' : '')
      if (item.type === 'text') {
        let str = item.match === '=' ? '' : '%'
        // eslint-disable-next-line
        searchText += item.key + ' ' + item.match + ' ' + '\'' + str + item.value + str + '\''
        let fields = item.key.split(',').map(field => { // 综合搜索,所字段拼接
          return field + ' ' + item.match + ' \'' + str + item.value + str + '\''
        })
        searchText += '(' + fields.join(' OR ') + ')'
      } else if (item.type === 'select') {
        let str = item.match === '=' ? '' : '%'
        searchText += item.key + ' ' + item.match + ' \'' + str + item.value + str + '\''
      } else if (item.type === 'date') {
        let _val = item.value
        let timetail = ' 00:00:00.000'
@@ -328,29 +337,24 @@
          timetail = ''
        }
        // eslint-disable-next-line
        searchText += '(' + item.key + ' ' + _match + ' ' + '\'' + _val + timetail + '\')'
        searchText += '(' + item.key + ' ' + _match + ' \'' + _val + timetail + '\')'
      } else if (item.type === 'datemonth') { // 月-过滤条件,从月开始至结束,结束时间为月末加一天的0点,方式为<
        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').add(1, 'days').format('YYYY-MM-DD') + ' 00:00:00.000'
        // eslint-disable-next-line
        searchText += '(' + item.key + ' >= \'' + _startval + '\' AND ' + item.key + ' < \'' + _endval + '\')'
      } else if (item.type === 'dateweek') { // 周-过滤条件
        let _startval = item.value[0] + ' 00:00:00.000'
        let _endval = moment(item.value[1], 'YYYY-MM-DD').add(1, 'days').format('YYYY-MM-DD') + ' 00:00:00.000'
        // eslint-disable-next-line
        searchText += '(' + item.key + ' >= \'' + _startval + '\' AND ' + item.key + ' < \'' + _endval + '\')'
      } else if (item.type === 'daterange') {
        let _startval = item.value[0] + ' 00:00:00.000'
        let _endval = moment(item.value[1], 'YYYY-MM-DD').add(1, 'days').format('YYYY-MM-DD') + ' 00:00:00.000'
        // eslint-disable-next-line
        searchText += '(' + item.key + ' >= \'' + _startval + '\' AND ' + item.key + ' < \'' + _endval + '\')'
      } else {
        // eslint-disable-next-line
        searchText += '(' + item.key + ' ' + item.match + ' ' + '\'' + item.value + '\')'
        searchText += '(' + item.key + ' ' + item.match + ' \'' + item.value + '\')'
      }
    })
    return searchText
@@ -366,24 +370,18 @@
    let searchText = ''
    searches.forEach(item => {
      if (!item.value) return
      // eslint-disable-next-line
      searchText += (searchText !== '' ? ' ' + 'AND' + ' ' : '')
      searchText += (searchText !== '' ? ' AND ' : '')
      if (item.type === 'text') {
        let options = item.key.split(',').map(op => {
          // equal时不添加%
          // eslint-disable-next-line
          let str = item.op === 'equal' ? '' : '%'
          // eslint-disable-next-line
          return op + ' ' + item.op + ' ' + '"' + str + item.value + str + '"'
          return op + ' ' + item.op + ' \'' + str + item.value + str + '\''
        })
        // eslint-disable-next-line
        searchText += '(' + options.join(' ' + 'OR' + ' ') + ')'
        searchText += '(' + options.join(' OR ') + ')'
      } else if (item.type === 'date') {
        // eslint-disable-next-line
        searchText += '(' + item.key + ' ' + item.op + ' ' + '"' + item.value + '")'
        searchText += '(' + item.key + ' ' + item.op + ' \'' + item.value + '\')'
      } else {
        // eslint-disable-next-line
        searchText += '(' + item.key + ' ' + item.op + ' ' + '"' + item.value + '")'
        searchText += '(' + item.key + ' ' + item.op + ' \'' + item.value + '\')'
      }
    })
    return searchText