实时数据

dev.car
法外狂徒张三 2024-10-11 15:59:00 +08:00
parent 5cab7d2d5d
commit 1b6a8e770c
6 changed files with 49 additions and 29 deletions

View File

@ -9,6 +9,14 @@ export function listMessage(query) {
}) })
} }
export function getCarRealTime(vin) {
return request({
url: '/car/realTime/getCarRealTime',
method: 'get',
params: {vin}
})
}
export function dobListMessage(query) { export function dobListMessage(query) {
return request({ return request({
url: '/car/messageInfo/dobList', url: '/car/messageInfo/dobList',

View File

@ -134,13 +134,7 @@
:name="item.value" :name="item.value"
> >
</el-tab-pane> </el-tab-pane>
<el-table v-loading="loading" :data="messageList" @selection-change="handleSelectionChange" v-if="srcs==''"> <p v-html="trueTime" v-if="srcs==''"></p>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="车辆报文类型编码" align="center" prop="messageTypeCode" />
<el-table-column label="报文字段" align="center" >
</el-table-column>
</el-table>
</el-tabs> </el-tabs>
<iframe :src="srcs" width="100%" height="1000px" frameborder="0" v-if="srcs!=''"></iframe> <iframe :src="srcs" width="100%" height="1000px" frameborder="0" v-if="srcs!=''"></iframe>
@ -152,13 +146,14 @@
<script> <script>
import { listCar, getCar, delCar, addCar, updateCar } from "/src/api/car/car"; import { listCar, getCar, delCar, addCar, updateCar } from "/src/api/car/car";
import {listMessage, testMessage} from "@/api/car/message/message"; import { getCarRealTime, listMessage, testMessage } from '@/api/car/message/message'
import {getMessageType, listMessageType} from "@/api/car/message/messageType"; import {getMessageType, listMessageType} from "@/api/car/message/messageType";
export default { export default {
name: "Car", name: "Car",
data() { data() {
return { return {
timer: null,
srcs:'', srcs:'',
options: [ options: [
{ {
@ -233,7 +228,8 @@ export default {
carPlate: [ carPlate: [
{ required: true, message: "车辆车牌号不能为空", trigger: "blur" } { required: true, message: "车辆车牌号不能为空", trigger: "blur" }
], ],
} },
trueTime:{},
}; };
}, },
created() { created() {
@ -245,6 +241,20 @@ export default {
document.querySelector('.tags-view-container').style.display = 'none'; document.querySelector('.tags-view-container').style.display = 'none';
}, },
methods: { methods: {
getTrueTime(){
var vin="";
vin=this.messageParams.carVin
getCarRealTime(vin).then(response => {
this.trueTime = response.data
console.log(this.trueTime)
})
},
setTimer() {
this.timer = setInterval( () => {
console.log('开始定时...每过一秒执行一次')
this.getTrueTime()
}, 1000)
},
handleTypeTabClick(tab){ handleTypeTabClick(tab){
console.log(tab.name) console.log(tab.name)
this.srcs = tab.name this.srcs = tab.name
@ -263,6 +273,7 @@ export default {
this.messageParams.flag = false; this.messageParams.flag = false;
} }
this.getMessageList(row) this.getMessageList(row)
this.setTimer()
}, },
getMessageList(row) { getMessageList(row) {
this.loading = true; this.loading = true;
@ -274,6 +285,7 @@ export default {
this.getMessageTypeList(); this.getMessageTypeList();
}); });
}, },
/** 查询车辆基础信息列表 */ /** 查询车辆基础信息列表 */
getList() { getList() {
this.loading = true; this.loading = true;

View File

@ -81,7 +81,7 @@
icon="el-icon-plus" icon="el-icon-plus"
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['platform:logs:add']" v-hasPermi="['warning:logs:add']"
>新增</el-button> >新增</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
@ -92,7 +92,7 @@
size="mini" size="mini"
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['platform:logs:edit']" v-hasPermi="['warning:logs:edit']"
>修改</el-button> >修改</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
@ -103,7 +103,7 @@
size="mini" size="mini"
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['platform:logs:remove']" v-hasPermi="['warning:logs:remove']"
>删除</el-button> >删除</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
@ -113,7 +113,7 @@
icon="el-icon-download" icon="el-icon-download"
size="mini" size="mini"
@click="handleExport" @click="handleExport"
v-hasPermi="['platform:logs:export']" v-hasPermi="['warning:logs:export']"
>导出</el-button> >导出</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
@ -146,14 +146,14 @@
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['platform:logs:edit']" v-hasPermi="['warning:logs:edit']"
>修改</el-button> >修改</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['platform:logs:remove']" v-hasPermi="['warning:logs:remove']"
>删除</el-button> >删除</el-button>
</template> </template>
</el-table-column> </el-table-column>

View File

@ -71,7 +71,7 @@
icon="el-icon-plus" icon="el-icon-plus"
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['platform:rule:add']" v-hasPermi="['warning:rule:add']"
>新增 >新增
</el-button> </el-button>
</el-col> </el-col>
@ -83,7 +83,7 @@
size="mini" size="mini"
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['platform:rule:edit']" v-hasPermi="['warning:rule:edit']"
>修改 >修改
</el-button> </el-button>
</el-col> </el-col>
@ -95,7 +95,7 @@
size="mini" size="mini"
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['platform:rule:remove']" v-hasPermi="['warning:rule:remove']"
>删除 >删除
</el-button> </el-button>
</el-col> </el-col>
@ -106,7 +106,7 @@
icon="el-icon-download" icon="el-icon-download"
size="mini" size="mini"
@click="handleExport" @click="handleExport"
v-hasPermi="['platform:rule:export']" v-hasPermi="['warning:rule:export']"
>导出 >导出
</el-button> </el-button>
</el-col> </el-col>
@ -130,7 +130,7 @@
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['platform:rule:edit']" v-hasPermi="['warning:rule:edit']"
>修改 >修改
</el-button> </el-button>
<el-button <el-button
@ -138,7 +138,7 @@
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['platform:rule:remove']" v-hasPermi="['warning:rule:remove']"
>删除 >删除
</el-button> </el-button>
</template> </template>

View File

@ -39,7 +39,7 @@
icon="el-icon-plus" icon="el-icon-plus"
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['platform:strategy:add']" v-hasPermi="['warning:strategy:add']"
>新增 >新增
</el-button> </el-button>
</el-col> </el-col>
@ -51,7 +51,7 @@
size="mini" size="mini"
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['platform:strategy:edit']" v-hasPermi="['warning:strategy:edit']"
>修改 >修改
</el-button> </el-button>
</el-col> </el-col>
@ -63,7 +63,7 @@
size="mini" size="mini"
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['platform:strategy:remove']" v-hasPermi="['warning:strategy:remove']"
>删除 >删除
</el-button> </el-button>
</el-col> </el-col>
@ -74,7 +74,7 @@
icon="el-icon-download" icon="el-icon-download"
size="mini" size="mini"
@click="handleExport" @click="handleExport"
v-hasPermi="['platform:strategy:export']" v-hasPermi="['warning:strategy:export']"
>导出 >导出
</el-button> </el-button>
</el-col> </el-col>
@ -94,7 +94,7 @@
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['platform:strategy:edit']" v-hasPermi="['warning:strategy:edit']"
>修改 >修改
</el-button> </el-button>
<el-button <el-button
@ -102,7 +102,7 @@
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['platform:strategy:remove']" v-hasPermi="['warning:strategy:remove']"
>删除 >删除
</el-button> </el-button>
<el-button <el-button
@ -110,7 +110,7 @@
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleAddRule(scope.row)" @click="handleAddRule(scope.row)"
v-hasPermi="['platform:strategy:remove']" v-hasPermi="['warning:strategy:remove']"
>配置规则 >配置规则
</el-button> </el-button>
</template> </template>

View File

@ -35,7 +35,7 @@ module.exports = {
proxy: { proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
target: `http://localhost:8080`, target: `http://localhost:8081`,
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: '' ['^' + process.env.VUE_APP_BASE_API]: ''