|
|
|
@ -1,238 +1,254 @@
|
|
|
|
|
<template>
|
|
|
|
|
<el-drawer title="基本信息" v-model="dialogVisible" size="60%">
|
|
|
|
|
<el-descriptions :column="1" border>
|
|
|
|
|
<el-descriptions-item label="电价模型名称" min-width="120">
|
|
|
|
|
{{ oldlist.name || "--" }}
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
</el-descriptions>
|
|
|
|
|
<br/>
|
|
|
|
|
<div class="title_info" style="margin-top: 20px">换电站基础信息 </div>
|
|
|
|
|
<br/>
|
|
|
|
|
<!-- table -->
|
|
|
|
|
<ContentWrap>
|
|
|
|
|
<el-table :data="stationList" :stripe="true" :show-overflow-tooltip="true" :header-cell-style="{
|
|
|
|
|
backgroundColor: '#eff4fa'
|
|
|
|
|
}">
|
|
|
|
|
|
|
|
|
|
<el-table-column label="换电站编码" align="center" prop="stationNo" />
|
|
|
|
|
<el-table-column label="换电站名称" align="center" prop="stationName" />
|
|
|
|
|
<el-table-column label="换电站识别号" align="center" prop="stationSn" />
|
|
|
|
|
<!-- <el-table-column label="地理位置" align="center" prop="stationLocation" /> -->
|
|
|
|
|
<el-table-column label="站类型" align="center" prop="stationType" >
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :type="DICT_TYPE.SITECLASSIFICATION_TYPE" :value="scope.row.stationType" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<!-- <el-table-column label="换电站现场照片" align="center" prop="avatar" /> -->
|
|
|
|
|
<!-- <el-table-column label="纬度" align="center" prop="latitude" /> -->
|
|
|
|
|
<!-- <el-table-column label="经度" align="center" prop="longitude" /> -->
|
|
|
|
|
<el-table-column label="区域名称" align="center" prop="areaName" />
|
|
|
|
|
<!-- <el-table-column label="区域编号" align="center" prop="areaCode" /> -->
|
|
|
|
|
<el-drawer title="基本信息" v-model="dialogVisible" size="60%">
|
|
|
|
|
<el-descriptions :column="1" border>
|
|
|
|
|
<el-descriptions-item label="电价模型名称" min-width="120">
|
|
|
|
|
{{ oldlist.name || '--' }}
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
</el-descriptions>
|
|
|
|
|
<br />
|
|
|
|
|
<div class="title_info" style="margin-top: 20px">换电站基础信息 </div>
|
|
|
|
|
<br />
|
|
|
|
|
<!-- table -->
|
|
|
|
|
<ContentWrap>
|
|
|
|
|
<el-table
|
|
|
|
|
:data="stationList"
|
|
|
|
|
:stripe="true"
|
|
|
|
|
:show-overflow-tooltip="true"
|
|
|
|
|
:header-cell-style="{
|
|
|
|
|
backgroundColor: '#eff4fa'
|
|
|
|
|
}"
|
|
|
|
|
>
|
|
|
|
|
<el-table-column label="换电站编码" align="center" prop="stationNo" width="120" />
|
|
|
|
|
<el-table-column label="换电站名称" align="center" prop="stationName" width="120" />
|
|
|
|
|
<el-table-column label="换电站识别号" align="center" prop="stationSn" width="120" />
|
|
|
|
|
<!-- <el-table-column label="地理位置" align="center" prop="stationLocation" /> -->
|
|
|
|
|
<el-table-column label="站类型" align="center" prop="stationType" width="120">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :type="DICT_TYPE.SITECLASSIFICATION_TYPE" :value="scope.row.stationType" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<!-- <el-table-column label="换电站现场照片" align="center" prop="avatar" /> -->
|
|
|
|
|
<!-- <el-table-column label="纬度" align="center" prop="latitude" /> -->
|
|
|
|
|
<!-- <el-table-column label="经度" align="center" prop="longitude" /> -->
|
|
|
|
|
<el-table-column label="区域名称" align="center" prop="areaName" />
|
|
|
|
|
<!-- <el-table-column label="区域编号" align="center" prop="areaCode" /> -->
|
|
|
|
|
|
|
|
|
|
<el-table-column label="营运时间" align="center" prop="operationTime" width="180"
|
|
|
|
|
:formatter="dateFormatter"/>
|
|
|
|
|
<el-table-column label="投放时间 " align="center" prop="launchTime" width="180"
|
|
|
|
|
:formatter="dateFormatter"/>
|
|
|
|
|
<el-table-column label="联系方式-手机号 " align="center" prop="contactWay" />
|
|
|
|
|
<!-- <el-table-column label="服务电话" align="center" prop="serviceTel" /> -->
|
|
|
|
|
<!-- <el-table-column label="联系方式-邮箱地址 " align="center" prop="email" /> -->
|
|
|
|
|
<el-table-column label="负责人" align="center" prop="principal" />
|
|
|
|
|
<!-- <el-table-column label="所属运营企业" align="center" prop="stationCompany" /> -->
|
|
|
|
|
<!-- <el-table-column label="场站服务状态" align="center" prop="status" /> -->
|
|
|
|
|
<!-- <el-table-column label="场站运行模式" align="center" prop="runModel" /> -->
|
|
|
|
|
<!-- <el-table-column label="工位分类" align="center" prop="staType" /> -->
|
|
|
|
|
<!-- <el-table-column label="区域分类" align="center" prop="areaType" /> -->
|
|
|
|
|
<!-- <el-table-column label="站型类型 " align="center" prop="siteType" /> -->
|
|
|
|
|
<!-- 1:公共; 50:个人; 100:公交(专用)101:环卫(专用)102:物流(专用)103: 出租⻋(专用)104:分时租赁(专用)105:小区共享(专用)106:单位(专用)107:私人共享桩(专用)255:其他 -->
|
|
|
|
|
<!-- <el-table-column label="服务车型" align="center" prop="matchVehicles" /> -->
|
|
|
|
|
<el-table-column label="是否全天营业" align="center" prop="oahFlag" >
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :type="DICT_TYPE.OAHFLAG_STATUS" :value="scope.row.oahFlag" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<!-- 0是;1否 -->
|
|
|
|
|
<!-- <el-table-column label="站点分类" align="center" prop="siteClassification" /> -->
|
|
|
|
|
<!-- 站点分类 1:充电站;2:换电站;3:充换电一体站 -->
|
|
|
|
|
<!-- <el-table-column label="建设场所" align="center" prop="constructionSite" /> -->
|
|
|
|
|
<!-- construction建设场所 1:居民区;2:公共机构;3:企事业单位;4:写字楼;5:工业园区;6:交通枢纽;7:大型文体设施;8:城市绿地;9:大型建筑配建停车场;10:路边停车位;11:城际高速服务区;2:风景区;13:公交场站;14:加油加气站;15:出租车;255:其他 -->
|
|
|
|
|
<el-table-column label="是否启用" align="center" prop="enable" >
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :type="DICT_TYPE.MODEL_TIME_STATUS" :value="scope.row.enable" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<!-- 0:未启用 1:启用 -->
|
|
|
|
|
|
|
|
|
|
<el-table-column label="计费电量" align="center" prop="electricitySource" >
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :type="DICT_TYPE.ELECTRICITYSOURCE" :value="scope.row.electricitySource" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
|
|
<!-- 计费电量:1默认(最大值),2:soc差值;3:soe差值,4:交流,5:直流,6:0 -->
|
|
|
|
|
<el-table-column label="电价电量" align="center" prop="electricityPriceSource" >
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :type="DICT_TYPE.ELECTRICITYSOURCE" :value="scope.row.electricityPriceSource" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<!-- 电价电量:1默认(最大值),2:soc差值;3:soe差值,4:交流,5:直流,6:0 -->
|
|
|
|
|
<!-- <el-table-column label="soc差值来源" align="center" prop="socSource" /> -->
|
|
|
|
|
<!-- soc差值来源:1:换电时的SOC;2:充电时的SOC -->
|
|
|
|
|
|
|
|
|
|
</el-table>
|
|
|
|
|
</ContentWrap>
|
|
|
|
|
<br/>
|
|
|
|
|
<div class="title_info" style="margin-top: 20px">电价模型月份信息 </div>
|
|
|
|
|
<br/>
|
|
|
|
|
<!-- table -->
|
|
|
|
|
<ContentWrap>
|
|
|
|
|
<el-table :data="electricityDate" :stripe="true" :show-overflow-tooltip="true" :header-cell-style="{
|
|
|
|
|
backgroundColor: '#eff4fa'
|
|
|
|
|
}">
|
|
|
|
|
|
|
|
|
|
<el-table-column label="电价模型名称 " align="center" prop="name" />
|
|
|
|
|
<el-table-column label="时段数量 " align="center" prop="periodsAmount" />
|
|
|
|
|
<el-table-column label="开始日期 " align="center" prop="startDate" width="180"
|
|
|
|
|
/>
|
|
|
|
|
<el-table-column label="结束日期 " align="center" prop="endDate" width="180"
|
|
|
|
|
/>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="营运时间"
|
|
|
|
|
align="center"
|
|
|
|
|
prop="operationTime"
|
|
|
|
|
width="180"
|
|
|
|
|
:formatter="dateFormatter"
|
|
|
|
|
/>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="投放时间 "
|
|
|
|
|
align="center"
|
|
|
|
|
prop="launchTime"
|
|
|
|
|
width="180"
|
|
|
|
|
:formatter="dateFormatter"
|
|
|
|
|
/>
|
|
|
|
|
<el-table-column label="联系方式-手机号 " align="center" prop="contactWay" width="130" />
|
|
|
|
|
<!-- <el-table-column label="服务电话" align="center" prop="serviceTel" /> -->
|
|
|
|
|
<!-- <el-table-column label="联系方式-邮箱地址 " align="center" prop="email" /> -->
|
|
|
|
|
<el-table-column label="负责人" align="center" prop="principal" />
|
|
|
|
|
<!-- <el-table-column label="所属运营企业" align="center" prop="stationCompany" /> -->
|
|
|
|
|
<!-- <el-table-column label="场站服务状态" align="center" prop="status" /> -->
|
|
|
|
|
<!-- <el-table-column label="场站运行模式" align="center" prop="runModel" /> -->
|
|
|
|
|
<!-- <el-table-column label="工位分类" align="center" prop="staType" /> -->
|
|
|
|
|
<!-- <el-table-column label="区域分类" align="center" prop="areaType" /> -->
|
|
|
|
|
<!-- <el-table-column label="站型类型 " align="center" prop="siteType" /> -->
|
|
|
|
|
<!-- 1:公共; 50:个人; 100:公交(专用)101:环卫(专用)102:物流(专用)103: 出租⻋(专用)104:分时租赁(专用)105:小区共享(专用)106:单位(专用)107:私人共享桩(专用)255:其他 -->
|
|
|
|
|
<!-- <el-table-column label="服务车型" align="center" prop="matchVehicles" /> -->
|
|
|
|
|
<el-table-column label="是否全天营业" align="center" prop="oahFlag" width="120">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :type="DICT_TYPE.OAHFLAG_STATUS" :value="scope.row.oahFlag" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<!-- 0是;1否 -->
|
|
|
|
|
<!-- <el-table-column label="站点分类" align="center" prop="siteClassification" /> -->
|
|
|
|
|
<!-- 站点分类 1:充电站;2:换电站;3:充换电一体站 -->
|
|
|
|
|
<!-- <el-table-column label="建设场所" align="center" prop="constructionSite" /> -->
|
|
|
|
|
<!-- construction建设场所 1:居民区;2:公共机构;3:企事业单位;4:写字楼;5:工业园区;6:交通枢纽;7:大型文体设施;8:城市绿地;9:大型建筑配建停车场;10:路边停车位;11:城际高速服务区;2:风景区;13:公交场站;14:加油加气站;15:出租车;255:其他 -->
|
|
|
|
|
<el-table-column label="是否启用" align="center" prop="enable" width="100">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :type="DICT_TYPE.MODEL_TIME_STATUS" :value="scope.row.enable" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<!-- 0:未启用 1:启用 -->
|
|
|
|
|
|
|
|
|
|
<el-table-column label="尖电价(分)" align="center" prop="theTipPrice" />
|
|
|
|
|
<el-table-column label="峰电价(分)" align="center" prop="peakPrice" />
|
|
|
|
|
<el-table-column label="平电价(分)" align="center" prop="flatPrice" />
|
|
|
|
|
<el-table-column label="谷电价(分)" align="center" prop="theValleyPrice" />
|
|
|
|
|
<el-table-column label="计费电量" align="center" prop="electricitySource" width="100">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :type="DICT_TYPE.ELECTRICITYSOURCE" :value="scope.row.electricitySource" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
|
|
<el-table-column label="是否启用" align="center" prop="status" >
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :type="DICT_TYPE.MODEL_TIME_STATUS" :value="scope.row.status" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="备注" align="center" prop="remark" />
|
|
|
|
|
<!-- <el-table-column label="数据来源" align="center" prop="source" /> -->
|
|
|
|
|
<!-- :0:云平台;1;三方运营商 -->
|
|
|
|
|
</el-table>
|
|
|
|
|
</ContentWrap>
|
|
|
|
|
<br/>
|
|
|
|
|
<div class="title_info" style="margin-top: 20px">电价模型小时信息 </div>
|
|
|
|
|
<br/>
|
|
|
|
|
<!-- table -->
|
|
|
|
|
<ContentWrap>
|
|
|
|
|
<el-table :data="electricityTimeList" :stripe="true" :show-overflow-tooltip="true" :header-cell-style="{
|
|
|
|
|
backgroundColor: '#eff4fa'
|
|
|
|
|
}">
|
|
|
|
|
<el-table-column label="电价模型名称" align="center" prop="name" />
|
|
|
|
|
<el-table-column label="类型" align="center" prop="type">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :type="DICT_TYPE.PEAK_PLATEAU_STATE" :value="scope.row.type" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<!-- 1尖2峰3平4谷 -->
|
|
|
|
|
<el-table-column label="尖电价开始时刻" align="center" prop="startTime" width="180"
|
|
|
|
|
/>
|
|
|
|
|
<el-table-column label="尖电价结束时刻" align="center" prop="endTime" width="180"
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<!-- 计费电量:1默认(最大值),2:soc差值;3:soe差值,4:交流,5:直流,6:0 -->
|
|
|
|
|
<el-table-column label="电价电量" align="center" prop="electricityPriceSource" width="100">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag
|
|
|
|
|
:type="DICT_TYPE.ELECTRICITYSOURCE"
|
|
|
|
|
:value="scope.row.electricityPriceSource"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<!-- 电价电量:1默认(最大值),2:soc差值;3:soe差值,4:交流,5:直流,6:0 -->
|
|
|
|
|
<!-- <el-table-column label="soc差值来源" align="center" prop="socSource" /> -->
|
|
|
|
|
<!-- soc差值来源:1:换电时的SOC;2:充电时的SOC -->
|
|
|
|
|
</el-table>
|
|
|
|
|
</ContentWrap>
|
|
|
|
|
<br />
|
|
|
|
|
<div class="title_info" style="margin-top: 20px">电价模型月份信息 </div>
|
|
|
|
|
<br />
|
|
|
|
|
<!-- table -->
|
|
|
|
|
<ContentWrap>
|
|
|
|
|
<el-table
|
|
|
|
|
:data="electricityDate"
|
|
|
|
|
:stripe="true"
|
|
|
|
|
:show-overflow-tooltip="true"
|
|
|
|
|
:header-cell-style="{
|
|
|
|
|
backgroundColor: '#eff4fa'
|
|
|
|
|
}"
|
|
|
|
|
>
|
|
|
|
|
<el-table-column label="电价模型名称" align="center" prop="name" width="120" />
|
|
|
|
|
<el-table-column label="时段数量" align="center" prop="periodsAmount" />
|
|
|
|
|
<el-table-column label="开始日期" align="center" prop="startDate" width="180" />
|
|
|
|
|
<el-table-column label="结束日期" align="center" prop="endDate" width="180" />
|
|
|
|
|
<el-table-column label="尖电价(分)" align="center" prop="theTipPrice" />
|
|
|
|
|
<el-table-column label="峰电价(分)" align="center" prop="peakPrice" />
|
|
|
|
|
<el-table-column label="平电价(分)" align="center" prop="flatPrice" />
|
|
|
|
|
<el-table-column label="谷电价(分)" align="center" prop="theValleyPrice" />
|
|
|
|
|
<el-table-column label="是否启用" align="center" prop="status">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :type="DICT_TYPE.MODEL_TIME_STATUS" :value="scope.row.status" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="备注" align="center" prop="remark" />
|
|
|
|
|
<!-- <el-table-column label="数据来源" align="center" prop="source" /> -->
|
|
|
|
|
<!-- :0:云平台;1;三方运营商 -->
|
|
|
|
|
</el-table>
|
|
|
|
|
</ContentWrap>
|
|
|
|
|
<br />
|
|
|
|
|
<div class="title_info" style="margin-top: 20px">电价模型小时信息 </div>
|
|
|
|
|
<br />
|
|
|
|
|
<!-- table -->
|
|
|
|
|
<ContentWrap>
|
|
|
|
|
<el-table
|
|
|
|
|
:data="electricityTimeList"
|
|
|
|
|
:stripe="true"
|
|
|
|
|
:show-overflow-tooltip="true"
|
|
|
|
|
:header-cell-style="{
|
|
|
|
|
backgroundColor: '#eff4fa'
|
|
|
|
|
}"
|
|
|
|
|
>
|
|
|
|
|
<el-table-column label="电价模型名称" align="center" prop="name" />
|
|
|
|
|
<el-table-column label="类型" align="center" prop="type">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :type="DICT_TYPE.PEAK_PLATEAU_STATE" :value="scope.row.type" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<!-- 1尖2峰3平4谷 -->
|
|
|
|
|
<el-table-column label="尖电价开始时刻" align="center" prop="startTime" width="180" />
|
|
|
|
|
<el-table-column label="尖电价结束时刻" align="center" prop="endTime" width="180" />
|
|
|
|
|
</el-table>
|
|
|
|
|
</ContentWrap>
|
|
|
|
|
<br />
|
|
|
|
|
</el-drawer>
|
|
|
|
|
</template>
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { dateFormatter } from '@/utils/formatTime'
|
|
|
|
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
|
|
|
|
import {
|
|
|
|
|
ElectricityPriceApi,
|
|
|
|
|
ElectricityPriceVO
|
|
|
|
|
} from '@/api/operationsManagement/electricityPriceModel'
|
|
|
|
|
/** 电价模型 表单 */
|
|
|
|
|
defineOptions({ name: 'ElectricityPriceForm' })
|
|
|
|
|
|
|
|
|
|
</el-table>
|
|
|
|
|
</ContentWrap>
|
|
|
|
|
<br/>
|
|
|
|
|
const { t } = useI18n() // 国际化
|
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
|
|
|
|
|
|
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
|
|
|
|
const dialogTitle = ref('') // 弹窗的标题
|
|
|
|
|
const electricityDate = ref([])
|
|
|
|
|
const oldlist = ref([])
|
|
|
|
|
const stationList = ref([])
|
|
|
|
|
const electricityTimeList = ref([])
|
|
|
|
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
|
|
|
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
|
|
|
|
const formData = ref({
|
|
|
|
|
id: undefined,
|
|
|
|
|
name: undefined,
|
|
|
|
|
theTipPrice: undefined,
|
|
|
|
|
peakPrice: undefined,
|
|
|
|
|
flatPrice: undefined,
|
|
|
|
|
theValleyPrice: undefined,
|
|
|
|
|
periodsAmount: undefined,
|
|
|
|
|
remark: undefined,
|
|
|
|
|
operatorId: undefined
|
|
|
|
|
})
|
|
|
|
|
const formRules = reactive({
|
|
|
|
|
name: [{ required: true, message: '电价模型名称不能为空', trigger: 'blur' }]
|
|
|
|
|
})
|
|
|
|
|
const formRef = ref() // 表单 Ref
|
|
|
|
|
|
|
|
|
|
</el-drawer>
|
|
|
|
|
</template>
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { dateFormatter } from '@/utils/formatTime'
|
|
|
|
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
|
|
|
|
import { ElectricityPriceApi, ElectricityPriceVO } from '@/api/operationsManagement/electricityPriceModel'
|
|
|
|
|
/** 电价模型 表单 */
|
|
|
|
|
defineOptions({ name: 'ElectricityPriceForm' })
|
|
|
|
|
|
|
|
|
|
const { t } = useI18n() // 国际化
|
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
|
|
|
|
|
|
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
|
|
|
|
const dialogTitle = ref('') // 弹窗的标题
|
|
|
|
|
const electricityDate = ref([])
|
|
|
|
|
const oldlist = ref([])
|
|
|
|
|
const stationList = ref([])
|
|
|
|
|
const electricityTimeList = ref([])
|
|
|
|
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
|
|
|
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
|
|
|
|
const formData = ref({
|
|
|
|
|
id: undefined,
|
|
|
|
|
name: undefined,
|
|
|
|
|
theTipPrice: undefined,
|
|
|
|
|
peakPrice: undefined,
|
|
|
|
|
flatPrice: undefined,
|
|
|
|
|
theValleyPrice: undefined,
|
|
|
|
|
periodsAmount: undefined,
|
|
|
|
|
remark: undefined,
|
|
|
|
|
operatorId: undefined,
|
|
|
|
|
})
|
|
|
|
|
const formRules = reactive({
|
|
|
|
|
name: [{ required: true, message: '电价模型名称不能为空', trigger: 'blur' }],
|
|
|
|
|
})
|
|
|
|
|
const formRef = ref() // 表单 Ref
|
|
|
|
|
|
|
|
|
|
/** 打开弹窗 */
|
|
|
|
|
const open = async (id?: number) => {
|
|
|
|
|
dialogVisible.value = true
|
|
|
|
|
|
|
|
|
|
resetForm()
|
|
|
|
|
// 修改时,设置数据
|
|
|
|
|
if (id) {
|
|
|
|
|
formLoading.value = true
|
|
|
|
|
try {
|
|
|
|
|
const formData2 = await ElectricityPriceApi.getElectricityPrice(id)
|
|
|
|
|
oldlist.value = formData2
|
|
|
|
|
// console.log(formData2,"-++++++---")
|
|
|
|
|
/** 打开弹窗 */
|
|
|
|
|
const open = async (id?: number) => {
|
|
|
|
|
dialogVisible.value = true
|
|
|
|
|
|
|
|
|
|
electricityDate.value[0] = formData2.electricityDateResp
|
|
|
|
|
stationList.value = formData2.stationList
|
|
|
|
|
electricityTimeList.value = formData2.electricityTimeList
|
|
|
|
|
// console.log(electricityTimeList.value,"==========")
|
|
|
|
|
} finally {
|
|
|
|
|
formLoading.value = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
|
|
|
|
|
|
|
|
|
/** 提交表单 */
|
|
|
|
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
|
|
|
|
const submitForm = async () => {
|
|
|
|
|
// 校验表单
|
|
|
|
|
await formRef.value.validate()
|
|
|
|
|
// 提交请求
|
|
|
|
|
resetForm()
|
|
|
|
|
// 修改时,设置数据
|
|
|
|
|
if (id) {
|
|
|
|
|
formLoading.value = true
|
|
|
|
|
try {
|
|
|
|
|
const data = formData.value as unknown as ElectricityPriceApi.ElectricityPriceVO
|
|
|
|
|
|
|
|
|
|
await ElectricityPriceApi.createElectricityPrice(data)
|
|
|
|
|
message.success(t('common.createSuccess'))
|
|
|
|
|
const formData2 = await ElectricityPriceApi.getElectricityPrice(id)
|
|
|
|
|
oldlist.value = formData2
|
|
|
|
|
// console.log(formData2,"-++++++---")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dialogVisible.value = false
|
|
|
|
|
// 发送操作成功的事件
|
|
|
|
|
emit('success')
|
|
|
|
|
electricityDate.value[0] = formData2.electricityDateResp
|
|
|
|
|
stationList.value = formData2.stationList
|
|
|
|
|
electricityTimeList.value = formData2.electricityTimeList
|
|
|
|
|
// console.log(electricityTimeList.value,"==========")
|
|
|
|
|
} finally {
|
|
|
|
|
formLoading.value = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 重置表单 */
|
|
|
|
|
const resetForm = () => {
|
|
|
|
|
formData.value = {
|
|
|
|
|
id: undefined,
|
|
|
|
|
name: undefined,
|
|
|
|
|
theTipPrice: undefined,
|
|
|
|
|
peakPrice: undefined,
|
|
|
|
|
flatPrice: undefined,
|
|
|
|
|
theValleyPrice: undefined,
|
|
|
|
|
periodsAmount: undefined,
|
|
|
|
|
remark: undefined,
|
|
|
|
|
operatorId: undefined,
|
|
|
|
|
}
|
|
|
|
|
formRef.value?.resetFields()
|
|
|
|
|
}
|
|
|
|
|
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 ElectricityPriceApi.ElectricityPriceVO
|
|
|
|
|
|
|
|
|
|
await ElectricityPriceApi.createElectricityPrice(data)
|
|
|
|
|
message.success(t('common.createSuccess'))
|
|
|
|
|
|
|
|
|
|
dialogVisible.value = false
|
|
|
|
|
// 发送操作成功的事件
|
|
|
|
|
emit('success')
|
|
|
|
|
} finally {
|
|
|
|
|
formLoading.value = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 重置表单 */
|
|
|
|
|
const resetForm = () => {
|
|
|
|
|
formData.value = {
|
|
|
|
|
id: undefined,
|
|
|
|
|
name: undefined,
|
|
|
|
|
theTipPrice: undefined,
|
|
|
|
|
peakPrice: undefined,
|
|
|
|
|
flatPrice: undefined,
|
|
|
|
|
theValleyPrice: undefined,
|
|
|
|
|
periodsAmount: undefined,
|
|
|
|
|
remark: undefined,
|
|
|
|
|
operatorId: undefined
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
formRef.value?.resetFields()
|
|
|
|
|
}
|
|
|
|
|
</script>
|