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
fae97f85
Commit
fae97f85
authored
Sep 30, 2021
by
郭志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(editor): 问题修复
parent
26491120
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
88 additions
and
27 deletions
+88
-27
dev.config.ts
app/web/config/dev.config.ts
+5
-5
test.config.ts
app/web/config/test.config.ts
+3
-3
index.ts
.../component/DynamicForm/component/ComponentSelect/index.ts
+3
-2
contextMenu.mixin.ts
app/web/page/editor/mixins/contextMenu.mixin.ts
+8
-2
goodsTabs.mixin.ts
app/web/page/editor/mixins/goodsTabs.mixin.ts
+29
-2
index.ts
app/web/page/editor/view/dashboard/index.ts
+33
-9
index.ts
app/web/page/store/modules/editor/index.ts
+7
-4
No files found.
app/web/config/dev.config.ts
View file @
fae97f85
...
@@ -3,12 +3,12 @@ const protocol = EASY_ENV_IS_BROWSER ? window.location.protocol : 'http';
...
@@ -3,12 +3,12 @@ const protocol = EASY_ENV_IS_BROWSER ? window.location.protocol : 'http';
export
default
{
export
default
{
apiHost
:
`http://localhost:7002/`
,
apiHost
:
`http://localhost:7002/`
,
// apiHost: `http://192.168.28.199:7001/`,
// apiHost: `http://192.168.28.199:7001/`,
// apiHost: 'https://quantum-blocks-
vcc2
.liangkebang.net/',
// apiHost: 'https://quantum-blocks-
test1
.liangkebang.net/',
h5Host
:
'
https://quantum-h5-
vcc2
.liangkebang.net
'
,
h5Host
:
'
https://quantum-h5-
test1
.liangkebang.net
'
,
qiniuHost
:
`https://appsync.lkbang.net`
,
qiniuHost
:
`https://appsync.lkbang.net`
,
shenceUrl
:
`
${
protocol
}
//bn.xyqb.com/sa?project=default`
,
shenceUrl
:
`
${
protocol
}
//bn.xyqb.com/sa?project=default`
,
opapiHost
:
`https://opapi-
vcc2
.liangkebang.net`
,
opapiHost
:
`https://opapi-
test1
.liangkebang.net`
,
qiniuUpHost
:
`
${
protocol
}
//up-z0.qiniup.com`
,
qiniuUpHost
:
`
${
protocol
}
//up-z0.qiniup.com`
,
// kdspHost: 'https://kdsp-api-
vcc2
.liangkebang.net',
// kdspHost: 'https://kdsp-api-
test1
.liangkebang.net',
kdspHost
:
'
https://talos-
vcc2
.liangkebang.net
'
kdspHost
:
'
https://talos-
test1
.liangkebang.net
'
};
};
\ No newline at end of file
app/web/config/test.config.ts
View file @
fae97f85
const
protocol
=
EASY_ENV_IS_BROWSER
?
window
.
location
.
protocol
:
'
https
'
;
const
protocol
=
EASY_ENV_IS_BROWSER
?
window
.
location
.
protocol
:
'
https
'
;
const
hostMap
=
{
const
hostMap
=
{
apiHost
:
`
${
protocol
}
//quantum-blocks-
vcc2
.liangkebang.net`
,
apiHost
:
`
${
protocol
}
//quantum-blocks-
test1
.liangkebang.net`
,
h5Host
:
`
${
protocol
}
//quantum-h5-
vcc2
.liangkebang.net`
,
h5Host
:
`
${
protocol
}
//quantum-h5-
test1
.liangkebang.net`
,
opapiHost
:
'
${protocol}//opapi-
vcc2
.liangkebang.net
'
,
opapiHost
:
'
${protocol}//opapi-
test1
.liangkebang.net
'
,
qiniuHost
:
`
${
protocol
}
//appsync.lkbang.net`
,
qiniuHost
:
`
${
protocol
}
//appsync.lkbang.net`
,
shenceUrl
:
`
${
protocol
}
//bn.xyqb.com/sa?project=default`
,
shenceUrl
:
`
${
protocol
}
//bn.xyqb.com/sa?project=default`
,
qiniuUpHost
:
`
${
protocol
}
//up-z0.qiniup.com`
,
qiniuUpHost
:
`
${
protocol
}
//up-z0.qiniup.com`
,
...
...
app/web/page/editor/component/DynamicForm/component/ComponentSelect/index.ts
View file @
fae97f85
...
@@ -38,9 +38,10 @@ export default class DynamicForm extends Vue {
...
@@ -38,9 +38,10 @@ export default class DynamicForm extends Vue {
}
else
{
}
else
{
list
=
this
.
pageData
?.
elements
?.
filter
(
v
=>
pointY
<
v
?.
point
?.
y
);
list
=
this
.
pageData
?.
elements
?.
filter
(
v
=>
pointY
<
v
?.
point
?.
y
);
}
}
list
=
list
.
sort
((
cur
,
next
)
=>
{
return
cur
.
point
.
y
>
next
.
point
.
y
?
1
:
-
1
;
});
this
.
list
=
list
.
map
((
element
,
index
)
=>
({
id
:
element
.
id
,
label
:
element
.
title
+
'
-
'
+
element
.
id
}));
this
.
list
=
list
.
map
((
element
,
index
)
=>
({
id
:
element
.
id
,
label
:
element
.
title
+
'
-
'
+
element
.
id
}));
// console.log('curEleIndex', pointY, this.pageData?.elements?.filter(v => pointY < v?.point?.y), this.list);
// console.log('curEleIndex', pointY, this.pageData?.elements?.filter(v => pointY < v?.point?.y), this.list);
}
}
}
}
}
\ No newline at end of file
app/web/page/editor/mixins/contextMenu.mixin.ts
View file @
fae97f85
...
@@ -17,13 +17,19 @@ export default class ContextMenuMixin extends Vue {
...
@@ -17,13 +17,19 @@ export default class ContextMenuMixin extends Vue {
label
:
'
复制
'
,
label
:
'
复制
'
,
onClick
:
()
=>
{
onClick
:
()
=>
{
// PERF 可以抽象
// PERF 可以抽象
const
searchBarCom
=
this
.
pageData
.
elements
[
containerIndex
];
const
ComInfo
=
this
.
pageData
.
elements
[
containerIndex
];
if
(
searchBarCom
.
name
===
'
cs-search-bar
'
)
{
if
(
ComInfo
.
name
===
'
cs-search-bar
'
)
{
this
.
$Notice
.
warning
({
this
.
$Notice
.
warning
({
title
:
'
搜索框只能添加一个
'
title
:
'
搜索框只能添加一个
'
});
});
return
;
return
;
}
}
if
(
ComInfo
.
name
===
'
cs-floor-nav
'
)
{
this
.
$Notice
.
warning
({
title
:
'
楼层导航只能添加一个
'
});
return
;
}
this
.
updatePageData
({
type
:
'
copy
'
,
containerIndex
,
childIndex
});
this
.
updatePageData
({
type
:
'
copy
'
,
containerIndex
,
childIndex
});
// console.log('复制');
// console.log('复制');
}
}
...
...
app/web/page/editor/mixins/goodsTabs.mixin.ts
View file @
fae97f85
...
@@ -7,7 +7,15 @@ export default class GoodsTabsMixin extends Vue {
...
@@ -7,7 +7,15 @@ export default class GoodsTabsMixin extends Vue {
@
Getter
(
'
pageData
'
)
pageData
;
@
Getter
(
'
pageData
'
)
pageData
;
@
Mutation
(
'
UPDATE_PAGE_INFO
'
)
updatePageInfo
;
@
Mutation
(
'
UPDATE_PAGE_INFO
'
)
updatePageInfo
;
@
Mutation
(
'
COPY_OR_DELETE_PAGE_INFO
'
)
updatePageData
;
@
Mutation
(
'
COPY_OR_DELETE_PAGE_INFO
'
)
updatePageData
;
get
hasSearchBarCom
()
{
return
this
.
pageData
.
elements
.
some
(
item
=>
item
.
name
===
'
cs-search-bar
'
);
}
get
hasFloorNavCom
()
{
return
this
.
pageData
.
elements
.
some
(
item
=>
item
.
name
===
'
cs-floor-nav
'
);
}
get
hasGoodsNavCom
()
{
return
this
.
pageData
.
elements
.
some
(
item
=>
item
.
name
===
'
cs-goods-tabs
'
);
}
handleGoodsTabs
()
{
handleGoodsTabs
()
{
const
goodsTabs
=
{};
const
goodsTabs
=
{};
const
pageData
=
cloneDeep
(
this
.
pageData
);
const
pageData
=
cloneDeep
(
this
.
pageData
);
...
@@ -32,7 +40,7 @@ export default class GoodsTabsMixin extends Vue {
...
@@ -32,7 +40,7 @@ export default class GoodsTabsMixin extends Vue {
goodsTabs
[
element
.
id
]
=
{
idx
,
childs
,
childIndexs
};
goodsTabs
[
element
.
id
]
=
{
idx
,
childs
,
childIndexs
};
}
}
});
});
console
.
log
(
'
goodsTabs
'
,
goodsTabs
);
let
indexs
=
[];
let
indexs
=
[];
Object
.
keys
(
goodsTabs
).
forEach
(
key
=>
{
Object
.
keys
(
goodsTabs
).
forEach
(
key
=>
{
const
{
idx
,
childIndexs
,
childs
}
=
goodsTabs
[
key
];
const
{
idx
,
childIndexs
,
childs
}
=
goodsTabs
[
key
];
...
@@ -68,4 +76,23 @@ export default class GoodsTabsMixin extends Vue {
...
@@ -68,4 +76,23 @@ export default class GoodsTabsMixin extends Vue {
});
});
});
});
}
}
handleComAchorScrollEnable
()
{
const
pageData
=
cloneDeep
(
this
.
pageData
);
const
hasMoreGoodsTabs
=
pageData
.
elements
.
filter
(
element
=>
element
.
name
===
'
cs-goods-tabs
'
).
length
>
1
;
pageData
.
elements
.
forEach
((
element
,
idx
)
=>
{
if
(
element
.
name
===
'
cs-floor-nav
'
)
{
const
idList
=
element
.
props
.
list
.
map
(
v
=>
v
.
componentId
);
if
(
idList
.
some
(
v
=>
!
v
))
{
throw
new
Error
(
'
楼层导航组件不可为空
'
);
}
if
(
idList
.
length
&&
idList
.
length
!==
Array
.
from
(
new
Set
(
idList
)).
length
)
{
throw
new
Error
(
'
楼层导航不可重复选择组件
'
);
}
}
if
((
this
.
hasFloorNavCom
||
hasMoreGoodsTabs
)
&&
element
.
name
===
'
cs-goods-tabs
'
)
{
element
.
props
.
anchor
=
false
;
}
});
return
pageData
;
}
}
}
\ No newline at end of file
app/web/page/editor/view/dashboard/index.ts
View file @
fae97f85
...
@@ -53,10 +53,6 @@ export default class DashBoard extends Mixins(ContextMenuMixin, GoodsTabsMixin,
...
@@ -53,10 +53,6 @@ export default class DashBoard extends Mixins(ContextMenuMixin, GoodsTabsMixin,
inTheSave
:
boolean
=
false
;
inTheSave
:
boolean
=
false
;
searchBarComNum
:
number
=
0
;
searchBarComNum
:
number
=
0
;
get
HasSearchBarCom
()
{
return
this
.
pageData
.
elements
.
some
(
item
=>
item
.
name
===
'
cs-search-bar
'
);
}
get
pageDataInject
()
{
get
pageDataInject
()
{
return
this
.
pageData
;
return
this
.
pageData
;
}
}
...
@@ -88,7 +84,8 @@ export default class DashBoard extends Mixins(ContextMenuMixin, GoodsTabsMixin,
...
@@ -88,7 +84,8 @@ export default class DashBoard extends Mixins(ContextMenuMixin, GoodsTabsMixin,
}
else
{
}
else
{
this
.
pageData
.
elements
.
sort
((
a
,
b
)
=>
a
.
point
.
y
-
b
.
point
.
y
);
this
.
pageData
.
elements
.
sort
((
a
,
b
)
=>
a
.
point
.
y
-
b
.
point
.
y
);
// 处理商品标签组件
// 处理商品标签组件
const
pageData
=
this
.
handleGoodsTabs
();
let
pageData
=
this
.
handleComAchorScrollEnable
();
pageData
=
this
.
handleGoodsTabs
();
const
{
pageName
,
pageDescribe
,
pageKeywords
,
coverImage
,
isPublish
,
isTemplate
,
shareCoverImage
,
shareOpenMethod
}
=
pageConfig
;
const
{
pageName
,
pageDescribe
,
pageKeywords
,
coverImage
,
isPublish
,
isTemplate
,
shareCoverImage
,
shareOpenMethod
}
=
pageConfig
;
const
pageInfo
=
{
page
:
JSON
.
stringify
(
pageData
),
author
:
user
?.
account
,
isPublish
,
pageName
,
pageDescribe
,
pageKeywords
,
coverImage
,
isTemplate
,
shareCoverImage
,
shareOpenMethod
}
as
pageInfo
;
const
pageInfo
=
{
page
:
JSON
.
stringify
(
pageData
),
author
:
user
?.
account
,
isPublish
,
pageName
,
pageDescribe
,
pageKeywords
,
coverImage
,
isTemplate
,
shareCoverImage
,
shareOpenMethod
}
as
pageInfo
;
if
(
this
.
uuid
)
{
pageInfo
.
uuid
=
this
.
uuid
;
}
if
(
this
.
uuid
)
{
pageInfo
.
uuid
=
this
.
uuid
;
}
...
@@ -224,14 +221,41 @@ export default class DashBoard extends Mixins(ContextMenuMixin, GoodsTabsMixin,
...
@@ -224,14 +221,41 @@ export default class DashBoard extends Mixins(ContextMenuMixin, GoodsTabsMixin,
// 调整组件高度
// 调整组件高度
this
.
$nextTick
(()
=>
this
.
adjustHeight
());
this
.
$nextTick
(()
=>
this
.
adjustHeight
());
}
}
//
过滤搜索框
//
限制组件添加
addEleFilter
(
el
)
{
addEleFilter
(
el
)
{
if
(
el
.
data
.
name
===
'
cs-search-bar
'
)
{
// 限制searchNav只添加一个
if
(
this
.
HasSearchBarCom
)
{
if
(
el
.
data
.
name
===
'
cs-search-bar
'
&&
this
.
hasSearchBarCom
)
{
this
.
$Notice
.
warning
({
title
:
'
搜索框只能添加一个
'
});
return
;
}
// 限制floor-nav只添加一个,同时添加后goods-tabs会取消锚点滚动
if
(
el
.
data
.
name
===
'
cs-floor-nav
'
)
{
if
(
this
.
hasFloorNavCom
)
{
this
.
$Notice
.
warning
({
this
.
$Notice
.
warning
({
title
:
'
搜索框只能
添加一个
'
title
:
'
楼层导航目前只支持
添加一个
'
});
});
return
;
return
;
}
else
{
this
.
$Message
.
error
({
content
:
'
楼层导航添加后,商品导航中的锚点滚动将会无效
'
,
duration
:
10
});
}
}
// 添加多个goods-tabs会取消锚点滚动
if
(
el
.
data
.
name
===
'
cs-goods-tabs
'
)
{
if
(
this
.
hasGoodsNavCom
)
{
this
.
$Message
.
error
({
content
:
'
添加多个商品导航后,商品导航中的锚点滚动将会无效
'
,
duration
:
10
});
}
else
if
(
this
.
hasFloorNavCom
)
{
this
.
$Message
.
error
({
content
:
'
已添加楼层导航后,商品导航中的锚点滚动将会无效
'
,
duration
:
10
});
}
}
}
}
this
.
addElements
(
el
);
this
.
addElements
(
el
);
...
...
app/web/page/store/modules/editor/index.ts
View file @
fae97f85
...
@@ -139,14 +139,17 @@ export default class EditorModule implements Module<EditorState, RootState> {
...
@@ -139,14 +139,17 @@ export default class EditorModule implements Module<EditorState, RootState> {
state
.
curChildIndex
=
null
;
state
.
curChildIndex
=
null
;
}
else
if
(
type
===
'
copy
'
)
{
}
else
if
(
type
===
'
copy
'
)
{
let
eleCopyed
=
{}
as
PageElement
;
let
eleCopyed
=
{}
as
PageElement
;
const
newId
=
uuid
().
slice
(
19
);
if
(
childIndex
||
childIndex
===
0
)
{
if
(
childIndex
||
childIndex
===
0
)
{
eleCopyed
=
JSON
.
parse
(
JSON
.
stringify
(
page
[
containerIndex
].
child
[
childIndex
]
||
{}));
eleCopyed
=
cloneDeep
(
page
[
containerIndex
].
child
[
childIndex
]
||
{});
eleCopyed
.
id
=
uuid
().
slice
(
19
);
eleCopyed
.
id
=
newId
;
eleCopyed
.
point
.
i
=
newId
;
const
{
left
,
top
}
=
eleCopyed
.
commonStyle
;
const
{
left
,
top
}
=
eleCopyed
.
commonStyle
;
page
[
containerIndex
].
child
.
push
({
...
eleCopyed
,
commonStyle
:
{
...
eleCopyed
.
commonStyle
,
left
:
left
+
10
,
top
:
top
+
10
}
});
page
[
containerIndex
].
child
.
push
({
...
eleCopyed
,
commonStyle
:
{
...
eleCopyed
.
commonStyle
,
left
:
left
+
10
,
top
:
top
+
10
}
});
}
else
{
}
else
{
eleCopyed
=
JSON
.
parse
(
JSON
.
stringify
(
page
[
containerIndex
]
||
{}));
eleCopyed
=
cloneDeep
(
page
[
containerIndex
]
||
{});
eleCopyed
.
id
=
uuid
().
slice
(
19
);
eleCopyed
.
id
=
newId
;
eleCopyed
.
point
.
i
=
newId
;
page
.
push
({
...
eleCopyed
,
point
:
{
...
eleCopyed
.
point
,
i
:
page
.
length
}});
page
.
push
({
...
eleCopyed
,
point
:
{
...
eleCopyed
.
point
,
i
:
page
.
length
}});
}
}
}
}
...
...
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