浏览代码

设置英文名称页面

cxmo 1 年之前
父节点
当前提交
2df233e851
共有 3 个文件被更改,包括 102 次插入8 次删除
  1. 9 0
      src/router/chartETA.js
  2. 18 6
      src/views/chartETA/ChartDetail.vue
  3. 75 2
      src/views/chartETA/SetChartENName.vue

+ 9 - 0
src/router/chartETA.js

@@ -29,4 +29,13 @@ export const chartETARoutes=[
             keepAlive:false,
         },
     },
+    {
+        path:"/chartETA/setchartname",
+        name:"ChartETASetName",
+        component: () => import("@/views/chartETA/SetChartEnName.vue"),
+        meta: { 
+            title: "ETA图库",
+            keepAlive:false,
+        },
+    },
 ]

+ 18 - 6
src/views/chartETA/ChartDetail.vue

@@ -2,7 +2,7 @@
 import {nextTick, onMounted,ref,reactive} from 'vue'
 import {showDialog, showToast} from 'vant'
 import apiChart from '@/api/chart'
-import { useRoute } from 'vue-router'
+import { useRoute,useRouter } from 'vue-router'
 import { getSSRHandler, useWindowSize } from '@vueuse/core'
 import {yearSelectOpt,sameOptionType} from '@/hooks/chart/config'
 import {useChartRender} from '@/hooks/chart/render'
@@ -16,6 +16,7 @@ const {options,axisLimitState,chartRender}=useChartRender()
 const { width } = useWindowSize()
 
 const route=useRoute()
+const router = useRouter()
 
 //获取图详情
 let chartInfoData=null
@@ -375,8 +376,16 @@ function saveChartPic(){
     }
 
 }
-//跳转设置英文页面
-function goSetChartEnName(){}
+//设置英文名称
+function goSetChartEnName(){
+    router.push({
+        path:'/chartETA/setchartname',
+        query:{
+            id:chartInfo.value.ChartInfoId,
+            chartType:chartInfo.value.ChartType
+        }
+    })
+}
 
 let isShowAddToMyETADialog = ref(false)
 //加入我的图库
@@ -384,7 +393,9 @@ function openAddToMyETADialog(){
     isShowAddToMyETADialog.value = true
 }
 //删除图表
-function deleteChart(){}
+function deleteChart(){
+    //删除成功后,返回上一页
+}
 
 
 </script>
@@ -678,9 +689,10 @@ function deleteChart(){}
             position="center"
             round
             closeable
-            :style="{width:'400px'}"
+            :style="{width:'80%',padding:'30px'}"
         >
-            <img :src="savePicSrc" alt="" :style="{width:'100%'}">
+            <img :src="savePicSrc" alt="" style="width:100%;box-sizing: border-box;">
+            <p style="text-align: center;color:#999;margin-top: 10px;">长按保存图片</p>
         </van-popup>
     </div>
 </template>

+ 75 - 2
src/views/chartETA/SetChartENName.vue

@@ -1,13 +1,86 @@
 <script setup>
 //设置图表英文名称
+import {ref,onMounted, initCustomFormatter} from 'vue'
+import { useRoute } from 'vue-router'
+import {sameOptionType} from '@/hooks/chart/config'
+import apiChart from '@/api/chart'
+const route=useRoute()
+const chartInfo = ref(null)
+function getChartDetail(){
+    const params=sameOptionType.includes(Number(route.query.chartType))?{
+        ChartInfoId:Number(route.query.id),
+        DateType: '',
+        StartDate: '',
+        EndDate: '',
+    }:{
+        ChartInfoId:Number(route.query.id),
+        Calendar: '公历',
+        SeasonStartDate: '',
+        SeasonEndDate:'' ,
+    }
+    const res=await apiChart.chartInfoById(params)
+    if(res.Ret!==200) return
+    chartInfo.value = res.Data
+    initForm()
+}
+//表格组,第一项固定为图表名称
+const formGroup = ref([
+    /* {
+        groupName:'图表名称',//分组名称
+        formList:[{
+            label:'图表名称',
+            cnValue:'测试截面散点图',//中文值
+            enValue:'',//英文值
+        }],//需要填写的项
+    } */
+])
+
+const ExtraConfig = ref({})
+function initForm(){
+    const {EdbInfoList} = chartInfo.value
+    const {ChartName,ChartNameEn,ExtraConfig} = chartInfo.value.ChartInfo
+    //第一项固定为图表名称
+    formGroup.value.push({
+        groupName:'图表名称',
+        formList:[{
+            label:'图表名称',
+            cnValue:ChartName,
+            enValue:ChartNameEn,
+        }]
+    })
+    //截面散点图 chartType===10 与其他图格式不一样 保存一下额外数据
+    if(Number(route.query.chartType)===10){
+        ExtraConfig.value = JSON.parse(ExtraConfig)
+        const {SeriesList} = ExtraConfig
+        const seriesEdbInfoList = SeriesList[0].EdbInfoList //每一项的EdbInfoList是一样的,取第一项就行
+        let formSeriesList = []
+        let formEdbInfoList = []
+        formGroup.value.push({
+            groupName:'标签,系列名称',
+
+        })
+    }
+
+    
+    for(const edb in EdbInfoList){
+
+    }
+    
+
+}
+onMounted(() => {
+    getChartDetail()
+})
 </script>
 
 <template>
-    <div>
-
+    <div class="set-name-pop-wrap">
+        
     </div>
 </template>
 
 <style scoped lang="scss">
+.set-name-pop-wrap{
 
+}
 </style>