update 准确度统计导出excel
This commit is contained in:
@@ -105,3 +105,7 @@ export const updateTaskPoolBriefApi = (params: any) => {
|
||||
export const statisticTaskPoolConfidenceApi = (params: any) => {
|
||||
return post(`${PREFIX}taskpool/statisticTaskPoolConfidence`, params);
|
||||
};
|
||||
// 导出统计工况库和场景库准确度信息
|
||||
export const exportStatisticTaskPoolConfidenceApi = (params: any, filename?: string) => {
|
||||
return download(`${PREFIX}taskpool/exportStatisticTaskPoolConfidence`, params, filename);
|
||||
};
|
||||
|
||||
@@ -115,11 +115,25 @@ import commonFilterChart from '@/components/common/echartCard/commonFilterChart.
|
||||
import {
|
||||
statisticDisciplineConfidenceTrendApi,
|
||||
statisticTaskPoolConfidenceApi,
|
||||
exportStatisticTaskPoolConfidenceApi,
|
||||
} from '@/api/task/taskpool';
|
||||
// import { FileUtil } from '@/utils/file';
|
||||
|
||||
// const tableTitle = [
|
||||
// { chineseName: '学科名称', englishName: 'discipline' },
|
||||
// { chineseName: '机型库名称', englishName: 'poolName' },
|
||||
// { chineseName: '准确度平均值', englishName: 'confidence' },
|
||||
// { chineseName: '场景数量', englishName: 'count' },
|
||||
// { chineseName: '有效数量', englishName: 'effective' },
|
||||
// ];
|
||||
const downloadAction = (type: string) => {
|
||||
const params = type === 'discipline' ? disciplineParams.value : machineParams.value;
|
||||
console.log('下载参数:', params);
|
||||
const dataType = params.bTotal ? '总量' : '有效';
|
||||
const fileName =
|
||||
type === 'discipline' ? '学科' + dataType + '准确度' : '机型' + dataType + '准确度';
|
||||
exportStatisticTaskPoolConfidenceApi(params, fileName + '.xlsx');
|
||||
// const tableData = type === 'discipline' ? disciplinetableData.value : machineTableData.value;
|
||||
// FileUtil.exportExcel(tableData, fileName, tableTitle);
|
||||
};
|
||||
|
||||
// #region学科准确度
|
||||
@@ -130,6 +144,7 @@ const disciplineExtraFilters = ref({
|
||||
});
|
||||
const disciplineParams = ref();
|
||||
const disciplineNodata = ref(false);
|
||||
// const disciplinetableData = ref<any>([]);
|
||||
const disciplineConfidenceUpdate = async (data: any) => {
|
||||
const params = {
|
||||
type: 1,
|
||||
@@ -139,12 +154,14 @@ const disciplineConfidenceUpdate = async (data: any) => {
|
||||
disciplineParams.value = params;
|
||||
disciplineLoading.value = true;
|
||||
try {
|
||||
// disciplinetableData.value = [];
|
||||
const res: any = await statisticTaskPoolConfidenceApi(params);
|
||||
if (res.code === 200) {
|
||||
disciplineLoading.value = false;
|
||||
const data = res.data || [];
|
||||
disciplineNodata.value = data.length === 0;
|
||||
if (data.length) {
|
||||
// disciplinetableData.value = data.map(({ poolName, ...rest }: any) => rest); // eslint-disable-line
|
||||
const xData = data.map((item: any) => (item as any).discipline);
|
||||
const option = {
|
||||
color: ['#409eff'],
|
||||
@@ -183,6 +200,7 @@ const machineLoading = ref(false);
|
||||
const machineConfidenceOption = ref<any>();
|
||||
const machineNodata = ref(false);
|
||||
const machineParams = ref();
|
||||
// const machineTableData = ref<any>([]);
|
||||
const queryMachineConfidenceFun = async (data: any) => {
|
||||
const params = {
|
||||
type: 2,
|
||||
@@ -195,11 +213,13 @@ const queryMachineConfidenceFun = async (data: any) => {
|
||||
machineParams.value = params;
|
||||
machineLoading.value = true;
|
||||
try {
|
||||
// machineTableData.value = [];
|
||||
const res: any = await statisticTaskPoolConfidenceApi(params);
|
||||
if (res.code === 200 && Array.isArray(res.data)) {
|
||||
const data = res.data || [];
|
||||
machineNodata.value = data.length === 0;
|
||||
if (data.length) {
|
||||
// machineTableData.value = data.map(({ discipline, ...rest }: any) => rest); // eslint-disable-line
|
||||
const xData = data.map((item: any) => (item as any).poolName);
|
||||
const option = {
|
||||
color: ['#409eff'],
|
||||
|
||||
Reference in New Issue
Block a user