123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189 |
- <template>
- <view class="site-wrapper" ref="contentWrapper" >
- <!-- 筛选框start -->
- <view class="ding">
- <view class="cu-bar search bg-gray filter-section">
- <view class="search-form round bg-white">
- <text class="cuIcon-search"></text>
- <input class="" @focus="InputFocus" @blur="InputBlur" :adjust-position="false" type="text" placeholder="请输入站点名称"
- confirm-type="search"></input>
- </view>
- <view class="action">
- <button class="cu-btn bg-blue round">查询</button>
- </view>
- </view>
- </view>
- <!-- 筛选框end -->
- <!-- 站点列表start -->
- <view class="site-items">
- <view class="cu-list menu-avatar">
- <view class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''" v-for="(item,index) in newSiteListData"
- :key="index" :data-target="'move-box-' + index">
- <view class="cu-avatar round lg" v-if="type==1" style="background-image: url(../../static/site-icon-alarm.png);"></view>
- <view class="cu-avatar round lg" v-else style="background-image: url(../../static/site-icon.png);"></view>
- <view class="content" v-if="type==1" @tap="goAlarmingList">
- <view class="text-grey site-tit">
- {{item.siteName}}
- <text>(共3个未处理告警)</text>
- </view>
- </view>
- <view class="content" v-else @tap="goDeviceType" @longpress="showDetail(item)">
- <view class="text-grey site-tit">
- {{item.siteName}}
- <text>(共3个设备)</text>
- </view>
- <view class="showDetail" v-if="item.isShow" @tap.stop="goSiteDetail" >查看详情</view>
- </view>
- <view class="nav-right num">
- <view class="text-grey">
- <text class="icon iconfont margin-right-xs margin-left-lg"></text>
- </view>
- </view>
- </view>
- </view>
- </view>
- <!-- 站点列表end -->
- </view>
- </template>
- <script>
- import json from '../../data/json.js';
- export default {
- data() {
- return {
- type: '0',
- show:'false',
- siteListData: json.siteListData,
- modalName: null,
- listTouchStart: 0,
- listTouchDirection: null,
- CustomBar: this.CustomBar,
- };
- },
- onLoad: function(option) {
- console.log(option.type); //打印出上个页面传递的参数。
- this.type = option.type;
- if (option.type == 1) {
- uni.setNavigationBarTitle({
- title: '综合报警'
- });
- } else {
- uni.setNavigationBarTitle({
- title: '运行监测'
- });
- }
- },
- onPullDownRefresh() {
- console.log('refresh');
- setTimeout(function() {
- uni.stopPullDownRefresh();
- }, 1000);
- },
- computed: {
- newSiteListData() {
- return this.siteListData.map(item => {
- this.$set(item, "isShow", false)
- return item
- })
- }
-
-
-
-
-
- },
-
- methods: {
-
- // 隐藏显示
- showDetail(e) {
- // 存储点击那一项的状态
- const nowStatu = e.isShow;
-
- this.show=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
- },
- // 页面跳转
- goAlarmingList() {
- uni.navigateTo({
- url: '/pages/alarmingList/alarmingList',
- success: res => {},
- fail: () => {},
- complete: () => {}
- });
- },
- goDeviceType() {
- uni.navigateTo({
- url: '/pages/deviceType/deviceType',
- success: res => {},
- fail: () => {},
- complete: () => {}
- });
- },
- goSiteDetail() {
- uni.navigateTo({
- url: '/pages/siteDetail/siteDetail',
- success: res => {},
- fail: () => {},
- complete: () => {}
- });
- },
- }
- }
- </script>
- <style>
- .showDetail {
- position: absolute;
- background: #fff;
- box-shadow: 0 1px 6px 0 rgb(32 33 36 / 28%);
- padding: 0rpx 32rpx;
- border-radius: 10rpx;
- top: 42rpx;
- right: 0%;
- z-index: 3000000;
- font-size: 28rpx;
- }
- </style>
|