From da6c93287db9469c8bd20e275088b31e6b1e9939 Mon Sep 17 00:00:00 2001
From: liaozan <378024053@qq.com>
Date: Mon, 11 Apr 2022 22:00:19 +0800
Subject: [PATCH] feat: fileContent preview with highlight+1
---
initializer-ui/src/components/starter.vue | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/initializer-ui/src/components/starter.vue b/initializer-ui/src/components/starter.vue
index 0a8aa96..16dfbfa 100644
--- a/initializer-ui/src/components/starter.vue
+++ b/initializer-ui/src/components/starter.vue
@@ -29,7 +29,7 @@
-
+
@@ -40,6 +40,7 @@ import type {TreeProps} from 'ant-design-vue';
import {FormInstance, message} from "ant-design-vue";
import request, {isLoading} from "../utils/request";
import BaseResponse from "../models/BaseResponse";
+import {TreeDataNode} from "ant-design-vue/es/vc-tree-select/interface";
interface FormState {
groupId: string,
@@ -61,6 +62,7 @@ const id = ref(-1)
const structPreviewVisible = ref(false)
const contentPreviewVisible = ref(false)
const fileContent = ref()
+const fileExtension = ref()
const loading = computed(() => isLoading.value)
const downloadForm = ref();
@@ -104,9 +106,10 @@ const onDownload = async (id: number) => {
downloadGeneratedProject(data, fileName)
}
-const onSelect = async (selectedKeys: string[], event: { node: FileNode }) => {
+const onSelect = async (selectedKeys: string[], event: { node: TreeDataNode }) => {
const {node} = event
fileContent.value = node.fileContent
+ fileExtension.value = node.title.substring(node.title.lastIndexOf('.') + 1)
contentPreviewVisible.value = true
}
--
GitLab