From 46c673f0bf4a22ae108e90cfcf1bdeb4f0b6a45c Mon Sep 17 00:00:00 2001
From: wangting <675591594@qq.com>
Date: 星期二, 07 五月 2024 17:48:19 +0800
Subject: [PATCH] 添加action,数据联动

---
 Source/ProjectWeb/src/components/dynamic-components/index.vue |   74 +++++++++++++++++++++++++++++++------
 1 files changed, 62 insertions(+), 12 deletions(-)

diff --git a/Source/ProjectWeb/src/components/dynamic-components/index.vue b/Source/ProjectWeb/src/components/dynamic-components/index.vue
index 10ed89e..7660ba1 100644
--- a/Source/ProjectWeb/src/components/dynamic-components/index.vue
+++ b/Source/ProjectWeb/src/components/dynamic-components/index.vue
@@ -1,49 +1,68 @@
 <template>
-  <dynamic-table v-if="componentVO.uiComponentType=='table'"
+  <dynamic-table v-if="componentVO.uiComponentType=='table' || componentVO.uiComponentType=='TreeTable'"
+                 :uiBtmType="uiBtmType"
+                 :uiContext="uiContext"
                  :key="areasName+'table-'+componentVO.oid"
                  :inDialog="inDialog"
+                 :canEdit="canEdit"
                  :componentVO="componentVO"
                  :sourceData="sourceData"
+                 :sourceBtmType="sourceBtmType"
+                 :dataStore="dataStore"
                  :areasName="areasName"
                  :paramVOS="paramVOS"
+                 @setData="setData"
+                 @setDataStore="setDataStore"
                  :isShow="isShow">
 
   </dynamic-table>
-  <dynamicTreeTable v-else-if="componentVO.uiComponentType=='TreeTable'"
-                 :key="areasName+'table-'+componentVO.oid"
-                 :inDialog="inDialog"
-                 :componentVO="componentVO"
-                 :sourceData="sourceData"
-                 :areasName="areasName"
-                 :paramVOS="paramVOS"
-                 :isShow="isShow">
-
-  </dynamicTreeTable>
   <dynamic-form v-else-if="componentVO.uiComponentType=='form'"
+                :uiBtmType="uiBtmType"
+                :uiContext="uiContext"
                 :key="areasName+'form-'+componentVO.oid"
                 :inDialog="inDialog"
+                :canEdit="canEdit"
                 :componentVO="componentVO"
                 :sourceData="sourceData"
+                :sourceBtmType="sourceBtmType"
+                :dataStore="dataStore"
                 :areasName="areasName"
                 :paramVOS="paramVOS"
+                @setData="setData"
+                @setDataStore="setDataStore"
                 :isShow="isShow">
 
   </dynamic-form>
   <dynamic-tree v-else-if="componentVO.uiComponentType=='tree'"
+                :uiBtmType="uiBtmType"
+                :uiContext="uiContext"
                 :key="areasName+'tree-'+componentVO.oid"
                 :inDialog="inDialog"
+                :canEdit="canEdit"
                 :componentVO="componentVO"
                 :sourceData="sourceData"
+                :sourceBtmType="sourceBtmType"
+                :dataStore="dataStore"
                 :areasName="areasName"
                 :paramVOS="paramVOS"
+                @setData="setData"
+                @setDataStore="setDataStore"
                 :isShow="isShow">
   </dynamic-tree>
-  <dynamic-custom v-else-if="componentVO.uiComponentType=='customer'"  :inDialog="inDialog"
+  <dynamic-custom v-else-if="componentVO.uiComponentType=='customer'"
+                  :uiBtmType="uiBtmType"
+                  :uiContext="uiContext"
+                  :inDialog="inDialog"
+                  :canEdit="canEdit"
                   :key="areasName+'custom-'+componentVO.oid"
                   :componentVO="componentVO"
                   :sourceData="sourceData"
+                  :sourceBtmType="sourceBtmType"
+                  :dataStore="dataStore"
                   :areasName="areasName"
                   :paramVOS="paramVOS"
+                  @setData="setData"
+                  @setDataStore="setDataStore"
                   :isShow="isShow">
 
   </dynamic-custom>
@@ -59,6 +78,14 @@
   name: "dynamicIndex",
   components:{dynamicCustom, dynamicTree, dynamicForm, dynamicTable,dynamicTreeTable  },
   props:{
+    //ui涓婁笅鏂囩殑涓氬姟绫诲瀷锛堟垨閾炬帴绫诲瀷锛�
+    uiBtmType: {
+      type: String
+    },
+    //ui涓婁笅鏂�
+    uiContext:{
+      type: String
+    },
     componentVO:{
       type:Object,
       default: {}
@@ -66,6 +93,11 @@
     inDialog: {
       type: Boolean,
       default: false
+    },
+    canEdit:{
+      //鍐呭鏄惁鍙紪杈�
+      type:Boolean,
+      default:false
     },
     areasName:{
       type:String,
@@ -75,6 +107,15 @@
       //鑿滃崟婧愭暟鎹垨鑰呭脊绐楁椂鎸夐挳鎵�灞炲尯鍩熺殑涓婁竴鍖哄煙閫変腑鏁版嵁
       type:Object,
       default: {}
+    },
+    //涓婁竴鍖哄煙涓氬姟绫诲瀷
+    sourceBtmType:{
+      type: String
+    },
+    dataStore:{
+      //寮圭獥鏃舵寜閽墍灞炲尯鍩熼�変腑鏁版嵁
+      type:Array,
+      default: []
     },
     paramVOS:{
       type:Object,
@@ -87,6 +128,15 @@
     },
   },
   created() {
+  },
+  methods:{
+    setDataStore(value) {
+      this.$emit("setDataStore", value);
+      this.dataStore = value.dataStore;
+    },
+    setData(value) {
+      this.$emit("setData", value);
+    }
   }
 }
 </script>

--
Gitblit v1.9.3