|
|
|
@ -102,6 +102,7 @@ |
|
|
|
|
|
|
|
|
|
<script lang="ts"> |
|
|
|
|
import Vue from 'vue' |
|
|
|
|
import { Loading } from 'element-ui' |
|
|
|
|
|
|
|
|
|
export default Vue.extend({ |
|
|
|
|
name: 'document', |
|
|
|
@ -128,12 +129,30 @@ |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
read(item: any) { |
|
|
|
|
this.$store.commit('menus/read') |
|
|
|
|
this.$store.commit('read/open', item) |
|
|
|
|
this.$router.push(this.localePath('/read')) |
|
|
|
|
let loadingInstance =Loading.service({}); |
|
|
|
|
let that=this |
|
|
|
|
this.GLOBAL.fetchGet(`/v1/api/file/find/${item.fileId}`,{},function(res) { |
|
|
|
|
if(res.code==='200'){ |
|
|
|
|
fetch(`${that.GLOBAL.server_address}${res.msg}`).then(res=>res.text()).then(res=>{ |
|
|
|
|
item.content=res |
|
|
|
|
loadingInstance.close() |
|
|
|
|
that.$store.commit('menus/read') |
|
|
|
|
that.$store.commit('read/open', item) |
|
|
|
|
that.$router.push(that.localePath('/read')) |
|
|
|
|
}).catch(err=>{ |
|
|
|
|
console.error(err) |
|
|
|
|
loadingInstance.close() |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
loadingInstance.close() |
|
|
|
|
that.$message.error(that.$t('error_500').toString()) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
query(){ |
|
|
|
|
let that=this |
|
|
|
|
let loadingInstance =Loading.service({}); |
|
|
|
|
this.GLOBAL.fetchGet('/v1/api/paper/list', { |
|
|
|
|
title: this.form.title, |
|
|
|
|
author: this.form.author, |
|
|
|
@ -148,6 +167,7 @@ |
|
|
|
|
}else{ |
|
|
|
|
that.$message.error(that.$t('error_500').toString()) |
|
|
|
|
} |
|
|
|
|
loadingInstance.close() |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|