| | |
| | | |
| | | <!-- 表单弹窗 --> |
| | | <script type="text/html" id="editDialog"> |
| | | <form id="detail" class="layui-form"> |
| | | <form id="detail" lay-filter="detail" class="layui-form"> |
| | | <input name="id" type="hidden"> |
| | | <input name="uuid" type="hidden"> |
| | | <input name="path" type="hidden"> |
| | |
| | | return; |
| | | } |
| | | var ids = checkRows.map(function (d) { |
| | | return d.authorityId; |
| | | return d.id; |
| | | }); |
| | | doDel({ids: ids}); |
| | | } |
| | |
| | | content: $('#editDialog').html(), |
| | | success: function (layero, dIndex) { |
| | | // 回显表单数据 |
| | | console.log(mData) |
| | | form.val('detail', mData); |
| | | // 表单提交事件 |
| | | form.on('submit(editSubmit)', function (data) { |
| | |
| | | }, function (i) { |
| | | layer.close(i); |
| | | var loadIndex = layer.load(2); |
| | | $.get('../../json/ok.json', {id: obj.data ? obj.data.authorityId : obj.ids}, function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200) { |
| | | layer.msg(res.msg, {icon: 1}); |
| | | insTb.refresh(); |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | var ids; |
| | | if (obj.data) { |
| | | ids = []; |
| | | ids[0] = obj.data.id; |
| | | } else { |
| | | ids = obj.ids; |
| | | } |
| | | $.ajax({ |
| | | url: baseUrl+"/tag/delete/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {ids: ids}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.msg(res.msg, {icon: 1}); |
| | | insTb.refresh(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }, 'json'); |
| | | }) |
| | | }); |
| | | } |
| | | |