2023-02-17 17:21:05 +08:00
|
|
|
/*
|
|
|
|
|
* Author: 黎永顺
|
|
|
|
|
* name: 数据采集-组件框
|
|
|
|
|
* Description:
|
|
|
|
|
* Date: 2023/2/17
|
|
|
|
|
*/
|
|
|
|
|
import React, { Component } from "react";
|
|
|
|
|
import { inject, observer } from "mobx-react";
|
2023-02-21 09:57:44 +08:00
|
|
|
import { toJS } from "mobx";
|
2024-01-31 11:27:40 +08:00
|
|
|
import { WeaLocaleProvider, WeaNewScroll, WeaSlideModal, WeaTab, WeaTop } from "ecCom";
|
2023-02-21 09:57:44 +08:00
|
|
|
import ImportModal from "../../components/importModal";
|
2023-02-20 09:41:36 +08:00
|
|
|
import SlideModalTitle from "../../components/slideModalTitle";
|
2023-02-21 09:57:44 +08:00
|
|
|
import { getSearchs } from "../../util";
|
2023-02-17 17:21:05 +08:00
|
|
|
import "./index.less";
|
2024-01-31 11:27:40 +08:00
|
|
|
import LogDialog from "../../components/logViewModal";
|
|
|
|
|
|
|
|
|
|
const getLabel = WeaLocaleProvider.getLabel;
|
2023-02-17 17:21:05 +08:00
|
|
|
|
|
|
|
|
@inject("taxAgentStore")
|
|
|
|
|
@observer
|
|
|
|
|
class Layout extends Component {
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props);
|
|
|
|
|
this.state = {
|
2024-01-31 11:27:40 +08:00
|
|
|
showSearchAd: false, logDialogVisible: false
|
2023-02-17 17:21:05 +08:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
const { taxAgentStore: { fetchTaxAgentOption } } = this.props;
|
|
|
|
|
fetchTaxAgentOption();
|
|
|
|
|
window.addEventListener("resize", this.resizeUpdate);
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-21 09:57:44 +08:00
|
|
|
componentWillReceiveProps(nextProps, nextContext) {
|
2023-04-10 15:53:53 +08:00
|
|
|
if (nextProps.exportPayloadType !== this.props.exportPayloadType) {
|
2023-02-21 09:57:44 +08:00
|
|
|
/*
|
|
|
|
|
* Author: 黎永顺
|
|
|
|
|
* Description:导出数据采集数据
|
|
|
|
|
* Params:
|
|
|
|
|
* Date: 2023/2/20
|
|
|
|
|
*/
|
|
|
|
|
window.open(nextProps.exportPayloadUrl, "_self");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-17 17:21:05 +08:00
|
|
|
componentWillUnmount() {
|
|
|
|
|
window.removeEventListener("resize", this.resizeUpdate);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
resizeUpdate = () => {
|
|
|
|
|
const { onResizeWindowInnerWidth } = this.props;
|
|
|
|
|
onResizeWindowInnerWidth(window.innerWidth);
|
|
|
|
|
};
|
2024-01-31 11:27:40 +08:00
|
|
|
onDropMenuClick = (key) => {
|
|
|
|
|
switch (key) {
|
|
|
|
|
case "log":
|
|
|
|
|
this.setState({ logDialogVisible: true });
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
};
|
2023-02-17 17:21:05 +08:00
|
|
|
|
|
|
|
|
render() {
|
2024-01-31 11:27:40 +08:00
|
|
|
const { showSearchAd, logDialogVisible } = this.state;
|
2023-02-20 09:41:36 +08:00
|
|
|
const {
|
|
|
|
|
title, btns, leftComp, children, taxAgentStore: { showOperateBtn },
|
2023-02-21 09:57:44 +08:00
|
|
|
slidePayload, onClose, onSave, slideLoading, form, condition,
|
|
|
|
|
onAdSearch, onCancel, importPayload, onImportSetStep, onImportFile,
|
2024-01-31 11:27:40 +08:00
|
|
|
onPreviewImport, detailOptBtns, columns, logFunction
|
2023-02-20 09:41:36 +08:00
|
|
|
} = this.props;
|
2023-02-20 14:28:08 +08:00
|
|
|
const { visible, title: subtitle, children: slideChildren } = slidePayload;
|
2023-02-21 09:57:44 +08:00
|
|
|
const {
|
|
|
|
|
visible: importVisiable, step, importFormComponent, importOpts,
|
2023-02-22 13:36:59 +08:00
|
|
|
importResult, slideDataSource, templateLink
|
2023-02-21 09:57:44 +08:00
|
|
|
} = importPayload;
|
2023-02-17 17:21:05 +08:00
|
|
|
return (
|
|
|
|
|
<div className="layoutWrapper">
|
|
|
|
|
<WeaTop title={title} buttons={showOperateBtn ? btns : []}
|
2024-01-31 11:27:40 +08:00
|
|
|
icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
|
|
|
|
|
showDropIcon onDropMenuClick={this.onDropMenuClick}
|
|
|
|
|
dropMenuDatas={[
|
|
|
|
|
{
|
|
|
|
|
key: "log", icon: <i className="iconfont icon-caozuorizhi32"/>,
|
|
|
|
|
content: getLabel(545781, "操作日志")
|
|
|
|
|
}
|
|
|
|
|
]}
|
2023-02-17 17:21:05 +08:00
|
|
|
/>
|
|
|
|
|
<WeaTab
|
|
|
|
|
searchType={["base", "advanced"]}
|
|
|
|
|
replaceLeft={leftComp}
|
2023-02-21 09:57:44 +08:00
|
|
|
searchsAd={getSearchs(form, toJS(condition), 2)}
|
2023-02-17 17:21:05 +08:00
|
|
|
showSearchAd={showSearchAd}
|
|
|
|
|
setShowSearchAd={bool => this.setState({ showSearchAd: bool })}
|
2023-02-21 09:57:44 +08:00
|
|
|
onAdReset={() => form.resetForm()}
|
|
|
|
|
onAdSearch={onAdSearch}
|
|
|
|
|
onSearch={onAdSearch}
|
|
|
|
|
onSearchChange={(v) => form.updateFields({ username: v })}
|
|
|
|
|
searchsBaseValue={form.getFormParams().username}
|
2023-02-17 17:21:05 +08:00
|
|
|
/>
|
|
|
|
|
<div className="dataContent">
|
|
|
|
|
<WeaNewScroll height="100%">{children}</WeaNewScroll>
|
2023-02-21 09:57:44 +08:00
|
|
|
{/*导入弹框*/}
|
|
|
|
|
<ImportModal
|
|
|
|
|
needimportSelected //下载模板需要带上导入所选项
|
2023-03-02 09:34:04 +08:00
|
|
|
columns={columns}
|
2023-02-21 09:57:44 +08:00
|
|
|
params={importOpts}
|
|
|
|
|
step={step}
|
|
|
|
|
setStep={onImportSetStep}
|
|
|
|
|
importResult={importResult}
|
|
|
|
|
onFinish={() => onCancel(true)}
|
|
|
|
|
slideDataSource={slideDataSource}
|
|
|
|
|
previewImport={onPreviewImport}
|
|
|
|
|
importFile={onImportFile}
|
2023-02-22 13:36:59 +08:00
|
|
|
templateLink={templateLink}
|
2023-02-21 09:57:44 +08:00
|
|
|
renderFormComponent={() => importFormComponent}
|
|
|
|
|
visiable={importVisiable}
|
|
|
|
|
onCancel={onCancel}
|
|
|
|
|
/>
|
2023-02-20 09:41:36 +08:00
|
|
|
{/* 新增-编辑-详情弹框 */}
|
|
|
|
|
<WeaSlideModal
|
|
|
|
|
className="slideOuterWrapper"
|
|
|
|
|
visible={visible}
|
|
|
|
|
top={0}
|
|
|
|
|
measureT="%"
|
2023-06-20 14:25:30 +08:00
|
|
|
width={80}
|
|
|
|
|
measureX="%"
|
2023-02-20 09:41:36 +08:00
|
|
|
height={100}
|
|
|
|
|
measureY="%"
|
|
|
|
|
direction="right"
|
|
|
|
|
title={
|
|
|
|
|
<SlideModalTitle
|
|
|
|
|
subtitle={subtitle}
|
2023-02-20 14:28:08 +08:00
|
|
|
loading={slideLoading}
|
|
|
|
|
onSave={onSave}
|
2023-02-21 09:57:44 +08:00
|
|
|
editable={subtitle.length <= 2}
|
2023-02-20 09:41:36 +08:00
|
|
|
showOperateBtn={showOperateBtn}
|
2023-02-21 09:57:44 +08:00
|
|
|
customOperate={subtitle.length <= 2 ? [] : detailOptBtns}
|
2023-02-20 09:41:36 +08:00
|
|
|
/>
|
|
|
|
|
}
|
|
|
|
|
content={slideChildren}
|
|
|
|
|
onClose={onClose}
|
|
|
|
|
/>
|
2024-01-31 11:27:40 +08:00
|
|
|
{/*操作日志*/}
|
|
|
|
|
<LogDialog visible={logDialogVisible} logFunction={logFunction}
|
|
|
|
|
onCancel={() => this.setState({ logDialogVisible: false })}/>
|
2023-02-17 17:21:05 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default Layout;
|