From 877200bd3f7e80b4e7f134b7f7df378f89de0484 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 10 十二月 2019 18:56:51 +0800 Subject: [PATCH] 2019-12-10 --- src/tabviews/commontable/mutilform/index.jsx | 11 +++-- src/tabviews/commontable/index.scss | 14 +++++++ src/templates/modalconfig/index.jsx | 2 src/templates/modalconfig/source.jsx | 3 + src/components/header/index.jsx | 3 + src/templates/modalconfig/settingform/index.jsx | 20 ++++++++-- src/tabviews/commontable/index.jsx | 2 src/tabviews/commontable/mainAction/index.jsx | 10 +++++ src/tabviews/commontable/mutilform/index.scss | 19 +++++---- 9 files changed, 62 insertions(+), 22 deletions(-) diff --git a/src/components/header/index.jsx b/src/components/header/index.jsx index 5ab8f48..ad1127c 100644 --- a/src/components/header/index.jsx +++ b/src/components/header/index.jsx @@ -225,13 +225,14 @@ } render () { + // let logourl = window.GLOB.logo const menu = ( <Menu overlayclassname="header-dropdown"> {this.props.debug && <Menu.Item key="0"> {this.state.dict['header.edit']} <Switch size="small" className="edit-switch" disabled={!!this.props.editLevel} onChange={this.changeEditState} /> </Menu.Item>} - {/* <Menu.Item key="1" onClick={this.changePassword}>{this.state.dict['header.password']}</Menu.Item> */} + <Menu.Item key="1" onClick={this.changePassword}>{this.state.dict['header.password']}</Menu.Item> <Menu.Item key="2" onClick={this.logout}>{this.state.dict['header.logout']}</Menu.Item> </Menu> ) diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx index fded058..41ca634 100644 --- a/src/tabviews/commontable/index.jsx +++ b/src/tabviews/commontable/index.jsx @@ -369,7 +369,7 @@ const { setting, searchlist, actions, columns, loadingview, viewlost } = this.state return ( - <div className="commontable"> + <div className="commontable" id={'commontable' + this.props.MenuID}> {loadingview && <Loading />} {searchlist && searchlist.length > 0 ? <MainSearch diff --git a/src/tabviews/commontable/index.scss b/src/tabviews/commontable/index.scss index 4c65183..92fae90 100644 --- a/src/tabviews/commontable/index.scss +++ b/src/tabviews/commontable/index.scss @@ -1,9 +1,23 @@ .commontable { + position: relative; min-height: calc(100vh - 94px); padding-top: 16px; .box404 { padding-top: 30px; } + .ant-modal-mask { + position: absolute; + } + .ant-modal-wrap { + position: absolute; + } + .action-modal .ant-modal { + top: 40px; + max-width: 95%; + .ant-modal-body { + max-height: calc(100vh - 250px); + } + } } .ant-back-top { bottom: 30px; diff --git a/src/tabviews/commontable/mainAction/index.jsx b/src/tabviews/commontable/mainAction/index.jsx index 22fd0a8..f7e16d1 100644 --- a/src/tabviews/commontable/mainAction/index.jsx +++ b/src/tabviews/commontable/mainAction/index.jsx @@ -495,15 +495,25 @@ getModels = () => { const { execAction } = this.state + + if (!execAction || !this.state.visible) return + let title = '' let width = '62vw' + let container = document.body if (execAction && execAction.setting) { title = execAction.setting.title width = execAction.setting.width + 'vw' + + if (execAction.setting.container === 'tab') { + width = execAction.setting.width + '%' + container = () => document.getElementById('commontable' + this.props.MenuID) + } } return ( <Modal + getContainer={container} wrapClassName='action-modal' title={title} visible={this.state.visible} diff --git a/src/tabviews/commontable/mutilform/index.jsx b/src/tabviews/commontable/mutilform/index.jsx index 65a5403..42e091b 100644 --- a/src/tabviews/commontable/mutilform/index.jsx +++ b/src/tabviews/commontable/mutilform/index.jsx @@ -69,7 +69,7 @@ if (item.type === 'title') { fields.push( - <Col span={24 / cols} key={index}> + <Col span={24} key={index}> <p>{item.label}</p> </Col> ) @@ -159,7 +159,7 @@ } ] })( - <DatePicker getCalendarContainer={() => document.getElementById('form-box')} /> + <DatePicker /> )} </Form.Item> </Col> @@ -183,7 +183,7 @@ } ] })( - <MonthPicker getCalendarContainer={() => document.getElementById('form-box')} /> + <MonthPicker /> )} </Form.Item> </Col> @@ -207,7 +207,8 @@ } ] })( - <DatePicker showTime getCalendarContainer={() => document.getElementById('form-box')} /> + // <DatePicker showTime getCalendarContainer={() => document.getElementById('form-box')} /> + <DatePicker showTime /> )} </Form.Item> </Col> @@ -288,7 +289,7 @@ } } return ( - <Form {...formItemLayout} className="ant-advanced-search-form" id="form-box"> + <Form {...formItemLayout} className="ant-advanced-search-form main-form-field" id="form-box"> <Row gutter={24}>{this.getFields()}</Row> </Form> ) diff --git a/src/tabviews/commontable/mutilform/index.scss b/src/tabviews/commontable/mutilform/index.scss index 838b936..2d2bf0a 100644 --- a/src/tabviews/commontable/mutilform/index.scss +++ b/src/tabviews/commontable/mutilform/index.scss @@ -1,6 +1,6 @@ -.ant-advanced-search-form.main-search { +.ant-advanced-search-form.main-form-field { + position: relative; padding: 0px 24px 20px; - border-bottom: 1px solid #d9d9d9; .ant-form-item { display: flex; margin-bottom: 10px; @@ -9,12 +9,13 @@ flex: 1; } .ant-form-item-label { - width: 100px; + min-width: 100px; } -} -.ant-advanced-search-form { - position: relative; -} -.ant-advanced-search-form .ant-input-number { - width: 100%; + .ant-input-number { + width: 100%; + } + p { + color: #1890ff; + border-bottom: 1px solid #d9d9d9; + } } \ No newline at end of file diff --git a/src/templates/modalconfig/index.jsx b/src/templates/modalconfig/index.jsx index 86da3d2..54ac9ba 100644 --- a/src/templates/modalconfig/index.jsx +++ b/src/templates/modalconfig/index.jsx @@ -481,7 +481,7 @@ handleSubmit = () => { this.formRef.handleConfirm().then(res => { let _config = JSON.parse(JSON.stringify(this.state.config)) - console.log(res) + if ((res.type === 'select' || res.type === 'link') && res.resourceType === '1') { let sql = 'select ' + res.valueField + ',' + res.valueText + ' from (' + res.dataSource + ')' if (res.orderBy) { diff --git a/src/templates/modalconfig/settingform/index.jsx b/src/templates/modalconfig/settingform/index.jsx index 9c8dda9..8af9ea6 100644 --- a/src/templates/modalconfig/settingform/index.jsx +++ b/src/templates/modalconfig/settingform/index.jsx @@ -47,6 +47,13 @@ </Form.Item> </Col> <Col span={12}> + <Form.Item label="瀹藉害"> + {getFieldDecorator('width', { + initialValue: data.width + })(<InputNumber min={30} max={90} precision={0} />)} + </Form.Item> + </Col> + <Col span={12}> <Form.Item label="鍒楁暟"> {getFieldDecorator('cols', { initialValue: data.cols @@ -60,10 +67,15 @@ </Form.Item> </Col> <Col span={12}> - <Form.Item label="瀹藉害"> - {getFieldDecorator('width', { - initialValue: data.width - })(<InputNumber min={30} max={90} precision={0} />)} + <Form.Item label="鎸傝浇瀵硅薄"> + {getFieldDecorator('container', { + initialValue: data.container || 'view' + })( + <Radio.Group> + <Radio value="view">椤甸潰</Radio> + <Radio value="tab">鏍囩椤�</Radio> + </Radio.Group> + )} </Form.Item> </Col> </Row> diff --git a/src/templates/modalconfig/source.jsx b/src/templates/modalconfig/source.jsx index 0e29aa5..860f9af 100644 --- a/src/templates/modalconfig/source.jsx +++ b/src/templates/modalconfig/source.jsx @@ -10,7 +10,8 @@ setting: { title: '', width: 60, - cols: '2' + cols: '2', + container: 'view' }, tables: [], groups: [], -- Gitblit v1.8.0