diff --git a/src/main.js b/src/main.js index 33c71402..46612886 100644 --- a/src/main.js +++ b/src/main.js @@ -299,10 +299,10 @@ async function VueInit() { Vue.prototype.$path.push(key) } let text = i18n.t(key) - if (store.state.trials.config.aa) { - Object.keys(store.state.trials.config.aa).forEach(key => { - let test = new RegExp(key) - text = text.replace(test, store.state.trials.config.aa[key]) + if (Array.isArray(store.state.trials.config.TrialObjectNameList) && store.state.trials.config.TrialObjectNameList.length > 0) { + store.state.trials.config.TrialObjectNameList.forEach(item => { + let test = new RegExp(item.Name, 'ig') + text = text.replace(test, item.TrialName) }) } // return i18n.t(key) diff --git a/src/permission.js b/src/permission.js index 86334b42..ff2f7256 100644 --- a/src/permission.js +++ b/src/permission.js @@ -18,7 +18,44 @@ router.beforeEach(async (to, from, next) => { NProgress.start() // 设置页面标题 // document.title = getPageTitle(to.meta.title) - + if (!to.query.trialId) { + store.dispatch('trials/setConfig', {}) + } + if ( + to.query.trialId && + to.query.trialId !== + store.state.trials.config.trialId && + store.state.trials.whiteList.indexOf(to.path) === -1 + ) { + console.log(to.query.path) + let res = await getTrialExtralConfig({ + TrialId: to.query.trialId, + }) + if (res.IsSuccess) { + store.dispatch('trials/setConfig', { + trialId: to.query.trialId, + ...res.Result, + }) + } + } if (!to.query.trialId) { + store.dispatch('trials/setConfig', {}) + } + if ( + to.query.trialId && + to.query.trialId !== + store.state.trials.config.trialId && + store.state.trials.whiteList.indexOf(to.path) === -1 + ) { + let res = await getTrialExtralConfig({ + TrialId: to.query.trialId, + }) + if (res.IsSuccess) { + store.dispatch('trials/setConfig', { + trialId: to.query.trialId, + ...res.Result, + }) + } + } // 确定用户是否已登录 const hasToken = getToken() Vue.prototype.toPath = to.path @@ -89,27 +126,6 @@ router.beforeEach(async (to, from, next) => { } } } - - if (!to.query.trialId) { - store.dispatch('trials/setConfig', {}) - } - if ( - to.query.trialId && - to.query.trialId !== - store.state.trials.config.trialId && - store.state.trials.whiteList.indexOf(to.path) === -1 - ) { - let res = await getTrialExtralConfig({ - TrialId: to.query.trialId, - }) - res.Result.aa = { 阅片人: '采集人', 申办方: 'aaa' } - if (res.IsSuccess) { - store.dispatch('trials/setConfig', { - trialId: to.query.trialId, - ...res.Result, - }) - } - } }) router.afterEach(() => { diff --git a/src/views/trials/trials-panel/setting/trial-config/components/logicalConfig.vue b/src/views/trials/trials-panel/setting/trial-config/components/logicalConfig.vue index 8f6fa39d..58900386 100644 --- a/src/views/trials/trials-panel/setting/trial-config/components/logicalConfig.vue +++ b/src/views/trials/trials-panel/setting/trial-config/components/logicalConfig.vue @@ -274,6 +274,16 @@ > {{ $t('common:button:cancel') }} + + {{ $t('common:button:terminology') }} + @@ -733,6 +743,11 @@ + + + \ No newline at end of file