jwyu hai 1 ano
pai
achega
9c629c4450

+ 1 - 0
README.md

@@ -4,3 +4,4 @@
 3. 图标尽量使用svg,将svg图标文件放入assets/svg 目录下,使用时直接用<svg-icon name="文件名"/>
    如果要修改svg颜色将下载的svg中的fill的value改为currentColor(fill="currentColor"),然后在svg-icon 组件上设置class然后设置颜色值
    或者直接把fill删除 可以直接通过color属性来设置颜色
+4. ios端设置剪切板数据无法在异步方法后设置

+ 15 - 0
src/api/dataEDB.js

@@ -351,6 +351,21 @@ export default{
         return post('/datamanage/edb_info/calculate/batch/save/batch',params)
     },
 
+    /**
+     * 指标替换前校验
+     */
+    replaceEDBCheck(){
+        return post('/datamanage/edb_info/replace/check',{})
+    },
+
+    /**
+     * 指标替换
+     * @param NewEdbInfoId
+     * @param OldEdbInfoId
+     */
+    replaceEDB(params){
+        return post('/datamanage/edb_info/replace',params)
+    }
 
 
 }

+ 5 - 0
src/assets/styles/common.scss

@@ -179,4 +179,9 @@ a[href="https://froala.com/wysiwyg-editor"], a[href="https://www.froala.com/wysi
     padding: 36px;
     max-height: 60vh;
     overflow-y: auto;
+}
+@media screen and (min-width:650px){
+    .edb-formula-tips-html-box{
+        padding: 18px;
+    }
 }

+ 13 - 23
src/hooks/edb/useCopyEdbData.js

@@ -1,32 +1,22 @@
 // 复制指标数据
-import apiDataEDB from '@/api/dataEDB'
-import apiDataPredictEDB from '@/api/dataPredictEDB'
 import { showToast } from 'vant'
 import { copyText } from 'vue3-clipboard'
 
 export function useCopyEdbData(){
 
-    async function copyData(e){
-        const params={
-            PageSize: 100000,
-            CurrentIndex: 1,
-            EdbInfoId:e.EdbInfoId
-        }
-        const res=params.EdbInfoCategoryType===1?await apiDataPredictEDB.edbDataList(params):await apiDataEDB.edbDataList(params)
-        if(res.Ret===200){
-            const arr=res.Data.Item.DataList || [];
-            let str = '日期\t 值\n';
-            arr.forEach((item) => (str += `${item.DataTime}\t${item.Value}\n`));
-            copyText(str,undefined,(error,event)=>{
-                if(error){
-                    showToast('复制失败')
-                    console.log('复制数据失败',error);
-                    throw new Error(error)
-                }else{
-                    showToast('复制成功')
-                }
-            })
-        }
+    function copyData(data){
+        let str = '日期\t 值\n';
+        data.forEach((item) => (str += `${item.DataTime}\t${item.Value}\n`));
+        copyText(str,undefined,(error,event)=>{
+            if(error){
+                showToast('复制失败')
+                console.log('复制数据失败',error);
+                throw new Error('复制数据失败'+JSON.stringify(error))
+            }else{
+                showToast('复制成功')
+            }
+        })
+        
     }
 
     return {

+ 8 - 0
src/router/dataEDB.js

@@ -80,4 +80,12 @@ export const dataEDBRoutes=[
             title: "指标批量运算"
         },
     },
+    {
+        path:"/dataEDB/replaceEDB",
+        name:"DataEDBReplaceEDB",
+        component: () => import("@/views/dataEDB/ReplaceEDB.vue"),
+        meta: { 
+            title: "替换指标"
+        },
+    },
 ]

+ 7 - 14
src/views/dataEDB/Detail.vue

@@ -36,28 +36,20 @@ async function getLangType(){
 }
 getLangType()
 
-// 获取指标详情
+// 指标详情
 const edbInfo=ref(null)
-// async function getEDBInfo(){
-//     const res=route.query.edbType==1
-//         ? await apiDataEDB.getBaseEdbInfo({EdbInfoId:Number(route.query.edbInfoId)})
-//         : await apiDataEDB.getCalculateEdbInfo({EdbInfoId:Number(route.query.edbInfoId)})
-//     if(res.Ret===200){
-//         edbInfo.value=res.Data
-//     }
-// }
-// getEDBInfo()
-
+const edbDataAll=ref([])//指标的所有数据
 //获取指标的按钮操作权限和详情
 //由于指标详情接口中没有按钮权限 只能获取一下指标数据接口了
 async function getEDBOptAuth(){
     const res=await apiDataEDB.edbDataList({
         EdbInfoId:route.query.edbInfoId,
-        PageSize: 1,
+        PageSize: 100000,
         CurrentIndex: 1,
     })
     if(res.Ret===200){
         edbInfo.value=res.Data.Item
+        edbDataAll.value=res.Data.Item.DataList || []
     }
 }
 getEDBOptAuth()
@@ -69,8 +61,10 @@ function handleShowLimit(){
 }
 
 //点击复制
+// 提前获取指标的所有数据用于复制(在getEDBOptAuth方法中一起获取)
+// ios端无法在异步方法后设置剪切板内容
 function handleCopyData(){
-    copyData({EdbInfoId:edbInfo.value.EdbInfoId})
+    copyData(edbDataAll.value)
 }
 
 //点击刷新
@@ -183,7 +177,6 @@ function handleSave(){
     chartDetailIns?.value.handleSaveChartLimit()
 }
 
-
 </script>
 
 <template>

+ 30 - 5
src/views/dataEDB/Index.vue

@@ -3,7 +3,7 @@ import {reactive,ref, watch} from 'vue'
 import apiDataEDB from '@/api/dataEDB'
 import {apiCommonSetSysConfig,apiGetLanguageConfig} from '@/api/common'
 import EDBClassify from './components/EDBClassify.vue'
-import { showSuccessToast, showToast } from 'vant'
+import { showDialog, showSuccessToast, showToast } from 'vant'
 import {useRouter} from 'vue-router'
 import {useCachedViewsStore} from '@/store/modules/cachedViews'
 import langIconZH from '@/assets/imgs/chartETA/lang-icon.png'
@@ -78,9 +78,20 @@ function refreshEBDList(){
 
 //基础操作
 const showActionPop=ref(false)
-function handleSelectActionOpt(e){
-    console.log(e);
+async function handleSelectActionOpt(e){
     if(e.path){
+        // 替换指标要做校验
+        if(e.name==='替换指标'){
+            const res=await apiDataEDB.replaceEDBCheck()
+            if(res.Ret!==200) return
+            if(res.Data!==2){
+                showDialog({
+                    title:'提示',
+                    message: '当前正在替换中,请耐心等待',
+                })
+                return
+            }
+        }
         router.push(e.path)
         return
     }
@@ -158,6 +169,19 @@ function handleEDBOpt(type,data){
         })
     }
 
+    //查看计算指标
+    if(type==='see'){
+        router.push({
+            path:'/dataEDB/calculate/detail',
+            query:{
+                source:data.Source,
+                name:data.SourceName,
+                edbInfoId:data.EdbInfoId,
+                type:'preview'
+            }
+        })
+    }
+
     edbOptState.show=false
 }
 
@@ -301,7 +325,8 @@ async function goSearch(){
                 path:'/dataEDB/calculate/index'
             },
             {
-                name:'替换指标'
+                name:'替换指标',
+                path:'/dataEDB/replaceEDB'
             }
         ]"
         @select="handleSelectActionOpt"
@@ -321,7 +346,7 @@ async function goSearch(){
         <template #default>
             <ul class="edb-opt-list">
                 <!-- 计算指标查看 -->
-                <li class="item" v-if="seeComputeEDBInfo(edbOptState.data)">查看</li>
+                <li class="item" v-if="seeComputeEDBInfo(edbOptState.data)" @click="handleEDBOpt('see',edbOptState.data)">查看</li>
                 <li class="item" v-if="edbOptState.data?.Button.ShowEdbRelation" @click="handleEDBOpt('relationEDB',edbOptState.data)">关联指标</li>
                 <li class="item" v-if="edbOptState.data?.Button.ShowChartRelation" @click="handleEDBOpt('relationChart',edbOptState.data)">关联图表</li>
                 <li class="item" v-if="edbOptState.data?.Button.MoveButton" @click="handleEDBOpt('move',edbOptState.data)">移动至</li>

+ 143 - 0
src/views/dataEDB/ReplaceEDB.vue

@@ -0,0 +1,143 @@
+<script setup name="DataEDBReplaceEDB">
+import {ref} from 'vue'
+import apiDataEDB from '@/api/dataEDB'
+import SelectEDB from './calculate/components/SelectEDB.vue'
+import { useRouter } from 'vue-router'
+import { showDialog, showToast } from 'vant'
+
+const router=useRouter()
+
+const beforeEDB=ref(null)
+const afterEDB=ref(null)
+const showSelectEDB=ref(false)
+let selectType='before'
+function handleShowSelectEDB(type){
+    selectType=type
+    showSelectEDB.value=true
+}
+function handleConfirmSelectEDB(e){
+    if(selectType==='before'){
+        beforeEDB.value=e
+    }else{
+        afterEDB.value=e
+    }
+}
+
+const saveBtnLoading=ref(false)
+function handleSave(){
+    if(!beforeEDB.value){
+        showToast('原指标不能为空')
+        return
+    }
+    if(!afterEDB.value){
+        showToast('替换指标不能为空')
+        return
+    }
+    showDialog({
+        title:'提示',
+        message:'本次替换将持续较长时间,是否确认替换?',
+        showCancelButton:true
+    }).then(()=>{
+        apiDataEDB.replaceEDB({
+            OldEdbInfoId:beforeEDB.value.EdbInfoId,
+            NewEdbInfoId:afterEDB.value.EdbInfoId,
+        }).then(res=>{
+            if(res.Ret===200){
+                setTimeout(() => {
+                    router.back()
+                }, 500);
+            }
+        })
+    })
+
+}
+
+</script>
+
+<template>
+    <div class="replace-edb-page">
+        <van-field 
+            :modelValue="beforeEDB?.EdbName"
+            readonly
+            label="原指标" 
+            placeholder="请选择指标"
+            input-align="right"
+            right-icon="arrow"
+            required
+            @click-input="handleShowSelectEDB('before')"
+        />
+        <van-field 
+            :modelValue="afterEDB?.EdbName"
+            readonly
+            label="替换为" 
+            placeholder="请选择指标"
+            input-align="right"
+            right-icon="arrow"
+            required
+            @click-input="handleShowSelectEDB('after')"
+        />
+        <p class="tips">提示:替换后,图表和计算指标引用到原指标的会全部由替换指标替代。</p>
+
+        <div class="opt-btns">
+            <van-button class="primary2" @click="$router.back()">取消</van-button>
+            <van-button 
+                type="primary" 
+                :loading="saveBtnLoading"
+                loading-text="替换中..."
+                @click="handleSave"
+            >全部替换</van-button>
+        </div>
+    </div>
+
+    <!-- 选择指标 -->
+    <SelectEDB v-model:show="showSelectEDB" @select="handleConfirmSelectEDB"/>
+</template>
+
+<style lang="scss" scoped>
+.replace-edb-page{
+    min-height: 90vh;
+    background-color: $page-bg-grey;
+    padding-bottom: 210px ;
+    .tips{
+        color: $font-grey;
+        line-height: 1.7;
+        padding: var(--van-cell-horizontal-padding);
+    }
+}
+.opt-btns{
+    position: fixed;
+    left: 0;
+    right: 0;
+    bottom: 0;
+    background-color: #fff;
+    z-index: 99;
+    padding: 48px;
+    display: flex;
+    justify-content: space-between;
+    .van-button{
+        width: 48%;
+        max-width: 300PX;
+    }
+}
+
+@media screen and (min-width:$media-width){
+    .replace-edb-page{
+        padding-bottom: 105px;
+    }
+    .formula-intro-btn{
+        width: 90px;
+        height: 30px;
+        gap: 2px;
+        border-radius: 16px;
+        .icon{
+            width: 12px;
+            height: 12px;
+        }
+    }
+    .opt-btns{
+        padding: 24px;
+        justify-content: center;
+        gap: 10px;
+    }
+}
+</style>

+ 2 - 0
src/views/dataEDB/SearchList.vue

@@ -72,6 +72,7 @@ function goDetail(item){
             />
         </div>
         <img v-if="listState.list.length==0&&listState.finished&&keyword" class="list-empty-img" src="https://hzstatic.hzinsights.com/static/ETA_mobile/empty_img.png" alt="">
+        <template v-if="keyword">
         <van-list
             v-model:loading="listState.loading"
             :finished="listState.finished"
@@ -93,6 +94,7 @@ function goDetail(item){
                 </li>
             </ul>
         </van-list>
+        </template>
     </div>
 </template>
 

+ 62 - 0
src/views/dataEDB/calculate/BatchDetail.vue

@@ -133,7 +133,11 @@ function handleAddEdbList(){
 	edbList.value.push(item);
 }
 function handleDeleteEDBItem(index){
+    if(index===currentEdbInfoIndex.value){
+        activeTag.value=edbList.value[0].tag
+    }
     edbList.value.splice(index, 1)
+
 }
 // 当前操作指标的下标
 const currentEdbInfoIndex=computed(()=>{
@@ -605,6 +609,64 @@ async function handleSave(){
     justify-content: space-between;
     .van-button{
         width: 48%;
+        max-width: 300PX;
+    }
+}
+@media screen and (min-width:$media-width){
+    .batch-calculate-wrap{
+        padding-bottom: 105px;
+    }
+    .section{
+        margin-bottom: 16px;
+    }
+    .edblist-tag-list{
+        padding: 8px 16px;
+        .tag-list{
+            margin-right: 10px;
+            gap: 0 8px;
+            .item-tag{
+                gap: 6px;
+                padding: 3px 16px;
+            }
+        }
+    }
+
+    .form-wrap{
+        .select-edbinfo-box{
+            .time{
+                font-size: 12px;
+            }
+        }
+        .edbinfo-box{
+            .info-box{
+                margin-top: 7px;
+                border-radius: 4px;
+                padding: 10px;
+                .name{
+                    font-size: 16px;
+                    margin: 0 0 5px 0;
+                }
+                .info-list{
+                    gap: 5px 0;
+                    margin-bottom: 5px;
+                }
+            }
+        }
+    }
+    .formula-intro-btn{
+        width: 90px;
+        height: 30px;
+        gap: 2px;
+        border-radius: 16px;
+        .icon{
+            width: 12px;
+            height: 12px;
+        }
+    }
+    .opt-btns{
+        padding: 24px;
+        justify-content: center;
+        gap: 10px;
     }
 }
 </style>

+ 2 - 2
src/views/dataEDB/calculate/Detail.vue

@@ -20,7 +20,7 @@ async function getCalculateInfo(){
         edbInfo.value=res.Data
     }
 }
-if(route.query.type==='edit'){
+if(['edit','preview'].includes(route.query.type)){
     getCalculateInfo()
 }
 
@@ -35,7 +35,7 @@ if(route.query.type==='edit'){
     <!-- 拼接计算 编辑时则为 23\24 -->
     <JointCalculate v-if="['joint','23','24'].includes(source)" :edbInfo="edbInfo"/>
     <!-- 拟合残差计算 -->
-    <FittingResidualsCalculate v-if="source==='37'"/>
+    <FittingResidualsCalculate v-if="source==='37'" :edbInfo="edbInfo"/>
     <!-- 扩散指数计算 -->
     <DiffusionIndexCalcualate v-if="source==='53'" :edbInfo="edbInfo"/>
 </template>

+ 30 - 1
src/views/dataEDB/calculate/Index.vue

@@ -3,6 +3,10 @@ import {ref} from 'vue'
 import { Dialog } from 'vant';
 import { useRouter } from 'vue-router';
 import {calculateTypeTipsMap,calculateType,calculateBatchType} from '../util/config'
+import { useWindowSize } from '@vueuse/core'
+
+
+const { width } = useWindowSize()
 
 const router=useRouter()
 
@@ -39,7 +43,7 @@ function handleGoBatchDetail(item){
 
 <template>
     <div class="calculate-index-page">
-        <van-tabs sticky swipeable border title-active-color="#0052D9" title-inactive-color="#333" line-width="16px">
+        <van-tabs sticky :offset-top="width>650?60:0" swipeable border title-active-color="#0052D9" title-inactive-color="#333" line-width="16px">
             <van-tab title="常规计算">
                 <ul class="type-list-wrap">
                     <li 
@@ -122,4 +126,29 @@ function handleGoBatchDetail(item){
         }
     }
 }
+@media screen and (min-width:$media-width){
+    .type-list-wrap{
+        padding: $page-padding;
+        gap: 10px;
+        .type-item{
+            padding: 15px 10px;
+            border-radius: 8px;
+            width: 166px;
+            .tips-box{
+                width: 70px;
+                height: 15px;
+                border-radius: 21px;
+                font-size: 11px;
+                svg{
+                    width: 10px;
+                    height: 10px;
+                }
+            }
+            .name{
+                margin-top: 5px;
+                font-size: 14px;
+            }
+        }
+    }
+}
 </style>

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

@@ -20,7 +20,7 @@ const props=defineProps({
 watch(
     ()=>props.edbInfo,
     ()=>{
-        if(route.query.type==='edit'){
+        if(['edit','preview'].includes(route.query.type)){
             edbList.value=props.edbInfo.CalculateList.map(item=>{
                 return {
                     tag:item.FromTag,
@@ -49,6 +49,9 @@ watch(
 const route=useRoute()
 const router=useRouter()
 
+// 预览页面
+const isPreview=ref(route.query.type==='preview'||false)
+
 const source=ref(Number(route.query.source)||0)//计算类型
 
 //公式说明
@@ -112,6 +115,7 @@ function handleDeleteEDBItem(index){
 const showSelectEDB=ref(false)
 let whichIndex=0
 function handleShowSelectEDB(index){
+    if(isPreview.value) return
     whichIndex=index
     showSelectEDB.value=true
 }
@@ -224,11 +228,12 @@ async function handleSave(){
 <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-swipe-cell  v-for="(item,index) in edbList" :key="item.tag" :disabled="index<2||isPreview">
                 <van-field 
                     :label="item.tag"
-                    is-link
+                    :right-icon="!isPreview?'arrow':''"
                     @click-input="handleShowSelectEDB(index)"
+                    :disabled="isPreview"
                 >
                     <template #input>
                         <div class="edb-info-box">
@@ -244,14 +249,14 @@ async function handleSave(){
                     <van-button square type="danger" text="删除" @click="handleDeleteEDBItem(index)"/>
                 </template>
             </van-swipe-cell>
-            <div class="van-cell add-edb-box" @click="handleAddEdbList">
+            <div class="van-cell add-edb-box" @click="handleAddEdbList" v-if="!isPreview">
                 <img src="@/assets/imgs/icon01.png" alt="">
                 <span>添加更多参数</span>
             </div>
             <van-field label="指标扩散日期">
                 <template #input>
                     <div class="contact-date-box">
-                        <van-radio-group v-model="dateContactState.type" shape="dot" @change="dateContactState.list=[]">
+                        <van-radio-group :disabled="isPreview" v-model="dateContactState.type" shape="dot" @change="dateContactState.list=[]">
                             <van-radio :name="1">全部日期并集</van-radio>
                             <van-radio :name="2">部分日期并集</van-radio>
                         </van-radio-group>
@@ -260,6 +265,7 @@ async function handleSave(){
                             direction="horizontal"
                             shape="square" 
                             v-if="dateContactState.type===2"
+                            :disabled="isPreview"
                         >
                             <van-checkbox
                                 v-for="item in edbList"
@@ -282,9 +288,10 @@ async function handleSave(){
                 required
                 @focus="edbNameInputFocus=true"
                 @blur="edbNameInputFocus=false"
+                :disabled="isPreview"
             >
                 <template #right-icon>
-                    <svg-icon class="edit-icon" name="edit" :color="edbNameInputFocus?'#0052D9':'#333333'"/>
+                    <svg-icon v-if="!isPreview" class="edit-icon" name="edit" :color="edbNameInputFocus?'#0052D9':'#333333'"/>
                 </template>
             </van-field>
             <van-field 
@@ -293,9 +300,10 @@ async function handleSave(){
                 label="单位" 
                 placeholder="请选择单位"
                 input-align="right"
-                right-icon="arrow"
+                :right-icon="!isPreview?'arrow':''"
                 required
                 @click-input="showSelectUnit=true"
+                :disabled="isPreview"
             />
             <van-field 
                 :modelValue="classifyStr"
@@ -303,9 +311,10 @@ async function handleSave(){
                 label="指标目录" 
                 placeholder="请选择指标目录"
                 input-align="right"
-                right-icon="arrow"
+                :right-icon="!isPreview?'arrow':''"
                 required
                 @click-input="showSelectClassify=true"
+                :disabled="isPreview"
             />
             <van-field 
                 :modelValue="baseInfo.frequency"
@@ -313,9 +322,10 @@ async function handleSave(){
                 label="频度" 
                 placeholder="请选择指标频度"
                 input-align="right"
-                right-icon="arrow"
+                :right-icon="!isPreview?'arrow':''"
                 required
                 @click-input="showSelectFrequency=true"
+                :disabled="isPreview"
             />
         </section>
 
@@ -324,7 +334,7 @@ async function handleSave(){
             <span>公式说明</span>
         </div>
 
-        <div class="opt-btns">
+        <div class="opt-btns" v-if="!isPreview">
             <van-button class="primary2" @click="$router.back()">取消</van-button>
             <van-button 
                 type="primary" 
@@ -456,6 +466,56 @@ async function handleSave(){
     justify-content: space-between;
     .van-button{
         width: 48%;
+        max-width: 300PX;
+    }
+}
+@media screen and (min-width:$media-width){
+    .diffusionIndex-wrap{
+        padding-bottom: 105px;
+    }
+    .section{
+        margin-bottom: 16px;
+    }
+    .select-edb-box{
+        .edb-info-box{
+            .time{
+                font-size: 12px;
+            }
+        }
+        .add-edb-box{
+            font-size: 16px;
+            padding: 16px var(--van-cell-horizontal-padding);
+            img{
+                width: 24px;
+                height: 24px;
+            }
+        }
+    }
+    .contact-date-box{
+        .van-radio{
+            margin-bottom: 5px;
+        }
+        .van-checkbox-group--horizontal{
+            gap: 4px;
+        }
+        .time{
+            margin-top: 5px;
+        }
+    }
+    .formula-intro-btn{
+        width: 90px;
+        height: 30px;
+        gap: 2px;
+        border-radius: 16px;
+        .icon{
+            width: 12px;
+            height: 12px;
+        }
+    }
+    .opt-btns{
+        padding: 24px;
+        justify-content: center;
+        gap: 10px;
     }
 }
 </style>

+ 117 - 14
src/views/dataEDB/calculate/components/FittingResidualsCalculate.vue

@@ -1,7 +1,7 @@
 <script setup>
 import apiDataEDB from '@/api/dataEDB'
 import {calculateTypeTipsMap} from '../../util/config'
-import {ref,reactive} from 'vue'
+import {ref,reactive,watch} from 'vue'
 import SelectEDB from './SelectEDB.vue'
 import SelectEDBClassify from '../../components/SelectEDBClassify.vue'
 import SelectEDBUnit from '../../components/SelectEDBUnit.vue'
@@ -14,6 +14,57 @@ import moment from 'moment'
 const route=useRoute()
 const router=useRouter()
 
+const props=defineProps({
+    edbInfo:{
+        type:Object,
+        default:null
+    }
+})
+
+watch(
+    ()=>props.edbInfo,
+    ()=>{
+        if(['edit','preview'].includes(route.query.type)){
+            props.edbInfo.CalculateList.forEach(item=>{
+                if(item.FromTag==='A'){
+                    independentEDBInfo.value={
+                        EdbInfoId:item.FromEdbInfoId,
+                        EdbName:item.FromEdbName,
+                        StartDate:item.StartDate,
+                        EndDate:item.EndDate
+                    }
+                    selfMoveType.value=item.MoveValue===0?0:1
+                    selfMoveVal.value=item.MoveValue
+                }
+                if(item.FromTag==='B'){
+                    dependentEDBInfo.value={
+                        EdbInfoId:item.FromEdbInfoId,
+                        EdbName:item.FromEdbName,
+                        StartDate:item.StartDate,
+                        EndDate:item.EndDate
+                    }
+                }
+            })
+
+            fittingDate.value=props.edbInfo.EdbInfoDetail.CalculateFormula.split(',')
+
+            baseInfo.name=props.edbInfo.EdbInfoDetail.EdbName
+            baseInfo.unit=props.edbInfo.EdbInfoDetail.Unit
+            baseInfo.classify=props.edbInfo.EdbInfoDetail.ClassifyId
+            baseInfo.frequency=props.edbInfo.EdbInfoDetail.Frequency
+
+            setTimeout(() => {
+                selectEDBClassifyINS.value?.getSelectClassifyOpt(props.edbInfo.EdbInfoDetail.ClassifyId)//获取选择的分类目录
+            }, 1000);
+
+            getEDBCorrelationIndex()
+        }
+    }
+)
+
+// 预览页面
+const isPreview=ref(route.query.type==='preview'||false)
+
 const source=ref(Number(route.query.source)||0)//计算类型
 
 //公式说明
@@ -52,6 +103,7 @@ const independentEDBInfo=ref(null)//自变量指标
 const dependentEDBInfo=ref(null)//因变量指标
 let currentSelectEDBType=''
 function handleShowSelectEDB(type){
+    if(isPreview.value) return
     currentSelectEDBType=type
     showSelectEDB.value=true
 }
@@ -107,6 +159,7 @@ function onConfirmSelectUnit(value){
 //选择分类
 const showSelectClassify=ref(false)
 const classifyStr=ref('')
+const selectEDBClassifyINS=ref(null)
 function handleConfirmClassify({value,selectedOptions}){
     baseInfo.classify=value
     classifyStr.value=`${selectedOptions[0].ClassifyName}/${selectedOptions[1].ClassifyName}/${selectedOptions[2].ClassifyName}`
@@ -170,7 +223,7 @@ async function handleSave(){
         ]
     }
     saveBtnLoading.value=true
-    const res=await apiDataEDB.addCalculateEDB(params)
+    const res=route.query.type==='edit'?await apiDataEDB.editCalculateEDB({...params,EdbInfoId:Number(route.query.edbInfoId)}) : await apiDataEDB.addCalculateEDB(params)
     saveBtnLoading.value=false
     if(res.Ret===200){
         showToast(res.Msg)
@@ -188,8 +241,9 @@ async function handleSave(){
             <van-field 
                 label="自变量"
                 required
-                right-icon="arrow"
+                :right-icon="!isPreview?'arrow':''"
                 @click-input="handleShowSelectEDB('independent')"
+                :disabled="isPreview"
             >
                 <template #input>
                     <div class="edb-info-box">
@@ -203,12 +257,12 @@ async function handleSave(){
             </van-field>
             <van-cell>
                 <div class="self-move-type-box">
-                    <van-radio-group v-model="selfMoveType" shape="dot" direction="horizontal" @change="handleSelfMoveTypeChange">
+                    <van-radio-group :disabled="isPreview" v-model="selfMoveType" shape="dot" direction="horizontal" @change="handleSelfMoveTypeChange">
                         <van-radio :name="0">标准指标</van-radio>
                         <van-radio :name="1">领先天数</van-radio>
                     </van-radio-group>
                     <div class="day-box" v-show="selfMoveType===1">
-                        <input class="input" type="number" :min="0" v-model="selfMoveVal" @change="getEDBCorrelationIndex()">
+                        <input class="input" :disabled="isPreview" type="number" :min="0" v-model="selfMoveVal" @change="getEDBCorrelationIndex()">
                         <span>天</span>
                     </div>
                 </div>
@@ -216,8 +270,9 @@ async function handleSave(){
             <van-field 
                 label="因变量"
                 required
-                right-icon="arrow"
+                :right-icon="!isPreview?'arrow':''"
                 @click-input="handleShowSelectEDB('dependent')"
+                :disabled="isPreview"
             >
                 <template #input>
                     <div class="edb-info-box">
@@ -231,9 +286,10 @@ async function handleSave(){
             </van-field>
             <van-field
                 label="拟合时间段"
-                right-icon="arrow"
+                :right-icon="!isPreview?'arrow':''"
                 required
-                @click-input="showFittingDate=true"
+                @click-input="()=>{if(isPreview) return false ;showFittingDate=true}"
+                :disabled="isPreview"
             >
                 <template #input>
                     <div class="edb-info-box">
@@ -255,9 +311,10 @@ async function handleSave(){
                 required
                 @focus="edbNameInputFocus=true"
                 @blur="edbNameInputFocus=false"
+                :disabled="isPreview"
             >
                 <template #right-icon>
-                    <svg-icon class="edit-icon" name="edit" :color="edbNameInputFocus?'#0052D9':'#333333'"/>
+                    <svg-icon v-if="!isPreview" class="edit-icon" name="edit" :color="edbNameInputFocus?'#0052D9':'#333333'"/>
                 </template>
             </van-field>
             <van-field 
@@ -266,9 +323,10 @@ async function handleSave(){
                 label="单位" 
                 placeholder="请选择单位"
                 input-align="right"
-                right-icon="arrow"
+                :right-icon="!isPreview?'arrow':''"
                 required
                 @click-input="showSelectUnit=true"
+                :disabled="isPreview"
             />
             <van-field 
                 :modelValue="classifyStr"
@@ -276,9 +334,10 @@ async function handleSave(){
                 label="指标目录" 
                 placeholder="请选择指标目录"
                 input-align="right"
-                right-icon="arrow"
+                :right-icon="!isPreview?'arrow':''"
                 required
                 @click-input="showSelectClassify=true"
+                :disabled="isPreview"
             />
             <van-field 
                 :modelValue="baseInfo.frequency"
@@ -286,9 +345,10 @@ async function handleSave(){
                 label="频度" 
                 placeholder="请选择指标频度"
                 input-align="right"
-                right-icon="arrow"
+                :right-icon="!isPreview?'arrow':''"
                 required
                 @click-input="showSelectFrequency=true"
+                :disabled="isPreview"
             />
         </section>
 
@@ -297,7 +357,7 @@ async function handleSave(){
             <span>公式说明</span>
         </div>
 
-        <div class="opt-btns">
+        <div class="opt-btns" v-if="!isPreview">
             <van-button class="primary2" @click="$router.back()">取消</van-button>
             <van-button 
                 type="primary" 
@@ -318,7 +378,7 @@ async function handleSave(){
     <SelectEDBUnit v-model:show="showSelectUnit" @select="onConfirmSelectUnit"/>
 
     <!-- 选择分类 -->
-    <SelectEDBClassify v-model:show="showSelectClassify" @select="handleConfirmClassify" />
+    <SelectEDBClassify ref="selectEDBClassifyINS" :defaultId="baseInfo.classify" v-model:show="showSelectClassify" @select="handleConfirmClassify" />
 
     <!-- 选择频度 -->
     <SelectEDBFrequency v-model:show="showSelectFrequency" @select="handleConfirmFrequency"/>
@@ -413,6 +473,49 @@ async function handleSave(){
     justify-content: space-between;
     .van-button{
         width: 48%;
+        max-width: 300PX;
+    }
+}
+@media screen and (min-width:$media-width){
+    .fitting-residuals-wrap{
+        padding-bottom: 105px;
+    }
+    .section{
+        margin-bottom: 16px;
+    }
+    .self-move-type-box{
+        padding: 10px 0;
+        .day-box{
+            gap: 5px;
+            .input{
+                width: 40px;
+                height: 24px;
+                border-radius: 3px;
+                padding: 0 5px;
+            }
+        }
+    }
+    .select-edb-box{
+        .edb-info-box{
+            .time{
+                font-size: 12px;
+            }
+        }
+    }
+    .formula-intro-btn{
+        width: 90px;
+        height: 30px;
+        gap: 2px;
+        border-radius: 16px;
+        .icon{
+            width: 12px;
+            height: 12px;
+        }
+    }
+    .opt-btns{
+        padding: 24px;
+        justify-content: center;
+        gap: 10px;
     }
 }
 </style>

+ 91 - 13
src/views/dataEDB/calculate/components/FormulaCalculate.vue

@@ -24,7 +24,7 @@ const props=defineProps({
 watch(
     ()=>props.edbInfo,
     ()=>{
-        if(route.query.type==='edit'){
+        if(['edit','preview'].includes(route.query.type)){
             edbList.value=props.edbInfo.CalculateList.map(item=>{
                 return {
                     tag:item.FromTag,
@@ -46,6 +46,8 @@ watch(
     }
 )
 
+// 预览页面
+const isPreview=ref(route.query.type==='preview'||false)
 
 const letterOpts = [];//字母数据
 function initLetterOpt(){
@@ -113,6 +115,7 @@ function handleDeleteEDBItem(index){
 const showSelectEDB=ref(false)
 let whichIndex=0
 function handleShowSelectEDB(index){
+    if(isPreview.value) return
     whichIndex=index
     showSelectEDB.value=true
 }
@@ -127,8 +130,19 @@ function handleConfirmSelectEDB(e){
 const showEDBHistory=ref(false)
 const edbHistoryId=ref(0)
 function handleShowEDBHistory(item){
-    edbHistoryId.value=item.target
-    showEDBHistory.value=true
+    //计算指标打开弹窗,基础指标打开新页面
+    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')
+    }
 }
 
 // 计算公式
@@ -215,11 +229,12 @@ async function handleSave(){
 <template>
     <div class="formula-calculate-wrap">
         <section class="section select-edb-box">
-            <van-swipe-cell  v-for="(item,index) in edbList" :key="item.tag" :disabled="index<4">
+            <van-swipe-cell  v-for="(item,index) in edbList" :key="item.tag" :disabled="index<4||isPreview">
                 <van-field 
                     :label="item.tag"
-                    is-link
+                    :right-icon="!isPreview?'arrow':''"
                     @click-input="handleShowSelectEDB(index)"
+                    :disabled="isPreview"
                 >
                     <template #left-icon>
                         <div class="left-icon">
@@ -240,7 +255,7 @@ async function handleSave(){
                     <van-button square type="danger" text="删除" @click="handleDeleteEDBItem(index)"/>
                 </template>
             </van-swipe-cell>
-            <div class="add-edb-box" @click="handleAddEdbList">
+            <div class="add-edb-box" @click="handleAddEdbList" v-if="!isPreview">
                 <img src="@/assets/imgs/icon01.png" alt="">
                 <span>添加更多参数</span>
             </div>
@@ -251,8 +266,8 @@ async function handleSave(){
                 required
             >
                 <template #input>
-                    <div>
-                    <input class="formula-input" type="text" placeholder="请输入公式" v-model="formulaVal">
+                    <div style="margin-left:auto">
+                    <input class="formula-input" :disabled="isPreview" type="text" placeholder="请输入公式" v-model="formulaVal">
                     <div class="formula-tips">
                         <p class="en-text-wrap">公式示例:A*0.5+B*C*1.2+120-MAX(A,B,C)</p>
                         <p class="en-text-wrap">函数支持:MAX(),MIN(),ln(A),log(a,A)</p>
@@ -270,9 +285,10 @@ async function handleSave(){
                 required
                 @focus="edbNameInputFocus=true"
                 @blur="edbNameInputFocus=false"
+                :disabled="isPreview"
             >
                 <template #right-icon>
-                    <svg-icon class="edit-icon" name="edit" :color="edbNameInputFocus?'#0052D9':'#333333'"/>
+                    <svg-icon v-if="!isPreview" class="edit-icon" name="edit" :color="edbNameInputFocus?'#0052D9':'#333333'"/>
                 </template>
             </van-field>
             <van-field 
@@ -281,9 +297,10 @@ async function handleSave(){
                 label="单位" 
                 placeholder="请选择单位"
                 input-align="right"
-                right-icon="arrow"
+                :right-icon="!isPreview?'arrow':''"
                 required
                 @click-input="showSelectUnit=true"
+                :disabled="isPreview"
             />
             <van-field 
                 :modelValue="classifyStr"
@@ -291,9 +308,10 @@ async function handleSave(){
                 label="指标目录" 
                 placeholder="请选择指标目录"
                 input-align="right"
-                right-icon="arrow"
+                :right-icon="!isPreview?'arrow':''"
                 required
                 @click-input="showSelectClassify=true"
+                :disabled="isPreview"
             />
             <van-field 
                 :modelValue="baseInfo.frequency"
@@ -301,16 +319,17 @@ async function handleSave(){
                 label="频度" 
                 placeholder="请选择指标频度"
                 input-align="right"
-                right-icon="arrow"
+                :right-icon="!isPreview?'arrow':''"
                 required
                 @click-input="showSelectFrequency=true"
+                :disabled="isPreview"
             />
         </section>
         <div class="formula-intro-btn" @click="showTips=true">
             <svg-icon class="icon" name="warning"></svg-icon>
             <span>公式说明</span>
         </div>
-        <div class="opt-btns">
+        <div class="opt-btns" v-if="!isPreview">
             <van-button class="primary2" @click="$router.back()">取消</van-button>
             <van-button type="primary" @click="handleSave">生成计算指标</van-button>
         </div>
@@ -440,6 +459,65 @@ async function handleSave(){
     justify-content: space-between;
     .van-button{
         width: 48%;
+        max-width: 300PX;
+    }
+}
+@media screen and (min-width:$media-width){
+    .formula-calculate-wrap{
+        padding-bottom: 105px;
+    }
+    .section{
+        margin-bottom: 16px;
+    }
+    .select-edb-box{
+        .left-icon{
+            width: 24px;
+            height: 24px;
+        }
+        .edb-info-box{
+            .time{
+                font-size: 12px;
+            }
+        }
+        .add-edb-box{
+            font-size: 16px;
+            padding: 16px var(--van-cell-horizontal-padding);
+            img{
+                width: 24px;
+                height: 24px;
+            }
+        }
+    }
+    .formula-box{
+        .formula-input{
+            padding: 6px 16px;
+            border-radius: 6px;
+        }
+        .formula-tips{
+            font-size: 12px;
+        }
+    }
+    .baseinfo-box{
+        .edit-icon{
+            width: 24px;
+            height: 24px;
+        }
+    }
+    .formula-intro-btn{
+        width: 90px;
+        height: 30px;
+        gap: 2px;
+        border-radius: 16px;
+        .icon{
+            width: 12px;
+            height: 12px;
+        }
+    }
+    .opt-btns{
+        padding: 24px;
+        justify-content: center;
+        gap: 10px;
     }
+    
 }
 </style>

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

@@ -21,7 +21,7 @@ const props=defineProps({
 watch(
     ()=>props.edbInfo,
     ()=>{
-        if(route.query.type==='edit'){
+        if(['edit','preview'].includes(route.query.type)){
             const edbInfoData=props.edbInfo.EdbInfoDetail
             if(edbInfoData.Source===24){//累计同比拼接
                 tabActive.value=2
@@ -57,6 +57,8 @@ watch(
     }
 )
 
+// 预览页面
+const isPreview=ref(route.query.type==='preview'||false)
 
 //公式说明
 const tipsConfig=new Map([
@@ -111,6 +113,7 @@ const afterEBDInfo=ref(null)
 const showSelectEDB=ref(false)
 let currentSelectEDBType=''//当前是选择哪个指标
 function handleShowSelectEDB(type){
+    if(isPreview.value) return
     currentSelectEDBType=type
     if(tabActive.value===2&&type==='before'){//累计同比值拼接选择待拼接指标搜索指标时Frequency传月度
         selectEDBSearchParams.value={Frequency:'月度'}
@@ -234,7 +237,7 @@ async function handleSave(){
             title-inactive-color="#333" 
             line-width="16px"
             @change="handleTabChange"
-            v-if="$route.query.type!=='edit'"
+            v-if="!['edit','preview'].includes($route.query.type)"
         >
             <van-tab 
                 :title="tab.label" 
@@ -250,17 +253,19 @@ async function handleSave(){
                 label="拼接日期" 
                 placeholder="请选择日期"
                 input-align="right"
-                right-icon="arrow"
+                :right-icon="!isPreview?'arrow':''"
                 required
                 @click-input="showSelectJointDate=true"
                 v-if="tabActive===1"
+                :disabled="isPreview"
             />
             <van-field
                 label-width="7em"
                 :label="tabActive===1?'拼接日期之前':'待拼接指标'"
                 required
-                right-icon="arrow"
+                :right-icon="!isPreview?'arrow':''"
                 @click-input="handleShowSelectEDB('before')"
+                :disabled="isPreview"
             >
                 <template #input>
                     <div class="edb-info-box">
@@ -276,9 +281,10 @@ async function handleSave(){
             <van-field
                 label-width="7em"
                 :label="tabActive===1?'拼接日期之后':'同比值指标'"
-                right-icon="arrow"
+                :right-icon="!isPreview?'arrow':''"
                 required
                 @click-input="handleShowSelectEDB('after')"
+                :disabled="isPreview"
             >
                 <template #input>
                     <div class="edb-info-box">
@@ -301,9 +307,10 @@ async function handleSave(){
                 required
                 @focus="edbNameInputFocus=true"
                 @blur="edbNameInputFocus=false"
+                :disabled="isPreview"
             >
                 <template #right-icon>
-                    <svg-icon class="edit-icon" name="edit" :color="edbNameInputFocus?'#0052D9':'#333333'"/>
+                    <svg-icon v-if="!isPreview" class="edit-icon" name="edit" :color="edbNameInputFocus?'#0052D9':'#333333'"/>
                 </template>
             </van-field>
             <van-field 
@@ -312,9 +319,10 @@ async function handleSave(){
                 label="单位" 
                 placeholder="请选择单位"
                 input-align="right"
-                right-icon="arrow"
+                :right-icon="!isPreview?'arrow':''"
                 required
                 @click-input="showSelectUnit=true"
+                :disabled="isPreview"
             />
             <van-field 
                 :modelValue="classifyStr"
@@ -322,9 +330,10 @@ async function handleSave(){
                 label="指标目录" 
                 placeholder="请选择指标目录"
                 input-align="right"
-                right-icon="arrow"
+                :right-icon="!isPreview?'arrow':''"
                 required
                 @click-input="showSelectClassify=true"
+                :disabled="isPreview"
             />
             <van-field 
                 :modelValue="baseInfo.frequency"
@@ -332,9 +341,10 @@ async function handleSave(){
                 label="频度" 
                 placeholder="请选择指标频度"
                 input-align="right"
-                right-icon="arrow"
+                :right-icon="!isPreview?'arrow':''"
                 required
                 @click-input="showSelectFrequency=true"
+                :disabled="isPreview"
             />
         </section>
 
@@ -343,7 +353,7 @@ async function handleSave(){
             <span>公式说明</span>
         </div>
 
-        <div class="opt-btns">
+        <div class="opt-btns" v-if="!isPreview">
             <van-button class="primary2" @click="$router.back()">取消</van-button>
             <van-button 
                 type="primary" 
@@ -440,6 +450,31 @@ async function handleSave(){
     justify-content: space-between;
     .van-button{
         width: 48%;
+        max-width: 300PX;
+    }
+}
+
+@media screen and (min-width:$media-width){
+    .joint-calculate-wrap{
+        padding-bottom: 105px;
+    }
+    .section{
+        margin-bottom: 16px;
+    }
+    .formula-intro-btn{
+        width: 90px;
+        height: 30px;
+        gap: 2px;
+        border-radius: 16px;
+        .icon{
+            width: 12px;
+            height: 12px;
+        }
+    }
+    .opt-btns{
+        padding: 24px;
+        justify-content: center;
+        gap: 10px;
     }
 }
 </style>

+ 110 - 21
src/views/dataEDB/calculate/components/OtherCalculate.vue

@@ -1,6 +1,7 @@
 <script setup>
 import {ref,reactive,watch} from 'vue'
 import { useRoute, useRouter } from "vue-router";
+import EDBHistory from '@/views/dataEDB/components/EDBHistory.vue'
 import SelectEDB from './SelectEDB.vue'
 import SelectEDBClassify from '../../components/SelectEDBClassify.vue'
 import SelectEDBUnit from '../../components/SelectEDBUnit.vue'
@@ -9,7 +10,9 @@ import SeeEDBDataList from './SeeEDBDataList.vue'
 import {calculateTypeTipsMap} from '../../util/config'
 import { showToast } from 'vant';
 import apiDataEDB from '@/api/dataEDB'
+import { useWindowSize } from '@vueuse/core'
 
+const { width } = useWindowSize()
 const route=useRoute()
 const router=useRouter()
 
@@ -23,7 +26,7 @@ const props=defineProps({
 watch(
     ()=>props.edbInfo,
     ()=>{
-        if(route.query.type==='edit'){
+        if(['edit','preview'].includes(route.query.type)){
             const fromEdbInfo=props.edbInfo.CalculateList[0]
             const edbInfoData=props.edbInfo.EdbInfoDetail
             searchEDBInfoByCode(fromEdbInfo.FromEdbCode)
@@ -45,8 +48,6 @@ watch(
             if([8,12,13,35].includes(edbInfoData.Source)){
                 baseInfo.numberN=Number(edbInfoData.CalculateFormula)
             }
-            
-            
 
             setTimeout(() => {
                 selectEDBClassifyINS.value?.getSelectClassifyOpt(props.edbInfo.EdbInfoDetail.ClassifyId)//获取选择的分类目录
@@ -55,6 +56,9 @@ watch(
     }
 )
 
+// 预览页面
+const isPreview=ref(route.query.type==='preview'||false)
+
 const moveTypeOpts=[{name:'领先',key:1},{name:'滞后',key:2}]
 const moveUnitOpts=[
     {name:'天',key:'天'},
@@ -290,13 +294,31 @@ function handleTabChange(){
 
 }
 
+//点击选择的指标左侧图标查看指标详情
+const showEDBHistory=ref(false)// 显示指标溯源
+function handleShowEDBHistory(data){
+    //计算指标打开弹窗,基础指标打开新页面
+    if(data.EdbType===2){
+        showEDBHistory.value=true
+    }else{
+        const routerEl=router.resolve({
+            path:'/dataEDB/detail',
+            query:{
+                edbInfoId:data.EdbInfoId
+            }
+        })
+        window.open(routerEl.href,'_blank')
+    }
+}
+
 </script>
 
 <template>
     <div class="other-calculate-wrap">
         <van-tabs 
             v-model:active="source" 
-            sticky 
+            sticky
+            :offset-top="width>650?60:0"
             border 
             title-active-color="#0052D9" 
             title-inactive-color="#333" 
@@ -315,14 +337,15 @@ function handleTabChange(){
             <van-field
                 :modelValue="selectEDBinfo?.EdbName"
                 label="选择指标"
-                is-link
+                :right-icon="!isPreview?'arrow':''"
                 readonly
                 placeholder="请选择指标"
                 input-align="right"
                 @click-input="showSelectEDB=true"
+                :disabled="isPreview"
             >
                 <template #left-icon>
-                    <div class="left-icon" v-if="selectEDBinfo">
+                    <div class="left-icon" v-if="selectEDBinfo" @click="handleShowEDBHistory(selectEDBinfo)">
                         <svg-icon name="edb-history-tag" size="24px"/>
                     </div>
                 </template>
@@ -357,16 +380,17 @@ function handleTabChange(){
                 label="移动方式"
                 required
                 v-if="source===22"
+                :disabled="isPreview"
             >
                 <template #input>
                     <div class="move-type-box">
-                        <div class="btn" @click="showMoveType=true">
-                            <svg-icon name="swap"></svg-icon>
+                        <div :class="['btn',isPreview?'disabled':'']" @click="()=>{if(isPreview)return false;showMoveType=true}">
+                            <svg-icon name="swap" v-if="!isPreview"></svg-icon>
                             <span>{{getMoveTypeName(baseInfo.moveType)}}</span>
                         </div>
-                        <input class="input" type="number" :min="0" v-model="baseInfo.moveVal">
-                        <div class="btn" @click="showMoveUnit=true">
-                            <svg-icon name="swap"></svg-icon>
+                        <input :disabled="isPreview" class="input" type="number" :min="0" v-model="baseInfo.moveVal">
+                        <div :class="['btn',isPreview?'disabled':'']" @click="()=>{if(isPreview)return false;showMoveUnit=true}">
+                            <svg-icon name="swap" v-if="!isPreview"></svg-icon>
                             <span>{{baseInfo.moveUnit}}</span>
                         </div>
                     </div>
@@ -380,9 +404,10 @@ function handleTabChange(){
                 required
                 @focus="edbNameInputFocus=true"
                 @blur="edbNameInputFocus=false"
+                :disabled="isPreview"
             >
                 <template #right-icon>
-                    <svg-icon class="edit-icon" name="edit" :color="edbNameInputFocus?'#0052D9':'#333333'"/>
+                    <svg-icon v-if="!isPreview" class="edit-icon" name="edit" :color="edbNameInputFocus?'#0052D9':'#333333'"/>
                 </template>
             </van-field>
             <van-field 
@@ -391,10 +416,10 @@ function handleTabChange(){
                 label="单位" 
                 placeholder="请选择单位"
                 input-align="right"
-                right-icon="arrow"
+                :right-icon="!isPreview?'arrow':''"
                 required
                 @click-input="showSelectUnit=true"
-                :disabled="!editEdbInfoId&&[6,7].includes(source)"
+                :disabled="!editEdbInfoId&&[6,7].includes(source)||isPreview"
             />
             <van-field 
                 :modelValue="classifyStr"
@@ -402,9 +427,10 @@ function handleTabChange(){
                 label="指标目录" 
                 placeholder="请选择指标目录"
                 input-align="right"
-                right-icon="arrow"
+                :right-icon="!isPreview?'arrow':''"
                 required
                 @click-input="showSelectClassify=true"
+                :disabled="isPreview"
             />
             <van-field 
                 :modelValue="baseInfo.frequency"
@@ -412,10 +438,10 @@ function handleTabChange(){
                 label="频度" 
                 placeholder="请选择指标频度"
                 input-align="right"
-                right-icon="arrow"
+                :right-icon="!isPreview?'arrow':''"
                 required
                 @click-input="showSelectFrequency=true"
-                :disabled="[5,14,61,63].includes(source)||(!editEdbInfoId&&[6,7].includes(source))"
+                :disabled="[5,14,61,63].includes(source)||(!editEdbInfoId&&[6,7].includes(source))||isPreview"
             />
             <van-field
                 v-if="[8,12,13,35].includes(source)"
@@ -426,9 +452,10 @@ function handleTabChange(){
                 required
                 @focus="numberNInputFocus=true"
                 @blur="numberNInputFocus=false"
+                :disabled="isPreview"
             >
                 <template #right-icon>
-                    <svg-icon class="edit-icon" name="edit" :color="numberNInputFocus?'#0052D9':'#333333'"/>
+                    <svg-icon v-if="!isPreview" class="edit-icon" name="edit" :color="numberNInputFocus?'#0052D9':'#333333'"/>
                 </template>
             </van-field>
             <!-- 超季节性日历 -->
@@ -439,9 +466,10 @@ function handleTabChange(){
                 label="日历" 
                 placeholder="请选择日历"
                 input-align="right"
-                right-icon="arrow"
+                :right-icon="!isPreview?'arrow':''"
                 required
                 @click-input="showSelectCalendar=true"
+                :disabled="isPreview"
             />
             <!-- 降频数据取值 -->
             <van-field
@@ -451,8 +479,9 @@ function handleTabChange(){
                 label="数据取值" 
                 placeholder="请选择"
                 input-align="right"
-                right-icon="arrow"
+                :right-icon="!isPreview?'arrow':''"
                 @click-input="showDataValSelect=true"
+                :disabled="isPreview"
             />
         </section>
 
@@ -460,7 +489,7 @@ function handleTabChange(){
             <svg-icon class="icon" name="warning"></svg-icon>
             <span>公式说明</span>
         </div>
-        <div class="opt-btns">
+        <div class="opt-btns" v-if="!isPreview">
             <van-button class="primary2" @click="$router.back()">取消</van-button>
             <van-button 
                 type="primary" 
@@ -498,6 +527,9 @@ function handleTabChange(){
     <!-- 降频数据取值 -->
     <van-action-sheet v-model:show="showDataValSelect" close-on-click-action :actions="[{name:'期末值'},{name:'平均值'}]" @select="e=>baseInfo.valueType=e.name" />
     
+    <!-- 指标溯源 -->
+    <EDBHistory v-model:show="showEDBHistory" :edbInfoId="edbHistoryId"/>
+
     <!-- 公式说明 -->
     <van-dialog 
         v-model:show="showTips" 
@@ -568,6 +600,10 @@ function handleTabChange(){
         background-color: #F2F3FF;
         color: $theme-color;
     }
+    .disabled{
+        background-color: #F6F6F6;
+        color: #333;
+    }
 }
 .formula-intro-btn{
     width: 180px;
@@ -599,6 +635,59 @@ function handleTabChange(){
     justify-content: space-between;
     .van-button{
         width: 48%;
+        max-width: 300PX;
+    }
+}
+@media screen and (min-width:$media-width){
+    .other-calculate-wrap{
+        padding-bottom: 105px;
+    }
+    .section{
+        margin-bottom: 16px;
+    }
+    .edbinfo-box{
+        .info-box{
+            margin-top: 7px;
+            border-radius: 4px;
+            padding: 10px;
+            .name{
+                font-size: 16px;
+                margin: 0 0 5px 0;
+            }
+            .info-list{
+                gap: 5px 0;
+                margin-bottom: 5px;
+            }
+        }
+    }
+    .move-type-box{
+        gap: 10px;
+        .input{
+            border-radius: 6px;
+            width: 65px;
+            height: 36px;
+            padding: 0 16px;
+        }
+        .btn{
+            width: 65px;
+            height: 36px;
+            border-radius: 6px;
+        }
+    }
+    .formula-intro-btn{
+        width: 90px;
+        height: 30px;
+        gap: 2px;
+        border-radius: 16px;
+        .icon{
+            width: 12px;
+            height: 12px;
+        }
+    }
+    .opt-btns{
+        padding: 24px;
+        justify-content: center;
+        gap: 10px;
     }
 }
 </style>

+ 26 - 0
src/views/dataEDB/calculate/components/SeeEDBDataList.vue

@@ -140,4 +140,30 @@ watch(
         }
     }
 }
+@media screen and (min-width:$media-width){
+    .title{
+        font-size: 18px;
+        padding: 17px;
+    }
+    .data-list{
+        .data-item{
+            div{
+                padding: 0 16px;
+                height: 56px;
+            }
+            .lable{
+                font-size: 17px;
+            }
+            .val{
+                span{
+                    padding: 0 5px;
+                    line-height: 24px;
+                    border-radius: 2px;
+                    min-width: 30px;
+                }
+                
+            }
+        }
+    }
+}
 </style>

+ 43 - 1
src/views/dataEDB/calculate/components/SelectEDB.vue

@@ -221,7 +221,7 @@ function handleShowEDBInfo(item){
             }
             .con{
                 padding: 32px 32px 32px 0;
-                border-bottom: 1px solid $border-color;
+                border-bottom: 1PX solid $border-color;
                 display: flex;
                 .name{
                     flex: 1;
@@ -238,6 +238,7 @@ function handleShowEDBInfo(item){
         justify-content: space-between;
         .van-button{
             width: 48%;
+            max-width: 300PX;
         }
     }
 }
@@ -296,4 +297,45 @@ function handleShowEDBInfo(item){
     }
 }
 
+@media screen and (min-width:$media-width){
+    .select-edb-box{
+        .list-wrap{
+            .item{
+                .con{
+                    padding: 16px 16px 16px 0;
+                    .icon{
+                        margin-left: 10px;
+                    }
+                }
+            }
+        }
+        .btns-box{
+            padding: 10px var(--van-padding-md);
+            justify-content: center;
+            gap: 10px;
+        }
+    }
+    .search-box{
+        .van-search{
+            padding: 3px;
+        }
+        .right-btn{
+            width: 56px;
+            height: 28px;
+            line-height: 28px;
+        }
+    }
+    .edb-info-wrap{
+        padding: 24px;
+        .name{
+            font-size: 18px;
+        }
+        .info-list{
+            .item{
+                margin-bottom: 16px;
+            }
+        }
+    }
+}
+
 </style>