|
@@ -1,7 +1,7 @@
|
|
|
<!-- eslint-disable prettier/prettier -->
|
|
|
<template>
|
|
|
<div class="bodycontent">
|
|
|
- <div class="sheard">
|
|
|
+ <div class="sheard1">
|
|
|
<div class="searchheard">
|
|
|
<div class="item">
|
|
|
<div>区域:</div>
|
|
@@ -101,6 +101,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
+
|
|
|
<div>
|
|
|
<el-table
|
|
|
:data="tableData"
|
|
@@ -220,7 +221,7 @@
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <el-dialog v-model="pdfviewshow" :title="`文件预览`" width="60vw" >
|
|
|
+ <el-dialog v-model="pdfviewshow" :title="`文件预览`" width="90vw" >
|
|
|
|
|
|
|
|
|
<div style="position: relative;min-height:70vh">
|
|
@@ -232,10 +233,9 @@
|
|
|
<el-button type="primary" icon="DArrowRight" :disabled="ccindex+1>=filelist.length" @click="fileindexlook(ccindex+1)"></el-button>
|
|
|
</div>
|
|
|
</el-affix>
|
|
|
- <pdfview :src="currentfile.url" :size="currentfile.size"></pdfview>
|
|
|
-
|
|
|
-
|
|
|
+ <pdfview :src="currentfile.url" :ispic="(currentfile.fileSuffix+'').indexOf('pdf')==-1" :isprint="hsp('filemanager.project.file.download')?1:0" :size="currentfile.size"></pdfview>
|
|
|
|
|
|
+ <el-button v-hasPermi="['filemanager.project.file.download']" v-if="(currentfile.fileSuffix+'').indexOf('pdf')==-1" type="primary" style="position:absolute;right: 0;top: 0;z-index: 11" @click="printfile(currentfile)">打印</el-button>
|
|
|
</div>
|
|
|
<!-- <div><el-affix :offset="120" position="bottom"><el-button type="text" icon="DArrowRight"></el-button></el-affix></div>
|
|
|
</div> -->
|
|
@@ -365,7 +365,8 @@
|
|
|
<template #default="scope">
|
|
|
<div style="display: flex;">
|
|
|
<img style="width: 25px;height:25px" :src="gettypeicon(scope.row.fileSuffix)"/>
|
|
|
- <div>{{ scope.row.originalName }}</div>
|
|
|
+
|
|
|
+ <div><el-badge v-if="scope.row.isnew" value="新" style="position:absolute;right: 0;top:10px"></el-badge>{{ scope.row.originalName }}</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -410,6 +411,7 @@
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
+
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
@@ -430,13 +432,22 @@ import {
|
|
|
updateArchives,
|
|
|
delArchives,
|
|
|
getArchive_files,
|
|
|
- saveArchive_files
|
|
|
+ saveArchive_files, getArchives
|
|
|
} from "@/api/archives/index";
|
|
|
import _ from "lodash";
|
|
|
import {useRoute} from "vue-router";
|
|
|
import useUserStore from "@/store/modules/user";
|
|
|
import moment from "moment";
|
|
|
import {ElLoading} from "element-plus";
|
|
|
+import auth from "@/plugins/auth";
|
|
|
+import printJS from "print-js";
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+const hsp = (v:string)=>{
|
|
|
+ if(status.value=="0") return false;
|
|
|
+ return auth.hasPermi(v)
|
|
|
+}
|
|
|
|
|
|
|
|
|
const userroles = useUserStore().roles;
|
|
@@ -453,7 +464,6 @@ var isnormal = false;
|
|
|
|
|
|
const uploadbtnenable = ref(false);
|
|
|
|
|
|
-
|
|
|
const searchForm = ref({
|
|
|
area: "",
|
|
|
qiuquan: "",
|
|
@@ -623,12 +633,12 @@ const updatecurrent = (id, status: number) => {
|
|
|
id: id,
|
|
|
status: status + "",
|
|
|
...(status == 4
|
|
|
- ? { ext1: JSON.stringify({ projectreson: projectreson.value }) }
|
|
|
+ ? { ext1: JSON.stringify({ projectreson: projectreson.value }),ext2: "{}" }
|
|
|
: {}),
|
|
|
}).then((res) => {
|
|
|
ElMessage.success("保存成功");
|
|
|
shvisable.value = false;
|
|
|
- getnextdata(1);
|
|
|
+ getnextdata(currentpage.value);
|
|
|
});
|
|
|
};
|
|
|
|
|
@@ -651,7 +661,7 @@ const tableRowClassName = ({ row, rowIndex }: { row: any; rowIndex: number }) =>
|
|
|
const deleteitem = (id: any) => {
|
|
|
delArchives(id).then((res) => {
|
|
|
ElMessage.success("删除成功");
|
|
|
- getnextdata(1);
|
|
|
+ getnextdata(currentpage.value);
|
|
|
});
|
|
|
};
|
|
|
|
|
@@ -662,9 +672,7 @@ const filedel = (item) => {
|
|
|
delOss(item.ossId).then(res => {
|
|
|
ElMessage.success("删除成功");
|
|
|
setTimeout(() => {
|
|
|
- getArchive_files(currentitem.value.id).then((res1) => {
|
|
|
- filelist.value = res1.data
|
|
|
- });
|
|
|
+ getfilelist()
|
|
|
}, 1000);
|
|
|
|
|
|
})
|
|
@@ -686,9 +694,7 @@ const deletefilebanch = () => {
|
|
|
if (index == delindex) {
|
|
|
ElMessage.success("删除成功");
|
|
|
setTimeout(() => {
|
|
|
- getArchive_files(currentitem.value.id).then((res1) => {
|
|
|
- filelist.value = res1.data
|
|
|
- });
|
|
|
+ getfilelist()
|
|
|
}, 1000);
|
|
|
|
|
|
}
|
|
@@ -699,14 +705,34 @@ const deletefilebanch = () => {
|
|
|
}
|
|
|
|
|
|
|
|
|
+const getfilelist =()=>{
|
|
|
+ getArchives(currentitem.value.id).then(res1=>{
|
|
|
+ currentitem.value = res1.data;
|
|
|
+
|
|
|
+ getArchive_files(currentitem.value.id).then((res1) => {
|
|
|
+ if(currentitem.value.ext2!=null && currentitem.value.ext2!=undefined){
|
|
|
+ let filenewdata = JSON.parse(currentitem.value.ext2);
|
|
|
+ if(filenewdata["newfile"]!=undefined){
|
|
|
+ res1.data= res1.data.map(i=>{
|
|
|
+ if(filenewdata["newfile"].indexOf(i.ossId)!=-1){
|
|
|
+ return {...i,isnew:true}
|
|
|
+ }else{
|
|
|
+ return {...i,isnew:false}
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ filelist.value = res1.data
|
|
|
+ });
|
|
|
+ })
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
const lookfiles = (item) => {
|
|
|
currentitem.value = item;
|
|
|
drawer.value = true;
|
|
|
selectfiles.value = [];
|
|
|
-
|
|
|
- getArchive_files(item.id).then((res) => {
|
|
|
- filelist.value = res.data
|
|
|
- });
|
|
|
+ getfilelist();
|
|
|
};
|
|
|
const showfileuplaod = ref(false);
|
|
|
const uploadfilelist = ref("");
|
|
@@ -718,9 +744,7 @@ const saveuploadfiles = () => {
|
|
|
saveArchive_files(currentitem.value.id, uploadfilelist.value).then(res => {
|
|
|
ElMessage.success("保存成功");
|
|
|
showfileuplaod.value = false;
|
|
|
- getArchive_files(currentitem.value.id).then((res) => {
|
|
|
- filelist.value = res.data
|
|
|
- });
|
|
|
+ getfilelist()
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -794,6 +818,19 @@ const downloadfile = (file) => {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+const printfile = (file)=>{
|
|
|
+ listByIds(file.ossId).then((res) => {
|
|
|
+ printJS({
|
|
|
+ printable: [
|
|
|
+ res.data[0].url
|
|
|
+ ],
|
|
|
+ type: "image",
|
|
|
+ header: "",
|
|
|
+ imageStyle: "width:100%;height:100%; margin-bottom:0px;",
|
|
|
+ });
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -830,7 +867,7 @@ const gettypeicon = (type) => {
|
|
|
<style type="scss" scoped>
|
|
|
.bodycontent {
|
|
|
padding: 10px 15px;
|
|
|
- .sheard {
|
|
|
+ .sheard1 {
|
|
|
position: relative;
|
|
|
padding: 10px 0px;
|
|
|
.searchheard {
|
|
@@ -865,4 +902,5 @@ const gettypeicon = (type) => {
|
|
|
.el-table .danger-row {
|
|
|
--el-table-tr-bg-color: var(--el-color-danger-light-9);
|
|
|
}
|
|
|
+
|
|
|
</style>
|