Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
VueElementTemplate
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄瑜
VueElementTemplate
Commits
48158898
Commit
48158898
authored
Mar 05, 2018
by
王康
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
form
parent
baf28444
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
16 deletions
+22
-16
HmComplexForm.md
src/views/haomo/components/forms/HmComplexForm.md
+9
-9
HmComplexForm.vue
src/views/haomo/components/forms/HmComplexForm.vue
+5
-3
hm_org_schema.js
src/views/haomo/schemas/hm_org_schema.js
+8
-4
No files found.
src/views/haomo/components/forms/HmComplexForm.md
View file @
48158898
...
@@ -3,12 +3,12 @@
...
@@ -3,12 +3,12 @@
```
jsx
```
jsx
<
hm
-
complex
-
form
<
hm
-
complex
-
form
:
schema
=
"{
:
schema
=
"{
'model': 'HmUser
2
',
'model': 'HmUser',
'modelPlural': 'HmUser
2
S',
'modelPlural': 'HmUserS',
'modelCamel': 'hmUser
2
',
'modelCamel': 'hmUser',
'modelCamelPlural': 'hmUser
2
S',
'modelCamelPlural': 'hmUserS',
'modelUnderscore': 'hm_user
2
',
'modelUnderscore': 'hm_user',
'modelUnderscorePlural': 'hm_user
2
S',
'modelUnderscorePlural': 'hm_userS',
'columns': [
'columns': [
{
{
'id': 'o50',
'id': 'o50',
...
@@ -214,7 +214,7 @@
...
@@ -214,7 +214,7 @@
'type': 'string'
'type': 'string'
}
}
]
]
}"
>
<
/
hm
-
complex
-
form
>
}"
>
<
/
hm
-
complex
-
form
>
```
```
### 指定显示的表单类型
### 指定显示的表单类型
...
@@ -223,7 +223,7 @@
...
@@ -223,7 +223,7 @@
<div>
<div>
<hm-complex-form
<hm-complex-form
:tableId=
"tableId"
:tableId=
"tableId"
:schema=
"schema['HmUser
2
']"
:schema=
"schema['HmUser']"
:columns=
"showUserColumns"
>
:columns=
"showUserColumns"
>
</hm-complex-form>
</hm-complex-form>
</div>
</div>
...
@@ -231,7 +231,7 @@
...
@@ -231,7 +231,7 @@
<
script
>
<
script
>
export
default
{
export
default
{
name
:
'HmComplexForm'
,
name
:
'HmComplexForm
Index
'
,
data
()
{
data
()
{
return
{
return
{
schema
:
{
schema
:
{
...
...
src/views/haomo/components/forms/HmComplexForm.vue
View file @
48158898
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
v-model=
"formModel[column.codeCamel]"
></el-input>
-->
v-model=
"formModel[column.codeCamel]"
></el-input>
-->
<!-- 富文本 -->
<!-- 富文本 -->
<quill-editor
v-if=
"column.
codeCamel==='securityLevel'"
class=
"editor-example bubble
"
<quill-editor
v-if=
"column.
widgetType==='richText'
"
ref=
"textEditor"
ref=
"textEditor"
v-model=
"formModel[column.codeCamel]"
v-model=
"formModel[column.codeCamel]"
:options=
"editorOption"
:options=
"editorOption"
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
:picker-options=
"pickerOptions"
>
:picker-options=
"pickerOptions"
>
</el-date-picker>
</el-date-picker>
<!-- 下拉框 -->
<!-- 下拉框 -->
<el-select
v-else-if=
"column.
codeCamel === 't
ype'"
v-model=
"formModel[column.codeCamel]"
>
<el-select
v-else-if=
"column.
widgetType === 'selectT
ype'"
v-model=
"formModel[column.codeCamel]"
>
<el-option
v-for=
"item in selectOptions"
<el-option
v-for=
"item in selectOptions"
:key=
"item.value"
:key=
"item.value"
:label=
"item.label"
:label=
"item.label"
...
@@ -39,11 +39,13 @@
...
@@ -39,11 +39,13 @@
</el-option>
</el-option>
</el-select>
</el-select>
<!-- 文本域 -->
<!-- 文本域 -->
<el-input
v-else-if=
"column.
codeCamel === 'departmentId
'"
v-model=
"formModel[column.codeCamel]"
<el-input
v-else-if=
"column.
widgetType === 'textarea
'"
v-model=
"formModel[column.codeCamel]"
type=
"textarea"
type=
"textarea"
:autosize=
"
{ minRows: 2, maxRows: 5}"
:autosize=
"
{ minRows: 2, maxRows: 5}"
:rows="2">
:rows="2">
</el-input>
</el-input>
<!-- 复选框 -->
<el-checkbox
v-else-if=
"column.widgetType === 'checkbox'"
v-model=
"formModel[column.codeCamel]"
></el-checkbox>
<!-- 普通input -->
<!-- 普通input -->
<el-input
v-else
v-model=
"formModel[column.codeCamel]"
></el-input>
<el-input
v-else
v-model=
"formModel[column.codeCamel]"
></el-input>
</el-form-item>
</el-form-item>
...
...
src/views/haomo/schemas/hm_org_schema.js
View file @
48158898
...
@@ -2981,7 +2981,8 @@ const ModelSchema = {
...
@@ -2981,7 +2981,8 @@ const ModelSchema = {
'codeCamelPlural'
:
'avatars'
,
'codeCamelPlural'
:
'avatars'
,
'codeUnderscore'
:
'avatar'
,
'codeUnderscore'
:
'avatar'
,
'codeUnderscorePlural'
:
'avatars'
,
'codeUnderscorePlural'
:
'avatars'
,
'type'
:
'string'
'type'
:
'string'
,
'widgetType'
:
'checkbox'
},
},
{
{
'id'
:
'o335'
,
'id'
:
'o335'
,
...
@@ -3045,7 +3046,8 @@ const ModelSchema = {
...
@@ -3045,7 +3046,8 @@ const ModelSchema = {
'codeCamelPlural'
:
'securityLevels'
,
'codeCamelPlural'
:
'securityLevels'
,
'codeUnderscore'
:
'security_level'
,
'codeUnderscore'
:
'security_level'
,
'codeUnderscorePlural'
:
'security_levels'
,
'codeUnderscorePlural'
:
'security_levels'
,
'type'
:
'number'
'type'
:
'number'
,
'widgetType'
:
'richText'
},
},
{
{
'id'
:
'o339'
,
'id'
:
'o339'
,
...
@@ -3062,7 +3064,8 @@ const ModelSchema = {
...
@@ -3062,7 +3064,8 @@ const ModelSchema = {
'codeCamelPlural'
:
'types'
,
'codeCamelPlural'
:
'types'
,
'codeUnderscore'
:
'type'
,
'codeUnderscore'
:
'type'
,
'codeUnderscorePlural'
:
'types'
,
'codeUnderscorePlural'
:
'types'
,
'type'
:
'number'
'type'
:
'number'
,
'widgetType'
:
'selectType'
},
},
{
{
'id'
:
'o340'
,
'id'
:
'o340'
,
...
@@ -3079,7 +3082,8 @@ const ModelSchema = {
...
@@ -3079,7 +3082,8 @@ const ModelSchema = {
'codeCamelPlural'
:
'departmentIds'
,
'codeCamelPlural'
:
'departmentIds'
,
'codeUnderscore'
:
'department_id'
,
'codeUnderscore'
:
'department_id'
,
'codeUnderscorePlural'
:
'department_ids'
,
'codeUnderscorePlural'
:
'department_ids'
,
'type'
:
'string'
'type'
:
'string'
,
'widgetType'
:
'textarea'
}
}
]
]
},
},
...
...
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