style: lint fix

This commit is contained in:
zxc 2024-09-15 11:37:49 +08:00
parent 58e81c4227
commit 51ad1a8244
7 changed files with 16 additions and 20 deletions

View File

@ -42,7 +42,7 @@ module.exports = {
'default-case': 'error',
'consistent-this': ['error', '_this'],
'max-depth': ['error', 8],
'max-lines': ['error', 800],
'max-lines': ['error', 1000],
'no-multi-str': 'error',
'space-infix-ops': 'error',
'space-before-blocks': ['error', 'always'],

View File

@ -49,13 +49,10 @@
</template>
<script lang="ts" setup>
import { computed, onMounted, onUnmounted, ref } from 'vue'
import { computed, onMounted, onUnmounted, ref, watch, nextTick, onBeforeUnmount } from 'vue'
import Popover from './Popover.vue'
import Input from './Input.vue'
import Divider from './Divider.vue'
import { watch } from 'vue';
import { nextTick } from 'vue';
import { onBeforeUnmount } from 'vue';
interface SelectOption {
label: string

View File

@ -1,4 +1,3 @@
import { computed } from 'vue'
import { storeToRefs } from 'pinia'
import { nanoid } from 'nanoid'
import { useSlidesStore, useMainStore } from '@/store'

View File

@ -22,7 +22,7 @@ import type {
ChartOptions,
} from '@/types/slides'
const convertFontSizePtToPx = (html: string, ratio: number) => {
const convertFontSizePtToPx = (html: string, ratio: number) => {
return html.replace(/font-size:\s*([\d.]+)pt/g, (match, p1) => {
return `font-size: ${(parseFloat(p1) * ratio).toFixed(1)}px`
})

View File

@ -49,7 +49,7 @@ export default () => {
for (let i = startIndex; i < slides.value.length; i++) {
const slide = slides.value[i]
if(i !== startIndex && slide.sectionTag) break
if (i !== startIndex && slide.sectionTag) break
ids.push(slide.id)
}

View File

@ -165,9 +165,9 @@ export const useSlidesStore = defineStore('slides', {
deleteSlidesIndex.push(index)
const deletedSlideSection = slides[index].sectionTag
if(deletedSlideSection) {
if (deletedSlideSection) {
const handleSlideNext = slides[index + 1]
if(handleSlideNext && !handleSlideNext.sectionTag) {
if (handleSlideNext && !handleSlideNext.sectionTag) {
delete slides[index].sectionTag
slides[index + 1].sectionTag = deletedSlideSection
}

View File

@ -1,4 +1,4 @@
import * as echarts from 'echarts'
import type * as echarts from 'echarts'
import type { ChartData, ChartType } from '@/types/slides'
export interface ChartOptionPayload {
@ -18,7 +18,7 @@ export const getChartOption = ({
lineSmooth,
stack,
}: ChartOptionPayload): echarts.EChartsOption | null => {
if(type === 'bar') {
if (type === 'bar') {
return {
color: themeColors,
textStyle: textColor ? {
@ -57,7 +57,7 @@ export const getChartOption = ({
}),
}
}
if(type === 'column') {
if (type === 'column') {
return {
color: themeColors,
textStyle: textColor ? {
@ -96,7 +96,7 @@ export const getChartOption = ({
}),
}
}
if(type === 'line') {
if (type === 'line') {
return {
color: themeColors,
textStyle: textColor ? {
@ -136,7 +136,7 @@ export const getChartOption = ({
}),
}
}
if(type === 'pie') {
if (type === 'pie') {
return {
color: themeColors,
textStyle: textColor ? {
@ -178,7 +178,7 @@ export const getChartOption = ({
],
}
}
if(type === 'ring') {
if (type === 'ring') {
return {
color: themeColors,
textStyle: textColor ? {
@ -220,7 +220,7 @@ export const getChartOption = ({
],
}
}
if(type === 'area') {
if (type === 'area') {
return {
color: themeColors,
textStyle: textColor ? {
@ -261,7 +261,7 @@ export const getChartOption = ({
}),
}
}
if(type === 'radar') {
if (type === 'radar') {
// indicator 中不设置max时显示异常设置max后控制台警告无解等EChart官方修复此bug
// const values: number[] = []
// for (const item of data.series) {
@ -297,9 +297,9 @@ export const getChartOption = ({
],
}
}
if(type === 'scatter') {
if (type === 'scatter') {
const formatedData = []
for(let i = 0; i < data.series[0].length; i++) {
for (let i = 0; i < data.series[0].length; i++) {
const x = data.series[0][i]
const y = data.series[1] ? data.series[1][i] : x
formatedData.push([x, y])