修改设备工单
This commit is contained in:
@ -2,18 +2,17 @@
|
||||
<!-- 绑定安全生产监控相机 -->
|
||||
<view>
|
||||
<view class="page_padding">
|
||||
<view class="page_name font14">绑定安全生产监控相机</view>
|
||||
<view class="page_content contentboxsty font13">
|
||||
<view class="content_row">
|
||||
<view class="name">串流推流Url</view>
|
||||
<view class="">
|
||||
<input placeholder="请输入串流推流Url"/>
|
||||
<view class="name font_bold">串流推流Url</view>
|
||||
<view class="text">
|
||||
<input v-model="form.stream_url" placeholder="请输入串流推流Url" disabled/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content_row">
|
||||
<view class="name">AppName</view>
|
||||
<view class="">
|
||||
<input placeholder="请输入APP名称"/>
|
||||
<view class="name font_bold">AppName</view>
|
||||
<view class="text">
|
||||
<input v-model="form.app_name" placeholder="请输入APP名称"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content_row noborbot">
|
||||
@ -23,9 +22,9 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="content_row">
|
||||
<view class="name">StreamName</view>
|
||||
<view class="">
|
||||
<input placeholder="请输入StreamName"/>
|
||||
<view class="name font_bold">StreamName</view>
|
||||
<view class="text">
|
||||
<input v-model="form.stream_name" placeholder="请输入StreamName"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content_row noborbot">
|
||||
@ -35,43 +34,49 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="content_row">
|
||||
<view class="name">设备IP</view>
|
||||
<view class="">
|
||||
<input placeholder="请输入设备IP"/>
|
||||
<view class="name font_bold">设备IP</view>
|
||||
<view class="text">
|
||||
<input v-model="form.monitor_ip" placeholder="请输入设备IP"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content_row">
|
||||
<view class="name">端口</view>
|
||||
<view class="">
|
||||
<input placeholder="请输入设备端口"/>
|
||||
<view class="name font_bold">端口</view>
|
||||
<view class="text">
|
||||
<input v-model="form.monitor_port" placeholder="请输入设备端口"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content_row">
|
||||
<view class="name">用户名</view>
|
||||
<view class="">
|
||||
<input placeholder="请输入您的用户名"/>
|
||||
<view class="name font_bold">用户名</view>
|
||||
<view class="text">
|
||||
<input v-model="form.monitor_account" placeholder="请输入您的用户名"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content_row">
|
||||
<view class="name">密码</view>
|
||||
<view class="">
|
||||
<input placeholder="请输入密码"/>
|
||||
<view class="name font_bold">密码</view>
|
||||
<view class="text">
|
||||
<input password type="safe-password" v-model="form.monitor_password" placeholder="请输入密码"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content_row">
|
||||
<view class="name">监控推流权限</view>
|
||||
<view class="flex_layout">
|
||||
<view class="t-icon t-icon-qiyong1 contenticon"></view><text class="text">Token验证</text>
|
||||
<view class="t-icon t-icon-jinyong2 contenticon"></view><text class="text">禁用</text>
|
||||
<!-- <label class="radio"><radio value="r1" checked="true" />Token验证</label>
|
||||
<label class="radio"><radio value="r2" />禁用</label> -->
|
||||
<view class="name font_bold">监控推流权限</view>
|
||||
<view class="text flex_layout">
|
||||
<view class="switch" @click="form.stream_type=1">
|
||||
<view v-if="form.stream_type ==1" class="t-icon t-icon-qiyong1 contenticon"></view>
|
||||
<view v-else class="t-icon t-icon-jinyong1 contenticon"></view>
|
||||
<text class="text">Token验证</text>
|
||||
</view>
|
||||
<view class="switch" @click="form.stream_type=2">
|
||||
<view v-if="form.stream_type ==2" class="t-icon t-icon-qiyong1 contenticon"></view>
|
||||
<view v-else class="t-icon t-icon-jinyong1 contenticon"></view>
|
||||
<text class="text">禁用</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom_but flex_layout">
|
||||
<view class="font13">保存</view>
|
||||
<view class="font13">取消</view>
|
||||
<view class="but_color font13" @click="save">保存</view>
|
||||
<view class="font13" @click="cancel">取消</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@ -80,24 +85,85 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
form:{
|
||||
id:'',
|
||||
stream_url:'',
|
||||
app_name:'',
|
||||
stream_name:'',
|
||||
stream_type:1,
|
||||
monitor_ip:'',
|
||||
monitor_port:'',
|
||||
monitor_account:'',
|
||||
monitor_password:''
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.form.id = option.id;
|
||||
this.getVideo(option.id);
|
||||
},
|
||||
onReady() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
getVideo(id){
|
||||
this.$api.request('/get.video.config',{id:id}).then(res=>{
|
||||
this.form.stream_url = res.data.stream_url;
|
||||
if(res.data.app_name && res.data.eq_name){
|
||||
this.form.app_name = res.data.app_name;
|
||||
this.form.stream_name = res.data.stream_name;
|
||||
this.form.stream_type = res.data.stream_type;
|
||||
this.form.monitor_ip = res.data.monitor_ip;
|
||||
this.form.monitor_port = res.data.monitor_port;
|
||||
this.form.monitor_account = res.data.monitor_account;
|
||||
this.form.monitor_password = res.data.monitor_password;
|
||||
}
|
||||
}).catch(err=>{
|
||||
|
||||
})
|
||||
},
|
||||
save(){
|
||||
this.$api.postFuncLoading('/bind.video.config',this.form).then(res=>{
|
||||
this.parentClick();
|
||||
this.reset();
|
||||
this.$wf.toast({type:'success',text:'保存成功'});
|
||||
}).catch(err=>{
|
||||
|
||||
})
|
||||
},
|
||||
cancel(){
|
||||
this.reset();
|
||||
},
|
||||
reset(){
|
||||
this.form.app_name = '';
|
||||
this.form.stream_name = '';
|
||||
this.form.stream_type = 1;
|
||||
this.form.monitor_ip = '';
|
||||
this.form.monitor_port = '';
|
||||
this.form.monitor_account = '';
|
||||
this.form.monitor_password = '';
|
||||
},
|
||||
parentClick(){
|
||||
const pages = getCurrentPages();
|
||||
if (pages.length >= 2) {
|
||||
const prevPage = pages[pages.length - 2];
|
||||
prevPage.$vm.getList();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.page_name{margin-bottom: 10px;}
|
||||
<style scoped lang="scss">
|
||||
.page_content{padding: 0 12px;}
|
||||
.content_row{display: flex;border-bottom: 1px solid #2D3A6F;height: 44px;align-items: center;
|
||||
.name{width: 30%;}
|
||||
.name{flex-basis: 96px;}
|
||||
.text{flex: 1;}
|
||||
.tip{width: 70%;font-size: 10px;color: #666;}
|
||||
.flex_layout{
|
||||
.contenticon{width: 20px;height: 20px;}
|
||||
.contenticon{width: 16px;height: 16px;}
|
||||
.text{padding: 0 20px 0 5px;}
|
||||
}
|
||||
}
|
||||
}
|
||||
.switch{display: flex;align-items: center;}
|
||||
</style>
|
||||
|
@ -1,34 +1,33 @@
|
||||
<template>
|
||||
<view class="page_padding">
|
||||
<view class="contentboxsty page_content ">
|
||||
|
||||
<view class="detail_list contentboxsty page_content font13">
|
||||
<view class="content_row">
|
||||
<view class="name">设备</view>
|
||||
<view class="data">{{form.name}}</view>
|
||||
<view class="name font_bold">设备</view>
|
||||
<view class="text">{{form.eq_name}}</view>
|
||||
</view>
|
||||
<view class="content_row">
|
||||
<view class="name">设备名称</view>
|
||||
<view class="data">双头立锯</view>
|
||||
<view class="name font_bold">设备名称</view>
|
||||
<view class="text">{{form.name}}</view>
|
||||
</view>
|
||||
<view class="content_row">
|
||||
<view class="name">设备功率</view>
|
||||
<view class="data">双头立锯</view>
|
||||
<view class="name font_bold">设备功率</view>
|
||||
<view class="text">{{form.power}}</view>
|
||||
</view>
|
||||
<view class="content_row">
|
||||
<view class="name">设备IP</view>
|
||||
<view class="data">双头立锯</view>
|
||||
<view class="name font_bold">设备IP</view>
|
||||
<view class="text">{{form.equipment_configs.length>0? form.equipment_configs[0].ip:''}}</view>
|
||||
</view>
|
||||
<view class="content_row">
|
||||
<view class="name">端口</view>
|
||||
<view class="data">双头立锯</view>
|
||||
<view class="name font_bold">端口</view>
|
||||
<view class="text">{{form.equipment_configs.length>0? form.equipment_configs[0].port:''}}</view>
|
||||
</view>
|
||||
<view class="content_row">
|
||||
<view class="name">状态</view>
|
||||
<view class="data">{{form.active_status==true?'启用':'禁用'}}</view>
|
||||
<view class="name font_bold">状态</view>
|
||||
<view class="text">{{form.active_status==true?'启用':'禁用'}}</view>
|
||||
</view>
|
||||
<view class="textarea_row">
|
||||
<view class="name font13">设置备注</view>
|
||||
<view class="">
|
||||
<view class="name font_bold font13">备注</view>
|
||||
<view class="text textareaText">
|
||||
{{form.remark}}
|
||||
</view>
|
||||
</view>
|
||||
@ -40,7 +39,11 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form:{}
|
||||
form:{
|
||||
equipment_configs:[
|
||||
{ip:'',port:''}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad(options){
|
||||
@ -49,7 +52,6 @@
|
||||
methods: {
|
||||
getDetail(id){
|
||||
this.$api.postFuncLoading('/device.info',{id:id}).then(res=>{
|
||||
console.log(res)
|
||||
this.form = res.data
|
||||
})
|
||||
},
|
||||
@ -57,13 +59,13 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.content_row{display: flex;height: 44px;align-items: center;
|
||||
.name{width: 30%;font-size: 13px;}
|
||||
.data{font-size: 14px;}
|
||||
<style scoped lang="scss">
|
||||
.content_row{display: flex;align-items: center;padding-top: 17px;
|
||||
.name{flex-basis: 80px;}
|
||||
.text{flex: 1;}
|
||||
}
|
||||
.textarea_row{
|
||||
.name{padding: 12px 0;}
|
||||
// textarea{border-radius: 4px;background: rgba(255, 255, 255, 0.50);width: 100%;}
|
||||
.name{padding: 17px 0;}
|
||||
.textareaText{min-height: 80px;}
|
||||
}
|
||||
</style>
|
||||
|
@ -1,111 +1,229 @@
|
||||
<template>
|
||||
<page-meta>
|
||||
<navigation-bar title="添加设备" color="white"></navigation-bar>
|
||||
<template>
|
||||
<page-meta>
|
||||
<navigation-bar :title="this.form.id && this.form.id > 0?'编辑设备':'添加设备'"></navigation-bar>
|
||||
</page-meta>
|
||||
<view class="page_padding">
|
||||
<!-- <view class="page_name font14">
|
||||
添加/编辑设备
|
||||
</view> -->
|
||||
<view class="page_padding bot_padding">
|
||||
<view class="page_content contentboxsty font13">
|
||||
<view class="content_row">
|
||||
<view class="name">选择设备</view>
|
||||
<picker placeholder="请选择设备" @change="bindPickerChange" :value="index" :range="array" >
|
||||
<input type="text" :value="array[index]" placeholder="请选择设备" disabled />
|
||||
</picker>
|
||||
|
||||
<!-- <view class="">
|
||||
<picker @change="bindPickerChange" placeholder="请选择设备" :value="index" :range="array">
|
||||
<view class="uni-input" style="width: 70%;">{{array[index]}}</view>
|
||||
</picker>
|
||||
</view -->
|
||||
<view class="name font_bold">选择设备</view>
|
||||
<pickerSelect class="comView" @change="equipmentChange" :list="setMap.equipment" :id="form.eq_no" placeholder="请选择设备" />
|
||||
</view>
|
||||
<view class="content_row">
|
||||
<view class="name">设备自定义名称</view>
|
||||
<view class="">
|
||||
<input placeholder="请输入设备名称"/>
|
||||
|
||||
<view class="name font_bold">设备自定义名称</view>
|
||||
<view class="comView">
|
||||
<input v-model="form.name" placeholder="请输入设备名称"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content_row">
|
||||
<view class="name font_bold">设备编号</view>
|
||||
<view class="comView">
|
||||
<input v-model="form.code" placeholder="请输入设备编号"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content_row">
|
||||
<view class="name font_bold">设备功率</view>
|
||||
<view class="comView">
|
||||
<input v-model="form.power" placeholder="请输入设备功率"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content_row">
|
||||
<view class="name">设备功率</view>
|
||||
<view class="">
|
||||
<input placeholder="请输入设备功率"/>
|
||||
<view class="name font_bold">设备IP</view>
|
||||
<view class="comView">
|
||||
<input v-model="form.config[0].ip" placeholder="请输入设备IP"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content_row">
|
||||
<view class="name">设备IP</view>
|
||||
<view class="">
|
||||
<input placeholder="请输入设备IP"/>
|
||||
<view class="name font_bold">端口</view>
|
||||
<view class="comView">
|
||||
<input v-model="form.config[0].port" placeholder="请输入设备端口"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content_row">
|
||||
<view class="name">端口</view>
|
||||
<view class="">
|
||||
<input placeholder="请输入设备端口"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content_row">
|
||||
<view class="name">状态</view>
|
||||
<view class="flex_layout">
|
||||
<view class="switch" @click="switchSta(1)">
|
||||
<view v-if="selectSta==1" class="t-icon t-icon-qiyong1 contenticon"></view>
|
||||
<view v-else class="t-icon t-icon-jinyong2 contenticon"></view>
|
||||
<text class="text">启用</text>
|
||||
<view class="name font_bold">型号</view>
|
||||
<view class="flex_layout comView">
|
||||
<view class="switch" @click="form.config[0].plc_model = 'H3U'">
|
||||
<view v-if="form.config[0].plc_model=='H3U'" class="t-icon t-icon-qiyong1 contenticon"></view>
|
||||
<view v-else class="t-icon t-icon-jinyong1 contenticon"></view>
|
||||
<text class="text">H3U</text>
|
||||
</view>
|
||||
<view class="switch" @click="switchSta(2)">
|
||||
<view v-if="selectSta==2" class="t-icon t-icon-qiyong1 contenticon"></view>
|
||||
<view v-else class="t-icon t-icon-jinyong2 contenticon"></view>
|
||||
<text class="text">禁用</text>
|
||||
<view class="switch" @click="form.config[0].plc_model = 'H5U'">
|
||||
<view v-if="form.config[0].plc_model=='H5U'" class="t-icon t-icon-qiyong1 contenticon"></view>
|
||||
<view v-else class="t-icon t-icon-jinyong1 contenticon"></view>
|
||||
<text class="text">H5U</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content_row">
|
||||
<view class="name font_bold">逻辑控制器(PLC)</view>
|
||||
<pickerSelect class="comView" :list="setMap.plc" :id="form.plc_lj" placeholder="请选择设备" />
|
||||
</view>
|
||||
<view class="content_row">
|
||||
<view class="name font_bold">状态</view>
|
||||
<view class="flex_layout comView">
|
||||
<view class="switch" @click="form.active_status=true">
|
||||
<view v-if="form.active_status" class="t-icon t-icon-qiyong1 contenticon"></view>
|
||||
<view v-else class="t-icon t-icon-jinyong1 contenticon"></view>
|
||||
<text class="text">启用</text>
|
||||
</view>
|
||||
<view class="switch" @click="form.active_status=false">
|
||||
<view v-if="!form.active_status" class="t-icon t-icon-qiyong1 contenticon"></view>
|
||||
<view v-else class="t-icon t-icon-jinyong1 contenticon"></view>
|
||||
<text class="text">禁用</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="textarea_row">
|
||||
<view class="name">设置备注</view>
|
||||
<view class="name font_bold">设置备注</view>
|
||||
<view class="textarea">
|
||||
|
||||
<textarea />
|
||||
<textarea placeholder="请输入备注..." v-model="form.remark" cursor-spacing="180px" :auto-blur="true" placeholder-class="placeholderStyle" />
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom_but flex_layout">
|
||||
<view class="font13 but_color">保存</view>
|
||||
<view class="font13">取消</view>
|
||||
<view class="font13 but_color" @click="save">保存</view>
|
||||
<view class="font13" @click="cancel">取消</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
array: ['中国', '美国', '巴西', '日本'],
|
||||
selectSta:1,
|
||||
return {
|
||||
setMap:{
|
||||
equipment:[],
|
||||
plc:[
|
||||
{name:'汇川',value:1}
|
||||
]
|
||||
},
|
||||
|
||||
form:{
|
||||
id:'',
|
||||
eq_no:'',
|
||||
name:'',
|
||||
code:'',
|
||||
power:'',
|
||||
remark:'',
|
||||
active_status:true,
|
||||
plc_lj:1,
|
||||
config:[
|
||||
{
|
||||
eq_type:'',
|
||||
ip:'',
|
||||
port:'',
|
||||
plc_model:'H3U'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
onLoad(option) {
|
||||
this.form.id = option.id;
|
||||
if(option.id!='undefined'){
|
||||
this.getOrderInfo(option.id);
|
||||
}
|
||||
},
|
||||
onReady() {
|
||||
this.getEquipment();
|
||||
},
|
||||
methods: {
|
||||
switchSta(type){
|
||||
console.log(type)
|
||||
this.selectSta = type;
|
||||
},
|
||||
methods: {
|
||||
getOrderInfo(id){
|
||||
this.$api.postFuncLoading('/device.info',{id:id}).then(res=>{
|
||||
this.form = {
|
||||
id:res.data.id,
|
||||
eq_no:res.data.eq_no,
|
||||
name:res.data.name,
|
||||
code:res.data.code,
|
||||
power:res.data.power,
|
||||
remark:res.data.remark,
|
||||
active_status:res.data.active_status,
|
||||
plc_lj:1,
|
||||
config:[
|
||||
{
|
||||
eq_type:res.data.equipment_configs[0].eq_type,
|
||||
ip:res.data.equipment_configs[0].ip,
|
||||
port:res.data.equipment_configs[0].port,
|
||||
plc_model:res.data.equipment_configs[0].plc_model
|
||||
}
|
||||
]
|
||||
}
|
||||
}).catch(err=>{
|
||||
|
||||
})
|
||||
},
|
||||
getEquipment(){
|
||||
this.$api.request('/equipment.select',{}).then(res=>{
|
||||
res.data.forEach(item=>{
|
||||
item.name = item.eq_name;
|
||||
item.value = item.eq_no;
|
||||
})
|
||||
this.setMap['equipment'] = res.data;
|
||||
})
|
||||
},
|
||||
equipmentChange(e){
|
||||
this.form.eq_no = e.value;
|
||||
this.form.name = e.name;
|
||||
},
|
||||
save(){
|
||||
if(!(this.form.id && this.form.id>0)){
|
||||
delete this.form.id
|
||||
}
|
||||
this.$api.postFuncLoading('/equipment.add',this.form).then(res=>{
|
||||
this.parentClick();
|
||||
this.reset();
|
||||
this.$wf.toast({type:'success',text:'保存成功'});
|
||||
})
|
||||
},
|
||||
cancel(){
|
||||
this.reset();
|
||||
},
|
||||
reset(){
|
||||
this.form = {
|
||||
id:'',
|
||||
eq_no:'',
|
||||
name:'',
|
||||
code:'',
|
||||
power:'',
|
||||
remark:'',
|
||||
active_status:true,
|
||||
plc_lj:1,
|
||||
config:[
|
||||
{
|
||||
eq_type:'',
|
||||
ip:'',
|
||||
port:'',
|
||||
plc_model:'H3U'
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
parentClick(){
|
||||
const pages = getCurrentPages();
|
||||
if (pages.length >= 2) {
|
||||
const prevPage = pages[pages.length - 2];
|
||||
prevPage.$vm.getList();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
<style scoped lang="scss">
|
||||
.page_name{margin-bottom: 10px;}
|
||||
.page_content{padding: 0 12px 10px;}
|
||||
.page_content{padding: 0 12px 13px;}
|
||||
.content_row{display: flex;border-bottom: 1px solid #2D3A6F;height: 44px;align-items: center;
|
||||
.name{width: 30%;}
|
||||
.name{flex-basis: 110px;}
|
||||
.switch{display: flex;align-items: center;
|
||||
.contenticon{width: 20px;height: 20px;}
|
||||
.contenticon{font-size: 15px;}
|
||||
.text{padding: 0 20px 0 5px;}
|
||||
}
|
||||
}
|
||||
.textarea_row{
|
||||
.textarea_row{
|
||||
.name{padding: 12px 0;}
|
||||
.textarea{border-radius: 4px;background: rgba(255, 255, 255, 0.50);padding:5px 10px;
|
||||
textarea{width: 100%;}
|
||||
}
|
||||
.textarea{border-radius: 4px;background: $uni-bg-color-placeholder;padding:10px 12px;}
|
||||
}
|
||||
</style>
|
||||
|
@ -1,39 +1,36 @@
|
||||
<template>
|
||||
<!-- 设备管理 -->
|
||||
<view class="page_padding bot_padding">
|
||||
<view class="" v-for="(item,index) in list" :key="index" >
|
||||
<view class="page_list contentboxsty font13" @click="toDeviceDetail(item.id)">
|
||||
<view class="list_row">
|
||||
<view class="row_name">
|
||||
设备名称
|
||||
<view class="page_padding bot_padding columnFlex">
|
||||
<view class="flexBox">
|
||||
<view v-for="(item,index) in list" :key="index" >
|
||||
<view class="page_list contentboxsty font13" @click="toDeviceDetail(item.id)">
|
||||
<view class="list_row">
|
||||
<view class="name font_bold">设备名称</view>
|
||||
<view class="text">
|
||||
{{item.name}}
|
||||
<view class="iconfont icon-bianji font20" @click.stop="toAddDevice(item.id)"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list_row padd_top12">
|
||||
<view class="name font_bold">设备IP/端口</view>
|
||||
<view class="text">{{item.equipment_monitor_config?item.equipment_monitor_config.monitor_ip+'/'+item.equipment_monitor_config.monitor_port:'-'}}</view>
|
||||
</view>
|
||||
<view class="row_data">
|
||||
{{item.name}}
|
||||
<view class="list_row padd_top12">
|
||||
<view class="name font_bold">已绑定设备</view>
|
||||
<view class="text">
|
||||
{{item.equipment_monitor_config && item.equipment_monitor_config.eq_name?item.equipment_monitor_config.eq_name:'-'}}
|
||||
<view class="iconfont icon-bangding font20" @click="toBindingDevice(item.id)"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="iconfont icon-bianji font20" @click="toAddDevice()"></view>
|
||||
</view>
|
||||
<view class="list_row">
|
||||
设备IP/端口
|
||||
</view>
|
||||
<view class="list_row">
|
||||
<view class="row_name">
|
||||
已绑定设备
|
||||
</view>
|
||||
<view class="row_data">
|
||||
{{item.name}}
|
||||
</view>
|
||||
<view class="iconfont icon-bangding font20" @click="toBindingDevice()"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<loadMore :noData="loadParams.noData" :loading="loadParams.loading" :loadEnd="loadParams.loadEnd" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="page_bottom_button">
|
||||
<view class="page_add" @click="toAddDevice()">
|
||||
<!-- <view class="name_left font14">
|
||||
系统设备管理
|
||||
</view> -->
|
||||
<view class="iconfont icon-tianjia font24"></view>
|
||||
<text>添加</text>
|
||||
<view class="page_add" @click="toAddDevice()">
|
||||
<view class="icon iconfont icon-tianjia font20"></view>
|
||||
<text class="font14">添加</text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
@ -42,46 +39,97 @@
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list:[]
|
||||
return {
|
||||
params:{
|
||||
page:1,
|
||||
pageSize:10,
|
||||
},
|
||||
loadParams:{
|
||||
noData:false,
|
||||
loading:false,
|
||||
loadEnd:false
|
||||
},
|
||||
list:[],
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
onReady() {
|
||||
this.getList();
|
||||
},
|
||||
// 上拉刷新
|
||||
onPullDownRefresh(){
|
||||
this.params.page = 1;
|
||||
this.loadParams = {
|
||||
noData:false,
|
||||
loading:false,
|
||||
loadEnd:false
|
||||
};
|
||||
this.getList(2);
|
||||
},
|
||||
// 加载下一页
|
||||
onReachBottom(){
|
||||
if(!(this.loadParams.loadEnd || this.loadParams.noData)){
|
||||
this.loadParams.loading = true;
|
||||
this.params.page ++;
|
||||
this.getList();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getList(){
|
||||
// this.$api.postFuncLoading('/equipment.mag',{}).then(res=>{
|
||||
// console.log(res)
|
||||
// this.list = res.data.rows;
|
||||
// })
|
||||
getList(type=1){
|
||||
if(this.params.page == 1){
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
})
|
||||
}
|
||||
this.$api.request('/equipment.mag',this.params).then(res=>{
|
||||
if(type ==2){
|
||||
uni.stopPullDownRefresh();
|
||||
}
|
||||
setTimeout( ()=> {
|
||||
uni.hideLoading();
|
||||
}, 200);
|
||||
|
||||
this.loadParams.loading = false;
|
||||
if(res.data.rows.length ==0 && this.params.page == 1){
|
||||
this.loadParams.noData = true;
|
||||
}
|
||||
if(res.data.rows.length>0 && res.data.rows.length < this.params.pageSize){
|
||||
this.loadParams.loadEnd = true;
|
||||
}
|
||||
if(this.params.page == 1){
|
||||
this.list = res.data.rows;
|
||||
}else{
|
||||
this.list = this.list.concat(res.data.rows);
|
||||
}
|
||||
}).catch(err=>{
|
||||
setTimeout(()=> {
|
||||
uni.hideLoading();
|
||||
}, 200);
|
||||
})
|
||||
},
|
||||
//详情
|
||||
toDeviceDetail(id){
|
||||
console.log(id)
|
||||
uni.navigateTo({
|
||||
url:'/pages/equipmentManage/deviceDetail?id='+id
|
||||
})
|
||||
},
|
||||
toAddDevice(){
|
||||
toAddDevice(params){
|
||||
uni.navigateTo({
|
||||
url:'/pages/equipmentManage/editDevice'
|
||||
url:'/pages/equipmentManage/editDevice?id='+params
|
||||
})
|
||||
},
|
||||
toBindingDevice(){
|
||||
toBindingDevice(id){
|
||||
uni.navigateTo({
|
||||
url:'/pages/equipmentManage/bindingDevice'
|
||||
url:'/pages/equipmentManage/bindingDevice?id='+id
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
/* .page_name{display: flex;margin-bottom: 10px;align-items: center;} */
|
||||
/* .name_left{flex: 1;} */
|
||||
.page_list{padding: 6px 12px;}
|
||||
.list_row{display: flex;padding: 6px 0;align-items: center;}
|
||||
.row_name{width:30%;}
|
||||
.row_data{width: 65%;}
|
||||
<style scoped lang="scss">
|
||||
.page_list{padding: 12px;}
|
||||
.list_row{display: flex;align-items: center;}
|
||||
.list_row .name{flex-basis: 84px;text-align: right;padding-right: 12px;box-sizing: border-box;}
|
||||
.list_row .text{flex: 1;display: flex;justify-content: space-between;align-items: center;}
|
||||
</style>
|
||||
|
Reference in New Issue
Block a user