diff --git a/package.json b/package.json index c1bdeaf..9452a9f 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,11 @@ "vxe-table": "^3.8.22", "wujie-vue2": "^1.0.22", "moment": "^2.29.4", - "vue-grid-layout": "^2.4.0" + "vue-grid-layout": "^2.4.0", + "@vue-office/docx": "^1.6.2", + "@vue-office/excel": "^1.7.11", + "@vue-office/pdf": "^2.0.2", + "@vue/composition-api": "^1.7.2" }, "devDependencies": { "@vue/cli-plugin-babel": "4.4.4", diff --git a/src/components/OnlineFile/index.vue b/src/components/OnlineFile/index.vue index 6044c74..55c92bf 100644 --- a/src/components/OnlineFile/index.vue +++ b/src/components/OnlineFile/index.vue @@ -41,9 +41,13 @@ export default { }, methods: { open(url) { - this.codeUri = `${process.env.VUE_APP_PREVIEW}?url=${encodeURIComponent( - new Buffer(url).toString('base64') - )}` + const resolve = this.$router.resolve({ + path: '/preview', + query: { + url + } + }) + this.codeUri = resolve.href this.showModal = true } } diff --git a/src/components/UserPicker/index.vue b/src/components/UserPicker/index.vue index 7228076..0ac8239 100644 --- a/src/components/UserPicker/index.vue +++ b/src/components/UserPicker/index.vue @@ -3,6 +3,7 @@ v-model="myValue" :size="size" clearable + :reserve-keyword="reserveKeyword" :popper-append-to-body="popperAppendToBody" :style="{ width: width }" value-key="id" @@ -10,7 +11,7 @@ filterable :multiple="multiple" :loading="loading" - @change="e => $emit('input',e)" + @input="e => $emit('input',e)" > { // start progress bar NProgress.start() diff --git a/src/router/index.js b/src/router/index.js index d1b0efb..355a69d 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -42,7 +42,11 @@ export const constantRoutes = [ component: () => import('@/views/404'), hidden: true }, - + { + path: '/preview', + component: () => import('@/views/preview'), + hidden: true + }, { path: '/', component: Layout, diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js index 23a76cd..5b82939 100644 --- a/src/store/modules/permission.js +++ b/src/store/modules/permission.js @@ -65,6 +65,9 @@ const mutations = { SET_ROUTES: (state, routes) => { state.addRoutes = routes state.routes = constantRoutes.concat(routes) + }, + RESET_ADD_ROUTES: (state) => { + state.addRoutes = [] } } diff --git a/src/views/preview/index.vue b/src/views/preview/index.vue new file mode 100644 index 0000000..3a1ff4e --- /dev/null +++ b/src/views/preview/index.vue @@ -0,0 +1,84 @@ + + + + + diff --git a/src/views/system/components/Account.vue b/src/views/system/components/Account.vue index 0eb204d..fe3c17c 100644 --- a/src/views/system/components/Account.vue +++ b/src/views/system/components/Account.vue @@ -145,7 +145,9 @@ export default { showClose: false }) await this.$store.dispatch('user/logout') - this.$router.push('/') + await this.$store.commit('permission/SET_ROUTES', []) + await this.$store.commit('permission/RESET_ADD_ROUTES') + this.$router.push(`/login?redirect=${this.$route.fullPath}`) } }) } else { diff --git a/src/views/system/components/AddArticle.vue b/src/views/system/components/AddArticle.vue index d05b870..1ba7b0e 100644 --- a/src/views/system/components/AddArticle.vue +++ b/src/views/system/components/AddArticle.vue @@ -123,6 +123,10 @@ export default { return isLt10M }, uploadSuccess(response, file, fileList) { + if (response.code) { + fileList.splice(fileList.indexOf(file), 1) + this.$message.warning(response.msg) + } this.fileList = fileList }, removeHandle(file, fileList) { diff --git a/src/views/system/department.vue b/src/views/system/department.vue index 5b88b18..8900d81 100644 --- a/src/views/system/department.vue +++ b/src/views/system/department.vue @@ -42,7 +42,7 @@ {{ row.deputy_manager.map(i => i.name).toString() }}