浏览代码

v1.7.1_EDB

jwyu 1 年之前
父节点
当前提交
3d99b55f25

+ 3 - 0
src/views/dataEDB/calculate/Detail.vue

@@ -1,6 +1,7 @@
 <script setup name="DataEDBCalculateDetail">
 import {ref} from 'vue'
 import { useRoute } from "vue-router";
+import DiffusionIndexCalcualate from './components/DiffusionIndexCalcualate.vue';
 import FittingResidualsCalculate from './components/FittingResidualsCalculate.vue';
 import FormulaCalculate from './components/FormulaCalculate.vue';
 import JointCalculate from './components/JointCalculate.vue';
@@ -22,4 +23,6 @@ document.title=route.query.name||'指标运算'
     <JointCalculate v-if="type==='joint'"/>
     <!-- 拟合残差计算 -->
     <FittingResidualsCalculate v-if="type==='37'"/>
+    <!-- 扩散指数计算 -->
+    <DiffusionIndexCalcualate v-if="type==='53'"/>
 </template>

+ 167 - 0
src/views/dataEDB/calculate/components/DiffusionIndexCalcualate.vue

@@ -0,0 +1,167 @@
+<script setup>
+import apiDataEDB from '@/api/dataEDB'
+import { showToast } from 'vant';
+import {reactive, ref} from 'vue'
+import SelectEDB from './SelectEDB.vue'
+import EDBHistory from '@/views/dataEDB/components/EDBHistory.vue'
+import SelectEDBClassify from '../../components/SelectEDBClassify.vue'
+import SelectEDBUnit from '../../components/SelectEDBUnit.vue'
+import SelectEDBFrequency from '../../components/SelectEDBFrequency.vue'
+import {calculateTypeTipsMap} from '../../util/config'
+import { useRoute, useRouter } from 'vue-router';
+
+const route=useRoute()
+const router=useRouter()
+
+//公式说明
+const showTips=ref(false)
+const tipsContent=ref(calculateTypeTipsMap.get(Number(route.query.type))||'')
+
+
+const letterOpts = [];//字母数据
+function initLetterOpt(){
+    for(let i=0;i<26;i++){
+        letterOpts.push(String.fromCharCode(65+i));
+    }
+}
+initLetterOpt()
+
+//选择的指标集合
+const edbList=ref([
+    {
+        tag:letterOpts[0],
+        target:'',
+        startDate:'',
+        endDate:'',
+        name:''
+    },
+    {
+        tag:letterOpts[1],
+        target:'',
+        startDate:'',
+        endDate:'',
+        name:''
+    }
+])
+function handleAddEdbList(){
+    if(edbList.value.length>=26){
+        showToast('添加指标个数已达上限')
+        return
+    }
+    let tag = edbList.value[edbList.value.length-1].tag;
+	let index = letterOpts.findIndex(item => item === tag);
+	const item = {
+		tag: letterOpts[index+1],
+		target: '',
+		start_date: '',
+		end_date: '',
+        name:''
+	};
+	edbList.value.push(item);
+}
+function handleDeleteEDBItem(index){
+    edbList.value.splice(index, 1)
+}
+// 选择指标
+const showSelectEDB=ref(false)
+let whichIndex=0
+function handleShowSelectEDB(index){
+    whichIndex=index
+    showSelectEDB.value=true
+}
+function handleConfirmSelectEDB(e){
+    edbList.value[whichIndex].target=e.EdbInfoId
+    edbList.value[whichIndex].startDate=e.StartDate
+    edbList.value[whichIndex].endDate=e.EndDate
+    edbList.value[whichIndex].name=e.EdbName
+}
+
+
+</script>
+
+<template>
+    <div class="diffusionIndex-wrap">
+        <section class="section select-edb-box">
+            <van-swipe-cell  v-for="(item,index) in edbList" :key="item.tag" :disabled="index<2">
+                <van-field 
+                    :label="item.tag"
+                    is-link
+                    @click-input="handleShowSelectEDB(index)"
+                >
+                    <template #input>
+                        <div class="edb-info-box">
+                            <div class="edb-info" v-if="item.target">
+                                <span class="name">{{item.name}}</span>
+                                <span class="time">{{item.startDate}}至{{item.endDate}}</span>
+                            </div>
+                            <span class="placeholder" v-else>请选择指标</span>
+                        </div>
+                    </template>
+                </van-field>
+                <template #right>
+                    <van-button square type="danger" text="删除" @click="handleDeleteEDBItem(index)"/>
+                </template>
+            </van-swipe-cell>
+            <div class="add-edb-box" @click="handleAddEdbList">
+                <img src="@/assets/imgs/icon01.png" alt="">
+                <span>添加更多参数</span>
+            </div>
+        </section>
+    </div>
+
+    <!-- 选择指标 -->
+    <SelectEDB v-model:show="showSelectEDB" @select="handleConfirmSelectEDB"/>
+
+</template>
+
+<style lang="scss" scoped>
+.diffusionIndex-wrap{
+    min-height: 90vh;
+    background-color: $page-bg-grey;
+    padding-bottom: 210px ;
+}
+
+.section{
+    background-color: #fff;
+    margin-bottom: 32px;
+}
+
+.select-edb-box{
+    .left-icon{
+        width: 48px;
+        height: 48px;
+    }
+    :deep(.van-cell__right-icon){
+        align-self: center;
+        color: #333;
+    }
+    .edb-info-box{
+        width: 100%;
+        text-align: right;
+        .placeholder{
+            color: var(--van-text-color-3);
+        }
+        .edb-info{
+            display: flex;
+            flex-direction: column;
+        }
+        .time{
+            color: $font-grey_999;
+            font-size: 24px;
+        }
+    }
+    .add-edb-box{
+        display: flex;
+        justify-content: flex-end;
+        align-items: center;
+        color: $theme-color;
+        font-size: 32px;
+        padding: 32px var(--van-cell-horizontal-padding);
+        img{
+            width: 48px;
+            height: 48px;
+        }
+    }
+
+}
+</style>

+ 17 - 0
src/views/dataEDB/calculate/components/OtherCalculate.vue

@@ -165,6 +165,9 @@ function onSelectMoveUnit(e){
 //超季节性日历选择
 const showSelectCalendar=ref(false)
 
+//降频数据取值选择
+const showDataValSelect=ref(false)
+
 //查看指标数据详情
 const showSeeEDBDataList=ref(false)
 
@@ -390,6 +393,17 @@ function handleTabChange(){
                 required
                 @click-input="showSelectCalendar=true"
             />
+            <!-- 降频数据取值 -->
+            <van-field
+                v-if="source===51"
+                :modelValue="baseInfo.valueType"
+                readonly
+                label="数据取值" 
+                placeholder="请选择"
+                input-align="right"
+                right-icon="arrow"
+                @click-input="showDataValSelect=true"
+            />
         </section>
 
         <div class="formula-intro-btn" @click="showTips=true">
@@ -431,6 +445,9 @@ function handleTabChange(){
     <!-- 超季节性日历选择 -->
     <van-action-sheet v-model:show="showSelectCalendar" close-on-click-action :actions="[{name:'公历'},{name:'农历'}]" @select="e=>baseInfo.calendarType=e.name" />
 
+    <!-- 降频数据取值 -->
+    <van-action-sheet v-model:show="showDataValSelect" close-on-click-action :actions="[{name:'期末值'},{name:'平均值'}]" @select="e=>baseInfo.valueType=e.name" />
+    
     <!-- 公式说明 -->
     <van-dialog 
         v-model:show="showTips"