12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <link rel="stylesheet" href="/static/editor.md/css/editormd.min.css" />
- <div class="layui-layout layui-layout-admin" style="padding-left: 40px;margin-top: 20px;">
- <form class="layui-form" action="" method="post">
- <div class="layui-form-item">
- <label class="layui-form-label">标题</label>
- <div class="layui-input-block " style="width: 400px">
- <input type="hidden" name="id" id="id" value="{{.info.Id}}" >
- <input type="text" name="title" id="title" lay-verify="required" autocomplete="off" placeholder="请输入标题" class="layui-input" value="{{.info.Title}}">
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label">内容</label>
- <div class="layui-input-inline" id="api-editormd" style="border: 1px solid #e4e4e4">
- <textarea name="content" id="content" style="display:none;">
- {{.info.Content}}
- </textarea>
- </div>
- </div>
- <div class="layui-form-item">
- <div class="layui-input-block">
- <button class="layui-btn" lay-submit="" lay-filter="sub">保存</button>
- <button type="reset" class="layui-btn layui-btn-primary">重置</button>
- </div>
- </div>
- </form>
- </div>
- <script>
- var apiEditor;
- layui.use(['form','element','table','layer','jquery'],function(){
- var form = layui.form; //只有执行了这一步,部分表单元素才会自动修饰成功
- var $ = layui.jquery;
- var table = layui.table;
- form.on('submit(sub)', function(data){
- var form_data = data.field;
- $.post('{{urlfor "PropertyNoticeController.Edit"}}', form_data, function (out) {
- if (out.status == 0) {
- layer.msg("操作成功",{icon: 1},function () {
- window.location.href="/propertynotice/index";
- })
- } else {
- layer.msg(out.message)
- }
- }, "json");
- return false;
- });
- form.render();
- });
- </script>
- {{template "public/editormd.html" .}}
|