zhaoke 2 years ago
parent
commit
53c7d880a8

+ 3 - 0
src/views/dashboard/hooks/usePublic.ts

@@ -61,6 +61,7 @@ export function usePublic() {
       },
       axisLabel: {
         color: '#8897BC',
+        interval: 0,
       },
     },
     yAxis: [
@@ -292,12 +293,14 @@ export function usePublic() {
             type: 'bar',
             data: [12, 10, 15, 11, 16, 4, 6],
             yAxisIndex: 0,
+            barWidth: 10,
           },
           {
             name: '重量/吨',
             type: 'bar',
             data: [11, 15, 17, 8, 1, 4, 6],
             yAxisIndex: 1,
+            barWidth: 10,
           },
         ],
       },

+ 10 - 1
src/views/dashboard/index.vue

@@ -268,6 +268,12 @@ const pubFunc = (listValues, target, type?) => {
   return newObj;
 };
 
+const parseDate = (date: string) => {
+  const dates = date.split("-");
+  const newDate = dates.shift();
+  return dates.join("-");
+};
+
 //获取小时峰值分布
 const hourlyPeakFunc = async () => {
   loading1.value = true;
@@ -287,6 +293,9 @@ const waybillTrendFunc = async () => {
     { flightDate1: form.value.startDate, flightDate2: form.value.endDate },
   ])) as any;
   if (listValues && isValue(listValues)) {
+    listValues.forEach((item) => {
+      item.jobTime = parseDate(item["jobTime"]);
+    });
     waybillTrendObj.value = pubFunc(listValues, optionLeft);
   }
   loading2.value = false;
@@ -389,7 +398,7 @@ const airlineFunc = async () => {
       },
     ]),
       listValues.forEach((item) => {
-        item.jobTime = item["nodeCode"];
+        item.jobTime = NODE_CODE[item["nodeCode"]] ?? item["nodeCode"];
         item.weight = item["flightNum"];
       });
     airlineObj.value = pubFunc(listValues, newObj, true);

+ 16 - 17
src/views/dashboard/indexHomeOut.vue

@@ -291,6 +291,12 @@ const pubFunc = (listValues, target, type?) => {
   return newObj;
 };
 
+const parseDate = (date: string) => {
+  const dates = date.split("-");
+  const newDate = dates.shift();
+  return dates.join("-");
+};
+
 //获取小时峰值分布
 const hourlyPeakFunc = async () => {
   loading1.value = true;
@@ -310,6 +316,9 @@ const waybillTrendFunc = async () => {
     { flightDate1: form.value.startDate, flightDate2: form.value.endDate },
   ])) as any;
   if (listValues && isValue(listValues)) {
+    listValues.forEach((item) => {
+      item.jobTime = parseDate(item["jobTime"]);
+    });
     waybillTrendObj.value = pubFunc(listValues, optionLeft);
   }
   loading2.value = false;
@@ -319,7 +328,7 @@ const waybillTrendFunc = async () => {
 const nodePeakFunc = async () => {
   loading3.value = true;
   const listValues = (await getPublicData(DATACONTENT_ID.jscAirlineAbnormalId, [
-    { fd1: form.value.startDate, fd2: form.value.endDate, fttp: "国内港" },
+    { fd1: form.value.startDate, fd2: form.value.endDate, fttp: "国内港" },
   ])) as any;
   if (listValues && isValue(listValues)) {
     const newObj = _.cloneDeep(airCompaneBaggage.option.baseOption);
@@ -379,7 +388,7 @@ const airlineAbnormalFunc = async () => {
     {
       fd1: form.value.startDate,
       fd2: form.value.endDate,
-      fttp: "国内港",
+      fttp: "国内港",
     },
   ])) as any;
   if (listValues && isValue(listValues)) {
@@ -410,7 +419,7 @@ const airlineFunc = async () => {
       },
     ]),
       listValues.forEach((item) => {
-        item.jobTime = item["nodeCode"];
+        item.jobTime = NODE_CODE[item["nodeCode"]] ?? item["nodeCode"];
         item.weight = item["flightNum"];
       });
     airlineObj.value = pubFunc(listValues, newObj, true);
@@ -429,20 +438,10 @@ const pickingFuncs = async () => {
   ])) as any;
   if (listValues && isValue(listValues)) {
     const newObj: any = _.cloneDeep(airCompaneBaggage.option.baseOption);
-    (newObj.dataZoom = [
-      {
-        id: "dataZoomX",
-        type: "slider",
-        xAxisIndex: [0],
-        filterMode: "filter",
-        start: 0,
-        end: 40,
-      },
-    ]),
-      listValues.forEach((item) => {
-        item.jobTime = item["flightDate"];
-        item.weight = item["flightNum"];
-      });
+    listValues.forEach((item) => {
+      item.jobTime = parseDate(item["flightDate"]);
+      item.weight = item["flightNum"];
+    });
     pickingObj.value = pubFunc(listValues, newObj, true);
   }
   loading8.value = false;

+ 10 - 1
src/views/dashboard/indexIn.vue

@@ -268,6 +268,12 @@ const pubFunc = (listValues, target, type?) => {
   return newObj;
 };
 
+const parseDate = (date: string) => {
+  const dates = date.split("-");
+  const newDate = dates.shift();
+  return dates.join("-");
+};
+
 //获取小时峰值分布
 const hourlyPeakFunc = async () => {
   loading1.value = true;
@@ -287,6 +293,9 @@ const waybillTrendFunc = async () => {
     { flightDate1: form.value.startDate, flightDate2: form.value.endDate },
   ])) as any;
   if (listValues && isValue(listValues)) {
+    listValues.forEach((item) => {
+      item.jobTime = parseDate(item["jobTime"]);
+    });
     waybillTrendObj.value = pubFunc(listValues, optionLeft);
   }
   loading2.value = false;
@@ -388,7 +397,7 @@ const airlineFunc = async () => {
       },
     ]),
       listValues.forEach((item) => {
-        item.jobTime = item["nodeCode"];
+        item.jobTime = NODE_CODE[item["nodeCode"]] ?? item["nodeCode"];
         item.weight = item["flightNum"];
       });
     airlineObj.value = pubFunc(listValues, newObj, true);

+ 16 - 17
src/views/dashboard/indexOut.vue

@@ -310,6 +310,9 @@ const waybillTrendFunc = async () => {
     { flightDate1: form.value.startDate, flightDate2: form.value.endDate },
   ])) as any;
   if (listValues && isValue(listValues)) {
+    listValues.forEach((item) => {
+      item.jobTime = parseDate(item["jobTime"]);
+    });
     waybillTrendObj.value = pubFunc(listValues, optionLeft);
   }
   loading2.value = false;
@@ -319,7 +322,7 @@ const waybillTrendFunc = async () => {
 const nodePeakFunc = async () => {
   loading3.value = true;
   const listValues = (await getPublicData(DATACONTENT_ID.jscAirlineAbnormalId, [
-    { fd1: form.value.startDate, fd2: form.value.endDate, fttp: "国际港" },
+    { fd1: form.value.startDate, fd2: form.value.endDate, fttp: "国际港" },
   ])) as any;
   if (listValues && isValue(listValues)) {
     const newObj = _.cloneDeep(airCompaneBaggage.option.baseOption);
@@ -380,7 +383,7 @@ const airlineAbnormalFunc = async () => {
     {
       fd1: form.value.startDate,
       fd2: form.value.endDate,
-      fttp: "国际港",
+      fttp: "国际港",
     },
   ])) as any;
   if (listValues && isValue(listValues)) {
@@ -411,7 +414,7 @@ const airlineFunc = async () => {
       },
     ]),
       listValues.forEach((item) => {
-        item.jobTime = item["nodeCode"];
+        item.jobTime = NODE_CODE[item["nodeCode"]] ?? item["nodeCode"];
         item.weight = item["flightNum"];
       });
     airlineObj.value = pubFunc(listValues, newObj, true);
@@ -430,25 +433,21 @@ const pickingFuncs = async () => {
   ])) as any;
   if (listValues && isValue(listValues)) {
     const newObj: any = _.cloneDeep(airCompaneBaggage.option.baseOption);
-    (newObj.dataZoom = [
-      {
-        id: "dataZoomX",
-        type: "slider",
-        xAxisIndex: [0],
-        filterMode: "filter",
-        start: 0,
-        end: 40,
-      },
-    ]),
-      listValues.forEach((item) => {
-        item.jobTime = item["flightDate"];
-        item.weight = item["flightNum"];
-      });
+    listValues.forEach((item) => {
+      item.jobTime = parseDate(item["flightDate"]);
+      item.weight = item["flightNum"];
+    });
     pickingObj.value = pubFunc(listValues, newObj, true);
   }
   loading8.value = false;
 };
 
+const parseDate = (date: string) => {
+  const dates = date.split("-");
+  const newDate = dates.shift();
+  return dates.join("-");
+};
+
 onMounted(() => {
   hourlyPeakFunc();
   waybillTrendFunc();