Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f3c62496
authored
Apr 13, 2023
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码生成,支持设置前端的模版
parent
ebbf47f5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
25 deletions
+41
-25
src/utils/dict.ts
+2
-1
src/views/infra/codegen/PreviewCode.vue
+1
-1
src/views/infra/codegen/components/GenerateInfoForm.vue
+35
-21
src/views/system/dict/data/DictDataForm.vue
+2
-1
src/views/system/dict/data/index.vue
+1
-1
No files found.
src/utils/dict.ts
View file @
f3c62496
...
...
@@ -21,7 +21,7 @@ export interface DictDataType {
}
export
const
getDictOptions
=
(
dictType
:
string
)
=>
{
return
dictStore
.
getDictByType
(
dictType
)
return
dictStore
.
getDictByType
(
dictType
)
||
[]
}
export
const
getIntDictOptions
=
(
dictType
:
string
)
=>
{
...
...
@@ -117,6 +117,7 @@ export enum DICT_TYPE {
INFRA_API_ERROR_LOG_PROCESS_STATUS
=
'infra_api_error_log_process_status'
,
INFRA_CONFIG_TYPE
=
'infra_config_type'
,
INFRA_CODEGEN_TEMPLATE_TYPE
=
'infra_codegen_template_type'
,
INFRA_CODEGEN_FRONT_TYPE
=
'infra_codegen_front_type'
,
INFRA_CODEGEN_SCENE
=
'infra_codegen_scene'
,
INFRA_FILE_STORAGE
=
'infra_file_storage'
,
...
...
src/views/infra/codegen/PreviewCode.vue
View file @
f3c62496
...
...
@@ -15,7 +15,7 @@
v-loading=
"loading"
element-loading-text=
"生成文件目录中..."
>
<el-scrollbar
height=
"calc(100vh - 88px - 40px
- 50px
)"
>
<el-scrollbar
height=
"calc(100vh - 88px - 40px)"
>
<el-tree
ref=
"treeRef"
node-key=
"id"
...
...
src/views/infra/codegen/components/GenerateInfoForm.vue
View file @
f3c62496
...
...
@@ -14,6 +14,19 @@
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
prop=
"frontType"
label=
"前端类型"
>
<el-select
v-model=
"formData.frontType"
>
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.INFRA_CODEGEN_FRONT_TYPE)"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
prop=
"scene"
label=
"生成场景"
>
<el-select
v-model=
"formData.scene"
>
<el-option
...
...
@@ -25,6 +38,26 @@
</el-select>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item>
<template
#
label
>
<span>
上级菜单
<el-tooltip
content=
"分配到指定菜单下,例如 系统管理"
placement=
"top"
>
<Icon
icon=
"ep:question-filled"
/>
</el-tooltip>
</span>
</
template
>
<el-tree-select
v-model=
"formData.parentMenuId"
placeholder=
"请选择系统菜单"
node-key=
"id"
check-strictly
:data=
"menus"
:props=
"menuTreeProps"
/>
</el-form-item>
</el-col>
<!-- <el-col :span="12">-->
<!-- <el-form-item prop="packageName">-->
...
...
@@ -115,27 +148,6 @@
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item>
<
template
#
label
>
<span>
上级菜单
<el-tooltip
content=
"分配到指定菜单下,例如 系统管理"
placement=
"top"
>
<Icon
icon=
"ep:question-filled"
/>
</el-tooltip>
</span>
</
template
>
<el-tree-select
v-model=
"formData.parentMenuId"
placeholder=
"请选择系统菜单"
node-key=
"id"
check-strictly
:data=
"menus"
:props=
"menuTreeProps"
/>
</el-form-item>
</el-col>
<el-col
:span=
"24"
v-if=
"formData.genType === '1'"
>
<el-form-item
prop=
"genPath"
>
<
template
#
label
>
...
...
@@ -297,6 +309,7 @@ const props = defineProps({
const
formRef
=
ref
()
const
formData
=
ref
({
templateType
:
null
,
frontType
:
null
,
scene
:
null
,
moduleName
:
''
,
businessName
:
''
,
...
...
@@ -315,6 +328,7 @@ const formData = ref({
const
rules
=
reactive
({
templateType
:
[
required
],
frontType
:
[
required
],
scene
:
[
required
],
moduleName
:
[
required
],
businessName
:
[
required
],
...
...
src/views/system/dict/data/DictDataForm.vue
View file @
f3c62496
...
...
@@ -115,11 +115,12 @@ const colorTypeOptions = readonly([
])
/** 打开弹窗 */
const
open
=
async
(
type
:
string
,
id
?:
number
)
=>
{
const
open
=
async
(
type
:
string
,
id
?:
number
,
dictType
?:
string
)
=>
{
dialogVisible
.
value
=
true
dialogTitle
.
value
=
t
(
'action.'
+
type
)
formType
.
value
=
type
resetForm
()
formData
.
value
.
dictType
=
dictType
// 修改时,设置数据
if
(
id
)
{
formLoading
.
value
=
true
...
...
src/views/system/dict/data/index.vue
View file @
f3c62496
...
...
@@ -167,7 +167,7 @@ const resetQuery = () => {
/** 添加/修改操作 */
const
formRef
=
ref
()
const
openForm
=
(
type
:
string
,
id
?:
number
)
=>
{
formRef
.
value
.
open
(
type
,
id
)
formRef
.
value
.
open
(
type
,
id
,
queryParams
.
dictType
)
}
/** 删除按钮操作 */
...
...
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