|
@@ -1801,13 +1801,28 @@
|
|
|
></p>
|
|
></p>
|
|
|
<p v-if="item2.attachment != null">
|
|
<p v-if="item2.attachment != null">
|
|
|
{{ $t("fu-jian") }}:
|
|
{{ $t("fu-jian") }}:
|
|
|
- <a
|
|
|
|
|
|
|
+ <!-- <a
|
|
|
v-for="file in JSON.parse(item2.attachment)"
|
|
v-for="file in JSON.parse(item2.attachment)"
|
|
|
style="margin-right: 5px"
|
|
style="margin-right: 5px"
|
|
|
:href="'/upload/' + file.serverName"
|
|
:href="'/upload/' + file.serverName"
|
|
|
:download="file.originName"
|
|
:download="file.originName"
|
|
|
>{{ file.originName }}</a
|
|
>{{ file.originName }}</a
|
|
|
|
|
+ > -->
|
|
|
|
|
+ <el-link
|
|
|
|
|
+ v-for="item in JSON.parse(item2.attachment)"
|
|
|
|
|
+ @click.prevent="viewOnline2(item)"
|
|
|
>
|
|
>
|
|
|
|
|
+ <span style="margin-left: 8px; color: #262626">{{
|
|
|
|
|
+ item.originName
|
|
|
|
|
+ }}</span>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ icon="el-icon-download"
|
|
|
|
|
+ circle
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ style="margin-left: 100px"
|
|
|
|
|
+ @click.stop.native="downloadByA(item)"
|
|
|
|
|
+ ></el-button>
|
|
|
|
|
+ </el-link>
|
|
|
</p>
|
|
</p>
|
|
|
</div>
|
|
</div>
|
|
|
<p></p>
|
|
<p></p>
|
|
@@ -3274,6 +3289,32 @@ export default {
|
|
|
this.times = `${Y}-${M}-${D}`;
|
|
this.times = `${Y}-${M}-${D}`;
|
|
|
console.log(this.times, "时间");
|
|
console.log(this.times, "时间");
|
|
|
},
|
|
},
|
|
|
|
|
+ // 在线预览
|
|
|
|
|
+ viewOnline2(row) {
|
|
|
|
|
+ sessionStorage.setItem("fileName", row.serverName);
|
|
|
|
|
+ sessionStorage.setItem("fileUrl", "/upload/" + row.serverName);
|
|
|
|
|
+ let routeUrl;
|
|
|
|
|
+ if (row.serverName.endsWith(".doc") || row.serverName.endsWith(".docx")) {
|
|
|
|
|
+ routeUrl = this.$router.resolve({
|
|
|
|
|
+ path: "/viewWord",
|
|
|
|
|
+ params: {},
|
|
|
|
|
+ });
|
|
|
|
|
+ } else if (
|
|
|
|
|
+ row.serverName.endsWith(".xls") ||
|
|
|
|
|
+ row.serverName.endsWith(".xlsx")
|
|
|
|
|
+ ) {
|
|
|
|
|
+ routeUrl = this.$router.resolve({
|
|
|
|
|
+ path: "/viewExcel",
|
|
|
|
|
+ params: {},
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ if (routeUrl != null) {
|
|
|
|
|
+ console.log(routeUrl.href);
|
|
|
|
|
+ window.open(routeUrl.href, "_blank");
|
|
|
|
|
+ } else {
|
|
|
|
|
+ window.open(row.url, "_blank");
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
// 提交按钮
|
|
// 提交按钮
|
|
|
submitInsert() {
|
|
submitInsert() {
|
|
|
if (this.textContent !== true)
|
|
if (this.textContent !== true)
|
|
@@ -4152,6 +4193,13 @@ export default {
|
|
|
},
|
|
},
|
|
|
);
|
|
);
|
|
|
},
|
|
},
|
|
|
|
|
+ downloadByA(row) {
|
|
|
|
|
+ const a = document.createElement("a"); // 创建a标签
|
|
|
|
|
+ a.setAttribute("download", row.serverName); // download属性
|
|
|
|
|
+ a.setAttribute("href", "/upload/" + row.serverName); // href链接
|
|
|
|
|
+ a.click(); // 自执行点击事件
|
|
|
|
|
+ a.remove();
|
|
|
|
|
+ },
|
|
|
uploadFileClickTwo(item, row) {
|
|
uploadFileClickTwo(item, row) {
|
|
|
let files = new FormData();
|
|
let files = new FormData();
|
|
|
files.append("projectId", this.curProjectId);
|
|
files.append("projectId", this.curProjectId);
|