From 8c5d5ae56d8f8d476136f33e1a2e7a5cf6c6c5f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=86=8A=E9=A3=9E?= Date: Fri, 29 Dec 2023 10:45:45 +0800 Subject: [PATCH] 1 --- package.json | 8 +++--- .../CustomizeQuestionTableFormItem.vue | 3 ++- .../customize/CustomizeReportPageUpload.vue | 27 +++++++++---------- vue.config.js | 1 + 4 files changed, 19 insertions(+), 20 deletions(-) diff --git a/package.json b/package.json index 5ce45372..7a9ee616 100644 --- a/package.json +++ b/package.json @@ -3,10 +3,10 @@ "version": "1.0.0", "scripts": { "dev": "vue-cli-service serve --open", - "build": "vue-cli-service build", - "build:prod": "vue-cli-service build --mode prod", - "build:uat": "vue-cli-service build --mode uat", - "build:usa": "vue-cli-service build --mode usa", + "build": "vue-cli-service --max_old_space_size=8000 build", + "build:prod": "vue-cli-service --max_old_space_size=8000 build --mode prod", + "build:uat": "vue-cli-service --max_old_space_size=8000 build --mode uat", + "build:usa": "vue-cli-service --max_old_space_size=8000 build --mode usa", "pre": "vue-cli-service build --mode pre", "i18n": "npm run i18n:zh && npm run i18n:en", "i18n:zh": "node i18nGenerate.js lang=zh keyCol=5 valCol=6", diff --git a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionTableFormItem.vue b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionTableFormItem.vue index 741bfdb4..7d1bbbb0 100644 --- a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionTableFormItem.vue +++ b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionTableFormItem.vue @@ -264,7 +264,7 @@ export default { this.urls = this.questionForm[this.question.Id].split('|') this.fileList = [] this.urls.map(url => { - this.fileList.push({ name: '', url: `/api/${url}` }) + this.fileList.push({ name: '', url: `${url}` }) }) } } @@ -353,6 +353,7 @@ export default { var subjectId = this.$route.query.trialId var file = await this.fileToBlob(param.file) const res = await this.OSSclient.put(`/${trialId}/Read/${subjectId}/Visit/${param.file.name}`, file) + console.log(res) this.fileList.push({ name: param.file.name, path: this.$getObjectName(res.url), url: this.$getObjectName(res.url)}) this.urls.push(this.$getObjectName(res.url)) this.$emit('setFormTableItemData', this.question.Id, this.urls.length > 0 ? this.urls.join('|') : '') diff --git a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeReportPageUpload.vue b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeReportPageUpload.vue index a8a91bde..eef1f61a 100644 --- a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeReportPageUpload.vue +++ b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeReportPageUpload.vue @@ -89,8 +89,9 @@ name: "CustomizeReportPageUpload", this.urls = this.initUrl === '' ? [] : this.initUrl.split('|') this.fileList = [] this.urls.map(url => { - this.fileList.push({ name: '', url: `/api/${url}` }) + this.fileList.push({ name: '', url: `${url}` }) }) + console.log(this.fileList) }, methods: { checkFileSuffix(fileName) { @@ -102,7 +103,7 @@ name: "CustomizeReportPageUpload", return true } }, - uploadScreenshot(param) { + async uploadScreenshot(param) { if (!this.visitTaskId) return const loading = this.$loading({ target: document.querySelector('.ecrf-wrapper'), @@ -111,19 +112,15 @@ name: "CustomizeReportPageUpload", text: 'Loading', spinner: 'el-icon-loading' }) - const formData = new FormData() - formData.append('file', param.file) - uploadReadingAnswerImage(this.$route.query.trialId, this.visitTaskId, formData).then(res => { - if (res.IsSuccess) { - this.fileList.push({ url: `/api/${res.Result.Path}` }) - this.urls.push(res.Result.Path) - // this.questionForm[] - this.$emit('setImageUrl', this.urls.length > 0 ? this.urls.join('|') : '') - } - loading.close() - }).catch(() => { - loading.close() - }) + var trialId = this.$route.query.trialId + var subjectId = this.$route.query.trialId + var file = await this.fileToBlob(param.file) + const res = await this.OSSclient.put(`/${trialId}/Read/${subjectId}/Visit/${param.file.name}`, file) + console.log(res) + this.fileList.push({ name: param.file.name, path: this.$getObjectName(res.url), url: this.$getObjectName(res.url)}) + this.urls.push(this.$getObjectName(res.url)) + this.$emit('setImageUrl', this.urls.length > 0 ? this.urls.join('|') : '') + loading.close() }, handleBeforeUpload(file) { // 检测文件类型是否符合要求 diff --git a/vue.config.js b/vue.config.js index a750ead3..b65ab141 100644 --- a/vue.config.js +++ b/vue.config.js @@ -16,6 +16,7 @@ const name = defaultSettings.title || 'IRCIS' // page title // eslint-disable-next-line no-undef module.exports = { + lintOnSave: false, transpileDependencies: ['@cornerstonejs'], // publicPath: process.env.NODE_ENV === 'development' || process.env.VUE_APP_OSS_CONFIG_BUCKET === 'zyypacs-usa' ? process.env.VUE_APP_BASE_PATH : `${process.env.VUE_FILE_PATH}${process.env.VUE_APP_OSS_PATH}${distDate}/`, publicPath: '/',