rsbi hace 4 años
padre
commit
34778c3efa
Se han modificado 2 ficheros con 13 adiciones y 2 borrados
  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) => {
           refMaster.get_node("#").children.forEach((element) => {
             let node = refMaster.get_node(element);
             let node = refMaster.get_node(element);
             if (node.li_attr.ref) {
             if (node.li_attr.ref) {
+              console.log(node.li_attr);
               json.joininfo.push({
               json.joininfo.push({
                 col: node.id,
                 col: node.id,
                 ref: node.li_attr.ref,
                 ref: node.li_attr.ref,
                 refKey: node.li_attr.refKey,
                 refKey: node.li_attr.refKey,
-                jtype: node.li_attr.jstype,
+                jtype: node.li_attr.jtype,
               });
               });
               joins.push(node.li_attr.ref);
               joins.push(node.li_attr.ref);
             }
             }

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

@@ -113,8 +113,18 @@ export default {
         this.$notify.error("请选择字段再点关联");
         this.$notify.error("请选择字段再点关联");
         return;
         return;
       }
       }
-      this.masterCol = node[0].id;
+      node = node[0];
+      this.masterCol = node.id;
       this.showDailog = true;
       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(){
     savejoin(){
       var ref = $("#masterTableTree").jstree(true);
       var ref = $("#masterTableTree").jstree(true);