yijianjun 1 mēnesi atpakaļ
vecāks
revīzija
ca044b9fd0

+ 82 - 82
src/utils/menu.js

@@ -49,88 +49,88 @@ const menu = {
           //     ],
           //     menu: "变电站管理",
           //   },
-          {
-            child: [
-              {
-                allButtons: [
-                  '新增',
-                  '查看',
-                  '修改',
-                  '删除',
-                  '城市降雨量',
-                  '月降雨量统计',
-                  '地型统计',
-                  '城市',
-                  '温度统计',
-                  '年降雨量统计',
-                  '导出',
-                  '导入',
-                  '上传模板',
-                  '下载模板',
-                  '首页总数',
-                  '首页统计',
-                ],
-                appFrontIcon: 'cuIcon-copy',
-                buttons: [
-                  '新增',
-                  '查看',
-                  '修改',
-                  '删除',
-                  '城市降雨量',
-                  '月降雨量统计',
-                  '地型统计',
-                  '年降雨量统计',
-                  '首页总数',
-                  '温度统计',
-                  '导出',
-                  '导入',
-                  '上传模板',
-                  '下载模板',
-                ],
-                menu: '电采暖负荷数据',
-                menuJump: '列表',
-                tableName: 'rainfalldata',
-              },
-            ],
-            menu: '电采暖负荷数据管理',
-          },
-          {
-            child: [
-              {
-                allButtons: ['新增', '查看', '修改', '删除'],
-                appFrontIcon: 'cuIcon-clothes',
-                buttons: ['新增', '查看', '修改', '删除'],
-                menu: '电采暖负荷预测',
-                menuJump: '列表',
-                tableName: 'rainfalldataforecast',
-              },
-            ],
-            menu: '电采暖负荷预测管理',
-          },
-          {
-            child: [
-              {
-                allButtons: ['查看'],
-                appFrontIcon: 'cuIcon-form',
-                buttons: ['查看'],
-                menu: '看板',
-                tableName: 'hasBoard',
-              },
-            ],
-            menu: '看板管理',
-          },
-          {
-            child: [
-              {
-                allButtons: ['查看', '删除'],
-                appFrontIcon: 'cuIcon-explore',
-                buttons: ['查看', '删除'],
-                menu: '系统日志',
-                tableName: 'syslog',
-              },
-            ],
-            menu: '系统管理',
-          },
+          // {
+          //   child: [
+          //     {
+          //       allButtons: [
+          //         '新增',
+          //         '查看',
+          //         '修改',
+          //         '删除',
+          //         '城市降雨量',
+          //         '月降雨量统计',
+          //         '地型统计',
+          //         '城市',
+          //         '温度统计',
+          //         '年降雨量统计',
+          //         '导出',
+          //         '导入',
+          //         '上传模板',
+          //         '下载模板',
+          //         '首页总数',
+          //         '首页统计',
+          //       ],
+          //       appFrontIcon: 'cuIcon-copy',
+          //       buttons: [
+          //         '新增',
+          //         '查看',
+          //         '修改',
+          //         '删除',
+          //         '城市降雨量',
+          //         '月降雨量统计',
+          //         '地型统计',
+          //         '年降雨量统计',
+          //         '首页总数',
+          //         '温度统计',
+          //         '导出',
+          //         '导入',
+          //         '上传模板',
+          //         '下载模板',
+          //       ],
+          //       menu: '电采暖负荷数据',
+          //       menuJump: '列表',
+          //       tableName: 'rainfalldata',
+          //     },
+          //   ],
+          //   menu: '电采暖负荷数据管理',
+          // },
+          // {
+          //   child: [
+          //     {
+          //       allButtons: ['新增', '查看', '修改', '删除'],
+          //       appFrontIcon: 'cuIcon-clothes',
+          //       buttons: ['新增', '查看', '修改', '删除'],
+          //       menu: '电采暖负荷预测',
+          //       menuJump: '列表',
+          //       tableName: 'rainfalldataforecast',
+          //     },
+          //   ],
+          //   menu: '电采暖负荷预测管理',
+          // },
+          // {
+          //   child: [
+          //     {
+          //       allButtons: ['查看'],
+          //       appFrontIcon: 'cuIcon-form',
+          //       buttons: ['查看'],
+          //       menu: '看板',
+          //       tableName: 'hasBoard',
+          //     },
+          //   ],
+          //   menu: '看板管理',
+          // },
+          // {
+          //   child: [
+          //     {
+          //       allButtons: ['查看', '删除'],
+          //       appFrontIcon: 'cuIcon-explore',
+          //       buttons: ['查看', '删除'],
+          //       menu: '系统日志',
+          //       tableName: 'syslog',
+          //     },
+          //   ],
+          //   menu: '系统管理',
+          // },
         ],
         frontMenu: [],
         hasBackLogin: '是',

+ 353 - 359
src/views/login.vue

@@ -1,374 +1,368 @@
 <template>
-	<div>
-		<div class="login-container">
-			<el-form class="login_form animate__animated animate__">
-				<div class="login_form2">
-					<div class="title-container">电采暖负荷分析可视化系统</div>
-					<div v-if="loginType==1" class="list-item">
-						<div class="lable">
-							账号:
-						</div>
-						<input placeholder="请输入账号:" name="username" type="text" v-model="rulesForm.username">
-					</div>
-					<div v-if="loginType==1" class="list-item">
-						<div class="lable">
-							密码:
-						</div>
-						<div class="password-box">
-							<input placeholder="请输入密码:" name="password" :type="showPassword?'text':'password'" v-model="rulesForm.password">
-							<span class="icon iconfont" :class="showPassword?'icon-liulan13':'icon-liulan17'" @click="showPassword=!showPassword"></span>
-						</div>
-					</div>
+  <div>
+    <div class="login-container">
+      <el-form class="login_form animate__animated animate__">
+        <div class="login_form2">
+          <div class="title-container">电采暖负荷分析可视化系统</div>
+          <div v-if="loginType == 1" class="list-item">
+            <div class="lable">账号:</div>
+            <input placeholder="请输入账号:" name="username" type="text" v-model="rulesForm.username" />
+          </div>
+          <div v-if="loginType == 1" class="list-item">
+            <div class="lable">密码:</div>
+            <div class="password-box">
+              <input placeholder="请输入密码:" name="password" :type="showPassword ? 'text' : 'password'" v-model="rulesForm.password" />
+              <span
+                class="icon iconfont"
+                :class="showPassword ? 'icon-liulan13' : 'icon-liulan17'"
+                @click="showPassword = !showPassword"
+              ></span>
+            </div>
+          </div>
 
-					<div class="list-item " v-if="roles.length>1">
-						<div class="lable">
-							角色:
-						</div>
-						<div prop="loginInRole" class="list-type">
-							<el-radio v-if="loginType==1||(loginType==2&&item.roleName!='管理员')" v-for="item in roles" v-bind:key="item.roleName" v-model="rulesForm.role" :label="item.roleName">{{item.roleName}}</el-radio>
-						</div>
-					</div>
+          <!-- <div class="list-item" v-if="roles.length > 1">
+            <div class="lable">角色:</div>
+            <div prop="loginInRole" class="list-type">
+              <el-radio
+                v-if="loginType == 1 || (loginType == 2 && item.roleName != '管理员')"
+                v-for="item in roles"
+                v-bind:key="item.roleName"
+                v-model="rulesForm.role"
+                :label="item.roleName"
+                >{{ item.roleName }}</el-radio
+              >
+            </div>
+          </div> -->
 
-		
-					<div class="login-btn">
-						<div class="login-btn1">
-							<el-button v-if="loginType==1" type="primary" @click="login()" class="loginInBt">登录</el-button>
-						</div>
-						<div class="login-btn2">
-							<el-button type="primary" @click="register('qiye')" class="register">
-								注册企业							</el-button>
-						</div>
-						<div class="login-btn3">
-						</div>
-					</div>
-				</div>
-			</el-form>
-		</div>
-	</div>
+          <div class="login-btn">
+            <div class="login-btn1">
+              <el-button v-if="loginType == 1" type="primary" @click="login()" class="loginInBt">登录</el-button>
+            </div>
+            <!-- <div class="login-btn2">
+              <el-button type="primary" @click="register('qiye')" class="register"> 注册企业 </el-button>
+            </div> -->
+            <div class="login-btn3"></div>
+          </div>
+        </div>
+      </el-form>
+    </div>
+  </div>
 </template>
 <script>
-	import 'animate.css'
-	import menu from "@/utils/menu";
-	export default {
-		data() {
-			return {
-				verifyCheck2: false,
-				flag: false,
-				baseUrl:this.$base.url,
-				loginType: 1,
-				rulesForm: {
-					username: "",
-					password: "",
-					role: "",
-				},
-				menus: [],
-				roles: [],
-				tableName: "",
-				showPassword: false,
-			};
-		},
-		mounted() {
-			let menus = menu.list();
-			this.menus = menus;
+import 'animate.css';
+import menu from '@/utils/menu';
+export default {
+  data() {
+    return {
+      verifyCheck2: false,
+      flag: false,
+      baseUrl: this.$base.url,
+      loginType: 1,
+      rulesForm: {
+        username: '',
+        password: '',
+        role: '管理员',
+      },
+      menus: [],
+      roles: [],
+      tableName: '',
+      showPassword: false,
+    };
+  },
+  mounted() {
+    let menus = menu.list();
+    this.menus = menus;
 
-			for (let i = 0; i < this.menus.length; i++) {
-				if (this.menus[i].hasBackLogin=='是') {
-					this.roles.push(this.menus[i])
-				}
-			}
+    for (let i = 0; i < this.menus.length; i++) {
+      if (this.menus[i].hasBackLogin == '是') {
+        this.roles.push(this.menus[i]);
+      }
+    }
+  },
+  created() {},
+  destroyed() {},
+  components: {},
+  methods: {
+    //注册
+    register(tableName) {
+      this.$storage.set('loginTable', tableName);
+      this.$router.push({ path: '/register', query: { pageFlag: 'register' } });
+    },
+    // 登陆
+    login() {
+      if (!this.rulesForm.username) {
+        this.$message.error('请输入用户名');
+        return;
+      }
+      if (!this.rulesForm.password) {
+        this.$message.error('请输入密码');
+        return;
+      }
+      if (this.roles.length > 1) {
+        if (!this.rulesForm.role) {
+          this.$message.error('请选择角色');
+          return;
+        }
 
-		},
-		created() {
+        let menus = this.menus;
+        for (let i = 0; i < menus.length; i++) {
+          if (menus[i].roleName == this.rulesForm.role) {
+            this.tableName = menus[i].tableName;
+          }
+        }
+      } else {
+        this.tableName = this.roles[0].tableName;
+        this.rulesForm.role = this.roles[0].roleName;
+      }
 
-		},
-		destroyed() {
-		},
-		components: {
-		},
-		methods: {
-
-			//注册
-			register(tableName){
-				this.$storage.set("loginTable", tableName);
-				this.$router.push({path:'/register',query:{pageFlag:'register'}})
-			},
-			// 登陆
-			login() {
-
-				if (!this.rulesForm.username) {
-					this.$message.error("请输入用户名");
-					return;
-				}
-				if (!this.rulesForm.password) {
-					this.$message.error("请输入密码");
-					return;
-				}
-				if(this.roles.length>1) {
-					if (!this.rulesForm.role) {
-						this.$message.error("请选择角色");
-						return;
-					}
-
-					let menus = this.menus;
-					for (let i = 0; i < menus.length; i++) {
-						if (menus[i].roleName == this.rulesForm.role) {
-							this.tableName = menus[i].tableName;
-						}
-					}
-				} else {
-					this.tableName = this.roles[0].tableName;
-					this.rulesForm.role = this.roles[0].roleName;
-				}
-		
-				this.loginPost()
-			},
-			loginPost() {
-				this.$http({
-					url: `${this.tableName}/login?username=${this.rulesForm.username}&password=${this.rulesForm.password}`,
-					method: "post"
-				}).then(({ data }) => {
-					if (data && data.code === 0) {
-						this.$storage.set("Token", data.token);
-						this.$storage.set("role", this.rulesForm.role);
-						this.$storage.set("sessionTable", this.tableName);
-						this.$storage.set("adminName", this.rulesForm.username);
-						if(this.boardAuth('hasBoard','查看',this.rulesForm.role)) {
-							this.$router.replace({ path: "/board" });
-						}else {
-							this.$router.replace({ path: "/" });
-						}
-					} else {
-						this.$message.error(data.msg);
-					}
-				});
-			},
-		}
-	}
+      this.loginPost();
+    },
+    loginPost() {
+      this.$http({
+        url: `${this.tableName}/login?username=${this.rulesForm.username}&password=${this.rulesForm.password}`,
+        method: 'post',
+      }).then(({ data }) => {
+        if (data && data.code === 0) {
+          this.$storage.set('Token', data.token);
+          this.$storage.set('role', this.rulesForm.role);
+          this.$storage.set('sessionTable', this.tableName);
+          this.$storage.set('adminName', this.rulesForm.username);
+          if (this.boardAuth('hasBoard', '查看', this.rulesForm.role)) {
+            this.$router.replace({ path: '/board' });
+          } else {
+            this.$router.replace({ path: '/' });
+          }
+        } else {
+          this.$message.error(data.msg);
+        }
+      });
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
 .login-container {
-	min-height: 100vh;
-	position: relative;
-	background-repeat: no-repeat;
-	background-position: center center;
-	background-size: cover;
-	background: url(http://codegen.caihongy.cn/20240920/478d9d0cf9214f75a492b100481872a4.jpg) no-repeat center center / 100% 100%;
-	background: url(http://codegen.caihongy.cn/20240920/478d9d0cf9214f75a492b100481872a4.jpg) no-repeat center center / 100% 100%;
-	display: flex;
-	width: 100%;
-	min-height: 100vh;
-	justify-content: center;
-	align-items: center;
-	position: relative !important;
+  min-height: 100vh;
+  position: relative;
+  background-repeat: no-repeat;
+  background-position: center center;
+  background-size: cover;
+  background: url(http://codegen.caihongy.cn/20240920/478d9d0cf9214f75a492b100481872a4.jpg) no-repeat center center / 100% 100%;
+  background: url(http://codegen.caihongy.cn/20240920/478d9d0cf9214f75a492b100481872a4.jpg) no-repeat center center / 100% 100%;
+  display: flex;
+  width: 100%;
+  min-height: 100vh;
+  justify-content: center;
+  align-items: center;
+  position: relative !important;
 
-	.login_form {
-		border-radius: 0px;
-		padding: 30px 80px 30px 40px;
-		margin: 0 auto;
-		background: #ffffff;
-		width: 600px;
-		height: auto;
-		.login_form2 {
-			width: 100%;
-		}
-		.title-container {
-			padding: 0;
-			margin: 0 0 20px -20px;
-			color: #0674fc;
-			background: none;
-			font-weight: 600;
-			width: calc(100% + 80px);
-			font-size: 22px;
-			line-height: 40px;
-			text-align: center;
-		}
-		.list-item {
-			padding: 0;
-			margin: 0 0 20px;
-			display: flex;
-			width: calc(100% - 0px);
-			align-items: center;
-			position: relative;
-			flex-wrap: wrap;
-			.lable {
-				border-radius: 8px 0 0 8px;
-				padding: 0 0 0 10px;
-				color: #000;
-				background: #fff;
-				width: 100px;
-				font-size: 16px;
-				line-height: 40px;
-				text-align: right;
-			}
-			input {
-				border: 1px solid #0674fc;
-				border-radius: 0px;
-				padding: 0 10px;
-				color: #666;
-				flex: 1;
-				background: none;
-				width: auto;
-				font-size: 15px;
-				height: 40px;
-			}
-			input:focus {
-				border: 1px solid #0674fc;
-				border-radius: 0px;
-				padding: 0 10px;
-				color: #666;
-				flex: 1;
-				background: none;
-				width: 100%;
-				font-size: 15px;
-				height: 40px;
-			}
-			.password-box {
-				flex: 1;
-				display: flex;
-				width: auto;
-				position: relative;
-				align-items: center;
-				input {
-					border: 1px solid #0674fc;
-					border-radius: 0px;
-					padding: 0 10px;
-					color: #666;
-					flex: 1;
-					background: none;
-					width: auto;
-					font-size: 15px;
-					height: 40px;
-				}
-				input:focus {
-					border: 1px solid #0674fc;
-					border-radius: 0px;
-					padding: 0 10px;
-					color: #666;
-					flex: 1;
-					background: none;
-					width: 100%;
-					font-size: 15px;
-					height: 40px;
-				}
-				.iconfont {
-					cursor: pointer;
-					z-index: 1;
-					color: #e6e6e6;
-					top: 0;
-					font-size: 16px;
-					line-height: 44px;
-					position: absolute;
-					right: 13px;
-				}
-			}
-			input::placeholder {
-				color: #999;
-				font-size: 16px;
-			}
-		}
-		.list-type {
-			padding: 0 0px;
-			margin: 0;
-			background: none;
-			flex: 1;
-			width: calc(100% - 0px);
-			line-height: 38px;
-			height: auto;
-			::v-deep .el-radio__input .el-radio__inner {
-				border-radius: 0;
-				background: rgba(53, 53, 53, 0);
-				border-color: #aaa;
-			}
-			::v-deep .el-radio__input.is-checked .el-radio__inner {
-				border-radius: 0;
-				background: #0674fc;
-				border-color: #0674fc;
-			}
-			::v-deep .el-radio__label {
-				color: #aaa;
-				font-size: 16px;
-			}
-			::v-deep .el-radio__input.is-checked+.el-radio__label {
-				color: #0674fc;
-				font-size: 16px;
-			}
-		}
-		.login-btn {
-			padding: 0 0 0 100px;
-			margin: 20px auto 0;
-			display: flex;
-			width: 100%;
-			justify-content: center;
-			align-items: center;
-			flex-wrap: wrap;
-			.login-btn1 {
-				margin: 0;
-				width: 100%;
-			}
-			.login-btn2 {
-				margin: 0;
-				display: flex;
-				width: 100%;
-				align-items: center;
-				flex-wrap: wrap;
-			}
-			.login-btn3 {
-				margin: 0 0 20px;
-				width: 100%;
-				text-align: center;
-				order: -1;
-			}
-			.loginInBt {
-				border: 0px solid rgba(0, 0, 0, 1);
-				cursor: pointer;
-				border-radius: 0;
-				padding: 0 10px;
-				margin: 0 0 10px 0;
-				color: #fff;
-				background: #0674fc;
-				font-weight: 500;
-				letter-spacing: 4px;
-				width: 100%;
-				font-size: 22px;
-				height: 50px;
-			}
-			.loginInBt:hover {
-				opacity: 0.9;
-			}
-			.register {
-				border: 0px solid rgba(0, 0, 0, 1);
-				cursor: pointer;
-				border-radius: 8px;
-				padding: 0 10px;
-				margin: 0 10px 10px 0;
-				color: #333;
-				background: #fff;
-				width: auto;
-				font-size: 16px;
-				height: 50px;
-			}
-			.register:hover {
-				opacity: 0.8;
-			}
-			.forget {
-				cursor: pointer;
-				border: 0;
-				border-radius: 0;
-				padding: 0 0px;
-				margin: 0 0px 0px 0;
-				color: #666;
-				background: none;
-				width: 100%;
-				font-size: 16px;
-				text-align: right;
-				height: 34px;
-			}
-			.forget:hover {
-				opacity: 1;
-			}
-		}
-	}
+  .login_form {
+    border-radius: 0px;
+    padding: 30px 80px 30px 40px;
+    margin: 0 auto;
+    background: #ffffff;
+    width: 600px;
+    height: auto;
+    .login_form2 {
+      width: 100%;
+    }
+    .title-container {
+      padding: 0;
+      margin: 0 0 20px -20px;
+      color: #0674fc;
+      background: none;
+      font-weight: 600;
+      width: calc(100% + 80px);
+      font-size: 22px;
+      line-height: 40px;
+      text-align: center;
+    }
+    .list-item {
+      padding: 0;
+      margin: 0 0 20px;
+      display: flex;
+      width: calc(100% - 0px);
+      align-items: center;
+      position: relative;
+      flex-wrap: wrap;
+      .lable {
+        border-radius: 8px 0 0 8px;
+        padding: 0 0 0 10px;
+        color: #000;
+        background: #fff;
+        width: 100px;
+        font-size: 16px;
+        line-height: 40px;
+        text-align: right;
+      }
+      input {
+        border: 1px solid #0674fc;
+        border-radius: 0px;
+        padding: 0 10px;
+        color: #666;
+        flex: 1;
+        background: none;
+        width: auto;
+        font-size: 15px;
+        height: 40px;
+      }
+      input:focus {
+        border: 1px solid #0674fc;
+        border-radius: 0px;
+        padding: 0 10px;
+        color: #666;
+        flex: 1;
+        background: none;
+        width: 100%;
+        font-size: 15px;
+        height: 40px;
+      }
+      .password-box {
+        flex: 1;
+        display: flex;
+        width: auto;
+        position: relative;
+        align-items: center;
+        input {
+          border: 1px solid #0674fc;
+          border-radius: 0px;
+          padding: 0 10px;
+          color: #666;
+          flex: 1;
+          background: none;
+          width: auto;
+          font-size: 15px;
+          height: 40px;
+        }
+        input:focus {
+          border: 1px solid #0674fc;
+          border-radius: 0px;
+          padding: 0 10px;
+          color: #666;
+          flex: 1;
+          background: none;
+          width: 100%;
+          font-size: 15px;
+          height: 40px;
+        }
+        .iconfont {
+          cursor: pointer;
+          z-index: 1;
+          color: #e6e6e6;
+          top: 0;
+          font-size: 16px;
+          line-height: 44px;
+          position: absolute;
+          right: 13px;
+        }
+      }
+      input::placeholder {
+        color: #999;
+        font-size: 16px;
+      }
+    }
+    .list-type {
+      padding: 0 0px;
+      margin: 0;
+      background: none;
+      flex: 1;
+      width: calc(100% - 0px);
+      line-height: 38px;
+      height: auto;
+      ::v-deep .el-radio__input .el-radio__inner {
+        border-radius: 0;
+        background: rgba(53, 53, 53, 0);
+        border-color: #aaa;
+      }
+      ::v-deep .el-radio__input.is-checked .el-radio__inner {
+        border-radius: 0;
+        background: #0674fc;
+        border-color: #0674fc;
+      }
+      ::v-deep .el-radio__label {
+        color: #aaa;
+        font-size: 16px;
+      }
+      ::v-deep .el-radio__input.is-checked + .el-radio__label {
+        color: #0674fc;
+        font-size: 16px;
+      }
+    }
+    .login-btn {
+      padding: 0 0 0 100px;
+      margin: 20px auto 0;
+      display: flex;
+      width: 100%;
+      justify-content: center;
+      align-items: center;
+      flex-wrap: wrap;
+      .login-btn1 {
+        margin: 0;
+        width: 100%;
+      }
+      .login-btn2 {
+        margin: 0;
+        display: flex;
+        width: 100%;
+        align-items: center;
+        flex-wrap: wrap;
+      }
+      .login-btn3 {
+        margin: 0 0 20px;
+        width: 100%;
+        text-align: center;
+        order: -1;
+      }
+      .loginInBt {
+        border: 0px solid rgba(0, 0, 0, 1);
+        cursor: pointer;
+        border-radius: 0;
+        padding: 0 10px;
+        margin: 0 0 10px 0;
+        color: #fff;
+        background: #0674fc;
+        font-weight: 500;
+        letter-spacing: 4px;
+        width: 100%;
+        font-size: 22px;
+        height: 50px;
+      }
+      .loginInBt:hover {
+        opacity: 0.9;
+      }
+      .register {
+        border: 0px solid rgba(0, 0, 0, 1);
+        cursor: pointer;
+        border-radius: 8px;
+        padding: 0 10px;
+        margin: 0 10px 10px 0;
+        color: #333;
+        background: #fff;
+        width: auto;
+        font-size: 16px;
+        height: 50px;
+      }
+      .register:hover {
+        opacity: 0.8;
+      }
+      .forget {
+        cursor: pointer;
+        border: 0;
+        border-radius: 0;
+        padding: 0 0px;
+        margin: 0 0px 0px 0;
+        color: #666;
+        background: none;
+        width: 100%;
+        font-size: 16px;
+        text-align: right;
+        height: 34px;
+      }
+      .forget:hover {
+        opacity: 1;
+      }
+    }
+  }
 }
-
 </style>

+ 16 - 92
src/views/modules/load-forecasting/components/add-or-update.vue

@@ -3,103 +3,27 @@
     <el-form class="add-update-preview" ref="ruleForm" :model="ruleForm" label-width="180px">
       <el-row>
         <el-col :span="12">
-          <el-form-item label="变电站名称" prop="subNm">
-            <el-input v-model="ruleForm.subNm" placeholder="请输入变电站名称" :readonly="type == 'view'"></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="归属县旗" prop="compNm">
-            <el-input v-model="ruleForm.compNm" placeholder="请输入归属县旗名称" :readonly="type == 'view'"></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="电压等级" prop="voltageLevel">
-            <el-input type="number" v-model="ruleForm.voltageLevel" placeholder="请输入电压等级" :readonly="type == 'view'" />
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="主变台数" prop="mainNum">
-            <el-input
-              type="number"
-              style="width: 100%"
-              v-model="ruleForm.mainNum"
-              placeholder="请输入主变台数"
-              :readonly="type == 'view'"
-            />
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="主变容量(MVA)" prop="mainCapacity">
-            <el-input
-              type="number"
-              style="width: 100%"
-              v-model="ruleForm.mainCapacity"
-              placeholder="请输入主变容量"
-              :readonly="type == 'view'"
-            />
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="采集日期" prop="dataDate">
-            <el-input v-model="ruleForm.dataDate" :readonly="type == 'view'" />
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="当日温度(℃)" prop="temperature">
-            <el-input v-model="ruleForm.temperature" :readonly="type == 'view'" />
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="最大负荷(MW)" prop="peakLoad">
-            <el-input v-model="ruleForm.peakLoad" :readonly="type == 'view'" />
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="基础负荷(MW)" prop="baseLoad">
-            <el-input v-model="ruleForm.baseLoad" :readonly="type == 'view'" />
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="电采暖负荷(MW)" prop="electricHeatingLoad">
-            <el-input v-model="ruleForm.electricHeatingLoad" :readonly="type == 'view'" />
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="电采暖负荷(MW)" prop="electricHeatingLoad">
-            <el-input v-model="ruleForm.electricHeatingLoad" :readonly="type == 'view'" />
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="用户数" prop="usersNum">
-            <el-input v-model="ruleForm.usersNum" :readonly="type == 'view'" />
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="平房区用户数" prop="pingfangUsers">
-            <el-input v-model="ruleForm.pingfangUsers" :readonly="type == 'view'" />
+          <el-form-item label="时间范围" prop="timeStatType">
+            <el-select v-model="ruleForm.timeStatType" placeholder="请选择">
+              <el-option label="日" value="daily"></el-option>
+              <el-option label="月" value="monthly"></el-option>
+              <el-option label="年" value="yearly"></el-option>
+            </el-select>
           </el-form-item>
         </el-col>
+      </el-row>
+      <el-row :gutter="20">
         <el-col :span="12">
-          <el-form-item label="平房区接入电暖用户数" prop="electricHeatingUsers">
-            <el-input v-model="ruleForm.electricHeatingUsers" :readonly="type == 'view'" />
-          </el-form-item>
+          <div>最大负荷</div>
+          <div id="peak_load" style="width: 100%; height: 400px"></div>
         </el-col>
         <el-col :span="12">
-          <el-form-item label="平房区已接入电采暖容量(MWA)" prop="pingfangElectricHeatingCapacity">
-            <el-input v-model="ruleForm.pingfangElectricHeatingCapacity" :readonly="type == 'view'" />
-          </el-form-item>
+          <div>基础负荷</div>
+          <div id="base_load" style="width: 100%; height: 400px"></div>
         </el-col>
       </el-row>
       <el-form-item class="btn">
-        <el-button class="btn3" v-if="type != 'view'" type="success" @click="onSubmit">
-          <span class="icon iconfont icon-xihuan"></span>
-          提交
-        </el-button>
-        <el-button class="btn4" v-if="type != 'view'" type="success" @click="back()">
-          <span class="icon iconfont icon-xihuan"></span>
-          取消
-        </el-button>
-        <el-button class="btn5" v-if="type == 'view'" type="success" @click="back()">
+        <el-button class="btn5" type="success" @click="back()">
           <span class="icon iconfont icon-xihuan"></span>
           返回
         </el-button>
@@ -111,14 +35,14 @@
 export default {
   data() {
     return {
-      type: 'view', // add, edit, view
-      ruleForm: {},
+      ruleForm: {
+        timeStatType: 'daily',
+      },
     };
   },
   props: ['parent'],
   methods: {
     openDialog(id, type) {
-      this.type = type;
       this.resetForm();
       if (id) this.info(id);
     },

+ 435 - 112
src/views/modules/load-forecasting/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="main-content" :style="{ width: '100%', padding: '20px 30px', fontSize: '15px' }">
     <!-- 列表页 -->
-    <template v-if="!addOrUpdateOrDetailFlag">
+    <template v-if="!analysisFlag">
       <el-form
         class="center-form-pv"
         :style="{
@@ -46,8 +46,8 @@
               class="item-label"
               >变电站</label
             >
-            <el-select style="width: 100%" v-model="searchForm.subName" placeholder="变电站" @keydown.enter.native="search()" clearable>
-              <el-option v-for="item in subList" :key="item.value" :label="item.label" :value="item.label" />
+            <el-select style="width: 100%" v-model="searchForm.subId" placeholder="变电站" @keydown.enter.native="search()" clearable>
+              <el-option v-for="item in subList" :key="item.value" :label="item.label" :value="item.value" />
             </el-select>
           </div>
           <div
@@ -71,8 +71,8 @@
               class="item-label"
               >归属县旗</label
             >
-            <el-select style="width: 100%" v-model="searchForm.compNm" placeholder="归属县旗" @keydown.enter.native="search()" clearable>
-              <el-option v-for="item in compList" :key="item.value" :label="item.label" :value="item.label" />
+            <el-select style="width: 100%" v-model="searchForm.compId" placeholder="归属县旗" @keydown.enter.native="search()" clearable>
+              <el-option v-for="item in compList" :key="item.value" :label="item.label" :value="item.value" />
             </el-select>
           </div>
           <div :style="{ alignItems: 'center', margin: '0 10px 0 0', display: 'flex' }">
@@ -90,10 +90,7 @@
               class="item-label"
               >温度</label
             >
-            <el-input v-model="searchForm.temperaturestart" placeholder="最小温度" clearable></el-input>
-          </div>
-          <div :style="{ alignItems: 'center', margin: '0 10px 0 0', display: 'flex' }" :label="'至'">
-            <el-input v-model="searchForm.temperatureend" placeholder="最大温度" clearable></el-input>
+            <el-input v-model="searchForm.temperature" placeholder="温度" clearable></el-input>
           </div>
           <div
             :style="{
@@ -151,7 +148,7 @@
             display: 'flex',
           }"
         >
-          <el-button class="del" :disabled="dataListSelections.length ? false : true" type="danger" @click="deleteHandler()">
+          <el-button class="add" type="danger" @click="ycForecastHandler()">
             <span
               class="icon iconfont icon-xihuan"
               :style="{
@@ -162,9 +159,9 @@
                 height: '34px',
               }"
             ></span>
-            批量删除
+            预测
           </el-button>
-          <el-button class="add" type="danger" @click="importHandler()">
+          <el-button class="add" type="danger" @click="analysisHandler()">
             <span
               class="icon iconfont icon-xihuan"
               :style="{
@@ -175,7 +172,7 @@
                 height: '34px',
               }"
             ></span>
-            预测
+            数据分析
           </el-button>
         </el-row>
       </el-form>
@@ -205,11 +202,9 @@
           :border="true"
           :data="dataList"
           v-loading="dataListLoading"
-          @selection-change="selectionChangeHandler"
         >
-          <el-table-column :resizable="true" type="selection" align="center" width="50"></el-table-column>
           <el-table-column :resizable="true" :sortable="true" label="序号" type="index" width="50" />
-          <el-table-column :resizable="true" :sortable="true" prop="dataDate" label="日期" />
+          <el-table-column :resizable="true" :sortable="true" prop="recordDate" label="日期" />
           <el-table-column :resizable="true" :sortable="true" prop="subNm" label="变电站">
             <template slot-scope="scope" :resizable="true" :sortable="true">
               {{ scope.row.subNm }}
@@ -235,47 +230,20 @@
               {{ scope.row.mainCapacity }}
             </template>
           </el-table-column>
-          <!-- <el-table-column :resizable="true" :sortable="true" prop="temperature" label="温度">
+          <el-table-column :resizable="true" :sortable="true" prop="temperature" label="温度(℃)" />
+          <el-table-column :resizable="true" :sortable="true" prop="peakLoad" label="最大负荷(MW)" />
+          <el-table-column :resizable="true" :sortable="true" prop="loadRate" label="负载率(%)">
             <template slot-scope="scope">
-              {{ scope.row.temperature }}℃
+              {{ scope.row.loadRate ? (Number(scope.row.loadRate) * 100).toFixed(2) : '--' }}
             </template>
-          </el-table-column> -->
-          <el-table-column :resizable="true" :sortable="true" prop="peakLoad" label="最大负荷(MW)" />
-          <el-table-column :resizable="true" :sortable="true" prop="loadRate" label="负载率(%)" />
+          </el-table-column>
           <el-table-column :resizable="true" :sortable="true" prop="baseLoad" label="基础负荷(MW)" />
           <el-table-column :resizable="true" :sortable="true" prop="electricHeatingLoad" label="电采暖负荷(MW)" />
           <el-table-column :resizable="true" :sortable="true" prop="usersNum" label="用户数" />
-          <el-table-column :resizable="true" :sortable="true" prop="pfUsersNum" label="平房用户数" />
           <el-table-column :resizable="true" :sortable="true" prop="joinElectricHeatingNum" label="接入电暖用户数" />
-          <el-table-column :resizable="true" :sortable="true" prop="pingfangElectricHeatingCapacity" label="接入电采暖容量(MWA)" />
-          <el-table-column width="120" label="操作">
+          <el-table-column :resizable="true" :sortable="true" prop="confidence" label="置信度(%)">
             <template slot-scope="scope">
-              <el-button class="view" type="success" @click="addOrUpdateHandler(scope.row.id, 'view')">
-                <span
-                  class="icon iconfont icon-xihuan"
-                  :style="{
-                    margin: '0 2px',
-                    fontSize: '14px',
-                    color: '#fff',
-                    display: 'none',
-                    height: '40px',
-                  }"
-                ></span>
-                明细
-              </el-button>
-              <el-button class="del" type="primary" @click="deleteHandler(scope.row.id)">
-                <span
-                  class="icon iconfont icon-xihuan"
-                  :style="{
-                    margin: '0 2px',
-                    fontSize: '14px',
-                    color: '#fff',
-                    display: 'none',
-                    height: '40px',
-                  }"
-                ></span>
-                删除
-              </el-button>
+              {{ scope.row.confidence ? (Number(scope.row.confidence) * 100).toFixed(2) : '--' }}
             </template>
           </el-table-column>
         </el-table>
@@ -306,29 +274,253 @@
         }"
       ></el-pagination>
     </template>
-    <!-- 添加/修改页面  将父组件的search方法传递给子组件-->
-    <add-or-update v-if="addOrUpdateOrDetailFlag" :parent="this" ref="addOrUpdate"></add-or-update>
-    <!-- 上传文件弹窗 -->
-    <upload-modal :parent="this" ref="uploadModal"></upload-modal>
+    <div v-if="analysisFlag">
+      <el-form
+        class="center-form-pv"
+        :style="{
+          border: '0px solid #fff',
+          padding: '10px',
+          margin: '0',
+          flexWrap: 'wrap',
+          background: '#ffffff',
+          display: 'flex',
+          width: '100%',
+        }"
+        :inline="true"
+        :model="searchForm"
+      >
+        <el-row
+          :style="{
+            padding: '10px',
+            alignItems: 'center',
+            flexWrap: 'wrap',
+            background: 'none',
+            display: 'flex',
+          }"
+        >
+          <div
+            v-if="false"
+            :style="{
+              alignItems: 'center',
+              margin: '0 10px 0 0',
+              display: 'flex',
+            }"
+          >
+            <label
+              :style="{
+                margin: '0 10px 0 0',
+                whiteSpace: 'nowrap',
+                color: '#666',
+                display: 'inline-block',
+                lineHeight: '40px',
+                fontSize: 'inherit',
+                fontWeight: '500',
+                height: '40px',
+              }"
+              class="item-label"
+              >变电站</label
+            >
+            <el-select style="width: 100%" v-model="searchForm.subId" placeholder="变电站" @keydown.enter.native="search()" clearable>
+              <el-option v-for="item in subList" :key="item.value" :label="item.label" :value="item.value" />
+            </el-select>
+          </div>
+          <div
+            :style="{
+              alignItems: 'center',
+              margin: '0 10px 0 0',
+              display: 'flex',
+            }"
+          >
+            <label
+              :style="{
+                margin: '0 10px 0 0',
+                whiteSpace: 'nowrap',
+                color: '#666',
+                display: 'inline-block',
+                lineHeight: '40px',
+                fontSize: 'inherit',
+                fontWeight: '500',
+                height: '40px',
+              }"
+              class="item-label"
+              >归属县旗</label
+            >
+            <el-select style="width: 100%" v-model="searchForm.compId" placeholder="归属县旗" @keydown.enter.native="search()" clearable>
+              <el-option v-for="item in compList" :key="item.value" :label="item.label" :value="item.value" />
+            </el-select>
+          </div>
+          <div
+            :style="{
+              alignItems: 'center',
+              margin: '0 10px 0 0',
+              display: 'flex',
+            }"
+          >
+            <label
+              :style="{
+                margin: '0 10px 0 0',
+                whiteSpace: 'nowrap',
+                color: '#666',
+                display: 'inline-block',
+                lineHeight: '40px',
+                fontSize: 'inherit',
+                fontWeight: '500',
+                height: '40px',
+              }"
+              class="item-label"
+              >时间范围</label
+            >
+            <el-radio-group size="large" v-model="searchForm.timeStatType" @change="searchForm.record_date_end = undefined">
+              <el-radio-button label="daily">日</el-radio-button>
+              <el-radio-button label="monthly">月</el-radio-button>
+              <el-radio-button label="yearly">年</el-radio-button>
+            </el-radio-group>
+          </div>
+          <div
+            :style="{
+              alignItems: 'center',
+              margin: '0 10px 0 0',
+              display: 'flex',
+            }"
+          >
+            <label
+              :style="{
+                margin: '0 10px 0 0',
+                whiteSpace: 'nowrap',
+                color: '#666',
+                display: 'inline-block',
+                lineHeight: '40px',
+                fontSize: 'inherit',
+                fontWeight: '500',
+                height: '40px',
+              }"
+              class="item-label"
+              >日期</label
+            >
+            <el-date-picker
+              size="large"
+              v-model="searchForm.record_date_end"
+              :type="timeTtpeMap[searchForm.timeStatType]"
+              :value-format="timeValueFormatMap[searchForm.timeStatType]"
+              placeholder="选择日期"
+            />
+            <!-- value-format="yyyy-MM-dd" -->
+          </div>
+          <el-button class="search" type="success" @click="initAnalysisData()">
+            <span
+              class="icon iconfont icon-fangdajing07"
+              :style="{
+                margin: '0 2px',
+                fontSize: '16px',
+                color: '#fff',
+                display: 'none',
+                height: '40px',
+              }"
+            ></span>
+            搜索
+          </el-button>
+        </el-row>
+
+        <el-row
+          class="actions"
+          :style="{
+            padding: '10px',
+            margin: '0px 0',
+            flexWrap: 'wrap',
+            background: 'none',
+            display: 'flex',
+          }"
+        >
+          <el-button class="add" type="danger" @click="analysisFlag = false">
+            <span
+              class="icon iconfont icon-xihuan"
+              :style="{
+                margin: '0 2px',
+                fontSize: '14px',
+                color: '#fff',
+                display: 'none',
+                height: '34px',
+              }"
+            ></span>
+            返回
+          </el-button>
+        </el-row>
+      </el-form>
+      <el-row :gutter="12">
+        <el-col :span="8">
+          <el-card header="最大负荷">
+            <div id="chart1" style="height: 260px"></div>
+          </el-card>
+        </el-col>
+        <el-col :span="8">
+          <el-card header="基础负荷">
+            <div id="chart2" style="height: 260px"></div>
+          </el-card>
+        </el-col>
+        <el-col :span="8">
+          <el-card header="电采暖负荷">
+            <div id="chart3" style="height: 260px"></div>
+          </el-card>
+        </el-col>
+      </el-row>
+      <el-row :gutter="12" style="margin-top: 12px">
+        <el-col :span="8">
+          <el-card header="负荷率">
+            <div id="chart4" style="height: 260px"></div>
+          </el-card>
+        </el-col>
+        <el-col :span="8">
+          <el-card header="用户数">
+            <div id="chart5" style="height: 260px"></div>
+          </el-card>
+        </el-col>
+        <el-col :span="8">
+          <el-card header="接入电暖用户数">
+            <div id="chart6" style="height: 260px"></div>
+          </el-card>
+        </el-col>
+      </el-row>
+    </div>
   </div>
 </template>
 
 <script>
-import AddOrUpdate from './components/add-or-update.vue';
-import uploadModal from './components/uploadModal.vue';
+import * as echarts from 'echarts';
 export default {
-  components: {
-    AddOrUpdate,
-    uploadModal,
-  },
+  components: {},
   data() {
     return {
       searchForm: {
-        subNm: '',
-        compNm: '',
-        temperaturestart: '',
-        temperatureend: '',
+        subId: '',
+        compId: '',
+        temperature: '',
         dateRange: [],
+        timeStatType: 'daily',
+        record_date_end: '',
+      },
+      timeRangeList: [
+        {
+          label: '日',
+          value: 'daily',
+        },
+        {
+          label: '月',
+          value: 'monthly',
+        },
+        {
+          label: '年',
+          value: 'yearly',
+        },
+      ],
+      timeTtpeMap: {
+        daily: 'date',
+        monthly: 'month',
+        yearly: 'year',
+      },
+      timeValueFormatMap: {
+        daily: 'yyyy-MM-DD',
+        monthly: 'yyyy-MM',
+        yearly: 'yyyy',
       },
       dataList: [],
       subList: [],
@@ -339,7 +531,46 @@ export default {
       dataListSelections: [],
       layouts: ['prev', 'pager', 'next', 'sizes'],
       compList: [],
-      addOrUpdateOrDetailFlag: false,
+      analysisFlag: false,
+      barOption: {
+        grid: { top: 10, left: 15, right: 15, bottom: 20 },
+        color: ['#0977fd'],
+        tooltip: { trigger: 'item', formatter: '{b} : {c}', backgroundColor: 'transparent' },
+        xAxis: {
+          type: 'category',
+          data: ['-'],
+        },
+        yAxis: {
+          name: 'MW',
+          type: 'value',
+        },
+        series: [
+          {
+            data: [],
+            type: 'bar',
+          },
+        ],
+      },
+      pie: {
+        grid: { top: 10, left: 15, right: 15, bottom: 20 },
+        color: ['#0977fd'],
+        tooltip: { trigger: 'item', formatter: '{b} : {c}', backgroundColor: 'transparent' },
+        series: [
+          {
+            type: 'pie',
+            radius: ['25%', '55%'],
+            center: ['50%', '60%'],
+            data: [],
+            emphasis: {
+              itemStyle: {
+                shadowBlur: 10,
+                shadowOffsetX: 0,
+                shadowColor: 'rgba(0, 0, 0, 0.5)',
+              },
+            },
+          },
+        ],
+      },
     };
   },
   created() {
@@ -383,8 +614,130 @@ export default {
         }));
       }
     },
-    importHandler() {
-      this.$refs.uploadModal.openDialog();
+    // 初始化分析数据
+    initAnalysisData(initType = 'value') {
+      if (initType != 'init' && !this.searchForm.compId) {
+        this.$message.warning('请选择归属县旗');
+        return;
+      }
+      if (initType != 'init' && !this.searchForm.record_date_end) {
+        this.$message.warning('请选择日期');
+        return;
+      }
+      this.getAnalysisData(initType);
+    },
+    getAnalysisData(initType = 'value') {
+      const columns = ['peak_load', 'base_load', 'electric_heating_load', 'load_rate ', 'users_num', 'join_electric_heating_num'];
+      const params = {
+        subId: this.searchForm.subId,
+        companyId: this.searchForm.compId,
+        recordDate: this.searchForm.record_date_end,
+      };
+      columns.forEach((item, i) => {
+        this.$http({
+          url: `/electric-heating/${initType}/${item.filed}/${this.searchForm.timeStatType}`,
+          method: 'get',
+          params: params,
+        }).then(({ data }) => {
+          const chart = echarts.init(document.getElementById(`chart${i + 1}`), 'carp');
+          const res = initType === 'init' ? data?.data?.result || [] : data?.data || [];
+          // 使用刚指定的配置项和数据显示图表。
+          if ([0, 1, 2].includes(i)) {
+            chart.setOption({
+              ...this.barOption,
+              xAxis: {
+                type: 'category',
+                data: res?.map(item => item.subName),
+              },
+              series: [
+                {
+                  data: res?.map(item => item.total),
+                  type: 'bar',
+                },
+              ],
+            });
+          }
+          if ([3, 4, 5].includes(i)) {
+            chart.setOption({
+              ...this.pieOption,
+              series: [
+                {
+                  data: res?.map(item => ({ name: item.subName, value: item.total })),
+                  type: 'pie',
+                  radius: ['25%', '55%'],
+                  center: ['50%', '60%'],
+                  emphasis: {
+                    itemStyle: {
+                      shadowBlur: 10,
+                      shadowOffsetX: 0,
+                      shadowColor: 'rgba(0, 0, 0, 0.5)',
+                    },
+                  },
+                },
+              ],
+            });
+          }
+          //根据窗口的大小变动图表
+          window.onresize = function () {
+            chart.resize();
+          };
+          console.log(data, item);
+        });
+      });
+    },
+    // 预测
+    ycForecastHandler() {
+      if (this.searchForm.temperature == '' || this.searchForm.temperature == undefined) {
+        this.$message.warning('请输入温度');
+        return;
+      }
+      if (!this.searchForm.dateRange || this.searchForm.dateRange?.length === 0) {
+        this.$message.warning('请选择日期范围');
+        return;
+      }
+      this.dataListLoading = true;
+      let params = {
+        page: this.pageIndex,
+        limit: this.pageSize,
+        sort: 'id',
+        order: 'desc',
+      };
+      if (this.searchForm.subId != '' && this.searchForm.subId != undefined) {
+        params['subId'] = Number(this.searchForm.subId);
+      }
+      if (this.searchForm.compId != '' && this.searchForm.compId != undefined) {
+        params['compId'] = Number(this.searchForm.compId);
+      }
+      if (this.searchForm.temperature != '' && this.searchForm.temperature != undefined) {
+        params['temperature'] = Number(this.searchForm.temperature);
+      }
+      if (this.searchForm.dateRange != '' && this.searchForm.dateRange != undefined) {
+        params['startDate'] = this.searchForm.dateRange[0];
+        params['endDate'] = this.searchForm.dateRange[1];
+      }
+      this.$http({
+        url: '/electric-heating/predict',
+        method: 'post',
+        data: params,
+      }).then(({ data }) => {
+        if (data && data.code === 0) {
+          this.$message.success(data.msg);
+        } else {
+          this.$message.error(data.msg);
+        }
+        this.dataListLoading = false;
+      });
+    },
+    // 显示数据分析
+    analysisHandler(row) {
+      this.analysisFlag = true;
+      this.searchForm.timeStatType = 'daily';
+      this.searchForm.subId = undefined;
+      this.searchForm.compId = undefined;
+      this.searchForm.record_date_end = undefined;
+      this.$nextTick(() => {
+        this.initAnalysisData('init');
+      });
     },
     search() {
       this.pageIndex = 1;
@@ -399,14 +752,21 @@ export default {
         sort: 'id',
         order: 'desc',
       };
-      if (this.searchForm.subNm != '' && this.searchForm.subNm != undefined) {
-        params['subNm'] = '%' + this.searchForm.subNm + '%';
+      if (this.searchForm.subId != '' && this.searchForm.subId != undefined) {
+        params['subId'] = Number(this.searchForm.subId);
+      }
+      if (this.searchForm.compId != '' && this.searchForm.compId != undefined) {
+        params['compId'] = Number(this.searchForm.compId);
       }
-      if (this.searchForm.compNm != '' && this.searchForm.compNm != undefined) {
-        params['compNm'] = '%' + this.searchForm.compNm + '%';
+      if (this.searchForm.temperature != '' && this.searchForm.temperature != undefined) {
+        params['temperature'] = Number(this.searchForm.temperature);
+      }
+      if (this.searchForm.dateRange != '' && this.searchForm.dateRange != undefined) {
+        params['record_date_start'] = this.searchForm.dateRange[0];
+        params['record_date_end'] = this.searchForm.dateRange[1];
       }
       this.$http({
-        url: '/subLoad/page',
+        url: '/electric-heating/page',
         method: 'get',
         params: params,
       }).then(({ data }) => {
@@ -431,46 +791,6 @@ export default {
       this.pageIndex = val;
       this.getDataList();
     },
-    // 多选
-    selectionChangeHandler(val) {
-      this.dataListSelections = val;
-    },
-    // 添加/修改
-    addOrUpdateHandler(id, type) {
-      this.addOrUpdateOrDetailFlag = true;
-      this.$nextTick(() => {
-        this.$refs.addOrUpdate.openDialog(id, type);
-      });
-    },
-    // 删除
-    async deleteHandler(id) {
-      var ids = id
-        ? [Number(id)]
-        : this.dataListSelections.map(item => {
-            return Number(item.id);
-          });
-      await this.$confirm(`确定进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning',
-      }).then(async () => {
-        await this.$http({
-          url: 'subLoad/delete',
-          method: 'post',
-          data: ids,
-        }).then(async ({ data }) => {
-          if (data && data.code === 0) {
-            this.$message({
-              message: '操作成功',
-              type: 'success',
-            });
-            this.search();
-          } else {
-            this.$message.error(data.msg);
-          }
-        });
-      });
-    },
   },
 };
 </script>
@@ -1130,4 +1450,7 @@ export default {
   position: relative;
   transition: 0.3s;
 }
+::v-deep .el-radio-button__orig-radio:checked + .el-radio-button__inner {
+  background-color: #0977fd;
+}
 </style>