king
2019-12-06 2cb65d99c9aebf8293cb2838fcfe3e09fb2739ce
2019-12-06
2 文件已重命名
22个文件已修改
2个文件已添加
4个文件已删除
1368 ■■■■■ 已修改文件
public/emp-favicon.ico 补丁 | 查看 | 原始文档 | blame | 历史
public/index.html 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/index.js 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/img/bg_title.png 补丁 | 查看 | 原始文档 | blame | 历史
src/components/header/editmenu/index.jsx 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/sidemenu/editsecmenu/index.jsx 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/sidemenu/editthdmenu/index.jsx 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/locales/en-US/comtable.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/locales/zh-CN/comtable.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/setupProxy.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/commontable/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/dragelement/itemtypes.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/index.jsx 90 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/actionform/index.jsx 260 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/actionform/index.scss 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/columnform/index.jsx 149 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/columnform/index.scss 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/dragelement/card.jsx 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/dragelement/index.jsx 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/dragelement/itemtypes.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/editcard/index.jsx 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/editcard/index.scss 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/index.jsx 418 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/index.scss 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/modalform/index.jsx 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/modalform/index.scss 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/settingform/index.jsx 48 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/settingform/index.scss 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/source.jsx 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/login/index.scss 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/emp-favicon.ico
public/index.html
@@ -5,7 +5,6 @@
    <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="theme-color" content="#000000" />
    <meta name="description" content="minkesoft" />
    <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
    <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo.png" />
    <script src="%PUBLIC_URL%/options.js"></script>
src/api/index.js
@@ -22,16 +22,16 @@
  return Promise.reject(error)
})
const setCurrentUrl = () => {
  if (!!(window.history && window.history.pushState)) {
    window.history.replaceState(null, null, window.location.href.split('#')[0] + '#/login')
    window.location.reload()
  }
}
// const setCurrentUrl = () => {
//   if (!!(window.history && window.history.pushState)) {
//     window.history.replaceState(null, null, window.location.href.split('#')[0] + '#/login')
//     window.location.reload()
//   }
// }
axios.interceptors.response.use((response) => {
  if (response.data.ErrCode === 'LoginError') {
    setCurrentUrl()
    // setCurrentUrl()
  } else {
    return Promise.resolve(response.data)
  }
src/assets/img/bg_title.png
src/components/header/editmenu/index.jsx
@@ -7,9 +7,10 @@
import TransferForm from '@/components/transferform'
import DragElement from '../dragelement'
import MenuForm from '../menuform'
import Api from '@/api'
import Utils from '@/utils/utils.js'
import zhCN from '@/locales/zh-CN/header.js'
import enUS from '@/locales/en-US/header.js'
import Api from '@/api'
import './index.scss'
const { confirm } = Modal
@@ -233,11 +234,12 @@
      let _this = this
      let param  = {}
      param.func = 'sPC_Menu_SortUpt'
      param.LText = []
      let _text = []
      previewList.forEach((item, index) => {
        param.LText.push('selectmspace\'' + item.MenuID + '\'mspaceasmspaceMenuid,' + (index + 1) * 10 + 'mspaceasmspacesort')
        _text.push('select \'' + item.MenuID + '\' as Menuid,' + (index + 1) * 10 + ' as sort')
      })
      param.LText = param.LText.join('mspaceunionmspace')
      _text = _text.join(' union ')
      param.LText = Utils.formatOptions(_text)
      confirm({
        title: this.state.dict['header.menu.resetorder'],
        content: '',
src/components/sidemenu/editsecmenu/index.jsx
@@ -190,11 +190,12 @@
        let _this = this
        let param  = {}
        param.func = 'sPC_Menu_SortUpt'
        param.LText = []
        let _text = []
        previewList.forEach((item, index) => {
          param.LText.push('selectmspace\'' + item.MenuID + '\'mspaceasmspaceMenuid,' + (index + 1) * 10 + 'mspaceasmspacesort')
          _text.push('select \'' + item.MenuID + '\' as Menuid,' + (index + 1) * 10 + ' as sort')
        })
        param.LText = param.LText.join('mspaceunionmspace')
        _text = _text.join(' union ')
        param.LText = Utils.formatOptions(_text)
        confirm({
          title: this.state.dict['header.menu.resetorder'],
          content: '',
src/components/sidemenu/editthdmenu/index.jsx
@@ -197,11 +197,13 @@
        let _this = this
        let param  = {}
        param.func = 'sPC_Menu_SortUpt'
        param.LText = []
        let _text = []
        previewList.forEach((item, index) => {
          param.LText.push('selectmspace\'' + item.MenuID + '\'mspaceasmspaceMenuid,' + (index + 1) * 10 + 'mspaceasmspacesort')
          _text.push('select \'' + item.MenuID + '\' as Menuid,' + (index + 1) * 10 + ' as sort')
        })
        param.LText = param.LText.join('mspaceunionmspace')
        _text = _text.join(' union ')
        param.LText = Utils.formatOptions(_text)
        confirm({
          title: this.state.dict['header.menu.resetorder'],
          content: '',
@@ -366,14 +368,17 @@
  handleSubConfig = (item, originMenu, config) => {
    if (item.OpenType === 'pop') {
      item.pageParam = ''
      if (config && config.type === 'modal') {
        item.pageParam = config
      }
      this.setState({
        editMenu: originMenu,
        editAction: item,
        tabview: 'Modal'
      })
    }
    console.log(item)
    console.log(originMenu)
  }
  UNSAFE_componentWillMount () {
src/locales/en-US/comtable.js
@@ -22,6 +22,7 @@
  'header.menu.openType.newWindow': 'A new window',
  'header.menu.newpage.service': 'Customer Service',
  'header.form.search.placeholder': '请添加搜索条件',
  'header.form.modal.placeholder': '请添加表单',
  'header.form.action.placeholder': '请添加按钮',
  'header.form.column.placeholder': '请添加显示列',
  'header.form.column.source': '显示列',
src/locales/zh-CN/comtable.js
@@ -22,6 +22,7 @@
  'header.menu.openType.newWindow': '新窗口',
  'header.menu.newpage.service': '客服',
  'header.form.search.placeholder': '请添加搜索条件',
  'header.form.modal.placeholder': '请添加表单',
  'header.form.action.placeholder': '请添加按钮',
  'header.form.column.placeholder': '请添加显示列',
  'header.form.column.source': '显示列',
src/setupProxy.js
@@ -1,8 +1,9 @@
const proxy = require('http-proxy-middleware')
const service = 'mkwms'
module.exports = function(app) {
  app.use(proxy('/webapi', { 
    target: 'http://qingqiumarket.cn/MKWMS/webapi',
    target: `http://qingqiumarket.cn/${service}/webapi`,
    secure: false,
    changeOrigin: true,
    pathRewrite: {
@@ -12,7 +13,7 @@
  }))
  
  app.use(proxy('/zh-CN', { // 登录接口
    target: 'http://qingqiumarket.cn/MKWMS/zh-CN',
    target: `http://qingqiumarket.cn/${service}/zh-CN`,
    secure: false,
    changeOrigin: true,
    pathRewrite: {
src/tabviews/commontable/index.jsx
@@ -48,8 +48,8 @@
    }
    let result = await Api.getSystemConfig(param)
    if (result.status && result.LongParam) {
      let config = window.decodeURIComponent(window.atob(result.LongParam))
      try {
        config = JSON.parse(config)
        this.setState({
src/templates/comtableconfig/dragelement/itemtypes.js
@@ -1,5 +1,6 @@
export default {
  CARD: 'card',
  form: 'form',
  search: 'search',
  action: 'action',
  columns: 'columns'
src/templates/comtableconfig/index.jsx
@@ -877,8 +877,7 @@
        })
        _this.setState({
          config: _config,
          [element.type + 'loading']: true,
          visible: false
          [element.type + 'loading']: true
        }, () => {
          _this.setState({
            [element.type + 'loading']: false
@@ -944,6 +943,25 @@
        return
      }
      let sql = []
      config.action.forEach((item, index) => {
        sql.push(`'${item.uuid}' as menuid, '${item.label}' as menuname, '${(index + 1) * 10}' as Sort`)
      })
      sql = sql.join(' union all select ')
      sql = 'select ' + sql
      sql = Utils.formatOptions(sql)
      let btnParam = {
        func: 'sPC_Button_AddUpt',
        ParentID: menu.MenuID,
        MenuNo: res.menuNo,
        Template: menu.PageParam.Template || '',
        PageParam: '',
        LongParam: '',
        LongButton: sql
      }
      if (this.state.operaType === 'add') { // 新建菜单
        let param = {
          func: 'sPC_TrdMenu_Add',
@@ -955,6 +973,7 @@
          PageParam: JSON.stringify(_pageParam),
          LongParam: _LongParam
        }
        this.setState({
          menuloading: true
        })
@@ -962,7 +981,6 @@
        Api.getSystemConfig(param).then(response => {
          if (response.status) {
            this.setState({
              menuloading: false,
              operaType: 'edit',
              originMenu: {
                ...originMenu,
@@ -973,11 +991,7 @@
                ParentID: res.parentId
              }
            })
            notification.success({
              top: 92,
              message: '保存成功',
              duration: 10
            })
            this.submitAction(btnParam)
          } else {
            this.setState({
              menuloading: false
@@ -1006,16 +1020,7 @@
        Api.getSystemConfig(param).then(response => {
          if (response.status) {
            notification.success({
              top: 92,
              message: '保存成功',
              duration: 10
            })
            if (this.state.closeVisible) {
              this.props.handleConfig('')
            } else {
              this.setState({
                menuloading: false,
                originMenu: {
                  ...originMenu,
                  LongParam: _config,
@@ -1025,7 +1030,7 @@
                  ParentID: res.parentId
                }
              })
            }
            this.submitAction(btnParam)
          } else {
            this.setState({
              menuloading: false
@@ -1050,10 +1055,32 @@
  /**
   * @description 保存或修改菜单按钮
   */
  submitAction = () => {
    if (!is(fromJS(this.state.originActions), fromJS())) {
  submitAction = (param) => {
    Api.getSystemConfig(param).then(response => {
      if (response.status) {
        notification.success({
          top: 92,
          message: '保存成功',
          duration: 10
        })
        if (this.state.closeVisible) {
          this.props.handleConfig('')
        } else {
          this.setState({
            menuloading: false
          })
    }
      } else {
        this.setState({
          menuloading: false
        })
        notification.warning({
          top: 92,
          message: response.message,
          duration: 10
        })
      }
    })
  }
  cancelConfig = () => {
@@ -1388,6 +1415,9 @@
    })
  }
  /**
   * @description 设置可配置按钮
   */
  setSubConfig = (btn) => {
    const { menu } = this.props
    const { config, originMenu } = this.state
@@ -1422,16 +1452,24 @@
            loading: true
          })
          Api.getSystemConfig({
            func: 'sPC_Get_FrozenMenu',
            ParentID: btn.uuid,
            TYPE: 30
            func: 'sPC_Get_LongParam',
            MenuID: btn.uuid
          }).then(res => {
            if (res.status) {
              let btnconfig = ''
              this.setState({
                loading: false
              })
              this.props.handleSubConfig(btn, originMenu, btnconfig)
              let _LongParam = ''
              if (res.LongParam) {
                _LongParam = window.decodeURIComponent(window.atob(res.LongParam))
                try {
                  _LongParam = JSON.parse(_LongParam)
                } catch (e) {
                  _LongParam = ''
                }
              }
              this.props.handleSubConfig(btn, originMenu, _LongParam)
            } else {
              this.setState({
                loading: false
src/templates/modalconfig/actionform/index.jsx
File was deleted
src/templates/modalconfig/actionform/index.scss
File was deleted
src/templates/modalconfig/columnform/index.jsx
File was deleted
src/templates/modalconfig/columnform/index.scss
File was deleted
src/templates/modalconfig/dragelement/card.jsx
@@ -1,20 +1,22 @@
import React from 'react'
import { useDrag, useDrop } from 'react-dnd'
import { Icon, Button, Select, DatePicker, Input } from 'antd'
import { Icon, Select, DatePicker, Input } from 'antd'
import moment from 'moment'
import ItemTypes from './itemtypes'
import './index.scss'
const Card = ({ id, type, card, moveCard, findCard, editCard, copyCard, hasDrop }) => {
const { MonthPicker } = DatePicker
const Card = ({ id, card, moveCard, findCard, editCard, closeCard, hasDrop }) => {
  const originalIndex = findCard(id).index
  const [{ isDragging }, drag] = useDrag({
    item: { type: ItemTypes[type], id, originalIndex },
    item: { type: ItemTypes.form, id, originalIndex },
    collect: monitor => ({
      isDragging: monitor.isDragging(),
    }),
  })
  const [, drop] = useDrop({
    accept: ItemTypes[type],
    accept: ItemTypes.form,
    canDrop: () => true,
    drop: (item) => {
      if (!item.hasOwnProperty('originalIndex')) {
@@ -35,19 +37,22 @@
    editCard(id)
  }
  const copy = () => {
    copyCard(id)
  const close = () => {
    closeCard(id)
  }
  return (
    <div className="page-card" style={type === 'columns' ? { flex: card.Width, opacity: opacity} : { opacity: opacity}}>
    <div className="page-card" style={{ opacity: opacity}}>
      <div ref={node => drag(drop(node))}>
        {type === 'search' && <div className="ant-row ant-form-item">
        {<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} />
            }
            {card.type === 'number' &&
              <Input style={{marginTop: '4px'}} defaultValue={card.initval} />
            }
            {(card.type === 'select' || card.type === 'link') &&
@@ -56,33 +61,18 @@
            {card.type === 'date' &&
              <DatePicker defaultValue={card.initval ? moment(card.initval, 'YYYY-MM-DD') : null} />
            }
            {card.type === 'datemonth' ?
              <MonthPicker defaultValue={card.initval ? moment().subtract(card.initval, 'month') : null} /> : null
            }
            {card.type === 'datetime' &&
              <DatePicker showTime defaultValue={card.initval ? moment(card.initval, 'YYYY-MM-DD HH:mm:ss') : null} />
            }
            <div className="input-mask"></div>
          </div>
        </div>}
        {type === 'action' &&
          <Button
            className={'mk-btn mk-' + card.class}
            icon={card.icon}
            key={card.uuid}
          >{card.label}</Button>
        }
        {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>}
            </div>
          </span>
        }
      </div>
      <Icon className="edit" type="edit" onClick={edit} />
      {type === 'action' && <Icon className="edit copy" type="copy" onClick={copy} />}
      <Icon className="edit close" type="close" onClick={close} />
    </div>
  )
}
src/templates/modalconfig/dragelement/index.jsx
@@ -7,14 +7,14 @@
import ItemTypes from './itemtypes'
import './index.scss'
const Container = ({list, type, placeholder, handleList, handleMenu }) => {
const Container = ({list, setting, placeholder, handleList, handleForm, closeForm }) => {
  let target = null
  const [cards, setCards] = useState(list)
  const moveCard = (id, atIndex) => {
    const { card, index } = findCard(id)
    const _cards = update(cards, { $splice: [[index, 1], [atIndex, 0, card]] })
    setCards(_cards)
    handleList({[type]: _cards})
    handleList(_cards)
  }
  const findCard = id => {
@@ -27,7 +27,12 @@
  const editCard = id => {
    const { card } = findCard(id)
    handleMenu(card)
    handleForm(card)
  }
  const closeCard = id => {
    const { card } = findCard(id)
    closeForm(card)
  }
  
  const hasDrop = (item) => {
@@ -35,16 +40,15 @@
  }
  const [, drop] = useDrop({
    accept: ItemTypes[type],
    accept: ItemTypes.form,
    drop(item) {
      if (item.hasOwnProperty('originalIndex')) {
        return
      }
      let newcard = {}
      if (item.type === 'search') {
        newcard.uuid = Utils.getuuid()
        newcard.label = 'fieldName'
      newcard.label = 'label'
        newcard.field = ''
        newcard.initval = ''
        newcard.type = item.subType
@@ -57,8 +61,6 @@
        newcard.valueText = ''
        newcard.orderBy = ''
        newcard.orderType = 'asc'
        newcard.display = 'dropdown'
      }
      
      let indexes = cards.map(car => {return car.id})
      let newid = 0
@@ -83,22 +85,24 @@
      const _cards = update(cards, { $splice: [[targetIndex, 0, newcard]] })
      setCards(_cards)
      handleList({[type]: _cards})
      handleList(_cards)
      target = null
    }
  })
  
  let _cols = 24 / (setting.cols || 2)
  return (
    <div ref={drop} className="ant-row">
      {type === 'search' && cards.map(card => (
        <Col key={card.uuid} span={6}>
      {cards.map(card => (
        <Col key={card.uuid} span={_cols}>
          <Card
            key={card.uuid}
            id={`${card.id}`}
            type={type}
            card={card}
            moveCard={moveCard}
            editCard={editCard}
            closeCard={closeCard}
            findCard={findCard}
            hasDrop={hasDrop}
          />
src/templates/modalconfig/dragelement/itemtypes.js
@@ -1,5 +1,6 @@
export default {
  CARD: 'card',
  form: 'form',
  search: 'search',
  action: 'action',
  columns: 'columns'
src/templates/modalconfig/editcard/index.jsx
@@ -1,6 +1,8 @@
import React, {Component} from 'react'
import { Row, Col, Icon, Radio } from 'antd'
import { Row, Col, Icon, Radio, Input } from 'antd'
import './index.scss'
const { Search } = Input
class EditCardCell extends Component {
  constructor(props) {
@@ -16,6 +18,8 @@
    const { card } = this.state
    this.setState({
      card: {...card, selected: !card.selected}
    }, () => {
      this.props.changeCard(this.state.card)
    })
  }
@@ -27,34 +31,21 @@
  }
  render() {
    const { card, type } = this.state
    let _type = card.type
    if (type === 'columns') {
      if (_type !== 'picture') {
        _type = 'text'
      }
    } else if (type === 'search') {
      if (_type === 'number') {
        _type = 'text'
      }
    }
    const { card } = this.state
    return (
      <div className={'ant-card ant-card-bordered ' + (card.selected ? 'selected' : '')} >
        <div className="base" onClick={this.changeSelect}>
          <Icon type="check" />
          <p title={card.field}>字段名: {card.field}</p>
          <p title={card.label}>提示文字: {card.label}</p>
          <p title={card.field}>字段: <span>{card.field}</span></p>
          <p title={card.label}>名称: <span>{card.label}</span></p>
        </div>
        {type === 'search' && <Radio.Group onChange={this.changeType} value={_type} disabled={!card.selected}>
        <Radio.Group onChange={this.changeType} value={card.type} disabled={!card.selected}>
          <Radio value="text">text</Radio>
          <Radio value="number">number</Radio>
          <Radio value="select">select</Radio>
          <Radio value="date">date</Radio>
          <Radio value="datetime">datetime</Radio>
        </Radio.Group>}
        {type === 'columns' && <Radio.Group onChange={this.changeType} value={_type} disabled={!card.selected}>
          <Radio value="text">text</Radio>
          <Radio value="picture">picture</Radio>
        </Radio.Group>}
        </Radio.Group>
      </div>
    )
  }
@@ -66,16 +57,29 @@
    this.state = {
      dataSource: props.data,
      type: props.type
      selectCards: props.data.filter(item => item.selected),
      type: props.type,
      searchKey: ''
    }
  }
  getSelectedCard = () => {
    let box = []
    this.state.dataSource.forEach((item, index) => {
      box.push(this.refs['cellCard' + index].state.card)
  changeCard = (item) => {
    let cards = JSON.parse(JSON.stringify(this.state.selectCards))
    let isAdd = true
    cards = cards.map(card => {
      if (card.field === item.field) {
        isAdd = false
        return item
      } else {
        return card
      }
    })
    return box
    if (isAdd) {
      cards.push(item)
    }
    this.setState({
      selectCards: cards
    })
  }
  render() {
@@ -83,12 +87,23 @@
    return (
      <div className="common-modal-edit-card">
        <Row>
          {dataSource.map((item, index) => (
            <Col key={index} span={8}>
              <EditCardCell ref={'cellCard' + index} type={type} card={item} />
        <Row className="search-row">
          <Col span={8}>
            <Search placeholder="请输入字段名" onSearch={value => {this.setState({searchKey: value})}} enterButton />
            </Col>
          ))}
        </Row>
        <Row>
          {dataSource.map((item, index) => {
            if (item.field.toLowerCase().indexOf(this.state.searchKey.toLowerCase()) >= 0) {
              return (
                <Col key={index} span={8}>
                  <EditCardCell ref={'cellCard' + index} type={type} card={item} changeCard={this.changeCard} />
                </Col>
              )
            } else {
              return ''
            }
          })}
        </Row>
      </div>
    )
src/templates/modalconfig/editcard/index.scss
@@ -12,7 +12,7 @@
        white-space: nowrap;
      }
      label {
        margin-right: 7px;
        margin-right: 15px;
        span.ant-radio + * {
          padding-right: 0px;
          padding-left: 4px;
@@ -35,6 +35,14 @@
        opacity: 1;
        color: #1890ff;
      }
      p {
        color: #1890ff;
      }
    }
  }
  .search-row {
    .ant-col {
      padding-top: 0px;
    }
  }
}
src/templates/modalconfig/index.jsx
@@ -3,15 +3,13 @@
import { is, fromJS } from 'immutable'
import { DndProvider } from 'react-dnd'
import HTML5Backend from 'react-dnd-html5-backend'
import { Button, Card, Modal, Collapse, notification, Select, List, Icon } from 'antd'
import { Button, Card, Modal, Collapse, notification, Select, List, Icon, Empty } from 'antd'
import DragElement from './dragelement'
import SourceElement from './dragelement/source'
import Api from '@/api'
// import SearchForm from './searchform'
// import ActionForm from './actionform'
// import ColumnForm from './columnform'
import ModalForm from './modalform'
import SettingForm from './settingform'
// import EditCard from './editcard'
import EditCard from './editcard'
import MenuForm from './menuform'
import zhCN from '@/locales/zh-CN/comtable.js'
import enUS from '@/locales/en-US/comtable.js'
@@ -42,11 +40,8 @@
    fields: null, // 搜索条件及显示列,可选字段
    modalformlist: null, // 基本信息表单字段
    formlist: null, // 搜索条件、按钮、显示列表单字段
    formtemp: '', // 表单类型,显示列、按钮、搜索条件
    card: null, // 编辑元素
    searchloading: false, // 搜索条件加载中
    actionloading: false, // 按钮加载中
    columnsloading: false, // 显示列加载中
    loading: false, // 搜索条件加载中
    menuloading: false, // 菜单保存中
    settingVisible: false, // 全局配置模态框
    closeVisible: false, // 关闭模态框
@@ -58,10 +53,22 @@
  UNSAFE_componentWillMount () {
    const {menu, editAction} = this.props
    let _config = JSON.parse(JSON.stringify((Source.baseConfig)))
    let _config = ''
    let _operaType = 'add'
    if (editAction.pageParam) {
      _config = editAction.pageParam
      _operaType = 'edit'
    } else {
      _config = JSON.parse(JSON.stringify((Source.baseConfig)))
    }
    if (!_config.setting.title) {
      _config.setting.title = editAction.label
    }
    
    this.setState({
      config: _config,
      operaType: _operaType,
      selectedTables: _config.tables || [],
      modalformlist: [
        {
@@ -77,22 +84,6 @@
          key: 'btnName',
          label: '按钮名称',
          initVal: editAction.label,
          required: true,
          readonly: true
        },
        {
          type: 'text',
          key: 'menuNo',
          label: this.state.dict['header.menu.menuNo'],
          initVal: menu.MenuNo,
          required: true,
          readonly: true
        },
        {
          type: 'text',
          key: 'opentype',
          label: this.state.dict['header.menu.openType'],
          initVal: '弹窗(表单)',
          required: true,
          readonly: true
        }
@@ -185,36 +176,28 @@
    })
  }
  handleList = (listObj) => {
    let config = this.state.config
    if (this.state.operaType === 'add') {
      let key = Object.keys(listObj)[0]
      let newlength = listObj[key].length
      if (newlength > config[key].length) {
        listObj[key] = listObj[key].filter(item => !item.origin)
      }
      if (newlength > listObj[key].length) {
  handleList = (list) => {
    let _config = JSON.parse(JSON.stringify(this.state.config))
    if (list.length > _config.fields.length) {
      _config.fields = list.filter(item => !item.origin)
        this.setState({
          [key + 'loading']: true,
          config: {...config, ...listObj}
        })
        setTimeout(() => {
        loading: true,
        config: _config
      }, () => {
          this.setState({
            [key + 'loading']: false
          loading: false
          })
        }, 100)
      })
      } else {
        this.setState({config: {...config, ...listObj}})
      }
    } else {
      this.setState({config: {...config, ...listObj}})
      _config.fields = list
      this.setState({config: _config})
    }
  }
  handleSearch = (card) => {
  handleForm = (card) => {
    this.setState({
      visible: true,
      formtemp: 'search',
      card: card,
      formlist: [
        {
@@ -234,34 +217,40 @@
          readonly: false
        },
        {
          type: 'text',
          key: 'initval',
          label: this.state.dict['header.form.initval'],
          initVal: card.initval,
          required: false
        },
        {
          type: 'select',
          key: 'type',
          label: this.state.dict['header.form.type'],
          initVal: card.type,
          required: true,
          options: [{
            MenuID: 'text',
            value: 'text',
            text: this.state.dict['header.form.text']
          }, {
            MenuID: 'select',
            value: 'select',
            text: this.state.dict['header.form.select']
          }, {
            MenuID: 'link',
            value: 'link',
            text: this.state.dict['header.form.link']
          }, {
            MenuID: 'date',
            value: 'date',
            text: this.state.dict['header.form.dateday']
          }, {
            MenuID: 'datetime',
            text: this.state.dict['header.form.datetime']
            value: 'dateweek',
            text: this.state.dict['header.form.dateweek']
          }, {
            value: 'datemonth',
            text: this.state.dict['header.form.datemonth']
          }, {
            value: 'daterange',
            text: this.state.dict['header.form.daterange']
          }]
        },
        {
          type: 'text',
          key: 'initval',
          label: this.state.dict['header.form.initval'],
          initVal: card.initval,
          required: false
        },
        {
          type: 'radio',
@@ -270,10 +259,10 @@
          initVal: card.resourceType || '0',
          required: true,
          options: [{
            MenuID: '0',
            value: '0',
            text: this.state.dict['header.form.custom']
          }, {
            MenuID: '1',
            value: '1',
            text: this.state.dict['header.form.datasource']
          }]
        },
@@ -283,10 +272,10 @@
          label: this.state.dict['header.form.setAll'],
          initVal: card.setAll || 'false',
          options: [{
            MenuID: 'true',
            value: 'true',
            text: this.state.dict['header.form.true']
          }, {
            MenuID: 'false',
            value: 'false',
            text: this.state.dict['header.form.false']
          }]
        },
@@ -344,25 +333,11 @@
          label: this.state.dict['header.form.orderType'],
          initVal: card.orderType || 'asc',
          options: [{
            MenuID: 'asc',
            value: 'asc',
            text: this.state.dict['header.form.asc']
          }, {
            MenuID: 'desc',
            value: 'desc',
            text: this.state.dict['header.form.desc']
          }]
        },
        {
          type: 'select',
          key: 'display',
          label: this.state.dict['header.form.display'],
          initVal: card.display || 'dropdown',
          required: true,
          options: [{
            MenuID: 'dropdown',
            text: this.state.dict['header.form.dropdown']
          }, {
            MenuID: 'button',
            text: this.state.dict['header.form.button']
          }]
        }
      ]
@@ -371,70 +346,56 @@
  handleSubmit = () => {
    this.formRef.handleConfirm().then(res => {
      let _config = this.state.config
      if (this.state.operaType === 'add') {
        _config[res.type] = _config[res.type].map(item => {
          if (item.uuid === res.values.uuid) {
            return res.values
      let _config = JSON.parse(JSON.stringify(this.state.config))
      console.log(res)
      _config.fields = _config.fields.map(item => {
        if (item.uuid === res.uuid) {
          return res
          } else {
            return item
          }
        })
        _config[res.type] = _config[res.type].filter(item => !item.origin)
      } else {
        _config[res.type] = _config[res.type].map(item => {
          if (item.uuid === res.values.uuid) {
            return res.values
          } else {
            return item
          }
        })
      }
      _config.fields = _config.fields.filter(item => !item.origin)
      this.setState({
        config: _config,
        [res.type + 'loading']: true,
        loading: true,
        visible: false
      }, () => {
        this.setState({
          loading: false
      })
      this.resetFrom()
      })
    })
  }
  deleteElement = () => {
    let _config = this.state.config
    _config[this.state.formtemp] = _config[this.state.formtemp].filter(item => {
      if (item.uuid === this.state.card.uuid) {
  closeForm = (card) => {
    let _this = this
    confirm({
      content: `确定删除<<${card.label}>>吗?`,
      okText: this.state.dict['header.confirm'],
      cancelText: this.state.dict['header.cancel'],
      onOk() {
        let _config = JSON.parse(JSON.stringify(_this.state.config))
        _config.fields = _config.fields.filter(item => {
          if (item.uuid === card.uuid) {
        return false
      } else {
        return true
      }
    })
    this.setState({
        _this.setState({
      config: _config,
      [this.state.formtemp + 'loading']: true,
      visible: false
          loading: true
        }, () => {
          _this.setState({
            loading: false
    })
    this.resetFrom()
  }
  handleCancel = () => {
    this.setState({
      visible: false
    })
    this.resetFrom()
  }
  resetFrom = () => {
    setTimeout(() => {
      this.setState({
        // formtemp: '',
        searchloading: false,
        actionloading: false,
        columnsloading: false
        // formlist: null
      },
      onCancel() {}
      })
    }, 10)
  }
  changeTemplate = () => {
@@ -445,26 +406,11 @@
    const { menu } = this.props
    const { config, originMenu } = this.state
    this.menuformRef.handleConfirm().then(res => {
      if (config.search[0] && config.search[0].origin) {
      if (!config.fields[0] && config.fields[0].origin) {
        notification.warning({
          top: 92,
          message: '请设置搜索条件',
          duration: 10
        })
        return
      }
      if (config.action[0] && config.action[0].origin) {
        notification.warning({
          top: 92,
          message: '请设置按钮',
          duration: 10
        })
        return
      }
      if (config.columns[0] && config.columns[0].origin) {
        notification.warning({
          top: 92,
          message: '请设置显示列',
          message: '请添加表单',
          duration: 10
        })
        return
@@ -485,9 +431,8 @@
        return
      }
      if (this.state.operaType === 'add') {
        let param = {
          func: 'sPC_TrdMenu_Add',
        func: 'sPC_ButtonParam_AddUpt',
          ParentID: res.parentId,
          MenuID: menu.MenuID,
          MenuNo: res.menuNo,
@@ -530,6 +475,9 @@
            })
          }
        })
      if (this.state.operaType === 'add') {
      } else {
        let param = {
          func: 'sPC_TrdMenu_Upt',
@@ -631,7 +579,7 @@
    }
  }
  queryField = (type) => {
  queryField = () => {
    const {selectedTables, tableColumns, config} = this.state
    if (selectedTables.length === 0) {
      notification.warning({
@@ -649,22 +597,13 @@
      })
    })
    if (type === 'search') {
      config.search.forEach(item => {
    config.fields.forEach(item => {
        if (columns.has(item.field)) {
          columns.set(item.field, {...item, selected: true, type: item.type})
        }
      })
    } else if (type === 'columns') {
      config.columns.forEach(item => {
        if (columns.has(item.field)) {
          columns.set(item.field, {...item, selected: true, type: item.type})
        }
      })
    }
    this.setState({
      addType: type,
      tableVisible: true,
      fields: [...columns.values()]
    })
@@ -673,26 +612,28 @@
  addFieldSubmit = () => {
    if (!this.state.fields || this.state.fields.length === 0) {
      this.setState({
        tableVisible: false,
        addType: ''
        tableVisible: false
      })
    }
    const {addType, config} = this.state
    let _config = JSON.parse(JSON.stringify(this.state.config))
    let cards = this.refs.searchcard.getSelectedCard()
    let cards = this.refs.searchcard.state.selectCards
    let columns = new Map()
    cards.forEach(card => {
      columns.set(card.field, card)
    })
    let items = []
    if (addType === 'search') {
      config.search.forEach(item => {
    _config.fields.forEach(item => {
        if (columns.has(item.field)) {
          let cell = columns.get(item.field)
          if (cell.selected) {
        if (cell.selected && cell.type === item.type) { // 数据未修改
          items.push(item)
        } else if (cell.selected) { // 数据类型修改
          item.type = cell.type
          item.initval = ''
            items.push(item)
          }
          columns.delete(item.field)
@@ -703,7 +644,7 @@
      let _columns = [...columns.values()]
      let indexes = items.map(card => {return card.id})
      let id = Math.max(...indexes, 0)
    let id = Math.max(...indexes, 0) + 1
      _columns.forEach(item => {
        if (item.selected) {
@@ -723,68 +664,23 @@
            valueText: '',
            orderBy: '',
            orderType: 'asc',
            display: 'dropdown'
          }
          items.push(newcard)
          id++
        }
      })
    } else {
      config.columns.forEach(item => {
        if (columns.has(item.field)) {
          let cell = columns.get(item.field)
          if (cell.selected) {
            items.push(item)
          }
          columns.delete(item.field)
        } else if (!item.origin) {
          items.push(item)
        }
      })
      let _columns = [...columns.values()]
      let indexes = items.map(card => {return card.id})
      let id = Math.max(...indexes, 0)
      _columns.forEach(item => {
        if (item.selected) {
          let newcard = {
            id: id,
            uuid: Utils.getuuid(),
            Align: 'left',
            label: item.label,
            field: item.field,
            Hide: 'false',
            IsSort: 'true',
            type: 'text',
            Width: 120
          }
          items.push(newcard)
          id++
        }
      })
    }
    _config.fields = items
    this.setState({
      tableVisible: false,
      [addType + 'loading']: true,
      addType: '',
      config: {...config, [addType]: items}
    })
    setTimeout(() => {
      loading: true,
      config: _config
    }, () => {
      this.setState({
        [addType + 'loading']: false
        loading: false
      })
    }, 100)
  }
  cancelFieldSubmit = () => {
    this.setState({
      tableVisible: false,
      addType: ''
    })
  }
@@ -811,16 +707,6 @@
              } else if (/^decimal/.test(_type)) {
                _decimal = _type.split(',')[1]
                _decimal = parseInt(_decimal)
                if (_decimal > 4) {
                  _decimal = 4
                }
                _type = 'number'
              } else if (/^decimal/.test(_type)) {
                _decimal = _type.split(',')[1]
                _decimal = parseInt(_decimal)
                if (_decimal > 4) {
                  _decimal = 4
                }
                _type = 'number'
              } else if (/^datetime/.test(_type)) {
                _type = 'datetime'
@@ -877,19 +763,20 @@
    })
  }
  cancelSetting = () => {
    this.setState({
      settingVisible: false
    })
  }
  render () {
    const { config } = this.state
    return (
      <div className="modal-form-board">
        <DndProvider backend={HTML5Backend}>
          <div className="tools">
            <Collapse accordion defaultActiveKey="0" bordered={false}>
              <Panel header="基本信息" key="0" id="modal-basedata">
                <MenuForm
                  dict={this.state.dict}
                  formlist={this.state.modalformlist}
                  wrappedComponentRef={(inst) => this.menuformRef = inst}
                />
                <MenuForm
                  dict={this.state.dict}
                  formlist={this.state.modalformlist}
@@ -932,7 +819,7 @@
                    return (<SourceElement key={index} content={item}/>)
                  })}
                </div>
                <Button type="primary" block onClick={() => this.queryField('search')}>添加表单</Button>
                <Button type="primary" block onClick={() => this.queryField()}>添加表单</Button>
              </Panel>
            </Collapse>
          </div>
@@ -944,31 +831,51 @@
              </div>
            } style={{ width: '100%' }}>
              <Icon type="setting" onClick={this.changeSetting} />
              <div className="search-list">
                {<DragElement
                  list={this.state.config.search}
                  type="search"
                  placeholder={this.state.dict['header.form.search.placeholder']}
              <div className="ant-modal-content" style={{width: config.setting.width + '%'}}>
                <button type="button" className="ant-modal-close">
                  <span className="ant-modal-close-x"><Icon type="close"/></span>
                </button>
                <div className="ant-modal-header">
                  <div className="ant-modal-title">{config.setting.title}</div>
                </div>
                <div className="ant-modal-body">
                  <div className="modal-form">
                    {!this.state.loading ?
                      <DragElement
                        list={config.fields}
                        setting={config.setting}
                        placeholder={this.state.dict['header.form.modal.placeholder']}
                  handleList={this.handleList}
                  handleMenu={this.handleSearch}
                />}
                        handleForm={this.handleForm}
                        closeForm={this.closeForm}
                      /> : null
                    }
                  </div>
                </div>
                <div className="ant-modal-footer">
                  <div>
                    <button type="button" className="ant-btn"><span>取 消</span></button>
                    <button type="button" className="ant-btn ant-btn-primary"><span>确 定</span></button>
                  </div>
                  <div className="action-mask"></div>
                </div>
              </div>
            </Card>
          </div>
        </DndProvider>
        {/* <Modal
        <Modal
          title={this.state.dict['header.edit']}
          visible={this.state.visible}
          width={700}
          onCancel={this.handleCancel}
          footer={[
            <Button key="delete" type="danger" onClick={this.deleteElement}>{this.state.dict['header.delete']}</Button>,
            <Button key="cancel" onClick={this.handleCancel}>{this.state.dict['header.cancel']}</Button>,
            <Button key="confirm" type="primary" onClick={this.handleSubmit}>{this.state.dict['header.confirm']}</Button>
          ]}
          onCancel={() => {
            this.setState({
              visible: false
            })
          }}
          onOk={this.handleSubmit}
          destroyOnClose
        >
          {this.state.formtemp === 'search' && <SearchForm
          {<ModalForm
            dict={this.state.dict}
            formlist={this.state.formlist}
            card={this.state.card}
@@ -981,29 +888,34 @@
          width={'65vw'}
          style={{minWidth: '900px', maxWidth: '1200px'}}
          onOk={this.addFieldSubmit}
          onCancel={this.cancelFieldSubmit}
          onCancel={() => {
            this.setState({
              tableVisible: false
            })
          }}
          destroyOnClose
        >
          {this.state.addType === 'search' && this.state.fields.length > 0 &&
            <EditCard data={this.state.fields} ref="searchcard" type="search" />
          }
          {this.state.addType === 'columns' && this.state.fields.length > 0 &&
            <EditCard data={this.state.fields} ref="searchcard" type="columns" />
          {this.state.fields && this.state.fields.length > 0 ?
            <EditCard data={this.state.fields} ref="searchcard" type="search" /> : null
          }
          {(!this.state.fields || this.state.fields.length === 0) &&
            <Empty />
          }
        </Modal> */}
        </Modal>
        <Modal
          title={this.state.dict['header.edit']}
          visible={this.state.settingVisible}
          width={700}
          onOk={this.settingSave}
          onCancel={this.cancelSetting}
          onCancel={() => {
            this.setState({
              settingVisible: false
            })
          }}
          destroyOnClose
        >
          <SettingForm
            data={this.state.config.setting}
            data={config.setting}
            dict={this.state.dict}
            wrappedComponentRef={(inst) => this.settingRef = inst}
          />
src/templates/modalconfig/index.scss
@@ -131,9 +131,34 @@
    .ant-card-body {
      position: relative;
      padding: 0;
      .ant-modal-content {
        max-width: 95%;
        margin: 0 auto;
        margin-top: 30px;
        .ant-modal-header {
          position: relative;
          z-index: 10;
          background: transparent;
        }
        .ant-modal-close {
          opacity: 0.5;
        }
        .ant-modal-footer {
          position: relative;
          button {
            opacity: 0.5;
          }
        }
        .action-mask {
          position: absolute;
          top: 0px;
          left: 0px;
          right: 0px;
          bottom: 0px;
        }
      }
      .search-list {
        padding: 1px 24px 20px;
      .modal-form {
        min-height: 87px;
        > .ant-row {
          min-height: 65px;
@@ -172,6 +197,7 @@
                margin-top: 4px;
              }
              .ant-calendar-picker {
                width: 100%;
                margin-top: 4px;
              }
              .input-mask {
@@ -187,10 +213,15 @@
          .edit {
            position: absolute;
            left: 0;
            top: 5px;
            top: 0px;
            color: #1890ff;
            cursor: pointer;
            display: none;
          }
          .edit.close {
            left: 20px;
            color: #ff4d4f;
          }
        }
        .page-card:hover {
          .edit {
src/templates/modalconfig/modalform/index.jsx
File was renamed from src/templates/modalconfig/searchform/index.jsx
@@ -1,7 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Select, Icon, Radio, notification } from 'antd'
import moment from 'moment'
import EditTable from '../editable'
import './index.scss'
@@ -17,44 +16,69 @@
  state = {
    openType: null,
    resourceType: null,
    formlist: null
    formlist: null,
    dateoptions: {
      date: [{value: '', text: '空'}, {value: '0', text: '当天'}, {value: 1, text: '前一天'}, {value: 3, text: '前三天'}, {value: 7, text: '前七天'}, {value: 30, text: '前30天'}],
      dateweek: [{value: '', text: '空'}, {value: '0', text: '本周'}, {value: 1, text: '上周'}, {value: 3, text: '前三周'}, {value: 7, text: '前七周'}],
      datemonth: [{value: '', text: '空'}, {value: '0', text: '本月'}, {value: 1, text: '上月'}, {value: 3, text: '前三月'}, {value: 7, text: '前七月'}],
      daterange: [{value: '', text: '空'}, {value: '0', text: '今天'}, {value: 1, text: '昨天'}, {value: 3, text: '前三天'}, {value: 7, text: '前七天'}, {value: 30, text: '前30天'}],
    }
  }
  openTypeChange = (key, value) => {
    if (key === 'type') {
      let _options = ['label', 'field', 'initval', 'type']
      if (value === 'select' && this.state.resourceType === '0') {
        _options = [..._options, ...['resourceType', 'setAll', 'options', 'display']]
      } else if (value === 'select' && this.state.resourceType === '1') {
        _options = [..._options, ...['resourceType', 'setAll', 'dataSource', 'valueField', 'valueText', 'orderBy', 'orderType', 'display']]
      } else if (value === 'link' && this.state.resourceType === '0') {
        _options = [..._options, ...['resourceType', 'setAll', 'options', 'linkField', 'display']]
      } else if (value === 'link' && this.state.resourceType === '1') {
        _options = [..._options, ...['resourceType', 'setAll', 'dataSource', 'linkField', 'valueField', 'valueText', 'orderBy', 'orderType', 'display']]
      if (value === 'select' || value === 'link') { // 切换类型为选择或关联时,来源默认为自定义
        _options = [..._options, 'resourceType', 'setAll', 'options']
      }
      if (value === 'link') {
        _options = [..._options, 'linkField']
      }
      
      this.setState({
        openType: value,
        resourceType: '0',
        formlist: this.state.formlist.map(form => {
          form.hidden = !_options.includes(form.key)
          if (form.key === 'initval') {
            if (this.state.dateoptions.hasOwnProperty(value)) {
              form.options = this.state.dateoptions[value]
              form.type = 'select'
            } else {
              form.type = 'text'
            }
            form.initVal = ''
            form.hidden = true
          }
          return form
        })
      }, () => {
        this.setState({
          formlist: this.state.formlist.map(form => {
            if (form.key === 'initval') {
              form.hidden = false
            }
            return form
          })
        })
      })
    }
  }
  onChange = (e, key) => {
    const { openType } = this.state
    let value = e.target.value
    if (key === 'resourceType') {
      let _options = ['label', 'field', 'initval', 'type', 'resourceType', 'setAll']
      if (this.state.openType === 'select' && value === '0') {
        _options = [..._options, ...['options', 'display']]
      } else if (this.state.openType === 'select' && value === '1') {
        _options = [..._options, ...['dataSource', 'valueField', 'valueText', 'orderBy', 'orderType', 'display']]
      } else if (this.state.openType === 'link' && value === '0') {
        _options = [..._options, ...['options', 'linkField', 'display']]
      } else if (this.state.openType === 'link' && value === '1') {
        _options = [..._options, ...['dataSource', 'linkField', 'valueField', 'valueText', 'orderBy', 'orderType', 'display']]
      if (value === '0') {
        _options = [..._options, 'options']
      } else if (value === '1') {
        _options = [..._options, 'dataSource', 'valueField', 'valueText', 'orderBy', 'orderType']
      }
      if (openType === 'link') {
        _options = [..._options, 'linkField']
      }
      
      this.setState({
@@ -74,12 +98,6 @@
      if (item.hidden) return
      if (item.type === 'text') { // 文本搜索
        let placeholder = ''
        if (item.key === 'initval' && this.state.openType === 'date') {
          placeholder = '例:' + moment().format('YYYY-MM-DD')
        } else if (item.key === 'initval' && this.state.openType === 'datetime') {
          placeholder = '例:' + moment().format('YYYY-MM-DD HH:mm:ss')
        }
        fields.push(
          <Col span={12} key={index}>
            <Form.Item label={item.label}>
@@ -91,7 +109,7 @@
                    message: this.props.dict['form.required.input'] + item.label + '!'
                  }
                ]
              })(<Input placeholder={placeholder} autoComplete="off" disabled={item.readonly} />)}
              })(<Input placeholder="" autoComplete="off" disabled={item.readonly} />)}
            </Form.Item>
          </Col>
        )
@@ -115,7 +133,7 @@
                  getPopupContainer={() => document.getElementById('commontable-search-form-box')}
                >
                  {item.options.map(option =>
                    <Select.Option id={option.MenuID} title={option.text} key={option.MenuID} value={option.MenuID}>
                    <Select.Option id={option.value} title={option.text} key={option.value} value={option.value}>
                      {item.key === 'icon' && <Icon type={option.text} />} {option.text}
                    </Select.Option>
                  )}
@@ -141,7 +159,7 @@
                  {
                    item.options.map(option => {
                      return (
                        <Radio key={option.MenuID} value={option.MenuID}>{option.text}</Radio>
                        <Radio key={option.value} value={option.value}>{option.text}</Radio>
                      )
                    })
                  }
@@ -150,7 +168,6 @@
            </Form.Item>
          </Col>
        )
      } else if (item.type === 'textarea') {
        fields.push(
          <Col span={20} offset={4} key={index}>
@@ -175,6 +192,7 @@
        )
      }
    })
    return fields
  }
@@ -204,10 +222,7 @@
          }
          if (isvalid) {
            resolve({
              type: 'search',
              values
            })
            resolve(values)
          } else {
            notification.warning({
              top: 92,
@@ -226,21 +241,25 @@
    if (!formlist) return
    let type = formlist.filter(cell => cell.key === 'type')[0].initVal
    let resourceType = formlist.filter(cell => cell.key === 'resourceType')[0].initVal
    let _options = ['label', 'field', 'initval', 'type']
    if (type === 'select' && resourceType === '0') {
      _options = [..._options, ...['resourceType', 'setAll', 'options', 'display']]
    } else if (type === 'select' && resourceType === '1') {
      _options = [..._options, ...['resourceType', 'setAll', 'dataSource', 'valueField', 'valueText', 'orderBy', 'orderType', 'display']]
    } else if (type === 'link' && resourceType === '0') {
      _options = [..._options, ...['resourceType', 'setAll', 'options', 'linkField', 'display']]
    } else if (type === 'link' && resourceType === '1') {
      _options = [..._options, ...['resourceType', 'setAll', 'dataSource', 'linkField', 'valueField', 'valueText', 'orderBy', 'orderType', 'display']]
    let _options = ['label', 'field', 'initval', 'type'] // 默认显示项
    if ((type === 'select' || type === 'link') && resourceType === '0') { // 选择类型、自定义资源
      _options = [..._options, 'resourceType', 'setAll', 'options']
    } else if ((type === 'select' || type === 'link') && resourceType === '1') { // 选择类型、数据源
      _options = [..._options, 'resourceType', 'setAll', 'dataSource', 'valueField', 'valueText', 'orderBy', 'orderType']
    }
    if (type === 'link') { // 关联类型、增加关联字段
      _options = [..._options, 'linkField']
    }
    
    this.setState({
      openType: type,
      resourceType: resourceType,
      formlist: formlist.map(form => {
        if (this.state.dateoptions.hasOwnProperty(type) && form.key === 'initval') {
          form.options = this.state.dateoptions[type]
          form.type = 'select'
        }
        form.hidden = !_options.includes(form.key)
        return form
      })
src/templates/modalconfig/modalform/index.scss
src/templates/modalconfig/settingform/index.jsx
@@ -1,15 +1,14 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Radio } from 'antd'
import { Form, Row, Col, Input, Radio, InputNumber } from 'antd'
import './index.scss'
const { TextArea } = Input
// const { TextArea } = Input
class SettingForm extends Component {
  static propTpyes = {
    dict: PropTypes.object, // 字典项
    formlist: PropTypes.any,
    card: PropTypes.object
    data: PropTypes.object
  }
  state = {
@@ -30,9 +29,9 @@
  }
  render() {
    const { data, dict } = this.props
    const { data } = this.props
    const { getFieldDecorator } = this.props.form
    console.log(data)
    const formItemLayout = {
      labelCol: {
        xs: { span: 24 },
@@ -44,33 +43,36 @@
      }
    }
    return (
      <Form {...formItemLayout} className="ant-advanced-search-form commontable-setting-form">
      <Form {...formItemLayout} className="ant-advanced-search-form modal-setting-form">
        <Row gutter={24}>
          <Col span={12}>
            <Form.Item label="固定按钮">
              {getFieldDecorator('actionfixed', {
                initialValue: data.actionfixed
            <Form.Item label="标题">
              {getFieldDecorator('title', {
                initialValue: data.title
              })(<Input placeholder="" autoComplete="off"/>)}
            </Form.Item>
          </Col>
          <Col span={12}>
            <Form.Item label="列数">
              {getFieldDecorator('cols', {
                initialValue: data.cols
              })(
                <Radio.Group>
                  <Radio value={true}>是</Radio>
                  <Radio value={false}>否</Radio>
                  <Radio value="1">1列</Radio>
                  <Radio value="2">2列</Radio>
                  <Radio value="3">3列</Radio>
                </Radio.Group>
              )}
            </Form.Item>
          </Col>
          <Col span={12}>
            <Form.Item label="固定列">
              {getFieldDecorator('columnfixed', {
                initialValue: data.columnfixed
              })(
                <Radio.Group>
                  <Radio value={true}>是</Radio>
                  <Radio value={false}>否</Radio>
                </Radio.Group>
              )}
            <Form.Item label="宽度">
              {getFieldDecorator('width', {
                initialValue: data.width
              })(<InputNumber min={30} max={90} precision={0} />)}
            </Form.Item>
          </Col>
          <Col span={24}>
          {/* <Col span={24}>
            <Form.Item label="数据源" className="textarea">
              {getFieldDecorator('dataresource', {
                initialValue: data.dataresource,
@@ -82,7 +84,7 @@
                ]
              })(<TextArea rows={4} />)}
            </Form.Item>
          </Col>
          </Col> */}
        </Row>
      </Form>
    )
src/templates/modalconfig/settingform/index.scss
@@ -1,4 +1,4 @@
.ant-advanced-search-form.commontable-setting-form {
.ant-advanced-search-form.modal-setting-form {
  .textarea {
    .ant-form-item-label {
      width: 16.3%;
@@ -7,4 +7,7 @@
      width: 83.33333333%;
    }
  }
  .ant-input-number {
    width: 100%;
  }
}
src/templates/modalconfig/source.jsx
@@ -6,7 +6,7 @@
class CommonTableBaseData {
  baseConfig = {
    type: 'system',
    type: 'modal',
    setting: {
      title: '',
      width: 60,
@@ -74,31 +74,37 @@
  searchItems = [
    {
      type: 'search',
      type: 'form',
      label: '文本框',
      subType: 'text',
      url: ''
    },
    {
      type: 'search',
      type: 'form',
      label: '数值框',
      subType: 'number',
      url: ''
    },
    {
      type: 'form',
      label: '下拉框',
      subType: 'select',
      url: ''
    },
    {
      type: 'search',
      type: 'form',
      label: '时间框(天)',
      subType: 'date',
      url: ''
    },
    {
      type: 'search',
      type: 'form',
      label: '时间框(月)',
      subType: 'datemonth',
      url: ''
    },
    {
      type: 'search',
      type: 'form',
      label: '时间框(秒)',
      subType: 'datetime',
      url: ''
src/views/login/index.scss
@@ -62,6 +62,7 @@
      button {
        width: 100%;
        height: calc(2vw + 10px);
        min-height: 30px;
        line-height: 1;
      }
      .ant-dropdown-link {
@@ -79,6 +80,7 @@
      .ant-input {
        font-size: 16px;
        height: calc(2vw + 5px);
        min-height: 30px;
      }
      .ant-form label {
        font-size: 16px;
@@ -109,3 +111,14 @@
  top: 50px;
  z-index: 1080;
}
@media screen and (max-width: 500px) {
  .login-container {
    .login-middle {
      .login-form {
        float: unset;
        margin: 0 auto;
        margin-top: 5%;
      }
    }
  }
}