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
605a9e1a
Commit
605a9e1a
authored
Jan 13, 2021
by
郝聪敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: dots保存在组件内部
parent
92c63c3c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
261 additions
and
264 deletions
+261
-264
config.ts
app/web/lib/config.ts
+252
-258
index.ts
app/web/page/activity/view/activity/index.ts
+1
-1
index.ts
app/web/page/editor/component/DynamicForm/index.ts
+3
-0
index.ts
app/web/page/editor/component/FreedomContainer/index.ts
+4
-4
index.vue
app/web/page/editor/component/FreedomContainer/index.vue
+1
-1
No files found.
app/web/lib/config.ts
View file @
605a9e1a
const
mdData
=
require
(
'
@qg/cherry-ui/md/index.json
'
);
// mdData.forEach(com => com.value = com.config.reduce((pre, cur) => {
// pre[cur.key] = cur.val;
// return pre;
// }, {}));
// console.log('basicComponents', mdData);
export
const
basicComponents
=
mdData
;
// export const basicComponents = [
// {
// eleName: 'freedom-container',
// title: '自由容器',
// h: 300,
// config: [
// {
// key: 'backgroundImage',
// name: '背景图片',
// type: 'Upload'
// },
// ],
// value: {
// backgroundImage: 'http://activitystatic.q-gp.com/landing-bg.png';
// },
// commonStyle: {}
// },
// {
// h: 44,
// eleName: 'cr-button',
// title: 'Button 按钮',
// config: [
// {
// key: 'type',
// name: '类型',
// desc: '类型,可选值为',
// options: [
// 'default',
// 'primary',
// 'info',
// 'danger',
// 'waring',
// 'success'
// ],
// type: 'select'
// },
// {
// key: 'size',
// name: '尺寸',
// desc: '尺寸,可选值为',
// options: [
// 'normal',
// 'large',
// 'small',
// 'mini'
// ],
// type: 'select'
// },
// {
// key: 'color',
// name: '颜色',
// desc: '按钮颜色,支持传入',
// type: 'ColorSelector'
// },
// {
// key: 'icon',
// name: '图标',
// desc: '左侧',
// type: 'text'
// },
// {
// key: 'block',
// name: '块级元素',
// desc: '是否为块级元素',
// type: 'checkbox'
// },
// {
// key: 'shape',
// name: '形状',
// desc: '按钮形状,可选值为',
// options: [
// 'square',
// 'circle'
// ],
// type: 'select'
// },
// {
// key: 'disabled',
// name: '禁用',
// desc: '是否禁用按钮',
// type: 'checkbox'
// },
// {
// key: 'plain',
// name: '朴素按钮',
// desc: '朴素按钮',
// type: 'checkbox'
// },
// {
// key: 'hairline',
// name: '细边框',
// desc: '细边框',
// type: 'checkbox'
// },
// {
// key: 'loading',
// name: '加载中',
// desc: '是否显示为加载状态',
// type: 'checkbox'
// },
// {
// key: 'loadingText',
// name: '加载文字',
// desc: '加载状态提示文字',
// type: 'text'
// },
// {
// key: 'loadingType',
// name: '加载图标类型',
// desc: '',
// options: [
// 'circular',
// 'spinner'
// ],
// type: 'select'
// },
// {
// key: 'loadingSize',
// name: '加载图标大小',
// desc: '加载图标大小',
// type: 'text'
// }
// ],
// value: {
// type: 'default',
// size: 'normal',
// color: '',
// icon: '',
// block: false,
// shape: 'square',
// disabled: false,
// plain: false,
// hairline: false,
// loading: false,
// loadingText: '',
// loadingType: 'circular',
// loadingSize: '20px'
// },
// commonStyle: {}
// },
// {
// eleName: 'cr-image',
// title: '图片',
// h: 140,
// config: [
// {
// key: 'width',
// name: '宽度',
// type: 'text'
// },
// {
// key: 'height',
// name: '高度',
// type: 'text'
// },
// {
// key: 'src',
// name: '图片',
// type: 'Upload'
// },
// ],
// value: {
// width: '5.067rem',
// height: '3.733rem',
// src: 'https://appsync.lkbang.net/Fs0qmUsMry39AjHDf_W-qgn8XEy6',
// fit: 'contain',
// },
// commonStyle: {}
// },
// {
// eleName: 'cr-nav-bar',
// title: 'NavBar 导航栏',
// h: 48,
// config: [
// {
// key: 'title',
// name: '标题',
// desc: '标题',
// propType: 'string',
// options: [],
// type: 'text'
// },
// {
// key: 'leftText',
// name: '左侧文案',
// desc: '左侧文案',
// propType: 'string',
// options: [],
// type: 'text'
// },
// {
// key: 'rightText',
// name: '右侧文案',
// desc: '右侧文案',
// default: '',
// options: [
// 'info',
// 'danger',
// 'primary',
// 'warning'
// ],
// type: 'text'
// },
// {
// key: 'leftArrow',
// name: '左侧箭头',
// desc: '是否显示左侧箭头',
// propType: 'boolean',
// options: [],
// type: 'checkbox'
// },
// {
// key: 'border',
// name: '边框',
// desc: '是否显示下边框',
// propType: 'boolean',
// options: [],
// type: 'checkbox'
// },
// {
// key: 'fixed',
// name: '固定导航栏',
// desc: '是否固定导航栏',
// propType: 'boolean',
// options: [],
// type: 'checkbox'
// },
// {
// key: 'zIndex',
// name: 'z-index',
// desc: '元素z-index',
// propType: [
// 'number',
// 'string'
// ],
// options: [],
// type: 'text'
// }
// ],
// value: {
// title: '',
// leftText: '返回',
// rightText: '',
// leftArrow: true,
// border: true,
// fixed: true,
// zIndex: '9999'
// },
// commonStyle: {}
// }
// ];
// export const basicComponents = require('@qg/cherry-ui/md/index.json');
export
const
basicComponents
=
[
{
eleName
:
'
freedom-container
'
,
title
:
'
自由容器
'
,
h
:
300
,
config
:
[
{
key
:
'
backgroundImage
'
,
name
:
'
背景图片
'
,
type
:
'
Upload
'
},
],
value
:
{
backgroundImage
:
'
http://activitystatic.q-gp.com/landing-bg.png
'
;
},
commonStyle
:
{}
},
{
h
:
44
,
eleName
:
'
cr-button
'
,
title
:
'
Button 按钮
'
,
config
:
[
{
key
:
'
type
'
,
name
:
'
类型
'
,
desc
:
'
类型,可选值为
'
,
options
:
[
'
default
'
,
'
primary
'
,
'
info
'
,
'
danger
'
,
'
waring
'
,
'
success
'
],
type
:
'
select
'
},
{
key
:
'
size
'
,
name
:
'
尺寸
'
,
desc
:
'
尺寸,可选值为
'
,
options
:
[
'
normal
'
,
'
large
'
,
'
small
'
,
'
mini
'
],
type
:
'
select
'
},
{
key
:
'
color
'
,
name
:
'
颜色
'
,
desc
:
'
按钮颜色,支持传入
'
,
type
:
'
ColorSelector
'
},
{
key
:
'
icon
'
,
name
:
'
图标
'
,
desc
:
'
左侧
'
,
type
:
'
text
'
},
{
key
:
'
block
'
,
name
:
'
块级元素
'
,
desc
:
'
是否为块级元素
'
,
type
:
'
checkbox
'
},
{
key
:
'
shape
'
,
name
:
'
形状
'
,
desc
:
'
按钮形状,可选值为
'
,
options
:
[
'
square
'
,
'
circle
'
],
type
:
'
select
'
},
{
key
:
'
disabled
'
,
name
:
'
禁用
'
,
desc
:
'
是否禁用按钮
'
,
type
:
'
checkbox
'
},
{
key
:
'
plain
'
,
name
:
'
朴素按钮
'
,
desc
:
'
朴素按钮
'
,
type
:
'
checkbox
'
},
{
key
:
'
hairline
'
,
name
:
'
细边框
'
,
desc
:
'
细边框
'
,
type
:
'
checkbox
'
},
{
key
:
'
loading
'
,
name
:
'
加载中
'
,
desc
:
'
是否显示为加载状态
'
,
type
:
'
checkbox
'
},
{
key
:
'
loadingText
'
,
name
:
'
加载文字
'
,
desc
:
'
加载状态提示文字
'
,
type
:
'
text
'
},
{
key
:
'
loadingType
'
,
name
:
'
加载图标类型
'
,
desc
:
''
,
options
:
[
'
circular
'
,
'
spinner
'
],
type
:
'
select
'
},
{
key
:
'
loadingSize
'
,
name
:
'
加载图标大小
'
,
desc
:
'
加载图标大小
'
,
type
:
'
text
'
}
],
value
:
{
type
:
'
default
'
,
size
:
'
normal
'
,
color
:
''
,
icon
:
''
,
block
:
false
,
shape
:
'
square
'
,
disabled
:
false
,
plain
:
false
,
hairline
:
false
,
loading
:
false
,
loadingText
:
''
,
loadingType
:
'
circular
'
,
loadingSize
:
'
20px
'
},
commonStyle
:
{}
},
{
eleName
:
'
cr-image
'
,
title
:
'
图片
'
,
h
:
140
,
config
:
[
{
key
:
'
width
'
,
name
:
'
宽度
'
,
type
:
'
text
'
},
{
key
:
'
height
'
,
name
:
'
高度
'
,
type
:
'
text
'
},
{
key
:
'
src
'
,
name
:
'
图片
'
,
type
:
'
Upload
'
},
],
value
:
{
width
:
'
5.067rem
'
,
height
:
'
3.733rem
'
,
src
:
'
https://appsync.lkbang.net/Fs0qmUsMry39AjHDf_W-qgn8XEy6
'
,
fit
:
'
contain
'
,
},
commonStyle
:
{}
},
{
eleName
:
'
cr-nav-bar
'
,
title
:
'
NavBar 导航栏
'
,
h
:
48
,
config
:
[
{
key
:
'
title
'
,
name
:
'
标题
'
,
desc
:
'
标题
'
,
propType
:
'
string
'
,
options
:
[],
type
:
'
text
'
},
{
key
:
'
leftText
'
,
name
:
'
左侧文案
'
,
desc
:
'
左侧文案
'
,
propType
:
'
string
'
,
options
:
[],
type
:
'
text
'
},
{
key
:
'
rightText
'
,
name
:
'
右侧文案
'
,
desc
:
'
右侧文案
'
,
default
:
''
,
options
:
[
'
info
'
,
'
danger
'
,
'
primary
'
,
'
warning
'
],
type
:
'
text
'
},
{
key
:
'
leftArrow
'
,
name
:
'
左侧箭头
'
,
desc
:
'
是否显示左侧箭头
'
,
propType
:
'
boolean
'
,
options
:
[],
type
:
'
checkbox
'
},
{
key
:
'
border
'
,
name
:
'
边框
'
,
desc
:
'
是否显示下边框
'
,
propType
:
'
boolean
'
,
options
:
[],
type
:
'
checkbox
'
},
{
key
:
'
fixed
'
,
name
:
'
固定导航栏
'
,
desc
:
'
是否固定导航栏
'
,
propType
:
'
boolean
'
,
options
:
[],
type
:
'
checkbox
'
},
{
key
:
'
zIndex
'
,
name
:
'
z-index
'
,
desc
:
'
元素z-index
'
,
propType
:
[
'
number
'
,
'
string
'
],
options
:
[],
type
:
'
text
'
}
],
value
:
{
title
:
''
,
leftText
:
'
返回
'
,
rightText
:
''
,
leftArrow
:
true
,
border
:
true
,
fixed
:
true
,
zIndex
:
'
9999
'
},
commonStyle
:
{}
}
];
export
const
businessComponents
=
[
{
...
...
app/web/page/activity/view/activity/index.ts
View file @
605a9e1a
...
...
@@ -23,7 +23,7 @@ export default class Activity extends Vue {
@
Watch
(
'
pageName
'
,
{
immediate
:
true
})
onPageNameChange
(
newVal
)
{
if
(
newVal
)
{
if
(
EASY_ENV_IS_BROWSER
&&
newVal
)
{
document
.
title
=
newVal
;
// 如果是 iOS 设备,则使用如下 hack 的写法实现页面标题的更新
if
(
navigator
.
userAgent
.
match
(
/
\(
i
[^
;
]
+;
(
U;
)?
CPU.+Mac OS X/
))
{
...
...
app/web/page/editor/component/DynamicForm/index.ts
View file @
605a9e1a
...
...
@@ -119,6 +119,9 @@ export default class DynamicForm extends Mixins(ContextMenu) {
case
'
number
'
:
result
=
'
Number
'
;
break
;
case
'
Upload
'
:
result
=
'
Upload
'
;
break
;
}
return
result
;
}
...
...
app/web/page/editor/component/FreedomContainer/index.ts
View file @
605a9e1a
...
...
@@ -16,6 +16,8 @@ export default class FreedomContainer extends Mixins(ContextMenu) {
@
Prop
({
type
:
Boolean
,
default
:
false
})
showHeader
;
@
Prop
(
String
)
backgroundImage
;
dots
:
object
=
{};
mousedown
(
childIndex
,
event
)
{
this
.
setDragable
(
false
);
const
childItem
=
cloneDeep
(
this
.
childItem
);
...
...
@@ -63,7 +65,7 @@ export default class FreedomContainer extends Mixins(ContextMenu) {
@
Watch
(
'
curChildIndex
'
)
onIndexChange
(
newVal
)
{
this
.
childItem
.
child
.
forEach
(
item
=>
delete
item
.
dots
)
;
this
.
dots
=
{}
;
if
(
newVal
||
newVal
===
0
)
{
this
.
setPointStyle
();
}
...
...
@@ -74,14 +76,12 @@ export default class FreedomContainer extends Mixins(ContextMenu) {
this
.
$nextTick
(()
=>
{
const
points
=
[
'
lt
'
,
'
rt
'
,
'
lb
'
,
'
rb
'
,
'
l
'
,
'
r
'
,
'
t
'
,
'
b
'
];
const
[
height
,
width
]
=
this
.
getHW
(
this
.
curChildIndex
);
const
dots
=
points
.
reduce
((
pre
,
cur
)
=>
{
this
.
dots
[
this
.
curChildIndex
]
=
points
.
reduce
((
pre
,
cur
)
=>
{
pre
[
cur
]
=
convertPointStyle
(
cur
,
{
height
,
width
});
return
pre
;
},
{});
const
childEle
=
this
.
childItem
.
child
[
this
.
curChildIndex
];
// this.updatePageInfo({ containerIndex: this.containerIndex, childIndex: this.curChildIndex, data: { ...childEle, commonStyle: { ...childEle.commonStyle, height: +height, width: +width } } });
this
.
updateCommonStyle
({
containerIndex
:
this
.
containerIndex
,
childIndex
:
this
.
curChildIndex
,
data
:
{
...
childEle
.
commonStyle
,
height
:
+
height
,
width
:
+
width
}});
this
.
$set
(
this
.
childItem
.
child
[
this
.
curChildIndex
],
'
dots
'
,
dots
);
});
}
...
...
app/web/page/editor/component/FreedomContainer/index.vue
View file @
605a9e1a
...
...
@@ -4,7 +4,7 @@
<div
v-for=
"(item, index) in childItem.child"
:style=
"transformStyle(item.commonStyle, 'container')"
:class=
"['freedom-body-item',
{ 'Fb-item_selected': curChildIndex === index }]" :key="index" @click.stop="handleElementClick(containerIndex, index)" @mousedown.stop="mousedown(index, $event)" @contextmenu.prevent.stop="show($event, containerIndex, index)">
<component
ref=
"childComponent"
:style=
"transformStyle(item.commonStyle, 'component')"
:is=
"item.name"
v-bind=
"item.props"
></component>
<div
class=
"freedom-body-dot"
v-for=
"(style, key) in
item.dots
"
v-for=
"(style, key) in
dots[index]
"
:key=
"key"
:style=
"style"
@
mousedown.stop.prevent=
"handleMouseDownOnPoint(key, $event)"
/>
...
...
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