|
@@ -199,7 +199,7 @@
|
|
|
<el-radio
|
|
|
v-model="item.EdbInfoType"
|
|
|
:label="1"
|
|
|
- @change="refreshTarget"
|
|
|
+ @change="getPreviewChartInfo"
|
|
|
>标准指标</el-radio
|
|
|
>
|
|
|
<div style="margin-top: 15px">
|
|
@@ -207,7 +207,7 @@
|
|
|
v-model="item.EdbInfoType"
|
|
|
:label="0"
|
|
|
style="margin-right: 10px"
|
|
|
- @change="refreshTarget"
|
|
|
+ @change="getPreviewChartInfo"
|
|
|
>领先指标</el-radio
|
|
|
>
|
|
|
<template v-if="item.EdbInfoType === 0">
|
|
@@ -218,7 +218,7 @@
|
|
|
type="number"
|
|
|
min="0"
|
|
|
v-model="item.LeadValue"
|
|
|
- @change="refreshTarget"
|
|
|
+ @change="getPreviewChartInfo"
|
|
|
@keyup.native="filterCode(item)"
|
|
|
></el-input>
|
|
|
<el-select
|
|
@@ -226,7 +226,7 @@
|
|
|
placeholder=""
|
|
|
style="width: 60px"
|
|
|
size="mini"
|
|
|
- @change="refreshTarget"
|
|
|
+ @change="getPreviewChartInfo"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in fre_options"
|
|
@@ -466,7 +466,7 @@
|
|
|
v-model="calendar_type"
|
|
|
class="calendar-cont"
|
|
|
v-if="chartInfo.ChartType === 2"
|
|
|
- @change="getChartInfo"
|
|
|
+ @change="getPreviewChartInfo"
|
|
|
>
|
|
|
<el-radio-button label="公历" />
|
|
|
<el-radio-button label="农历" />
|
|
@@ -849,7 +849,7 @@ export default {
|
|
|
},
|
|
|
selected_chartid(newval) {
|
|
|
if (!newval) {
|
|
|
- // this.year_select = 3;
|
|
|
+
|
|
|
this.year_select = this.yearSelector[0].value;
|
|
|
this.calendar_type = '公历';
|
|
|
this.season_year = '';
|
|
@@ -858,7 +858,7 @@ export default {
|
|
|
} else {
|
|
|
sessionStorage.removeItem('beforeOptions');
|
|
|
|
|
|
- newval && this.getChartInfo();
|
|
|
+ newval && this.getChartDetail();
|
|
|
this.formItemArray=[]
|
|
|
}
|
|
|
},
|
|
@@ -1233,8 +1233,7 @@ export default {
|
|
|
sucessCallback(type) {
|
|
|
this.isOpenDialog = false;
|
|
|
this.getTreeData();
|
|
|
- // type && this.getDataList();
|
|
|
- this.selected_chartid && this.getChartInfo();
|
|
|
+
|
|
|
if (type === 'add') {
|
|
|
//新增分类完成之后,展开父节点显示刚新增的分类,若已展开节点则不做处理
|
|
|
let code = sessionStorage.getItem('expandCode');
|
|
@@ -1525,87 +1524,164 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
|
|
|
+ /* 获取图表详情 回显参数 */
|
|
|
+ async getChartDetail() {
|
|
|
+ const res = await dataBaseInterface.getChartInfoById({
|
|
|
+ ChartInfoId: this.selected_chartid
|
|
|
+ })
|
|
|
+
|
|
|
+ if (res.Ret !== 200) return;
|
|
|
+ this.chartInfo = res.Data.ChartInfo;
|
|
|
+
|
|
|
+
|
|
|
+ this.tableData = res.Data.EdbInfoList;
|
|
|
+ this.setDefaultDateSelect(); //设置默认的日期选中
|
|
|
+
|
|
|
+ sessionStorage.setItem('defaultArr',JSON.stringify(res.Data.EdbInfoList));
|
|
|
+
|
|
|
+ const chartTypeMap = {
|
|
|
+ 7: this.initBarData, //柱形图
|
|
|
+ 10: this.initSectionScatterData //截面散点
|
|
|
+ }
|
|
|
+ chartTypeMap[this.chartInfo.ChartType] && chartTypeMap[this.chartInfo.ChartType](res.Data);
|
|
|
+
|
|
|
+ //将指标添加进标签列表中
|
|
|
+ const {ChartNameEn,ChartName,ChartInfoId,UniqueCode,ChartClassifyId}=res.Data.ChartInfo
|
|
|
+ this.addLabel({code:UniqueCode,id:ChartInfoId,classifyId:ChartClassifyId,EdbName:ChartName,EdbNameEn:ChartNameEn,chartData:res.Data.ChartInfo})
|
|
|
+ this.defaultShowNodes=this.findParentNodeHandle(this.treeData,ChartClassifyId)
|
|
|
+ this.changeTreeNode()
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 设置默认时间选中项 */
|
|
|
+ setDefaultDateSelect() {
|
|
|
+ this.year_select = this.chartInfo.DateType;
|
|
|
+ this.select_date = [this.chartInfo.StartDate, this.chartInfo.EndDate];
|
|
|
+ this.calendar_type = this.chartInfo.Calendar; //日历类型
|
|
|
+ this.season_year = [
|
|
|
+ this.chartInfo.SeasonStartDate,
|
|
|
+ this.chartInfo.SeasonEndDate,
|
|
|
+ ];
|
|
|
+ this.dateTip =
|
|
|
+ this.chartInfo.DateType === 5
|
|
|
+ ? `${this.chartInfo.StartDate}~${this.chartInfo.EndDate}`
|
|
|
+ : this.chartInfo.DateType === 6
|
|
|
+ ? `${this.chartInfo.StartDate}~至今`
|
|
|
+ : '请选择时间段';
|
|
|
+ },
|
|
|
+
|
|
|
/* 获取图表详情信息 type为refresh刷新指标不存储时间 */
|
|
|
- getChartInfo(type) {
|
|
|
- // 判断图标类型 设置参数
|
|
|
- let params =
|
|
|
- this.sameOptionType.includes(this.selected_chartType)
|
|
|
- ? {
|
|
|
- ChartInfoId: this.selected_chartid,
|
|
|
- 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] : '',
|
|
|
- }
|
|
|
- : {
|
|
|
- ChartInfoId: this.selected_chartid,
|
|
|
- Calendar: this.calendar_type,
|
|
|
- SeasonStartDate: this.season_year ? this.season_year[0] : '',
|
|
|
- SeasonEndDate: this.season_year ? this.season_year[1] : '',
|
|
|
- };
|
|
|
- dataBaseInterface.chartInfo(params).then((res) => {
|
|
|
- if (res.Ret === 200) {
|
|
|
- this.chartInfo = res.Data.ChartInfo;
|
|
|
- let beforeOptions = sessionStorage.getItem('beforeOptions')
|
|
|
- ? JSON.parse(sessionStorage.getItem('beforeOptions'))
|
|
|
- : '';
|
|
|
- //合并缓存配置和新的数据
|
|
|
- let newarr = res.Data.EdbInfoList.map((item, index) => {
|
|
|
- if (beforeOptions && type === 'refresh') {
|
|
|
- const DataList = item.DataList;
|
|
|
- return {
|
|
|
- ...beforeOptions[index],
|
|
|
- DataList,
|
|
|
- };
|
|
|
- } else {
|
|
|
- return item;
|
|
|
- }
|
|
|
- });
|
|
|
- this.tableData = newarr;
|
|
|
- // 刷新最新的指标数据 防止领先配置已保存 指标数据确实原数据的情况 针对正常图
|
|
|
- if (
|
|
|
- type === 'refresh' &&
|
|
|
- beforeOptions &&
|
|
|
- (this.sameOptionType.includes(this.chartInfo.ChartType) && this.chartInfo.ChartType!==5)
|
|
|
- )
|
|
|
- this.refreshTarget();
|
|
|
- sessionStorage.setItem(
|
|
|
- 'defaultArr',
|
|
|
- JSON.stringify(res.Data.EdbInfoList)
|
|
|
- );
|
|
|
- if (!type) {
|
|
|
- this.year_select = this.chartInfo.DateType;
|
|
|
- this.select_date = [
|
|
|
- this.chartInfo.StartDate,
|
|
|
- this.chartInfo.EndDate,
|
|
|
- ];
|
|
|
- this.calendar_type = this.chartInfo.Calendar; //日历类型
|
|
|
- // this.season_year = [ this.chartInfo.SeasonStartDate, this.chartInfo.SeasonEndDate ];
|
|
|
- this.dateTip =
|
|
|
- this.chartInfo.DateType === 5
|
|
|
- ? `${this.chartInfo.StartDate}~${this.chartInfo.EndDate}`
|
|
|
- : this.chartInfo.DateType === 6
|
|
|
- ? `${this.chartInfo.StartDate}~至今`
|
|
|
- : '请选择时间段';
|
|
|
-
|
|
|
- //新图表类型 依赖数据不同单独init 数据
|
|
|
- const typeInitMap = {
|
|
|
- 7: this.initBarData,
|
|
|
- 10: this.initSectionScatterData
|
|
|
- }
|
|
|
- typeInitMap[this.chartInfo.ChartType] && typeInitMap[this.chartInfo.ChartType](res.Data);
|
|
|
+ async getPreviewChartInfo(type) {
|
|
|
+ let params = {
|
|
|
+ ChartType: this.chartInfo.ChartType,
|
|
|
+ DateType: this.year_select,
|
|
|
+ StartDate: [5, 6].includes(this.year_select)
|
|
|
+ ? this.select_date[0]
|
|
|
+ : '',
|
|
|
+ EndDate: this.year_select === 5 ? this.select_date[1] : '',
|
|
|
+ Calendar: this.calendar_type,
|
|
|
+ SeasonStartDate: this.season_year ? this.season_year[0] : '',
|
|
|
+ SeasonEndDate: this.season_year ? this.season_year[1] : '',
|
|
|
+ ChartEdbInfoList: this.tableData.map(_ => ({
|
|
|
+ EdbInfoId: _.EdbInfoId,
|
|
|
+ EdbInfoType: _.EdbInfoType,
|
|
|
+ LeadValue: _.EdbInfoType ? 0 : Number(_.LeadValue),
|
|
|
+ LeadUnit: _.EdbInfoType ? '' : _.LeadUnit,
|
|
|
+ }))
|
|
|
+ }
|
|
|
+
|
|
|
+ const res = await dataBaseInterface.getSplinePreviewData(params)
|
|
|
+
|
|
|
+ if(res.Ret !== 200) return
|
|
|
+
|
|
|
+ const { EdbInfoList } = res.Data;
|
|
|
+
|
|
|
+ this.tableData.forEach((item) => {
|
|
|
+ let edbData = EdbInfoList.find(_ => _.EdbInfoId===item.EdbInfoId);
|
|
|
+ item.DataList = edbData.DataList;
|
|
|
+ if(edbData.EdbInfoCategoryType===1) item.MoveLatestDate = edbData.MoveLatestDate;
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ // // 判断图标类型 设置参数
|
|
|
+ // let params =
|
|
|
+ // this.sameOptionType.includes(this.selected_chartType)
|
|
|
+ // ? {
|
|
|
+ // ChartInfoId: this.selected_chartid,
|
|
|
+ // 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] : '',
|
|
|
+ // }
|
|
|
+ // : {
|
|
|
+ // ChartInfoId: this.selected_chartid,
|
|
|
+ // Calendar: this.calendar_type,
|
|
|
+ // SeasonStartDate: this.season_year ? this.season_year[0] : '',
|
|
|
+ // SeasonEndDate: this.season_year ? this.season_year[1] : '',
|
|
|
+ // };
|
|
|
+ // dataBaseInterface.chartInfo(params).then((res) => {
|
|
|
+ // if (res.Ret === 200) {
|
|
|
+ // this.chartInfo = res.Data.ChartInfo;
|
|
|
+ // let beforeOptions = sessionStorage.getItem('beforeOptions')
|
|
|
+ // ? JSON.parse(sessionStorage.getItem('beforeOptions'))
|
|
|
+ // : '';
|
|
|
+ // //合并缓存配置和新的数据
|
|
|
+ // let newarr = res.Data.EdbInfoList.map((item, index) => {
|
|
|
+ // if (beforeOptions && type === 'refresh') {
|
|
|
+ // const DataList = item.DataList;
|
|
|
+ // return {
|
|
|
+ // ...beforeOptions[index],
|
|
|
+ // DataList,
|
|
|
+ // };
|
|
|
+ // } else {
|
|
|
+ // return item;
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // this.tableData = newarr;
|
|
|
+ // // 刷新最新的指标数据 防止领先配置已保存 指标数据确实原数据的情况 针对正常图
|
|
|
+ // if (
|
|
|
+ // type === 'refresh' &&
|
|
|
+ // beforeOptions &&
|
|
|
+ // (this.sameOptionType.includes(this.chartInfo.ChartType) && this.chartInfo.ChartType!==5)
|
|
|
+ // )
|
|
|
+ // this.refreshTarget();
|
|
|
+ // sessionStorage.setItem(
|
|
|
+ // 'defaultArr',
|
|
|
+ // JSON.stringify(res.Data.EdbInfoList)
|
|
|
+ // );
|
|
|
+ // if (!type) {
|
|
|
+ // this.year_select = this.chartInfo.DateType;
|
|
|
+ // this.select_date = [
|
|
|
+ // this.chartInfo.StartDate,
|
|
|
+ // this.chartInfo.EndDate,
|
|
|
+ // ];
|
|
|
+ // this.calendar_type = this.chartInfo.Calendar; //日历类型
|
|
|
+ // // this.season_year = [ this.chartInfo.SeasonStartDate, this.chartInfo.SeasonEndDate ];
|
|
|
+ // this.dateTip =
|
|
|
+ // this.chartInfo.DateType === 5
|
|
|
+ // ? `${this.chartInfo.StartDate}~${this.chartInfo.EndDate}`
|
|
|
+ // : this.chartInfo.DateType === 6
|
|
|
+ // ? `${this.chartInfo.StartDate}~至今`
|
|
|
+ // : '请选择时间段';
|
|
|
+
|
|
|
+ // //新图表类型 依赖数据不同单独init 数据
|
|
|
+ // const typeInitMap = {
|
|
|
+ // 7: this.initBarData,
|
|
|
+ // 10: this.initSectionScatterData
|
|
|
+ // }
|
|
|
+ // typeInitMap[this.chartInfo.ChartType] && typeInitMap[this.chartInfo.ChartType](res.Data);
|
|
|
|
|
|
- }
|
|
|
- //将指标添加进标签列表中
|
|
|
- const {ChartNameEn,ChartName,ChartInfoId,UniqueCode,ChartClassifyId}=res.Data.ChartInfo
|
|
|
- this.addLabel({code:UniqueCode,id:ChartInfoId,classifyId:ChartClassifyId,EdbName:ChartName,EdbNameEn:ChartNameEn,chartData:res.Data.ChartInfo})
|
|
|
- this.defaultShowNodes=this.findParentNodeHandle(this.treeData,ChartClassifyId)
|
|
|
- this.changeTreeNode()
|
|
|
- }
|
|
|
+ // }
|
|
|
+ // //将指标添加进标签列表中
|
|
|
+ // const {ChartNameEn,ChartName,ChartInfoId,UniqueCode,ChartClassifyId}=res.Data.ChartInfo
|
|
|
+ // this.addLabel({code:UniqueCode,id:ChartInfoId,classifyId:ChartClassifyId,EdbName:ChartName,EdbNameEn:ChartNameEn,chartData:res.Data.ChartInfo})
|
|
|
+ // this.defaultShowNodes=this.findParentNodeHandle(this.treeData,ChartClassifyId)
|
|
|
+ // this.changeTreeNode()
|
|
|
+ // }
|
|
|
|
|
|
- });
|
|
|
+ // });
|
|
|
},
|
|
|
|
|
|
/* 搜索 */
|
|
@@ -1893,7 +1969,7 @@ export default {
|
|
|
//保存表格配置和上下限 曲线图需要保存表格配置 季节图就不用了
|
|
|
this.saveNowOptions();
|
|
|
// 图表已存在
|
|
|
- this.selected_chartid && this.getChartInfo('refresh');
|
|
|
+ this.selected_chartid && this.getPreviewChartInfo();
|
|
|
},
|
|
|
/* 打开时间段弹窗 */
|
|
|
openDateDia() {
|
|
@@ -1919,7 +1995,7 @@ export default {
|
|
|
this.dateTip = `${data.start_date}~至今`;
|
|
|
}
|
|
|
this.saveNowOptions();
|
|
|
- this.getChartInfo('refresh');
|
|
|
+ this.getPreviewChartInfo();
|
|
|
},
|
|
|
|
|
|
/* 编辑图表 跳转 */
|
|
@@ -2057,18 +2133,18 @@ export default {
|
|
|
},
|
|
|
/* 保存图表当前配置项 上下限 */
|
|
|
saveNowOptions() {
|
|
|
- const dataArr = _.cloneDeep(this.tableData);
|
|
|
- dataArr.forEach((item) => {
|
|
|
- item.MaxData = Number(item.MaxData);
|
|
|
- item.MinData = Number(item.MinData);
|
|
|
- delete item.DataList;
|
|
|
- });
|
|
|
- sessionStorage.setItem('beforeOptions', JSON.stringify(dataArr));
|
|
|
+ // const dataArr = _.cloneDeep(this.tableData);
|
|
|
+ // dataArr.forEach((item) => {
|
|
|
+ // item.MaxData = Number(item.MaxData);
|
|
|
+ // item.MinData = Number(item.MinData);
|
|
|
+ // delete item.DataList;
|
|
|
+ // });
|
|
|
+ // sessionStorage.setItem('beforeOptions', JSON.stringify(dataArr));
|
|
|
},
|
|
|
/* 季节图切换年份 保持当前配置 */
|
|
|
seasonYearChange() {
|
|
|
this.saveNowOptions();
|
|
|
- this.getChartInfo('refresh');
|
|
|
+ this.getPreviewChartInfo();
|
|
|
},
|
|
|
/* 一键刷新 超长等待..*/
|
|
|
refreshHandle() {
|
|
@@ -2086,7 +2162,7 @@ export default {
|
|
|
.then((res) => {
|
|
|
this.refreshLoading.close();
|
|
|
if (res.Ret === 200) {
|
|
|
- this.getChartInfo('refresh');
|
|
|
+ this.getPreviewChartInfo();
|
|
|
this.$message.success(res.Msg);
|
|
|
}
|
|
|
});
|