licp
2024-07-11 ef1b406e8112c097d70deb0e23fc9cec1c9a535f
修改bug
已修改4个文件
71 ■■■■■ 文件已修改
src/components/do/b1-ins-order/add.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b1-inspect-order-plan/Inspection.vue 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main.js 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/js/worker.js 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b1-ins-order/add.vue
@@ -2221,7 +2221,9 @@
      handleAll(e) {
        if (e.length > 0) {
          this.productList.map(m => {
            m.state = 1
            if(e.find(a=>a.id == m.id)){
              m.state = 1
            }
            return m
          })
        } else {
src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -278,11 +278,11 @@
          </el-radio-group>
          <el-form :inline="true" :model="otherForm" class="form-inline" label-width="50px" style="padding-top: 0;padding-left: 10px;" v-if="PROJECT=='检测中心'">
            <el-form-item label="温度:" style="margin-bottom: 0;">
              <el-input clearable v-model="otherForm.temperature" size="small" placeholder="" style="width: 100px;" @change="m=>subOtherForm(m,'temperature')"></el-input>
              <el-input v-model="otherForm.temperature" size="small" placeholder="" style="width: 90px;" @change="m=>subOtherForm(m,'temperature')"></el-input>
              <span style="margin-left: 4px;">℃</span>
            </el-form-item>
            <el-form-item label="湿度:" style="margin-bottom: 0;">
              <el-input clearable v-model="otherForm.humidity" size="small" placeholder="" style="width: 100px;" @change="m=>subOtherForm(m,'humidity')"></el-input>
              <el-input v-model="otherForm.humidity" size="small" placeholder="" style="width: 90px;" @change="m=>subOtherForm(m,'humidity')"></el-input>
              <span style="margin-left: 4px;">%</span>
            </el-form-item>
          </el-form>
@@ -517,7 +517,7 @@
          <el-table-column
            prop="comValue"
            align="center"
            label="平均值"
            label="衰减系数"
            min-width="150">
          </el-table-column>
          <el-table-column
@@ -1687,12 +1687,16 @@
          this.result = JSON.parse(event.data);
          switch (this.result.method){
            case 'saveInsContext':
              this.tableList = this.result.value.tableList
              this.param = this.result.value.param
              this.saveInsContext()
              this.$nextTick(()=>{
                this.tableList = this.result.value.tableList
                this.param = this.result.value.param
                this.saveInsContext()
              })
              break;
            case 'tableList':
              this.tableList = this.result.value
              this.$nextTick(()=>{
                this.tableList = this.result.value
              })
              break;
            case 'getCurrentInsProduct':
              this.getCurrentInsProduct(this.result.value)
src/main.js
@@ -15,24 +15,24 @@
Vue.prototype.$Big = Big;
// 项目切换
Vue.prototype.PROJECT = '检测中心'
// Vue.prototype.PROJECT = '装备电缆'
// Vue.prototype.PROJECT = '检测中心'
Vue.prototype.PROJECT = '装备电缆'
//本地
// Vue.prototype.LOCATIONVUE = "http://127.0.0.1:80";
// const javaApi = 'http://127.0.0.1:8001';
// const javaApi = 'http://192.168.47.249:8001';
// const javaApi = 'http://172.20.10.5:8001';
//云
// Vue.prototype.LOCATIONVUE = "http://114.132.189.42:8080";
// const javaApi = 'http://114.132.189.42:1234';
//检测中心正式库
Vue.prototype.LOCATIONVUE = "http://10.1.200.86:8080";
const javaApi = 'http://10.1.200.86:8001';
// Vue.prototype.LOCATIONVUE = "http://10.1.200.86:8080";
// const javaApi = 'http://10.1.200.86:8001';
//装备电缆测试库
// Vue.prototype.LOCATIONVUE = "http://10.16.173.59";
// const javaApi = 'http://10.16.173.59:8001';
Vue.prototype.LOCATIONVUE = "http://10.16.173.59";
const javaApi = 'http://10.16.173.59:8001';
Vue.prototype.HaveJson = (val) => {
    return JSON.parse(JSON.stringify(val))
static/js/worker.js
@@ -71,10 +71,20 @@
          let ask = currentSample.insProduct.find(m => m.id == item.i).ask?currentSample.insProduct.find(m => m.id == item.i).ask.split('&'):null;
          let res = Object.values(comValue)[0]
          let comp = []
          if(res==''||res==null||res==undefined||res=='Infinity'){
            item.v.v = ''
            item.v.v = null
            list.forEach(a => {
              if (a[0].r == item.r) {
                for (let  b=0; b<a.length; b++) {
                  if (a[b].c == item.c) {
                    a[b].v.v = null
                    break
                  }
                }
              }
            })
          }else{
            console.log(ask,res,item.v.f)
            if(ask){
              comp = ask.map((m, i) => {
                if (m.includes('RTS')) {
@@ -131,7 +141,6 @@
                    return handleMoreParam(res,m,'-')
                  }else{
                    let k = m.split('-')
                    console.log(k,eval(res),eval(res) >= eval(handleFraction(k[0])) && eval(res) <= eval(handleFraction(k[1])))
                    return  eval(res) >= eval(handleFraction(k[0])) && eval(res) <= eval(handleFraction(k[1]))
                  }
                }else if(m.includes('±')){
@@ -203,7 +212,6 @@
          if(getInspectionValueType(item.i)==1){
            let ask = currentSample.insProduct.find(m => m.id == item.i).ask?currentSample.insProduct.find(m => m.id == item.i).ask.split('&'):null;
            comResult = compute(item.v.f.replace(/=/g, ' '),comValue)
            console.log(1111,comResult)
            // 装备项目检验值转化
            if (PROJECT === '装备电缆' && ask[0].includes('RTS')) {
              let num2 = new Big(comResult)
@@ -299,10 +307,17 @@
  }
}
/**
 * 处理带有多个参数的函数
 *
 * @param res 字符串,需要被分割并处理的字符串
 * @param str 字符串,与res中的每一项进行比较的字符串,可能是分数或者带有比较符号的字符串
 * @param comp 字符串,表示比较类型的字符(如 '>'、'<'、'='、'≥'、'≤'、'±'、'~'、'-')
 * @returns 返回布尔值,如果res中每一项都满足与str的比较条件,则返回true,否则返回false
 */
function handleMoreParam(res,str,comp){
  let arr = res.split('/')
  let arr0 = arr.every(item=>{
    console.log(comp)
    switch (comp){
      case '>':
        return item > handleFraction(str)
@@ -332,6 +347,11 @@
  }
}
/**
 * 获取参数
 *
 * @returns 返回处理后的参数对象
 */
function getParam(){
  for (var b in param){
    param[b].insValue = []
@@ -669,6 +689,7 @@
  }
}
/**
 * 计算函数
 *
@@ -686,8 +707,6 @@
        if(typeof(comValue[a])=='string'&&comValue[a].includes('^')){
          // 计算幂次
          arr[a] = CalculatePower(comValue[a])
        } else if (typeof(comValue[a])=='string'&&comValue[a].includes('/')) {
          arr[a] = comValue[a].split('/')[0] / comValue[a].split('/')[1];
        } else{
          arr[a] = comValue[a]
        }
@@ -734,6 +753,8 @@
    }
    if(str.includes('&"/"&')){
      return str.replaceAll('&"/"&', '/').replaceAll('//','')
    }else if(str.includes('/')){
      return str
    }else{
      return eval(str)
    }