<script type="text/html" template lay-done="layui.data.sendParams(d);">
    <div class="layui-form coreshop-form layui-form-pane" lay-filter="LAY-app-CoreCmsArticleType-editForm" id="LAY-app-CoreCmsArticleType-editForm">
        <input type="hidden" name="id" id="id" value="{{d.params.data.model.id || '' }}" />
        <input type="hidden" name="parentId" id="parentId" value="0" />
        <div class="layui-form-item">
            <label for="name" class="layui-form-label">分类名称</label>
            <div class="layui-input-block">
                <input name="name" id="name" lay-verType="tips" lay-verify="required|verifyname" class="layui-input" placeholder="请输入分类名称" lay-reqText="请输入分类名称" value="{{d.params.data.model.name || '' }}" />
            </div>
        </div>
        <div class="layui-form-item">
            <label for="sort" class="layui-form-label">排序 </label>
            <div class="layui-input-block">
                <input type="number" min="0" max="999999" name="sort" id="sort" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.model.sort }}" placeholder="请输入排序 " lay-reqText="请输入排序 并为数字" />
            </div>
        </div>
        <div class="layui-form-item text-right">
            <input type="button" class="layui-btn" lay-submit lay-filter="LAY-app-CoreCmsArticleType-editForm-submit" id="LAY-app-CoreCmsArticleType-editForm-submit" value="确认编辑">
        </div>
    </div>
</script>
<script>
    var debug = layui.setter.debug;
    layui.data.sendParams = function (d) {
        //开启调试情况下获取接口赋值数据
        if (debug) { console.log(d.params.data); }
        layui.use(['admin', 'form', 'laydate', 'upload', 'coreHelper', 'cropperImg', 'dtree'],
            function () {
                var $ = layui.$
                    , form = layui.form
                    , admin = layui.admin
                    , laydate = layui.laydate
                    , upload = layui.upload
                    , cropperImg = layui.cropperImg
                    , dtree = layui.dtree
                    , coreHelper = layui.coreHelper;

                form.verify({

                    verifyname: [/^[\S]{0,32}$/, '分类名称最大只允许输入32位字符，且不能出现空格'],
                });
                //重载form
                form.render(null, 'LAY-app-CoreCmsArticleType-editForm');
            })
    };
</script>