From 7623c217ad57ad1140fbf3b534fdc420ec6e4c08 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期二, 02 十二月 2025 11:15:54 +0800
Subject: [PATCH] 人脸设备标签问题
---
src/views/system/monitor/face/index.vue | 227 +++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 214 insertions(+), 13 deletions(-)
diff --git a/src/views/system/monitor/face/index.vue b/src/views/system/monitor/face/index.vue
index 007b042..858227c 100644
--- a/src/views/system/monitor/face/index.vue
+++ b/src/views/system/monitor/face/index.vue
@@ -1,13 +1,16 @@
<template>
<div class="app-container">
<div
- style="display: flex;flex-direction: row;min-width: 158px;max-width: 158px;margin-bottom: 5px;border-radius: 1px; user-select: none"
+ style="display: flex;flex-direction: row;min-width: 300px;max-width: 300px;margin-bottom: 5px;border-radius: 1px; user-select: none"
>
<div @click="clickTab(null)" class="tab"
- :class="{tabActive: null == queryParams.provinceTag, tabInactive: null != queryParams.provinceTag}">鍏ㄩ儴
+ :class="{tabActive: !queryParams.provinceTag && !queryParams.deptTag, tabInactive: queryParams.provinceTag || queryParams.deptTag}">鍏ㄩ儴
</div>
<div @click="clickTab(0)" class="tab"
- :class="{tabActive: 0 === queryParams.provinceTag, tabInactive: 0 !== queryParams.provinceTag}">鐪佸巺鑰冩牳
+ :class="{tabActive: queryParams.provinceTag, tabInactive: !queryParams.provinceTag}">鐪佸巺鑰冩牳
+ </div>
+ <div @click="clickTab(1)" class="tab"
+ :class="{tabActive: queryParams.deptTag, tabInactive: !queryParams.deptTag}">鍏畨閮ㄨ�冩牳
</div>
</div>
<el-card class="box-card" >
@@ -32,6 +35,10 @@
<p>寮傚父鏁�</p >
</div>
<div class="dashboard-item">
+ <h3 style="color: #4f4f4f">{{ count.unknownNumbers }}</h3>
+ <p>鏈煡鏁�</p>
+ </div>
+ <div class="dashboard-item">
<h3>{{ count.viewsPercentage }}%</h3>
<p>璁惧杩愯鐜�</p >
</div>
@@ -44,9 +51,10 @@
<el-form-item label="鍏抽敭瀛�" prop="name">
<el-input
v-model="queryParams.name"
- placeholder="璇疯緭鍏ュ叧閿瓧"
+ placeholder="璁惧鍚�/璁惧缂栫爜/IP/鍗曚綅鍚�"
clearable
@keyup.enter.native="handleQuery"
+ @clear="handleQuery"
/>
</el-form-item>
<el-form-item label="鍖哄煙" prop="onState">
@@ -69,6 +77,7 @@
v-model="queryParams.onState"
placeholder="璁惧鐘舵��"
clearable
+ @change="handleQuery"
style="width: 100px"
>
<el-option
@@ -86,13 +95,23 @@
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-form>
+ <div v-hasPermi="['system:monitor:export']">
+ <el-button slot="reference" type="primary" size="mini" @click="handleExport" plain >瀵煎嚭</el-button>
+ <el-button style="margin-left: 10px" type="primary" size="mini" @click="openImport" plain>瀵煎叆璁惧鏍囩</el-button>
+ </div>
<el-table v-loading="loading" :data="monitorList" @selection-change="handleSelectionChange">
<el-table-column label="璁惧鍚嶇О" align="center" prop="name" width="280" fixed show-overflow-tooltip/>
<el-table-column label="璁惧缂栫爜" align="center" prop="serialNumber" width="180"/>
<el-table-column label="ip" align="center" prop="ip" width="180"/>
<el-table-column label="鏍囩" align="center" width="180" v-if="columns[0].visible">
<template slot-scope="scope">
- <div>{{ scope.row.provinceTag == 0 ? "鐪佸巺" : "甯傚眬" }}</div>
+ <div>
+ {{
+ (
+ (scope.row.provinceTagFace ? '鐪佸巺銆�' : '') +
+ (scope.row.deptTag ? '鍏畨閮ㄣ��' : '')).replace(/銆�$/, '')
+ }}
+ </div>
</template>
</el-table-column>
<el-table-column label="鍖哄煙" align="center" prop="area" width="180" v-if="columns[1].visible"/>
@@ -127,7 +146,11 @@
<el-table-column label="寤烘ā澶辫触鐜�" align="center" prop="failPercent" width="180" v-if="columns[12].visible"/>
<el-table-column label="浜鸿劯鍚堟牸鐜�" align="center" prop="facePercent" width="180" v-if="columns[13].visible"/>
<el-table-column label="澶у浘鍙敤鐜�" align="center" prop="bigUsefulPercent" width="180" v-if="columns[14].visible"/>
- <el-table-column label="url鍙敤鐜�" align="center" prop="urlPercent" width="180" v-if="columns[15].visible"/>
+ <el-table-column label="寤鸿绫诲瀷鏍囩" align="center" prop="constructTag" width="180" v-if="columns[15].visible">
+ <template slot-scope="scope">
+ <div>{{ scope.row.tag }}</div>
+ </template>
+ </el-table-column>
<el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope">
<el-button
@@ -197,10 +220,16 @@
<el-form-item label="璁惧鍚嶇О锛�">{{ form.name }}</el-form-item>
<el-col :span="12">
<el-form-item label="璁惧缂栫爜锛�">{{ form.serialNumber }}</el-form-item>
- <el-form-item label="鏍囩锛�">{{ form.provinceTag == 0 ? '鐪佸巺' : '甯傚眬' }}</el-form-item>
+ <el-form-item label="鏍囩锛�">
+ {{
+ ((form.provinceTagFace ? '鐪佸巺銆�' : '') +
+ (form.deptTag ? '鍏畨閮ㄣ��' : '')).replace(/銆�$/, '')
+ }}
+ </el-form-item>
<el-form-item label="璁惧鐘舵�侊細">
- <div v-if="form.onState === 0">绂荤嚎</div>
+ <div v-if="form.onState === 0">鏈煡</div>
<div v-else-if="form.onState === 1">鍦ㄧ嚎</div>
+ <div v-else-if="form.onState === -1">绂荤嚎</div>
</el-form-item>
<el-form-item label="绠$悊鍗曚綅锛�">{{ form.unitName }}</el-form-item>
</el-col>
@@ -243,7 +272,6 @@
<el-form-item label="褰撴棩鎶撴媿閲忥細">{{ form.snapCount }}</el-form-item>
<el-form-item label="涓婁紶鍙婃椂鐜囷細">{{ form.uploadPercent }}</el-form-item>
<el-form-item label="浜鸿劯鍚堟牸鐜囷細">{{ form.facePercent }}</el-form-item>
- <el-form-item label="url鍙敤鐜囷細">{{ form.urlPercent }}</el-form-item>
</el-col>
</el-row>
</el-form>
@@ -251,13 +279,70 @@
<el-button @click="open = false">鍏� 闂�</el-button>
</div>
</el-dialog>
+ <el-dialog
+ title="瀵煎叆璁惧鏍囩"
+ width="800px"
+ :visible.sync="importShow"
+ :close-on-click-modal="false"
+ custom-class="import-dialog"
+ >
+ <div class="import-content">
+ <!-- 涓婁紶鍖哄煙 -->
+ <div class="upload-section">
+ <el-upload
+ ref="upload"
+ class="custom-upload"
+ action=""
+ drag
+ :file-list="fileList"
+ :before-upload="beforeUpload"
+ :on-change="handleFileChange"
+ :on-remove="handleFileRemove"
+ :auto-upload="false"
+ accept=".xls,.xlsx"
+ >
+ <div class="upload-content">
+ <i class="el-icon-upload"></i>
+ <div class="upload-text">灏嗘枃浠舵嫋鍒版澶勶紝鎴�<em>鐐瑰嚮涓婁紶</em></div>
+ <div class="upload-tip">鏀寔 .xls 鎴� .xlsx 鏍煎紡鏂囦欢锛屾枃浠跺ぇ灏忎笉瓒呰繃10MB</div>
+ </div>
+ </el-upload>
+ </div>
+
+ <!-- 鎿嶄綔鎸夐挳 -->
+ <div class="action-section">
+ <el-button
+ type="primary"
+ size="medium"
+ :loading="upload"
+ @click="handleImport"
+ class="import-btn"
+ :disabled="!currentFile"
+ >
+ {{ upload ? '瀵煎叆涓�...' : '寮�濮嬪鍏�' }}
+ </el-button>
+ <el-button
+ size="medium"
+ @click="downloadTemplate"
+ class="template-btn"
+ >
+ <i class="el-icon-download"></i>涓嬭浇妯℃澘
+ </el-button>
+ </div>
+ </div>
+
+ <div slot="footer" class="dialog-footer">
+ <el-button type="primary" size="medium" @click="importShow = false">鍏� 闂�</el-button>
+ </div>
+ </el-dialog>
</div>
</template>
<script>
import { videoCount, listMonitor, getMonitor, delMonitor, addMonitor, updateMonitor } from "@/api/platform/monitor";
import { listDept } from "@/api/system/dept";
+import { importData } from "@/api/platform/monitorConstruction";
export default {
name: "Monitor",
dicts: ['sys_normal_disable','platform_yes_no','camera_state'],
@@ -280,13 +365,14 @@
{ key: 11, label: `涓婁紶鍙婃椂鐜嘸, visible: false },
{ key: 12, label: `寤烘ā澶辫触鐜嘸, visible: false },
{ key: 13, label: `浜鸿劯鍚堟牸鐜嘸, visible: false },
- { key: 14, label: `鍥剧墖璁块棶寮傚父閲廯, visible: false },
- { key: 15, label: `澶у浘涓嶅彲鐢ㄩ噺`, visible: false }
+ { key: 14, label: `澶у浘涓嶅彲鐢ㄩ噺`, visible: false },
+ {key: 15, label: `寤鸿绫诲瀷`, visible: true}
],
count: {
totalPosts: 0,
totalMembers: 0,
postsPercentage: 0,
+ unknownNumbers: 0,
totalViews: 0,
totalFace: 0,
viewsPercentage: 0
@@ -338,7 +424,12 @@
address: [
{ required: true, message: "鍦板潃涓嶈兘涓虹┖", trigger: "blur" }
],
- }
+ },
+
+ importShow: false,
+ upload: false,
+ fileList: [],
+ currentFile: null,
};
},
created() {
@@ -349,8 +440,74 @@
});
},
methods: {
+ beforeUpload(file) {
+ // 鏂囦欢楠岃瘉閫昏緫
+ const isExcel = file.type.includes('spreadsheet') ||
+ file.name.endsWith('.xls') ||
+ file.name.endsWith('.xlsx');
+ const isLt10M = file.size / 1024 / 1024 < 10;
+
+ if (!isExcel) {
+ this.$message.error('鍙兘涓婁紶 Excel 鏂囦欢!');
+ return false;
+ }
+ if (!isLt10M) {
+ this.$message.error('鏂囦欢澶у皬涓嶈兘瓒呰繃 10MB!');
+ return false;
+ }
+
+ return true;
+ },
+ handleFileRemove(){
+ this.currentFile = null;
+ },
+ handleFileChange(file, fileList) {
+ this.currentFile = file;
+ },
+
+ async handleImport() {
+ if (!this.currentFile) {
+ this.$message.warning('璇峰厛閫夋嫨瑕佸鍏ョ殑鏂囦欢');
+ return;
+ }
+
+ this.upload = true;
+ // 杩欓噷鎵ц涓婁紶閫昏緫
+ // 涓婁紶瀹屾垚鍚�
+ const formData = new FormData();
+ formData.append('file', this.currentFile.raw);
+
+ await importData(formData).then(res =>{
+ if (res.code === 200){
+ this.$message.success("瀵煎叆鎴愬姛");
+ }
+ })
+ this.upload = false;
+ this.importShow = false;
+ },
+
+ downloadTemplate() {
+ // 涓嬭浇妯℃澘鏂囦欢閫昏緫
+ this.download("monitorConstruction/importTemplate", {}, `璁惧鏍囩妯℃澘.xlsx`);
+ },
+ openImport(){
+ this.fileList = []
+ this.currentFile = null;
+ this.importShow = true;
+ this.upload = false;
+
+ },
clickTab(active) {
- this.queryParams.provinceTag = active
+ if (active === 0) {
+ this.queryParams.provinceTag = true
+ this.queryParams.deptTag =null
+ } else if (active === 1) {
+ this.queryParams.provinceTag = null
+ this.queryParams.deptTag = true
+ }else {
+ this.queryParams.provinceTag = null
+ this.queryParams.deptTag = null
+ }
this.getList()
this.getVideoCount()
},
@@ -468,6 +625,50 @@
</script>
<style lang="scss" scoped>
+.custom-upload{
+ width: 100%;
+ height: 100%;
+
+}
+.custom-upload ::v-deep .el-upload-dragger {
+ width: 500px;
+ height: 200px;
+ padding: 0; /* 绉婚櫎榛樿鐨勫唴杈硅窛 */
+ margin: 0 0 0 125px;
+}
+
+.custom-upload ::v-deep .el-upload-dragger .el-icon-upload {
+ margin-top: 0; /* 璋冩暣鍥炬爣鐨勪笂杈硅窛 */
+}
+
+/* 纭繚鑷畾涔夊唴瀹瑰尯鍩熷厖婊℃暣涓嫋鎷藉尯鍩� */
+.custom-upload .upload-content {
+ width: 100%;
+ height: 100%;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+}
+.action-section {
+ display: flex;
+ justify-content: center;
+ gap: 15px;
+ margin-top: 25px;
+}
+.import-content {
+ padding: 10px 0;
+}
+.upload-section {
+ width: 100%;
+ margin-bottom: 20px;
+}
+.el-upload{
+ width: 100%;
+}
+.el-upload .el-upload-dragger{
+ width: 100%;
+}
.tab {
padding: 5px 15px;
}
--
Gitblit v1.8.0