Merge pull request '添加设备告警,白名单,固定车续费后台管理' (#1) from sjy into master

Reviewed-on: #1
This commit is contained in:
root 2024-08-20 09:32:21 +08:00
commit 369992c35c
10 changed files with 1580 additions and 0 deletions

View File

@ -0,0 +1,51 @@
import request from '@/config/axios'
// 固定车续费记录 VO
export interface VehicleRenewalRecordVO {
id: string // 续费订单号
parkNumber: string // 场库编号
method: string // 接口名称
plate: string // 车牌
carGroupName: string // 固定车组名称
payTime: string // 支付时间
payCharge: string // 续费金额
number: number // 车位号
feeMonth: string // 续费时长
end: string // 过期日期
carOwnerName: string // 车主名称
payType: string // 支付类型
orderNo: string // 支付流水号
}
// 固定车续费记录 API
export const VehicleRenewalRecordApi = {
// 查询固定车续费记录分页
getVehicleRenewalRecordPage: async (params: any) => {
return await request.get({ url: `/parking/vehicle-renewal-record/page`, params })
},
// 查询固定车续费记录详情
getVehicleRenewalRecord: async (id: number) => {
return await request.get({ url: `/parking/vehicle-renewal-record/get?id=` + id })
},
// 新增固定车续费记录
createVehicleRenewalRecord: async (data: VehicleRenewalRecordVO) => {
return await request.post({ url: `/parking/vehicle-renewal-record/create`, data })
},
// 修改固定车续费记录
updateVehicleRenewalRecord: async (data: VehicleRenewalRecordVO) => {
return await request.put({ url: `/parking/vehicle-renewal-record/update`, data })
},
// 删除固定车续费记录
deleteVehicleRenewalRecord: async (id: number) => {
return await request.delete({ url: `/parking/vehicle-renewal-record/delete?id=` + id })
},
// 导出固定车续费记录 Excel
exportVehicleRenewalRecord: async (params) => {
return await request.download({ url: `/parking/vehicle-renewal-record/export-excel`, params })
},
}

View File

@ -0,0 +1,50 @@
import request from '@/config/axios'
// 告警记录 VO
export interface WarningVO {
id: string // 表自增 id
parkNumber: string // 场库编号
areaCode: string // 停车区域
portCode: string // 车位编码
objectId: string // 告警对象 Id
objectCode: string // 告警对象编码
objectName: string // 告警对象名称
objectType: string // 告警对象类型
warningTime: string // 告警时间
reportTime: string // 上报时间
warningType: string // 告警类型
warningDetail: string // 告警详情
}
// 告警记录 API
export const WarningApi = {
// 查询告警记录分页
getWarningPage: async (params: any) => {
return await request.get({ url: `/parking/warning/page`, params })
},
// 查询告警记录详情
getWarning: async (id: number) => {
return await request.get({ url: `/parking/warning/get?id=` + id })
},
// 新增告警记录
createWarning: async (data: WarningVO) => {
return await request.post({ url: `/parking/warning/create`, data })
},
// 修改告警记录
updateWarning: async (data: WarningVO) => {
return await request.put({ url: `/parking/warning/update`, data })
},
// 删除告警记录
deleteWarning: async (id: number) => {
return await request.delete({ url: `/parking/warning/delete?id=` + id })
},
// 导出告警记录 Excel
exportWarning: async (params) => {
return await request.download({ url: `/parking/warning/export-excel`, params })
},
}

View File

@ -0,0 +1,48 @@
import request from '@/config/axios'
// 白名单管理 VO
export interface WhiteVO {
fixedId: number // 白名单记录流水号
parkNumber: string // 场库编号
plate: string // 车牌号
chargeType: string // 收费类型
certificate: string // 身份证信息
start: string // 生效日期
end: string // 失效日期
dept: string // 部门
memo: string // 备注
source: string // 来源
}
// 白名单管理 API
export const WhiteApi = {
// 查询白名单管理分页
getWhitePage: async (params: any) => {
return await request.get({ url: `/parking/white/page`, params })
},
// 查询白名单管理详情
getWhite: async (id: number) => {
return await request.get({ url: `/parking/white/get?id=` + id })
},
// 新增白名单管理
createWhite: async (data: WhiteVO) => {
return await request.post({ url: `/parking/white/create`, data })
},
// 修改白名单管理
updateWhite: async (data: WhiteVO) => {
return await request.put({ url: `/parking/white/update`, data })
},
// 删除白名单管理
deleteWhite: async (id: number) => {
return await request.delete({ url: `/parking/white/delete?id=` + id })
},
// 导出白名单管理 Excel
exportWhite: async (params) => {
return await request.download({ url: `/parking/white/export-excel`, params })
},
}

View File

@ -105,6 +105,16 @@ export enum DICT_TYPE {
COMMON_STATUS = 'common_status', COMMON_STATUS = 'common_status',
TERMINAL = 'terminal', // 终端 TERMINAL = 'terminal', // 终端
DATE_INTERVAL = 'date_interval', // 数据间隔 DATE_INTERVAL = 'date_interval', // 数据间隔
//停车场固定车续费支付类型
PAY_TYPE = 'pay_type',
//白名单支付类型
CHARGE_TYPE = 'charge_type',
//告警
OBJECT_TYPE = 'object_type',
WARNING_TYPE = 'warning_type',
// ========== SYSTEM 模块 ========== // ========== SYSTEM 模块 ==========
SYSTEM_USER_SEX = 'system_user_sex', SYSTEM_USER_SEX = 'system_user_sex',

View File

@ -0,0 +1,171 @@
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form
ref="formRef"
:model="formData"
:rules="formRules"
label-width="100px"
v-loading="formLoading"
>
<el-form-item label="场库编号" prop="parkNumber">
<el-input v-model="formData.parkNumber" placeholder="请输入场库编号" />
</el-form-item>
<el-form-item label="接口名称" prop="method">
<el-input v-model="formData.method" placeholder="请输入接口名称" />
</el-form-item>
<el-form-item label="车牌" prop="plate">
<el-input v-model="formData.plate" placeholder="请输入车牌" />
</el-form-item>
<el-form-item label="固定车组名称" prop="carGroupName">
<el-input v-model="formData.carGroupName" placeholder="请输入固定车组名称" />
</el-form-item>
<el-form-item label="支付时间" prop="payTime">
<el-date-picker
v-model="formData.payTime"
type="date"
value-format="x"
placeholder="选择支付时间"
/>
</el-form-item>
<el-form-item label="续费金额" prop="payCharge">
<el-input v-model="formData.payCharge" placeholder="请输入续费金额" />
</el-form-item>
<el-form-item label="车位号" prop="number">
<el-input v-model="formData.number" placeholder="请输入车位号" />
</el-form-item>
<el-form-item label="续费时长" prop="feeMonth">
<el-input v-model="formData.feeMonth" placeholder="请输入续费时长" />
</el-form-item>
<el-form-item label="过期日期" prop="end">
<el-input v-model="formData.end" placeholder="请输入过期日期" />
</el-form-item>
<el-form-item label="车主名称" prop="carOwnerName">
<el-input v-model="formData.carOwnerName" placeholder="请输入车主名称" />
</el-form-item>
<el-form-item label="支付类型" prop="payType">
<el-select v-model="formData.payType" placeholder="请选择支付类型">
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.PAY_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="支付流水号" prop="orderNo">
<el-input v-model="formData.orderNo" placeholder="请输入支付流水号" />
</el-form-item>
</el-form>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
<script setup lang="ts">
import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
import { VehicleRenewalRecordApi, VehicleRenewalRecordVO } from '@/api/parking/vehiclerenewalrecord'
/** 固定车续费记录 表单 */
defineOptions({ name: 'VehicleRenewalRecordForm' })
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
id: undefined,
parkNumber: undefined,
method: undefined,
plate: undefined,
carGroupName: undefined,
payTime: undefined,
payCharge: undefined,
number: undefined,
feeMonth: undefined,
end: undefined,
carOwnerName: undefined,
payType: undefined,
orderNo: undefined,
})
const formRules = reactive({
parkNumber: [{ required: true, message: '场库编号不能为空', trigger: 'blur' }],
method: [{ required: true, message: '接口名称不能为空', trigger: 'blur' }],
plate: [{ required: true, message: '车牌不能为空', trigger: 'blur' }],
carGroupName: [{ required: true, message: '固定车组名称不能为空', trigger: 'blur' }],
payTime: [{ required: true, message: '支付时间不能为空', trigger: 'blur' }],
payCharge: [{ required: true, message: '续费金额不能为空', trigger: 'blur' }],
number: [{ required: true, message: '车位号不能为空', trigger: 'blur' }],
feeMonth: [{ required: true, message: '续费时长不能为空', trigger: 'blur' }],
end: [{ required: true, message: '过期日期不能为空', trigger: 'blur' }],
carOwnerName: [{ required: true, message: '车主名称不能为空', trigger: 'blur' }],
payType: [{ required: true, message: '支付类型不能为空', trigger: 'change' }],
orderNo: [{ required: true, message: '支付流水号不能为空', trigger: 'blur' }],
})
const formRef = ref() // Ref
/** 打开弹窗 */
const open = async (type: string, id?: number) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
//
if (id) {
formLoading.value = true
try {
formData.value = await VehicleRenewalRecordApi.getVehicleRenewalRecord(id)
} finally {
formLoading.value = false
}
}
}
defineExpose({ open }) // open
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
await formRef.value.validate()
//
formLoading.value = true
try {
const data = formData.value as unknown as VehicleRenewalRecordVO
if (formType.value === 'create') {
await VehicleRenewalRecordApi.createVehicleRenewalRecord(data)
message.success(t('common.createSuccess'))
} else {
await VehicleRenewalRecordApi.updateVehicleRenewalRecord(data)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
id: undefined,
parkNumber: undefined,
method: undefined,
plate: undefined,
carGroupName: undefined,
payTime: undefined,
payCharge: undefined,
number: undefined,
feeMonth: undefined,
end: undefined,
carOwnerName: undefined,
payType: undefined,
orderNo: undefined,
}
formRef.value?.resetFields()
}
</script>

View File

@ -0,0 +1,321 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="100px"
>
<el-form-item label="场库编号" prop="parkNumber">
<el-input
v-model="queryParams.parkNumber"
placeholder="请输入场库编号"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="接口名称" prop="method">
<el-input
v-model="queryParams.method"
placeholder="请输入接口名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="车牌" prop="plate">
<el-input
v-model="queryParams.plate"
placeholder="请输入车牌"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="固定车组名称" prop="carGroupName">
<el-input
v-model="queryParams.carGroupName"
placeholder="请输入固定车组名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="支付时间" prop="payTime">
<el-date-picker
v-model="queryParams.payTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="续费金额" prop="payCharge">
<el-input
v-model="queryParams.payCharge"
placeholder="请输入续费金额"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="车位号" prop="number">
<el-input
v-model="queryParams.number"
placeholder="请输入车位号"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="续费时长" prop="feeMonth">
<el-input
v-model="queryParams.feeMonth"
placeholder="请输入续费时长"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="过期日期" prop="end">
<el-input
v-model="queryParams.end"
placeholder="请输入过期日期"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="车主名称" prop="carOwnerName">
<el-input
v-model="queryParams.carOwnerName"
placeholder="请输入车主名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="支付类型" prop="payType">
<el-select
v-model="queryParams.payType"
placeholder="请选择支付类型"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.PAY_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="支付流水号" prop="orderNo">
<el-input
v-model="queryParams.orderNo"
placeholder="请输入支付流水号"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker
v-model="queryParams.createTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button
type="primary"
plain
@click="openForm('create')"
v-hasPermi="['parking:vehicle-renewal-record:create']"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
plain
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['parking:vehicle-renewal-record:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
</ContentWrap>
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="续费订单号" align="center" prop="id" width="100px" />
<el-table-column label="场库编号" align="center" prop="parkNumber" />
<el-table-column label="接口名称" align="center" prop="method" />
<el-table-column label="车牌" align="center" prop="plate" />
<el-table-column label="固定车组名称" align="center" prop="carGroupName" width="110px"/>
<el-table-column label="支付时间" align="center" prop="payTime" />
<el-table-column label="续费金额" align="center" prop="payCharge" />
<el-table-column label="车位号" align="center" prop="number" />
<el-table-column label="续费时长" align="center" prop="feeMonth" />
<el-table-column label="过期日期" align="center" prop="end" />
<el-table-column label="车主名称" align="center" prop="carOwnerName" />
<el-table-column label="支付类型" align="center" prop="payType">
<template #default="scope">
<dict-tag :type="DICT_TYPE.PAY_TYPE" :value="scope.row.payType" />
</template>
</el-table-column>
<el-table-column label="支付流水号" align="center" prop="orderNo" width="100px"/>
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="180px"
/>
<el-table-column label="操作" align="center" fixed="right" width="110">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['parking:vehicle-renewal-record:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['parking:vehicle-renewal-record:delete']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<VehicleRenewalRecordForm ref="formRef" @success="getList" />
</template>
<script setup lang="ts">
import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import { VehicleRenewalRecordApi, VehicleRenewalRecordVO } from '@/api/parking/vehiclerenewalrecord'
import VehicleRenewalRecordForm from './VehicleRenewalRecordForm.vue'
/** 固定车续费记录 列表 */
defineOptions({ name: 'VehicleRenewalRecord' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const list = ref<VehicleRenewalRecordVO[]>([]) //
const total = ref(0) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
parkNumber: undefined,
method: undefined,
plate: undefined,
carGroupName: undefined,
payTime: [],
payCharge: undefined,
number: undefined,
feeMonth: undefined,
end: undefined,
carOwnerName: undefined,
payType: undefined,
orderNo: undefined,
createTime: [],
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await VehicleRenewalRecordApi.getVehicleRenewalRecordPage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await VehicleRenewalRecordApi.deleteVehicleRenewalRecord(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await VehicleRenewalRecordApi.exportVehicleRenewalRecord(queryParams)
download.excel(data, '固定车续费记录.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 初始化 **/
onMounted(() => {
getList()
})
</script>

View File

@ -0,0 +1,173 @@
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form
ref="formRef"
:model="formData"
:rules="formRules"
label-width="100px"
v-loading="formLoading"
>
<el-form-item label="场库编号" prop="parkNumber">
<el-input v-model="formData.parkNumber" placeholder="请输入场库编号" />
</el-form-item>
<el-form-item label="停车区域 " prop="areaCode">
<el-input v-model="formData.areaCode" placeholder="请输入停车区域 " />
</el-form-item>
<el-form-item label="车位编码" prop="portCode">
<el-input v-model="formData.portCode" placeholder="请输入车位编码" />
</el-form-item>
<el-form-item label="告警对象 Id" prop="objectId">
<el-input v-model="formData.objectId" placeholder="请输入告警对象 Id" />
</el-form-item>
<el-form-item label="告警对象编码" prop="objectCode">
<el-input v-model="formData.objectCode" placeholder="请输入告警对象编码" />
</el-form-item>
<el-form-item label="告警对象名称" prop="objectName">
<el-input v-model="formData.objectName" placeholder="请输入告警对象名称" />
</el-form-item>
<el-form-item label="告警对象类型" prop="objectType">
<el-select v-model="formData.objectType" placeholder="请选择告警对象类型">
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.OBJECT_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="告警时间" prop="warningTime">
<el-date-picker
v-model="formData.warningTime"
type="date"
value-format="x"
placeholder="选择告警时间"
/>
</el-form-item>
<el-form-item label="上报时间" prop="reportTime">
<el-date-picker
v-model="formData.reportTime"
type="date"
value-format="x"
placeholder="选择上报时间"
/>
</el-form-item>
<el-form-item label="告警类型" prop="warningType">
<el-select v-model="formData.warningType" placeholder="请选择告警类型">
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.WARNING_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="告警详情" prop="warningDetail">
<el-input v-model="formData.warningDetail" placeholder="请输入告警详情" />
</el-form-item>
</el-form>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
<script setup lang="ts">
import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
import { WarningApi, WarningVO } from '@/api/parking/warning'
/** 告警记录 表单 */
defineOptions({ name: 'WarningForm' })
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
id: undefined,
parkNumber: undefined,
areaCode: undefined,
portCode: undefined,
objectId: undefined,
objectCode: undefined,
objectName: undefined,
objectType: undefined,
warningTime: undefined,
reportTime: undefined,
warningType: undefined,
warningDetail: undefined,
})
const formRules = reactive({
parkNumber: [{ required: true, message: '场库编号不能为空', trigger: 'blur' }],
objectCode: [{ required: true, message: '告警对象编码不能为空', trigger: 'blur' }],
objectName: [{ required: true, message: '告警对象名称不能为空', trigger: 'blur' }],
objectType: [{ required: true, message: '告警对象类型不能为空', trigger: 'change' }],
warningTime: [{ required: true, message: '告警时间不能为空', trigger: 'blur' }],
reportTime: [{ required: true, message: '上报时间不能为空', trigger: 'blur' }],
warningType: [{ required: true, message: '告警类型不能为空', trigger: 'change' }],
})
const formRef = ref() // Ref
/** 打开弹窗 */
const open = async (type: string, id?: number) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
//
if (id) {
formLoading.value = true
try {
formData.value = await WarningApi.getWarning(id)
} finally {
formLoading.value = false
}
}
}
defineExpose({ open }) // open
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
await formRef.value.validate()
//
formLoading.value = true
try {
const data = formData.value as unknown as WarningVO
if (formType.value === 'create') {
await WarningApi.createWarning(data)
message.success(t('common.createSuccess'))
} else {
await WarningApi.updateWarning(data)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
id: undefined,
parkNumber: undefined,
areaCode: undefined,
portCode: undefined,
objectId: undefined,
objectCode: undefined,
objectName: undefined,
objectType: undefined,
warningTime: undefined,
reportTime: undefined,
warningType: undefined,
warningDetail: undefined,
}
formRef.value?.resetFields()
}
</script>

View File

@ -0,0 +1,322 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="100px"
>
<el-form-item label="场库编号" prop="parkNumber">
<el-input
v-model="queryParams.parkNumber"
placeholder="请输入场库编号"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="停车区域 " prop="areaCode">
<el-input
v-model="queryParams.areaCode"
placeholder="请输入停车区域 "
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="车位编码" prop="portCode">
<el-input
v-model="queryParams.portCode"
placeholder="请输入车位编码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="告警对象 Id" prop="objectId">
<el-input
v-model="queryParams.objectId"
placeholder="请输入告警对象 Id"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="告警对象编码" prop="objectCode">
<el-input
v-model="queryParams.objectCode"
placeholder="请输入告警对象编码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="告警对象名称" prop="objectName">
<el-input
v-model="queryParams.objectName"
placeholder="请输入告警对象名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="告警对象类型" prop="objectType">
<el-select
v-model="queryParams.objectType"
placeholder="请选择告警对象类型"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.OBJECT_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="告警时间" prop="warningTime">
<el-date-picker
v-model="queryParams.warningTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="上报时间" prop="reportTime">
<el-date-picker
v-model="queryParams.reportTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="告警类型" prop="warningType">
<el-select
v-model="queryParams.warningType"
placeholder="请选择告警类型"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.WARNING_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="告警详情" prop="warningDetail">
<el-input
v-model="queryParams.warningDetail"
placeholder="请输入告警详情"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker
v-model="queryParams.createTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button
type="primary"
plain
@click="openForm('create')"
v-hasPermi="['parking:warning:create']"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
plain
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['parking:warning:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
</ContentWrap>
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="ID" align="center" prop="id" />
<el-table-column label="场库编号" align="center" prop="parkNumber" />
<el-table-column label="停车区域 " align="center" prop="areaCode" />
<el-table-column label="车位编码" align="center" prop="portCode" />
<el-table-column label="告警对象 Id" align="center" prop="objectId" width="110px" />
<el-table-column label="告警对象编码" align="center" prop="objectCode" width="110px" />
<el-table-column label="告警对象名称" align="center" prop="objectName" width="110px" />
<el-table-column label="告警对象类型" align="center" prop="objectType" width="110px" >
<template #default="scope">
<dict-tag :type="DICT_TYPE.OBJECT_TYPE" :value="scope.row.objectType" />
</template>
</el-table-column>
<el-table-column label="告警时间" align="center" prop="warningTime" />
<el-table-column label="上报时间" align="center" prop="reportTime" />
<el-table-column label="告警类型" align="center" prop="warningType">
<template #default="scope">
<dict-tag :type="DICT_TYPE.WARNING_TYPE" :value="scope.row.warningType" />
</template>
</el-table-column>
<el-table-column label="告警详情" align="center" prop="warningDetail" />
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="180px"
/>
<el-table-column label="操作" align="center" fixed="right" width="110">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['parking:warning:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['parking:warning:delete']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<WarningForm ref="formRef" @success="getList" />
</template>
<script setup lang="ts">
import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import { WarningApi, WarningVO } from '@/api/parking/warning'
import WarningForm from './WarningForm.vue'
/** 告警记录 列表 */
defineOptions({ name: 'Warning' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const list = ref<WarningVO[]>([]) //
const total = ref(0) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
parkNumber: undefined,
areaCode: undefined,
portCode: undefined,
objectId: undefined,
objectCode: undefined,
objectName: undefined,
objectType: undefined,
warningTime: [],
reportTime: [],
warningType: undefined,
warningDetail: undefined,
createTime: [],
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await WarningApi.getWarningPage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await WarningApi.deleteWarning(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await WarningApi.exportWarning(queryParams)
download.excel(data, '告警记录.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 初始化 **/
onMounted(() => {
getList()
})
</script>

View File

@ -0,0 +1,148 @@
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form
ref="formRef"
:model="formData"
:rules="formRules"
label-width="100px"
v-loading="formLoading"
>
<el-form-item label="场库编号" prop="parkNumber">
<el-input v-model="formData.parkNumber" placeholder="请输入场库编号" />
</el-form-item>
<el-form-item label="车牌号" prop="plate">
<el-input v-model="formData.plate" placeholder="请输入车牌号" />
</el-form-item>
<el-form-item label="收费类型" prop="chargeType">
<el-select v-model="formData.chargeType" placeholder="请选择收费类型">
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.CHARGE_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="身份证信息" prop="certificate">
<el-input v-model="formData.certificate" placeholder="请输入身份证信息" />
</el-form-item>
<el-form-item label="生效日期" prop="start">
<el-input v-model="formData.start" placeholder="请输入生效日期" />
</el-form-item>
<el-form-item label="失效日期" prop="end">
<el-input v-model="formData.end" placeholder="请输入失效日期" />
</el-form-item>
<el-form-item label="部门" prop="dept">
<el-input v-model="formData.dept" placeholder="请输入部门" />
</el-form-item>
<el-form-item label="备注" prop="memo">
<el-input v-model="formData.memo" placeholder="请输入备注" />
</el-form-item>
<el-form-item label="来源" prop="source">
<el-input v-model="formData.source" placeholder="请输入来源" />
</el-form-item>
</el-form>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
<script setup lang="ts">
import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
import { WhiteApi, WhiteVO } from '@/api/parking/white'
/** 白名单管理 表单 */
defineOptions({ name: 'WhiteForm' })
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
fixedId: undefined,
parkNumber: undefined,
plate: undefined,
chargeType: undefined,
certificate: undefined,
start: undefined,
end: undefined,
dept: undefined,
memo: undefined,
source: undefined,
})
const formRules = reactive({
parkNumber: [{ required: true, message: '场库编号不能为空', trigger: 'blur' }],
plate: [{ required: true, message: '车牌号不能为空', trigger: 'blur' }],
chargeType: [{ required: true, message: '收费类型不能为空', trigger: 'change' }],
certificate: [{ required: true, message: '身份证信息不能为空', trigger: 'blur' }],
start: [{ required: true, message: '生效日期不能为空', trigger: 'blur' }],
end: [{ required: true, message: '失效日期不能为空', trigger: 'blur' }],
dept: [{ required: true, message: '部门不能为空', trigger: 'blur' }],
memo: [{ required: true, message: '备注不能为空', trigger: 'blur' }],
source: [{ required: true, message: '来源不能为空', trigger: 'blur' }],
})
const formRef = ref() // Ref
/** 打开弹窗 */
const open = async (type: string, id?: number) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
//
if (id) {
formLoading.value = true
try {
formData.value = await WhiteApi.getWhite(id)
} finally {
formLoading.value = false
}
}
}
defineExpose({ open }) // open
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
await formRef.value.validate()
//
formLoading.value = true
try {
const data = formData.value as unknown as WhiteVO
if (formType.value === 'create') {
await WhiteApi.createWhite(data)
message.success(t('common.createSuccess'))
} else {
await WhiteApi.updateWhite(data)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
fixedId: undefined,
parkNumber: undefined,
plate: undefined,
chargeType: undefined,
certificate: undefined,
start: undefined,
end: undefined,
dept: undefined,
memo: undefined,
source: undefined,
}
formRef.value?.resetFields()
}
</script>

View File

@ -0,0 +1,286 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="100px"
>
<el-form-item label="场库编号" prop="parkNumber">
<el-input
v-model="queryParams.parkNumber"
placeholder="请输入场库编号"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="车牌号" prop="plate">
<el-input
v-model="queryParams.plate"
placeholder="请输入车牌号"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="收费类型" prop="chargeType">
<el-select
v-model="queryParams.chargeType"
placeholder="请选择收费类型"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.CHARGE_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="身份证信息" prop="certificate">
<el-input
v-model="queryParams.certificate"
placeholder="请输入身份证信息"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="生效日期" prop="start">
<el-input
v-model="queryParams.start"
placeholder="请输入生效日期"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="失效日期" prop="end">
<el-input
v-model="queryParams.end"
placeholder="请输入失效日期"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="部门" prop="dept">
<el-input
v-model="queryParams.dept"
placeholder="请输入部门"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="备注" prop="memo">
<el-input
v-model="queryParams.memo"
placeholder="请输入备注"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="来源" prop="source">
<el-input
v-model="queryParams.source"
placeholder="请输入来源"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker
v-model="queryParams.createTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button
type="primary"
plain
@click="openForm('create')"
v-hasPermi="['parking:white:create']"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
plain
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['parking:white:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
</ContentWrap>
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="白名单记录流水号" align="center" prop="fixedId" />
<el-table-column label="场库编号" align="center" prop="parkNumber" />
<el-table-column label="车牌号" align="center" prop="plate" />
<el-table-column label="收费类型" align="center" prop="chargeType">
<template #default="scope">
<dict-tag :type="DICT_TYPE.CHARGE_TYPE" :value="scope.row.chargeType" />
</template>
</el-table-column>
<el-table-column label="身份证信息" align="center" prop="certificate" width='100px' />
<el-table-column label="生效日期" align="center" prop="start" />
<el-table-column label="失效日期" align="center" prop="end" />
<el-table-column label="部门" align="center" prop="dept" />
<el-table-column label="备注" align="center" prop="memo" />
<el-table-column label="来源" align="center" prop="source" />
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="180px"
/>
<el-table-column label="操作" align="center">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['parking:white:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['parking:white:delete']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<WhiteForm ref="formRef" @success="getList" />
</template>
<script setup lang="ts">
import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import { WhiteApi, WhiteVO } from '@/api/parking/white'
import WhiteForm from './WhiteForm.vue'
/** 白名单管理 列表 */
defineOptions({ name: 'White' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const list = ref<WhiteVO[]>([]) //
const total = ref(0) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
parkNumber: undefined,
plate: undefined,
chargeType: undefined,
certificate: undefined,
start: undefined,
end: undefined,
dept: undefined,
memo: undefined,
source: undefined,
createTime: [],
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await WhiteApi.getWhitePage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await WhiteApi.deleteWhite(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await WhiteApi.exportWhite(queryParams)
download.excel(data, '白名单管理.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 初始化 **/
onMounted(() => {
getList()
})
</script>