Răsfoiți Sursa

编辑器修改

moshaorui 4 luni în urmă
părinte
comite
bbe9093f38
1 a modificat fișierele cu 10 adăugiri și 1 ștergeri
  1. 10 1
      resources/views/admin/pages-custom/ace.blade.php

+ 10 - 1
resources/views/admin/pages-custom/ace.blade.php

@@ -293,6 +293,7 @@
         }
         //左边外观选择与分销商选择联动
         $('select[name="appearance_id"]').change(function() {
+            //console.log('-------2-----')
             if ($(this).val() == '') {
                 changeButtonDisabled(true);
             }
@@ -301,20 +302,26 @@
             });
             //请空编辑器内容
             editor.setValue('');
+            //请空代码树
+            $('.main-card-body').html('');
             //显示代码树
             postData();
         });
+        //分销商选择
         $('input[name="dist_id"]').change(function() {
+            //console.log('-------0-----')
             loadingIndex = layer.load(1, {
                 shade: [0.5, '#000'] // 设置遮罩层
             });
             //请空编辑器内容
             editor.setValue('');
+            //请空代码树
+            $('.main-card-body').html('');
             dist_id = $(this).val();
 
             //在分销商名字前加上分销商id
             setTimeout(function() {
-                $("div[name='dist_id'] .option").text(dist_id+" - " + $("div[name='dist_id'] .option").text());
+                $("div[name='dist_id'] .option").prepend(dist_id+" - ");
             }, 100); // 延迟2000毫秒(即2秒)
 
 
@@ -327,9 +334,11 @@
                     dist_id: dist_id,
                 },
                 success: function(response) {
+                    //console.log('-------1-----')
                     // 更改选中的值
                     var $select = $('select[name="appearance_id"]');
                     $select.select2('val', response);
+
                     //显示代码树
                    // postData();
                 }