diff --git a/IoTSharp/ClientApp/package.json b/IoTSharp/ClientApp/package.json index 8a6ecacdb838ee3273c22c72a12acd3958cb08a2..8c40ab47c48b25d5187f319ca0e230cb99fa2fbc 100755 --- a/IoTSharp/ClientApp/package.json +++ b/IoTSharp/ClientApp/package.json @@ -51,7 +51,7 @@ "codemirror": "5.45.0", "driver.js": "0.9.5", "dropzone": "5.5.1", - "echarts": "4.2.1", + "echarts": "^4.2.1", "element-ui": "2.7.0", "file-saver": "2.0.1", "fuse.js": "3.4.4", @@ -66,6 +66,7 @@ "sortablejs": "1.8.4", "tasksfile": "^5.1.0", "tui-editor": "1.3.3", + "v-charts": "^1.19.0", "vue": "2.6.10", "vue-count-to": "1.0.13", "vue-i18n": "^8.11.2", diff --git a/IoTSharp/ClientApp/src/api/device.js b/IoTSharp/ClientApp/src/api/device.js index 0d939a27ce723f4cf1d0adebf94f7f185423a26c..7df67163c986f6ae98e475eb1eb8298289a7052f 100755 --- a/IoTSharp/ClientApp/src/api/device.js +++ b/IoTSharp/ClientApp/src/api/device.js @@ -1,5 +1,6 @@ import request from '@/utils/request' +// Get all of the customer's devices. export function getDevices(id) { return request({ url: '/Devices/Customers/' + id, @@ -7,35 +8,67 @@ export function getDevices(id) { }) } -export function postDevice(data) { +// Get a device's detail +export function getDevice(id) { return request({ - url: '/Devices', + url: '/Devices/' + id, + method: 'get' + }) +} + +// Create a new device +export function creatDevice(data) { + return request({ + url: '/Devices/', method: 'post', data }) } -export function fetchArticle(id) { +// DELETE: api/Devices/5 +export function deleteDevice(data) { return request({ - url: '/article/detail', - method: 'get', - params: { id } + url: '/Devices', + method: 'delete', + data }) } - -export function fetchPv(pv) { +// for pagin usage,current not support +export function getDevicePv(pv) { return request({ - url: '/article/pv', + url: '/Devices/pv', method: 'get', params: { pv } }) } - - -export function updateArticle(data) { +// modify device +export function updateDevice(id, data) { return request({ - url: '/article/update', - method: 'post', + url: `/Devices/${id}`, + method: 'put', data }) } +// Get a device's credentials +export function getDeviceAccessToken(id) { + return request({ + url: `/Devices/${id}/Identity`, + method: 'get' + }) +} +// Request attribute values by device access token from the server +export function getDeviceAttributes(id) { + return request({ + url: `/Devices/${id}/AttributeLatest`, + method: 'get' + }) +} + +// Request telemetry values by device access token from the server +export function getDeviceTelemetryLatest(id) { + return request({ + url: `/Devices/${id}/TelemetryLatest`, + method: 'get' + }) +} + diff --git a/IoTSharp/ClientApp/src/router/index.js b/IoTSharp/ClientApp/src/router/index.js index 3bbb3779de41f630f57fa581f391a674233a46bf..14cb59962c663634751f2a4e41a25c2fd7b7b12d 100755 --- a/IoTSharp/ClientApp/src/router/index.js +++ b/IoTSharp/ClientApp/src/router/index.js @@ -7,10 +7,10 @@ Vue.use(Router) import Layout from '@/layout' /* Router Modules */ -import componentsRouter from './modules/components' -import chartsRouter from './modules/charts' -import tableRouter from './modules/table' -import nestedRouter from './modules/nested' +// import componentsRouter from './modules/components' +// import chartsRouter from './modules/charts' +// import tableRouter from './modules/table' +// import nestedRouter from './modules/nested' /** * Note: sub-menu only appear when route children.length >= 1 @@ -110,12 +110,27 @@ export const constantRoutes = [ } }, { - path: 'add', - component: () => import('@/views/device/add'), - name: 'DeviceAdd', + path: 'board', + component: () => import('@/views/device/device-board'), + name: 'DeviceBoard', meta: { - title: '添加设备' - // if do not set roles, means: this page does not require permission + title: '设备详情' + } + }, + { + path: 'compomentlib', + component: () => import('@/views/device/component-lib'), + name: 'ComponentLib', + meta: { + title: '部件库' + } + }, + { + path: 'DeviceVisionBoardboard', + component: () => import('@/views/device/device-visionboard'), + name: 'DeviceVisionBoardboard', + meta: { + title: '仪表盘' } }, { @@ -204,8 +219,8 @@ export const asyncRoutes = [ } ] }, - /** when your routing map is too long, you can split it into small modules **/ + /* componentsRouter, chartsRouter, nestedRouter, @@ -414,7 +429,7 @@ export const asyncRoutes = [ } ] }, - + */ // 404 page must be placed at the end !!! { path: '*', redirect: '/404', hidden: true } ] diff --git a/IoTSharp/ClientApp/src/utils/request.js b/IoTSharp/ClientApp/src/utils/request.js index c8b631b81e774bb348fc76d2b7a275427ec2d836..6a0bd8560ccb1b618c1f1e5dc99789892b30885e 100755 --- a/IoTSharp/ClientApp/src/utils/request.js +++ b/IoTSharp/ClientApp/src/utils/request.js @@ -6,6 +6,7 @@ import { getToken } from '@/utils/auth' // create an axios instance const service = axios.create({ baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url + // baseURL: process.env.BASE_API, // withCredentials: true, // send cookies when cross-domain requests timeout: 5000 // request timeout }) @@ -44,9 +45,6 @@ service.interceptors.response.use( */ response => { const res = response.data - console.log('response = ') - console.log(response) - console.log('response token = ') // if the custom code is not 20000, it is judged as an error. if (res.code !== 10000) { Message({ diff --git a/IoTSharp/ClientApp/src/views/device/add.vue b/IoTSharp/ClientApp/src/views/device/add.vue deleted file mode 100755 index 37d49f8dce293fedc41c324ab1aa192463d9f7c3..0000000000000000000000000000000000000000 --- a/IoTSharp/ClientApp/src/views/device/add.vue +++ /dev/null @@ -1,381 +0,0 @@ - - - diff --git a/IoTSharp/ClientApp/src/views/device/component-lib.vue b/IoTSharp/ClientApp/src/views/device/component-lib.vue new file mode 100644 index 0000000000000000000000000000000000000000..ad36f420d582d6f3151550d85aea658391b9de69 --- /dev/null +++ b/IoTSharp/ClientApp/src/views/device/component-lib.vue @@ -0,0 +1,141 @@ + + + + diff --git a/IoTSharp/ClientApp/src/views/device/device-board.vue b/IoTSharp/ClientApp/src/views/device/device-board.vue new file mode 100644 index 0000000000000000000000000000000000000000..0dfe861e38c4ab06a00a0d79376791404db116aa --- /dev/null +++ b/IoTSharp/ClientApp/src/views/device/device-board.vue @@ -0,0 +1,611 @@ + + + + + diff --git a/IoTSharp/ClientApp/src/views/device/device-visionboard.vue b/IoTSharp/ClientApp/src/views/device/device-visionboard.vue new file mode 100644 index 0000000000000000000000000000000000000000..a83fe1e00920d6df317beb0af61cbe2147288549 --- /dev/null +++ b/IoTSharp/ClientApp/src/views/device/device-visionboard.vue @@ -0,0 +1,198 @@ + + + + diff --git a/IoTSharp/ClientApp/src/views/device/utils.js b/IoTSharp/ClientApp/src/views/device/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..b35cb6d23dbc7d88351303415a093784bb09e65e --- /dev/null +++ b/IoTSharp/ClientApp/src/views/device/utils.js @@ -0,0 +1,2 @@ +import Vue from 'vue' +export const bus = new Vue() diff --git a/IoTSharp/ClientApp/src/views/login/index.vue b/IoTSharp/ClientApp/src/views/login/index.vue index bcb5d9eeb1f15051481d86b6a8132684655f2dbd..0da7d67eb2f9ebd900901c2e30127badd63acdbc 100755 --- a/IoTSharp/ClientApp/src/views/login/index.vue +++ b/IoTSharp/ClientApp/src/views/login/index.vue @@ -46,17 +46,18 @@
登录 我要注册 -
- Please register the user first.the username must be email. + Please register first.The username must be email.
- The password must contain upper and lower case letters, numbers, and symbols. + The password must contain upper and lower case letters, numbers, and symbols. +
+
+ Getting a tenant?
- Getting a tenant?
@@ -74,11 +75,11 @@ - - - - diff --git a/IoTSharp/ClientApp/src/views/login/register.vue b/IoTSharp/ClientApp/src/views/login/register.vue index c7408589a984e9cb03b28e12053dd1b6e9b266bd..33590283ac562d8ebdeb5891b71b32c2c29b5c70 100755 --- a/IoTSharp/ClientApp/src/views/login/register.vue +++ b/IoTSharp/ClientApp/src/views/login/register.vue @@ -70,9 +70,10 @@ -
+
Register + Getting a tenant?
Getting a tenant? @@ -99,11 +100,9 @@ - - - - diff --git a/IoTSharp/ClientApp/src/views/permission/role.vue b/IoTSharp/ClientApp/src/views/permission/role.vue index 38e085e5d5216124e398cebf6e4ab5224dcd1429..12fddd6bcb505d0bf7f7cbcdb712f00a712f138c 100755 --- a/IoTSharp/ClientApp/src/views/permission/role.vue +++ b/IoTSharp/ClientApp/src/views/permission/role.vue @@ -205,6 +205,7 @@ export default { const isEdit = this.dialogType === 'edit' const checkedKeys = this.$refs.tree.getCheckedKeys() + const checkednodes = this.$refs.tree.getCheckedNodes() this.role.routes = this.generateTree(deepClone(this.serviceRoutes), '/', checkedKeys) if (isEdit) {