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
d65e988f
Commit
d65e988f
authored
Nov 01, 2022
by
徐光星
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat/v1.8' into 'master'
Feat/v1.8 See merge request
!93
parents
b60f711b
57c4b0c2
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
100 additions
and
4 deletions
+100
-4
operation.api.ts
app/web/api/operation.api.ts
+5
-0
index.vue
...onent/DynamicForm/component/CouponModalSelector/index.vue
+58
-0
index.ts
app/web/page/editor/component/DynamicPageForm/index.ts
+18
-2
index.vue
app/web/page/editor/component/DynamicPageForm/index.vue
+13
-1
index.ts
app/web/page/editor/view/dashboard/index.ts
+2
-0
state.ts
app/web/page/store/modules/editor/state.ts
+2
-0
tslint.json
tslint.json
+2
-1
No files found.
app/web/api/operation.api.ts
View file @
d65e988f
...
...
@@ -105,4 +105,9 @@ export default {
accessToken
:
true
});
},
getCouponModalList
(
params
)
{
return
http
.
post
(
`
${
config
.
opapiHost
}
/kdspOp/api/kdsp/app/app-config-push/listAll`
,
params
,
{
accessToken
:
true
});
}
};
\ No newline at end of file
app/web/page/editor/component/DynamicForm/component/CouponModalSelector/index.vue
0 → 100644
View file @
d65e988f
<
template
>
<div
class=
"couponModalSeletor"
>
<Select
v-model=
"modalId"
filterable
clearable
multiple
>
<Option
v-for=
"item in list"
:value=
"item.appConfigPushNo"
:key=
"item.appConfigPushNo"
>
{{
`id ${item.id
}
- ${item.name
}
`
}}
<
/Option
>
<
/Select
>
<!--
<
Button
type
=
"
primary
"
@
click
=
"
save
"
>
保存
<
/Button> --
>
<
/div
>
<
/template
>
<
script
>
import
operationApi
from
'
@api/operation.api
'
;
export
default
{
props
:
{
value
:
{
type
:
Array
,
default
:
[]
}
}
,
watch
:
{
value
(
val
)
{
this
.
modalId
=
val
;
}
,
modalId
(
val
)
{
this
.
$emit
(
'
input
'
,
val
);
}
}
,
components
:
{
}
,
data
()
{
return
{
list
:
[],
modalId
:
[]
}
}
,
created
()
{
this
.
modalId
=
this
.
value
;
this
.
getCouponModalList
();
}
,
methods
:
{
async
getCouponModalList
()
{
const
res
=
await
operationApi
.
getCouponModalList
({
elementType
:
4
,
// 4为优惠券弹窗类型
enable
:
'
VALID
'
}
);
const
list
=
res
.
list
.
map
(
item
=>
{
let
obj
=
{
}
;
obj
.
id
=
item
.
id
.
toString
();
obj
.
appConfigPushNo
=
item
.
appConfigPushNo
.
toString
();
obj
.
name
=
item
.
componentName
;
return
obj
;
}
)
// console.log(list)
this
.
list
=
list
;
}
}
}
<
/script
>
<
style
scoped
lang
=
"
less
"
>
<
/style
>
app/web/page/editor/component/DynamicPageForm/index.ts
View file @
d65e988f
...
...
@@ -4,6 +4,7 @@ import { reduce, ceil, subtract, divide, cloneDeep, assign } from 'lodash';
import
ContextMenuMixin
from
'
@editor/mixins/contextMenu.mixin
'
;
import
Upload
from
'
../DynamicForm/component/Upload/index.vue
'
;
import
ColorSelector
from
'
../DynamicForm/component/ColorSelector/index.vue
'
;
import
CouponModalSelector
from
'
../DynamicForm/component/CouponModalSelector/index.vue
'
;
// 用于选择优惠券弹窗
import
BaseSelect
from
'
../DynamicForm/component/BaseSelect/index.vue
'
;
import
Textarea
from
'
../DynamicForm/component/Textarea/index.vue
'
;
import
Number
from
'
../DynamicForm/component/Number/index.vue
'
;
...
...
@@ -12,7 +13,7 @@ import BackTopPicker from '../DynamicForm/component/BackTopPicker/index.vue';
import
SwitchBtn
from
'
../DynamicForm/component/SwitchBtn/index.vue
'
;
import
{
SHOP_CART_CONFIG
,
DEFAULT_CONFIG
}
from
'
@service/staticData.service
'
;
@
Component
({
components
:
{
Upload
,
ColorSelector
,
BaseSelect
,
Textarea
,
Number
,
FormList
,
BackTopPicker
,
SwitchBtn
},
name
:
'
DynamicPageForm
'
})
@
Component
({
components
:
{
Upload
,
ColorSelector
,
BaseSelect
,
Textarea
,
Number
,
FormList
,
BackTopPicker
,
SwitchBtn
,
CouponModalSelector
},
name
:
'
DynamicPageForm
'
})
export
default
class
DynamicPageForm
extends
Mixins
(
ContextMenuMixin
)
{
@
Getter
(
'
pageData
'
)
pageData
;
@
State
(
state
=>
state
.
tenant
.
cartAndShareBtn
)
cartAndShareBtn
;
...
...
@@ -32,6 +33,13 @@ export default class DynamicPageForm extends Mixins(ContextMenuMixin) {
type
:
'
ColorSelector
'
}
];
baseConfigSchema
:
object
[]
=
[
{
key
:
'
pageNeedLogin
'
,
name
:
'
是否登录
'
,
type
:
'
SwitchBtn
'
},
];
,
titleSchema
:
object
[]
=
[
{
key
:
'
titleBgColor
'
,
...
...
@@ -158,6 +166,13 @@ export default class DynamicPageForm extends Mixins(ContextMenuMixin) {
formDefault
:
{}
}
];
floatModal
:
object
[]
=
[
{
key
:
'
couponModal
'
,
name
:
'
优惠券弹窗
'
,
type
:
'
CouponModalSelector
'
},
];
// 这块用于让被污染的pageInfo的page.props返回shareOpenMethod
otherProps
:
object
[]
=
[
{
...
...
@@ -171,7 +186,7 @@ export default class DynamicPageForm extends Mixins(ContextMenuMixin) {
},
];
get
propsSchema
()
{
return
[...
this
.
titleSchema
,
...
this
.
bottomSchema
,
...
this
.
floatSchema
,
...
this
.
otherProps
];
return
[...
this
.
titleSchema
,
...
this
.
bottomSchema
,
...
this
.
floatSchema
,
...
this
.
otherProps
,
...
this
.
floatModal
,
...
this
.
baseConfigSchema
];
}
@
Watch
(
'
cartAndShareBtn
'
,
{
immediate
:
true
})
...
...
@@ -189,6 +204,7 @@ export default class DynamicPageForm extends Mixins(ContextMenuMixin) {
this
.
propsSchema
.
forEach
(
schame
=>
{
this
.
$set
(
this
.
propsForm
,
schame
.
key
,
this
.
pageData
?.
props
?.[
schame
.
key
]);
});
// console.log(this.propsForm);
}
@
Watch
(
'
commonStyleForm
'
,
{
immediate
:
true
,
deep
:
true
})
...
...
app/web/page/editor/component/DynamicPageForm/index.vue
View file @
d65e988f
...
...
@@ -3,6 +3,12 @@
<h2>
{{
title
}}
</h2>
<Form
class=
"dynamic-form-component"
:label-width=
"80"
:model=
"propsForm"
@
submit
.
native
.
prevent
>
<h3>
基础属性
</h3>
<h4>
基础配置
</h4>
<template
v-for=
"(item, index) in baseConfigSchema"
>
<FormItem
class=
"Df-component-formitem"
:label=
"item.name"
:key=
"'baseConfigSchema_' + index"
>
<component
:is=
"item.type"
:options=
"item.options"
v-bind=
"item.props"
v-model=
"propsForm[item.key]"
:formControl=
"item.formControl"
/>
</FormItem>
</
template
>
<h4>
标题栏
</h4>
<
template
v-for=
"(item, index) in titleSchema"
>
<FormItem
class=
"Df-component-formitem"
:label=
"item.name"
:key=
"'titleSchema_' + index"
>
...
...
@@ -21,6 +27,12 @@
<component
:is=
"item.type"
:options=
"item.options"
v-bind=
"item.props"
v-model=
"propsForm[item.key]"
:formDefault=
"item.formDefault"
:formControl=
"item.formControl"
/>
</FormItem>
</
template
>
<h4>
弹窗
</h4>
<
template
v-for=
"(item, index) in floatModal"
>
<FormItem
class=
"Df-component-formitem"
:label=
"item.name"
:key=
"'floatModal_' + index"
>
<component
:is=
"item.type"
:options=
"item.options"
v-bind=
"item.props"
v-model=
"propsForm[item.key]"
:formDefault=
"item.formDefault"
:formControl=
"item.formControl"
/>
</FormItem>
</
template
>
</Form>
<Form
class=
"dynamic-form-component"
:label-width=
"80"
:model=
"commonStyleForm"
@
submit
.
native
.
prevent
>
<h3>
基础样式
</h3>
...
...
@@ -57,7 +69,7 @@
}
}
/deep/ .ivu-form-item-label {
font-size: 1
4
px;
font-size: 1
2
px;
}
/deep/ .ivu-input-number {
...
...
app/web/page/editor/view/dashboard/index.ts
View file @
d65e988f
...
...
@@ -114,6 +114,8 @@ export default class DashBoard extends Mixins(ContextMenuMixin, GoodsTabsMixin,
return
;
}
}
// console.log({ pageInfo, pageData: this.pageData }, 0);
// return;
await
this
.
savePageData
({
pageInfo
,
pageData
:
this
.
pageData
});
if
(
this
.
uuid
)
{
await
this
.
getPageDate
({
pageId
:
this
.
uuid
});
}
this
.
showSubmitPopup
=
false
;
...
...
app/web/page/store/modules/editor/state.ts
View file @
d65e988f
...
...
@@ -95,11 +95,13 @@ export const defaultState = {
backgroundImage
:
''
,
},
props
:
{
pageNeedLogin
:
false
,
titleBgColor
:
'
#fff
'
,
titleUseUrl
:
false
,
showPageBottomTip
:
true
,
pageBottomTxt
:
'
没有更多啦~
'
,
pageBottomColor
:
'
#333
'
,
couponModal
:
[],
showBackTop
:
true
,
btAttachVal
:
[
{
...
...
tslint.json
View file @
d65e988f
...
...
@@ -18,7 +18,8 @@
"only-arrow-functions"
:
false
,
"interface-over-type-literal"
:
false
,
"ter-indent"
:
[
true
,
2
],
"no-var-requires"
:
false
"no-var-requires"
:
false
,
"triple-equals"
:
false
},
"rulesDirectory"
:
[
"app"
]
}
\ No newline at end of file
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