jwyu 1 жил өмнө
parent
commit
2c7ebe64f4

+ 39 - 3
src/views/dataEDB/calculate/components/DiffusionIndexCalcualate.vue

@@ -6,6 +6,7 @@ import SelectEDB from './SelectEDB.vue'
 import SelectEDBClassify from '../../components/SelectEDBClassify.vue'
 import SelectEDBUnit from '../../components/SelectEDBUnit.vue'
 import SelectEDBFrequency from '../../components/SelectEDBFrequency.vue'
+import EDBHistory from '@/views/dataEDB/components/EDBHistory.vue'
 import {calculateTypeTipsMap} from '../../util/config'
 import { useRoute, useRouter } from 'vue-router';
 import moment from 'moment';
@@ -74,14 +75,16 @@ const edbList=ref([
         target:'',
         startDate:'',
         endDate:'',
-        name:''
+        name:'',
+        EdbType:0
     },
     {
         tag:letterOpts[1],
         target:'',
         startDate:'',
         endDate:'',
-        name:''
+        name:'',
+        EdbType:0
     }
 ])
 function handleAddEdbList(){
@@ -96,7 +99,8 @@ function handleAddEdbList(){
 		target: '',
 		start_date: '',
 		end_date: '',
-        name:''
+        name:'',
+        EdbType:0
 	};
 	edbList.value.push(item);
 }
@@ -124,6 +128,7 @@ function handleConfirmSelectEDB(e){
     edbList.value[whichIndex].startDate=e.StartDate
     edbList.value[whichIndex].endDate=e.EndDate
     edbList.value[whichIndex].name=e.EdbName
+    edbList.value[whichIndex].EdbType=e.EdbType
 }
 
 // 日期合并类型
@@ -236,6 +241,25 @@ async function handleSave(){
     }
 }
 
+// 显示指标溯源
+const showEDBHistory=ref(false)
+const edbHistoryId=ref(0)
+function handleShowEDBHistory(item){
+    //计算指标打开弹窗,基础指标打开新页面
+    if(item.EdbType===2){
+        edbHistoryId.value=item.target
+        showEDBHistory.value=true
+    }else{
+        const routerEl=router.resolve({
+            path:'/dataEDB/detail',
+            query:{
+                edbInfoId:item.target
+            }
+        })
+        window.open(routerEl.href,'_blank')
+    }
+}
+
 
 </script>
 
@@ -249,6 +273,11 @@ async function handleSave(){
                     @click-input="handleShowSelectEDB(index)"
                     :disabled="isPreview"
                 >
+                    <template #left-icon>
+                        <div class="left-icon">
+                            <svg-icon name="edb-history-tag" size="24px" v-if="item.target" @click="handleShowEDBHistory(item)"/>
+                        </div>
+                    </template>
                     <template #input>
                         <div class="edb-info-box">
                             <div class="edb-info" v-if="item.target">
@@ -371,6 +400,9 @@ async function handleSave(){
     <!-- 选择频度 -->
     <SelectEDBFrequency v-model:show="showSelectFrequency" @select="handleConfirmFrequency"/>
 
+    <!-- 指标溯源 -->
+    <EDBHistory v-model:show="showEDBHistory" :edbInfoId="edbHistoryId"/>
+
     <!-- 公式说明 -->
     <van-dialog 
         v-model:show="showTips" 
@@ -491,6 +523,10 @@ async function handleSave(){
         margin-bottom: 16px;
     }
     .select-edb-box{
+        .left-icon{
+            width: 24px;
+            height: 24px;
+        }
         .edb-info-box{
             .time{
                 font-size: 12px;

+ 33 - 0
src/views/dataEDB/calculate/components/FittingResidualsCalculate.vue

@@ -7,6 +7,7 @@ import SelectEDBClassify from '../../components/SelectEDBClassify.vue'
 import SelectEDBUnit from '../../components/SelectEDBUnit.vue'
 import SelectEDBFrequency from '../../components/SelectEDBFrequency.vue'
 import SelectDateRange from '@/components/SelectDateRange.vue'
+import EDBHistory from '@/views/dataEDB/components/EDBHistory.vue'
 import { showToast } from 'vant'
 import { useRoute, useRouter } from 'vue-router'
 import moment from 'moment'
@@ -247,6 +248,25 @@ async function handleSave(){
     }
 }
 
+//点击选择的指标左侧图标查看指标详情
+const showEDBHistory=ref(false)// 显示指标溯源
+const edbHistoryId=ref(0)
+function handleShowEDBHistory(data){
+    //计算指标打开弹窗,基础指标打开新页面
+    if(data.EdbType===2){
+        edbHistoryId.value=data.EdbInfoId
+        showEDBHistory.value=true
+    }else{
+        const routerEl=router.resolve({
+            path:'/dataEDB/detail',
+            query:{
+                edbInfoId:data.EdbInfoId
+            }
+        })
+        window.open(routerEl.href,'_blank')
+    }
+}
+
 </script>
 
 <template>
@@ -259,6 +279,11 @@ async function handleSave(){
                 @click-input="handleShowSelectEDB('independent')"
                 :disabled="isPreview"
             >
+                <template #left-icon>
+                    <div class="left-icon" v-if="independentEDBInfo" @click="handleShowEDBHistory(independentEDBInfo)">
+                        <svg-icon name="edb-history-tag" size="24px"/>
+                    </div>
+                </template>
                 <template #input>
                     <div class="edb-info-box">
                         <div class="edb-info" v-if="independentEDBInfo">
@@ -288,6 +313,11 @@ async function handleSave(){
                 @click-input="handleShowSelectEDB('dependent')"
                 :disabled="isPreview"
             >
+                <template #left-icon>
+                    <div class="left-icon" v-if="dependentEDBInfo" @click="handleShowEDBHistory(dependentEDBInfo)">
+                        <svg-icon name="edb-history-tag" size="24px"/>
+                    </div>
+                </template>
                 <template #input>
                     <div class="edb-info-box">
                         <div class="edb-info" v-if="dependentEDBInfo">
@@ -397,6 +427,9 @@ async function handleSave(){
     <!-- 选择频度 -->
     <SelectEDBFrequency v-model:show="showSelectFrequency" @select="handleConfirmFrequency"/>
 
+    <!-- 指标溯源 -->
+    <EDBHistory v-model:show="showEDBHistory" :edbInfoId="edbHistoryId"/>
+
     <!-- 公式说明 -->
     <van-dialog 
         v-model:show="showTips" 

+ 11 - 5
src/views/dataEDB/calculate/components/FormulaCalculate.vue

@@ -68,28 +68,32 @@ const edbList=ref([
         target:'',
         startDate:'',
         endDate:'',
-        name:''
+        name:'',
+        EdbType:0
     },
     {
         tag:letterOpts[1],
         target:'',
         startDate:'',
         endDate:'',
-        name:''
+        name:'',
+        EdbType:0
     },
     {
         tag:letterOpts[2],
         target:'',
         startDate:'',
         endDate:'',
-        name:''
+        name:'',
+        EdbType:0
     },
     {
         tag:letterOpts[3],
         target:'',
         startDate:'',
         endDate:'',
-        name:''
+        name:'',
+        EdbType:0
     }
 ])
 function handleAddEdbList(){
@@ -104,7 +108,8 @@ function handleAddEdbList(){
 		target: '',
 		start_date: '',
 		end_date: '',
-        name:''
+        name:'',
+        EdbType:0
 	};
 	edbList.value.push(item);
 }
@@ -124,6 +129,7 @@ function handleConfirmSelectEDB(e){
     edbList.value[whichIndex].startDate=e.StartDate
     edbList.value[whichIndex].endDate=e.EndDate
     edbList.value[whichIndex].name=e.EdbName
+    edbList.value[whichIndex].EdbType=e.EdbType
 }
 
 // 显示指标溯源

+ 7 - 3
src/views/dataEDB/calculate/components/OtherCalculate.vue

@@ -398,8 +398,8 @@ function handleShowEDBHistory(data){
                     <li class="info-item">最新日期:{{selectEDBinfo.LatestDate}}</li>
                     <li class="info-item">单位:{{selectEDBinfo.Unit}}</li>
                     <li class="info-item">最新值:{{selectEDBinfo.LatestValue}}</li>
-                    <li class="info-item" style="width:100%">最近更新:{{selectEDBinfo.ModifyTime}}</li>
-                    <li class="info-item" style="width:100%">数据来源:{{selectEDBinfo.SourceName}}</li>
+                    <li class="info-item">最近更新:{{selectEDBinfo.ModifyTime}}</li>
+                    <li class="info-item">数据来源:{{selectEDBinfo.SourceName}}</li>
                 </ul>
                 <div style="text-align:right">
                     <van-button color="#0052D9" size="small" @click="showSeeEDBDataList=true">查看数据</van-button>
@@ -618,7 +618,8 @@ function handleShowEDBHistory(data){
             color: $font-grey;
             margin-bottom: 10px;
             .info-item{
-                width: 50%;
+                width: 100%;
+                margin-bottom: 10px;
             }
         }
     }
@@ -706,6 +707,9 @@ function handleShowEDBHistory(data){
             .info-list{
                 gap: 5px 0;
                 margin-bottom: 5px;
+                .info-item{
+                    margin-bottom: 5px;
+                }
             }
         }
     }