From e1749547c76a5d8bae94e47d38d4d75b481610c1 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@63.com> Date: 星期四, 09 九月 2021 10:51:15 +0800 Subject: [PATCH] # --- src/main/webapp/views/allo/allo_detail.html | 49 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 46 insertions(+), 3 deletions(-) diff --git a/src/main/webapp/views/allo/allo_detail.html b/src/main/webapp/views/allo/allo_detail.html index 08b3257..4ebabaa 100644 --- a/src/main/webapp/views/allo/allo_detail.html +++ b/src/main/webapp/views/allo/allo_detail.html @@ -33,12 +33,19 @@ <input id="name" class="layui-input" type="text" autocomplete="off"> </div> </div> - <div class="layui-inline" style="width:31%;;display: none"> - <label class="layui-form-label">鐖躲��銆�绾э細</label> + <div class="layui-inline" style="width:85%;"> + <label class="layui-form-label form-required">鎵�灞炲簱鍖猴細</label> <div class="layui-input-inline"> - <input id="parentId" class="layui-input" type="text" lay-verify="number" > + <select id="parentId" lay-verify="required" lay-search=""> + </select> </div> </div> +<!-- <div class="layui-inline" style="width:31%;;display: none">--> +<!-- <label class="layui-form-label">鐖躲��銆�绾э細</label>--> +<!-- <div class="layui-input-inline">--> +<!-- <input id="parentId" class="layui-input" type="text" lay-verify="number" >--> +<!-- </div>--> +<!-- </div>--> <div class="layui-inline" style="width:31%;;display: none"> <label class="layui-form-label">鐖剁骇鍚嶇О锛�</label> <div class="layui-input-inline"> @@ -170,6 +177,42 @@ <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></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> +<script type="text/template" id="parentNodeGroup"> + <option value="">閫夋嫨搴撳尯</option> + {{#each data}} + <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> -- Gitblit v1.9.1