Browse Source

Merge branch 'eta1.4.6'

Karsa 10 tháng trước cách đây
mục cha
commit
90a4573619

+ 10 - 0
src/api/modules/chartApi.js

@@ -933,6 +933,16 @@ const dataBaseInterface = {
 	 */
 	getReportrefreshStatus: params => {
 		return http.post('/datamanage/chart_info/batch_refresh/result',params)
+	},
+
+	/**
+	 * 获取雷达图预览数据
+	 * @param {
+	 * 	ExtraConfig: { EdbInfoIdList  DateList }
+	 * } params 
+	 */
+	getRadarPreviewData: params => {
+		return http.post('/datamanage/chart_info/preview/radar',params)
 	}
 	
 }

+ 15 - 18
src/views/dataEntry_manage/addChart.vue

@@ -112,14 +112,7 @@
 							placeholder="请选择所属分类"
 						/>
 					</el-form-item>
-					<el-form-item label="图表单位" prop="Unit" v-if="chartInfo.ChartType===7">
-						<!-- <el-input
-							v-model="chartInfo.Unit"
-							style="width: 90%"
-							placeholder="请输入图表单位"
-							clearable
-							@change="changeUnit"
-						/> -->
+					<el-form-item label="图表单位" prop="Unit" v-if="[7,11].includes(chartInfo.ChartType)">
 						<el-select
 							v-model="chartInfo.Unit"
 							filterable
@@ -195,7 +188,8 @@
 						<el-checkbox v-model="tableData[0].IsOrder">逆序</el-checkbox>
 					</div>
 					
-          <el-collapse v-model="activeNames" class="target-list" v-if="tableData.length&&![7,10].includes(chartInfo.ChartType)">
+					<!-- 配置区  柱形 截面 雷达不需要-->
+          <el-collapse v-model="activeNames" class="target-list" v-if="tableData.length&&![7,10,11].includes(chartInfo.ChartType)">
             <el-collapse-item v-for="(item,index) in tableData" :key="item.EdbInfoId" :disabled="[2,5].includes(chartInfo.ChartType)">
               <template slot="title">
                 <span class="text_oneLine">{{item.EdbName}}</span>
@@ -326,14 +320,14 @@
             </el-collapse-item>
           </el-collapse>
 
-					<!-- 奇怪柱状图配置 -->
+					<!-- 奇怪柱状图配置 雷达图也要用 -->
 					<bar-option
-						v-if="chartInfo.ChartType===7"
+						v-if="[7,11].includes(chartInfo.ChartType)"
 						ref="BarOptRef"
 						:chartInfo="chartInfo"
 						:edblist="tableData"
-						:datedata="barDateList"
-						@getData="getBarPreviewData"
+						:datedata="chartInfo.ChartType===7?barDateList:radarChartData.YDataList"
+						@getData="barOptionPreviewMap"
 					/>
 
 					<!-- 截面散点图 -->
@@ -467,7 +461,7 @@
 							</div>
 
 							<!-- 后续新图专用上下限 和其他数据依赖不公用 柱形图 截面散点-->
-							<template v-if="[7,10].includes(chartInfo.ChartType)">	
+							<template v-if="[7,10,11].includes(chartInfo.ChartType)">	
 								<div class="range-cont left">
 									<el-input
 										style="width: 60px; display: block"
@@ -574,7 +568,7 @@
 							align="center"
 						>
 							<template slot-scope="scope">
-								<div v-if="item.key === 'EdbName' && [1,4,6,7].includes(chartInfo.ChartType)">
+								<div v-if="item.key === 'EdbName' && [1,4,6,7,11].includes(chartInfo.ChartType)">
 									<!-- 柱状图用别名 -->
 									<el-input 
 										v-model="scope.row.EdbAliasName"
@@ -685,9 +679,12 @@ export default {
 		tableData: {
       handler(newval, oldval) {
 				if(newval.length) {
-					if([7,10].includes(this.chartInfo.ChartType)) {
+					if([7,10,11].includes(this.chartInfo.ChartType)) {
 						// 奇怪柱形图
 						this.chartInfo.ChartType === 7 && this.barDateList.length && this.$refs.BarOptRef.getBarData();
+
+						//雷达图
+						this.chartInfo.ChartType === 11 && this.$refs.BarOptRef.getBarData();
 				
 					}else {
 						//拼接标题
@@ -739,9 +736,9 @@ export default {
 					// 季节图只允许添加一个指标
 					if(this.chartInfo.ChartType === 2 && this.tableData.length > 1) return this.$message.warning('您选择的图表样式为季节性图表,只支持单指标画图');
 
-					if(this.chartInfo.ChartType === 7 && !this.$refs.BarOptRef.dateList.length)  return this.$message.warning('请添加日期');
+					else if([7,11].includes(this.chartInfo.ChartType)  && !this.$refs.BarOptRef.dateList.length)  return this.$message.warning('请添加日期');
 
-					if(this.chartInfo.ChartType === 10 && !this.$refs.SectionScatterOptRef.seriesArr[0].edbs)  return this.$message.warning('请添加系列指标');
+					else if(this.chartInfo.ChartType === 10 && !this.$refs.SectionScatterOptRef.seriesArr[0].edbs)  return this.$message.warning('请添加系列指标');
 
 					if(this.chartInfo.ChartType === 2){
 						if(!(this.SeasonExtraConfig.XStartDate && this.SeasonExtraConfig.XEndDate)){

+ 9 - 5
src/views/dataEntry_manage/chartSetting.vue

@@ -177,7 +177,7 @@
 					</div>
 
           <el-collapse v-model="activeNames" class="target-list" v-if="tableData.length">
-            <el-collapse-item v-for="(item,index) in tableData" :key="item.EdbInfoId" :disabled="[2,5,7,10].includes(chartInfo.ChartType)">
+            <el-collapse-item v-for="(item,index) in tableData" :key="item.EdbInfoId" :disabled="![1,4,6].includes(chartInfo.ChartType)">
               <template slot="title">
                 <span class="text_oneLine">{{item.EdbName}}</span>
               </template>
@@ -443,7 +443,7 @@
                     </div>
 
                     <!-- 后续新图专用上下限 和其他数据依赖不公用 柱形图 截面散点-->
-                    <template v-if="[7,10].includes(chartInfo.ChartType)">	
+                    <template v-if="[7,10,11].includes(chartInfo.ChartType)">	
                       <div class="range-cont left">
                         <el-input
                           style="width: 60px; display: block"
@@ -1606,7 +1606,8 @@ export default {
 
       const chartTypeMap = {
         7: this.initBarData, //柱形图
-        10: this.initSectionScatterData //截面散点
+        10: this.initSectionScatterData, //截面散点
+        11: this.initRadarData //雷达图
       }
       chartTypeMap[this.chartInfo.ChartType] && chartTypeMap[this.chartInfo.ChartType](res.Data);
 
@@ -1811,12 +1812,14 @@ export default {
             }
             break
           case 7:
+          case 11:
             typeChartParam = {
                ...public_param,
               DateType: 6,
               LeftMin: String(this.chartLimit.min),
               LeftMax: String(this.chartLimit.max),
             }
+            break
           case 10: 
             typeChartParam = {
               ...public_param,
@@ -1829,7 +1832,8 @@ export default {
                 YMinValue: String(this.chartLimit.min),
                 YMaxValue: String(this.chartLimit.max),
               })
-            } 
+            }
+            break
         }
 
         let params = this.sameOptionType.includes(this.selected_chartType)
@@ -2204,7 +2208,7 @@ export default {
         .then((res) => {
           this.refreshLoading.close();
           if (res.Ret === 200) {
-            [7,10].includes(this.chartInfo.ChartType) ? this.getChartDetail() : this.getPreviewChartInfo();
+            [7,10,11].includes(this.chartInfo.ChartType) ? this.getChartDetail() : this.getPreviewChartInfo();
             this.$message.success(res.Msg);
           }
         });

+ 5 - 4
src/views/dataEntry_manage/components/barOptionSection.vue

@@ -2,7 +2,7 @@
   <div class="bar-option-wrapper">
     <template v-if="dateList.length">
       <!-- 排序规则 -->
-      <div v-if="isBaseBarShow">
+      <div v-if="isBaseBarShow&&chartInfo.ChartType===7">
         <div>
           <label style="margin-right: 5px;">排序规则</label> 
           <el-radio-group v-model="sortObj.sort" @change="() => { sortObj.sortIndex= '';changeSort()}">
@@ -141,7 +141,8 @@ export default {
     edblist: Array,
     datedata: Array,
     chartInfo: {
-      type: Object
+      type: Object,
+      default: () => {}
     },
     initData: {
       default: null
@@ -311,8 +312,8 @@ export default {
         Name:  _.Name
       }));
       this.sortObj = {
-        sort: Sort.Sort,
-        sortIndex: Sort.DateIndex
+        sort: Sort?Sort.Sort:0,
+        sortIndex: Sort?Sort.DateIndex:''
       }
     }
   }

+ 2 - 0
src/views/dataEntry_manage/components/chart.vue

@@ -5,9 +5,11 @@
 
 <script>
 import Highcharts from 'highcharts/highstock';
+import HighchartsMore from 'highcharts/highcharts-more';
 import HightchartsExport from 'highcharts/modules/exporting';
 import HighchartszhCN  from '@/utils/highcahrts-zh_CN'
 HighchartszhCN(Highcharts)
+HighchartsMore(Highcharts)
 HightchartsExport(Highcharts)
 const elementResizeDetectorMaker = require("element-resize-detector");//引入监听dom变化的组件
 const erd = elementResizeDetectorMaker();

+ 50 - 47
src/views/dataEntry_manage/components/markersSection.vue

@@ -1,57 +1,60 @@
 <template>
   <div class="chart-markers-section">
-    <!-- 标示线 -->
-    <div class="section-item">
-      <ul class="marker-list"  v-if="markerLinesArr.length">
-        <li class="marker-item" v-for="(item,index) in markerLinesArr" :key="index">
-          <span>{{item.axisName}}: {{item.value}}</span>
-          <div style="flex-shrink:0">
-            <i class="el-icon-view icon" :style="item.isShow?'color:#0052D9':'color:#999'" @click="item.isShow=!item.isShow;updateChartHandle()"/>
-            <i class="el-icon-edit icon" style="margin:0 6px" @click="openMarkerDiaHandle('line',index+1)"/>
-            <i class="el-icon-delete icon" @click="markerLinesArr.splice(index,1);updateChartHandle()"/>
-          </div>
-        </li>
-      </ul>
+    <!-- 雷达不要 -->
+    <template v-if="chartInfo.ChartType!==11">
+      <!-- 标示线 -->
+      <div class="section-item">
+        <ul class="marker-list"  v-if="markerLinesArr.length">
+          <li class="marker-item" v-for="(item,index) in markerLinesArr" :key="index">
+            <span>{{item.axisName}}: {{item.value}}</span>
+            <div style="flex-shrink:0">
+              <i class="el-icon-view icon" :style="item.isShow?'color:#0052D9':'color:#999'" @click="item.isShow=!item.isShow;updateChartHandle()"/>
+              <i class="el-icon-edit icon" style="margin:0 6px" @click="openMarkerDiaHandle('line',index+1)"/>
+              <i class="el-icon-delete icon" @click="markerLinesArr.splice(index,1);updateChartHandle()"/>
+            </div>
+          </li>
+        </ul>
+
+        <div
+          class="add-cont"
+          @click="openMarkerDiaHandle('line')"
+        >
+          <img
+            src="~@/assets/img/set_m/add_ico.png"
+            alt=""
+            style="width: 16px; height: 16px; margin-right: 10px"
+          />
+          <span>添加标识线</span>
+        </div>
 
-      <div
-        class="add-cont"
-        @click="openMarkerDiaHandle('line')"
-      >
-        <img
-          src="~@/assets/img/set_m/add_ico.png"
-          alt=""
-          style="width: 16px; height: 16px; margin-right: 10px"
-        />
-        <span>添加标识线</span>
       </div>
 
-    </div>
+      <!-- 标识区 -->
+      <div class="section-item">
+        <ul class="marker-list" v-if="markerAreasArr.length">
+          <li class="marker-item" v-for="(item,index) in markerAreasArr" :key="index">
+            <span>{{item.axisName}}: {{`${item.fromValue}至${item.toValue}`}}</span>
+            <div style="flex-shrink:0">
+              <i class="el-icon-view icon" :style="item.isShow?'color:#0052D9':'color:#999'" @click="item.isShow=!item.isShow;updateChartHandle()"/>
+              <i class="el-icon-edit icon" style="margin:0 6px" @click="openMarkerDiaHandle('area',index+1)"/>
+              <i class="el-icon-delete icon" @click="markerAreasArr.splice(index,1);updateChartHandle()"/>
+            </div>
+          </li>
+        </ul>
+        <div
+          class="add-cont"
+          @click="openMarkerDiaHandle('area')"
+        >
+          <img
+            src="~@/assets/img/set_m/add_ico.png"
+            alt=""
+            style="width: 16px; height: 16px; margin-right: 10px"
+          />
+          <span>添加标识区</span>
+        </div>
 
-    <!-- 标识区 -->
-    <div class="section-item">
-      <ul class="marker-list" v-if="markerAreasArr.length">
-        <li class="marker-item" v-for="(item,index) in markerAreasArr" :key="index">
-          <span>{{item.axisName}}: {{`${item.fromValue}至${item.toValue}`}}</span>
-          <div style="flex-shrink:0">
-            <i class="el-icon-view icon" :style="item.isShow?'color:#0052D9':'color:#999'" @click="item.isShow=!item.isShow;updateChartHandle()"/>
-            <i class="el-icon-edit icon" style="margin:0 6px" @click="openMarkerDiaHandle('area',index+1)"/>
-            <i class="el-icon-delete icon" @click="markerAreasArr.splice(index,1);updateChartHandle()"/>
-          </div>
-        </li>
-      </ul>
-      <div
-        class="add-cont"
-        @click="openMarkerDiaHandle('area')"
-      >
-        <img
-          src="~@/assets/img/set_m/add_ico.png"
-          alt=""
-          style="width: 16px; height: 16px; margin-right: 10px"
-        />
-        <span>添加标识区</span>
       </div>
-
-    </div>
+    </template>
 
     <!-- 图表说明 -->
     <div class="section-item">

+ 16 - 10
src/views/dataEntry_manage/editChart.vue

@@ -120,7 +120,7 @@
 							placeholder="请选择所属分类"
 						/>
 					</el-form-item>
-					<el-form-item label="图表单位" prop="Unit" v-if="chartInfo.ChartType===7">
+					<el-form-item label="图表单位" prop="Unit" v-if="[7,11].includes(chartInfo.ChartType)">
 						<el-select
 							v-model="chartInfo.Unit"
 							filterable
@@ -196,7 +196,7 @@
 						<el-checkbox v-model="tableData[0].IsOrder">逆序</el-checkbox>
 					</div>
 
-          <el-collapse v-model="activeNames" class="target-list" v-if="tableData.length&&![7,10].includes(chartInfo.ChartType)">
+          <el-collapse v-model="activeNames" class="target-list" v-if="tableData.length&&![7,10,11].includes(chartInfo.ChartType)">
             <el-collapse-item v-for="(item,index) in tableData" :key="item.EdbInfoId" :disabled="[2,5].includes(chartInfo.ChartType)">
               <template slot="title">
                 <span class="text_oneLine">{{item.EdbName}}</span>
@@ -317,13 +317,13 @@
 
 					<!-- 奇怪柱状图配置 -->
 					<bar-option
-						v-if="chartInfo.ChartType===7"
+						v-if="[7,11].includes(chartInfo.ChartType)"
 						ref="BarOptRef"
 						:chartInfo="chartInfo"
 						:edblist="tableData"
-						:datedata="barDateList"
-						:initData="initBarOptions"
-						@getData="getBarPreviewData"
+						:datedata="chartInfo.ChartType===7?barDateList:radarChartData.YDataList"
+						:initData="chartInfo.ChartType===7?initBarOptions:(chartInfo.ExtraConfig&&JSON.parse(chartInfo.ExtraConfig))"
+						@getData="barOptionPreviewMap"
 					/>
 
 					<!-- 截面散点图 -->
@@ -458,7 +458,7 @@
 							</div>
 
 							<!-- 后续新图专用上下限 和其他数据依赖不公用 柱形图 截面散点-->
-							<template v-if="[7,10].includes(chartInfo.ChartType)">	
+							<template v-if="[7,10,11].includes(chartInfo.ChartType)">	
 								<div class="range-cont left">
 									<el-input
 										style="width: 60px; display: block"
@@ -563,7 +563,7 @@
 							align="center"
 						>
 							<template slot-scope="scope">
-								<div v-if="item.key === 'EdbName' && [1,4,6,7].includes(chartInfo.ChartType)">
+								<div v-if="item.key === 'EdbName' && [1,4,6,7,11].includes(chartInfo.ChartType)">
 									<!-- 奇怪柱状图用别名 -->
 									<el-input 
 										v-model="scope.row.EdbAliasName"
@@ -682,9 +682,12 @@ export default {
 		tableData: {
       handler(newval, oldval) {
 				if(newval) {
-					if([7,10].includes(this.chartInfo.ChartType)) {
+					if([7,10,11].includes(this.chartInfo.ChartType)) {
 						// 奇怪柱形图
 						this.chartInfo.ChartType === 7 && this.barDateList.length && this.$refs.BarOptRef && this.$refs.BarOptRef.getBarData();
+
+						//雷达图
+						this.chartInfo.ChartType === 11 && this.$refs.BarOptRef && this.$refs.BarOptRef.getBarData();
 					}else {
 						this.setAddChartDefault();
 						newval.length && !this.chartInfo.WarnMsg && this.setChartOptionHandle(newval);
@@ -732,7 +735,7 @@ export default {
           this.chartInfo = {
 						...ChartInfo,
 						classify: [ChartInfo.ChartClassify[0].ParentId,...ChartInfo.ChartClassify.map(item => item.ChartClassifyId)],
-						Unit: BarChartInfo ? BarChartInfo.Unit : '',
+						Unit: ChartInfo.ChartType===7 ? BarChartInfo.Unit : ChartInfo.Unit,
 						SourcesFromVisable: ChartInfo.SourcesFrom ? JSON.parse(ChartInfo.SourcesFrom).isShow : true
 					};
 					//处理下历史默认来源
@@ -758,6 +761,9 @@ export default {
 
 					//截面散点图
 					this.chartInfo.ChartType === 10 && this.initSectionScatterData(res.Data);
+
+					//雷达图
+					this.chartInfo.ChartType === 11 && this.initRadarData(res.Data);
 					
 					this.getThemeList();
 

+ 79 - 25
src/views/dataEntry_manage/mixins/addOreditMixin.js

@@ -53,6 +53,7 @@ export default {
         { label: '组合图', key: 6 },
 				{ label: '柱形图',key: 7 },
 				{ label: '截面散点图',key: 10 },
+				{ label: '雷达图',key: 11 },
       ], //图表样式
 
 
@@ -138,7 +139,7 @@ export default {
 				this.getThemeList('init')
 
 				//柱形图 截面散点切换到普通图 依赖的指标信息其实只有信息无数据 需清空
-				if([7,10].includes(oldval)&&![7,10].includes(newval)) {
+				if([7,10,11].includes(oldval)&&![7,10,11].includes(newval)) {
 					this.tableData = [];
 					this.chartInfo.LeftMax = '';
 					this.chartInfo.LeftMin = '';
@@ -149,7 +150,7 @@ export default {
 				this.initStatus();
 
 				//共用结构的类型切换可以直接画图
-				if(![7,10].includes(newval)) {
+				if(![7,10,11].includes(newval)) {
 					//单指标允许切换到季节图需药重新请求数据
 					this.tableData.length===1 && this.selectTarget(this.tableData[0],'switch');
 					this.tableData.length > 1 && this.setChartOptionHandle(this.tableData);
@@ -163,26 +164,9 @@ export default {
 		selectTarget(item,type='') {
 			if(!item) return
 
-			/* 正常图获取指标数据 柱形图不获取 */
-			if(this.chartInfo.ChartType === 7) return this.setBarEdbList(item);
-				// let params = this.sameOptionType.includes(this.chartInfo.ChartType) 
-				// 	? {
-				// 		EdbInfoId: item.EdbInfoId,
-				// 		ChartType: this.chartInfo.ChartType,
-				// 		DateType: this.year_select,
-				// 		StartDate:
-				// 			this.year_select === 5 || this.year_select === 6
-				// 				? this.select_date[0]
-				// 				: '',
-				// 		EndDate: this.year_select === 5 ? this.select_date[1] : '',
-				// 	} 
-				// 	: {
-				// 		EdbInfoId: item.EdbInfoId,
-				// 		ChartType: this.chartInfo.ChartType,
-				// 		Calendar: this.calendar_type,
-				// 		SeasonStartDate: '',
-				// 		SeasonEndDate: '',
-				// 	};
+			/* 正常图获取指标数据 柱形图 雷达图不获取 */
+			if([7,11].includes(this.chartInfo.ChartType)) return this.setBarEdbList(item);
+
 				let dateArray=this.chartInfo.ChartType==2?this.season_year:this.select_date
 
 				let params = {
@@ -255,7 +239,7 @@ export default {
 
 		},
 
-		/* 添加柱形图表格 */
+		/* 添加柱形图 /雷达图指标数组 */
 		setBarEdbList(edb) {
 			let have_bol = this.tableData.some(item => item.EdbInfoId === edb.EdbInfoId);
 
@@ -265,7 +249,16 @@ export default {
 			this.search_txt = '';
 			this.chartInfo.Unit = this.chartInfo.Unit||edb.Unit
 			this.tableData.push(edb)
+		},
 
+		/* 奇怪柱形图的日期配置项现在不止柱形图用了 获取数据时扩展一下 */
+		barOptionPreviewMap(data) {
+			let tyepeMapApi = {
+				7: this.getBarPreviewData,//柱形图
+				11: this.getRadarPreviewData//雷达图
+			}
+
+			tyepeMapApi[this.chartInfo.ChartType](data);
 		},
 
 		/* 获取bar数据 */
@@ -314,6 +307,49 @@ export default {
 			})
 		},
 
+		/* 获取雷达图预览数据 */
+		async getRadarPreviewData({dateList}) {
+			if(this.tableData.length<3 || !dateList.length) return
+			
+			let parmas = {
+				ChartEdbInfoList: this.tableData.map(_ => ({
+					EdbInfoId: _.EdbInfoId,
+					EdbAliasName:_.EdbAliasName
+				})),
+				ExtraConfig: JSON.stringify({ DateList: dateList})
+			}
+
+			const res = await dataBaseInterface.getRadarPreviewData(parmas)
+
+			if(res.Ret!==200) return 
+
+			const { DataResp,EdbInfoList,ChartInfo } = res.Data;
+			this.chartInfo = {
+				...this.chartInfo,
+				ChartSource: ChartInfo.ChartSource
+			}
+			
+			this.radarChartData = {
+				YDataList: DataResp.YDataList,
+				XDataList: EdbInfoList.filter(_ => DataResp.XEdbIdValue.includes(_.EdbInfoId))
+			}
+
+			// //初始状态设置上下限极值
+			if(!this.chartInfo.LeftMin) {
+				const value_arr = this.radarChartData.YDataList.map(_ => _.Value).flat(Infinity)
+
+				this.chartLimit = {
+					min: Math.min(...value_arr),
+					max: Math.max(...value_arr)
+				}
+			}
+
+			//默认来源搞一下
+			this.setDefaultSourceFrom();
+
+			this.setRadarChart()
+		},
+
 		/* 曲线图切换筛选项时请求数据 */
 		async getPreviewSplineInfo() {
 			let dateArray=this.chartInfo.ChartType==2?this.season_year:this.select_date
@@ -683,10 +719,27 @@ export default {
 							}))
 						})
 					}	
+				case 11: 
+					return {
+						...public_param,
+						DateType: 6,
+						Unit: this.chartInfo.Unit,
+						LeftMin: String(this.chartLimit.min),
+						LeftMax: String(this.chartLimit.max),
+						ExtraConfig: JSON.stringify({
+							DateList: this.$refs.BarOptRef.dateList.map(item => ({
+								Type: item.Type,
+								Date: item.Date,
+								Value: item.Value,
+								Name: item.Name,
+								Color: item.Color
+							})),
+						})
+					}
 			}
 		},
 
-		/* 奇怪柱形图更新单位 */
+		/* 更新单位 */
 		changeUnit(val) {
 			if(!this.options.series) return
 
@@ -862,7 +915,8 @@ export default {
 			
 			const chartTypeMap = {
         7: this.setBarChart, //柱形图
-        10: this.setSectionScatterChart //截面散点
+        10: this.setSectionScatterChart, //截面散点
+				11: this.setRadarChart  //雷达图
       }
       chartTypeMap[this.chartInfo.ChartType] 
 				? chartTypeMap[this.chartInfo.ChartType]() 

+ 121 - 2
src/views/dataEntry_manage/mixins/chartPublic.js

@@ -189,7 +189,10 @@ export const chartSetMixin = {
 			},
 
       /* 跨品种分析图 */
-      crossVarietyChartData: {}
+      crossVarietyChartData: {},
+
+      /* 雷达图 */
+      radarChartData: {}
 		}
 	},
   watch: {
@@ -1797,6 +1800,121 @@ export const chartSetMixin = {
       this.currentLang=='en' && this.changeOptions()
     },
 
+    //雷达图数据初始化
+    initRadarData(data) {
+      const { DataResp,EdbInfoList,ChartInfo } = data;
+
+      this.leftIndex = -1;
+      this.rightIndex = -1;
+      this.rightTwoIndex = -1;
+      
+      this.radarChartData = {
+				YDataList: DataResp.YDataList,
+				XDataList: EdbInfoList.filter(_ => DataResp.XEdbIdValue.includes(_.EdbInfoId))
+			}
+      this.chartLimit = {
+        min: Number(ChartInfo.LeftMin),
+        max: Number(ChartInfo.LeftMax)
+      }
+
+      this.setRadarChart();
+    },
+    /*雷达图绘图*/
+    setRadarChart() {
+      const { YDataList,XDataList } = this.radarChartData;
+
+      /* 主题样式*/
+      const chartTheme =  this.chartInfo.ChartThemeStyle ? JSON.parse(this.chartInfo.ChartThemeStyle) : null;
+
+      //x轴
+      let xAxis = {
+        lineWidth: 0,
+        tickLength: 0,
+        tickmarkPlacement: 'on',
+        categories: XDataList.map(_ => _.EdbAliasName||_.EdbName),
+        labels: {
+          allowOverlap: true,
+          autoRotationLimit: 40,
+          distance: 20,
+          style: {
+            ...chartTheme&&chartTheme.xAxisOptions.style
+          }
+        }
+      }
+
+      //y轴
+      const { max,min } = this.chartLimit;
+      let yAxis = [{
+        gridLineInterpolation: 'polygon',
+        gridLineWidth: 1,
+        lineWidth: 0,
+        endOnTick: false,
+        startOnTick: false,
+        showLastLabel: true,
+        // tickAmount:4,
+        title: {
+          text:  this.chartInfo.Unit,
+          textCh: this.chartInfo.Unit,
+          textEn: this.chartInfo.UnitEn,
+          align: 'high',
+          rotation: 0,
+          y: 5,
+          x:10,
+          textAlign: 'left',
+          reserveSpace: false,
+          style:{
+            ...chartTheme&&chartTheme.yAxisOptions.style
+          },
+        },
+        labels: {
+          allowOverlap: true,
+          style:{
+            ...chartTheme&&chartTheme.yAxisOptions.style
+          }
+        },
+        min: Number(min),
+        max: Number(max),
+      }]
+
+      //系列
+      let series = [];
+      YDataList.forEach(item => {
+        let serie_item = {
+          data: item.Value,
+          pointPlacement: 'on',
+          type: (chartTheme&&chartTheme.lineOptions.lineType) || 'line',
+          dashStyle: (chartTheme&&chartTheme.lineOptions.dashStyle)||'Solid',
+          yAxis: 0,
+          name: item.Name || item.Date,
+          nameCh: item.Name || item.Date,
+          nameEn: item.Date,
+          color: item.Color,
+          lineWidth: (chartTheme&&chartTheme.lineOptions.lineWidth) || 1,
+          chartType: 'linear'
+        };
+        series.push(serie_item)
+      })
+
+      this.options = {
+        chart: {
+          ...defaultOpts.chart,
+					...chartTheme.drawOption,
+          spacing: [2,10,2,10],
+          polar:true,
+        },
+        title: {
+          text:''
+        },
+        pane: {
+          size: '80%'
+        },
+        series,
+        yAxis,
+        xAxis
+      }
+      this.currentLang=='en' && this.changeOptions();
+    },
+
 
     /* 统计频率图 */
     setStatisticFrequency() {
@@ -2319,7 +2437,8 @@ export const chartSetMixin = {
       //source1 eta图库的类型对应
       const typeMap = {
         7: this.setBarChart,
-        10: this.setSectionScatterChart
+        10: this.setSectionScatterChart,
+        11: this.setRadarChart
       }
       //其他source
       const sourceMap = {

+ 11 - 4
src/views/mychart_manage/components/chartDetailDia.vue

@@ -272,7 +272,7 @@
                 </div>
 
                   <!-- 后续新图专用上下限 和其他数据依赖不公用 柱形图 截面散点-->
-                <template v-if="[7,10].includes(chartInfo.ChartType)">	
+                <template v-if="[7,10,11].includes(chartInfo.ChartType)">	
                   <div class="range-cont left">
                     <el-input
                       style="width: 60px; display: block"
@@ -517,7 +517,7 @@
               label="操作"
               key="Copy"
               align="center"
-              v-if="[2,5,7].includes(chartInfo.ChartType)"
+              v-if="chartInfo.Source!==1 || ![1,4,6].includes(chartInfo.ChartType)"
               width="110"
             >
               <template slot-scope="scope">
@@ -735,7 +735,11 @@ export default {
             this.setDefaultDateSelect(); //设置默认的日期选中
             this.chartInfo.ChartType === 7 && this.initBarData(res.Data);
 
+            //截面散点图
             this.chartInfo.ChartType === 10 && this.initSectionScatterData(res.Data);
+
+            //雷达图
+            this.chartInfo.ChartType === 11 && this.initRadarData(res.Data);
           }else if([2,5].includes(this.chartInfo.Source)) {
             this.tableData = [res.Data.EdbInfoList[0]];
             this.chartInfo = res.Data.ChartInfo.Source===5 ? {
@@ -947,7 +951,7 @@ export default {
         if (res.Ret !== 200) return
         this.$message.success(res.Msg);
 
-        Source===1&&![7,10].includes(ChartType)  
+        Source===1&&![7,10,11].includes(ChartType) 
           ? this.getPreviewChartInfo() 
           : this.getChartDetail(UniqueCode);
     },
@@ -1155,12 +1159,14 @@ export default {
           }
           break
         case 7:
+        case 11:
           typeChartParam = {
             ...public_param,
             DateType: 6,
             LeftMin: String(this.chartLimit.min),
             LeftMax: String(this.chartLimit.max),
           }
+          break
         case 10: 
           typeChartParam = {
             ...public_param,
@@ -1173,7 +1179,8 @@ export default {
               YMinValue: String(this.chartLimit.min),
               YMaxValue: String(this.chartLimit.max),
             })
-          } 
+          }
+          break
       }
 
       let params = this.sameOptionType.includes(this.chartInfo.ChartType)

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

@@ -75,7 +75,10 @@ export default {
       statisticFrequencyData: {},
 
       /* 跨品种分析图 */
-      crossVarietyChartData: {}
+      crossVarietyChartData: {},
+
+      /* 雷达图 */
+      radarChartData: {}
     }
   },
   methods: {
@@ -1491,6 +1494,116 @@ export default {
       }
     },
 
+    //雷达图数据初始化
+    initRadarData(data) {
+      const { DataResp,EdbInfoList,ChartInfo } = data;
+      
+      this.radarChartData = {
+        YDataList: DataResp.YDataList,
+        XDataList: EdbInfoList.filter(_ => DataResp.XEdbIdValue.includes(_.EdbInfoId))
+      }
+      this.chartLimit = {
+        min: Number(ChartInfo.LeftMin),
+        max: Number(ChartInfo.LeftMax)
+      }
+
+      this.setRadarChart();
+    },
+    /*雷达图绘图*/
+    setRadarChart() {
+      const { YDataList,XDataList } = this.radarChartData;
+
+      /* 主题样式*/
+      const chartTheme =  this.chartInfo.ChartThemeStyle ? JSON.parse(this.chartInfo.ChartThemeStyle) : null;
+
+      //x轴
+      let xAxis = {
+        lineWidth: 0,
+        tickLength: 0,
+        tickmarkPlacement: 'on',
+        categories: XDataList.map(_ => _.EdbAliasName||_.EdbName),
+        labels: {
+          allowOverlap: true,
+          autoRotationLimit: 40,
+          distance: 20,
+          style: {
+            ...chartTheme&&chartTheme.xAxisOptions.style
+          }
+        }
+      }
+
+      //y轴
+      const { max,min } = this.chartLimit;
+      let yAxis = [{
+        gridLineInterpolation: 'polygon',
+        gridLineWidth: 1,
+        lineWidth: 0,
+        endOnTick: false,
+        startOnTick: false,
+        showLastLabel: true,
+        // tickAmount:4,
+        title: {
+          text:  this.chartInfo.Unit,
+          textCh: this.chartInfo.Unit,
+          textEn: this.chartInfo.UnitEn,
+          align: 'high',
+          rotation: 0,
+          y: 5,
+          x:10,
+          textAlign: 'left',
+          reserveSpace: false,
+          style:{
+            ...chartTheme&&chartTheme.yAxisOptions.style
+          },
+        },
+        labels: {
+          allowOverlap: true,
+          style:{
+            ...chartTheme&&chartTheme.yAxisOptions.style
+          }
+        },
+        min: Number(min),
+        max: Number(max),
+      }]
+
+      //系列
+      let series = [];
+      YDataList.forEach(item => {
+        let serie_item = {
+          data: item.Value,
+          pointPlacement: 'on',
+          type: (chartTheme&&chartTheme.lineOptions.lineType) || 'line',
+          dashStyle: (chartTheme&&chartTheme.lineOptions.dashStyle)||'Solid',
+          yAxis: 0,
+          name: item.Name || item.Date,
+          nameCh: item.Name || item.Date,
+          nameEn: item.Date,
+          color: item.Color,
+          lineWidth: (chartTheme&&chartTheme.lineOptions.lineWidth) || 1,
+          chartType: 'linear'
+        };
+        series.push(serie_item)
+      })
+
+      this.options = {
+        chart: {
+          ...defaultOpts.chart,
+          ...chartTheme.drawOption,
+          spacing: [2,10,2,10],
+          polar:true,
+        },
+        title: {
+          text:''
+        },
+        pane: {
+          size: '80%'
+        },
+        series,
+        yAxis,
+        xAxis
+      }
+    },
+
     /* 查询范围为1年内 x轴显示为月/日 否则默认年/月 */
     xTimeDiffer() {
       const end_date =

+ 5 - 0
src/views/ppt_manage/mixins/pptMixins.js

@@ -1,7 +1,9 @@
 /** 图库9.0(智能PPT) 共通逻辑 */
 import Highcharts from "highcharts/highstock";
+import HighchartsMore from 'highcharts/highcharts-more';
 import HighchartszhCN  from '@/utils/highcahrts-zh_CN'
 HighchartszhCN(Highcharts)
+HighchartsMore(Highcharts)
 import { dataBaseInterface,pptInterface } from "@/api/api.js";
 import {etaBaseConfigInterence} from '@/api/modules/etaBaseConfigApi.js';
 import {pptEnInterface} from '@/api/modules/pptEnApi.js';
@@ -210,6 +212,8 @@ export default {
         this.chartInfo.ChartType === 7 && this.initBarData(res.Data);
         //截面散点图
         this.chartInfo.ChartType === 10 && this.initSectionScatterData(res.Data);
+        //雷达图
+        this.chartInfo.ChartType === 11 && this.initRadarData(res.Data);
 
         Data.Status && ![7,10].includes(this.chartInfo.ChartType) && this.setOptions();
         Data.Status&&this.setOptionsLang(currentLang)
@@ -557,6 +561,7 @@ export default {
             animation: false,
             backgroundColor: "rgba(0,0,0,0)",
             renderTo:$(`#${refName}`)[0],
+            ...options.chart||{}
           },
           legend: {
             ...defaultOpts.legend,

+ 3 - 2
src/views/system_manage/chartTheme/components/optionsSection.vue

@@ -32,8 +32,8 @@
                   </el-select>
                 </li>
 
-                <!-- 曲线额外配置 -->
-                <template v-if="[1,2].includes(chartType)">
+                <!-- 曲线额外配置 雷达 -->
+                <template v-if="[1,2,11].includes(chartType)">
                   <li class="option-item">
                     <label class="el-form-item__label">线型</label>
                     <el-select 
@@ -246,6 +246,7 @@ export default {
         6: {label:'线条、柱形设置',lineLabel: '系列'},
         7: {label:'柱形设置',lineLabel: '根'},
         10: {label:'散点设置',lineLabel: '系列'},
+        11: {label:'线条设置',lineLabel: '条'},
       },
       labelMap: new Map([
         ['lineOptions','线条设置'],

+ 4 - 1
src/views/system_manage/chartTheme/themeSetting.vue

@@ -112,8 +112,11 @@ export default {
         ChartThemeStyle: themeItem.Config
       };
       this.tableData = res.Data.EdbInfoList;
+
       if(this.chartInfo.ChartType === 7) return this.initBarData(res.Data);
-      if(this.chartInfo.ChartType === 10) return this.initSectionScatterData(res.Data);
+      else if(this.chartInfo.ChartType === 10) return this.initSectionScatterData(res.Data);
+      
+      else if(this.chartInfo.ChartType === 11) return this.initRadarData(res.Data);
 
       this.setChartOptionHandle(this.tableData)
     },