Commit 5422a72c authored by wangqinghua's avatar wangqinghua

quiet2

parent d509cc9b
......@@ -87,6 +87,9 @@ export const removeIntentionById = params =>req('get','/intention/removeIntenti
//下载文件
export const downloadFile = params =>req('get','/common/file/download',params);
//下载
export const preDownloadFile = params =>req('get','/common/file/pre/download',params);
......
......@@ -4,10 +4,12 @@ import * as types from '../store/types';
import router from '../router';
import {Message} from 'element-ui';
export const domin = '/api' //本地环境
// export const domin = '' //生产环境
//axios配置
let instance = axios.create({
// baseURL:'/api',
baseURL:'http://172.19.1.232:8085',
baseURL:'/api',
// baseURL:'http://172.19.1.232:8085',
// timeout:20000,
});
......
......@@ -33,7 +33,7 @@
label="会议名称"
width="180">
<template slot-scope="scope">
<span @click="handleEdit(scope.row)" class="pointer">
<span @click="handleEdit(scope.row)" class="pointer">
{{scope.row.title}}
</span>
</template>
......@@ -57,8 +57,10 @@
<span class="font-size-20 pointer">
<i @click="handleEdit(scope.row)" class="el-icon-edit-outline margin-right-20"></i>
<i @click="handleDelete(scope.row)" class="el-icon-delete margin-right-20"></i>
<i title="离线缓存" @click="downloadData(scope.row)" class="el-icon-download margin-right-20"></i>
<i v-if="scope.row.preview === true" title="预览" @click="previewMeet(scope.row)" class="el-icon-more"></i>
<i title="离线缓存" @click="downloadData(scope.row)"
class="el-icon-download margin-right-20"></i>
<i v-if="scope.row.preview === true" title="预览" @click="previewMeet(scope.row)"
class="el-icon-more"></i>
</span>
</template>
</el-table-column>
......@@ -79,15 +81,16 @@
</template>
<script>
import {getMeetingPage,removeMeetingById,getMeetingById} from '../api/api'
import {getMeetingPage, removeMeetingById, preDownloadFile} from '../api/api'
import {formatDate} from "../common/date";
import {domin} from "../http.js/http";
export default {
name: "meet-list",
data() {
return {
currentPage: 1,
total:null,
total: null,
form: {
pageNo: '1',
pageSize: '10',
......@@ -124,7 +127,7 @@
this.getList()
},
//新增会议
handleAdd(){
handleAdd() {
this.$router.push({
path: '/meetManage',
......@@ -144,8 +147,8 @@
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
removeMeetingById({id:row.id}).then(
(res)=>{
removeMeetingById({id: row.id}).then(
(res) => {
this.getList()
this.$message.success("删除成功")
}
......@@ -153,19 +156,18 @@
})
},
//缓存数据
downloadData(row){
row.preview = true
console.log(this.tableData)
getMeetingById({id:row.id}).then(
(res)=>{
this.meet = res.data
let data = JSON.stringify(this.meet)
localStorage.setItem(row.id,data)
}
)
downloadData(row) {
let url = domin + '/common/file/pre/download?id=' + row.id
console.log(url)
let link = document.createElement("a");
link.setAttribute("href", url);
link.setAttribute("download", '组织部.zip');
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
},
//预览
previewMeet(row){
previewMeet(row) {
let newpage = this.$router.resolve({
name: 'viewFile',
query: {previewId: row.id}
......@@ -173,10 +175,10 @@
window.open(newpage.href, '_blank');
}
},
filters:{
formatDate(time){
filters: {
formatDate(time) {
let date = new Date(time);
return formatDate(date,'yyyy-MM-dd hh:mm');
return formatDate(date, 'yyyy-MM-dd hh:mm');
}
}
......
......@@ -80,6 +80,7 @@
<script>
import {getMeetingById, downloadFile} from '../api/api'
import {formatDate} from "../common/date";
import {domin} from "../http.js/http";
import pdf from 'vue-pdf'
import * as types from '../store/types'
......@@ -142,9 +143,9 @@
let url
if (name.saveName.includes('.doc') || name.saveName.includes('.docx')) {
const fileName = name.saveName.split('.doc')[0] + '.pdf'
url = '/api/common/file/download?fileName=' + fileName
url = domin + '/common/file/download?fileName=' + fileName
} else {
url = '/api/common/file/download?fileName=' + name.saveName
url = domin + '/common/file/download?fileName=' + name.saveName
}
this.src = pdf.createLoadingTask(url)
......
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