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 @@ > - + 删除 - - - + @@ -154,6 +158,20 @@ v-model="addDeviceParams.iotCode" /> + + + + @@ -215,6 +233,7 @@ import { unbindDeviceApi, getDeviceBindRecordApi, getDeviceBindDetailsApi, + selectList, } from '@/api/iotDevice' export default { components: { @@ -237,6 +256,7 @@ export default { addDeviceParams: { iotType: '', iotCode: '', + iotStatus: 0, }, // 新增设备表单校验 addDeviceRules: { @@ -261,6 +281,8 @@ export default { sendParams: { iotId: '', }, + // 设备类型数据源 + deviceTypeList: [], // 复选框选中的数据 selectList: [], // 绑定记录Api @@ -273,6 +295,7 @@ export default { created() { this.getDeviceList() + this.getDeviceTypeList() }, methods: { @@ -282,6 +305,18 @@ export default { this.deviceList = res.rows this.total = res.total }, + + //** 获取设备类型 */ + async getDeviceTypeList() { + try { + const res = await selectList() + // this.typeOptions = res.data + console.log(res, '设备类型获取成功') + this.deviceTypeList = res.data + } catch (err) { + console.log('🚀 ~ getIotType ~ err:', err) + } + }, /** 搜索按钮 */ handelQuery() { this.getDeviceList(this.queryParams) @@ -290,10 +325,13 @@ export default { addDevice(row) { if (!row) { this.dialogConfig.outerTitle = '添加设备' + this.addDeviceParams.iotId = '' + this.addDeviceParams.iotCode = '' } else { this.dialogConfig.outerTitle = '修改设备' this.addDeviceParams.iotId = row.iotId this.addDeviceParams.iotCode = row.iotCode + this.addDeviceParams.iotStatus = row.iotStatus this.addDeviceParams.iotType = parseInt(row.iotType) } this.dialogConfig.outerWidth = '40%' diff --git a/sgzb-ui/src/views/warehouseManage/machinery/coding/component/BindIOT.vue b/sgzb-ui/src/views/warehouseManage/machinery/coding/component/BindIOT.vue index fcfd1ca5..f0f9595c 100644 --- a/sgzb-ui/src/views/warehouseManage/machinery/coding/component/BindIOT.vue +++ b/sgzb-ui/src/views/warehouseManage/machinery/coding/component/BindIOT.vue @@ -107,7 +107,12 @@ style="width: 280px" @change="changeIotType" > - + @@ -139,7 +144,12 @@ @@ -380,6 +528,7 @@ export default { margin: 0; list-style: none; display: flex; + align-items: center; li { flex: 1; text-align: center; diff --git a/sgzb-ui/src/views/warehouseManage/machinery/coding/debug.vue b/sgzb-ui/src/views/warehouseManage/machinery/coding/debug.vue index 8fc6ec58..450377ec 100644 --- a/sgzb-ui/src/views/warehouseManage/machinery/coding/debug.vue +++ b/sgzb-ui/src/views/warehouseManage/machinery/coding/debug.vue @@ -1,6 +1,6 @@ - + 导出 @@ -135,6 +135,7 @@ @@ -151,13 +152,13 @@ label="设备类型" align="center" prop="deviceType" - :show-overflow-tooltip="true" + show-overflow-tooltip /> + + + 未绑定 + + + + + + + - + 编辑 删除 @@ -513,6 +530,16 @@ + + + + @@ -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;