解决发票管理换页不保留搜索的问题

main
wuyize 2023-01-05 14:53:11 +08:00
parent 65e321b0c0
commit 33b68690af
2 changed files with 44 additions and 51 deletions

View File

@ -319,7 +319,7 @@ function InvoiceManagement(props: {}) {
const navigate = useNavigate() const navigate = useNavigate()
const handleInvoiceSearchInfo = (invoiceSearch: InvoiceSearchOption) => { const handleInvoiceSearchInfo = (invoiceSearch: InvoiceSearchOption) => {
//setInvoiceSearchOption(invoiceSearch) setInvoiceSearchOption(invoiceSearch)
searchInvoiceContent(invoiceSearch) searchInvoiceContent(invoiceSearch)
} }
const searchInvoiceContent = (invoiceSearch: InvoiceSearchOption) => { const searchInvoiceContent = (invoiceSearch: InvoiceSearchOption) => {

View File

@ -84,7 +84,6 @@ function HorizontalBarChart(props: { title: string, values: number[], labels: st
}, },
series: [ series: [
{ {
name: 'Direct',
type: 'bar', type: 'bar',
colorBy: 'data', colorBy: 'data',
emphasis: { emphasis: {
@ -96,46 +95,9 @@ function HorizontalBarChart(props: { title: string, values: number[], labels: st
}} notMerge={true} lazyUpdate={true}/> }} notMerge={true} lazyUpdate={true}/>
} }
var mMapData =
[
{from: '青海省', to: '青海省', value: 90},
{from: '青海省', to: '安徽省', value: 80},
{from: '青海省', to: '甘肃省', value: 70},
{from: '青海省', to: '宁夏省', value: 60},
{from: '青海省', to: '山西省', value: 50},
{from: '青海省', to: '陕西省', value: 40},
{from: '青海省', to: '广东省', value: 30},
{from: '青海省', to: '重庆省', value: 20},
{from: '青海省', to: '西藏省', value: 10}
];
var convertLineData = function (data: { from: string, to: string, value: number }[]) {
var res = [];
for (var i = 0; i < data.length; i++) {
var dataItem = data[i];
// @ts-ignore
var fromCoord = GeoCoordMap[dataItem.from];
// @ts-ignore
var toCoord = GeoCoordMap[dataItem.to];
if (fromCoord && toCoord) {
res.push(
{
fromName: dataItem.from,
toName: dataItem.to,
coords: [fromCoord, toCoord],
value: dataItem.value,
});
}
}
return res;
};
function StatView() { function StatView() {
const { const {
token: {colorBgContainer, colorPrimary, colorSuccess}, token: {colorBgContainer, colorPrimary, colorSuccess, colorBorder},
} = theme.useToken(); } = theme.useToken();
const [type, setType] = useState<StatType>('month'); const [type, setType] = useState<StatType>('month');
@ -400,7 +362,11 @@ function StatView() {
return geoCoordMap.find(([name,]) => name.includes(placeName)) return geoCoordMap.find(([name,]) => name.includes(placeName))
} }
let mapDataTemp: { fromName: string, toName: string, coords: any[], value: number }[] = [] let maxValue = 0
for (const item of statResponse.reimbursementPlaceStats) {
maxValue = Math.max(maxValue, item.reimbursementLaunchCount)
}
let mapDataTemp: any[] = []
let departures = new Map<string, number>() let departures = new Map<string, number>()
let destinations = new Map<string, number>() let destinations = new Map<string, number>()
for (const item of statResponse.reimbursementPlaceStats) { for (const item of statResponse.reimbursementPlaceStats) {
@ -421,10 +387,13 @@ function StatView() {
if (fromCoords && toCoords) { if (fromCoords && toCoords) {
mapDataTemp.push({ mapDataTemp.push({
"fromName": fromCoords[0], fromName: fromCoords[0],
"toName": toCoords[0], toName: toCoords[0],
"coords": [fromCoords[1], toCoords[1]], coords: [fromCoords[1], toCoords[1]],
"value": item.reimbursementLaunchCount, value: item.reimbursementLaunchCount,
lineStyle: {
width: item.reimbursementLaunchCount / maxValue * 10
}
}) })
} }
} }
@ -676,6 +645,19 @@ function StatView() {
text: '差旅去向', text: '差旅去向',
left: 'center', left: 'center',
}, },
tooltip: {
trigger: 'item',
formatter: function (params: any) {
let returnStr = '';
if (params.componentSubType == 'lines') {
returnStr += params.marker;
returnStr += params.data.fromName + ' → ' + params.data.toName;
returnStr += '' + params.data.value;
}
return returnStr;
}
},
geo: { geo: {
map: 'china', map: 'china',
emphasis: { emphasis: {
@ -685,8 +667,8 @@ function StatView() {
disabled: true disabled: true
}, },
itemStyle: { itemStyle: {
areaColor: '#d4e2fd', areaColor: colorBorder,
borderColor: '#8c8c8c' borderColor: colorBgContainer
} }
}, },
series: [ series: [
@ -695,10 +677,21 @@ function StatView() {
zlevel: 2, zlevel: 2,
lineStyle: { lineStyle: {
normal: { normal: {
color: '#', color: {
width: 3, type: 'linear',
opacity: 0.2, x: 0,
curveness: .3 y: 0,
x2: 1,
y2: 1,
colorStops: [{
offset: 0, color: '#6395f9'
}, {
offset: 1, color: '#62daab'
}],
},
opacity: 0.5,
curveness: .3,
cap: 'round'
} }
}, },
data: mapData data: mapData