licp
2024-07-26 b5196ecfbda5236f3fd3f0213a5e6911d291bda4
src/components/do/b6-device-management/b6-data-acquisition-config.vue
@@ -28,7 +28,7 @@
        <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" fixed="right" label="操作" width="120">
        <el-table-column prop="section" label="操作" width="120">
          <template slot-scope="scope">
            <el-button type="text" @click="dataConfig(scope.row)">数采配置</el-button>
          </template>
@@ -122,6 +122,16 @@
            :value="item.value">
          </el-option>
        </el-select>
         </div>
      <div v-if="configForm.fileType == '.mdb'" class="search_thing" style="margin-bottom: 14px;">
            <div class="search_label">委托字段:</div>
            <el-input size="small" placeholder="请输入" clearable
                  v-model="configForm.mdbEntrustCode"></el-input>
         </div>
      <div v-if="configForm.fileType == '.mdb'" class="search_thing" style="margin-bottom: 14px;">
            <div class="search_label">样品字段:</div>
            <el-input size="small" placeholder="请输入" clearable
                  v-model="configForm.mdbSampleCode"></el-input>
         </div>
      <span slot="footer" class="dialog-footer">
            <el-row>
@@ -217,12 +227,12 @@
                index:7
              },
              {
                name:'inspectionItemSubclass',
                index:12
                name:'formula',
                index:13
              },
              {
                name:'inspectionItemSubclass',
                index:13
                index:14
              }
            ]
            }
@@ -306,13 +316,14 @@
        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)
          this.$set(this.configForm, 'storageUrl', this.tableList[0].storageUrl)
          this.$set(this.configForm, 'ip', this.tableList[0].ip)
          this.$set(this.configForm, 'mdbEntrustCode', this.tableList[0].mdbEntrustCode)
          this.$set(this.configForm, 'mdbSampleCode', this.tableList[0].mdbSampleCode)
        }
        // 一般的合并行
        if (this.spanConfig != undefined && this.spanConfig.rows && this.spanConfig.rows.length >
@@ -348,17 +359,21 @@
        collectUrl: this.configForm.collectUrl,
        storageUrl: this.configForm.storageUrl,
        ip: this.configForm.ip,
        isDevice: true
        isDevice: true,
        mdbEntrustCode: this.configForm.mdbEntrustCode,
        mdbSampleCode: this.configForm.mdbSampleCode
      })
      this.upLoad4 = true
      this.$axios.post(this.$api.deviceScope.saveDataAcquisitionConfiguration + "?deviceId=" + this.deviceId, obj, {headers: {
            'Content-Type': 'application/json'
          }}).then(res => {
        this.tableList = res.data
        this.dialogVisible4 = false
        this.upLoad4 = false
        this.init()
        this.$message.success('操作成功')
            if(res.code == 200) {
              this.tableList = res.data
              this.dialogVisible4 = false
              this.init()
              this.$message.success('操作成功')
            }
            this.upLoad4 = false
      }).catch(err => {
        this.upLoad4 = false
      })