From 241a37c30386c6ceb2188a2c562de354ac232cb0 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 28 九月 2021 14:58:21 +0800 Subject: [PATCH] 2021-09-28 --- src/menu/components/chart/antv-pie/index.jsx | 2 src/templates/zshare/editcomponent/index.jsx | 29 ++++++++- src/menu/components/chart/antv-bar/index.jsx | 2 src/menu/components/chart/antv-scatter/index.jsx | 2 src/menu/components/table/normal-table/index.scss | 2 src/menu/components/share/pastecomponent/index.jsx | 9 +- src/tabviews/zshare/actionList/normalbutton/index.jsx | 40 +++++++------ src/templates/calendarconfig/index.jsx | 2 src/templates/comtableconfig/index.jsx | 2 src/templates/subtableconfig/index.jsx | 2 src/templates/sharecomponent/searchcomponent/index.jsx | 30 +++++----- 11 files changed, 71 insertions(+), 51 deletions(-) diff --git a/src/menu/components/chart/antv-bar/index.jsx b/src/menu/components/chart/antv-bar/index.jsx index 6930709..ef00994 100644 --- a/src/menu/components/chart/antv-bar/index.jsx +++ b/src/menu/components/chart/antv-bar/index.jsx @@ -1338,7 +1338,7 @@ {appType !== 'mob' ? <Icon className="plus" title="娣诲姞鎸夐挳" onClick={this.addButton} type="plus-square" /> : null} <ChartCompileForm config={card} dict={this.state.dict} plotchange={this.updateComponent}/> <CopyComponent type="line" card={card}/> - <PasteComponent config={card} options={['action', 'search', 'form']} updateConfig={this.updateComponent} /> + <PasteComponent config={card} options={['action']} updateConfig={this.updateComponent} /> <Icon className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle} type="font-colors" /> <LogComponent btnlog={card.btnlog || []} handlelog={this.handleLog} /> <ClockComponent config={card} updateConfig={this.updateComponent}/> diff --git a/src/menu/components/chart/antv-pie/index.jsx b/src/menu/components/chart/antv-pie/index.jsx index 7055125..3356b8a 100644 --- a/src/menu/components/chart/antv-pie/index.jsx +++ b/src/menu/components/chart/antv-pie/index.jsx @@ -17,7 +17,6 @@ const SettingComponent = asyncIconComponent(() => import('@/menu/datasource')) const ChartCompileForm = asyncIconComponent(() => import('./chartcompile')) const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent')) -const PasteComponent = asyncIconComponent(() => import('@/menu/components/share/pastecomponent')) const NormalHeader = asyncComponent(() => import('@/menu/components/share/normalheader')) const UserComponent = asyncIconComponent(() => import('@/menu/components/share/usercomponent')) const ClockComponent = asyncIconComponent(() => import('@/menu/components/share/clockcomponent')) @@ -674,7 +673,6 @@ {!ismob ? <Icon className="plus" title="娣诲姞鎼滅储" onClick={this.addSearch} type="plus-circle" /> : null} <ChartCompileForm config={card} dict={this.state.dict} plotchange={this.updateComponent}/> <CopyComponent type="pie" card={card}/> - <PasteComponent config={card} options={['search', 'form']} updateConfig={this.updateComponent} /> <Icon className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle} type="font-colors" /> <ClockComponent config={card} updateConfig={this.updateComponent}/> <UserComponent config={card}/> diff --git a/src/menu/components/chart/antv-scatter/index.jsx b/src/menu/components/chart/antv-scatter/index.jsx index 9a7b1f3..eacdf5c 100644 --- a/src/menu/components/chart/antv-scatter/index.jsx +++ b/src/menu/components/chart/antv-scatter/index.jsx @@ -376,7 +376,7 @@ {appType !== 'mob' ? <Icon className="plus" title="娣诲姞鎸夐挳" onClick={this.addButton} type="plus-square" /> : null} <ChartCompileForm config={card} dict={this.state.dict} plotchange={this.updateComponent}/> <CopyComponent type="line" card={card}/> - <PasteComponent config={card} options={['action', 'search', 'form']} updateConfig={this.updateComponent}/> + <PasteComponent config={card} options={['action']} updateConfig={this.updateComponent}/> <Icon className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle} type="font-colors"/> <LogComponent btnlog={card.btnlog || []} handlelog={this.handleLog}/> <ClockComponent config={card} updateConfig={this.updateComponent}/> diff --git a/src/menu/components/share/pastecomponent/index.jsx b/src/menu/components/share/pastecomponent/index.jsx index e367d11..c6df7d3 100644 --- a/src/menu/components/share/pastecomponent/index.jsx +++ b/src/menu/components/share/pastecomponent/index.jsx @@ -162,10 +162,7 @@ } MKEmitter.emit('addButton', config.uuid, res) } else if (type === 'search' || type === 'form') { - config.search = config.search || [] - config.search = config.search.filter(item => !item.origin) - - let keys = config.search.map(item => item.field.toLowerCase()) + let keys = config.search.map(item => item.field ? item.field.toLowerCase() : '') if (type === 'form') { if (['number', 'switch', 'textarea', 'fileupload', 'hint', 'color', 'funcvar'].includes(res.type)) { @@ -188,7 +185,9 @@ return } - config.search.push(res) + MKEmitter.emit('plusSearch', config.uuid, res, 'simple') + this.setState({visible: false}) + return } else if (type === 'cardcell') { config.subcards.push(res) } else if (type === 'menucell') { diff --git a/src/menu/components/table/normal-table/index.scss b/src/menu/components/table/normal-table/index.scss index 23a3143..f933a19 100644 --- a/src/menu/components/table/normal-table/index.scss +++ b/src/menu/components/table/normal-table/index.scss @@ -8,7 +8,7 @@ min-height: 100px; .model-table-search-list { - padding: 10px 0px 0px; + padding: 10px 0px 15px; min-height: 65px; border-bottom: 1px solid #f0f0f0; >.anticon-question-circle { diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx index 1282c98..b6101a4 100644 --- a/src/tabviews/zshare/actionList/normalbutton/index.jsx +++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx @@ -692,15 +692,17 @@ delete _param.ErrMesg delete _param.message - Api.genericInterface(_param).then(result => { - if (!result.status) { - notification.warning({ - top: 92, - message: result.message, - duration: 5 - }) - } - }) + setTimeout(() => { + Api.genericInterface(_param).then(result => { + if (!result.status) { + notification.warning({ + top: 92, + message: result.message, + duration: 5 + }) + } + }) + }, 600) } resolve(res) }, () => { @@ -1160,15 +1162,17 @@ delete _param.ErrMesg delete _param.message - Api.genericInterface(_param).then(result => { - if (!result.status) { - notification.warning({ - top: 92, - message: result.message, - duration: 5 - }) - } - }) + setTimeout(() => { + Api.genericInterface(_param).then(result => { + if (!result.status) { + notification.warning({ + top: 92, + message: result.message, + duration: 5 + }) + } + }) + }, 600) } if (params.length === 0) { this.execSuccess(res) diff --git a/src/templates/calendarconfig/index.jsx b/src/templates/calendarconfig/index.jsx index 498affe..ce34dfd 100644 --- a/src/templates/calendarconfig/index.jsx +++ b/src/templates/calendarconfig/index.jsx @@ -767,7 +767,7 @@ </div> } bordered={false} extra={ <div> - <EditComponent dict={this.state.dict} options={['search']} config={this.state.config}/> + <EditComponent dict={this.state.dict} type="table" options={['search', 'form']} config={this.state.config}/> <Switch className="big" checkedChildren="鍚�" unCheckedChildren="鍋�" checked={this.state.config.enabled} onChange={this.onEnabledChange} /> <Button type="primary" onClick={this.submitConfig} loading={this.state.menuloading}>{this.state.dict['model.save']}</Button> <Button onClick={this.cancelConfig}>{this.state.dict['model.back']}</Button> diff --git a/src/templates/comtableconfig/index.jsx b/src/templates/comtableconfig/index.jsx index 2056c7e..4eea89d 100644 --- a/src/templates/comtableconfig/index.jsx +++ b/src/templates/comtableconfig/index.jsx @@ -1262,7 +1262,7 @@ <div> <Versions MenuId={menu.MenuID} open_edition={openEdition} updateConfig={this.refreshConfig}/> <ReplaceField type="table" config={config} updateConfig={this.updateconfig}/> - <EditComponent dict={this.state.dict} options={['search', 'action', 'columns']} config={this.state.config} MenuID={this.props.menu.MenuID} thawButtons={this.state.thawButtons} refresh={this.editConfig}/> + <EditComponent dict={this.state.dict} type="table" options={['search', 'form', 'action', 'columns']} config={this.state.config} MenuID={this.props.menu.MenuID} thawButtons={this.state.thawButtons} refresh={this.editConfig}/> <Switch className="big" checkedChildren={this.state.dict['model.enable']} unCheckedChildren={this.state.dict['model.disable']} checked={this.state.config.enabled} onChange={this.onEnabledChange} /> <Button type="primary" onClick={this.submitConfig} loading={this.state.menuloading}>{this.state.dict['model.save']}</Button> <Button onClick={this.cancelConfig}>{this.state.dict['model.back']}</Button> diff --git a/src/templates/sharecomponent/searchcomponent/index.jsx b/src/templates/sharecomponent/searchcomponent/index.jsx index fad052d..8545707 100644 --- a/src/templates/sharecomponent/searchcomponent/index.jsx +++ b/src/templates/sharecomponent/searchcomponent/index.jsx @@ -43,21 +43,21 @@ }) } - /** - * @description 鐩戝惉鍒版悳绱㈡潯浠跺鍒舵椂锛岃Е鍙戞悳绱㈡潯浠剁紪杈� - */ - UNSAFE_componentWillReceiveProps (nextProps) { - const { searchlist } = this.state + // /** + // * @description 鐩戝惉鍒版悳绱㈡潯浠跺鍒舵椂锛岃Е鍙戞悳绱㈡潯浠剁紪杈� + // */ + // UNSAFE_componentWillReceiveProps (nextProps) { + // const { searchlist } = this.state - if (!is(fromJS(nextProps.config.search), fromJS(this.props.config.search)) && !is(fromJS(nextProps.config.search), fromJS(searchlist))) { - let len = nextProps.config.search.length - let item = nextProps.config.search[len - 1] - if (item && item.focus) { - this.handleSearch(item) - } - this.setState({searchlist: fromJS(nextProps.config.search).toJS()}) - } - } + // if (!is(fromJS(nextProps.config.search), fromJS(this.props.config.search)) && !is(fromJS(nextProps.config.search), fromJS(searchlist))) { + // let len = nextProps.config.search.length + // let item = nextProps.config.search[len - 1] + // if (item && item.focus) { + // this.handleSearch(item) + // } + // this.setState({searchlist: fromJS(nextProps.config.search).toJS()}) + // } + // } componentDidMount () { MKEmitter.addListener('plusSearch', this.plusSearch) @@ -336,7 +336,7 @@ <Tooltip placement="bottomLeft" overlayClassName="middle" title={dict['model.tooltip.search.guide']}> <Icon type="question-circle" /> </Tooltip> - <FieldsComponent config={config} type="search" /> + <FieldsComponent config={{uuid: config.uuid, search: searchlist}} type="search" /> <Switch checkedChildren={dict['model.switch.open']} unCheckedChildren={dict['model.switch.close']} defaultChecked={showField} onChange={this.onFieldChange} /> <DragElement list={searchlist} diff --git a/src/templates/subtableconfig/index.jsx b/src/templates/subtableconfig/index.jsx index c1ea057..c561696 100644 --- a/src/templates/subtableconfig/index.jsx +++ b/src/templates/subtableconfig/index.jsx @@ -1057,7 +1057,7 @@ <div> <Versions MenuId={config.uuid} open_edition={openEdition} updateConfig={this.refreshConfig}/> <ReplaceField type="table" config={config} updateConfig={this.updateconfig}/> - <EditComponent dict={this.state.dict} options={['search', 'action', 'columns']} config={config} MenuID={config.uuid} thawButtons={this.state.thawButtons} refresh={this.updateConfig}/> + <EditComponent dict={this.state.dict} type="table" options={['search', 'form', 'action', 'columns']} config={config} MenuID={config.uuid} thawButtons={this.state.thawButtons} refresh={this.updateConfig}/> <Switch className="big" checkedChildren="鍚�" unCheckedChildren="鍋�" checked={config.enabled} onChange={this.onEnabledChange} /> <Button type="primary" onClick={this.submitConfig} loading={this.state.menuloading}>{this.state.dict['model.save']}</Button> <Button onClick={this.cancelConfig}>{this.state.dict['model.back']}</Button> diff --git a/src/templates/zshare/editcomponent/index.jsx b/src/templates/zshare/editcomponent/index.jsx index dd89e6d..cbc5832 100644 --- a/src/templates/zshare/editcomponent/index.jsx +++ b/src/templates/zshare/editcomponent/index.jsx @@ -117,16 +117,35 @@ } pasteSubmit = () => { - const { options, config } = this.props + const { options, config, type } = this.props let _config = fromJS(this.props.config).toJS() this.pasteFormRef.handleConfirm().then(res => { - if (res.copyType === 'action' && options.includes('action')) { + if (!options.includes(res.copyType)) { + notification.warning({ + top: 92, + message: '閰嶇疆淇℃伅鏍煎紡閿欒锛�', + duration: 5 + }) + return + } else if (res.copyType === 'action') { res.uuid = Utils.getuuid() MKEmitter.emit('pasteButton', config.uuid, res) - } else if (options.includes('search') && res.copyType === 'search') { + } else if (res.copyType === 'search' || (type === 'table' && res.copyType === 'form')) { res.uuid = Utils.getuuid() let keys = _config.search.map(item => item.field ? item.field.toLowerCase() : '') + + if (type === 'table') { + if (['number', 'switch', 'textarea', 'fileupload', 'hint', 'color', 'funcvar'].includes(res.type)) { + res.type = 'text' + } else if (res.type === 'radio') { + res.type = 'select' + } else if (res.type === 'checkbox') { + res.type = 'multiselect' + } else if (res.type === 'datetime') { + res.type = 'date' + } + } if (res.field && keys.includes(res.field.toLowerCase())) { notification.warning({ @@ -137,12 +156,12 @@ return } MKEmitter.emit('plusSearch', config.uuid, res, 'simple') - } else if (options.includes('columns') && res.copyType === 'columns') { + } else if (res.copyType === 'columns') { let keys = _config.columns.map(item => item.field ? item.field.toLowerCase() : '') let items = res.columns.filter(col => col.field && !keys.includes(col.field.toLowerCase())) MKEmitter.emit('plusColumns', config.uuid, items) - } else if (options.includes('form') && res.copyType === 'form') { + } else if (res.copyType === 'form') { let keys = _config.fields.map(item => item.field ? item.field.toLowerCase() : '') res.uuid = Utils.getuuid() -- Gitblit v1.8.0