<template>
|
<view class="m-page">
|
<view class="m-page-over">
|
<view class="m-button-list">
|
<u-button type="primary" text="分配" @click="allot" v-if="listName == 'tally'">
|
<view class="m-button-base">
|
<u--image src="/static/img/blue_1.png" width="1em" height="1em" mode="aspectFit"></u--image>
|
分配
|
</view>
|
</u-button>
|
<u-button type="primary" text="解绑" @click="untie" v-if="listName == 'tally' || listName == 'rail'">
|
<view class="m-button-base">
|
<u--image src="/static/img/blue_1.png" width="1em" height="1em" mode="aspectFit"></u--image>
|
解绑
|
</view>
|
</u-button>
|
<u-button type="primary" text="新增" @click="add"
|
v-if="listName != 'rail' && listName != 'jobHis' && listName != 'alarmHis' && listName != 'map' && listName != 'network'">
|
<view class="m-button-base">
|
<u--image src="/static/img/blue_2.png" width="1em" height="1em" mode="aspectFit"></u--image>
|
新增
|
</view>
|
</u-button>
|
<u-button type="primary" text="锁定" @click="lockd" v-if="listName == 'baseStation'">
|
<view class="m-button-base">
|
<u--image src="/static/img/blue_3.png" width="1em" height="1em" mode="aspectFit"></u--image>
|
锁定
|
</view>
|
</u-button>
|
|
<u-button type="primary" text="修改" @click="update"
|
v-if="listName != 'jobHis' && listName != 'alarmHis'&& listName != 'network'">
|
<view class="m-button-base">
|
<u--image src="/static/img/blue_3.png" width="1em" height="1em" mode="aspectFit"></u--image>
|
{{listName=='baseStation'?'校准':'修改'}}
|
</view>
|
</u-button>
|
<u-button type="primary" text="打开" @click="openrelay" v-if="listName == 'atresia' && isopen==true">
|
<view class="m-button-base">
|
<u--image src="/static/img/blue_1.png" width="1em" height="1em" mode="aspectFit"></u--image>
|
打开
|
</view>
|
</u-button>
|
<u-button type="primary" text="关闭" @click="closerelay" v-if="listName == 'atresia'&& isopen==false">
|
<view class="m-button-base">
|
<u--image src="/static/img/blue_1.png" width="1em" height="1em" mode="aspectFit"></u--image>
|
关闭
|
</view>
|
</u-button>
|
|
<u-button type="primary" text="删除" @click="dele"
|
v-if="listName != 'jobHis' && listName != 'alarmHis' && listName != 'map'&& listName != 'network'">
|
<view class="m-button-base">
|
<u--image src="/static/img/blue_4.png" width="1em" height="1em" mode="aspectFit"></u--image>
|
删除
|
</view>
|
</u-button>
|
<u-button type="primary" text="导出" v-if="listName == 'jobHis' || listName == 'alarmHis'"
|
@click="exportFile"></u-button>
|
<u-button class="m-button-allDel" type="primary" text="全删" @click="deleteAllData"
|
v-if="listName == 'jobHis' || listName == 'alarmHis'">
|
<view class="m-button-base">
|
<u--image src="/static/img/blue_4.png" width="1em" height="1em" mode="aspectFit"></u--image>
|
全删
|
</view>
|
</u-button>
|
<u-button type="primary" text="开始" @click="start"
|
v-if="listName == 'network' && statusorstop == 'start'">
|
<view class="m-button-base" >
|
<u--image src="/static/img/blue_4.png" width="1em" height="1em" mode="aspectFit"></u--image>
|
开始
|
</view>
|
</u-button>
|
<u-button type="primary" text="暂停" @click="stop"
|
v-if="listName == 'network' && statusorstop == 'stop'">
|
<view class="m-button-base" >
|
<u--image src="/static/img/blue_4.png" width="1em" height="1em" mode="aspectFit"></u--image>
|
暂停
|
</view>
|
</u-button>
|
<u-button class="m-button-allDel" type="primary" text="清空" @click="cleanall"
|
v-if="listName == 'network'">
|
<view class="m-button-base">
|
<u--image src="/static/img/blue_4.png" width="1em" height="1em" mode="aspectFit"></u--image>
|
清空
|
</view>
|
</u-button>
|
|
<u-button class="m-button-allDel" type="primary" text="测试" @click="ceshi"
|
v-if="listName == 'network'">
|
<view class="m-button-base">
|
<u--image src="/static/img/blue_4.png" width="1em" height="1em" mode="aspectFit"></u--image>
|
测试
|
</view>
|
</u-button>
|
|
<passwordForm v-if="passwordFormShow" @submitPasswordForm="submitPasswordForm"
|
@cancelPasswordForm="passwordFormShow = false"></passwordForm>
|
<!-- <u-icon name="close-circle" color="#fff" size="40" @click="colseList"></u-icon> -->
|
</view>
|
<view class="u-page" :style="{ top: top + 'px' }">
|
<view>
|
<u-list height="auto">
|
<view class="m-list-title">
|
<u-list-item>
|
<u-cell :customStyle="{'background-color':'#459EFF'}">
|
<view slot="label">
|
<u-row>
|
<u-col :span="colWidth" style="text-align: center;"
|
v-for="(item, index) in titleList" :key="index">
|
<view class="m-list-title-text">{{ item.title }}</view>
|
</u-col>
|
</u-row>
|
</view>
|
</u-cell>
|
</u-list-item>
|
</view>
|
</u-list>
|
</view>
|
<view>
|
<u-list height="auto">
|
<view>
|
<u-list-item>
|
<u-cell :customStyle="{'background-color':'#459EFF'}">
|
<view slot="label">
|
<u-row>
|
<u-col :span="colWidth" style="text-align: center;"
|
v-for="(item, index) in titleList" :key="index">
|
<view v-if="item.title=='创建时间'" style="margin-left: -150px;position: relative;">
|
<view class="m-list-title-text">{{ item.title }}</view>
|
|
</view>
|
<view v-else-if=" listName == 'voice' && item.title=='序号' || listName == 'department' && item.title=='序号'" style="width: 30%;left: 0;position: relative;">
|
<view class="m-list-title-text">{{ item.title }}</view>
|
</view>
|
<view v-else-if="item.title=='语音文字' || item.title=='延迟时间'|| item.title=='报警类型' || item.title=='部门ID' || item.title=='部门名称' " >
|
|
<view class="m-list-title-text" style="width: 100%; left: -80px;position: relative;">{{ item.title }}</view>
|
</view>
|
<view v-else >
|
<view class="m-list-title-text">{{ item.title }}</view>
|
</view>
|
<!-- <view class="m-list-title-text">{{ item.title }}</view> -->
|
</u-col>
|
</u-row>
|
</view>
|
</u-cell>
|
</u-list-item>
|
</view>
|
</u-list>
|
</view>
|
<view class="m-list">
|
<u-list :height="height" :scrollable="scrollableview" :scrollTop="scrollTopview" :scrollWithAnimation="scrollWithAnimationview" @scrolltolower="scrolltolower" @scroll="scrollbottom" :scrollIntoView="toView">
|
|
<view class="m-list-label">
|
<u-list-item v-for="(item, index) in valueList" :key="index"
|
:class="{ 'm-pitch': pitch(index) }" class="m-list-item">
|
<u-cell @click="changeIndex(index, item)"
|
:customStyle="{'background-color':pitch(index)?'red':'transparent' }">
|
<view slot="label">
|
<u-row>
|
<u-col :span="colWidth" style="text-align: center;"
|
v-for="(itemV, indexV) in titleList" :key="indexV">
|
<!-- 常规属性 -->
|
<view v-if="itemV.value=='addTime' && listName != 'map'" style="margin-left: -150px;position: relative;">
|
<view class="m-layout m-list-value-text"
|
v-if="itemV.value != undefined && itemV.title != '是否启用'">
|
{{ item[itemV.value] }}</view>
|
|
</view>
|
<view v-else-if=" listName == 'voice' && itemV.value=='id' || listName == 'department' && itemV.value=='id'" style="width: 10%;">
|
<view class="m-layout m-list-value-text"
|
v-if="itemV.value != undefined && itemV.title != '是否启用'">
|
{{ item[itemV.value] }}</view>
|
</view>
|
<view v-else-if="itemV.value=='voicewenzi' || itemV.value=='ycTime' || itemV.value=='baojtype' || itemV.value=='department_id' || itemV.value=='department_name'" >
|
<view class="m-layout m-list-value-text" style="width: 100%; left: -80px;position: relative;"
|
v-if="itemV.value != undefined && itemV.title != '是否启用'">
|
{{ item[itemV.value] }}</view>
|
</view>
|
<view v-else >
|
<view class="m-layout m-list-value-text"
|
v-if="itemV.value != undefined && itemV.title != '是否启用'">
|
{{ item[itemV.value] }}</view>
|
</view>
|
|
<!-- 围栏管理属性-启用围栏开关 -->
|
<view class="m-switch m-list-value-text" v-if="itemV.title == '是否启用'">
|
<view @click.stop=""><u-switch
|
v-model="item.baoliu7=item.baoliu7=='1'?true:false"
|
asyncChange @change="asyncChange($event,item)"></u-switch>
|
</view>
|
</view>
|
</u-col>
|
</u-row>
|
</view>
|
</u-cell>
|
</u-list-item>
|
|
</view>
|
<!-- <view id="bottom" style="padding: 10px;">
|
最下方内容
|
</view> -->
|
<u-loadmore @loadmore="scrolltolower" :status="status" />
|
|
</u-list>
|
</view>
|
</view>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
import passwordForm from '@/pages/index/components/passwordForm.vue';
|
import {
|
downloadFile,
|
connChart,
|
exportExcel
|
} from '../common/utils.js';
|
// import { start } from 'repl';
|
export default {
|
components: {
|
|
passwordForm
|
},
|
props: {
|
titleList: Array,
|
colWidth: Number,
|
listName: String,
|
deviceId: String,
|
networkList:Array,
|
isRefresh: Boolean
|
},
|
data() {
|
return {
|
isopen:false,
|
statusorstop:'',
|
scrollTopview:999999999999999,
|
scrollWithAnimationview:true,
|
scrollableview:true,
|
networkStatus:'start',
|
toView :'bottom',
|
ip: '', //192.168.1.15
|
port: '8233', //默认8233端口
|
localPort: '9527',
|
message: '你好啊',
|
passwordFormShow: false,
|
passwordFormText: '',
|
indexList: [],
|
valueList: [],
|
pitchIndex: [],
|
valueSwitch: false,
|
height: 0,
|
top: 0,
|
formData: [],
|
ids: '',
|
idList: [],
|
timeCount: null,
|
num: 10,
|
labelModel: null,
|
number: 1,
|
count: 20,
|
status: 'loadmore', //nomore
|
};
|
},
|
computed: {},
|
watch: {
|
|
|
isRefresh(newV, oldV) {
|
if (newV) {
|
this.number = 1
|
this.valueList = []
|
this.idList = []
|
this.ids = ''
|
this.pitchIndex = []
|
this.formData = []
|
// if (this.listName == 'sys') this.getRailList();
|
if (this.listName == 'rail') this.getRailList();
|
if (this.listName == 'tally') this.getTallyList();
|
if (this.listName == 'baseStation') this.getBaseList();
|
if (this.listName == 'warnLable') this.getWarnList();
|
if (this.listName == 'atresia') this.getAtresiaList();
|
if (this.listName == 'voice') this.getVoiceList()
|
if (this.listName == 'network') this.getNetworkList();
|
|
|
if (this.listName == 'alarmHis') this.getAlarmHisList();
|
if (this.listName == 'jobHis') this.getJobHisList();
|
if (this.listName == 'map') this.getMapList();
|
if (this.listName == 'department') this.getDepartmentList();
|
this.$emit('refresh', {
|
isRefresh: false
|
})
|
}
|
},
|
},
|
mounted() {
|
if (this.listName == 'network' ) {
|
this.statusorstop = 'start'
|
} else{
|
this.statusorstop = ''
|
}
|
this.$nextTick(() => {
|
setTimeout(() => {
|
/* 设置列表各项height、top */
|
const m_page = uni.createSelectorQuery().select('.m-page'); //列表父级
|
const m_button_list = uni.createSelectorQuery().select('.m-button-list'); //列表头部按钮
|
const u_list = uni.createSelectorQuery().selectAll('.u-list'); //列表表头
|
const u_page = uni.createSelectorQuery().select('.u-page'); //列表:表头+数据
|
var m_page_height = 0; //列表父级高度
|
var m_button_list_height = 0; //列表头部按钮高度
|
var u_list_height = 0; //列表表头高度
|
m_button_list.boundingClientRect(data => {
|
m_button_list_height = data.height;
|
this.top = m_button_list_height; //列表表格(表头+数据)的top
|
}).exec();
|
m_page.boundingClientRect(data => {
|
m_page_height = data.height;
|
}).exec();
|
u_list.boundingClientRect(data => {
|
u_list_height = data[1].height;
|
}).exec();
|
u_page.boundingClientRect(data => {
|
this.height = m_page_height - m_button_list_height -
|
u_list_height; //列表数据高度
|
uni.pageScrollTo({
|
scrollTop: this.height,
|
duration: 0
|
});
|
this.scrollTopview=data.height
|
}).exec();
|
}, 50)
|
if (this.listName == 'rail') this.getRailList();
|
if (this.listName == 'tally') this.getTallyList();
|
if (this.listName == 'baseStation') this.getBaseList();
|
if (this.listName == 'warnLable') this.getWarnList();
|
if (this.listName == 'atresia') this.getAtresiaList();
|
if (this.listName == 'voice') this.getVoiceList();
|
if (this.listName == 'network') this.getNetworkList();
|
|
if (this.listName == 'alarmHis') this.getAlarmHisList();
|
if (this.listName == 'jobHis') this.getJobHisList();
|
if (this.listName == 'map') this.getMapList();
|
if (this.listName == 'department') this.getDepartmentList();
|
});
|
},
|
beforeDestroy() {
|
clearInterval(this.timeCount)
|
},
|
methods: {
|
scrolltolower() {
|
console.log('触底了')
|
this.number += 1
|
if (this.listName == 'rail') this.getRailList();
|
if (this.listName == 'tally') this.getTallyList();
|
if (this.listName == 'baseStation') this.getBaseList();
|
if (this.listName == 'warnLable') this.getBaseList();
|
if (this.listName == 'atresia') this.getAtresiaList();
|
if (this.listName == 'voice') this.getVoiceList();
|
if (this.listName == 'network') this.getNetworkList();
|
if (this.listName == 'alarmHis') this.getAlarmHisList();
|
if (this.listName == 'jobHis') this.getJobHisList();
|
if (this.listName == 'map') this.getMapList();
|
if (this.listName == 'department') this.getDepartmentList();
|
},
|
scrollbottom(e) {
|
this.scrollTopview=e
|
},
|
//选中行
|
changeIndex(index, item) {
|
if (this.listName == 'jobHis' || this.listName == 'alarmHis') {
|
return
|
}
|
if (
|
this.pitchIndex.filter(e => {
|
return e == index;
|
}).length == 0
|
) {
|
// this.$set(this.pitchIndex,this.pitchIndex.length,index)
|
this.pitchIndex.push(index);
|
this.formData.push(item);
|
this.idList.push(item.id);
|
} else {
|
this.pitchIndex = this.pitchIndex.filter(e => {
|
return e != index;
|
});
|
this.formData = this.formData.filter(e => {
|
return e.id != item.id;
|
});
|
this.idList = this.idList.filter(e => {
|
return e != item.id;
|
});
|
}
|
this.ids = this.idList.join(',');
|
},
|
//修改选中行样式
|
pitch(index) {
|
if (
|
this.pitchIndex.filter(e => {
|
return e == index;
|
}).length != 0
|
) {
|
return true;
|
} else {
|
return false;
|
}
|
},
|
//启用围栏-开关
|
asyncChange(e, item) {
|
var sys = this.$store.state.sys;
|
if (sys.local==false) {
|
item.baoliu7 = e;
|
this.$emit('iskai',{
|
ipa:e,
|
name:item.name
|
});
|
}else{
|
this.labelModel.update(`id=${item.id}`, {
|
baoliu7: e ? '1' : '0'
|
}, (err, results) => {
|
item.baoliu7 = e;
|
// this.lock2(item.id,item.baoliu7)
|
});
|
}
|
|
// uni.showModal({
|
// content: e ? '确定要打开吗' : '确定要关闭吗',
|
// confirmColor:"#68B0FE",
|
// cancelColor:"#68B0FE",
|
// success: res => {
|
// if (res.confirm) {
|
// this.$Api.enablefence({
|
// id:item.id,
|
// str:e?'1':'0'
|
// }).then(res=>{
|
// console.log(res)
|
// item.baoliu7=e;
|
// })
|
// }
|
// }
|
// });
|
},
|
// lock2(id,baoliu){
|
// let _this = this
|
// var ipa = id+"," +baoliu+","
|
// console.log(ipa);
|
// // this.$emit('submitDrawForm', {
|
// // lock: ipa
|
// // });
|
// _this.$emit('asyncChange', {
|
|
// lock: ipa
|
// });
|
// },
|
//获取围栏列表数据
|
getRailList() {
|
// this.status = 'loading'
|
var sys = this.$store.state.sys;
|
console.log(sys);
|
setTimeout(() => {
|
if (sys.local==false) {
|
var method ='GET'
|
var data = {}
|
data.serialNumber = this.deviceId
|
data.name = 'ALL'
|
console.log(data);
|
var contentType='application/x-www-form-urlencoded'
|
uni.request({
|
// url: "http://192.168.31.101:8181/Fence/", //接口地址。
|
// url: "http://111.198.60.6:6008/Fence/", //接口地址。
|
url: "http://"+sys.baoliu20host+":8181/Fence/", //接口地址。
|
data: data,
|
method: method,
|
header: { //请求头可自定义
|
'content-type': contentType,
|
},
|
timeout:5000,//设置超时时间,默认5秒
|
success: (rep) => { //具体捕获请看自己接口返回的形式
|
console.log(87654345678);
|
console.log(rep)
|
// this.railList = [];
|
if (rep.statusCode==200) {
|
rep.data.forEach((e, i) => {
|
e.name=e.name.split(this.deviceId)[0]
|
e.addtime=e.baoliu12
|
this.status = 'loadmore'
|
})
|
this.valueList.push(...rep.data)
|
}else{
|
// this.status = 'nomore'
|
}
|
},
|
// fail(error) {
|
// console.log(error);
|
// uni.hideLoading();
|
// uni.$u.toast('网络不通');
|
// // reject(error)
|
// },
|
complete() {
|
uni.hideLoading();
|
}
|
});
|
}else{
|
this.labelModel = connChart('fence');
|
this.labelModel.limit({
|
where: '1=1 order by id desc',
|
number: this.number,
|
count: this.count
|
}, (e, r) => {
|
if (!e && r.length != 0) {
|
this.valueList.push(...r)
|
this.status = 'loadmore'
|
} else {
|
this.status = 'nomore'
|
}
|
})
|
}
|
}, 500)
|
},
|
//获取标签列表数据
|
getTallyList() {
|
this.status = 'loading'
|
setTimeout(() => {
|
this.labelModel = connChart('label');
|
this.labelModel.limit({
|
where: '1=1 order by id desc',
|
number: this.number,
|
count: this.count
|
}, (e, r) => {
|
if (!e && r.length != 0) {
|
this.valueList.push(...r)
|
this.status = 'loadmore'
|
} else {
|
this.status = 'nomore'
|
}
|
})
|
}, 500)
|
},
|
//获取基站列表数据
|
getBaseList() {
|
this.status = 'loading'
|
setTimeout(() => {
|
this.labelModel = connChart('base');
|
this.labelModel.limit({
|
where: '1=1 order by id desc',
|
number: this.number,
|
count: this.count
|
}, (e, r) => {
|
if (!e && r.length != 0) {
|
this.valueList.push(...r)
|
this.status = 'loadmore'
|
} else {
|
this.status = 'nomore'
|
}
|
})
|
}, 500)
|
},
|
getWarnList() {
|
this.status = 'loading'
|
setTimeout(() => {
|
this.labelModel = connChart('warn');
|
this.labelModel.limit({
|
where: '1=1 order by id desc',
|
number: this.number,
|
count: this.count
|
}, (e, r) => {
|
if (!e && r.length != 0) {
|
this.valueList.push(...r)
|
this.status = 'loadmore'
|
} else {
|
this.status = 'nomore'
|
}
|
})
|
}, 500)
|
},
|
getAtresiaWarnList() {
|
this.status = 'loading'
|
setTimeout(() => {
|
this.labelModel = connChart('block');
|
this.labelModel.limit({
|
where: '1=1 order by id desc',
|
number: this.number,
|
count: this.count
|
}, (e, r) => {
|
if (!e && r.length != 0) {
|
this.valueList.push(...r)
|
this.status = 'loadmore'
|
} else {
|
this.status = 'nomore'
|
}
|
})
|
}, 500)
|
},
|
|
getNetworkWarnList() {
|
this.status = 'loading'
|
setTimeout(() => {
|
this.labelModel = connChart('network');
|
this.labelModel.limit({
|
where: '1=1 order by id desc',
|
number: this.number,
|
count: this.count
|
}, (e, r) => {
|
if (!e && r.length != 0) {
|
this.valueList.push(...r)
|
this.status = 'loadmore'
|
} else {
|
this.status = 'nomore'
|
}
|
})
|
}, 500)
|
},
|
|
getVoiceWarnList() {
|
this.status = 'loading'
|
setTimeout(() => {
|
this.labelModel = connChart('voice');
|
this.labelModel.limit({
|
where: '1=1 order by id desc',
|
number: this.number,
|
count: this.count
|
}, (e, r) => {
|
if (!e && r.length != 0) {
|
this.valueList.push(...r)
|
this.status = 'loadmore'
|
} else {
|
this.status = 'nomore'
|
}
|
})
|
}, 500)
|
},
|
|
//获取告警历史列表
|
getAlarmHisList() {
|
this.status = 'loading'
|
setTimeout(() => {
|
this.labelModel = connChart('alarm');
|
this.labelModel.limit({
|
where: '1=1 order by id desc',
|
number: this.number,
|
count: this.count
|
}, (e, r) => {
|
if (!e && r.length != 0) {
|
this.valueList.push(...r)
|
this.status = 'loadmore'
|
} else {
|
this.status = 'nomore'
|
}
|
})
|
}, 500)
|
},
|
//获取作业历史列表
|
getJobHisList() {
|
this.status = 'loading'
|
setTimeout(() => {
|
this.labelModel = connChart('work');
|
this.labelModel.limit({
|
where: '1=1 order by id desc',
|
number: this.number,
|
count: this.count
|
}, (e, r) => {
|
if (!e && r.length != 0) {
|
this.valueList.push(...r)
|
this.status = 'loadmore'
|
} else {
|
this.status = 'nomore'
|
}
|
})
|
}, 500)
|
},
|
//获取地图列表
|
getMapList() {
|
this.status = 'loading'
|
setTimeout(() => {
|
this.labelModel = connChart('map');
|
this.labelModel.limit({
|
where: '1=1 order by id desc',
|
number: this.number,
|
count: this.count
|
}, (e, r) => {
|
if (!e && r.length != 0) {
|
this.valueList.push(...r)
|
this.status = 'loadmore'
|
} else {
|
this.status = 'nomore'
|
}
|
})
|
}, 500)
|
},
|
//获取部门列表
|
getDepartmentList() {
|
this.status = 'loading'
|
setTimeout(() => {
|
this.labelModel = connChart('department');
|
this.labelModel.limit({
|
where: '1=1 order by id desc',
|
number: this.number,
|
count: this.count
|
}, (e, r) => {
|
if (!e && r.length != 0) {
|
this.valueList.push(...r)
|
this.status = 'loadmore'
|
} else {
|
this.status = 'nomore'
|
}
|
})
|
}, 500)
|
},
|
//获取部门列表
|
getAtresiaList() {
|
this.status = 'loading'
|
setTimeout(() => {
|
this.labelModel = connChart('block');
|
this.labelModel.limit({
|
where: '1=1 order by id desc',
|
number: this.number,
|
count: this.count
|
}, (e, r) => {
|
if (!e && r.length != 0) {
|
this.valueList.push(...r)
|
this.status = 'loadmore'
|
} else {
|
this.status = 'nomore'
|
}
|
})
|
}, 500)
|
},
|
getVoiceList() {
|
this.status = 'loading'
|
setTimeout(() => {
|
this.labelModel = connChart('voice');
|
this.labelModel.limit({
|
where: '1=1 order by id desc',
|
number: this.number,
|
count: this.count
|
}, (e, r) => {
|
if (!e && r.length != 0) {
|
this.valueList.push(...r)
|
this.status = 'loadmore'
|
} else {
|
this.status = 'nomore'
|
}
|
})
|
}, 500)
|
},
|
getNetworkList() {
|
|
this.status = 'loading'
|
setTimeout(() => {
|
if(this.networkStatus=='start'){
|
this.status = 'nomore'
|
this.valueList = this.networkList
|
}
|
}, 500)
|
},
|
colseList() {
|
this.$emit('closeList');
|
},
|
sendBroadMsg() {
|
this.$socket.sendBroadcast(this.message, this.ip, this.port, this.localPort); //目标端口'7777',本地端口'9527'
|
},
|
lockd() {
|
if (this.formData.length == 1) {
|
// this.sendBroadMsg();
|
this.$emit('lockd', {
|
formData: this.formData[0]
|
});
|
} else if (this.formData.length == 0) {
|
uni.$u.toast('请选中行')
|
} else {
|
uni.$u.toast('请选中单行')
|
}
|
},
|
openrelay(){
|
if (this.formData.length == 1) {
|
// this.sendBroadMsg();
|
this.$emit('openrelay', {
|
formData: this.formData[0]
|
});
|
this.isopen=false
|
} else if (this.formData.length == 0) {
|
uni.$u.toast('请选中行')
|
} else {
|
uni.$u.toast('请选中单行')
|
}
|
},
|
closerelay(){
|
if (this.formData.length == 1) {
|
// this.sendBroadMsg();
|
this.$emit('closerelay', {
|
formData: this.formData[0]
|
});
|
this.isopen=true
|
} else if (this.formData.length == 0) {
|
uni.$u.toast('请选中行')
|
} else {
|
uni.$u.toast('请选中单行')
|
}
|
},
|
add() {
|
this.$emit('add', {
|
formData: this.formData[0]
|
});
|
},
|
update() {
|
if (this.formData.length == 1) {
|
this.$emit('update', {
|
formData: this.formData[0]
|
});
|
} else if (this.formData.length == 0) {
|
uni.$u.toast('请选中行')
|
} else {
|
uni.$u.toast('请选中单行')
|
}
|
},
|
allot() {
|
if (this.formData.length == 1) {
|
this.$emit('allot', {
|
type: 'allot',
|
formData: this.formData[0]
|
});
|
} else if (this.formData.length == 0) {
|
uni.$u.toast('请选中行')
|
} else {
|
uni.$u.toast('请选中单行')
|
}
|
},
|
untie() {
|
console.log(111111);
|
if (this.formData.length == 1) {
|
// if (this.model.show_password) {
|
// this.passwordFormShow = true;
|
// // this.passwordFormText = 'tally';
|
// return;
|
// }
|
console.log(this.listName);
|
if (this.listName == 'tally') {
|
uni.showModal({
|
title: '提示',
|
content: '是否确认修改标签绑定信息?',
|
success: res => {
|
console.log(res);
|
if (res.confirm) {
|
console.log(1111111111);
|
var ipa = this.formData[0].p_tagid+","+this.formData[0].baoliu12
|
this.$emit('untie', {
|
|
ipa: ipa
|
});
|
this.labelModel = connChart('label')
|
this.labelModel.update(`id='${this.formData[0].id}'`, {
|
baoliu12:"未命名",
|
|
// p_warn: list,
|
// p_tagid: this.model.p_tagid,
|
// baoliu12: this.model.baoliu12
|
}, (err, results) => {
|
console.log(2222222);
|
|
|
// this.$emit('submitTallyForm');
|
});
|
this.number = 1
|
this.valueList = []
|
this.idList = []
|
this.ids = ''
|
this.pitchIndex = []
|
this.formData = []
|
if (this.listName == 'tally') {
|
this.getTallyList()
|
} else if (this.listName == 'rail') {
|
this.getRailList()
|
} else if (this.listName == 'baseStation') {
|
this.getBaseList()
|
} else if (this.listName == 'map') {
|
this.getMapList()
|
} else if (this.listName == 'department') {
|
this.getDepartmentList()
|
} else if (this.listName == 'warnLable') {
|
this.getWarnList()
|
} else if (this.listName == 'atresia') {
|
this.getAtresiaList()
|
} else if (this.listName == 'voice') {
|
this.getVoiceList()
|
} else if (this.listName == 'network') {
|
this.getNetworkList()
|
}
|
} else if (res.cancel) {
|
|
}
|
}
|
});
|
} else if (this.listName == 'rail') {
|
uni.showModal({
|
title: '提示',
|
content: '是否确认修改标签绑定信息?',
|
success: res => {
|
if (res.confirm) {
|
this.labelModel = connChart('fence')
|
this.labelModel.update(`id='${this.formData[0].id}'`, {
|
p_tagid:"",
|
|
// p_warn: list,
|
// p_tagid: this.model.p_tagid,
|
// baoliu12: this.model.baoliu12
|
}, (err, results) => {
|
|
// this.$emit('submitTallyForm');
|
});
|
this.number = 1
|
this.valueList = []
|
this.idList = []
|
this.ids = ''
|
this.pitchIndex = []
|
this.formData = []
|
if (this.listName == 'tally') {
|
this.getTallyList()
|
} else if (this.listName == 'rail') {
|
this.getRailList()
|
} else if (this.listName == 'baseStation') {
|
this.getBaseList()
|
} else if (this.listName == 'map') {
|
this.getMapList()
|
} else if (this.listName == 'department') {
|
this.getDepartmentList()
|
} else if (this.listName == 'warnLable') {
|
this.getWarnList()
|
} else if (this.listName == 'atresia') {
|
this.getAtresiaList()
|
}else if (this.listName == 'voice') {
|
this.getVoiceList()
|
} else if (this.listName == 'network') {
|
this.getNetworkList()
|
}
|
} else if (res.cancel) {
|
}
|
}
|
});
|
}
|
|
// this.$emit('allot', {
|
// type: 'allot',
|
// formData: this.formData[0]
|
// });
|
} else if (this.formData.length == 0) {
|
uni.$u.toast('请选中行')
|
} else {
|
uni.$u.toast('请选中单行')
|
}
|
},
|
|
submitPasswordForm() {
|
this.passwordFormShow = false;
|
|
// if (this.listName == 'tally') {
|
// // if (this.model.show_password) {
|
// // this.passwordFormShow = true;
|
// // // this.passwordFormText = 'tally';
|
// // return;
|
// // }
|
// this.passwordFormShow = true;
|
// this.passwordFormText = 'tally';
|
// } else if (this.listName == 'baseStation') {
|
// // if (this.model.show_password) {
|
// // this.passwordFormShow = true;
|
// // // this.passwordFormText = 'tally';
|
// // return;
|
// // }
|
// this.passwordFormShow = true;
|
// this.passwordFormText = 'baseStation';
|
// } else {
|
uni.showModal({
|
title: '提示',
|
content: '是否确认删除?',
|
success: res => {
|
if (res.confirm) {
|
console.log('用户点击确定');
|
var ipa = this.ids
|
let labelModel = connChart('label')
|
labelModel.find(`id in(${this.ids})`, (e, r) => {
|
r.forEach(e => {
|
console.log(e);
|
this.$emit('dele', {
|
ipa: e.p_tagid
|
});
|
});
|
})
|
this.labelModel.delete(`id in(${this.ids})`, (err, results) => {
|
|
this.number = 1
|
this.valueList = []
|
this.idList = []
|
this.ids = ''
|
this.pitchIndex = []
|
this.formData = []
|
if (this.listName == 'tally') {
|
|
this.getTallyList()
|
} else if (this.listName == 'rail') {
|
this.getRailList()
|
} else if (this.listName == 'baseStation') {
|
this.getBaseList()
|
} else if (this.listName == 'map') {
|
this.getMapList()
|
} else if (this.listName == 'department') {
|
this.getDepartmentList()
|
} else if (this.listName == 'warnLable') {
|
this.getWarnList()
|
} else if (this.listName == 'atresia') {
|
this.getAtresiaList()
|
}else if (this.listName == 'voice') {
|
this.getVoiceList()
|
} else if (this.listName == 'network') {
|
this.getNetworkList()
|
}
|
});
|
} else if (res.cancel) {
|
}
|
}
|
});
|
// }
|
this.passwordFormText = '';
|
},
|
dele() {
|
if (this.formData.length >= 1) {
|
if (this.listName == 'tally') {
|
// if (this.model.show_password) {
|
// this.passwordFormShow = true;
|
// // this.passwordFormText = 'tally';
|
// return;
|
// }
|
this.passwordFormShow = true;
|
this.passwordFormText = 'tally';
|
} else if (this.listName == 'baseStation') {
|
// if (this.model.show_password) {
|
// this.passwordFormShow = true;
|
// // this.passwordFormText = 'tally';
|
// return;
|
// }
|
this.passwordFormShow = true;
|
this.passwordFormText = 'baseStation';
|
} else{
|
uni.showModal({
|
title: '提示',
|
content: '是否确认删除?',
|
success: res => {
|
if (res.confirm) {
|
console.log('用户点击确定');
|
var ipa = this.ids
|
if (this.listName == 'rail') {
|
let labelModel = connChart('fence')
|
labelModel.find(`id in(${this.ids})`, (e, r) => {
|
r.forEach(e => {
|
console.log(e);
|
this.$emit('dele', {
|
ipa: e.name
|
});
|
});
|
})
|
}else if (this.listName == 'voice') {
|
let labelModel = connChart('voice')
|
labelModel.find(`id in(${this.ids})`, (e, r) => {
|
r.forEach(e => {
|
console.log(e);
|
this.$emit('dele', {
|
ipa: e.baojtype
|
});
|
});
|
})
|
}
|
var sys = this.$store.state.sys;
|
console.log(sys);
|
if (sys.local==false && this.listName == 'rail') {
|
console.log(this.formData[0].name);
|
this.$emit('dele', {
|
ipa: this.formData[0].name
|
});
|
this.number = 1
|
this.valueList = []
|
this.idList = []
|
this.ids = ''
|
this.pitchIndex = []
|
this.formData = []
|
this.getRailList()
|
|
// this.$emit('dele', {
|
// ipa: this.formData[0].name
|
// });
|
|
}else{
|
this.labelModel.delete(`id in(${this.ids})`, (err, results) => {
|
|
this.number = 1
|
this.valueList = []
|
this.idList = []
|
this.ids = ''
|
this.pitchIndex = []
|
this.formData = []
|
if (this.listName == 'tally') {
|
this.getTallyList()
|
} else if (this.listName == 'rail') {
|
this.getRailList()
|
} else if (this.listName == 'baseStation') {
|
this.getBaseList()
|
} else if (this.listName == 'map') {
|
this.getMapList()
|
} else if (this.listName == 'department') {
|
this.getDepartmentList()
|
} else if (this.listName == 'atresia') {
|
this.getAtresiaList()
|
} else if (this.listName == 'warnLable') {
|
this.getWarnList()
|
}else if (this.listName == 'voice') {
|
// this.$emit('dele', {
|
// ipa: ipa
|
// });
|
this.getVoiceList()
|
} else if (this.listName == 'network') {
|
this.getNetworkList()
|
}
|
});
|
}
|
|
} else if (res.cancel) {
|
console.log('用户点击取消');
|
}
|
}
|
});
|
}
|
|
|
|
} else if (this.formData.length == 0) {
|
uni.$u.toast('请选中行')
|
}
|
},
|
start() {
|
this.statusorstop = 'stop'
|
// this.networkStatus=='start'
|
console.log("开始");
|
this.$emit('start');
|
},
|
stop() {
|
this.statusorstop = 'start'
|
// this.valueList=[]
|
// this.networkStatus=='stop'
|
console.log("暂停");
|
this.$emit('stop');
|
},
|
cleanall() {
|
this.getNetworkList()
|
this.valueList = []
|
console.log("清空");
|
this.$emit('cleanall');
|
},
|
ceshi(){
|
|
|
this.$emit('ceshi');
|
},
|
//导出excel
|
exportFile() {
|
if (this.listName == 'jobHis') {
|
this.labelModel.find((e, r) => {
|
console.log(e, r)
|
var arr = r.map(item => ({
|
'序号': item.id,
|
'关联标签ID': item.tagid,
|
'操作步骤': item.type,
|
'围栏名称': item.fencename,
|
'关联部门': item.department,
|
'围栏高度': item.high,
|
'围栏绘制时间': item.fenceaddtime,
|
'记录时间': item.addtime,
|
'备注': item.beizhu
|
}))
|
exportExcel(arr)
|
})
|
} else if (this.listName == 'alarmHis') {
|
this.labelModel.find((e, r) => {
|
console.log(e, r)
|
var arr = r.map(item => ({
|
'序号': item.id,
|
'关联标签ID': item.objectid,
|
'关联部门': item.baoliu3,
|
'围栏名称': item.baoliu2,
|
'告警原因': item.type,
|
'状态': item.status,
|
'坐标': item.baoliu1,
|
'告警时间': item.time
|
}))
|
exportExcel(arr)
|
})
|
}
|
|
},
|
//全部删除
|
deleteAllData() {
|
uni.showModal({
|
title: '提示',
|
content: '是否确认删除?',
|
confirmColor: "#68B0FE",
|
cancelColor: "#68B0FE",
|
success: res => {
|
if (res.confirm) {
|
console.log('用户点击确定');
|
this.labelModel.delete((err, results) => {
|
this.number = 1
|
this.valueList = []
|
this.idList = []
|
this.ids = ''
|
this.pitchIndex = []
|
this.formData = []
|
if (this.listName == 'jobHis') {
|
this.getJobHisList()
|
} else if (this.listName == 'alarmHis') {
|
this.getAlarmHisList()
|
}
|
});
|
} else if (res.cancel) {
|
console.log('用户点击取消');
|
}
|
}
|
});
|
},
|
}
|
};
|
</script>
|
|
<style lang="scss" scoped>
|
.m-page {
|
position: fixed;
|
top: calc(3.5em + 20px);
|
left: 0;
|
// transform: translate(-50%, -50%);
|
width: 100%;
|
height: calc(100vh - 3.5em - 20px - 60px);
|
overflow: hidden;
|
background-color: rgba(255, 255, 255, 0.9);
|
z-index: 750;
|
// border-radius: 15px;
|
box-shadow: 0px 0px 10px 1px rgba(0, 0, 0, 0.16);
|
// box-shadow: -3.536px -3.536px 5px 0px rgba(255, 255, 255, 0.75), 4.721px 6.457px 8px -5px rgba(191, 191, 191, 1);
|
}
|
|
.m-page-over {
|
width: calc(100vw - 8em - 1px);
|
height: 100%;
|
position: absolute;
|
left: 0;
|
top: 0;
|
border-right: 1px solid #63AFF9;
|
}
|
|
.m-button-list {
|
position: absolute;
|
left: 0;
|
top: 0;
|
display: flex;
|
flex-wrap: wrap;
|
align-items: flex-start;
|
justify-content: flex-start;
|
width: 100%;
|
padding-top: 0.5em;
|
// padding-bottom: 0.5em;
|
}
|
|
.m-button-list .u-button {
|
width: 5em;
|
margin-bottom: 0.5em;
|
// box-shadow: -3.536px -3.536px 5px 0px rgba(255, 255, 255, 0.75), 4.721px 6.457px 8px -2px rgba(191, 191, 191, 1);
|
}
|
|
.m-button-base {
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
}
|
|
.m-button-allDel {
|
width: fit-content !important;
|
}
|
|
/deep/ .u-collapse-item__content {
|
border-radius: 0px !important;
|
// background-color: rgba(233, 233, 233,0.6);
|
// box-shadow: inset 2px 3.464px 5px 0px rgba(153, 153, 153, 0.004);
|
}
|
|
/deep/ .u-cell {
|
border-radius: 0px !important;
|
}
|
|
.u-page {
|
position: absolute;
|
left: 0;
|
// top: 20%;
|
width: 100%;
|
// background-color: rgba(0, 0, 0, 0.5);
|
border-top: 1px solid #fff;
|
color: #fff !important;
|
}
|
|
.m-list-label {
|
overflow: hidden;
|
width: 100%;
|
}
|
|
.m-list-title {
|
position: absolute;
|
top: 0;
|
left: 0;
|
width: 100%;
|
}
|
|
.m-list-title-text {
|
font-size: 0.8em;
|
color: #fff;
|
}
|
|
.m-list-value-text {
|
font-size: 0.8em;
|
color: #68B0FE;
|
}
|
|
/deep/ .u-cell__body {
|
color: rgb(255, 255, 255);
|
// color: #fff !important;
|
border-radius: 0;
|
background-color: transparent;
|
// box-shadow: -4.243px -4.243px 10px 0px rgba(255, 255, 255, 0.004),2.294px 3.277px 10px 0px rgba(191, 191, 191, 0.004);
|
border-bottom: 1px dashed rgb(153, 153, 153) !important;
|
}
|
|
/deep/ .u-line {
|
border: none !important;
|
}
|
|
.m-list {
|
overflow: hidden;
|
}
|
|
.m-pitch {
|
// background-color: rgba(0, 170, 255, 0.8);
|
background-color: rgba(255, 0, 0, 1.0);
|
}
|
|
.m-switch {
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
}
|
|
.m-layout {
|
word-break: break-all;
|
}
|
</style>
|