|
@@ -4,7 +4,7 @@
|
|
|
v-model="props.openScan"
|
|
|
width="964px"
|
|
|
top="20vh"
|
|
|
- title="扫描文档"
|
|
|
+ title="设备已扫描文档"
|
|
|
:close-on-click-modal="false"
|
|
|
@close="closeOpen"
|
|
|
>
|
|
@@ -14,16 +14,23 @@
|
|
|
<el-checkbox v-model="checkedAll" @change="checkAllChange"
|
|
|
>共{{ props.scannerFiles.length }}项</el-checkbox
|
|
|
>
|
|
|
- <div class="">
|
|
|
+ <div class="" v-if="copyList.length>0">
|
|
|
+ <el-button @click="toDownFile" style="margin-right: 10px;">
|
|
|
+ <img src="@/assets/images/download.png" alt="" style="width: 22px; height: 22px;" /> 下载
|
|
|
+ </el-button>
|
|
|
+ <el-button color="#2E6BC8" @click="toMoveMy" style="margin-right: 10px;">
|
|
|
+ <img src="@/assets/images/folder_white.png" alt="" /> 移动到我的空间
|
|
|
+ </el-button>
|
|
|
<el-button color="#2E6BC8" @click="toSave">
|
|
|
- <img src="@/assets/images/folder_white.png" alt="" /> 移动到
|
|
|
+ <img src="@/assets/images/folder_white.png" alt="" /> 移动到..
|
|
|
</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 盒子区域 -->
|
|
|
<div class="bigBox" id="bigBox">
|
|
|
- <div v-for="(item, index) in copyList" :key="item" class="one_box">
|
|
|
- <img :src="wangzhi + item.path" alt="" />
|
|
|
+ <div v-if="copyList.length==0" style="margin-bottom: 20px;">请先在该扫描仪设备上进行文件扫描,并采用FTP上传方式。</div>
|
|
|
+ <div v-if="copyList.length>0" v-for="(item, index) in copyList" :key="item" class="one_box">
|
|
|
+ <img :src="wangzhi + item.path" alt="" title="点击可查看大图" @click="onshowpreview(item)"/>
|
|
|
<div class="top_check">
|
|
|
<el-checkbox
|
|
|
:checked="fileArr.some((par) => par == item.q)"
|
|
@@ -35,6 +42,12 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
+ <ImgPreview
|
|
|
+ :previewData="previewData"
|
|
|
+ :copyFileType="copyFileType"
|
|
|
+ :showPreview="showPreview"
|
|
|
+ @closeImgPreview="onCloseImgPreview"
|
|
|
+ ></ImgPreview>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
@@ -49,8 +62,11 @@ import {
|
|
|
defineExpose,
|
|
|
onDeactivated,
|
|
|
} from "vue";
|
|
|
+
|
|
|
+import ImgPreview from "@/components/ImgPreview/ImgPreview.vue";
|
|
|
import Sortable from "sortablejs";
|
|
|
import { ElMessage } from "element-plus";
|
|
|
+
|
|
|
const props = defineProps({
|
|
|
openScan: {
|
|
|
type: Boolean,
|
|
@@ -72,29 +88,6 @@ const emit = defineEmits(["closeOpen", "saveScanFile"]);
|
|
|
const closeOpen = () => {
|
|
|
emit("closeOpen");
|
|
|
};
|
|
|
-// const checkChange = (item,index) => {
|
|
|
-// console.log('item',item);
|
|
|
-// console.log('index',index);
|
|
|
-// let arr = fileArr.value;
|
|
|
-// if (arr.some((par) => par == item.q)) {
|
|
|
-// arr = arr.filter((par) => par != item.q);
|
|
|
-// } else {
|
|
|
-// arr.push(item.q);
|
|
|
-// }
|
|
|
-// // if (arr.some((par) => par == item.q)) {
|
|
|
-// // arr = arr.filter((par) => par != item.q);
|
|
|
-// // } else {
|
|
|
-// // arr.push({q:item.q,index:index});
|
|
|
-// // }
|
|
|
-// // 判断全选
|
|
|
-// if (arr.length == props.scannerFiles.length) {
|
|
|
-// checkedAll.value = true;
|
|
|
-// } else {
|
|
|
-// checkedAll.value = false;
|
|
|
-// }
|
|
|
-// fileArr.value = JSON.parse(JSON.stringify(arr));
|
|
|
-// console.log("fileArr", toRaw(fileArr.value));
|
|
|
-// };
|
|
|
const checkChange = (item, index) => {
|
|
|
// console.log("item", item);
|
|
|
// console.log("index", index);
|
|
@@ -144,10 +137,24 @@ const toSave = () => {
|
|
|
arr.push(toRaw(item));
|
|
|
}
|
|
|
});
|
|
|
- // console.log('arr',arr);
|
|
|
- // console.log('chengeC',copyList.value);
|
|
|
emit("saveScanFile", arr);
|
|
|
};
|
|
|
+const toDownFile=()=>{
|
|
|
+ if (!copyList.value.some((item) => item.checked == true)) {
|
|
|
+ return ElMessage({ message: "请先勾选文件", type: "error" });
|
|
|
+ }
|
|
|
+ copyList.value.forEach((item) => {
|
|
|
+ if (item.checked) {
|
|
|
+ const img=document.createElement("a");
|
|
|
+ img.href=wangzhi+item.path;
|
|
|
+ img.download=item.name;
|
|
|
+ document.body.appendChild(img)
|
|
|
+ img.click();
|
|
|
+ document.body.removeChild(img)
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+};
|
|
|
const rowDrop = () => {
|
|
|
const el = document.getElementById("bigBox"); //找到想要拖拽的那一列
|
|
|
Sortable.create(el, {
|
|
@@ -172,6 +179,17 @@ onMounted(async () => {
|
|
|
// console.log("copyList.value", copyList.value);
|
|
|
}, 500);
|
|
|
});
|
|
|
+
|
|
|
+const copyFileType = ref('.png');
|
|
|
+let showPreview = ref(false);
|
|
|
+let previewData = ref();
|
|
|
+const onshowpreview=(img)=>{
|
|
|
+ showPreview.value = true;
|
|
|
+ previewData.value = wangzhi+img.path;
|
|
|
+}
|
|
|
+const onCloseImgPreview=()=>{
|
|
|
+ showPreview.value = false;
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
@@ -194,7 +212,7 @@ onMounted(async () => {
|
|
|
max-height: 700px;
|
|
|
display: flex;
|
|
|
flex-wrap: wrap;
|
|
|
- justify-content: space-between;
|
|
|
+ //justify-content: space-between;
|
|
|
overflow-y: auto;
|
|
|
.one_box {
|
|
|
width: 300px;
|
|
@@ -202,13 +220,14 @@ onMounted(async () => {
|
|
|
border: 1px solid #c1cce3;
|
|
|
box-sizing: border-box;
|
|
|
margin-bottom: 16px;
|
|
|
+ margin-right: 16px;
|
|
|
border-radius: 4px 4px 4px 4px;
|
|
|
box-shadow: 0px 2px 10px 1px rgba(199, 203, 216, 0.4);
|
|
|
position: relative;
|
|
|
img {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
- object-fit: cover;
|
|
|
+ object-fit: fill;
|
|
|
}
|
|
|
.top_check {
|
|
|
position: absolute;
|
|
@@ -217,6 +236,9 @@ onMounted(async () => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+.el-checkbox__inner{
|
|
|
+ border: 1px solid #868de1 !important;
|
|
|
+}
|
|
|
:deep(.el-dialog__body) {
|
|
|
padding: 0 !important;
|
|
|
}
|