From 3cca19f42bfc1eb99e16e94dc9e89e3f973bc4a6 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 13 九月 2022 09:21:04 +0800
Subject: [PATCH] 2022-09-13

---
 src/templates/sharecomponent/treesettingcomponent/settingform/datasource/index.jsx |   51 ++++++++++++++++++++++++++++++++-------------------
 1 files changed, 32 insertions(+), 19 deletions(-)

diff --git a/src/templates/sharecomponent/treesettingcomponent/settingform/datasource/index.jsx b/src/templates/sharecomponent/treesettingcomponent/settingform/datasource/index.jsx
index 02acde2..6c21f28 100644
--- a/src/templates/sharecomponent/treesettingcomponent/settingform/datasource/index.jsx
+++ b/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'
@@ -9,11 +10,12 @@
 import CodeMirror from '@/templates/zshare/codemirror'
 import './index.scss'
 
+const { TextArea } = Input
+
 class SettingForm extends Component {
   static propTpyes = {
     dict: PropTypes.object,       // 瀛楀吀椤�
     menu: PropTypes.object,       // 鑿滃崟淇℃伅
-    permFuncField: PropTypes.any, // 瀛樺偍杩囩▼鍙敤寮�濮嬪瓧绗�
     setting: PropTypes.object,    // 鏁版嵁婧愰厤缃�
     inputSubmit: PropTypes.func   // 瑙﹀彂鎻愪氦
   }
@@ -25,14 +27,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({
@@ -126,7 +139,7 @@
             param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
             param.secretkey = Utils.encrypt(param.LText, param.timestamp)
     
-            Api.getLocalConfig(param)
+            Api.genericInterface(param)
           }
 
           resolve(values)
@@ -191,8 +204,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 +266,7 @@
             {interType === 'inner' ? <Col span={12}>
               <Form.Item label={
                 <Tooltip placement="topLeft" title={funcTooltip}>
-                  <Icon type="question-circle" />
+                  <QuestionCircleOutlined className="mk-form-tip" />
                   鍐呴儴鍑芥暟
                 </Tooltip>
               }>
@@ -273,7 +286,7 @@
                 })(<Input placeholder={''} autoComplete="off" onPressEnter={this.handleSubmit} />)}
               </Form.Item>
             </Col> : null}
-            {interType === 'outer' ? <Col span={12}>
+            {interType === 'outer' ? <Col span={24} className="data-source">
               <Form.Item label="鎺ュ彛鍦板潃">
                 {getFieldDecorator('interface', {
                   initialValue: setting.interface || '',
@@ -283,7 +296,7 @@
                       message: dict['form.required.input'] + '鎺ュ彛鍦板潃!'
                     }
                   ]
-                })(<Input placeholder={''} autoComplete="off" onPressEnter={this.handleSubmit} />)}
+                })(<TextArea rows={2}/>)}
               </Form.Item>
             </Col> : null}
             {interType === 'outer' ? <Col span={12}>
@@ -305,7 +318,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 +330,7 @@
             <Col span={12}>
               <Form.Item label={
                 <Tooltip placement="topLeft" title={'鏁版嵁鍊煎瓧娈点��'}>
-                  <Icon type="question-circle" />
+                  <QuestionCircleOutlined className="mk-form-tip" />
                   Value
                 </Tooltip>
               }>
@@ -342,7 +355,7 @@
             <Col span={12}>
               <Form.Item label={
                 <Tooltip placement="topLeft" title={'鏄剧ず鏂囧瓧瀛楁銆�'}>
-                  <Icon type="question-circle" />
+                  <QuestionCircleOutlined className="mk-form-tip" />
                   Label
                 </Tooltip>
               }>
@@ -367,7 +380,7 @@
             <Col span={12}>
               <Form.Item label={
                 <Tooltip placement="topLeft" title={'鐖剁骇瀛楁銆�'}>
-                  <Icon type="question-circle" />
+                  <QuestionCircleOutlined className="mk-form-tip" />
                   Parent
                 </Tooltip>
               }>
@@ -392,7 +405,7 @@
             <Col span={12}>
               <Form.Item label="鎺掑簭">
                 {getFieldDecorator('order', {
-                  initialValue: setting.order || '',
+                  initialValue: setting.order || 'ID desc',
                   rules: [
                     {
                       required: true,
@@ -409,7 +422,7 @@
             <Col span={12}>
               <Form.Item label={
                 <Tooltip placement="topLeft" title={'鐖剁骇瀛楁鍊间笌椤剁骇鏍囪瘑鐩稿悓鏃讹紝瑙嗕负椤剁骇鑺傜偣銆�'}>
-                  <Icon type="question-circle" />
+                  <QuestionCircleOutlined className="mk-form-tip" />
                   椤剁骇鏍囪瘑
                 </Tooltip>
               }>
@@ -427,7 +440,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>
               }>

--
Gitblit v1.8.0