Browse Source

专题管理板块文件的上传与下载

dev_kxc
xzt 2 years ago
parent
commit
78925fba6f
  1. 17
      jwtech-admin-page/src/views/project/special/options/ContractPage.vue
  2. 19
      jwtech-admin-page/src/views/project/special/options/documentPage.vue
  3. 19
      jwtech-admin-page/src/views/project/special/options/resultsPage.vue
  4. 34
      jwtech-admin-page/src/views/project/special/options/taskPage.vue

17
jwtech-admin-page/src/views/project/special/options/ContractPage.vue

@ -232,6 +232,7 @@ import {
} from "@/api/earlyStage/contract";
import { getToken } from "@/utils/auth";
import { v4 as uuidv4 } from "uuid";
import { getFileStream } from "@/api/system/upload";
export default {
props: ["proNo"],
@ -470,6 +471,7 @@ export default {
console.log("fileList", fileList);
this.contractFileList.push({
name: fileList.name,
fileName: fileList.response.fileName,
url: fileList.response.url,
uid: fileList.uid,
// fileList: fileList,
@ -483,8 +485,23 @@ export default {
//
this.contractFileList.splice(index, 1);
},
//
handlePreview(file) {
console.log(file);
getFileStream({ fileName: file.fileName }).then((res) => {
const blob = new Blob([res], {
// type
// application/xlsx application/zip
type: "application/xlsx",
}); //excel,pdf
const href = URL.createObjectURL(blob); //URLblob
const a = document.createElement("a"); //a
a.style.display = "none";
a.href = href; //
a.download = file.name; //
a.click(); //
URL.revokeObjectURL(a.href); //URL
});
},
handleExceed(files, fileList) {
this.$message.warning(

19
jwtech-admin-page/src/views/project/special/options/documentPage.vue

@ -241,6 +241,7 @@ import {
updateDocument,
exportDocument,
} from "@/api/earlyStage/document";
import { getFileStream } from "@/api/system/upload";
export default {
props: ["proNo"],
data() {
@ -479,6 +480,7 @@ export default {
console.log("fileList", fileList);
this.acceptDocumentFileList.push({
name: fileList.name,
fileName: fileList.response.fileName,
url: fileList.response.url,
uid: fileList.uid,
});
@ -500,8 +502,23 @@ export default {
//
this.acceptDocumentFileList.splice(index, 1);
},
//
handlePreview(file) {
console.log(file);
// console.log(file);
getFileStream({ fileName: file.fileName }).then((res) => {
const blob = new Blob([res], {
// type
// application/xlsx application/zip
type: "application/xlsx",
}); //excel,pdf
const href = URL.createObjectURL(blob); //URLblob
const a = document.createElement("a"); //a
a.style.display = "none";
a.href = href; //
a.download = file.name; //
a.click(); //
URL.revokeObjectURL(a.href); //URL
});
},
handleExceed(files, fileList) {
this.$message.warning(

19
jwtech-admin-page/src/views/project/special/options/resultsPage.vue

@ -326,6 +326,7 @@ import {
exportGain,
} from "@/api/earlyStage/gain";
import { getToken } from "@/utils/auth";
import { getFileStream } from "@/api/system/upload";
export default {
props: ["proNo"],
data() {
@ -564,6 +565,7 @@ export default {
console.log("fileList", fileList);
this.resultsFileList.push({
name: fileList.name,
fileName: fileList.response.fileName,
url: fileList.response.url,
uid: fileList.uid,
// fileList: fileList,
@ -578,8 +580,23 @@ export default {
//
this.resultsFileList.splice(index, 1);
},
//
handlePreview(file) {
console.log(file);
// console.log(file);
getFileStream({ fileName: file.fileName }).then((res) => {
const blob = new Blob([res], {
// type
// application/xlsx application/zip
type: "application/xlsx",
}); //excel,pdf
const href = URL.createObjectURL(blob); //URLblob
const a = document.createElement("a"); //a
a.style.display = "none";
a.href = href; //
a.download = file.name; //
a.click(); //
URL.revokeObjectURL(a.href); //URL
});
},
handleExceed(files, fileList) {
this.$message.warning(

34
jwtech-admin-page/src/views/project/special/options/taskPage.vue

@ -637,9 +637,23 @@ export default {
//
this.projectFileList.splice(index, 1);
},
//
handleProjectPreview(file) {
console.log(file.fileName);
getFileStream({ fileName: file.fileName });
// console.log(file);
getFileStream({ fileName: file.fileName }).then((res) => {
const blob = new Blob([res], {
// type
// application/xlsx application/zip
type: "application/xlsx",
}); //excel,pdf
const href = URL.createObjectURL(blob); //URLblob
const a = document.createElement("a"); //a
a.style.display = "none";
a.href = href; //
a.download = file.name; //
a.click(); //
URL.revokeObjectURL(a.href); //URL
});
},
handleProjectExceed(files, fileList) {
this.$message.warning(
@ -671,7 +685,21 @@ export default {
this.opinionFileList.splice(index, 1);
},
handleOpinionPreview(file) {
console.log(file);
// console.log(file);
getFileStream({ fileName: file.fileName }).then((res) => {
const blob = new Blob([res], {
// type
// application/xlsx application/zip
type: "application/xlsx",
}); //excel,pdf
const href = URL.createObjectURL(blob); //URLblob
const a = document.createElement("a"); //a
a.style.display = "none";
a.href = href; //
a.download = file.name; //
a.click(); //
URL.revokeObjectURL(a.href); //URL
});
},
handleOpinionExceed(files, fileList) {
this.$message.warning(

Loading…
Cancel
Save