From 531d433ab95e1c5ca48637eca9dc157380f675c0 Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期四, 12 十一月 2026 18:37:05 +0800
Subject: [PATCH] 修改了个税功能

---
 src/main.js |  101 +++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 98 insertions(+), 3 deletions(-)

diff --git a/src/main.js b/src/main.js
index d800d22..d8a4a2e 100644
--- a/src/main.js
+++ b/src/main.js
@@ -3,18 +3,25 @@
  * @Date: 2022-04-25 08:04:47
  * @LastEditors: your Name
  * @LastEditTime: 2022-04-25 16:33:00
- * @Description: 
+ * @Description:
  */
 import Vue from 'vue'
 import yearPicker from 'vue-year-picker'
 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 '@/assets/styles/money.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 +34,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 +46,8 @@
 import FileUpload from "@/components/FileUpload"
 // 鍥剧墖涓婁紶缁勪欢
 import ImageUpload from "@/components/ImageUpload"
+import AttachmentPreviewPane from "@/components/AttachmentPreviewPane/index.vue"
+import { formatMoneyValue, moneyColumnFormatter } from '@/utils/money'
 // 瀛楀吀鏍囩缁勪欢
 import DictTag from '@/components/DictTag'
 // 澶撮儴鏍囩缁勪欢
@@ -47,6 +58,17 @@
 // import li_area_select from '@components/Address'
 import moment from "moment"
 import '@/utils/drag.js';
+import DingTalkPC from 'dingtalk-jsapi';
+
+Vue.prototype.$dingtalk = DingTalkPC;
+DingTalkPC.config({
+  agentId: 'your_agentId',
+  corpId: 'your_corpId',
+  timeStamp: new Date().getTime(),
+  nonceStr: 'your_nonceStr',
+  signature: 'your_signature',
+  jsApiList: ['runtime.permission.requestAuthCode']
+});
 
 Vue.prototype.$moment = moment;
 
@@ -64,6 +86,7 @@
 import echarts from 'echarts'
 Vue.prototype.$echarts = echarts
 
+
 // 鍏ㄥ眬缁勪欢鎸傝浇
 // Vue.component('li_area_select',li_area_select)
 Vue.component('DictTag', DictTag)
@@ -72,6 +95,37 @@
 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: {
+    formatMoneyValue,
+    formatMoney: moneyColumnFormatter,
+    normalizeMoney(row, key) {
+      if (row && key) {
+        row[key] = formatMoneyValue(row[key])
+      }
+    },
+    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)
@@ -90,14 +144,55 @@
  */
 
 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-12-MONEY-1'
+
+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)
+}
+
+// 閲戦鍒楀唴鍙紪杈戣緭鍏ユ澶辩劍鍚庣粺涓�涓や綅灏忔暟
+document.addEventListener('focusout', e => {
+  const target = e.target
+  if (!target || target.tagName !== 'INPUT') return
+  if (!target.closest('.money-column')) return
+  const raw = String(target.value || '').trim()
+  if (raw === '') return
+  const num = Number(raw)
+  if (!Number.isFinite(num)) return
+  const text = num.toFixed(2)
+  if (target.value === text) return
+  const setter = Object.getOwnPropertyDescriptor(
+    window.HTMLInputElement.prototype,
+    'value'
+  ).set
+  setter.call(target, text)
+  target.dispatchEvent(new Event('input', { bubbles: true }))
+})

--
Gitblit v1.9.3