소스 검색

跨品种分析:数据点显示标签

Karsa 9 달 전
부모
커밋
f90b537049

+ 9 - 0
src/api/modules/chartRelevanceApi.js

@@ -1018,5 +1018,14 @@ export const crossVarietyInterface = {
      */
     getTagRelation: params => {
       return http.get('/cross_variety/tag/variety_edb/list',params)
+    },
+
+    /**
+     * 保存图表上下限
+     * @param {*} params 
+     * @returns 
+     */
+    saveChart: params => {
+      return http.post('/cross_variety/chart/save',params)
     }
 }

+ 1 - 1
src/views/chartRelevance_manage/crossVarietyAnalysis/chartEditor.vue

@@ -576,7 +576,7 @@ export default {
     overflow-x: auto;
     .chart-min-cont {
       background: #fff;
-      min-width: 880px;
+      min-width: 900px;
       height: calc(100vh - 118px);
       overflow-y: auto;
       display: flex;

+ 9 - 7
src/views/chartRelevance_manage/crossVarietyAnalysis/components/chartFormSection.vue

@@ -120,17 +120,18 @@
           />
 
           <el-date-picker
-            v-model="item.Date"
+            v-model="item.FixDate"
             v-else-if="item.DateType===3"
             value-format="yyyy-MM-dd"
             type="date"
             placeholder="选择日期"
             style="width: 150px"
+            @change="changeParams"
           />
 
           <span>
-            <i class="el-icon-view" v-if="item.ShowTips" @click="item.ShowTips=!item.ShowTips"/>
-            <img :src="$icons.no_view" v-else style="width:24px;height:24px" @click="item.ShowTips=!item.ShowTips">
+            <i class="el-icon-view" v-if="item.ShowTips===1" @click="()=>{item.ShowTips=item.ShowTips===1?0:1;changeParams()}"/>
+            <img :src="$icons.no_view" v-else style="width:24px;height:24px" @click="()=>{item.ShowTips=item.ShowTips===1?0:1;changeParams()}">
           </span>
 
           <el-button type="text" v-if="index===0" @click="addDateHandle">
@@ -173,7 +174,7 @@ export default {
         TagX: '',
         TagY: '',
         DateConfigList: [
-          { DateType: 1,Num: 0,Date:'',ShowTips: true },
+          { DateType: 1,Num: 0,FixDate:'',ShowTips: 1 },
         ],
       },
       unitOpt: [
@@ -206,21 +207,22 @@ export default {
       if(this.form.DateConfigList.length === 5) return this.$message.warning('日期数量已达上限')
 
       this.form.DateConfigList.push({
-        DateType: 1,Num: 1,Date:'',ShowTips: true
+        DateType: 1,Num: 1,FixDate:'',ShowTips: 1
       })
       
       this.changeParams()
     },
 
     initData(data) {
-      const { ChartName,CalculateValue,CalculateUnit,TagX,TagY,DateConfigList } = data;
+      const { ChartName,CalculateValue,CalculateUnit,TagX,TagY,DateConfigList,PercentType } = data;
       this.form = {
         ChartName,
         CalculateValue,
         CalculateUnit,
         TagX,
         TagY,
-        DateConfigList
+        DateConfigList,
+        PercentType: PercentType||0
       }
     },
 

+ 13 - 1
src/views/chartRelevance_manage/crossVarietyAnalysis/list.vue

@@ -467,7 +467,19 @@ export default {
 
 		/* 保存上下限 */
 		async saveChartHandle() {
-			let res = await crossVarietyInterface.saveChart();
+			let { min,max,x_min,x_max } = this.chartLimit;
+      let params = {
+        ChartInfoId: this.chartInfo.ChartInfoId,
+        XMin: String(x_min),
+				XMax: String(x_max),
+				LeftMin: String(min),
+				LeftMax: String(max),
+      }
+			let res = await crossVarietyInterface.saveChart(params);
+
+			if(res.Ret !== 200) return
+
+			this.$message.success('保存成功')
 		},
 
 		/* 获取图表列表 */

+ 1 - 1
src/views/chartRelevance_manage/statistic/statisticFeatureChartEditor.vue

@@ -420,7 +420,7 @@ export default {
 
       percentOptions: [
         { label: '数据个数',val: 1 },
-        { label: '数据区间',val: 2 },
+        { label: '数据区间',val: 0 },
       ],
       tips: {
         'percent':`1、数据个数百分位算法:数据区间第一个(较远日期)和最后一个数据点(较近日期)分别为 (T1,S1),(T2,S2)。T代表时间。S代表对应的值<br>

+ 14 - 1
src/views/dataEntry_manage/mixins/chartPublic.js

@@ -2082,6 +2082,10 @@ export const chartSetMixin = {
 
        //数据列
       let series = [];
+      const tagMap = { //标签对应文字
+        1: '最新',
+        3: 'Fix'
+      }
       DataList.forEach(item => {
         //数据列
         let series_item = {
@@ -2095,7 +2099,16 @@ export const chartSetMixin = {
           zIndex:1
         }
         item.CoordinatePointData.forEach(_ => {
-          series_item.data.push({x: _.X,y: _.Y,})
+          series_item.data.push({
+            x: _.X,
+            y: _.Y,
+            dataLabels: {
+              enabled: _.ShowTips===1,
+              allowOverlap: true,
+              align: 'left',
+              format: tagMap[_.DateType] || `-${_.DaysAgo}T`,
+            }
+          })
         })
         series.push(series_item);
       })

+ 14 - 1
src/views/ppt_manage/mixins/mixins.js

@@ -1429,6 +1429,10 @@ export default {
 
        //数据列
       let series = [];
+      const tagMap = { //标签对应文字
+        1: '最新',
+        3: 'Fix'
+      }
       DataList.forEach(item => {
         //数据列
         let series_item = {
@@ -1442,7 +1446,16 @@ export default {
           zIndex:1
         }
         item.CoordinatePointData.forEach(_ => {
-          series_item.data.push({x: _.X,y: _.Y,})
+          series_item.data.push({
+            x: _.X,
+            y: _.Y,
+            dataLabels: {
+              enabled: _.ShowTips===1,
+              allowOverlap: true,
+              align: 'left',
+              format: tagMap[_.DateType] || `-${_.DaysAgo}T`,
+            }
+          })
         })
         series.push(series_item);
       })