From eebe63a6727e6495321d1433ebd2779b5a36d45a Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 31 十二月 2020 22:08:14 +0800 Subject: [PATCH] 2020-12-31 --- src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx | 66 +++++++++++++++++++++++++++----- 1 files changed, 55 insertions(+), 11 deletions(-) diff --git a/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx b/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx index 295a5b4..c1c0e77 100644 --- a/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx +++ b/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx @@ -11,10 +11,9 @@ class SettingForm extends Component { static propTpyes = { - type: PropTypes.string, // 鑿滃崟绫诲瀷锛宮ain鎴杝ubtable + config: PropTypes.object, // 椤甸潰閰嶇疆 dict: PropTypes.object, // 瀛楀吀椤� menu: PropTypes.object, // 鑿滃崟淇℃伅 - permFuncField: PropTypes.any, // 瀛樺偍杩囩▼鍙敤寮�濮嬪瓧绗� setting: PropTypes.object, // 鏁版嵁婧愰厤缃� columns: PropTypes.array, // 鍒楄缃� scripts: PropTypes.array, // 鑷畾涔夎剼鏈� @@ -27,14 +26,25 @@ } UNSAFE_componentWillMount () { - const { setting, permFuncField } = this.props + const { setting } = this.props + let usefulFields = sessionStorage.getItem('permFuncField') + if (usefulFields) { + try { + usefulFields = JSON.parse(usefulFields) + } catch { + usefulFields = [] + } + } else { + usefulFields = [] + } + let tooltip = null let rules = [] - if (permFuncField && permFuncField.length > 0) { - tooltip = '寮�澶村彲鐢ㄥ瓧绗︼細' + permFuncField.join(', ') - let str = '^(' + permFuncField.join('|') + ')' + if (usefulFields.length > 0) { + tooltip = '寮�澶村彲鐢ㄥ瓧绗︼細' + usefulFields.join(', ') + let str = '^(' + usefulFields.join('|') + ')' let _patten = new RegExp(str + formRule.func.innerPattern + '$', 'g') rules.push({ @@ -125,7 +135,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) @@ -164,7 +174,7 @@ } render() { - const { setting, dict, menu, type, columns } = this.props + const { setting, dict, menu, config, columns } = this.props const { getFieldDecorator } = this.props.form const { interType, funcRules, funcTooltip } = this.state @@ -390,7 +400,7 @@ </Radio.Group>)} </Form.Item> </Col> - {type === 'main' ? <Col span={12}> + {config.Template === 'CommonTable' ? <Col span={12}> <Form.Item label="鎸夐挳鍥哄畾"> {getFieldDecorator('actionfixed', { initialValue: setting.actionfixed === 'true' || setting.actionfixed === true ? 'true' : 'false' @@ -401,8 +411,13 @@ </Radio.Group>)} </Form.Item> </Col> : null} - {type === 'main' ? <Col span={12}> - <Form.Item label="琛ㄥご鍥哄畾"> + {config.Template === 'CommonTable' ? <Col span={12}> + <Form.Item label={ + <Tooltip placement="topLeft" title={'鍚湁鍚堝苟鍒楁垨琛ㄦ牸鍑虹幇妯悜婊氬姩鏃朵細鏄剧ず寮傚父锛岃鎱庣敤锛�'}> + <Icon type="question-circle" /> + 琛ㄥご鍥哄畾 + </Tooltip> + }> {getFieldDecorator('columnfixed', { initialValue: setting.columnfixed === 'true' || setting.columnfixed === true ? 'true' : 'false' })( @@ -412,6 +427,35 @@ </Radio.Group>)} </Form.Item> </Col> : null} + <Col span={12}> + <Form.Item label="杈规"> + {getFieldDecorator('bordered', { + initialValue: setting.bordered || 'true' + })( + <Radio.Group> + <Radio value="true">鏈�</Radio> + <Radio value="false">鏃�</Radio> + </Radio.Group>)} + </Form.Item> + </Col> + <Col span={12}> + <Form.Item label={ + <Tooltip placement="topLeft" title="鍙屽嚮琛ㄦ牸涓锛岃Е鍙戠殑鎸夐挳銆�"> + <Icon type="question-circle" /> + 鍙屽嚮浜嬩欢 + </Tooltip> + }> + {getFieldDecorator('doubleClick', { + initialValue: setting.doubleClick || '' + })( + <Select allowClear> + {config.action.map(option => + <Select.Option key={option.uuid} value={option.uuid}>{option.label}</Select.Option> + )} + </Select> + )} + </Form.Item> + </Col> </Row> </Form> </div> -- Gitblit v1.8.0