Commit f7c54e66 by zhaopanyu

zpy 1.19

parent 0e603a0e
...@@ -8,17 +8,21 @@ ...@@ -8,17 +8,21 @@
"lint": "vue-cli-service lint" "lint": "vue-cli-service lint"
}, },
"dependencies": { "dependencies": {
"@vue-office/docx": "^1.6.0",
"@vue-office/excel": "^1.6.0",
"amfe-flexible": "^2.2.1", "amfe-flexible": "^2.2.1",
"axios": "^0.21.1", "axios": "^0.21.1",
"compression-webpack-plugin": "^6.1.1", "compression-webpack-plugin": "^6.1.1",
"core-js": "^3.6.5", "core-js": "^3.6.5",
"dingtalk-jsapi": "^3.0.28", "dingtalk-jsapi": "^3.0.29",
"fs": "^0.0.1-security", "fs": "^0.0.1-security",
"js-base64": "^3.7.5",
"js-cookie": "^3.0.1", "js-cookie": "^3.0.1",
"moment": "^2.29.4", "moment": "^2.29.4",
"path": "^0.12.7", "path": "^0.12.7",
"useless-files-webpack-plugin": "^1.0.1", "useless-files-webpack-plugin": "^1.0.1",
"vant": "^3.0.16", "vant": "^3.0.16",
"viewerjs": "^1.11.6",
"vue": "^3.2.26", "vue": "^3.2.26",
"vue-baidu-calendar": "^1.0.8", "vue-baidu-calendar": "^1.0.8",
"vue-router": "^4.0.0-0", "vue-router": "^4.0.0-0",
......
...@@ -79,9 +79,9 @@ ...@@ -79,9 +79,9 @@
<div v-if="list && list.fileList"> <div v-if="list && list.fileList">
<div v-for="(item, index) in list.fileList " :key="index"> <div v-for="(item, index) in list.fileList " :key="index">
{{ item.fjmc }} {{ item.fjmc }}
<van-button size="mini" type="primary" v-if="!file" @click=" <!-- <van-button size="mini" type="primary" v-if="!file" @click="
downloadAttachments(index)">下载附件</van-button> downloadAttachments(index)">下载附件</van-button> -->
<van-button size="mini" type="success" @click="previews" v-else>预览</van-button> <van-button size="mini" type="primary" @click="previews(index)">预览</van-button>
</div> </div>
</div> </div>
...@@ -240,7 +240,7 @@ ...@@ -240,7 +240,7 @@
<script setup> <script setup>
import { encode } from 'js-base64';
import { ref, toRefs, computed, reactive, onMounted } from "vue"; import { ref, toRefs, computed, reactive, onMounted } from "vue";
import * as dd from "dingtalk-jsapi"; import * as dd from "dingtalk-jsapi";
import { import {
...@@ -406,15 +406,21 @@ const downloadAttachments = async (index) => { ...@@ -406,15 +406,21 @@ const downloadAttachments = async (index) => {
}); });
} }
//预览 //预览
const previews = async () => { const previews = async (index) => {
loadData(); // loadData();
dd.previewFileInDingTalk({ // dd.previewFileInDingTalk({
spaceId: fileDataObj.value.spaceId, // spaceId: fileDataObj.value.spaceId,
fileId: fileDataObj.value.fileId, // fileId: fileDataObj.value.fileId,
fileName: fileDataObj.value.fileName, // fileName: fileDataObj.value.fileName,
fileSize: fileDataObj.value.fileSize, // fileSize: fileDataObj.value.fileSize,
fileType: fileDataObj.value.fileType, // fileType: fileDataObj.value.fileType,
}) // })
const url = window.location.protocol + '//' + window.location.host + baseUrl + list.value.fileList[index].fjdz
const encodedUrl = encode(url);;
console.log(encodedUrl, 'encodedUrl');
// const previewUrl = 'http://222.174.117.26:11321/kkFileView/onlinePreview?url=' + encodeURIComponent(encodedUrl);
const previewUrl = 'http://192.168.1.114:8012/onlinePreview?url=' + encodeURIComponent(encodedUrl);
window.open(previewUrl);
}; };
const pyr = async () => { const pyr = async () => {
......
...@@ -53,9 +53,9 @@ ...@@ -53,9 +53,9 @@
<div v-if="list && list.fileList"> <div v-if="list && list.fileList">
<div v-for="(item, index) in list.fileList " :key="index"> <div v-for="(item, index) in list.fileList " :key="index">
{{ item.fjmc }} {{ item.fjmc }}
<van-button size="mini" type="primary" v-if="!file" @click=" <!-- <van-button size="mini" type="primary" v-if="!file" @click="
downloadAttachments(index)">下载附件</van-button> downloadAttachments(index)">下载附件</van-button> -->
<van-button size="mini" type="success" @click="previews" v-else>预览</van-button> <van-button size="mini" type="primary" @click="previews(index)">预览</van-button>
</div> </div>
</div> </div>
</td> </td>
...@@ -211,7 +211,7 @@ ...@@ -211,7 +211,7 @@
<script setup> <script setup>
import { encode } from 'js-base64';
import { ref, toRefs, computed, reactive, onMounted } from "vue"; import { ref, toRefs, computed, reactive, onMounted } from "vue";
import * as dd from "dingtalk-jsapi"; import * as dd from "dingtalk-jsapi";
import { import {
...@@ -344,15 +344,21 @@ const downloadAttachments = async (index) => { ...@@ -344,15 +344,21 @@ const downloadAttachments = async (index) => {
}); });
} }
//预览 //预览
const previews = async () => { const previews = async (index) => {
loadData(); // loadData();
dd.previewFileInDingTalk({ // dd.previewFileInDingTalk({
spaceId: fileDataObj.value.spaceId, // spaceId: fileDataObj.value.spaceId,
fileId: fileDataObj.value.fileId, // fileId: fileDataObj.value.fileId,
fileName: fileDataObj.value.fileName, // fileName: fileDataObj.value.fileName,
fileSize: fileDataObj.value.fileSize, // fileSize: fileDataObj.value.fileSize,
fileType: fileDataObj.value.fileType, // fileType: fileDataObj.value.fileType,
}) // })
const url = window.location.protocol + '//' + window.location.host + baseUrl + list.value.fileList[index].fjdz
const encodedUrl = encode(url);;
console.log(encodedUrl, 'encodedUrl');
// const previewUrl = 'http://222.174.117.26:11321/kkFileView/onlinePreview?url=' + encodeURIComponent(encodedUrl);
const previewUrl = 'http://192.168.1.114:8012/onlinePreview?url=' + encodeURIComponent(encodedUrl);
window.open(previewUrl);
}; };
const urgencyText = computed(() => { const urgencyText = computed(() => {
......
...@@ -68,9 +68,9 @@ ...@@ -68,9 +68,9 @@
<div v-if="list && list.fileList"> <div v-if="list && list.fileList">
<div v-for="(item, index) in list.fileList " :key="index"> <div v-for="(item, index) in list.fileList " :key="index">
{{ item.fjmc }} {{ item.fjmc }}
<van-button size="mini" type="primary" v-if="!file" @click=" <!-- <van-button size="mini" type="primary" v-if="!file" @click="
downloadAttachments(index)">下载附件</van-button> downloadAttachments(index)">下载附件</van-button> -->
<van-button size="mini" type="success" @click="previews" v-else>预览</van-button> <van-button size="mini" type="primary" @click="previews(index)">预览</van-button>
</div> </div>
</div> </div>
</td> </td>
...@@ -227,7 +227,7 @@ ...@@ -227,7 +227,7 @@
<script setup> <script setup>
import { encode } from 'js-base64';
import { ref, toRefs, computed, reactive, onMounted } from "vue"; import { ref, toRefs, computed, reactive, onMounted } from "vue";
import * as dd from "dingtalk-jsapi"; import * as dd from "dingtalk-jsapi";
import { import {
...@@ -360,15 +360,22 @@ const downloadAttachments = async (index) => { ...@@ -360,15 +360,22 @@ const downloadAttachments = async (index) => {
}); });
} }
//预览 //预览
const previews = async () => { const previews = async (index) => {
loadData(); // loadData();
dd.previewFileInDingTalk({ // dd.previewFileInDingTalk({
spaceId: fileDataObj.value.spaceId, // spaceId: fileDataObj.value.spaceId,
fileId: fileDataObj.value.fileId, // fileId: fileDataObj.value.fileId,
fileName: fileDataObj.value.fileName, // fileName: fileDataObj.value.fileName,
fileSize: fileDataObj.value.fileSize, // fileSize: fileDataObj.value.fileSize,
fileType: fileDataObj.value.fileType, // fileType: fileDataObj.value.fileType,
}) // })
const url = window.location.protocol + '//' + window.location.host + baseUrl + list.value.fileList[index].fjdz
const encodedUrl = encode(url);;
console.log(encodedUrl, 'encodedUrl');
const previewUrl = 'http://192.168.1.114:8012/onlinePreview?url=' + encodeURIComponent(encodedUrl);
// const previewUrl = 'http://222.174.117.26:11321/kkFileView/onlinePreview?url=' + encodeURIComponent(encodedUrl);
window.open(previewUrl);
}; };
const urgencyText = computed(() => { const urgencyText = computed(() => {
......
...@@ -53,9 +53,9 @@ ...@@ -53,9 +53,9 @@
<div v-if="list && list.fileList"> <div v-if="list && list.fileList">
<div v-for="(item, index) in list.fileList " :key="index"> <div v-for="(item, index) in list.fileList " :key="index">
{{ item.fjmc }} {{ item.fjmc }}
<van-button size="mini" type="primary" v-if="!file" @click=" <!-- <van-button size="mini" type="primary" @click="
downloadAttachments(index)">下载附件</van-button> downloadAttachments(index)">下载附件</van-button> -->
<van-button size="mini" type="success" @click="previews" v-else>预览</van-button> <van-button size="mini" type="primary" @click="previews(index)">预览</van-button>
</div> </div>
</div> </div>
</td> </td>
...@@ -213,6 +213,7 @@ ...@@ -213,6 +213,7 @@
<script setup> <script setup>
import { encode } from 'js-base64';
import { ref, toRefs, computed, reactive, onMounted } from "vue"; import { ref, toRefs, computed, reactive, onMounted } from "vue";
import * as dd from "dingtalk-jsapi"; import * as dd from "dingtalk-jsapi";
import { import {
...@@ -344,18 +345,46 @@ const downloadAttachments = async (index) => { ...@@ -344,18 +345,46 @@ const downloadAttachments = async (index) => {
}); });
} }
// const preyl = () => {
// const script = document.createElement('script');
// script.src = '"https://cdn.jsdelivr.net/npm/js-base64@3.6.0/base64.min.js"'
// };
//预览 //预览
const previews = async () => { const previews = async (index) => {
loadData(); // console.log(index, 'index');
dd.previewFileInDingTalk({ // const url = window.location.protocol + '//' + window.location.host + baseUrl + list.value.fileList[index].fjdz;
spaceId: fileDataObj.value.spaceId, // console.log(url, 'url');
fileId: fileDataObj.value.fileId, // const previewUrl = 'https://view.xdocin.com/view?src=' + encodeURIComponent(url);
fileName: fileDataObj.value.fileName, // window.open(previewUrl);
fileSize: fileDataObj.value.fileSize, // const url = window.location.protocol + '//' + window.location.host + baseUrl + list.value.fileList[index].fjdz;
fileType: fileDataObj.value.fileType, // let urls = encodeURIComponent(url)
}) // let officeUrl = 'http://view.officeapps.live.com/op/view.aspx?src=' + urls
// // 在新窗口打开编码后 的链接
// window.open(officeUrl, '_target')
//​在https://view.officeapps.live.com/op/view.aspx?src=后面拼接需要预览的地址,如下:\
// let url = window.location.protocol + '//' + window.location.host + baseUrl + list.value.fileList[index].fjdz;
// console.log(url, 'url');
// let url = "http://xxx.com/files/demo.doc"
// window.open("​https://view.officeapps.live.com/op/view.aspx?src=" + encodeURIComponent(url))
// var url = 'https://public.fuyingy.com/79e5c202204201011493290.jpg'; //图片随便写了一个
// var url = window.location.protocol + '//' + window.location.host + baseUrl + list.value.fileList[index].fjdz;
// const url = 'http://47.105.176.202:5129/gld_api/profile/upload/2024/01/18/讲课获奖_1702535402841_20240118100155A002.xlsx'
// console.log(url, 'url');
// console.log('http://192.168.1.114:8012/onlinePreview?url=' + encodeURIComponent(Base64.encode(url)));
// window.open('http://192.168.1.114:8012/onlinePreview?url=' + encodeURIComponent(Base64.encode(url)));
const url = window.location.protocol + '//' + window.location.host + baseUrl + list.value.fileList[index].fjdz
const encodedUrl = encode(url);;
console.log(encodedUrl, 'encodedUrl');
const previewUrl = 'http://192.168.1.114:8012/onlinePreview?url=' + encodeURIComponent(encodedUrl);
// const previewUrl = 'http://222.174.117.26:11321/kkFileView/onlinePreview?url=' + encodeURIComponent(encodedUrl);
window.open(previewUrl);
}; };
const urgencyText = computed(() => { const urgencyText = computed(() => {
switch (list.value?.urgency) { switch (list.value?.urgency) {
case '0': case '0':
...@@ -412,7 +441,7 @@ const goback = async () => { ...@@ -412,7 +441,7 @@ const goback = async () => {
onMounted(async () => { onMounted(async () => {
loadData(); loadData();
// preyl();
}); });
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment