linwe
2024-12-19 f77fc328aacfdc1fef6a0a12d5ec28cceb0fd0d6
企业搜索
1 files modified
44 ■■■■■ changed files
src/views/house/components/scanCodeAlarm.vue 44 ●●●●● patch | view | raw | blame | history
src/views/house/components/scanCodeAlarm.vue
@@ -2,7 +2,11 @@
<template>
  <div class="table-box-w">
    <div class="list-box">
      <el-table :data="dataList.records" style="width: 100%" @cell-click="cellClick">
      <el-table :header-cell-style="{ 'text-align': 'center', 'background-color': '#203c60', 'borderColor': '#324e75' }"
        :cell-style="{ 'text-align': 'center', 'borderColor': '#324e75' }" v-loading="residentLoading"
        element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading"
        element-loading-background="rgba(17, 38, 163, 1)" :empty-text="residentNoDataText" :data="dataList.records"
        style="width: 100%" @cell-click="cellClick">
        <!-- 包含了姓名、性别、民族、身份证号码、手机号、现居住地、岗位、从业人员照片等。 -->
        <el-table-column align="center" prop="policeName" label="民警"> </el-table-column>
        <el-table-column align="center" prop="pcsName" label="单位"> </el-table-column>
@@ -107,11 +111,13 @@
  },
  //import引入的组件需要注入到对象中才能使用
  components: {},
  data () {
  data() {
    //这里存放数据
    return {
      row: {},
      detailBox: false,
      residentLoading: false,
      residentNoDataText: '暂无数据',
      dataList: {
        total: 1,
        records: []
@@ -131,31 +137,35 @@
  watch: {},
  //方法集合
  methods: {
    handleSizeChange (val) {
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`)
      this.pageparm.pageSize = val
      this.init()
    },
    handleCurrentChange (val) {
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`)
      this.pageparm.current = val
      this.init()
    },
    init () {
    init() {
      this.residentLoading = true
      getPoliceAlarmRecordsPage(123456, this.pageparm.pageSize, this.pageparm.current).then((res) => {
        this.dataList.total = res.data.data.total
        this.dataList.records = res.data.data.records
        this.residentLoading = false
      }).catch((err) => {
        this.residentLoading = false
      })
    },
    cellClick (row, column, cell, event) {
    cellClick(row, column, cell, event) {
      row.employerImg = this.getImgUrls(row.employerImg)
      this.row = row
      this.detailBox = !this.detailBox
      console.log('cellClick', row, column, cell, event)
    },
    // // 图片转换
    getImgUrls (imageUrls) {
    getImgUrls(imageUrls) {
      if (imageUrls && imageUrls != '' && imageUrls.length > 0) {
        imageUrls = imageUrls.split(',').filter(ele => ele != '').map(ele => {
          // return 'http://10.141.11.11/place/' + ele
@@ -167,23 +177,23 @@
  },
  //生命周期 - 创建完成(可以访问当前this实例)
  created () {
  created() {
    console.log('tableFromPop mounted', this.hushiPeoTy)
  },
  //生命周期 - 挂载完成(可以访问DOM元素)
  mounted () {
  mounted() {
    console.log('tableFromPop mounted', this.hushiPeoTy)
    this.init()
  },
  beforeCreate () { }, //生命周期 - 创建之前
  beforeMount () { }, //生命周期 - 挂载之前
  beforeUpdate () { }, //生命周期 - 更新之前
  updated () { }, //生命周期 - 更新之后
  beforeDestroy () { }, //生命周期 - 销毁之前
  destroyed () { }, //生命周期 - 销毁完成
  activated () { }, //如果页面有keep-alive缓存功能,这个函数会触发
  beforeCreate() { }, //生命周期 - 创建之前
  beforeMount() { }, //生命周期 - 挂载之前
  beforeUpdate() { }, //生命周期 - 更新之前
  updated() { }, //生命周期 - 更新之后
  beforeDestroy() { }, //生命周期 - 销毁之前
  destroyed() { }, //生命周期 - 销毁完成
  activated() { }, //如果页面有keep-alive缓存功能,这个函数会触发
}
</script>
@@ -193,4 +203,4 @@
  // position: relative;
  // background-color: rgba(228, 17, 17, 0.5);
}
</style>
</style>