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
df48e092
Commit
df48e092
authored
Jan 24, 2022
by
郭志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(pagedata): 提示优化
parent
6240e63b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
6 deletions
+25
-6
editor.ts
app/controller/editor.ts
+15
-6
index.ts
app/web/page/store/modules/editor/index.ts
+10
-0
No files found.
app/controller/editor.ts
View file @
df48e092
...
...
@@ -14,9 +14,13 @@ export default class EditorController extends Controller {
public
async
save
(
ctx
:
Context
)
{
const
pageInfo
=
ctx
.
request
.
body
;
const
result
=
await
ctx
.
model
.
PageInfo
.
create
({
...
pageInfo
,
uuid
:
uuidv1
().
replace
(
/-/g
,
''
),
tenantId
:
ctx
.
headers
[
'
qg-tenant-id
'
]});
await
ctx
.
service
.
redis
.
set
(
`pageInfo:
${
result
.
dataValues
.
uuid
}
`
,
result
.
dataValues
);
ctx
.
body
=
ctx
.
helper
.
ok
(
result
);
try
{
const
result
=
await
ctx
.
model
.
PageInfo
.
create
({
...
pageInfo
,
uuid
:
uuidv1
().
replace
(
/-/g
,
''
),
tenantId
:
ctx
.
headers
[
'
qg-tenant-id
'
]});
ctx
.
body
=
ctx
.
helper
.
ok
(
result
);
await
ctx
.
service
.
redis
.
set
(
`pageInfo:
${
result
.
dataValues
.
uuid
}
`
,
result
.
dataValues
);
}
catch
(
error
)
{
ctx
.
body
=
ctx
.
helper
.
fail
(
error
);
}
}
public
async
update
(
ctx
:
Context
)
{
...
...
@@ -27,10 +31,15 @@ export default class EditorController extends Controller {
if
(
ctx
.
headers
[
'
qg-tenant-id
'
])
{
pageInfo
.
tenantId
=
+
ctx
.
headers
[
'
qg-tenant-id
'
];
}
const
result
=
await
ctx
.
model
.
PageInfo
.
update
(
pageInfo
,
{
where
:
{
uuid
:
pageInfo
.
uuid
,
tenantId
:
ctx
.
headers
[
'
qg-tenant-id
'
]
}});
await
ctx
.
service
.
redis
.
set
(
`pageInfo:
${
pageInfo
.
uuid
}
`
,
pageInfo
);
await
ctx
.
service
.
redis
.
del
(
`page:
${
pageInfo
.
uuid
}
`
);
try
{
const
result
=
await
ctx
.
model
.
PageInfo
.
update
(
pageInfo
,
{
where
:
{
uuid
:
pageInfo
.
uuid
,
tenantId
:
ctx
.
headers
[
'
qg-tenant-id
'
]
}});
await
ctx
.
service
.
redis
.
set
(
`pageInfo:
${
pageInfo
.
uuid
}
`
,
pageInfo
);
await
ctx
.
service
.
redis
.
del
(
`page:
${
pageInfo
.
uuid
}
`
);
ctx
.
body
=
ctx
.
helper
.
ok
(
result
);
}
catch
(
error
)
{
error
.
message
=
error
.
message
.
indexOf
(
'
Data too long
'
)
>
-
1
&&
error
.
message
.
indexOf
(
'
page_data
'
)
>
-
1
?
'
配置组件过多,请对组件进行删减
'
:
''
;
ctx
.
body
=
ctx
.
helper
.
fail
(
error
);
}
}
// todo 编辑器获取跳过redis,但需要注意
public
async
get
(
ctx
:
Context
)
{
...
...
app/web/page/store/modules/editor/index.ts
View file @
df48e092
...
...
@@ -66,6 +66,16 @@ export default class EditorModule implements Module<EditorState, RootState> {
const
goodsTabs
=
{};
(
pageObj
as
Page
).
elements
.
forEach
((
element
,
idx
)
=>
{
if
(
element
.
schame
)
{
delete
element
.
schame
;
}
if
(
element
?.
child
?.
length
)
{
element
.
child
.
forEach
(
childEle
=>
{
if
(
childEle
.
schame
)
{
delete
childEle
.
schame
;
}
});
}
if
(
element
.
name
===
'
cs-goods-tabs
'
&&
element
?.
child
?.
length
)
{
goodsTabs
[
idx
]
=
cloneDeep
(
element
.
child
);
// 逆向循环
...
...
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