Browse Source

地区选择

afa 10 months ago
parent
commit
74aab2320b

+ 4 - 17
application/admin/command/Task.php

@@ -26,42 +26,29 @@ class Task extends Command
 
             $arr = array();
             $i = 0;
-            // $reg::chunk(100, function($rows) use($arr, $i) {
-            //       foreach ($rows as $row)  {
-                      
-            //             $arr[$i]['label'] = $row->name;
-            //             $arr[$i]['value'] = $row->id;
-            //             dump($row);die;
-            //       }
-            //       return false;
-            // });
-
-
-
-         
             foreach ($list as $key => $item) {
 
               
                   $arr[$i]['label'] = $item;
-                  $arr[$i]['value'] = $key;
+                  $arr[$i]['id'] = $key;
                   $list1  =$reg::where('parent_id', '=', $key)->column('id,name');
                   $j = 0;
                   foreach ($list1 as $key1 => $item1) {
                         $arr[$i]['children'][$j]['label'] = $item1;
-                        $arr[$i]['children'][$j]['value'] = $key1;
+                        $arr[$i]['children'][$j]['id'] = $key1;
                         $list2  =$reg::where('parent_id', '=', $key1)->column('id,name');
                         $s = 0;
                        
                         foreach ($list2 as $key2 => $item2) {
                               $arr[$i]['children'][$j]['children'][$s]['label'] = $item2;
-                              $arr[$i]['children'][$j]['children'][$s]['value'] = $key2;
+                              $arr[$i]['children'][$j]['children'][$s]['id'] = $key2;
                               $list3  =$reg::where('parent_id', '=', $key2)->column('id,name');
 
                               $d = 0;
                               foreach ($list3 as $key3 => $item3) {
 
                                     $arr[$i]['children'][$j]['children'][$s]['children'][$d]['label'] = $item3;
-                                    $arr[$i]['children'][$j]['children'][$s]['children'][$d]['value'] = $key3;
+                                    $arr[$i]['children'][$j]['children'][$s]['children'][$d]['id'] = $key3;
 
                                     $d += 1;
                               }

+ 1 - 0
application/admin/view/product/lists/edit.html

@@ -65,6 +65,7 @@
                 placeholder="选择关联地区"
                 v-model="data"
                 @input="handleChange"
+                :clearable='false'
                 ref="treeselect"/>
                 <template v-slot:value-label="{ node }">
                   <span>{{ getNode(node) }}</span>

File diff suppressed because it is too large
+ 0 - 0
public/assets/libs/area/area.js


Some files were not shown because too many files changed in this diff