异步查询,日期条件修复

feature/ais
dxfeng 2 years ago
parent d8d381101f
commit 69d8ff5a5d

@ -1,5 +1,5 @@
import styles from './index.less'; import styles from './index.less';
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState, useRef } from 'react';
import { OrgChartComponent } from '@/components/orgChart'; import { OrgChartComponent } from '@/components/orgChart';
import * as d3 from 'd3'; import * as d3 from 'd3';
import { TopBar } from '../components/topBar'; import { TopBar } from '../components/topBar';
@ -15,7 +15,7 @@ export default function companyPage() {
const [data, setData] = useState(null); const [data, setData] = useState(null);
let addNodeChildFunc = null; let addNodeChildFunc = null;
let orgChart = null; let orgChart = null;
let topBarSearchRequest = null; let topBarSearchRequest = useRef({});
const [hasRight, setHasRight] = useState(''); const [hasRight, setHasRight] = useState('');
const [watermark, setWatermark] = useState(''); const [watermark, setWatermark] = useState('');
@ -35,7 +35,7 @@ export default function companyPage() {
return; return;
} }
let idsStr = idsList.join(','); let idsStr = idsList.join(',');
let request = { ...topBarSearchRequest, ids: idsStr }; let request = { ...topBarSearchRequest.current, ids: idsStr };
let api = let api =
'/api/ais/orgChart/asyncCompanyData' + '/api/ais/orgChart/asyncCompanyData' +
qs.stringify(request, { addQueryPrefix: true }); qs.stringify(request, { addQueryPrefix: true });
@ -267,7 +267,7 @@ export default function companyPage() {
}; };
const handleSearch = (requestData) => { const handleSearch = (requestData) => {
topBarSearchRequest = requestData; topBarSearchRequest.current = requestData;
let api = let api =
'/api/ais/orgChart/companyData' + '/api/ais/orgChart/companyData' +
qs.stringify(requestData, { addQueryPrefix: true }); qs.stringify(requestData, { addQueryPrefix: true });

Loading…
Cancel
Save