<div class="block-header-toolbar"> <form class="layui-form" action="" lay-filter="prg" class="queryForm"> <label class="layui-form-label">请输入项目名称</label> <div class="layui-input-inline"> <select id="otype" name="otype" lay-verify="required" lay-search="" class="select" > <option value=""></option> </select> </div> </form> </div>
<div class="layui-btn-container"> <form class="layui-form" action="" lay-filter="prg" class="queryForm"> <div class="layui-input-inline"> <select id="oplatform" name="oplatform" lay-verify="required" class="select" > <option value=""></option> </select> </div> </form> </div>
function initDataPushStatus(laytable) { let id = "pushStatusData"; $.ajax({ url: urlpic + "systemDataSource?deptId=4678", type: 'get', success: function (res) { let pushData = res.pushData let data = [] let form = layui.form $.each(res.pushData, function (index, item) { // console.log(index, item, '10.14') $('#otype').append(new Option(item.projectName));// 下拉菜单里添加元素 }); let boshData = []; for(let key in res.platformData) { boshData.push({name: res.platformData[key]}) } boshData.map((v,i)=>{ $('#oplatform').append(new Option(v.name)); }) layui.form.render("select"); form.render("select"); } }); }