shuishen
2026-02-10 abd285e6d013128aa57c9e30e851b2aa76d60ec5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<!--  -->
<template>
  <div class="table-box-w">
    <div class="list-box">
      <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>
        <el-table-column align="center" prop="createTime" label="报警时间"> </el-table-column>
        <el-table-column align="center" prop="address" show-overflow-tooltip label="地址"> </el-table-column>
        <el-table-column align="center" prop="injuryFlag" label="是否受伤">
          <template slot-scope="scope">
            {{ scope.row.injuryFlag == 1 ? '是' : '否' }}
          </template>
        </el-table-column>
      </el-table>
 
      <div class="pages">
        <el-pagination background layout="prev, pager, next" :page-size="100" :total="dataList.total"
          :current-page="currentPage4" @current-change="handleCurrentChange"></el-pagination>
      </div>
    </div>
 
    <!-- 详情页面 -->
    <el-dialog class="resident-details-box-details" :modal="false" :close-on-click-modal="false" :append-to-body="true"
      :visible.sync="detailBox">
      <div class="detail-box">
        <!-- popelList[0]  详情页面 包含了姓名、性别、民族、身份证号码、手机号、现居住地、岗位、从业人员照片等-->
        <div class="detail-title-box">
          <div class="detail-title">扫码报警详情</div>
          <div class="close" @click="detailBox = false" title="关闭"></div>
        </div>
 
        <div class="detail-content-box">
          <el-row class="">
            <el-col :span="6">
              <div class="detail-row">民警</div>
            </el-col>
            <el-col :span="18">
              <div class="detail-row">{{ row.policeName }}</div>
            </el-col>
          </el-row>
 
          <el-row class="">
            <el-col :span="6">
              <div class="detail-row">单位</div>
            </el-col>
            <el-col :span="18">
              <div class="detail-row">{{ row.pcsName }}</div>
            </el-col>
          </el-row>
 
          <el-row class="">
            <el-col :span="6">
              <div class="detail-row">是否受伤</div>
            </el-col>
            <el-col :span="18">
              <div class="detail-row">{{ row.gender == 1 ? '是' : '否' }}</div>
            </el-col>
          </el-row>
 
          <el-row class="">
            <el-col :span="6">
              <div class="detail-row">报警时间</div>
            </el-col>
            <el-col :span="18">
              <div class="detail-row">{{ row.createTime }}</div>
            </el-col>
          </el-row>
 
          <el-row class="">
            <el-col :span="6">
              <div class="detail-row">地址</div>
            </el-col>
            <el-col :span="18">
              <div class="">{{ row.address }}</div>
            </el-col>
          </el-row>
 
          <el-row class="">
            <el-col :span="6">
              <div class="detail-row">经纬度</div>
            </el-col>
            <el-col :span="18">
              <div class="detail-row">{{ row.longitude }},{{ row.latitude }}</div>
            </el-col>
          </el-row>
        </div>
      </div>
    </el-dialog>
  </div>
</template>
 
<script>
 
import {
  getPoliceAlarmRecordsPage
} from "@/api/dept/newIndex.js"
export default {
  name: 'tableFromPop',
 
  props: {
    hushiPeoTy: {
      type: String,
      default: ''
    },
    residentIdSave: {
      type: String,
      default: ''
    },
    residentDetailsType: {
      type: Number,
      default: 1
    },
  },
  //import引入的组件需要注入到对象中才能使用
  components: {},
  data () {
    //这里存放数据
    return {
      row: {},
      detailBox: false,
      residentLoading: false,
      residentNoDataText: '暂无数据',
      dataList: {
        total: 1,
        records: []
 
      },
      pageparm: {
        pageSize: 10,
        current: 1
      }
 
    }
  },
  //监听属性 类似于data概念
  computed: {
  },
  //监控data中的数据变化
  watch: {},
  //方法集合
  methods: {
    handleSizeChange (val) {
      console.log(`每页 ${val} 条`)
      this.pageparm.pageSize = val
      this.init()
    },
    handleCurrentChange (val) {
      console.log(`当前页: ${val}`)
      this.pageparm.current = val
      this.init()
 
    },
    init () {
      this.residentLoading = true
      getPoliceAlarmRecordsPage(this.residentDetailsType, this.residentIdSave, 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) {
      row.employerImg = this.getImgUrls(row.employerImg)
      this.row = row
      this.detailBox = !this.detailBox
      console.log('cellClick', row, column, cell, event)
    },
    // // 图片转换
    getImgUrls (imageUrls) {
      if (imageUrls && imageUrls != '' && imageUrls.length > 0) {
        imageUrls = imageUrls.split(',').filter(ele => ele != '').map(ele => {
          return 'http://10.141.11.11/jczzMedia/' + ele
          // return 'https://srgdjczzxtpt.com:2080/gminio/jczz/' + ele
        })
      }
      return imageUrls || []
    },
 
  },
  //生命周期 - 创建完成(可以访问当前this实例)
  created () {
    console.log('tableFromPop mounted', this.hushiPeoTy)
 
  },
  //生命周期 - 挂载完成(可以访问DOM元素)
  mounted () {
    console.log('tableFromPop mounted', this.hushiPeoTy)
    this.init()
 
  },
  beforeCreate () { }, //生命周期 - 创建之前
  beforeMount () { }, //生命周期 - 挂载之前
  beforeUpdate () { }, //生命周期 - 更新之前
  updated () { }, //生命周期 - 更新之后
  beforeDestroy () { }, //生命周期 - 销毁之前
  destroyed () { }, //生命周期 - 销毁完成
  activated () { }, //如果页面有keep-alive缓存功能,这个函数会触发
}
</script>
 
 
<style scoped lang="scss">
.table-box-w {
  // position: relative;
  // background-color: rgba(228, 17, 17, 0.5);
}
</style>