|
@@ -30,24 +30,30 @@
|
|
<body>
|
|
<body>
|
|
<div class="layuimini-container">
|
|
<div class="layuimini-container">
|
|
<div class="layuimini-main">
|
|
<div class="layuimini-main">
|
|
- <a href="{:url('add')}"><button type="button" class="layui-btn add">添 加</button></a>
|
|
|
|
|
|
+ <a href="{:url('add')}">
|
|
|
|
+ <button type="button" class="layui-btn add">添 加</button>
|
|
|
|
+ </a>
|
|
|
|
|
|
<div class="layui-form" style="margin-top: 20px;">
|
|
<div class="layui-form" style="margin-top: 20px;">
|
|
<table class="layui-table">
|
|
<table class="layui-table">
|
|
<colgroup>
|
|
<colgroup>
|
|
- <col width="90">
|
|
|
|
- <col width="110">
|
|
|
|
- <col width="800">
|
|
|
|
|
|
+ <col width="40">
|
|
|
|
+ <col width="60">
|
|
|
|
+ <col width="100">
|
|
<col width="130">
|
|
<col width="130">
|
|
|
|
+ <col width="130">
|
|
|
|
+ <col width="70">
|
|
<col width="70">
|
|
<col width="70">
|
|
- <col width="85">
|
|
|
|
|
|
+ <col width="185">
|
|
</colgroup>
|
|
</colgroup>
|
|
<thead>
|
|
<thead>
|
|
<tr>
|
|
<tr>
|
|
<th>id</th>
|
|
<th>id</th>
|
|
- <th>一级分类</th>
|
|
|
|
- <th class="text-center">二 / 三级分类</th>
|
|
|
|
|
|
+ <th>标题</th>
|
|
|
|
+ <th>排序</th>
|
|
<th class="text-center">创建时间</th>
|
|
<th class="text-center">创建时间</th>
|
|
|
|
+ <th class="text-center">操作时间</th>
|
|
|
|
+ <th class="text-center">操作人</th>
|
|
<th class="text-center">状 态</th>
|
|
<th class="text-center">状 态</th>
|
|
<th>操作管理</th>
|
|
<th>操作管理</th>
|
|
</tr>
|
|
</tr>
|
|
@@ -56,56 +62,30 @@
|
|
<!--一级类目循环-->
|
|
<!--一级类目循环-->
|
|
<tr>
|
|
<tr>
|
|
<td>
|
|
<td>
|
|
- <div class="layui-input-inline">
|
|
|
|
- <input type="text" value="1" data-id="1" class="changeSort layui-input">
|
|
|
|
- </div>
|
|
|
|
|
|
+ 1
|
|
|
|
+ </td>
|
|
|
|
+ <td>
|
|
|
|
+ abcd
|
|
</td>
|
|
</td>
|
|
<td>
|
|
<td>
|
|
<div class="layui-input-inline">
|
|
<div class="layui-input-inline">
|
|
- <input type="text" name="p0" autocomplete="off" class="layui-input" value="一级类目"
|
|
|
|
- onchange="editCls(this,id=1,ptype=1)">
|
|
|
|
|
|
+ <input type="text" value="1" data-id="1" class="changeSort layui-input">
|
|
</div>
|
|
</div>
|
|
</td>
|
|
</td>
|
|
<td>
|
|
<td>
|
|
- <!--二级类目循环 start-->
|
|
|
|
- <div class="layui-input-block" style="margin-left: 0;">
|
|
|
|
- <button data-ptype="2" type="button"
|
|
|
|
- class="layui-btn layui-btn-primary layui-btn-sm del-child"
|
|
|
|
- style="border: none;"><i class="layui-icon"></i></button>
|
|
|
|
- <div class="layui-input-inline">
|
|
|
|
- <input type="text" name="p1" style="background: #ffb800;" autocomplete="off"
|
|
|
|
- class="inoutCls" onchange="editCls(this,id=1,ptype=2)" value="二级类目">
|
|
|
|
- </div>
|
|
|
|
-
|
|
|
|
- <!-- 三级类目循环 start-->
|
|
|
|
- <div class="layui-input-inline">
|
|
|
|
- --<input type="text" name="p1" autocomplete="off" class="inoutCls"
|
|
|
|
- onchange="editCls(this,id=1,ptype=3)" value="1。1">
|
|
|
|
- </div>
|
|
|
|
- <div class="layui-input-inline">
|
|
|
|
- --<input type="text" name="p1" autocomplete="off" class="inoutCls"
|
|
|
|
- onchange="editCls(this,id=1,ptype=3)" value="1。2">
|
|
|
|
- </div>
|
|
|
|
- <div class="layui-input-inline">
|
|
|
|
- --<input type="text" name="p1" autocomplete="off" class="inoutCls"
|
|
|
|
- onchange="editCls(this,id=1,ptype=3)" value="1。3">
|
|
|
|
- </div>
|
|
|
|
- <!-- 三级类目循环 end-->
|
|
|
|
- </div>
|
|
|
|
-
|
|
|
|
- <!--二级类目循环 end-->
|
|
|
|
|
|
+ 创建时间
|
|
</td>
|
|
</td>
|
|
- <td>2019-11-20 10:40</td>
|
|
|
|
-
|
|
|
|
- <td data-id="1"><input type="checkbox" checked="" name="status" lay-skin="switch"
|
|
|
|
- lay-filter="switchTest"
|
|
|
|
- lay-text="ON|OFF">
|
|
|
|
|
|
+ <td>
|
|
|
|
+ 更新时间
|
|
|
|
+ </td>
|
|
|
|
+ <td>
|
|
|
|
+ singwa
|
|
|
|
+ </td>
|
|
|
|
+ <td data-id="1"><input type="checkbox" checked="" name="status" lay-skin="switch" lay-filter="switchTest" lay-text="ON|OFF">
|
|
</td>
|
|
</td>
|
|
-
|
|
|
|
-
|
|
|
|
<td>
|
|
<td>
|
|
- <a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete del-child" data-ptype="1"
|
|
|
|
- lay-event="delete" data-id="$id">删除</a>
|
|
|
|
|
|
+ <a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete del-child" data-ptype="1" lay-event="delete" data-id="$id">删除</a>
|
|
|
|
+ <a href="{:url('index', ['pid'=>1])}">获取子栏目</a>
|
|
</td>
|
|
</td>
|
|
</tr>
|
|
</tr>
|
|
<!--一级类目循环 end-->
|
|
<!--一级类目循环 end-->
|
|
@@ -161,8 +141,8 @@
|
|
if (!name && type == 3) { // 演示 应该放到修改回调中 进行处理
|
|
if (!name && type == 3) { // 演示 应该放到修改回调中 进行处理
|
|
return $(that).parent().remove()
|
|
return $(that).parent().remove()
|
|
}
|
|
}
|
|
- let url = '{:url("admin/edit")}?id=' + id + '&name=' + name
|
|
|
|
- layObj.get(url, (res) =>{
|
|
|
|
|
|
+ let url = '{:url("admin/edit")}?id=' + id + '&name=' + name
|
|
|
|
+ layObj.get(url, (res) => {
|
|
if (name && res) {
|
|
if (name && res) {
|
|
$(that).val(name)
|
|
$(that).val(name)
|
|
}
|
|
}
|
|
@@ -188,24 +168,24 @@
|
|
msg = '二';
|
|
msg = '二';
|
|
}
|
|
}
|
|
layObj.box(`是否删除${msg}级分类`, () => {
|
|
layObj.box(`是否删除${msg}级分类`, () => {
|
|
- let url = '{:url("admin/del")}?id=' + id
|
|
|
|
- layObj.get(url, (res) =>{
|
|
|
|
|
|
+ let url = '{:url("admin/del")}?id=' + id
|
|
|
|
+ layObj.get(url, (res) => {
|
|
$(this).parent().remove()
|
|
$(this).parent().remove()
|
|
})
|
|
})
|
|
|
|
|
|
})
|
|
})
|
|
})
|
|
})
|
|
|
|
|
|
- $('.changeSort').on('change',function () {
|
|
|
|
|
|
+ $('.changeSort').on('change', function () {
|
|
let id = $(this).attr('data-id');
|
|
let id = $(this).attr('data-id');
|
|
let val = $(this).val();
|
|
let val = $(this).val();
|
|
|
|
|
|
- if(!val){
|
|
|
|
|
|
+ if (!val) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- let url = '{:url("admin/sort")}?id=' + id + '&sort='+val;
|
|
|
|
|
|
+ let url = '{:url("admin/sort")}?id=' + id + '&sort=' + val;
|
|
// let url = 'http:www.baidu.com';
|
|
// let url = 'http:www.baidu.com';
|
|
- layObj.get(url,function (res) {
|
|
|
|
|
|
+ layObj.get(url, function (res) {
|
|
console.log(res, 'sort');
|
|
console.log(res, 'sort');
|
|
})
|
|
})
|
|
|
|
|