12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- {extend name="common/base"/}
- {block name="style"}
- <style>
- .layui-layer-content {
-
- }
-
- .footer{
- display: none;
- }
- </style>
- {/block}
- {block name="body"}
- <form class="layui-form p-4">
- <h3 class="pb-3">新建文档</h3>
- <table class="layui-table layui-table-form">
- <tr>
- <td class="layui-td-gray">关联项目<font>*</font></td>
- <td>
- <input type="text" name="project_name" lay-verify="required" lay-reqText="" placeholder="请输入文档名称" class="layui-input" value="{$project.project_name}" readonly>
- <input type="hidden" name="project_id" lay-verify="required" lay-reqText="" placeholder="请输入文档名称" class="layui-input" value="{$project.id}" readonly>
- </td>
- </tr>
- <tr>
- <td class="layui-td-gray" style="vertical-align:top;">文档内容<font>*</font></td>
- <td colspan="5">
- <textarea name="content" placeholder="请输入内容" class="layui-textarea" id="container_content"
- style="border:0;padding:0">{$detail.content}</textarea>
- </td>
- </tr>
- </table>
- <div class="pt-3">
- <input type="hidden" name="id" value="{$detail.id}"/>
- <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
- <button type="reset" class="layui-btn layui-btn-primary">重置</button>
- </div>
- </form>
- {/block}
- <!-- /主体 -->
- <!-- 脚本 -->
- {block name="script"}
- <script>
- const moduleInit = ['tool', 'tagpicker', 'tinymce', 'oaTool'];
- function gouguInit() {
- var form = layui.form, tool = layui.tool, oaTool = layui.oaTool;
- //编辑器初始化
- var editor = layui.tinymce;
- var edit = editor.render({
- selector: "#container_content",
- height: 500
- });
- let a = 1;
- //监听提交
- form.on('submit(webform)', function (data) {
- data.field.content = tinyMCE.editors['container_content'].getContent();
- if (data.field.content == '') {
- layer.msg('请先完善文章内容');
- return false;
- }
- if(a){
- let callback = function (e) {
- parent.layui.recordTable.reload();
- layer.msg(e.msg);
- if (e.code == 0) {
- tool.tabRefresh(71);
- tool.sideClose(1000);
- a = 1
- }
- }
- tool.post("/admin/project.record/edit", data.field, callback);
- }
-
- a = 0
- return false;
- })
- }
- </script>
- {/block}
|