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