提交 74006adc authored 作者: fit2cloud-chenyw's avatar fit2cloud-chenyw

feat: 增加忽略eslient扫描注释

上级 7399b5eb
...@@ -911,6 +911,7 @@ export default { ...@@ -911,6 +911,7 @@ export default {
}, },
// 外部传参改动x // 外部传参改动x
moveHorizontally(val) { moveHorizontally(val) {
// eslint-disable-next-line no-unused-vars
const [deltaX, _] = snapToGrid(this.grid, val, this.top, this.scale) const [deltaX, _] = snapToGrid(this.grid, val, this.top, this.scale)
const left = restrictToBounds(deltaX, this.bounds.minLeft, this.bounds.maxLeft) const left = restrictToBounds(deltaX, this.bounds.minLeft, this.bounds.maxLeft)
this.left = left this.left = left
...@@ -918,6 +919,7 @@ export default { ...@@ -918,6 +919,7 @@ export default {
}, },
// 外部传参改动y // 外部传参改动y
moveVertically(val) { moveVertically(val) {
// eslint-disable-next-line no-unused-vars
const [_, deltaY] = snapToGrid(this.grid, this.left, val, this.scale) const [_, deltaY] = snapToGrid(this.grid, this.left, val, this.scale)
const top = restrictToBounds(deltaY, this.bounds.minTop, this.bounds.maxTop) const top = restrictToBounds(deltaY, this.bounds.minTop, this.bounds.maxTop)
this.top = top this.top = top
...@@ -926,6 +928,7 @@ export default { ...@@ -926,6 +928,7 @@ export default {
// 控制柄移动 // 控制柄移动
handleResize(e) { handleResize(e) {
const handle = this.handle const handle = this.handle
// eslint-disable-next-line no-unused-vars
const scaleRatio = this.scaleRatio const scaleRatio = this.scaleRatio
const { TL, TR, BL, BR } = this const { TL, TR, BL, BR } = this
let { x: mouseX, y: mouseY } = this.getMouseCoordinate(e) let { x: mouseX, y: mouseY } = this.getMouseCoordinate(e)
...@@ -1085,6 +1088,7 @@ export default { ...@@ -1085,6 +1088,7 @@ export default {
changeWidth(val) { changeWidth(val) {
// console.log('parentWidth', this.parentWidth) // console.log('parentWidth', this.parentWidth)
// console.log('parentHeight', this.parentHeight) // console.log('parentHeight', this.parentHeight)
// eslint-disable-next-line no-unused-vars
const [newWidth, _] = snapToGrid(this.grid, val, 0, this.scale) const [newWidth, _] = snapToGrid(this.grid, val, 0, this.scale)
// const right = restrictToBounds(this.parentWidth - newWidth - this.left, this.bounds.minRight, this.bounds.maxRight) // const right = restrictToBounds(this.parentWidth - newWidth - this.left, this.bounds.minRight, this.bounds.maxRight)
// private 将 this.bounds.minRight 设置为0 // private 将 this.bounds.minRight 设置为0
...@@ -1102,6 +1106,7 @@ export default { ...@@ -1102,6 +1106,7 @@ export default {
this.height = height this.height = height
}, },
changeHeight(val) { changeHeight(val) {
// eslint-disable-next-line no-unused-vars
const [_, newHeight] = snapToGrid(this.grid, 0, val, this.scale) const [_, newHeight] = snapToGrid(this.grid, 0, val, this.scale)
// const bottom = restrictToBounds(this.parentHeight - newHeight - this.top, this.bounds.minBottom, this.bounds.maxBottom) // const bottom = restrictToBounds(this.parentHeight - newHeight - this.top, this.bounds.minBottom, this.bounds.maxBottom)
// private 将 this.bounds.minBottom 设置为0 // private 将 this.bounds.minBottom 设置为0
...@@ -1418,6 +1423,7 @@ export default { ...@@ -1418,6 +1423,7 @@ export default {
}, },
// 修复 正则获取left与top // 修复 正则获取left与top
formatTransformVal(string) { formatTransformVal(string) {
// eslint-disable-next-line prefer-const
let [left, top, rotate = 0] = string.match(/[\d|\.]+/g) let [left, top, rotate = 0] = string.match(/[\d|\.]+/g)
if (top === undefined) top = 0 if (top === undefined) top = 0
return [Number(left), Number(top), rotate] return [Number(left), Number(top), rotate]
......
...@@ -14,7 +14,9 @@ export default { ...@@ -14,7 +14,9 @@ export default {
components: { DeComplexOperator }, components: { DeComplexOperator },
// mixins: [mixins], // mixins: [mixins],
props: { props: {
// eslint-disable-next-line vue/require-default-prop
field: String, field: String,
// eslint-disable-next-line vue/require-default-prop
label: String, label: String,
defaultOperator: { defaultOperator: {
type: String, type: String,
......
...@@ -30,8 +30,11 @@ export default { ...@@ -30,8 +30,11 @@ export default {
event: 'change' event: 'change'
}, },
props: { props: {
// eslint-disable-next-line vue/require-default-prop
label: String, label: String,
// eslint-disable-next-line vue/require-default-prop
operator: String, operator: String,
// eslint-disable-next-line vue/require-default-prop
operators: Array operators: Array
}, },
data() { data() {
......
...@@ -14,13 +14,16 @@ ...@@ -14,13 +14,16 @@
export default { export default {
props: { props: {
start: { start: {
type: Object type: Object,
default: null
}, },
width: { width: {
type: Number type: Number,
default: null
}, },
height: { height: {
type: Number type: Number,
default: null
} }
} }
} }
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
export default { export default {
props: { props: {
// eslint-disable-next-line vue/require-default-prop
matrixStyle: { matrixStyle: {
type: Object type: Object
} }
......
...@@ -25,6 +25,7 @@ export default { ...@@ -25,6 +25,7 @@ export default {
type: Array, type: Array,
default: () => [] default: () => []
}, },
// eslint-disable-next-line vue/require-default-prop
element: { element: {
type: Object type: Object
} }
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
<script> <script>
export default { export default {
props: { props: {
// eslint-disable-next-line vue/require-default-prop
propValue: { propValue: {
type: String, type: String,
require: true require: true
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
<script> <script>
export default { export default {
props: { props: {
// eslint-disable-next-line vue/require-default-prop
element: { element: {
type: Object type: Object
} }
......
...@@ -25,10 +25,12 @@ import { keycodes } from '@/components/canvas/utils/shortcutKey.js' ...@@ -25,10 +25,12 @@ import { keycodes } from '@/components/canvas/utils/shortcutKey.js'
export default { export default {
props: { props: {
// eslint-disable-next-line vue/require-default-prop
propValue: { propValue: {
type: String, type: String,
require: true require: true
}, },
// eslint-disable-next-line vue/require-default-prop
element: { element: {
type: Object type: Object
}, },
...@@ -68,17 +70,17 @@ export default { ...@@ -68,17 +70,17 @@ export default {
}, },
handleKeydown(e) { handleKeydown(e) {
if (e.keyCode == this.ctrlKey) { if (e.keyCode === this.ctrlKey) {
this.isCtrlDown = true this.isCtrlDown = true
} else if (this.isCtrlDown && this.canEdit && keycodes.includes(e.keyCode)) { } else if (this.isCtrlDown && this.canEdit && keycodes.includes(e.keyCode)) {
e.stopPropagation() e.stopPropagation()
} else if (e.keyCode == 46) { // deleteKey } else if (e.keyCode === 46) { // deleteKey
e.stopPropagation() e.stopPropagation()
} }
}, },
handleKeyup(e) { handleKeyup(e) {
if (e.keyCode == this.ctrlKey) { if (e.keyCode === this.ctrlKey) {
this.isCtrlDown = false this.isCtrlDown = false
} }
}, },
......
...@@ -38,6 +38,7 @@ import generateID from '@/utils/generateID' ...@@ -38,6 +38,7 @@ import generateID from '@/utils/generateID'
import { listenGlobalKeyDown } from '@/utils/shortcutKey' import { listenGlobalKeyDown } from '@/utils/shortcutKey'
export default { export default {
// eslint-disable-next-line vue/no-unused-components
components: { Editor, ComponentList, AttrList, AnimationList, EventList, Toolbar }, components: { Editor, ComponentList, AttrList, AnimationList, EventList, Toolbar },
data() { data() {
return { return {
...@@ -71,6 +72,7 @@ export default { ...@@ -71,6 +72,7 @@ export default {
resetID(data) { resetID(data) {
if (data) { if (data) {
data.forEach(item => { data.forEach(item => {
// eslint-disable-next-line no-undef
item.type !== 'custom' && (item.id = uuid.v1()) item.type !== 'custom' && (item.id = uuid.v1())
}) })
} }
...@@ -85,7 +87,7 @@ export default { ...@@ -85,7 +87,7 @@ export default {
let component let component
const id = e.dataTransfer.getData('componentId') const id = e.dataTransfer.getData('componentId')
componentList.forEach(componentTemp => { componentList.forEach(componentTemp => {
if (id == componentTemp.id) { if (id === componentTemp.id) {
component = deepCopy(componentTemp) component = deepCopy(componentTemp)
} }
}) })
...@@ -112,7 +114,7 @@ export default { ...@@ -112,7 +114,7 @@ export default {
} }
// 0 左击 1 滚轮 2 右击 // 0 左击 1 滚轮 2 右击
if (e.button != 2) { if (e.button !== 2) {
this.$store.commit('hideContextMenu') this.$store.commit('hideContextMenu')
} }
} }
......
...@@ -77,7 +77,7 @@ export default { ...@@ -77,7 +77,7 @@ export default {
batchDeleteComponent({ componentData }, deleteData) { batchDeleteComponent({ componentData }, deleteData) {
deleteData.forEach(component => { deleteData.forEach(component => {
for (let i = 0, len = componentData.length; i < len; i++) { for (let i = 0, len = componentData.length; i < len; i++) {
if (component.id == componentData[i].id) { if (component.id === componentData[i].id) {
componentData.splice(i, 1) componentData.splice(i, 1)
break break
} }
......
...@@ -56,9 +56,9 @@ let isCtrlDown = false ...@@ -56,9 +56,9 @@ let isCtrlDown = false
export function listenGlobalKeyDown() { export function listenGlobalKeyDown() {
window.onkeydown = (e) => { window.onkeydown = (e) => {
const { curComponent } = store.state const { curComponent } = store.state
if (e.keyCode == ctrlKey) { if (e.keyCode === ctrlKey) {
isCtrlDown = true isCtrlDown = true
} else if (e.keyCode == deleteKey && curComponent) { } else if (e.keyCode === deleteKey && curComponent) {
store.commit('deleteComponent') store.commit('deleteComponent')
store.commit('recordSnapshot') store.commit('recordSnapshot')
} else if (isCtrlDown) { } else if (isCtrlDown) {
...@@ -73,7 +73,7 @@ export function listenGlobalKeyDown() { ...@@ -73,7 +73,7 @@ export function listenGlobalKeyDown() {
} }
window.onkeyup = (e) => { window.onkeyup = (e) => {
if (e.keyCode == ctrlKey) { if (e.keyCode === ctrlKey) {
isCtrlDown = false isCtrlDown = false
} }
} }
...@@ -109,7 +109,7 @@ function compose() { ...@@ -109,7 +109,7 @@ function compose() {
function decompose() { function decompose() {
const curComponent = store.state.curComponent const curComponent = store.state.curComponent
if (curComponent && !curComponent.isLock && curComponent.component == 'Group') { if (curComponent && !curComponent.isLock && curComponent.component === 'Group') {
store.commit('decompose') store.commit('decompose')
store.commit('recordSnapshot') store.commit('recordSnapshot')
} }
......
...@@ -33,7 +33,7 @@ export function getStyle(style, filter = []) { ...@@ -33,7 +33,7 @@ export function getStyle(style, filter = []) {
// 获取一个组件旋转 rotate 后的样式 // 获取一个组件旋转 rotate 后的样式
export function getComponentRotatedStyle(style) { export function getComponentRotatedStyle(style) {
style = { ...style } style = { ...style }
if (style.rotate != 0) { if (style.rotate !== 0) {
const newWidth = style.width * cos(style.rotate) + style.height * sin(style.rotate) const newWidth = style.width * cos(style.rotate) + style.height * sin(style.rotate)
const diffX = (style.width - newWidth) / 2 // 旋转后范围变小是正值,变大是负值 const diffX = (style.width - newWidth) / 2 // 旋转后范围变小是正值,变大是负值
style.left += diffX style.left += diffX
......
function checkDataPermission(el, binding, vnode) { function checkDataPermission(el, binding, vnode) {
// eslint-disable-next-line no-unused-vars
const dataPermission = vnode.privileges const dataPermission = vnode.privileges
// eslint-disable-next-line no-unused-vars
const { value } = binding const { value } = binding
// // 数据授权采用并集的方式 部门 角色 用户 有一个有权限即可 // // 数据授权采用并集的方式 部门 角色 用户 有一个有权限即可
// if (value && value instanceof Array) { // if (value && value instanceof Array) {
......
...@@ -8,8 +8,7 @@ export default new Router({ ...@@ -8,8 +8,7 @@ export default new Router({
{ {
path: '/', path: '/',
name: 'home', name: 'home',
component: () => component: () => import('../views/link/index.vue'),
import('../views/link/index.vue'),
meta: { meta: {
title: '首页' title: '首页'
} }
......
...@@ -213,6 +213,7 @@ export function formatCondition(param) { ...@@ -213,6 +213,7 @@ export function formatCondition(param) {
return null return null
} }
const result = { conditions: [] } const result = { conditions: [] }
// eslint-disable-next-line no-unused-vars
for (const [key, value] of Object.entries(param)) { for (const [key, value] of Object.entries(param)) {
result.conditions.push(value) result.conditions.push(value)
} }
......
...@@ -9,6 +9,7 @@ export function hexColorToRGBA(hex, alpha) { ...@@ -9,6 +9,7 @@ export function hexColorToRGBA(hex, alpha) {
} }
if (/^#[0-9A-F]{6}$/i.test(hex)) { // 判断传入是否为#六位十六进制数 if (/^#[0-9A-F]{6}$/i.test(hex)) { // 判断传入是否为#六位十六进制数
hex.replace(/[0-9A-F]{2}/ig, function(kw) { hex.replace(/[0-9A-F]{2}/ig, function(kw) {
// eslint-disable-next-line no-eval
rgb.push(eval('0x' + kw)) // 十六进制转化为十进制并存如数组 rgb.push(eval('0x' + kw)) // 十六进制转化为十进制并存如数组
}) })
return `rgba(${rgb.join(',')},${alpha / 100})` // 输出RGB格式颜色 return `rgba(${rgb.join(',')},${alpha / 100})` // 输出RGB格式颜色
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论