123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- <template>
- <view>
- <view class="content">
- <view class="section" v-if="data">
- <view>
- <u--text class="title" text="名称"></u--text>
- <view class="title">{{data.itemReadName}}</view>
- </view>
- <view class="title">
- <u--text class="title" text="类型"></u--text>
- <view class="title">{{data.alarmType}}</view>
- </view>
- <view>
- <u--text class="title" text="时间"></u--text>
- <view class="title">{{data.alarmTime}}</view>
- </view>
- <view v-if="data.itemId>0">
- <u--text class="title" text="报警值"></u--text>
- <view class="title">{{data.alarmValue}}</view>
- </view>
- <view>
- <u--text class="title" text="报警描述"></u--text>
- <view class="title">{{data.alarmText}}</view>
- </view>
- <view>
- <u-button type="primary" size="small" class="cl" @click="queryChart" v-if="data.itemId>0 && showbtn" >查看点位实时曲线</u-button>
- </view>
- <view v-if="showChart">
- <web-view :src="src" style="top:300px;width:100%;height: 500px;"></web-view>
- </view>
-
- </view>
- </view>
-
-
- </view>
- </template>
- <script>
- import {
- getToken
- } from "@/utils/auth.js"
- import {
- getDayTime,
- timeToDate,
- nowDate
- } from '@/utils/date.js'
- export default {
- data() {
- return {
- src:'',
- dataStr: null,
- showChart:false,
- showbtn:true,
- data:{
-
- }
- }
- },
- onLoad(options) {
- this.dataStr = options.data
- this.showData()
- },
- methods: {
- showData(){
- this.data = JSON.parse(this.dataStr);
- console.log(this.data)
- },
- queryChart(){
- let idList = []
- idList.push(this.data.itemId)
- let id_List = idList.map(temp=>temp).join(',');
- //当前时间一分钟的实时曲线
- let startTime = timeToDate(new Date().getTime()-60000);
- let endTime = nowDate()
- this.src =
- `/static/webview/datachart-wv.html?idList=${id_List}&startTime=${startTime}&endTime=${endTime}`
- this.showChart = true
- this.showbtn = false
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .content {
- padding: 25rpx;
- .section {
- position: relative;
- text-align: left;
- .title {
- font-size: 28rpx;
- margin-bottom: 20rpx;
- word-wrap: break-word
- }
- .time {
- font-size: 28rpx;
- color: #9fa297;
- }
- .cont {
- font-size:28rpx;
- margin-top: 60rpx;
- text-align: left;
- word-wrap: break-word
- }
- .empty {
- position: absolute;
- top: 0;
- right: 0;
- left: 0;
- bottom: 0;
- }
- }
- }
- </style>
|