From 20185ab64a165df51515d9fa1c9b12a7a8c55f59 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 07 四月 2023 23:11:04 +0800 Subject: [PATCH] 2023-04-07 --- src/views/menudesign/menuform/index.jsx | 105 +++++++++++++++++++++------------------------------- 1 files changed, 43 insertions(+), 62 deletions(-) diff --git a/src/views/menudesign/menuform/index.jsx b/src/views/menudesign/menuform/index.jsx index 7c8be79..0f4433b 100644 --- a/src/views/menudesign/menuform/index.jsx +++ b/src/views/menudesign/menuform/index.jsx @@ -193,47 +193,14 @@ this.props.form.setFieldsValue({parentId: _id}) this.props.updateConfig({...config, fstMenuId: value, parentId: _id}) }) - } else if (key === 'parentId') { - this.props.updateConfig({...config, parentId: value}) - } else if (key === 'cacheUseful') { - this.props.updateConfig({...config, cacheUseful: value}) - } else if (key === 'timeUnit') { - this.props.updateConfig({...config, timeUnit: value}) - } else if (key === 'OpenType') { - this.props.updateConfig({...config, OpenType: value}) - } else if (key === 'hidden') { - this.props.updateConfig({...config, hidden: value}) - } else if (key === 'permission') { - this.props.updateConfig({...config, permission: value}) - } else if (key === 'cacheLocal') { - this.props.updateConfig({...config, cacheLocal: value}) + } else { + if (key === 'cacheTime' || key === 'minWidth') { + if (typeof(value) !== 'number') { + value = '' + } + } + this.props.updateConfig({...config, [key]: value}) } - } - - // 鑿滃崟鍚嶇О - changeName = (e) => { - this.props.updateConfig({...this.props.config, MenuName: e.target.value}) - } - - // 鑿滃崟鍙傛暟 - changeNo = (e) => { - this.props.updateConfig({...this.props.config, MenuNo: e.target.value}) - } - - // 鍔╄鐮� - changeEasyCode = (e) => { - this.props.updateConfig({...this.props.config, easyCode: e.target.value}) - } - - changeRemark = (e) => { - this.props.updateConfig({...this.props.config, Remark: e.target.value}) - } - - changeCacheDay = (val) => { - if (typeof(val) !== 'number') { - val = '' - } - this.props.updateConfig({...this.props.config, cacheTime: val}) } render() { @@ -306,7 +273,7 @@ message: '璇疯緭鍏ヨ彍鍗曞悕绉�!' } ] - })(<Input placeholder="" autoComplete="off" onChange={this.changeName}/>)} + })(<Input placeholder="" autoComplete="off" onChange={(e) => {this.selectChange('MenuName', e.target.value)}}/>)} </Form.Item> </Col> <Col span={24}> @@ -319,7 +286,7 @@ message: '璇疯緭鍏ヨ彍鍗曞弬鏁�!' } ] - })(<Input placeholder="" autoComplete="off" onChange={this.changeNo}/>)} + })(<Input placeholder="" autoComplete="off" onChange={(e) => {this.selectChange('MenuNo', e.target.value)}}/>)} </Form.Item> </Col> <Col span={24}> @@ -336,6 +303,23 @@ <Radio.Group onChange={(e) => {this.selectChange('OpenType', e.target.value)}}> <Radio value="newtab">鏍囩椤�</Radio> <Radio value="newpage">鏂伴〉闈�</Radio> + </Radio.Group> + )} + </Form.Item> + </Col> + <Col span={24}> + <Form.Item label={ + <Tooltip placement="topLeft" title="璺宠繃鏉冮檺楠岃瘉鏃讹紝椤甸潰涓粍浠跺強鎸夐挳涓嶅湪杩涜鏉冮檺鎺у埗銆�"> + <QuestionCircleOutlined className="mk-form-tip" /> + 鏉冮檺楠岃瘉 + </Tooltip> + }> + {getFieldDecorator('permission', { + initialValue: config.permission || 'true' + })( + <Radio.Group onChange={(e) => {this.selectChange('permission', e.target.value)}}> + <Radio value="true">浣跨敤</Radio> + <Radio value="false">涓嶄娇鐢�</Radio> </Radio.Group> )} </Form.Item> @@ -374,23 +358,6 @@ )} </Form.Item> </Col> - <Col span={24}> - <Form.Item label={ - <Tooltip placement="topLeft" title="璺宠繃鏉冮檺楠岃瘉鏃讹紝椤甸潰涓粍浠跺強鎸夐挳涓嶅湪杩涜鏉冮檺鎺у埗銆�"> - <QuestionCircleOutlined className="mk-form-tip" /> - 鏉冮檺楠岃瘉 - </Tooltip> - }> - {getFieldDecorator('permission', { - initialValue: config.permission || 'true' - })( - <Radio.Group onChange={(e) => {this.selectChange('permission', e.target.value)}}> - <Radio value="true">浣跨敤</Radio> - <Radio value="false">涓嶄娇鐢�</Radio> - </Radio.Group> - )} - </Form.Item> - </Col> {config.cacheUseful === 'true' ? <Col span={24}> <Form.Item label="鍗曚綅"> {getFieldDecorator('timeUnit', { @@ -414,15 +381,29 @@ } ] })( - <InputNumber min={1} max={config.timeUnit !== 'hour' ? 7 : 23} precision={0} onChange={this.changeCacheDay}/> + <InputNumber min={1} max={config.timeUnit !== 'hour' ? 7 : 23} precision={0} onChange={(val) => {this.selectChange('cacheTime', val)}}/> )} </Form.Item> </Col> : null} <Col span={24}> + <Form.Item label={ + <Tooltip placement="topLeft" title="濡傛灉椤甸潰鍐呭鍦ㄧ獥鍙d腑鏃犳硶瀹屽叏灞曠ず锛屽彲璁剧疆鏈�灏忓搴︼紝瀹炵幇椤甸潰鐨勬í鍚戞粴鍔ㄣ��"> + <QuestionCircleOutlined className="mk-form-tip" /> + 鏈�灏忓搴� + </Tooltip> + }> + {getFieldDecorator('minWidth', { + initialValue: config.minWidth + })( + <InputNumber min={0} precision={0} onChange={(val) => {this.selectChange('minWidth', val)}}/> + )} + </Form.Item> + </Col> + <Col span={24}> <Form.Item label="鍔╄鐮�"> {getFieldDecorator('easyCode', { initialValue: config.easyCode - })(<Input placeholder="" autoComplete="off" onChange={this.changeEasyCode}/>)} + })(<Input placeholder="" autoComplete="off" onChange={(e) => {this.selectChange('easyCode', e.target.value)}}/>)} </Form.Item> </Col> <Col span={24}> @@ -442,7 +423,7 @@ message: '澶囨敞鏈�澶�512涓瓧绗︼紒' } ] - })(<TextArea rows={2} placeholder={''} onChange={this.changeRemark} />)} + })(<TextArea rows={2} placeholder={''} onChange={(e) => {this.selectChange('Remark', e.target.value)}}/>)} </Form.Item> </Col> </Row> -- Gitblit v1.8.0