jwyu 1 ano atrás
pai
commit
44e163db4b

+ 7 - 0
src/api/chart.js

@@ -140,6 +140,13 @@ export default{
      */
     refreshChartMultiple(params){
         return post('/datamanage/chart_info/batch_refresh',params)
+    },
+    /**
+     * 刷新图表
+     * @param ChartInfoId
+     */
+    refreshChart(params){
+        return get('/datamanage/chart_info/refresh',params)
     }
 
 } 

+ 7 - 0
src/api/correlationChart.js

@@ -69,4 +69,11 @@ export default {
     searchChartList(params){
         return get('/correlation/chart_info/search_by_es',params)
     },
+    /**
+     * 刷新图表
+     * @param ChartInfoId
+     */
+    refreshChart(params){
+        return get('/correlation/chart_info/refresh',params)
+    }
 }

+ 7 - 0
src/api/futureChart.js

@@ -54,5 +54,12 @@ export default{
      */
     chartSaveOther(params){
         return post('/future_good/chart_info/copy',params)
+    },
+    /**
+     * 刷新图表
+     * @param ChartInfoId
+     */
+    refreshChart(params){
+        return get('/future_good/chart_info/refresh',params)
     }
 }

+ 7 - 0
src/api/lineEquationChart.js

@@ -12,4 +12,11 @@ export default {
     searchChartList(params){
         return get('/line_equation/chart_info/search_by_es',params)
     },
+    /**
+     * 刷新图表
+     * @param ChartInfoId
+     */
+    refreshChart(params){
+        return get('/line_equation/chart_info/refresh',params)
+    }
 }

+ 12 - 0
src/api/statisticFeatureChart.js

@@ -0,0 +1,12 @@
+//统计特征曲线
+import { get,post } from "./index";
+
+export default {
+    /**
+     * 刷新图表
+     * @param ChartInfoId
+     */
+    refreshChart(params){
+        return get('/line_feature/chart_info/refresh',params)
+    }
+}

+ 28 - 0
src/hooks/common.js

@@ -1,5 +1,6 @@
 import {Base64} from 'js-base64'
 import {ref} from 'vue'
+import { showToast } from 'vant'
 
 
 // 导出静态图片资源
@@ -12,4 +13,31 @@ export function useUserInfo(){
     let userInfo=ref(null)
     userInfo.value=localStorage.getItem('userInfo')?JSON.parse(Base64.decode(localStorage.getItem('userInfo'))):null
     return userInfo
+}
+
+/**
+ * 设置剪切板
+ * @param text 文本
+ */
+export function setClipboardData(text){
+    
+    if(navigator.clipboard&&window.isSecureContext){
+        try{
+           await navigator.clipboard.writeText(text)
+           showToast({message:'复制链接成功',type:'success'})
+       }catch(err){
+           console.log(err);
+           throw new Error(JSON.stringify(err)) 
+           showToast({message:'复制链接失败',type:'fail'})
+       }
+   }else{
+       const input = document.createElement('input')
+       input.setAttribute('readonly','readonly')
+       input.value = text
+       document.body.appendChild(input)
+       input.select();
+       document.execCommand('copy');
+       document.body.removeChild(input);
+       showToast({message:'复制链接成功',type:'success'})
+   }
 }

+ 1 - 1
src/router/myETA.js

@@ -10,7 +10,7 @@
         component: () => import("@/views/myETA/Index.vue"),
         meta: { 
             title: "My ETA",
-            keepAlive:false
+            keepAlive:true
         },
     },
     {

+ 88 - 52
src/views/myETA/ChartDetail.vue

@@ -1,14 +1,11 @@
 <script setup>
 import {ref,nextTick, reactive} from 'vue'
 import apiETAChart from '@/api/chart'
-import {
-    apiMyChartList,
-    apiMyClassifyList,
-    apiChartInMyClassifyList,
-    apiChartAddToClassify,
-    apiMyChartRemove,
-    apiChartDel
-} from '@/api/myETA'
+import apiFutureChart from '@/api/futureChart'
+import apiCorrelationChart from '@/api/correlationChart'
+import apiLineEquationChart from '@/api/lineEquationChart'
+import apiStatisticFeatureChart from '@/api/statisticFeatureChart'
+import apiMyETAChart from '@/api/myETA'
 import { useRoute, useRouter } from 'vue-router'
 import {useChartRender} from '@/hooks/chart/render'
 import {yearSelectOpt,sameOptionType} from '@/hooks/chart/config'
@@ -32,7 +29,7 @@ let chartCode=route.query.code
 let allChartList=ref([])
 async function getAllChartList(){
     if(!route.query.cid) return
-    const res=await apiMyChartList({
+    const res=await apiMyETAChart.myChartList({
         CurrentIndex:1,
         PageSize:1000000,
         MyChartClassifyId:Number(route.query.cid)
@@ -331,7 +328,7 @@ let showMoreAction=ref(false)
 // 复制到
 let myChartClassifyList=[]//我的图库中的所有分类
 async function getMyChartClassifyList(){
-    const res=await apiMyClassifyList()
+    const res=await apiMyETAChart.myClassifyList()
     if(res.Ret===200){
         myChartClassifyList=res.Data.List||[]
     }
@@ -340,7 +337,7 @@ getMyChartClassifyList()
 let showCopyTo=ref(false)
 let copyToOpt=ref([])
 async function handleShowCopyTo(){
-    const res=await apiChartInMyClassifyList({ChartInfoId:chartInfo.value.ChartInfoId})
+    const res=await apiMyETAChart.chartInMyClassifyList({ChartInfoId:chartInfo.value.ChartInfoId})
     if(res.Ret===200){
         const arr=res.Data||[]
         copyToOpt.value=myChartClassifyList.map(e=>{
@@ -363,7 +360,7 @@ async function handleConfirmCopy(){
         showToast('请选择分类')
         return
     }
-    const res=await apiChartAddToClassify({
+    const res=await apiMyETAChart.chartAddToClassify({
         ChartInfoId:chartInfo.value.ChartInfoId,
         MyChartClassifyId:arr
     })
@@ -385,7 +382,7 @@ function handleRemoveChart(){
         showCancelButton:true
     }).then(() => {
         // on close
-        apiMyChartRemove({
+        apiMyETAChart.myChartRemove({
             MyChartClassifyId:Number(route.query.cid),
             MyChartId:chartInfo.value.MyChartId
         }).then(res=>{
@@ -407,7 +404,7 @@ function handleDeleteChart(){
         showCancelButton:true
     }).then(() => {
         // on close
-        apiChartDel({
+        apiMyETAChart.chartDel({
             ChartInfoId:chartInfo.value.ChartInfoId
         }).then(res=>{
             if(res.Ret===200){
@@ -423,6 +420,32 @@ function handleDeleteChart(){
 // 另存为
 let showSaveChartOther=ref(false)
 
+// 刷新
+async function handleChartRefresh(){
+    const { Source,ChartInfoId,UniqueCode } = chartInfo.value
+    let res=null
+    if(Source===1){
+        res= await apiETAChart.refreshChart({ ChartInfoId })
+    }else if([2,5].includes(Source)){
+        res=await apiFutureChart.refreshChart({ ChartInfoId })
+    }else if([3,4].includes(Source)){
+        res=await apiCorrelationChart.refreshChart({ ChartInfoId })
+    }else if(Source===6){
+        res=await apiLineEquationChart.refreshChart({ ChartInfoId })
+    }else if([7,8,9].includes(Source)) {
+        res=await apiStatisticFeatureChart.refreshChart({ ChartInfoId })
+    }
+    if(res.Ret!==200)return
+    showToast('刷新成功')
+    showMoreAction.value=false
+    Source===1?reloadChartInfo():getChartInfo()
+}
+
+//分享
+function handleChartShare(){
+    
+}
+
 </script>
 
 <template>
@@ -511,15 +534,13 @@ let showSaveChartOther=ref(false)
         <div class="edb-list-box">
             <!-- pad 设置上下限按钮 -->
             <span class="pad-limit-set-btn" @click="handleShowAxisLimitOpt" v-if="chartInfo.Source!=3&&chartInfo.ChartType!=8">设置上下限</span>
-            <div class="list-lable">指标信息</div>
+            <!-- <div class="list-lable">指标信息</div> -->
             <div class="list-box">
-                <van-cell 
-                    :title="item.EdbName" 
-                    is-link
-                    v-for="item in edbList" 
-                    :key="item.EdbInfoId" 
-                    @click="handleShowEDBInfo(item)"
-                />
+                <div class="list-item" v-for="item in edbList" :key="item.EdbInfoId" @click="handleShowEDBInfo(item)">
+                    <span class="date">{{item.LatestDate}}</span>
+                    <span class="edb-name van-ellipsis" :style="{color:item.ChartColor}">{{item.EdbName}}</span>
+                    <span class="value">{{item.LatestValue}}</span>
+                </div>
             </div>
         </div>
 
@@ -685,23 +706,33 @@ let showSaveChartOther=ref(false)
         v-model:show="showMoreAction"
         position="bottom"
         round
+        closeable
     >
         <div class="more-action-wrap">
+            <div class="van-ellipsis title-box">{{chartInfo.ChartName}}</div>
+            <div class="item" @click.stop="handleChartRefresh">
+                刷新
+            </div>
+            <div class="item" @click.stop="handleChartShare" v-if="!chartInfo.Disabled">
+                分享
+            </div>
+            <div class="item" @click.stop="handleRemoveChart" v-if="$route.query.iscommon!='true'">
+                移出
+            </div>
             <div class="item" @click.stop="handleShowCopyTo" v-if="$route.query.iscommon!='true'">
-                <img src="@/assets/imgs/myETA/icon_copy.png" alt="">
-                <span>复制到</span>
+                复制到
             </div>
             <div class="item" @click.stop="showSaveChartOther=true">
-                <img src="@/assets/imgs/myETA/icon_save.png" alt="">
-                <span>另存为</span>
+                另存为
             </div>
-            <div class="item" @click.stop="handleRemoveChart" v-if="$route.query.iscommon!='true'">
-                <img src="@/assets/imgs/myETA/icon_remove.png" alt="">
-                <span>移出</span>
+            <div class="item">
+                保存图片
+            </div>
+            <div class="item">
+                设置英文名称
             </div>
             <div class="item" @click.stop="handleDeleteChart" v-if="chartInfo.IsEdit">
-                <img src="@/assets/imgs/myETA/icon_del.png" alt="">
-                <span>删除</span>
+                删除
             </div>
         </div>
     </van-popup>
@@ -846,6 +877,7 @@ let showSaveChartOther=ref(false)
     }
 
     .edb-list-box{
+        margin-top: 20px;
         .pad-limit-set-btn{
             display: none;
         }
@@ -855,14 +887,17 @@ let showSaveChartOther=ref(false)
             margin-bottom: 20px;
             margin-top: 40px;
         }
-        :deep(.van-cell){
-            padding-left: 0;
-            padding-right: 0;
-            font-size: 32px;
-        }
-        :deep(.van-cell:after){
-            right: 0;
-            left: 0;
+        .list-item{
+            padding:18px;
+            display: flex;
+            gap:0 20px;
+            border-bottom: 1px solid #DCDFE6;
+            &:last-child{
+                border-bottom: none;
+            }
+            .edb-name{
+                flex: 1;
+            }
         }
     }
 
@@ -940,17 +975,24 @@ let showSaveChartOther=ref(false)
     
 }
 .more-action-wrap{
+    .title-box{
+        font-size: 36px;
+        font-weight: 600;
+        text-align: center;
+        padding: $page-padding;
+    }
     .item{
         display: flex;
         align-items: center;
+        justify-content: center;
         padding: 32px 34px;
-        border-bottom: 1px solid $border-color;
+        border-top: 1px solid $border-color;
         font-size: 32px;
-        img{
-            width: 48px;
-            height: 48px;
-            margin-right: 20px;
-        }
+        // img{
+        //     width: 48px;
+        //     height: 48px;
+        //     margin-right: 20px;
+        // }
     }
 }
 
@@ -1062,13 +1104,7 @@ let showSaveChartOther=ref(false)
                 font-size: 16px;
                 margin-bottom: 14px;
             }
-            :deep(.van-cell){
-                font-size: 14px;
-                padding: 10px 20px;
-            }
-            .list-box{
-                border: 1px solid $border-color;
-            }
+            
         }
         .fix-bot-action-box{
             display: none;

+ 110 - 20
src/views/myETA/Index.vue

@@ -146,7 +146,7 @@ function goDetail(item){
         query:{
             code:item.UniqueCode,
             cid:listState.cid,
-            iscommon:classifyState.classifyTypeAct==1?false:true
+            iscommon:listState.ctype=='我的图库'?false:true
         }
     })
 }
@@ -161,7 +161,8 @@ function goDetail(item){
                 <van-search 
                     shape="round" 
                     readonly 
-                    placeholder="请输入图表名称" 
+                    placeholder="请输入图表名称"
+                    @click="$router.push('/myETA/searchlist')"
                 />
                 <img @click="goChooseChart" class="icon" src="@/assets/imgs/myETA/icon_select.png" alt="icon">
                 <img @click="showClassifyPop=true" class="icon" src="@/assets/imgs/myETA/icon_menu2.png" alt="icon">
@@ -233,22 +234,6 @@ function goDetail(item){
                     </li>
                 </template>
             </draggable>
-            <!-- <ul class="list-box">
-                <li 
-                    class="item"
-                    v-for="item in classifyState.classifyTypeAct==1?classifyState.myClassifyList:classifyState.pubClassifyList"
-                    :key="item.MyChartClassifyId"
-                    @click="handleSwitchClassify(item)"
-                >
-                    <div :class="['van-ellipsis name',item.MyChartClassifyId===listState.cid&&'active-name']">{{item.MyChartClassifyName}}</div>
-                    <div class="icon-drag-box" v-if="classifyState.classifyTypeAct==1">
-                        <img src="@/assets/imgs/icon_drag.png" alt="">
-                    </div>
-                    <div class="icon-menu-box" @click.stop="handleShowOpt(item)">
-                        <img src="@/assets/imgs/myETA/icon_opt.png" alt="">
-                    </div>
-                </li>
-            </ul> -->
             <div class="bot-btns">
                 <van-button type="primary" block @click="handleAddClassify('')">添加我的分类</van-button>
             </div>
@@ -309,7 +294,6 @@ function goDetail(item){
             </div>
             </template>
         </div>
-
     </van-popup>
 </template>
 
@@ -497,6 +481,112 @@ function goDetail(item){
 
 
 @media screen and (min-width:$media-width){
-    
+    .myETA-index-page{
+        padding: 0 $page-padding;
+    }
+    .top-sticky-wrap{
+        top: 60px;
+        padding-bottom: 10px;
+        padding-top: 15px;
+        .search-wrap{
+            .icon{
+                width: 35px;
+                height: 35px;
+                margin-left: 15px;
+            }
+        }
+        .des{
+            margin-top: 15px;
+        }
+    }
+    .chart-list-wrap{
+        justify-content: flex-start;
+        .chart-list-item{
+            width: 326px;
+            padding: 5px 7px;
+            margin-bottom: 10px;
+            border-radius: 6px;
+            margin-left: 5px;
+            margin-right: 5px;
+            .name{
+                min-height: 35px;
+            }
+            .img{
+                height: 220px;
+                margin: 5px 0;
+            }
+            .time{
+                font-size: 14px;
+                .remove-box{
+                    width: 16px;
+                    height: 16px;
+                }
+            }
+        }
+    }
+    .classify-wrap{
+        .type-box{
+            padding: $page-padding;
+            box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.08);
+            .item{
+                margin-right: 20px;
+                font-size: 16px;
+            }
+            .active{
+                &::after{
+                    bottom: -$page-padding;
+                    width: 25px;
+                    height: 3px;
+                    border-radius: 2px;
+                }
+            }
+        }
+        .list-box{
+            padding: $page-padding;
+            .item{
+                padding: 12px 0;
+                .icon-drag-box{
+                    width: 24px;
+                    height: 24px;
+                }
+                .icon-menu-box{
+                    margin-left: 10px;
+                    width: 24px;
+                    height: 24px;
+                }
+            }
+        }
+        .bot-btns{
+            padding: $page-padding;
+        }
+    }
+
+    .rename-wrap{
+        padding: 25px 15px;
+        span{
+            margin-right: 10px;
+        }
+        input{
+            line-height: 35px;
+            padding: 0 15px;
+            border-radius: 35px;
+            width: 75px;
+        }
+    }
+
+    .classify-opt-wrap{
+        .item{
+            padding: 21px;
+            img{
+                width: 18px;
+                height: 18px;
+                margin-right: 10px;
+            }
+            .switch-box{
+                right: 21px;
+            }
+            
+        }
+    }
 }
 </style>

+ 45 - 18
src/views/myETA/SearchList.vue

@@ -83,10 +83,10 @@ function goDetail(item){
         >
             <ul class="list-wrap">
                 <li class="item" v-for="item in listState.list" :key="item.ChartInfoId" @click="goDetail(item)">
-                    <div class="van-ellipsis name">{{item.ChartName}}</div>
+                    <div class="van-multi-ellipsis--l2 name">{{item.ChartName}}</div>
+                    <img class="img" :src="item.ChartImage" alt="">   
                     <div class="time">
-                        <span>创建人:{{item.SysUserRealName}}</span>
-                        <span>创建时间:{{moment(item.CreateTime).format('YYYY-MM-DD')}}</span>
+                        <span>{{item.CreateTime.slice(0,10)}}</span>
                     </div>
                 </li>
             </ul>
@@ -95,41 +95,68 @@ function goDetail(item){
 </template>
 
 <style lang="scss" scoped>
+.search-box{
+    position: sticky;
+    top: 0;
+    background-color: #fff;
+    z-index: 99;
+}
 .list-wrap{
     padding: $page-padding;
+    display: flex;
+    flex-wrap: wrap;
+    box-sizing: border-box;
+    justify-content: space-between;
     .item{
-        padding: 30px 0;
-        border-bottom: 1px solid $border-color;
+        box-sizing: border-box;
+        width: 326px;
+        padding: 10px 14px;
+        border: 1px solid $border-color;
+        margin-bottom: 20px;
+        border-radius: 12px;
         .name{
-            margin-bottom: 20px;
+            min-height: 70px;
+        }
+        .img{
+            width: 100%;
+            height: 220px;
+            display: block;
+            margin: 10px 0;
         }
         .time{
-            display: flex;
-            justify-content: space-between;
-            color: $font-grey_999;
             font-size: 28px;
+            color: $font-grey_999;
+            position: relative;     
         }
     }
 }
 @media screen and (min-width:$media-width){
+
     .chart-search-list-page{
-        max-width: 820px;
-        margin: 0 auto;
         padding-top: 10px;
     }
+    .search-box{
+        top: 60px;
+    }
     .list-wrap{
-        padding: 10px 30px;
+        padding: var(--van-search-padding);
+        justify-content: flex-start;
         .item{
-            padding: 10px 0;
+            width: 326px;
+            padding: 5px 7px;
+            margin-bottom: 10px;
+            border-radius: 6px;
+            margin-left: 5px;
+            margin-right: 5px;
             .name{
-                margin-bottom: 10px;
+                min-height: 35px;
+            }
+            .img{
+                height: 220px;
+                margin: 5px 0;
             }
             .time{
                 font-size: 14px;
-                justify-content: flex-start;
-                span{
-                    margin-right: 20px;
-                }
             }
         }