Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
quantum-blocks
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
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
ui
quantum-blocks
Commits
f9288370
Commit
f9288370
authored
Sep 22, 2021
by
郭志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(saveModal): 调整保存表单校验逻辑
parent
216b9593
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
6 deletions
+22
-6
index.ts
app/web/page/editor/component/BasicPageFormModal/index.ts
+19
-4
index.vue
app/web/page/editor/component/BasicPageFormModal/index.vue
+3
-2
No files found.
app/web/page/editor/component/BasicPageFormModal/index.ts
View file @
f9288370
...
@@ -10,7 +10,8 @@ import { getStyle } from '@service/utils.service';
...
@@ -10,7 +10,8 @@ import { getStyle } from '@service/utils.service';
@
Component
({
components
:
{
Upload
},
name
:
'
BasicPageForm
'
})
@
Component
({
components
:
{
Upload
},
name
:
'
BasicPageForm
'
})
export
default
class
DynamicForm
extends
Vue
{
export
default
class
DynamicForm
extends
Vue
{
@
Getter
(
'
pageInfo
'
)
pageData
;
@
Getter
(
'
pageInfo
'
)
pageInfo
;
@
Getter
(
'
pageData
'
)
pageData
;
@
Prop
(
Boolean
)
value
;
@
Prop
(
Boolean
)
value
;
showPopup
:
boolean
=
false
;
showPopup
:
boolean
=
false
;
...
@@ -20,12 +21,19 @@ export default class DynamicForm extends Vue {
...
@@ -20,12 +21,19 @@ export default class DynamicForm extends Vue {
ruleCustom
:
object
=
{
ruleCustom
:
object
=
{
pageName
:
[
pageName
:
[
{
required
:
true
,
message
:
'
请输入页面名称
'
,
trigger
:
'
blur
'
}
{
required
:
true
,
message
:
'
请输入页面名称
'
,
trigger
:
'
blur
'
}
]
],
shareOpenMethod
:
[
{
validator
:
this
.
validateOpenMethod
,
trigger
:
'
blur
'
}
],
};
};
get
enableShare
()
{
return
this
.
pageData
.
props
?.
showShare
;
}
@
Watch
(
'
pageData
'
,
{
immediate
:
true
})
@
Watch
(
'
pageData
'
,
{
immediate
:
true
})
onPageDataChange
(
newVal
)
{
onPageDataChange
(
newVal
)
{
const
{
pageName
,
pageDescribe
,
pageKeywords
,
coverImage
,
isPublish
,
isTemplate
,
shareCoverImage
,
shareOpenMethod
}
=
this
.
page
Data
;
const
{
pageName
,
pageDescribe
,
pageKeywords
,
coverImage
,
isPublish
,
isTemplate
,
shareCoverImage
,
shareOpenMethod
}
=
this
.
page
Info
;
this
.
formCustom
=
{
pageName
,
pageDescribe
,
pageKeywords
,
coverImage
,
isPublish
:
!!
isPublish
,
isTemplate
:
!!
isTemplate
,
shareCoverImage
,
shareOpenMethod
};
this
.
formCustom
=
{
pageName
,
pageDescribe
,
pageKeywords
,
coverImage
,
isPublish
:
!!
isPublish
,
isTemplate
:
!!
isTemplate
,
shareCoverImage
,
shareOpenMethod
};
}
}
...
@@ -38,7 +46,7 @@ export default class DynamicForm extends Vue {
...
@@ -38,7 +46,7 @@ export default class DynamicForm extends Vue {
}
}
handleSubmit
(
type
)
{
handleSubmit
(
type
)
{
this
.
$refs
.
formCustom
.
validate
(
async
(
valid
)
=>
{
this
.
$refs
.
formCustom
?
.
validate
(
async
(
valid
)
=>
{
if
(
valid
)
{
if
(
valid
)
{
if
(
type
===
'
save
'
)
{
if
(
type
===
'
save
'
)
{
this
.
loadingSave
=
true
;
this
.
loadingSave
=
true
;
...
@@ -64,6 +72,13 @@ export default class DynamicForm extends Vue {
...
@@ -64,6 +72,13 @@ export default class DynamicForm extends Vue {
this
.
formCustom
.
pageName
=
this
.
formCustom
.
pageName
||
'
未命名
'
;
this
.
formCustom
.
pageName
=
this
.
formCustom
.
pageName
||
'
未命名
'
;
this
.
handleSubmit
(
'
autoSave
'
);
this
.
handleSubmit
(
'
autoSave
'
);
}
}
validateOpenMethod
(
rule
,
value
,
callback
)
{
if
(
!
value
&&
this
.
enableShare
)
{
callback
(
new
Error
(
'
请选择H5打开方式
'
));
}
else
{
callback
();
}
}
changeStyle
(
type
)
{
changeStyle
(
type
)
{
const
gridEle
=
document
.
querySelector
(
'
.vue-grid-layout
'
);
const
gridEle
=
document
.
querySelector
(
'
.vue-grid-layout
'
);
...
...
app/web/page/editor/component/BasicPageFormModal/index.vue
View file @
f9288370
...
@@ -16,9 +16,10 @@
...
@@ -16,9 +16,10 @@
</FormItem>
</FormItem>
<FormItem
label=
"H5打开方式"
prop=
"shareOpenMethod"
>
<FormItem
label=
"H5打开方式"
prop=
"shareOpenMethod"
>
<RadioGroup
v-model=
"formCustom.shareOpenMethod"
>
<RadioGroup
v-model=
"formCustom.shareOpenMethod"
>
<Radio
:label=
"1"
>
小程序
</Radio>
<Radio
:label=
"1"
:disabled=
"!enableShare"
>
小程序
</Radio>
<Radio
:label=
"2"
>
APP
</Radio>
<Radio
:label=
"2"
:disabled=
"!enableShare"
>
APP
</Radio>
</RadioGroup>
</RadioGroup>
<p
class=
"basic-form__tip"
>
当分享功能未启用时,此处不可选
</p>
</FormItem>
</FormItem>
<FormItem
label=
"是否发布"
prop=
"isPublish"
>
<FormItem
label=
"是否发布"
prop=
"isPublish"
>
<i-switch
v-model=
"formCustom.isPublish"
></i-switch>
<i-switch
v-model=
"formCustom.isPublish"
></i-switch>
...
...
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