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) => {
59
59
}
60
60
} )
61
61
}
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 3
3
<el-page-header @back =" $router.back()" content =" 专栏列表" ></el-page-header >
4
4
<div class =" row" >
5
5
<el-button plain @click =" addColumn" >添加专栏</el-button >
6
+ <el-button plain @click =" changeSort" >更新排序</el-button >
6
7
</div >
8
+ <div class =" row" >提示:排序值尽量填不同的数值,以免排列顺序有误。</div >
7
9
<el-table
8
10
v-if =" tableData.length"
9
11
:data =" tableData"
26
28
label =" 创建时间"
27
29
width =" 240" >
28
30
</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 >
29
45
<el-table-column
30
46
label =" 操作"
31
47
width =" 220" >
48
64
49
65
<script >
50
66
import { mapState } from ' vuex'
51
- import { apiColumnList , apiColumnDelete } from ' ./../service/column'
67
+ import { apiColumnList , apiColumnDelete , apiColumnChangeSort } from ' ./../service/column'
52
68
export default {
53
69
name: ' AdminColumn' ,
54
70
data () {
@@ -126,6 +142,14 @@ export default {
126
142
})
127
143
this .apiColumnListMethod ()
128
144
}
145
+ },
146
+ async changeSort () {
147
+ let result = await apiColumnChangeSort ({
148
+ list: this .tableData
149
+ })
150
+ if (result .isok ) {
151
+ this .apiColumnListMethod ()
152
+ }
129
153
}
130
154
}
131
155
}
You can’t perform that action at this time.
0 commit comments