king
2020-01-19 b35e3f0bacdbadf5823e06fe8dc6e047089aae38
2020-01-19
14个文件已修改
287 ■■■■ 已修改文件
src/components/header/index.jsx 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/header/loginform.jsx 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/sidemenu/editthdmenu/index.jsx 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/locales/en-US/comtable.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/locales/zh-CN/comtable.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/commontable/index.jsx 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/subtable/index.jsx 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/subtabtable/index.jsx 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/tableshare/actionList/index.jsx 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/settingform/index.jsx 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/formtabconfig/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/subtableconfig/actionform/index.jsx 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/subtableconfig/index.jsx 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/subtableconfig/settingform/index.jsx 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/header/index.jsx
@@ -263,6 +263,9 @@
          this.loadmenu()
          this.props.resetEditState(true)
        } else {
          this.setState({
            loginLoading: false
          })
          notification.error({
            top: 92,
            message: res.message,
src/components/header/loginform.jsx
@@ -27,10 +27,20 @@
    })
  }
  handleSubmit = e => {
    // 登录参数检验
  handleSubmit = (e, key) => {
    e.preventDefault()
    this.props.handleSubmit()
    if (e.target.value) {
      if (!this.props.form.getFieldValue(key)) {
        const input = document.getElementById(key)
        if (input) {
          input.focus()
        }
        return
      }
      this.props.handleSubmit()
    } else {
      this.handleConfirm()
    }
  }
  componentDidMount () {
@@ -54,7 +64,7 @@
              prefix={<Icon type="user" style={{ color: 'rgba(0,0,0,.25)' }} />}
              placeholder={this.state.dict['login.username']}
              autoComplete="off"
              onPressEnter={this.handleSubmit}
              onPressEnter={(e) => {this.handleSubmit(e, 'password')}}
            />
          )}
        </Form.Item>
@@ -67,7 +77,7 @@
                message: this.state.dict['login.password.empty'],
              }
            ]
          })(<Input.Password onPressEnter={this.handleSubmit} placeholder={this.state.dict['login.password']} prefix={<Icon type="lock" style={{ color: 'rgba(0,0,0,.25)' }} />} />)}
          })(<Input.Password onPressEnter={(e) => {this.handleSubmit(e, 'username')}} placeholder={this.state.dict['login.password']} prefix={<Icon type="lock" style={{ color: 'rgba(0,0,0,.25)' }} />} />)}
        </Form.Item>
      </Form>
    )
src/components/sidemenu/editthdmenu/index.jsx
@@ -449,55 +449,78 @@
  }
  handleSubConfig = (item, originMenu, config, type) => {
    if (type === 'button') { // 三级菜单页面,按钮配置
      if (item.OpenType === 'pop') {
    this.setState({
      tabview: ''
    }, () => {
      if (type === 'button') { // 三级菜单页面,按钮配置
        if (item.OpenType === 'pop') {
          let pageParam = ''
          if (config && config.type === 'Modal') {
            pageParam = config
          }
          this.setState({
            editMenu: originMenu,
            editTab: '',
            editAction: item,
            btnParam: pageParam,
            tabview: 'Modal'
          })
        }
      } else if (type === 'tab') { // 三级菜单页面,标签配置
        if (item.type === 'SubTable' || item.tabType === 'SubTable') {
          this.setState({
            editMenu: originMenu,
            editTab: config,
            editAction: '',
            tabview: 'SubTable'
          })
        }
      } else if (type === 'tabButton') { // 三级菜单下,标签下,按钮配置
        console.log(item)
        let pageParam = ''
        if (config && config.type === 'Modal') {
        if (item.OpenType === 'popview') {
          if (config && config.Template === 'SubTable') {
            pageParam = config
          } else {
            pageParam = {
              ...item,
              uuid: item.linkTab,
              create: true
            }
          }
          this.setState({
            editMenu: originMenu,
            editTab: pageParam,
            editAction: item,
            tabview: 'SubTable'
          })
        } else {
          if (config && config.type === 'Modal') {
            pageParam = config
          }
          this.setState({
            editTab: originMenu,
            editAction: item,
            btnParam: pageParam,
            tabview: 'Modal'
          })
        }
      } else if (type === 'tabview') { // 三级菜单下,打开新标签页或当前页跳转,类型的按钮配置
        let pageParam = ''
        if (config && config.type === 'FormTab') {
          pageParam = config
        }
  
        this.setState({
          editMenu: originMenu,
          editTab: '',
          editAction: item,
          btnParam: pageParam,
          tabview: 'Modal'
          tabview: 'FormTab'
        })
      }
    } else if (type === 'tab') { // 三级菜单页面,标签配置
      if (item.type === 'SubTable' || item.tabType === 'SubTable') {
        this.setState({
          editMenu: originMenu,
          editTab: config,
          editAction: '',
          tabview: 'SubTable'
        })
      }
    } else if (type === 'tabButton') { // 三级菜单下,标签下,按钮配置
      let pageParam = ''
      if (config && config.type === 'Modal') {
        pageParam = config
      }
      this.setState({
        editTab: originMenu,
        editAction: item,
        btnParam: pageParam,
        tabview: 'Modal'
      })
    } else if (type === 'tabview') { // 三级菜单下,打开新标签页或当前页跳转,类型的按钮配置
      let pageParam = ''
      if (config && config.type === 'FormTab') {
        pageParam = config
      }
      this.setState({
        editMenu: originMenu,
        editAction: item,
        btnParam: pageParam,
        tabview: 'FormTab'
      })
    }
    })
  }
  UNSAFE_componentWillMount () {
src/locales/en-US/comtable.js
@@ -173,6 +173,9 @@
  'header.form.readonly': '是否只读',
  'header.form.field.required': '是否必填',
  'header.form.field.ishidden': '是否隐藏',
  'header.form.queryType': '查询类型',
  'header.form.query': '查询',
  'header.form.statistics': '统计',
  'header.modal.form.edit': '表单-编辑',
  'header.modal.search.edit': '搜索条件-编辑',
  'header.modal.action.edit': '按钮-编辑',
src/locales/zh-CN/comtable.js
@@ -173,6 +173,9 @@
  'header.form.readonly': '是否只读',
  'header.form.field.required': '是否必填',
  'header.form.field.ishidden': '是否隐藏',
  'header.form.queryType': '查询类型',
  'header.form.query': '查询',
  'header.form.statistics': '统计',
  'header.modal.form.edit': '表单-编辑',
  'header.modal.search.edit': '搜索条件-编辑',
  'header.modal.action.edit': '按钮-编辑',
src/tabviews/commontable/index.jsx
@@ -182,12 +182,14 @@
        columns: _columns,
        isLinkMain: _isLinkMain,
        arr_field: _arrField.join(','),
        search: Utils.initMainSearch(config.search), // 搜索条件初始化(含有时间格式,需要转化)
        loading: true
        search: Utils.initMainSearch(config.search) // 搜索条件初始化(含有时间格式,需要转化)
      }, () => {
        this.improveSearch()
        if (config.setting.onload !== 'false') { // 初始化可加载
          this.setState({
            loading: true
          })
          this.loadmaindata()
        }
      })
@@ -406,6 +408,22 @@
    if (/\s/.test(_dataresource)) {
      _dataresource = '(' + _dataresource + ') tb'
    }
    if (setting.queryType === 'statistics') { // 统计数据源,内容替换
      let fieldmap = new Map()
      search.forEach(item => {
        let _field = item.key
        if (fieldmap.has(_field)) {
          _field = _field + '1'
        }
        fieldmap.set(item.key, true)
        let reg = new RegExp('@' + _field, 'ig')
        _dataresource = _dataresource.replace(reg, `'${item.value}'`)
      })
    }
    let LText = `select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${_dataresource} ${_search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows`
@@ -661,7 +679,6 @@
   * @description 触发按钮弹窗(标签页)
   */
  triggerPopview = (btn, data) => {
    console.log(btn)
    if (btn.OpenType === 'popview') {
      this.setState({
        popAction: btn,
src/tabviews/subtable/index.jsx
@@ -65,7 +65,7 @@
   * @description 获取页面配置信息
   */
  async loadconfig () {
    const { permAction } = this.props
    const { permAction, Tab, BID } = this.props
    let param = {
      func: 'sPC_Get_LongParam',
@@ -159,11 +159,16 @@
        actions: _actions,
        columns: _columns,
        arr_field: _arrField.join(','),
        search: Utils.initMainSearch(config.search), // 搜索条件初始化(含有时间格式,需要转化)
        loading: true
        search: Utils.initMainSearch(config.search) // 搜索条件初始化(含有时间格式,需要转化)
      }, () => {
        this.improveSearch()
        this.loadmaindata()
        if (config.setting.onload !== 'false' && (!Tab.supMenu || BID)) { // 初始化可加载
          this.setState({
            loading: true
          })
          this.loadmaindata()
        }
      })
    } else {
      this.setState({
@@ -364,6 +369,22 @@
    if (/\s/.test(_dataresource)) {
      _dataresource = '(' + _dataresource + ') tb'
    }
    if (setting.queryType === 'statistics') { // 统计数据源,内容替换
      let fieldmap = new Map()
      search.forEach(item => {
        let _field = item.key
        if (fieldmap.has(_field)) {
          _field = _field + '1'
        }
        fieldmap.set(item.key, true)
        let reg = new RegExp('@' + _field, 'ig')
        _dataresource = _dataresource.replace(reg, `'${item.value}'`)
      })
    }
    let LText = `select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${_dataresource} ${_search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows`
@@ -612,6 +633,7 @@
            type="sub"
            setting={setting}
            actions={actions}
            Tab={this.props.Tab}
            BID={this.props.BID}
            dict={this.state.dict}
            MenuID={this.props.SupMenuID}
src/tabviews/subtabtable/index.jsx
@@ -333,6 +333,22 @@
      _dataresource = '(' + _dataresource + ') tb'
    }
    if (setting.queryType === 'statistics') { // 统计数据源,内容替换
      let fieldmap = new Map()
      search.forEach(item => {
        let _field = item.key
        if (fieldmap.has(_field)) {
          _field = _field + '1'
        }
        fieldmap.set(item.key, true)
        let reg = new RegExp('@' + _field, 'ig')
        _dataresource = _dataresource.replace(reg, `'${item.value}'`)
      })
    }
    let LText = `select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${_dataresource} ${_search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows`
    let DateCount = `select count(1) as total from ${_dataresource} ${_search}`
src/tabviews/tableshare/actionList/index.jsx
@@ -12,6 +12,7 @@
class MainAction extends Component {
  static propTpyes = {
    BID: PropTypes.string,
    Tab: PropTypes.any,
    type: PropTypes.string,
    MenuID: PropTypes.string,
    actions: PropTypes.array, // 搜索条件列表
@@ -39,7 +40,16 @@
   * @description 触发按钮操作
   */
  actionTrigger = (item, record) => {
    const { setting } = this.props
    const { setting, type, Tab, BID } = this.props
    if (type === 'sub' && Tab && Tab.supMenu && !BID) {
      notification.warning({
        top: 92,
        message: '需要上级主键值!',
        duration: 10
      })
      return
    }
    let _this = this
    let data = this.props.gettableselected() || []
src/templates/comtableconfig/settingform/index.jsx
@@ -213,15 +213,32 @@
              })(<TextArea rows={4} />)}
            </Form.Item>
          </Col> : null}
          {interType !== 'outer' ? <Col span={12}>
            <Form.Item label={
              <Tooltip placement="topLeft" title="查询时,搜索条件以where条件拼接进入sql,统计时,将数据源中以“@+搜索字段”的内容,以搜索条件中的值进行替换后,提交查询,注:查询类型仅在使用系统函数时有效。">
                <Icon type="question-circle" />
                {dict['header.form.queryType']}
              </Tooltip>
            }>
              {getFieldDecorator('queryType', {
                initialValue: data.queryType || 'query'
              })(
                <Radio.Group>
                  <Radio value="query">{dict['header.form.query']}</Radio>
                  <Radio value="statistics">{dict['header.form.statistics']}</Radio>
                </Radio.Group>
              )}
            </Form.Item>
          </Col> : null}
          <Col span={12}>
            <Form.Item label="固定按钮">
              {getFieldDecorator('actionfixed', {
                initialValue: data.actionfixed ? 'true' : 'false'
              })(
                <Select>
                  <Select.Option value="true">是</Select.Option>
                  <Select.Option value="false">否</Select.Option>
                </Select>
                <Radio.Group>
                  <Radio value="true">{dict['header.form.true']}</Radio>
                  <Radio value="false">{dict['header.form.false']}</Radio>
                </Radio.Group>
              )}
            </Form.Item>
          </Col>
@@ -242,14 +259,14 @@
            </Form.Item>
          </Col> : null}
          <Col span={12}>
            <Form.Item label="固定列">
            <Form.Item label="固定表头">
              {getFieldDecorator('columnfixed', {
                initialValue: data.columnfixed ? 'true' : 'false'
              })(
                <Select>
                  <Select.Option value="true">是</Select.Option>
                  <Select.Option value="false">否</Select.Option>
                </Select>
                <Radio.Group>
                  <Radio value="true">{dict['header.form.true']}</Radio>
                  <Radio value="false">{dict['header.form.false']}</Radio>
                </Radio.Group>
              )}
            </Form.Item>
          </Col>
src/templates/formtabconfig/index.jsx
@@ -74,7 +74,7 @@
   */
  UNSAFE_componentWillMount () {
    const { menu, editAction, config } = this.props
    console.log(menu)
    let _config = ''
    let _originMenu = ''
src/templates/subtableconfig/actionform/index.jsx
@@ -2,6 +2,7 @@
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Select, Icon, Radio, notification, Tooltip, InputNumber } from 'antd'
import { btnIcons, btnClasses, formRule } from '@/utils/option.js'
import Utils from '@/utils/utils.js'
import './index.scss'
const { TextArea } = Input
@@ -486,6 +487,8 @@
          if (values.OpenType === 'excelIn' || values.OpenType === 'excelOut') {
            values.position = 'toolbar'
            values.Ot = 'notRequired'
          } else if (values.OpenType === 'popview' && !values.linkTab) { // 没有关联标签(新建时),创建新标签Id
            values.linkTab = Utils.getuuid()
          }
          if (values.innerFunc === '' && values.sql === '') {
src/templates/subtableconfig/index.jsx
@@ -510,8 +510,8 @@
  creatFunc = () => {
    let _config = JSON.parse(JSON.stringify(this.state.config))
    this.formRef.handleConfirm().then(res => {
      let btn = res  // 按钮信息
    this.actionFormRef.handleConfirm().then(res => {
      let btn = res         // 按钮信息
      let newLText = ''     // 创建存储过程sql
      let DelText = ''      // 删除存储过程sql
      let isExit = false    // 存储过程是否存在
@@ -1718,7 +1718,7 @@
          })
          Api.getSystemConfig({
            func: 'sPC_Get_LongParam',
            MenuID: btn.uuid
            MenuID: btn.OpenType === 'popview' ? btn.linkTab : btn.uuid
          }).then(res => {
            if (res.status) {
              this.setState({
@@ -1733,6 +1733,7 @@
                  _LongParam = ''
                }
              }
              this.props.handleSubConfig(btn, config, _LongParam, 'tabButton')
            } else {
              this.setState({
src/templates/subtableconfig/settingform/index.jsx
@@ -183,6 +183,23 @@
              })(<TextArea rows={4} />)}
            </Form.Item>
          </Col> : null}
          {interType !== 'outer' ? <Col span={12}>
            <Form.Item label={
              <Tooltip placement="topLeft" title="查询时,搜索条件以where条件拼接进入sql,统计时,将数据源中以“@+搜索字段”的内容,以搜索条件中的值进行替换后,提交查询,注:查询类型仅在使用系统函数时有效。">
                <Icon type="question-circle" />
                {dict['header.form.queryType']}
              </Tooltip>
            }>
              {getFieldDecorator('queryType', {
                initialValue: data.queryType || 'query'
              })(
                <Radio.Group>
                  <Radio value="query">{dict['header.form.query']}</Radio>
                  <Radio value="statistics">{dict['header.form.statistics']}</Radio>
                </Radio.Group>
              )}
            </Form.Item>
          </Col> : null}
          <Col span={12}>
            <Form.Item label="主键">
              {getFieldDecorator('primaryKey', {
@@ -236,6 +253,18 @@
              })(<Input placeholder="ID asc, UID desc" autoComplete="off" />)}
            </Form.Item>
          </Col>
          <Col span={12}>
            <Form.Item label="初始化">
              {getFieldDecorator('onload', {
                initialValue: data.onload || 'true'
              })(
                <Select>
                  <Select.Option value="true">加载数据</Select.Option>
                  <Select.Option value="false">不加载数据</Select.Option>
                </Select>
              )}
            </Form.Item>
          </Col>
        </Row>
      </Form>
    )