|
@@ -291,7 +291,7 @@
|
|
import { ref, computed, watch, onMounted } from 'vue';
|
|
import { ref, computed, watch, onMounted } from 'vue';
|
|
import TableLoop from '@/components/common/table-loop/index.vue';
|
|
import TableLoop from '@/components/common/table-loop/index.vue';
|
|
import { useRequest } from 'vue-request';
|
|
import { useRequest } from 'vue-request';
|
|
-import { division } from '@/utils/tool';
|
|
|
|
|
|
+import { division, dateFormat } from '@/utils/tool';
|
|
import {
|
|
import {
|
|
sopServiceList,
|
|
sopServiceList,
|
|
warningTop,
|
|
warningTop,
|
|
@@ -358,20 +358,27 @@ const {
|
|
} = useRequest(supWarningTrend);
|
|
} = useRequest(supWarningTrend);
|
|
|
|
|
|
const options8 = computed(() => {
|
|
const options8 = computed(() => {
|
|
- let res = result8.value || {};
|
|
|
|
- let keys = Object.keys(res);
|
|
|
|
|
|
+ let res = result8.value || [];
|
|
let xData = [],
|
|
let xData = [],
|
|
sData = [];
|
|
sData = [];
|
|
- let values = Object.values(res);
|
|
|
|
- if (values.length) {
|
|
|
|
- xData = values[0].map((item) => item.click_date);
|
|
|
|
|
|
+ if (res.length) {
|
|
|
|
+ xData = res.map((item) => item.timeStr);
|
|
|
|
+ }
|
|
|
|
+ if (res.length && res[0].sopSupplierAvgViewInfo?.length) {
|
|
|
|
+ res = res.map((item) => {
|
|
|
|
+ item.sopSupplierAvgViewInfo.sort((a, b) => a.supplierId - b.supplierId);
|
|
|
|
+ return item;
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ sData = res[0].sopSupplierAvgViewInfo.map((item) => ({
|
|
|
|
+ name: item.supplierName,
|
|
|
|
+ data: res.map((v) => {
|
|
|
|
+ return v.sopSupplierAvgViewInfo.find(
|
|
|
|
+ (x) => x.supplierId == item.supplierId
|
|
|
|
+ ).rate;
|
|
|
|
+ }),
|
|
|
|
+ }));
|
|
}
|
|
}
|
|
- sData = keys.map((key, index) => {
|
|
|
|
- return {
|
|
|
|
- name: key,
|
|
|
|
- data: values[index].map((item) => item.count),
|
|
|
|
- };
|
|
|
|
- });
|
|
|
|
return createLineOption({ xData, sData });
|
|
return createLineOption({ xData, sData });
|
|
});
|
|
});
|
|
|
|
|