Commit c7d28c24 authored by 黄奎's avatar 黄奎

新增排序

parent 0f517a30
......@@ -16,6 +16,7 @@
@click="msg.pageIndex=1,getList()"> </span>
</div>
<br>
<el-button @click="saveSort()" size="small" type="primary">保存排序</el-button>
<div v-loading="loading" flex="dir:left box:mean" class="cat-list" style="margin-top:20px;">
<el-card class="card-item-box" shadow="never">
<div slot="header" class="clearfix">
......@@ -159,7 +160,8 @@
<el-input type="text" size="small" v-model="addMsg.Name"></el-input>
</el-form-item>
<el-form-item label="排序">
<el-input type="text" size="small" v-model="addMsg.SortNum" @keyup.native="checkInteger(addMsg,'SortNum')"></el-input>
<el-input type="text" size="small" v-model="addMsg.SortNum"
@keyup.native="checkInteger(addMsg,'SortNum')"></el-input>
</el-form-item>
</el-form>
</div>
......@@ -309,8 +311,8 @@
this.addMsg.Name = tempObj.Name;
this.addMsg.Level = tempObj.Level;
this.addMsg.ParentId = tempObj.ParentId;
this.addMsg.FirstLevelName=tempObj.FirstLevelName;
this.addMsg.SecondLevelName=tempObj.SecondLevelName;
this.addMsg.FirstLevelName = tempObj.FirstLevelName;
this.addMsg.SecondLevelName = tempObj.SecondLevelName;
this.IsShowCategory = false;
}
} else {
......@@ -402,7 +404,30 @@
this.active2 = index;
this.addMsg.ParentId = item.Id;
},
//批量修改排序
saveSort() {
this.sortList = [];
this.dataFirst.forEach((item, index) => {
item.children.forEach((item2, index2) => {
let obj = {
Id: item2.Id,
SortNum: index2+1,
}
this.sortList.push(obj)
})
let obj = {
Id: item.Id,
SortNum: index+1,
}
this.sortList.push(obj)
})
this.apipost("/api/Share/SetShareCategorySortList", this.sortList, res => {
if (res.data.resultCode == 1) {
this.Success(res.data.message)
this.getList();
}
})
},
},
mounted() {
this.getList();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment