licp
2024-07-04 50fdf639a5d30355950ecd70e9d89ea541080f4b
调试
已修改1个文件
83 ■■■■■ 文件已修改
src/components/do/b1-inspect-order-plan/Inspection.vue 83 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -1705,7 +1705,9 @@
                    comp = ask.map((m, i) => {
                      if (m.includes('=')) {
                        let str = m.split('=')[1]
                        console.log(res,str)
                        if(typeof res == 'string'&&typeof str == 'string'){
                          console.log(res,str)
                          return  res.trim() == str.trim()
                        }else{
                          return  eval(res) == eval(str)
@@ -1754,11 +1756,13 @@
                }else{
                  let valueList = [];
                  item.valueList.forEach(a => {
                    console.log(a)
                    valueList.push({
                      name: `${this.comparisonList.find(e=>e.value==a.c).label}${a.r+1}`,
                      value: 0,
                    })
                  })
                  console.log(comValue)
                  for (var a in comValue) {
                    valueList.forEach(b => {
                      if (b.name == a) {
@@ -1770,88 +1774,11 @@
                  valueList.forEach(b => {
                    str = str.replace(b.name, b.value)
                  })
                  console.log(str)
                  comResult = str
                }
              } catch (error) {
              }
              // comResult = excelFunction.compute(item.v.f.replace(/=/g, ' '),comValue);
              // switch (item.methodName) {
              //   case 'AVERAGE':
              //     let num = 0
              //     for (var a in comValue) {
              //       num += comValue[a]
              //     }
              //     comResult = num / Object.keys(comValue).length
              //     break;
              //   case 'SUM':
              //     let sum = 0
              //     for (var a in comValue) {
              //       sum += comValue[a]
              //     }
              //     comResult = sum
              //     break;
              //   case 'MEDIAN':
              //     let arr = []
              //     for (var a in comValue) {
              //       arr.push(comValue[a])
              //     }
              //     comResult = this.median(arr)
              //     break;
              //   case 'APS':
              //     let arr0 = []
              //     for (var a in comValue) {
              //       arr0.push(comValue[a])
              //     }
              //     comResult = Math.abs(arr0[0])
              //     break;
              //   // case 'MAX':
              //   //   let arr1 = []
              //   //   for (var a in comValue) {
              //   //     arr1.push(eval(comValue[a]))
              //   //   }
              //   //   comResult = Math.max(...arr1)
              //   //   break;
              //   // case 'MIN':
              //   //   let arr2 = []
              //   //   for (var a in comValue) {
              //   //     arr2.push(eval(comValue[a]))
              //   //   }
              //   //   comResult = Math.median(...arr2)
              //   //   break;
              //   default:
              //     let valueList = [];
              //     item.valueList.forEach(a => {
              //       valueList.push({
              //         name: `${this.comparisonList.find(e=>e.value==a.c).label}${a.r+1}`,
              //         value: 0,
              //       })
              //     })
              //     for (var a in comValue) {
              //       valueList.forEach(b => {
              //         if (b.name == a) {
              //           b.value = comValue[a]
              //         }
              //       })
              //     }
              //     let str = item.v.f.replace(/=/g, ' ');
              //     valueList.forEach(b => {
              //       str = str.replace(b.name, b.value)
              //     })
              //     str = str.replaceAll('MAX', 'Math.max')
              //     str = str.replaceAll('MIN', 'Math.min')
              //     str = str.replaceAll(',', ',')
              //     try {
              //       if(this.getInspectionValueType(item.i)==1){
              //         comResult = eval(str)
              //       }else{
              //         comResult = str
              //       }
              //     } catch (error) {
              //     }
              //     break;
              // }
              try {
                list.forEach(a => {
                  if (a[0].r == item.r && comResult !== '') {