mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2026-02-05 00:49:49 +08:00
【优化】优化新版treeTable下商品分类及菜单导航树形表格模式的排序问题。
【发布】发布0.7.0版本
This commit is contained in:
@@ -13004,6 +13004,11 @@
|
|||||||
是否最后节点,无下级节点
|
是否最后节点,无下级节点
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.ViewModels.UI.dtreeChild.isParent">
|
||||||
|
<summary>
|
||||||
|
是否属于父节点
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="P:CoreCms.Net.Model.ViewModels.UI.dtreeChild.checkArr">
|
<member name="P:CoreCms.Net.Model.ViewModels.UI.dtreeChild.checkArr">
|
||||||
<summary>
|
<summary>
|
||||||
是否选中 0否1是
|
是否选中 0否1是
|
||||||
@@ -13014,6 +13019,11 @@
|
|||||||
子
|
子
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:CoreCms.Net.Model.ViewModels.UI.dtreeChild.otherData">
|
||||||
|
<summary>
|
||||||
|
其他数据
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:CoreCms.Net.Model.ViewModels.UI.DTreeList">
|
<member name="T:CoreCms.Net.Model.ViewModels.UI.DTreeList">
|
||||||
<summary>
|
<summary>
|
||||||
Dtree List集合数据格式
|
Dtree List集合数据格式
|
||||||
|
|||||||
@@ -47,6 +47,11 @@ namespace CoreCms.Net.Model.ViewModels.UI
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool last { get; set; }
|
public bool last { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否属于父节点
|
||||||
|
/// </summary>
|
||||||
|
public bool isParent { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否选中 0否1是
|
/// 是否选中 0否1是
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -56,6 +61,13 @@ namespace CoreCms.Net.Model.ViewModels.UI
|
|||||||
/// 子
|
/// 子
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public object children { get; set; }
|
public object children { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 其他数据
|
||||||
|
/// </summary>
|
||||||
|
public object otherData { get; set; }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
},
|
},
|
||||||
onLaunch() {
|
onLaunch() {
|
||||||
//版本设置
|
//版本设置
|
||||||
const version = '0.6.9'
|
const version = '0.7.0'
|
||||||
// 开发环境才提示,生产环境不会提示
|
// 开发环境才提示,生产环境不会提示
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
console.log(`\n %c \u6838\u5fc3\u5546\u57ce\u7cfb\u7edf\u0020\u0043\u006f\u0072\u0065\u0053\u0068\u006f\u0070 V${version} %c \u0068\u0074\u0074\u0070\u0073\u003a\u002f\u002f\u0077\u0077\u0077\u002e\u0063\u006f\u0072\u0065\u0073\u0068\u006f\u0070\u002e\u0063\u006e\u002f \n\n`, 'color: #ffffff; background: #3c9cff; padding:5px 0;', 'color: #3c9cff;background: #f1f1f1; padding:5px 0;');
|
console.log(`\n %c \u6838\u5fc3\u5546\u57ce\u7cfb\u7edf\u0020\u0043\u006f\u0072\u0065\u0053\u0068\u006f\u0070 V${version} %c \u0068\u0074\u0074\u0070\u0073\u003a\u002f\u002f\u0077\u0077\u0077\u002e\u0063\u006f\u0072\u0065\u0073\u0068\u006f\u0070\u002e\u0063\u006e\u002f \n\n`, 'color: #ffffff; background: #3c9cff; padding:5px 0;', 'color: #3c9cff;background: #f1f1f1; padding:5px 0;');
|
||||||
|
|||||||
@@ -71,6 +71,8 @@ namespace CoreCms.Net.Utility.Helper
|
|||||||
parentTree.title = item.name;
|
parentTree.title = item.name;
|
||||||
parentTree.parentId = item.parentId.ToString();
|
parentTree.parentId = item.parentId.ToString();
|
||||||
parentTree.last = !oldNavs.Exists(p => p.parentId == item.id);
|
parentTree.last = !oldNavs.Exists(p => p.parentId == item.id);
|
||||||
|
parentTree.isParent = !parentTree.last;
|
||||||
|
parentTree.otherData = item;
|
||||||
|
|
||||||
childTree.Add(parentTree);
|
childTree.Add(parentTree);
|
||||||
parentTree.children = GetMenus(oldNavs, item.id);
|
parentTree.children = GetMenus(oldNavs, item.id);
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ namespace CoreCms.Net.Web.Admin.Controllers
|
|||||||
//获取数据
|
//获取数据
|
||||||
var list = await _coreCmsGoodsCategoryServices.QueryListByClauseAsync(p => p.id > 0, p => p.sort, OrderByType.Asc, true, true);
|
var list = await _coreCmsGoodsCategoryServices.QueryListByClauseAsync(p => p.id > 0, p => p.sort, OrderByType.Asc, true, true);
|
||||||
//返回数据
|
//返回数据
|
||||||
jm.data = list;
|
jm.data = GoodsHelper.GetTree(list,false).data;
|
||||||
jm.code = 0;
|
jm.code = 0;
|
||||||
jm.msg = "数据调用成功!";
|
jm.msg = "数据调用成功!";
|
||||||
return jm;
|
return jm;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
"AppPcUrl": "https://pc.test.pro.coreshop.cn/", //PC端访问地址
|
"AppPcUrl": "https://pc.test.pro.coreshop.cn/", //PC端访问地址
|
||||||
"AppH5Url": "https://h5.test.pro.coreshop.cn/", //H5端访问地址
|
"AppH5Url": "https://h5.test.pro.coreshop.cn/", //H5端访问地址
|
||||||
"AppInterFaceUrl": "https://api.test.pro.coreshop.cn/", //接口请求地址
|
"AppInterFaceUrl": "https://api.test.pro.coreshop.cn/", //接口请求地址
|
||||||
"AppVersion": "CoreShopProfessional v0.6.9"
|
"AppVersion": "CoreShopProfessional v0.7.0"
|
||||||
},
|
},
|
||||||
//redis为必须启动项,请保持redis为正常可用
|
//redis为必须启动项,请保持redis为正常可用
|
||||||
"RedisConfig": {
|
"RedisConfig": {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ layui.define(['all'], function (exports) {
|
|||||||
pageTabs: false, // 是否开启页面选项卡功能。单页版不推荐开启
|
pageTabs: false, // 是否开启页面选项卡功能。单页版不推荐开启
|
||||||
|
|
||||||
name: '核心商城系统',
|
name: '核心商城系统',
|
||||||
version: 'CoreShopProfessional v0.6.9',
|
version: 'CoreShopProfessional v0.7.0',
|
||||||
name: 'layuiAdmin',
|
name: 'layuiAdmin',
|
||||||
tableName: 'CoreShop', // 本地存储表名
|
tableName: 'CoreShop', // 本地存储表名
|
||||||
MOD_NAME: 'admin', // 模块事件名
|
MOD_NAME: 'admin', // 模块事件名
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
||||||
<input type="number" min="0" max="999999" name="sort" id="sort" lay-verType="tips" lay-verify="required|number" class="layui-input" value="1" placeholder="请输入分类排序" lay-reqText="请输入分类排序并为数字" />
|
<input type="number" min="0" max="999999" name="sort" id="sort" lay-verType="tips" lay-verify="required|number" class="layui-input" value="1" placeholder="请输入分类排序" lay-reqText="请输入分类排序并为数字" />
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-mid layui-word-aux">请输入数字</div>
|
<div class="layui-form-mid layui-word-aux">请输入数字,排序从小到大</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
||||||
<input type="number" min="0" max="999999" name="sort" id="sort" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.model.sort || '' }}" placeholder="请输入分类排序" lay-reqText="请输入分类排序并为数字" />
|
<input type="number" min="0" max="999999" name="sort" id="sort" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.model.sort || '' }}" placeholder="请输入分类排序" lay-reqText="请输入分类排序并为数字" />
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-mid layui-word-aux">请输入数字</div>
|
<div class="layui-form-mid layui-word-aux">请输入数字,排序从小到大</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
|
|||||||
@@ -68,15 +68,14 @@
|
|||||||
customName: {
|
customName: {
|
||||||
id: 'id',
|
id: 'id',
|
||||||
pid: 'parentId',
|
pid: 'parentId',
|
||||||
name: 'name',
|
name: 'title',
|
||||||
// isParent:'isParent'
|
|
||||||
},
|
},
|
||||||
view: {
|
view: {
|
||||||
showIcon: false,
|
showIcon: false,
|
||||||
indent: 25
|
indent: 25
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
isSimpleData: true,
|
//isSimpleData: true,
|
||||||
},
|
},
|
||||||
callback: {}
|
callback: {}
|
||||||
},
|
},
|
||||||
@@ -85,17 +84,17 @@
|
|||||||
cols: [
|
cols: [
|
||||||
[
|
[
|
||||||
{ field: 'id', title: '序列', width: 60, sort: false },
|
{ field: 'id', title: '序列', width: 60, sort: false },
|
||||||
{ field: 'name', title: '名称', sort: false },
|
{ field: 'title', title: '名称', sort: false },
|
||||||
{
|
{
|
||||||
field: 'sort', title: '排序', sort: false, width: 105, templet: function (d) {
|
field: 'sort', title: '排序', sort: false, width: 105, templet: function (d) {
|
||||||
return d.sort;
|
return d.otherData.sort
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'imageUrl', title: '图片', width: 80, sort: false,
|
field: 'imageUrl', title: '图片', width: 80, sort: false,
|
||||||
templet: function (d) {
|
templet: function (d) {
|
||||||
if (d.imageUrl) {
|
if (d.otherData.imageUrl) {
|
||||||
return '<a href="javascript:void(0);" onclick=layui.coreHelper.viewImage("' + d.imageUrl + '")><image style="max-width:28px;max-height:28px;" src="' + d.imageUrl + '" /></a>';
|
return '<a href="javascript:void(0);" onclick=layui.coreHelper.viewImage("' + d.otherData.imageUrl + '")><image style="max-width:28px;max-height:28px;" src="' + d.otherData.imageUrl + '" /></a>';
|
||||||
} else {
|
} else {
|
||||||
return '<a href="javascript:void(0);" onclick=layui.coreHelper.viewImage("' + setter.noImagePicUrl + '")><image style="max-width:30px;max-height:30px;" src="' + setter.noImagePicUrl + '" /></a>';
|
return '<a href="javascript:void(0);" onclick=layui.coreHelper.viewImage("' + setter.noImagePicUrl + '")><image style="max-width:30px;max-height:30px;" src="' + setter.noImagePicUrl + '" /></a>';
|
||||||
}
|
}
|
||||||
@@ -106,10 +105,7 @@
|
|||||||
]
|
]
|
||||||
],
|
],
|
||||||
done: function (res, curr, count) {
|
done: function (res, curr, count) {
|
||||||
treeTable.expandAll('treeTableBox', true); // 打开全部节点
|
treeTable.expandAll('treeTableBox', true);
|
||||||
//console.log(res); // 得到当前渲染的数据
|
|
||||||
//console.log(curr); // 得到当前页码
|
|
||||||
//console.log(count); // 得到数据总量
|
|
||||||
},
|
},
|
||||||
page: false
|
page: false
|
||||||
});
|
});
|
||||||
@@ -243,5 +239,5 @@
|
|||||||
|
|
||||||
<!--设置是否显示-->
|
<!--设置是否显示-->
|
||||||
<script type="text/html" id="switch_isShow">
|
<script type="text/html" id="switch_isShow">
|
||||||
<input type="checkbox" name="switch_isShow" value="{{d.id}}" lay-skin="switch" lay-text="显示|关闭" lay-filter="switch_isShow" {{ d.isShow ? 'checked' : '' }}>
|
<input type="checkbox" name="switch_isShow" value="{{d.id}}" lay-skin="switch" lay-text="显示|关闭" lay-filter="switch_isShow" {{ d.otherData.isShow ? 'checked' : '' }}>
|
||||||
</script>
|
</script>
|
||||||
@@ -84,7 +84,6 @@
|
|||||||
id: 'id',
|
id: 'id',
|
||||||
pid: 'parentId',
|
pid: 'parentId',
|
||||||
name: 'menuName',
|
name: 'menuName',
|
||||||
//isParent: 'isParent'
|
|
||||||
},
|
},
|
||||||
view: {
|
view: {
|
||||||
showIcon: false,
|
showIcon: false,
|
||||||
@@ -125,8 +124,12 @@
|
|||||||
//{field: 'createTime', title: '创建时间'},
|
//{field: 'createTime', title: '创建时间'},
|
||||||
{title: '操作', toolbar: '#LAY-app-SysMenu-tableBox-bar', align: 'center', width: 180}
|
{title: '操作', toolbar: '#LAY-app-SysMenu-tableBox-bar', align: 'center', width: 180}
|
||||||
]],
|
]],
|
||||||
page: false
|
initSort: {
|
||||||
|
field: 'sortNumber',
|
||||||
|
type: 'asc'
|
||||||
|
},
|
||||||
|
//autoSort: false,
|
||||||
|
page: false
|
||||||
});
|
});
|
||||||
//重载form
|
//重载form
|
||||||
form.render();
|
form.render();
|
||||||
|
|||||||
@@ -272,7 +272,7 @@
|
|||||||
优惠券接口
|
优惠券接口
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:CoreCms.Net.Web.WebApi.Controllers.CouponController.#ctor(CoreCms.Net.Auth.HttpContextUser.IHttpContextUser,CoreCms.Net.IServices.ICoreCmsCouponServices,CoreCms.Net.IServices.ICoreCmsPromotionServices,CoreCms.Net.Caching.AutoMate.RedisCache.IRedisOperationRepository)">
|
<member name="M:CoreCms.Net.Web.WebApi.Controllers.CouponController.#ctor(CoreCms.Net.Auth.HttpContextUser.IHttpContextUser,CoreCms.Net.IServices.ICoreCmsCouponServices,CoreCms.Net.IServices.ICoreCmsPromotionServices,CoreCms.Net.Caching.AutoMate.RedisCache.IRedisOperationRepository,CoreCms.Net.IRepository.UnitOfWork.IUnitOfWork)">
|
||||||
<summary>
|
<summary>
|
||||||
构造函数
|
构造函数
|
||||||
</summary>
|
</summary>
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
"AppPcUrl": "https://pc.test.pro.coreshop.cn/", //PC端访问地址
|
"AppPcUrl": "https://pc.test.pro.coreshop.cn/", //PC端访问地址
|
||||||
"AppH5Url": "https://h5.test.pro.coreshop.cn/", //H5端访问地址
|
"AppH5Url": "https://h5.test.pro.coreshop.cn/", //H5端访问地址
|
||||||
"AppInterFaceUrl": "https://api.test.pro.coreshop.cn/", //接口请求地址
|
"AppInterFaceUrl": "https://api.test.pro.coreshop.cn/", //接口请求地址
|
||||||
"AppVersion": "CoreShopProfessional v0.6.9"
|
"AppVersion": "CoreShopProfessional v0.7.0"
|
||||||
},
|
},
|
||||||
//redis为必须启动项,请保持redis为正常可用
|
//redis为必须启动项,请保持redis为正常可用
|
||||||
"RedisConfig": {
|
"RedisConfig": {
|
||||||
|
|||||||
Reference in New Issue
Block a user