mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 01:06:59 +08:00
refactor: eslint
This commit is contained in:
@@ -11,28 +11,26 @@ const dashboardStore = dashboardStoreWithOut()
|
||||
const canvasLocked = ref(false) // Is the canvas movement locked, Default false
|
||||
const emits = defineEmits(['parentAddItemBox'])
|
||||
const { curComponentId, curComponent } = storeToRefs(dashboardStore)
|
||||
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
let currentInstance
|
||||
// Props
|
||||
let currentInstance: any
|
||||
const props = defineProps({
|
||||
canvasId: {
|
||||
type: String,
|
||||
default: 'canvas-main',
|
||||
},
|
||||
// eslint-disable-next-line vue/require-default-prop
|
||||
parentConfigItem: {
|
||||
type: Object as PropType<CanvasItem>,
|
||||
required: false,
|
||||
default: null,
|
||||
},
|
||||
// eslint-disable-next-line vue/require-default-prop
|
||||
dashboardInfo: {
|
||||
type: Object,
|
||||
required: false,
|
||||
default: null,
|
||||
},
|
||||
// eslint-disable-next-line vue/require-default-prop
|
||||
canvasStyleData: {
|
||||
type: Object,
|
||||
required: false,
|
||||
default: null,
|
||||
},
|
||||
canvasComponentData: {
|
||||
type: Array as PropType<CanvasItem[]>,
|
||||
@@ -122,7 +120,6 @@ const coordinates = ref<CanvasCoord[]>([])
|
||||
const infoBox = ref()
|
||||
|
||||
// Position data (non-reactive)
|
||||
|
||||
let lastTask: (() => void) | undefined = undefined
|
||||
let isOverlay = false
|
||||
let itemMaxX = 0
|
||||
@@ -193,9 +190,9 @@ function addItemToPositionBox(item: CanvasItem) {
|
||||
for (let i = item.x - 1; i < item.x - 1 + item.sizeX; i++) {
|
||||
for (let j = item.y - 1; j < item.y - 1 + item.sizeY; j++) {
|
||||
if (pb[j] && pb[j][i]) {
|
||||
// Ensure the target location is valid
|
||||
// Ensure the target location is valid & Place the item in the corresponding position
|
||||
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
pb[j][i].el = item // Place the item in the corresponding position
|
||||
pb[j][i].el = item
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -935,7 +932,6 @@ function startMove(e: MouseEvent, item: CanvasItem, index: number) {
|
||||
if (curActiveMoveInSQTab) {
|
||||
if (curActiveMoveInSQTab.moveInActive) {
|
||||
const refTabInstance =
|
||||
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
currentInstance.refs['shape_component_' + curActiveMoveInSQTab.id][0]
|
||||
refTabInstance.addTabItem(moveItem)
|
||||
removeItemById(moveItem.id)
|
||||
|
||||
@@ -49,7 +49,7 @@ function getPointStyle(point: string) {
|
||||
marginTop: '-4px',
|
||||
left: `${newLeft}`,
|
||||
top: `${newTop}`,
|
||||
// @ts-expect-error
|
||||
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
cursor: `${cursors[point]}-resize`,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,6 @@ const optInit = (params: any) => {
|
||||
state.targetInfo = params.data
|
||||
state.nodeType = params.nodeType || 'folder'
|
||||
resourceDialogShow.value = true
|
||||
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
resourceForm.name = params.name || getResourceNewName(params.opt)
|
||||
resourceForm.pid = params.pid || 'root'
|
||||
if (params.parentSelect) {
|
||||
|
||||
@@ -209,7 +209,6 @@ onMounted(() => {
|
||||
getTree()
|
||||
})
|
||||
|
||||
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
const addOperation = (params: any) => {
|
||||
if (params.opt === 'newLeaf') {
|
||||
const newCanvasUrl = '#/canvas?opt=create' + (params?.id ? `&pid=${params?.id}` : '')
|
||||
|
||||
@@ -72,7 +72,6 @@ function addTab() {
|
||||
}
|
||||
configItem.value.propValue.push(newTab)
|
||||
configItem.value.activeSubTabIndex = configItem.value.propValue.length - 1
|
||||
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
editableTabsValue.value = newTab.name
|
||||
}
|
||||
|
||||
|
||||
@@ -88,7 +88,6 @@ onMounted(() => {
|
||||
nextTick(() => {
|
||||
if (dashboardEditorRef.value) {
|
||||
sizeInit()
|
||||
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
nextTick(() => {
|
||||
if (canvasCoreRef.value) {
|
||||
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
|
||||
@@ -13,6 +13,7 @@ import icon_undo_outlined from '@/assets/svg/icon_undo_outlined.svg'
|
||||
import icon_redo_outlined from '@/assets/svg/icon_redo_outlined.svg'
|
||||
import icon_left_outlined from '@/assets/svg/icon_left_outlined.svg'
|
||||
import { saveDashboardResource } from '@/views/dashboard/utils/canvasUtils.ts'
|
||||
import ChatChartSelection from '@/views/dashboard/editor/ChatChartSelection.vue'
|
||||
|
||||
const { t } = useI18n()
|
||||
const dashboardStore = dashboardStoreWithOut()
|
||||
@@ -73,6 +74,8 @@ const groupOptFinish = (result: any) => {
|
||||
window.history.replaceState({ path: url }, '', url)
|
||||
}
|
||||
|
||||
const chartSelectionFinish = () => {}
|
||||
|
||||
const editCanvasName = () => {
|
||||
nameEdit.value = true
|
||||
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
@@ -207,6 +210,10 @@ const backToMain = () => {
|
||||
/>
|
||||
</Teleport>
|
||||
<ResourceGroupOpt ref="resourceGroupOptRef" @finish="groupOptFinish"></ResourceGroupOpt>
|
||||
<ChatChartSelection
|
||||
ref="chatChartSelectionRef"
|
||||
@finish="chartSelectionFinish"
|
||||
></ChatChartSelection>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ const dashboardEditorRef = ref(null)
|
||||
const addComponent = (componentType: string) => {
|
||||
const component = cloneDeep(findNewComponentFromList(componentType))
|
||||
if (component && dashboardEditorRef.value) {
|
||||
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
component.id = guid()
|
||||
if (component.component === 'SQTab') {
|
||||
const subTabName = guid('tab')
|
||||
|
||||
@@ -55,7 +55,6 @@ const loadCanvasData = (params: any) => {
|
||||
dataInitState.value = false
|
||||
load_resource_prepare(
|
||||
{ id: params.id },
|
||||
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
function ({ dashboardInfo, canvasDataResult, canvasStyleResult, canvasViewInfoPreview }) {
|
||||
state.canvasDataPreview = canvasDataResult
|
||||
state.canvasStylePreview = canvasStyleResult
|
||||
@@ -196,8 +195,8 @@ defineExpose({
|
||||
}
|
||||
|
||||
.close-side {
|
||||
width: 0px !important;
|
||||
padding: 0px !important;
|
||||
width: 0 !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.flexible-button-area {
|
||||
|
||||
@@ -28,7 +28,6 @@ const loadCanvasData = (params: any) => {
|
||||
dataInitState.value = false
|
||||
load_resource_prepare(
|
||||
{ id: params.id },
|
||||
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
function ({ dashboardInfo, canvasDataResult, canvasStyleResult, canvasViewInfoPreview }) {
|
||||
state.canvasDataPreview = canvasDataResult
|
||||
state.canvasStylePreview = canvasStyleResult
|
||||
|
||||
Reference in New Issue
Block a user