king
2019-11-30 95f2f60ba9eb343c2605e1ae68c221443d75f704
src/templates/comtableconfig/index.jsx
@@ -600,6 +600,20 @@
        },
        {
          type: 'select',
          key: 'method',
          label: this.state.dict['header.form.request.method'],
          initVal: card.method || 'POST',
          required: true,
          options: [{
            MenuID: 'POST',
            text: 'POST'
          }, {
            MenuID: 'GET',
            text: 'GET'
          }]
        },
        {
          type: 'select',
          key: 'icon',
          label: this.state.dict['header.form.icon'],
          initVal: card.icon,
@@ -613,6 +627,13 @@
          initVal: card.class,
          required: false,
          options: []
        },
        {
          type: 'textarea',
          key: 'sql',
          label: this.state.dict['header.form.datasource'],
          initVal: card.sql || '',
          required: false
        }
      ]
    })
@@ -713,6 +734,7 @@
  handleSubmit = () => {
    this.formRef.handleConfirm().then(res => {
      let _config = this.state.config
      let isupdate = false
      if (res.type === 'search') {
        if ((res.values.type === 'select' || res.values.type === 'link') && res.values.resourceType === '1') {
@@ -727,6 +749,7 @@
      if (this.state.operaType === 'add') {
        _config[res.type] = _config[res.type].map(item => {
          if (item.uuid === res.values.uuid) {
            isupdate = true
            return res.values
          } else {
            return item
@@ -736,11 +759,16 @@
      } else {
        _config[res.type] = _config[res.type].map(item => {
          if (item.uuid === res.values.uuid) {
            isupdate = true
            return res.values
          } else {
            return item
          }
        })
      }
      if (!isupdate) { // 操作不是修改,添加元素至列表
        _config[res.type].push(res.values)
      }
      this.setState({
@@ -1443,6 +1471,7 @@
                    placeholder={this.state.dict['header.form.action.placeholder']}
                    handleList={this.handleList}
                    handleMenu={this.handleAction}
                    copyElement={this.handleAction}
                  /> : null
                }
              </div>