fei.wang
2025-04-18 11f6acee504c77a8919a4e0ddfe3e70a746e3522
src/views/equipment/monitoring.vue
@@ -40,8 +40,13 @@
      <el-table-column label="状态" width="80">
        <template slot-scope="scope">
                            <span v-if="scope.row.onlie == '1'"><img src="../../assets/images/online6.png"></span>
                            <span v-else-if="scope.row.onlie == '0'"><img src="../../assets/images/offline4.png"></span>
                            <!-- <span v-if="scope.row.onlie == '1'"><img src="../../assets/images/online6.png"></span>
                            <span v-else-if="scope.row.onlie == '0'"><img src="../../assets/images/offline4.png"></span> -->
                            <span v-if="scope.row.onlie == '1'">在线</span>
                            <span v-else-if="scope.row.onlie == '0'">离线</span>
                            <span v-else-if="scope.row.onlie == '4'">高精度</span>
                            <span v-else-if="scope.row.onlie == '6'">超阈值告警</span>
                            <span v-else-if="scope.row.onlie == '7'">非高精度告警</span>
                        </template>
        
      </el-table-column>
@@ -139,7 +144,7 @@
          <el-input v-model="temp.anchorname
        " placeholder="请输入名称" />
        </el-form-item>
        <el-form-item label="公司" prop="companyid">
        <el-form-item label="公司" prop="company">
          <el-select style="width: 100%;" v-model="temp.company" filterable remote placeholder="请选择公司"
            :remote-method="searchMethod" :loading="searchloading">
            <el-option v-for="item in options" :key="item.id" :label="item.companyname" :value="item.id">
@@ -147,8 +152,13 @@
          </el-select>
        </el-form-item>
        <el-form-item label="基准" prop="needbaseid">
          <el-input v-model="temp.needbaseid
        " placeholder="请输入基准" />
          <!-- <el-input v-model="temp.needbaseid
        " placeholder="请输入基准" /> -->
        <el-select style="width: 100%;" v-model="temp.needbaseid" filterable remote placeholder="请选择公司"
            :remote-method="jzsearchMethod" :loading="searchloading">
            <el-option v-for="item in jzoptions" :key="item.tagid" :label="item.tagid" :value="item.tagid">
            </el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <div class="text-right">
@@ -165,7 +175,7 @@
<script>
import Pagination from '@/components/Pagination'
import { getList, delEquipment, addorupEquipment, searchEquipment, search,addSystemOperationLog } from '@/api/equipment'
import { getList, delEquipment, addorupEquipment, searchEquipment, search,addSystemOperationLog,searchfive,jzsearchfive,jzsearch } from '@/api/equipment'
import { deepClone } from '@/utils'
const _temp = {
@@ -204,6 +214,7 @@
      dialogType: 'create',
      loading: false,
      value: '',
      jzoptions:[],
      options: [],
      searchloading: false,
      rules: {
@@ -239,12 +250,61 @@
        this.options = [];
      }
    },
    // 远程搜索
    searchMethodfive(query) {
      if (query !== '') {
        this.loading = true;
        // var params = { query: query }
        searchfive().then(response => {
          this.options = response.data;
          this.loading = false;
        })
      } else {
        this.options = [];
      }
    },
      // 远程搜索
      jzsearchMethod(query) {
      if (query !== '') {
        this.loading = true;
        var params = { type: '0' }
        jzsearch(params).then(response => {
          this.jzoptions = response.data;
          this.loading = false;
        })
      } else {
        this.jzoptions = [];
      }
    },
    // 远程搜索
    jzsearchMethodfive() {
        this.loading = true;
         var params = { type: '0' }
        jzsearchfive(params).then(response => {
          this.jzoptions = response.data;
          this.loading = false;
        })
    },
    // 搜索
    search() {
      this.listLoading = true
      searchEquipment(this.listQuery).then(response => {
        this.list = response.data.records
        this.total = response.data.total
        if (response.data!=null) {
          this.list = response.data.records
          this.total = response.data.total
        }else{
          this.$message({
            message: '未搜索到数据',
            type: 'error'
          })
        }
        this.listLoading = false
      })
    },
@@ -269,6 +329,8 @@
        this.total = response.data.total
        this.listLoading = false
      })
      this.searchMethodfive();
      this.jzsearchMethodfive();
    },
    resetTemp() {
      this.temp = Object.assign({}, _temp)
@@ -287,6 +349,7 @@
      this.dialogVisible = true
      this.dialogType = 'modify'
      this.temp = deepClone(scope.row)
      // this.temp.companyid = scope.row.companyid
      this.disabled=true
      // this.$nextTick(() => {
      //   this.$refs['dataForm'].clearValidate()
@@ -313,7 +376,7 @@
          this.list.splice(scope.$index, 1)
          delEquipment(params).then(response => {
            this.temp.adminname = localStorage.getItem('username') || '';
            const params = { name:  this.temp.adminname, content: '删除了一个基准站,该编号为:'+scope.row.tagid };
            const params = { name:  this.temp.adminname, content: '删除了一个监测站,该编号为:'+scope.row.tagid };
            addSystemOperationLog(params).then(response => {
                        })
@@ -327,23 +390,27 @@
      })
    },
    submit(formName) {
      if ( this.dialogType != 'modify') {
        this.temp.companyid=this.temp.company
      }
      if (this.loading) {
        return
      }
      this.temp.companyid=this.temp.company
      this.$refs[this.temp].validate((valid) => {
          if (valid) {
            this.loading = true
      addorupEquipment(this.temp).then(() => {
        if (this.temp.id=="") {
          this.temp.adminname = localStorage.getItem('username') || '';
            const params = { name:  this.temp.adminname, content: '新增了一个基准站,该编号为:'+this.temp.tagid };
            const params = { name:  this.temp.adminname, content: '新增了一个监测站,该编号为:'+this.temp.tagid };
            addSystemOperationLog(params).then(response => {
                        })
        } else {
          this.temp.adminname = localStorage.getItem('username') || '';
            const params = { name:  this.temp.adminname, content: '修改了一个基准站,该编号为:'+this.temp.tagid };
            const params = { name:  this.temp.adminname, content: '修改了一个监测站,该编号为:'+this.temp.tagid };
            addSystemOperationLog(params).then(response => {
                        })