index.vue
10.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
<template>
<div class="timedTask from-clues">
<div class="from-clues-header">
<el-form ref="ruleForm" :model="form" label-width="100px">
<el-row class="mb-5">
<!-- 按钮操作 -->
<el-col :span="2" class="btnColRight">
<el-form-item>
<btn nativeType="cx" @click="handleAdd">添加人员</btn>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<div class="from-clues-content">
<lb-table
:page-size="pageData.size"
:current-page.sync="pageData.current"
:total="pageData.total"
@size-change="handleSizeChange"
@p-current-change="handleCurrentChange"
:column="tableData.columns"
:data="tableData.data"
>
</lb-table>
</div>
<edit-dialog ref="dialogForm" />
</div>
</template>
<script>
// 定时任务
import {
getUuid,
judgeSort,
realMove,
findParents,
removeTreeListItem,
} from "@/utils/operation";
import data from "./data";
import sjsbTask from "@/api/sjsbTask.js";
import tableMixin from "@/mixins/tableMixin.js";
import EditDialog from "./edit-dialog.vue";
export default {
name: "menus",
mixins: [tableMixin],
components: {
EditDialog,
},
data() {
return {
taskData: null,
form: {
job_name: "",
currentPage: 1,
},
queryParam: {},
selectType: "0",
queryName: "",
organizationId: "", // 组织机构ID
departmentId: "", // 部门ID
departmentList: [], // 部门列表
levelList: [], // 职务级别
tableData: [],
sexList: [],
typeOptions: [
{
value: "0",
label: "姓名",
},
{
value: "1",
label: "工号",
},
{
value: "2",
label: "部门",
},
{
value: "3",
label: "机构",
},
],
selectionList: [],
tableData: {
columns: [
{
label: "序号",
type: "index",
width: "50",
index: this.indexMethod,
},
]
.concat(data.columns())
.concat([
{
label: "排序",
width: 380,
render: (h, scope) => {
return (
<div>
<el-button
type="text"
disabled={scope.row.isTop}
onClick={() => {
this.moveUpward(scope.$index, scope.row);
}}
>
上移
</el-button>
<el-button
type="text"
disabled={scope.row.isBottom}
onClick={() => {
this.moveDown(scope.$index, scope.row);
}}
>
下移
</el-button>
</div>
);
},
},
{
label: "操作",
width: 380,
render: (h, scope) => {
return (
<div>
<el-button
type="text"
size="mini"
icon="el-icon-edit"
onClick={() => {
this.updateLock(scope.row, scope.row.name);
}}
>
解锁
</el-button>
<el-button
type="text"
size="mini"
icon="el-icon-video-pause"
onClick={() => {
this.resetPassword(scope.row.id);
}}
>
重置
</el-button>
<el-button
type="text"
size="mini"
icon="el-icon-edit"
onClick={() => {
this.handleEdit(scope.row);
}}
>
修改
</el-button>
<el-button
type="text"
size="mini"
icon="el-icon-delete"
style="color:#F56C6C"
onClick={() => {
this.handleDelete(scope.row.id, scope.row.name);
}}
>
删除
</el-button>
</div>
);
},
},
]),
data: [],
},
pageData: {
total: 5,
pageSize: 15,
current: 1,
},
};
},
methods: {
handleAdd() {
this.taskData = null;
this.$refs.dialogForm.add();
this.$refs.dialogForm.title = "添加";
},
featchData() {
this.tableData.data = [
{
id: "6a269fa4-49ee-40ed-be72-302ebdf7b9d6",
name: "组件开发模板测试用户",
sort: 67,
loginName: "wgs-template-test",
email: null,
lastLoginTime: null,
mobilePhone: null,
isLocked: false,
status: "ACTIVE",
passwordChangeTime: "2022-06-29T01:59:18.123+0000",
idCard: null,
departmentId: "dcce05ff-7747-4c19-b31f-c018ec8d8f0c",
departmentName: "科室一",
organizationId: "e9e830f0-38f4-4fb2-90ad-496c4e1314aa",
sex: "0",
isDuty: null,
code: "adfasfd",
jobLevel: null,
telephone: null,
address: null,
_X_ROW_KEY: "row_42",
switch: true,
},
{
id: "acebbaf3-81d0-4b0f-a426-feafa7ea1bed",
name: "饿肚肚",
sort: 36,
loginName: "吃饭",
email: null,
lastLoginTime: null,
mobilePhone: null,
isLocked: false,
status: "ACTIVE",
passwordChangeTime: "2021-08-24T02:04:39.132+0000",
idCard: "43423441242134 ",
departmentId: "dcce05ff-7747-4c19-b31f-c018ec8d8f0c",
departmentName: "科室一",
organizationId: "e9e830f0-38f4-4fb2-90ad-496c4e1314aa",
sex: null,
isDuty: null,
code: "2323",
jobLevel: null,
telephone: null,
address: null,
_X_ROW_KEY: "row_43",
switch: true,
},
];
},
// 重置搜索
// resetSearch() {
// this.selectType = "0";
// this.queryName = "";
// this.queryParam = {
// organizationId: this.organizationId,
// departmentId: this.departmentId
// }
// },
// 更新用户解锁状态
updateLock(id, name) {
this.$confirm(
`<div class="customer-message-wrapper">
<h5 class="title">确定要更新用户解锁状态吗</h5>
<p class="result">执行后,数据将
<span >无法恢复</span>
</p>
</div>`,
"执行确认",
{
dangerouslyUseHTMLString: true,
customClass: "customer-delete",
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(() => {
// updateLock(id).then((res) => {
// if (res.status === 1) {
// this.$message.success({ message: res.message, showClose: true })
// this.getTableList()
// } else {
// this.$message.error({ message: res.message, showClose: true })
// }
// })
})
.catch(() => {});
},
// 上移下移
moveUpward(index, row) {
console.log("index",index);
console.log("row",row);
realMove(row.bsmDict, "UP", this.tableData);
this.key++;
let id = findParents(this.tableData, row.bsmDict);
this.keyList = id;
},
moveDown(index, row) {
realMove(row.bsmDict, "DOWN", this.tableData);
this.key++;
let id = findParents(this.tableData, row.bsmDict);
this.keyList = id;
},
// 重置用户密码
resetPassword(data) {
const ids = [];
if (data instanceof Array) {
data.forEach((item) => {
ids.push(item.id);
});
} else {
ids.push(data);
}
console.log(ids, "ids");
if (ids.length === 0) {
this.$message({
message: "请选择需要重置密码的用户!",
showClose: true,
});
return;
}
this.$confirm(
`<div class="customer-message-wrapper">
<h5 class="title">确定要重置密码吗</h5>
<p class="result">执行后,数据将
<span >无法恢复</span>
</p>
</div>`,
"执行确认",
{
dangerouslyUseHTMLString: true,
customClass: "customer-delete",
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(() => {
// resetPassword(ids).then((res) => {
// if (res.status === 1) {
// this.$message.success({ message: res.message, showClose: true })
// this.getTableList()
// } else {
// this.$message.error({ message: res.message, showClose: true })
// }
// })
})
.catch(() => {});
},
// 修改人员信息
handleEdit(row) {
this.$refs.dialogForm.edit(row);
this.$refs.dialogForm.title = "修改";
},
// 删除
handleDelete(id, content) {
this.$confirm("此操将进行删除操作, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
// deleteAction(`${api.users}/${id}`).then((res) => {
// if (res.status === 1) {
// this.$message.success({ message: res.message, showClose: true })
// } else {
// this.$message.error({ message: res.message, showClose: true })
// }
// this.getTableList()
// })
})
.catch(() => {});
},
},
};
</script>
<style scoped lang="scss">
@import "~@/styles/mixin.scss";
@import "~@/styles/public.scss";
</style>