lxh пре 8 месеци
родитељ
комит
5445da7a3c

+ 16 - 16
src/views/vent/monitorManager/alarmMonitor/warn/dustWarn.vue

@@ -135,16 +135,16 @@ function cardClick(ind, item) {
     clearTimeout(timer);
     getMonitor(item.deviceID, true);
 }
-function uniqueObjects(arr, key) {
-    const unique = arr.map((e) => e[key])
-        // 存储每个属性值
-        .map((e, i, final) => final.indexOf(e) === i && i)
-        // 移除重复值的索引
-        .filter((e) => arr[e])
-        // 映射到对应的对象
-        .map((e) => arr[e]);
-    return unique;
-}
+// function uniqueObjects(arr, key) {
+//     const unique = arr.map((e) => e[key])
+//         // 存储每个属性值
+//         .map((e, i, final) => final.indexOf(e) === i && i)
+//         // 移除重复值的索引
+//         .filter((e) => arr[e])
+//         // 映射到对应的对象
+//         .map((e) => arr[e]);
+//     return unique;
+// }
 //顶部区域选项切换
 function topAreaClick(index) {
     activeIndex.value = index;
@@ -155,8 +155,8 @@ function topAreaClick(index) {
 
     echartNow.value = JSON.parse(choiceData[index].readData.expectInfo)['list']
     echartNow.value.push({ time: JSON.parse(choiceData[index].readData.expectInfo)['nowTime'], value: JSON.parse(choiceData[index].readData.expectInfo)['nowVal'], value1: JSON.parse(choiceData[index].readData.expectInfo)['aveVal'] })
-    let unique = uniqueObjects(echartNow.value, 'time');
-    let setData = [...unique].sort((a, b) => Date.parse(new Date(a.time)) - Date.parse(new Date(b.time)))
+    // let unique = uniqueObjects(echartNow.value, 'time');
+    let setData = [...echartNow.value].sort((a, b) => Date.parse(new Date(a.time)) - Date.parse(new Date(b.time)))
     setData.forEach(el => {
         if (el.value && el.value != '0' && el.value1!='0') {
             echartDataFc.maxData.data.push(el.value);
@@ -217,8 +217,8 @@ function getSysWarnList(id, type) {
             if (choiceData[activeIndex.value]) {
                 echartNow.value = JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['list']
                 echartNow.value.push({ time: JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['nowTime'], value: JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['nowVal'], value1: JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['aveVal'] })
-                let unique = uniqueObjects(echartNow.value, 'time');
-                let setData = [...unique].sort((a, b) => Date.parse(new Date(a.time)) - Date.parse(new Date(b.time)))
+                // let unique = uniqueObjects(echartNow.value, 'time');
+                let setData = [...echartNow.value].sort((a, b) => Date.parse(new Date(a.time)) - Date.parse(new Date(b.time)))
                 setData.forEach(el => {
                     if (el.value && el.value != '0' && el.value1!='0') {
                         echartDataFc.maxData.data.push(el.value);
@@ -238,8 +238,8 @@ function getSysWarnList(id, type) {
                 activeIndex.value = 0;
                 echartNow.value = JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['list']
                 echartNow.value.push({ time: JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['nowTime'], value: JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['nowVal'], value1: JSON.parse(choiceData[activeIndex.value].readData.expectInfo)['aveVal'] })
-                let unique = uniqueObjects(echartNow.value, 'time');
-                let setData = [...unique].sort((a, b) => Date.parse(new Date(a.time)) - Date.parse(new Date(b.time)))
+                // let unique = uniqueObjects(echartNow.value, 'time');
+                let setData = [...echartNow.value].sort((a, b) => Date.parse(new Date(a.time)) - Date.parse(new Date(b.time)))
                 setData.forEach(el => {
                     if (el.value && el.value != '0' && el.value1!='0') {
                         echartDataFc.maxData.data.push(el.value);

+ 12 - 12
src/views/vent/monitorManager/deviceMonitor/components/device/modal/dust.modal.vue

@@ -248,16 +248,16 @@ export default defineComponent({
         setModalProps({ loading: false, confirmLoading: false });
       }, 300);
     }
-    function uniqueObjects(arr, key) {
-      const unique = arr.map((e) => e[key])
-        // 存储每个属性值
-        .map((e, i, final) => final.indexOf(e) === i && i)
-        // 移除重复值的索引
-        .filter((e) => arr[e])
-        // 映射到对应的对象
-        .map((e) => arr[e]);
-      return unique;
-    }
+    // function uniqueObjects(arr, key) {
+    //   const unique = arr.map((e) => e[key])
+    //     // 存储每个属性值
+    //     .map((e, i, final) => final.indexOf(e) === i && i)
+    //     // 移除重复值的索引
+    //     .filter((e) => arr[e])
+    //     // 映射到对应的对象
+    //     .map((e) => arr[e]);
+    //   return unique;
+    // }
 
     watch([() => props.dataSource, () => props.activeID], ([newDataSource, newActiveID], [oldDataSource, oldActiveID]) => {
       deviceList.value = newDataSource as any[];
@@ -279,9 +279,9 @@ export default defineComponent({
 
           echartNow.value = JSON.parse(item.readData.expectInfo)['list']
           echartNow.value.push({time:JSON.parse(item.readData.expectInfo)['nowTime'],value:JSON.parse(item.readData.expectInfo)['nowVal'],value1:JSON.parse(item.readData.expectInfo)['aveVal']})
-          let unique=uniqueObjects( echartNow.value, 'time');
+          // let unique=uniqueObjects( echartNow.value, 'time');
     
-          let setData = [ ...unique].sort((a,b)=>Date.parse(new Date(a.time)) - Date.parse(new Date(b.time)))
+          let setData = [ ... echartNow.value].sort((a,b)=>Date.parse(new Date(a.time)) - Date.parse(new Date(b.time)))
           setData.forEach(el=>{
            if(el.value && el.value!='0'&& el.value1 !='0'){
             el.nowVal=el.value