From 323c7db213700662cdd7ac19ae463bf69e56cdf9 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 28 Jul 2025 11:21:54 +0800 Subject: [PATCH 1/4] perf: Modify pwd api msg --- backend/apps/system/api/user.py | 10 +++++----- backend/common/utils/locale.py | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/backend/apps/system/api/user.py b/backend/apps/system/api/user.py index 0cf26d34..9d9644cd 100644 --- a/backend/apps/system/api/user.py +++ b/backend/apps/system/api/user.py @@ -120,11 +120,11 @@ async def query(session: SessionDep, trans: Trans, id: int) -> UserEditor: @router.post("") async def create(session: SessionDep, creator: UserCreator, trans: Trans): if check_account_exists(session=session, account=creator.account): - raise Exception(trans('i18n_exist', msg = f"{trans('i18n_user.account') [{creator.account}]}")) + raise Exception(trans('i18n_exist', msg = f"{trans('i18n_user.account')} [{creator.account}]")) if check_email_exists(session=session, email=creator.email): - raise Exception(trans('i18n_exist', msg = f"{trans('i18n_user.email') [{creator.email}]}")) + raise Exception(trans('i18n_exist', msg = f"{trans('i18n_user.email')} [{creator.email}]")) if not check_email_format(creator.email): - raise Exception(trans('i18n_format_invalid', key = f"{trans('i18n_user.email') [{creator.email}]}")) + raise Exception(trans('i18n_format_invalid', key = f"{trans('i18n_user.email')} [{creator.email}]")) data = creator.model_dump(exclude_unset=True) user_model = UserModel.model_validate(data) #user_model.create_time = get_timestamp() @@ -154,9 +154,9 @@ async def update(session: SessionDep, editor: UserEditor, trans: Trans): if editor.account != user_model.account: raise Exception(f"account cannot be changed!") if editor.email != user_model.email and check_email_exists(session=session, account=editor.email): - raise Exception(trans('i18n_exist', msg = f"{trans('i18n_user.email') [{editor.email}]}")) + raise Exception(trans('i18n_exist', msg = f"{trans('i18n_user.email')} [{editor.email}]")) if not check_email_format(editor.email): - raise Exception(trans('i18n_format_invalid', key = f"{trans('i18n_user.email') [{editor.email}]}")) + raise Exception(trans('i18n_format_invalid', key = f"{trans('i18n_user.email')} [{editor.email}]")) origin_oid: int = user_model.oid del_stmt = sqlmodel_delete(UserWsModel).where(UserWsModel.uid == editor.id) session.exec(del_stmt) diff --git a/backend/common/utils/locale.py b/backend/common/utils/locale.py index eb107548..67a0d97c 100644 --- a/backend/common/utils/locale.py +++ b/backend/common/utils/locale.py @@ -45,9 +45,9 @@ class I18nHelper: return current if isinstance(current, str) else key_path - def __call__(self, key: str, **kwargs) -> str: + def __call__(self, arg_key: str, **kwargs) -> str: lang_data = self.i18n.translations.get(self.lang, {}) - text = self._get_nested_translation(lang_data, key) + text = self._get_nested_translation(lang_data, arg_key) if kwargs: try: From 522fa47e2b245015ad03d3f358e3f0dcc21a1a67 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 28 Jul 2025 11:27:18 +0800 Subject: [PATCH 2/4] perf: Token miss msg --- frontend/src/router/watch.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/router/watch.ts b/frontend/src/router/watch.ts index b480d2ca..d91cf605 100644 --- a/frontend/src/router/watch.ts +++ b/frontend/src/router/watch.ts @@ -19,7 +19,7 @@ export const watchRouter = (router: any) => { return } if (!token) { - ElMessage.error('Please login first') + // ElMessage.error('Please login first') next('/login') return } From f2d24ba404598a140b24baa2b06d8e8c42c78c6e Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Mon, 28 Jul 2025 11:37:19 +0800 Subject: [PATCH 3/4] refactor: item move deraction --- .../src/views/dashboard/canvas/CanvasCore.vue | 24 ++++--------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/frontend/src/views/dashboard/canvas/CanvasCore.vue b/frontend/src/views/dashboard/canvas/CanvasCore.vue index 73a7610d..7f5315a5 100644 --- a/frontend/src/views/dashboard/canvas/CanvasCore.vue +++ b/frontend/src/views/dashboard/canvas/CanvasCore.vue @@ -129,6 +129,7 @@ const maxCell = ref(0) const positionBox = ref>>([]) const coordinates = ref([]) const infoBox = ref() +const historyPageX = ref(null) // Position data (non-reactive) let lastTask: (() => void) | undefined = undefined @@ -921,25 +922,10 @@ function startMove(e: MouseEvent, item: CanvasItem, index: number) { //If the current canvas is locked, no component movement will be performed if (canvasLocked.value) return // Adjust the accuracy of moving coordinate changes - const newX = Math.max( - Math.floor( - (nowCloneItemX - 20 + infoBox.value.cloneItem.offsetWidth / 96 - baseMarginLeft.value) / - cellWidth.value + - 1 - ), - 1 - ) - // temp adjust board - - // Adjust the accuracy of moving coordinate changes - const newY = Math.max( - Math.floor( - (nowCloneItemY + infoBox.value.cloneItem.offsetHeight / 96 - baseMarginTop.value) / - cellHeight.value + - 1 - ), - 1 - ) + let newX = Math.floor(nowCloneItemX / cellWidth.value) + let newY = Math.floor(nowCloneItemY / cellHeight.value) + newX = newX > 0 ? newX : 1 + newY = newY > 0 ? newY : 1 debounce(() => { if (newX !== infoBox.value.oldX || newY !== infoBox.value.oldY) { movePlayer(moveItem, { x: newX, y: newY }) From b1f7eeb8322751249c64757a057aa04700c87961 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Mon, 28 Jul 2025 12:05:50 +0800 Subject: [PATCH 4/4] fix: eslint --- .../src/views/dashboard/canvas/CanvasCore.vue | 1 - frontend/src/views/ds/DatasourceForm.vue | 18 +++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/frontend/src/views/dashboard/canvas/CanvasCore.vue b/frontend/src/views/dashboard/canvas/CanvasCore.vue index 7f5315a5..abf16914 100644 --- a/frontend/src/views/dashboard/canvas/CanvasCore.vue +++ b/frontend/src/views/dashboard/canvas/CanvasCore.vue @@ -129,7 +129,6 @@ const maxCell = ref(0) const positionBox = ref>>([]) const coordinates = ref([]) const infoBox = ref() -const historyPageX = ref(null) // Position data (non-reactive) let lastTask: (() => void) | undefined = undefined diff --git a/frontend/src/views/ds/DatasourceForm.vue b/frontend/src/views/ds/DatasourceForm.vue index 4444208d..90257473 100644 --- a/frontend/src/views/ds/DatasourceForm.vue +++ b/frontend/src/views/ds/DatasourceForm.vue @@ -274,15 +274,15 @@ const save = async (formEl: FormInstance | undefined) => { } } else { requestObj.tables = list - const a = datasourceApi - .add(requestObj) - .then(() => { - close() - emit('refresh') - }) - .finally(() => { - saveLoading.value = false - }) + // const a = datasourceApi + // .add(requestObj) + // .then(() => { + // close() + // emit('refresh') + // }) + // .finally(() => { + // saveLoading.value = false + // }) } } })