修改默认值

dev
夜笙歌 1 year ago
parent 7bbc2a3dad
commit 4f7facac64

@ -14,6 +14,10 @@ export default {
},
methods: {
goto() {
console.log(this.$store.state.user.permissions)
console.log(this.$store.state.user.permissions.includes('business:monitor:index'))
console.log( this.$store.state.user.permissions.includes('*:*:*'))
console.log( this.$store.state.user.permissions.filter(e=>e.includes('business:monitor')))
if (this.$store.state.user.permissions.includes('business:monitor:index') || this.$store.state.user.permissions.includes('*:*:*')) {
this.$router.push({path: "/board/index"});
} else {

@ -9,7 +9,7 @@ const state = {
device: 'desktop',
size: Cookies.get('size') || 'medium',
language: Cookies.get('language') || 'en_US',
sceneId:0
sceneId:null
}
const mutations = {

@ -27,32 +27,38 @@
</template>
<div>
<div>
<!-- <el-row :gutter="24">-->
<!-- <el-col :span="12">-->
<el-row :gutter="24" style="height: 30px;">
<el-col :span="12">
<!-- <el-radio-group v-model="radio">-->
<!-- <el-radio-button label="日统计报表"></el-radio-button>-->
<!-- <el-radio-button label="月统计报表"></el-radio-button>-->
<!-- </el-radio-group>-->
<!-- </el-col>-->
<!-- <el-col :span="12">-->
<!-- <div style="position: absolute; right: 30px;">-->
<!-- <span style="color: #fff;"> 开始时间</span>-->
<!-- <div style="display: inline-block;width: 200px;margin-right: 12px;">-->
<!-- <el-date-picker placeholder="选择日期" style="width: 100%;" type="date"></el-date-picker>-->
<!-- </div>-->
<!-- <el-button type="primary">搜索</el-button>-->
<!-- <el-button>重置</el-button>-->
</el-col>
<el-col :span="12">
<div style="position: absolute; right: 30px;">
<span style="color: #fff;"> 开始时间</span>
<div style="display: inline-block;width: 220px;margin-right: 12px;">
<el-date-picker
v-model="date"
format="yyyy-MM-dd"
placeholder="选择日期"
type="date"
value-format="timestamp">
</el-date-picker>
</div>
<el-button type="primary" @click="search"></el-button>
<el-button @click="reset"></el-button>
<!-- <el-button>导出</el-button>-->
<!-- </div>-->
<!-- </el-col>-->
<!-- </el-row>-->
</div>
</el-col>
</el-row>
<el-table v-if="show" :cell-style="setStyle"
:data="tableData" :header-cell-style="{ textAlign: 'center',backgroundColor:'#0a457d' }"
style="width: 100%;margin-top: 12px;">
<el-table-column v-for="i in deviceDataColumns" :label="i.columnName" :prop="i.columnKey">
</el-table-column>
</el-table>
<el-pagination :currentPage="currentPage" :pageSize="5" :total="total" background
<el-pagination v-show="!isMap" :currentPage="currentPage" :pageSize="5" :total="total" background
layout="prev, pager, next" @current-change="currentChange">
</el-pagination>
</div>
@ -110,7 +116,8 @@ export default {
currentPage: 1,
deviceDataColumns: [],
show: false,
isMap:false
isMap: false,
date: new Date().getTime()
}
},
async mounted() {
@ -125,6 +132,15 @@ export default {
await this.getData()
},
methods: {
async search() {
this.currentPage = 1
await this.setHistoryData()
},
async reset() {
this.currentPage = 1
this.date = new Date().getTime()
await this.setHistoryData()
},
setPolyline(e) {
let polyline = new AMap.Polyline({
path: e,
@ -136,7 +152,10 @@ export default {
setMarker(e, i) {
let marker = new AMap.Marker({
position: e, // [116.39, 39.9]
title: i
title: `
经度${e[0]}
纬度:${e[1]}
时间${i}`
});
map.add(marker);
map.setFitView()
@ -171,9 +190,10 @@ export default {
deviceModeId: this.deviceModeId,
"offset": this.currentPage - 1,
"limit": 10,
"startTime": 0
startTime: this.date,
endTime: this.date + (1000 * 60 * 60 * 24)
})
let dataList = data.historyData.dataList
let dataList = data.historyData?.dataList || []
if (dataList.filter(e => (Object.keys(e).includes('longitude') || Object.keys(e).includes('longitude'))).length > 0) {
this.isMap = true
dataList.filter(e => (Object.keys(e).includes('longitude') || Object.keys(e).includes('longitude'))).forEach(e => {
@ -182,16 +202,16 @@ export default {
this.setPolyline(dataList.filter(e => (Object.keys(e).includes('longitude') || Object.keys(e).includes('longitude'))).map(e => {
return [e.longitude, e.latitude]
}))
this.tableData = data.historyData.dataList
this.total = data.historyData.count
this.currentPage = 1
this.deviceDataColumns = data.deviceDataColumns
this.$nextTick(() => {
this.show = true
})
// this.tableData = data.historyData?.dataList
// this.total = data.historyData?.count
// this.currentPage = 1
// this.deviceDataColumns = data.deviceDataColumns
// this.$nextTick(() => {
// this.show = true
// })
} else {
this.tableData = data.historyData.dataList
this.total = data.historyData.count
this.tableData = data.historyData?.dataList
this.total = data.historyData?.count
this.currentPage = 1
this.deviceDataColumns = data.deviceDataColumns
this.$nextTick(() => {

@ -125,15 +125,18 @@ export default {
},
watch:{
jtData:{
handler() {
this.getData(this.$store.getters.sceneId)
async handler() {
console.log(this.$store.getters.sceneId)
if(this.$store.getters.sceneId !== null){
await this.getData(this.$store.getters.sceneId)
}
},
deep: true,
immediate: true
}
},
mounted() {
this.getData(this.$store.getters.sceneId)
async mounted() {
// await this.getData(this.$store.getters.sceneId)
},
methods: {
toMonitor(e){

Loading…
Cancel
Save