|
@@ -1,14 +1,25 @@
|
|
|
<script setup>
|
|
|
import {ref,nextTick, reactive} from 'vue'
|
|
|
import {apiChartInfoByCode,apiChartInfoById,apiEDBInfo} from '@/api/chart'
|
|
|
-import {apiMyChartList} from '@/api/myETA'
|
|
|
-import { useRoute } from 'vue-router'
|
|
|
+import {
|
|
|
+ apiMyChartList,
|
|
|
+ apiMyClassifyList,
|
|
|
+ apiChartInMyClassifyList,
|
|
|
+ apiChartAddToClassify,
|
|
|
+ apiMyChartRemove,
|
|
|
+ apiChartDel
|
|
|
+} from '@/api/myETA'
|
|
|
+import { useRoute, useRouter } from 'vue-router'
|
|
|
import {chartRender} from '@/hooks/chart/render'
|
|
|
import {yearSelectOpt,sameOptionType} from '@/hooks/chart/config'
|
|
|
import EDBInfo from './components/EDBInfo.vue'
|
|
|
import moment from 'moment'
|
|
|
+import { showToast,showDialog} from 'vant'
|
|
|
+import ChartSaveOther from './components/ChartSaveOther.vue'
|
|
|
+
|
|
|
|
|
|
const route=useRoute()
|
|
|
+const router=useRouter()
|
|
|
let chartCode=route.query.code
|
|
|
|
|
|
// 获取当前图表所在分类下的所有图表数据 用于上一张下一张切换
|
|
@@ -179,6 +190,96 @@ function handleUpdateRender(val){
|
|
|
// 更多操作弹窗
|
|
|
let showMoreAction=ref(false)
|
|
|
|
|
|
+// 复制到
|
|
|
+let myChartClassifyList=[]//我的图库中的所有分类
|
|
|
+async function getMyChartClassifyList(){
|
|
|
+ const res=await apiMyClassifyList()
|
|
|
+ if(res.Ret===200){
|
|
|
+ myChartClassifyList=res.Data.List||[]
|
|
|
+ }
|
|
|
+}
|
|
|
+getMyChartClassifyList()
|
|
|
+let showCopyTo=ref(false)
|
|
|
+let copyToOpt=ref([])
|
|
|
+async function handleShowCopyTo(){
|
|
|
+ const res=await apiChartInMyClassifyList({ChartInfoId:chartInfo.value.ChartInfoId})
|
|
|
+ if(res.Ret===200){
|
|
|
+ const arr=res.Data||[]
|
|
|
+ copyToOpt.value=myChartClassifyList.map(e=>{
|
|
|
+ return {
|
|
|
+ ...e,
|
|
|
+ select:false
|
|
|
+ }
|
|
|
+ }).filter((x) => !arr.includes(x.MyChartClassifyId))
|
|
|
+ showCopyTo.value=true
|
|
|
+ }
|
|
|
+}
|
|
|
+async function handleConfirmCopy(){
|
|
|
+ const arr=[]
|
|
|
+ copyToOpt.value.map(item=>{
|
|
|
+ if(item.select){
|
|
|
+ arr.push(item.MyChartClassifyId)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if(arr.length===0){
|
|
|
+ showToast('请选择分类')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const res=await apiChartAddToClassify({
|
|
|
+ ChartInfoId:chartInfo.value.ChartInfoId,
|
|
|
+ MyChartClassifyId:arr
|
|
|
+ })
|
|
|
+ if(res.Ret===200){
|
|
|
+ showToast('复制成功')
|
|
|
+ showCopyTo.value=false
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 移除图表
|
|
|
+function handleRemoveChart(){
|
|
|
+ showDialog({
|
|
|
+ title: '提示',
|
|
|
+ message: '是否确认移出?',
|
|
|
+ showCancelButton:true
|
|
|
+ }).then(() => {
|
|
|
+ // on close
|
|
|
+ apiMyChartRemove({
|
|
|
+ MyChartClassifyId:Number(route.query.cid),
|
|
|
+ MyChartId:chartInfo.value.MyChartId
|
|
|
+ }).then(res=>{
|
|
|
+ if(res.Ret===200){
|
|
|
+ showToast('移出成功')
|
|
|
+ setTimeout(() => {
|
|
|
+ router.back()
|
|
|
+ }, 1500)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }).catch(()=>{})
|
|
|
+}
|
|
|
+
|
|
|
+//删除图表
|
|
|
+function handleDeleteChart(){
|
|
|
+ showDialog({
|
|
|
+ title: '提示',
|
|
|
+ message: '删除后该图表将不能再引用,确认删除吗?',
|
|
|
+ showCancelButton:true
|
|
|
+ }).then(() => {
|
|
|
+ // on close
|
|
|
+ apiChartDel({
|
|
|
+ ChartInfoId:chartInfo.value.ChartInfoId
|
|
|
+ }).then(res=>{
|
|
|
+ if(res.Ret===200){
|
|
|
+ showToast('删除成功')
|
|
|
+ setTimeout(() => {
|
|
|
+ router.back()
|
|
|
+ }, 1500)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }).catch(()=>{})
|
|
|
+}
|
|
|
+
|
|
|
+// 另存为
|
|
|
+let showSaveChartOther=ref(false)
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
@@ -382,24 +483,58 @@ let showMoreAction=ref(false)
|
|
|
round
|
|
|
>
|
|
|
<div class="more-action-wrap">
|
|
|
- <div class="item">
|
|
|
- <img src="@/assets/imgs/ppt/icon_action_copy.png" alt="">
|
|
|
+ <div class="item" @click.stop="handleShowCopyTo">
|
|
|
+ <img src="@/assets/imgs/myETA/icon_copy.png" alt="">
|
|
|
<span>复制到</span>
|
|
|
</div>
|
|
|
- <div class="item">
|
|
|
- <img src="@/assets/imgs/ppt/icon_action_copy.png" alt="">
|
|
|
+ <div class="item" @click.stop="showSaveChartOther=true">
|
|
|
+ <img src="@/assets/imgs/myETA/icon_save.png" alt="">
|
|
|
<span>另存为</span>
|
|
|
</div>
|
|
|
- <div class="item">
|
|
|
- <img src="@/assets/imgs/ppt/icon_action_copy.png" alt="">
|
|
|
+ <div class="item" @click.stop="handleRemoveChart">
|
|
|
+ <img src="@/assets/imgs/myETA/icon_remove.png" alt="">
|
|
|
<span>移出</span>
|
|
|
</div>
|
|
|
- <div class="item">
|
|
|
- <img src="@/assets/imgs/ppt/icon_action_copy.png" alt="">
|
|
|
+ <div class="item" @click.stop="handleDeleteChart">
|
|
|
+ <img src="@/assets/imgs/myETA/icon_del.png" alt="">
|
|
|
<span>删除</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</van-popup>
|
|
|
+
|
|
|
+ <!-- 复制到 -->
|
|
|
+ <van-popup
|
|
|
+ v-model:show="showCopyTo"
|
|
|
+ position="bottom"
|
|
|
+ round
|
|
|
+ closeable
|
|
|
+ >
|
|
|
+ <div class="global-pop-wrap_mobile chart-copyto-wrap">
|
|
|
+ <div class="head-box">
|
|
|
+ <div class="title">复制到</div>
|
|
|
+ </div>
|
|
|
+ <div class="content">
|
|
|
+ <ul>
|
|
|
+ <li
|
|
|
+ :class="['item',item.select?'active':'']"
|
|
|
+ v-for="item in copyToOpt"
|
|
|
+ :key="item.MyChartClassifyId"
|
|
|
+ @click="item.select=!item.select"
|
|
|
+ >{{item.MyChartClassifyName}}</li>
|
|
|
+ </ul>
|
|
|
+ <div v-if="copyToOpt.length===0" style="padding:50px 0;text-align:center">无数据</div>
|
|
|
+ </div>
|
|
|
+ <div class="bot-btn-box" @click="handleConfirmCopy">确定</div>
|
|
|
+ </div>
|
|
|
+ </van-popup>
|
|
|
+
|
|
|
+ <!-- 另存为 -->
|
|
|
+ <ChartSaveOther
|
|
|
+ :source="chartInfo?.Source"
|
|
|
+ :chartInfo="chartInfo"
|
|
|
+ :show="showSaveChartOther"
|
|
|
+ @close="showSaveChartOther=false"
|
|
|
+ />
|
|
|
</template>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
@@ -600,4 +735,45 @@ let showMoreAction=ref(false)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+.chart-copyto-wrap{
|
|
|
+ .head-box{
|
|
|
+ .title{
|
|
|
+ padding: 0 $page-padding;
|
|
|
+ font-size: 36px;
|
|
|
+ font-weight: 600;
|
|
|
+ line-height: 120px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .bot-btn-box{
|
|
|
+ line-height: 112px;
|
|
|
+ text-align: center;
|
|
|
+ color: $theme-color;
|
|
|
+ font-size: 32px;
|
|
|
+ }
|
|
|
+ .content{
|
|
|
+ .item{
|
|
|
+ padding: 32px $page-padding;
|
|
|
+ font-size: 32px;
|
|
|
+ border-bottom: 1px solid $border-color;
|
|
|
+ position: relative;
|
|
|
+ &.active{
|
|
|
+ color: $theme-color;
|
|
|
+ &::after{
|
|
|
+ content: '';
|
|
|
+ display: block;
|
|
|
+ width: 36px;
|
|
|
+ height: 36px;
|
|
|
+ background-image: url('@/assets/imgs/icon_select2.png');
|
|
|
+ background-size: cover;
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ position: absolute;
|
|
|
+ top: 50%;
|
|
|
+ right: $page-padding;
|
|
|
+ transform: translateY(-50%);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|