/* * Author: 黎永顺 * name: 数据采集-组件框 * Description: * Date: 2023/2/17 */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { toJS } from "mobx"; import { WeaLocaleProvider, WeaSlideModal, WeaTab, WeaTop } from "ecCom"; import { Button } from "antd"; import ImportModal from "./importDialog"; import LogDialog from "../../components/logViewModal"; import { getSearchs } from "../../util"; import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; @inject("taxAgentStore") @observer class Layout extends Component { constructor(props) { super(props); this.state = { showSearchAd: false, logDialogVisible: false, filterConditions: "[]" }; } componentDidMount() { const { taxAgentStore: { fetchTaxAgentOption } } = this.props; fetchTaxAgentOption(); window.addEventListener("resize", this.resizeUpdate); } componentWillReceiveProps(nextProps, nextContext) { if (nextProps.exportPayloadType !== this.props.exportPayloadType) { /* * Author: 黎永顺 * Description:导出数据采集数据 * Params: * Date: 2023/2/20 */ window.open(nextProps.exportPayloadUrl, "_self"); } if (nextProps.targetid !== this.props.targetid && nextProps.targetid) { /* * Author: 黎永顺 * Description:操作日志 * Params: * Date: 2023/2/20 */ this.onDropMenuClick("log", nextProps.targetid); } } componentWillUnmount() { window.removeEventListener("resize", this.resizeUpdate); } resizeUpdate = () => { const { onResizeWindowInnerWidth } = this.props; onResizeWindowInnerWidth(window.innerWidth); }; onDropMenuClick = (key, targetid = "") => { switch (key) { case "log": this.setState({ logDialogVisible: true, filterConditions: targetid ? `[{\"connectCondition\":\"AND\",\"columIndex\":\"targetid\",\"type\":\"=\",\"value\":\"${targetid}\"}]` : "[]" }); break; default: break; } }; renderTitle = () => { const { slidePayload, slideLoading, detailOptBtns, onSave } = this.props; const { title } = slidePayload; return
{title}
{(slidePayload.children && slidePayload.children.props.className) ? [...detailOptBtns] : }
; }; render() { const { showSearchAd, logDialogVisible, filterConditions } = this.state; const { title, btns, leftComp, children, taxAgentStore: { showOperateBtn }, slidePayload, onClose, form, condition, onImportFile, tabBtns = [], onAdSearch, onCancel, importPayload, logFunction, onClearTargrtid } = this.props; const { visible, children: slideChildren } = slidePayload; const { visible: importVisiable, importFormComponent, importOpts, importResult, templateLink, previewUrl } = importPayload; return (
} iconBgcolor="#F14A2D" showDropIcon onDropMenuClick={this.onDropMenuClick} dropMenuDatas={[ { key: "log", icon: , content: getLabel(545781, "操作日志") } ]} /> this.setState({ showSearchAd: bool })} onAdReset={() => form.resetForm()} onAdSearch={onAdSearch} onSearch={onAdSearch} onSearchChange={(v) => form.updateFields({ username: v })} searchsBaseValue={form.getFormParams().username} buttons={showOperateBtn ? tabBtns : []} />
{children} {/*导入弹框*/} {/* 新增-编辑-详情弹框 */} {/*操作日志*/} this.setState({ logDialogVisible: false }, () => onClearTargrtid())}/>
); } } export default Layout;