Skip to content

Commit 9f0ce6f

Browse files
authored
Merge branch 'youlaitech:master' into master
2 parents f15c78e + b81a1d4 commit 9f0ce6f

File tree

3 files changed

+63
-48
lines changed

3 files changed

+63
-48
lines changed

src/layout/components/NavBar/components/NavbarAction.vue

+10-15
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,21 @@
4343
>
4444
<el-link type="primary">
4545
<el-text class="w-350px" size="default" truncated>
46-
{{ message.title }}</el-text
47-
>
46+
{{ message.title }}
47+
</el-text>
4848
</el-link>
4949
</div>
5050
</el-tab-pane>
5151
</el-tabs>
5252
<el-divider />
5353
<div class="flex-x-between">
5454
<el-link type="primary" :underline="false">
55-
<span class="text-xs">查看更多</span
56-
><el-icon class="text-xs"><ArrowRight /></el-icon
57-
></el-link>
55+
<span class="text-xs">查看更多</span>
56+
<el-icon class="text-xs"><ArrowRight /></el-icon>
57+
</el-link>
5858
<el-link type="primary" :underline="false">
59-
<span class="text-xs">全部已读</span></el-link
60-
>
59+
<span class="text-xs">全部已读</span>
60+
</el-link>
6161
</div>
6262
</div>
6363
</template>
@@ -211,13 +211,8 @@ function logout() {
211211
background: rgb(255 255 255 / 20%);
212212
}
213213
214-
.see-more {
215-
padding: 10px 0;
216-
text-align: center;
217-
}
218-
219-
.see-more a {
220-
color: var(--el-color-primary);
221-
text-decoration: none;
214+
.layout-top .nav-action-item,
215+
.layout-mix .nav-action-item {
216+
color: #fff;
222217
}
223218
</style>

src/layout/components/Sidebar/components/SidebarMixTopMenu.vue

+4-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
v-if="route.meta && route.meta.icon"
2020
:icon-class="route.meta.icon"
2121
/>
22-
<span v-if="route.path === '/'"> 首页 </span>
22+
<span v-if="route.path === '/'">首页</span>
2323
<template v-else>
2424
<span v-if="route.meta && route.meta.title" class="ml-1">
2525
{{ translateRouteTitle(route.meta.title) }}
@@ -41,8 +41,10 @@ const appStore = useAppStore();
4141
const permissionStore = usePermissionStore();
4242
const router = useRouter();
4343

44+
console.log("当前路由", useRoute().path);
45+
4446
// 避免 activeTopMenuPath 缓存被清理,从当前路由路径获取顶部菜单路径,eg. /system/user → /system
45-
const activeTopMenuPath = useRoute().path.replace(/\/[^\/]+$/, "") || "/";
47+
const activeTopMenuPath = useRoute().path.match(/^\/[^\/]+/)?.[0] || "/";
4648
appStore.activeTopMenu(activeTopMenuPath);
4749

4850
// 激活的顶部菜单路径

src/views/system/user/index.vue

+49-31
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,14 @@
4646
</el-form-item>
4747

4848
<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>
5253
<el-button @click="handleResetQuery">
5354
<i-ep-refresh />
54-
重置</el-button
55-
>
55+
重置
56+
</el-button>
5657
</el-form-item>
5758
</el-form>
5859
</div>
@@ -65,24 +66,30 @@
6566
v-hasPerm="['sys:user:add']"
6667
type="success"
6768
@click="handleOpenDialog()"
68-
><i-ep-plus />新增</el-button
6969
>
70+
<i-ep-plus />
71+
新增
72+
</el-button>
7073
<el-button
7174
v-hasPerm="['sys:user:delete']"
7275
type="danger"
7376
:disabled="removeIds.length === 0"
7477
@click="handleDelete()"
75-
><i-ep-delete />删除</el-button
7678
>
79+
<i-ep-delete />
80+
删除
81+
</el-button>
7782
</div>
7883
<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>
8693
</div>
8794
</div>
8895
</template>
@@ -135,9 +142,9 @@
135142

136143
<el-table-column label="状态" align="center" prop="status">
137144
<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>
141148
</template>
142149
</el-table-column>
143150
<el-table-column
@@ -154,24 +161,30 @@
154161
size="small"
155162
link
156163
@click="hancleResetPassword(scope.row)"
157-
><i-ep-refresh-left />重置密码</el-button
158164
>
165+
<i-ep-refresh-left />
166+
重置密码
167+
</el-button>
159168
<el-button
160169
v-hasPerm="['sys:user:edit']"
161170
type="primary"
162171
link
163172
size="small"
164173
@click="handleOpenDialog(scope.row.id)"
165-
><i-ep-edit />编辑</el-button
166174
>
175+
<i-ep-edit />
176+
编辑
177+
</el-button>
167178
<el-button
168179
v-hasPerm="['sys:user:delete']"
169180
type="danger"
170181
link
171182
size="small"
172183
@click="handleDelete(scope.row.id)"
173-
><i-ep-delete />删除</el-button
174184
>
185+
<i-ep-delete />
186+
删除
187+
</el-button>
175188
</template>
176189
</el-table-column>
177190
</el-table>
@@ -257,8 +270,8 @@
257270

258271
<el-form-item label="状态" prop="status">
259272
<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>
262275
</el-radio-group>
263276
</el-form-item>
264277
</el-form>
@@ -392,16 +405,21 @@ function hancleResetPassword(row: { [key: string]: any }) {
392405
confirmButtonText: "确定",
393406
cancelButtonText: "取消",
394407
}
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("已取消重置密码");
400421
}
401-
UserAPI.updatePassword(row.id, value).then(() => {
402-
ElMessage.success("密码重置成功,新密码是:" + value);
403-
});
404-
});
422+
);
405423
}
406424

407425
/**

0 commit comments

Comments
 (0)