添加上下移动
Showing
2 changed files
with
88 additions
and
28 deletions
... | @@ -13,9 +13,17 @@ | ... | @@ -13,9 +13,17 @@ |
13 | </el-form> | 13 | </el-form> |
14 | </div> | 14 | </div> |
15 | <div class="from-clues-content"> | 15 | <div class="from-clues-content"> |
16 | <lb-table :page-size="pageData.size" :current-page.sync="pageData.current" :total="pageData.total" | 16 | <lb-table |
17 | @size-change="handleSizeChange" @p-current-change="handleCurrentChange" :column="tableData.columns" | 17 | :page-size="pageData.size" |
18 | :data="tableData.data"> | 18 | :current-page.sync="pageData.current" |
19 | :total="pageData.total" | ||
20 | @size-change="handleSizeChange" | ||
21 | @p-current-change="handleCurrentChange" | ||
22 | :column="tableData.columns" | ||
23 | :data="tableData.data" | ||
24 | :expand-row-keys="keyList" | ||
25 | row-key="dictid" | ||
26 | > | ||
19 | </lb-table> | 27 | </lb-table> |
20 | </div> | 28 | </div> |
21 | <EditDialog ref="addEditDialog" /> | 29 | <EditDialog ref="addEditDialog" /> |
... | @@ -23,7 +31,13 @@ | ... | @@ -23,7 +31,13 @@ |
23 | </div> | 31 | </div> |
24 | </template> | 32 | </template> |
25 | <script> | 33 | <script> |
26 | // 定时任务 | 34 | import { |
35 | getUuid, | ||
36 | judgeSort, | ||
37 | realMove, | ||
38 | findParents, | ||
39 | removeTreeListItem, | ||
40 | } from "@/utils/operation"; | ||
27 | import data from "./data"; | 41 | import data from "./data"; |
28 | import sjsbTask from "@/api/sjsbTask.js"; | 42 | import sjsbTask from "@/api/sjsbTask.js"; |
29 | import tableMixin from "@/mixins/tableMixin.js"; | 43 | import tableMixin from "@/mixins/tableMixin.js"; |
... | @@ -36,9 +50,10 @@ export default { | ... | @@ -36,9 +50,10 @@ export default { |
36 | EditDialog, | 50 | EditDialog, |
37 | Roleslistdiglog, | 51 | Roleslistdiglog, |
38 | }, | 52 | }, |
39 | data () { | 53 | data() { |
40 | return { | 54 | return { |
41 | taskData: null, | 55 | taskData: null, |
56 | keyList: [], | ||
42 | form: { | 57 | form: { |
43 | job_name: "", | 58 | job_name: "", |
44 | currentPage: 1, | 59 | currentPage: 1, |
... | @@ -53,7 +68,6 @@ export default { | ... | @@ -53,7 +68,6 @@ export default { |
53 | departmentId: "", // 部门ID | 68 | departmentId: "", // 部门ID |
54 | departmentList: [], // 部门列表 | 69 | departmentList: [], // 部门列表 |
55 | levelList: [], // 职务级别 | 70 | levelList: [], // 职务级别 |
56 | tableData: [], | ||
57 | sexList: [], | 71 | sexList: [], |
58 | typeOptions: [ | 72 | typeOptions: [ |
59 | { | 73 | { |
... | @@ -94,23 +108,21 @@ export default { | ... | @@ -94,23 +108,21 @@ export default { |
94 | <div> | 108 | <div> |
95 | <el-button | 109 | <el-button |
96 | type="text" | 110 | type="text" |
97 | size="mini" | 111 | disabled={scope.row.isTop} |
98 | icon="el-icon-video-pause" | ||
99 | onClick={() => { | 112 | onClick={() => { |
100 | this.personnel(scope.row); | 113 | this.moveUpward(scope.$index, scope.row); |
101 | }} | 114 | }} |
102 | > | 115 | > |
103 | 人员 | 116 | 上移 |
104 | </el-button> | 117 | </el-button> |
105 | <el-button | 118 | <el-button |
106 | type="text" | 119 | type="text" |
107 | size="mini" | 120 | disabled={scope.row.isBottom} |
108 | icon="el-icon-edit" | ||
109 | onClick={() => { | 121 | onClick={() => { |
110 | this.handleEdit(scope.row); | 122 | this.moveDown(scope.$index, scope.row); |
111 | }} | 123 | }} |
112 | > | 124 | > |
113 | 修改 | 125 | 下移 |
114 | </el-button> | 126 | </el-button> |
115 | </div> | 127 | </div> |
116 | ); | 128 | ); |
... | @@ -169,12 +181,12 @@ export default { | ... | @@ -169,12 +181,12 @@ export default { |
169 | }, | 181 | }, |
170 | }; | 182 | }; |
171 | }, | 183 | }, |
172 | created () { | 184 | created() { |
173 | this.featchData(); | 185 | this.featchData(); |
174 | }, | 186 | }, |
175 | methods: { | 187 | methods: { |
176 | // 新增角色 | 188 | // 新增角色 |
177 | handleAdd () { | 189 | handleAdd() { |
178 | // this.$refs.addEditDialog.roleId = value.id | 190 | // this.$refs.addEditDialog.roleId = value.id |
179 | // this.roleSort = value.sort ? value.sort : 0 | 191 | // this.roleSort = value.sort ? value.sort : 0 |
180 | 192 | ||
... | @@ -182,7 +194,7 @@ export default { | ... | @@ -182,7 +194,7 @@ export default { |
182 | this.$refs.addEditDialog.dialogTitle = "新增"; | 194 | this.$refs.addEditDialog.dialogTitle = "新增"; |
183 | }, | 195 | }, |
184 | // 修改角色 | 196 | // 修改角色 |
185 | handleEdit (row) { | 197 | handleEdit(row) { |
186 | this.$refs.addEditDialog.roleId = row.id; | 198 | this.$refs.addEditDialog.roleId = row.id; |
187 | this.roleSort = row.sort ? row.sort : 0; | 199 | this.roleSort = row.sort ? row.sort : 0; |
188 | if (row.id) { | 200 | if (row.id) { |
... | @@ -193,29 +205,78 @@ export default { | ... | @@ -193,29 +205,78 @@ export default { |
193 | this.$refs.addEditDialog.showAddEditDialog = true; | 205 | this.$refs.addEditDialog.showAddEditDialog = true; |
194 | this.$refs.addEditDialog.dialogTitle = "修改"; | 206 | this.$refs.addEditDialog.dialogTitle = "修改"; |
195 | }, | 207 | }, |
196 | featchData () { | 208 | featchData() { |
197 | this.tableData.data = [ | 209 | this.tableData.data = [ |
198 | { | 210 | { |
199 | id: "2176e915-fdb4-414a-b8d6-6cf63171cffc", | 211 | id: "2176e915-fdb4-414a-b8d6-6cf63171cffc", |
212 | isTop: true, | ||
213 | isBottom: false, | ||
214 | dictid: "51b9f487861671f77782c5a23b5fe52esasq", | ||
200 | createdAt: "2022-10-31T07:08:29.293+0000", | 215 | createdAt: "2022-10-31T07:08:29.293+0000", |
201 | updatedAt: "2022-10-31T07:08:29.293+0000", | 216 | updatedAt: "2022-10-31T07:08:29.293+0000", |
202 | createdBy: "3127e455-43ba-45ff-9326-0e02ef89485e", | 217 | createdBy: "3127e455-43ba-45ff-9326-0e02ef89485e", |
203 | updatedBy: "3127e455-43ba-45ff-9326-0e02ef89485e", | 218 | updatedBy: "3127e455-43ba-45ff-9326-0e02ef89485e", |
204 | sort: 29, | 219 | sort: 29, |
205 | name: "人事部材料管理员", | 220 | name: "材料管理员", |
206 | type: "材料管理员", | 221 | type: "信息员", |
207 | category: 2, | 222 | category: 2, |
208 | description: "管理内部材料", | 223 | description: "1二点三s", |
224 | _X_ROW_KEY: "row_365", | ||
225 | }, | ||
226 | { | ||
227 | id: "2176e915-fdb4-414a-b8d6-6cf63171c222ffc", | ||
228 | isTop: false, | ||
229 | isBottom: false, | ||
230 | dictid: "51b9f487861671f77782c5a23b5fe52e11", | ||
231 | createdAt: "2022-10-31T07:08:29.293+0000", | ||
232 | updatedAt: "2022-10-31T07:08:29.293+0000", | ||
233 | createdBy: "3127e455-43ba-45ff-9326-0e02ef89485e", | ||
234 | updatedBy: "3127e455-43ba-45ff-9326-0e02ef89485e", | ||
235 | sort: 29, | ||
236 | name: "人事管理员", | ||
237 | type: "管理", | ||
238 | category: 2, | ||
239 | description: "管qdq", | ||
240 | _X_ROW_KEY: "row_365", | ||
241 | }, | ||
242 | { | ||
243 | id: "2176e915-fdb4-414a-b8324d6-6cf63171cffc", | ||
244 | isTop: false, | ||
245 | isBottom: true, | ||
246 | dictid: "51b9f487861671f72131ddd7782c5a23b5fe52e12ewsd", | ||
247 | createdAt: "2022-10-31T07:08:29.293+0000", | ||
248 | updatedAt: "2022-10-31T07:08:29.293+0000", | ||
249 | createdBy: "3127e455-43ba-45ff-9326-0e02ef89485e", | ||
250 | updatedBy: "3127e455-43ba-45ff-9326-0e02ef89485e", | ||
251 | sort: 29, | ||
252 | name: "管理员", | ||
253 | type: "材料", | ||
254 | category: 2, | ||
255 | description: "sadq", | ||
209 | _X_ROW_KEY: "row_365", | 256 | _X_ROW_KEY: "row_365", |
210 | }, | 257 | }, |
211 | ]; | 258 | ]; |
212 | }, | 259 | }, |
213 | 260 | // 上移下移 | |
214 | personnel () { | 261 | moveUpward(index, row) { |
262 | realMove(row.dictid, "UP", this.tableData.data); | ||
263 | this.key++; | ||
264 | let id = findParents(this.tableData.data, row.dictid); | ||
265 | this.keyList = id; | ||
266 | }, | ||
267 | moveDown(index, row) { | ||
268 | realMove(row.dictid, "DOWN", this.tableData.data); | ||
269 | this.key++; | ||
270 | let id = findParents(this.tableData.data, row.dictid); | ||
271 | this.keyList = id; | ||
272 | }, | ||
273 | // 人员配置弹框 | ||
274 | personnel() { | ||
215 | this.$refs.rolesForm.adds(); | 275 | this.$refs.rolesForm.adds(); |
216 | this.$refs.rolesForm.title = "人员配置"; | 276 | this.$refs.rolesForm.title = "人员配置"; |
217 | }, | 277 | }, |
218 | handleDel (row) { | 278 | // 删除 |
279 | handleDel(row) { | ||
219 | this.$confirm("此操将进行删除操作, 是否继续?", "提示", { | 280 | this.$confirm("此操将进行删除操作, 是否继续?", "提示", { |
220 | confirmButtonText: "确定", | 281 | confirmButtonText: "确定", |
221 | cancelButtonText: "取消", | 282 | cancelButtonText: "取消", |
... | @@ -253,8 +314,8 @@ export default { | ... | @@ -253,8 +314,8 @@ export default { |
253 | <style scoped lang="scss"> | 314 | <style scoped lang="scss"> |
254 | @import "~@/styles/mixin.scss"; | 315 | @import "~@/styles/mixin.scss"; |
255 | @import "~@/styles/public.scss"; | 316 | @import "~@/styles/public.scss"; |
256 | .btnColRight{ | 317 | .btnColRight { |
257 | margin-left: -30px; | 318 | margin-left: -30px; |
258 | margin-top: 20px; | 319 | margin-top: 20px; |
259 | } | 320 | } |
260 | </style> | 321 | </style> | ... | ... |
... | @@ -24,7 +24,7 @@ | ... | @@ -24,7 +24,7 @@ |
24 | @p-current-change="handleCurrentChange" | 24 | @p-current-change="handleCurrentChange" |
25 | :column="tableData.columns" | 25 | :column="tableData.columns" |
26 | :data="tableData.data" | 26 | :data="tableData.data" |
27 | :expand-row-keys="keyList" row-key="dictid" | 27 | :expand-row-keys="keyList" row-key="dictid" |
28 | > | 28 | > |
29 | </lb-table> | 29 | </lb-table> |
30 | </div> | 30 | </div> |
... | @@ -32,7 +32,6 @@ | ... | @@ -32,7 +32,6 @@ |
32 | </div> | 32 | </div> |
33 | </template> | 33 | </template> |
34 | <script> | 34 | <script> |
35 | // 定时任务 | ||
36 | import { | 35 | import { |
37 | getUuid, | 36 | getUuid, |
38 | judgeSort, | 37 | judgeSort, | ... | ... |
-
Please register or sign in to post a comment