From e543372cc70a19ff2630c79d8421c2c593e54e5f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 02 六月 2021 17:15:21 +0800 Subject: [PATCH] 2021-06-02 --- src/templates/sharecomponent/treesettingcomponent/settingform/datasource/index.jsx | 32 +++++++++++++++++++++----------- 1 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/templates/sharecomponent/treesettingcomponent/settingform/datasource/index.jsx b/src/templates/sharecomponent/treesettingcomponent/settingform/datasource/index.jsx index 2029b4d..caadc2b 100644 --- a/src/templates/sharecomponent/treesettingcomponent/settingform/datasource/index.jsx +++ b/src/templates/sharecomponent/treesettingcomponent/settingform/datasource/index.jsx @@ -13,7 +13,6 @@ static propTpyes = { dict: PropTypes.object, // 瀛楀吀椤� menu: PropTypes.object, // 鑿滃崟淇℃伅 - permFuncField: PropTypes.any, // 瀛樺偍杩囩▼鍙敤寮�濮嬪瓧绗� setting: PropTypes.object, // 鏁版嵁婧愰厤缃� inputSubmit: PropTypes.func // 瑙﹀彂鎻愪氦 } @@ -25,14 +24,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 { + 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({ @@ -123,7 +133,7 @@ } param.LText = Utils.formatOptions(param.LText) - param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' + param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') param.secretkey = Utils.encrypt(param.LText, param.timestamp) Api.getLocalConfig(param) @@ -191,8 +201,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}/>)} @@ -392,7 +402,7 @@ <Col span={12}> <Form.Item label="鎺掑簭"> {getFieldDecorator('order', { - initialValue: setting.order || '', + initialValue: setting.order || 'ID desc', rules: [ { required: true, @@ -408,7 +418,7 @@ </Col> <Col span={12}> <Form.Item label={ - <Tooltip placement="topLeft" title={'鐖剁骇瀛楁鍊间笌椤剁骇鏍囪瘑锛堥粯璁ゅ�间负绌猴級鐩稿悓鏃讹紝瑙嗕负椤剁骇鑺傜偣銆�'}> + <Tooltip placement="topLeft" title={'鐖剁骇瀛楁鍊间笌椤剁骇鏍囪瘑鐩稿悓鏃讹紝瑙嗕负椤剁骇鑺傜偣銆�'}> <Icon type="question-circle" /> 椤剁骇鏍囪瘑 </Tooltip> @@ -426,7 +436,7 @@ </Col> <Col span={12}> <Form.Item label={ - <Tooltip placement="topLeft" title={'姣忚鍒嗕负24浠斤紝鏍戝舰姣斾緥鍙缃负2-12锛堟渶澶�50%锛�'}> + <Tooltip placement="topLeft" title={'鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒楋紝鏍戝舰姣斾緥鍙缃负2-12锛堟渶澶�50%锛�'}> <Icon type="question-circle" /> 瀹藉害 </Tooltip> -- Gitblit v1.8.0