首页品牌添加排序设置
This commit is contained in:
parent
8fb60f6aa3
commit
bde51f8a9f
@ -30,3 +30,11 @@ export function createHomeBrand(data) {
|
|||||||
data:data
|
data:data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function updateHomeBrandSort(params) {
|
||||||
|
return request({
|
||||||
|
url:'/home/brand/update/sort/'+params.id,
|
||||||
|
method:'post',
|
||||||
|
params:params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button size="mini"
|
<el-button size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
@click="handleEditSort(scope.$index, scope.row)">排序
|
@click="handleEditSort(scope.$index, scope.row)">设置排序
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button size="mini"
|
<el-button size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
@ -153,10 +153,24 @@
|
|||||||
<el-button size="small" type="primary" @click="handleSelectDialogConfirm()">确 定</el-button>
|
<el-button size="small" type="primary" @click="handleSelectDialogConfirm()">确 定</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
<el-dialog title="设置排序"
|
||||||
|
:visible.sync="sortDialogVisible"
|
||||||
|
width="40%">
|
||||||
|
<el-form :model="sortDialogData"
|
||||||
|
label-width="150px">
|
||||||
|
<el-form-item label="排序:">
|
||||||
|
<el-input v-model="sortDialogData.sort" style="width: 200px"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<span slot="footer">
|
||||||
|
<el-button @click="sortDialogVisible = false" size="small">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="handleUpdateSort" size="small">确 定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import {fetchList,updateRecommendStatus,deleteHomeBrand,createHomeBrand} from '@/api/homeBrand';
|
import {fetchList,updateRecommendStatus,deleteHomeBrand,createHomeBrand,updateHomeBrandSort} from '@/api/homeBrand';
|
||||||
import {fetchList as fetchBrandList} from '@/api/brand';
|
import {fetchList as fetchBrandList} from '@/api/brand';
|
||||||
|
|
||||||
const defaultListQuery = {
|
const defaultListQuery = {
|
||||||
@ -210,7 +224,9 @@
|
|||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 5
|
pageSize: 5
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
sortDialogVisible:false,
|
||||||
|
sortDialogData:{sort:0,id:null}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@ -333,6 +349,27 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
handleEditSort(index,row){
|
||||||
|
this.sortDialogVisible=true;
|
||||||
|
this.sortDialogData.sort=row.sort;
|
||||||
|
this.sortDialogData.id=row.id;
|
||||||
|
},
|
||||||
|
handleUpdateSort(){
|
||||||
|
this.$confirm('是否要修改排序?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
updateHomeBrandSort(this.sortDialogData).then(response=>{
|
||||||
|
this.sortDialogVisible=false;
|
||||||
|
this.getList();
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: '删除成功!'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})
|
||||||
|
},
|
||||||
getList() {
|
getList() {
|
||||||
this.listLoading = true;
|
this.listLoading = true;
|
||||||
fetchList(this.listQuery).then(response => {
|
fetchList(this.listQuery).then(response => {
|
||||||
@ -357,7 +394,13 @@
|
|||||||
message: '修改成功!'
|
message: '修改成功!'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
})
|
}).catch(() => {
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: '已取消操作!'
|
||||||
|
});
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
deleteBrand(ids){
|
deleteBrand(ids){
|
||||||
this.$confirm('是否要删除该推荐?', '提示', {
|
this.$confirm('是否要删除该推荐?', '提示', {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user