Browse Source

收藏夹修改

duy 4 weeks ago
parent
commit
44d63b5907
4 changed files with 144 additions and 34 deletions
  1. 1 1
      package.json
  2. 1 1
      src/styles/data-fill/wbs.scss
  3. 138 28
      src/views/data-fill/wbs.vue
  4. 4 4
      yarn.lock

+ 1 - 1
package.json

@@ -25,7 +25,7 @@
         "dayjs": "^1.11.13",
         "echarts": "^5.5.1",
         "element-plus": "^2.8.7",
-        "hc-vue3-ui": "^4.9.4",
+        "hc-vue3-ui": "^4.9.5",
         "js-base64": "^3.7.7",
         "js-fast-way": "^0.5.7",
         "js-md5": "^0.8.3",

+ 1 - 1
src/styles/data-fill/wbs.scss

@@ -241,7 +241,7 @@
                 .hc-tree-box {
                     position: relative;
                     padding: 15px 20px;
-                    height: calc(100% - 220px);
+                    height: calc(100% - 200px);
               
                     .hc-tree-back-to {
                         font-size: 12px;

+ 138 - 28
src/views/data-fill/wbs.vue

@@ -83,12 +83,12 @@
                                 <HcIcon name="star-half" class="mr-3 cursor-pointer" style="color:rgb(255, 125, 67);" title="文件收藏夹" @click="collectListClick" />
                             </el-tooltip>
                             <template v-if="classType === '1'">
-                                <HcIcon v-if="isLookHide" name="eye-off" style="color:#3F9EFF" class="cursor-pointer" @click="lookHideList" />
-                                <HcIcon v-else name="eye" style="color:#3F9EFF" class="cursor-pointer" @click="handleClickBack" />
+                                <HcIcon v-if="isLookHide" name="eye-off" style="color:#3F9EFF" class="cursor-pointer" title="隐藏夹" @click="lookHideList" />
+                                <HcIcon v-else name="eye" style="color:#3F9EFF" class="cursor-pointer" title="显示全部节点" @click="handleClickBack" />
                             </template>
                         </div>
                         <div>
-                            <HcIcon v-loading="lookLoading" name="time" class="mr-3 cursor-pointer" style="color:#3F9EFF" @click="lookHistory" />
+                            <HcIcon v-loading="lookLoading" name="time" class="mr-3 cursor-pointer" style="color:#3F9EFF" title="近五天填报记录" @click="lookHistory" />
                             <HcIcon name="article" style="color:gray" class="cursor-pointer" />
                         </div>
                     </div>
@@ -107,8 +107,8 @@
                                 </el-link>
                             </div>
                             <div
-                                class="back-button"
-                                :class="{ scaling: isScaling }"
+                                v-if="isSearchTree"
+                                class="back-button animate-pulse"
                                 @click="handleClick"
                             >
                                 <HcIcon name="arrow-go-back" style="color:#FF7D43" class="cursor-pointer text-18px font-700" />
@@ -1477,13 +1477,15 @@
             </el-form>
         </hc-new-dialog>
         <!-- 添加到收藏夹 -->
-        <hc-new-dialog
+        <!-- <hc-new-dialog
             v-model="collectDialog"
             title="添加到文件夹"
+            widths="20rem"
           
             is-footer-center
             :loading="saveCollectLoad"
             :footer="collectList.length > 0"
+            ui="collectModalStyle"
             @close="collectModalClose"
             @save="collectModalSave"
         >
@@ -1500,7 +1502,46 @@
                 </el-form-item>
             </el-form>
             <el-alert v-else title="请先创建文件夹" type="warning" :closable="false" />
-        </hc-new-dialog>
+        </hc-new-dialog> -->
+        
+        <div 
+            v-if="collectDialog" 
+            class="collect-modal collectModalStyle"
+            :style="{
+                left: `${collectDialogPosition?.left}px`,
+                top: `${collectDialogPosition?.top}px`,
+                display: collectDialog ? 'block' : 'none',
+            }"
+        >
+            <!-- 模态框头部 -->
+            <div class="collect-modal-header">
+                <h3>添加到文件夹</h3>
+                <button class="close-btn" @click="collectModalClose">×</button>
+            </div>
+    
+            <!-- 模态框内容 -->
+            <div class="collect-modal-body">
+                <el-form
+                    v-if="collectList.length > 0"
+                    ref="collectFormRef"
+                    :model="collectForm"
+                    :rules="collectRules"
+                >
+                    <el-form-item label="文件夹" prop="id">
+                        <el-select v-model="collectForm.id" v-loading="collectLoad" placeholder="请选择" clearable @change="checkCollect">
+                            <el-option v-for="item in collectList" :key="item.id" :label="item.name" :value="item.id" />
+                        </el-select>
+                    </el-form-item>
+                </el-form>
+                <el-alert v-else title="请先创建文件夹" type="warning" :closable="false" />
+            </div>
+    
+            <!-- 模态框底部 -->
+            <div v-if="collectList.length > 0" class="collect-modal-footer">
+                <el-button @click="collectModalClose">取消</el-button>
+                <el-button type="primary" :loading="saveCollectLoad" @click="collectModalSave">确定</el-button>
+            </div>
+        </div>
         <JumpTreeDialog
             v-model="moveDialogShow"
             :contract-id="contractId"
@@ -3941,15 +3982,32 @@ const handleClick = () => {
 
 
 //收藏
+
 const collectTreeData = ref({})
-const collectClick = async (data)=>{
+const collectDialogPosition = ref(null)
+const collectClick = async (data, position)=>{
     collectTreeData.value = data
+    collectDialogPosition.value = position
+
 
     if (data.isCollect === 0) {
         
      collectDialog.value = true
      await nextTick()
+    // 获取元素
+const modal = document.querySelector('.collectModalStyle')
 
+// 动态设置位置
+if (modal && collectDialogPosition) {
+
+    
+  modal.style.left = collectDialogPosition.value.left
+  modal.style.top = collectDialogPosition.value.top
+  modal.style.position = 'fixed' 
+    modal.style.transform = 'translateY(0) translateX(0)' // 重置transform,防止位置偏移
+
+    
+}
      getCollectList()
     } else {
         console.log('取消收藏')
@@ -3970,7 +4028,7 @@ const collectModalCancel = async ()=>{
         false,
     )
     if (!error && code === 200) {
-        window?.$message?.success(msg)
+        // window?.$message?.success(msg)
          collectTreeData.value.isCollect = 0
 
         
@@ -4220,17 +4278,16 @@ const hideTreeNode = async (data) => {
         {
             ids: data['primaryKeyId'],
             // status: 2,
-            status:isLookHide.value ? 2 : 0,
+            status:data.isBussShow == 2 ? 0 : 2, //2隐藏 0显示
         },
         false,
     )
     hideSaveLoading.value = false
     if (!error && code === 200) {
-        window?.$message?.success(msg || '操作成功')
-        setTimeout(() => {
-            window?.location?.reload() //刷新页面
-        }, 1000)
-    } 
+
+        data.isBussShow = data.isBussShow == 2 ? 0 : 2
+        
+    }
 }
 const isLookHide = ref(true)
 const handleClickBack = ()=>{
@@ -4258,20 +4315,9 @@ const lookHideList = ()=>{
 <style lang="scss" scoped>
 @import "../../styles/data-fill/wbs.scss";
 
-.back-button {
-  /* 确保按钮有足够的空间来展示放大效果 */
-  padding: 4px;
-  /* 过渡效果:所有属性变化在300ms内完成,使用ease-out缓动函数 */
-  transition: all 300ms ease-out;
-  /* 防止放大时内容溢出 */
-  overflow: hidden;
-}
 
-/* 缩放状态的样式 */
-.back-button.scaling {
-  /* 放大到1.2倍 */
-  transform: scale(1.2);
-}
+
+
 .hc-project-box{
     display: flex;
     justify-content: space-between;
@@ -4482,6 +4528,24 @@ html.theme-dark {
 </style>
 
 <style lang="scss" scoped>
+/* 由小变大的脉动动画效果 */
+.animate-pulse {
+    /* 保持动画持续运行 */
+    animation: pulse 1.5s ease-in-out infinite;
+    /* 确保图标变换时不会超出容器 */
+    transform-origin: center;
+}
+
+@keyframes pulse {
+    0%, 100% {
+        /* 原始大小 */
+        transform: scale(1);
+    }
+    50% {
+        /* 放大到1.2倍 */
+        transform: scale(1.2);
+    }
+}
 .hc-tree-back-to{
     display: flex;
     justify-content: space-between;
@@ -4643,3 +4707,49 @@ html.theme-dark {
   border-radius: 3px;
 }
 </style>
+
+<style scoped>
+.collect-modal {
+    position: fixed;
+    width: 20rem;
+    background: #fff;
+    border-radius: 4px;
+    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+    z-index: 1000;
+    transform: translateY(0) translateX(0);
+}
+
+.collect-modal-header {
+    padding: 15px 20px;
+    border-bottom: 1px solid #e5e5e5;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+}
+
+.collect-modal-header h3 {
+    margin: 0;
+    font-size: 16px;
+    font-weight: 500;
+}
+
+.close-btn {
+    background: transparent;
+    border: none;
+    font-size: 18px;
+    cursor: pointer;
+    color: #909399;
+}
+
+.collect-modal-body {
+    padding: 20px;
+}
+
+.collect-modal-footer {
+    padding: 10px 20px 15px;
+    border-top: 1px solid #e5e5e5;
+    display: flex;
+    justify-content: center;
+    gap: 10px;
+}
+</style>

+ 4 - 4
yarn.lock

@@ -2109,10 +2109,10 @@ has-flag@^4.0.0:
   resolved "http://219.151.181.73:9000/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b"
   integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==
 
-hc-vue3-ui@^4.9.4:
-  version "4.9.4"
-  resolved "http://219.151.181.73:9000/hc-vue3-ui/-/hc-vue3-ui-4.9.4.tgz#3be18470892739b2823d5042f6c8cb72637bb443"
-  integrity sha512-zabB5pxGdJOczlFE8oJ+mxifQMsFFIe/iGU+fS2SoAiRTDYbH1zwQA4hcHWsC0ZS/ZPmLI5RAeRe1sSDUSssNw==
+hc-vue3-ui@^4.9.5:
+  version "4.9.5"
+  resolved "http://219.151.181.73:9000/hc-vue3-ui/-/hc-vue3-ui-4.9.5.tgz#5d38549e988caceb5d16094028f7ed799cff2e8f"
+  integrity sha512-DPtgzsufy3Pd1l8lniP3cMY/dWdswwaqRXGy3d6M79alWk8DKnx34dIrYJZt1OPIaurQ+JY338DNsBVzX8ZKDw==
   dependencies:
     axios "^1.7.7"
     dayjs "^1.11.13"