Kaynağa Gözat

feat: 水质报名去除off

sunxiao 1 ay önce
ebeveyn
işleme
5dddbb1331

+ 6 - 3
src/views/analyse/components/CustomModal.vue

@@ -16,13 +16,14 @@ const modelVisible = defineModel('visible');
 
 
 const simulateData = computed(() => {
 const simulateData = computed(() => {
   const data = props.currentData;
   const data = props.currentData;
-  const usefulkeys = ['on', 'off'];
+  // const usefulkeys = ['on', 'off']; old
+  const usefulkeys = ['on'];
   const resultObj = {};
   const resultObj = {};
 
 
   usefulkeys.forEach(key => {
   usefulkeys.forEach(key => {
     const tempArr = data[key];
     const tempArr = data[key];
 
 
-    resultObj[key] = tempArr.map(item => {
+    resultObj[key] = (tempArr || []).map(item => {
       let numVal = '';
       let numVal = '';
       const keyWhiteList = ['MLSS', 'r']
       const keyWhiteList = ['MLSS', 'r']
       const numDigit = keyWhiteList.includes(item.name) ? 0 : 2;
       const numDigit = keyWhiteList.includes(item.name) ? 0 : 2;
@@ -42,6 +43,7 @@ const simulateData = computed(() => {
       }
       }
     })
     })
   })
   })
+  console.log("resultObj",  resultObj );
   return resultObj;
   return resultObj;
 })
 })
 
 
@@ -52,7 +54,8 @@ const handleCancel = () => {
 
 
 // 发起预测
 // 发起预测
 const handleStartReport = () => {
 const handleStartReport = () => {
-  const usefulkeys = ['on', 'off'];
+  // const usefulkeys = ['on', 'off']; old
+  const usefulkeys = ['on'];
   const simulate = {};
   const simulate = {};
   const table = {
   const table = {
     header: [],
     header: [],