licp
2024-07-25 edb0c23348c9b705d5be9298ed2cbbd0f103e2be
src/components/do/b6-device-management/b6-data-acquisition-config.vue
@@ -19,15 +19,16 @@
        <el-table-column prop="fileType" align="center" label="文件后缀"></el-table-column>
        <el-table-column prop="collectUrl" align="center" min-width="100" show-overflow-tooltip label="采集地址"></el-table-column>
        <el-table-column prop="storageUrl" align="center" min-width="100" show-overflow-tooltip label="存储地址"></el-table-column>
        <el-table-column prop="ip" align="center" label="IP地址"></el-table-column>
        <el-table-column prop="ip" align="center" label="IP地址" min-width="100"></el-table-column>
        <el-table-column prop="sample" align="center" label="检验对象" show-overflow-tooltip min-width="150"></el-table-column>
        <el-table-column prop="inspectionItem" align="center" label="检验项" min-width="100"></el-table-column>
        <el-table-column prop="inspectionItemSubClass" align="center" label="检验项子项" min-width="100"></el-table-column>
        <el-table-column prop="referx" align="center" label="参照X"></el-table-column>
        <el-table-column prop="inspectionItemSubclass" align="center" label="检验项子项" min-width="100"></el-table-column>
        <el-table-column prop="referx" align="center" label="参照X" min-width="100"></el-table-column>
        <el-table-column prop="x" align="center" label="X"></el-table-column>
        <el-table-column prop="refery" align="center" label="参照Y"></el-table-column>
        <el-table-column prop="refery" align="center" label="参照Y" min-width="100"></el-table-column>
        <el-table-column prop="y" align="center" label="Y"></el-table-column>
        <el-table-column prop="formula" align="center" label="公式"></el-table-column>
        <el-table-column prop="section" label="操作" width="120">
        <el-table-column prop="section" fixed="right" label="操作" width="120">
          <template slot-scope="scope">
            <el-button type="text" @click="dataConfig(scope.row)">数采配置</el-button>
          </template>
@@ -185,7 +186,7 @@
      specialSpanList: [],
      spanConfig: {
            special: {
              main: "inspectionItemSubClass",
              main: "inspectionItemSubclass",
              rows:[
              {
                name:'deviceName',
@@ -212,15 +213,15 @@
                index:6
              },
              {
                name:'inspectionItemSubClass',
                name:'inspectionItemSubclass',
                index:7
              },
              {
                name:'inspectionItemSubClass',
                name:'inspectionItemSubclass',
                index:12
              },
              {
                name:'inspectionItemSubClass',
                name:'inspectionItemSubclass',
                index:13
              }
            ]
@@ -300,9 +301,13 @@
        }
    },
    init() {
      this.tableList = []
      // this.tableList = []
      this.$axios.get(this.$api.deviceScope.queryDataAcquisitionConfiguration + "?deviceId=" + this.deviceId + "&isDevice=" + false).then(res => {
        this.tableList = res.data
        this.tableList.forEach(i => {
          i.sample = i.sample.replaceAll('"', '').replaceAll("],", ';').replaceAll("[", '').replaceAll('"', '').replaceAll(']', '')
          console.log(`output->i.sample`,i.sample)
        })
        if(this.tableList[0]) {
          this.$set(this.configForm, 'fileType', this.tableList[0].fileType)
          this.$set(this.configForm, 'collectUrl', this.tableList[0].collectUrl)
@@ -361,10 +366,15 @@
    dataConfig (row) {
      this.configForm = {
        deviceId: row.deviceId,
        insProductItem: row.inspectionItemSubClass.trim()
        inspectionItem: row.inspectionItem.trim(),
        inspectionItemSubclass: row.inspectionItemSubclass,
        structureItemParameterId: row.structureItemParameterId
      }
      this.dialogVisible3 = true
      this.$axios.get(this.$api.deviceScope.queryDataAcquisitionConfiguration + "?deviceId=" + this.deviceId + "&insProductItem=" + row.inspectionItemSubClass.trim()  + "&isDevice=" + true).then(res => {
      this.$axios.get(this.$api.deviceScope.queryDataAcquisitionConfiguration + "?deviceId=" + this.deviceId +
      "&inspectionItem=" + row.inspectionItem.trim() +
      "&isDevice=" + true +
      "&inspectionItemSubclass=" + row.inspectionItemSubclass.trim()).then(res => {
        const data = res.data
        if(data[0]) {
          this.domains.splice(0, 1)
@@ -399,7 +409,9 @@
            }
            i.formula = this.configForm.formula
            i.deviceId = this.deviceId
            i.insProductItem = this.configForm.insProductItem
            i.inspectionItem = this.configForm.inspectionItem
            i.inspectionItemSubclass = this.configForm.inspectionItemSubclass
            i.structureItemParameterId = this.configForm.structureItemParameterId
          })
          this.$axios.post(this.$api.deviceScope.saveDataAcquisitionConfiguration + "?deviceId=" + this.deviceId, {dataConfigList: this.domains, isDevice: false},{headers: {
            'Content-Type': 'application/json'