|
|
@ -102,6 +102,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
<script lang="ts"> |
|
|
|
<script lang="ts"> |
|
|
|
import Vue from 'vue' |
|
|
|
import Vue from 'vue' |
|
|
|
|
|
|
|
import { Loading } from 'element-ui' |
|
|
|
|
|
|
|
|
|
|
|
export default Vue.extend({ |
|
|
|
export default Vue.extend({ |
|
|
|
name: 'document', |
|
|
|
name: 'document', |
|
|
@ -128,12 +129,30 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
read(item: any) { |
|
|
|
read(item: any) { |
|
|
|
this.$store.commit('menus/read') |
|
|
|
let loadingInstance =Loading.service({}); |
|
|
|
this.$store.commit('read/open', item) |
|
|
|
let that=this |
|
|
|
this.$router.push(this.localePath('/read')) |
|
|
|
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(){ |
|
|
|
query(){ |
|
|
|
let that=this |
|
|
|
let that=this |
|
|
|
|
|
|
|
let loadingInstance =Loading.service({}); |
|
|
|
this.GLOBAL.fetchGet('/v1/api/paper/list', { |
|
|
|
this.GLOBAL.fetchGet('/v1/api/paper/list', { |
|
|
|
title: this.form.title, |
|
|
|
title: this.form.title, |
|
|
|
author: this.form.author, |
|
|
|
author: this.form.author, |
|
|
@ -148,6 +167,7 @@ |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
that.$message.error(that.$t('error_500').toString()) |
|
|
|
that.$message.error(that.$t('error_500').toString()) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
loadingInstance.close() |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|