Commit 5422a72c authored by wangqinghua's avatar wangqinghua

quiet2

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