diff --git a/public/images/devcie_default.png b/public/images/devcie_default.png new file mode 100644 index 00000000..392d8bbc Binary files /dev/null and b/public/images/devcie_default.png differ diff --git a/public/index.html b/public/index.html index 93bc3043..a875f323 100644 --- a/public/index.html +++ b/public/index.html @@ -11,7 +11,7 @@ - + diff --git a/src/api/iot/project_new.js b/src/api/iot/project_new.js new file mode 100644 index 00000000..675b67ff --- /dev/null +++ b/src/api/iot/project_new.js @@ -0,0 +1,28 @@ +import request from "@/utils/request"; + +// 查询 项目 网关/子设备 +export function listProjectDevice(query) { + return request({ + url: "/iot/device/getProjectDeviceList", + method: "get", + params: query + }); +} + +// 查询 项目 型号 +export function listProjectModel(query) { + return request({ + url: "/iot/model/getProjectModelList", + method: "get", + params: query + }); +} + +// 查询 项目 子设备 表格 列 +export function listProjectTableFilter(query) { + return request({ + url: "/iot/dev/prod/fun/tableHeader", + method: "get", + params: query + }); +} diff --git a/src/assets/images/devcie_default.png b/src/assets/images/devcie_default.png new file mode 100644 index 00000000..392d8bbc Binary files /dev/null and b/src/assets/images/devcie_default.png differ diff --git a/src/components/Cards/index.js b/src/components/Cards/index.js new file mode 100644 index 00000000..dbcb60c6 --- /dev/null +++ b/src/components/Cards/index.js @@ -0,0 +1,8 @@ + +import ESimpleCard from "./src/ESimpleCard/index" + +ESimpleCard.install = function install(Vue) { + Vue.component(ESimpleCard.name, ESimpleCard); +}; + +export default ESimpleCard diff --git a/src/components/Cards/src/ESimpleCard/index.js b/src/components/Cards/src/ESimpleCard/index.js new file mode 100644 index 00000000..64fc4646 --- /dev/null +++ b/src/components/Cards/src/ESimpleCard/index.js @@ -0,0 +1,84 @@ +import './style.scss' +export default { + name: 'ESimpleCard', + props: { + direction: { + type: String, + default: 'horizontal' + }, + title: { + type: String, + default: '' + }, + extra: { + type: [String, Boolean], + default: false + }, + labelStyle: { + type: Object + }, + contentStyle: { + type: Object + }, + labelClassName: { + type: String, + default: '' + }, + contentClassName: { + type: String, + default: '' + }, + data: { + type: [String, Object, Number, Array] + }, + colon: { + type: Boolean, + default: true + }, + icon: { + type: String, + default: 'el-icon-s-grid' + } + + }, + methods: { + handleExtra() { + const { data } = this; + this.$emit('click', data) + }, + }, + render() { + const { title, extra, $slots, icon, color } = this; + return ( +
+ { + (title || extra || $slots.cardHeader) ? +
+ { $slots.cardHeader || + + } +
+ : null + } +
+ { + $slots.cardBody + } +
+
+ ) + } +} diff --git a/src/components/Cards/src/ESimpleCard/style.scss b/src/components/Cards/src/ESimpleCard/style.scss new file mode 100644 index 00000000..a62831c9 --- /dev/null +++ b/src/components/Cards/src/ESimpleCard/style.scss @@ -0,0 +1,53 @@ +.e-simple-card { + width: 100%; + height: 100%; + background: #FFFFFF; + border: 1px solid #E8E8E8; + border-radius: 5px; + +} +.e-simple-card__header { + border-bottom: 1px solid #E8E8E8; + padding: 10px; +} +.e-simple-card__body { + padding: 20px; +} + +.e-simple-card__header .e-header-template { + display: flex; + width: 100%; + height: 15px; + align-items: center; +} +.e-header-template .template-left { + width: 60%; + height: 100%; + display: flex; + justify-content: flex-start; + align-items: center; +} +.e-header-template .template-left .template-title { + font-size: 14px; + font-family: 'Source Han Sans CN'; + font-weight: 400; + color: #344567; +} +.e-header-template .template-left .template-icon { + font-size: 14px; + margin-right: 5px; + color: #344567; +} + +.e-header-template .template__extra { + width: 40%; + height: 100%; + display: flex; + justify-content: flex-end; + align-items: center; + font-size: 16px; +} + +.e-header-template .template__extra .icon:hover { + color: #1890ff +} diff --git a/src/components/Edescriptions/index.js b/src/components/Edescriptions/index.js new file mode 100644 index 00000000..c4cf7626 --- /dev/null +++ b/src/components/Edescriptions/index.js @@ -0,0 +1,9 @@ +import Descriptions from './src/index'; +import './style.scss' + +/* istanbul ignore next */ +Descriptions.install = function install(Vue) { + Vue.component(Descriptions.name, Descriptions); +}; + +export default Descriptions; diff --git a/src/components/Edescriptions/src/descriptions-item.js b/src/components/Edescriptions/src/descriptions-item.js new file mode 100644 index 00000000..d764543c --- /dev/null +++ b/src/components/Edescriptions/src/descriptions-item.js @@ -0,0 +1,30 @@ +export default { + name: 'ElDescriptionsItem', + props: { + label: { + type: String, + default: '' + }, + span: { + type: Number, + default: 1 + }, + contentClassName: { + type: String, + default: '' + }, + contentStyle: { + type: Object + }, + labelClassName: { + type: String, + default: '' + }, + labelStyle: { + type: Object + } + }, + render() { + return null; + } +}; diff --git a/src/components/Edescriptions/src/descriptions-row.js b/src/components/Edescriptions/src/descriptions-row.js new file mode 100644 index 00000000..d75dd28e --- /dev/null +++ b/src/components/Edescriptions/src/descriptions-row.js @@ -0,0 +1,116 @@ +export default { + name: 'ElDescriptionsRow', + props: { + row: { + type: Array + } + }, + inject: ['elDescriptions'], + render(h) { + const { elDescriptions } = this; + const row = (this.row || []).map(item => { + return { + ...item, + label: item.slots.label || item.props.label, + ...['labelClassName', 'contentClassName', 'labelStyle', 'contentStyle'].reduce((res, key) => { + res[key] = item.props[key] || elDescriptions[key]; + return res; + }, {}) + }; + }); + if (elDescriptions.direction === 'vertical') { + return ( + + + { + row.map(item => { + return ( + {item.label} + ); + }) + } + + + { + row.map(item =>{ + return ( + {item.slots.default} + ); + }) + } + + + ); + } + if (elDescriptions.border) { + return ( + + + { + row.map(item=> { + return ([ + {item.label}, + {item.slots.default} + ]); + }) + } + + + ); + } + return ( + + + { + row.map(item=> { + return ( + +
+ {item.label} + {item.slots.default} +
+ ); + }) + } + + + ); + } +}; diff --git a/src/components/Edescriptions/src/index.js b/src/components/Edescriptions/src/index.js new file mode 100644 index 00000000..43c8c3d3 --- /dev/null +++ b/src/components/Edescriptions/src/index.js @@ -0,0 +1,180 @@ +import DescriptionsRow from './descriptions-row'; +import { isFunction } from 'element-ui/src/utils/types'; + +export default { + name: 'ElDescriptions', + components: { + [DescriptionsRow.name]: DescriptionsRow + }, + props: { + border: { + type: Boolean, + default: false + }, + column: { + type: Number, + default: 3 + }, + direction: { + type: String, + default: 'horizontal' + }, + size: { + type: String + // validator: isValidComponentSize, + }, + title: { + type: String, + default: '' + }, + extra: { + type: String, + default: '' + }, + labelStyle: { + type: Object + }, + contentStyle: { + type: Object + }, + labelClassName: { + type: String, + default: '' + }, + contentClassName: { + type: String, + default: '' + }, + colon: { + type: Boolean, + default: true + } + }, + computed: { + descriptionsSize() { + return this.size || (this.$ELEMENT || {}).size; + } + }, + provide() { + return { + elDescriptions: this + }; + }, + methods: { + getOptionProps(vnode) { + if (vnode.componentOptions) { + const componentOptions = vnode.componentOptions; + const { propsData = {}, Ctor = {} } = componentOptions; + const props = (Ctor.options || {}).props || {}; + const res = {}; + for (const k in props) { + const v = props[k]; + const defaultValue = v.default; + if (defaultValue !== undefined) { + res[k] = isFunction(defaultValue) ? defaultValue.call(vnode) : defaultValue; + } + } + return { ...res, ...propsData }; + } + return {}; + }, + getSlots(vnode) { + let componentOptions = vnode.componentOptions || {}; + const children = vnode.children || componentOptions.children || []; + const slots = {}; + children.forEach(child => { + if (!this.isEmptyElement(child)) { + const name = (child.data && child.data.slot) || 'default'; + slots[name] = slots[name] || []; + if (child.tag === 'template') { + slots[name].push(child.children); + } else { + slots[name].push(child); + } + } + }); + return { ...slots }; + }, + isEmptyElement(c) { + return !(c.tag || (c.text && c.text.trim() !== '')); + }, + filledNode(node, span, count, isLast = false) { + if (!node.props) { + node.props = {}; + } + if (span > count) { + node.props.span = count; + } + if (isLast) { + // set the max span, cause of the last td + node.props.span = count; + } + return node; + }, + getRows() { + const children = ((this.$slots.default || []).filter(vnode => vnode.tag && + vnode.componentOptions && vnode.componentOptions.Ctor.options.name === 'ElDescriptionsItem')); + const nodes = children.map(vnode => { + return { + props: this.getOptionProps(vnode), + slots: this.getSlots(vnode), + vnode + }; + }); + const rows = []; + let temp = []; + let count = this.column; + + nodes.forEach((node, index) => { + const span = node.props.span || 1; + + if (index === children.length - 1) { + temp.push(this.filledNode(node, span, count, true)); + rows.push(temp); + return; + } + + if (span < count) { + count -= span; + temp.push(node); + } else { + temp.push(this.filledNode(node, span, count)); + rows.push(temp); + count = this.column; + temp = []; + } + }); + + return rows; + } + }, + render() { + const { title, extra, border, descriptionsSize, $slots } = this; + const rows = this.getRows(); + + return ( +
+ { + (title || extra || $slots.title || $slots.extra) + ?
+
+ { $slots.title ? $slots.title : title} +
+
+ { $slots.extra ? $slots.extra : extra } +
+
+ : null + } + +
+ + {rows.map(row => ( + + ))} +
+
+
+ ); + } +}; diff --git a/src/config/env.js b/src/config/env.js index be094302..8e15503a 100644 --- a/src/config/env.js +++ b/src/config/env.js @@ -11,6 +11,7 @@ let wsProtocol = 'ws://'; let iotWebSocketAlarmBaseUrl = '' let bigWebSocketUrl = '' let port = '8899' +let webSocketProjectGatewayUrl = '' // window.dasConfig = { // ip: 'http://192.168.10.241:32024' @@ -41,8 +42,9 @@ if (env.NODE_ENV == 'development') { } else if(env.NODE_ENV == 'test') { } iotWebSocketAlarmBaseUrl = sysWebSocket + hrefHost + ':8899/ws/alarm/live' -bigWebSocketUrl = sysWebSocket + hrefHost + ( port ? ':'+ port :'') + '/ws/dev/readData' -sysWebSocket = sysWebSocket + hrefHost; +sysWebSocket = sysWebSocket + hrefHost + ( port ? ':'+ port :''); +bigWebSocketUrl = sysWebSocket + '/ws/dev/readData' +webSocketProjectGatewayUrl = sysWebSocket + '/ws/dev/projectDeviceLive' iotWebSocketBaseUrl = sysWebSocket + '/ws/dev/up/' devLiveWebSocketBaseUrl = sysWebSocket + '/ws/dev/live/' iotPlatformUrl = 'http://' + iotHost + prodApi @@ -54,5 +56,6 @@ export { iotWebSocketAlarmBaseUrl, devLiveWebSocketBaseUrl, prodApi, - bigWebSocketUrl + bigWebSocketUrl, + webSocketProjectGatewayUrl } diff --git a/src/views/iot/project/index.vue b/src/views/iot/project/index.vue index bda77a34..f2992af5 100644 --- a/src/views/iot/project/index.vue +++ b/src/views/iot/project/index.vue @@ -274,9 +274,9 @@ -
+
@@ -647,7 +647,7 @@ export default { }, handleDetails(row) { this.sourceId = row.projectId; - this.componectVal = "DetailsWrap"; + this.componectVal = "DetailsWrapNew"; }, // 跳转详情页 linkToTable() { diff --git a/src/views/iot/project/profileV2/DeviceManage/EDeviceChildren.vue b/src/views/iot/project/profileV2/DeviceManage/EDeviceChildren.vue new file mode 100644 index 00000000..f03d1a16 --- /dev/null +++ b/src/views/iot/project/profileV2/DeviceManage/EDeviceChildren.vue @@ -0,0 +1,442 @@ + + + diff --git a/src/views/iot/project/profileV2/DeviceManage/EDeviceTable.vue b/src/views/iot/project/profileV2/DeviceManage/EDeviceTable.vue new file mode 100644 index 00000000..fff865a7 --- /dev/null +++ b/src/views/iot/project/profileV2/DeviceManage/EDeviceTable.vue @@ -0,0 +1,512 @@ + + + diff --git a/src/views/iot/project/profileV2/DeviceManage/EDynamicTable.vue b/src/views/iot/project/profileV2/DeviceManage/EDynamicTable.vue new file mode 100644 index 00000000..466e8ca4 --- /dev/null +++ b/src/views/iot/project/profileV2/DeviceManage/EDynamicTable.vue @@ -0,0 +1,122 @@ + + + diff --git a/src/views/iot/project/profileV2/DeviceManage/index.vue b/src/views/iot/project/profileV2/DeviceManage/index.vue new file mode 100644 index 00000000..ec0e8043 --- /dev/null +++ b/src/views/iot/project/profileV2/DeviceManage/index.vue @@ -0,0 +1,48 @@ + + diff --git a/src/views/iot/project/profileV2/ECensusCards.vue b/src/views/iot/project/profileV2/ECensusCards.vue new file mode 100644 index 00000000..2f4c8352 --- /dev/null +++ b/src/views/iot/project/profileV2/ECensusCards.vue @@ -0,0 +1,81 @@ + + + diff --git a/src/views/iot/project/profileV2/EEchartsGauge.vue b/src/views/iot/project/profileV2/EEchartsGauge.vue new file mode 100644 index 00000000..f54fd10c --- /dev/null +++ b/src/views/iot/project/profileV2/EEchartsGauge.vue @@ -0,0 +1,141 @@ + + + diff --git a/src/views/iot/project/profileV2/EEchartsLine.vue b/src/views/iot/project/profileV2/EEchartsLine.vue new file mode 100644 index 00000000..273c500c --- /dev/null +++ b/src/views/iot/project/profileV2/EEchartsLine.vue @@ -0,0 +1,66 @@ + + + diff --git a/src/views/iot/project/profileV2/EEchartsPie.vue b/src/views/iot/project/profileV2/EEchartsPie.vue new file mode 100644 index 00000000..e9dcbdf2 --- /dev/null +++ b/src/views/iot/project/profileV2/EEchartsPie.vue @@ -0,0 +1,122 @@ + + + diff --git a/src/views/iot/project/profileV2/ENavMenu.vue b/src/views/iot/project/profileV2/ENavMenu.vue new file mode 100644 index 00000000..88102ef5 --- /dev/null +++ b/src/views/iot/project/profileV2/ENavMenu.vue @@ -0,0 +1,91 @@ + + + diff --git a/src/views/iot/project/profileV2/EObjectContainer.vue b/src/views/iot/project/profileV2/EObjectContainer.vue new file mode 100644 index 00000000..ac94040a --- /dev/null +++ b/src/views/iot/project/profileV2/EObjectContainer.vue @@ -0,0 +1,47 @@ + + diff --git a/src/views/iot/project/profileV2/EObjectInfo.vue b/src/views/iot/project/profileV2/EObjectInfo.vue new file mode 100644 index 00000000..92c15396 --- /dev/null +++ b/src/views/iot/project/profileV2/EObjectInfo.vue @@ -0,0 +1,426 @@ + + + + diff --git a/src/views/iot/project/profileV2/EObjectSpace.vue b/src/views/iot/project/profileV2/EObjectSpace.vue new file mode 100644 index 00000000..8721dea5 --- /dev/null +++ b/src/views/iot/project/profileV2/EObjectSpace.vue @@ -0,0 +1,371 @@ + + + + diff --git a/src/views/iot/project/profileV2/EObjectSpaceDevice.vue b/src/views/iot/project/profileV2/EObjectSpaceDevice.vue new file mode 100644 index 00000000..ff18ca74 --- /dev/null +++ b/src/views/iot/project/profileV2/EObjectSpaceDevice.vue @@ -0,0 +1,353 @@ + + + diff --git a/src/views/iot/project/profileV2/EObjectTenant.vue b/src/views/iot/project/profileV2/EObjectTenant.vue new file mode 100644 index 00000000..8e244d4b --- /dev/null +++ b/src/views/iot/project/profileV2/EObjectTenant.vue @@ -0,0 +1,386 @@ + + + diff --git a/src/views/iot/project/profileV2/EProjectManage.vue b/src/views/iot/project/profileV2/EProjectManage.vue new file mode 100644 index 00000000..b6201844 --- /dev/null +++ b/src/views/iot/project/profileV2/EProjectManage.vue @@ -0,0 +1,19 @@ + + diff --git a/src/views/iot/project/profileV2/ETodayRatio.vue b/src/views/iot/project/profileV2/ETodayRatio.vue new file mode 100644 index 00000000..26fdee91 --- /dev/null +++ b/src/views/iot/project/profileV2/ETodayRatio.vue @@ -0,0 +1,169 @@ + + + + diff --git a/src/views/iot/project/profileV2/ETrendCensus.vue b/src/views/iot/project/profileV2/ETrendCensus.vue new file mode 100644 index 00000000..02fba45a --- /dev/null +++ b/src/views/iot/project/profileV2/ETrendCensus.vue @@ -0,0 +1,205 @@ + + + + diff --git a/src/views/iot/project/profileV2/ETypeCensus.vue b/src/views/iot/project/profileV2/ETypeCensus.vue new file mode 100644 index 00000000..9d0a5f51 --- /dev/null +++ b/src/views/iot/project/profileV2/ETypeCensus.vue @@ -0,0 +1,258 @@ + + + + diff --git a/src/views/iot/project/profileV2/details.vue b/src/views/iot/project/profileV2/details.vue new file mode 100644 index 00000000..556a8809 --- /dev/null +++ b/src/views/iot/project/profileV2/details.vue @@ -0,0 +1,451 @@ + + + diff --git a/src/views/profile/DeviceDetailsView/index.vue b/src/views/profile/DeviceDetailsView/index.vue index b10efa45..f75d0d9c 100644 --- a/src/views/profile/DeviceDetailsView/index.vue +++ b/src/views/profile/DeviceDetailsView/index.vue @@ -113,7 +113,7 @@ import ModelOat from "./modelOat"; import ChildDevice from "./childDevice"; export default { name: "DetailsWrap", - props: ["sourceId", "isTenant"], + props: ["sourceId", "isTenant", 'isPersonal'], components: { InfoWrap, DeviceLog, diff --git a/src/views/profile/DeviceDetailsView/info.vue b/src/views/profile/DeviceDetailsView/info.vue index 7e3088e8..45f2c163 100644 --- a/src/views/profile/DeviceDetailsView/info.vue +++ b/src/views/profile/DeviceDetailsView/info.vue @@ -19,7 +19,7 @@ > 编辑