From 2dfc8dc4bcd3d3cd4aed1b6054e073e140eba9c8 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Mon, 19 May 2025 16:05:50 +0800
Subject: [PATCH] Merge branch 'master' into jiangwu
---
src/views/wel/components/backlog.vue | 194 +++++++++++++++++++++++++++++++++---------------
1 files changed, 133 insertions(+), 61 deletions(-)
diff --git a/src/views/wel/components/backlog.vue b/src/views/wel/components/backlog.vue
index e5d24bd..b335f6f 100644
--- a/src/views/wel/components/backlog.vue
+++ b/src/views/wel/components/backlog.vue
@@ -3,28 +3,42 @@
<div class="block">
<div class="title">待办事项</div>
- <div class="todo-items">
+ <div class="todo-items" v-if="todos.length>0">
<div
v-for="(item, index) in todos"
:key="index"
class="todo-item"
- :class="`status-${item.status}`"
- @click="jumporder()"
+ :style="getStatusStyle(item.status)"
+ @click="jumporder(item)"
>
- <div class="status-indicator"></div>
+ <div
+ class="status-indicator"
+ :style="{ backgroundColor: getStatusColor(item.status) }"
+ ></div>
<div class="content-wrapper">
<div class="main-content">
- <span class="status-tag">{{ statusMap[item.status] }}</span>
- <span class="todo-text">{{ item.event_name }}</span>
+ <span class="status-tag" :style="{ color: getStatusColor(item.status) }">{{
+ permission.o_and_m_p_jump === true
+ ? zfstatusMap[item.status]
+ : statusMap[item.status]
+ }}</span>
+ <span class="todo-text">{{ item.name }}</span>
</div>
<div class="action-area">
<img :src="st7" alt="" />
- <span class="todo-date">{{ item.job_create_time?.slice(0,10) }}</span>
+ <span class="todo-date">{{ item.date?.slice(0, 10).replace(/-/g, '.') }}</span>
</div>
</div>
</div>
+ </div>
+ <div v-else>
+ <el-empty >
+ <template #description>
+ <span class="custom-text">暂无数据</span>
+ </template>
+ </el-empty>
</div>
</div>
</div>
@@ -32,29 +46,110 @@
<script setup>
import st7 from '@/assets/images/workbench/st7.png';
-import { getList } from '@/api/tickets/ticket';
+import { getdaiban } from '@/api/home/index';
import { onMounted } from 'vue';
-import { useRouter } from 'vue-router'
+import { useRouter } from 'vue-router';
+import { useStore } from 'vuex';
+const router = useRouter();
+const store = useStore();
+const permission = computed(() => store.getters.permission);
+const userInfo = computed(() => store.getters.userInfo);
const todos = ref([]);
-const router = useRouter()
-const jumporder = () => {
- console.log('tiao');
- router.push({
- path: '/tickets/ticket',
- })
-};
+const loading = ref(false);
const statusMap = {
+ 0: '待处理',
2: '待审核',
3: '处理中',
- 0: '待处理',
- 4: '已完成',
+};
+const statusMapColor = {
+ 0: { color: '#FF7411', background: '#FF7411', borderLeftColor: '#FF7411' },
+ 2: { color: '#FF472F', background: '#FF472F', borderLeftColor: '#FF472F' },
+ 3: { color: '#FFC300', background: '#FFC300', borderLeftColor: '#FFC300' },
+};
+const zfstatusMap = {
+ 1: '待审核',
+};
+const zfstatusMapColor = {
+ 1: { color: '#FF472F', background: '#FF472F', borderLeftColor: '#FF472F' },
+};
+const getStatusStyle = statusIndex => {
+ if (permission.value.o_and_m_p_jump === true) {
+ const style = zfstatusMapColor[statusIndex] || {
+ color: '#999',
+ borderLeftColor: '#999',
+ };
+ return {
+ color: style.color,
+ borderLeft: `3px solid ${style.borderLeftColor}`,
+ };
+ } else {
+ const style = statusMapColor[statusIndex] || {
+ color: '#999',
+ borderLeftColor: '#999',
+ };
+ return {
+ color: style.color,
+ borderLeft: `3px solid ${style.borderLeftColor}`,
+ };
+ }
+};
+// 获取状态对应的文字颜色
+const getStatusColor = statusIndex => {
+ if (permission.value.o_and_m_p_jump === true) {
+ return zfstatusMapColor[statusIndex]?.color || '#999';
+ } else {
+ return statusMapColor[statusIndex]?.color || '#999';
+ }
};
const getListMatter = async () => {
- const res = await getList({});
- todos.value=res.data.data.records?.slice(0,5)
+ loading.value = true;
+ try {
+ if (permission.value.o_and_m_p_jump === true) {
+ const res = await getdaiban(0, userInfo.value.detail.areaCode);
+ todos.value = res.data.data?.slice(0, 5) || [];
+ loading.value = false;
+ } else {
+ const res = await getdaiban(1, userInfo.value.detail.areaCode);
+ todos.value = res.data.data?.slice(0, 5) || [];
+ loading.value = false;
+ }
+ } catch (error) {}
+};
+const isDataReady = computed(() => {
+ return userInfo.value.detail?.areaCode && permission.value.o_and_m_p_jump;
+});
+const autoFetchData = () => {
+ if (isDataReady.value) {
+ getListMatter();
+ }
+};
+watch(
+ () => [userInfo.value.detail?.areaCode, permission.value.o_and_m_p_jump],
+ () => autoFetchData(),
+ { immediate: true }
+);
+
+const jumporder = val => {
+ if (permission.value.o_and_m_p_jump === true) {
+ const id = val.id;
+ router.push({
+ path: `/tickets/orderLog`,
+ query: {
+ id,
+ },
+ });
+ } else {
+ const orderNumber = val.event_num;
+ router.push({
+ path: `/tickets/ticket`,
+ query: {
+ orderNumber,
+ },
+ });
+ }
};
onMounted(() => {
- getListMatter();
+ autoFetchData();
});
</script>
@@ -69,6 +164,7 @@
.block {
margin: 11px 21px 13px 22px;
.title {
+ font-family: 'Source Han Sans CN';
font-weight: bold;
font-size: 16px;
color: #363636;
@@ -76,7 +172,7 @@
.todo-items {
display: grid;
- gap: 0.8rem;
+ gap: 0.6rem;
margin-top: 10px;
}
@@ -143,58 +239,34 @@
}
// 状态颜色方案
- .status-2 {
- border-left-color: #ff6560;
- color: #ff6560;
+ .status-0 {
+ border-left-color: #ff7411;
+ color: #ff7411;
.status-indicator {
- background: #ff6560;
+ background: #ff7411;
}
}
- .status-0 {
- border-left-color: #5d77fb;
- color: #5d77fb;
+ .status-2 {
+ border-left-color: #ff472f;
+ color: #ff472f;
.status-indicator {
- background: #5d77fb;
+ background: #ff472f;
}
}
.status-3 {
- border-left-color: #ff8b26;
- color: #ff8b26;
+ border-left-color: #ffc300;
+ color: #ffc300;
.status-indicator {
- background: #ff8b26;
+ background: #ffc300;
}
}
}
-
- // @media (max-width: 768px) {
- // .todo-list-container {
- // padding: 1rem;
-
- // .content-wrapper {
- // flex-direction: column;
- // align-items: flex-start !important;
- // gap: 0.5rem !important;
- // }
-
- // .action-area {
- // width: 100%;
- // justify-content: space-between;
- // }
- // }
- // }
-
- // @media (max-width: 480px) {
- // .main-content {
- // flex-direction: column;
- // align-items: flex-start !important;
- // }
-
- // .status-tag {
- // margin-bottom: 0.3rem;
- // }
- // }
+ .custom-text {
+ font-size: 14px;
+color: #7C8091;
+ }
}
</style>
--
Gitblit v1.9.3