|
@@ -2,7 +2,7 @@
|
|
|
import {nextTick, onMounted,ref,reactive} from 'vue'
|
|
|
import {showDialog, showToast} from 'vant'
|
|
|
import apiChart from '@/api/chart'
|
|
|
-import { useRoute,useRouter } from 'vue-router'
|
|
|
+import { useRoute, useRouter } from 'vue-router'
|
|
|
import { getSSRHandler, useWindowSize } from '@vueuse/core'
|
|
|
import {yearSelectOpt,sameOptionType} from '@/hooks/chart/config'
|
|
|
import {useChartRender} from '@/hooks/chart/render'
|
|
@@ -11,12 +11,15 @@ import EdbInfo from './components/EdbInfo.vue'
|
|
|
import SourceDetail from './components/SourceDetail.vue'
|
|
|
import TreeSelectPop from './components/TreeSelectPop.vue'
|
|
|
import AddChartToMyETA from './components/AddChartToMyETA.vue'
|
|
|
+import {useCachedViewsStore} from '@/store/modules/cachedViews'
|
|
|
import _ from 'lodash';
|
|
|
+
|
|
|
+
|
|
|
const {options,axisLimitState,chartRender}=useChartRender()
|
|
|
const { width } = useWindowSize()
|
|
|
-
|
|
|
+const cachedViewsStore=useCachedViewsStore()
|
|
|
const route=useRoute()
|
|
|
-const router = useRouter()
|
|
|
+const router=useRouter()
|
|
|
|
|
|
//获取图详情
|
|
|
let chartInfoData=null
|
|
@@ -304,6 +307,7 @@ async function getShareLink(){
|
|
|
await navigator.clipboard.writeText(linkUrl)
|
|
|
showToast({message:'复制链接成功',type:'success'})
|
|
|
}catch(err){
|
|
|
+ console.log(err);
|
|
|
showToast({message:'复制链接失败',type:'fail'})
|
|
|
}
|
|
|
}
|
|
@@ -394,7 +398,27 @@ function openAddToMyETADialog(){
|
|
|
}
|
|
|
//删除图表
|
|
|
function deleteChart(){
|
|
|
- //删除成功后,返回上一页
|
|
|
+ showDialog({
|
|
|
+ title: '提示',
|
|
|
+ message: '删除后该图表将不能再引用,确认删除吗?',
|
|
|
+ showCancelButton:true
|
|
|
+ }).then(() => {
|
|
|
+ apiChart.deleteClassify({
|
|
|
+ ChartClassifyId:Number(route.query.chartClassifyId),
|
|
|
+ ChartInfoId:Number(route.query.id),
|
|
|
+ }).then(res=>{
|
|
|
+ if(res.Ret===200){
|
|
|
+ cachedViewsStore.removeCaches('ChartETAList')
|
|
|
+ cachedViewsStore.removeCaches('ChartETASearch')
|
|
|
+ showToast('删除成功')
|
|
|
+ setTimeout(() => {
|
|
|
+ router.back()
|
|
|
+ }, 1000);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }).catch(()=>{
|
|
|
+
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
|
|
@@ -694,6 +718,7 @@ function deleteChart(){
|
|
|
<img :src="savePicSrc" alt="" style="width:100%;box-sizing: border-box;">
|
|
|
<p style="text-align: center;color:#999;margin-top: 10px;">长按保存图片</p>
|
|
|
</van-popup>
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
|