| | |
| | | </el-card> |
| | | <el-row type="flex"> |
| | | <el-col :span="20"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"> |
| | | <el-form :model="queryParams" ref="queryForm" size="mini" :inline="true" v-show="showSearch"> |
| | | <el-form-item label="关键字" prop="name"> |
| | | <el-input |
| | | v-model="queryParams.name" |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="分建类型"> |
| | | <el-select v-model="queryParams.constructionType" @change="handleQuery" clearable placeholder="分建类型"> |
| | | <el-option v-for="(item,index) in constructionTypeList" :key="index" :label="item.label" :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">搜索</el-button> |
| | | <el-button icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button> |
| | | |
| | | </el-form-item> |
| | | |
| | | </el-form> |
| | | <!-- 导出按钮 --> |
| | | <div v-hasPermi="['system:monitor:export']"> |
| | | <el-button style="margin-right: 10px" slot="reference" type="primary" size="mini" @click="handleExport" plain >导出</el-button> |
| | | <el-popover |
| | | placement="left" |
| | | width="300px" |
| | | trigger="click"> |
| | | <span style="font-weight: bold;font-size: 16px">导出报表</span> |
| | | <el-form ref="exportForm" :model="exportForm" :rules="exportRules" label-width="100px"> |
| | | <el-form-item label="考核时间" prop="month" required> |
| | | <el-date-picker |
| | | v-model="exportForm.month" |
| | | format="yyyy-MM" |
| | | value-format="yyyy-MM" |
| | | type="month" |
| | | placeholder="选择月"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="区县" prop="deptIds"> |
| | | <el-select v-model="exportForm.deptIds" multiple clearable> |
| | | <el-option |
| | | v-for="dept in deptList" |
| | | :key="dept.deptId" |
| | | :label="dept.area" |
| | | :value="dept.deptId" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="标签" prop="tags"> |
| | | <el-checkbox-group v-model="exportForm.tags"> |
| | | <el-checkbox |
| | | v-for="item in tagOptions" |
| | | :key="item.value" |
| | | :label="item.value" |
| | | >{{ item.label }} |
| | | </el-checkbox> |
| | | </el-checkbox-group> |
| | | </el-form-item> |
| | | <el-form-item label="数据类型" prop="dataType" required> |
| | | <el-radio-group v-model="exportForm.dataType"> |
| | | <!-- <div style="display: flex;margin-bottom: 10px;">--> |
| | | <!-- <div style="width: 48%">--> |
| | | <el-radio :label="0">总量数据</el-radio> |
| | | <!-- </div>--> |
| | | <!-- <div style="width: 48%">--> |
| | | <el-radio :label="1">每日在线情况</el-radio> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div style="display: flex;">--> |
| | | <!-- <div style="width: 48%">--> |
| | | <el-radio :label="2">每日录像情况</el-radio> |
| | | <!-- </div>--> |
| | | <!-- <div style="width: 48%">--> |
| | | <el-radio :label="3">每日录像缺失时长</el-radio> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-button type="primary" size="small" style="width: 100%" @click="handleFormExport">导出</el-button> |
| | | </el-form> |
| | | <el-button slot="reference" type="primary" size="mini" plain>导出报表</el-button> |
| | | </el-popover> |
| | | <div style="display: flex"> |
| | | <div v-hasPermi="['system:monitor:export']"> |
| | | <el-button style="margin-right: 10px" slot="reference" type="primary" size="mini" @click="handleExport" plain >导出</el-button> |
| | | <el-popover |
| | | placement="left" |
| | | width="300px" |
| | | trigger="click"> |
| | | <span style="font-weight: bold;font-size: 16px">导出报表</span> |
| | | <el-form ref="exportForm" :model="exportForm" :rules="exportRules" label-width="100px"> |
| | | <el-form-item label="考核时间" prop="month" required> |
| | | <el-date-picker |
| | | v-model="exportForm.month" |
| | | format="yyyy-MM" |
| | | value-format="yyyy-MM" |
| | | type="month" |
| | | placeholder="选择月"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="区县" prop="deptIds"> |
| | | <el-select v-model="exportForm.deptIds" multiple clearable> |
| | | <el-option |
| | | v-for="dept in deptList" |
| | | :key="dept.deptId" |
| | | :label="dept.area" |
| | | :value="dept.deptId" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="标签" prop="tags"> |
| | | <el-checkbox-group v-model="exportForm.tags"> |
| | | <el-checkbox |
| | | v-for="item in tagOptions" |
| | | :key="item.value" |
| | | :label="item.value" |
| | | >{{ item.label }} |
| | | </el-checkbox> |
| | | </el-checkbox-group> |
| | | </el-form-item> |
| | | <el-form-item label="数据类型" prop="dataType" required> |
| | | <el-radio-group v-model="exportForm.dataType"> |
| | | <!-- <div style="display: flex;margin-bottom: 10px;">--> |
| | | <!-- <div style="width: 48%">--> |
| | | <el-radio :label="0">总量数据</el-radio> |
| | | <!-- </div>--> |
| | | <!-- <div style="width: 48%">--> |
| | | <el-radio :label="1">每日在线情况</el-radio> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div style="display: flex;">--> |
| | | <!-- <div style="width: 48%">--> |
| | | <el-radio :label="2">每日录像情况</el-radio> |
| | | <!-- </div>--> |
| | | <!-- <div style="width: 48%">--> |
| | | <el-radio :label="3">每日录像缺失时长</el-radio> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-button type="primary" size="small" style="width: 100%" @click="handleFormExport">导出</el-button> |
| | | </el-form> |
| | | <el-button slot="reference" type="primary" size="mini" plain>导出报表</el-button> |
| | | |
| | | </el-popover> |
| | | <el-button style="margin-left: 10px" type="primary" size="mini" @click="openImport" plain>导入设备标签</el-button> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <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"/> |
| | |
| | | <div v-else-if="scope.row.osdtime == null">未知</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="建设类型标签" align="center" prop="constructTag" width="180" v-if="columns[12].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 |
| | |
| | | :limit.sync="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | <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> |
| | | <!-- 设备资产详情 --> |
| | | <el-dialog title="视频监控详情" :visible.sync="open" width="800px" append-to-body> |
| | | <el-form ref="form" :model="form" label-width="150px" size="mini"> |
| | |
| | | <script> |
| | | import {videoCount, listMonitor, getMonitor, delMonitor, addMonitor, updateMonitor} from "@/api/platform/monitor"; |
| | | import {listDept} from "@/api/system/dept"; |
| | | |
| | | import { importData } from "@/api/platform/monitorConstruction" |
| | | import {getToken} from "@/utils/auth"; |
| | | export default { |
| | | name: "Monitor", |
| | | dicts: ['sys_normal_disable', 'platform_yes_no', 'camera_state'], |
| | | data() { |
| | | return { |
| | | importShow: false, |
| | | upload: false, |
| | | fileList: [], |
| | | currentFile: null, |
| | | |
| | | constructionTypeList:[ |
| | | { label:'一二期',value:'PHASE_ONE_TWO' }, |
| | | { label:'三期',value:'PHASE_THREE' }, |
| | | { label:'四区人脸',value:'PHASE_FOURTH' }, |
| | | { label:'东部新城',value:'EASTERN_NEW_CITY' }, |
| | | { label:'沿滩二期人脸',value:'YAN_TAN_PHASE_TWO_FACE' }, |
| | | { label: '入川即检',value: 'CHECK_ENTER_SICHUAN'} |
| | | ], |
| | | deptList: [], |
| | | // 列信息 |
| | | columns: [ |
| | |
| | | {key: 8, label: `录像完整状态`, visible: false}, |
| | | {key: 9, label: `录像缺失时长`, visible: false}, |
| | | {key: 10, label: `OSD标注`, visible: false}, |
| | | {key: 11, label: `OSD时间`, visible: false} |
| | | {key: 11, label: `OSD时间`, visible: false}, |
| | | {key: 12, label: `建设类型`, visible: true} |
| | | ], |
| | | count: { |
| | | totalPosts: 0, |
| | |
| | | }); |
| | | }, |
| | | methods: { |
| | | openImport(){ |
| | | this.fileList = [] |
| | | this.currentFile = null; |
| | | this.importShow = true; |
| | | this.upload = false; |
| | | |
| | | }, |
| | | 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`); |
| | | }, |
| | | clickTab(active) { |
| | | if (active === 0) { |
| | | this.queryParams.provinceTag = true |
| | |
| | | if (this.exportForm.dataType === 0) { |
| | | this.download('system/monitor/export/video/total', { |
| | | ...this.exportForm, |
| | | }, `总量情况_${new Date().getTime()}.xlsx`) |
| | | }, `总量情况_${new Date().getTime()}.xlsx`, { |
| | | timeout: 60000 |
| | | }) |
| | | } else if (this.exportForm.dataType === 1) { |
| | | this.download('system/monitor/export/video/online', { |
| | | ...this.exportForm, |
| | | }, `点位在线_${new Date().getTime()}.xlsx`) |
| | | }, `点位在线_${new Date().getTime()}.xlsx`, { |
| | | timeout: 60000 |
| | | }) |
| | | } else if (this.exportForm.dataType === 2) { |
| | | this.download('system/monitor/export/video/record', { |
| | | ...this.exportForm, |
| | | }, `录像情况_${new Date().getTime()}.xlsx`) |
| | | }, `录像情况_${new Date().getTime()}.xlsx`, { |
| | | timeout: 60000 |
| | | }) |
| | | } else if (this.exportForm.dataType === 3) { |
| | | this.download('system/monitor/export/video/loseTime', { |
| | | ...this.exportForm, |
| | | }, `录像缺失时长_${new Date().getTime()}.xlsx`) |
| | | }, `录像缺失时长_${new Date().getTime()}.xlsx`, { |
| | | timeout: 60000 |
| | | }) |
| | | } |
| | | } |
| | | }); |
| | |
| | | }; |
| | | </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; |
| | | } |