瀏覽代碼

fix: 1、修复tab页多个重复问题;2、修复首页日志显示不对问题

qiny 1 年之前
父節點
當前提交
ef07b3496d

+ 2 - 1
client/src/views/OaSystem/home/components/daily/index.vue

@@ -56,7 +56,8 @@ onMounted(async () => {
   const logList = await http.getLogList('daily')
   logList.map((item: any) => {
     const date = item.reportStartDate
-    logObj.value[date] = item
+    const dateKey = moment(date).format('YYYY-MM-DD')
+    logObj.value[dateKey] = item
   })
 
   // 订阅点击更多事件

+ 2 - 2
client/src/views/OaSystem/marketCenter/khglPage/CustomerTable.vue

@@ -142,8 +142,8 @@ const newCustomer = (isAdd: boolean, row?) => {
   const params = !isAdd
     ? `/editCustomer?id=${row.id}&edit=true`
     : row
-    ? `/newCustomer?id=${row.id}`
-    : '/newCustomer'
+      ? `/newCustomer?id=${row.id}`
+      : '/newCustomer'
   push(params)
 }
 // 查看客户详情

+ 13 - 4
client/src/views/OaSystem/oaLayout/tagList.vue

@@ -237,11 +237,19 @@ const closeRightTags = () => {
 
 // 新增tag
 const addTags = () => {
-  const { name } = unref(currentRoute)
+  const { name, path } = unref(currentRoute)
   if (name) {
-    selectedTag.value = unref(currentRoute)
-    tagsViewStore.addView(unref(currentRoute))
-    tagsViewStore.addCachedView()
+    // 检查当前路由路径是否已经存在
+    const existingTagIndex = unref(visitedViews).findIndex((view) => view.path === path)
+    if (existingTagIndex !== -1) {
+      // 如果存在相同路径的标签,更新该标签
+      tagsViewStore.visitedViews[existingTagIndex] = unref(currentRoute)
+    } else {
+      // 如果不存在相同路径的标签,添加新标签
+      selectedTag.value = unref(currentRoute)
+      tagsViewStore.addView(unref(currentRoute))
+      tagsViewStore.addCachedView()
+    }
   }
   nextTick(() => {
     // 当前选择路由滚入视野
@@ -253,6 +261,7 @@ const addTags = () => {
   })
   return false
 }
+
 //订阅流程中关闭message事件
 subscribe.on('closeCurrentView', () => {
   const view = vueRouter.currentRoute.value as RouteLocationNormalizedLoaded