@ -22,70 +22,10 @@
< / f7-view >
< / f7-app >
< / div >
< template id = "page-home" >
< f7-page :page-content = "false" @ page:reinit = "vm.init" >
< f7-navbar >
< f7-nav-title > {{vm.Title}}< / f7-nav-title >
< / f7-navbar >
< f7-toolbar tabbar labels bottom >
< f7-link tab-link = "#tab-message" icon-ios = "f7:chat" icon-md = "f7:chat" text = "消息" > < / f7-link >
< f7-link tab-link = "#tab-nodes" icon-ios = "f7:data" icon-md = "f7:data" text = "智慧教室" tab-link-active > < / f7-link >
< f7-link tab-link = "#tab-user" icon-ios = "f7:person" icon-md = "f7:person" text = "我的" > < / f7-link >
< / f7-toolbar >
< f7-tabs >
< f7-tab id = "tab-message" class = "page-content" >
< template v-for = "message in vm.Messages" >
< template v-if = "message&&message.Data.length" >
< div class = "block-title" > {{message.DisplayName||message.Name}}< / div >
< div class = "list" >
< ul v-if = "message.Data.length" >
< template v-for = "p in message.Data" >
< li v-if = "p.Name!=='hidden'" >
< div class = "item-content" >
< div class = "item-media" > < i class = "f7-icons" > info< / i > < / div >
< div class = "item-inner" >
< div class = "item-title" > {{p.Name}}< / div >
< div class = "item-after" >
< span class = "badge color-blue" >
{{p.Value}}
< / span >
< span > < / span >
< span class = "badge color-blue" v-if = "p.Unit" >
{{p.Unit}}
< / span >
< span > < / span >
< span class = "badge color-blue" v-if = "p.Description" >
{{p.Description}}
< / span >
< / div >
< / div >
< / div >
< / li >
< / template >
< / ul >
< / div >
< / template >
< / template >
< / f7-tab >
< f7-tab id = "tab-nodes" class = "page-content" tab-active >
< f7-list >
< f7-list-item v-for = "node in vm.Nodes" :title = "node.Name" :badge = "node.Count" :link = "'/node/'+node.Number+'/name/'+node.Name" > < / f7-list-item >
< / f7-list >
< / f7-tab >
< f7-tab id = "tab-user" class = "page-content" >
< f7-list >
< f7-list-item title = "用户名" :after = "vm.UserName" > < / f7-list-item >
< f7-list-item title = "昵称" :after = "vm.NickName" > < / f7-list-item >
< f7-list-item link = "/login/" title = "注销" > < / f7-list-item >
< / f7-list >
< / f7-tab >
< / f7-tabs >
< / f7-page >
< / template >
< template id = "page-login" >
< f7-page >
< f7-navbar title = "登录" > < / f7-navbar >
< form v-bind:action = "Server+'/Account/AppLogin'" v-on:submit . prevent = "OnSubmit" >
< form v-bind:action = "Server+'/Account/AppLogin'" v-on:submit . prevent = "OnSubmit" class = "login" >
< div class = "list" >
< ul >
< li class = "item-content item-input item-input-outline" >
@ -144,16 +84,78 @@
< / form >
< / f7-page >
< / template >
< template id = "page-home" >
< f7-page :page-content = "false" @ page:reinit = "vm.init" >
< f7-navbar >
< f7-nav-title > {{vm.Title}}< / f7-nav-title >
< / f7-navbar >
< f7-toolbar tabbar labels bottom >
< f7-link tab-link = "#tab-message" icon-ios = "f7:chat" icon-md = "f7:chat" text = "消息" > < / f7-link >
< f7-link tab-link = "#tab-nodes" icon-ios = "f7:data" icon-md = "f7:data" text = "智慧教室" tab-link-active > < / f7-link >
< f7-link tab-link = "#tab-user" icon-ios = "f7:person" icon-md = "f7:person" text = "我的" > < / f7-link >
< / f7-toolbar >
< f7-tabs >
< f7-tab id = "tab-message" class = "page-content" >
< template v-for = "message in vm.Messages" >
< template v-if = "message&&message.Data.length" >
< div class = "block-title" > {{message.DisplayName||message.Name}}< / div >
< div class = "list" >
< ul v-if = "message.Data.length" >
< template v-for = "p in message.Data" >
< li v-if = "p.Name!=='hidden'" >
< div class = "item-content" >
< div class = "item-media" > < i class = "f7-icons" > info< / i > < / div >
< div class = "item-inner" >
< div class = "item-title" > {{p.Name}}< / div >
< div class = "item-after" >
< span class = "badge color-blue" >
{{p.Value}}
< / span >
< span > < / span >
< span class = "badge color-blue" v-if = "p.Unit" >
{{p.Unit}}
< / span >
< span > < / span >
< span class = "badge color-blue" v-if = "p.Description" >
{{p.Description}}
< / span >
< / div >
< / div >
< / div >
< / li >
< / template >
< / ul >
< / div >
< / template >
< / template >
< / f7-tab >
< f7-tab id = "tab-nodes" class = "page-content" tab-active >
< f7-list >
< f7-list-item icon-ios = "f7:chat" icon-md = "f7:chat" v-for = "node in vm.Nodes" :title = "node.Name" :badge = "node.Count" :link = "'/node/'+node.Number+'/name/'+node.Name" >
< f7-icon slot = "media" f7 = "link" > < / f7-icon >
< / f7-list-item >
< / f7-list >
< / f7-tab >
< f7-tab id = "tab-user" class = "page-content" >
< f7-list >
< f7-list-item title = "用户名" :after = "vm.UserName" > < / f7-list-item >
< f7-list-item title = "昵称" :after = "vm.NickName" > < / f7-list-item >
< f7-list-item link = "/login/" title = "注销" > < / f7-list-item >
< / f7-list >
< / f7-tab >
< / f7-tabs >
< / f7-page >
< / template >
< template id = "page-node" >
< f7-page >
< f7-navbar >
< f7-navbar :title = "Node.Name" back-link = "Back" > < / f7-navbar >
< / f7-navbar >
< template :v-if = "Node.Sences.length" >
< template v-if= "Node.Sences.length" >
< div class = "block-title" > 场景< / div >
< div class = "block block-strong" >
< div class = "row" >
< div class = "col-33 tablet-20 desktop-10" v-for = "sence in _.orderBy(Node.Sences,['DisplayOrder','Name'])" v-on:click = "callSence(sence.Id)" >
< div class = "col- 50 tablet-33 desktop-2 0" v-for = "sence in _.orderBy(Node.Sences,['DisplayOrder','Name'])" v-on:click = "callSence(sence.Id)" >
< a href = "javascript:;" class = "button button-raised button-fill" > {{sence.Name}}< / a >
< / div >
< / div >
@ -163,7 +165,7 @@
< div class = "block-title" > 监测< / div >
< div class = "block block-strong" >
< div class = "row" >
< div class = "col- 33 tablet-20 desktop-1 0" v-for = "device in getDevices('检测器','监测器')" >
< div class = "col- 50 tablet-33 desktop-2 0" v-for = "device in getDevices('检测器','监测器')" >
< div class = "row" >
< a class = "button button-raised" :href = "'/device/'+device.Number+'/name/'+device.Name" > {{device.DisplayName||device.Name}}< / a >
< / div >
@ -191,7 +193,7 @@
< div class = "block-title" > 警报< / div >
< div class = "block block-strong" >
< div class = "row" >
< div class = "col- 33 tablet-20 desktop-1 0" v-for = "device in getDevices('感应器')" >
< div class = "col- 50 tablet-33 desktop-2 0" v-for = "device in getDevices('感应器')" >
< div class = "row" >
< a class = "button button-raised" :href = "'/device/'+device.Number+'/name/'+device.Name" > {{device.DisplayName||device.Name}}< / a >
< / div >
@ -206,7 +208,7 @@
< div class = "block-title" > 主机< / div >
< div class = "block block-strong" >
< div class = "row" >
< div class = "col- 33 tablet-20 desktop-1 0" v-for = "device in getDevices('主机')" >
< div class = "col- 50 tablet-33 desktop-2 0" v-for = "device in getDevices('主机')" >
< div class = "row" >
< a class = "button button-raised" :href = "'/device/'+device.Number+'/name/'+device.Name" > {{device.DisplayName||device.Name}}< / a >
< / div >
@ -226,7 +228,7 @@
< div class = "block-title" > 无线AP< / div >
< div class = "block block-strong" >
< div class = "row" >
< div class = "col- 33 tablet-20 desktop-1 0" v-for = "device in getDevices('AP')" >
< div class = "col- 50 tablet-33 desktop-2 0" v-for = "device in getDevices('AP')" >
< div class = "row" >
< a class = "button button-raised" :href = "'/device/'+device.Number+'/name/'+device.Name" > {{device.DisplayName||device.Name}}< / a >
< / div >
@ -245,7 +247,7 @@
< div class = "block-title" > 一路可调窗帘< / div >
< div class = "block block-strong" >
< div class = "row" >
< div class = "col- 33 tablet-20 desktop-1 0" v-for = "device in getDevices('一路可调窗帘')" >
< div class = "col- 50 tablet-33 desktop-2 0" v-for = "device in getDevices('一路可调窗帘')" >
< div class = "row" >
< a class = "button button-raised" :href = "'/device/'+device.Number+'/name/'+device.Name" > {{device.DisplayName||device.Name}}< / a >
< / div >
@ -260,9 +262,8 @@
< / div >
< / div >
< div class = "row" >
< div class = "col-33 tablet-20 desktop-10" > < / div >
< div class = "col-33 tablet-20 desktop-10" > < / div >
< div class = "col-33 tablet-20 desktop-10" >
< div class = "col-50 tablet-33 desktop-20" > < / div >
< div class = "col-50 tablet-33 desktop-20" >
< div class = "row" >
< a class = "button button-raised button-fill" href = "javascript: ;" v-on:click = "callAll('一路可调窗帘','21on')" > 开< / a >
< a class = "button button-raised button-fill" href = "javascript: ;" v-on:click = "callAll('一路可调窗帘','23stop')" > 停< / a >
@ -276,7 +277,7 @@
< div class = "block-title" > 计量开关< / div >
< div class = "block block-strong" >
< div class = "row" >
< div class = "col- 33 tablet-20 desktop-1 0" v-for = "device in getDevices('计量开关')" >
< div class = "col- 50 tablet-33 desktop-2 0" v-for = "device in getDevices('计量开关')" >
< div class = "row" >
< a class = "button button-raised" :href = "'/device/'+device.Number+'/name/'+device.Name" > {{device.DisplayName||device.Name}}< / a >
< / div >
@ -289,9 +290,8 @@
< / div >
< / div >
< div class = "row" >
< div class = "col-33 tablet-20 desktop-10" > < / div >
< div class = "col-33 tablet-20 desktop-10" > < / div >
< div class = "col-33 tablet-20 desktop-10" >
< div class = "col-50 tablet-33 desktop-20" > < / div >
< div class = "col-50 tablet-33 desktop-20" >
< div class = "row" >
< a class = "button button-raised button-fill" href = "javascript: ;" v-on:click = "callAll('计量开关','21on')" > 全开< / a >
< a class = "button button-raised button-fill" href = "javascript: ;" v-on:click = "callAll('计量开关','22off')" > 全关< / a >
@ -304,7 +304,7 @@
< div class = "block-title" > 一路开关< / div >
< div class = "block block-strong" >
< div class = "row" >
< div class = "col- 33 tablet-20 desktop-1 0" v-for = "device in getDevices('一路照明开关')" >
< div class = "col- 50 tablet-33 desktop-2 0" v-for = "device in getDevices('一路照明开关')" >
< div class = "row" >
< a class = "button button-raised" :href = "'/device/'+device.Number+'/name/'+device.Name" > {{device.DisplayName||device.Name}}< / a >
< / div >
@ -317,9 +317,8 @@
< / div >
< / div >
< div class = "row" >
< div class = "col-33 tablet-20 desktop-10" > < / div >
< div class = "col-33 tablet-20 desktop-10" > < / div >
< div class = "col-33 tablet-20 desktop-10" >
< div class = "col-50 tablet-33 desktop-20" > < / div >
< div class = "col-50 tablet-33 desktop-20" >
< div class = "row" >
< a class = "button button-raised button-fill" href = "javascript: ;" v-on:click = "callAll('一路照明开关','21on')" > 全开< / a >
< a class = "button button-raised button-fill" href = "javascript: ;" v-on:click = "callAll('一路照明开关','22off')" > 全关< / a >
@ -332,7 +331,7 @@
< div class = "block-title" > 二路灯开关< / div >
< div class = "block block-strong" >
< div class = "row" >
< div class = "col- 33 tablet-20 desktop-1 0" v-for = "device in getDevices('二路灯开关')" >
< div class = "col- 50 tablet-33 desktop-2 0" v-for = "device in getDevices('二路灯开关')" >
< div class = "row" >
< a class = "button button-raised" :href = "'/device/'+device.Number+'/name/'+device.Name" > {{device.DisplayName||device.Name}}< / a >
< / div >
@ -353,9 +352,8 @@
< / div >
< / div >
< div class = "row" >
< div class = "col-33 tablet-20 desktop-10" > < / div >
< div class = "col-33 tablet-20 desktop-10" > < / div >
< div class = "col-33 tablet-20 desktop-10" >
< div class = "col-50 tablet-33 desktop-20" > < / div >
< div class = "col-50 tablet-33 desktop-20" >
< div class = "row" >
< a class = "button button-raised button-fill" href = "javascript: ;" v-on:click = "callAll('二路灯开关','21on')" > 全开< / a >
< a class = "button button-raised button-fill" href = "javascript: ;" v-on:click = "callAll('二路灯开关','22off')" > 全关< / a >
@ -368,7 +366,7 @@
< div class = "block-title" > 三路照明开关< / div >
< div class = "block block-strong" >
< div class = "row" >
< div class = "col- 33 tablet-20 desktop-1 0" v-for = "device in getDevices('三路照明开关')" >
< div class = "col- 50 tablet-33 desktop-2 0" v-for = "device in getDevices('三路照明开关')" >
< div class = "row" >
< a class = "button button-raised" :href = "'/device/'+device.Number+'/name/'+device.Name" > {{device.DisplayName||device.Name}}< / a >
< / div >
@ -389,9 +387,8 @@
< / div >
< / div >
< div class = "row" >
< div class = "col-33 tablet-20 desktop-10" > < / div >
< div class = "col-33 tablet-20 desktop-10" > < / div >
< div class = "col-33 tablet-20 desktop-10" >
< div class = "col-50 tablet-33 desktop-20" > < / div >
< div class = "col-50 tablet-33 desktop-20" >
< div class = "row" >
< a class = "button button-raised button-fill" href = "javascript: ;" v-on:click = "callAll('三路照明开关','21on')" > 全开< / a >
< a class = "button button-raised button-fill" href = "javascript: ;" v-on:click = "callAll('三路照明开关','22off')" > 全关< / a >
@ -404,7 +401,7 @@
< div class = "block-title" > 墙面插座< / div >
< div class = "block block-strong" >
< div class = "row" >
< div class = "col- 33 tablet-20 desktop-1 0" v-for = "device in getDevices('墙面插座')" >
< div class = "col- 50 tablet-33 desktop-2 0" v-for = "device in getDevices('墙面插座')" >
< div class = "row" >
< a class = "button button-raised" :href = "'/device/'+device.Number+'/name/'+device.Name" > {{device.DisplayName||device.Name}}< / a >
< / div >
@ -417,9 +414,8 @@
< / div >
< / div >
< div class = "row" >
< div class = "col-33 tablet-20 desktop-10" > < / div >
< div class = "col-33 tablet-20 desktop-10" > < / div >
< div class = "col-33 tablet-20 desktop-10" >
< div class = "col-50 tablet-33 desktop-20" > < / div >
< div class = "col-50 tablet-33 desktop-20" >
< div class = "row" >
< a class = "button button-raised button-fill" href = "javascript: ;" v-on:click = "callAll('墙面插座','21on')" > 全开< / a >
< a class = "button button-raised button-fill" href = "javascript: ;" v-on:click = "callAll('墙面插座','22off')" > 全关< / a >
@ -432,7 +428,7 @@
< div class = "block-title" > 一路插座< / div >
< div class = "block block-strong" >
< div class = "row" >
< div class = "col- 33 tablet-20 desktop-1 0" v-for = "device in getDevices('一路插座')" >
< div class = "col- 50 tablet-33 desktop-2 0" v-for = "device in getDevices('一路插座')" >
< div class = "row" >
< a class = "button button-raised" :href = "'/device/'+device.Number+'/name/'+device.Name" > {{device.DisplayName||device.Name}}< / a >
< / div >
@ -445,9 +441,8 @@
< / div >
< / div >
< div class = "row" >
< div class = "col-33 tablet-20 desktop-10" > < / div >
< div class = "col-33 tablet-20 desktop-10" > < / div >
< div class = "col-33 tablet-20 desktop-10" >
< div class = "col-50 tablet-33 desktop-20" > < / div >
< div class = "col-50 tablet-33 desktop-20" >
< div class = "row" >
< a class = "button button-raised button-fill" href = "javascript: ;" v-on:click = "callAll('一路插座','21on')" > 全开< / a >
< a class = "button button-raised button-fill" href = "javascript: ;" v-on:click = "callAll('一路插座','22off')" > 全关< / a >
@ -460,7 +455,7 @@
< div class = "block-title" > 二路插座< / div >
< div class = "block block-strong" >
< div class = "row" >
< div class = "col- 33 tablet-20 desktop-1 0" v-for = "device in getDevices('二路插座')" >
< div class = "col- 50 tablet-33 desktop-2 0" v-for = "device in getDevices('二路插座')" >
< div class = "row" >
< a class = "button button-raised" :href = "'/device/'+device.Number+'/name/'+device.Name" > {{device.DisplayName||device.Name}}< / a >
< / div >
@ -473,9 +468,8 @@
< / div >
< / div >
< div class = "row" >
< div class = "col-33 tablet-20 desktop-10" > < / div >
< div class = "col-33 tablet-20 desktop-10" > < / div >
< div class = "col-33 tablet-20 desktop-10" >
< div class = "col-50 tablet-33 desktop-20" > < / div >
< div class = "col-50 tablet-33 desktop-20" >
< div class = "row" >
< a class = "button button-raised button-fill" href = "javascript: ;" v-on:click = "callAll('二路插座','21on')" > 全开< / a >
< a class = "button button-raised button-fill" href = "javascript: ;" v-on:click = "callAll('二路插座','22off')" > 全关< / a >
@ -488,7 +482,7 @@
< div class = "block-title" > 密码门锁< / div >
< div class = "block block-strong" >
< div class = "row" >
< div class = "col- 33 tablet-20 desktop-1 0" v-for = "device in getDevices('密码门锁')" >
< div class = "col- 50 tablet-33 desktop-2 0" v-for = "device in getDevices('密码门锁')" >
< div class = "row" >
< a class = "button button-raised" :href = "'/device/'+device.Number+'/name/'+device.Name" > {{device.DisplayName||device.Name}}< / a >
< / div >
@ -500,9 +494,8 @@
< / div >
< / div >
< div class = "row" >
< div class = "col-33 tablet-20 desktop-10" > < / div >
< div class = "col-33 tablet-20 desktop-10" > < / div >
< div class = "col-33 tablet-20 desktop-10" >
< div class = "col-50 tablet-33 desktop-20" > < / div >
< div class = "col-50 tablet-33 desktop-20" >
< div class = "row" >
< a class = "button button-raised button-fill" href = "javascript: ;" v-on:click = "callAll('密码门锁','21open')" > 全开< / a >
< / div >
@ -606,51 +599,62 @@
< / ul >
< / div >
< div class = "block-title" v-if = "Device.Apis.length" > 操作< / div >
< div class = "row ">
< template v- if= "Device.Apis.length ">
< div class = "col" v-for = "api in _.orderBy(Device.Apis,['Command']) ">
< form method = "get" action = "/Command/Exec" v-on:submit . prevent = "call" >
< input type = "hidden" name = " cmd" :value = "api.Comman d" / >
< input type = "hidden" name = "id" :value = "Device.Id" / >
< div class = "row" >
< template v-if = "Device.Apis.length ">
< template v- for= "api in _.orderBy(Device.Apis,['Command']) ">
< form method = "get" action = "/Command/Exec" v-on:submit . prevent = "call" class = "command ">
< input type = "hidden" name = "cmd" :value = "api.Command" / >
< input type = "hidden" name = " id" :value = "Device.I d" / >
< div class = "list" >
< ul >
< template v-for = "parameter in api.Parameters" >
< template v-if = "parameter.Name!='hidden'" >
< template v-if = "isSelect(Device,parameter.Name)" >
< div class = "col" >
< select :name = "parameter.Name" style = "height:29px;" data-val = "true" data-val-required = "请选择" >
< option value = "" > 请选择< / option >
< option v-for = "option in getSelect(Device,parameter.Name)" :value = "option.value" > {{option.text}}< / option >
< / select >
< span class = "field-validation-valid text-danger" :data-valmsg-for = "parameter.Name" data-valmsg-replace = "true" > < / span >
< / div >
< / template >
< template v-else >
< div class = "col" >
< template v-if = "parameter.Minimum||parameter.Maximnu" >
< input :name = "parameter.Name" :value = "getParameter(parameter.Name)" data-val = "true" data-val-required = "请输入"
data-val-number="必须输入数字" :data-val-range="'范围:'+parameter.Minimum+'~'+parameter.Maximnu" :data-val-range-min="parameter.Minimum" :data-val-range-max="parameter.Maximnu"
style="height:29px;" type="text" :placeholder="'请输入'+parameter.Description" />
< li class = "item-content item-input item-input-outline" v-if = "parameter.Name!='hidden'" >
< div class = "item-inner" >
< div class = "item-title item-floating-label" > {{parameter.Description}}< / div >
< div class = "item-input-wrap" >
< template v-if = "isSelect(Device,parameter.Name)" >
< select :name = "parameter.Name"
data-val="true"
:data-val-required="'请选择'+parameter.Description">
< option value = "" > 请选择< / option >
< option v-for = "option in getSelect(Device,parameter.Name)" :value = "option.value" > {{option.text}}< / option >
< / select >
< span class = "input-clear-button" > < / span >
< / template >
< template v-else >
< input :name = "parameter.Name" :value = "getParameter(parameter.Name)" data-val = "true" data-val-required = "请输入"
style="height:29px;" type="text" :placeholder="'请输入'+parameter.Description" />
< template v-if = "parameter.Minimum||parameter.Maximnu" >
< input :name = "parameter.Name" :value = "getParameter(parameter.Name)" data-val = "true" data-val-required = "请输入"
data-val-number="必须输入数字" :data-val-range="'范围:'+parameter.Minimum+'~'+parameter.Maximnu" :data-val-range-min="parameter.Minimum" :data-val-range-max="parameter.Maximnu"
type="text" />
< span class = "input-clear-button" > < / span >
< / template >
< template v-else >
< input :name = "parameter.Name"
:value="getParameter(parameter.Name)"
data-val="true"
:data-val-required="'请输入'+parameter.Description"
type="text" />
< span class = "input-clear-button" > < / span >
< / template >
< / template >
< span class = "field-validation-valid text-danger" :data-valmsg-for = "parameter.Name" data-valmsg-replace = "true" > < / span >
< / div >
< / template >
< / template >
< span class = "field-validation-valid text-danger" :data-valmsg-for = "parameter.Name" data-valmsg-replace = "true" > < / span >
< / div >
< / li >
< / template >
< div class = "col" >
< button class = "button button-fill button-outline" type = "submit" > {{api.Name}}< / button >
< / div >
< / div >
< / form >
< / div >
< li >
< div class = "item-content" >
< div class = "item-inner" >
< button class = "button button-fill button-outline" type = "submit" > {{api.Name}}< / button >
< / div >
< / div >
< / li >
< / ul >
< / div >
< / form >
< / template >
< / div >
< / template >
< / f7-page >
< / template >
<!-- Page Not Found Template -->
< template id = "page-not-found" >
< f7-page >
< f7-navbar title = "Not found" back-link = "Back" > < / f7-navbar >
@ -671,8 +675,6 @@
< / div >
< / div >
< div class = "page-content" >
< div id = "video-container" class = "block" >
< / div >
< / div >
< / div >
< / div >