|
@@ -20,6 +20,7 @@
|
|
</header>
|
|
</header>
|
|
<template v-if="haveData">
|
|
<template v-if="haveData">
|
|
<div
|
|
<div
|
|
|
|
+ v-if="haveAuth"
|
|
class="chart-wrapper"
|
|
class="chart-wrapper"
|
|
id="chart-wrapper"
|
|
id="chart-wrapper"
|
|
v-loading="loading"
|
|
v-loading="loading"
|
|
@@ -32,6 +33,8 @@
|
|
|
|
|
|
<div class="mark"></div>
|
|
<div class="mark"></div>
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
|
|
+ <NoAuth v-else/>
|
|
</template>
|
|
</template>
|
|
<div class="chart-wrapper notfound" v-else>
|
|
<div class="chart-wrapper notfound" v-else>
|
|
<i class="el-icon-warning"></i>哎吆,你的图飞了,赶快去找管理员救命吧~
|
|
<i class="el-icon-warning"></i>哎吆,你的图飞了,赶快去找管理员救命吧~
|
|
@@ -40,7 +43,7 @@
|
|
<!-- 图表来源说明 -->
|
|
<!-- 图表来源说明 -->
|
|
<div
|
|
<div
|
|
class="chart-bottom-info bootom-source"
|
|
class="chart-bottom-info bootom-source"
|
|
- v-if="chartInfo.Instructions&&JSON.parse(chartInfo.Instructions).isShow
|
|
|
|
|
|
+ v-if="haveAuth&&chartInfo.Instructions&&JSON.parse(chartInfo.Instructions).isShow
|
|
">
|
|
">
|
|
|
|
|
|
<!-- 图表说明 -->
|
|
<!-- 图表说明 -->
|
|
@@ -54,7 +57,7 @@
|
|
></div>
|
|
></div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <div class="bootom-source">
|
|
|
|
|
|
+ <div class="bootom-source" v-if="haveAuth">
|
|
|
|
|
|
<!-- 自定义来源 -->
|
|
<!-- 自定义来源 -->
|
|
<div class="source-box">
|
|
<div class="source-box">
|
|
@@ -93,13 +96,15 @@ import { ChartApi } from '@/request/api';
|
|
import collectBtn from './components/collectBtn.vue'
|
|
import collectBtn from './components/collectBtn.vue'
|
|
import collectBtnHT from './components/collectBtnHT.vue'
|
|
import collectBtnHT from './components/collectBtnHT.vue'
|
|
import { useChartRender } from '@/hooks/chart/useChartRender';
|
|
import { useChartRender } from '@/hooks/chart/useChartRender';
|
|
|
|
+import NoAuth from '@/components/noAuth.vue';
|
|
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
components: {
|
|
components: {
|
|
chart,
|
|
chart,
|
|
collectBtn,
|
|
collectBtn,
|
|
- collectBtnHT
|
|
|
|
|
|
+ collectBtnHT,
|
|
|
|
+ NoAuth
|
|
},
|
|
},
|
|
setup() {
|
|
setup() {
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
@@ -127,6 +132,7 @@ export default defineComponent({
|
|
// 语言 中英文 ch en 默认中文
|
|
// 语言 中英文 ch en 默认中文
|
|
const language = ref(route.query.fromPage || route.query.lang || 'zh');
|
|
const language = ref(route.query.fromPage || route.query.lang || 'zh');
|
|
const IsCollect=ref(false)//图表是否收藏
|
|
const IsCollect=ref(false)//图表是否收藏
|
|
|
|
+ const haveAuth = ref(true)
|
|
const getChartInfo = async (type='') => {
|
|
const getChartInfo = async (type='') => {
|
|
localStorage.setItem('token', `Bearer ${route.query.token}`)
|
|
localStorage.setItem('token', `Bearer ${route.query.token}`)
|
|
if(!code.value) {
|
|
if(!code.value) {
|
|
@@ -138,6 +144,7 @@ export default defineComponent({
|
|
try {
|
|
try {
|
|
let params={
|
|
let params={
|
|
UniqueCode: code.value || '',
|
|
UniqueCode: code.value || '',
|
|
|
|
+ AuthToken: route.query?.authToken || ''
|
|
}
|
|
}
|
|
// 如果是来自etamini 也就是eta小程序的报告详情
|
|
// 如果是来自etamini 也就是eta小程序的报告详情
|
|
if(route.query.source==='etamini'){
|
|
if(route.query.source==='etamini'){
|
|
@@ -151,26 +158,27 @@ export default defineComponent({
|
|
const { Data } =route.query.isETAForumChart=='true'?await ChartApi.getForumChart(params) : await ChartApi.getChart(params);
|
|
const { Data } =route.query.isETAForumChart=='true'?await ChartApi.getForumChart(params) : await ChartApi.getChart(params);
|
|
loading.value = false;
|
|
loading.value = false;
|
|
state.chartInfo = Data.ChartInfo;
|
|
state.chartInfo = Data.ChartInfo;
|
|
- IsCollect.value=Data.IsCollect
|
|
|
|
|
|
+ IsCollect.value=Data.IsCollect;
|
|
state.dataList = Data.ChartInfo.Source === 1 ? Data.EdbInfoList : [Data.EdbInfoList[0]];
|
|
state.dataList = Data.ChartInfo.Source === 1 ? Data.EdbInfoList : [Data.EdbInfoList[0]];
|
|
|
|
+ haveData.value = true;
|
|
|
|
+ haveAuth.value = Data.IsAuth;
|
|
|
|
|
|
- //处理英文研报英文设置不全就展示中文
|
|
|
|
- // setLangFromEnReport();
|
|
|
|
document.title = language.value==='zh'?Data.ChartInfo.ChartName:Data.ChartInfo.ChartNameEn;
|
|
document.title = language.value==='zh'?Data.ChartInfo.ChartName:Data.ChartInfo.ChartNameEn;
|
|
|
|
|
|
|
|
+ if(!Data.IsAuth) return
|
|
|
|
+
|
|
state.options = useChartRender(Data,language.value as string)
|
|
state.options = useChartRender(Data,language.value as string)
|
|
|
|
|
|
- haveData.value = true;
|
|
|
|
type === 'refresh' && ElMessage.success('刷新成功');
|
|
type === 'refresh' && ElMessage.success('刷新成功');
|
|
|
|
|
|
//水印配置
|
|
//水印配置
|
|
nextTick(()=>{
|
|
nextTick(()=>{
|
|
- const markDom = document.querySelector('.mark')
|
|
|
|
|
|
+ const markDom = document.querySelector('.mark') as HTMLElement
|
|
Data.WaterMark&&(markDom.style.backgroundImage = `url(${Data.WaterMark})`)
|
|
Data.WaterMark&&(markDom.style.backgroundImage = `url(${Data.WaterMark})`)
|
|
})
|
|
})
|
|
}catch (e) {
|
|
}catch (e) {
|
|
loading.value = false;
|
|
loading.value = false;
|
|
- haveData.value = false;
|
|
|
|
|
|
+ haveData.value = false;
|
|
}
|
|
}
|
|
|
|
|
|
};
|
|
};
|
|
@@ -240,7 +248,8 @@ export default defineComponent({
|
|
refreshChart,
|
|
refreshChart,
|
|
copyText,
|
|
copyText,
|
|
handleChangeChartCollect,
|
|
handleChangeChartCollect,
|
|
- IsCollect
|
|
|
|
|
|
+ IsCollect,
|
|
|
|
+ haveAuth
|
|
};
|
|
};
|
|
},
|
|
},
|
|
});
|
|
});
|