From 9b6707a857d91aac00ca840661eb4998eabd7e4f Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@iotlink.com>
Date: 星期三, 21 十月 2020 17:40:36 +0800
Subject: [PATCH] 调整增加底库form的样式, 国标刷新按钮增加loading
---
src/pages/cameraAccess/components/DataStackInfo.vue | 54 ++++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 48 insertions(+), 6 deletions(-)
diff --git a/src/pages/cameraAccess/components/DataStackInfo.vue b/src/pages/cameraAccess/components/DataStackInfo.vue
index af2cfef..4bd21d6 100644
--- a/src/pages/cameraAccess/components/DataStackInfo.vue
+++ b/src/pages/cameraAccess/components/DataStackInfo.vue
@@ -105,7 +105,7 @@
</el-tooltip>
<!-- 鏂囦欢涓婁紶 -->
- <el-button type="primary" size="small" @click="handleUpload">
+ <el-button type="primary" size="small" :disabled="!DataStackPool.selectedDir.id" @click="handleUpload">
涓婁紶
<i class="el-icon-upload el-icon--right"></i>
</el-button>
@@ -129,10 +129,20 @@
<template slot-scope="{row}">
<div :class="snapshotClass">
<el-image
- v-show="row.snapshot_url !== ''"
+ v-if="row.type==1"
style="width: 30x; height: 30px"
:src="'/httpImage/' + row.snapshot_url"
fit="fill"
+ :preview-src-list="['/httpImage/' + row.snapshot_url]"
+ >
+ <div slot="error" :class="snapshotClass"></div>
+ </el-image>
+ <el-image
+ v-if="row.type==2"
+ style="width: 30x; height: 30px"
+ :src="`/files/${row.path.substr(row.path.lastIndexOf('/')+1)}`"
+ fit="fill"
+ :preview-src-list="[`/files/${row.path.substr(row.path.lastIndexOf('/')+1)}`]"
>
<div slot="error" :class="snapshotClass"></div>
</el-image>
@@ -254,7 +264,8 @@
<!-- 鏂囦欢棰勮 -->
<el-dialog title="鏌ョ湅鏂囦欢" :visible.sync="previewDialog" width="500px">
- <video :src="videoUrl" controls style="margin-top: 12px;">鎮ㄧ殑娴忚鍣ㄤ笉鏀寔 video 鏍囩銆�</video>
+ <video v-if="videoUrl" :src="videoUrl" controls style="margin-top: 12px;">鎮ㄧ殑娴忚鍣ㄤ笉鏀寔 video 鏍囩銆�</video>
+ <el-image v-if="imgUrl" :src="imgUrl"></el-image>
</el-dialog>
<el-dialog title="绉诲姩/澶嶅埗" :visible.sync="fileDialog" width="500px">
@@ -364,6 +375,7 @@
data() {
return {
videoUrl: "",
+ imgUrl: "",
previewDialog: false,
fileDialog: false,
isDisabled: true,
@@ -396,15 +408,30 @@
},
mounted() {
this.initFormData();
+ console.log(this.PollData.barCharts)
},
beforeDestroy() {
this.taskUid = 0;
},
+ watch:{
+ 'fileList.length':{
+ handler(n,o){
+ //鏁版嵁鏍堟枃浠舵暟閲忓彉鏇�
+ //鏇存柊鐙珛鍦烘櫙鏁版嵁鏍堟枃浠�
+ console.log(this.$root.$children[0].$children[1].$refs['sepRule'])
+ this.$root.$children[0].$children[1].$refs['sepRule'].getStackFiles();
+ }
+ }
+ },
methods: {
preview(row) {
- if (this.form.type === 1) {
- this.previewDialog = true;
+ this.previewDialog = true;
+ if (row.type === 1) {
+
this.videoUrl = "/files/" + row.identifier + ".mp4"
+ }else if(row.type===2){
+
+ this.imgUrl = "/files/" + row.path.substr(row.path.lastIndexOf('/')+1)
}
},
// 娓呯┖杈撳叆妗�
@@ -428,6 +455,7 @@
this.fileList = [];
},
selectDir(node) {
+
if (node.id === "") {
return
}
@@ -450,6 +478,8 @@
this.total = 0;
this.multipleSelection = []; // 娓呯┖閫変腑鐘舵��
this.initFetchListTask();
+ this.videoUrl = '';
+ this.imgUrl = '';
},
initFetchListTask() {
const uid = Math.round(Math.random() * 1000);
@@ -472,10 +502,12 @@
findAllFileByStackId({ name: this.searchInput, stackId: this.form.id, page: this.page, size: this.size, type: 0 }).then(rsp => {
if (rsp && rsp.success && rsp.data.total > 0) {
this.fileList = rsp.data.dataList;
+
this.total = rsp.data.total;
// 瀹氭椂鍒锋柊浼氭竻绌洪�変腑鐘舵�侊紝鍦ㄨ繖閲屾仮澶�
this.fileList.forEach(row => {
+ //this.polygonDatas.push({snapshot_url:row.snapshot_url})
if (this.multipleSelection.indexOf(row.id) !== -1) {
this.$nextTick(() => {
this.$refs.multipleTable.toggleRowSelection(row);
@@ -552,6 +584,7 @@
this.multipleSelection = [];
},
handleUpload() {
+ console.log(this.DataStackPool.selectedDir.id)
console.log(this.$refs.uploader.$refs.button.$refs.btn.click())
},
handleRefrashFileList(val) {
@@ -571,6 +604,9 @@
})
if (res && res.success) {
this.fetchFileList();
+ //鏇存柊鐙珛鍦烘櫙鏁版嵁鏍堟枃浠�
+ console.log(this.$root.$children[0].$children[1].$refs['sepRule'])
+ this.$root.$children[0].$children[1].$refs['sepRule'].getStackFiles();
this.$notify({
type: "success",
message: "鏂囦欢鎺掑簭鎴愬姛锛�"
@@ -609,6 +645,7 @@
cmd.cb(cmd.data);
},
handleFileDelete(rows, multi = false) {
+ let _this = this;
let ids = this.multipleSelection;
if (!multi) {
ids = [rows.id];
@@ -630,7 +667,8 @@
type: "error",
message: "鏂囦欢宸插垹闄�"
})
- })
+ });
+
}).catch(() => { })
},
handleFileMove(row) {
@@ -718,6 +756,10 @@
.el-form-item__label {
text-align: left;
}
+ .el-button--primary.is-disabled{
+ background-color: #9eb4f0 !important;
+ border-color: #9eb4f0 !important;
+ }
.label {
color: #606266;
font-size: 14px;
--
Gitblit v1.8.0