diff --git a/spx-gui/src/App.vue b/spx-gui/src/App.vue index 4becdb332..34394b85d 100644 --- a/spx-gui/src/App.vue +++ b/spx-gui/src/App.vue @@ -27,7 +27,14 @@ - + diff --git a/spx-gui/src/components/project/index.ts b/spx-gui/src/components/project/index.ts index 40013a446..6b736116c 100644 --- a/spx-gui/src/components/project/index.ts +++ b/spx-gui/src/components/project/index.ts @@ -13,16 +13,17 @@ export function useCreateProject() { return new Promise((resolve, reject) => { const modal = modalCtrl.create({ title: t({ en: 'Create a new project', zh: '创建新的项目' }), - content: () => h(ProjectCreate, { - onCreated(projectData) { - modal.destroy() - resolve(projectData) - }, - onCancelled() { - modal.destroy() - reject(new Cancelled()) - } - }), + content: () => + h(ProjectCreate, { + onCreated(projectData) { + modal.destroy() + resolve(projectData) + }, + onCancelled() { + modal.destroy() + reject(new Cancelled()) + } + }), preset: 'dialog' }) }) diff --git a/spx-gui/src/utils/exception.ts b/spx-gui/src/utils/exception.ts index 16808b9ea..9110bbd86 100644 --- a/spx-gui/src/utils/exception.ts +++ b/spx-gui/src/utils/exception.ts @@ -54,11 +54,13 @@ export function useMessageHandle( const m = useMessage() const { t } = useI18n() - return ((...args: Args) => { + return (...args: Args) => { return action(...args).then( (ret) => { if (successMessage != null) { - const successText = t(typeof successMessage === 'function' ? successMessage(ret) : successMessage) + const successText = t( + typeof successMessage === 'function' ? successMessage(ret) : successMessage + ) m.success(() => successText) } return ret @@ -75,7 +77,7 @@ export function useMessageHandle( throw e } ) - }) + } } // TODO: helpers for in-place feedback diff --git a/spx-gui/src/utils/form.ts b/spx-gui/src/utils/form.ts index a5de55703..bb34a5a6f 100644 --- a/spx-gui/src/utils/form.ts +++ b/spx-gui/src/utils/form.ts @@ -23,7 +23,7 @@ export function useForm(rulesInput: FormRulesInput) { const formRef = ref(null) const rules: FormRules = {} - Object.keys(rulesInput).forEach(path => { + Object.keys(rulesInput).forEach((path) => { const validator = rulesInput[path] rules[path] = { async validator(_: unknown, v: unknown) { @@ -40,7 +40,7 @@ export function useForm(rulesInput: FormRulesInput) { if (formRef.value == null) throw new Error('invalid calling of validate without formRef value') const errs: FormValidationError[] = await formRef.value.validate().then( () => [], - e => { + (e) => { if (Array.isArray(e)) return e throw e }