zhengnaiwen_citu 3 hónapja
szülő
commit
53a2ea29b7

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 261 - 826
package-lock.json


+ 1 - 0
package.json

@@ -13,6 +13,7 @@
     "@babel/polyfill": "^7.12.1",
     "@babel/preset-env": "^7.23.9",
     "@mdi/font": "^7.4.47",
+    "@vue/composition-api": "^1.7.2",
     "@wangeditor/editor": "^5.1.23",
     "@wangeditor/editor-for-vue": "^1.0.2",
     "axios": "^1.7.2",

+ 96 - 24
src/components/AutoComponents/ECharts/eCharts.js

@@ -49,33 +49,105 @@ class EChartsComponent {
     ]
 
     const echartsInstance = ECharts.init(el)
-    const handler = {
-      get: function (target, prop) {
-        if (prop === 'setOption') {
-          return function (option, ...args) {
-            // 填充图例数据
-            const { legend, ...options } = option
-            if (legend) {
-              Object.assign(legend, {
-                data: options.series.map((item, index) => {
-                  return item.name || `系列${index + 1}`
-                })
-              })
-            }
-            // 合并颜色配置
-            const mergedOption = {
-              legend,
-              color: defaultColors,
-              ...options
-            }
-            // 调用原始的 setOption 方法
-            return target[prop](mergedOption, ...args)
-          }
+    // const handler = {
+    //   get: function (target, prop) {
+    //     if (prop === 'setOption') {
+    //       return function (option, ...args) {
+    //         // 填充图例数据
+    //         const { legend, ...options } = option
+    //         if (legend) {
+    //           Object.assign(legend, {
+    //             data: options.series.map((item, index) => {
+    //               return item.name || `系列${index + 1}`
+    //             })
+    //           })
+    //         }
+    //         // 合并颜色配置
+    //         const mergedOption = {
+    //           legend,
+    //           color: defaultColors,
+    //           ...options
+    //         }
+    //         // 调用原始的 setOption 方法
+    //         return target[prop](mergedOption, ...args)
+    //       }
+    //     }
+    //     return target[prop]
+    //   }
+    // }
+    // this.el = new Proxy(echartsInstance, handler)
+    function createEchartsWrapper (echartsInstance) {
+      const wrapper = { el: echartsInstance }
+
+      // 保存原始 setOption 方法
+      const originalSetOption = echartsInstance.setOption
+
+      // 定义新的 setOption 方法
+      function wrappedSetOption (option, ...args) {
+        // 填充图例数据
+        const { legend, ...options } = option
+        if (legend) {
+          Object.assign(legend, {
+            data: options.series.map((item, index) => {
+              return item.name || `系列${index + 1}`
+            })
+          })
+        }
+
+        // 合并颜色配置
+        const mergedOption = {
+          legend,
+          color: defaultColors,
+          ...options
         }
-        return target[prop]
+
+        // 调用原始的 setOption 方法
+        return originalSetOption.call(echartsInstance, mergedOption, ...args)
       }
+
+      // 使用 Object.defineProperty 定义 setOption 属性
+      Object.defineProperty(wrapper, 'setOption', {
+        get: function () {
+          return wrappedSetOption
+        },
+        enumerable: true,
+        configurable: true
+      })
+
+      // 代理其他属性和方法
+      Object.keys(echartsInstance).forEach(key => {
+        if (key !== 'setOption') { // 跳过已经处理的 setOption
+          Object.defineProperty(wrapper, key, {
+            get: function () {
+              return echartsInstance[key]
+            },
+            enumerable: true,
+            configurable: true
+          })
+        }
+      })
+
+      // 处理原型上的方法
+      const proto = Object.getPrototypeOf(echartsInstance)
+      Object.getOwnPropertyNames(proto).forEach(key => {
+        if (typeof proto[key] === 'function' && key !== 'constructor' && !Object.prototype.hasOwnProperty.call(wrapper, key)) {
+          Object.defineProperty(wrapper, key, {
+            get: function () {
+              return function (...args) {
+                return echartsInstance[key].apply(echartsInstance, args)
+              }
+            },
+            enumerable: true,
+            configurable: true
+          })
+        }
+      })
+
+      return wrapper
     }
-    this.el = new Proxy(echartsInstance, handler)
+
+    // 使用方式
+    this.el = createEchartsWrapper(echartsInstance)
   }
 
   getEl () {

+ 2 - 1
src/main.js

@@ -14,7 +14,7 @@ import promise from 'es6-promise'
 import '@/styles/index.scss'
 import '@/styles/orangeTheme.scss'
 import './autoComponents'
-
+import VueCompositionAPI from '@vue/composition-api'
 // 引入自定义指令
 import Directives from './directives/index.js'
 import 'scrolling-element'
@@ -33,6 +33,7 @@ ElementUI.MessageBox.setDefaults({
 
 Vue.use(ElementUI)
 Vue.use(Directives)
+Vue.use(VueCompositionAPI)
 
 Vue.prototype.$DEFAULT_TITLE = '薪酬通'
 

+ 1 - 1
src/views/salary/solution/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="white pa-3">
-    <TabTemplate :permission="['view']" :import-context="(path) => import(`./${path}`)" @history="onHistory"></TabTemplate>
+    <TabTemplate :permission="['view', 'release', 'delete']" :import-context="(path) => import(`./${path}`)" @history="onHistory"></TabTemplate>
     <el-drawer
       :title="itemData.title"
       :visible.sync="show"

+ 22 - 0
vue.config.js

@@ -24,6 +24,17 @@ module.exports = defineConfig({
         target: 'https://company.citupro.com:18182/op/base',
         secure: false, // 是否支持 https,默认 false
         changeOrigin: true, // 是否支持跨域
+        headers: {
+          // 确保包含这些头部以兼容IE11
+          Accept: 'application/json',
+          'Content-Type': 'application/json; charset=utf-8'
+        },
+        onProxyReq (proxyReq) {
+          // 对于IE11的特殊处理
+          if (proxyReq.getHeader('origin')) {
+            proxyReq.setHeader('origin', 'https://company.citupro.com:18182/op/base')
+          }
+        },
         pathRewrite: {
           '^/op/base': ''
         }
@@ -33,6 +44,17 @@ module.exports = defineConfig({
         target: 'https://company.citupro.com:18183',
         secure: false, // 是否支持 https,默认 false
         changeOrigin: true, // 是否支持跨域
+        headers: {
+          // 确保包含这些头部以兼容IE11
+          Accept: 'application/json',
+          'Content-Type': 'application/json; charset=utf-8'
+        },
+        onProxyReq (proxyReq) {
+          // 对于IE11的特殊处理
+          if (proxyReq.getHeader('origin')) {
+            proxyReq.setHeader('origin', 'https://company.citupro.com:18183')
+          }
+        },
         pathRewrite: {
           '^/op/base/api': '/op/base/api'
         }

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott