123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- <template>
- <view class="site-wrapper" ref="contentWrapper">
- <!-- 筛选框start -->
- <view style="height:224rpx"></view>
- <view class="ding">
- <view class="cu-bar search bg-gray filter-section" style="with:50%;">
- <view class="search-form round bg-white" >
- <select name="" id="" placeholder="">
- <option value="">请选择设备类型</option>
- <option value="">类型1</option>
- <option value="">类型2</option>
- </select>
- </view>
- <view class="search-form round bg-white">
- <input type="text"
- placeholder="选输入设备点位" confirm-type="search"></input>
- </view>
- </view>
-
- <view class="cu-bar search bg-gray filter-section">
- <view class="search-form round bg-white" style="margin-bottom:26rpx">
- <input class="" @focus="InputFocus" v-model="siteName" @blur="InputBlur" :adjust-position="false" type="text"
- placeholder="选择传输方式" confirm-type="search"></input>
- </view>
- <view class="action">
- <button class="cu-btn bg-blue round" @click="searchData()">查询</button>
- </view>
- </view>
- </view>
- <!-- 筛选框end -->
- <!-- 设备列表start -->
- <block class="">
- <view class="processList">
- <view class="cu-list menu-avatar ">
- <view class="cu-item" v-for="(item,index) in deviceOffLineData" :key="index" >
- <view class="cu-avatar lg" style="background-image:url(../../static/device-icon.png);"></view>
- <view class="content">
- <view class="pro-title">
- <view class="cut">{{item.title}}</view>
- </view>
- <view class="pro-des ">
- <view class="text-cut">
- {{item.subTitle}}
- </view>
- </view>
- <view class="pro-date ">{{item.time}}</view>
- </view>
-
- </view>
- </view>
- </view>
- </block>
- <!-- 设备列表end -->
- </view>
- </template>
- <script>
- import json from '../../data/json.js';
- export default {
- data() {
- return {
- deviceOffLineData:json.deviceOffLineData,
- siteListRes: 0,
- siteName: '',
- type: '0',
- siteListData: [],
- modalName: null,
- listTouchStart: 0,
- listTouchDirection: null,
- CustomBar: this.CustomBar,
- };
- },
- onPullDownRefresh() {
- console.log('refresh');
- setTimeout(function() {
- uni.stopPullDownRefresh();
- }, 1000);
- },
- computed: {
- newSiteListData() {
- return this.siteListData.map(item => {
- this.$set(item, "isShow", false)
- return item
- })
- }
- },
- mounted() {
- document.addEventListener('click', (e) => {
- if (e.target.className != 'showDetail') {
- this.siteListData.forEach(item => {
- item.isShow = false
- })
- }
- })
- },
- onLoad() {
- this.getSiteList()
- },
- methods: {
- searchData() {
- this.getSiteList({
- "siteName": this.siteName
- })
- },
- async getSiteList(ming) {
- const res = await this.$myRequest({
- url: 'OperationMonitoring/getSiteList',
- showLoading: true,
- data: ming
- })
- this.siteListRes = 1;
- console.log(res.data.data)
- this.siteListData = res.data.data
- },
- // 隐藏显示
- showDetail(e) {
- // 存储点击那一项的状态
- const nowStatu = e.isShow;
- // 将每一项列表的isShow设置为false,让所有的列表都隐藏
- this.siteListData.forEach(item => {
- item.isShow = false
- })
- // 用于再次点击该项的取反
- e.isShow = !nowStatu
- },
- InputFocus(e) {
- this.InputBottom = e.detail.height
- },
- InputBlur(e) {
- this.InputBottom = 0
- },
-
- }
- }
- </script>
- <style>
-
- </style>
|