king
2020-02-15 c76e56d9cc6f8f5e93aaf355b269ec8cac8c6b95
2020-02-15
17个文件已修改
1个文件已添加
468 ■■■■ 已修改文件
node_modules.rar 补丁 | 查看 | 原始文档 | blame | 历史
src/locales/en-US/comtable.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/locales/zh-CN/comtable.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/commontable/index.jsx 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/formtab/index.jsx 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/settingform/index.jsx 43 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/formtabconfig/actionform/index.jsx 124 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/formtabconfig/dragelement/card.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/formtabconfig/index.jsx 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/formtabconfig/index.scss 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/formtabconfig/settingform/index.jsx 127 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/formtabconfig/source.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/subtableconfig/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/subtableconfig/settingform/index.jsx 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/tableshare/verifycardexcelin/columnform/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/option.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
node_modules.rar
Binary files differ
src/locales/en-US/comtable.js
@@ -47,6 +47,9 @@
  'header.menu.func.create': '创建存储过程',
  'header.menu.tab': '标签页',
  'header.menu.tab.subtable': '子表',
  'header.menu.datasource': '数据来源',
  'header.menu.maintable': '主表',
  'header.menu.query': '查询',
  'header.form.tabType': '标签类型',
  'header.form.search.placeholder': 'Please add search criteria',
  'header.form.modal.placeholder': 'Please add the form',
@@ -69,6 +72,7 @@
  'header.form.execError': 'Failure',
  'header.form.messageTip': '信息提示',
  'header.form.errorTime': '停留时间',
  'header.form.refresh': '刷新',
  'header.form.refresh.never': 'Don\'t refresh',
  'header.form.refresh.view': 'Refresh the page',
  'header.form.refresh.grid': 'Refresh the table',
src/locales/zh-CN/comtable.js
@@ -47,6 +47,9 @@
  'header.menu.func.create': '创建存储过程',
  'header.menu.tab': '标签页',
  'header.menu.tab.subtable': '子表',
  'header.menu.datasource': '数据来源',
  'header.menu.maintable': '主表',
  'header.menu.query': '查询',
  'header.form.tabType': '标签类型',
  'header.form.search.placeholder': '请添加搜索条件',
  'header.form.modal.placeholder': '请添加表单',
@@ -69,6 +72,7 @@
  'header.form.execError': '执行失败',
  'header.form.messageTip': '信息提示',
  'header.form.errorTime': '停留时间',
  'header.form.refresh': '刷新',
  'header.form.refresh.never': '不刷新',
  'header.form.refresh.view': '刷新页面',
  'header.form.refresh.grid': '刷新表格',
src/tabviews/commontable/index.jsx
@@ -701,6 +701,14 @@
   * @description 触发按钮弹窗(标签页)
   */
  triggerPopview = (btn, data) => {
    const { setting } = this.state
    let _primaryId = ''
    if (data && data[0] && setting.primaryKey) {
      _primaryId = data[0][setting.primaryKey] || ''
    }
    if (btn.OpenType === 'popview') {
      this.setState({
        popAction: btn,
@@ -718,6 +726,7 @@
        param: {
          btn: btn,
          data: data,
          primaryId: _primaryId,
          arr_field: this.state.arr_field
        }
      }
@@ -742,6 +751,7 @@
        tabParam: {
          btn: btn,
          data: data,
          primaryId: _primaryId,
          arr_field: this.state.arr_field
        }
      })
src/tabviews/formtab/index.jsx
@@ -89,7 +89,7 @@
      }
      let _arrField = []     // 字段集
      console.log(this.props.param)
      if (this.props.param && this.props.param.arr_field) {
        _arrField = this.props.param.arr_field
      } else {
@@ -132,34 +132,21 @@
        }
      })
      let _data = null
      let _isCustomData = false
      if (this.props.param && this.props.param.data) {
        _data = this.props.param.data[0] || null
      }
      if ((config.setting.interType === 'inner' && config.setting.innerFunc) || (config.setting.interType === 'outer' && config.setting.interface)) {
        _isCustomData = true
        _data = null
      }
      this.setState({
        config: config,
        setting: config.setting,
        actions: config.action,
        isLinkMain: _isLinkMain,
        arr_field: _arrField,
        data: _data,
        data: config.setting.datatype === 'query' ? null : (this.props.param.data[0] || null),
        BIDs: {
          mainTable: (!_isCustomData && _data && _data[0] && _data[0][config.setting.primaryKey]) || '',
          mainTabledata: (!_isCustomData && _data && _data[0]) || ''
          mainTable: this.props.param.primaryId || '',
          mainTabledata: config.setting.datatype === 'query' ? '' : (this.props.param.data[0] || '')
        }
      }, () => {
        this.improveSelectOption(config.groups)
        if (_isCustomData) {
        if (config.setting.datatype === 'query') {
          this.loadmaindata()
        }
      })
src/templates/comtableconfig/index.jsx
@@ -12,6 +12,7 @@
import zhCN from '@/locales/zh-CN/comtable.js'
import enUS from '@/locales/en-US/comtable.js'
import { getSearchForm, getActionForm, getColumnForm } from '@/templates/tableshare/formconfig'
import { queryTableSql } from '@/utils/option.js'
import ActionForm from './actionform'
import SettingForm from './settingform'
@@ -186,8 +187,7 @@
  componentDidMount () {
    let param = {
      func: 'sPC_Get_SelectedList',
      // LText: 'select TbName ,Remark from sDataDictionary where IsKey!=\'\' and Deleted =0',
      LText: 'select TbName,Remark from (select TbName,Remark from sDataDictb where appkey= @appkey@ and Deleted=0 union select a.TbName,Remark from (select TbName,Remark from sDataDictb where appkey= \'\' and Deleted=0 ) a left join (select TbName from sDataDictb where appkey= @appkey@ and Deleted=0 ) b on a.TbName=b.TbName where b.TbName is null ) t',
      LText: queryTableSql,
      obj_name: 'data',
      arr_field: 'TbName,Remark'
    }
src/templates/comtableconfig/settingform/index.jsx
@@ -21,11 +21,12 @@
    columns: this.props.columns.filter(item => item.field && item.type !== 'colspan'),
    currentTabs: null,
    selectTabs: [],
    interReadonly: false
    interReadonly: false,
    primaryKey: ''
  }
  UNSAFE_componentWillMount() {
    const { config, data } = this.props
    const { config, data, columns } = this.props
    let _tabs = []
    let _select = []
    let _tabMap = new Map()
@@ -45,10 +46,26 @@
      }
    })
    let primaryKey = data.primaryKey
    if (primaryKey) {
      let field = columns.filter(column => column.field === primaryKey)
      if (field.length !== 1) {
        primaryKey = ''
      }
    }
    if (!primaryKey) {
      columns.forEach(col => {
        if (col.field.toLowerCase() === 'id') {
          primaryKey = col.field
        }
      })
    }
    this.setState({
      currentTabs: _tabs,
      selectTabs: _select,
      interReadonly: data.sysInterface === 'true'
      interReadonly: data.sysInterface === 'true',
      primaryKey: primaryKey
    })
  }
@@ -122,7 +139,7 @@
  render() {
    const { data, dict, menu, usefulFields } = this.props
    const { getFieldDecorator } = this.props.form
    const { interType, columns, selectTabs } = this.state
    const { interType, columns, selectTabs, primaryKey } = this.state
    const formItemLayout = {
      labelCol: {
@@ -133,17 +150,6 @@
        xs: { span: 24 },
        sm: { span: 16 }
      }
    }
    let primaryKey = data.primaryKey
    if (primaryKey) {
      let field = columns.filter(column => column.field === primaryKey)
      if (field.length !== 1) {
        primaryKey = ''
      }
    }
    if (!primaryKey && columns.length === 0) {
      primaryKey = 'ID'
    }
    let str = '^(' + usefulFields.join('|') + ')'
@@ -319,16 +325,13 @@
          <Col span={12}>
            <Form.Item label="主键">
              {getFieldDecorator('primaryKey', {
                initialValue: primaryKey
                initialValue: primaryKey || ''
              })(
                <Select
                  getPopupContainer={() => document.getElementById('commontable-setting-form')}
                  onChange={this.selectChange}
                >
                  <Select.Option key='unset' value="">不设置</Select.Option>
                  {columns.length === 0 ?
                    <Select.Option key='id' value="ID">ID</Select.Option> : null
                  }
                  <Select.Option key='unset' value="">未设置</Select.Option>
                  {columns.map((option, index) =>
                    <Select.Option id={option.uuid} title={option.label} key={index} value={option.field}>{option.label}</Select.Option>
                  )}
src/templates/formtabconfig/actionform/index.jsx
@@ -28,6 +28,23 @@
    }, {
      value: 'update',
      text: this.props.dict['header.form.action.update']
    }],
    returnoptions: [{ // 返回后-不刷新、刷新页面、刷新表格
      value: 'never',
      text: this.props.dict['header.form.refresh.never']
    }, {
      value: 'grid',
      text: this.props.dict['header.form.refresh.grid']
    }, {
      value: 'view',
      text: this.props.dict['header.form.refresh.view']
    }],
    currentoptions: [{ // 不返回时-不刷新、刷新
      value: 'never',
      text: this.props.dict['header.form.refresh.never']
    }, {
      value: 'refresh',
      text: this.props.dict['header.form.refresh']
    }]
  }
@@ -36,20 +53,32 @@
    const { card } = this.props
    let _intertype = ''
    let _options = null
    console.log(this.props.card.btnType)
    let _success = 'close'
    let _error = 'notclose'
    this.props.formlist.forEach(form => {
      if (form.key === 'intertype') {
        _intertype = form.initVal
      } else if (form.key === 'afterExecSuccess') {
        _success = form.initVal
      } else if (form.key === 'afterExecError') {
        _error = form.initVal
      }
    })
    if (card.btnType === 'cancel') {
      _options = ['label', 'OpenType', 'icon', 'class', 'execSuccess']
    } else {
      this.props.formlist.forEach(form => {
        if (form.key === 'intertype') {
          _intertype = form.initVal
        }
      })
    } else if (card.btnType === 'confirm') {
      if (_intertype === 'outer') {
        _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'sysInterface', 'icon', 'class', 'execSuccess', 'execError', 'afterExecSuccess', 'afterExecError']
      } else {
        _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType', 'afterExecSuccess', 'afterExecError']
      }
    } else {
      if (_intertype === 'outer') {
        _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'sysInterface', 'icon', 'class', 'execSuccess', 'execError', 'afterExecSuccess', 'afterExecError']
      } else {
        _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'afterExecSuccess', 'afterExecError']
      }
    }
@@ -76,7 +105,22 @@
          }
        } else if (item.key === 'execSuccess' && card.btnType === 'cancel') {
          item.label = '关闭后'
        } else if (item.key === 'execSuccess' && card.btnType !== 'cancel') {
          if (_success === 'close') {
            item.options = this.state.returnoptions
          } else {
            item.options = this.state.currentoptions
          }
        } else if (item.key === 'execError') {
          if (_error === 'close') {
            item.options = this.state.returnoptions
          } else {
            item.options = this.state.currentoptions
          }
        } else if (item.key === 'innerFunc' && card.btnType !== 'confirm' && _intertype === 'inner') {
          item.required = true
        }
        item.hidden = !_options.includes(item.key)
        return item
      })
@@ -96,15 +140,66 @@
    }
  }
  selectChange = (key, value) => {
    if (key === 'afterExecSuccess') {
      this.setState({
        formlist: this.state.formlist.map(item => {
          if (item.key === 'execSuccess') {
            if (value === 'close') {
              item.options = this.state.returnoptions
            } else {
              item.options = this.state.currentoptions
            }
          }
          return item
        })
      })
      this.props.form.setFieldsValue({
        execSuccess: 'never'
      })
    } else if (key === 'afterExecError') {
      this.setState({
        formlist: this.state.formlist.map(item => {
          if (item.key === 'execError') {
            if (value === 'close') {
              item.options = this.state.returnoptions
            } else {
              item.options = this.state.currentoptions
            }
          }
          return item
        })
      })
      this.props.form.setFieldsValue({
        execError: 'never'
      })
    }
  }
  onChange = (e, key) => {
    const { card } = this.props
    let value = e.target.value
    if (key === 'intertype') {
      let _options = null
      if (value === 'inner') {
        _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType', 'afterExecSuccess', 'afterExecError']
      if (card.btnType === 'confirm') {
        if (value === 'outer') {
          _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'sysInterface', 'icon', 'class', 'execSuccess', 'execError', 'afterExecSuccess', 'afterExecError']
        } else {
          _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType', 'afterExecSuccess', 'afterExecError']
        }
      } else {
        _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'afterExecSuccess', 'afterExecError']
        if (value === 'outer') {
          _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'sysInterface', 'icon', 'class', 'execSuccess', 'execError', 'afterExecSuccess', 'afterExecError']
        } else {
          _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'afterExecSuccess', 'afterExecError']
        }
      }
      this.setState({
        interType: value,
        formlist: this.state.formlist.map(item => {
@@ -114,7 +209,12 @@
            item.readonly = false
          } else if (item.key === 'sysInterface') {
            item.initVal = 'false'
          } else if (item.key === 'innerFunc' && card.btnType !== 'confirm' && value === 'inner') {
            item.required = true
          } else if (item.key === 'innerFunc' && card.btnType !== 'confirm' && value === 'outer') {
            item.required = false
          }
          return item
        })
      })
@@ -125,7 +225,6 @@
        })
      }
      this.setState({
        // interType: value,
        formlist: this.state.formlist.map(item => {
          if (item.key === 'interface' && value === 'true') {
            item.readonly = true
@@ -230,6 +329,7 @@
                  showSearch
                  filterOption={(input, option) => option.props.children[2].toLowerCase().indexOf(input.toLowerCase()) >= 0}
                  getPopupContainer={() => document.getElementById('winter')}
                  onChange={(val) => this.selectChange(item.key, val)}
                  disabled={!!item.readonly}
                >
                  {item.options.map((option, index) =>
src/templates/formtabconfig/dragelement/card.jsx
@@ -133,7 +133,7 @@
        }
      </div>
      <Icon className="edit" title="编辑" type="edit" onClick={edit} />
      {type === 'action' && ['prompt', 'exec'].includes(card.OpenType) && card.intertype === 'inner' && !card.innerFunc ?
      {type === 'action' && card.btnType === 'confirm' && card.intertype === 'inner' && !card.innerFunc ?
        <Icon className="edit profile" title="校验规则" type="profile" onClick={profile} /> : null
      }
      {card.btnType !== 'confirm' && card.btnType !== 'cancel' && <Icon className="edit close" title="删除" type="close" onClick={del} />}
src/templates/formtabconfig/index.jsx
@@ -12,11 +12,11 @@
import enUS from '@/locales/en-US/comtable.js'
import Utils from '@/utils/utils.js'
import { getModalForm, getActionForm } from '@/templates/tableshare/formconfig'
import { queryTableSql } from '@/utils/option.js'
import ModalForm from '@/templates/ushare/modalform'
import ActionForm from './actionform'
import SettingForm from './settingform'
// import ModalForm from './modalform'
import DragElement from './dragelement'
import GroupForm from './groupform'
import TabForm from '@/templates/tableshare/tabform'
@@ -63,8 +63,8 @@
    funcLoading: false,      // 存储过程创建中
    tabviews: [],            // 所有标签页
    profileVisible: false,   // 验证信息模态框
    editgroup: null,
    groupVisible: null
    editgroup: null,         // 当前编辑组
    groupVisible: false      // 编辑组模态框
  }
  /**
@@ -123,8 +123,7 @@
  componentDidMount () {
    let param = {
      func: 'sPC_Get_SelectedList',
      // LText: 'select TbName ,Remark from sDataDictionary where IsKey!=\'\' and Deleted =0',
      LText: 'select TbName,Remark from (select TbName,Remark from sDataDictb where appkey= @appkey@ and Deleted=0 union select a.TbName,Remark from (select TbName,Remark from sDataDictb where appkey= \'\' and Deleted=0 ) a left join (select TbName from sDataDictb where appkey= @appkey@ and Deleted=0 ) b on a.TbName=b.TbName where b.TbName is null ) t',
      LText: queryTableSql,
      obj_name: 'data',
      arr_field: 'TbName,Remark'
    }
@@ -1177,6 +1176,13 @@
      let _LongParam = ''
      let _config = {...config, tables: this.state.selectedTables}
      // 数据来源为查询且未设置主键时,启用为false
      if (_config.setting.datatype === 'query' && !_config.setting.primaryKey) {
        _config.enabled = false
      } else if (_config.setting.datatype === 'query' && _config.setting.interType === 'inner' && !_config.setting.innerFunc && !_config.setting.dataresource) {
        _config.enabled = false
      }
      // 标签不合法时,启用状态为false
      if (_config.tabgroups.length > 1) {
        _config.tabgroups.forEach(group => {
@@ -1739,17 +1745,37 @@
        }
      })
    }
    let forminvalid = true
    if (config.groups.length > 1) {
      config.groups.forEach(group => {
        if (group.sublist.length === 0) {
          forminvalid = false
        }
      })
    }
    if (config.setting.interType === 'inner' && !config.setting.innerFunc && !config.setting.dataresource) {
    if (config.setting.datatype === 'query' && config.setting.interType === 'inner' && !config.setting.innerFunc && !config.setting.dataresource) {
      notification.warning({
        top: 92,
        message: '菜单尚未设置数据源,不可启用!',
        message: '尚未设置数据源,不可启用!',
        duration: 10
      })
    } else if (config.setting.datatype === 'query' && config.setting.primaryKey) {
      notification.warning({
        top: 92,
        message: '尚未设置主键,不可启用!',
        duration: 10
      })
    } else if (!tabinvalid) {
      notification.warning({
        top: 92,
        message: '菜单标签页设置错误(多行标签内,行标签不可为空),不可启用!',
        message: '存在多余标签组,不可启用!',
        duration: 10
      })
    } else if (!forminvalid) {
      notification.warning({
        top: 92,
        message: '存在多余空表单组,不可启用!',
        duration: 10
      })
    } else {
src/templates/formtabconfig/index.scss
@@ -300,14 +300,17 @@
            cursor: pointer;
            display: none;
          }
          .edit.close {
            left: 40px;
            color: #ff4d4f;
          }
          .edit.profile {
            left: 20px;
            color: purple;
          }
          .edit.close {
            left: 20px;
            color: #ff4d4f;
          }
          .edit.profile + .edit.close {
            left: 40px;
          }
          button {
            cursor: move;
            min-width: 65px;
src/templates/formtabconfig/settingform/index.jsx
@@ -19,11 +19,12 @@
    columns: null,
    currentTabs: null,
    selectTabs: [],
    interReadonly: false
    interReadonly: false,
    primaryKey: ''
  }
  UNSAFE_componentWillMount() {
    const { config, menu } = this.props
    const { config } = this.props
    let _tabs = []
    let _select = []
@@ -32,9 +33,6 @@
    let _setting = config.setting
    
    try {
      if (menu && menu.LongParam) {
        _columns = menu.LongParam.columns.filter(item => item.field && item.type !== 'colspan')
      }
      config.groups.forEach(group => {
        let list = group.sublist.filter(item => item.field)
        _columns = [..._columns, ...list]
@@ -72,12 +70,30 @@
      }
    })
    let primaryKey = _setting.primaryKey
    if (primaryKey) {
      let field = _columns.filter(column => column.field === primaryKey)
      if (field.length !== 1) {
        primaryKey = ''
      }
    }
    if (!primaryKey) {
      _columns.forEach(col => {
        if (col.field.toLowerCase() === 'id') {
          primaryKey = col.field
        }
      })
    }
    this.setState({
      currentTabs: _tabs,
      selectTabs: _select,
      columns: _columns,
      setting: _setting,
      interReadonly: _setting.sysInterface === 'true'
      interType: _setting.interType || 'inner',
      interReadonly: _setting.sysInterface === 'true',
      datatype: _setting.datatype || 'maintable',
      primaryKey: primaryKey
    })
  }
@@ -131,10 +147,34 @@
    })
  }
  sourceChange = (e) => {
    const { interType } = this.state
    this.setState({
      datatype: e.target.value
    }, () => {
      if (interType === 'inner') return
      let _type = this.props.form.getFieldValue('sysInterface')
      if (_type === 'true') {
        this.props.form.setFieldsValue({
          interface: window.GLOB.mainSystemApi || window.GLOB.subSystemApi
        })
        this.setState({
          interReadonly: true
        })
      } else {
        this.setState({
          interReadonly: false
        })
      }
    })
  }
  render() {
    const { dict, usefulFields, menu } = this.props
    const { getFieldDecorator } = this.props.form
    const { interType, columns, selectTabs, setting } = this.state
    const { interType, columns, selectTabs, setting, datatype, primaryKey } = this.state
    const formItemLayout = {
      labelCol: {
@@ -145,17 +185,6 @@
        xs: { span: 24 },
        sm: { span: 16 }
      }
    }
    let primaryKey = setting.primaryKey
    if (primaryKey) {
      let field = columns.filter(column => column.field === primaryKey)
      if (field.length !== 1) {
        primaryKey = ''
      }
    }
    if (!primaryKey && columns.length === 0) {
      primaryKey = 'ID'
    }
    let str = '^(' + usefulFields.join('|') + ')'
@@ -195,9 +224,37 @@
            </Form.Item>
          </Col>
          <Col span={12}>
            <Form.Item label={dict['header.menu.datasource']}>
              {getFieldDecorator('datatype', {
                initialValue: setting.datatype || 'maintable'
              })(
                <Radio.Group onChange={this.sourceChange}>
                  <Radio value="maintable">{dict['header.menu.maintable']}</Radio>
                  <Radio value="query">{dict['header.menu.query']}</Radio>
                </Radio.Group>
              )}
            </Form.Item>
          </Col>
          {datatype === 'query' ? <Col span={12}>
            <Form.Item label="主键">
              {getFieldDecorator('primaryKey', {
                initialValue: primaryKey || ''
              })(
                <Select
                  getPopupContainer={() => document.getElementById('commontable-setting-form')}
                >
                  <Select.Option key='unset' value="">未设置</Select.Option>
                  {columns.map((option, index) =>
                    <Select.Option id={option.uuid} title={option.label} key={index} value={option.field}>{option.label}</Select.Option>
                  )}
                </Select>
              )}
            </Form.Item>
          </Col> : null}
          {datatype === 'query' ? <Col span={12}>
            <Form.Item label={dict['header.form.intertype']}>
              {getFieldDecorator('interType', {
                initialValue: setting.interType || 'inner'
                initialValue: interType
              })(
                <Radio.Group onChange={this.onChange}>
                  <Radio value="inner">{dict['header.form.interface.inner']}</Radio>
@@ -205,8 +262,8 @@
                </Radio.Group>
              )}
            </Form.Item>
          </Col>
          {interType === 'outer' ? <Col span={12}>
          </Col> : null}
          {datatype === 'query' && interType === 'outer' ? <Col span={12}>
            <Form.Item label={dict['header.form.sysInterface']}>
              {getFieldDecorator('sysInterface', {
                initialValue: setting.sysInterface || 'false'
@@ -218,7 +275,7 @@
              )}
            </Form.Item>
          </Col> : null}
          {interType === 'outer' ? <Col span={12}>
          {datatype === 'query' && interType === 'outer' ? <Col span={12}>
            <Form.Item label={dict['header.form.interface']}>
              {getFieldDecorator('interface', {
                initialValue: setting.sysInterface === 'true' ? (window.GLOB.mainSystemApi || window.GLOB.subSystemApi) : (setting.interface || ''),
@@ -235,7 +292,7 @@
              })(<Input placeholder="" autoComplete="off" disabled={this.state.interReadonly} />)}
            </Form.Item>
          </Col> : null}
          {interType !== 'outer' ? <Col span={12}>
          {datatype === 'query' && interType !== 'outer' ? <Col span={12}>
            <Form.Item label={
              <Tooltip placement="topLeft" overlayClassName="middle" title={`可自定义数据处理函数,函数名称需以${usefulFields.join(', ')}等字符开始;未设置时会调用系统函数,使用系统函数需完善数据源。`}>
                <Icon type="question-circle" />
@@ -256,7 +313,7 @@
              })(<Input placeholder="" autoComplete="off" />)}
            </Form.Item>
          </Col> : null}
          {interType !== 'outer' ? <Col span={24}>
          {datatype === 'query' && interType !== 'outer' ? <Col span={24}>
            <Form.Item help={'数据ID:' + menu.MenuID} label={
              <Tooltip placement="topLeft" title="使用系统函数时,需填写数据源,自定义函数时,可忽略。">
                <Icon type="question-circle" />
@@ -268,7 +325,7 @@
              })(<TextArea rows={4} />)}
            </Form.Item>
          </Col> : null}
          {interType === 'outer' ? <Col span={12}>
          {datatype === 'query' && interType === 'outer' ? <Col span={12}>
            <Form.Item label={dict['header.form.outerFunc']}>
              {getFieldDecorator('outerFunc', {
                initialValue: setting.outerFunc || '',
@@ -284,26 +341,6 @@
              })(<Input placeholder="" autoComplete="off" />)}
            </Form.Item>
          </Col> : null}
          <Col span={12}>
            <Form.Item label="主键">
              {getFieldDecorator('primaryKey', {
                initialValue: primaryKey
              })(
                <Select
                  getPopupContainer={() => document.getElementById('commontable-setting-form')}
                >
                  <Select.Option key='unset' value="">不设置</Select.Option>
                  {columns.length === 0 ?
                    <Select.Option key='id' value="ID">ID</Select.Option> : null
                  }
                  {columns.map((option, index) =>
                    <Select.Option id={option.uuid} title={option.label} key={index} value={option.field}>{option.label}</Select.Option>
                  )}
                </Select>
              )}
            </Form.Item>
          </Col>
          <Col span={12}>
            <Form.Item label={
              <Tooltip placement="topLeft" title="主表可选取关联标签,标签关联后,主表数据切换时,下级标签会跟随主表主键值变化。">
src/templates/formtabconfig/source.jsx
@@ -82,7 +82,7 @@
        execError: 'never',
        errorTime: 15,
        OpenType: 'exec',
        icon: 'plus',
        icon: '',
        class: 'green',
        verify: null
      }, {
@@ -95,8 +95,8 @@
        OpenType: 'exec',
        pageTemplate: '',
        url: '',
        icon: 'rollback',
        class: 'purple'
        icon: '',
        class: 'danger'
      }
    ],
    tabs: [
src/templates/modalconfig/index.jsx
@@ -11,6 +11,7 @@
import enUS from '@/locales/en-US/comtable.js'
import Utils from '@/utils/utils.js'
import { getModalForm } from '@/templates/tableshare/formconfig'
import { queryTableSql } from '@/utils/option.js'
import ModalForm from '@/templates/ushare/modalform'
import DragElement from './dragelement'
@@ -131,8 +132,7 @@
  componentDidMount () {
    let param = {
      func: 'sPC_Get_SelectedList',
      // LText: 'select TbName ,Remark from sDataDictionary where IsKey!=\'\' and Deleted =0',
      LText: 'select TbName,Remark from (select TbName,Remark from sDataDictb where appkey= @appkey@ and Deleted=0 union select a.TbName,Remark from (select TbName,Remark from sDataDictb where appkey= \'\' and Deleted=0 ) a left join (select TbName from sDataDictb where appkey= @appkey@ and Deleted=0 ) b on a.TbName=b.TbName where b.TbName is null ) t',
      LText: queryTableSql,
      obj_name: 'data',
      arr_field: 'TbName,Remark'
    }
src/templates/subtableconfig/index.jsx
@@ -12,6 +12,7 @@
import enUS from '@/locales/en-US/comtable.js'
import Utils from '@/utils/utils.js'
import { getSearchForm, getActionForm, getColumnForm } from '@/templates/tableshare/formconfig'
import { queryTableSql } from '@/utils/option.js'
import ActionForm from './actionform'
import SettingForm from './settingform'
@@ -155,8 +156,7 @@
  componentDidMount () {
    let param = {
      func: 'sPC_Get_SelectedList',
      // LText: 'select TbName ,Remark from sDataDictionary where IsKey!=\'\' and Deleted =0',
      LText: 'select TbName,Remark from (select TbName,Remark from sDataDictb where appkey= @appkey@ and Deleted=0 union select a.TbName,Remark from (select TbName,Remark from sDataDictb where appkey= \'\' and Deleted=0 ) a left join (select TbName from sDataDictb where appkey= @appkey@ and Deleted=0 ) b on a.TbName=b.TbName where b.TbName is null ) t',
      LText: queryTableSql,
      obj_name: 'data',
      arr_field: 'TbName,Remark'
    }
src/templates/subtableconfig/settingform/index.jsx
@@ -18,7 +18,31 @@
  state = {
    interType: this.props.data.interType || 'inner',
    columns: this.props.columns.filter(item => item.field && item.type !== 'colspan'),
    interReadonly: this.props.data.sysInterface === 'true'
    interReadonly: this.props.data.sysInterface === 'true',
    primaryKey: ''
  }
  UNSAFE_componentWillMount() {
    const { data, columns } = this.props
    let primaryKey = data.primaryKey
    if (primaryKey) {
      let field = columns.filter(column => column.field === primaryKey)
      if (field.length !== 1) {
        primaryKey = ''
      }
    }
    if (!primaryKey) {
      columns.forEach(col => {
        if (col.field.toLowerCase() === 'id') {
          primaryKey = col.field
        }
      })
    }
    this.setState({
      primaryKey: primaryKey
    })
  }
  handleConfirm = () => {
@@ -94,7 +118,7 @@
  render() {
    const { data, dict, tabId, usefulFields } = this.props
    const { getFieldDecorator } = this.props.form
    const { interType, columns } = this.state
    const { interType, columns, primaryKey } = this.state
    const formItemLayout = {
      labelCol: {
@@ -105,17 +129,6 @@
        xs: { span: 24 },
        sm: { span: 16 }
      }
    }
    let primaryKey = data.primaryKey
    if (primaryKey) {
      let field = columns.filter(column => column.field === primaryKey)
      if (field.length !== 1) {
        primaryKey = ''
      }
    }
    if (!primaryKey && columns.length === 0) {
      primaryKey = 'ID'
    }
    let str = '^(' + usefulFields.join('|') + ')'
@@ -266,16 +279,13 @@
          <Col span={12}>
            <Form.Item label="主键">
              {getFieldDecorator('primaryKey', {
                initialValue: primaryKey
                initialValue: primaryKey || ''
              })(
                <Select
                  getPopupContainer={() => document.getElementById('subtable-setting-form')}
                  onChange={this.selectChange}
                >
                  <Select.Option key='unset' value="">不设置</Select.Option>
                  {columns.length === 0 ?
                    <Select.Option key='id' value="ID">ID</Select.Option> : null
                  }
                  <Select.Option key='unset' value="">未设置</Select.Option>
                  {columns.map((option, index) =>
                    <Select.Option id={option.uuid} title={option.label} key={index} value={option.field}>{option.label}</Select.Option>
                  )}
src/templates/tableshare/verifycardexcelin/columnform/index.jsx
@@ -57,7 +57,7 @@
        this.props.form.setFieldsValue({
          Column: '',
          Text: '',
          required: 'false',
          required: 'true',
          type: 'Nvarchar(50)'
        })
      }
@@ -111,7 +111,7 @@
          <Col span={7}>
            <Form.Item label={'是否必填'}>
              {getFieldDecorator('required', {
                initialValue: 'false'
                initialValue: 'true'
              })(
                <Select>
                  <Select.Option value="false"> 否 </Select.Option>
src/utils/option.js
@@ -5,6 +5,7 @@
const _dict =  sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS
// 表单校验规则
export const formRule = {
  input: {
    max: 100,
@@ -36,6 +37,7 @@
  }
}
// 系统模板
export const sysTemps = [
  {
    title: '基础表格',
@@ -61,6 +63,7 @@
  }
]
// 日期默认值选择范围
export const dateOptions = {
  date: [
    {value: '', text: _dict['date.empty']},
@@ -105,7 +108,8 @@
  ]
}
export const matchReg = { // 匹配规则
// 匹配规则
export const matchReg = {
  text: [{
    value: 'like',
    text: 'like'
@@ -146,6 +150,7 @@
  }]
}
// 按钮图标集
export const btnIcons = [{
  value: '',
  text: 'unset'
@@ -187,6 +192,7 @@
  text: 'step-forward'
}]
// 按钮颜色集
export const btnClasses = [{
  value: 'default',
  text: '默认(黑边白底)'
@@ -239,3 +245,5 @@
  value: 'border-purple',
  text: '白底紫框'
}]
export const queryTableSql = 'select TbName,Remark from (select TbName,Remark from sDataDictb where appkey= @appkey@ and Deleted=0 union select a.TbName,Remark from (select TbName,Remark from sDataDictb where appkey= \'\' and Deleted=0 ) a left join (select TbName from sDataDictb where appkey= @appkey@ and Deleted=0 ) b on a.TbName=b.TbName where b.TbName is null ) t'