king
2022-06-08 88ca0a326f0101a7713404909041003a512bb7e2
2022-06-08
5个文件已修改
61 ■■■■ 已修改文件
src/menu/components/table/edit-table/columns/editColumn/index.jsx 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/normal-table/columns/editColumn/index.jsx 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/searchcomponent/index.jsx 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/searchcomponent/searchform/index.jsx 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/formconfig.jsx 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/edit-table/columns/editColumn/index.jsx
@@ -85,7 +85,14 @@
  }
  editColumn = (column) => {
    let formlist = getColumnForm(column, this.props.fields, this.props.columns)
    let fields = fromJS(this.props.fields).toJS().map(item => {
      if (item.label.toLowerCase() !== item.field.toLowerCase()) {
        item.text = item.label + '(' + item.field + ')'
      }
      return item
    })
    let formlist = getColumnForm(column, fields, this.props.columns)
    this.column = fromJS(column).toJS()
    this.column.editType = this.column.editType || 'text'
@@ -132,7 +139,7 @@
        }
      })
    } else if (key === 'field') {
      let values = {label: option.props.children}
      let values = {label: option.props.label || option.props.children}
      if (/Decimal|int/ig.test(option.props.datatype)) {
        let decimal = 0
        if (/Decimal/ig.test(option.props.datatype)) {
@@ -270,7 +277,7 @@
          getPopupContainer={() => document.getElementById('edit-table-column-winter')}
        >
          {item.options.map((option, i) =>
            <Select.Option key={i} datatype={option.datatype || ''} value={(option.value || option.field || option.MenuID)}>
            <Select.Option key={i} datatype={option.datatype || ''} label={option.label || ''} value={(option.value || option.field || option.MenuID)}>
              {(option.text || option.label || option.MenuName)}
            </Select.Option>
          )}
src/menu/components/table/normal-table/columns/editColumn/index.jsx
@@ -44,7 +44,14 @@
  }
  editColumn = (column) => {
    let formlist = getColumnForm(column, this.props.fields)
    let fields = fromJS(this.props.fields).toJS().map(item => {
      if (item.label.toLowerCase() !== item.field.toLowerCase()) {
        item.text = item.label + '(' + item.field + ')'
      }
      return item
    })
    let formlist = getColumnForm(column, fields)
    let _options = fromJS(columnTypeOptions[column.type]).toJS()
    if (column.type === 'text' || column.type === 'number') {
      if (column.perspective === 'linkmenu') {
@@ -96,7 +103,7 @@
        }
      })
    } else if (key === 'field') {
      let values = {label: option.props.children}
      let values = {label: option.props.label || option.props.children}
      if (/Decimal|int/ig.test(option.props.datatype)) {
        let decimal = 0
        if (/Decimal/ig.test(option.props.datatype)) {
@@ -231,7 +238,7 @@
                  getPopupContainer={() => document.getElementById('columnwinter')}
                >
                  {item.options.map((option, index) =>
                    <Select.Option key={index} datatype={option.datatype || ''} value={(option.value || option.field || option.MenuID)}>
                    <Select.Option key={index} datatype={option.datatype || ''} label={option.label || ''} value={(option.value || option.field || option.MenuID)}>
                      {(option.text || option.label || option.MenuName)}
                    </Select.Option>
                  )}
src/templates/sharecomponent/searchcomponent/index.jsx
@@ -127,10 +127,17 @@
      })
    })
    let columns = null
    if (this.props.config.type === 'table') {
      columns = this.props.config.columns.map(item => {
        return {key: item.uuid, text: item.field, value: item.field, label: item.label}
      })
    }
    this.setState({
      visible: true,
      card: card,
      formlist: getSearchForm(card, linkableFields)
      formlist: getSearchForm(card, linkableFields, columns)
    })
  }
src/templates/sharecomponent/searchcomponent/searchform/index.jsx
@@ -1,7 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { fromJS } from 'immutable'
import { Form, Row, Col, Input, Select, Radio, notification, Tooltip, InputNumber, Checkbox, Cascader } from 'antd'
import { Form, Row, Col, Input, Select, Radio, notification, Tooltip, InputNumber, Checkbox, Cascader, AutoComplete } from 'antd'
import { QuestionCircleOutlined } from '@ant-design/icons'
import { dateOptions, matchReg, formRule } from '@/utils/option.js'
@@ -419,6 +419,12 @@
    this.props.form.setFieldsValue({dataSource: resource})
  }
  complete = (key, option) => {
    let label = option.props.label
    this.props.form.setFieldsValue({label: label})
  }
  getFields() {
    const { getFieldDecorator } = this.props.form
    const { dict } = this.props
@@ -455,7 +461,20 @@
          })
        }
        if (item.key === 'field' && item.options && item.options.length > 0) {
          content = <AutoComplete
            dataSource={item.options.map((cell) => <AutoComplete.Option label={cell.label} key={cell.key}>
              {cell.text}
            </AutoComplete.Option>)}
            filterOption={(input, option) => option.props.children.indexOf(input) > -1}
            onSelect={this.complete}
            placeholder=""
          >
            <Input placeholder="" autoComplete="off" onPressEnter={this.handleSubmit} />
          </AutoComplete>
        } else {
        content = <Input placeholder="" autoComplete="off" onPressEnter={this.handleSubmit} />
        }
      } else if (item.type === 'number') {
        rules = [
          { required: item.required, message: dict['form.required.input'] + item.label + '!' }
src/templates/zshare/formconfig.jsx
@@ -286,7 +286,7 @@
 * @param {object} card           // 搜索条件对象
 * @param {Array}  linkableFields // 可关联字段
 */
export function getSearchForm (card, linkableFields) {
export function getSearchForm (card, linkableFields, columns) {
  let roleList = sessionStorage.getItem('sysRoles')
  let appType = sessionStorage.getItem('appType')
  if (roleList) {
@@ -396,7 +396,8 @@
      key: 'field',
      label: Formdict['model.form.field'],
      initVal: card.field || '',
      required: true
      required: true,
      options: columns
    },
    {
      type: 'select',