From e1aa0ecffbabd618c71e4ad94370fb8dffe6ee1c Mon Sep 17 00:00:00 2001
From: zhanghua <314079846@qq.com>
Date: 星期日, 21 一月 2024 20:54:49 +0800
Subject: [PATCH] 优化
---
src/views/intelligentPatrol/statistics/unlawful/area/index.vue | 226 ++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 210 insertions(+), 16 deletions(-)
diff --git a/src/views/intelligentPatrol/statistics/unlawful/area/index.vue b/src/views/intelligentPatrol/statistics/unlawful/area/index.vue
index 0025cda..ce8dfbb 100644
--- a/src/views/intelligentPatrol/statistics/unlawful/area/index.vue
+++ b/src/views/intelligentPatrol/statistics/unlawful/area/index.vue
@@ -13,6 +13,7 @@
start-placeholder="寮�濮嬫棩鏈�"
end-placeholder="缁撴潫鏃ユ湡"
:picker-options="pickerOptions"
+ value-format="yyyy-MM-dd HH:mm:ss"
>
</el-date-picker>
</div>
@@ -40,8 +41,11 @@
<div class="main-content">
<!-- 鏁版嵁灞曠ず -->
<el-table
+ border
+ stripe
ref="multipleTable"
:header-cell-style="{
+ background: '#F5F5F5',
'font-weight': '650',
'line-height': '45px',
}"
@@ -53,6 +57,10 @@
<el-table-column prop="name" label="鍖哄煙鍚嶇О" min-width="10">
</el-table-column>
<el-table-column prop="count" label="浜嬩欢鎬绘暟" min-width="5">
+ <template slot-scope="scope">
+
+ <el-button type="text" @click="seachTotalEvents(scope.row.id)">{{scope.row.count}}</el-button>
+ </template>
</el-table-column>
<el-table-column prop="ratio" label="鍗犳瘮" min-width="5">
</el-table-column>
@@ -82,16 +90,137 @@
</el-pagination>
</div>
</div>
+ <el-dialog
+ title="浜嬩欢鎬绘暟"
+ :visible.sync="dialogVisibleEvent"
+ width="80%"
+ :before-close="handClose">
+ <el-table
+ border
+ stripe
+ ref="multipleTable"
+ :header-cell-style="{
+ background: '#F5F5F5',
+ 'font-weight': '650',
+ 'line-height': '45px'
+ }"
+ :data="gridData"
+ style="width: 100%"
+ :row-class-name="tableRowClassName"
+
+ >
+
+ <el-table-column
+ prop="code"
+ label="浜嬩欢缂栧彿"
+ min-width="18"
+ >
+ </el-table-column>
+ <el-table-column
+ prop="eventSource"
+ label="闂鏉ユ簮"
+ min-width="8"
+ >
+ <template slot-scope="scope">
+ <span>{{
+ scope.row.eventSource === 2
+ ? '缃戞牸宸℃煡'
+ : '瑙嗛宸℃煡'
+ }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column
+ :prop="mystatus === 1 ? 'category' : 'category'"
+ :label="mystatus === 1 ? '澶х被鍚嶇О' : '杩濆缓绫诲埆'"
+ :min-width="mystatus === 1 ? '10' : '15'"
+ >
+ </el-table-column>
+ <el-table-column
+ :prop="mystatus === 1 ? 'type' : 'site'"
+ :label="mystatus === 1 ? '灏忕被鍚嶇О' : '杩濆缓鍦扮偣'"
+ min-width="10"
+ >
+ </el-table-column>
+ <el-table-column
+ :prop="mystatus === 1 ? 'site' : ''"
+ :label="
+ mystatus === 1 ? '鎶ヨ鐐逛綅' : '杩濇硶寤虹瓚闀裤�佸銆侀珮'
+ "
+ :min-width="mystatus === 1 ? '10' : '20'"
+ show-overflow-tooltip
+ >
+ <template slot-scope="scope">
+ <div v-if="mystatus === 2">
+ <span>{{
+ scope.row.buildingLength +
+ '绫�' +
+ '銆�' +
+ scope.row.buildingWidth +
+ '绫�' +
+ '銆�' +
+ scope.row.buildingHigh +
+ '绫�'
+ }}</span>
+ </div>
+ <div v-else>{{ scope.row.site }}</div>
+ </template>
+ </el-table-column>
+ <el-table-column
+ :prop="mystatus === 1 ? 'street' : 'buildingArea'"
+ :label="mystatus === 1 ? '鎵�灞炲尯鍩�' : '杩濇硶寤虹瓚闈㈢Н'"
+ min-width="12"
+ >
+ </el-table-column>
+ <el-table-column
+ prop="alarmTime"
+ label="鎶ヨ鏃堕棿"
+ min-width="15"
+ v-if="mystatus === 1"
+ >
+ <template slot-scope="scope">
+ <span>{{ filterTime(scope.row.alarmTime) }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column
+ :prop="mystatus === 1 ? 'continueTime' : 'materials'"
+ :label="mystatus === 1 ? '鎸佺画鏃堕棿' : '杩濇硶寤虹瓚鏉愭枡'"
+ min-width="12"
+ >
+ </el-table-column>
+ </el-table>
+
+ <div >
+ <el-pagination
+ background
+ :current-page="currentPages"
+ layout="prev, pager, next"
+ :total="totalNums"
+ :page-size="pageSizes"
+ @current-change="changeCurrentPages"
+ >
+ </el-pagination>
+ </div>
+
+ </el-dialog>
</main>
</div>
</template>
<script>
import { createNamespacedHelpers } from "vuex";
+import basecase from "@/api/operate/basecase";
+import helper from "@/utils/mydate";
const { mapActions } = createNamespacedHelpers("statistics");
export default {
data() {
return {
+ seachID:'',
+ dialogVisibleEvent:false,
+ mystatus:1,
+ totalNums:1,
+ pageSizes:10,
+ currentPages:1,
+ gridData:[],
pickerOptions: {
shortcuts: [
{
@@ -136,10 +265,71 @@
},
methods: {
...mapActions(["searchByArea"]),
-
- handleExport(e) {},
- setTableDataHandle(e) {},
- resetTableData(e) {},
+ handClose(){
+ this.dialogVisibleEvent=false
+ },
+// 澶勭悊鏃堕棿
+ filterTime(time) {
+ return helper(time);
+ },
+ seachTotalEvents(id){
+ this.seachID=id
+ this.dialogVisibleEvent = true
+ console.log(this.value2)
+ let params ={
+ type:1,
+ street:id,
+ current: this.currentPages,
+ size: this.pageSizes,
+ }
+ params.startTime = this.value2[0]||''
+ params.endTime = this.value2[1]||''
+ basecase.baseCasePoolList(params).then(res=>{
+ console.log(res)
+ this.gridData =res.records
+ this.pageSizes =res.size
+ this.currentPages =res.current
+ this.totalNums = res.total
+ })
+ },
+ handleExport(e) {
+ this.$axios({
+ method: "post",
+ // url: `sccg/intelligentPatrol/statistics/export/unlawful`,
+ url: `sccg/intelligentPatrol/statistics/export/unlawful/street`,
+ responseType: "arraybuffer",
+ data: {
+ beginTime: this.value2[0],
+ endTime: this.value2[1],
+ }
+ }).then((res) => {
+ let time = new Date();
+ let deathdate = time.toLocaleDateString();
+ const blob = new Blob([res.data], {
+ type: "application/vnd.ms-excel;charset=utf-8",
+ });
+ if (window.navigator.msSaveBlob) {
+ window.navigator.msSaveBlob(blob, deathdate + "鎸夊尯鍩熺粺璁�" + ".xlsx");
+ } else {
+ const url = window.URL.createObjectURL(blob);
+ const link = document.createElement("a");
+ link.style.display = "none";
+ link.href = url;
+ link.download = deathdate + "鎸夊尯鍩熺粺璁�" + ".xlsx";
+ document.body.appendChild(link);
+ link.click();
+ document.body.removeChild(link);
+ }
+ this.$message.success("鎿嶄綔鎴愬姛");
+ });
+ },
+ setTableDataHandle(e) {
+ this.setTableData()
+ },
+ resetTableData(e) {
+ this.value2= ''
+ this.setTableData()
+ },
// 璁剧疆琛ㄦ牸鏂戦┈绾�
tableRowClassName({ row, rowIndex }) {
if ((rowIndex + 1) % 2 == 0) {
@@ -155,12 +345,16 @@
this.searchByArea({
currentPage,
pageSize,
- beginTime:'2022-05-01 00:00:00',
- endTime:'2022-09-01 00:00:00'
+ beginTime: this.value2[0],
+ endTime:this.value2[1],
}).then((res) => {
- this.list = res.records;
- this.totalNum = res.total;
+ this.list = res.records;
+ this.totalNum = res.total;
});
+ },
+ changeCurrentPages(page){
+ this.currentPages = page;
+ this.seachTotalEvents(this.seachID)
},
// 褰撳墠椤垫敼鍙樿Е鍙戜簨浠�
changeCurrentPage(page) {
@@ -183,15 +377,15 @@
<style lang="scss" scoped>
.list {
text-align: left;
- margin: 10px 20px;
+ padding: 10px 20px;
color: #4b9bb7;
-
+ border: 1px solid #ccc;
header {
background-color: white;
- border: 1pox solid #fff;
+ border: 1px solid #fff;
.header-content {
- padding: 0 40px;
+ //padding: 0 40px;
display: flex;
line-height: 100px;
justify-content: space-between;
@@ -231,14 +425,14 @@
}
}
- :deep(.el-range-separator) {
+ ::v-deep(.el-range-separator) {
padding: 0px !important;
}
main {
// background-color: #09152f;
margin-top: 20px;
padding-bottom: 50px;
- border: 1pox solid #fff;
+ border: 1px solid #fff;
.main-title {
line-height: 60px;
@@ -328,7 +522,7 @@
// font-size: 10px;
.operation {
display: flex;
-
+ color: var(--operation-color);;
.line {
padding: 0 5px;
}
@@ -340,4 +534,4 @@
}
}
}
-</style>
\ No newline at end of file
+</style>
--
Gitblit v1.8.0