From 9e83db905da90296c4b479eb7a12f6b1efac254f Mon Sep 17 00:00:00 2001
From: lion <120344285@qq.com>
Date: Tue, 25 Mar 2025 17:25:41 +0800
Subject: [PATCH] =?UTF-8?q?=E5=BF=AB=E6=8D=B7=E8=8F=9C=E5=8D=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/user.js | 9 +++
src/views/dashboard/index.vue | 146 +++++++++++++++++++++++++++-------
2 files changed, 128 insertions(+), 27 deletions(-)
diff --git a/src/api/user.js b/src/api/user.js
index 44fff87..2885e86 100644
--- a/src/api/user.js
+++ b/src/api/user.js
@@ -16,6 +16,15 @@ export function save (data) {
})
}
+export function saveMyself (data) {
+ return request({
+ url: "/api/backend/user/myself-save",
+ method: "post",
+ data
+ })
+}
+
+
export function destroy (data) {
return request({
url: "/api/backend/user/delete",
diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue
index e2ff8e1..383bed2 100644
--- a/src/views/dashboard/index.vue
+++ b/src/views/dashboard/index.vue
@@ -170,23 +170,34 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
{{item.name}}
+
-
{{ item.name }}
-
+
@@ -285,6 +296,48 @@
frameborder="0"
/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {return changeCheck(item,e)}" v-model="item.checked">{{ item.name }}
+
+
+
+
+
+ 确认
+
+
@@ -299,6 +352,9 @@ import { index as configIndex } from "@/api/config";
import { index } from "@/api/attendance";
import {isExternal} from "@/utils/validate";
import { defaultModalSize } from "@/settings";
+import {saveMyself} from "@/api/user"
+import {getInfo} from "@/api/me"
+
export default {
name: "Dashboard",
components: {
@@ -310,7 +366,8 @@ export default {
modalUrl: "",
zIndex: PopupManager.nextZIndex(),
isShowModal: false,
-
+ isShowQuick:false,
+ quickLoading:false,
weatherIcon: new Map([
["晴", "el-icon-sunny"],
["阴", "el-icon-cloudy"],
@@ -436,22 +493,29 @@ export default {
console.error(err);
}
},
+ // 快捷菜单
+ changeCheck(item){
+ this.$set(item,'checked',!item.checked)
+ this.$forceUpdate()
+ },
async getUsualFlows() {
try {
await this.getFlows();
- const res = await configIndex({
- filter: [
- {
- key: "key",
- op: "eq",
- value: "dashboard_menus",
- },
- ],
- });
- this.usualFlows = this.flows.filter(
- (i) => res.data[0]?.value?.indexOf(i.id.toString()) !== -1
- );
- console.log(this.usualFlows);
+ const res = await getInfo()
+ this.usualFlows = res.quick_enter?res.quick_enter:[]
+ // const res = await configIndex({
+ // filter: [
+ // {
+ // key: "key",
+ // op: "eq",
+ // value: "dashboard_menus",
+ // },
+ // ],
+ // });
+ // this.usualFlows = this.flows.filter(
+ // (i) => res.data[0]?.value?.indexOf(i.id.toString()) !== -1
+ // );
+ console.log(res,this.usualFlows);
} catch (err) {
console.error(err);
}
@@ -464,6 +528,29 @@ export default {
console.error(err);
}
},
+ openQucik(){
+ this.flows.map(flow => {
+ const isChecked = this.usualFlows.some(usualFlow => usualFlow.id === flow.id);
+ flow.checked = isChecked
+ });
+ this.isShowQuick = true
+ },
+ updatequick(){
+ this.quickLoading = true
+ let arr = this.flows.filter((i)=> i.checked===true)
+ saveMyself({
+ quick_enter:arr
+ }).then(res=>{
+ this.$message({
+ type: 'success',
+ message: '更改成功!'
+ })
+ this.isShowQuick = false
+ this.quickLoading = false
+ this.getUsualFlows()
+ })
+
+ },
async getTotal() {
try {
const res = await axios.get(`${process.env.VUE_APP_BASE_API}/api/oa/statistics/notifications`,{
@@ -667,6 +754,9 @@ $btn-colors: linear-gradient(90deg, #d4bbfd 0%, #af7bff 100%),
font-weight: bold;
padding-left: 20px;
position: relative;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
&::before {
content: "";
@@ -815,6 +905,8 @@ $btn-colors: linear-gradient(90deg, #d4bbfd 0%, #af7bff 100%),
font-size: 14px;
padding-top: 20px;
text-align: center;
+ width: 100%;
+ height: 40px;
}
}
}