u
This commit is contained in:
1 parent
aa813c9649
commit
62550b8182
45 files changed
+12535
-566
No files matched your search
@@ -9,11 +9,13 @@ const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
onMounted(() => {
|
||||
loadDataApi("s_keyvalue", `b_key='bodycaption'`, ``, ["b_value"]).then((res) => {
|
||||
if (res.success) {
|
||||
title.value = res.data[0].b_value;
|
||||
}
|
||||
});
|
||||
loadDataApi("s_keyvalue", `b_key='bodycaption'`, ``, ["b_value"]).then(
|
||||
(res) => {
|
||||
if (res.success) {
|
||||
title.value = res.data[0].b_value;
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
const menuList = ref([
|
||||
@@ -40,6 +42,19 @@ const menuList = ref([
|
||||
label: "系统管理",
|
||||
icon: "lucide:settings",
|
||||
children: [
|
||||
{
|
||||
label: "办公管理",
|
||||
children: [
|
||||
{
|
||||
label: "企业公告",
|
||||
path: "/system/oa/notice",
|
||||
},
|
||||
{
|
||||
label: "用户提醒",
|
||||
path: "/system/oa/reminder",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "字段配置",
|
||||
path: "/system/field",
|
||||
@@ -48,6 +63,10 @@ const menuList = ref([
|
||||
label: "权限配置",
|
||||
path: "/system/permission",
|
||||
},
|
||||
{
|
||||
label: "模块配置",
|
||||
path: "/system/module",
|
||||
},
|
||||
],
|
||||
},
|
||||
]);
|
||||
@@ -154,13 +173,14 @@ function handleMenuChange(val) {
|
||||
border-radius: 6px;
|
||||
}
|
||||
.el-menu-item {
|
||||
padding-left: 48px !important;
|
||||
// padding-left: 48px !important;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
&.is-active {
|
||||
.el-sub-menu__title {
|
||||
color: var(--el-color-primary);
|
||||
}
|
||||
// .el-sub-menu__title {
|
||||
// color: var(--el-color-primary);
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ import { useUserStore } from "@/store/user";
|
||||
import { useTabStore } from "@/store/tab";
|
||||
import { useRouter } from "vue-router";
|
||||
import { ElMessage } from "element-plus";
|
||||
import UpdatePassword from "./update-password.vue";
|
||||
|
||||
const props = defineProps({
|
||||
collapse: {
|
||||
@@ -18,6 +19,8 @@ const router = useRouter();
|
||||
const tabStore = useTabStore();
|
||||
const userStore = useUserStore();
|
||||
|
||||
const showUpdatePassword = ref(false);
|
||||
|
||||
function onCollapse() {
|
||||
emits("collapse");
|
||||
}
|
||||
@@ -37,7 +40,11 @@ function logout() {
|
||||
<div class="g3-topbar-left">
|
||||
<div class="g3-action-icon" @click="onCollapse()">
|
||||
<G3Icon
|
||||
:icon="props.collapse ? 'lucide:list-indent-increase' : 'lucide:list-indent-decrease'"
|
||||
:icon="
|
||||
props.collapse
|
||||
? 'lucide:list-indent-increase'
|
||||
: 'lucide:list-indent-decrease'
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -48,19 +55,29 @@ function logout() {
|
||||
<G3Icon icon="lucide:circle-user-round" size="18" />
|
||||
<div class="user-info">
|
||||
<span class="user-name">
|
||||
{{ userStore.userInfo.username || userStore.userInfo.userid || "空" }}
|
||||
{{
|
||||
userStore.userInfo.username || userStore.userInfo.userid || "空"
|
||||
}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item> 个人信息 </el-dropdown-item>
|
||||
<el-dropdown-item> 修改密码 </el-dropdown-item>
|
||||
<el-dropdown-item divided @click="logout"> 退出登录 </el-dropdown-item>
|
||||
<el-dropdown-item @click="router.push('/user-center')"
|
||||
>个人中心</el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item @click="showUpdatePassword = !showUpdatePassword">
|
||||
修改密码
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item divided @click="logout">
|
||||
退出登录
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
|
||||
<UpdatePassword v-model="showUpdatePassword" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
<script lang="js" setup>
|
||||
import { updatePasswordApi } from "@/request/api";
|
||||
import { ElMessage } from "element-plus";
|
||||
|
||||
const confirmLoading = ref(false);
|
||||
const showDialog = defineModel(false);
|
||||
|
||||
const form = ref({
|
||||
oldPassword: "",
|
||||
newPassword: "",
|
||||
confirmPassword: "",
|
||||
});
|
||||
|
||||
function handleConfirm() {
|
||||
if (form.value.newPassword === "") {
|
||||
ElMessage.warning("新密码不能为空");
|
||||
return;
|
||||
}
|
||||
if (form.value.confirmPassword !== form.value.newPassword) {
|
||||
ElMessage.warning("新密码和确认密码不一致");
|
||||
return;
|
||||
}
|
||||
|
||||
confirmLoading.value = true;
|
||||
|
||||
updatePasswordApi({
|
||||
newPassword: form.value.newPassword,
|
||||
oldPassword: form.value.oldPassword,
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
// 修改成功
|
||||
ElMessage.success("修改成功");
|
||||
showDialog.value = false;
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
confirmLoading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
function resetForm() {
|
||||
form.value.newPassword = "";
|
||||
form.value.oldPassword = "";
|
||||
form.value.confirmPassword = "";
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="showDialog"
|
||||
@closed="resetForm"
|
||||
title="修改密码"
|
||||
width="400"
|
||||
>
|
||||
<G3Grid>
|
||||
<G3GridGroup :label-width="80" :column="1" label-align="right">
|
||||
<G3GridItem label="旧密码" :span="1">
|
||||
<el-input v-model="form.oldPassword" type="password" show-password />
|
||||
</G3GridItem>
|
||||
<G3GridItem label="新密码" :span="1" required>
|
||||
<el-input v-model="form.newPassword" type="password" show-password />
|
||||
</G3GridItem>
|
||||
<G3GridItem label="确认密码" :span="1" required>
|
||||
<el-input
|
||||
v-model="form.confirmPassword"
|
||||
type="password"
|
||||
show-password
|
||||
/>
|
||||
</G3GridItem>
|
||||
</G3GridGroup>
|
||||
</G3Grid>
|
||||
|
||||
<div class="footer">
|
||||
<el-button @click="showDialog = false">取消</el-button>
|
||||
<el-button type="primary" :loading="confirmLoading" @click="handleConfirm"
|
||||
>确认</el-button
|
||||
>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.footer {
|
||||
margin-top: 12px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user