From 5743e533414c608a12f9323f17a7c86721c7f54c Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期五, 06 十一月 2026 00:13:43 +0800
Subject: [PATCH] organfee

---
 src/main.js |   59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 57 insertions(+), 2 deletions(-)

diff --git a/src/main.js b/src/main.js
index 60b8011..3601ed1 100644
--- a/src/main.js
+++ b/src/main.js
@@ -10,11 +10,17 @@
 import Cookies from 'js-cookie'
 
 import Element from 'element-ui'
+import '@/assets/styles/tokens.css' // 璁捐浠ょ墝锛圕SS 鍙橀噺锛屼緵杩愯鏃舵崲鑲わ級
 import './assets/styles/element-variables.scss'
 
 import '@/assets/styles/index.scss' // global css
 import '@/assets/styles/ruoyi.scss' // ruoyi css
+// 杩愯鏃朵富棰樺眰 + 缁勪欢榛樿澶栬锛氬繀椤绘櫄浜� element-ui 涓� ruoyi.scss锛屽惁鍒欒鐩栦笉鐢熸晥
+import '@/assets/styles/theme-runtime.scss'
+import '@/assets/styles/element-override.scss'
+import '@/assets/styles/pdf-resize-dialog.scss'
 import App from './App'
+import FilePreview from '@/components/FilePreview/index.vue'
 import store from './store'
 import router from './router'
 import directive from './directive' //directive
@@ -27,6 +33,8 @@
 import { getConfigKey } from "@/api/system/config";
 import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/ruoyi";
 import dataV from '@jiaminghi/data-view';//dataV
+// 涓婚鑹茶繍琛屾椂锛圕SS 鍙橀噺娉ㄥ叆锛�
+import { applyTheme, getStoredTheme, DEFAULT_PRIMARY } from '@/utils/theme'
 // 鍒嗛〉缁勪欢
 import Pagination from "@/components/Pagination";
 // 鑷畾涔夎〃鏍煎伐鍏风粍浠�
@@ -37,6 +45,7 @@
 import FileUpload from "@/components/FileUpload"
 // 鍥剧墖涓婁紶缁勪欢
 import ImageUpload from "@/components/ImageUpload"
+import AttachmentPreviewPane from "@/components/AttachmentPreviewPane/index.vue"
 // 瀛楀吀鏍囩缁勪欢
 import DictTag from '@/components/DictTag'
 // 澶撮儴鏍囩缁勪欢
@@ -84,6 +93,30 @@
 Vue.component('Editor', Editor)
 Vue.component('FileUpload', FileUpload)
 Vue.component('ImageUpload', ImageUpload)
+Vue.component('AttachmentPreviewPane', AttachmentPreviewPane)
+
+// 闄勪欢鍐呭祵棰勮锛氭墍鏈夋姤閿�椤靛叡鐢�
+Vue.mixin({
+  data() {
+    return {
+      embeddedFile: null,
+      pdfFullscreen: false
+    }
+  },
+  methods: {
+    openEmbeddedPreview(item) {
+      if (!item) return
+      const ext = String(item.name || '').toLowerCase().split('.').pop()
+      const type = ext === 'pdf'
+        ? 'pdf'
+        : ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp'].includes(ext)
+          ? 'image'
+          : 'other'
+      this.embeddedFile = { name: item.name, url: item.url, type }
+      this.pdfVisible = true
+    }
+  }
+})
 
 Vue.use(directive)
 Vue.use(plugins)
@@ -102,14 +135,36 @@
  */
 
 Vue.use(Element, {
-  size: Cookies.get('size') || 'medium' // set element-ui default size
+  size: Cookies.get('size') || 'small' // set element-ui default size锛堝師 medium锛屾敼涓� small 鎻愬崌淇℃伅瀵嗗害锛�
 })
+
+// 鍚姩鍗冲簲鐢ㄥ凡淇濆瓨鐨勪富棰樿壊锛堢櫥褰曢〉绛変笉浣跨敤 Layout 鐨勯〉闈篃鑳界敓鏁堬級
+applyTheme(getStoredTheme() || DEFAULT_PRIMARY)
 
 Vue.config.productionTip = false
 
-new Vue({
+// 鍓嶇鏋勫缓鏍囪瘑锛氱敤浜庣‘璁ゆ祻瑙堝櫒瀹為檯鍔犺浇鐨勬槸鍝竴鐗堜唬鐮�
+window.__APP_BUILD__ = '2026-11-03-PDF-PREVIEW-18'
+
+const app = new Vue({
   el: '#app',
   router,
   store,
   render: h => h(App)
 })
+
+// 鏂囦欢棰勮锛欰pp 鍐呮寕杞界殑鍏ㄥ眬缁勪欢锛岄伩鍏嶅湪搴旂敤澶栨墜宸� $mount
+let fallbackPreview = null
+Vue.prototype.$previewFile = (files, index = 0) => {
+  if (app.$refs.filePreview) {
+    app.$refs.filePreview.open(files, index)
+    return
+  }
+  // 鍏滃簳锛欰pp 鍐呯粍浠跺皻鏈寕杞芥椂锛屼粛淇濊瘉鏈夐瑙堝叆鍙�
+  if (!fallbackPreview) {
+    const FilePreviewCtor = Vue.extend(FilePreview)
+    fallbackPreview = new FilePreviewCtor().$mount()
+    document.body.appendChild(fallbackPreview.$el)
+  }
+  fallbackPreview.open(files, index)
+}

--
Gitblit v1.9.3