From 0ef8178b95e45ac2f5f29e3d1b3576f48e6cf588 Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Mon, 21 Jul 2025 16:44:59 +0800
Subject: [PATCH] feat:个人工作台调整
---
src/views/wel/components/backlog.vue | 55 +++++++++++++++++++++++++++++++++++--------------------
1 files changed, 35 insertions(+), 20 deletions(-)
diff --git a/src/views/wel/components/backlog.vue b/src/views/wel/components/backlog.vue
index 19ad663..9c52e74 100644
--- a/src/views/wel/components/backlog.vue
+++ b/src/views/wel/components/backlog.vue
@@ -9,13 +9,13 @@
<div>
{{ item.name }}
<div class="dots">{{ item.number >= 100 ? '99+' : item.number }}</div>
- <!-- <div class="dots">99+</div> -->
+
</div>
</div>
</div>
</div>
- <div class="todo-items" v-if="todos.length > 0" v-loading="loading">
+ <div class="todo-items" v-if="todos.length > 0" v-loading="loading" element-loading-background="rgba(255, 255, 255, 0.5)">
<div v-for="(item, index) in todos" :key="index" class="todo-item" :style="getStatusStyle(item.status)"
@click="jumporder(item)">
<div class="status-indicator"><img :src="getStatus(item.status)" alt=""></div>
@@ -65,6 +65,10 @@
const store = useStore()
const permission = computed(() => store.getters.permission)
const checked = ref('事件工单')
+const todosCache = reactive({
+ '事件工单': [],
+ '智飞工单': []
+})
const titleList = ref([
{
label: 'event_order_count',
@@ -77,11 +81,11 @@
number: 0,
},
])
-const titleClick = (item, index) => {
- checked.value = item.name
- getListMatter()
-}
+const titleClick = async (item, index) => {
+ checked.value = item.name
+ await getListMatter()
+}
const userInfo = computed(() => store.getters.userInfo)
const todos = ref([])
const loading = ref(false)
@@ -203,24 +207,25 @@
})
}
// 获取事件工单或者智飞工单的信息
+
const getListMatter = async () => {
- if (checked.value === '事件工单') {
- loading.value = true
- const type = 1
+ loading.value = true
+ const type = checked.value === '事件工单' ? 1 : 2
+
+ // 使用缓存数据
+ if (todosCache[checked.value].length > 0) {
+ todos.value = todosCache[checked.value]
+ }
+
+ try {
const res = await getOrderOrEventApi(type, userInfo.value.detail.areaCode)
- todos.value = res.data.data || []
+ const data = res.data.data || []
+ todos.value = data
+ todosCache[checked.value] = data
+ } finally {
loading.value = false
- // console.log('事件工单', todos.value);
- } else if (checked.value === '智飞工单') {
- loading.value = true
- const type = 2
- const res = await getOrderOrEventApi(type, userInfo.value.detail.areaCode)
- todos.value = res.data.data || []
- loading.value = false
- // console.log('智飞工单', todos.value);
}
}
-
onMounted(() => {
getListMatter()
getOrderCount()
@@ -313,12 +318,19 @@
.todo-items {
margin-top: 10px;
- // height: 250px;
+ transition: opacity 0.3s ease;
height: pxToVh(250);
overflow-y: scroll;
+ &:empty {
+ display: none;
+ }
}
.todo-item {
+ transition:
+ transform 0.2s ease,
+ box-shadow 0.2s ease,
+ opacity 0.3s ease;
margin: 6px 0;
display: flex;
align-items: center;
@@ -415,5 +427,8 @@
font-size: 14px;
color: #7c8091;
}
+ .el-empty {
+ transition: opacity 0.3s ease;
+}
}
</style>
--
Gitblit v1.9.3