king
2022-08-02 8d66ff34fae5b048a6b7923cc75d34f13a08be9d
src/templates/sharecomponent/treesettingcomponent/settingform/datasource/index.jsx
@@ -1,6 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Radio, Tooltip, Icon, notification, InputNumber } from 'antd'
import { Form, Row, Col, Input, Radio, Tooltip, notification, InputNumber } from 'antd'
import { QuestionCircleOutlined } from '@ant-design/icons'
import moment from 'moment'
import Api from '@/api'
@@ -13,7 +14,6 @@
  static propTpyes = {
    dict: PropTypes.object,       // 字典项
    menu: PropTypes.object,       // 菜单信息
    permFuncField: PropTypes.any, // 存储过程可用开始字符
    setting: PropTypes.object,    // 数据源配置
    inputSubmit: PropTypes.func   // 触发提交
  }
@@ -25,14 +25,25 @@
  }
  UNSAFE_componentWillMount () {
    const { setting, permFuncField } = this.props
    const { setting } = this.props
    let usefulFields = sessionStorage.getItem('permFuncField')
    let tooltip = null
    let rules = []
    if (permFuncField && permFuncField.length > 0) {
      tooltip = '开头可用字符:' + permFuncField.join(', ')
      let str = '^(' + permFuncField.join('|') + ')'
    if (usefulFields) {
      try {
        usefulFields = JSON.parse(usefulFields)
      } catch (e) {
        usefulFields = []
      }
    } else {
      usefulFields = []
    }
    if (usefulFields.length > 0) {
      tooltip = '开头可用字符:' + usefulFields.join(', ')
      let str = '^(' + usefulFields.join('|') + ')'
      let _patten = new RegExp(str + formRule.func.innerPattern + '$', 'g')
      rules.push({
@@ -191,8 +202,8 @@
                      message: dict['form.required.input'] + '表名!'
                    },
                    {
                      max: formRule.input.max,
                      message: formRule.input.message
                      max: 50,
                      message: '表名最长为50个字符!'
                    }
                  ]
                })(<Input placeholder={''} autoComplete="off" onPressEnter={this.handleSubmit}/>)}
@@ -253,7 +264,7 @@
            {interType === 'inner' ? <Col span={12}>
              <Form.Item label={
                <Tooltip placement="topLeft" title={funcTooltip}>
                  <Icon type="question-circle" />
                  <QuestionCircleOutlined className="mk-form-tip" />
                  内部函数
                </Tooltip>
              }>
@@ -305,7 +316,7 @@
            {interType === 'system' ? <Col span={24} className="data-source" style={{paddingLeft: '7px'}}>
              <Form.Item help={'数据ID:' + menu.MenuID} labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } label={
                <Tooltip placement="topLeft" title={'使用系统函数时,需填写数据源。注:数据权限替换符 $@ -> /* 或 \'\'、 @$ -> */ 或 \'\''}>
                  <Icon type="question-circle" />
                  <QuestionCircleOutlined className="mk-form-tip" />
                  数据源
                </Tooltip>
              }>
@@ -317,7 +328,7 @@
            <Col span={12}>
              <Form.Item label={
                <Tooltip placement="topLeft" title={'数据值字段。'}>
                  <Icon type="question-circle" />
                  <QuestionCircleOutlined className="mk-form-tip" />
                  Value
                </Tooltip>
              }>
@@ -342,7 +353,7 @@
            <Col span={12}>
              <Form.Item label={
                <Tooltip placement="topLeft" title={'显示文字字段。'}>
                  <Icon type="question-circle" />
                  <QuestionCircleOutlined className="mk-form-tip" />
                  Label
                </Tooltip>
              }>
@@ -367,7 +378,7 @@
            <Col span={12}>
              <Form.Item label={
                <Tooltip placement="topLeft" title={'父级字段。'}>
                  <Icon type="question-circle" />
                  <QuestionCircleOutlined className="mk-form-tip" />
                  Parent
                </Tooltip>
              }>
@@ -392,7 +403,7 @@
            <Col span={12}>
              <Form.Item label="排序">
                {getFieldDecorator('order', {
                  initialValue: setting.order || '',
                  initialValue: setting.order || 'ID desc',
                  rules: [
                    {
                      required: true,
@@ -409,7 +420,7 @@
            <Col span={12}>
              <Form.Item label={
                <Tooltip placement="topLeft" title={'父级字段值与顶级标识相同时,视为顶级节点。'}>
                  <Icon type="question-circle" />
                  <QuestionCircleOutlined className="mk-form-tip" />
                  顶级标识
                </Tooltip>
              }>
@@ -427,7 +438,7 @@
            <Col span={12}>
              <Form.Item label={
                <Tooltip placement="topLeft" title={'栅格布局,每行等分为24列,树形比例可设置为2-12(最大50%)'}>
                  <Icon type="question-circle" />
                  <QuestionCircleOutlined className="mk-form-tip" />
                  宽度
                </Tooltip>
              }>