diff --git a/sgzb-ui/package.json b/sgzb-ui/package.json index 764a77ce..2ab89879 100644 --- a/sgzb-ui/package.json +++ b/sgzb-ui/package.json @@ -51,6 +51,7 @@ "js-cookie": "3.0.1", "jsencrypt": "3.0.0-rc.1", "jszip": "^3.10.1", + "moment": "^2.30.1", "nprogress": "0.2.0", "qrcodejs2": "0.0.2", "quill": "1.3.7", diff --git a/sgzb-ui/src/api/iotDevice/index.js b/sgzb-ui/src/api/iotDevice/index.js index 96d88c02..c6620325 100644 --- a/sgzb-ui/src/api/iotDevice/index.js +++ b/sgzb-ui/src/api/iotDevice/index.js @@ -49,6 +49,24 @@ export function deleteDeviceApi(id) { }) } +/** 获取机具设备的位置信息 */ +export const getIotDeviceLocationApi = (data) => { + return request.post('/material/iotMachine/getLocation', data) +} +/** 获取机具设备的行程信息 */ +export const getIotDeviceTripApi = (data) => { + return request.post('/material/iotMachine/searchItinerary', data) +} +/** 获取机具设备的停留点信息 */ +export const getIotDeviceParkDetailApi = (data) => { + return request.post('/material/iotMachine/reportParkDetailByTime', data) +} +/** 获取机具设备的报警信息 */ +export const getIotDeviceAlarmApi = (data) => { + return request.post('/material/iotMachine/reportAlarm', data) +} + + /** * ***** */ diff --git a/sgzb-ui/src/views/iotDevice/index.vue b/sgzb-ui/src/views/iotDevice/index.vue index 0e139124..08308db8 100644 --- a/sgzb-ui/src/views/iotDevice/index.vue +++ b/sgzb-ui/src/views/iotDevice/index.vue @@ -15,9 +15,9 @@ 添加设备 - 下载二维码 + > --> @@ -56,13 +56,13 @@ > - + @@ -534,12 +561,22 @@ import Treeselect from '@riophae/vue-treeselect' import '@riophae/vue-treeselect/dist/vue-treeselect.css' import QRCode from 'qrcodejs2' +import BindIOT from './component/BindIOT' +import MapDialog from './component/MapDIalog' + export default { name: 'Devices', dicts: ['sys_normal_disable'], - components: { Treeselect }, + components: { Treeselect, BindIOT, MapDialog }, data() { return { + openMap: false, + isShow: false, + props: { + isShow: false, + typeId: '', + maCode: '', + }, // 遮罩层 loading: true, // 选中数组 @@ -604,6 +641,10 @@ export default { }, ], }, + mapDialogVisible: false, + deviceName: '', + deviceType: '', + iotCode: '', } }, created() { @@ -788,6 +829,29 @@ export default { // ...this.queryParams // }, `type_${new Date().getTime()}.xlsx`) }, + + // iot设备绑定 + handleBindIOT(row) { + console.log('🚀 ~ handleBindIOT ~ row:', row) + this.props = { + isShow: true, + typeId: row.typeId, + maCode: row.maCode, + } + }, + // 查看设备地图 + async handleMap(row) { + this.deviceName = row.specificationType + this.deviceType = row.maStatusName + this.iotCode = row.iotCode + + this.mapDialogVisible = true + }, + + /** 关闭地图弹框 */ + handelCloseDialog() { + this.mapDialogVisible = false + }, }, } @@ -801,8 +865,10 @@ export default { margin-top: 15px; font-size: 18px; } -::v-deep.el-table .fixed-width .el-button--mini { - width: 60px !important; - margin-bottom: 10px; + +.location-icon { + font-size: 20px; + cursor: pointer; + color: #409eff; } diff --git a/sgzb-ui/src/views/warehouseManage/machinery/coding/index.vue b/sgzb-ui/src/views/warehouseManage/machinery/coding/index.vue index e664ca0d..c1c72bd5 100644 --- a/sgzb-ui/src/views/warehouseManage/machinery/coding/index.vue +++ b/sgzb-ui/src/views/warehouseManage/machinery/coding/index.vue @@ -534,6 +534,7 @@ v-if="mapDialogVisible" :deviceName="deviceName" :deviceType="deviceType" + :iotCode="iotCode" @handelCloseDialog="handelCloseDialog" /> @@ -643,6 +644,7 @@ export default { mapDialogVisible: false, deviceName: '', deviceType: '', + iotCode: '', } }, created() { @@ -838,9 +840,11 @@ export default { } }, // 查看设备地图 - handleMap(row) { + async handleMap(row) { this.deviceName = row.specificationType this.deviceType = row.maStatusName + this.iotCode = row.iotCode + this.mapDialogVisible = true }, diff --git a/sgzb-ui/vue.config.js b/sgzb-ui/vue.config.js index 58a47ec1..6f92d0a2 100644 --- a/sgzb-ui/vue.config.js +++ b/sgzb-ui/vue.config.js @@ -43,12 +43,12 @@ module.exports = { // target: `https://test-cc.zhgkxt.com`,//线上环境-南网 // target: `https://z.csgmall.com.cn`, - target: `http://192.168.2.154:28080`, //超 + // target: `http://192.168.2.154:28080`, //超 // target: `http://10.40.92.81:28080`, //韩/ // target: `http://192.168.2.82:28080`,//旭/ // target: `http://192.168.2.248:28080`, //帅 // target: `http://192.168.2.209:28080`, //福 - // target: `http://192.168.2.114:39080`, //王 + target: `http://192.168.2.125:39080`, //王 //******** 注意事项 ********* */ //1.全局替换qrUrl二维码扫码提供的网址-发布服务器的地址target;