Browse Source

按日期排序

duy 2 tháng trước cách đây
mục cha
commit
2a8820d744
2 tập tin đã thay đổi với 25 bổ sung0 xóa
  1. 9 0
      src/api/modules/archiveFile/archiveFile.js
  2. 16 0
      src/views/file/collection.vue

+ 9 - 0
src/api/modules/archiveFile/archiveFile.js

@@ -97,4 +97,13 @@ export default {
             params: form,
         }, msg)
       },
+
+  //按日期排序
+    async sortByFileTime(form, msg = true) {
+        return HcApi({
+            url: '/api/blade-business/archiveFile/sortByFileTime',
+            method: 'post',
+            data: form,
+        }, msg)
+    },
 }

+ 16 - 0
src/views/file/collection.vue

@@ -36,6 +36,7 @@
                 <el-button :disabled="tableCheckedKeys.length <= 0" :loading="onlineLoading" color="#e03997" hc-btn @click="batchOnline">在线验签</el-button>
             </template>
             <template #extra>
+                <el-button hc-btn class="mr-1" type="success" @click="dateClick">按日期排序</el-button>
                 <HcTooltip keys="file_collection_btn_moves">
                     <el-button color="#626aef" hc-btn @click="movesClick">跨目录移动</el-button>
                 </HcTooltip>
@@ -1797,6 +1798,21 @@ const getTableFileTime = (time) => {
     if (isNullES(time)) return ''
     return time.replace(/-/g, '')
 }
+//按日期排序
+const dateClick = async () => {
+   let id = nodeIds.value
+   if (!id) {
+       window.$message?.warning('请先选择节点')
+       return
+   }
+    const { error, code, msg, data } = await archiveFileApi.sortByFileTime({
+        nodeId: id,
+    })
+    if (!error && code === 200) {
+        window.$message?.success('msg')
+        window?.location?.reload() //刷新页面
+    } 
+}
 </script>
 
 <style lang="scss">