king
2020-01-07 ec3cc73f8deaf0b83b0b517e65f949a5a5c496dc
src/templates/comtableconfig/settingform/index.jsx
@@ -80,11 +80,9 @@
  }
  selectChange = (val) => {
    let _order = this.props.form.getFieldValue('order')
    if (_order) return
    // let _order = this.props.form.getFieldValue('order')
    this.props.form.setFieldsValue({
      order: `${val} desc`,
      order: `${val} desc`
    })
  }
@@ -110,6 +108,9 @@
      if (field.length !== 1) {
        primaryKey = ''
      }
    }
    if (!primaryKey && columns.length === 0) {
      primaryKey = 'ID'
    }
    let str = '^(' + usefulFields.join('|') + ')'
@@ -238,7 +239,7 @@
          <Col span={12}>
            <Form.Item label="主键">
              {getFieldDecorator('primaryKey', {
                initialValue: primaryKey ? primaryKey : (columns.length === 0 ? 'ID' : '')
                initialValue: primaryKey
              })(
                <Select
                  getPopupContainer={() => document.getElementById('commontable-setting-form')}
@@ -258,7 +259,7 @@
          <Col span={12}>
            <Form.Item label="默认排序">
              {getFieldDecorator('order', {
                initialValue: data.order,
                initialValue: data.order || (primaryKey ? primaryKey + ' desc' : ''),
                rules: [
                  {
                    required: true,