Commit f7c54e66 by zhaopanyu

zpy 1.19

parent 0e603a0e
......@@ -8,17 +8,21 @@
"lint": "vue-cli-service lint"
},
"dependencies": {
"@vue-office/docx": "^1.6.0",
"@vue-office/excel": "^1.6.0",
"amfe-flexible": "^2.2.1",
"axios": "^0.21.1",
"compression-webpack-plugin": "^6.1.1",
"core-js": "^3.6.5",
"dingtalk-jsapi": "^3.0.28",
"dingtalk-jsapi": "^3.0.29",
"fs": "^0.0.1-security",
"js-base64": "^3.7.5",
"js-cookie": "^3.0.1",
"moment": "^2.29.4",
"path": "^0.12.7",
"useless-files-webpack-plugin": "^1.0.1",
"vant": "^3.0.16",
"viewerjs": "^1.11.6",
"vue": "^3.2.26",
"vue-baidu-calendar": "^1.0.8",
"vue-router": "^4.0.0-0",
......
......@@ -79,9 +79,9 @@
<div v-if="list && list.fileList">
<div v-for="(item, index) in list.fileList " :key="index">
{{ item.fjmc }}
<van-button size="mini" type="primary" v-if="!file" @click="
downloadAttachments(index)">下载附件</van-button>
<van-button size="mini" type="success" @click="previews" v-else>预览</van-button>
<!-- <van-button size="mini" type="primary" v-if="!file" @click="
downloadAttachments(index)">下载附件</van-button> -->
<van-button size="mini" type="primary" @click="previews(index)">预览</van-button>
</div>
</div>
......@@ -240,7 +240,7 @@
<script setup>
import { encode } from 'js-base64';
import { ref, toRefs, computed, reactive, onMounted } from "vue";
import * as dd from "dingtalk-jsapi";
import {
......@@ -406,15 +406,21 @@ const downloadAttachments = async (index) => {
});
}
//预览
const previews = async () => {
loadData();
dd.previewFileInDingTalk({
spaceId: fileDataObj.value.spaceId,
fileId: fileDataObj.value.fileId,
fileName: fileDataObj.value.fileName,
fileSize: fileDataObj.value.fileSize,
fileType: fileDataObj.value.fileType,
})
const previews = async (index) => {
// loadData();
// dd.previewFileInDingTalk({
// spaceId: fileDataObj.value.spaceId,
// fileId: fileDataObj.value.fileId,
// fileName: fileDataObj.value.fileName,
// fileSize: fileDataObj.value.fileSize,
// 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 () => {
......
......@@ -53,9 +53,9 @@
<div v-if="list && list.fileList">
<div v-for="(item, index) in list.fileList " :key="index">
{{ item.fjmc }}
<van-button size="mini" type="primary" v-if="!file" @click="
downloadAttachments(index)">下载附件</van-button>
<van-button size="mini" type="success" @click="previews" v-else>预览</van-button>
<!-- <van-button size="mini" type="primary" v-if="!file" @click="
downloadAttachments(index)">下载附件</van-button> -->
<van-button size="mini" type="primary" @click="previews(index)">预览</van-button>
</div>
</div>
</td>
......@@ -211,7 +211,7 @@
<script setup>
import { encode } from 'js-base64';
import { ref, toRefs, computed, reactive, onMounted } from "vue";
import * as dd from "dingtalk-jsapi";
import {
......@@ -344,15 +344,21 @@ const downloadAttachments = async (index) => {
});
}
//预览
const previews = async () => {
loadData();
dd.previewFileInDingTalk({
spaceId: fileDataObj.value.spaceId,
fileId: fileDataObj.value.fileId,
fileName: fileDataObj.value.fileName,
fileSize: fileDataObj.value.fileSize,
fileType: fileDataObj.value.fileType,
})
const previews = async (index) => {
// loadData();
// dd.previewFileInDingTalk({
// spaceId: fileDataObj.value.spaceId,
// fileId: fileDataObj.value.fileId,
// fileName: fileDataObj.value.fileName,
// fileSize: fileDataObj.value.fileSize,
// 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(() => {
......
......@@ -68,9 +68,9 @@
<div v-if="list && list.fileList">
<div v-for="(item, index) in list.fileList " :key="index">
{{ item.fjmc }}
<van-button size="mini" type="primary" v-if="!file" @click="
downloadAttachments(index)">下载附件</van-button>
<van-button size="mini" type="success" @click="previews" v-else>预览</van-button>
<!-- <van-button size="mini" type="primary" v-if="!file" @click="
downloadAttachments(index)">下载附件</van-button> -->
<van-button size="mini" type="primary" @click="previews(index)">预览</van-button>
</div>
</div>
</td>
......@@ -227,7 +227,7 @@
<script setup>
import { encode } from 'js-base64';
import { ref, toRefs, computed, reactive, onMounted } from "vue";
import * as dd from "dingtalk-jsapi";
import {
......@@ -360,15 +360,22 @@ const downloadAttachments = async (index) => {
});
}
//预览
const previews = async () => {
loadData();
dd.previewFileInDingTalk({
spaceId: fileDataObj.value.spaceId,
fileId: fileDataObj.value.fileId,
fileName: fileDataObj.value.fileName,
fileSize: fileDataObj.value.fileSize,
fileType: fileDataObj.value.fileType,
})
const previews = async (index) => {
// loadData();
// dd.previewFileInDingTalk({
// spaceId: fileDataObj.value.spaceId,
// fileId: fileDataObj.value.fileId,
// fileName: fileDataObj.value.fileName,
// fileSize: fileDataObj.value.fileSize,
// 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(() => {
......
......@@ -53,9 +53,9 @@
<div v-if="list && list.fileList">
<div v-for="(item, index) in list.fileList " :key="index">
{{ item.fjmc }}
<van-button size="mini" type="primary" v-if="!file" @click="
downloadAttachments(index)">下载附件</van-button>
<van-button size="mini" type="success" @click="previews" v-else>预览</van-button>
<!-- <van-button size="mini" type="primary" @click="
downloadAttachments(index)">下载附件</van-button> -->
<van-button size="mini" type="primary" @click="previews(index)">预览</van-button>
</div>
</div>
</td>
......@@ -213,6 +213,7 @@
<script setup>
import { encode } from 'js-base64';
import { ref, toRefs, computed, reactive, onMounted } from "vue";
import * as dd from "dingtalk-jsapi";
import {
......@@ -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 () => {
loadData();
dd.previewFileInDingTalk({
spaceId: fileDataObj.value.spaceId,
fileId: fileDataObj.value.fileId,
fileName: fileDataObj.value.fileName,
fileSize: fileDataObj.value.fileSize,
fileType: fileDataObj.value.fileType,
})
const previews = async (index) => {
// console.log(index, 'index');
// const url = window.location.protocol + '//' + window.location.host + baseUrl + list.value.fileList[index].fjdz;
// console.log(url, 'url');
// const previewUrl = 'https://view.xdocin.com/view?src=' + encodeURIComponent(url);
// window.open(previewUrl);
// const url = window.location.protocol + '//' + window.location.host + baseUrl + list.value.fileList[index].fjdz;
// 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(() => {
switch (list.value?.urgency) {
case '0':
......@@ -412,7 +441,7 @@ const goback = async () => {
onMounted(async () => {
loadData();
// preyl();
});
</script>
<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