From 948a8b5fba4baf0a19493ae6d7b8a1dee0d4101a Mon Sep 17 00:00:00 2001
From: wangting <675591594@qq.com>
Date: 星期二, 14 五月 2024 17:01:19 +0800
Subject: [PATCH] 修改action实现机制,配置文档

---
 Source/ProjectWeb/src/components/actions/base/BaseAction.js |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/Source/ProjectWeb/src/components/actions/base/BaseAction.js b/Source/ProjectWeb/src/components/actions/base/BaseAction.js
index b560c29..1c336ee 100644
--- a/Source/ProjectWeb/src/components/actions/base/BaseAction.js
+++ b/Source/ProjectWeb/src/components/actions/base/BaseAction.js
@@ -1,6 +1,6 @@
 import {validatenull} from "@/util/validate";
 import Vue from 'vue';
-import {handlers} from '../handlers';
+import {handlerAction} from '../handlers';
 
 /**
  * 鎸夐挳鐨勫熀纭�鏈嶅姟
@@ -61,15 +61,12 @@
   }
   if (button.url && button.url != 'null') {
     //鏈夐厤缃產ction璺緞锛屼娇鐢ㄨ矾寰勫搴旂殑js
-    import("../" + button.url + ".js").then(module => {
+    import(`../${button.url}`).then(module => {
       module.doAction(options, callback);
     })
   } else {
-    if (handlers[button.actionVO.id.toLowerCase()]) {
-      handlers[button.actionVO.id.toLowerCase()]()
-    } else {
-      Vue.prototype.$message.error('鏈壘鍒板搴攁ction锛岃閲嶆柊閰嶇疆鎸夐挳锛�');
-    }
+    //鎵ц閫氱敤action
+    handlerAction(button.actionVO.id.toLowerCase(),options, callback)
   }
 };
 
@@ -151,7 +148,7 @@
       fnTarget(buttonParse,callback);
     }else{
       try {
-        import("../"+buttonParse.jsPath+".js").then(module => {
+        import(`../${buttonParse.jsPath}.js`).then(module => {
           module[buttonParse.methodName](options,callback);
         })
       } catch (error) {
@@ -179,7 +176,7 @@
       fnTarget(buttonParse,callback,actionType);
     }else{
       try {
-        import("../"+buttonParse.jsPath+".js").then(module => {
+        import(`../${buttonParse.jsPath}.js`).then(module => {
           module[buttonParse.methodName](options,callback,actionType);
         })
       } catch (error) {

--
Gitblit v1.9.3