From 342d3498191f1683059fe586209ec920545e0bf9 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 28 九月 2021 13:38:09 +0800 Subject: [PATCH] 2021-09-28 --- src/menu/components/share/normalheader/index.scss | 2 src/tabviews/zshare/mutilform/mkCheckCard/index.scss | 4 src/menu/components/table/normal-table/options.jsx | 12 +++ src/tabviews/zshare/mutilform/index.scss | 2 src/tabviews/zshare/topSearch/index.jsx | 3 src/templates/modalconfig/settingform/index.jsx | 7 + src/templates/modalconfig/dragelement/index.scss | 5 + src/tabviews/zshare/actionList/printbutton/index.jsx | 38 +++------ src/templates/sharecomponent/searchcomponent/index.jsx | 20 ++++ src/templates/modalconfig/checkCard/index.jsx | 2 src/menu/components/table/normal-table/index.scss | 15 +++ src/tabviews/zshare/topSearch/index.scss | 3 src/tabviews/custom/components/tree/antd-tree/index.scss | 2 src/tabviews/zshare/topSearch/advanceform/index.scss | 3 src/menu/components/table/normal-table/index.jsx | 2 src/tabviews/zshare/actionList/normalbutton/index.jsx | 60 +++++--------- src/templates/modalconfig/dragelement/card.jsx | 4 src/templates/sharecomponent/searchcomponent/index.scss | 3 src/templates/sharecomponent/searchcomponent/searchform/index.jsx | 2 19 files changed, 107 insertions(+), 82 deletions(-) diff --git a/src/menu/components/share/normalheader/index.scss b/src/menu/components/share/normalheader/index.scss index 7570654..b20bf0a 100644 --- a/src/menu/components/share/normalheader/index.scss +++ b/src/menu/components/share/normalheader/index.scss @@ -22,7 +22,7 @@ } .ant-input-search.ant-input-affix-wrapper { width: 50%; - max-width: 130px; + max-width: 150px; margin-top: 8px; margin-right: 25px; float: right; diff --git a/src/menu/components/table/normal-table/index.jsx b/src/menu/components/table/normal-table/index.jsx index 075ebfa..030ba32 100644 --- a/src/menu/components/table/normal-table/index.jsx +++ b/src/menu/components/table/normal-table/index.jsx @@ -66,7 +66,7 @@ name: card.name, subtype: card.subtype, setting: { interType: 'system' }, - wrap: { name: card.name, width: card.width || 24, bordered: 'true', tableType: 'checkbox' }, + wrap: { name: card.name, width: card.width || 24, bordered: 'true', tableType: 'checkbox', show: 'true' }, style: { marginLeft: '8px', marginRight: '8px', marginTop: '8px', marginBottom: '8px' }, headerStyle: { fontSize: '16px', borderBottomWidth: '1px', borderBottomColor: '#e8e8e8' }, columns: [], diff --git a/src/menu/components/table/normal-table/index.scss b/src/menu/components/table/normal-table/index.scss index 4d382fd..23a3143 100644 --- a/src/menu/components/table/normal-table/index.scss +++ b/src/menu/components/table/normal-table/index.scss @@ -17,6 +17,21 @@ .page-card { background: transparent; } + .quickly-add { + display: inline-block; + position: absolute; + z-index: 3; + right: 70px; + bottom: 5px; + .ant-btn-block { + background-color: transparent; + color: #1890ff; + border: none; + box-shadow: none !important; + height: 18px; + padding: 0 10px; + } + } } .model-table-search-list.length0 { display: none; diff --git a/src/menu/components/table/normal-table/options.jsx b/src/menu/components/table/normal-table/options.jsx index 6f33f6d..374a6bf 100644 --- a/src/menu/components/table/normal-table/options.jsx +++ b/src/menu/components/table/normal-table/options.jsx @@ -118,6 +118,18 @@ ] }, { + type: 'radio', + field: 'show', + label: '鎼滅储鎸夐挳', + initval: wrap.show || 'true', + tooltip: '鎼滅储鏉′欢瀛樺湪鏃讹紝鍙�夋嫨鏄惁鏄剧ず鎼滅储鎸夐挳銆�', + required: false, + options: [ + {value: 'true', label: '鏄剧ず'}, + {value: 'false', label: '闅愯棌'}, + ] + }, + { type: 'color', field: 'borderColor', label: '杈规棰滆壊', diff --git a/src/tabviews/custom/components/tree/antd-tree/index.scss b/src/tabviews/custom/components/tree/antd-tree/index.scss index 78de410..5c43bad 100644 --- a/src/tabviews/custom/components/tree/antd-tree/index.scss +++ b/src/tabviews/custom/components/tree/antd-tree/index.scss @@ -26,7 +26,7 @@ } .ant-input-search.ant-input-affix-wrapper { width: 50%; - max-width: 130px; + max-width: 150px; margin-top: 6px; float: right; height: 30px; diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx index 0bf6a30..1282c98 100644 --- a/src/tabviews/zshare/actionList/normalbutton/index.jsx +++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx @@ -109,9 +109,7 @@ if (btn.uuid !== res.menuId) return - this.setState({ - loading: true - }) + this.setState({ loading: true }) this.execSubmit(this.state.tabledata, () => {}, res.form) } @@ -127,17 +125,12 @@ /** * @description 鎸夐挳鐘舵�佹敼鍙� */ - updateStatus = (type) => { - if (type === 'start') { - this.setState({ - loading: true - }) - } else if (type === 'over') { - this.setState({ - loading: false, - visible: false - }) - } + updateStatus = () => { + this.setState({ + loading: false, + visible: false, + confirmLoading: false + }) } /** @@ -242,7 +235,7 @@ MKEmitter.emit('mkFormSubmit', btn.uuid) return } else if (btn.OpenType === 'prompt') { - this.updateStatus('start') + this.setState({loading: true}) confirm({ title: this.state.dict['main.action.confirm.tip'], onOk() { @@ -251,21 +244,20 @@ }) }, onCancel() { - _this.updateStatus('over') + _this.setState({loading: false}) } }) } else if (btn.OpenType === 'exec') { - this.updateStatus('start') + this.setState({loading: true}) this.execSubmit(data, () => { this.setState({loading: false})}) } else if (btn.OpenType === 'pop') { - this.updateStatus('start') - let modal = this.state.btnconfig if (!modal && btn.modal) { modal = this.handleModelConfig(btn.modal) } this.setState({ + loading: true, tabledata: data, btnconfig: modal }, () => { @@ -712,7 +704,7 @@ } resolve(res) }, () => { - this.updateStatus('over') + this.updateStatus() _resolve() }) }, 100 * i) @@ -867,7 +859,7 @@ } resolve() }, () => { - _this.updateStatus('over') + _this.updateStatus() resolve() _resolve() }) @@ -884,7 +876,7 @@ _resolve() } }, () => { - this.updateStatus('over') + this.updateStatus() _resolve() }) } @@ -1136,7 +1128,7 @@ _resolve() } }, () => { - this.updateStatus('over') + this.updateStatus() _resolve() }) } @@ -1189,7 +1181,7 @@ _resolve() } }, () => { - this.updateStatus('over') + this.updateStatus() _resolve() }) } @@ -1242,7 +1234,7 @@ _resolve() } }, () => { - this.updateStatus('over') + this.updateStatus() _resolve() }) } else { @@ -1680,14 +1672,14 @@ message: res.message, duration: 5 }) - this.updateStatus('over') + this.setState({ loading: false }) } else if (!_LongParam || (btn.OpenType === 'pop' && _LongParam.type !== 'Modal')) { notification.warning({ top: 92, message: '鏈幏鍙栧埌鎸夐挳閰嶇疆淇℃伅锛�', duration: 5 }) - this.updateStatus('over') + this.setState({ loading: false }) } else { _LongParam = updateForm(_LongParam) _LongParam = this.handleModelConfig(_LongParam) @@ -1713,15 +1705,9 @@ */ handleOk = () => { this.formRef.handleConfirm().then(res => { - this.setState({ - confirmLoading: true - }) + this.setState({ confirmLoading: true }) - this.execSubmit(this.state.tabledata, () => { - this.setState({ - confirmLoading: false - }) - }, res) + this.execSubmit(this.state.tabledata, () => { this.setState({ confirmLoading: false }) }, res) }) } @@ -1730,10 +1716,10 @@ */ handleCancel = () => { this.setState({ + loading: false, visible: false, confirmLoading: false }) - this.updateStatus('over') } modelconfirm = () => { @@ -1799,7 +1785,7 @@ }) }, onCancel() { - _this.updateStatus('over') + _this.setState({ loading: false }) } }) } diff --git a/src/tabviews/zshare/actionList/printbutton/index.jsx b/src/tabviews/zshare/actionList/printbutton/index.jsx index ec7be3e..ffed630 100644 --- a/src/tabviews/zshare/actionList/printbutton/index.jsx +++ b/src/tabviews/zshare/actionList/printbutton/index.jsx @@ -91,21 +91,6 @@ } MKEmitter.removeListener('triggerBtnId', this.actionTrigger) } - - /** - * @description 鎸夐挳鐘舵�佹敼鍙� - */ - updateStatus = (type) => { - if (type === 'start') { - this.setState({ - loading: true - }) - } else if (type === 'over') { - this.setState({ - loading: false - }) - } - } /** * @description 瑙﹀彂鎸夐挳鎿嶄綔 @@ -166,27 +151,27 @@ } if (btn.execMode === 'pop') { - this.updateStatus('start') let modal = this.state.btnconfig if (!modal && btn.modal) { modal = this.handleModelConfig(btn.modal) } this.setState({ + loading: true, tabledata: data, btnconfig: modal }, () => { this.improveAction() }) } else if (btn.execMode === 'prompt') { - this.updateStatus('start') + this.setState({ loading: true }) confirm({ title: this.state.dict['main.action.confirm.tip'], onOk() { _this.triggerPrint(data) }, onCancel() { - _this.updateStatus('over') + _this.setState({ loading: false }) } }) } else { @@ -1348,14 +1333,14 @@ message: res.message, duration: 5 }) - this.updateStatus('over') + this.setState({ loading: false }) } else if (!_LongParam || (btn.execMode === 'pop' && _LongParam.type !== 'Modal')) { notification.warning({ top: 92, message: '鏈幏鍙栧埌鎸夐挳閰嶇疆淇℃伅锛�', duration: 5 }) - this.updateStatus('over') + this.setState({ loading: false }) } else { _LongParam = updateForm(_LongParam) _LongParam = this.handleModelConfig(_LongParam) @@ -1380,10 +1365,13 @@ * @description 妯℃�佹锛堣〃鍗曪級锛岀‘璁� */ handleOk = () => { + const { btnconfig } = this.state this.formRef.handleConfirm().then(res => { - this.setState({ - visible: false - }) + if (btnconfig.setting.finish !== 'unclose') { + this.setState({ + visible: false + }) + } this.triggerPrint(this.state.tabledata, res) }) } @@ -1393,9 +1381,9 @@ */ handleCancel = () => { this.setState({ + loading: false, visible: false }) - this.updateStatus('over') } modelconfirm = () => { @@ -1452,7 +1440,7 @@ _this.triggerPrint(tabledata, result) }, onCancel() { - _this.updateStatus('over') + _this.setState({ loading: false }) } }) } diff --git a/src/tabviews/zshare/mutilform/index.scss b/src/tabviews/zshare/mutilform/index.scss index 051bd32..d492dbb 100644 --- a/src/tabviews/zshare/mutilform/index.scss +++ b/src/tabviews/zshare/mutilform/index.scss @@ -27,7 +27,7 @@ .ant-form-item.checkcard, .ant-form-item.file-upload { margin-bottom: 10px; .ant-form-item-control { - line-height: 1.5; + line-height: 1; } } .ant-form-item.readonly { diff --git a/src/tabviews/zshare/mutilform/mkCheckCard/index.scss b/src/tabviews/zshare/mutilform/mkCheckCard/index.scss index 7cb06a3..1fb51b0 100644 --- a/src/tabviews/zshare/mutilform/mkCheckCard/index.scss +++ b/src/tabviews/zshare/mutilform/mkCheckCard/index.scss @@ -1,6 +1,6 @@ .check-card-form-box { - margin-top: 10px; - margin-bottom: -10px; + margin-top: 5px; + // margin-bottom: -10px; .card-cell { position: relative; border: 1px solid #bcbcbc; diff --git a/src/tabviews/zshare/topSearch/advanceform/index.scss b/src/tabviews/zshare/topSearch/advanceform/index.scss index 21216b0..50a24d0 100644 --- a/src/tabviews/zshare/topSearch/advanceform/index.scss +++ b/src/tabviews/zshare/topSearch/advanceform/index.scss @@ -26,9 +26,6 @@ .ant-calendar-picker-container { z-index: 10 !important; } - .check-card-form-box { - margin-top: 5px; - } .advance-button { position: absolute; left: 0; diff --git a/src/tabviews/zshare/topSearch/index.jsx b/src/tabviews/zshare/topSearch/index.jsx index c2a3416..d2c6e39 100644 --- a/src/tabviews/zshare/topSearch/index.jsx +++ b/src/tabviews/zshare/topSearch/index.jsx @@ -77,6 +77,9 @@ } if (searchlist) { + if (setting && setting.show === 'false') { + showButton = false + } _searchlist = fromJS(searchlist).toJS() } else if (config) { _searchlist = fromJS(config.search).toJS() diff --git a/src/tabviews/zshare/topSearch/index.scss b/src/tabviews/zshare/topSearch/index.scss index 18fe436..6529efb 100644 --- a/src/tabviews/zshare/topSearch/index.scss +++ b/src/tabviews/zshare/topSearch/index.scss @@ -74,9 +74,6 @@ } } } - .check-card-form-box { - margin-top: 5px; - } .ant-calendar-picker-clear, .ant-calendar-picker-icon { right: 8px; } diff --git a/src/templates/modalconfig/checkCard/index.jsx b/src/templates/modalconfig/checkCard/index.jsx index 3575d22..952f4db 100644 --- a/src/templates/modalconfig/checkCard/index.jsx +++ b/src/templates/modalconfig/checkCard/index.jsx @@ -73,7 +73,7 @@ render() { return ( - <div className="check-card-edit-box" style={{marginTop: '10px'}}> + <div className="check-card-edit-box" style={{marginTop: '5px'}}> <Row gutter={12}>{this.getCards()}</Row> </div> ) diff --git a/src/templates/modalconfig/dragelement/card.jsx b/src/templates/modalconfig/dragelement/card.jsx index a8ef271..f2dfa6a 100644 --- a/src/templates/modalconfig/dragelement/card.jsx +++ b/src/templates/modalconfig/dragelement/card.jsx @@ -64,6 +64,7 @@ } let formItem = null + let className = 'ant-form-item' if (card.type === 'text') { formItem = (<Input style={{marginTop: '4px'}} placeholder={card.placeholder || ''} value={card.initval} />) } else if (card.type === 'number') { @@ -114,6 +115,7 @@ } else if (card.type === 'split') { formItem = <div className="split-line">{card.label}</div> } else if (card.type === 'checkcard') { + className += ' checkcard' formItem = <CheckCard config={card} /> } @@ -136,7 +138,7 @@ <div className="page-card" style={{ opacity: opacity}}> <div ref={node => drag(drop(node))} onDoubleClick={edit}> {card.type === 'split' ? formItem : <Form.Item - className="ant-form-item" + className={className} colon={!!_label} label={_label} required={card.required === 'true'} diff --git a/src/templates/modalconfig/dragelement/index.scss b/src/templates/modalconfig/dragelement/index.scss index c6bc0a5..e810030 100644 --- a/src/templates/modalconfig/dragelement/index.scss +++ b/src/templates/modalconfig/dragelement/index.scss @@ -28,6 +28,11 @@ padding-left: 10px; border-bottom: 1px solid #e9e9e9; } + .ant-form-item.checkcard { + .ant-form-item-control { + line-height: 1; + } + } .ant-form-item { cursor: move; display: flex; diff --git a/src/templates/modalconfig/settingform/index.jsx b/src/templates/modalconfig/settingform/index.jsx index ebe4427..1b6be2a 100644 --- a/src/templates/modalconfig/settingform/index.jsx +++ b/src/templates/modalconfig/settingform/index.jsx @@ -193,7 +193,12 @@ </Form.Item> </Col> <Col span={12}> - <Form.Item label="鏄剧ず鏂瑰紡"> + <Form.Item label={ + <Tooltip placement="topLeft" title="鎵撳嵃鎸夐挳涓棤鏁堛��"> + <Icon type="question-circle" /> + 鏄剧ず鏂瑰紡 + </Tooltip> + }> {getFieldDecorator('display', { initialValue: display || 'modal' })( diff --git a/src/templates/sharecomponent/searchcomponent/index.jsx b/src/templates/sharecomponent/searchcomponent/index.jsx index dc0dd9e..fad052d 100644 --- a/src/templates/sharecomponent/searchcomponent/index.jsx +++ b/src/templates/sharecomponent/searchcomponent/index.jsx @@ -9,13 +9,15 @@ import zhCN from '@/locales/zh-CN/model.js' import enUS from '@/locales/en-US/model.js' import { getSearchForm } from '@/templates/zshare/formconfig' - +import asyncComponent from '@/utils/asyncComponent' import MKEmitter from '@/utils/events.js' import SearchForm from './searchform' import DragElement from './dragsearch' import './index.scss' const { confirm } = Modal + +const FieldsComponent = asyncComponent(() => import('@/templates/sharecomponent/fieldscomponent')) class SearchComponent extends Component { static propTpyes = { @@ -311,22 +313,34 @@ } shouldComponentUpdate (nextProps, nextState) { - return !is(fromJS(this.state), fromJS(nextState)) || this.props.config.setting.show !== nextProps.config.setting.show + if (!is(fromJS(this.state), fromJS(nextState))) { + return true + } else if (this.props.config.wrap) { + return this.props.config.wrap.show !== nextProps.config.wrap.show + } else { + return this.props.config.setting.show !== nextProps.config.setting.show + } } render() { const { config } = this.props const { dict, searchlist, visible, sqlVerifing, card, showField } = this.state + let show = config.setting.show + if (config.wrap) { + show = config.wrap.show + } + return ( <div className={'model-table-search-list length' + searchlist.length}> <Tooltip placement="bottomLeft" overlayClassName="middle" title={dict['model.tooltip.search.guide']}> <Icon type="question-circle" /> </Tooltip> + <FieldsComponent config={config} type="search" /> <Switch checkedChildren={dict['model.switch.open']} unCheckedChildren={dict['model.switch.close']} defaultChecked={showField} onChange={this.onFieldChange} /> <DragElement list={searchlist} - show={config.setting.show} + show={show} showField={showField} handleList={this.handleList} handleMenu={this.handleSearch} diff --git a/src/templates/sharecomponent/searchcomponent/index.scss b/src/templates/sharecomponent/searchcomponent/index.scss index 60babd1..9ab67a9 100644 --- a/src/templates/sharecomponent/searchcomponent/index.scss +++ b/src/templates/sharecomponent/searchcomponent/index.scss @@ -4,6 +4,9 @@ position: relative; border-bottom: 1px solid #d9d9d9; + .quickly-add { + display: none; + } .anticon-question-circle { color: #c49f47; position: relative; diff --git a/src/templates/sharecomponent/searchcomponent/searchform/index.jsx b/src/templates/sharecomponent/searchcomponent/searchform/index.jsx index e92077f..377235b 100644 --- a/src/templates/sharecomponent/searchcomponent/searchform/index.jsx +++ b/src/templates/sharecomponent/searchcomponent/searchform/index.jsx @@ -654,8 +654,6 @@ } } else if (['multiselect', 'select', 'link', 'checkcard'].includes(values.type) && values.resourceType === '1') { values.options = [] - } else if (values.type === 'text' && values.advanced === 'true') { - values.inputType = 'input' } if (values.type === 'range') { -- Gitblit v1.8.0