浏览代码

计算指标新增日均值

Karsa 1 年之前
父节点
当前提交
32822152b9

+ 15 - 5
src/views/dataEntry_manage/databaseComponents/batchComptedDialog.vue

@@ -15,7 +15,7 @@
 				:src="$icons.computed"
 				style="color: #fff; width: 16px; height: 16px; margin-right: 5px"
 			/>
-			<span style="font-size: 16px">{{ switchType.get(type) }}</span>
+			<span style="font-size: 16px">{{ titleMap.get(type) }}</span>
 		</div>
 
     <div class="cont">
@@ -119,7 +119,7 @@
 				style="margin-right: 20px"
 				@click="saveHandle"
 				:loading="loading"
-				>{{loading ? '计算中...' : save_txts.get(type)}}</el-button
+				>{{loading ? '计算中...' : saveBtnMap.get(type)}}</el-button
 			>
 			<el-button type="primary" plain @click="cancelHandle('cancel')">取消</el-button>
 		</div>
@@ -199,7 +199,7 @@ export default {
 				},
       ],
 
-			switchType: new Map([
+			titleMap: new Map([
 				[6,'同比值'],
 				[7,'同差值'],
 				[8,'N数值移动平均计算'],
@@ -220,8 +220,9 @@ export default {
 				[64,'累计值转月/季值'],
 				[65,'累计值'],
 				[66,'累计值'],
+				[75,'日均值']
 			]),//标题
-			save_txts: new Map([
+			saveBtnMap: new Map([
 				[6,'同比值计算'],
 				[7,'同差值计算'],
 				[8,'移动平均计算'],
@@ -242,6 +243,7 @@ export default {
 				[64,'转季值计算'],
 				[65,'累计值计算'],
 				[66,'年初至今计算'],
+				[75,'日均值计算']
 			]),//保存文案
 			unitArr,
 			options: [],
@@ -326,6 +328,7 @@ export default {
             list.targetName = default_opt.targetName;
             list.unit = default_opt.unit;
             list.frequency = default_opt.frequency;
+						list.menu = default_opt.menu||0
 					}
 				});
 
@@ -431,7 +434,7 @@ export default {
       let params = filterArr.map(item => ({
         CalculateId: item.tag,
         CalculateInfo: {
-          ClassifyId: item.menu[item.menu.length - 1],
+          ClassifyId: Array.isArray(item.menu)?item.menu[item.menu.length - 1]:item.menu,
           EdbName: item.targetName,
           Formula: String(item.n_num),
           Frequency:item.frequency,
@@ -578,6 +581,13 @@ export default {
 						unit: '无',
 						frequency: obj.Frequency
 					}
+				case 75: 
+					return {
+						targetName: `${obj.EdbName}日均值`,
+						unit: obj.Unit,
+						frequency: obj.Frequency,
+						menu: obj.ClassifyId,
+					}
 			}
     }  
 	},

+ 20 - 10
src/views/dataEntry_manage/databaseComponents/operationDialog.vue

@@ -15,7 +15,7 @@
 				:src="$icons.computed"
 				style="color: #fff; width: 16px; height: 16px; margin-right: 5px"
 			/>
-			<span style="font-size: 16px">{{ (operationForm.edb_id ? (operationForm.view ? '查看' : '编辑') : '') + switchType.get(type) }}</span>
+			<span style="font-size: 16px">{{ (operationForm.edb_id ? (operationForm.view ? '查看' : '编辑') : '') + titleMap.get(type) }}</span>
 		</div>
 		<div class="dialog-main">
 
@@ -163,7 +163,7 @@
 							<selectUnit 
 								v-model="formData.unit" 
 								style="width: 340px" 
-								:disabled="!operationForm.edb_id&&[6,7].includes(type)"
+								:disabled="!operationForm.edb_id&&[6,7,75].includes(type)"
 							/>
 						</el-form-item>
 						<el-form-item label="指标目录" prop="menu">
@@ -181,7 +181,7 @@
 								placeholder="请选择频度"
 								style="width: 340px"
 								clearable
-								:disabled="[5,14,61,63].includes(type)||(!operationForm.edb_id&&[6,7].includes(type))"
+								:disabled="[5,14,61,63,75].includes(type)||(!operationForm.edb_id&&[6,7].includes(type))"
 							>
 								<el-option
 									v-for="item in frequencyArr"
@@ -237,7 +237,7 @@
 				style="margin-right: 20px"
 				@click="saveHandle"
 				:loading="loading"
-				>{{loading ? '计算中...' : operationForm.edb_id ? '保存' : save_txts.get(type)}}</el-button
+				>{{loading ? '计算中...' : operationForm.edb_id ? '保存' : saveBtnMap.get(type)}}</el-button
 			>
 			<el-button type="primary" plain @click="cancelHandle('cancel')">取消</el-button>
 		</div>
@@ -255,6 +255,7 @@
 import { dataBaseInterface } from '@/api/api.js';
 import { formRules } from './util';
 import { unitArr } from '@/utils/defaultOptions';
+import { isArray } from 'highcharts';
 export default {
 	name:'',
 	props: {
@@ -359,7 +360,7 @@ export default {
 					key: 'SourceName',
 				},
 			],
-			switchType: new Map([
+			titleMap: new Map([
 				[5,'累计值转月/季值'],
 				[6,'同比值'],
 				[7,'同差值'],
@@ -375,8 +376,9 @@ export default {
 				[61,'累计值转月/季值'],
 				[62,'累计值'],
 				[63,'累计值'],
+				[75,'日均值']
 			]),//标题
-			save_txts: new Map([
+			saveBtnMap: new Map([
 				[5,'转月值计算'],
 				[6,'同比值计算'],
 				[7,'同差值计算'],
@@ -391,6 +393,7 @@ export default {
 				[61,'转季值计算'],
 				[62,'累计值计算'],
 				[63,'年初至今计算'],
+				[75,'日均值计算'],
 			]),//保存文案
 			formData: {
 				targetName:'',
@@ -604,7 +607,7 @@ export default {
 					Source: this.type,
 					EdbName: this.formData.targetName,
 					Unit: this.formData.unit,
-					ClassifyId: this.formData.menu[this.formData.menu.length - 1],
+					ClassifyId: Array.isArray(this.formData.menu)?this.formData.menu[this.formData.menu.length - 1]:this.formData.menu,
 					Frequency: this.formData.frequency,
 					Formula: valueMap[this.type] ? String(this.formData[valueMap[this.type]]) : String(this.formData.n_num),
 					FromEdbInfoId: this.select_target,
@@ -687,13 +690,20 @@ export default {
 				61:  obj.EdbName,
 				62:  obj.EdbName,
 				63:  obj.EdbName,
+				75: `${obj.EdbName}日均值`
+			}
+			
+			let frequerncyMap = {
+				14: '日度',
+				61: '季度',
+				62: ''
 			}
 
 			this.formData = {
 				targetName: name_map[this.type] || '',
-				frequency: this.type === 14 ? '日度' : this.type === 61 ? '季度' : this.type === 62 ? '' : obj.Frequency,
-				unit: [5,8,14,7,35].includes(this.type) ? obj.Unit : '无',
-				menu:'',
+				frequency: frequerncyMap[this.type] || obj.Frequency,
+				unit: [5,8,14,7,35,75].includes(this.type) ? obj.Unit : '无',
+				menu: this.type===75 ? obj.ClassifyId : '',
 				n_num: 1,
 				moveType: 1,
 				moveUnit: '天',

+ 16 - 1
src/views/dataEntry_manage/databaseComponents/util.js

@@ -102,6 +102,10 @@ export const computedTypes = [
 	{
 		name:'指数修匀',
 		type:'alpha'
+	},
+	{
+		name:'日均值',
+		type: 75
 	}
 ]
 
@@ -142,6 +146,10 @@ export const computedBatchTypes = [
 	{
 		name:'指数修匀',
 		type:'alpha'
+	},
+	{
+		name:'日均值',
+		type: 75
 	}
 ]
 
@@ -418,5 +426,12 @@ export const formulaTip = new Map([
 	['alpha',`指数修匀计算公式:<br>
 	1、设定指数修匀值序列的初始值=原来时间序列的初始值 <br>
 	2、选择平滑系数alpha值:在0-1之间,开区间 <br>
-	3、本期指数修匀值=alpha*本期实际值+(1-alpha)*上期指数修匀值`]
+	3、本期指数修匀值=alpha*本期实际值+(1-alpha)*上期指数修匀值`],
+	[75,`日均值计算公式:<br>
+	1、年度值转日均值=年度值/对应年份天数 <br>
+	2、半年度值转日均值=半年度值/对应半年度天数 <br>
+	3、季度值转日均值=季度值/对应季度天数 <br>
+	4、月度值转日均值=月度值/对应月度天数 <br>
+	5、旬度值转日均值=旬度值/对应旬度天数 <br>
+	6、周度值转日均值=周度值/7]`]
 ])

+ 2 - 2
src/views/dataEntry_manage/databaseList.vue

@@ -373,7 +373,7 @@
 		</el-dialog>
 		<!-- 转月值 同比 同差 平均值弹窗 -->
 		<operationDialog
-			:isOperation="([5,6,7,8,12,13,14,22,35,51,52,61,62,63].includes(computed_type) || (computed_type===40&&operationForm.view)) && computed_source===1"
+			:isOperation="([5,6,7,8,12,13,14,22,35,51,52,61,62,63,75].includes(computed_type) || (computed_type===40&&operationForm.view)) && computed_source===1"
 			:type="computed_type"
 			:operationForm="operationForm"
 			@cancel="computed_type=0"
@@ -425,7 +425,7 @@
 
 		<!-- 批量计算弹窗 -->
 		<batchComputedDialog
-			:isBatchComputed="[6,7,8,12,13,14,5,61,62,63].includes(computed_type) && computed_source===2"
+			:isBatchComputed="[6,7,8,12,13,14,5,61,62,63,75].includes(computed_type) && computed_source===2"
 			:type="computed_type"
 			@cancel="computed_type=0"
 			@addCallBack="addComputedCallBack"

+ 1 - 1
src/views/mychart_manage/index.vue

@@ -434,7 +434,7 @@ export default {
     getClassify() {
       mychartInterface.classifyList().then((res) => {
         if (res.Ret !== 200) return;
-        this.chart_lang = res.Data.Language === 'EN' ? 'en' : 'ch';
+        this.chart_lang = res.Data&&res.Data.Language === 'EN' ? 'en' : 'ch';
 
         this.classifyList = res.Data ? res.Data.List.map(item => ({
           ...item,

+ 4 - 4
src/views/predictEdb_manage/components/operationDialog.vue

@@ -15,7 +15,7 @@
 				:src="$icons.computed"
 				style="color: #fff; width: 16px; height: 16px; margin-right: 5px"
 			/>
-			<span style="font-size: 16px">{{ (operationForm.edb_id ? (operationForm.view ? '查看' : '编辑') : '') + switchType.get(type) }}</span>
+			<span style="font-size: 16px">{{ (operationForm.edb_id ? (operationForm.view ? '查看' : '编辑') : '') + titleMap.get(type) }}</span>
 		</div>
 		<div class="dialog-main">
 			
@@ -263,7 +263,7 @@
 				style="margin-right: 20px"
 				@click="saveHandle"
 				:loading="loading"
-				>{{loading ? '计算中...' : operationForm.edb_id ? '保存' : save_txts.get(type)}}</el-button
+				>{{loading ? '计算中...' : operationForm.edb_id ? '保存' : saveBtnMap.get(type)}}</el-button
 			>
 			<el-button type="primary" plain @click="cancelHandle('cancel')">取消</el-button>
 		</div>
@@ -371,7 +371,7 @@ export default {
 					key: 'SourceName',
 				},
 			],
-			switchType: new Map([
+			titleMap: new Map([
 				[42,'累计值转月/季值'],
 				[32,'同比值'],
 				[33,'同差值'],
@@ -389,7 +389,7 @@ export default {
 				[69,'标准差'],
 				[70,'百分比'],
 			]),//标题
-			save_txts: new Map([
+			saveBtnMap: new Map([
 				[42,'转月值计算'],
 				[32,'同比值计算'],
 				[33,'同差值计算'],