You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
106 lines
3.8 KiB
106 lines
3.8 KiB
{extend name="frame"} |
|
|
|
{block name="title"}彩蛋设置 |
|
修改{/block} |
|
{block name="meta"}{:token_meta()}{/block} |
|
|
|
{block name="body"} |
|
|
|
<div class="layui-container"> |
|
<div class="layui-row"> |
|
<form class="layui-form" action="" lay-filter="sd"> |
|
<input type="hidden" name="id" value=''/> |
|
|
|
<div class="layui-form-item"> |
|
<label class="layui-form-label">id</label> |
|
<div class="layui-input-block"> |
|
<input type="text" name="id" required placeholder="请输入" value='' autocomplete="off" class="layui-input"> |
|
</div> |
|
</div> |
|
|
|
<div class="layui-form-item"> |
|
<label class="layui-form-label">彩蛋设定数</label> |
|
<div class="layui-input-block"> |
|
<input type="text" name="number" required placeholder="请输入" value='' autocomplete="off" class="layui-input"> |
|
</div> |
|
</div> |
|
|
|
<div class="layui-form-item"> |
|
<label class="layui-form-label">触发次数</label> |
|
<div class="layui-input-block"> |
|
<input type="text" name="page" required placeholder="请输入" value='' autocomplete="off" class="layui-input"> |
|
</div> |
|
</div> |
|
|
|
<div class="layui-form-item"> |
|
<label class="layui-form-label">标题</label> |
|
<div class="layui-input-block"> |
|
<input type="text" name="title" required placeholder="请输入" value='' autocomplete="off" class="layui-input"> |
|
</div> |
|
</div> |
|
|
|
<div class="layui-form-item"> |
|
<label class="layui-form-label">用户</label> |
|
<div class="layui-input-block"> |
|
<select name="admin_id" lay-search> |
|
{foreach $admin as $value => $title} |
|
<option value="{$value}">{$title}</option> |
|
{/foreach} |
|
</select> |
|
</div> |
|
</div> |
|
|
|
<div class="layui-form-item"> |
|
<div class="layui-input-block"> |
|
<button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button> |
|
<button onclick="return formVal();" class="layui-btn layui-btn-primary">重置</button> |
|
</div> |
|
</div> |
|
</form> |
|
</div> |
|
</div> |
|
|
|
{/block} |
|
{block name="js"} |
|
|
|
|
|
|
|
<script> |
|
|
|
layui.use(['form', 'jquery'], function () { |
|
var form = layui.form, $ = layui.jquery; |
|
|
|
(window.formVal = function(){ |
|
form.val('sd', {:json_encode($data)}); |
|
})(); |
|
|
|
form.on('submit(formDemo)', function (data) { |
|
layer.confirm('确认此次操作?', {icon:3}, function (index) { |
|
let load = custom.loading(); |
|
$.ajax({ |
|
url: '{:url("editHandle")}' |
|
, type: 'post' |
|
, headers: { |
|
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') |
|
} |
|
, data: data.field |
|
, success: function (res) { |
|
layer.close(load); |
|
if (res.code === 200) { |
|
parent.layer.closeAll(); |
|
window.parent.layNotice.success('成功'); |
|
window.parent.table.reload('test'); |
|
} else { |
|
layNotice.warning(res.msg); |
|
} |
|
}, |
|
error: function (err) { |
|
layer.close(load); |
|
} |
|
}); |
|
}); |
|
return false; |
|
}) |
|
}); |
|
</script> |
|
{/block} |