Ver Fonte

编辑元素来源回显

duy há 2 meses atrás
pai
commit
c2ea1a44c5
1 ficheiros alterados com 35 adições e 2 exclusões
  1. 35 2
      src/views/digital/signer.vue

+ 35 - 2
src/views/digital/signer.vue

@@ -676,6 +676,7 @@ import { log } from "@antv/g2plot/lib/utils";
             //选择元素来源
             eleCheck(row,index,type) {
                 console.log(row,'row');
+                console.log(type,'type');
                 this.getAllElements()
                 this.eleCheckRow=row;
                 this.eleIndex=index;
@@ -690,8 +691,31 @@ import { log } from "@antv/g2plot/lib/utils";
                     
                    if(row.id){
                     this.getEleDetail(row.id,1)
+                        getTableList({
+                            tableType:''
+                        }).then(res => {
+                    
+                            if (res.data.code == 200) {
+                                this.elementTableOptions = res.data.data.map(item => ({
+                                    value: item.id,
+                                    label: item.tabChName
+                                }));
+                                // this.elementTableNameSelect=row.tableIds
+                                let arr=[];
+                                this.elementList.forEach(item => {
+                                    arr.push(item.value)
+                                    // item.checked = false;
+                                });
+                                this.elementTableNameSelect=arr
+
+                            }else{  
+                                this.elementTableOptions = [];
+                                this.elementTableNameSelect=[]
+                            }
+                        });
+
                    }else{
-                console.log(row,'222');
+               
                  
                     this.elementCategorySelect=row.eleType
                     this.changeSelect(row.eleType)
@@ -719,7 +743,15 @@ import { log } from "@antv/g2plot/lib/utils";
                     this.elementLoading = false;
                     if (res.data.code == 200) {
                         if(type==1){
-                            this.elementList = res.data.data;
+                            // this.elementList = res.data.data;
+                            this.elementList = res.data.data.map(item => ({
+                            value: item.id,
+                            label: item.name,
+                            checked: true
+                          
+                        }));
+                            console.log( this.elementList,' this.elementList');
+                            
                                 
                         }else{
                             this.elementList1 = res.data.data;
@@ -788,6 +820,7 @@ import { log } from "@antv/g2plot/lib/utils";
                             value: item.id,
                             label: item.tabChName
                         }));
+                        this.slec
                     }else{  this.elementTableOptions = [];}
                 });
             },