|
@@ -10,7 +10,7 @@
|
|
color:${JSON.parse(chartInfo.ChartThemeStyle).titleOptions.style.color}
|
|
color:${JSON.parse(chartInfo.ChartThemeStyle).titleOptions.style.color}
|
|
`:''"
|
|
`:''"
|
|
>
|
|
>
|
|
- {{ language === 'ch'?chartInfo.ChartName: chartInfo.ChartNameEn}}
|
|
|
|
|
|
+ {{ language === 'en'?(chartInfo.ChartNameEn||chartInfo.ChartName): chartInfo.ChartName}}
|
|
</span>
|
|
</span>
|
|
|
|
|
|
<div class="copy-icon" @click.stop="copyText">
|
|
<div class="copy-icon" @click.stop="copyText">
|
|
@@ -72,6 +72,8 @@
|
|
|
|
|
|
<ul class="right-action" @click.stop>
|
|
<ul class="right-action" @click.stop>
|
|
<li v-if="$route.query.source==='ybxcx'"><collectBtn/></li>
|
|
<li v-if="$route.query.source==='ybxcx'"><collectBtn/></li>
|
|
|
|
+ <!-- eta小程序报告详情中的有收藏 -->
|
|
|
|
+ <li v-if="$route.query.source==='etamini'" @click="handleChangeChartCollect">{{IsCollect?'取消收藏':'收藏'}}</li>
|
|
<li @click="copyUrl" class="copy" v-if="isShare"><i class="el-icon-share"/>分享</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'"><i class="el-icon-refresh"/>刷新</li>
|
|
<li @click="refreshChart" v-if="chartInfo.UniqueCode&&$route.query.source!=='smartReportGetImg'"><i class="el-icon-refresh"/>刷新</li>
|
|
</ul>
|
|
</ul>
|
|
@@ -120,7 +122,8 @@ export default defineComponent({
|
|
const code = ref(route.query.code);
|
|
const code = ref(route.query.code);
|
|
const isShare = ref(route.query.fromType === 'share');
|
|
const isShare = ref(route.query.fromType === 'share');
|
|
// 语言 中英文 ch en 默认中文
|
|
// 语言 中英文 ch en 默认中文
|
|
- const language = ref(route.query.lang || 'ch');
|
|
|
|
|
|
+ const language = ref(route.query.fromPage || route.query.lang || 'zh');
|
|
|
|
+ const IsCollect=ref(false)//图表是否收藏
|
|
const getChartInfo = async (type='') => {
|
|
const getChartInfo = async (type='') => {
|
|
|
|
|
|
if(!code.value) {
|
|
if(!code.value) {
|
|
@@ -130,16 +133,23 @@ export default defineComponent({
|
|
|
|
|
|
loading.value = true;
|
|
loading.value = true;
|
|
try {
|
|
try {
|
|
- const { Data } = await ChartApi.getChart({
|
|
|
|
|
|
+ let params={
|
|
UniqueCode: code.value || '',
|
|
UniqueCode: code.value || '',
|
|
- });
|
|
|
|
|
|
+ }
|
|
|
|
+ // 如果是来自etamini 也就是eta小程序的报告详情
|
|
|
|
+ if(route.query.source==='etamini'){
|
|
|
|
+ params.Source=1
|
|
|
|
+ params.Token=route.query.token
|
|
|
|
+ }
|
|
|
|
+ const { Data } = await ChartApi.getChart(params);
|
|
loading.value = false;
|
|
loading.value = false;
|
|
state.chartInfo = Data.ChartInfo;
|
|
state.chartInfo = Data.ChartInfo;
|
|
|
|
+ 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]];
|
|
|
|
|
|
//处理英文研报英文设置不全就展示中文
|
|
//处理英文研报英文设置不全就展示中文
|
|
- setLangFromEnReport();
|
|
|
|
- document.title = language.value==='ch'?Data.ChartInfo.ChartName:Data.ChartInfo.ChartNameEn;
|
|
|
|
|
|
+ // setLangFromEnReport();
|
|
|
|
+ document.title = language.value==='zh'?Data.ChartInfo.ChartName:Data.ChartInfo.ChartNameEn;
|
|
|
|
|
|
state.options = useChartRender(Data,language.value)
|
|
state.options = useChartRender(Data,language.value)
|
|
|
|
|
|
@@ -158,17 +168,6 @@ export default defineComponent({
|
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
-
|
|
|
|
- //处理英文研报的图表英文设置不全的情况
|
|
|
|
- const setLangFromEnReport = () => {
|
|
|
|
- //来源于英文研报
|
|
|
|
- if(route.query.fromPage !== 'en') return
|
|
|
|
- let is_name_en = state.chartInfo.ChartNameEn ? true : false;//名称是否有英文
|
|
|
|
- let is_target_en = [2,9,10].includes(state.chartInfo.ChartType) ? true : state.dataList.every(_ => _.EdbNameEn);//指标是否有英文
|
|
|
|
- console.log(is_name_en,is_target_en)
|
|
|
|
- language.value = (is_name_en && is_target_en) ? 'en' : 'ch';
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/* 复制标题 */
|
|
/* 复制标题 */
|
|
const copyText = () => {
|
|
const copyText = () => {
|
|
const { chartInfo } = state;
|
|
const { chartInfo } = state;
|
|
@@ -195,7 +194,7 @@ export default defineComponent({
|
|
const refreshChart = _.debounce(async () => {
|
|
const refreshChart = _.debounce(async () => {
|
|
loading.value = true;
|
|
loading.value = true;
|
|
let res: any=null
|
|
let res: any=null
|
|
- if([1,6,7,8,9,10].includes(state.chartInfo.Source)){
|
|
|
|
|
|
+ if([1,6,7,8,9,10,11].includes(state.chartInfo.Source)){
|
|
res=await ChartApi.refreshChart({UniqueCode: state.chartInfo.UniqueCode})
|
|
res=await ChartApi.refreshChart({UniqueCode: state.chartInfo.UniqueCode})
|
|
}else if([2,5].includes(state.chartInfo.Source)){
|
|
}else if([2,5].includes(state.chartInfo.Source)){
|
|
res=await ChartApi.refreshCommordityChart({UniqueCode: state.chartInfo.UniqueCode});
|
|
res=await ChartApi.refreshCommordityChart({UniqueCode: state.chartInfo.UniqueCode});
|
|
@@ -207,6 +206,21 @@ export default defineComponent({
|
|
res.Ret === 200 && getChartInfo('refresh');
|
|
res.Ret === 200 && getChartInfo('refresh');
|
|
},400)
|
|
},400)
|
|
|
|
|
|
|
|
+
|
|
|
|
+ // 点击收藏\取消收藏
|
|
|
|
+ const handleChangeChartCollect=async ()=>{
|
|
|
|
+ const params={
|
|
|
|
+ UniqueCode:code.value || '',
|
|
|
|
+ Token:route.query.token,
|
|
|
|
+ }
|
|
|
|
+ const res=IsCollect.value?await ChartApi.chartCollectCancel(params):await ChartApi.chartCollect(params)
|
|
|
|
+ if(res.Ret===200){
|
|
|
|
+ ElMessage.success(IsCollect.value?'取消收藏成功':'收藏成功')
|
|
|
|
+ IsCollect.value=!IsCollect.value
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
return {
|
|
return {
|
|
...toRefs(state),
|
|
...toRefs(state),
|
|
loading,
|
|
loading,
|
|
@@ -217,7 +231,9 @@ export default defineComponent({
|
|
isShare,
|
|
isShare,
|
|
language,
|
|
language,
|
|
refreshChart,
|
|
refreshChart,
|
|
- copyText
|
|
|
|
|
|
+ copyText,
|
|
|
|
+ handleChangeChartCollect,
|
|
|
|
+ IsCollect
|
|
};
|
|
};
|
|
},
|
|
},
|
|
});
|
|
});
|