| | |
| | | <div class="layui-card-body"> |
| | | <div class="layui-form toolbar"> |
| | | <input id="app-edit-search" class="layui-input search-input" type="text" placeholder="按名称" />  |
| | | <button id="app-btn-search" class="layui-btn icon-btn"><i class="layui-icon"></i>搜索</button> |
| | | <button id="user-btn-add" class="layui-btn icon-btn"><i class="layui-icon"></i>添加</button> |
| | | <button id="app-btn-search" class="layui-btn icon-btn permissions" permissions="sysdictionaries-list"><i class="layui-icon"></i>搜索</button> |
| | | <button id="user-btn-add" class="layui-btn icon-btn permissions" permissions="sysdictionaries-edit"><i class="layui-icon"></i>添加</button> |
| | | </div> |
| | | |
| | | <!-- 数据表格 --> |
| | |
| | | |
| | | <!-- 表格操作列 --> |
| | | <script type="text/html" id="dictionaries-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="sysdictionaries-edit" lay-event="edit">修改</a> |
| | | <a class="layui-btn layui-btn-xs permissions" permissions="sysdictionaries-del" lay-event="del">删除</a> |
| | | </script> |
| | | <!-- 表格状态列 --> |
| | | <script type="text/html" id="dictionaries-tpl-state"> |
| | |
| | | |
| | | <!-- 表单弹窗 --> |
| | | <script type="text/html" id="app-model"> |
| | | <form id="app-form" lay-filter="app-form" class="layui-form model-form"> |
| | | <form id="app-form" lay-filter="app-form" class="layui-form model-form" autocomplete="off"> |
| | | <input name="id" type="hidden"/> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">字典类型</label> |
| | |
| | | headers: { 'Authorization': 'Bearer ' + config.getToken().access_token }, |
| | | page: true, |
| | | cols: [[ |
| | | { type: 'numbers' }, |
| | | { type: 'numbers', width: "10%",align: 'center',}, |
| | | { |
| | | field: 'dictionariesClassId', width: 180, sort: true, title: '字典类型', templet: function (d) { |
| | | field: 'dictionariesClassId', width: "10%",align: 'center', title: '字典类型', templet: function (d) { |
| | | return d.dictionariesClassId == undefined ? "分类" : "字典" |
| | | } |
| | | }, |
| | | { field: 'dictionariesClassName', width: 200, sort: true, title: '字典分类' }, |
| | | { field: 'dictionariesKey', width: 180, sort: true, title: '字典Key' }, |
| | | { field: 'dictionariesName', width: 264, sort: true, title: '字典值' }, |
| | | { field: 'id', width: 250, align: 'center', toolbar: '#dictionaries-tpl-state', sort: true, title: '状态' },// 0就诊数据 1筛查 |
| | | { field: 'createTime', width: 250, sort: true, title: '创建时间', templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy年MM月dd日 HH:mm:ss')}}</div>" }, |
| | | { field: 'id', width: 250, align: 'center', toolbar: '#dictionaries-table-bar', sort: true, title: '操作' },// 0就诊数据 1筛查 |
| | | ]] |
| | | { field: 'dictionariesClassName', width: "10%",align: 'center', title: '字典分类' }, |
| | | { field: 'dictionariesKey', width: "20%",align: 'center', title: '字典Key' }, |
| | | { field: 'dictionariesName', width: "10%",align: 'center', title: '字典值' }, |
| | | { field: 'id', width: "10%",align: 'center', toolbar: '#dictionaries-tpl-state', title: '状态' },// 0就诊数据 1筛查 |
| | | { field: 'createTime', width: "10%",align: 'center', title: '创建时间', templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy-MM-dd HH:mm')}}</div>" }, |
| | | { field: 'id', width: "10%",align: 'center', toolbar: '#dictionaries-table-bar', title: '操作' },// 0就诊数据 1筛查 |
| | | ]], |
| | | done:function(res){ |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | |
| | | // 修改菜单类型 |
| | | // 修改类型 |
| | | let changeType = function (type) { |
| | | |
| | | if (type == 1) { |
| | |
| | | } |
| | | }); |
| | | function ccc() { |
| | | console.log(11111111) |
| | | } |
| | | // 删除 |
| | | var doDelete = function (obj) { |
| | |
| | | admin.req('api-user/sysdictionaries/' + obj.id, {}, 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 }); |
| | | } |
| | | }, 'delete'); |
| | | }); |
| | |
| | | // 获取应用列表 |
| | | var getdata = function () { |
| | | var co = $('#role_clients'); |
| | | console.log(11111111111111); |
| | | console.log(co); |
| | | admin.req('api-user/sysdictionaries/findAll', JSON.stringify({ dictionariesClassIdIsNull: "str" }), function (data) { |
| | | layer.closeAll('loading'); |
| | | if (0 === data.code) { |
| | | console.log(123132132132132132) |
| | | let selected = false; |
| | | clientsAll = data; |
| | | $.each(data.data, function (index, item) { |
| | | //往下拉菜单里添加元素 |
| | | // console.log(JSON.stringify(item)) |
| | | $('#role_clients').append(new Option(item.dictionariesName, item.dictionariesKey, false, selected)); |
| | | }) |
| | | form.render(); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | } |
| | | }, 'Post'); |
| | | } |
| | |
| | | // 搜索按钮点击事件 |
| | | $('#app-btn-search').click(function () { |
| | | var key = $('#app-edit-search').val(); |
| | | table.reload('app-table', { where: { dictionariesName: key } }); |
| | | table.reload('app-table', { |
| | | where: { dictionariesName: key }, |
| | | page: { |
| | | curr: 1 |
| | | } }); |
| | | }); |
| | | // 修改role状态 |
| | | form.on('switch(dictionaries-tpl-state)', function (obj) { |
| | |
| | | }, 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'); |
| | | } |
| | |
| | | admin.req('api-user/sysdictionaries', 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; |