Skip to content

Commit 9c58877

Browse files
committed
refactor: eslint
1 parent 45dba83 commit 9c58877

File tree

10 files changed

+16
-20
lines changed

10 files changed

+16
-20
lines changed

frontend/src/views/dashboard/canvas/CanvasCore.vue

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,26 @@ const dashboardStore = dashboardStoreWithOut()
1111
const canvasLocked = ref(false) // Is the canvas movement locked, Default false
1212
const emits = defineEmits(['parentAddItemBox'])
1313
const { curComponentId, curComponent } = storeToRefs(dashboardStore)
14-
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
15-
let currentInstance
16-
// Props
14+
let currentInstance: any
1715
const props = defineProps({
1816
canvasId: {
1917
type: String,
2018
default: 'canvas-main',
2119
},
22-
// eslint-disable-next-line vue/require-default-prop
2320
parentConfigItem: {
2421
type: Object as PropType<CanvasItem>,
2522
required: false,
23+
default: null,
2624
},
27-
// eslint-disable-next-line vue/require-default-prop
2825
dashboardInfo: {
2926
type: Object,
3027
required: false,
28+
default: null,
3129
},
32-
// eslint-disable-next-line vue/require-default-prop
3330
canvasStyleData: {
3431
type: Object,
3532
required: false,
33+
default: null,
3634
},
3735
canvasComponentData: {
3836
type: Array as PropType<CanvasItem[]>,
@@ -122,7 +120,6 @@ const coordinates = ref<CanvasCoord[]>([])
122120
const infoBox = ref()
123121
124122
// Position data (non-reactive)
125-
126123
let lastTask: (() => void) | undefined = undefined
127124
let isOverlay = false
128125
let itemMaxX = 0
@@ -193,9 +190,9 @@ function addItemToPositionBox(item: CanvasItem) {
193190
for (let i = item.x - 1; i < item.x - 1 + item.sizeX; i++) {
194191
for (let j = item.y - 1; j < item.y - 1 + item.sizeY; j++) {
195192
if (pb[j] && pb[j][i]) {
196-
// Ensure the target location is valid
193+
// Ensure the target location is valid & Place the item in the corresponding position
197194
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
198-
pb[j][i].el = item // Place the item in the corresponding position
195+
pb[j][i].el = item
199196
}
200197
}
201198
}
@@ -935,7 +932,6 @@ function startMove(e: MouseEvent, item: CanvasItem, index: number) {
935932
if (curActiveMoveInSQTab) {
936933
if (curActiveMoveInSQTab.moveInActive) {
937934
const refTabInstance =
938-
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
939935
currentInstance.refs['shape_component_' + curActiveMoveInSQTab.id][0]
940936
refTabInstance.addTabItem(moveItem)
941937
removeItemById(moveItem.id)

frontend/src/views/dashboard/canvas/ResizeHandle.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function getPointStyle(point: string) {
4949
marginTop: '-4px',
5050
left: `${newLeft}`,
5151
top: `${newTop}`,
52-
// @ts-expect-error
52+
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
5353
cursor: `${cursors[point]}-resize`,
5454
}
5555
}

frontend/src/views/dashboard/common/ResourceGroupOpt.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ const optInit = (params: any) => {
6262
state.targetInfo = params.data
6363
state.nodeType = params.nodeType || 'folder'
6464
resourceDialogShow.value = true
65-
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
6665
resourceForm.name = params.name || getResourceNewName(params.opt)
6766
resourceForm.pid = params.pid || 'root'
6867
if (params.parentSelect) {

frontend/src/views/dashboard/common/ResourceTree.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ onMounted(() => {
209209
getTree()
210210
})
211211
212-
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
213212
const addOperation = (params: any) => {
214213
if (params.opt === 'newLeaf') {
215214
const newCanvasUrl = '#/canvas?opt=create' + (params?.id ? `&pid=${params?.id}` : '')

frontend/src/views/dashboard/components/sq-tab/index.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ function addTab() {
7272
}
7373
configItem.value.propValue.push(newTab)
7474
configItem.value.activeSubTabIndex = configItem.value.propValue.length - 1
75-
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
7675
editableTabsValue.value = newTab.name
7776
}
7877

frontend/src/views/dashboard/editor/DashboardEditor.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ onMounted(() => {
8888
nextTick(() => {
8989
if (dashboardEditorRef.value) {
9090
sizeInit()
91-
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
9291
nextTick(() => {
9392
if (canvasCoreRef.value) {
9493
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment

frontend/src/views/dashboard/editor/Toolbar.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import icon_undo_outlined from '@/assets/svg/icon_undo_outlined.svg'
1313
import icon_redo_outlined from '@/assets/svg/icon_redo_outlined.svg'
1414
import icon_left_outlined from '@/assets/svg/icon_left_outlined.svg'
1515
import { saveDashboardResource } from '@/views/dashboard/utils/canvasUtils.ts'
16+
import ChatChartSelection from '@/views/dashboard/editor/ChatChartSelection.vue'
1617
1718
const { t } = useI18n()
1819
const dashboardStore = dashboardStoreWithOut()
@@ -73,6 +74,8 @@ const groupOptFinish = (result: any) => {
7374
window.history.replaceState({ path: url }, '', url)
7475
}
7576
77+
const chartSelectionFinish = () => {}
78+
7679
const editCanvasName = () => {
7780
nameEdit.value = true
7881
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -207,6 +210,10 @@ const backToMain = () => {
207210
/>
208211
</Teleport>
209212
<ResourceGroupOpt ref="resourceGroupOptRef" @finish="groupOptFinish"></ResourceGroupOpt>
213+
<ChatChartSelection
214+
ref="chatChartSelectionRef"
215+
@finish="chartSelectionFinish"
216+
></ChatChartSelection>
210217
</div>
211218
</template>
212219

frontend/src/views/dashboard/editor/index.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ const dashboardEditorRef = ref(null)
2424
const addComponent = (componentType: string) => {
2525
const component = cloneDeep(findNewComponentFromList(componentType))
2626
if (component && dashboardEditorRef.value) {
27-
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
2827
component.id = guid()
2928
if (component.component === 'SQTab') {
3029
const subTabName = guid('tab')

frontend/src/views/dashboard/preview/SQPreviewShow.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ const loadCanvasData = (params: any) => {
5555
dataInitState.value = false
5656
load_resource_prepare(
5757
{ id: params.id },
58-
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
5958
function ({ dashboardInfo, canvasDataResult, canvasStyleResult, canvasViewInfoPreview }) {
6059
state.canvasDataPreview = canvasDataResult
6160
state.canvasStylePreview = canvasStyleResult
@@ -196,8 +195,8 @@ defineExpose({
196195
}
197196
198197
.close-side {
199-
width: 0px !important;
200-
padding: 0px !important;
198+
width: 0 !important;
199+
padding: 0 !important;
201200
}
202201
203202
.flexible-button-area {

frontend/src/views/dashboard/preview/SQPreviewSingle.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ const loadCanvasData = (params: any) => {
2828
dataInitState.value = false
2929
load_resource_prepare(
3030
{ id: params.id },
31-
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
3231
function ({ dashboardInfo, canvasDataResult, canvasStyleResult, canvasViewInfoPreview }) {
3332
state.canvasDataPreview = canvasDataResult
3433
state.canvasStylePreview = canvasStyleResult

0 commit comments

Comments
 (0)