zhangzengfei
2022-10-11 ba2c435355a217ad20e41be3d30eb7ab3eef49ba
数据上报企业编码添加名称显示
3个文件已修改
135 ■■■■ 已修改文件
src/views/dataPush/components/dataPush.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dataPush/components/device.vue 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dataPush/components/point.vue 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dataPush/components/dataPush.vue
@@ -37,7 +37,7 @@
  mounted() {},
  methods: {
    handleClick(tab, event) {
      console.log(tab, event, this.activeName)
      // console.log(tab, event, this.activeName)
    }
  }
}
src/views/dataPush/components/device.vue
@@ -22,8 +22,9 @@
    <div class="table-area">
      <el-table
        id="multipleTable"
        ref="multipleTable"
        v-loading="tbLoading"
        id="devTable"
        ref="devTable"
        :data="dataList"
        :fit="true"
        :default-sort="{ prop: 'devCode', order: 'ascending' }"
@@ -32,7 +33,11 @@
        <!-- <el-table-column prop="devId" label="设备ID" show-overflow-tooltip></el-table-column> -->
        <el-table-column prop="devIp" label="设备IP" show-overflow-tooltip></el-table-column>
        <el-table-column prop="devCode" label="设备编码" show-overflow-tooltip></el-table-column>
        <el-table-column prop="companyCode" label="企业编码" show-overflow-tooltip></el-table-column>
        <el-table-column label="企业编码" show-overflow-tooltip>
          <template slot-scope="scope">
            {{ scope.row.companyCode | fillCompanyCode(companyCodeOptions) }}
          </template>
        </el-table-column>
        <el-table-column prop="state" label="状态" show-overflow-tooltip>
          <template slot-scope="scope">
            <div v-if="scope.row.state == 0" class="status">离线</div>
@@ -88,7 +93,7 @@
        <el-input v-model="ruleForm.devCode" placeholder="请输入设备编码" style="width: 350px"></el-input>
      </el-form-item>
      <el-form-item label="企业编码" prop="companyCode">
        <el-input v-model="ruleForm.companyCode" placeholder="请输入企业编码" style="width: 350px"></el-input>
        <el-input v-model="ruleForm.companyCode" placeholder="请输入企业编码" style="width: 350px"> </el-input>
      </el-form-item>
    </el-form>
    <div class="right">
@@ -103,13 +108,38 @@
import { getDevicesList, devicesCreate, devicesUpdate, devicesDelete } from "@/api/report"
export default {
  filters: {
    fillCompanyCode(key, opts) {
      let obj = opts.find((t) => t.value == key)
      return obj ? obj.lable : key
    }
  },
  data() {
    return {
      tbLoading: false,
      query: {},
      inputText: "", //输入框内容
      isShowAdd: false, //是否展示新增弹窗
      dataList: [],
      tip: 1,
      companyCodeOptions: [
        {
          value: "370300010",
          lable: "370300010/汇丰"
        },
        {
          value: "370300450",
          lable: "370300450/海益"
        },
        {
          value: "370300440",
          lable: "370300440/金汇丰"
        },
        {
          value: "370300480",
          lable: "370300480/中汇"
        }
      ],
      ruleForm: {
        //y
        devName: "",
@@ -145,6 +175,7 @@
  mounted() {},
  methods: {
    async fetchDevicesList(val) {
      this.tbLoading = true
      if (val === 1) {
        let query = { pageIndex: this.page, pageSize: this.size, keyword: this.inputText }
        this.query = query
@@ -156,6 +187,9 @@
        this.dataList = res.data
        this.total = res.total
      }
      setTimeout(() => {
        this.tbLoading = false
      }, 200)
    },
    delUser(row) {
      console.log(row, "row")
@@ -177,12 +211,12 @@
    //分页功能
    handleSizeChange(size) {
      this.size = size
      this.fetchDevicesList()
      this.fetchDevicesList(1)
    },
    //分页功能
    refrash(page) {
      this.page = page
      this.fetchDevicesList()
      this.fetchDevicesList(1)
    },
    addDevice() {
src/views/dataPush/components/point.vue
@@ -19,27 +19,35 @@
      </div>
    </div>
    <div class="switchBox">
      开启上报
      <el-table-column prop="Enable" label="开关" width="70px" show-overflow-tooltip>
        <el-switch v-model="value1" active-color="#0065ff" @change="changeAll($event)"> </el-switch>
      </el-table-column>
      <span style="margin-right:10px">开启上报</span>
      <el-switch v-model="value1" active-color="#0065ff" @change="changeAll($event)"> </el-switch>
    </div>
    <div class="table-area">
      <el-table
        id="multipleTable"
        ref="multipleTable"
        v-loading="tbLoading"
        id="pointTable"
        ref="pointTable"
        :data="dataList"
        :fit="true"
        :default-sort="{ prop: 'companyCode', order: 'ascending' }"
      >
        <el-table-column prop="cameraName" label="点位名称" width="130px" show-overflow-tooltip></el-table-column>
        <el-table-column prop="channelCode" label="报警通道编码" show-overflow-tooltip></el-table-column>
        <el-table-column prop="companyCode" label="企业编码" width="130px" show-overflow-tooltip></el-table-column>
        <el-table-column prop="scenes" label="推送场景" show-overflow-tooltip></el-table-column>
        <el-table-column
          prop="channelCode"
          label="报警通道编码"
          min-width="250px"
          show-overflow-tooltip
        ></el-table-column>
        <el-table-column prop="companyCode" label="企业编码" width="150px" show-overflow-tooltip>
          <template slot-scope="scope">
            {{ scope.row.companyCode | fillCompanyCode(companyCodeOptions) }}
          </template>
        </el-table-column>
        <el-table-column prop="scenes" label="推送场景" min-width="100px" show-overflow-tooltip></el-table-column>
        <el-table-column prop="updatedAt" label="推送时间" width="100px" show-overflow-tooltip>
          <template slot-scope="scope">{{ scope.row.startTime }}-{{ scope.row.endTime }}</template>
        </el-table-column>
        <el-table-column prop="Enable" label="开关" width="70px" show-overflow-tooltip>
        <el-table-column prop="Enable" label="开关" width="60px" show-overflow-tooltip>
          <template slot-scope="scope">
            <el-switch v-model="scope.row.enable" @change="changeSwitch($event, scope.row)" active-color="#0065ff">
            </el-switch>
@@ -86,7 +94,10 @@
        <el-input v-model="ruleForm.ChannelCode" placeholder="请输入报警通道编码" style="width: 350px"></el-input>
      </el-form-item>
      <el-form-item label="企业编码" prop="CompanyCode">
        <el-input v-model="ruleForm.CompanyCode" placeholder="请输入企业编码" style="width: 350px"></el-input>
        <el-select style="width: 350px" v-model="ruleForm.CompanyCode" placeholder="请选择">
          <el-option v-for="item in companyCodeOptions" :key="item.value" :label="item.label" :value="item.value">
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="推送场景" prop="Sceneslist">
        <el-select multiple style="width: 350px" v-model="ruleForm.Sceneslist" filterable placeholder="请选择">
@@ -145,8 +156,15 @@
import "./point/point.scss"
export default {
  filters: {
    fillCompanyCode(key, opts) {
      let obj = opts.find((t) => t.value == key)
      return obj ? obj.label : key
    }
  },
  data() {
    return {
      tbLoading: false,
      activeColor: "",
      inactiveColor: "#f0f3f5",
      value1: false,
@@ -227,24 +245,28 @@
        EndTime: [{ type: "string", required: true, message: "请选择结束时间", trigger: "change" }]
      },
      page: 1,
      size: 10, //分页相关
      total: 0 //总数,
      size: 20, //分页相关
      total: 0, //总数
      companyCodeOptions: [
        {
          value: "370300010",
          label: "370300010/汇丰"
        },
        {
          value: "370300450",
          label: "370300450/海益"
        },
        {
          value: "370300440",
          label: "370300440/金汇丰"
        },
        {
          value: "370300480",
          label: "370300480/中汇"
        }
      ]
    }
  },
  // computed: {
  //   // activeColor() {
  //   //   return this.value1 ? "#13ce66" : "#f0f3f5"
  //   // }
  // },
  // watch: {
  //   value1: {
  //     handler(newVal, oldVal) {
  //       console.log(newVal, oldVal, "newVal, oldVal")
  //       newVal ? (this.activeColor = "#13ce66") : (this.activeColor = "#f0f3f5")
  //     },
  //     deep: true
  //   }
  // },
  async created() {
    let query = { pageIndex: this.page, pageSize: this.size, keyword: this.inputText }
    this.query = query
@@ -264,7 +286,7 @@
          type: "success",
          message: "成功!"
        })
        this.checkCamerasList()
        // this.checkCamerasList()
      }
    },
    changeSwitch(val, row) {
@@ -396,12 +418,12 @@
    },
    handleSizeChange(size) {
      this.size = size
      this.checkCamerasList()
      this.checkCamerasList(1)
    },
    //分页功能
    refrash(page) {
      this.page = page
      this.checkCamerasList()
      this.checkCamerasList(1)
    },
    delCameras(row) {
      this.$confirm("确认要删除该点位吗, 是否继续?", "提示", {
@@ -420,6 +442,7 @@
      })
    },
    async checkCamerasList(val) {
      this.tbLoading = true
      if (val === 1) {
        let query = { pageIndex: this.page, pageSize: this.size, keyword: this.inputText }
        this.query = query
@@ -431,6 +454,10 @@
        this.dataList = res.data
        this.total = res.total
      }
      setTimeout(() => {
        this.tbLoading = false
      }, 300)
    },
    resetUser() {
      // this.ruleForm. = {