File tree Expand file tree Collapse file tree 2 files changed +34
-1
lines changed
Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -59,3 +59,12 @@ export const apiColumnArticleAllList = (paramsData) => {
5959 }
6060 } )
6161}
62+
63+ export const apiColumnChangeSort = ( paramsData ) => {
64+ return Vue . axios . post ( '/column/changeSort' , {
65+ ...paramsData
66+ } ,
67+ {
68+ showLoading : true
69+ } )
70+ }
Original file line number Diff line number Diff line change 33 <el-page-header @back =" $router.back()" content =" 专栏列表" ></el-page-header >
44 <div class =" row" >
55 <el-button plain @click =" addColumn" >添加专栏</el-button >
6+ <el-button plain @click =" changeSort" >更新排序</el-button >
67 </div >
8+ <div class =" row" >提示:排序值尽量填不同的数值,以免排列顺序有误。</div >
79 <el-table
810 v-if =" tableData.length"
911 :data =" tableData"
2628 label =" 创建时间"
2729 width =" 240" >
2830 </el-table-column >
31+ <el-table-column
32+ label =" 排序"
33+ width =" 155" >
34+ <template slot-scope="scope">
35+ <el-input-number
36+ v-model =" scope.row.columnSort"
37+ :min =" 1"
38+ size =" mini"
39+ :step =" 1"
40+ placeholder =" 排序数值"
41+ step-strictly >
42+ </el-input-number >
43+ </template >
44+ </el-table-column >
2945 <el-table-column
3046 label =" 操作"
3147 width =" 220" >
4864
4965<script >
5066import { mapState } from ' vuex'
51- import { apiColumnList , apiColumnDelete } from ' ./../service/column'
67+ import { apiColumnList , apiColumnDelete , apiColumnChangeSort } from ' ./../service/column'
5268export default {
5369 name: ' AdminColumn' ,
5470 data () {
@@ -126,6 +142,14 @@ export default {
126142 })
127143 this .apiColumnListMethod ()
128144 }
145+ },
146+ async changeSort () {
147+ let result = await apiColumnChangeSort ({
148+ list: this .tableData
149+ })
150+ if (result .isok ) {
151+ this .apiColumnListMethod ()
152+ }
129153 }
130154 }
131155}
You can’t perform that action at this time.
0 commit comments