master
xy 1 year ago
parent ec98c2c0d8
commit 12807f7116

@ -14,6 +14,10 @@
"test:ci": "npm run lint && npm run test:unit"
},
"dependencies": {
"@vue-office/docx": "^1.6.2",
"@vue-office/excel": "^1.7.11",
"@vue-office/pdf": "^2.0.2",
"@vue/composition-api": "^1.7.2",
"axios": "0.18.1",
"core-js": "3.6.5",
"echarts": "^5.0.0",
@ -29,6 +33,7 @@
"print-js": "^1.6.0",
"view-design": "^4.7.0",
"vue": "2.6.10",
"vue-demi": "^0.14.6",
"vue-grid-layout": "^2.4.0",
"vue-router": "3.0.6",
"vuex": "3.1.0",

@ -16,7 +16,7 @@ NProgress.configure({
showSpinner: false
}) // NProgress Configuration
const whiteList = ['/login'] // no redirect whitelist
const whiteList = ['/login','/preview'] // no redirect whitelist
router.beforeEach(async (to, from, next) => {
// start progress bar

@ -75,6 +75,11 @@ export const constantRoutes = [{
path: "/install",
component: () => import("@/views/install"),
hidden: true
},
{
path: '/preview',
component: () => import("@/views/preview"),
hidden: true
}
]

@ -1504,6 +1504,9 @@ export default {
}
this.form.is_purchase = this.flowIds?.find(i => i.id == this.form.flow_mod_id)?.type == 2 ? 1 : 0;
// this.form.is_contract = this.flowIds?.find(i => i.id == this.form.flow_mod_id)?.type == 2 ? 0 : 1;
if (!this.form.money) {
this.form.money = this.form.plan_price
}
if (this.type === 'add') {
addContrant(this.form,true).then(res => {
this.btnLoading = false

@ -272,7 +272,7 @@
@click="new RegExp(/contractLedger/g).test($route.path) ? ($refs['addContractLedger'].setType('add'),$refs['addContractLedger'].show()) : $router.push('/contract/contractEdit')"
>新增</Button
>
<Button style="margin-left: 10px" type="primary" @click="getContracts"
<Button style="margin-left: 10px" type="primary" @click="select.pageIndex=1,getContracts()"
>查询</Button
>
<Button type="primary" @click="toExport()" style="margin-left: 10px"

@ -0,0 +1,70 @@
<template>
<div class="container">
<template v-if="type === 'docx'">
<VueOfficeDocx :src="url" style="height: 100vh;"></VueOfficeDocx>
</template>
<template v-if="type === 'xlsx'">
<VueOfficeExcel :src="url" style="height: 100vh;"></VueOfficeExcel>
</template>
<template v-if="type === 'pdf'">
<VueOfficePdf :src="url" style="height: 100vh;"></VueOfficePdf>
</template>
</div>
</template>
<script>
//VueOfficeDocx
import VueOfficeDocx from '@vue-office/docx'
//
import '@vue-office/docx/lib/index.css'
//VueOfficeExcel
import VueOfficeExcel from '@vue-office/excel'
//
import '@vue-office/excel/lib/index.css'
//VueOfficePdf
import VueOfficePdf from '@vue-office/pdf'
import axios from 'axios'
export default {
components: {
VueOfficeDocx,
VueOfficePdf,
VueOfficeExcel
},
data() {
return {
url: "",
type: ""
}
},
methods: {
resolveUrl(url) {
if(url) {
let originalUrl
try {
originalUrl = window.atob(window.decodeURIComponent(this.$route.query.url??""))
} catch (err) {
originalUrl = window.decodeURIComponent(this.$route.query.url??"")
}
this.type = this.$route.query.type || originalUrl.split('.').at(-1)
try {
this.url = process.env.VUE_APP_DOMIAN + (window.location.origin === window.top.location.origin ? '' : '/oa') + new URL(originalUrl).pathname
console.log(this.url)
} catch (err) {
this.url = process.env.VUE_APP_DOMIAN + '/oa' + new URL(originalUrl).pathname
}
}
}
},
computed: {},
created() {
this.resolveUrl(this.$route.query.url)
}
}
</script>
<style scoped lang="scss">
.container {
height: 100vh;
width: 100vw;
}
</style>
Loading…
Cancel
Save