licp
2024-07-23 f3fa8866591600d5791d78c99396f4553f169aef
Merge branch 'master' of http://114.132.189.42:9002/r/center-lims-before into master
已修改5个文件
已添加1个文件
255 ■■■■ 文件已修改
src/components/do/b1-material-ins-order/customs-inspection.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b6-device-management/b6-data-acquisition-config.vue 168 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/tool/formula.vue 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/a6-device-management.vue 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/view/index.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/js/menu.js 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b1-material-ins-order/customs-inspection.vue
@@ -159,7 +159,7 @@
        </div>
      </div>
      <el-table class="el-table sampleTable" ref="sampleTable" :data="sampleList" height="250px" tooltip-effect="dark"
                border @selection-change="selectSample" highlight-current-row @row-click="rowClick" style="margin-top: 10px;">
                border @selection-change="selectSample" highlight-current-row @row-click="rowClick" style="margin-bottom: 10px;">
        <el-table-column type="selection" width="60" :selectable="selectable" v-if="active==1"></el-table-column>
        <el-table-column type="index" label="序号" width="65" align="center"></el-table-column>
        <el-table-column prop="sample" label="样品名称" align="center" min-width="100">
src/components/do/b6-device-management/b6-data-acquisition-config.vue
@@ -13,7 +13,7 @@
    </div>
    <div class="table">
      <el-table :data="tableList.slice((page.current - 1) * page.size, page.current * page.size)"
                border tooltip-effect="dark" style="width: 100%;" height="100%">
                border tooltip-effect="dark" style="width: 100%;" height="100%" :span-method="spanMethod">
        <el-table-column type="index" label="序号" align="center" width="65"></el-table-column>
        <el-table-column prop="deviceName" align="center" min-width="100" label="设备名称"></el-table-column>
        <el-table-column prop="fileType" align="center" label="文件后缀"></el-table-column>
@@ -81,9 +81,10 @@
            <el-button @click="addDomain" size="small" type="primary" style="position: absolute; bottom: -65px;left: 62px" v-if="index === domains.length-1">新增域名</el-button>
          </el-form-item>
        </div>
        <div class="fomItem1">
          <el-form-item class="fomItemInput" label="公式:">
            <el-input v-model="configForm.formula" @change="evalResult"></el-input>
        <div class="fomItem2">
          <el-form-item class="fomItemInput1" label="公式:">
            <!-- <formula :returnFormula="evalResult"/> -->
            <el-input type="textarea" autosi:autosize="{ minRows: 2, maxRows: 4}"ze placeholder="请输入内容" v-model="configForm.formula" @change="evalResult"> </el-input>
          </el-form-item>
        </div>
      </el-form>
@@ -132,10 +133,13 @@
</template>
<script>
import formula from '../../tool/formula.vue'
export default {
  name: "dataAcquisitionConfig",
  // import å¼•入的组件需要注入到对象中才能使用
  components: {},
  components: {
    formula
  },
  props: {
    deviceId: {
      type: Number,
@@ -176,11 +180,116 @@
        {label: 'excel', value: '.xlsx'},
        {label: 'txt', value: '.txt'},
        {label: 'png', value: '.png'},
      ],
      spanList: [],
      specialSpanList: [],
      spanConfig: {
            special: {
              main: "inspectionItemSubClass",
              rows:[
              {
                name:'deviceName',
                index:1
              },
              {
                name:'fileType',
                index:2
              },
              {
                name:'collectUrl',
                index:3
              },
              {
                name:'storageUrl',
                index:4
              },
              {
                name:'ip',
                index:5
              },
              {
                name:'inspectionItem',
                index:6
              },
              {
                name:'inspectionItemSubClass',
                index:7
              },
              {
                name:'inspectionItemSubClass',
                index:12
              },
              {
                name:'inspectionItemSubClass',
                index:13
              }
      ]
            }
      },
      deleteList: []
    }
  },
  // æ–¹æ³•集合
  methods: {
    rowspan(spanArr, position, spanName) {
        this.tableList.forEach((item, index) => {
          if (index === 0) {
            spanArr.push(1);
            position = 0;
          } else {
            if (
              this.tableList[index][spanName] ===
              this.tableList[index - 1][spanName]
            ) {
              spanArr[position] += 1;
              spanArr.push(0);
            } else {
              spanArr.push(1);
              position = index;
            }
          }
        });
      },
    spanMethod({
        row,
        column,
        rowIndex,
        columnIndex
      }) {
        // ä¸€èˆ¬çš„合并行
        if (this.spanConfig != undefined && this.spanConfig.rows && this.spanConfig.rows.length > 0) {
          let i = null;
          let obj = this.spanConfig.rows.find((item, index) => {
            i = index;
            return item.index == columnIndex
          })
          if (obj) {
            const _row = this.spanList[i].arr[rowIndex];
            const _col = _row > 0 ? 1 : 0;
            return {
              rowspan: _row,
              colspan: _col,
            };
          }
        }
        // ç‰¹æ®Šçš„合并行
        if (this.spanConfig != undefined && this.spanConfig.special && this.spanConfig.special.main &&
          this.spanConfig.special.rows && this.spanConfig.special.rows.length > 0) {
          let i = null;
          let obj = this.spanConfig.special.rows.find((item, index) => {
            i = index;
            return item.index == columnIndex
          })
          if (obj) {
            const _row = this.specialSpanList[i].arr[rowIndex];
            const _col = _row > 0 ? 1 : 0;
            return {
              rowspan: _row,
              colspan: _col,
            };
          }
        }
      },
    fileConfiguration() {
      this.dialogVisible4 = true
      if(this.tableList[0]) {
@@ -199,6 +308,31 @@
          this.$set(this.configForm, 'collectUrl', this.tableList[0].collectUrl)
          this.$set(this.configForm, 'storageUrl', this.tableList[0].storageUrl)
          this.$set(this.configForm, 'ip', this.tableList[0].ip)
        }
        // ä¸€èˆ¬çš„合并行
        if (this.spanConfig != undefined && this.spanConfig.rows && this.spanConfig.rows.length >
            0) {
            this.spanList = [];
            this.spanConfig.rows.forEach((item, index) => {
              this.spanList.push({
                arr: [],
                position: 0
              })
              this.rowspan(this.spanList[index].arr, this.spanList[index].position, item.name);
            })
          }
          // ç‰¹æ®Šçš„合并行
          if (this.spanConfig != undefined && this.spanConfig.special && this.spanConfig.special
            .main && this.spanConfig.special.rows && this.spanConfig.special.rows.length > 0) {
            this.specialSpanList = []
            this.spanConfig.special.rows.forEach((item, index) => {
              this.specialSpanList.push({
                arr: [],
                position: 0
              })
              this.rowspan(this.specialSpanList[index].arr, this.specialSpanList[index].position, this
                .spanConfig.special.main);
            })
        }
      })
    },
@@ -280,6 +414,13 @@
                id: ''
              }
            ]
            if(this.deleteList.length > 0) {
              this.$axios.delete(this.$api.deviceScope.deleteDataAcquisitionConfiguration + "?ids=" + this.deleteList.join()).then(res => {
                if(res.code == 200) {
                  this.init()
                }
              })
            }
            this.init()
            this.$message.success('添加成功')
          })
@@ -293,11 +434,8 @@
      const index = this.domains.indexOf(item)
      if (index !== -1 && this.domains.length > 1) {
        if(item.id){
            this.$axios.delete(this.$api.deviceScope.deleteDataAcquisitionConfiguration + "?id=" + item.id).then(res => {
            if(res.code == 200) {
          this.deleteList.push(item.id)
              this.domains.splice(index, 1)
            }
          })
        } else {
          this.domains.splice(index, 1)
        }
@@ -315,7 +453,8 @@
        id: ''
      });
    },
    evalResult () {
    evalResult (val) {
      this.configForm.formula = val
      // æ ¹æ®å…¬å¼è®¡ç®—出结果
    },
    sizeChange(val) {
@@ -325,6 +464,7 @@
      this.page.current = val
    },
    closeForm () {
      this.deleteList = []
      this.domains = [{
        referx: '',
        refery: '',
@@ -377,10 +517,18 @@
  display: flex;
  height: 74px;
}
.fomItem2 {
  display: flex;
  width: 100%;
}
.fomItemInput {
  width: 180px;
  margin-right: 6px;
}
.fomItemInput1 {
  width: 100%;
  margin-right: 6px;
}
>>>.el-form-item__label {
  padding-bottom: 0 !important;
}
src/components/tool/formula.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,39 @@
<template>
  <div>
    <el-input
      type="textarea"
      :autosize="{ minRows: 2, maxRows: 4 }"
      placeholder="请输入内容"
      v-model="formula"
      @change="evalResult"
      @input="inputValue"
    >
    </el-input>
  </div>
</template>
<script>
export default {
    props: {
        returnFormula: {
            type: Function,
            default: () => {return Function}
        }
    },
  data() {
    return {
        formula: ""
    };
  },
  methods: {
    // å›žæ˜¾
    evalResult() {
        this.returnFormula(this.formula)
    },
    inputValue(val) {
        let lastChar2 = val.slice(-1);
    }
  }
};
</script>
src/components/view/a6-device-management.vue
@@ -225,20 +225,6 @@
                                </el-upload>
                            </div>
                        </el-form-item>
        <el-form-item label="检测的文件类型:">
            <el-select :disabled="isUp" v-model="formData.fileType" placeholder="请选择文件类型" clearable>
              <el-option v-for="item in fileTypeOptions"
                         :key="item.value"
                         :label="item.label"
                         :value="item.value"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="采集地址:" clearable>
            <el-input :disabled="isUp" v-model="formData.collectUrl"></el-input>
          </el-form-item>
          <el-form-item label="储存地址:">
            <el-input :disabled="isUp" v-model="formData.storageUrl"></el-input>
          </el-form-item>
                    </el-form>
                </el-col>
            </el-row>
@@ -381,20 +367,6 @@
                                    <el-button type="text" style="height:30px;padding-top:8px">上传</el-button>
                                </el-upload>
                            </div>
                        </el-form-item>
                        <el-form-item label="检测的文件类型:">
            <el-select v-model="formData.fileType" placeholder="请选择文件类型" clearable>
              <el-option v-for="item in fileTypeOptions"
                         :key="item.value"
                         :label="item.label"
                         :value="item.value"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="采集地址:" clearable>
            <el-input v-model="formData.collectUrl"></el-input>
          </el-form-item>
          <el-form-item label="储存地址:">
            <el-input v-model="formData.storageUrl"></el-input>
          </el-form-item>
                    </el-form>
                </el-col>
src/view/index.vue
@@ -435,6 +435,15 @@
        },
        created() {
            this.menu = menus.menu
      if (this.PROJECT !== '装备电缆') { // æ£€æµ‹ä¸­å¿ƒæš‚æ— '原材料检验下单'功能
        const index = this.menu.findIndex(item => item.v === '业务管理')
        if (index > -1) {
          const index2 = this.menu[index].c.findIndex(obj => obj.v === '原材料检验下单')
          if (index2 > -1) {
            this.menu[index].c.splice(index2, 1)
          }
        }
      }
        },
        mounted() {
            this.userName = JSON.parse(localStorage.getItem("user")).name;
static/js/menu.js
@@ -14,7 +14,14 @@
        v: "业务管理",
        i: "font icon-kexueyanjiuheshiyankaifa",
        p: "selectInsOrderParameter selectInsOrderPlanList pageInsReport costStatistics selectWarehouse",
        c: [{
        c: [
      {
        v: "原材料检验下单",
        i: "font icon-erjidaohang",
        u: "b1-material-inspection-order",
        p: "selectInsOrderParameter"
      },
      {
            v: "检验下单",
            i: "font icon-erjidaohang",
            u: "b1-inspection-order",