add:增加agv运行时间管理功能

This commit is contained in:
zds
2025-06-18 14:08:56 +08:00
parent 7d86bc5116
commit d609ebd7f6
11 changed files with 425 additions and 2 deletions

View File

@@ -0,0 +1,88 @@
<template>
<el-dialog
append-to-body
v-loading.fullscreen.lock="fullscreenLoading"
title="agv运行管理"
:visible.sync="dialogVisible"
destroy-on-close
width="1200px"
@close="close"
@open="open"
>
<div class="grid-container">
<el-table
ref="table2"
:data="tableDtl"
style="width: 100%;"
size="mini"
border
:highlight-current-row="true"
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
>
<el-table-column v-if="false" prop="agv_id" label="uuid" align="center" />
<el-table-column min-width="60" prop="agv_no" label="车辆编号" align="center" />
<el-table-column min-width="60" prop="run_second" label="车辆运行总秒数(s)" align="center" />
<el-table-column min-width="60" prop="run_hour" label="车辆运行总时长(h)" align="center" :formatter="Myduration" />
<el-table-column min-width="50" prop="deadline" label="统计截至日期" align="center" />
<el-table-column min-width="60" prop="last_day_second" label="上一次累加运行秒数(s)" align="center" />
<el-table-column min-width="60" prop="update_time" label="更新时间" align="center" />
</el-table>
</div>
</el-dialog>
</template>
<script>
import crudParam from '@/views/system/param/param'
import { crud } from '@crud/crud'
export default {
name: 'AgvDialog',
components: { },
mixins: [crud()],
props: {
dialogShow: {
type: Boolean,
default: false
}
},
data() {
return {
dialogVisible: false,
fullscreenLoading: false,
tableDtl: []
}
},
watch: {
dialogShow: {
handler(newValue) {
this.dialogVisible = newValue
}
}
},
methods: {
open() {
this.queryTableDtl()
},
close() {
this.$emit('update:dialogShow', false)
this.tableDtl = []
this.$emit('AddChanged')
},
Myduration(row, column) {
let diffDays = 0
if (row.run_second && row.run_second !== null) {
diffDays = Math.floor(row.run_second / (60 * 60)) // 转换为H
}
return diffDays
},
queryTableDtl() {
crudParam.showDetail3({ 'name': 'station' }).then(res => {
this.tableDtl = res
})
}
}
}
</script>
<style scoped>
</style>

View File

@@ -24,6 +24,16 @@
>
充电桩管理
</el-button>
<el-button
slot="right"
class="filter-item"
type="info"
icon="el-icon-position"
size="mini"
@click="divOpenAgv"
>
agv运行时间管理
</el-button>
</crudOperation>
<!--表单组件-->
<el-dialog
@@ -82,6 +92,7 @@
</div>
<tube-dialog2 :dialog-show.sync="showView2" @AddChanged="querytable" />
<station-dialog :dialog-show.sync="showStation" @AddChanged="querytable" />
<agv-dialog :dialog-show.sync="showAgv" @AddChanged="querytable" />
</div>
</template>
@@ -93,6 +104,7 @@ import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import TubeDialog2 from '@/views/system/param/tubeDialog2.vue'
import StationDialog from '@/views/system/param/stationDialog.vue'
import AgvDialog from '@/views/system/param/agvDialog.vue'
const defaultForm = {
id: null,
@@ -104,7 +116,7 @@ const defaultForm = {
}
export default {
name: 'Param',
components: { pagination, crudOperation, udOperation, TubeDialog2, StationDialog },
components: { pagination, crudOperation, udOperation, TubeDialog2, StationDialog, AgvDialog },
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
return CRUD({ title: '系统参数', url: 'api/param', idField: 'id', sort: 'id,desc', crudMethod: { ...crudParam },
@@ -126,6 +138,7 @@ export default {
},
showView2: false,
showStation: false,
showAgv: false,
rules: {
id: [
{ required: true, message: '不能为空', trigger: 'blur' }
@@ -160,6 +173,9 @@ export default {
},
divOpenStation() {
this.showStation = true
},
divOpenAgv() {
this.showAgv = true
}
}
}

View File

@@ -54,6 +54,14 @@ export function showDetail2(params) {
})
}
export function showDetail3(params) {
return request({
url: 'api/dict/showDetail3',
method: 'get',
params
})
}
export function initDict(data) {
return request({
url: 'api/dict/initDict',
@@ -62,4 +70,4 @@ export function initDict(data) {
})
}
export default { add, edit, del, getValueByCode, queryParam, setParam, showDetail2, initDict }
export default { add, edit, del, getValueByCode, queryParam, setParam, showDetail2, initDict, showDetail3 }