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
df7991a6
Commit
df7991a6
authored
Nov 24, 2022
by
liaozan
🏀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change groupId component from input to select to limit the groupId
parent
6f93b455
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
8 deletions
+32
-8
initializer-ui/package.json
initializer-ui/package.json
+4
-4
initializer-ui/src/components/starter.vue
initializer-ui/src/components/starter.vue
+28
-3
initializer-ui/src/utils/request.ts
initializer-ui/src/utils/request.ts
+0
-1
No files found.
initializer-ui/package.json
View file @
df7991a6
...
...
@@ -6,16 +6,16 @@
"build"
:
"vite build --mode production"
},
"dependencies"
:
{
"vue"
:
"^3.2.4
4
"
,
"axios"
:
"^1.
1.3
"
,
"vue"
:
"^3.2.4
5
"
,
"axios"
:
"^1.
2.0
"
,
"ant-design-vue"
:
"^3.2.15"
,
"highlight.js"
:
"^11.6.0"
,
"@highlightjs/vue-plugin"
:
"^2.1.0"
},
"devDependencies"
:
{
"@vitejs/plugin-vue"
:
"^3.2.0"
,
"typescript"
:
"^4.
8.4
"
,
"vite"
:
"^3.2.
3
"
,
"typescript"
:
"^4.
9.3
"
,
"vite"
:
"^3.2.
4
"
,
"vue-tsc"
:
"^1.0.9"
}
}
\ No newline at end of file
initializer-ui/src/components/starter.vue
View file @
df7991a6
...
...
@@ -4,7 +4,7 @@
<h3
style=
"margin-bottom: 20px"
>
项目初始代码生成
</h3>
<a-form
ref=
"downloadForm"
:labelCol=
"
{span: 6}" :model="formState" :rules="formRules" :wrapperCol="{span: 18}" autocomplete="off" class="form-wrapper">
<a-form-item
has-feedback
label=
"GroupId"
name=
"groupId"
>
<a-
input
v-model:value=
"formState.groupId
"
/>
<a-
select
v-model:value=
"formState.groupId"
:options=
"groupOptions
"
/>
</a-form-item>
<a-form-item
has-feedback
label=
"ArtifactId"
name=
"artifactId"
>
<a-input
v-model:value=
"formState.artifactId"
/>
...
...
@@ -49,6 +49,7 @@
<
script
lang=
"ts"
setup
>
import
{
computed
,
reactive
,
ref
}
from
'
vue
'
import
{
SelectProps
}
from
'
ant-design-vue/es/select
'
;
import
type
{
TreeProps
}
from
'
ant-design-vue
'
;
import
{
FormInstance
,
message
}
from
"
ant-design-vue
"
;
import
request
,
{
isLoading
}
from
"
../utils/request
"
;
...
...
@@ -91,6 +92,22 @@ const fileExtension = ref<string | null>()
const
loading
=
computed
(()
=>
isLoading
.
value
)
const
downloadForm
=
ref
<
FormInstance
>
();
const
groupOptions
=
ref
<
SelectProps
[
'
options
'
]
>
([
{
"
value
"
:
"
com.schbrain.dg
"
,
"
label
"
:
"
com.schbrain.dg
"
},
{
"
value
"
:
"
com.schbrain.kp
"
,
"
label
"
:
"
com.schbrain.kp
"
},
{
"
value
"
:
"
com.schbrain.xb
"
,
"
label
"
:
"
com.schbrain.xb
"
},
])
const
formState
=
reactive
<
FormState
>
({
groupId
:
''
,
artifactId
:
''
,
...
...
@@ -148,7 +165,7 @@ const onPreview = async () => {
const
onDownload
=
async
(
id
:
number
)
=>
{
let
res
=
await
request
.
get
(
`/archetype/download/
${
id
}
`
,
{
responseType
:
'
blob
'
})
const
{
headers
,
data
}
=
res
const
fileName
=
headers
[
'
content-disposition
'
].
replace
(
/
\w
+;
\s
filename="
(
.*
)
"/
,
'
$1
'
)
const
fileName
=
headers
?.[
'
content-disposition
'
]?.
replace
(
/
\w
+;
\s
filename="
(
.*
)
"/
,
'
$1
'
)
||
''
downloadGeneratedProject
(
data
,
fileName
)
}
...
...
@@ -230,6 +247,7 @@ const createGroupTreeData = (groupNodeList: GroupNode[]): any => {
}
</
script
>
<!--suppress CssUnusedSymbol -->
<
style
scoped
>
.start-wrapper
{
width
:
500px
;
...
...
@@ -250,8 +268,15 @@ const createGroupTreeData = (groupNodeList: GroupNode[]): any => {
margin-left
:
10px
;
}
/*noinspection CssUnusedSymbol*/
.ant-input
,
.ant-btn
{
border-radius
:
6px
;
}
:deep
(
.ant-select
:not
(
.ant-select-customize-input
)
.ant-select-selector
)
{
border-radius
:
6px
;
}
.ant-select
{
text-align
:
left
;
}
</
style
>
\ No newline at end of file
initializer-ui/src/utils/request.ts
View file @
df7991a6
...
...
@@ -5,7 +5,6 @@ import {ref} from 'vue'
export
const
isLoading
=
ref
(
false
)
// @ts-ignore
axios
.
defaults
.
baseURL
=
import
.
meta
.
env
.
VITE_APP_BASE_URL
axios
.
interceptors
.
request
.
use
((
config
:
AxiosRequestConfig
)
=>
{
isLoading
.
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