Former-commit-id: 283e8b572e306ca020467248b7cfd83c4690351c
TangShanKaiPing
wanggang 5 years ago
commit 02f509eadd

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 46 KiB

@ -894,7 +894,7 @@ ul {
.weui-header{
top: 0;
color: #ffffff;
background-color: #07c160;
background-color: #35A9FE;
position: fixed;
right: 0;
left: 0;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 66 KiB

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1590482135471" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2785" xmlns:xlink="http://www.w3.org/1999/xlink" width="1024" height="1024"><defs><style type="text/css"></style></defs><path d="M718.933333 106.666667L469.333333 362.666667l320 106.666666-334.933333 313.6 108.8 59.733334L256 917.333333l57.6-315.733333 61.866667 108.8L576 512l-320-106.666667L533.333333 106.666667h185.6z" fill="#00BCD4" p-id="2786"></path></svg>

After

Width:  |  Height:  |  Size: 613 B

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1590481962936" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1297" xmlns:xlink="http://www.w3.org/1999/xlink" width="1024" height="1024"><defs><style type="text/css"></style></defs><path d="M759.091 384.307c-53.043 0-96.051-43.008-96.051-96.051s96.051-143.974 96.051-143.974 96.051 91.033 96.051 143.974c0.103 53.043-42.905 96.051-96.05 96.051z m0-192.102s-64 60.723-64 96.051c0 35.43 28.672 64 64 64 35.43 0 64-28.57 64-64 0-35.328-64-96.051-64-96.051z m-320 688.23c-150.323 0-272.179-123.597-272.179-276.07s272.18-460.186 272.18-460.186 271.974 307.61 271.974 460.186-121.652 276.07-271.975 276.07zM214.938 604.16c0 126.157 100.25 228.352 224.05 228.352 123.7 0 224.052-102.195 224.052-228.352 0-126.26-224.051-395.878-224.051-395.878S214.938 477.9 214.938 604.16zM439.09 816.435c-114.893 0-208.179-92.467-208.179-206.643 0-114.074 108.237-56.32 208.18 0 100.249 56.525 207.974-114.074 207.974 0 0 114.176-93.184 206.643-207.975 206.643z m0 0" fill="#06DCF3" p-id="1298"></path></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 46 KiB

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1590478482401" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2071" xmlns:xlink="http://www.w3.org/1999/xlink" width="1024" height="1024"><defs><style type="text/css"></style></defs><path d="M688.6 165.4l0 102c88.4 58.6 147.6 159.8 147.6 275 0 181.4-145.4 328.4-325 328.4S186 723.8 186 542.4c-0.2-115.2 59.2-216.6 147.6-275.2L333.6 166C195 233 98 376.8 98 543.2c0 230.6 185.4 417.8 413.8 417.8 228.4 0 413.6-187 413.6-417.8C925.4 376.6 829 232.4 688.6 165.4z" p-id="2072" fill="#d81e06"></path><path d="M511 482.8c32.6 0 59.8-26.8 59.8-59.6L570.8 124.6c0-33-27.2-59.6-59.8-59.6-32.6 0-59.8 26.8-59.8 59.6l0 298.4C451.4 456 478.6 482.8 511 482.8z" p-id="2073" fill="#d81e06"></path></svg>

After

Width:  |  Height:  |  Size: 875 B

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1590478482401" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2071" xmlns:xlink="http://www.w3.org/1999/xlink" width="1024" height="1024"><defs><style type="text/css"></style></defs><path d="M688.6 165.4l0 102c88.4 58.6 147.6 159.8 147.6 275 0 181.4-145.4 328.4-325 328.4S186 723.8 186 542.4c-0.2-115.2 59.2-216.6 147.6-275.2L333.6 166C195 233 98 376.8 98 543.2c0 230.6 185.4 417.8 413.8 417.8 228.4 0 413.6-187 413.6-417.8C925.4 376.6 829 232.4 688.6 165.4z" p-id="2072" fill="#1afa29"></path><path d="M511 482.8c32.6 0 59.8-26.8 59.8-59.6L570.8 124.6c0-33-27.2-59.6-59.8-59.6-32.6 0-59.8 26.8-59.8 59.6l0 298.4C451.4 456 478.6 482.8 511 482.8z" p-id="2073" fill="#1afa29"></path></svg>

After

Width:  |  Height:  |  Size: 875 B

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1590482293188" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4356" xmlns:xlink="http://www.w3.org/1999/xlink" width="1024" height="1024"><defs><style type="text/css"></style></defs><path d="M608.286118 553.110588V169.923765a143.36 143.36 0 0 0-286.659765 0v383.186823c-57.705412 43.670588-95.563294 112.218353-95.563294 190.102588a238.893176 238.893176 0 0 0 477.786353 0c0-77.914353-37.857882-146.432-95.563294-190.102588z m-8.131765 325.270588a191.126588 191.126588 0 0 1-326.294588-135.198117c0-70.354824 38.761412-131.192471 95.563294-164.171294V169.923765a95.593412 95.593412 0 0 1 191.156706 0v409.088c56.801882 33.069176 95.533176 93.756235 95.533176 164.171294a191.066353 191.066353 0 0 1-55.988706 135.168z" fill="#FFB95E" p-id="4357"></path><path d="M566.332235 641.837176a143.239529 143.239529 0 0 0-54.874353-34.213647v-246.663529H418.454588v246.663529a143.299765 143.299765 0 1 0 147.877647 34.213647z m161.460706-566.061176a71.619765 71.619765 0 1 0-0.090353 143.239529 71.619765 71.619765 0 0 0 0.090353-143.239529zM727.642353 169.863529a23.853176 23.853176 0 1 1 0-47.706353 23.853176 23.853176 0 0 1 0 47.706353z" fill="#FFB95E" p-id="4358"></path></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

@ -1,5 +1,6 @@
var userAgent = navigator.userAgent;
var isApp = userAgent.indexOf('isapp') !== -1;
var localStoreMsg = false; // 是否本地存储消息
/* API 网关 */
var apigateway = config.apigateway;
console.log('config:');
@ -171,6 +172,10 @@ var onReturnBack = function (){
}
}
window.addEventListener("popstate", function(e) {
$('.weui-header a.weui-header-left')[0].click();
}, false);
// indexedDB兼容
var indexedDB = window.indexedDB || window.webkitindexedDB || window.msIndexedDB || mozIndexedDB || null;
@ -214,7 +219,10 @@ function saveMessage(msg){
// 校验数据格式(当前只存储带key的消息后续会有调整)
if( jsonMsg.key ){
console.log('IS MSG');
objectStore.add({data: jsonMsg});
// 本地存储
if(localStoreMsg){
objectStore.add({data: jsonMsg});
}
// objectStore.delete(store.state.messages[0]._id);
store.commit('setMessages', [{data: jsonMsg}]);
}

@ -76,6 +76,20 @@ function execScene(id) {
});
}
function nodePower(number, command) {
var loading = weui.loading('提交中...');
axios.post('/IoTCenter/api/v1/node/power'+command, '"' + number + '"', { headers: { 'Content-Type': 'application/json;charset=UTF-8' } })
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
})
.finally(function () {
loading.hide();
});
}
/**
* 格式化时间
* @param {*} value

@ -20,7 +20,7 @@
</div>
<div class="weui-news-info">
<div class="weui-news-infoitem">
<img :onerror="'this.src=\'' + config.apigateway + '/images/info.svg' + '\'' " :src="config.apigateway+'/IoTCenter'+'/images/'+ iconMessage(message.data.key, message.data.value) +'.png'" class="weui-news-round" /><span class="weui-news-left">{{message.data.description}}</span>
<img :onerror="'this.src=\'' + config.apigateway + '/images/info.svg' + '\'' " :src="config.apigateway+'/images/'+ iconMessage(message.data.key, message.data.value).toLowerCase() +'.svg'" class="weui-news-round" /><span class="weui-news-left">{{message.data.description}}</span>
</div>
<div class="weui-news-infoitem">{{ formatDate(message.data.timestamp) }}</div>
</div>
@ -97,11 +97,11 @@
</div>
<div class="weui-panel__ft"> <a href="javascript:void(0);" class="weui-cell weui-cell_link">
<div class="weui-cell__bd">Email</div>
<span class="weui-cell__ft">{{user ? user.email : '' }}</span> </a>
<span class="weui-cell__ft">{{ user ? user.email : '' }}</span> </a>
</div>
<div class="weui-panel__ft"> <a href="javascript:void(0);" class="weui-cell weui-cell_link">
<div class="weui-cell__bd">生日</div>
<span class="weui-cell__ft">{{user ? user.birthday.replace('T00:00:00', '') : '' }}</span> </a>
<span class="weui-cell__ft">{{(user && user.birthday) ? user.birthday.replace('T00:00:00', '') : '' }}</span> </a>
</div>
<div class="weui-panel__ft" style="display: none;"> <a href="javascript:void(0);" class="weui-cell weui-cell_link">
<div class="weui-cell__bd">地区</div>

@ -13,11 +13,11 @@
<div class="card-header">场景</div>
<div class="card-body">
<div class="row">
<div class="col" v-for="scene in scenes" v-on:click="execScene(scene.id)">
<div class="col-md-2 col-sm-4 col-6 p-3" v-for="scene in scenes" v-on:click="execScene(scene.id)">
<div class="weui-grid__icon">
<img class="weui-tabbar__icon" :src="'/IoTCenter'+scene.image" />
<img class="weui-tabbar__icon" :src="scene.image.replace('.png', '.svg')" style="width:48px;margin: auto auto" />
</div>
<p class="weui-grid__label">{{scene.name}}</p>
<p class="weui-grid__label" style="text-align: center;">{{scene.name}}</p>
</div>
</div>
</div>
@ -79,7 +79,7 @@
<iot-ir v-bind:device="device"></iot-ir>
</div>
<!--串口控制器-->
<div v-for="device in getDevices('串口控制器')" class="col" style="min-width:320px;">
<div v-if="getShowFlag('串口控制器')" v-for="device in getDevices('串口控制器')" class="col" style="min-width:320px;">
<iot-serial-port v-bind:device="device"></iot-serial-port>
</div>
</div>

@ -28,6 +28,12 @@
getDevices: function (name) {
return Enumerable.from(this.node.devices).where(function (o) { return o.name === name; }).toArray();
},
getShowFlag:function (name){
arr = Enumerable.from(this.node.devices).where(function (o) { return o.name === name; }).toArray();
console.log('arrarrarrarr', arr)
console.log('arrarrarrarr', JSON.parse(arr[0].data[0].value)[0].name)
return JSON.parse(arr[0].data[0].value)[0].name !== '测试' ? true : false;
},
getDeviceDataAttr: function (number, name, attr) {
var device = Enumerable.from(this.node.devices).where(function (o) { return o.number === number; }).firstOrDefault();
var data = Enumerable.from(device.data).where(o => o.name === name).firstOrDefault();

@ -1,27 +1,50 @@
<div class="page js_show">
<div class="weui-header">
<router-link to="/" class="weui-header-left">
<i class="ion ion-ios-arrow-back"></i>
</router-link>
<h1 class="weui-header-title">智慧教室</h1>
</div>
<div class="main">
<div class="row p-1">
<div class="col-md-2 col-sm-3 col-4 p-1" v-for="node in nodes" >
<div class="card">
<div class="card-header">
<input type="checkbox" name="numbers[]" class="item" value="{{node.number}}">
<span class="float-right text-success" v-if="node.isOnline"><i class="ion ion-ios-wifi"></i></span>
<span class="float-right text-danger" v-else><i class="ion ion-ios-wifi"></i></span>
</div>
<router-link :to="{path:'/pages/iot/node',query:{number:node.number}}">
<div class="weui-grid__icon">
<img :src="node.image.replace('.png', '.svg')" style="width:32px; margin:auto auto" />
<div class="weui-tab">
<div class="weui-tab__panel bg-white" style="display: block;">
<div class="weui-header">
<router-link to="/" class="weui-header-left">
<i class="ion ion-ios-arrow-back"></i>
</router-link>
<h1 class="weui-header-title">智慧教室</h1>
<div class="weui-header-right" style="display: none;"><a class="ion ion-ios-more"></a></div>
</div>
<div class="main">
<div class="row weui-cells_checkbox p-1">
<div class="col-md-2 col-sm-3 col-4 p-1" v-for="node in nodes" >
<div class="card">
<div class="card-header" style="padding: 0">
<label class="weui-check__label" style="display: block; padding: .75rem 1.25rem; margin:0">
<input type="checkbox" name="numbers[]" class="weui-check item" :value="node.number"><i class="weui-icon-checked"></i>
<span class="float-right text-success" v-if="node.isOnline"><i class="ion ion-ios-wifi"></i></span>
<span class="float-right text-danger" v-else><i class="ion ion-ios-wifi"></i></span>
</label>
</div>
<p class="weui-grid__label">{{node.name}}{{node.count}}</p>
</router-link>
<router-link :to="{path:'/pages/iot/node',query:{number:node.number}}">
<div class="weui-grid__icon">
<img :src="node.image.replace('.png', '.svg')" style="width:32px; margin:auto auto" />
</div>
<p class="weui-grid__label">{{node.name}}{{node.count}}</p>
</router-link>
</div>
</div>
</div>
</div>
</div>
<div class="weui-tabbar">
<a href="javascript:;" v-on:click="selectAll();" class="weui-tabbar__item">
<i class="ion ion-md-checkmark weui-tabbar__icon"></i>
<p class="weui-tabbar__label">全部选取</p>
</a>
<a href="javascript:;" v-on:click="resetAll()" class="weui-tabbar__item">
<i class="ion ion-md-radio-button-off weui-tabbar__icon"></i>
<p class="weui-tabbar__label">取消选取</p>
</a>
<a href="javascript:;" v-on:click="setPower('On')" class="weui-tabbar__item">
<i class="ion ion-ios-flash weui-tabbar__icon"></i>
<p class="weui-tabbar__label">批量开启</p>
</a>
<a href="javascript:;" v-on:click="setPower('Off')" class="weui-tabbar__item">
<i class="ion ion-ios-flash-off weui-tabbar__icon"></i>
<p class="weui-tabbar__label">批量关闭</p>
</a>
</div>
</div>

@ -25,6 +25,26 @@
store.commit('setNodes', []);
},
methods: {
selectAll:function(){
$("input[type='checkbox']").each(function(idx,el){
el.checked = true
})
},
resetAll:function(){
$("input[type='checkbox']").each(function(idx,el){
el.checked = false
})
},
setPower:function(method){
var els = $('.item:checked');
if (els.length) {
els.each(function(idx, el){
nodePower(el.value, method);
})
} else {
weui.topTips('没有选择任何项', { duration: 3000 });
}
}
},
computed: {
nodes: function () {

Loading…
Cancel
Save