提交 09aaaede authored 作者: junjie's avatar junjie

fix:代码规范

上级 076a66ed
......@@ -2,9 +2,9 @@
<div ref="rightPanel" :class="{show:show}" class="rightPanel-container">
<div class="rightPanel-background" />
<div class="rightPanel">
<!-- <div class="handle-button" :style="{'top':buttonTop+'px','background-color':theme}" @click="show=!show">-->
<!-- <i :class="show?'el-icon-close':'el-icon-setting'" />-->
<!-- </div>-->
<!-- <div class="handle-button" :style="{'top':buttonTop+'px','background-color':theme}" @click="show=!show">-->
<!-- <i :class="show?'el-icon-close':'el-icon-setting'" />-->
<!-- </div>-->
<div class="rightPanel-items">
<slot />
</div>
......
......@@ -21,9 +21,9 @@
<el-tab-pane v-for="item in animationClassData" :key="item.label" :label="item.label" :name="item.label">
<el-scrollbar class="animate-container">
<div
class="animate"
v-for="(animate, index) in item.children"
:key="index"
class="animate"
@mouseover="hoverPreviewAnimate = animate.value"
@click="addAnimation(animate)"
>
......@@ -52,11 +52,11 @@ export default {
hoverPreviewAnimate: '',
animationActiveName: '进入',
animationClassData,
showAnimatePanel: false,
showAnimatePanel: false
}
},
computed: mapState([
'curComponent',
'curComponent'
]),
methods: {
addAnimation(animate) {
......@@ -70,8 +70,8 @@ export default {
removeAnimation(index) {
this.$store.commit('removeAnimation', index)
},
},
}
}
}
</script>
......
......@@ -59,7 +59,7 @@ export default {
bus.$emit('component-dialog-edit')
}
//编辑样式组件
// 编辑样式组件
if (this.curComponent.type === 'v-text' || this.curComponent.type === 'rect-shape') {
bus.$emit('component-dialog-style')
......
......@@ -39,11 +39,11 @@ export default {
isShowEvent: false,
eventURL: '',
eventActiveName: 'redirect',
eventList,
eventList
}
},
computed: mapState([
'curComponent',
'curComponent'
]),
methods: {
addEvent(event, param) {
......@@ -53,8 +53,8 @@ export default {
removeEvent(event) {
this.$store.commit('removeEvent', event)
},
},
}
}
}
</script>
......
<template>
<div class="modal-bg" v-if="show" @click="hide">
<div v-if="show" class="modal-bg" @click="hide">
<div class="fadeInLeft animated modal" @click="stopPropagation">
<slot></slot>
<slot />
</div>
</div>
</template>
......@@ -10,13 +10,13 @@
export default {
model: {
prop: 'show',
event: 'change',
event: 'change'
},
props: {
show: {
type: Boolean,
default: false,
},
default: false
}
},
methods: {
hide() {
......@@ -25,8 +25,8 @@ export default {
stopPropagation(e) {
e.stopPropagation()
},
},
}
}
}
</script>
......
......@@ -9,9 +9,9 @@ export default {
props: {
propValue: {
type: String,
require: true,
},
},
require: true
}
}
}
</script>
......
......@@ -7,9 +7,9 @@ export default {
props: {
propValue: {
type: String,
default: '',
},
},
default: ''
}
}
}
</script>
......
......@@ -6,6 +6,6 @@ export default {
removeAnimation({ curComponent }, index) {
curComponent.animations.splice(index, 1)
},
},
}
}
}
......@@ -2,7 +2,7 @@ export default {
state: {
menuTop: 0, // 右击菜单数据
menuLeft: 0,
menuShow: false,
menuShow: false
},
mutations: {
showContextMenu(state, { top, left }) {
......@@ -13,6 +13,6 @@ export default {
hideContextMenu(state) {
state.menuShow = false
},
},
}
}
}
......@@ -6,6 +6,6 @@ export default {
removeEvent({ curComponent }, event) {
delete curComponent.events[event]
},
},
}
}
}
......@@ -6,6 +6,6 @@ export default {
unlock({ curComponent }) {
curComponent.isLock = false
},
},
}
}
}
......@@ -37,8 +37,8 @@ export default [
{ label: '向右滑动展开', value: 'slideInLeft' },
{ label: '向左滑动展开', value: 'slideInRight' },
{ label: '向上滑动展开', value: 'slideInUp' },
{ label: '向下滑动展开', value: 'slideInDown' },
],
{ label: '向下滑动展开', value: 'slideInDown' }
]
},
{
label: '强调',
......@@ -52,8 +52,8 @@ export default [
{ label: '放大晃动缩小', value: 'tada' },
{ label: '扇形摇摆', value: 'wobble' },
{ label: '左右上下晃动', value: 'jello' },
{ label: 'Y轴旋转', value: 'flip' },
],
{ label: 'Y轴旋转', value: 'flip' }
]
},
{
label: '退出',
......@@ -88,7 +88,7 @@ export default [
{ label: '向左滑动收起', value: 'slideOutLeft' },
{ label: '向右滑动收起', value: 'slideOutRight' },
{ label: '向上滑动收起', value: 'slideOutUp' },
{ label: '向下滑动收起', value: 'slideOutDown' },
],
},
{ label: '向下滑动收起', value: 'slideOutDown' }
]
}
]
......@@ -7,7 +7,7 @@ export default function decomposeComponent(component, editorRect, parentStyle) {
// 获取元素的中心点坐标
const center = {
x: componentRect.left - editorRect.left + componentRect.width / 2,
y: componentRect.top - editorRect.top + componentRect.height / 2,
y: componentRect.top - editorRect.top + componentRect.height / 2
}
component.style.rotate = mod360(component.style.rotate + parentStyle.rotate)
......
......@@ -10,11 +10,11 @@ const events = {
if (msg) {
alert(msg)
}
},
}
}
const mixins = {
methods: events,
methods: events
}
const eventList = [
......@@ -22,18 +22,18 @@ const eventList = [
key: 'redirect',
label: '跳转事件',
event: events.redirect,
param: '',
param: ''
},
{
key: 'alert',
label: 'alert 事件',
event: events.alert,
param: '',
},
param: ''
}
]
export {
mixins,
events,
eventList,
eventList
}
import store from '@/store'
import eventBus from '@/components/canvas/utils/eventBus'
const ctrlKey = 17,
vKey = 86, // 粘贴
cKey = 67, // 复制
xKey = 88, // 剪切
const ctrlKey = 17
const vKey = 86 // 粘贴
const cKey = 67 // 复制
const xKey = 88 // 剪切
yKey = 89, // 重做
zKey = 90, // 撤销
const yKey = 89 // 重做
const zKey = 90 // 撤销
gKey = 71, // 组合
bKey = 66, // 拆分
const gKey = 71 // 组合
const bKey = 66 // 拆分
lKey = 76, // 锁定
uKey = 85, // 解锁
const lKey = 76 // 锁定
const uKey = 85 // 解锁
sKey = 83, // 保存
pKey = 80, // 预览
dKey = 68, // 删除
deleteKey = 46, // 删除
eKey = 69 // 清空画布
const sKey = 83 // 保存
const pKey = 80 // 预览
const dKey = 68 // 删除
const deleteKey = 46 // 删除
const eKey = 69 // 清空画布
export const keycodes = [66, 67, 68, 69, 71, 76, 80, 83, 85, 86, 88, 89, 90]
......@@ -30,13 +30,13 @@ const basemap = {
[zKey]: undo,
[sKey]: save,
[pKey]: preview,
[eKey]: clearCanvas,
[eKey]: clearCanvas
}
// 组件锁定状态下可以执行的操作
const lockMap = {
...basemap,
[uKey]: unlock,
[uKey]: unlock
}
// 组件未锁定状态下可以执行的操作
......@@ -48,7 +48,7 @@ const unlockMap = {
[bKey]: decompose,
[dKey]: deleteComponent,
[deleteKey]: deleteComponent,
[lKey]: lock,
[lKey]: lock
}
let isCtrlDown = false
......
......@@ -4,6 +4,6 @@ export default function toast(message = '', type = 'error', duration = 1500) {
Message({
message,
type,
duration,
duration
})
}
export function deepCopy(target) {
if (typeof target == 'object') {
const result = Array.isArray(target)? [] : {}
if (typeof target === 'object') {
const result = Array.isArray(target) ? [] : {}
for (const key in target) {
if (typeof target[key] == 'object') {
if (typeof target[key] === 'object') {
result[key] = deepCopy(target[key])
} else {
result[key] = target[key]
......
......@@ -80,7 +80,7 @@ export default {
background: '0% 0% / cover rgb(239, 241, 244)'
}
if (this.subjectItemDetails) {
if (this.subjectItemDetails.panel.backgroundType === 'image'&&this.subjectItemDetails.panel.imageUrl) {
if (this.subjectItemDetails.panel.backgroundType === 'image' && this.subjectItemDetails.panel.imageUrl) {
style = {
width: '100%',
height: '100%',
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论