文件预览

master
lion 9 months ago
parent c0799d885b
commit 62dacd901d

@ -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();

@ -22,13 +22,12 @@
<vue-office-pdf v-else-if="urlType==='pdf'" :src="url" @rendered="renderingCompleted"></vue-office-pdf>
<vue-office-excel v-else-if="urlType==='excel'" :src="url" @rendered="renderingCompleted"></vue-office-excel>
<vue-office-pptx v-else-if="urlType==='pptx'" :src="url" @rendered="renderingCompleted"></vue-office-pptx>
<img v-else-if="urlType==='image'" :src="url" style="width:100%"></img>
<iframe v-else id="iframeWin" :src="url" frameborder="0" scrolling="auto" align="center" class="iframeWeb">
</iframe>
</div>
<div v-if="typeName=='video'" style="text-align: center;">
<div v-if="typeName=='video'" style="text-align: center;height:100%;overflow: scroll;">
<video :src="url" controls></video>
</div>
@ -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 {

@ -31,8 +31,8 @@
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>开始日期
</div>
<div class="xy-table-item-content">
<el-date-picker :disabled="is_search" v-model="form.date" style="width:100%" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
type="date" placeholder="选择日期">
<el-date-picker :disabled="is_search" v-model="form.date" style="width:100%" format="yyyy-MM-dd"
value-format="yyyy-MM-dd" type="date" placeholder="选择日期">
</el-date-picker>
</div>
</div>
@ -43,8 +43,8 @@
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>结束日期
</div>
<div class="xy-table-item-content">
<el-date-picker :disabled="is_search" v-model="form.end_date" style="width:100%" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
type="date" placeholder="选择日期">
<el-date-picker :disabled="is_search" v-model="form.end_date" style="width:100%" format="yyyy-MM-dd"
value-format="yyyy-MM-dd" type="date" placeholder="选择日期">
</el-date-picker>
</div>
</div>
@ -54,12 +54,11 @@
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>所属区域
</div>
<div class="xy-table-item-content">
<div>
<el-checkbox :disabled="is_search" @change="changeAllArea" v-model="allArea"></el-checkbox>
<div class="xy-table-item-content">
<div>
<el-checkbox :disabled="is_search" @change="changeAllArea" v-model="allArea"></el-checkbox>
</div>
<el-select :disabled="is_search" style="width:100%" v-model="form.area_ids" multiple
placeholder="请选择">
<el-select :disabled="is_search" style="width:100%" v-model="form.area_ids" multiple placeholder="请选择">
<el-option v-for="item in areaList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
@ -86,8 +85,7 @@
</div>
<div class="xy-table-item-content" style="height:150px;overflow: scroll;">
<el-tree v-if="isShow" :default-checked-keys="checkArr" :check-strictly="true" @check="getSelectedNodes"
:data="catalogList" show-checkbox node-key="id" ref="tree" highlight-current
:props="defaultProps">
:data="catalogList" show-checkbox node-key="id" ref="tree" highlight-current :props="defaultProps">
</el-tree>
</div>
</div>
@ -98,10 +96,12 @@
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>附件
</div>
<div class="xy-table-item-content">
<el-upload :disabled="is_search" :action="action" class='upload-demo' multiple :file-list="filesList" ref="pictureUpload"
:auto-upload="true" :data="uploadOther" :on-success="handlesuccess" :on-remove="handleRemove">
<el-upload :disabled="is_search" :action="action" class='upload-demo' multiple :file-list="filesList"
ref="pictureUpload" :auto-upload="true" :data="uploadOther" :on-progress="handleProgress"
:on-success="handlesuccess" :on-remove="handleRemove">
<el-button v-if="!is_search" size="small" type="primary"></el-button>
</el-upload>
</el-upload>
<el-progress v-if="showProgress" :percentage="uploadProgress"></el-progress>
</div>
</div>
</template>
@ -112,8 +112,9 @@
</div>
<div class="xy-table-item-content">
<!-- <wangEditor :isShow="isShow && !is_search" v-show="showTinymce" :value="form.content" @change="changeEditor"></wangEditor> -->
<my-tinymce v-if="isShow && !is_search && showTinymce" @input="changeEditor" :value="form.content"></my-tinymce>
<div v-if="is_search" v-html="form.content"></div>
<my-tinymce v-if="isShow && !is_search && showTinymce" @input="changeEditor"
:value="form.content"></my-tinymce>
<div v-if="is_search" v-html="form.content"></div>
</div>
</div>
</template>
@ -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,

@ -96,9 +96,10 @@
</div>
<div class="xy-table-item-content">
<el-upload :action="action" class='upload-demo' multiple :file-list="filesList" ref="pictureUpload"
:auto-upload="true" :data="uploadOther" :on-success="handlesuccess" :on-remove="handleRemove">
:auto-upload="true" :data="uploadOther" :on-progress="handleProgress" :on-success="handlesuccess" :on-remove="handleRemove">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</el-upload>
<el-progress v-if="showProgress" :percentage="uploadProgress"></el-progress>
</div>
</div>
</template>
@ -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,

@ -116,7 +116,7 @@
</el-table-column>
</template>
<template v-slot:area_name>
<el-table-column align='center' min-width="120" label="所属区域" header-align="center">
<el-table-column align='center' min-width="120" label="授权区域" header-align="center">
<template slot-scope="scope">
<div v-if="scope.row.area_ids_details && scope.row.area_ids_details.length>0">
@ -386,7 +386,7 @@
},
{
prop: 'area_name',
label: '所属区域',
label: '授权区域',
align: 'center',
// width: 240
},

Loading…
Cancel
Save