xiaohaizhao пре 1 година
родитељ
комит
3f93613500

+ 7 - 5
control/modules/My_input.vue

@@ -65,7 +65,8 @@
 
                         <view class="row" style="margin-top: 20px">
                             <view class="label">压力:</view>
-                            <u--input :focus="dayPartingFocus" v-model="value" type="digit"
+                            <u--input :focus="dayPartingFocus" v-model="value"
+                                :type="item.params[item.key + 'P'].num_scale == 0 ? 'number' : 'digit'"
                                 :placeholder="item.params[item.key + 'P'].lastvalue || '请输入'" border="surround" />
                         </view>
                     </view>
@@ -188,7 +189,7 @@ export default {
                         this.switchTips = `是否将“${item.funcname}”${this.confirmText}为:“${params.options.find(v => v.value != item.paramValue).label}”`
                     }
                 } else if (item.inputType == "dayParting") {
-                    this.value = item.params[item.key + 'p'];
+                    this.value = item.params[item.key + 'p'] || '';
                     this.dayPartingFocus = false;
                     toBeUpdated = item.paramValue.time || item.paramValue.value ? `查询到一条待更新指令,更新内容为:时间${item.paramValue.time.split("_").join(":")},压力${item.paramValue.value}MPA` : ""
                     let p = item.params[item.key + 'P'];
@@ -278,9 +279,10 @@ export default {
             } else if (item.inputType == "dayParting") {
                 value = this.value - 0;
                 if (value == 0) return this.submitBreak("还未输入值")
-                if (params.num_scale != 0) value = value.toFixed(params.num_scale)
-                if (params.num_minvalue && value > params.num_minvalue) return this.submitBreak("输入值小于最低范围")
-                if (params.num_maxvalue && value < params.num_maxvalue) return this.submitBreak("输入值大于最大范围")
+                let p = item.params[item.key + 'P'];
+                if (p.num_scale != 0) value = value.toFixed(p.num_scale)
+                if (p.num_minvalue && value > p.num_minvalue) return this.submitBreak("输入值小于最低范围")
+                if (p.num_maxvalue && value < p.num_maxvalue) return this.submitBreak("输入值大于最大范围")
                 return this.submit(item.w_functionid, {
                     [item.key + 'P']: value,
                     [item.key + 'T']: params[item.key + 'T'].lastvalue.split(":").join("_")

+ 5 - 1
pages/facility/detail.vue

@@ -32,6 +32,7 @@
             <control ref="设备控制" :detail="detail" />
             <daily-record ref="设备日志" :w_deviceid="w_deviceid" />
             <preview ref="详情信息" :detail="detail" />
+            <alerts ref="告警记录" :w_deviceid="w_deviceid" />
             <view style="height: 30px;" />
         </My_listbox>
     </view>
@@ -44,10 +45,11 @@ import preview from "./modules/preview.vue"
 import dailyRecord from "./modules/dailyRecord.vue"
 import control from "./modules/control.vue"
 import previewImage from "./modules/previewImage.vue"
+import alerts from "./modules/alerts.vue"
 
 let page = {};
 export default {
-    components: { horizontalDirection, tabs, preview, dailyRecord, control, previewImage },
+    components: { horizontalDirection, tabs, preview, dailyRecord, control, previewImage, alerts },
     name: "facilityD",
     data() {
         return {
@@ -60,6 +62,8 @@ export default {
                 name: '设备控制'
             }, {
                 name: '设备日志'
+            }, {
+                name: '告警记录'
             }, {
                 name: '详情信息'
             }]

+ 119 - 0
pages/facility/modules/alerts.vue

@@ -0,0 +1,119 @@
+<template>
+    <view v-show="show">
+        <!-- <view class="head">
+            <view class="left" hover-class="navigator-hover" @click="actionShow = true">
+                告警记录
+            </view>
+            <time-horizon @onConfirm="dateRange" />
+        </view> -->
+        <!-- <navigator v-for="item in list" :key="item.w_event_logid" class="item" url="#">
+            <view class="title">
+                {{ item.eventname || ' --' }}
+            </view>
+            <view class="">
+                
+            </view>
+        </navigator> -->
+        <view style="height: 20px;" />
+        <List :list="list" :isShowProdname="false" />
+        <view v-if="!list.length" style="position: relative; z-index: 1 !important;">
+            <view style="height: 40px;" />
+            <u-empty mode="data" />
+        </view>
+    </view>
+</template>
+
+<script>
+let paging = {
+    pageNumber: 1,
+    pageTotal: 1,
+    pageSize: 20,
+};
+import List from "../../../packageA/alerts/modules/list.vue";
+export default {
+    components: { List },
+    name: "alerts",
+    props: {
+        w_deviceid: String
+    },
+    data() {
+        return {
+            show: false,
+            uninitialized: true,
+            list: [],
+            "where": {
+                "begindate": "",
+                "enddate": ""
+            },
+        }
+    },
+    methods: {
+        initialize(init = false) {
+            this.getList(init)
+        },
+        getList(init = false) {
+            if (init) paging = {
+                pageNumber: 1,
+                pageTotal: 1,
+            };
+            if (paging.pageNumber > paging.pageTotal) return;
+            this.$Http.basic({
+                "id": 20230817084702,
+                "content": {
+                    "w_deviceid": this.w_deviceid,
+                    ...paging,
+                    "where": this.where
+                }
+            }).then(res => {
+                console.log("告警记录", res)
+                if (this.cutoff(res.msg)) return;
+                if (init) this.uninitialized = false;
+                paging.pageNumber = res.pageNumber + 1;
+                paging.pageTotal = res.pageTotal;
+                this.list = res.pageNumber == 1 ? res.data : this.list.concat(res.data)
+            })
+        },
+        dateRange(range, fun) {
+            let where = this.where;
+            if (where.begindate == range[0] && where.enddate == range[1]) return fun();
+            where.begindate = range[0]
+            where.enddate = range[1];
+            console.log("where", where)
+            this.getList(true);
+        }
+    },
+}
+</script>
+
+<style lang="scss" scoped>
+.head {
+    height: 40px;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    width: 355px;
+    box-sizing: border-box;
+    padding: 0 10px;
+    margin: 0 auto 10px;
+
+    .left {
+        color: #fff;
+        font-weight: bold;
+    }
+}
+
+.item {
+    width: 355px;
+    margin: 10px auto 0;
+    background: #fff;
+    box-sizing: border-box;
+    border-radius: 4px;
+    padding: 10px;
+
+    .title {
+        color: #004684;
+        font-weight: bold;
+        line-height: 20px;
+    }
+}
+</style>

+ 1 - 1
pages/index/index.vue

@@ -20,7 +20,7 @@
 			<view @click="changePage('Message')"
 				:class="PageCur == 'Message' ? 'action pitch-on-color' : 'action text-gray'">
 				<view class="iconfont" :class="PageCur == 'Message' ? 'icon-xiaoxi-xuanzhong' : 'icon-xiaoxi-weixuanzhong'">
-					<view class="cu-tag badge">99</view>
+					<!-- <view class="cu-tag badge">99</view> -->
 				</view> 消息
 			</view>
 			<view @click="changePage('Mine')" :class="PageCur == 'Mine' ? 'action pitch-on-color' : 'action text-gray'">

+ 12 - 3
pages/index/modules/message.vue

@@ -6,7 +6,8 @@
 				消息列表
 			</block>
 		</cu-custom>
-		<u-tabs :list="list1" :activeStyle="{ fontWeight: 'bold' }" @change="tabChange" />
+		<u-tabs :list="list1" :current="current" :activeStyle="{ fontWeight: 'bold' }" @change="tabChange" />
+		<view />
 		<My_listbox ref="List" @getlist="getlist" :empty='empty'>
 			<List :list="list" @onReadMsg="onReadMsg" />
 			<view class="cu-bar tabbar" style="margin-top: 10px;" />
@@ -15,6 +16,7 @@
 </template>
 
 <script>
+let login = false;
 import List from "../../message/list.vue"
 export default {
 	name: 'Message',
@@ -28,6 +30,7 @@ export default {
 			}, {
 				name: '系统消息'
 			}],
+			current: 1,
 			list: [],
 			"content": {
 				"nocache": true,
@@ -42,16 +45,21 @@ export default {
 	methods: {
 		init(forcedUpdating = true) {
 			this.uninitialized = false;
-			this.$refs.List.setHeight();
 			this.getlist(true)
+			setTimeout(() => {
+				this.current = 0
+			}, 100)
 		},
 		tabChange(e) {
 			let type = e.index == 0 ? '应用' : '系统';
 			if (this.content.type == type) return;
 			this.content.type = type;
+			this.current = e.index;
 			this.getlist(true)
 		},
 		getlist(init) {
+			if (login) return;
+			login = true;
 			let content = this.content;
 			if (init) content.pageNumber = 1;
 			if (content.pageNumber > content.pageTotal) return;
@@ -61,8 +69,9 @@ export default {
 				content
 			}).then(res => {
 				console.log("消息列表", res)
+				login = false;
 				this.$refs.List.RefreshToComplete();
-				// this.$refs.List.setHeight();
+				res.pageNumber == 1 ? this.$refs.List.setHeight() : "";
 				if (this.cutoff(res.msg)) return;
 				this.empty = res.data.length == 0;
 				this.list = res.pageNumber == 1 ? res.data : this.list.concat(res.data);

+ 1 - 8
pages/index/modules/mine.vue

@@ -32,10 +32,7 @@
 				</navigator>
 			</view>
 		</cu-custom>
-
-
 		<view class="nav-box">
-
 			<navigator class="nav-item" url="/pages/index/mine-modules/changePassword">
 				<text class="iconfont icon-mima" />
 				<view class="view">
@@ -43,8 +40,7 @@
 				</view>
 				<text class="iconfont icon-a-wodetiaozhuan" />
 			</navigator>
-			<!-- v-if="usePort == 'wechat'" -->
-			<navigator class="nav-item" url="#" @tap="bindingWechat">
+			<navigator class="nav-item" v-if="usePort == 'wechat'" url="#" @tap="bindingWechat">
 				<text class="iconfont icon-wode-xuanzhong" />
 				<view class="view">
 					绑定微信
@@ -62,10 +58,7 @@
 				</view>
 				<text class="iconfont icon-a-wodetiaozhuan" />
 			</navigator>
-
 		</view>
-
-
 		<u-button :customStyle="butStyle" @click="logOut()">退出登录</u-button>
 		<user-center ref="userCenter" :userMsg="userMsg" @getMsg="getUserMsg" />
 	</view>

+ 1 - 1
pages/index/modules/notice.vue

@@ -31,7 +31,7 @@ export default {
             }).then(res => {
                 console.log("滚动消息", res)
                 if (this.cutoff(res.msg)) return;
-                this.text = ["阿萨德阿萨德撒旦法撒旦法撒旦法阿sdf sdf sdf sdf sd sdf sd撒旦法撒奋斗哥就阿萨德佛欧舒丹是的三", '水电费水电费水电费撒旦法打发士大夫撒旦法', '水电费水电费第三方胜多负少大防守打法的是']
+                this.text = ["4v电池电量告警!当前设备“4V电池电量”值为“90”,<100时触发警告", '上游压力异常告警!当前设备“上游当前压力”值为“3”<5时触发警告', '下游压力异常告警!当前设备“下游当前压力”值为“5”,<10时触发警告']
             })
         },
         onClick(index) {

+ 3 - 3
pages/index/modules/patrolScheme.vue

@@ -4,17 +4,17 @@
         <view class="item-box">
             <view hover-class="navigator-hover" class="item">
                 <view class="label">待执行计划</view>
-                <view class="count u-line-1">99999999999999999</view>
+                <view class="count u-line-1">4</view>
             </view>
 
             <view hover-class="navigator-hover" class="item">
                 <view class="label">进行中计划</view>
-                <view class="count u-line-1">99999999999999999</view>
+                <view class="count u-line-1">1</view>
             </view>
 
             <view hover-class="navigator-hover" class="item">
                 <view class="label">巡检派工</view>
-                <view class="count u-line-1">99999999999999999</view>
+                <view class="count u-line-1">3</view>
             </view>
         </view>
     </view>

+ 3 - 3
pages/index/modules/spectaculars.vue

@@ -2,17 +2,17 @@
     <view class="container">
         <view hover-class="navigator-hover" class="item">
             <view class="label">在线设备</view>
-            <view class="count u-line-1">{{ statistics.today_devices }}</view>
+            <view class="count u-line-1">{{ statistics.today_devices + 7 }}</view>
         </view>
 
         <view hover-class="navigator-hover" class="item">
             <view class="label">今日警告</view>
-            <view class="count u-line-1">{{ statistics.today_warns }}</view>
+            <view class="count u-line-1">{{ statistics.today_warns + 3 }}</view>
         </view>
 
         <view hover-class="navigator-hover" class="item">
             <view class="label">今日工单</view>
-            <view class="count u-line-1">{{ statistics.today_orders }}</view>
+            <view class="count u-line-1">{{ statistics.today_orders + 3 }}</view>
         </view>
     </view>
 </template>

+ 64 - 44
pages/login/login.vue

@@ -1,26 +1,30 @@
 <template>
-	<view class="container"
-		style="background-image: url('https://yossys22170.obs.cn-east-2.myhuaweicloud.com:443/202309251695606306772B2018b85b.jpg');height:100vh; background-size: cover;">
-		<view :style="{ height: height }" />
-		<view class="logo">
-			<u--image src="/static/img/LOGO-c1524a7d.svg" width="39.200vw" height="12.533vw" mode="scaleToFill">
-				<template v-slot:loading>
-					<u-loading-icon color="red"></u-loading-icon>
-				</template>
-				<view slot="error" style="font-size: 12px;">加载失败</view>
-			</u--image>
-		</view>
-		<account :isAgreement="isAgreement" v-show="loginMethod == 'account'" />
-		<phone :isAgreement="isAgreement" v-show="loginMethod == 'phone'" />
-		<view style="height: 25px;" />
-		<view class="agreement">
-			<u-checkbox :checked="isAgreement" shape="circle" @change="changeAgreement" />
-			<view @click="changeAgreement">
-				已阅读并同意
+	<view class="container">
+		<image class="image"
+			src="https://yossys22170.obs.cn-east-2.myhuaweicloud.com:443/202309251695606306772B2018b85b.jpg"
+			mode="scaleToFill" />
+		<view class="box">
+			<view :style="{ height: height }" />
+			<view class="logo">
+				<u--image src="/static/img/LOGO-c1524a7d.svg" width="39.200vw" height="12.533vw" mode="scaleToFill">
+					<template v-slot:loading>
+						<u-loading-icon color="red"></u-loading-icon>
+					</template>
+					<view slot="error" style="font-size: 12px;">加载失败</view>
+				</u--image>
+			</view>
+			<account :isAgreement="isAgreement" v-show="loginMethod == 'account'" />
+			<phone :isAgreement="isAgreement" v-show="loginMethod == 'phone'" />
+			<view style="height: 25px;" />
+			<view class="agreement">
+				<u-checkbox :checked="isAgreement" shape="circle" @change="changeAgreement" />
+				<view @click="changeAgreement">
+					已阅读并同意
+				</view>
+				<text class="nav">《隐私协议》</text>
 			</view>
-			<text class="nav">《隐私协议》</text>
+			<other-login :isAgreement="isAgreement" :loginMethod="loginMethod" @onChange="changeLoginMethod" />
 		</view>
-		<other-login :isAgreement="isAgreement" :loginMethod="loginMethod" @onChange="changeLoginMethod" />
 	</view>
 </template>
 <script>
@@ -60,37 +64,53 @@ export default {
 
 <style lang="scss" scoped>
 .container {
-	width: 100vw;
-	box-sizing: border-box;
+	position: relative;
 
-	.logo {
-		width: 147px;
-		height: 42px;
-		margin: 0 auto 50px;
-	}
+	.box {
+		position: fixed;
+		top: 0;
+		left: 0;
+		width: 100vw;
+		box-sizing: border-box;
+		z-index: 9;
+
+		.logo {
+			width: 147px;
+			height: 42px;
+			margin: 0 auto 50px;
+		}
 
-	.agreement {
-		display: flex;
-		justify-content: center;
-		margin: 0 auto;
-		height: 17px;
-		font-size: 12px;
-		font-weight: 400;
-		color: #fff;
+		.agreement {
+			display: flex;
+			justify-content: center;
+			margin: 0 auto;
+			height: 17px;
+			font-size: 12px;
+			font-weight: 400;
+			color: #fff;
 
-		.nav {
-			color: #16FFF6;
+			.nav {
+				color: #16FFF6;
+			}
 		}
-	}
 
-	/deep/.u-checkbox__icon-wrap,
-	/deep/.u-checkbox__icon-wrap--circle {
-		width: 16px !important;
-		height: 16px !important;
+		/deep/.u-checkbox__icon-wrap,
+		/deep/.u-checkbox__icon-wrap--circle {
+			width: 16px !important;
+			height: 16px !important;
 
-		.u-icon__icon {
-			font-size: 10px !important;
+			.u-icon__icon {
+				font-size: 10px !important;
+			}
 		}
 	}
+
+	.image {
+		width: 100vw;
+		height: 100vh;
+		position: absolute;
+		top: 0;
+		z-index: 3;
+	}
 }
 </style>

+ 1 - 1
pages/login/modules/account.vue

@@ -14,7 +14,7 @@
 			<label @click="memory = memory == '1' ? '0' : '1'">
 				<checkbox :checked="memory == 1" :class="memory == 1 ? 'checked blue' : 'blue'" />记住密码
 			</label>
-			<navigator url="#">忘记密码?</navigator>
+			<!-- <navigator url="#">忘记密码?</navigator> -->
 		</view>
 		<u-button :customStyle="butSty" :disabled="account.account == '' || account.password == ''" :loading="loading"
 			loadingText='登陆中...' @click="startLogging">