|
|
@@ -23,6 +23,15 @@
|
|
23
|
23
|
<span v-else> - </span>
|
|
24
|
24
|
</template>
|
|
25
|
25
|
</el-table-column>
|
|
|
26
|
+ <el-table-column :label="T('Status')" align="center">
|
|
|
27
|
+ <template #default="{row}">
|
|
|
28
|
+ <el-switch v-model="row.status"
|
|
|
29
|
+ :active-value="ENABLE_STATUS"
|
|
|
30
|
+ :inactive-value="DISABLE_STATUS"
|
|
|
31
|
+ @change="changeStatus(row)"
|
|
|
32
|
+ ></el-switch>
|
|
|
33
|
+ </template>
|
|
|
34
|
+ </el-table-column>
|
|
26
|
35
|
<el-table-column prop="created_at" :label="T('CreatedAt')" align="center"/>
|
|
27
|
36
|
<el-table-column prop="updated_at" :label="T('UpdatedAt')" align="center"/>
|
|
28
|
37
|
<el-table-column :label="T('Actions')" align="center" width="650">
|
|
|
@@ -51,6 +60,9 @@
|
|
51
|
60
|
<script setup>
|
|
52
|
61
|
import { useRepositories, useDel, useToEditOrAdd, useChangePwd } from '@/views/user/composables'
|
|
53
|
62
|
import { T } from '@/utils/i18n'
|
|
|
63
|
+ import { DISABLE_STATUS, ENABLE_STATUS } from '@/utils/common_options'
|
|
|
64
|
+ import { update } from '@/api/user'
|
|
|
65
|
+ import { ElMessageBox, ElMessage } from 'element-plus'
|
|
54
|
66
|
//列表
|
|
55
|
67
|
const {
|
|
56
|
68
|
listRes,
|
|
|
@@ -72,6 +84,20 @@
|
|
72
|
84
|
}
|
|
73
|
85
|
}
|
|
74
|
86
|
|
|
|
87
|
+ const changeStatus = async (row) => {
|
|
|
88
|
+ /*const confirm = await ElMessageBox.confirm(T('Confirm?', { param: T('Update') }), {
|
|
|
89
|
+ confirmButtonText: T('Confirm'),
|
|
|
90
|
+ cancelButtonText: T('Cancel'),
|
|
|
91
|
+ }).catch(_ => false)
|
|
|
92
|
+ if (!confirm) {
|
|
|
93
|
+ return false
|
|
|
94
|
+ }*/
|
|
|
95
|
+ const res = await update(row).catch(_ => false)
|
|
|
96
|
+ if (res) {
|
|
|
97
|
+ ElMessage.success(T('OperationSuccess'))
|
|
|
98
|
+ getList(listQuery)
|
|
|
99
|
+ }
|
|
|
100
|
+ }
|
|
75
|
101
|
|
|
76
|
102
|
</script>
|
|
77
|
103
|
|