<template>
  <div>
    <FileList />
  </div>
</template>
<script>
import FileList from "@/components/file/FileList.vue";
import { fileTypeConstant } from "@/constants";
const { MY_CREATE } = fileTypeConstant;
export default {
  components: {
    FileList,
  },
  data() {
    return {
      isInit: false,
    };
  },
  mounted() {
    this.isInit = false;
    // 读取当前的查询参数
    const currentQueryParams = this.$route.query;

    // 修改查询参数，例如，给 "filePath" 参数设置新的值
    const newFileType = MY_CREATE.code;
    const newFilePath = MY_CREATE.path;
    const newQueryParams = {
      ...currentQueryParams,
      fileType: newFileType,
      filePath: newFilePath,
    };

    // 使用 this.$router.push() 导航到当前路由，并传递新的查询参数
    this.$router.push({ query: newQueryParams });
    this.isInit = true;
  },
};
</script>
