南昌市物联网技防平台-前端
liuyg
2021-05-08 b5f430b249189049cf0a9234dc9197e4e6136544
j解决that.form.securityArr=null没有length问题
1 files modified
29 ■■■■■ changed files
src/views/policeTracking/policeTracking.vue 29 ●●●●● patch | view | raw | blame | history
src/views/policeTracking/policeTracking.vue
@@ -585,6 +585,16 @@
  },
  created() {
    this.form = this.$route.query;
    if (
      !(
        this.form.securityArr &&
        this.form.securityArr != null &&
        this.form.securityArr != undefined &&
        this.form.securityArr.length > 0
      )
    ) {
      this.form.securityArr = [];
    }
    this.updatedPageData();
    this.vaddress = this.form.vaddress;
    this.getReceivingAlarm();
@@ -770,8 +780,13 @@
        .then(function (res) {
          that.tableData = [];
          var i = 0;
          if (that.form.securityArr.length > 0) {
          console.log(that.form, 89);
          if (
            that.form.securityArr &&
            that.form.securityArr != null &&
            that.form.securityArr != undefined &&
            that.form.securityArr.length > 0
          ) {
            res.data.data.records.forEach((item) => {
              if (item.id == that.form.securityId) {
                that.tableData.push({
@@ -937,6 +952,16 @@
        },
      }).then(function (res) {
        that.form = res.data.data.records[0];
        if (
          !(
            that.form.securityArr &&
            that.form.securityArr != null &&
            that.form.securityArr != undefined &&
            that.form.securityArr.length > 0
          )
        ) {
          that.form.securityArr = [];
        }
        that.getList();//报错deptId格式不对liu.2021.5.7
      });
    },