南昌市物联网技防平台-前端
shuishen
2021-01-30 0d2844b5ea6c0e1243d6237d99bbec052a4852ea
Merge branch 'master' of http://192.168.0.105:10010/r/jfpt-Vue
1 files modified
327 ■■■■ changed files
src/page/index/logo.vue 327 ●●●● patch | view | raw | blame | history
src/page/index/logo.vue
@@ -116,188 +116,189 @@
</template>
<script>
import { mapGetters } from "vuex";
export default {
  name: "logo",
  data() {
    return {
      dialogTableVisible:false,
      deviceId:null,
      form: {},
    };
  },
  created() {
    this.getData();
  },
  computed: {
    ...mapGetters(["website", "keyCollapse"])
  },
  methods: {
    getData() {
      var that = this;
  import { mapGetters } from "vuex";
  import axios from 'axios'
  export default {
    name: "logo",
    data() {
      return {
        dialogTableVisible:false,
        deviceId:null,
        form: {},
      };
    },
    created() {
      this.getData();
    },
    computed: {
      ...mapGetters(["website", "keyCollapse"])
    },
    methods: {
      getData() {
        var that = this;
      axios({
        url: 'http://192.168.0.103:1888/api/blade-jfpts/alarm/alarm/page?current=1&size=1',
        method: 'get',
      }).then(function (response) {
        that.deviceId = response.data.data.records[0].id;
        //获得最新ID,开启实时报警循环
        that.layerRealtime();
      });
    },layerRealtime(){
      var that = this;
      window.clearTimeout(window.realTimeQuery);
      window.realTimeQuery = setInterval(function () {
        axios({
          url: 'http://192.168.0.103:1888/api/blade-jfpts/alarm/alarm/selecttx?id='+that.deviceId,
          method: 'post',
          url: 'http://192.168.0.103:1888/api/blade-jfpts/alarm/alarm/page?current=1&size=1',
          method: 'get',
        }).then(function (response) {
          if (response.data.data.length > 0){
            that.deviceId = response.data.data[0].id;
            that.form = response.data.data[0];
            that.dialogTableVisible = true;
            that.$refs.realAudio.src = "./realVideo/audio.mp3";
            that.$refs.realAudio.play();
          }
          that.deviceId = response.data.data.records[0].id;
          //获得最新ID,开启实时报警循环
          that.layerRealtime();
        });
      }, 5000);
    },
    closeDialog(){
      //关闭窗口回调,关闭警报
      this.$refs.realAudio.pause();
    },
    generate(row){
      var that = this;
      //关闭窗口回调,关闭警报
      that.$refs.realAudio.pause();
      if (row.czTime == "" || row.czTime == null){
        this.$message({
          message: '请选择处置时间',
          type: 'warning'
        });
      }else{
        axios({
          url: 'http://192.168.0.103:1888/api/blade-jfpts/jingdan/jingdan/submit',
          method: 'post',
          data: {
            rName: row.rname,
            galarmPeople: row.galarmPeople,
            phoneNumber: row.phoneNumber,
            place: row.place,
            content: row.content,
            galarmTime: row.alarmTime,
            waringType: row.waringType,
            deviceNumber: row.deviceNumber,
            type: "0",
            handleP: null,
            handleTime: null,
            handName: null,
            level: row.level,
            coordinate: null,
            jd: row.jd,
            wd: row.wd,
            addvcd: row.district,
            czTime: row.czTime,
            jjTime: row.jjTime,
            bz: row.bz,
          }
        })
          .then(function (response) {
            that.$message({
              message: '生成警单成功',
              type: 'success'
            });
            that.updateJtyep(row);
            that.dialogTableVisible = false;
          })
          .catch(function (error) {
            that.dialogTableVisible = false;
      },layerRealtime(){
        var that = this;
        window.clearTimeout(window.realTimeQuery);
        window.realTimeQuery = setInterval(function () {
          axios({
            url: 'http://192.168.0.103:1888/api/blade-jfpts/alarm/alarm/selecttx?id='+that.deviceId,
            method: 'post',
          }).then(function (response) {
            if (response.data.data.length > 0){
              that.deviceId = response.data.data[0].id;
              that.form = response.data.data[0];
              that.dialogTableVisible = true;
              that.$refs.realAudio.src = "./realVideo/audio.mp3";
              that.$refs.realAudio.play();
            }
          });
      }
        }, 5000);
    },
    revoke(row){
      var that = this;
      axios({
        url: 'http://192.168.0.103:1888/api/blade-jfpts/alarm/alarm/deletejj?id='+row.id,
        method: 'post',
      }).then(function () {
        that.dialogTableVisible = false;
      },
      closeDialog(){
        //关闭窗口回调,关闭警报
        this.$refs.realAudio.pause();
      },
      generate(row){
        var that = this;
        //关闭窗口回调,关闭警报
        that.$refs.realAudio.pause();
      });
        if (row.czTime == "" || row.czTime == null){
          this.$message({
            message: '请选择处置时间',
            type: 'warning'
          });
        }else{
          axios({
            url: 'http://192.168.0.103:1888/api/blade-jfpts/jingdan/jingdan/submit',
            method: 'post',
            data: {
              rName: row.rname,
              galarmPeople: row.galarmPeople,
              phoneNumber: row.phoneNumber,
              place: row.place,
              content: row.content,
              galarmTime: row.alarmTime,
              waringType: row.waringType,
              deviceNumber: row.deviceNumber,
              type: "0",
              handleP: null,
              handleTime: null,
              handName: null,
              level: row.level,
              coordinate: null,
              jd: row.jd,
              wd: row.wd,
              addvcd: row.district,
              czTime: row.czTime,
              jjTime: row.jjTime,
              bz: row.bz,
            }
          })
            .then(function (response) {
              that.$message({
                message: '生成警单成功',
                type: 'success'
              });
              that.updateJtyep(row);
              that.dialogTableVisible = false;
            })
            .catch(function (error) {
              that.dialogTableVisible = false;
            });
        }
      },
      revoke(row){
        var that = this;
        axios({
          url: 'http://192.168.0.103:1888/api/blade-jfpts/alarm/alarm/deletejj?id='+row.id,
          method: 'post',
        }).then(function () {
          that.dialogTableVisible = false;
          //关闭窗口回调,关闭警报
          that.$refs.realAudio.pause();
        });
    },updateJtyep(row){
      var that = this;
      axios({
        url: 'http://192.168.0.103:1888/api/blade-jfpts/alarm/alarm/updateJtype?id='+row.id+"&czTime="+row.czTime+"&bz="+row.bz,
        method: 'post',
      }).then(function () {
      });
      },updateJtyep(row){
        var that = this;
        axios({
          url: 'http://192.168.0.103:1888/api/blade-jfpts/alarm/alarm/updateJtype?id='+row.id+"&czTime="+row.czTime+"&bz="+row.bz,
          method: 'post',
        }).then(function () {
        });
      }
    }
  }
};
  };
</script>
<style lang="scss">
.fade-leave-active {
  transition: opacity 0.2s;
}
.fade-enter-active {
  transition: opacity 2.5s;
}
.fade-enter,
.fade-leave-to {
  opacity: 0;
}
.avue-logo {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 64px;
  line-height: 64px;
  background-color: #20222a;
  font-size: 20px;
  overflow: hidden;
  box-sizing: border-box;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.15);
  color: rgba(255, 255, 255, 0.8);
  z-index: 1024;
  &_title {
    display: block;
    text-align: center;
    font-weight: 300;
  .fade-leave-active {
    transition: opacity 0.2s;
  }
  .fade-enter-active {
    transition: opacity 2.5s;
  }
  .fade-enter,
  .fade-leave-to {
    opacity: 0;
  }
  .avue-logo {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 64px;
    line-height: 64px;
    background-color: #20222a;
    font-size: 20px;
    overflow: hidden;
    box-sizing: border-box;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.15);
    color: rgba(255, 255, 255, 0.8);
    z-index: 1024;
    &_title {
      display: block;
      text-align: center;
      font-weight: 300;
      font-size: 20px;
    }
    &_subtitle {
      display: block;
      text-align: center;
      font-size: 18px;
      font-weight: bold;
      color: #fff;
    }
  }
  &_subtitle {
    display: block;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
  }
}
.real-dialog .el-dialog::after {
  content: '';
  position: absolute;
  left: -5px;
  top: 25px;
  right: -5px;
  bottom: 25px;
  background: red;
  border-radius: 10px;
  filter: blur(120px);
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: -1;
}
  .real-dialog .el-dialog::after {
    content: '';
    position: absolute;
    left: -5px;
    top: 25px;
    right: -5px;
    bottom: 25px;
    background: red;
    border-radius: 10px;
    filter: blur(120px);
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: -1;
  }
</style>