dataease-dm/frontend/src/components/canvas/custom-component/component-list.js

345 lines
6.3 KiB
JavaScript
Raw Normal View History

2021-03-25 19:16:32 +08:00
// 公共样式
export const commonStyle = {
rotate: 0,
opacity: 1,
borderStyle: 'solid',
borderWidth: 0,
borderRadius: 0
2021-03-25 19:16:32 +08:00
}
export const commonAttr = {
animations: [],
events: {},
groupStyle: {}, // 当一个组件成为 Group 的子组件时使用
isLock: false // 是否锁定组件
}
2021-10-14 16:44:51 +08:00
// 超链接配置
export const HYPERLINKS = {
openMode: '_blank',
enable: false,
content: 'http://'
}
2021-11-08 19:03:09 +08:00
// 视频信息配置
export const VIDEOLINKS = {
2021-11-09 16:23:50 +08:00
videoType: 'web',
web: {
autoplay: true,
muted: true,
loop: true,
controlBar: {
2021-11-16 16:49:15 +08:00
timeDivider: false,
durationDisplay: false,
remainingTimeDisplay: false,
currentTimeDisplay: false, // 当前时间
volumeControl: false, // 声音控制键
2021-11-09 16:23:50 +08:00
fullscreenToggle: false
},
sources: [{
}]
2021-11-08 19:03:09 +08:00
},
2021-11-09 16:23:50 +08:00
rtmp: {
sources: [{
type: 'rtmp/mp4'
}],
techOrder: ['flash'],
autoplay: false,
controls: true,
flash: {
hls: {
withCredentials: false
}
}
}
2021-11-08 19:03:09 +08:00
}
export const assistList = [
{
id: '10001',
component: 'v-text',
type: 'v-text',
label: '文字',
icon: 'iconfont icon-text',
defaultClass: 'text-filter'
},
{
id: '10004',
component: 'rect-shape',
type: 'rect-shape',
label: '矩形',
icon: 'iconfont icon-juxing',
defaultClass: 'text-filter'
2021-08-31 15:57:14 +08:00
},
{
id: '10006',
component: 'de-tabs',
type: 'de-tabs',
label: '选项卡',
2021-09-23 15:37:40 +08:00
icon: 'iconfont icon-tabs',
2021-08-31 15:57:14 +08:00
defaultClass: 'text-filter'
}
2021-10-19 15:00:24 +08:00
]
export const pictureList = [
{
id: '20001',
2021-06-21 15:33:10 +08:00
component: 'picture-add',
type: 'picture-add',
label: '拖拽上传',
icon: 'iconfont icon-picture',
defaultClass: 'text-filter'
2021-11-08 19:03:09 +08:00
},
{
id: '20002',
component: 'video',
type: 'video',
label: '视频',
icon: 'iconfont icon-video',
defaultClass: 'text-filter'
}
]
2021-10-19 15:00:24 +08:00
export const dateList = [
{
id: '30001',
component: 'de-show-date',
type: 'de-show-date',
label: '时间',
icon: 'iconfont icon-shijian',
defaultClass: 'text-filter'
}
]
2021-03-25 19:16:32 +08:00
// 编辑器左侧组件列表
const list = [
{
2021-03-26 11:37:32 +08:00
id: '10001',
2021-03-25 19:16:32 +08:00
component: 'v-text',
label: '文字',
2021-06-21 12:39:24 +08:00
propValue: '双击输入文字',
2021-03-25 19:16:32 +08:00
icon: 'wenben',
type: 'v-text',
2021-03-25 19:16:32 +08:00
style: {
width: 400,
2021-06-21 12:39:24 +08:00
height: 100,
fontSize: 22,
fontWeight: 400,
2021-03-25 19:16:32 +08:00
lineHeight: '',
letterSpacing: 0,
textAlign: 'center',
color: '#000000',
verticalAlign: 'middle',
backgroundColor: '#ffffff',
borderRadius: 0
2021-10-09 00:02:06 +08:00
},
2021-10-14 16:44:51 +08:00
hyperlinks: HYPERLINKS,
2021-10-09 00:02:06 +08:00
x: 1,
y: 1,
sizex: 10,
sizey: 2
2021-03-25 19:16:32 +08:00
},
{
2021-03-26 11:37:32 +08:00
id: '10002',
2021-03-25 19:16:32 +08:00
component: 'v-button',
label: '按钮',
propValue: '按钮',
icon: 'button',
type: 'v-button',
2021-03-25 19:16:32 +08:00
style: {
width: 100,
height: 34,
borderWidth: '',
borderColor: '',
borderRadius: '',
fontSize: 14,
fontWeight: 400,
2021-03-25 19:16:32 +08:00
lineHeight: '',
letterSpacing: 0,
textAlign: '',
color: '',
backgroundColor: ''
}
},
{
2021-03-26 11:37:32 +08:00
id: '10003',
2021-03-25 19:16:32 +08:00
component: 'Picture',
label: '图片',
icon: 'tupian',
type: 'Picture',
2021-03-30 15:38:32 +08:00
propValue: require('@/components/canvas/assets/title.jpg'),
2021-03-25 19:16:32 +08:00
style: {
width: 300,
height: 200,
borderRadius: ''
2021-10-09 00:02:06 +08:00
},
x: 1,
y: 1,
sizex: 10,
sizey: 6
2021-03-25 19:16:32 +08:00
},
{
2021-03-26 11:37:32 +08:00
id: '10003-1',
component: 'Picture',
label: '背景-科技1',
icon: 'tupian',
type: 'Picture',
2021-03-30 15:38:32 +08:00
propValue: require('@/components/canvas/assets/bg-kj-1.jpg'),
2021-03-26 11:37:32 +08:00
style: {
borderStyle: 'solid',
borderWidth: 0,
2021-03-26 11:37:32 +08:00
width: 600,
height: 300,
borderRadius: ''
}
},
{
id: '10004',
2021-03-25 19:16:32 +08:00
component: 'rect-shape',
label: '矩形',
propValue: '',
2021-03-25 19:16:32 +08:00
icon: 'juxing',
type: 'rect-shape',
2021-03-25 19:16:32 +08:00
style: {
2021-10-09 00:02:06 +08:00
width: 300,
height: 200,
borderStyle: 'solid',
borderWidth: 0,
borderColor: '#000000',
backgroundColor: '#ffffff',
borderRadius: 0
2021-10-09 00:02:06 +08:00
},
x: 1,
y: 1,
sizex: 10,
sizey: 6
2021-03-25 19:16:32 +08:00
},
{
2021-03-26 11:37:32 +08:00
id: '10005',
2021-06-21 14:00:03 +08:00
component: 'user-view',
2021-03-25 19:16:32 +08:00
label: '用户视图',
propValue: '',
icon: 'juxing',
type: 'view',
style: {
2021-10-09 00:02:06 +08:00
width: 300,
height: 200,
borderRadius: ''
2021-10-09 00:02:06 +08:00
},
x: 1,
y: 36,
2021-10-09 00:02:06 +08:00
sizex: 10,
sizey: 6,
auxiliaryMatrix: true
2021-06-21 15:33:10 +08:00
},
2021-08-31 15:57:14 +08:00
{
id: '10006',
component: 'de-tabs',
label: '选项卡',
propValue: '',
2021-09-23 15:37:40 +08:00
icon: 'tabs',
2021-08-31 15:57:14 +08:00
type: 'de-tabs',
style: {
width: 200,
height: 200,
borderStyle: 'solid',
borderWidth: 0,
2021-08-31 15:57:14 +08:00
borderColor: '#000000',
backgroundColor: '#ffffff',
borderRadius: 0
2021-09-23 15:30:11 +08:00
},
options: {
tabList: [{
title: 'Tab1',
name: '1',
content: null
}]
2021-10-09 00:02:06 +08:00
},
x: 1,
y: 1,
sizex: 10,
sizey: 10
2021-08-31 15:57:14 +08:00
},
2021-10-19 15:00:24 +08:00
{
id: '30001',
component: 'de-show-date',
label: '时间',
propValue: '',
icon: 'shijian',
type: 'de-show-date',
style: {
width: 250,
height: 100,
fontSize: 22,
fontWeight: 400,
lineHeight: '',
letterSpacing: 0,
textAlign: 'center',
color: '#000000',
verticalAlign: 'middle',
backgroundColor: '#ffffff',
borderStyle: 'solid',
borderColor: '#000000',
2021-10-21 17:46:24 +08:00
borderRadius: 0,
/* margin: 10, */
time_margin: 0
2021-10-19 15:00:24 +08:00
},
formatInfo: {
openMode: '0',
showWeek: false,
showDate: true,
dateFormat: 'yyyy年-MM月-dd日',
timeFormat: 'hh:mm:ss'
},
x: 1,
y: 1,
sizex: 10,
sizey: 2
},
2021-06-21 15:33:10 +08:00
{
id: '20001',
component: 'picture-add',
type: 'picture-add',
label: '拖拽上传',
icon: 'iconfont icon-picture',
defaultClass: 'text-filter',
style: {
width: 400,
height: 200,
borderRadius: ''
2021-10-09 00:02:06 +08:00
},
x: 1,
y: 1,
sizex: 10,
sizey: 5
2021-11-08 19:03:09 +08:00
},
{
id: '20002',
component: 'de-video',
type: 'de-video',
label: '',
icon: 'iconfont icon-picture',
defaultClass: 'text-filter',
style: {
width: 400,
height: 200,
borderRadius: ''
},
videoLinks: VIDEOLINKS,
x: 1,
y: 1,
sizex: 10,
sizey: 5
2021-03-25 19:16:32 +08:00
}
]
for (let i = 0, len = list.length; i < len; i++) {
const item = list[i]
item.style = { ...commonStyle, ...item.style }
list[i] = { ...commonAttr, ...item }
}
export default list