Pārlūkot izejas kodu

资料进度修改

duy 1 mēnesi atpakaļ
vecāks
revīzija
65f72f37d1
1 mainītis faili ar 35 papildinājumiem un 6 dzēšanām
  1. 35 6
      src/views/schedule/data.vue

+ 35 - 6
src/views/schedule/data.vue

@@ -5,13 +5,13 @@
         </div>
        
         <div v-loading="isProcessLoading" class="hc-round-chart mt-14px flex">
-            <div class="open-btn">
+            <div class="open-btn" @click="toggleShowAll">
                 <el-link type="primary">
-                    <HcIcon name="arrow-right-s" />
+                    <HcIcon :name="isShowAll ? 'arrow-left-s' : 'arrow-right-s'" />
                 </el-link>
             </div>
             <el-row :gutter="30" class="flex-1">
-                <template v-for="(item, index) in processMaterialList" :key="index">
+                <template v-for="(item, index) in filteredProcessList" :key="index">
                     <el-col :span="isProcessSpan">
                         <div class="hc-round-chart-card-box position-relative">
                             <div class="hc-card-content-box">
@@ -20,7 +20,8 @@
                                     <div class="eye-icon-container pos-absolute">
                                         <HcTooltip keys="schedule-data-hide">
                                             <el-link type="warning" @click="hideData(item)">
-                                                <HcIcon name="eye-off" />
+                                                <HcIcon v-if="item.isHide === 0" name="eye-off" />
+                                                <HcIcon v-else name="eye" />
                                             </el-link>
                                         </HcTooltip>
                                     </div>
@@ -100,7 +101,7 @@
 </template>
 
 <script setup>
-import { onActivated, ref } from 'vue'
+import { computed, onActivated, ref } from 'vue'
 import { useRouter } from 'vue-router'
 import { useAppStore } from '~src/store'
 import { getArrValue, useClick } from 'js-fast-way'
@@ -250,6 +251,8 @@ const toTableClick = () => {
 }
 const hideLoad = ref(false)
 const hideData = async (item)=>{
+    console.log(item, 'item')
+    
         hideLoad.value = true
    
     
@@ -257,7 +260,7 @@ const hideData = async (item)=>{
        hideType:item.hideType,
         contractId: contractId.value,
         classifyType: contractTypeTabKey.value ?? '1',
-        type:1,
+        type:item.isHide === 0 ? 1 : 0,
     })
     //处理数据
     hideLoad.value = false
@@ -266,6 +269,31 @@ const hideData = async (item)=>{
         queryMaterialProgress()
     }
 }
+
+// 新增一个控制是否显示所有卡片的变量
+const isShowAll = ref(false)
+
+// 切换显示所有/仅显示未隐藏卡片
+const toggleShowAll = () => {
+    isShowAll.value = !isShowAll.value
+}
+
+
+// 根据显示状态过滤并排序卡片列表
+const filteredProcessList = computed(() => {
+  if (isShowAll.value) {
+    // 显示所有卡片时,先排isHide===0的,再排其他
+    return [...processMaterialList.value].sort((a, b) => {
+      // 核心排序逻辑:isHide为0的排在前面
+      if (a.isHide === 1 && b.isHide !== 1) return -1
+      if (a.isHide !== 1 && b.isHide === 1) return 1
+      return 0 // 状态相同则保持原有顺序
+    })
+  } else {
+    // 仅显示未隐藏卡片(本身已经都是isHide===0,无需排序)
+    return processMaterialList.value.filter(item => item.isHide === 0)
+  }
+})
 </script>
 
 <style lang="scss" scoped>
@@ -298,6 +326,7 @@ const hideData = async (item)=>{
     margin-right: 8px;
     display: flex;
     align-items: center;
+    cursor: pointer;
 }
 @import "../../styles/schedule/hc-data.scss";
 </style>