From c74806a3678843bd071b8608ae2e606513be0c28 Mon Sep 17 00:00:00 2001 From: caiyiling <1321909229@qq.com> Date: Thu, 18 Jul 2024 17:16:54 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E6=A0=87=E5=87=86?= =?UTF-8?q?=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dicoms/customize/CustomizeDicomViewer.vue | 59 ++++++++--------- .../reading/dicoms/customize/Hotkeys.vue | 50 +++++++++------ .../reading/dicoms/customize/Manuals.vue | 9 ++- .../reading/dicoms/customize/Others.vue | 34 +++++----- .../reading/dicoms/customize/WL.vue | 64 ++++++++++++------- .../reading/dicoms/customize/WLForm.vue | 45 ++++++------- 6 files changed, 143 insertions(+), 118 deletions(-) diff --git a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeDicomViewer.vue b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeDicomViewer.vue index cea40aa7..10ab29b7 100644 --- a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeDicomViewer.vue +++ b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeDicomViewer.vue @@ -1052,11 +1052,11 @@ export default { this.uploadStatus = status this.uploadImageVisible = true }, - getWwcTpl() { - const loading = this.$loading({ fullscreen: true }) - getUserWLTemplateList() - .then((res) => { - this.customWwcTpl = [] + async getWwcTpl() { + // const loading = this.$loading({ fullscreen: true }) + try { + let res = await getUserWLTemplateList() + this.customWwcTpl = [] res.Result.map((i) => { this.customWwcTpl.push({ label: i.TemplateName, @@ -1065,35 +1065,32 @@ export default { }) }) this.wwwcArr = [...this.defaultWwwc, ...this.customWwcTpl] - loading.close() - }) - .catch(() => { - loading.close() - }) + } catch(e) { + console.log(e) + } + }, - getHotKeys() { - const loading = this.$loading({ fullscreen: true }) - getDoctorShortcutKey({ imageToolType: 0 }) - .then((res) => { - res.Result.map((item) => { - this.hotKeyList.push({ - id: item.Id, - altKey: item.AltKey, - ctrlKey: item.CtrlKey, - shiftKey: item.ShiftKey, - metaKey: item.MetaKey, - key: item.Keyboardkey, - code: item.Code, - text: item.Text, - shortcutKeyEnum: item.ShortcutKeyEnum - }) + async getHotKeys() { + // const loading = this.$loading({ fullscreen: true }) + try { + let res = await getDoctorShortcutKey({ imageToolType: 0 }) + res.Result.map((item) => { + this.hotKeyList.push({ + id: item.Id, + altKey: item.AltKey, + ctrlKey: item.CtrlKey, + shiftKey: item.ShiftKey, + metaKey: item.MetaKey, + key: item.Keyboardkey, + code: item.Code, + text: item.Text, + shortcutKeyEnum: item.ShortcutKeyEnum }) - this.bindHotKey() - loading.close() - }) - .catch(() => { - loading.close() }) + this.bindHotKey() + } catch(e) { + console.log(e) + } }, resetHotkeyList(arr) { this.hotKeyList = [] diff --git a/src/views/trials/trials-panel/reading/dicoms/customize/Hotkeys.vue b/src/views/trials/trials-panel/reading/dicoms/customize/Hotkeys.vue index d7f6894e..6b98939a 100644 --- a/src/views/trials/trials-panel/reading/dicoms/customize/Hotkeys.vue +++ b/src/views/trials/trials-panel/reading/dicoms/customize/Hotkeys.vue @@ -57,10 +57,11 @@ export default { this.getHotkeys() }, methods: { - getHotkeys(isReset = false) { + async getHotkeys(isReset = false) { this.loading = true this.hotKeyList = [] - getDoctorShortcutKey({ imageToolType: this.readingTool }).then(res => { + try{ + let res = await getDoctorShortcutKey({ imageToolType: this.readingTool }) res.Result.map(item => { this.hotKeyList.push({ id: item.Id, keys: { controlKey: { altKey: item.AltKey, ctrlKey: item.CtrlKey, shiftKey: item.ShiftKey, metaKey: item.MetaKey, key: item.Keyboardkey, code: item.Code }, text: item.Text }, label: item.ShortcutKeyEnum }) }) @@ -68,11 +69,12 @@ export default { this.$emit('reset', this.hotKeyList) } this.loading = false - }).catch(() => { + }catch(e){ this.loading = false - }) + } + }, - handleSave() { + async handleSave() { this.loading = true var params = { imageToolType: this.readingTool, @@ -93,28 +95,34 @@ export default { ) }) params.shortcutKeyList = shortcutKeyList - setShortcutKey(params).then(res => { + try { + await setShortcutKey(params) this.$emit('reset', this.hotKeyList) this.$emit('close') this.loading = false - }).catch(() => { + }catch(e){ this.loading = false - }) + } }, - handleReset() { + async handleReset() { // '是否确认重置?' - this.$confirm(this.$t('trials:hotkeys:message:confirmReset'), { - type: 'warning', - distinguishCancelAndClose: true - }) - .then(() => { - this.loading = true - restoreDefaultShortcutKey({ imageToolType: this.readingTool }).then(res => { - this.$message.success(this.$t('trials:hotkeys:message:resetSuccessfully')) // '重置成功!' - this.getHotkeys(true) - }).catch(() => { this.loading = false }) - }) - .catch(action => {}) + const confirm = await this.$confirm( + this.$t('trials:hotkeys:message:confirmReset'), + { + type: 'warning', + distinguishCancelAndClose: true + } + ) + if (confirm !== 'confirm') return + this.loading = true + try{ + await restoreDefaultShortcutKey({ imageToolType: this.readingTool }) + this.$message.success(this.$t('trials:hotkeys:message:resetSuccessfully')) // '重置成功!' + this.getHotkeys(true) + this.loading = false + }catch(e){ + this.loading = false + } }, handleHotkeyVerify(hotkey) { for (const item of this.hotKeyList) { diff --git a/src/views/trials/trials-panel/reading/dicoms/customize/Manuals.vue b/src/views/trials/trials-panel/reading/dicoms/customize/Manuals.vue index 3cd5b590..bab4f6e9 100644 --- a/src/views/trials/trials-panel/reading/dicoms/customize/Manuals.vue +++ b/src/views/trials/trials-panel/reading/dicoms/customize/Manuals.vue @@ -51,19 +51,22 @@ export default { this.getList() }, methods: { - getList() { + async getList() { this.loading = true var param = { trialId: this.trialId } - getManualList(param).then(res => { + try{ + let res = await getManualList(param) this.fileList = res.Result if (this.fileList.length > 0) { this.preview(this.fileList[0]) } this.loading = false - }).catch(() => { this.loading = false }) + }catch(e){ + this.loading = false + } }, preview(file) { this.$set(this.selected, 'filePath', file.Path) diff --git a/src/views/trials/trials-panel/reading/dicoms/customize/Others.vue b/src/views/trials/trials-panel/reading/dicoms/customize/Others.vue index f0d62385..36e408e9 100644 --- a/src/views/trials/trials-panel/reading/dicoms/customize/Others.vue +++ b/src/views/trials/trials-panel/reading/dicoms/customize/Others.vue @@ -3,7 +3,7 @@
+ + + @@ -77,16 +83,19 @@ export default { this.getWL() }, methods: { - getWL() { + async getWL() { this.loading = true - getUserWLTemplateList().then(res => { + try { + const res = await getUserWLTemplateList() this.tableData = res.Result this.loading = false this.$emit('getWwcTpl') - }).catch(() => { this.loading = false }) + } catch (e) { + this.loading = false + } }, handleAdd() { - this.customWwc.title = this.$t('common:button:add') + this.customWwc.title = this.$t('common:button:new') this.row = {} this.customWwc.visible = true }, @@ -95,20 +104,27 @@ export default { this.row = Object.assign({}, row) this.customWwc.visible = true }, - handleDelete(row) { - var msg = this.$t('trials:staffResearch:message:confirmDel') - this.$confirm(msg, { - type: 'warning', - distinguishCancelAndClose: true - }).then(() => { - this.loading = true - deleteUserWLTemplate(row.Id).then(res => { - this.loading = false - // 删除成功 - this.$message.success(this.$t('common:message:deletedSuccessfully')) - this.getWL() - }).catch(() => { this.loading = false }) - }) + async handleDelete(row) { + // '是否确认删除?' + var msg = this.$t('trials:reading:wlTemplate:delete') + const confirm = await this.$confirm( + msg, + { + type: 'warning', + distinguishCancelAndClose: true + } + ) + if (confirm !== 'confirm') return + this.loading = true + try { + await deleteUserWLTemplate(row.Id) + this.loading = false + // 删除成功 + this.$message.success(this.$t('common:message:deletedSuccessfully')) + this.getWL() + } catch (e) { + this.loading = false + } } } } diff --git a/src/views/trials/trials-panel/reading/dicoms/customize/WLForm.vue b/src/views/trials/trials-panel/reading/dicoms/customize/WLForm.vue index 98aa912b..90344f17 100644 --- a/src/views/trials/trials-panel/reading/dicoms/customize/WLForm.vue +++ b/src/views/trials/trials-panel/reading/dicoms/customize/WLForm.vue @@ -8,14 +8,16 @@ size="small" > - + - - + + + - - + + + @@ -81,24 +83,23 @@ export default { } }, methods: { - handleSave() { - this.$refs.wlForm.validate((valid) => { - if (valid) { - this.loading = true - addOrUpdateUserWLTemplate(this.form).then((res) => { - this.loading = false - this.$emit('getWL') - this.$emit('close') - if (this.form.Id) { - this.$message.success(this.$t('common:message:savedSuccessfully')) - } else { - this.$message.success(this.$t('common:message:addedSuccessfully')) - } - }).catch(() => { - this.loading = false - }) + async handleSave() { + const valid = await this.$refs.wlForm.validate() + if (!valid) return + this.loading = true + try { + await addOrUpdateUserWLTemplate(this.form) + this.loading = false + this.$emit('getWL') + this.$emit('close') + if (this.form.Id) { + this.$message.success(this.$t('common:message:savedSuccessfully')) + } else { + this.$message.success(this.$t('common:message:addedSuccessfully')) } - }) + } catch (e) { + this.loading = false + } }, handleCancel() { this.$emit('close')