From fa26f2a9f2d08c5ea3ddb875308d5a717076df74 Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Thu, 1 Aug 2019 16:47:18 +0800 Subject: [PATCH] update Former-commit-id: 64cab16d60a40e39e225882ed3e779fe4d34f17a --- .../StreamingAssets/IoT.Resources.csproj | 2 + .../wwwroot/images/temperature.png | Bin 0 -> 1064 bytes .../StreamingAssets/wwwroot/index2.html | 232 ++++++++---------- 3 files changed, 101 insertions(+), 133 deletions(-) create mode 100644 projects/IoTClient/Assets/StreamingAssets/wwwroot/images/temperature.png diff --git a/projects/IoTClient/Assets/StreamingAssets/IoT.Resources.csproj b/projects/IoTClient/Assets/StreamingAssets/IoT.Resources.csproj index 1692dab5..cd818903 100644 --- a/projects/IoTClient/Assets/StreamingAssets/IoT.Resources.csproj +++ b/projects/IoTClient/Assets/StreamingAssets/IoT.Resources.csproj @@ -11,5 +11,7 @@ + + \ No newline at end of file diff --git a/projects/IoTClient/Assets/StreamingAssets/wwwroot/images/temperature.png b/projects/IoTClient/Assets/StreamingAssets/wwwroot/images/temperature.png new file mode 100644 index 0000000000000000000000000000000000000000..775fd69d70672cff35de4c5110a1c8f9ee930ac2 GIT binary patch literal 1064 zcmV+@1lRkCP)M>z5i9l3t|2WZ-Y`?J6}Ji`e-OTZ=G(RHW$fUOrmh<0!V z<~|6ghG51V-~jC0pzAK`f~gPSDeNKQ+cn`?rHlm}y1|8eUk5}z075+Tow?)u4kG0? z%pDMYG@cV(*8x!-U>u%;I81h)@q!cTHb@|dZ*b8bR&k~30F#;UaajHfQb5VqDu)x&J-8!$i^bg12{Cml7A`-@}q4`G!H;D zl!Z^lP_Q$GGUjO>AfiiIy@69ic(groG!H;LO42a!2(P8$q2Q-^0I%g2)SCO+{s1Pg zLx6t7zCDE3zL9^grO`vQz&Px{;b&vZRy86E5K#{&P*zwXK-ZnySY$sIFhwdon*c-% zMD#7T)Es{M`p5ueC6131hmuBZETGb;iWS0}?Gd|q7ZQ~?JsTZJ8nv;&L8j580T4|* z@pICRL%LGE2L;k_~=2fM6!ZC~Aj^ zzDq%QZj-k;0>W>7l8-!os+{dV=EMT1xcz8dW6jgKgVe%l<$7Z6t#Kp!WjMW~1y=|auGPu;43@YO5j z0F0f(JU-7XkUb`3g@~YE4S%y!?ULj6asb(^qpECIPNh|q9)RJ4;wvUGE+HBv&C1$2 z3UBaRX5}tuh4KK|qX6@Lq3ffpc)b`F6s^Bj9za!6^JYd=S)x8X_aRryBoy~&1LK@j z@(58a26T0K*Gu9#BLMLfa28+|W0OwK{h9SRJ-ad0EU;QlUhqZ3wR^BlE+I0J3Pf510YrwzU@SPF!~!oL>3ZPOp!CFdN)>|3*~K#NV6Zrv^i1}H^Kr-XH@3Azbmfm iv%s!j+SBu+2lxlQ(|b?7od%Hr0000 + @@ -88,6 +89,7 @@ + @@ -99,6 +101,7 @@ + @@ -133,6 +136,7 @@ + @@ -140,6 +144,7 @@ + @@ -150,10 +155,11 @@ + - + @@ -750,142 +756,12 @@ + - + - 属性 - - - - - - info - - {{data.Name}} - - - {{data.Value}} - - - - {{data.Unit}} - - - - {{data.Description}} - - - - - - - - - - - - - - - - 操作 - - - - - 预览 - 预览 - - - - - - - - - - - - - {{parameter.Description}} - - - - 请选择 - {{option.text}} - - - - - - - - - - - - - - - - - - - - - - {{api.Name}} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1300,6 +1176,92 @@ } }); + Vue.component('page-device', { + template: '#page-device', + data() { + return { + Device: { + Number: null, + Name: null, + Data: [], + Apis: [] + } + } + }, + mounted() { + var number = this.$f7route.params.number; + vm.Device = _.first(_.filter(vm.Node.Devices, function (o) { return o.Number == number; })); + }, + methods: { + isSelect: function (device, key) { + return _.filter(device.Data, function (o) { return o.Key == key + '[]' }).length > 0; + }, + getSelect: function (device, key) { + var data = _.first(_.filter(device.Data, function (o) { return o.Key == key + '[]' })).Value; + var result = JSON.parse(data); + return result; + }, + getParameter: function (name) { + console.log(name); + var prop = _.chain(this.Device.Data).filter(function (o) { return o.Key == name; }).first().value(); + return prop ? prop.Value : ''; + }, + call: function (e) { + if (!$(e.target).valid()) { + return; + } + var url = vm.IoTServer + '/App/Exec/?connectionId=' + vm.ConnectionId + '&node=' + this.getNodeNumber(this.Device.NodeId) + '&' + $(e.target).serialize(); + ajax(url); + }, + getNodeNumber(nodeId) { + return _.chain(vm.Nodes).filter(function (o) { + return o.Id === nodeId; + }).first().value().Number; + }, + showData(name) { + if (name === 'hidden' || name.indexOf('rtsp') != -1 || name.indexOf('rtmp') != -1 || name.indexOf('flv') != -1 || name.indexOf('hls') != -1) { + return false; + } + return true; + }, + showApi(api) { + if (this.Device.Name === '摄像头') { + if (this.getParameter('Ptz3DZoomSupport') === '否') { + if (api.Name !== '截屏') { + return false; + } + } + } + return true; + }, + getUrl(type) { + var url = _.chain(this.Device.Data).filter(function (o) { return o.Name === (type + '2'); }).first().value().Value; + url += '?id=' + this.Device.Id; + url += '&host=' + encodeURIComponent(vm.IoTServer); + url += '&node=' + _.chain(vm.Nodes).filter(function (o) { return o.Id === device.Device.NodeId; }).first().value().Number; + if (this.getParameter('Ptz3DZoomSupport') !== '否') { + url += '&ptz=true'; + } + return url; + }, + flv() { + this.$f7router.navigate('/camera/', { + props: { + name: this.Device.DisplayName || this.Device.Name, + url: this.getParameter('flv2'), + ptz: this.getParameter('Ptz3DZoomSupport') !== '否', + node: this.getNodeNumber(this.Device.NodeId), + id: this.Device.Id, + hls: this.getParameter('hls2') + } + }); + } + }, + destroyed() { + device = null; + }, + }); + Vue.component('page-not-found', { template: '#page-not-found' }); @@ -1326,6 +1288,10 @@ path: '/node/:number/name/:name', component: 'page-node' }, + { + path: '/device/:number/name/:name', + component: 'page-device' + }, { path: '(.*)', component: 'page-not-found',