From fbe0bf90566c75084e58cfe291feae96bec3e7c0 Mon Sep 17 00:00:00 2001 From: zhangminghua Date: Wed, 28 Dec 2022 17:10:32 +0800 Subject: [PATCH] =?UTF-8?q?(*)=E5=91=98=E5=B7=A5=E6=B2=9F=E9=80=9A?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E5=89=8D=E7=AB=AF=E5=AF=BC=E5=87=BA=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../communication/employeeCommunication.jsx | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/web/client/src/sections/humanAffairs/containers/communication/employeeCommunication.jsx b/web/client/src/sections/humanAffairs/containers/communication/employeeCommunication.jsx index 5cf3825..9eebe0e 100644 --- a/web/client/src/sections/humanAffairs/containers/communication/employeeCommunication.jsx +++ b/web/client/src/sections/humanAffairs/containers/communication/employeeCommunication.jsx @@ -1,14 +1,14 @@ import React, { useEffect, useRef, useState, useMemo } from 'react'; import { connect } from 'react-redux'; import moment from 'moment' -import { Select, Input, Button, Tooltip, Table, Pagination, Skeleton, DatePicker } from '@douyinfe/semi-ui'; +import { Select, Input, Button, Tooltip, Table, Pagination, Skeleton, DatePicker, Toast } from '@douyinfe/semi-ui'; import { IconSearch } from '@douyinfe/semi-icons'; import DetailModal from './detailModal'; import { SkeletonScreen } from "$components"; import '../../style.less' const EmployeeCommunication = (props) => { - const { dispatch, actions } = props + const { dispatch, actions, user } = props const { humanAffairs } = actions; const [keywordTarget, setKeywordTarget] = useState('personalName'); const [keyword, setKeyword] = useState('');//搜索内容 @@ -18,6 +18,7 @@ const EmployeeCommunication = (props) => { const [modalV, setModalV] = useState(true); const [dataToDetail, setDataToDetail] = useState(null); const [tableData, setTableData] = useState([]); + const [exportUrl, setExportUrl] = useState(''); const page = useRef(query.page); function seachValueChange(value) { setKeyword(value) @@ -84,7 +85,7 @@ const EmployeeCommunication = (props) => { title: '沟通时间', dataIndex: 'communicateDate', key: 'communicateDate', - width: 120, + width: 120, render: (text, record) => {text ? moment(text).format("YYYY-MM-DD") : '-'} }, { title: '沟通内容', @@ -191,14 +192,19 @@ const EmployeeCommunication = (props) => { setModalV(false) } - function handleChange (date) { + function handleChange(date) { if (date.length > 1) { - setTimeRange(moment(date[0]).format('YYYY-MM-DD 00:00:00')+','+moment(date[1]).format('YYYY-MM-DD 23:59:59')) + setTimeRange(moment(date[0]).format('YYYY-MM-DD 00:00:00') + ',' + moment(date[1]).format('YYYY-MM-DD 23:59:59')) } else { setTimeRange(''); } } + + const exportAllData = () => { + let url = `export/employee/communicate?token=${user.token}×tamp=${moment().valueOf()}` + setExportUrl(url); + } const scroll = useMemo(() => ({}), []); return (
@@ -247,7 +253,10 @@ const EmployeeCommunication = (props) => { }}>查询
-
+
{ + exportAllData() + }}> 导出
@@ -301,6 +310,9 @@ const EmployeeCommunication = (props) => { close={() => closeAndFetch()} onCancel={() => setModalV(false)} /> : '' } + { + exportUrl ?