|
|
|
@ -2,74 +2,148 @@
|
|
|
|
|
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
|
|
|
|
<el-form
|
|
|
|
|
ref="formRef"
|
|
|
|
|
:model="formData"
|
|
|
|
|
:model="formData.formData"
|
|
|
|
|
:rules="formRules"
|
|
|
|
|
label-width="100px"
|
|
|
|
|
v-loading="formLoading"
|
|
|
|
|
label-position="top"
|
|
|
|
|
>
|
|
|
|
|
<el-form-item label="换电站编码" prop="stationNo">
|
|
|
|
|
<el-input v-model="formData.stationNo" placeholder="请输入换电站编码" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="电接头连接状态 0:未知1:已经连接2:未连接" prop="connectionState">
|
|
|
|
|
<el-input v-model="formData.connectionState" placeholder="请输入电接头连接状态 0:未知1:已经连接2:未连接" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="枪号" prop="gunNo">
|
|
|
|
|
<el-input v-model="formData.gunNo" placeholder="请输入枪号" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="枪的工作状态 00H:待机01H:工作02H:工作完成03H:充电暂停" prop="chargeState">
|
|
|
|
|
<el-input v-model="formData.chargeState" placeholder="请输入枪的工作状态 00H:待机01H:工作02H:工作完成03H:充电暂停" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="枪名" prop="gunName">
|
|
|
|
|
<el-input v-model="formData.gunName" placeholder="请输入枪名" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="告警状态 00H:无告警01H:有告警" prop="alarmStatus">
|
|
|
|
|
<el-radio-group v-model="formData.alarmStatus">
|
|
|
|
|
<el-radio label="1">请选择字典生成</el-radio>
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="故障码" prop="troubleCode">
|
|
|
|
|
<el-input v-model="formData.troubleCode" placeholder="请输入故障码" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="充电开始时间" prop="startTime">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="formData.startTime"
|
|
|
|
|
type="date"
|
|
|
|
|
value-format="x"
|
|
|
|
|
placeholder="选择充电开始时间"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="已经充电时间 单位分钟" prop="chargeTime">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="formData.chargeTime"
|
|
|
|
|
type="date"
|
|
|
|
|
value-format="x"
|
|
|
|
|
placeholder="选择已经充电时间 单位分钟"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="充电开始SOC" prop="startSoc">
|
|
|
|
|
<el-input v-model="formData.startSoc" placeholder="请输入充电开始SOC" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="当前SOC" prop="currentSoc">
|
|
|
|
|
<el-input v-model="formData.currentSoc" placeholder="请输入当前SOC" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="充电开始SOE" prop="startSoe">
|
|
|
|
|
<el-input v-model="formData.startSoe" placeholder="请输入充电开始SOE" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="当前SOE" prop="currentSoe">
|
|
|
|
|
<el-input v-model="formData.currentSoe" placeholder="请输入当前SOE" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="当前充电电压" prop="currentVoltage">
|
|
|
|
|
<el-input v-model="formData.currentVoltage" placeholder="请输入当前充电电压" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="当前充电电流" prop="currentElectricCurrent">
|
|
|
|
|
<el-input v-model="formData.currentElectricCurrent" placeholder="请输入当前充电电流" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="BMS需求电压" prop="bmsVoltage">
|
|
|
|
|
<el-input v-model="formData.bmsVoltage" placeholder="请输入BMS需求电压" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="BMS需求电流" prop="bmsElectricCurrent">
|
|
|
|
|
<el-input v-model="formData.bmsElectricCurrent" placeholder="请输入BMS需求电流" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-row :gutter="24">
|
|
|
|
|
<!-- <el-col :span="12">
|
|
|
|
|
<el-form-item label="换电站编码" prop="stationNo">
|
|
|
|
|
<el-input v-model="formData.formData.stationNo" placeholder="请输入换电站编码" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col> -->
|
|
|
|
|
<!-- <el-col :span="12">
|
|
|
|
|
<el-form-item label="电接头连接状态" prop="connectionState">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="formData.formData.connectionState"
|
|
|
|
|
placeholder="请选电接头连接状态"
|
|
|
|
|
clearable
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in getIntDictOptions(DICT_TYPE.STATE_ELECTRICALCO_NNECTOR)"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col> -->
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="枪号" prop="gunNo">
|
|
|
|
|
<el-input v-model="formData.formData.gunNo" placeholder="请输入枪号" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="枪的工作状态" prop="chargeState">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="formData.formData.chargeState"
|
|
|
|
|
placeholder="请选枪的工作状态"
|
|
|
|
|
clearable
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in getIntDictOptions(DICT_TYPE.GUNSTATUS)"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="枪名" prop="gunName">
|
|
|
|
|
<el-input v-model="formData.formData.gunName" placeholder="请输入枪名" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<!-- <el-col :span="12">
|
|
|
|
|
<el-form-item label="告警状态" prop="alarmStatus">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="formData.formData.alarmStatus"
|
|
|
|
|
placeholder="请选告警状态"
|
|
|
|
|
clearable
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in getIntDictOptions(DICT_TYPE.STATE_ALARM)"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col> -->
|
|
|
|
|
<!-- <el-col :span="12">
|
|
|
|
|
<el-form-item label="故障码" prop="troubleCode">
|
|
|
|
|
<el-input v-model="formData.formData.troubleCode" placeholder="请输入故障码" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col> -->
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="充电开始时间" prop="startTime">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="formData.formData.startTime"
|
|
|
|
|
type="date"
|
|
|
|
|
value-format="x"
|
|
|
|
|
placeholder="选择充电开始时间"
|
|
|
|
|
style="width: 100%;"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="已经充电时间(分钟)" prop="chargeTime">
|
|
|
|
|
<el-input v-model="formData.formData.chargeTime" placeholder="请输入已经充电时间" />
|
|
|
|
|
<!-- <el-date-picker
|
|
|
|
|
v-model="formData.formData.chargeTime"
|
|
|
|
|
type="date"
|
|
|
|
|
value-format="x"
|
|
|
|
|
placeholder="选择已经充电时间 单位分钟"
|
|
|
|
|
style="width: 100%;"
|
|
|
|
|
/> -->
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="充电开始SOC" prop="startSoc">
|
|
|
|
|
<el-input v-model="formData.formData.startSoc" placeholder="请输入充电开始SOC" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="当前SOC" prop="currentSoc">
|
|
|
|
|
<el-input v-model="formData.formData.currentSoc" placeholder="请输入当前SOC" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<!-- <el-col :span="12">
|
|
|
|
|
<el-form-item label="充电开始SOE" prop="startSoe">
|
|
|
|
|
<el-input v-model="formData.formData.startSoe" placeholder="请输入充电开始SOE" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="当前SOE" prop="currentSoe">
|
|
|
|
|
<el-input v-model="formData.formData.currentSoe" placeholder="请输入当前SOE" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col> -->
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="当前充电电压" prop="currentVoltage">
|
|
|
|
|
<el-input v-model="formData.formData.currentVoltage" placeholder="请输入当前充电电压" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="当前充电电流" prop="currentElectricCurrent">
|
|
|
|
|
<el-input v-model="formData.formData.currentElectricCurrent" placeholder="请输入当前充电电流" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<!-- <el-col :span="12">
|
|
|
|
|
<el-form-item label="BMS需求电压" prop="bmsVoltage">
|
|
|
|
|
<el-input v-model="formData.formData.bmsVoltage" placeholder="请输入BMS需求电压" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="BMS需求电流" prop="bmsElectricCurrent">
|
|
|
|
|
<el-input v-model="formData.formData.bmsElectricCurrent" placeholder="请输入BMS需求电流" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col> -->
|
|
|
|
|
</el-row>
|
|
|
|
|
</el-form>
|
|
|
|
|
<template #footer>
|
|
|
|
|
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
|
|
|
@ -79,10 +153,17 @@
|
|
|
|
|
</template>
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { ChargeGunApi, ChargeGunVO } from '@/api/system/equipmentManagement/energyMeter/gunlist'
|
|
|
|
|
|
|
|
|
|
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
|
|
|
|
/** 充电机数据上报 表单 */
|
|
|
|
|
defineOptions({ name: 'ChargeGunForm' })
|
|
|
|
|
|
|
|
|
|
// const props = defineProps({
|
|
|
|
|
// stationNo: {
|
|
|
|
|
// type:String,
|
|
|
|
|
// default:''
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
const { t } = useI18n() // 国际化
|
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
|
|
|
|
|
|
@ -90,9 +171,11 @@ const dialogVisible = ref(false) // 弹窗的是否展示
|
|
|
|
|
const dialogTitle = ref('') // 弹窗的标题
|
|
|
|
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
|
|
|
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
|
|
|
|
const formData = ref({
|
|
|
|
|
id: undefined,
|
|
|
|
|
const formData = reactive({
|
|
|
|
|
formData:{
|
|
|
|
|
id: undefined,
|
|
|
|
|
stationNo: undefined,
|
|
|
|
|
// stationNo: props.stationNo,
|
|
|
|
|
connectionState: undefined,
|
|
|
|
|
gunNo: undefined,
|
|
|
|
|
chargeState: undefined,
|
|
|
|
@ -109,23 +192,28 @@ const formData = ref({
|
|
|
|
|
currentElectricCurrent: undefined,
|
|
|
|
|
bmsVoltage: undefined,
|
|
|
|
|
bmsElectricCurrent: undefined,
|
|
|
|
|
})
|
|
|
|
|
chargeId:'',
|
|
|
|
|
}})
|
|
|
|
|
const formRules = reactive({
|
|
|
|
|
stationNo: [{ required: true, message: '换电站编码不能为空', trigger: 'blur' }],
|
|
|
|
|
gunNo: [{ required: true, message: '枪号不能为空', trigger: 'blur' }],
|
|
|
|
|
gunName: [{ required: true, message: '枪名不能为空', trigger: 'blur' }]
|
|
|
|
|
})
|
|
|
|
|
const formRef = ref() // 表单 Ref
|
|
|
|
|
|
|
|
|
|
/** 打开弹窗 */
|
|
|
|
|
const open = async (type: string, id?: number) => {
|
|
|
|
|
const open = async (type: string, id?: number,stationNo:string,chargeId:string) => {
|
|
|
|
|
dialogVisible.value = true
|
|
|
|
|
dialogTitle.value = t('action.' + type)
|
|
|
|
|
formType.value = type
|
|
|
|
|
// formData.formData.stationNo=stationNo
|
|
|
|
|
formData.formData.chargeId=chargeId
|
|
|
|
|
resetForm()
|
|
|
|
|
// 修改时,设置数据
|
|
|
|
|
if (id) {
|
|
|
|
|
formLoading.value = true
|
|
|
|
|
try {
|
|
|
|
|
formData.value = await ChargeGunApi.getChargeGun(id)
|
|
|
|
|
formData.formData = await ChargeGunApi.getChargeGun(id)
|
|
|
|
|
} finally {
|
|
|
|
|
formLoading.value = false
|
|
|
|
|
}
|
|
|
|
@ -141,8 +229,11 @@ const submitForm = async () => {
|
|
|
|
|
// 提交请求
|
|
|
|
|
formLoading.value = true
|
|
|
|
|
try {
|
|
|
|
|
const data = formData.value as unknown as ChargeGunApi.ChargeGunVO
|
|
|
|
|
|
|
|
|
|
const data = formData.formData as unknown as ChargeGunApi.ChargeGunVO
|
|
|
|
|
// data.stationNo= props.stationNo
|
|
|
|
|
if (formType.value === 'create') {
|
|
|
|
|
|
|
|
|
|
await ChargeGunApi.createChargeGun(data)
|
|
|
|
|
message.success(t('common.createSuccess'))
|
|
|
|
|
} else {
|
|
|
|
@ -150,6 +241,8 @@ const submitForm = async () => {
|
|
|
|
|
message.success(t('common.updateSuccess'))
|
|
|
|
|
}
|
|
|
|
|
dialogVisible.value = false
|
|
|
|
|
resetForm()
|
|
|
|
|
|
|
|
|
|
// 发送操作成功的事件
|
|
|
|
|
emit('success')
|
|
|
|
|
} finally {
|
|
|
|
@ -159,26 +252,32 @@ const submitForm = async () => {
|
|
|
|
|
|
|
|
|
|
/** 重置表单 */
|
|
|
|
|
const resetForm = () => {
|
|
|
|
|
formData.value = {
|
|
|
|
|
id: undefined,
|
|
|
|
|
stationNo: undefined,
|
|
|
|
|
connectionState: undefined,
|
|
|
|
|
gunNo: undefined,
|
|
|
|
|
chargeState: undefined,
|
|
|
|
|
gunName: undefined,
|
|
|
|
|
alarmStatus: undefined,
|
|
|
|
|
troubleCode: undefined,
|
|
|
|
|
startTime: undefined,
|
|
|
|
|
chargeTime: undefined,
|
|
|
|
|
startSoc: undefined,
|
|
|
|
|
currentSoc: undefined,
|
|
|
|
|
startSoe: undefined,
|
|
|
|
|
currentSoe: undefined,
|
|
|
|
|
currentVoltage: undefined,
|
|
|
|
|
currentElectricCurrent: undefined,
|
|
|
|
|
bmsVoltage: undefined,
|
|
|
|
|
bmsElectricCurrent: undefined,
|
|
|
|
|
}
|
|
|
|
|
// formData.formData= {
|
|
|
|
|
// id: undefined,
|
|
|
|
|
// stationNo: undefined,
|
|
|
|
|
// connectionState: undefined,
|
|
|
|
|
// gunNo: undefined,
|
|
|
|
|
// chargeState: undefined,
|
|
|
|
|
// gunName: undefined,
|
|
|
|
|
// alarmStatus: undefined,
|
|
|
|
|
// troubleCode: undefined,
|
|
|
|
|
// startTime: undefined,
|
|
|
|
|
// chargeTime: undefined,
|
|
|
|
|
// startSoc: undefined,
|
|
|
|
|
// currentSoc: undefined,
|
|
|
|
|
// startSoe: undefined,
|
|
|
|
|
// currentSoe: undefined,
|
|
|
|
|
// currentVoltage: undefined,
|
|
|
|
|
// currentElectricCurrent: undefined,
|
|
|
|
|
// bmsVoltage: undefined,
|
|
|
|
|
// bmsElectricCurrent: undefined
|
|
|
|
|
// }
|
|
|
|
|
formRef.value?.resetFields()
|
|
|
|
|
}
|
|
|
|
|
// watch(()=>props.stationNo,(newValue)=>{
|
|
|
|
|
|
|
|
|
|
// },{
|
|
|
|
|
// deep:true,
|
|
|
|
|
// immediate:true
|
|
|
|
|
// })
|
|
|
|
|
</script>
|
|
|
|
|