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
369f6095
Commit
369f6095
authored
Jun 22, 2022
by
Xuguangxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 自由容器增加视频背景
parent
c47355b5
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
2 deletions
+34
-2
config.ts
app/web/lib/config.ts
+6
-0
index.vue
...e/editor/component/DynamicForm/component/Upload/index.vue
+15
-2
index.ts
app/web/page/editor/component/FreedomContainer/index.ts
+12
-0
index.vue
app/web/page/editor/component/FreedomContainer/index.vue
+1
-0
No files found.
app/web/lib/config.ts
View file @
369f6095
...
@@ -12,6 +12,12 @@ export const basicComponents = [
...
@@ -12,6 +12,12 @@ export const basicComponents = [
name
:
'
跳转链接
'
,
name
:
'
跳转链接
'
,
desc
:
'
跳转链接
'
,
desc
:
'
跳转链接
'
,
type
:
'
text
'
type
:
'
text
'
},
{
key
:
'
video
'
,
name
:
'
视频背景
'
,
desc
:
'
视频背景
'
,
type
:
'
upload
'
}
}
],
],
value
:
{
value
:
{
...
...
app/web/page/editor/component/DynamicForm/component/Upload/index.vue
View file @
369f6095
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<div>
<div>
<div
class=
"upload"
>
<div
class=
"upload"
>
<div
class=
"upload-img"
v-if=
"img"
>
<div
class=
"upload-img"
v-if=
"img"
>
<img
:src=
"img"
v-if=
"isUrl"
>
<img
:src=
"
fileType === 'video' ? `$
{img}?vframe/jpg/offset/1` :
img" v-if="isUrl">
<cr-icon
:type=
"img"
class=
"upload-img-none-icon"
v-else
/>
<cr-icon
:type=
"img"
class=
"upload-img-none-icon"
v-else
/>
<!--
<Icon
type=
"image"
size=
"20"
class=
"upload-img-none-icon"
></Icon>
-->
<!--
<Icon
type=
"image"
size=
"20"
class=
"upload-img-none-icon"
></Icon>
-->
<div
class=
"upload-img-cover"
>
<div
class=
"upload-img-cover"
>
...
@@ -38,7 +38,8 @@
...
@@ -38,7 +38,8 @@
return
{
return
{
id
:
uuidv4
().
substr
(
0
,
8
),
id
:
uuidv4
().
substr
(
0
,
8
),
percent
:
0
,
percent
:
0
,
img
:
this
.
value
img
:
this
.
value
,
fileType
:
''
}
}
},
},
computed
:
{
computed
:
{
...
@@ -104,17 +105,29 @@
...
@@ -104,17 +105,29 @@
},
},
BeforeUpload
:
(
up
,
file
)
=>
{
BeforeUpload
:
(
up
,
file
)
=>
{
const
{
type
,
size
}
=
file
;
const
{
type
,
size
}
=
file
;
console
.
log
(
type
);
let
limit
=
0
;
let
limit
=
0
;
let
fileType
=
''
;
// 来自量子积木v1.5需求中的优化点
// 来自量子积木v1.5需求中的优化点
if
(
type
===
'
image/gif
'
)
{
if
(
type
===
'
image/gif
'
)
{
// gif限制5M
// gif限制5M
this
.
fileType
=
'
image
'
;
limit
=
5
*
1024
*
1024
;
limit
=
5
*
1024
*
1024
;
if
(
size
>
limit
)
{
if
(
size
>
limit
)
{
this
.
$toast
(
'
gif图大小不允许超过5Mb
'
);
this
.
$toast
(
'
gif图大小不允许超过5Mb
'
);
return
false
;
return
false
;
}
}
}
else
if
(
type
.
toLowerCase
().
indexOf
(
'
video/
'
)
===
0
)
{
// 视频文件,限制4M
this
.
fileType
=
'
video
'
;
limit
=
4
*
1024
*
1024
;
if
(
size
>
limit
)
{
this
.
$toast
(
'
文件大小不允许超过4Mb
'
);
return
false
;
}
}
else
{
}
else
{
// 其他格式限制800KB
// 其他格式限制800KB
this
.
fileType
=
'
image
'
;
limit
=
800
*
1024
;
limit
=
800
*
1024
;
if
(
size
>
limit
)
{
if
(
size
>
limit
)
{
this
.
$toast
(
'
文件大小不允许超过800Kb
'
);
this
.
$toast
(
'
文件大小不允许超过800Kb
'
);
...
...
app/web/page/editor/component/FreedomContainer/index.ts
View file @
369f6095
...
@@ -84,6 +84,18 @@ export default class FreedomContainer extends Mixins(ContextMenuMixin, Transform
...
@@ -84,6 +84,18 @@ export default class FreedomContainer extends Mixins(ContextMenuMixin, Transform
});
});
}
}
videoOnload
()
{
if
(
this
.
$refs
.
videoBackground
)
{
// const childEle = this.childItem.child[this.curChildIndex];
console
.
log
(
this
.
childItem
);
const
height
=
this
.
$refs
.
videoBackground
.
offsetHeight
;
this
.
updateCommonStyle
({
containerIndex
:
this
.
containerIndex
,
childIndex
:
this
.
curChildIndex
,
data
:
{
...
this
.
childItem
.
commonStyle
,
height
:
+
height
}});
this
.
$nextTick
(()
=>
{
this
.
adjustHeight
();
});
}
}
// 获取point计算后样式
// 获取point计算后样式
setPointStyle
()
{
setPointStyle
()
{
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
...
...
app/web/page/editor/component/FreedomContainer/index.vue
View file @
369f6095
<
template
>
<
template
>
<div
class=
"freedom"
:ref=
"`freedomContainer$
{containerIndex}`" @click.stop="handleElementClick(containerIndex)">
<div
class=
"freedom"
:ref=
"`freedomContainer$
{containerIndex}`" @click.stop="handleElementClick(containerIndex)">
<video
width=
"100%"
@
loadeddata=
"videoOnload"
ref=
"videoBackground"
height=
"auto"
style=
"position: absolute; top: 0; left: 0"
v-if=
"childItem.props.video"
:src=
"childItem.props.video"
autoplay
loop
muted
/>
<div
class=
"freedom-body"
:data-index=
"containerIndex"
>
<div
class=
"freedom-body"
:data-index=
"containerIndex"
>
<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.prevent="mousedown(index, $event)" @contextmenu.prevent.stop="show($event, containerIndex, index)">
<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.prevent="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>
<component
ref=
"childComponent"
:style=
"transformStyle(item.commonStyle, 'component')"
:is=
"item.name"
v-bind=
"item.props"
></component>
...
...
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