Эх сурвалжийг харах

style: 修改代码格式

Gaokun Wang 1 долоо хоног өмнө
parent
commit
3dbecbb869

+ 2 - 2
electron/main/index.ts

@@ -24,7 +24,7 @@ function createWindow(): void {
     mainWindow.show()
   })
 
-  mainWindow.webContents.setWindowOpenHandler((details) => {
+  mainWindow.webContents.setWindowOpenHandler(details => {
     shell.openExternal(details.url)
     return { action: 'deny' }
   })
@@ -34,7 +34,7 @@ function createWindow(): void {
   if (is.dev && process.env['ELECTRON_RENDERER_URL']) {
     mainWindow.loadURL(process.env['ELECTRON_RENDERER_URL'])
   } else {
-    mainWindow.loadFile(join(__dirname, '../../src/index.html'))
+    mainWindow.loadFile(join(__dirname, '../renderer/index.html'))
   }
 }
 

+ 1 - 1
src/router/before.ts

@@ -2,7 +2,7 @@ import router from '@/router'
 import { done, start } from '@/utils/nprogress'
 const WHITE_LIST = ['/case', '/case-list', '/mx-graph']
 export const setupAuthRoutes = () => {
-  router.beforeEach(async (to, from, next) => {
+  router.beforeEach(async (to, _from, next) => {
     start()
     if (WHITE_LIST.includes(to.path)) return next()
     // 重定向登录页面

+ 1 - 1
src/types/auto-components.d.ts

@@ -14,9 +14,9 @@ declare module 'vue' {
     MxToolbar: typeof import('./../views/components/MxToolbar.vue')['default']
     RouterLink: typeof import('vue-router')['RouterLink']
     RouterView: typeof import('vue-router')['RouterView']
+    TButton: typeof import('tdesign-vue-next')['Button']
     TConfigProvider: typeof import('tdesign-vue-next')['ConfigProvider']
     THeadMenu: typeof import('tdesign-vue-next')['HeadMenu']
     TMenuItem: typeof import('tdesign-vue-next')['MenuItem']
-    Toolbar: typeof import('./../views/components/Toolbar.vue')['default']
   }
 }

+ 8 - 6
src/views/components/MxGraphContainer.vue

@@ -50,12 +50,14 @@ function configureStyles(graph: InstanceType<typeof myMxGraph>) {
 }
 
 function setupGraphListeners(graph: InstanceType<typeof myMxGraph>) {
-  graph.getSelectionModel().addListener(myMxConstants.EVENT_CHANGE, (sender: unknown, evt: any) => {
-    const cells = evt.getProperty('added')
-    console.log('Selected cells:', cells)
-  })
+  graph
+    .getSelectionModel()
+    .addListener(myMxConstants.EVENT_CHANGE, (_sender: unknown, evt: any) => {
+      const cells = evt.getProperty('added')
+      console.log('Selected cells:', cells)
+    })
 
-  graph.addListener(myMxConstants.EVENT_DOUBLE_CLICK, (sender: unknown, evt: any) => {
+  graph.addListener(myMxConstants.EVENT_DOUBLE_CLICK, (_sender: unknown, evt: any) => {
     const cell = evt.getProperty('cell')
     if (cell) {
       const newValue = prompt('输入新值:', graph.convertValueToString(cell) || '')
@@ -69,7 +71,7 @@ function setupGraphListeners(graph: InstanceType<typeof myMxGraph>) {
 function setupContextMenu(graph: InstanceType<typeof myMxGraph>) {
   myMxEvent.disableContextMenu(graph.container)
 
-  graph.addListener(myMxConstants.EVENT_CONTEXT_MENU, (sender: unknown, evt: any) => {
+  graph.addListener(myMxConstants.EVENT_CONTEXT_MENU, (_sender: unknown, evt: any) => {
     const cell = evt.getProperty('cell')
     evt.preventDefault()