|
@@ -562,11 +562,60 @@ export default {
|
|
|
if (!id) return
|
|
|
getProjectSchemeById(id).then(async (res) => {
|
|
|
if (res.code != 1) return
|
|
|
+ console.log("回填的数据", res.result);
|
|
|
const { monitorScheme, projectScheme } = res.result
|
|
|
// 方案
|
|
|
this.$set(this.form, 'projectName', projectScheme.projectName)
|
|
|
this.$set(this.form, 'projectRemouldTarget', projectScheme.projectRemouldTarget)
|
|
|
this.$set(this.form, 'id', projectScheme.id)
|
|
|
+
|
|
|
+ // this.$set(beforeRemouldDate1, beforeRemouldDate1, projectScheme.beforeRemouldDate1)
|
|
|
+ this.beforeRemouldDate1 = projectScheme.beforeRemouldStartDate
|
|
|
+ this.beforeRemouldDate2 = projectScheme.beforeRemouldEndDate
|
|
|
+ let dataCount = this.DateMinus(this.beforeRemouldDate1, this.beforeRemouldDate2)
|
|
|
+ console.log("相减的天数", dataCount);
|
|
|
+ let ljRain = 0
|
|
|
+ for(let i=0; i<this.selectData1.length; i++){
|
|
|
+ // debugger
|
|
|
+ if(this.selectData1[i].dayStr == this.beforeRemouldDate1.slice(0, 10)){
|
|
|
+ alert(11111)
|
|
|
+ console.log("相等的标号", i);
|
|
|
+ console.log("相等的标号前", this.selectData1[i-1]);
|
|
|
+ console.log("相等的标号中", this.selectData1[i]);
|
|
|
+ console.log("相等的标号后", this.selectData1[i+1]);
|
|
|
+ for(let j=i;j>=(i-dataCount);j--){
|
|
|
+ console.log("降雨量", this.selectData1[j]);
|
|
|
+ ljRain = ljRain + this.selectData1[j].rfall
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log("累加的降雨量", ljRain);
|
|
|
+ this.addRain = ljRain
|
|
|
+
|
|
|
+ this.afterRemouldDate1 = projectScheme.afterRemouldStartDate
|
|
|
+ this.afterRemouldDate2 = projectScheme.afterRemouldEndDate
|
|
|
+
|
|
|
+ let dataCount2 = this.DateMinus(this.afterRemouldDate1, this.afterRemouldDate2)
|
|
|
+ console.log("相减的天数2", dataCount2);
|
|
|
+ let ljRain2 = 0
|
|
|
+ for(let i=0; i<this.selectData1.length; i++){
|
|
|
+ // debugger
|
|
|
+ if(this.selectData1[i].dayStr == this.afterRemouldDate1.slice(0, 10)){
|
|
|
+ alert(11111)
|
|
|
+ console.log("相等的标号", i);
|
|
|
+ console.log("相等的标号前", this.selectData1[i-1]);
|
|
|
+ console.log("相等的标号中", this.selectData1[i]);
|
|
|
+ console.log("相等的标号后", this.selectData1[i+1]);
|
|
|
+ for(let j=i;j>=(i-dataCount2);j--){
|
|
|
+ console.log("降雨量", this.selectData1[j]);
|
|
|
+ ljRain2 = ljRain2 + this.selectData1[j].rfall
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log("累加的降雨量", ljRain2);
|
|
|
+ this.addRain2 = ljRain2
|
|
|
+
|
|
|
+
|
|
|
// 方案站点指标
|
|
|
let siteGroups = []
|
|
|
if (monitorScheme) {
|
|
@@ -619,6 +668,19 @@ export default {
|
|
|
this.$forceUpdate()
|
|
|
})
|
|
|
},
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过日期字符串相减得到天数
|
|
|
+ */
|
|
|
+ DateMinus(date1, date2) {
|
|
|
+ //date1:小日期 date2:大日期
|
|
|
+ var sdate = new Date(date1);
|
|
|
+ var now = new Date(date2);
|
|
|
+ var days = now.getTime() - sdate.getTime();
|
|
|
+ var day = parseInt(days / (1000 * 60 * 60 * 24));
|
|
|
+ return day;
|
|
|
+ },
|
|
|
+
|
|
|
/**
|
|
|
* 曲线请求参数
|
|
|
*/
|
|
@@ -855,7 +917,7 @@ export default {
|
|
|
getSelectData() {
|
|
|
getSelectData1().then((res) => {
|
|
|
if (res.code == 1) {
|
|
|
- // console.log("改造前计算下拉框数据1"+JSON.stringify(res))
|
|
|
+ console.log("改造前计算下拉框数据1"+JSON.stringify(res))
|
|
|
this.selectData1 = res.result
|
|
|
for (let i = 0; i < this.selectData1.length; i++) {
|
|
|
this.selectData1[i]['lable'] =
|