jwyu 1 year ago
parent
commit
8a7b8c15a0

+ 42 - 1
src/views/dataEDB/calculate/BatchDetail.vue

@@ -6,6 +6,7 @@ import SelectEDBUnit from '../components/SelectEDBUnit.vue'
 import SelectEDBFrequency from '../components/SelectEDBFrequency.vue'
 import SeeEDBDataList from './components/SeeEDBDataList.vue'
 import SelectEDB from './components/SelectEDB.vue'
+import EDBHistory from '@/views/dataEDB/components/EDBHistory.vue'
 import {calculateTypeTipsMap} from '../util/config'
 import { showToast,showDialog  } from 'vant';
 import apiDataEDB from '@/api/dataEDB'
@@ -348,12 +349,36 @@ async function handleSave(){
         }else{
             showToast('添加成功')
             setTimeout(() => {
-                router.back()
+                router.replace({
+                    path:'/dataEDB/detail',
+                    query:{
+                        edbInfoId:Success[0].EdbInfoId
+                    }
+                })
             }, 1500);
         }
     }
 }
 
+// 显示指标溯源
+const showEDBHistory=ref(false)
+const edbHistoryId=ref(0)
+function handleShowEDBHistory(item){
+    //计算指标打开弹窗,基础指标打开新页面
+    if(item.EdbType===2){
+        edbHistoryId.value=item.EdbInfoId
+        showEDBHistory.value=true
+    }else{
+        const routerEl=router.resolve({
+            path:'/dataEDB/detail',
+            query:{
+                edbInfoId:item.EdbInfoId
+            }
+        })
+        window.open(routerEl.href,'_blank')
+    }
+}
+
 
 </script>
 
@@ -396,6 +421,11 @@ async function handleSave(){
                 right-icon="arrow"
                 @click-input="showSelectEDB=true"
             >
+                <template #left-icon>
+                    <div class="left-icon">
+                        <svg-icon name="edb-history-tag" size="24px" v-if="edbList[currentEdbInfoIndex].edbData" @click="handleShowEDBHistory(edbList[currentEdbInfoIndex].edbData)"/>
+                    </div>
+                </template>
                 <template #input>
                     <div class="select-edbinfo-box">
                         <div class="edb-info" v-if="edbList[currentEdbInfoIndex].edbData">
@@ -539,6 +569,9 @@ async function handleSave(){
     <!-- 查看指标数据 -->
     <SeeEDBDataList v-model:show="showSeeEDBDataList" :edbInfoId="edbList[currentEdbInfoIndex].edbData?.EdbInfoId" />
 
+    <!-- 指标溯源 -->
+    <EDBHistory v-model:show="showEDBHistory" :edbInfoId="edbHistoryId"/>
+
     <!-- 公式说明 -->
     <van-dialog 
         v-model:show="showTips" 
@@ -592,6 +625,10 @@ async function handleSave(){
     }
 }
 .form-wrap{
+    // .left-icon{
+    //     width: 48px;
+    //     height: 48px;
+    // }
     :deep(.van-cell__right-icon){
         align-self: center;
         color: #333;
@@ -690,6 +727,10 @@ async function handleSave(){
     }
 
     .form-wrap{
+        // .left-icon{
+        //     width: 24px;
+        //     height: 24px;
+        // }
         .select-edbinfo-box{
             .time{
                 font-size: 12px;

+ 10 - 1
src/views/dataEDB/calculate/components/DiffusionIndexCalcualate.vue

@@ -222,7 +222,16 @@ async function handleSave(){
     if(res.Ret===200){
         showToast(res.Msg)
         setTimeout(() => {
-            router.back()
+            if(route.query.type==='edit'){
+                router.back()
+            }else{
+                router.replace({
+                    path:'/dataEDB/detail',
+                    query:{
+                        edbInfoId:res.Data.EdbInfoId
+                    }
+                })
+            }
         }, 1500);
     }
 }

+ 10 - 1
src/views/dataEDB/calculate/components/FittingResidualsCalculate.vue

@@ -233,7 +233,16 @@ async function handleSave(){
     if(res.Ret===200){
         showToast(res.Msg)
         setTimeout(() => {
-            router.back()
+            if(route.query.type==='edit'){
+                router.back()
+            }else{
+                router.replace({
+                    path:'/dataEDB/detail',
+                    query:{
+                        edbInfoId:res.Data.EdbInfoId
+                    }
+                })
+            }
         }, 1500);
     }
 }

+ 10 - 1
src/views/dataEDB/calculate/components/FormulaCalculate.vue

@@ -224,7 +224,16 @@ async function handleSave(){
     if(res.Ret===200){
         showToast(res.Msg)
         setTimeout(() => {
-            router.back()
+            if(edbInfoId){
+                router.back()
+            }else{
+                router.replace({
+                    path:'/dataEDB/detail',
+                    query:{
+                        edbInfoId:res.Data.EdbInfoId
+                    }
+                })
+            }
         }, 1500);
     }
 }

+ 10 - 1
src/views/dataEDB/calculate/components/JointCalculate.vue

@@ -224,7 +224,16 @@ async function handleSave(){
     if(res.Ret===200){
         showToast(route.query.type==='edit'?'编辑成功':'新增成功')
         setTimeout(() => {
-            router.back()
+            if(route.query.type==='edit'){
+                router.back()
+            }else{
+                router.replace({
+                    path:'/dataEDB/detail',
+                    query:{
+                        edbInfoId:res.Data.EdbInfoId
+                    }
+                })
+            }
         }, 1500);
     }
 }

+ 10 - 1
src/views/dataEDB/calculate/components/OtherCalculate.vue

@@ -293,7 +293,16 @@ async function handleSave(){
     if(res.Ret===200){
         showToast(res.Msg)
         setTimeout(() => {
-            router.back()
+            if(route.query.type==='edit'){
+                router.back()
+            }else{
+                router.replace({
+                    path:'/dataEDB/detail',
+                    query:{
+                        edbInfoId:res.Data.EdbInfoId
+                    }
+                })
+            }
         }, 1500);
     }
 }