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 @@