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
ec30a0f2
Commit
ec30a0f2
authored
Aug 30, 2021
by
郭志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(refresh): 刷新功能
parent
8f38572b
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
44 additions
and
1 deletion
+44
-1
editor.ts
app/controller/editor.ts
+4
-0
router.ts
app/router.ts
+1
-0
editor.api.ts
app/web/api/editor.api.ts
+3
-0
index.vue
...r/component/DynamicForm/component/BackTopPicker/index.vue
+11
-0
index.ts
app/web/page/editor/component/DynamicPageForm/index.ts
+9
-0
index.vue
app/web/page/editor/view/pageList/index.vue
+11
-1
state.ts
app/web/page/store/modules/editor/state.ts
+1
-0
staticData.service.ts
app/web/service/staticData.service.ts
+4
-0
No files found.
app/controller/editor.ts
View file @
ec30a0f2
...
@@ -71,6 +71,10 @@ export default class EditorController extends Controller {
...
@@ -71,6 +71,10 @@ export default class EditorController extends Controller {
ctx
.
body
=
ctx
.
helper
.
ok
(
list
);
ctx
.
body
=
ctx
.
helper
.
ok
(
list
);
}
}
public
async
clearCache
(
ctx
:
Context
)
{
ctx
.
body
=
ctx
.
helper
.
ok
({});
}
public
async
delete
(
ctx
:
Context
)
{
public
async
delete
(
ctx
:
Context
)
{
const
pageInfo
=
await
ctx
.
model
.
PageInfo
.
update
({
enable
:
0
},
{
where
:
{
id
:
+
ctx
.
params
.
pageId
}});
const
pageInfo
=
await
ctx
.
model
.
PageInfo
.
update
({
enable
:
0
},
{
where
:
{
id
:
+
ctx
.
params
.
pageId
}});
ctx
.
body
=
ctx
.
helper
.
ok
(
pageInfo
);
ctx
.
body
=
ctx
.
helper
.
ok
(
pageInfo
);
...
...
app/router.ts
View file @
ec30a0f2
...
@@ -11,6 +11,7 @@ export default (application: Application) => {
...
@@ -11,6 +11,7 @@ export default (application: Application) => {
router
.
post
(
'
/editor/save
'
,
controller
.
editor
.
save
);
router
.
post
(
'
/editor/save
'
,
controller
.
editor
.
save
);
router
.
post
(
'
/editor/update
'
,
controller
.
editor
.
update
);
router
.
post
(
'
/editor/update
'
,
controller
.
editor
.
update
);
router
.
post
(
'
/editor/clearcache
'
,
controller
.
editor
.
clearCache
);
router
.
get
(
'
/editor/get/list
'
,
controller
.
editor
.
getList
);
router
.
get
(
'
/editor/get/list
'
,
controller
.
editor
.
getList
);
router
.
get
(
'
/editor/get/template
'
,
controller
.
editor
.
getTemplateList
);
router
.
get
(
'
/editor/get/template
'
,
controller
.
editor
.
getTemplateList
);
router
.
get
(
'
/editor/get/:uuid
'
,
controller
.
editor
.
get
);
router
.
get
(
'
/editor/get/:uuid
'
,
controller
.
editor
.
get
);
...
...
app/web/api/editor.api.ts
View file @
ec30a0f2
...
@@ -6,6 +6,9 @@ export default {
...
@@ -6,6 +6,9 @@ export default {
getPageList
(
params
)
{
getPageList
(
params
)
{
return
http
.
get
(
'
editor/get/list
'
,
{
params
});
return
http
.
get
(
'
editor/get/list
'
,
{
params
});
},
},
refreshCache
()
{
return
http
.
post
(
'
editor/clearcache
'
);
},
getPageById
(
params
)
{
getPageById
(
params
)
{
return
http
.
get
(
`editor/get/
${
params
.
pageId
}
`
);
return
http
.
get
(
`editor/get/
${
params
.
pageId
}
`
);
},
},
...
...
app/web/page/editor/component/DynamicForm/component/BackTopPicker/index.vue
View file @
ec30a0f2
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
<
script
>
<
script
>
import
FormList
from
'
../mixins/formList.mixin.ts
'
;
import
FormList
from
'
../mixins/formList.mixin.ts
'
;
import
{
SHOP_CART_CONFIG
,
SHARE_CONFIG
,
DEFAULT_CONFIG
}
from
'
@service/staticData.service
'
;
import
{
SHOP_CART_CONFIG
,
SHARE_CONFIG
,
DEFAULT_CONFIG
}
from
'
@service/staticData.service
'
;
import
{
v4
as
uuid
}
from
'
uuid
'
;
const
CONFIG_MAP
=
{
const
CONFIG_MAP
=
{
[
'
购物车
'
]:
SHOP_CART_CONFIG
,
[
'
购物车
'
]:
SHOP_CART_CONFIG
,
...
@@ -42,6 +43,16 @@ const CONFIG_MAP = {
...
@@ -42,6 +43,16 @@ const CONFIG_MAP = {
this
.
$set
(
this
.
list
,
index
,
JSON
.
parse
(
JSON
.
stringify
(
CONFIG_MAP
[
e
])));
this
.
$set
(
this
.
list
,
index
,
JSON
.
parse
(
JSON
.
stringify
(
CONFIG_MAP
[
e
])));
this
.
oldPersets
[
index
]
=
e
;
this
.
oldPersets
[
index
]
=
e
;
}
}
},
add
()
{
const
object
=
this
.
formControl
.
reduce
((
pre
,
cur
)
=>
{
pre
[
cur
.
key
]
=
this
.
formDefault
[
cur
.
key
]
||
''
;
return
pre
;
},
{});
if
(
object
.
persets
===
'
自定义
'
)
{
object
.
name
=
'
自定义-
'
+
uuid
().
slice
(
19
);
}
this
.
list
.
push
(
object
);
}
}
}
}
}
}
...
...
app/web/page/editor/component/DynamicPageForm/index.ts
View file @
ec30a0f2
...
@@ -77,6 +77,15 @@ export default class DynamicPageForm extends Mixins(ContextMenuMixin) {
...
@@ -77,6 +77,15 @@ export default class DynamicPageForm extends Mixins(ContextMenuMixin) {
type
:
'
select
'
,
type
:
'
select
'
,
options
:
[
'
购物车
'
,
'
分享
'
,
'
自定义
'
]
options
:
[
'
购物车
'
,
'
分享
'
,
'
自定义
'
]
},
},
{
key
:
'
name
'
,
name
:
'
名称
'
,
type
:
'
text
'
,
props
:
{
require
:
true
,
placeholder
:
'
(必填) 区分埋点
'
}
},
{
{
key
:
'
txt
'
,
key
:
'
txt
'
,
name
:
'
文字
'
,
name
:
'
文字
'
,
...
...
app/web/page/editor/view/pageList/index.vue
View file @
ec30a0f2
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
:request=
"query"
:request=
"query"
@
newBtnClick=
"addPage"
@
newBtnClick=
"addPage"
>
>
<Button
type=
"default"
class=
"btnStyle"
@
click=
"refreshData()"
>
更新缓存
</Button>
</QGTable>
</QGTable>
</
template
>
</
template
>
<
script
>
<
script
>
...
@@ -187,7 +188,16 @@ export default {
...
@@ -187,7 +188,16 @@ export default {
},
},
addPage
()
{
addPage
()
{
this
.
$router
.
push
(
'
/detail
'
);
this
.
$router
.
push
(
'
/detail
'
);
}
},
async
refreshData
()
{
try
{
await
editorApi
.
refreshCache
();
this
.
$Notice
.
success
({
title
:
'
刷新成功!
'
});
}
catch
(
error
)
{
console
.
log
(
error
);
this
.
$Notice
.
warning
({
title
:
'
刷新失败!
'
});
}
},
},
},
mounted
(){}
mounted
(){}
}
}
...
...
app/web/page/store/modules/editor/state.ts
View file @
ec30a0f2
...
@@ -90,6 +90,7 @@ export const defaultState = {
...
@@ -90,6 +90,7 @@ export const defaultState = {
btAttachVal
:
[
btAttachVal
:
[
{
{
persets
:
'
购物车
'
,
persets
:
'
购物车
'
,
name
:
'
购物车
'
,
icon
:
'
shopping-cart-o
'
,
icon
:
'
shopping-cart-o
'
,
url
:
'
xyqb://shoppingCart?needLogin=1
'
,
url
:
'
xyqb://shoppingCart?needLogin=1
'
,
color
:
'
#333
'
,
color
:
'
#333
'
,
...
...
app/web/service/staticData.service.ts
View file @
ec30a0f2
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
export
const
SHOP_CART_CONFIG
=
{
export
const
SHOP_CART_CONFIG
=
{
persets
:
'
购物车
'
,
persets
:
'
购物车
'
,
txt
:
''
,
txt
:
''
,
name
:
'
购物车
'
,
icon
:
'
shopping-cart-o
'
,
icon
:
'
shopping-cart-o
'
,
url
:
'
xyqb://shoppingCart?needLogin=1
'
,
url
:
'
xyqb://shoppingCart?needLogin=1
'
,
color
:
'
#333
'
,
color
:
'
#333
'
,
...
@@ -15,6 +16,7 @@ export const SHOP_CART_CONFIG = {
...
@@ -15,6 +16,7 @@ export const SHOP_CART_CONFIG = {
export
const
BACK_TOP_CONFIG
=
{
export
const
BACK_TOP_CONFIG
=
{
persets
:
'
自定义
'
,
persets
:
'
自定义
'
,
name
:
''
,
icon
:
'
back-top-o
'
,
icon
:
'
back-top-o
'
,
background
:
'
#fff
'
,
background
:
'
#fff
'
,
color
:
'
#333
'
,
color
:
'
#333
'
,
...
@@ -25,6 +27,7 @@ export const BACK_TOP_CONFIG = {
...
@@ -25,6 +27,7 @@ export const BACK_TOP_CONFIG = {
export
const
SHARE_CONFIG
=
{
export
const
SHARE_CONFIG
=
{
persets
:
'
分享
'
,
persets
:
'
分享
'
,
name
:
'
分享
'
,
txt
:
''
,
txt
:
''
,
icon
:
'
share
'
,
icon
:
'
share
'
,
url
:
''
,
url
:
''
,
...
@@ -39,6 +42,7 @@ export const SHARE_CONFIG = {
...
@@ -39,6 +42,7 @@ export const SHARE_CONFIG = {
export
const
DEFAULT_CONFIG
=
{
export
const
DEFAULT_CONFIG
=
{
persets
:
'
自定义
'
,
persets
:
'
自定义
'
,
name
:
''
,
txt
:
''
,
txt
:
''
,
icon
:
''
,
icon
:
''
,
url
:
''
,
url
:
''
,
...
...
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