feat:bug
This commit is contained in:
1 parent
b736fef16a
commit
180149b5cb
6 files changed
+86
-10
No files matched your search
@@ -10,6 +10,15 @@ export function totalPage(params: any) {
|
||||
})
|
||||
}
|
||||
|
||||
// 军车出车次数(根据时间类型)
|
||||
export function armyCarCountByDateType(data: any) {
|
||||
return request({
|
||||
url: '/admin/car/total/army-car-count-by-date-type',
|
||||
method: 'post',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
/* end 人闸统计 end */
|
||||
|
||||
export function dataCleaning(data?: Object) {
|
||||
|
||||
@@ -167,6 +167,9 @@ onBeforeMount(() => {
|
||||
getDataList()
|
||||
}
|
||||
storesPanel.openFromPanel()
|
||||
} else if (query.data) {
|
||||
Object.assign(state.queryForm, JSON.parse(query.data))
|
||||
getDataList()
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -1,7 +1,17 @@
|
||||
<!-- 车辆信息 -->
|
||||
<template>
|
||||
<div class="h-full flex flex-col">
|
||||
<com-title title="过车数据" />
|
||||
<com-title title="过车数据">
|
||||
<div class="flex-1 flex justify-center cursor-pointer" @click="handleTodayClick">
|
||||
<span>今日过军车{{ total.today }}次</span>
|
||||
</div>
|
||||
<div class="flex items-center justify-center cursor-pointer" @click="handleMoreClick">
|
||||
<span>查看更多</span>
|
||||
<el-icon>
|
||||
<ArrowRightBold />
|
||||
</el-icon>
|
||||
</div>
|
||||
</com-title>
|
||||
<div>
|
||||
<el-date-picker v-model="timer.queryParams.capTimeList" value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="datetimerange" @change="handleChange" :disabledDate="disabledDate" />
|
||||
@@ -37,16 +47,20 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="carList">
|
||||
import { dayjs } from 'element-plus';
|
||||
|
||||
import * as carApi from "/@/api/car/carRecord"
|
||||
|
||||
import { simplePoll } from "/@/utils/poll"
|
||||
import { paseSingleImage } from "/@/utils/image"
|
||||
|
||||
const { push } = useRouter()
|
||||
|
||||
const comTitle = defineAsyncComponent(() => import('./com-title.vue'));
|
||||
|
||||
const timer = reactive<any>({
|
||||
initial: null,
|
||||
interval: 10 * 1000,
|
||||
interval: 30 * 1000,
|
||||
data: {
|
||||
records: [],
|
||||
total: 0
|
||||
@@ -58,8 +72,13 @@ const timer = reactive<any>({
|
||||
}
|
||||
})
|
||||
|
||||
const total = ref<any>({
|
||||
today: 0
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
initListPoll()
|
||||
getTotal()
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
@@ -67,6 +86,22 @@ onUnmounted(() => {
|
||||
timer.initial = null
|
||||
})
|
||||
|
||||
// 查看更多
|
||||
const handleMoreClick = () => {
|
||||
push({ path: "/car/carRecord/index" })
|
||||
}
|
||||
|
||||
const handleTodayClick = () => {
|
||||
const params = {
|
||||
capTimeList: [
|
||||
dayjs().startOf('day').format('YYYY-MM-DD HH:mm:ss'),
|
||||
dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss')
|
||||
],
|
||||
isArmyCar: "1"
|
||||
}
|
||||
push({ path: "/car/carRecord/index", query: { data: JSON.stringify(params) } })
|
||||
}
|
||||
|
||||
const handleSizeChange = (val: number) => {
|
||||
timer.queryParams.current = 1
|
||||
timer.queryParams.size = val
|
||||
@@ -94,6 +129,22 @@ function disabledDate(time: Date) {
|
||||
return time.getTime() < yesterday.getTime() || time.getTime() >= tomorrow.getTime()
|
||||
}
|
||||
|
||||
const getTotal = async () => {
|
||||
try {
|
||||
const _params = {}
|
||||
const { code, data } = await carApi.armyCarCountByDateType({ ..._params });
|
||||
if (code != 0) throw new Error("code!=0")
|
||||
console.log("军车出车次数(根据时间类型):", data);
|
||||
if (!data) return
|
||||
const today = data.find((v: any) => v.dateType == 'TODAY')
|
||||
total.value = {
|
||||
today: today?.timeCount || 0
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("|军车出车次数(根据时间类型)|意外的错误:", error);
|
||||
}
|
||||
}
|
||||
|
||||
// 过车列表
|
||||
const initListPoll = () => {
|
||||
timer.initial = simplePoll(async () => {
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
<!-- 车辆信息 -->
|
||||
<template>
|
||||
<div class="h-full flex flex-col">
|
||||
<com-title title="过人数据" />
|
||||
<com-title title="过人数据">
|
||||
<div class="flex items-center justify-center cursor-pointer" @click="handleMoreClick">
|
||||
<span>查看更多</span>
|
||||
<el-icon>
|
||||
<ArrowRightBold />
|
||||
</el-icon>
|
||||
</div>
|
||||
</com-title>
|
||||
<div>
|
||||
<el-date-picker v-model="timer.queryParams.swingTimeList" value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="datetimerange" @change="handleChange" :disabledDate="disabledDate" />
|
||||
@@ -43,6 +50,8 @@ import * as doorApi from "/@/api/door/doorRecord"
|
||||
import { simplePoll } from "/@/utils/poll"
|
||||
import { paseSingleImage } from "/@/utils/image"
|
||||
|
||||
const { push } = useRouter()
|
||||
|
||||
const comTitle = defineAsyncComponent(() => import('./com-title.vue'));
|
||||
|
||||
const timer = reactive<any>({
|
||||
@@ -68,6 +77,11 @@ onUnmounted(() => {
|
||||
timer.initial = null
|
||||
})
|
||||
|
||||
// 查看更多
|
||||
const handleMoreClick = () => {
|
||||
push({ path: "/door/doorRecord/index" })
|
||||
}
|
||||
|
||||
const handleSizeChange = (val: number) => {
|
||||
timer.queryParams.current = 1
|
||||
timer.queryParams.size = val
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
</com-title>
|
||||
<el-table v-if="tableHeaderList && tableHeaderList.length" style="padding-top: 10px;" :data="disposeDataList"
|
||||
v-loading="state.loading" border
|
||||
:cell-style="{ ...tableStyle.cellStyle, fontSize: '12px', padding: '8px 0 !important' }"
|
||||
:cell-style="{ ...tableStyle.cellStyle, fontSize: '14px', padding: '8px 0 !important' }"
|
||||
:header-cell-style="{ ...tableStyle.headerCellStyle, fontSize: '12px', padding: '8px 0 !important' }"
|
||||
@sort-change="sortChangeHandle">
|
||||
<el-table-column v-for="(v, i) in tableHeaderList" :width="getWidth(v)" :prop="v.prop" :label="v.label">
|
||||
|
||||
@@ -31,18 +31,17 @@ const VideoPay = defineAsyncComponent(() => import('./components/video-pay.vue')
|
||||
|
||||
const stores = useTagsViewRoutes();
|
||||
|
||||
onBeforeMount(() => {
|
||||
onMounted(() => {
|
||||
const query: any = useRoute().query
|
||||
if (query && query.action == 'login') {
|
||||
stores.setCurrenFullscreen(true)
|
||||
nextTick(() => {
|
||||
stores.setCurrenFullscreen(true)
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
const query: any = useRoute().query
|
||||
if (query && query.action == 'login') {
|
||||
stores.setCurrenFullscreen(false)
|
||||
}
|
||||
stores.setCurrenFullscreen(false)
|
||||
})
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user