You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
iot/projects/WebSPA/wwwroot/pages/iot/nodes.js

42 lines
1.5 KiB

function pages_iot_nodes() {
return {
component: Vue.component('pages_iot_nodes', function (resolve, reject) {
axios.get("/pages/iot/nodes.html?v2").then(function (response) {
resolve({
template: response.data,
data() {
return {
name: '智慧教室',
url: '/IoTCenter/api/v1/node/getNodes'
};
},
mounted: function () {
axios.post(this.url)
.then(function (response) {
store.commit('setNodes', response.data);
})
.catch(function (error) {
})
.finally(function () {
});
},
destroyed: function () {
store.commit('setNodes', []);
},
methods: {
},
computed: {
nodes: function () {
return store.state.nodes;
}
}
});
});
}),
onMessage: function (event, model, to, from) {
// 更新产品列表设备数
store.dispatch('getNodes');
}
}
}