Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
schbrain-archetype-initializer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tools
schbrain-archetype-initializer
Commits
da6c9328
Commit
da6c9328
authored
Apr 11, 2022
by
liaozan
🏀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: fileContent preview with highlight+1
parent
18e95dce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
initializer-ui/src/components/starter.vue
initializer-ui/src/components/starter.vue
+5
-2
No files found.
initializer-ui/src/components/starter.vue
View file @
da6c9328
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
<a-modal
v-model:visible=
"contentPreviewVisible"
:footer=
"null"
title=
"文件内容预览"
width=
"1000px"
>
<a-modal
v-model:visible=
"contentPreviewVisible"
:footer=
"null"
title=
"文件内容预览"
width=
"1000px"
>
<!--suppress HtmlUnknownTag -->
<!--suppress HtmlUnknownTag -->
<highlightjs
:
code=
"fileContent"
autodetect
></highlightjs>
<highlightjs
:
autodetect=
"false"
:code=
"fileContent"
:language=
"fileExtension"
></highlightjs>
</a-modal>
</a-modal>
</div>
</div>
</
template
>
</
template
>
...
@@ -40,6 +40,7 @@ import type {TreeProps} from 'ant-design-vue';
...
@@ -40,6 +40,7 @@ import type {TreeProps} from 'ant-design-vue';
import
{
FormInstance
,
message
}
from
"
ant-design-vue
"
;
import
{
FormInstance
,
message
}
from
"
ant-design-vue
"
;
import
request
,
{
isLoading
}
from
"
../utils/request
"
;
import
request
,
{
isLoading
}
from
"
../utils/request
"
;
import
BaseResponse
from
"
../models/BaseResponse
"
;
import
BaseResponse
from
"
../models/BaseResponse
"
;
import
{
TreeDataNode
}
from
"
ant-design-vue/es/vc-tree-select/interface
"
;
interface
FormState
{
interface
FormState
{
groupId
:
string
,
groupId
:
string
,
...
@@ -61,6 +62,7 @@ const id = ref(-1)
...
@@ -61,6 +62,7 @@ const id = ref(-1)
const
structPreviewVisible
=
ref
(
false
)
const
structPreviewVisible
=
ref
(
false
)
const
contentPreviewVisible
=
ref
(
false
)
const
contentPreviewVisible
=
ref
(
false
)
const
fileContent
=
ref
<
string
|
null
>
()
const
fileContent
=
ref
<
string
|
null
>
()
const
fileExtension
=
ref
<
string
|
null
>
()
const
loading
=
computed
(()
=>
isLoading
.
value
)
const
loading
=
computed
(()
=>
isLoading
.
value
)
const
downloadForm
=
ref
<
FormInstance
>
();
const
downloadForm
=
ref
<
FormInstance
>
();
...
@@ -104,9 +106,10 @@ const onDownload = async (id: number) => {
...
@@ -104,9 +106,10 @@ const onDownload = async (id: number) => {
downloadGeneratedProject
(
data
,
fileName
)
downloadGeneratedProject
(
data
,
fileName
)
}
}
const
onSelect
=
async
(
selectedKeys
:
string
[],
event
:
{
node
:
File
Node
})
=>
{
const
onSelect
=
async
(
selectedKeys
:
string
[],
event
:
{
node
:
TreeData
Node
})
=>
{
const
{
node
}
=
event
const
{
node
}
=
event
fileContent
.
value
=
node
.
fileContent
fileContent
.
value
=
node
.
fileContent
fileExtension
.
value
=
node
.
title
.
substring
(
node
.
title
.
lastIndexOf
(
'
.
'
)
+
1
)
contentPreviewVisible
.
value
=
true
contentPreviewVisible
.
value
=
true
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment