rsbi преди 4 години
родител
ревизия
34778c3efa
променени са 2 файла, в които са добавени 13 реда и са изтрити 2 реда
  1. 2 1
      src/view/model/DsetAdd.vue
  2. 11 1
      src/view/model/DsetTableJoin.vue

+ 2 - 1
src/view/model/DsetAdd.vue

@@ -306,11 +306,12 @@ export default {
           refMaster.get_node("#").children.forEach((element) => {
             let node = refMaster.get_node(element);
             if (node.li_attr.ref) {
+              console.log(node.li_attr);
               json.joininfo.push({
                 col: node.id,
                 ref: node.li_attr.ref,
                 refKey: node.li_attr.refKey,
-                jtype: node.li_attr.jstype,
+                jtype: node.li_attr.jtype,
               });
               joins.push(node.li_attr.ref);
             }

+ 11 - 1
src/view/model/DsetTableJoin.vue

@@ -113,8 +113,18 @@ export default {
         this.$notify.error("请选择字段再点关联");
         return;
       }
-      this.masterCol = node[0].id;
+      node = node[0];
+      this.masterCol = node.id;
       this.showDailog = true;
+      if(node.li_attr.ref){ //回写值
+        this.join.ref = node.li_attr.ref;
+        this.join.refKey = node.li_attr.refKey;
+        this.join.jtype = node.li_attr.jtype;
+      }else{
+        this.join.ref = null;
+        this.join.refKey = null;
+        this.join.jtype = null;
+      }
     },
     savejoin(){
       var ref = $("#masterTableTree").jstree(true);