clusterdetail.vue 3.72 KB
 <!--伴随人员-->
<template>
    <div>
        <el-dialog title="聚类详情" :visible.sync="dialogVisible" size="small" :before-close="handleClose" class="tabledialong">
            <div class="detail-aline mt20"></div>
            <el-row >
              <div class="dialongtable">
                <el-table v-loading.body="loading" :data="tableData"  boder style="width: 100%" >
                    <el-table-column type="index" label="编号" width="100">
                    </el-table-column>
                    <el-table-column prop="camera.name" label="相机名称" width="220">
                    </el-table-column>
                    <el-table-column label="抓拍时间">
                        <template slots-scope="scope">
                            {{showLocalTime(scope.row.event_dt)}}
                        </template>
                    </el-table-column>
                    <el-table-column label="图片" style="height:60px">
                        <template slots-scope="scope" class="accomimg-box">
                            <img :src="scope.row.pic_url" class="accomimg"/>
                        </template>
                    </el-table-column>
                    <el-table-column label="操作">
                        <template slots-scope="scope">
                            <el-button class="" type="danger" icon="delete" size="small" @click="clusDelete(scope.$index, scope.row)">删除</el-button>
                        </template>
                    </el-table-column>
                </el-table>
              </div>
            </el-row>
            <el-row>
                <div class="block">
                    <el-pagination class="flr mt10" @current-change="handleCurrentChange" :current-page.sync="page.currentPage" :page-size="page.limit" layout="total,prev, pager, next, jumper" :total="page.total">
                    </el-pagination>
                </div>
            </el-row>
            <span slot="footer" class="dialog-footer">
                <el-button @click="handleClose">取 消</el-button>
                <el-button type="primary" @click="handleClose">确 定</el-button>
            </span>
        </el-dialog>

    </div>
</template>
<script>
export default {
  data() {
    return {
      loading: true,
      page: {
        offset: 0,
        currentPage: 1,
        limit: 5,
        total: 0
      },
      tableData: []
    };
  },
  computed: {},

  methods: {
    handleClose() {
      this.$emit("closedialog", false);
    },
    clusDelete(index, row) {
      var Vthis = this;
      this.axios
        .delete(FACEWEB + "/face_events/" + row.unid)
        .then(function(response) {
          Vthis.$message({
            type: "success",
            message: "删除成功!"
          });
          Vthis.showAccompany();
        });
    },
    handleCurrentChange(val) {
      this.page.currentPage = val;
      this.page.offset = (val - 1) * this.page.limit;
      this.showAccompany();
    },
    showAccompany(accunid) {
      var Vthis = this;
      Vthis.loading = true;
      this.axios
        .get(FACEWEB + "/faces/" + this.eventdata.face.unid + "/face_events", {
          params: {
            limit: Vthis.page.limit,
            offset: Vthis.page.offset
          }
        })
        .then(function(response) {
          Vthis.tableData = response.data.list_data;
          Vthis.page.total = response.data.total_num;
          Vthis.loading = false;
        });
    }
  },
  props: {
    eventdata: {},
    dialogVisible: {},
    faceunid: {}
  },
  created() {},
  watch: {
    faceunid() {
      this.page.offset = 0;
      this.page.currentPage = 1;
      this.showAccompany();
    }
  }
};
</script>
<style lang="stylus" scoped>

.accomimg {
    height: 60px;
    border-radius:5px;
}
</style>