Browse Source

晋能发电场站生产实时运营管理平台APP,增加场站页面(包含场站数据简报页面,故障分类页面);

SunZehao 1 year ago
parent
commit
7d2c01c793

+ 5 - 9
api/login.js

@@ -1,19 +1,15 @@
 import request from '@/utils/request'
 
 // 登录方法
-export function login(username, password, captchaVerification) {
-	const data = {
-		username,
-		password,
-		captchaVerification
-	}
+export function login(params) {
 	return request({
-		url: '/system/auth/login',
+		baseUrl: 'http://192.168.2.2:48080',
+		url: '/admin-api/system/auth/login',
 		headers: {
 			isToken: false
 		},
 		'method': 'POST',
-		'data': data
+		'data': params
 	})
 }
 
@@ -31,4 +27,4 @@ export function logout() {
 		url: '/system/auth/logout',
 		'method': 'POST'
 	})
-}
+}

+ 2 - 2
config.js

@@ -1,8 +1,8 @@
 // 应用全局配置
 module.exports = {
 	// baseUrl: 'http://api-dashboard.yudao.iocoder.cn',
-	baseUrl: 'http://192.168.2.7:48080',
-	baseApi: '/admin-api',
+	baseUrl: 'http://192.168.2.2:6060',
+	baseApi: '',
 	// 应用信息
 	appInfo: {
 		// 应用名称

+ 13 - 1
pages.json

@@ -6,6 +6,12 @@
 				"navigationStyle": "custom"
 			}
 		}, {
+			"path": "pages/common/companyHeader",
+			"style": {
+				"navigationBarTitleText": "公司头部",
+				"navigationStyle": "custom"
+			}
+		}, {
 			"path": "pages/home/index",
 			"style": {
 				"navigationBarTitleText": "首页",
@@ -76,6 +82,12 @@
 				"navigationStyle": "custom"
 			}
 		}, {
+			"path": "pages/warn/faultWarnIndex",
+			"style": {
+				"navigationBarTitleText": "故障预警",
+				"navigationStyle": "custom"
+			}
+		}, {
 			"path": "pages/warn/stationIndex",
 			"style": {
 				"navigationBarTitleText": "场站故障预警",
@@ -132,7 +144,7 @@
 			"selectedIconPath": "static/jnImage/indexPage/reportS.png",
 			"text": "数据简报"
 		}, {
-			"pagePath": "pages/warn/index",
+			"pagePath": "pages/warn/faultWarnIndex",
 			"iconPath": "static/jnImage/indexPage/warn.png",
 			"selectedIconPath": "static/jnImage/indexPage/warnS.png",
 			"text": "故障预警"

+ 89 - 0
pages/common/companyHeader.vue

@@ -0,0 +1,89 @@
+<template>
+	<view class="home_header">
+		<view class="header_message" @click="changeMsg">
+			<image src="../../static/jnImage/indexPage/alarmSet.png"></image>
+		</view>
+		<view class="header_title">
+			<text class="titleName">发电场站生产实时运营管理平台</text>
+		</view>
+		<view class="header_more" @click="changeStation">
+			<image src="../../static/jnImage/indexPage/moreNew.png"></image>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+
+			};
+		},
+		methods: {
+			changeMsg() {
+				this.$tab.navigateTo('/pages/common/messagePage')
+			},
+			changeStation() {
+				this.$tab.navigateTo('/pages/common/stationListPage')
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.home_header {
+		width: calc(100% -32px);
+		display: flex;
+		justify-content: space-between;
+		height: 60px;
+		padding-top: 16px;
+		// position: fixed;
+
+		.header_message {
+			width: 15%;
+
+			image {
+				position: relative;
+				top: 5px;
+				left: 10px;
+				width: 25px;
+				height: 25px;
+			}
+		}
+
+		.header_title {
+			width: 70%;
+			position: relative;
+			left: 5px;
+
+			image {
+				width: 28px;
+				height: 22px;
+				position: relative;
+				top: 5px;
+			}
+
+			.titleName {
+				line-height: 20px;
+				font-size: 36upx;
+				font-family: FZZhengHeiS-M-GB;
+				font-weight: 600;
+				color: #fff;
+				position: relative;
+				top: 8px;
+			}
+		}
+
+		.header_more {
+			width: 15%;
+			position: relative;
+			top: 10px;
+			left: 10px;
+
+			image {
+				width: 25px;
+				height: 18px;
+			}
+		}
+	}
+</style>

+ 4 - 4
pages/home/index.vue

@@ -236,7 +236,7 @@
 									</view>
 									<view class="msg_data_sty flex">
 										<view class="msg_data_name">
-											<text>AGC指令</text>
+											<text>出现功率</text>
 										</view>
 										<view class="dataSty flex">
 											<text>0.00</text>
@@ -264,21 +264,21 @@
 		},
 		created() {
 			this.windPowerData = [{
-					name: '实际风速',
+					name: '风速',
 					value: 7,
 					code: '(m/s)',
 					min: 6,
 					max: 8
 				},
 				{
-					name: '预测风速',
+					name: '日照强度',
 					value: 10,
 					code: '(m/s)',
 					min: 6,
 					max: 20
 				},
 				{
-					name: '实际功率',
+					name: '功率',
 					value: 191,
 					code: '(万kW)',
 					min: 0,

+ 22 - 14
pages/login/login.vue

@@ -26,6 +26,12 @@
 </template>
 
 <script>
+	import {
+		setToken
+	} from '@/utils/auth'
+	import {
+		login
+	} from '../../api/login.js'
 	export default {
 		name: 'Login',
 		data() {
@@ -34,36 +40,38 @@
 				globalConfig: getApp().globalData.config,
 				loginForm: {
 					username: "admin",
-					password: "admin123"
+					password: "123456"
 				}
 			}
 		},
 		methods: {
 			// 登录方法
 			handleLogin(params) {
+				let that = this
 				// if (this.loginForm.username === "") {
 				// 	this.$modal.msgError("请输入您的账号")
 				// } else if (this.loginForm.password === "") {
 				// 	this.$modal.msgError("请输入您的密码")
 				// } else {
-				// 	// await this.pwdLogin({})
-				// uni.navigateTo({
-				// 	url: '/pages/power/index'
-				// });
+				// 	this.pwdLogin({})
 				// }
-				let that = this
 
 				that.$tab.switchTab('/pages/home/index')
 			},
 			// 密码登录
-			async pwdLogin() {
-				// this.$modal.loading("登录中,请耐心等待...")
-				// 执行登录
-				// this.$store.dispatch('Login', this.loginForm).then(() => {
-				// 	this.$modal.closeLoading()
-				// 	this.loginSuccess()
-				// })
-				this.loginSuccess()
+			pwdLogin() {
+				this.$modal.loading("登录中,请耐心等待...")
+				let params = {
+					username: this.loginForm.username,
+					password: this.loginForm.password
+				}
+				login(params).then(res => {
+					if (res && res.data) {
+						this.$modal.closeLoading()
+						setToken(res.data)
+						this.$tab.switchTab('/pages/home/index')
+					}
+				})
 			},
 			// 登录成功后,处理函数
 			loginSuccess(result) {

+ 5 - 77
pages/power/index.vue

@@ -1,17 +1,6 @@
 <template>
 	<view class="power">
-		<view class="home_header">
-			<view class="header_message" @click="changeMsg">
-				<image src="../../static/jnImage/indexPage/alarmSet.png"></image>
-			</view>
-			<view class="header_title">
-				<!-- <image src="../../static/jnImage/loginPage/logo.png" mode=""></image> -->
-				<text class="titleName">发电场站生产实时运营管理平台</text>
-			</view>
-			<view class="header_more" @click="changeStation">
-				<image src="../../static/jnImage/indexPage/moreNew.png"></image>
-			</view>
-		</view>
+		<company-header></company-header>
 		<view class="power_main">
 			<view class="flex justify-center">
 				<view class="power_tab">
@@ -97,12 +86,13 @@
 </template>
 
 <script>
-	// import * as echarts from 'echarts'
-	// import uCharts from '../../components/u-charts/u-charts.js';
-	// import qCharts from '../../components/u-charts/component.vue';
+	import companyHeader from '../common/companyHeader.vue'
 	var uChartsInstance = {};
 	export default {
 		onLoad: function() {},
+		components: {
+			companyHeader
+		},
 		data() {
 			return {
 				powerTab: 'DL',
@@ -201,12 +191,6 @@
 			this.getPowerBar()
 		},
 		methods: {
-			changeMsg() {
-				this.$tab.navigateTo('/pages/common/messagePage')
-			},
-			changeStation() {
-				this.$tab.navigateTo('/pages/common/stationListPage')
-			},
 			getPowerBar() {
 				let opts = {
 					color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
@@ -416,62 +400,6 @@
 		background-repeat: no-repeat, repeat;
 		background-size: 100% 260px, 100% 5px;
 
-		.home_header {
-			width: calc(100% -32px);
-			display: flex;
-			justify-content: space-between;
-			height: 60px;
-			padding-top: 16px;
-			// position: fixed;
-
-			.header_message {
-				width: 15%;
-
-				image {
-					position: relative;
-					top: 5px;
-					left: 10px;
-					width: 25px;
-					height: 25px;
-				}
-			}
-
-			.header_title {
-				width: 70%;
-				position: relative;
-				left: 5px;
-
-				image {
-					width: 28px;
-					height: 22px;
-					position: relative;
-					top: 5px;
-				}
-
-				.titleName {
-					line-height: 20px;
-					font-size: 36upx;
-					font-family: FZZhengHeiS-M-GB;
-					font-weight: 600;
-					color: #fff;
-					position: relative;
-					top: 8px;
-				}
-			}
-
-			.header_more {
-				width: 15%;
-				position: relative;
-				top: 10px;
-				left: 10px;
-
-				image {
-					width: 25px;
-					height: 18px;
-				}
-			}
-		}
-
 		.power_main {
 			padding: 0 20px;
 

+ 5 - 74
pages/report/index.vue

@@ -1,17 +1,6 @@
 <template>
 	<view class="report">
-		<view class="home_header">
-			<view class="header_message" @click="changeMsg">
-				<image src="../../static/jnImage/indexPage/alarmSet.png"></image>
-			</view>
-			<view class="header_title">
-				<!-- <image src="../../static/jnImage/loginPage/logo.png" mode=""></image> -->
-				<text class="titleName">发电场站生产实时运营管理平台</text>
-			</view>
-			<view class="header_more" @click="changeStation">
-				<image src="../../static/jnImage/indexPage/moreNew.png"></image>
-			</view>
-		</view>
+		<company-header></company-header>
 		<view class="report_main">
 			<view class="report_DataAll" v-for="(item,index) in reportProgressData" :key="index">
 				<view class="report_Data flex justify-between">
@@ -57,8 +46,12 @@
 </template>
 
 <script>
+	import companyHeader from '../common/companyHeader.vue'
 	export default {
 		onLoad: function() {},
+		components: {
+			companyHeader
+		},
 		data() {
 			return {
 				reportProgressData: [],
@@ -128,12 +121,6 @@
 			showProgress(item) {
 				return `width: ${item.progress};`
 			},
-			changeMsg() {
-				this.$tab.navigateTo('/pages/common/messagePage')
-			},
-			changeStation() {
-				this.$tab.navigateTo('/pages/common/stationListPage')
-			},
 			changeYearTab(item) {
 				this.yearData.forEach(it => {
 					it.showColor = false
@@ -158,62 +145,6 @@
 		background-repeat: no-repeat, repeat;
 		background-size: 100% 260px, 100% 5px;
 
-		.home_header {
-			width: calc(100% -32px);
-			display: flex;
-			justify-content: space-between;
-			height: 60px;
-			padding-top: 16px;
-			// position: fixed;
-
-			.header_message {
-				width: 15%;
-
-				image {
-					position: relative;
-					top: 5px;
-					left: 10px;
-					width: 25px;
-					height: 25px;
-				}
-			}
-
-			.header_title {
-				width: 70%;
-				position: relative;
-				left: 5px;
-
-				image {
-					width: 28px;
-					height: 22px;
-					position: relative;
-					top: 5px;
-				}
-
-				.titleName {
-					line-height: 20px;
-					font-size: 36upx;
-					font-family: FZZhengHeiS-M-GB;
-					font-weight: 600;
-					color: #fff;
-					position: relative;
-					top: 8px;
-				}
-			}
-
-			.header_more {
-				width: 15%;
-				position: relative;
-				top: 10px;
-				left: 10px;
-
-				image {
-					width: 25px;
-					height: 18px;
-				}
-			}
-		}
-
 		.report_main {
 			padding: 0 20px;
 

+ 7 - 76
pages/type/index.vue

@@ -1,17 +1,6 @@
 <template>
 	<view class="faultType">
-		<view class="home_header">
-			<view class="header_message" @click="changeMsg">
-				<image src="../../static/jnImage/indexPage/alarmSet.png"></image>
-			</view>
-			<view class="header_title">
-				<!-- <image src="../../static/jnImage/loginPage/logo.png" mode=""></image> -->
-				<text class="titleName">发电场站生产实时运营管理平台</text>
-			</view>
-			<view class="header_more" @click="changeStation">
-				<image src="../../static/jnImage/indexPage/moreNew.png"></image>
-			</view>
-		</view>
+		<company-header></company-header>
 		<view class="faultType_main">
 			<view class="flex justify-center">
 				<view class="faultType_tab">
@@ -65,7 +54,7 @@
 					</view>
 				</view>
 			</view>
-			<view class="ssdl">
+			<!-- <view class="ssdl">
 				<view class="flex justify-between">
 					<view class="gzcs_title flex justify-center">
 						<image src="../../static/jnImage/powerPage/powerDayIcon.png" mode=""
@@ -110,7 +99,7 @@
 						</view>
 					</view>
 				</view>
-			</view>
+			</view> -->
 			<view class="wxss">
 				<view class="flex justify-between">
 					<view class="gzcs_title flex justify-center">
@@ -148,8 +137,12 @@
 </template>
 
 <script>
+	import companyHeader from '../common/companyHeader.vue'
 	export default {
 		onLoad: function() {},
+		components: {
+			companyHeader
+		},
 		data() {
 			return {
 				faultTypeTab: 'XT',
@@ -339,12 +332,6 @@
 				};
 				this.chartData = JSON.parse(JSON.stringify(res));
 			},
-			changeMsg() {
-				this.$tab.navigateTo('/pages/common/messagePage')
-			},
-			changeStation() {
-				this.$tab.navigateTo('/pages/common/stationListPage')
-			},
 			getPieBarwxss() {
 				let proColor = ['#5CB2EF', '#3E78C5', '#00299D', '#3EAD9F', '#3F3A99', '#5EAC88', '#5D56D0', '#CD8D23',
 					'#9F65C1', '#FD8974', '#C745B9', '#FF6B3E'
@@ -415,62 +402,6 @@
 		background-repeat: no-repeat, repeat;
 		background-size: 100% 260px, 100% 5px;
 
-		.home_header {
-			width: calc(100% -32px);
-			display: flex;
-			justify-content: space-between;
-			height: 60px;
-			padding-top: 16px;
-			// position: fixed;
-
-			.header_message {
-				width: 15%;
-
-				image {
-					position: relative;
-					top: 5px;
-					left: 10px;
-					width: 25px;
-					height: 25px;
-				}
-			}
-
-			.header_title {
-				width: 70%;
-				position: relative;
-				left: 5px;
-
-				image {
-					width: 28px;
-					height: 22px;
-					position: relative;
-					top: 5px;
-				}
-
-				.titleName {
-					line-height: 20px;
-					font-size: 36upx;
-					font-family: FZZhengHeiS-M-GB;
-					font-weight: 600;
-					color: #fff;
-					position: relative;
-					top: 8px;
-				}
-			}
-
-			.header_more {
-				width: 15%;
-				position: relative;
-				top: 10px;
-				left: 10px;
-
-				image {
-					width: 25px;
-					height: 18px;
-				}
-			}
-		}
-
 		.faultType_main {
 			padding: 0 20px;
 

+ 128 - 0
pages/warn/faultWarnIndex.vue

@@ -0,0 +1,128 @@
+<template>
+	<view class="faultwarn">
+		<company-header></company-header>
+		<view class="falutWarn_main">
+			<view class="faultwarn_main_com flex" style="margin:10px 0" v-for="(item,index) in faultwarnData"
+				:key="index">
+				<view class="faultwarn_main_com_left">
+					<view class="faultwarnLeftTop">{{item.name}}</view>
+					<view class="faultwarnLeftBot">{{item.code}}</view>
+				</view>
+				<view class="faultwarn_main_com_right">
+					<view class="faultwarnRightTop" :style="getSty(item)">{{item.reson}}
+					</view>
+					<view class="faultwarnRightBot" :style="getSty(item)">{{item.date}}
+					</view>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import companyHeader from '../common/companyHeader.vue'
+	export default {
+		onLoad: function() {},
+		components: {
+			companyHeader
+		},
+		data() {
+			return {
+				faultwarnData: []
+			}
+		},
+		created() {
+			this.faultwarnData = [{
+					name: '乌力吉',
+					code: 'A25',
+					reson: '通讯站点诊断类故障',
+					date: '2017-01-06  13:34:34'
+				},
+				{
+					name: '宝龙山',
+					code: 'A25',
+					reson: '通讯站点诊断类故障通讯站点诊断类故障通 讯站点诊断类故障',
+					date: '2017-01-06  13:34:34'
+				},
+			]
+		},
+		methods: {
+			getSty(item) {
+				let sty = ''
+				if (item.reson.length > 16) {
+					sty = 'top: 5px'
+				} else {
+					sty = 'top: 15px'
+				}
+				return sty
+			},
+			changeMsg() {
+				this.$tab.navigateTo('/pages/common/messagePage')
+			},
+			changeStation() {
+				this.$tab.navigateTo('/pages/common/stationListPage')
+			},
+		}
+	}
+</script>
+
+<style lang="scss">
+	page {
+		background-color: #202246;
+	}
+
+	.faultwarn {
+		width: 100vw;
+		background: url('../../static/jnImage/loginPage/windBack.png'), url('../../static/jnImage/loginPage/backWav.png');
+		background-repeat: no-repeat, repeat;
+		background-size: 100% 260px, 100% 5px;
+
+		.falutWarn_main {
+			padding: 0 20px;
+
+			.faultwarn_main_com {
+				height: 60px;
+				background: #3F4572;
+				border-radius: 5px;
+
+				.faultwarn_main_com_left {
+					width: 20%;
+					background-color: #610900;
+					color: #fff;
+					border-radius: 5px 0 0 5px;
+					text-align: center;
+
+					.faultwarnLeftTop {
+						font-size: 30upx;
+						position: relative;
+						top: 15px;
+					}
+
+					.faultwarnLeftBot {
+						position: relative;
+						top: 20px;
+					}
+				}
+
+				.faultwarn_main_com_right {
+					padding-left: 10px;
+					width: 80%;
+
+					.faultwarnRightTop {
+						margin-bottom: 5px;
+						color: #6A98CB;
+						font-size: 30upx;
+						position: relative;
+						// top: 5px;
+					}
+
+					.faultwarnRightBot {
+						color: #9A9BA6;
+						position: relative;
+						// top: 5px;
+					}
+				}
+			}
+		}
+	}
+</style>

+ 6 - 72
pages/warn/index.vue

@@ -1,17 +1,6 @@
 <template>
 	<view class="warn">
-		<view class="home_header">
-			<view class="header_message" @click="changeMsg">
-				<image src="../../static/jnImage/indexPage/alarmSet.png"></image>
-			</view>
-			<view class="header_title">
-				<!-- <image src="../../static/jnImage/loginPage/logo.png" mode=""></image> -->
-				<text class="titleName">发电场站生产实时运营管理平台</text>
-			</view>
-			<view class="header_more" @click="changeStation">
-				<image src="../../static/jnImage/indexPage/moreNew.png"></image>
-			</view>
-		</view>
+		<company-header></company-header>
 		<view class="warn_main">
 			<view class="warn_main_one">
 				<view class="warn_main_one_top flex justify-between">
@@ -107,8 +96,12 @@
 </template>
 
 <script>
+	import companyHeader from '../common/companyHeader.vue'
 	export default {
 		onLoad: function() {},
+		components: {
+			companyHeader
+		},
 		data() {
 			return {
 				warnData: []
@@ -163,12 +156,7 @@
 			]
 		},
 		methods: {
-			changeMsg() {
-				this.$tab.navigateTo('/pages/common/messagePage')
-			},
-			changeStation() {
-				this.$tab.navigateTo('/pages/common/stationListPage')
-			},
+
 		}
 	}
 </script>
@@ -184,61 +172,7 @@
 		background-repeat: no-repeat, repeat;
 		background-size: 100% 260px, 100% 5px;
 
-		.home_header {
-			width: calc(100% -32px);
-			display: flex;
-			justify-content: space-between;
-			height: 60px;
-			padding-top: 16px;
-			// position: fixed;
-
-			.header_message {
-				width: 15%;
-
-				image {
-					position: relative;
-					top: 5px;
-					left: 10px;
-					width: 25px;
-					height: 25px;
-				}
-			}
-
-			.header_title {
-				width: 70%;
-				position: relative;
-				left: 5px;
 
-				image {
-					width: 28px;
-					height: 22px;
-					position: relative;
-					top: 5px;
-				}
-
-				.titleName {
-					line-height: 20px;
-					font-size: 36upx;
-					font-family: FZZhengHeiS-M-GB;
-					font-weight: 600;
-					color: #fff;
-					position: relative;
-					top: 8px;
-				}
-			}
-
-			.header_more {
-				width: 15%;
-				position: relative;
-				top: 10px;
-				left: 10px;
-
-				image {
-					width: 25px;
-					height: 18px;
-				}
-			}
-		}
 
 		.warn_main {
 			padding: 0 20px;

+ 60 - 316
pages/warn/stationIndex.vue

@@ -1,173 +1,60 @@
 <template>
-	<view class="warn">
-		<view class="box-bg">
-			<uni-nav-bar :fixed="true" dark left-icon="left" background-color='#202246' :title="stationName"
-				@clickLeft="back" />
-		</view>
-		<view class="warn_main">
-			<view class="warn_main_one">
-				<view class="warn_main_one_top flex justify-between">
-					<view class="warn_main_one_top_left">
-						<image src="../../static/jnImage/powerPage/warnOne.png" mode=""></image>
-						<text>离线</text>
+	<view class="stationFaultwarn">
+		<company-header></company-header>
+		<view class="falutWarn_main">
+			<view class="faultwarn_main_com flex" style="margin:10px 0" v-for="(item,index) in faultwarnData"
+				:key="index">
+				<view class="faultwarn_main_com_left">
+					<view class="faultwarnLeftTop">{{item.name}}</view>
+					<view class="faultwarnLeftBot">{{item.code}}</view>
+				</view>
+				<view class="faultwarn_main_com_right">
+					<view class="faultwarnRightTop" :style="getSty(item)">{{item.reson}}
 					</view>
-					<view class="warn_main_one_top_right">
-						<text>88</text>
+					<view class="faultwarnRightBot" :style="getSty(item)">{{item.date}}
 					</view>
 				</view>
-				<view class="warn_main_one_bot">
-					<uni-row class="warn_data_row">
-						<uni-col :span="12" v-for="(item,index) in warnData" :key="index">
-							<view class="warn_data_col flex">
-								<view class="warn_data_col_left">
-									<text>{{item.name}}</text>
-								</view>
-								<view class="warn_data_col_right flex justify-between">
-									<text>{{item.inPower}}</text>
-									<text>台</text>
-								</view>
-							</view>
-						</uni-col>
-					</uni-row>
-				</view>
-			</view>
-			<view class="warn_main_com flex justify-between" style="margin:10px 0">
-				<view class="warn_main_com_left">
-					<image src="../../static/jnImage/powerPage/warnTwo.png" mode=""></image>
-					<text>实时故障预警</text>
-				</view>
-				<view class="warn_main_com_right" style="background-color: #F14E51;">
-					<text>88</text>
-				</view>
-			</view>
-			<view class="warn_main_com flex justify-between" style="margin:1px 0">
-				<view class="warn_main_com_left">
-					<image src="../../static/jnImage/powerPage/warnThree.png" mode=""></image>
-					<text>阈值预警</text>
-				</view>
-				<view class="warn_main_com_right" style="background-color: #1A41AD;">
-					<text>88</text>
-				</view>
-			</view>
-			<view class="warn_main_com flex justify-between" style="margin:1px 0">
-				<view class="warn_main_com_left">
-					<image src="../../static/jnImage/powerPage/warnFour.png" mode=""></image>
-					<text>温升预警</text>
-				</view>
-				<view class="warn_main_com_right" style="background-color: #3963AB;">
-					<text>88</text>
-				</view>
-			</view>
-			<view class="warn_main_com flex justify-between" style="margin:1px 0 10px 0">
-				<view class="warn_main_com_left">
-					<image src="../../static/jnImage/powerPage/warnFive.png" mode=""></image>
-					<text>差值预警</text>
-				</view>
-				<view class="warn_main_com_right" style="background-color: #4E8CC8;">
-					<text>88</text>
-				</view>
-			</view>
-			<view class="warn_main_com flex justify-between" style="margin:1px 0">
-				<view class="warn_main_com_left">
-					<image src="../../static/jnImage/powerPage/warnSix.png" mode=""></image>
-					<text>风场平均风速达标未启机预警</text>
-				</view>
-				<view class="warn_main_com_right" style="background-color: #208A73;">
-					<text>88</text>
-				</view>
-			</view>
-			<view class="warn_main_com flex justify-between" style="margin:1px 0">
-				<view class="warn_main_com_left">
-					<image src="../../static/jnImage/powerPage/warnSeven.png" mode=""></image>
-					<text>风机平均风速达标未启机预警</text>
-				</view>
-				<view class="warn_main_com_right" style="background-color: #5EAC88;">
-					<text>88</text>
-				</view>
-			</view>
-			<view class="warn_main_com flex justify-between" style="margin:1px 0">
-				<view class="warn_main_com_left">
-					<image src="../../static/jnImage/powerPage/warnEight.png" mode=""></image>
-					<text>设备更换周期提醒</text>
-				</view>
-				<view class="warn_main_com_right" style="background-color: #43B99F;">
-					<text>88</text>
-				</view>
 			</view>
 		</view>
-		<station-bar ref="stationBar"></station-bar>
 	</view>
 </template>
 
 <script>
-	import stationBar from '../common/stationTab.vue'
+	import companyHeader from '../common/companyHeader.vue'
 	export default {
-		onLoad: function() {
-			this.stationName = uni.getStorageSync('stationName')
-		},
+		onLoad: function() {},
 		components: {
-			stationBar
+			companyHeader
 		},
 		data() {
 			return {
-				stationName: '',
-				warnData: []
+				faultwarnData: []
 			}
 		},
 		created() {
-			this.warnData = [{
-					inPower: 961,
-					allPower: 1865,
-					name: '宝龙山'
-				},
-				{
-					inPower: 852,
-					allPower: 1865,
-					name: '乌力吉'
-				},
-				{
-					inPower: 696,
-					allPower: 1865,
-					name: '浩日格吐'
-				},
-				{
-					inPower: 527,
-					allPower: 1865,
-					name: '开鲁'
-				},
-				{
-					inPower: 935,
-					allPower: 1865,
-					name: '景观'
+			this.faultwarnData = [{
+					name: '乌力吉',
+					code: 'A25',
+					reson: '通讯站点诊断类故障',
+					date: '2017-01-06  13:34:34'
 				},
 				{
-					inPower: 1022,
-					allPower: 1865,
-					name: '高力板'
+					name: '宝龙山',
+					code: 'A25',
+					reson: '通讯站点诊断类故障通讯站点诊断类故障通 讯站点诊断类故障',
+					date: '2017-01-06  13:34:34'
 				},
-				{
-					inPower: 752,
-					allPower: 1865,
-					name: '书声'
-				},
-				{
-					inPower: 1520,
-					allPower: 1865,
-					name: '宝力根花'
-				},
-				{
-					inPower: 365.6,
-					allPower: 1865,
-					name: '振发'
-				}
 			]
 		},
-		mounted() {
-			this.$refs.stationBar.showTab = '故障预警'
-		},
 		methods: {
-			back() {
-				this.$tab.switchTab('/pages/warn/index')
+			getSty(item) {
+				let sty = ''
+				if (item.reson.length > 16) {
+					sty = 'top: 5px'
+				} else {
+					sty = 'top: 15px'
+				}
+				return sty
 			},
 			changeMsg() {
 				this.$tab.navigateTo('/pages/common/messagePage')
@@ -184,201 +71,58 @@
 		background-color: #202246;
 	}
 
-	.warn {
+	.stationFaultwarn {
 		width: 100vw;
 		background: url('../../static/jnImage/loginPage/windBack.png'), url('../../static/jnImage/loginPage/backWav.png');
 		background-repeat: no-repeat, repeat;
 		background-size: 100% 260px, 100% 5px;
 
-		.home_header {
-			width: calc(100% -32px);
-			display: flex;
-			justify-content: space-between;
-			height: 60px;
-			padding-top: 16px;
-			// position: fixed;
-
-			.header_message {
-				width: 15%;
-
-				image {
-					position: relative;
-					top: 5px;
-					left: 10px;
-					width: 25px;
-					height: 25px;
-				}
-			}
-
-			.header_title {
-				width: 70%;
-				position: relative;
-				left: 5px;
-
-				image {
-					width: 28px;
-					height: 22px;
-					position: relative;
-					top: 5px;
-				}
-
-				.titleName {
-					line-height: 20px;
-					font-size: 36upx;
-					font-family: FZZhengHeiS-M-GB;
-					font-weight: 600;
-					color: #fff;
-					position: relative;
-					top: 8px;
-				}
-			}
-
-			.header_more {
-				width: 15%;
-				position: relative;
-				top: 10px;
-				left: 10px;
-
-				image {
-					width: 25px;
-					height: 18px;
-				}
-			}
-		}
-
-		.warn_main {
+		.falutWarn_main {
 			padding: 0 20px;
 
-			.warn_main_one {
-				padding: 5px 10px;
-				background-color: #3F4572;
+			.faultwarn_main_com {
+				height: 60px;
+				background: #3F4572;
 				border-radius: 5px;
 
-				.warn_main_one_top {
-					.warn_main_one_top_left {
-						image {
-							width: 30px;
-							height: 30px;
-							position: relative;
-							top: 1px;
-							margin-right: 5px;
-						}
-
-						text {
-							font-size: 30upx;
-							color: #9A9BA6;
-							position: relative;
-							top: -10px;
-						}
-					}
+				.faultwarn_main_com_left {
+					width: 20%;
+					background-color: #610900;
+					color: #fff;
+					border-radius: 5px 0 0 5px;
+					text-align: center;
 
-					.warn_main_one_top_right {
-						width: 20px;
-						height: 20px;
-						background-color: #686868;
-						text-align: center;
-						border-radius: 10px;
+					.faultwarnLeftTop {
+						font-size: 30upx;
 						position: relative;
-						top: 6px;
-
-						text {
-							color: #fff;
-							position: relative;
-							top: 4px;
-						}
+						top: 15px;
 					}
 
-				}
-
-				.warn_main_one_bot {
-					margin-top: 5px;
-
-					.warn_data_row {
-						.warn_data_col {
-							width: 98%;
-							height: 20px;
-							margin-bottom: 5px;
-							background: #2E336D;
-							border-radius: 5px;
-
-							.warn_data_col_left {
-								width: 50%;
-								height: 20px;
-								color: #fff;
-								font-size: 30upx;
-								background: #0B143E;
-								border-radius: 5px;
-
-								text {
-									margin-left: 5px;
-								}
-							}
-
-							.warn_data_col_right {
-								height: 20px;
-								color: #fff;
-								font-size: 32upx;
-								width: 48%;
-
-								text:nth-of-type(1) {
-									margin-left: 5px;
-									width: 50%;
-									font-size: 32upx;
-									color: #fff;
-									position: relative;
-									top: 3px;
-								}
-
-								text:nth-of-type(2) {
-									font-size: 22upx;
-									color: #96B5D5;
-									position: relative;
-									top: 3px;
-								}
-							}
-						}
+					.faultwarnLeftBot {
+						position: relative;
+						top: 20px;
 					}
 				}
-			}
 
-			.warn_main_com {
-				padding: 5px 10px;
-				background-color: #3F4572;
-				border-radius: 5px;
+				.faultwarn_main_com_right {
+					padding-left: 10px;
+					width: 80%;
 
-				.warn_main_com_left {
-					image {
-						width: 30px;
-						height: 30px;
-						position: relative;
-						top: 1px;
-						margin-right: 5px;
-					}
-
-					text {
+					.faultwarnRightTop {
+						margin-bottom: 5px;
+						color: #6A98CB;
 						font-size: 30upx;
-						color: #9A9BA6;
 						position: relative;
-						top: -10px;
+						// top: 5px;
 					}
-				}
-
-				.warn_main_com_right {
-					width: 20px;
-					height: 20px;
-					text-align: center;
-					border-radius: 10px;
-					position: relative;
-					top: 6px;
 
-					text {
-						color: #fff;
+					.faultwarnRightBot {
+						color: #9A9BA6;
 						position: relative;
-						top: 4px;
+						// top: 5px;
 					}
 				}
 			}
 		}
-
 	}
 </style>

+ 84 - 68
utils/request.js

@@ -1,76 +1,92 @@
 import store from '@/store'
-import config from '@/config'
-import { getAccessToken } from '@/utils/auth'
+import configs from '@/config'
+import {
+	getAccessToken
+} from '@/utils/auth'
 import errorCode from '@/utils/errorCode'
-import { toast, showConfirm, tansParams } from '@/utils/common'
+import {
+	toast,
+	showConfirm,
+	tansParams
+} from '@/utils/common'
 
 let timeout = 10000
-const baseUrl = config.baseUrl + config.baseApi;
+const baseUrls = configs.baseUrl;
 
 const request = config => {
-  // 是否需要设置 token
-  const isToken = (config.headers || {}).isToken === false
-  config.header = config.header || {}
-  if (getAccessToken() && !isToken) {
-    config.header['Authorization'] = 'Bearer ' + getAccessToken()
-  }
-  // 设置租户 TODO 芋艿:强制 1 先
-  config.header['tenant-id'] = '1';
-  // get请求映射params参数
-  if (config.params) {
-    let url = config.url + '?' + tansParams(config.params)
-    url = url.slice(0, -1)
-    config.url = url
-  }
-  return new Promise((resolve, reject) => {
-    uni.request({
-        method: config.method || 'get',
-        timeout: config.timeout ||  timeout,
-        url: config.baseUrl || baseUrl + config.url,
-        data: config.data,
-        // header: config.header,
-        header: config.header,
-        dataType: 'json'
-      }).then(response => {
-        let [error, res] = response
-        if (error) {
-          toast('后端接口连接异常')
-          reject('后端接口连接异常')
-          return
-        }
-        const code = res.data.code || 200
-        const msg = errorCode[code] || res.data.msg || errorCode['default']
-        if (code === 401) {
-          showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
-            if (res.confirm) {
-              store.dispatch('LogOut').then(res => {
-                uni.reLaunch({ url: '/pages/login' })
-              })
-            }
-          })
-          reject('无效的会话,或者会话已过期,请重新登录。')
-        } else if (code === 500) {
-          toast(msg)
-          reject('500')
-        } else if (code !== 200) {
-          toast(msg)
-          reject(code)
-        }
-        resolve(res.data)
-      })
-      .catch(error => {
-        let { message } = error
-        if (message === 'Network Error') {
-          message = '后端接口连接异常'
-        } else if (message.includes('timeout')) {
-          message = '系统接口请求超时'
-        } else if (message.includes('Request failed with status code')) {
-          message = '系统接口' + message.substr(message.length - 3) + '异常'
-        }
-        toast(message)
-        reject(error)
-      })
-  })
+	// 是否需要设置 token
+	const isToken = (config.headers || {}).isToken === false
+	config.header = config.header || {}
+	if (getAccessToken() && !isToken) {
+		config.header['Authorization'] = 'Bearer ' + getAccessToken()
+	}
+	// 设置租户 TODO 芋艿:强制 1 先
+	config.header['tenant-id'] = '1';
+	if (config.baseUrl) {
+		config.url = config.baseUrl + config.url
+	} else {
+		config.url = baseUrls + config.url
+	}
+	// get请求映射params参数
+	if (config.params) {
+		let url = config.url + '?' + tansParams(config.params)
+		url = url.slice(0, -1)
+		config.url = url
+	}
+
+	return new Promise((resolve, reject) => {
+		uni.request({
+				method: config.method || 'get',
+				timeout: config.timeout || timeout,
+				url: config.url,
+				data: config.data,
+				// header: config.header,
+				header: config.header,
+				dataType: 'json'
+			}).then(response => {
+				let [error, res] = response
+				if (error) {
+					toast('后端接口连接异常')
+					reject('后端接口连接异常')
+					return
+				}
+				const code = res.data.code || 200
+				const msg = errorCode[code] || res.data.msg || errorCode['default']
+				if (code === 401) {
+					showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
+						if (res.confirm) {
+							store.dispatch('LogOut').then(res => {
+								uni.reLaunch({
+									url: '/pages/login'
+								})
+							})
+						}
+					})
+					reject('无效的会话,或者会话已过期,请重新登录。')
+				} else if (code === 500) {
+					toast(msg)
+					reject('500')
+				} else if (code !== 200) {
+					toast(msg)
+					reject(code)
+				}
+				resolve(res.data)
+			})
+			.catch(error => {
+				let {
+					message
+				} = error
+				if (message === 'Network Error') {
+					message = '后端接口连接异常'
+				} else if (message.includes('timeout')) {
+					message = '系统接口请求超时'
+				} else if (message.includes('Request failed with status code')) {
+					message = '系统接口' + message.substr(message.length - 3) + '异常'
+				}
+				toast(message)
+				reject(error)
+			})
+	})
 }
 
-export default request
+export default request