From 1b8a6a21f6ab7f43a5722ce9ce1b2699473416ac Mon Sep 17 00:00:00 2001 From: wj <1285151836@qq.com> Date: Fri, 27 Oct 2023 16:02:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 8 ++++++++ src/main.js | 15 +++++++++++---- src/store/modules/permission.js | 4 ++-- src/utils/data.js | 11 +++++++++++ src/utils/request.js | 7 ++++++- 5 files changed, 38 insertions(+), 7 deletions(-) diff --git a/src/App.vue b/src/App.vue index 391d951c..9cf24578 100644 --- a/src/App.vue +++ b/src/App.vue @@ -17,3 +17,11 @@ export default { } } + diff --git a/src/main.js b/src/main.js index ebb89aff..b9992fbe 100644 --- a/src/main.js +++ b/src/main.js @@ -14,13 +14,13 @@ import store from "./store"; import router from "./router"; import directive from "./directive"; // directive import plugins from "./plugins"; // plugins -import { download } from "@/utils/request"; +import {download} from "@/utils/request"; import allTools from "./plugins/allTools"; import "./assets/icons"; // icon import "./permission"; // permission control -import { getDicts } from "@/api/system/dict/data"; -import { getConfigKey, updateConfigByKey } from "@/api/system/config"; +import {getDicts} from "@/api/system/dict/data"; +import {getConfigKey, updateConfigByKey} from "@/api/system/config"; import { parseTime, resetForm, @@ -106,7 +106,14 @@ DictData.install(); */ // 修改 el-dialog 默认点击遮照为不关闭 -Element.Dialog.props.closeOnClickModal.default = false; +Element.Dialog.props.closeOnClickModal = {type: Boolean, default: false} +Element.Dialog.props.appendToBody = {type: Boolean, default: true} + +Element.Table.props.border = {type: Boolean, default: true} +Element.Table.props.minHeight = {type: String | Number, default: "250"} +Element.Table.props.fit = {type: Boolean, default: true} +Element.TableColumn.props.showOverflowTooltip = {type: Boolean, default: true} +Element.DatePicker.props.firstDayOfWeek = {type: Number, default: 1} Vue.use(Element, { diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js index acf853a4..521d96d1 100644 --- a/src/store/modules/permission.js +++ b/src/store/modules/permission.js @@ -123,11 +123,11 @@ export function filterDynamicRoutes(routes) { export const loadView = (view) => { if (process.env.NODE_ENV === 'development') { - return (resolve) => require([`@/views/${view}`], resolve) + return (resolve) => require([`@/views/${view}.vue`], resolve) } else { // 使用 import 实现生产环境的路由懒加载 // return () => import(`@/views/${view}`) - return (resolve) => require([`@/views/${view}`], resolve) + return (resolve) => require([`@/views/${view}.vue`], resolve) } } diff --git a/src/utils/data.js b/src/utils/data.js index b3da5692..c825ea3c 100644 --- a/src/utils/data.js +++ b/src/utils/data.js @@ -2,3 +2,14 @@ export const mainActionMap = { WareHouseIn: '入库', WareHouseOut: '出库' } + + +/** + * 库存对比状态 + */ +export const stockCompareStatusEnum = { + DRAFT: {key: 'DRAFT', value: -1, desc: "草稿"}, + EXECUTING: {key: 'EXECUTING', value: 1, desc: "对比中"}, + FINISHED: {key: 'FINISHED', value: 3, desc: "对比完成"}, + ERROR: {key: 'ERROR', value: 9, desc: "异常"}, +} diff --git a/src/utils/request.js b/src/utils/request.js index 05fed3a8..3e0acccf 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -6,6 +6,7 @@ import errorCode from '@/utils/errorCode' import {tansParams, blobValidate} from "@/utils/ruoyi"; import cache from '@/plugins/cache' import {saveAs} from 'file-saver' +import router from "@/router"; let downloadLoadingInstance; // 是否显示重新登录 @@ -96,7 +97,11 @@ service.interceptors.response.use((res) => { ).then(() => { isRelogin.show = false; store.dispatch('LogOut').then(() => { - location.href = process.env.VUE_APP_CONTEXT_PATH; + router.push({ + path: "/login", + query: { redirect: router.currentRoute.fullPath } // 从哪个页面跳转过来 + }); + // location.href = process.env.VUE_APP_CONTEXT_PATH; }) }).catch(() => { isRelogin.show = false;