diff --git a/src/assets/js/api/equipmentCenter/cameraList.js b/src/assets/js/api/equipmentCenter/cameraList.js index b5504a27..a9d49603 100644 --- a/src/assets/js/api/equipmentCenter/cameraList.js +++ b/src/assets/js/api/equipmentCenter/cameraList.js @@ -84,4 +84,14 @@ export const addOcrZonePlaceApi = data => post('xmgl/ocrZonePlace/add', data); // 编辑ocr识别区域位置信息 export const editOcrZonePlaceApi = data => post('xmgl/ocrZonePlace/edit', data); // 删除ocr识别区域位置信息 -export const deleteOcrZonePlaceApi = data => post('xmgl/ocrZonePlace/delete', data); \ No newline at end of file +export const deleteOcrZonePlaceApi = data => post('xmgl/ocrZonePlace/delete', data); + +// 摄像机列表 +// 批量删除 +export const deleteVideoItemBatchApi = data => post('xmgl/videoItem/deleteBatch', data); +// 下载模版 +export const downloadExcelTemplateApi = data => get('xmgl/videoItem/downloadExcelTemplate', data); +// 导入模版 +export const importExcelApi = data => post('xmgl/videoItem/importExcel', data); +// 移动分组 +export const moveGroupApi = data => post('xmgl/videoItem/moveGroup', data); \ No newline at end of file diff --git a/src/views/equipmentCenter/videoManage/cameraList_lc.vue b/src/views/equipmentCenter/videoManage/cameraList_lc.vue index cf2c2c77..d4ee9f32 100644 --- a/src/views/equipmentCenter/videoManage/cameraList_lc.vue +++ b/src/views/equipmentCenter/videoManage/cameraList_lc.vue @@ -1,48 +1,87 @@ \ No newline at end of file diff --git a/src/views/equipmentCenter/videoManage/videoConfig.vue b/src/views/equipmentCenter/videoManage/videoConfig.vue index 3561809d..9932114e 100644 --- a/src/views/equipmentCenter/videoManage/videoConfig.vue +++ b/src/views/equipmentCenter/videoManage/videoConfig.vue @@ -140,6 +140,39 @@ {{ $t("message.videoManage.configAccount") }} + 模版下载 + + + 批量导入 + + 批量移动 + + 删除 + +
+ + + + + + + + + + + + + +
+
- + { + if (valid) { + if (this.selectionList.length === 0) + return this.$message.warning("请勾选需要移动的数据!"); + const itemIds = this.selectionList.map((item) => item.itemId); + const params = { + itemIds, + videoGroupId: this.currentVideoTypeDetail.groupId, + projectSn: this.projectSn, + }; + moveGroupApi(params).then((res) => { + if (res.success) { + this.$message.success(res.message); + this.moveGroupDialog = false; + this.getVideoList(); + } + }); + } else { + console.log("error submit!!"); + return false; + } + }); + }, + // 导入成功 + handleImportSuccess(res) { + if (res.code == 200) { + this.$message.success(res.message); + if (this.videoType === 1) { + this.$refs.camera.setVideoInfo(this.configInfoParams); + } else { + this.$refs.cameralc.setVideoInfo(this.configInfoParams); + } + } else { + this.$message.error(res.message); + } + console.log("导入", res); + }, + // 导出模版 + exportBtnTemplate() { + const requestData = { + projectSn: this.projectSn, + videoType: this.videoType, + }; + fetch( + this.$http.defaults.baseURL + + `xmgl/videoItem/downloadExcelTemplate?projectSn=${this.projectSn}&videoType=${this.videoType}`, + { + method: "get", + headers: { + Authorization: this.$store.state.userInfo.token, + "Content-Type": "application/json", // 设置请求头的内容类型为JSON + }, + // body: JSON.stringify(requestData), + } + ) + .then((response) => { + // 处理响应 + if (!response.ok) { + throw new Error("导出失败"); + } + return response.blob(); + }) + .then((blob) => { + console.log("导出成功"); + // 创建一个下载链接 + const url = window.URL.createObjectURL(blob); + // 创建一个元素 + const link = document.createElement("a"); + link.href = url; + link.download = "视频监控点模板.xlsx"; // 指定下载文件的文件名 + // 模拟点击下载链接 + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + // 释放URL对象 + window.URL.revokeObjectURL(url); + // 处理导出的文件 + // 这里可以使用blob对象来获取导出的文件内容或者将其保存到本地 + }) + .catch((error) => { + // 处理错误 + console.error(error); + }); + }, + selectDevice(event) { + console.log(event); + this.selectionList = event; + }, + deleteAttendanceBatch() { + if (this.selectionList.length === 0) + return this.$message.warning("请勾选需要删除的数据!"); + this.$confirm("删除后操作不可恢复,请谨慎操作!", "警告", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(() => { + console.log(this.selectionList); + + const itemIds = this.selectionList + .map((item) => item.itemId) + .join(","); + deleteVideoItemBatchApi({ itemIds }).then((res) => { + this.selectionList = []; + this.$refs.cameralc.setVideoInfo(this.configInfoParams); + }); + }) + .catch(() => {}); + }, + visibleChange(event) { + console.log(event); + if (event) { this.filterText = ""; } }, @@ -1588,13 +1815,13 @@ export default { }, recursion(array) { // 递归 筛选出节点的id - return array.filter(item => { + return array.filter((item) => { if (item.children && item.children.length > 0) { this.recursion(item.children); } console.log(item.groupName, item.groupName.indexOf(this.filterText)); return item.groupName.indexOf(this.filterText) !== -1; - }) + }); }, filterNode(value, data) { if (!value) return true; @@ -1749,7 +1976,7 @@ export default { // appSecret: '0a5836c68a7edabcc78e6a18f05bb317' }; this.isRouterAlive = false; - if(this.currentGroupInfo.id) { + if (this.currentGroupInfo.id) { this.treeFormClick(this.currentGroupInfo); } this.$nextTick(() => {