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

    // 修改查询参数，例如，给 "filePath" 参数设置新的值
    // 10-我的创作 11-模板管理
    const newFileType = TEMPLATE_MANAGE;
    const newFilePath = "/模板管理";
    const newQueryParams = {
      ...currentQueryParams,
      fileType: newFileType,
      filePath: newFilePath,
    };

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