12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="keywords" content="">
- <meta name="description" content="">
- <title></title>
- <link rel="stylesheet" href="../../../component/pear/css/pear.css">
- </head>
- <body>
- <form class="layui-form" lay-filter="edit">
- <input type="hidden" name="id" value="">
- <div class="mainBox">
- <div class="main-container">
- <div class="layui-form-item">
- <label class="layui-form-label layui-required">角色名称:</label>
- <div class="layui-input-block">
- <input type="text" value="" name="name" lay-verify="required"
- autocomplete="off" placeholder="请输入角色名称" class="layui-input">
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label layui-required">角色标识:</label>
- <div class="layui-input-block">
- <input type="text" value="" name="code" lay-verify="required"
- autocomplete="off" placeholder="请输入角色标识" class="layui-input">
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label">角色排序:</label>
- <div class="layui-input-block">
- <input type="text" value="" name="sort"
- autocomplete="off" placeholder="请输入角色排序" class="layui-input">
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label">角色描述:</label>
- <div class="layui-input-block">
- <input type="text" value="" name="remark"
- autocomplete="off" placeholder="请输入角色介绍" class="layui-input">
- </div>
- </div>
- </div>
- </div>
- <div class="bottom">
- <div class="button-container">
- <button type="submit" class="pear-btn pear-btn-primary"
- lay-submit="" lay-filter="save">提 交</button>
- <button type="button" class="pear-btn"
- onclick="parent.layer.closeAll();">关 闭</button>
- </div>
- </div>
- </form>
- <script src="../../../component/layui/layui.js"></script>
- <script src="../../../component/pear/pear.js"></script>
- <script src="../../../component/js/xm-select.js"></script>
- <script>
- layui.use(['request', 'form', 'popup'], function () {
- var $ = layui.jquery,
- request = layui.request,
- form = layui.form;
- var MODULE_PATH = "/system/role/v1/";
- layer.ready(function() {
- var id = request.getQueryString("id");
- if (id) {
- request.httpGet('/system/role/v1/' + id, function (result) {
- form.val('edit', result.data);
- });
- }
- });
- form.on('submit(save)', function (data) {
- request.http({
- url: MODULE_PATH,
- type: data.field.id ? 'put' : 'post',
- data: data.field,
- success: function (res) {
- if (res.success) {
- parent.layui.popup.success(res.msg, function () {
- parent.layer.close(parent.layer.getFrameIndex(window.name));
- parent.refresh();
- })
- } else {
- parent.layui.popup.failure(res.msg);
- }
- }
- });
- return false;
- });
- })
- </script>
- </body>
- </html>
|