diff --git a/ruoyi-ui/src/components/BoardTopNav/index.vue b/ruoyi-ui/src/components/BoardTopNav/index.vue index 14a2ccc..b898a30 100644 --- a/ruoyi-ui/src/components/BoardTopNav/index.vue +++ b/ruoyi-ui/src/components/BoardTopNav/index.vue @@ -72,7 +72,12 @@ export default { async mounted() { if (this.$route.name === 'SmartScene' || this.$route.name === 'GPS' || this.$route.name === 'index' || this.$store.getters.sceneId) { } else { - await this.$router.replace({path: "/board/index"}); + if (this.$store.state.user.permissions.includes('business:monitor:index') || this.$store.state.user.permissions.includes('*:*:*')) { + await this.$router.replace({path: "/board/index"}); + } else { + await this.$router.replace({path: "/board/smartScene"}); + this.$router.push({path: '/board/smartScene'}) + } } await this.setSelectSecnes() if (this.$route.name === 'SmartScene' || this.$route.name === 'GPS') { diff --git a/ruoyi-ui/src/views/board/equipment/index.vue b/ruoyi-ui/src/views/board/equipment/index.vue index 9d280b4..b1d2c4a 100644 --- a/ruoyi-ui/src/views/board/equipment/index.vue +++ b/ruoyi-ui/src/views/board/equipment/index.vue @@ -70,7 +70,7 @@
+ class="infoItem" :style="'height:'+(Object.keys(i.deviceDataMap).length<4 ? '100%':'50%')">
{{ val }}:
{{ i.deviceDataMap[val] }}
@@ -163,8 +163,10 @@ export default { }); }, async getTree() { - const {data} = await treeList(this.$store.getters.sceneId) - this.treeData = data + if(this.$store.getters.sceneId){ + const {data} = await treeList(this.$store.getters.sceneId) + this.treeData = data + } }, treeClick(e) { if (!e.children?.length > 0) { @@ -421,7 +423,7 @@ export default { display: inline-block; position: relative; width: 6vw; - height: 100%; + height: 50%; .spanBg { //background-image: url("~@/assets/board/equipment/icon.png"); diff --git a/ruoyi-ui/src/views/board/equipmentMonitoring/index.vue b/ruoyi-ui/src/views/board/equipmentMonitoring/index.vue index a779d6e..96a8268 100644 --- a/ruoyi-ui/src/views/board/equipmentMonitoring/index.vue +++ b/ruoyi-ui/src/views/board/equipmentMonitoring/index.vue @@ -2,13 +2,13 @@
-
+
{{ i.deviceModeName }}
style="width: 100%"> + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- +
@@ -94,27 +103,26 @@ import { } from '@/api/board/equipmentMonitoring' export default { - components: { - }, + components: {}, data() { return { - loading:false, + loading: false, tableShow: false, form: { data1: '', data2: '', data3: null }, - deviceModeId:'', + deviceModeId: '', maxHeight: 0, tableData: [], - deviceList:[], + deviceList: [], sceneId: 0, - offset:1, - limit:10, - total:0, - deviceDataColumns:[], - tableDataRow:[] + offset: 1, + limit: 10, + total: 0, + deviceDataColumns: [], + tableDataRow: [] } }, async mounted() { @@ -122,30 +130,33 @@ export default { await this.getData() }, methods: { - query(){ - this.getRightData({deviceModeId:this.deviceModeId}) + log(e) { + console.log(e) }, - reset(){ + query() { + this.getRightData({deviceModeId: this.deviceModeId}) + }, + reset() { this.form = { data1: '', data2: '', data3: null } - this.getRightData({deviceModeId:this.deviceModeId}) + this.getRightData({deviceModeId: this.deviceModeId}) }, - async currentChange(e){ - this.tableData =this.tableDataRow.slice(this.limit*(e-1),this.limit*e) + async currentChange(e) { + this.tableData = this.tableDataRow.slice(this.limit * (e - 1), this.limit * e) }, - async getRightData(e){ + async getRightData(e) { this.deviceModeId = e.deviceModeId this.loading = true await this.setSelectLatestDataByDeviceMode({ "sceneId": this.$store.getters.sceneId, "deviceModeId": e.deviceModeId, - deviceCode:this.form.data1, - deviceName:this.form.data2, - startTime:this.form?.data3?.length>1? new Date(this.form.data3[0]).getTime():'', - endTime:this.form?.data3?.length>1? new Date(this.form.data3[1]).getTime():'', + deviceCode: this.form.data1, + deviceName: this.form.data2, + startTime: this.form?.data3?.length > 1 ? new Date(this.form.data3[0]).getTime() : '', + endTime: this.form?.data3?.length > 1 ? new Date(this.form.data3[1]).getTime() : '', // "offset": this.offset-1, // "limit": 10 }) @@ -163,24 +174,24 @@ export default { return {textAlign: 'center', backgroundColor: '#063468', color: '#05aaba'} } }, - async setSelectLatestDataByDeviceMode(e){ + async setSelectLatestDataByDeviceMode(e) { const {data} = await selectLatestDataByDeviceMode(e) this.deviceDataColumns = data.deviceDataColumns - this.tableDataRow =data.latestData || [] - this.tableData =( data.latestData || []).slice(0,this.limit) - this.total=data.latestData.length || 0 + this.tableDataRow = data.latestData || [] + this.tableData = (data.latestData || []).slice(0, this.limit) + this.total = data.latestData.length || 0 this.offset = 1 }, - async setDeviceModesBySceneId(){ - const {data} = await getDeviceModesBySceneId( { + async setDeviceModesBySceneId() { + const {data} = await getDeviceModesBySceneId({ "sceneId": this.$store.getters.sceneId, }) this.deviceList = data }, - toHistory(e,i){ + toHistory(e, i) { console.log(e) console.log(i) - this.$router.push({path: "/board/senso",query:{id:e,deviceModeId:i}}); + this.$router.push({path: "/board/senso", query: {id: e, deviceModeId: i}}); } } }; @@ -253,7 +264,8 @@ export default { color: #25bffc; border-color: #25bffc; } - /deep/.el-range-input{ + + /deep/ .el-range-input { background-color: #0000; } } diff --git a/ruoyi-ui/src/views/board/senso/index.vue b/ruoyi-ui/src/views/board/senso/index.vue index 9af1d55..ea5495a 100644 --- a/ruoyi-ui/src/views/board/senso/index.vue +++ b/ruoyi-ui/src/views/board/senso/index.vue @@ -179,6 +179,9 @@ export default { async setDeviceInfo() { const {data} = await getDeviceInfo(this.deviceId) this.topData = data || {} + if(this.topData.gpsFlag !== '1'){ + this.date = null + } }, async setHistoryData() { this.isMap = false @@ -191,7 +194,7 @@ export default { "offset": this.currentPage - 1, "limit": 10, startTime: this.date, - endTime: this.date + (1000 * 60 * 60 * 24) + endTime: this.date ? this.date + (1000 * 60 * 60 * 24) : null }) let dataList = data.historyData?.dataList || [] if (dataList.filter(e => (Object.keys(e).includes('longitude') || Object.keys(e).includes('longitude'))).length > 0) { diff --git a/ruoyi-ui/src/views/board/smartScene/index.vue b/ruoyi-ui/src/views/board/smartScene/index.vue index fd5546a..3bb9a54 100644 --- a/ruoyi-ui/src/views/board/smartScene/index.vue +++ b/ruoyi-ui/src/views/board/smartScene/index.vue @@ -136,7 +136,9 @@ export default { } }, async mounted() { - // await this.getData(this.$store.getters.sceneId) + if(this.$store.getters.sceneId !== null){ + await this.getData(this.$store.getters.sceneId) + } }, methods: { toMonitor(e){