|
46 | 46 | </el-form-item>
|
47 | 47 |
|
48 | 48 | <el-form-item>
|
49 |
| - <el-button type="primary" @click="handleQuery" |
50 |
| - ><i-ep-search />搜索</el-button |
51 |
| - > |
| 49 | + <el-button type="primary" @click="handleQuery"> |
| 50 | + <i-ep-search /> |
| 51 | + 搜索 |
| 52 | + </el-button> |
52 | 53 | <el-button @click="handleResetQuery">
|
53 | 54 | <i-ep-refresh />
|
54 |
| - 重置</el-button |
55 |
| - > |
| 55 | + 重置 |
| 56 | + </el-button> |
56 | 57 | </el-form-item>
|
57 | 58 | </el-form>
|
58 | 59 | </div>
|
|
65 | 66 | v-hasPerm="['sys:user:add']"
|
66 | 67 | type="success"
|
67 | 68 | @click="handleOpenDialog()"
|
68 |
| - ><i-ep-plus />新增</el-button |
69 | 69 | >
|
| 70 | + <i-ep-plus /> |
| 71 | + 新增 |
| 72 | + </el-button> |
70 | 73 | <el-button
|
71 | 74 | v-hasPerm="['sys:user:delete']"
|
72 | 75 | type="danger"
|
73 | 76 | :disabled="removeIds.length === 0"
|
74 | 77 | @click="handleDelete()"
|
75 |
| - ><i-ep-delete />删除</el-button |
76 | 78 | >
|
| 79 | + <i-ep-delete /> |
| 80 | + 删除 |
| 81 | + </el-button> |
77 | 82 | </div>
|
78 | 83 | <div>
|
79 |
| - <el-button class="ml-3" @click="handleOpenImportDialog" |
80 |
| - ><template #icon><i-ep-upload /></template>导入</el-button |
81 |
| - > |
82 |
| - |
83 |
| - <el-button class="ml-3" @click="handleExport" |
84 |
| - ><template #icon><i-ep-download /></template>导出</el-button |
85 |
| - > |
| 84 | + <el-button class="ml-3" @click="handleOpenImportDialog"> |
| 85 | + <template #icon><i-ep-upload /></template> |
| 86 | + 导入 |
| 87 | + </el-button> |
| 88 | + |
| 89 | + <el-button class="ml-3" @click="handleExport"> |
| 90 | + <template #icon><i-ep-download /></template> |
| 91 | + 导出 |
| 92 | + </el-button> |
86 | 93 | </div>
|
87 | 94 | </div>
|
88 | 95 | </template>
|
|
135 | 142 |
|
136 | 143 | <el-table-column label="状态" align="center" prop="status">
|
137 | 144 | <template #default="scope">
|
138 |
| - <el-tag :type="scope.row.status == 1 ? 'success' : 'info'">{{ |
139 |
| - scope.row.status == 1 ? "启用" : "禁用" |
140 |
| - }}</el-tag> |
| 145 | + <el-tag :type="scope.row.status == 1 ? 'success' : 'info'"> |
| 146 | + {{ scope.row.status == 1 ? "启用" : "禁用" }} |
| 147 | + </el-tag> |
141 | 148 | </template>
|
142 | 149 | </el-table-column>
|
143 | 150 | <el-table-column
|
|
154 | 161 | size="small"
|
155 | 162 | link
|
156 | 163 | @click="hancleResetPassword(scope.row)"
|
157 |
| - ><i-ep-refresh-left />重置密码</el-button |
158 | 164 | >
|
| 165 | + <i-ep-refresh-left /> |
| 166 | + 重置密码 |
| 167 | + </el-button> |
159 | 168 | <el-button
|
160 | 169 | v-hasPerm="['sys:user:edit']"
|
161 | 170 | type="primary"
|
162 | 171 | link
|
163 | 172 | size="small"
|
164 | 173 | @click="handleOpenDialog(scope.row.id)"
|
165 |
| - ><i-ep-edit />编辑</el-button |
166 | 174 | >
|
| 175 | + <i-ep-edit /> |
| 176 | + 编辑 |
| 177 | + </el-button> |
167 | 178 | <el-button
|
168 | 179 | v-hasPerm="['sys:user:delete']"
|
169 | 180 | type="danger"
|
170 | 181 | link
|
171 | 182 | size="small"
|
172 | 183 | @click="handleDelete(scope.row.id)"
|
173 |
| - ><i-ep-delete />删除</el-button |
174 | 184 | >
|
| 185 | + <i-ep-delete /> |
| 186 | + 删除 |
| 187 | + </el-button> |
175 | 188 | </template>
|
176 | 189 | </el-table-column>
|
177 | 190 | </el-table>
|
|
257 | 270 |
|
258 | 271 | <el-form-item label="状态" prop="status">
|
259 | 272 | <el-radio-group v-model="formData.status">
|
260 |
| - <el-radio :label="1">正常</el-radio> |
261 |
| - <el-radio :label="0">禁用</el-radio> |
| 273 | + <el-radio :value="1">正常</el-radio> |
| 274 | + <el-radio :value="0">禁用</el-radio> |
262 | 275 | </el-radio-group>
|
263 | 276 | </el-form-item>
|
264 | 277 | </el-form>
|
@@ -392,16 +405,21 @@ function hancleResetPassword(row: { [key: string]: any }) {
|
392 | 405 | confirmButtonText: "确定",
|
393 | 406 | cancelButtonText: "取消",
|
394 | 407 | }
|
395 |
| - ).then(({ value }) => { |
396 |
| - if (!value || value.length < 6) { |
397 |
| - // 检查密码是否为空或少于6位 |
398 |
| - ElMessage.warning("密码至少需要6位字符,请重新输入"); |
399 |
| - return false; |
| 408 | + ).then( |
| 409 | + ({ value }) => { |
| 410 | + if (!value || value.length < 6) { |
| 411 | + // 检查密码是否为空或少于6位 |
| 412 | + ElMessage.warning("密码至少需要6位字符,请重新输入"); |
| 413 | + return false; |
| 414 | + } |
| 415 | + UserAPI.updatePassword(row.id, value).then(() => { |
| 416 | + ElMessage.success("密码重置成功,新密码是:" + value); |
| 417 | + }); |
| 418 | + }, |
| 419 | + () => { |
| 420 | + ElMessage.info("已取消重置密码"); |
400 | 421 | }
|
401 |
| - UserAPI.updatePassword(row.id, value).then(() => { |
402 |
| - ElMessage.success("密码重置成功,新密码是:" + value); |
403 |
| - }); |
404 |
| - }); |
| 422 | + ); |
405 | 423 | }
|
406 | 424 |
|
407 | 425 | /**
|
|
0 commit comments