From 0375a993bce43caa2a2b6b6ff45ed824704aae69 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期六, 06 三月 2021 16:58:51 +0800
Subject: [PATCH] #

---
 src/main/webapp/views/allo/allo.html        |    9 +---
 src/main/webapp/static/js/allo/allo.js      |   12 ------
 src/main/webapp/static/js/area/area.js      |   12 ------
 src/main/webapp/views/allo/allo_detail.html |   29 ++++++++++++++
 src/main/webapp/views/area/area_detail.html |   30 +++++++++++++++
 5 files changed, 61 insertions(+), 31 deletions(-)

diff --git a/src/main/webapp/static/js/allo/allo.js b/src/main/webapp/static/js/allo/allo.js
index b5c27ea..2689606 100644
--- a/src/main/webapp/static/js/allo/allo.js
+++ b/src/main/webapp/static/js/allo/allo.js
@@ -1,17 +1,5 @@
 var pageCurr;
 
-getParentNode();
-function getParentNode(el) {
-    http.post(baseUrl + "/parent/node/group", {type: 2}, function (res) {
-        if (res.data != null) {
-            var tpl = $("#parentNodeGroup").html();
-            var template = Handlebars.compile(tpl);
-            var html = template(res);
-            $('#parentId').append(html);
-        }
-    });
-}
-
 layui.use(['table','laydate', 'form'], function(){
     var table = layui.table;
     var $ = layui.jquery;
diff --git a/src/main/webapp/static/js/area/area.js b/src/main/webapp/static/js/area/area.js
index 14626a3..908d641 100644
--- a/src/main/webapp/static/js/area/area.js
+++ b/src/main/webapp/static/js/area/area.js
@@ -1,18 +1,6 @@
 var pageCurr;
 var tableIns;
 
-getParentNode();
-function getParentNode(el) {
-    http.post(baseUrl + "/parent/node/group", {type: 1}, function (res) {
-        if (res.data != null) {
-            var tpl = $("#parentNodeGroup").html();
-            var template = Handlebars.compile(tpl);
-            var html = template(res);
-            $('#parentId').append(html);
-        }
-    });
-}
-
 layui.use(['table','laydate', 'form'], function(){
     var table = layui.table;
     var $ = layui.jquery;
diff --git a/src/main/webapp/views/allo/allo.html b/src/main/webapp/views/allo/allo.html
index f3c9aa5..1519a40 100644
--- a/src/main/webapp/views/allo/allo.html
+++ b/src/main/webapp/views/allo/allo.html
@@ -55,19 +55,14 @@
 
 <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script>
 <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script>
+<script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script>
 <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script>
 <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script>
-<script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script>
 <script type="text/javascript" src="../../static/js/allo/allo.js" charset="utf-8"></script>
 
 <iframe id="detail-iframe" scrolling="auto" style="display:none;"></iframe>
 
 </body>
-<script type="text/template" id="parentNodeGroup">
-    <option value="">閫夋嫨搴撳尯</option>
-    {{#each data}}
-    <option value="{{this.key}}">{{this.val}}</option>
-    {{/each}}
-</script>
+
 </html>
 
diff --git a/src/main/webapp/views/allo/allo_detail.html b/src/main/webapp/views/allo/allo_detail.html
index b48d5cd..4ebabaa 100644
--- a/src/main/webapp/views/allo/allo_detail.html
+++ b/src/main/webapp/views/allo/allo_detail.html
@@ -185,5 +185,34 @@
     <option value="{{this.key}}">{{this.val}}</option>
     {{/each}}
 </script>
+<script>
+    layui.use(['form'], function(){
+        var form = layui.form;
+        getParentNode();
+        function getParentNode(el) {
+            $.ajax({
+                url: baseUrl+"/parent/node/group",
+                headers: {'token': localStorage.getItem('token')},
+                data: {type: 2},
+                method: 'POST',
+                success: function (res) {
+                    if (res.code === 200){
+                        if (res.data != null) {
+                            var tpl = $("#parentNodeGroup").html();
+                            var template = Handlebars.compile(tpl);
+                            var html = template(res);
+                            $('#parentId').append(html);
+                            layui.form.render('select');
+                        }
+                    } else if (res.code === 403){
+                        top.location.href = baseUrl+"/";
+                    } else {
+                        layer.msg(res.msg)
+                    }
+                }
+            })
+        }
+    })
+</script>
 </html>
 
diff --git a/src/main/webapp/views/area/area_detail.html b/src/main/webapp/views/area/area_detail.html
index 1eb3daf..b8969fa 100644
--- a/src/main/webapp/views/area/area_detail.html
+++ b/src/main/webapp/views/area/area_detail.html
@@ -190,5 +190,35 @@
     <option value="{{this.key}}">{{this.val}}</option>
     {{/each}}
 </script>
+<script>
+    layui.use(['form'], function(){
+        var form = layui.form;
+        getParentNode();
+        function getParentNode(el) {
+            $.ajax({
+                url: baseUrl+"/parent/node/group",
+                headers: {'token': localStorage.getItem('token')},
+                data: {type: 1},
+                method: 'POST',
+                success: function (res) {
+                    if (res.code === 200){
+                        if (res.data != null) {
+                            var tpl = $("#parentNodeGroup").html();
+                            var template = Handlebars.compile(tpl);
+                            var html = template(res);
+                            $('#parentId').append(html);
+                            form.render('select');
+                        }
+                    } else if (res.code === 403){
+                        top.location.href = baseUrl+"/";
+                    } else {
+                        layer.msg(res.msg)
+                    }
+                }
+            })
+        }
+    })
+
+</script>
 </html>
 

--
Gitblit v1.9.1