From eff1aeeec8c8b24dac27defae65e2ad892f8046b Mon Sep 17 00:00:00 2001
From: 1012414140@qq.com <1012414140@qq.com>
Date: 星期四, 15 十月 2026 14:35:05 +0800
Subject: [PATCH] feat: 优化代码大小

---
 src/main.js |  129 ++++++++++++++++++------------------------
 1 files changed, 55 insertions(+), 74 deletions(-)

diff --git a/src/main.js b/src/main.js
index 45ea16e..69c397e 100644
--- a/src/main.js
+++ b/src/main.js
@@ -3,10 +3,16 @@
 import router from './router'
 import axios from 'axios';
 import qs from 'qs'
-import ElementUI from 'element-ui';
-import 'element-ui/lib/theme-chalk/index.css'; // 榛樿涓婚
+
+// ===================== 銆愬垹闄や笅闈�3琛屻�慤I搴撴湰鍦板紩鍏� =====================
+// import ElementUI from 'element-ui';
+// import 'element-ui/lib/theme-chalk/index.css';
+// import ViewUI from 'view-design';
+// import 'view-design/dist/styles/iview.css';
+// import echarts from 'echarts';
+// ======================================================================
+
 import './assets/css/fonts/iconfont.css'
-// import '../static/css/theme-green/index.css';       // 娴呯豢鑹蹭富棰�
 import './assets/css/icon.css';
 import './components/common/directives';
 import "babel-polyfill";
@@ -15,23 +21,45 @@
 import TscPrintUtil from './assets/js/TscPrintUtil'
 import Print from './assets/js/print'
 import moment from 'moment'
+import store from './store/index' // 寮曞叆vuex
 Vue.prototype.$moment = moment;
-Vue.use(Print) // 娉ㄥ唽
-import ViewUI from 'view-design';
+Vue.use(Print)
 
 import 'lib-flexible'
+import preview from 'vue-photo-preview'
 
-// import style
-import 'view-design/dist/styles/iview.css';
+//preview鐨勫弬鏁�
+var option = {
+    minZoom:0.3,
+    maxSpreadZoom: 20,
+    fullscreenEl: false,
+    closeEl: true,
+    tapToClose: true,
+    shareEl: false,
+    zoomEl: true,
+    counterEl: true,
+    arrowEl: true,
+    tapToToggleControls: true,
+    allowPanToNext:true,
+    clickToCloseNonZoomable: false,
+    closeOnVerticalDrag:false,
+    pinchToClose:false,
+    getDoubleTapZoom:()=>1
+}
+Vue.use(preview,option)
 
-Vue.use(ViewUI);
+// ===================== 銆愪繚鐣欍�戝叏灞�娉ㄥ唽UI搴擄紙CDN鍏ㄥ眬鍙橀噺锛� =====================
+// Vue.use(ElementUI);
+// Vue.use(ViewUI);
+// ===========================================================================
+
 Vue.config.productionTip = false
-Vue.use(ElementUI, {
-    size: 'small'
-});
+
+// ===================== 銆愪繚鐣欍�慐Charts 鍏ㄥ眬鎸傝浇锛圕DN鍏ㄥ眬鍙橀噺锛� =====================
+// Vue.prototype.$echarts = echarts;
+// ===============================================================================
 
 import '@/utils/lib-fiexible'
-
 import {getStore,setStore,removeStore} from "./libs/store";
 
 Vue.prototype.getStore = getStore
@@ -40,7 +68,7 @@
 
 Vue.prototype.$axios = axios;
 axios.defaults.withCredentials = true
-// 瀵规彁浜ょ殑鏁版嵁杩涜json搴忓垪鍖�,鍙兘瀛樺湪闂,鏆傛椂鏈彂鐜颁粈涔堥棶棰�
+// 瀵规彁浜ょ殑鏁版嵁杩涜json搴忓垪鍖�
 axios.interceptors.request.use((config) => {
     if (config.method === 'post') {
         config.data = qs.stringify(config.data)
@@ -48,77 +76,30 @@
     if (config.method === 'get') {
         config.data = qs.stringify(config.data)
     }
-    console.log(config.data)
+    // 鐢熶骇鐜寤鸿娉ㄩ噴 console.log
+    // console.log(config.data)
     return config
 })
+
 // 閰嶇疆鏂囦欢
 Vue.prototype.$systemconfig = {
-// 鏈嶅姟绔矾寰�
-    basePath: 'http://183.196.93.178:8089',
-    //basePath:'http://127.0.0.1:8089'
+    basePath:'http://183.196.93.178:8089'
+    // basePath:'http://192.168.0.147:8089'
 }
 Vue.prototype.$byutil = byUtils
 Vue.prototype.$stringUtil = StringUtil
 Vue.prototype.$tscPrintUtil = TscPrintUtil
 
-//浣跨敤閽╁瓙鍑芥暟瀵硅矾鐢辫繘琛屾潈闄愯烦杞�
-// router.beforeEach((to, from, next) => {
-//     let user = byUtils.getUser()
-//     if (!user && to.path!== '/') {
-//         next('/');
-//     }
-//         //
-//     // if (to.path==='/login') {
-//     //     byUtils.setUser(null)
-//     // }
-//     // let user = byUtils.getUser()
-//     // console.log(user)
-//     // if (!user && to.path !== '/login') {
-//     //     next('/login');
-//     // } else if (to.meta.permission) {
-//     //     // 濡傛灉鏄鐞嗗憳鏉冮檺鍒欏彲杩涘叆锛岃繖閲屽彧鏄畝鍗曠殑妯℃嫙绠$悊鍛樻潈闄愯�屽凡
-//     //     role === 'admin' ? next() : next('/403');
-//     // } else {
-//         // 绠�鍗曠殑鍒ゆ柇IE10鍙婁互涓嬩笉杩涘叆瀵屾枃鏈紪杈戝櫒锛岃缁勪欢涓嶅吋瀹�
-//         if (navigator.userAgent.indexOf('MSIE') > -1 && to.path === '/editor') {
-//             Vue.prototype.$alert('vue-quill-editor缁勪欢涓嶅吋瀹笽E10鍙婁互涓嬫祻瑙堝櫒锛岃浣跨敤鏇撮珮鐗堟湰鐨勬祻瑙堝櫒鏌ョ湅', '娴忚鍣ㄤ笉鍏煎閫氱煡', {
-//                 confirmButtonText: '纭畾'
-//             });
-//         } else {
-//             next();
-//         }
-//     // }
-// })
-// router.beforeEach((to, from, next) => {
-//     if(!sessionStorage.accessToken){
-//         router.push({'path': '/'});
-//     }
-// })
-
-// router.beforeEach((to, from, next) => {
-//     if (to.path === '/login') {
-//         next();
-//     } else {
-//         //sessionStorage.accessToken
-//         let token = localStorage.getItem('userId');
-//         if(token){
-//             if (token==null) {
-//                 next('/login');
-//             } else {
-//                 if(token == ''){
-//                     next('/login');
-//                 }else{
-//                     next();
-//                 }
-//             }
-//         }else{
-//             next('/login');
-//         }
-//     }
-// });
-
+// 璺敱瀹堝崼
+router.beforeEach((to,from,next) => {
+    if(to.meta.title === '宄板嘲鐭垮尯鏅烘収鍋滆溅') {
+       document.title = to.meta.title
+   }
+    next();
+})
 
 new Vue({
     router,
+    store,
     render: h => h(App)
-}).$mount('#app')
+}).$mount('#app')
\ No newline at end of file

--
Gitblit v1.9.1