mark
2022-09-29 715191acb8dd5bccb3f7935c25128a990ed2b5c9
点位信息维护 的样式调整
1个文件已添加
2个文件已修改
66 ■■■■■ 已修改文件
src/views/dataPush/components/point.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dataPush/components/point.scss 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dataPush/components/point.vue 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dataPush/components/point.js
@@ -1,4 +1,5 @@
export const traverse = (arr, newArr = []) => {
  // 递归 遍历数组 满足条件 a.type === "4" push进入新数组 然后弹出新数组
  for (let i = 0; i < arr.length; i++) {
    let a = { ...arr[i] }
    if (a.type === "4") {
src/views/dataPush/components/point.scss
New file
@@ -0,0 +1,14 @@
.btns {
  .el-switch__core {
    border-radius: 16px;
    height: 32px;
  }
  .el-switch__core::after {
    height: 30px;
    width: 30px;
    margin-top: -1px;
  }
  .el-switch.is-checked .el-switch__core::after {
    margin-left: -31px;
  }
}
src/views/dataPush/components/point.vue
@@ -19,7 +19,13 @@
        <span>添加点位</span>
      </div>
      <div class="switchBox">
        <el-switch v-model="value1" @change="changeAll($event)" active-text="总点位开" inactive-text="总点位关">
        <el-switch
          v-model="value1"
          width="60"
          @change="changeAll($event)"
          active-text="总点位开"
          inactive-text="总点位关"
        >
        </el-switch>
      </div>
    </div>
@@ -32,9 +38,9 @@
        :fit="true"
        :default-sort="{ prop: 'createTime', order: 'descending' }"
      >
        <el-table-column prop="cameraName" label="点位名称" show-overflow-tooltip></el-table-column>
        <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="企业编码" 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="updatedAt" label="推送时间" width="100px" show-overflow-tooltip>
          <template slot-scope="scope">{{ scope.row.startTime }}-{{ scope.row.endTime }}</template>
@@ -135,7 +141,7 @@
      </el-form-item>
    </el-form>
    <div class="right">
      <div class="button searchBtn" @click="saveUser">保存</div>
      <div class="button searchBtn" @click="save">保存</div>
      <div class="button resetBtn" @click="resetUser">重置</div>
      <div class="button resetBtn" style="margin-left:20px" @click="goback">返回</div>
    </div>
@@ -147,7 +153,7 @@
import { traverse } from "./point"
import { getClusterDevList } from "@/api/clusterManage"
import { camerasList, camerasCreate, camerasConfig, camerasSwitch, camerasUpdate, camerasDelete } from "@/api/report"
import "./point.scss"
export default {
  data() {
    return {
@@ -218,9 +224,7 @@
        updatedAt: "",
        id: ""
      },
      dataList: [],
      tip: 1, // 区分保存还是编辑 但是现在没有编辑
      rules: {
        CameraName: [{ required: true, message: "请选择设备名称", trigger: "change" }],
@@ -244,8 +248,6 @@
    this.aaaaa()
  },
  // const rsp: any = await getLocalCameraTree(params)
  // console.log(rsp, "rsp")
  methods: {
    async changeAll(val) {
      console.log(val)
@@ -305,13 +307,16 @@
      this.ruleForm.id = row.id
    },
    async aaaaa() {
      // 进入页面前的初始化
      let res = await camerasConfig()
      // 总开关
      if (res && res.success) {
        res.data.enable === 0 ? (this.value1 = false) : (this.value1 = true)
        console.log(this.value1)
      }
      let clusterId = ""
      let clusterReq = await getClusterDevList()
      // 查询
      if (clusterReq && clusterReq.success) {
        if (clusterReq.data.clusterList.length > 0) {
          clusterId = clusterReq.data.clusterList[0].cluster_id
@@ -319,6 +324,7 @@
      }
      console.log(clusterId)
      let camereReq = await getLocalCameraTree({ clusterId: clusterId })
      // 这个是 添加时的点位 是从摄像机页面 来的
      let array = []
      this.cameraOptions = traverse(camereReq.data.treeMenu, array)
    },
@@ -327,10 +333,11 @@
      this.tip = 1
      this.resetUser()
    }, //y
    saveUser() {
    save() {
      this.$refs["ruleForm"].validate((valid) => {
        if (valid) {
          if (this.tip !== 1) {
            // tip1 是添加 其他是编辑
            let obj = this.cameraOptions.find((item) => item.name === this.ruleForm.CameraName)
            console.log(obj, "dddddddd")
            let params = {
@@ -458,16 +465,6 @@
//
</style>
<style scoped lang="scss">
::deep .el-switch {
  color: #f52323;
  .el-switch__core {
    height: 32px !important;
  }
  .el-switch__core::after {
    height: 30px !important;
    width: 30px !important;
  }
}
.sub-account {
  padding: 20px;
  .head-name {
@@ -628,13 +625,14 @@
  }
  .btns {
    display: flex;
    margin: 20px 0;
    text-align: center;
    justify-content: space-between;
    .switchBox {
      display: flex;
      align-items: center;
    }
    display: flex;
    margin: 20px 0;
    text-align: center;
    .add {
      margin-right: 20px;
      width: 126px;
@@ -764,6 +762,13 @@
</style>
<style>
/* .el-switch__core {
  height: 32px !important;
}
.el-switch__core::after {
  height: 30px !important;
  width: 30px !important;
} */
.el-date-table td.start-date span,
.el-date-table td.end-date span {
  background-color: #0065ff;