From e5454b769d44a34af423bf87ac8a740bf8c20341 Mon Sep 17 00:00:00 2001 From: Crunchy <3114200645@qq.com> Date: 星期二, 29 四月 2025 13:25:29 +0800 Subject: [PATCH] Merge branch 'dev' into dev_tides --- src/main.js | 27 ++++++++++++++++++++++----- 1 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/main.js b/src/main.js index b3b6719..5f56508 100644 --- a/src/main.js +++ b/src/main.js @@ -1,7 +1,5 @@ import Vue from "vue"; -import Cookies from "js-cookie"; - import Element from "element-ui"; import "./assets/styles/element-variables.scss"; @@ -26,6 +24,7 @@ selectDictLabels, handleTree, } from "@/utils/ruoyi"; +import { dictToValue } from "@/utils/index"; // 鍒嗛〉缁勪欢 import Pagination from "@/components/Pagination"; // 鑷畾涔夎〃鏍煎伐鍏风粍浠� @@ -47,6 +46,9 @@ // 瀛楀吀鏁版嵁缁勪欢 import DictData from "@/components/DictData"; import { checkPermi } from "@/utils/permission"; // 鏉冮檺鍒ゆ柇鍑芥暟 +import { getToken } from "@/utils/auth"; +// 鏃堕棿杞崲 +import Moment from "moment"; // 鍏ㄥ眬鏂规硶鎸傝浇 Vue.prototype.getDicts = getDicts; @@ -58,11 +60,26 @@ Vue.prototype.selectDictLabels = selectDictLabels; Vue.prototype.download = download; Vue.prototype.handleTree = handleTree; +Vue.prototype.dictToValue = dictToValue; Vue.prototype.HaveJson = (val) => { return JSON.parse(JSON.stringify(val)); }; -Vue.prototype.javaApi = process.env.VUE_APP_BASE_API; +Vue.prototype.javaApi = "http://192.168.21.53:8001/lims"; Vue.prototype.checkPermi = checkPermi; +Vue.prototype.uploadHeader = { + Authorization: "Bearer " + getToken(), +}; +// 瑙e喅el-radio-group鍗曢�夋鑷韩鐨刡ug +Vue.directive("removeAriaHidden", { + bind(el, binding) { + let ariaEls = el.querySelectorAll(".el-radio__original"); + ariaEls.forEach((item) => { + item.removeAttribute("aria-hidden"); + }); + }, +}); +Vue.use(Moment); +Vue.prototype.$moment = Moment; // 鍏ㄥ眬缁勪欢鎸傝浇 Vue.component("DictTag", DictTag); @@ -72,7 +89,7 @@ Vue.component("FileUpload", FileUpload); Vue.component("ImageUpload", ImageUpload); Vue.component("ImagePreview", ImagePreview); -Vue.component('barcode', VueBarcode) +Vue.component("barcode", VueBarcode); Vue.use(directive); Vue.use(plugins); @@ -89,7 +106,7 @@ */ Vue.use(Element, { - size: Cookies.get("size") || "medium", // set element-ui default size + size: localStorage.getItem("size") || "medium", // set element-ui default size }); Vue.config.productionTip = false; -- Gitblit v1.9.3