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

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 handleInvoiceSearchInfo = (invoiceSearch: InvoiceSearchOption) => {
//setInvoiceSearchOption(invoiceSearch)
setInvoiceSearchOption(invoiceSearch)
searchInvoiceContent(invoiceSearch)
}
const searchInvoiceContent = (invoiceSearch: InvoiceSearchOption) => {

View File

@ -84,7 +84,6 @@ function HorizontalBarChart(props: { title: string, values: number[], labels: st
},
series: [
{
name: 'Direct',
type: 'bar',
colorBy: 'data',
emphasis: {
@ -96,46 +95,9 @@ function HorizontalBarChart(props: { title: string, values: number[], labels: st
}} 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() {
const {
token: {colorBgContainer, colorPrimary, colorSuccess},
token: {colorBgContainer, colorPrimary, colorSuccess, colorBorder},
} = theme.useToken();
const [type, setType] = useState<StatType>('month');
@ -400,7 +362,11 @@ function StatView() {
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 destinations = new Map<string, number>()
for (const item of statResponse.reimbursementPlaceStats) {
@ -421,10 +387,13 @@ function StatView() {
if (fromCoords && toCoords) {
mapDataTemp.push({
"fromName": fromCoords[0],
"toName": toCoords[0],
"coords": [fromCoords[1], toCoords[1]],
"value": item.reimbursementLaunchCount,
fromName: fromCoords[0],
toName: toCoords[0],
coords: [fromCoords[1], toCoords[1]],
value: item.reimbursementLaunchCount,
lineStyle: {
width: item.reimbursementLaunchCount / maxValue * 10
}
})
}
}
@ -676,6 +645,19 @@ function StatView() {
text: '差旅去向',
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: {
map: 'china',
emphasis: {
@ -685,8 +667,8 @@ function StatView() {
disabled: true
},
itemStyle: {
areaColor: '#d4e2fd',
borderColor: '#8c8c8c'
areaColor: colorBorder,
borderColor: colorBgContainer
}
},
series: [
@ -695,10 +677,21 @@ function StatView() {
zlevel: 2,
lineStyle: {
normal: {
color: '#',
width: 3,
opacity: 0.2,
curveness: .3
color: {
type: 'linear',
x: 0,
y: 0,
x2: 1,
y2: 1,
colorStops: [{
offset: 0, color: '#6395f9'
}, {
offset: 1, color: '#62daab'
}],
},
opacity: 0.5,
curveness: .3,
cap: 'round'
}
},
data: mapData