From 0f17ec277fdfd7ec6e060385ecc2b1bf29370f94 Mon Sep 17 00:00:00 2001 From: pnoker Date: Fri, 7 Feb 2020 13:36:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/manager.js | 142 ++++++++-- src/router/common/index.js | 4 +- src/router/views/index.js | 56 +++- src/views/Now.vue | 14 +- src/views/attribute/Attribute.vue | 267 ++++++++++++++++++ src/views/config/Config.vue | 235 +++++++++++++++ src/views/connect/Connect.vue | 267 ++++++++++++++++++ .../{things/Things.vue => device/Device.vue} | 98 +++---- src/views/driver/Driver.vue | 57 +--- src/views/group/Group.vue | 175 ++++++++++++ src/views/layout/{index.vue => Layout.vue} | 12 +- src/views/login/{index.vue => Login.vue} | 0 src/views/point/Point.vue | 159 +++++++---- .../Template.vue => profile/Profile.vue} | 64 ++--- 14 files changed, 1300 insertions(+), 250 deletions(-) create mode 100644 src/views/attribute/Attribute.vue create mode 100644 src/views/config/Config.vue create mode 100644 src/views/connect/Connect.vue rename src/views/{things/Things.vue => device/Device.vue} (85%) create mode 100644 src/views/group/Group.vue rename src/views/layout/{index.vue => Layout.vue} (88%) rename src/views/login/{index.vue => Login.vue} (100%) rename src/views/{template/Template.vue => profile/Profile.vue} (83%) diff --git a/src/api/manager.js b/src/api/manager.js index 4441208..9a76d68 100644 --- a/src/api/manager.js +++ b/src/api/manager.js @@ -30,32 +30,62 @@ export const driverApi = { }) }; -export const groupApi = { - add: (group) => request({ - url: '/device_api/manager/group/add', +export const connectInfoApi = { + add: (connectInfo) => request({ + url: '/device_api/manager/connectInfo/add', method: 'post', - data: group + data: connectInfo }), delete: (id) => request({ - url: '/device_api/manager/group/delete/' + id, + url: '/device_api/manager/connectInfo/delete/' + id, method: 'post' }), - update: (group) => request({ - url: '/device_api/manager/group/update', + update: (connectInfo) => request({ + url: '/device_api/manager/connectInfo/update', method: 'post', - data: group + data: connectInfo }), selectById: (id) => request({ - url: '/device_api/manager/group/id/' + id, + url: '/device_api/manager/connectInfo/id/' + id, method: 'get' }), - list: (group) => request({ - url: '/device_api/manager/group/list', + list: (connectInfo) => request({ + url: '/device_api/manager/connectInfo/list', method: 'post', - data: group + data: connectInfo }), dictionary: () => request({ - url: '/device_api/manager/group/dictionary', + url: '/device_api/manager/connectInfo/dictionary', + method: 'get' + }) +}; + +export const profileInfoApi = { + add: (profileInfo) => request({ + url: '/device_api/manager/profileInfo/add', + method: 'post', + data: profileInfo + }), + delete: (id) => request({ + url: '/device_api/manager/profileInfo/delete/' + id, + method: 'post' + }), + update: (profileInfo) => request({ + url: '/device_api/manager/profileInfo/update', + method: 'post', + data: profileInfo + }), + selectById: (id) => request({ + url: '/device_api/manager/profileInfo/id/' + id, + method: 'get' + }), + list: (profileInfo) => request({ + url: '/device_api/manager/profileInfo/list', + method: 'post', + data: profileInfo + }), + dictionary: () => request({ + url: '/device_api/manager/profileInfo/dictionary', method: 'get' }) }; @@ -90,32 +120,32 @@ export const profileApi = { }) }; -export const pointApi = { - add: (point) => request({ - url: '/device_api/manager/point/add', +export const groupApi = { + add: (group) => request({ + url: '/device_api/manager/group/add', method: 'post', - data: point + data: group }), delete: (id) => request({ - url: '/device_api/manager/point/delete/' + id, + url: '/device_api/manager/group/delete/' + id, method: 'post' }), - update: (point) => request({ - url: '/device_api/manager/point/update', + update: (group) => request({ + url: '/device_api/manager/group/update', method: 'post', - data: point + data: group }), selectById: (id) => request({ - url: '/device_api/manager/point/id/' + id, + url: '/device_api/manager/group/id/' + id, method: 'get' }), - list: (point) => request({ - url: '/device_api/manager/point/list', + list: (group) => request({ + url: '/device_api/manager/group/list', method: 'post', - data: point + data: group }), dictionary: () => request({ - url: '/device_api/manager/point/dictionary', + url: '/device_api/manager/group/dictionary', method: 'get' }) }; @@ -157,3 +187,63 @@ export const deviceApi = { method: 'get' }) }; + +export const pointApi = { + add: (point) => request({ + url: '/device_api/manager/point/add', + method: 'post', + data: point + }), + delete: (id) => request({ + url: '/device_api/manager/point/delete/' + id, + method: 'post' + }), + update: (point) => request({ + url: '/device_api/manager/point/update', + method: 'post', + data: point + }), + selectById: (id) => request({ + url: '/device_api/manager/point/id/' + id, + method: 'get' + }), + list: (point) => request({ + url: '/device_api/manager/point/list', + method: 'post', + data: point + }), + dictionary: () => request({ + url: '/device_api/manager/point/dictionary', + method: 'get' + }) +}; + +export const pointInfoApi = { + add: (pointInfo) => request({ + url: '/device_api/manager/pointInfo/add', + method: 'post', + data: pointInfo + }), + delete: (id) => request({ + url: '/device_api/manager/pointInfo/delete/' + id, + method: 'post' + }), + update: (pointInfo) => request({ + url: '/device_api/manager/pointInfo/update', + method: 'post', + data: pointInfo + }), + selectById: (id) => request({ + url: '/device_api/manager/pointInfo/id/' + id, + method: 'get' + }), + list: (pointInfo) => request({ + url: '/device_api/manager/pointInfo/list', + method: 'post', + data: pointInfo + }), + dictionary: () => request({ + url: '/device_api/manager/pointInfo/dictionary', + method: 'get' + }) +}; diff --git a/src/router/common/index.js b/src/router/common/index.js index fc99337..d2dadb7 100644 --- a/src/router/common/index.js +++ b/src/router/common/index.js @@ -8,7 +8,7 @@ export default [ meta: { isAuth: false }, - component: () => import('@/views/login/index') + component: () => import('@/views/login/Login') }, { name: 'index', path: '/', @@ -39,4 +39,4 @@ export default [ }, component: () => import('@/components/error/500') } -] \ No newline at end of file +] diff --git a/src/router/views/index.js b/src/router/views/index.js index dc296d3..9b5640f 100644 --- a/src/router/views/index.js +++ b/src/router/views/index.js @@ -1,4 +1,4 @@ -import Index from '@/views/layout/index' +import Index from '@/views/layout/Layout' export default [ { @@ -21,19 +21,54 @@ export default [ }, component: () => import('@/views/driver/Driver') }, { - name: 'template', - path: '/template', + name: 'connect', + path: '/connect', meta: { isAuth: true }, - component: () => import('@/views/template/Template') + component: () => import('@/views/connect/Connect') }, { - name: 'things', - path: '/things', + name: 'attribute', + path: '/attribute', meta: { isAuth: true }, - component: () => import('@/views/things/Things') + component: () => import('@/views/attribute/Attribute') + }, { + name: 'profile', + path: '/profile', + meta: { + isAuth: true + }, + component: () => import('@/views/profile/Profile') + }, { + name: 'point', + path: '/point', + meta: { + isAuth: true + }, + component: () => import('@/views/point/Point') + }, { + name: 'group', + path: '/group', + meta: { + isAuth: true + }, + component: () => import('@/views/group/Group') + }, { + name: 'device', + path: '/device', + meta: { + isAuth: true + }, + component: () => import('@/views/device/Device') + }, { + name: 'config', + path: '/config', + meta: { + isAuth: true + }, + component: () => import('@/views/config/Config') }, { name: 'now', path: '/now', @@ -55,13 +90,6 @@ export default [ isAuth: true }, component: () => import('@/views/Alarm') - }, { - name: 'point', - path: '/point', - meta: { - isAuth: true - }, - component: () => import('@/views/point/Point') }, { name: 'video', path: '/video', diff --git a/src/views/Now.vue b/src/views/Now.vue index 9fdbcd5..e8869ec 100644 --- a/src/views/Now.vue +++ b/src/views/Now.vue @@ -25,7 +25,6 @@ data() { return { form: {}, - selectionList: [], query: {}, page: { pageSize: 10, @@ -54,18 +53,19 @@ tree: true, border: true, index: true, - selection: true, viewBtn: true, column: [ { label: '姓名', prop: 'name', search: true, - rules: [{ - required: true, - message: "请输入部门名称", - trigger: "blur" - }] + rules: [ + { + required: true, + message: "请输入部门名称", + trigger: "blur" + } + ] }, { label: '性别', diff --git a/src/views/attribute/Attribute.vue b/src/views/attribute/Attribute.vue new file mode 100644 index 0000000..49a8525 --- /dev/null +++ b/src/views/attribute/Attribute.vue @@ -0,0 +1,267 @@ + + + + + diff --git a/src/views/config/Config.vue b/src/views/config/Config.vue new file mode 100644 index 0000000..8714aed --- /dev/null +++ b/src/views/config/Config.vue @@ -0,0 +1,235 @@ + + + + + diff --git a/src/views/connect/Connect.vue b/src/views/connect/Connect.vue new file mode 100644 index 0000000..8ad4209 --- /dev/null +++ b/src/views/connect/Connect.vue @@ -0,0 +1,267 @@ + + + + + diff --git a/src/views/things/Things.vue b/src/views/device/Device.vue similarity index 85% rename from src/views/things/Things.vue rename to src/views/device/Device.vue index f8143d6..e028c7b 100644 --- a/src/views/things/Things.vue +++ b/src/views/device/Device.vue @@ -38,14 +38,12 @@ stripe: true, border: true, viewBtn: true, - selection: true, height: 664, align: 'center', column: [ { label: '设备', prop: 'name', - width: 220, span: 24, search: true, searchSpan: 5, @@ -61,58 +59,20 @@ trigger: 'blur' }, { pattern: /^[A-Za-z0-9\u4e00-\u9fa5]+$/, - message: '请输入 正确格式的设备名称,例:\'name01\' 或 \'名称01\'' + message: '请输入 正确格式的设备名称' } ] }, { label: '编码', prop: 'code', - width: 280, + width: 300, search: true, searchSpan: 5, disabled: true - }, { - label: '分组', - prop: 'groupId', - width: 150, - search: true, - searchSpan: 5, - type: 'select', - filterable: true, - searchFilterable: true, - dicData: [], - props: { - label: 'name', - value: 'id' - }, - rules: [{ - required: true, - message: '请选择所属分组', - trigger: 'click' - }] - }, { - label: '模板', - prop: 'profileId', - width: 180, - search: true, - searchSpan: 5, - type: 'select', - filterable: true, - searchFilterable: true, - dicData: [], - props: { - label: 'name', - value: 'id' - }, - rules: [{ - required: true, - message: '请选择使用模板', - trigger: 'click' - }] }, { label: '状态', prop: 'status', - width: 100, + width: 80, search: true, searchSpan: 4, disabled: true, @@ -138,11 +98,44 @@ } ] }, { - label: '描述', + label: '所属模板', + prop: 'profileId', + search: true, + searchSpan: 5, + type: 'tree', + dicData: [], + defaultExpandAll: true, + rules: [ + { + required: true, + message: '请选择使用模板', + trigger: 'click' + } + ] + }, { + label: '所属分组', + prop: 'groupId', + width: 150, + search: true, + searchSpan: 5, + type: 'select', + filterable: true, + searchFilterable: true, + dicData: [], + rules: [ + { + required: true, + message: '请选择所属分组', + trigger: 'click' + } + ] + }, { + label: '备注', prop: 'description', - width: 220, + width: 200, span: 24, type: 'textarea', + overHidden: true, rules: [ { max: 380, @@ -151,18 +144,18 @@ } ] }, { - label: '创建日期', - prop: 'createTime', - width: 180, + label: '修改日期', + prop: 'updateTime', + width: 155, span: 12, disabled: true, type: 'date', format: 'yyyy-MM-dd HH:mm:ss', valueFormat: 'yyyy-MM-dd HH:mm:ss' }, { - label: '修改日期', - prop: 'updateTime', - width: 180, + label: '创建日期', + prop: 'createTime', + width: 155, span: 12, disabled: true, type: 'date', @@ -171,7 +164,6 @@ } ] }, - selectionList: [], loading: true, page: { total: 0, @@ -225,7 +217,7 @@ }); }, listDelete(row) { - this.$confirm('是否删除该条设备?', '提示', { + this.$confirm('是否删除该条数据?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' diff --git a/src/views/driver/Driver.vue b/src/views/driver/Driver.vue index 62b569f..d12047d 100644 --- a/src/views/driver/Driver.vue +++ b/src/views/driver/Driver.vue @@ -22,10 +22,10 @@ + + diff --git a/src/views/layout/index.vue b/src/views/layout/Layout.vue similarity index 88% rename from src/views/layout/index.vue rename to src/views/layout/Layout.vue index d4077fe..d99a55a 100644 --- a/src/views/layout/index.vue +++ b/src/views/layout/Layout.vue @@ -11,15 +11,19 @@ :router=true> 首页 驱动 - 模板 + 连接 + 属性 + 模板 位号 - 设备 - 实时 + 分组 + 设备 + 配置 + diff --git a/src/views/login/index.vue b/src/views/login/Login.vue similarity index 100% rename from src/views/login/index.vue rename to src/views/login/Login.vue diff --git a/src/views/point/Point.vue b/src/views/point/Point.vue index 1d333c4..1ae3b31 100644 --- a/src/views/point/Point.vue +++ b/src/views/point/Point.vue @@ -38,7 +38,6 @@ stripe: true, border: true, viewBtn: true, - selection: true, height: 664, align: 'center', column: [ @@ -61,33 +60,13 @@ trigger: 'blur' }, { pattern: /^[A-Za-z0-9\u4e00-\u9fa5]+$/, - message: '请输入 正确格式的位号名称,例:\'point01\' 或 \'位号01\'' + message: '请输入 正确格式的位号名称' } ] - }, { - label: '模板', - prop: 'profileId', - width: 220, - span: 8, - search: true, - searchSpan: 6, - type: 'select', - filterable: true, - searchFilterable: true, - dicData: [], - props: { - label: 'name', - value: 'id' - }, - rules: [{ - required: true, - message: '请选择使用模板', - trigger: 'click' - }] }, { label: '类型', prop: 'type', - width: 100, + width: 120, span: 8, search: true, searchSpan: 4, @@ -115,11 +94,13 @@ value: 'boolean' } ], - rules: [{ - required: true, - message: '请选择位号数据类型', - trigger: 'click' - }] + rules: [ + { + required: true, + message: '请选择位号数据类型', + trigger: 'click' + } + ] }, { label: '读/写', prop: 'rw', @@ -142,11 +123,13 @@ value: 2 } ], - rules: [{ - required: true, - message: '请选择位号读写类型', - trigger: 'click' - }] + rules: [ + { + required: true, + message: '请选择位号读写类型', + trigger: 'click' + } + ] }, { label: '累计标识', prop: 'accrue', @@ -166,16 +149,18 @@ value: false } ], - rules: [{ - required: true, - message: '请选择模板共享类型', - trigger: 'click' - }] + rules: [ + { + required: true, + message: '请选择位号是否为累计数据', + trigger: 'click' + } + ] }, { label: '值', prop: 'value', width: 100, - span: 6, + span: 8, searchSpan: 12, disabled: true, value: '--' @@ -183,49 +168,102 @@ label: '最小值', prop: 'minimum', width: 100, - span: 6, + span: 8, searchSpan: 12, - value: -999999 + value: -999999, + rules: [ + { + pattern: /^-?(([0-9]*(\.[0-9]{1,3})$)|([0-9]+$))/, + message: '请输入 正确格式的最小值' + } + ] }, { label: '最大值', prop: 'maximum', width: 100, - span: 6, + span: 8, searchSpan: 12, - value: 999999 + value: 999999, + rules: [ + { + pattern: /^-?(([0-9]*(\.[0-9]{1,3})$)|([0-9]+$))/, + message: '请输入 正确格式的最大值' + } + ] }, { label: '倍数', prop: 'multiple', - width: 100, - span: 6, + width: 80, + span: 8, searchSpan: 12, - value: 1 + value: 1, + rules: [ + { + required: true, + message: '请输入 倍数', + trigger: 'blur' + }, { + pattern: /^-?(([0-9]*(\.[0-9]{1,3})$)|([0-9]+$))/, + message: '请输入 正确格式的倍数' + } + ] }, { label: '基值', prop: 'base', - width: 100, + width: 80, span: 8, searchSpan: 12, - value: 0 + value: 0, + rules: [ + { + pattern: /^-?(([0-9]*(\.[0-9]{1,3})$)|([0-9]+$))/, + message: '请输入 正确格式的基值' + } + ] }, { label: '格式', prop: 'format', - width: 100, + width: 80, span: 8, searchSpan: 12, - value: '#.##' + value: '%.3f', + rules: [ + { + required: true, + message: '请输入 格式', + trigger: 'blur' + } + ] }, { label: '单位', prop: 'unit', - width: 100, + width: 80, span: 8, searchSpan: 12 }, { - label: '描述', - prop: 'description', + label: '所属模板', + prop: 'profileId', width: 220, span: 24, + search: true, + searchSpan: 6, + type: 'tree', + dicData: [], + defaultExpandAll: true, + rules: [ + { + required: true, + message: '请选择所属模板', + trigger: 'click' + } + ] + }, { + label: '备注', + prop: 'description', + width: 200, + span: 24, type: 'textarea', + overHidden: true, rules: [ { max: 380, @@ -234,18 +272,18 @@ } ] }, { - label: '创建日期', - prop: 'createTime', - width: 180, + label: '修改日期', + prop: 'updateTime', + width: 155, span: 12, disabled: true, type: 'date', format: 'yyyy-MM-dd HH:mm:ss', valueFormat: 'yyyy-MM-dd HH:mm:ss' }, { - label: '修改日期', - prop: 'updateTime', - width: 180, + label: '创建日期', + prop: 'createTime', + width: 155, span: 12, disabled: true, type: 'date', @@ -254,7 +292,6 @@ } ] }, - selectionList: [], loading: true, page: { total: 0, @@ -300,7 +337,7 @@ }); }, listDelete(row) { - this.$confirm('是否删除该条模板?', '提示', { + this.$confirm('是否删除该条数据?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' diff --git a/src/views/template/Template.vue b/src/views/profile/Profile.vue similarity index 83% rename from src/views/template/Template.vue rename to src/views/profile/Profile.vue index 4a7f6f5..232d756 100644 --- a/src/views/template/Template.vue +++ b/src/views/profile/Profile.vue @@ -23,10 +23,10 @@