diff --git a/src/api/trials.js b/src/api/trials.js index 8d017e4a..35bc26ce 100644 --- a/src/api/trials.js +++ b/src/api/trials.js @@ -3675,3 +3675,11 @@ export function getTrialSiteSelectList(params) { params }) } +// 获取项目配置 +export function getTrialExtralConfig(params) { + return request({ + url: `/TrialConfig/getTrialExtralConfig`, + method: 'get', + params + }) +} diff --git a/src/permission.js b/src/permission.js index db67208e..19135136 100644 --- a/src/permission.js +++ b/src/permission.js @@ -6,13 +6,20 @@ import 'nprogress/nprogress.css' import { getToken } from '@/utils/auth' import Vue from 'vue' import { OSSclient } from './utils/oss' +import { getTrialExtralConfig } from "@/api/trials" // import getPageTitle from '@/utils/get-page-title' NProgress.configure({ showSpinner: false }) const whiteList = ['/ReviewersResearch', '/login', '/error', '/resetpassword', '/recompose', '/email-recompose', '/trialStats', '/showdicom', '/imagesShare', '/audit', '/preview', '/researchLogin', '/blindResumeInfo', '/trialsResume', '/joinVerify', '/showNoneDicoms', '/noneDicomReading', '/clinicalData', '/readingDicoms', '/readingPage', '/visitDicomReview', '/visitNondicomReview', '/globalReview', '/adReview', '/oncologyReview', '/nonedicoms'] -router.beforeEach(async(to, from, next) => { +router.beforeEach(async (to, from, next) => { + if (to.query.trialId && to.query.trialId !== store.state.trials.config.trialId) { + let res = await getTrialExtralConfig({ TrialId: to.query.trialId }); + if (res.IsSuccess) { + store.dispatch('trials/setConfig', { trialId: to.query.trialId, ...res.Result }); + } + } NProgress.start() // 设置页面标题 // document.title = getPageTitle(to.meta.title) @@ -56,7 +63,7 @@ router.beforeEach(async(to, from, next) => { /* has no token*/ if (whiteList.indexOf(to.path) !== -1) { // 在免登录whiteList中,直接进入 - if (to.path === '/readingDicoms' || to.path === '/noneDicomReading'){ + if (to.path === '/readingDicoms' || to.path === '/noneDicomReading') { OSSclient() } next() @@ -68,7 +75,7 @@ router.beforeEach(async(to, from, next) => { next(`/ReviewersResearch?`) NProgress.done() } else { - // 其他无权访问的页面将重定向到登录页面。 + // 其他无权访问的页面将重定向到登录页面。 next(`/login?`) NProgress.done() } diff --git a/src/store/modules/trials.js b/src/store/modules/trials.js index ed8ba8e1..609faffa 100644 --- a/src/store/modules/trials.js +++ b/src/store/modules/trials.js @@ -8,6 +8,7 @@ const getDefaultState = () => { visitPointQuery: null, studyListQuery: null, unlock: false, + config: {}, } } @@ -20,6 +21,9 @@ const mutations = { SET_UNLOCK: (state, unlock) => { state.unlock = unlock }, + SET_CONFIG: (state, config) => { + state.config = config + }, SET_ACTIVENAME: (state, activeName) => { state.trialDetailActiveName = activeName }, @@ -44,6 +48,9 @@ const actions = { setUnLock({ commit }, unlock) { commit('SET_UNLOCK', unlock) }, + setConfig({ commit }, config) { + commit('SET_CONFIG', config) + }, setActiveName({ commit }, activeName) { commit('SET_ACTIVENAME', activeName) }, diff --git a/src/utils/uploadZip.js b/src/utils/uploadZip.js index 89f309ea..3b0ded22 100644 --- a/src/utils/uploadZip.js +++ b/src/utils/uploadZip.js @@ -6,16 +6,17 @@ import { requestPackageAndAnonymizImage, } from "@/api/load.js"; let flag = {}; -export const downloadImage = async (id, id2) => { - if (flag[id2]) return - flag[id2] = true +export const downloadImage = async (id, id2, IsDicom = true) => { + if (flag[`${id2}_${IsDicom}`]) return + flag[`${id2}_${IsDicom}`] = true try { let params = { TrialId: id, - SubjectVisitId: id2 + SubjectVisitId: id2, + IsDicom: IsDicom } let res = await requestPackageAndAnonymizImage(params); - flag[id2] = false; + flag[`${id2}_${IsDicom}`] = false; if (res.IsSuccess) { if (!res.Result) { Vue.prototype.$message.warning(Vue.prototype.$t("trials:upload:message:not")) @@ -23,9 +24,9 @@ export const downloadImage = async (id, id2) => { } let a = document.createElement("a"); let href = Vue.prototype.OSSclientConfig.basePath + res.Result; - let fileName = - res.Result.split("/")[res.Result.split("/").length - 1]; - a.download = fileName; + // let fileName = + // res.Result.split("/")[res.Result.split("/").length - 1]; + a.download = res.OtherInfo.fileName; a.href = href; a.click(); URL.revokeObjectURL(href); @@ -39,7 +40,7 @@ export const downloadImage = async (id, id2) => { return false; } } catch (err) { - flag[id2] = false; + flag[`${id2}_${IsDicom}`] = false; console.log(err); } }; @@ -101,11 +102,11 @@ const setfolder = async (item) => { }) .then((res) => { saveAs(res, zipName + ".zip"); // 使用FileSaver.saveAs保存文件,文件名可自定义 - flag[id2] = false; + flag[`${id2}_${IsDicom}`] = false; zipObj = null; }); }) - .catch((reason) => { flag[id2] = false; }); + .catch((reason) => { flag[`${id2}_${IsDicom}`] = false; }); }; const handleBatchDown = async (item, zip) => { return new Promise((resolve) => { diff --git a/src/views/trials/trials-panel/visit/qc-check/components/qualityAssurance.vue b/src/views/trials/trials-panel/visit/qc-check/components/qualityAssurance.vue index 3c6ac5dc..e08ec6e5 100644 --- a/src/views/trials/trials-panel/visit/qc-check/components/qualityAssurance.vue +++ b/src/views/trials/trials-panel/visit/qc-check/components/qualityAssurance.vue @@ -43,6 +43,16 @@
+ + + {{ $t("trials:audit:button:downLoadAllDiocms") }} +
+ + + {{ $t("trials:audit:button:downLoadAllNonDiocms") }} +