|
|
|
@ -0,0 +1,578 @@
|
|
|
|
|
<template>
|
|
|
|
|
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
|
|
|
|
<el-form
|
|
|
|
|
ref="formRef"
|
|
|
|
|
:model="formData"
|
|
|
|
|
:rules="formRules"
|
|
|
|
|
label-width="150px"
|
|
|
|
|
v-loading="formLoading"
|
|
|
|
|
>
|
|
|
|
|
<!-- <el-form-item label="运营商id" prop="operatorId">
|
|
|
|
|
<el-input v-model="formData.operatorId" placeholder="请输入运营商id" />
|
|
|
|
|
</el-form-item> -->
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="换电站编码" prop="stationNo">
|
|
|
|
|
<el-input v-model="formData.stationNo" placeholder="请输入" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="换电站名称" prop="stationName">
|
|
|
|
|
<el-input v-model="formData.stationName" placeholder="请输入" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="换电站识别号" prop="stationSn">
|
|
|
|
|
<el-input v-model="formData.stationSn" placeholder="请输入" /> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="地理位置" prop="stationLocation">
|
|
|
|
|
<el-input v-model="formData.stationLocation" placeholder="请输入" /> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="12"
|
|
|
|
|
><el-form-item label="站类型" prop="stationType">
|
|
|
|
|
<el-select v-model="formData.stationType" placeholder="请选择" style="width: 100%">
|
|
|
|
|
<el-option label="请选择" value="" />
|
|
|
|
|
</el-select> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="计费模型" prop="sbmId">
|
|
|
|
|
<el-select v-model="formData.sbmId" placeholder="请选择" style="width: 100%">
|
|
|
|
|
<el-option
|
|
|
|
|
:label="item.name"
|
|
|
|
|
:value="item.id"
|
|
|
|
|
v-for="(item, index) in sbmIdlist"
|
|
|
|
|
:key="index"
|
|
|
|
|
/>
|
|
|
|
|
</el-select> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="电价模型" prop="priceId">
|
|
|
|
|
<el-select v-model="formData.priceId" placeholder="请选择" style="width: 100%">
|
|
|
|
|
<el-option
|
|
|
|
|
:label="item.name"
|
|
|
|
|
:value="item.id"
|
|
|
|
|
v-for="(item, index) in priceIdList"
|
|
|
|
|
:key="index"
|
|
|
|
|
/>
|
|
|
|
|
</el-select> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="场站运营模型" prop="runId">
|
|
|
|
|
<el-select v-model="formData.runId" placeholder="请选择" style="width: 100%">
|
|
|
|
|
<el-option
|
|
|
|
|
:label="item.name"
|
|
|
|
|
:value="item.id"
|
|
|
|
|
v-for="(item, index) in runIdlist"
|
|
|
|
|
:key="index"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="经度" prop="longitude">
|
|
|
|
|
<el-input v-model="formData.longitude" placeholder="请输入" /> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="纬度" prop="latitude">
|
|
|
|
|
<el-input v-model="formData.latitude" placeholder="请输入" /> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="区域编号" prop="areaCode">
|
|
|
|
|
<el-input v-model="formData.areaCode" placeholder="请输入" /> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="营运时间" prop="operationTime">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="formData.operationTime"
|
|
|
|
|
type="date"
|
|
|
|
|
value-format="x"
|
|
|
|
|
placeholder="选择营运时间"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="12"
|
|
|
|
|
><el-form-item label="投放时间" prop="launchTime">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="formData.launchTime"
|
|
|
|
|
type="date"
|
|
|
|
|
value-format="x"
|
|
|
|
|
placeholder="选择投放时间"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
/> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="手机号" prop="contactWay">
|
|
|
|
|
<el-input v-model="formData.contactWay" placeholder="请输入" /> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="服务电话" prop="serviceTel">
|
|
|
|
|
<el-input v-model="formData.serviceTel" placeholder="请输入" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="联系方式-邮箱地址" prop="email">
|
|
|
|
|
<el-input v-model="formData.email" placeholder="请输入" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="负责人" prop="principal">
|
|
|
|
|
<el-input v-model="formData.principal" placeholder="请输入" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="所属运营企业" prop="stationCompany">
|
|
|
|
|
<el-input v-model="formData.stationCompany" placeholder="请输入" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
<!-- <el-col :span="12">
|
|
|
|
|
<el-form-item label="电池运营模型" prop="batteryId">
|
|
|
|
|
<el-input v-model="formData.batteryId" placeholder="请输入" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col> -->
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="站控主机软件版本号" prop="stationSftVer">
|
|
|
|
|
<el-input v-model="formData.stationSftVer" placeholder="请输入" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="云平台区域编码" prop="nodeId">
|
|
|
|
|
<el-input v-model="formData.nodeId" placeholder="请输入" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="场站服务状态" prop="status">
|
|
|
|
|
<el-select v-model="formData.status" placeholder="请选择" style="width: 100%">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in getIntDictOptions(DICT_TYPE.STATION_INFO_STATUS)"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="协议版本号" prop="protocolVersion">
|
|
|
|
|
<el-input v-model="formData.protocolVersion" placeholder="请输入" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="设备列表版本号" prop="deviceVersion">
|
|
|
|
|
<el-input v-model="formData.deviceVersion" placeholder="请输入" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="场站运行模式" prop="runModel">
|
|
|
|
|
<el-select v-model="formData.runModel" placeholder="请选择" style="width: 100%">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in getIntDictOptions(DICT_TYPE.RUNMODEL_TYPE)"
|
|
|
|
|
: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="staType">
|
|
|
|
|
<el-select v-model="formData.staType" placeholder="请选择" style="width: 100%">
|
|
|
|
|
<el-option label="请选择" value="" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="区域分类" prop="areaType">
|
|
|
|
|
<el-select v-model="formData.areaType" placeholder="请选择" style="width: 100%">
|
|
|
|
|
<el-option label="请选择" value="" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="特殊配置" prop="specialConfig">
|
|
|
|
|
<el-input v-model="formData.specialConfig" placeholder="请输入" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="站型类型" prop="type">
|
|
|
|
|
<el-select v-model="formData.type" placeholder="请选择" style="width: 100%">
|
|
|
|
|
<el-option label="请选择" value="" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="是否小程序可见" prop="appAccess">
|
|
|
|
|
<el-select v-model="formData.appAccess" placeholder="请选择" style="width: 100%">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in getIntDictOptions(DICT_TYPE.APPACCESS_STATUS)"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="计费模型" prop="settleType">
|
|
|
|
|
<el-select v-model="formData.settleType" placeholder="请选择" style="width: 100%">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in getIntDictOptions(DICT_TYPE.SETTLE_TYPE)"
|
|
|
|
|
: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="siteType">
|
|
|
|
|
<el-select v-model="formData.siteType" placeholder="请选择" style="width: 100%">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in getIntDictOptions(DICT_TYPE.SITE_TYPE)"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="服务车型" prop="matchVehicles">
|
|
|
|
|
<el-select v-model="formData.matchVehicles" placeholder="请选择" style="width: 100%">
|
|
|
|
|
<el-option label="请选择" value="" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="是否全天营业" prop="oahFlag">
|
|
|
|
|
<el-select v-model="formData.oahFlag" placeholder="请选择" style="width: 100%">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in getIntDictOptions(DICT_TYPE.OAHFLAG_STATUS)"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="站点分类" prop="siteClassification">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="formData.siteClassification"
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in getIntDictOptions(DICT_TYPE.SITECLASSIFICATION_TYPE)"
|
|
|
|
|
: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="constructionSite">
|
|
|
|
|
<el-select v-model="formData.constructionSite" placeholder="请选择" style="width: 100%">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in getIntDictOptions(DICT_TYPE.CONSTRUCTIONSITE)"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="供应商代码" prop="supplierCode">
|
|
|
|
|
<el-input v-model="formData.supplierCode" placeholder="请输入" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="是否启用" prop="enable">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="formData.siteClassification"
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in getIntDictOptions(DICT_TYPE.STATIONINFO_ENABLE)"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item
|
|
|
|
|
label="所属运营企业统一社会信用代码"
|
|
|
|
|
label-width="240px"
|
|
|
|
|
prop="socialCreditCode"
|
|
|
|
|
>
|
|
|
|
|
<el-input v-model="formData.socialCreditCode" placeholder="请输入" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="站控版本号" prop="version">
|
|
|
|
|
<el-input v-model="formData.version" placeholder="请输入" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="换电站现场照片" prop="avatar">
|
|
|
|
|
<UploadImg v-model="formData.avatar" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="区域名称" prop="areaName">
|
|
|
|
|
<el-input v-model="formData.areaName" placeholder="请输入" /> </el-form-item
|
|
|
|
|
></el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
</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 { StationInfoApi, StationInfoVO } from '@/api/share/stationinfo'
|
|
|
|
|
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
|
|
|
|
|
|
|
|
|
/** 换电站基础信息 表单 */
|
|
|
|
|
defineOptions({ name: 'StationInfoForm' })
|
|
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
|
|
|
sbmIdlist: {
|
|
|
|
|
type: Array,
|
|
|
|
|
default: () => []
|
|
|
|
|
},
|
|
|
|
|
priceIdList: {
|
|
|
|
|
type: Array,
|
|
|
|
|
default: () => []
|
|
|
|
|
},
|
|
|
|
|
runIdlist: {
|
|
|
|
|
type: Array,
|
|
|
|
|
default: () => []
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const { t } = useI18n() // 国际化
|
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
|
|
|
|
|
|
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
|
|
|
|
const dialogTitle = ref('') // 弹窗的标题
|
|
|
|
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
|
|
|
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
|
|
|
|
const formData = ref({
|
|
|
|
|
id: undefined,
|
|
|
|
|
operatorId: undefined,
|
|
|
|
|
stationNo: undefined,
|
|
|
|
|
stationName: undefined,
|
|
|
|
|
stationSn: undefined,
|
|
|
|
|
stationLocation: undefined,
|
|
|
|
|
stationType: undefined,
|
|
|
|
|
sbmId: undefined,
|
|
|
|
|
priceId: undefined,
|
|
|
|
|
runId: undefined,
|
|
|
|
|
avatar: undefined,
|
|
|
|
|
latitude: undefined,
|
|
|
|
|
longitude: undefined,
|
|
|
|
|
areaName: undefined,
|
|
|
|
|
areaCode: undefined,
|
|
|
|
|
operationTime: undefined,
|
|
|
|
|
launchTime: undefined,
|
|
|
|
|
contactWay: undefined,
|
|
|
|
|
serviceTel: undefined,
|
|
|
|
|
email: undefined,
|
|
|
|
|
principal: undefined,
|
|
|
|
|
stationCompany: undefined,
|
|
|
|
|
socialCreditCode: undefined,
|
|
|
|
|
stationSftVer: undefined,
|
|
|
|
|
supplierCode: undefined,
|
|
|
|
|
nodeId: undefined,
|
|
|
|
|
status: undefined,
|
|
|
|
|
version: undefined,
|
|
|
|
|
protocolVersion: undefined,
|
|
|
|
|
deviceVersion: undefined,
|
|
|
|
|
runModel: 1,
|
|
|
|
|
staType: undefined,
|
|
|
|
|
areaType: undefined,
|
|
|
|
|
specialConfig: undefined,
|
|
|
|
|
type: undefined,
|
|
|
|
|
appAccess: 0,
|
|
|
|
|
settleType: undefined,
|
|
|
|
|
siteType: undefined,
|
|
|
|
|
matchVehicles: undefined,
|
|
|
|
|
oahFlag: undefined,
|
|
|
|
|
siteClassification: undefined,
|
|
|
|
|
constructionSite: undefined,
|
|
|
|
|
batteryId: undefined,
|
|
|
|
|
enable: undefined
|
|
|
|
|
})
|
|
|
|
|
const formRules = reactive({
|
|
|
|
|
stationNo: [{ required: true, message: '换电站编码不能为空', trigger: 'blur' }],
|
|
|
|
|
stationName: [{ required: true, message: '换电站名称不能为空', trigger: 'blur' }],
|
|
|
|
|
stationSn: [
|
|
|
|
|
{ required: true, message: '换电站识别号不能为空', trigger: 'blur' },
|
|
|
|
|
{ min: 1, max: 4, message: '长度不能超过4', trigger: 'blur' }
|
|
|
|
|
],
|
|
|
|
|
latitude: [{ required: true, message: '纬度不能为空', trigger: 'blur' }],
|
|
|
|
|
longitude: [{ required: true, message: '经度不能为空', trigger: 'blur' }],
|
|
|
|
|
areaName: [{ required: true, message: '区域名称不能为空', trigger: 'blur' }],
|
|
|
|
|
areaCode: [{ 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 StationInfoApi.getStationInfo(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 StationInfoApi.StationInfoVO
|
|
|
|
|
if (formType.value === 'create') {
|
|
|
|
|
await StationInfoApi.createStationInfo(data)
|
|
|
|
|
message.success(t('common.createSuccess'))
|
|
|
|
|
} else {
|
|
|
|
|
await StationInfoApi.updateStationInfo(data)
|
|
|
|
|
message.success(t('common.updateSuccess'))
|
|
|
|
|
}
|
|
|
|
|
dialogVisible.value = false
|
|
|
|
|
// 发送操作成功的事件
|
|
|
|
|
emit('success')
|
|
|
|
|
} finally {
|
|
|
|
|
formLoading.value = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 重置表单 */
|
|
|
|
|
const resetForm = () => {
|
|
|
|
|
formData.value = {
|
|
|
|
|
id: undefined,
|
|
|
|
|
operatorId: undefined,
|
|
|
|
|
stationNo: undefined,
|
|
|
|
|
stationName: undefined,
|
|
|
|
|
stationSn: undefined,
|
|
|
|
|
stationLocation: undefined,
|
|
|
|
|
stationType: undefined,
|
|
|
|
|
sbmId: undefined,
|
|
|
|
|
priceId: undefined,
|
|
|
|
|
runId: undefined,
|
|
|
|
|
avatar: undefined,
|
|
|
|
|
latitude: undefined,
|
|
|
|
|
longitude: undefined,
|
|
|
|
|
areaName: undefined,
|
|
|
|
|
areaCode: undefined,
|
|
|
|
|
operationTime: undefined,
|
|
|
|
|
launchTime: undefined,
|
|
|
|
|
contactWay: undefined,
|
|
|
|
|
serviceTel: undefined,
|
|
|
|
|
email: undefined,
|
|
|
|
|
principal: undefined,
|
|
|
|
|
stationCompany: undefined,
|
|
|
|
|
socialCreditCode: undefined,
|
|
|
|
|
stationSftVer: undefined,
|
|
|
|
|
supplierCode: undefined,
|
|
|
|
|
nodeId: undefined,
|
|
|
|
|
status: undefined,
|
|
|
|
|
version: undefined,
|
|
|
|
|
protocolVersion: undefined,
|
|
|
|
|
deviceVersion: undefined,
|
|
|
|
|
runModel: undefined,
|
|
|
|
|
staType: undefined,
|
|
|
|
|
areaType: undefined,
|
|
|
|
|
specialConfig: undefined,
|
|
|
|
|
type: undefined,
|
|
|
|
|
appAccess: undefined,
|
|
|
|
|
settleType: undefined,
|
|
|
|
|
siteType: undefined,
|
|
|
|
|
matchVehicles: undefined,
|
|
|
|
|
oahFlag: undefined,
|
|
|
|
|
siteClassification: undefined,
|
|
|
|
|
constructionSite: undefined,
|
|
|
|
|
batteryId: undefined,
|
|
|
|
|
enable: undefined
|
|
|
|
|
}
|
|
|
|
|
formRef.value?.resetFields()
|
|
|
|
|
}
|
|
|
|
|
</script>
|