diff --git a/src/components/viewFile/viewDownload.vue b/src/components/viewFile/viewDownload.vue index 2e72306..919160c 100644 --- a/src/components/viewFile/viewDownload.vue +++ b/src/components/viewFile/viewDownload.vue @@ -58,7 +58,8 @@ import viewFile from '@/components/viewFile/viewFile.vue' import JSZip from "jszip"; - import FileSaver from "file-saver"; + import FileSaver from "file-saver"; + import { download } from "@/utils/downloadRequest"; export default { components: { viewFile @@ -198,6 +199,11 @@ if (this.checkList.length < 1) { this.$Message.warning('请选择要下载的文件') return + } + if(this.checkList.length===1){ + // window.open(this.checkList[0].url,'_blank') + download(this.checkList[0].url, "get", {}, this.checkList[0].original_name); + return } var blogTitle = this.title; // 下载后压缩包的名称 var zip = new JSZip(); diff --git a/src/components/viewFile/viewFile.vue b/src/components/viewFile/viewFile.vue index 40d2f18..781d508 100644 --- a/src/components/viewFile/viewFile.vue +++ b/src/components/viewFile/viewFile.vue @@ -22,13 +22,12 @@ - -
+
@@ -138,7 +137,7 @@ this.url = "" this.diaShow = false this.typeName = 'file' - this.isfullscreen = false + this.isfullscreen = false this.$emit('update:isShow', false) } } @@ -151,7 +150,8 @@ } .dialogConcent { - overflow-y: hidden; + overflow-y: scroll; + height:400px; } .iframeWeb { diff --git a/src/views/record/components/addRecord.vue b/src/views/record/components/addRecord.vue index 02ee52e..b282695 100644 --- a/src/views/record/components/addRecord.vue +++ b/src/views/record/components/addRecord.vue @@ -31,8 +31,8 @@ *开始日期:
- +
@@ -43,8 +43,8 @@ 结束日期:
- +
@@ -54,12 +54,11 @@
*所属区域:
-
-
- 全部区域 +
+
+ 全部区域
- + @@ -86,8 +85,7 @@
+ :data="catalogList" show-checkbox node-key="id" ref="tree" highlight-current :props="defaultProps">
@@ -98,10 +96,12 @@ 附件:
- + 点击上传 - + +
@@ -112,8 +112,9 @@
- -
+ +
@@ -159,16 +160,18 @@ id: '', showTinymce: false, is_next: false, // 是否 可以延续 - catalogList: [], - is_search:false, // 是否到期 预警提醒的编辑 - allArea:false, + catalogList: [], + is_search: false, // 是否到期 预警提醒的编辑 + allArea: false, + showProgress:false, + uploadProgress:0, statusList: [{ id: 0, name: '正常' }, { id: 3, name: '已结束' - },{ + }, { id: 1, name: '已到期' }, { @@ -229,19 +232,19 @@ this.stateObj = state.state this.uploadOther.token = getToken(); }, - methods: { - changeAllArea(e){ - console.log(e) - if(e){ - - let arr = [] - this.areaList.map(item=>{ - arr.push(item.id) - }) - this.form.area_ids = arr - }else{ - this.form.area_ids = [] - } + methods: { + changeAllArea(e) { + console.log(e) + if (e) { + + let arr = [] + this.areaList.map(item => { + arr.push(item.id) + }) + this.form.area_ids = arr + } else { + this.form.area_ids = [] + } }, changeEditor(e) { this.form.content = e @@ -252,13 +255,13 @@ this.tagList = tag ? tag : [] }, getSelectedNodes(data, node) { - console.log("data", data) - if(data.children && data.children.length>0){ - this.$Message.warning('当前节点不可选择') - this.form.catalog_name = '' - this.form.catalog_id = '' - this.$refs.tree.setCheckedKeys([]); - return + console.log("data", data) + if (data.children && data.children.length > 0) { + this.$Message.warning('当前节点不可选择') + this.form.catalog_name = '' + this.form.catalog_id = '' + this.$refs.tree.setCheckedKeys([]); + return } this.$refs.tree.setCheckedKeys([]); // 删除所有选中节点 this.$refs.tree.setCheckedNodes([data]); // 选中已选中节点 @@ -290,6 +293,10 @@ } this.filesList = fileList }, + handleProgress(event, file, fileList) { + this.showProgress = true; + this.uploadProgress = event.percent; + }, clickSubmit(bol) { this.$refs.dialog.submit() }, @@ -301,10 +308,10 @@ this.$refs.addRecordLink.setCheck(this.form.catalog_id) this.$refs.addRecordLink.isShow = true }, - saveLink(e,id) { - console.log("e", e,id) - if (e) { - this.is_next = true + saveLink(e, id) { + console.log("e", e, id) + if (e) { + this.is_next = true this.form.next_link_id = id this.clickSubmit() } @@ -362,9 +369,9 @@ this.form = this.base.requestToForm(res, this.form) console.log("form---", this.form) this.checkArr = res.catalog_id ? [res.catalog_id] : [] - this.form.area_ids = res.area_ids ? res.area_ids : [] - if(this.form.area_ids.length===this.areaList.length){ - this.allArea = true + this.form.area_ids = res.area_ids ? res.area_ids : [] + if (this.form.area_ids.length === this.areaList.length) { + this.allArea = true } this.form.tag_ids = res.tag_ids ? res.tag_ids : [] this.form.files = res.files ? res.files : [] @@ -403,9 +410,11 @@ this.id = '' this.showTinymce = false this.checkArr = [] - this.filesList = [] - this.is_next = false - this.allArea = false + this.filesList = [] + this.is_next = false + this.allArea = false + this.showProgress = false; + this.uploadProgress = 0; this.form = { title: '', status: 0, diff --git a/src/views/record/components/addRecordLink.vue b/src/views/record/components/addRecordLink.vue index 8300698..39a14b2 100644 --- a/src/views/record/components/addRecordLink.vue +++ b/src/views/record/components/addRecordLink.vue @@ -96,9 +96,10 @@
+ :auto-upload="true" :data="uploadOther" :on-progress="handleProgress" :on-success="handlesuccess" :on-remove="handleRemove"> 点击上传 - + +
@@ -170,7 +171,9 @@ action: `${process.env.VUE_APP_UPLOAD_API}`, filesList: [], tagList: [], - areaList: [], + areaList: [], + showProgress:false, + uploadProgress:0, form: { title: '', status: 0, @@ -257,6 +260,10 @@ return } this.filesList = fileList + }, + handleProgress(event, file, fileList) { + this.showProgress = true; + this.uploadProgress = event.percent; }, submit() { @@ -328,7 +335,9 @@ this.id = '' this.showTinymce = false this.checkArr = [] - this.filesList = [] + this.filesList = [] + this.showProgress = false; + this.uploadProgress = 0; this.form = { title: '', status: 0, diff --git a/src/views/record/index.vue b/src/views/record/index.vue index 6ae2a1e..8c71b53 100644 --- a/src/views/record/index.vue +++ b/src/views/record/index.vue @@ -116,7 +116,7 @@