From 6fb14149d62199cfcc0448c82eb2f51f9c5181de Mon Sep 17 00:00:00 2001 From: luliqiang <kidgrow> Date: Thu, 31 Dec 2020 16:55:30 +0800 Subject: [PATCH] Merge branch 'dev' of http://192.168.2.240:7070/r/kidgrow-microservices-platform into parter --- kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/doctorTemplete.html | 68 ++++++++++++++++++++------------- 1 files changed, 41 insertions(+), 27 deletions(-) diff --git a/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/doctorTemplete.html b/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/doctorTemplete.html index 0c53143..0604d12 100644 --- a/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/doctorTemplete.html +++ b/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/doctorTemplete.html @@ -8,8 +8,6 @@ </div> <div class="layui-card-body"> <div class="layui-form toolbar"> - <button id="docto-templete-btn-add" class="layui-btn icon-btn"><i class="layui-icon"></i>添加</button> - <button id="docto-templete-btn-update" class="layui-btn icon-btn"><i class="layui-icon refresh"></i> 更新</button> <select id="templeteType" placeholder="话术类型"> <option value="">-请选择-</option> <option value="0">结论</option> @@ -21,25 +19,26 @@ <option value="0">公开-</option> <option value="1">私有</option> </select> - <input name="templeteTitle" id="templeteTitle" placeholder="请输入标题名称" type="text" + <input name="templeteTitle" id="templeteTitle" placeholder="按标题" type="text" class="layui-input search-input" maxlength="20" /> <button id="app-btn-search" class="layui-btn icon-btn"><i class="layui-icon"></i>搜索</button> + <button id="docto-templete-btn-add" class="layui-btn icon-btn permissions" permissions="doctortemplete-edit"><i class="layui-icon"></i>添加</button> </div> <!-- 数据表格 --> - <table class="layui-table" id="app-table" lay-filter="app-table"></table> + <table class="layui-table permissions" permissions="doctortemplete-list" id="app-table" lay-filter="app-table"></table> </div> </div> <!-- 表格操作列 --> <script type="text/html" id="doctor-templete-table-bar"> - <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">修改</a> - <a class="layui-btn layui-btn-xs" lay-event="del">删除</a> + <a class="layui-btn layui-btn-primary layui-btn-xs permissions" permissions="doctortemplete-edit" lay-event="edit">修改</a> + <a class="layui-btn layui-btn-xs permissions" permissions="doctortemplete-del" lay-event="del">删除</a> </script> <!-- 表格状态列 --> <script type="text/html" id="doctor-templete-tpl-state"> <input type="checkbox" lay-filter="doctor-templete-tpl-state" value="{{d.id}}" lay-skin="switch" lay-text="正常|锁定" - {{d.enabled==true?'checked':''}}/> + {{d.enabled==true?'checked':''}} class="permissions" permissions="doctortemplete-enable"/> </script> <!-- 表单弹窗 --> @@ -69,8 +68,8 @@ <div class="layui-input-block"> <select id="publicType-add" name="publicType" placeholder="开放类型" lay-verify="required" required> <option value="">-请选择-</option> - <option value="1">公开</option> - <option value="0">私有</option> + <option value="0">公开</option> + <option value="1">私有</option> </select> </div> </div> @@ -82,7 +81,8 @@ </div> <div class="layui-form-item model-form-footer"> <button class="layui-btn layui-btn-primary" ew-event="closeDialog" type="button">取消</button> - <button class="layui-btn" id="sure" lay-filter="user-form-submit" lay-submit>保存</button> + <button class="layui-btn" id="sure" lay-filter="user-form-submit" permissions=" + doctortemplete-edit" lay-submit>保存</button> </div> </form> </script> @@ -114,15 +114,14 @@ headers: { 'Authorization': 'Bearer ' + config.getToken().access_token }, page: true, cols: [[ - { type: 'numbers' }, - { field: 'templeteTitle', width: 180, sort: true, title: '标题' }, + { field: 'templeteTitle',align:'center', width: 300, title: '标题' }, { - field: 'publicType', width: 200, sort: true, title: '开放类型', templet: function (d) { - return d.publicType ==true ? "公开" : "私有" + field: 'publicType',align:'center', width: 100, title: '开放类型', templet: function (d) { + return d.publicType ==true ? "私有" : "公开" } }, { - field: 'templeteType', width: 180, sort: true, title: '话术类型', templet: function (d) { + field: 'templeteType',align:'center', width: 100, title: '话术类型', templet: function (d) { if (d.templeteType == 0) { return "结论"; } else if (d.templeteType == 1) { @@ -132,11 +131,14 @@ } } }, - { field: 'createUserName', width: 300, sort: true, title: '创建者' }, - { field: 'createTime', width: 250, sort: true, title: '创建时间', templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy年MM月dd日 HH:mm:ss')}}</div>" }, - { field: 'enabled', width: 100, sort: true, templet: '#doctor-templete-tpl-state', title: '状态' }, - { field: 'recordTitle', width: 300, toolbar: '#doctor-templete-table-bar', sort: true, title: '操作' }, - ]] + { field: 'createUserName',align:'center', width: 180, title: '创建者' }, + { field: 'createTime',align:'center', width: 150, sort: true, title: '创建时间', templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy/MM/dd HH:mm')}}</div>" }, + { field: 'enabled',align:'center', width: 100, templet: '#doctor-templete-tpl-state', title: '状态' ,fixed: 'right' }, + { field: 'recordTitle',align:'center', width: 150, toolbar: '#doctor-templete-table-bar', title: '操作',fixed: 'right' }, + ]], + done:function(res){ + permissionsInput(res,config); + } }); // 工具条点击事件 @@ -145,6 +147,20 @@ var layEvent = obj.event; if (layEvent === 'edit') { // 查看详情 showEditModel(data, 2); + }else if(layEvent === 'del'){ + layer.confirm('确定删除此用户吗?', function (i) { + layer.close(i); + layer.load(2); + admin.req('api-opration/doctortemplete/' + obj.data.id, {}, function (data) { + layer.closeAll('loading'); + if (data.code == 0) { + layer.msg(data.msg, { icon: 1, time: 2000 }); + table.reload('app-table', {}); + } else { + layer.msg(data.msg, { icon: 2, time: 2000 }); + } + }, 'delete'); + }); } }); @@ -153,7 +169,7 @@ var templeteType = $('#templeteType').val(); var publicType = $('#publicType').val(); var templeteTitle = $('#templeteTitle').val(); - table.reload('app-table', { where: { templeteType: templeteType, publicType: publicType, templeteTitle: templeteTitle } }); + table.reload('app-table', { where: { templeteType: templeteType, publicType: publicType, templeteTitle: templeteTitle },page: {curr: 1 } }); }); // 修改user状态 @@ -165,10 +181,10 @@ }, function (data) { layer.closeAll('loading'); if (data.code == 0) { - layer.msg(data.msg, { icon: 1, time: 500 }); + layer.msg(data.msg, { icon: 1, time: 2000 }); table.reload('app-table', {}); } else { - layer.msg(data.msg, { icon: 2, time: 500 }); + layer.msg(data.msg, { icon: 2, time: 2000 }); $(obj.elem).prop('checked', !obj.elem.checked); form.render('checkbox'); } @@ -183,15 +199,14 @@ }else if (data.field.publicType==0){ data.field.publicType=false; } - console.log(data.field.publicType) admin.req('api-opration/doctortemplete', JSON.stringify(data.field), function (data) { layer.closeAll('loading'); if (data.code == 0) { - // layer.msg(data.msg, { icon: 1, time: 500 }); + // layer.msg(data.msg, { icon: 1, time: 2000 }); layer.closeAll(); table.reload('app-table', {}); } else { - layer.msg(data.msg, { icon: 2, time: 500 }); + layer.msg(data.msg, { icon: 2, time: 2000 }); } }, "POST"); return false; @@ -214,7 +229,6 @@ $('#app-form')[0].reset(); $('#app-form').attr('method', 'POST'); if (data) { - console.log(data.publicType == true ? 1 : 0); if(index==1){ $('#sure').hide(); } -- Gitblit v1.8.0