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
022e49be
Commit
022e49be
authored
Aug 05, 2021
by
郭志伟
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat/titleColor' into 'master'
Feat/title color See merge request
!27
parents
637a0a85
fc870e39
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
116 additions
and
18 deletions
+116
-18
index.vue
...r/component/DynamicForm/component/ColorSelector/index.vue
+100
-12
index.ts
app/web/page/editor/component/DynamicPageForm/index.ts
+10
-1
index.vue
app/web/page/editor/component/DynamicPageForm/index.vue
+2
-2
state.ts
app/web/page/store/modules/editor/state.ts
+2
-1
apollo.js
bin/apollo.js
+1
-1
server.js
bin/server.js
+1
-1
No files found.
app/web/page/editor/component/DynamicForm/component/ColorSelector/index.vue
View file @
022e49be
<
template
>
<div
class=
"color-selector"
>
<Input
class=
"color-selector-input"
v-model=
"color"
placeholder=
"请输入"
@
input=
"change"
></Input>
<ColorPicker
placement=
"bottom-end"
v-model=
"color"
alpha
@
on-active-change=
"change($event)"
@
on-change=
"change($event)"
/>
<div>
<div
class=
"color-selector-gradient"
v-if=
"gradient"
:class=
"
{ active: showToColor }">
<div
class=
"color-selector"
>
<Input
class=
"color-selector-input"
v-model=
"color"
placeholder=
"请输入"
@
input=
"change"
></Input>
<ColorPicker
placement=
"bottom-end"
v-model=
"color"
:alpha=
"alpha"
@
on-active-change=
"change($event)"
@
on-change=
"change($event)"
/>
</div>
<div
class=
"color-selector-switch"
@
click=
"showToColor = !showToColor"
>
<Icon
type=
"ios-arrow-forward"
/>
</div>
<div
class=
"color-selector"
v-if=
"showToColor"
>
<Input
class=
"color-selector-input"
v-model=
"toColor"
placeholder=
"请输入"
@
input=
"change"
></Input>
<ColorPicker
placement=
"bottom-end"
v-model=
"toColor"
:alpha=
"alpha"
@
on-active-change=
"change($event, 'to')"
@
on-change=
"change($event, 'to')"
/>
</div>
</div>
<div
class=
"color-selector"
v-else
>
<Input
class=
"color-selector-input"
v-model=
"color"
placeholder=
"请输入"
@
input=
"change"
></Input>
<ColorPicker
placement=
"bottom-end"
v-model=
"color"
:alpha=
"alpha"
@
on-active-change=
"change($event)"
@
on-change=
"change($event)"
/>
</div>
</div>
</
template
>
<
script
>
export
default
{
props
:
{
value
:
String
,
value
:
{
type
:
[
String
,
Array
],
default
:
''
},
gradient
:
Boolean
,
alpha
:
{
type
:
Boolean
,
default
:
true
}
},
data
()
{
return
{
showToColor
:
false
,
color
:
this
.
value
||
''
,
toColor
:
''
,
}
},
created
()
{
console
.
log
(
this
.
color
);
},
watch
:
{
value
(
val
)
{
this
.
color
=
val
;
if
(
Array
.
isArray
(
val
))
{
this
.
color
=
val
[
0
];
this
.
toColor
=
val
[
1
];
this
.
showToColor
=
true
;
}
else
{
this
.
color
=
val
;
}
},
showToColor
(
val
)
{
if
(
val
&&
this
.
toColor
)
{
this
.
$emit
(
'
input
'
,
[
this
.
color
,
this
.
toColor
]);
}
else
{
this
.
$emit
(
'
input
'
,
this
.
color
);
}
}
},
methods
:
{
change
(
val
)
{
console
.
log
(
'
color
'
,
val
);
this
.
$emit
(
'
input
'
,
val
);
change
(
val
,
type
)
{
if
(
type
===
'
to
'
)
{
this
.
$emit
(
'
input
'
,
[
this
.
color
,
this
.
toColor
]);
}
else
{
this
.
$emit
(
'
input
'
,
val
);
}
}
}
}
...
...
@@ -35,7 +73,57 @@
display: flex;
align-items: center;
justify-content: space-between;
&-gradient {
position: relative;
.color-selector {
padding-left: 28px;
}
&.active {
.color-selector-switch {
position: relative;
top: 0;
&::before {
display: block;
}
.ivu-icon {
transform: rotate(90deg);
position: relative;
}
}
}
}
&-switch {
position: absolute;
top: 5px;
left: 0;
.ivu-icon {
position: absolute;
z-index: 2;
font-size: 16px;
width: 20px;
height: 20px;
line-height: 21px;
text-align: center;
margin-right: 5px;
cursor: pointer;
background-color: #f5f5f5;
}
&::before {
position: absolute;
z-index: 1;
display: none;
content: ' ';
top: 0;
bottom: 0;
left: 10px;
margin: auto;
height: 65px;
width: 16px;
border-color: #e8e8e8;
border-width: 1px 0 1px 1px;
border-style: solid;
}
}
&-input {
width: 100px !important;
flex-basis: 100px !important;
...
...
app/web/page/editor/component/DynamicPageForm/index.ts
View file @
022e49be
...
...
@@ -10,7 +10,7 @@ import Number from '../DynamicForm/component/Number/index.vue';
import
FormList
from
'
../DynamicForm/component/FormList/index.vue
'
;
import
{
resizeDiv
,
getStyle
}
from
'
@/service/utils.service
'
;
@
Component
({
components
:
{
Upload
,
ColorSelector
,
BaseSelect
,
Textarea
,
Number
,
FormList
},
name
:
'
DynamicForm
'
})
@
Component
({
components
:
{
Upload
,
ColorSelector
,
BaseSelect
,
Textarea
,
Number
,
FormList
},
name
:
'
Dynamic
Page
Form
'
})
export
default
class
DynamicPageForm
extends
Mixins
(
ContextMenuMixin
)
{
@
Getter
(
'
pageData
'
)
pageData
;
...
...
@@ -31,6 +31,15 @@ export default class DynamicPageForm extends Mixins(ContextMenuMixin) {
];
propsSchame
:
object
[]
=
[
{
key
:
'
titleBgColor
'
,
name
:
'
标题栏 背景色
'
,
type
:
'
ColorSelector
'
,
props
:
{
gradient
:
true
,
alpha
:
false
}
},
{
key
:
'
showPageBottomTip
'
,
name
:
'
底部提示
'
,
...
...
app/web/page/editor/component/DynamicPageForm/index.vue
View file @
022e49be
...
...
@@ -5,7 +5,7 @@
<h3>
基础属性
</h3>
<template
v-for=
"(item, index) in propsSchame"
>
<FormItem
class=
"Df-component-formitem"
:label=
"item.name"
>
<component
:is=
"item.type"
:options=
"item.options"
v-model=
"propsForm[item.key]"
:formControl=
"item.formControl"
/>
<component
:is=
"item.type"
:options=
"item.options"
v-bind=
"item.props"
v-model=
"propsForm[item.key]"
:formControl=
"item.formControl"
/>
</FormItem>
</
template
>
</Form>
...
...
@@ -13,7 +13,7 @@
<h3>
基础样式
</h3>
<
template
v-for=
"(item, index) in commonStyleSchame"
>
<FormItem
class=
"Df-component-formitem"
:label=
"item.name"
>
<component
:is=
"item.type"
:options=
"item.options"
v-model=
"commonStyleForm[item.key]"
/>
<component
:is=
"item.type"
:options=
"item.options"
v-bind=
"item.props"
v-model=
"commonStyleForm[item.key]"
/>
</FormItem>
</
template
>
</Form>
...
...
app/web/page/store/modules/editor/state.ts
View file @
022e49be
...
...
@@ -79,9 +79,10 @@ export const defaultState = {
page
:
{
commonStyle
:
{
backgroundColor
:
'
#f7f8fa
'
,
backgroundImage
:
''
backgroundImage
:
''
,
},
props
:
{
titleBgColor
:
'
#fff
'
,
showPageBottomTip
:
true
,
pageBottomTxt
:
'
没有更多啦~
'
,
pageBottomColor
:
'
#fff
'
,
...
...
bin/apollo.js
View file @
022e49be
...
...
@@ -8,7 +8,7 @@ const apollo = require('@qg/apollo-nodejs');
const
npm
=
require
(
"
npm
"
);
npm
.
load
(()
=>
{
apollo
.
load
({
appId
:
'
quantum-block
-h5
'
,
appId
:
'
quantum-block
s
'
,
configPath
:
path
.
resolve
(
__dirname
,
'
../config
'
),
}).
then
(()
=>
{
const
{
api
,
qiniu
}
=
require
(
path
.
resolve
(
'
./config/apollo.json
'
));
...
...
bin/server.js
View file @
022e49be
...
...
@@ -7,7 +7,7 @@ const apollo = require('@qg/apollo-nodejs');
const
npm
=
require
(
"
npm
"
);
npm
.
load
(()
=>
{
apollo
.
load
({
appId
:
'
quantum-block
-h5
'
,
appId
:
'
quantum-block
s
'
,
configPath
:
path
.
resolve
(
__dirname
,
'
../config
'
),
}).
then
(()
=>
{
const
{
api
,
qiniu
}
=
require
(
path
.
resolve
(
'
./config/apollo.json
'
));
...
...
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