From 52eafd2415619992c66f5f49d522e7d56ddcc3d4 Mon Sep 17 00:00:00 2001
From: wangting <675591594@qq.com>
Date: 星期一, 17 六月 2024 09:22:17 +0800
Subject: [PATCH] 链接类型action

---
 Source/plt-web/plt-web-ui/src/components/actions/base/LinkAddAction.js |   80 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 80 insertions(+), 0 deletions(-)

diff --git a/Source/plt-web/plt-web-ui/src/components/actions/base/LinkAddAction.js b/Source/plt-web/plt-web-ui/src/components/actions/base/LinkAddAction.js
new file mode 100644
index 0000000..3b6b2ea
--- /dev/null
+++ b/Source/plt-web/plt-web-ui/src/components/actions/base/LinkAddAction.js
@@ -0,0 +1,80 @@
+/**
+ * 鎸夐挳澶勭悊 閾炬帴绫诲瀷鏂板
+ */
+import {paramLow,callPreEvent, callPostEvent} from '../BaseAction';
+import {validatenull} from "@/util/validate";
+import Vue from "vue";
+import AddEditDialog from "@/components/actions/base/AddEditDialog"
+
+export const doAction = (options,callback) => {
+  const paramVOS = Object.assign({
+    url: '/api/uiDataController/linkAddSave',
+    method: 'post',
+    uploadfileurl: 'vciFileUploadController/uploadFile'
+  }, options.paramVOS)
+  options.paramVOS = paramVOS;
+
+  options.sourceData = options.sourceData || {};
+
+  callPreEvent(options, doBefore, function (options) {
+    doAdd(options, function (type,formData) {
+      callPostEvent(options, doAfter, callback,type);
+    });
+  });
+};
+
+/**
+ * 鎵ц
+ * @param options 鎸夐挳鐨勯厤缃俊鎭�
+ * @param callback 鍥炶皟
+ */
+export const doAdd = (options,callback)=> {
+  const paramVOS = options.paramVOS;
+  if (!paramVOS['form'] && !paramVOS['context']) {
+    Vue.prototype.$message.error("鎸夐挳閰嶇疆涓嶆纭�");
+    return false;
+  }
+
+  const dialogConstructor = Vue.extend(AddEditDialog);
+  let instance = new dialogConstructor();
+  instance.sourceData = options.sourceData;
+  instance.dataStore = options.dataStore;
+  instance.paramVOS = paramVOS
+
+  instance.type = 'add';
+  instance.dialogClose = function () {
+    vm.visible = false;
+    document.body.removeChild(vm.$el);
+    instance.$destroy();
+    instance = null;
+  };
+  if (callback) {
+    instance.saveCallback = callback;
+  }
+  let vm = instance.$mount();
+  document.body.appendChild(vm.$el);
+  instance.visible = true;
+
+}
+/**
+ * 鍓嶇疆浜嬩欢
+ * @param options 鎸夐挳鐨勯厤缃俊鎭�
+ * @param callback 鍥炶皟
+ */
+export const doBefore = (options,callback)=> {
+  console.log("鎵ц澧炲姞鍓嶇疆浜嬩欢")
+  if(callback){
+    callback(options);
+  }
+}
+/**
+ * 鍚庣疆浜嬩欢
+ * @param options 鎸夐挳鐨勯厤缃俊鎭�
+ * @param callback 鍥炶皟
+ */
+export const doAfter = (options,callback,actionType)=> {
+  console.log('鎵ц澧炲姞鍚庣疆浜嬩欢');
+  if(callback){
+    callback(actionType);
+  }
+}

--
Gitblit v1.9.3