|
@@ -34,7 +34,7 @@
|
|
|
</el-header>
|
|
|
<el-main>
|
|
|
<div style="height: 100%;">
|
|
|
- <component :is="componentType" :tableData="tableData" :queryParams="queryParams" @options="handleOption"></component>
|
|
|
+ <component :is="componentType" :tableData="tableData" :queryParams="queryParams" @options="handleOption" @on-sort="handleSort"></component>
|
|
|
</div>
|
|
|
</el-main>
|
|
|
<el-footer class="pagination">
|
|
@@ -66,6 +66,8 @@ export default {
|
|
|
return {
|
|
|
// 显示指定的子组件
|
|
|
componentType: 'categoryTable',
|
|
|
+ //显示的栏位
|
|
|
+ columnList:[],
|
|
|
//检索字段
|
|
|
searchFiled: [
|
|
|
{
|
|
@@ -106,6 +108,8 @@ export default {
|
|
|
current: 1,
|
|
|
size:10,
|
|
|
},
|
|
|
+ //排序
|
|
|
+ sort:[],
|
|
|
// 产品类别总数
|
|
|
total: 0,
|
|
|
// 产品类别数据
|
|
@@ -122,7 +126,7 @@ export default {
|
|
|
//获取检索字段以及分组字段
|
|
|
this.getColumn()
|
|
|
//获取检索字段以及分组字段
|
|
|
- this.getFieldList()
|
|
|
+ // this.getFieldList()
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
@@ -244,15 +248,39 @@ export default {
|
|
|
let params = {
|
|
|
...this.queryParams,//分页信息
|
|
|
searchQuery:str,//检索条件
|
|
|
- orderDTOList: null,//排序
|
|
|
+ orderDTOList: this.sort,//排序
|
|
|
}
|
|
|
this.$api.queryProductCategory(params).then(response=>{
|
|
|
if(response.code == 200){
|
|
|
-
|
|
|
this.tableData = response.data.data
|
|
|
+ this.total = response.data.total
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ //排序
|
|
|
+ handleSort({ column, prop, order, str }) {
|
|
|
+ this.sort=[]//如需要多个字段排序,则不需要清空
|
|
|
+ if (order == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var orderType = {
|
|
|
+ ascending: 0,
|
|
|
+ descending:1
|
|
|
+ }
|
|
|
+ var params = this.sort.find(item => {
|
|
|
+ return item.orderBy == prop
|
|
|
+ })
|
|
|
+ if (params) {
|
|
|
+ params.orderType = orderType[order]
|
|
|
+ } else {
|
|
|
+ params = {}
|
|
|
+ params.orderBy = prop
|
|
|
+ params.orderType = orderType[order]
|
|
|
+ this.sort.push(params)
|
|
|
+ }
|
|
|
+ this.queryParams.current = 1
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
// 分页
|
|
|
handleCurrentChange(val){
|
|
|
this.queryParams.current = val
|
|
@@ -262,7 +290,22 @@ export default {
|
|
|
changeGrouping(val) { },
|
|
|
//获取检索条件检索
|
|
|
search(val) {
|
|
|
-
|
|
|
+ let params = {}
|
|
|
+ if(val.length>0){
|
|
|
+ val.forEach(item => {
|
|
|
+ if (item.type == 3) {
|
|
|
+ params[item.value]=item.searchValue.map(itemValue => {
|
|
|
+ return itemValue.value
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ params[item.value]=item.searchValue.label
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ this.searchOption = params
|
|
|
+ this.queryParams.current = 1
|
|
|
+ this.getList()
|
|
|
},
|
|
|
},
|
|
|
}
|