8.18 模型代码提交22

master
zz 3 months ago
parent e8fd22ea20
commit f8d40329be

@ -4,7 +4,7 @@
<el-col :span="12"> <el-col :span="12">
<div>添加计费模型月份</div> <div>添加计费模型月份</div>
<br/> <br/>
<ElectricityDateForm ref="DateformRef" @success="dateSuccess" :modelId="selectId"/> <modelDateForm ref="DateformRef" @success="dateSuccess" :modelId="selectId"/>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<div>计费模月型列表</div> <div>计费模月型列表</div>
@ -34,7 +34,7 @@
import { BillingModelApi, BillingModelVO } from '@/api/operationsManagement/billingModel' import { BillingModelApi, BillingModelVO } from '@/api/operationsManagement/billingModel'
import modelTimeList from './components/hoursAndMinutes/modelTimeList.vue' import modelTimeList from './components/hoursAndMinutes/modelTimeList.vue'
import modelTimeForm from './components/hoursAndMinutes/modelTimeForm.vue' import modelTimeForm from './components/hoursAndMinutes/modelTimeForm.vue'
import ElectricityDateForm from './components/month/ElectricityDateForm.vue' import modelDateForm from './components/month/modelDateForm.vue'
import monthList from './components/month/index.vue' import monthList from './components/month/index.vue'
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'

@ -15,7 +15,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="换电计费模型月" prop="source"> <el-form-item label="换电计费模型月" prop="billingDateId">
<el-select v-model="formData.billingDateId" style="width: 100%;"> <el-select v-model="formData.billingDateId" style="width: 100%;">
<el-option <el-option
v-for="item in billingDateData" v-for="item in billingDateData"
@ -267,11 +267,13 @@ const resetForm = () => {
formRef.value?.resetFields() formRef.value?.resetFields()
} }
async function getbillingDateData(){ async function getbillingDateData(){
const data = await ElectricityDateApi.getElectricityDatenew({modelId:props.selectId}) // const data = await ElectricityDateApi.getElectricityDatenew({modelId:props.selectId})
// const data = await ElectricityDateApi.getElectricityDatePage({modelId:props.selectId}) const data = await ElectricityDateApi.getElectricityDatePage({modelId:props.selectId})
console.log(data,"----------")
billingDateData.value=data.list||[] billingDateData.value=data.list||[]
} }
// onMounted(()=>{ // onMounted(()=>{
// getbillingDateData() // getbillingDateData()
// }) // })

@ -128,7 +128,7 @@
backgroundColor: '#eff4fa' backgroundColor: '#eff4fa'
}"> }">
<el-table-column label="序号" type="index" align="center" width="80" /> <el-table-column label="序号" type="index" align="center" width="80" />
<el-table-column label="电网电价月份模型 ID" align="center" prop="id" /> <!-- <el-table-column label="电网电价月份模型 ID" align="center" prop="id" /> -->
<!-- <el-table-column label="电网电价模型id" align="center" prop="priceId" /> --> <!-- <el-table-column label="电网电价模型id" align="center" prop="priceId" /> -->
<el-table-column label="计费模型名称" align="center" prop="name" /> <el-table-column label="计费模型名称" align="center" prop="name" />
<el-table-column label="时段数量" align="center" prop="periodsAmount" /> <el-table-column label="时段数量" align="center" prop="periodsAmount" />
@ -186,7 +186,7 @@
</ContentWrap> </ContentWrap>
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<!-- <ElectricityDateForm ref="formRef" @success="getList" /> --> <!-- <modelDateForm ref="formRef" @success="getList" /> -->
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -194,7 +194,7 @@ import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download' import download from '@/utils/download'
import { ElectricityDateApi, ElectricityDateVO } from '@/api/operationsManagement/billingModel/monthModel' import { ElectricityDateApi, ElectricityDateVO } from '@/api/operationsManagement/billingModel/monthModel'
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import ElectricityDateForm from './ElectricityDateForm.vue' import modelDateForm from './modelDateForm.vue'
/** 电价模型月份 列表 */ /** 电价模型月份 列表 */
defineOptions({ name: 'ElectricityDate' }) defineOptions({ name: 'ElectricityDate' })

@ -24,29 +24,7 @@
<el-input v-model="formData.periodsAmount" placeholder="请输入时段数量" /> <el-input v-model="formData.periodsAmount" placeholder="请输入时段数量" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :span="12">
<el-form-item label="尖电价" prop="theTipPrice">
<el-input v-model="formData.theTipPrice" placeholder="请输入尖电价" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="峰电价" prop="peakPrice">
<el-input v-model="formData.peakPrice" placeholder="请输入峰电价" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="平电价" prop="flatPrice">
<el-input v-model="formData.flatPrice" placeholder="请输入平电价" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="谷电价" prop="theValleyPrice">
<el-input v-model="formData.theValleyPrice" placeholder="请输入谷电价" />
</el-form-item>
</el-col> -->
<el-col :span="12"> <el-col :span="12">
<el-form-item label="是否启用" prop="status"> <el-form-item label="是否启用" prop="status">
<el-radio-group v-model="formData.status"> <el-radio-group v-model="formData.status">
@ -90,22 +68,7 @@
</el-col> </el-col>
<!-- <el-col :span="12">
<el-form-item label="数据来源" prop="source">
<el-select v-model="formData.source" style="width: 100%;">
<el-option
:key="0"
label="云平台"
:value="0"
/>
<el-option
:key="1"
label="三方运营商"
:value="1"
/>
</el-select>
</el-form-item></el-col> -->
</el-row> </el-row>
<!-- <el-form-item label="电网电价模型id" prop="priceId"> <!-- <el-form-item label="电网电价模型id" prop="priceId">
<el-input v-model="formData.priceId" placeholder="请输入电网电价模型id" /> <el-input v-model="formData.priceId" placeholder="请输入电网电价模型id" />
@ -113,16 +76,10 @@
<!-- <el-form-item label="唯一编码" prop="code">
<el-input v-model="formData.code" placeholder="请输入唯一编码" />
</el-form-item> -->
<el-button @click="submitForm" type="primary" :disabled="formLoading">{{ formType=='update'?'确认编辑':'确认新增' }}</el-button> <el-button @click="submitForm" type="primary" :disabled="formLoading">{{ formType=='update'?'确认编辑':'确认新增' }}</el-button>
<el-button @click="onCencel" v-if="formType=='update'"></el-button> <el-button @click="onCencel" v-if="formType=='update'"></el-button>
</el-form> </el-form>
<!-- <template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template> -->
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ElectricityDateApi, ElectricityDateVO } from '@/api/operationsManagement/billingModel/monthModel' import { ElectricityDateApi, ElectricityDateVO } from '@/api/operationsManagement/billingModel/monthModel'

@ -4,7 +4,7 @@
<el-col :span="12"> <el-col :span="12">
<div>添加电价模型月份</div> <div>添加电价模型月份</div>
<br/> <br/>
<ElectricityDateForm ref="DateformRef" @success="dateSuccess" :modelId="selectId"/> <ElectricityDateForm ref="DateformRef" @success="dateSuccess" :priceId="selectId"/>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<div>电价模型月份列表</div> <div>电价模型月份列表</div>

@ -8,11 +8,11 @@
label-position="top" label-position="top"
> >
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="12"> <!-- <el-col :span="12">
<el-form-item label="分时模型(月日)id" prop="dateId"> <el-form-item label="分时模型(月日)id" prop="dateId">
<el-input v-model="formData.dateId" placeholder="请输入分时模型(月日)id" /> <el-input v-model="formData.dateId" placeholder="请输入分时模型(月日)id" />
</el-form-item> </el-form-item>
</el-col> </el-col> -->
<el-col :span="12"> <el-col :span="12">
<el-form-item label="计费模型名称" prop="name"> <el-form-item label="计费模型名称" prop="name">
<el-input v-model="formData.name" placeholder="请输入计费模型名称" /> <el-input v-model="formData.name" placeholder="请输入计费模型名称" />
@ -26,7 +26,7 @@
</el-form-item> </el-form-item>
</el-col> --> </el-col> -->
<el-col :span="12"> <el-col :span="12">
<el-form-item label="尖电价时间范围" prop="Time"> <!-- <el-form-item label="尖电价时间范围" prop="Time">
<el-time-picker <el-time-picker
v-model="formData.Time" v-model="formData.Time"
is-range is-range
@ -35,11 +35,17 @@
end-placeholder="结束时间" end-placeholder="结束时间"
value-format="HH:mm:ss" value-format="HH:mm:ss"
/> />
<!-- <el-form-item label="尖电价开始时刻" prop="startTime">
</el-form-item> -->
<el-form-item label="尖电价开始时刻" prop="startTime">
<el-date-picker <el-date-picker
v-model="formData.startTime" v-model="formData.startTime"
type="date" type="date"
value-format="x" format="hh:mm:ss"
value-format="hh:mm:ss"
placeholder="选择尖电价开始时刻" placeholder="选择尖电价开始时刻"
/> />
</el-form-item> </el-form-item>
@ -49,14 +55,25 @@
<el-date-picker <el-date-picker
v-model="formData.endTime" v-model="formData.endTime"
type="date" type="date"
value-format="x" format="hh:mm:ss"
value-format="hh:mm:ss"
placeholder="选择尖电价结束时刻" placeholder="选择尖电价结束时刻"
/> --> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="电价模型id" prop="electricityModelId"> <el-form-item label="电价模型名称" prop="electricityModel">
<el-input v-model="formData.electricityModelId" placeholder="请输入电价模型id" /> <el-select v-model="formData.electricityModelId" style="width: 100%;">
<el-option
v-for="item in electricityModel"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -70,30 +87,37 @@ import {
ElectricityTimeApi, ElectricityTimeApi,
ElectricityTimeVO ElectricityTimeVO
} from '@/api/operationsManagement/electricityPriceModel/timeModel' } from '@/api/operationsManagement/electricityPriceModel/timeModel'
import { ElectricityDateApi, ElectricityDateVO } from '@/api/operationsManagement/electricityPriceModel/monthModel'
/** 电价模型小时 表单 */ /** 电价模型小时 表单 */
defineOptions({ name: 'ElectricityTimeForm' }) defineOptions({ name: 'ElectricityTimeForm' })
const props=defineProps({
selectId:{
type:String,
default:''
}
})
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
const dialogVisible = ref(false) // const dialogVisible = ref(false) //
const dialogTitle = ref('') // const dialogTitle = ref('') //
const electricityModel = ref('')
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const formType = ref('') // create - update - const formType = ref('create') // create - update -
const formData = ref({ const formData = ref({
id: undefined, id: undefined,
dateId: undefined, dateId: props.selectId,
name: undefined, name: undefined,
type: undefined, type: undefined,
startTime: undefined, startTime: undefined,
endTime: undefined, endTime: undefined,
electricityModelId: undefined, electricityModelId: undefined,
Time:[]
// Time:[]
}) })
const formRules = reactive({ const formRules = reactive({
name: [{ required: true, message: '计费模型名称不能为空', trigger: 'blur' }], name: [{ required: true, message: '计费模型名称不能为空', trigger: 'blur' }],
electricityModelId: [{ required: true, message: '电价模型id不能为空', trigger: 'blur' }] electricityModelId: [{ required: true, message: '电价模型名称不能为空', trigger: 'blur' }]
}) })
const formRef = ref() // Ref const formRef = ref() // Ref
const onCencel=()=>{ const onCencel=()=>{
@ -111,7 +135,9 @@ const open = async (type: string, id?: number) => {
if (id) { if (id) {
formLoading.value = true formLoading.value = true
try { try {
// const res = await ElectricityTimeApi.getElectricityTime(id)
formData.value = await ElectricityTimeApi.getElectricityTime(id) formData.value = await ElectricityTimeApi.getElectricityTime(id)
// formData.value={...res,Time:[res?.startTime,res?.endTime]}
} finally { } finally {
formLoading.value = false formLoading.value = false
} }
@ -126,8 +152,11 @@ const submitForm = async () => {
await formRef.value.validate() await formRef.value.validate()
// //
formLoading.value = true formLoading.value = true
formData.value.dateId=props.selectId
try { try {
const data = formData.value as unknown as ElectricityTimeApi.ElectricityTimeVO const data = formData.value as unknown as ElectricityTimeApi.ElectricityTimeVO
// data.startTime=formData.value.Time[0]
// data.endTime=formData.value.Time[1]
if (formType.value === 'create') { if (formType.value === 'create') {
await ElectricityTimeApi.createElectricityTime(data) await ElectricityTimeApi.createElectricityTime(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
@ -157,12 +186,20 @@ const resetForm = () => {
formRef.value?.resetFields() formRef.value?.resetFields()
} }
// watch(()=>props.selectId,async(newValue)=>{ async function getbillingDateData(){
// console.log('newValue',newValue) // const data = await ElectricityDateApi.getElectricityDatenew({modelId:props.selectId})
// getbillingDateData() const data = await ElectricityDateApi.getElectricityDatePage({priceId:props.selectId})
// console.log(data,"-++++++++++-")
electricityModel.value=data.list||[]
}
watch(()=>props.selectId,async(newValue)=>{
console.log('newValue',newValue)
getbillingDateData()
// },{ },{
// deep:true, deep:true,
// immediate:true immediate:true
// }) })
</script> </script>

@ -29,7 +29,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
--> -->
<el-form-item label="电价模型id" prop="electricityModelId"> <!-- <el-form-item label="电价模型id" prop="electricityModelId">
<el-input <el-input
v-model="queryParams.electricityModelId" v-model="queryParams.electricityModelId"
placeholder="请输入电价模型id" placeholder="请输入电价模型id"
@ -37,7 +37,7 @@
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
class="!w-200px" class="!w-200px"
/> />
</el-form-item> </el-form-item> -->
<el-form-item> <el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button> <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 @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
@ -70,11 +70,11 @@
<el-table-column label="电网电价分时模型 ID" align="center" prop="id" /> <el-table-column label="电网电价分时模型 ID" align="center" prop="id" />
<el-table-column label="分时模型(月日)id" align="center" prop="dateId" /> <el-table-column label="分时模型(月日)id" align="center" prop="dateId" />
<el-table-column label="计费模型名称" align="center" prop="name" /> <el-table-column label="计费模型名称" align="center" prop="name" />
<el-table-column label="1尖2峰3平4谷" align="center" prop="type" /> <!-- <el-table-column label="1尖2峰3平4谷" align="center" prop="type" /> -->
<el-table-column label="尖电价开始时刻" align="center" prop="startTime" /> <el-table-column label="尖电价开始时刻" align="center" prop="startTime" />
<el-table-column label="尖电价结束时刻" align="center" prop="endTime" /> <el-table-column label="尖电价结束时刻" align="center" prop="endTime" />
<el-table-column label="电价模型id" align="center" prop="electricityModelId" /> <el-table-column label="电价模型id" align="center" prop="electric5ityModelId" />
<el-table-column label="操作" align="center" width="120" fixed="right"> <el-table-column label="操作" align="center" width="120" fixed="right">
<template #default="scope"> <template #default="scope">
<el-button <el-button
@ -134,13 +134,13 @@ const total = ref(0)
const queryParams = reactive({ const queryParams = reactive({
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
dateId: undefined, dateId: props.selectId,
name: undefined, name: undefined,
type: undefined, type: undefined,
startTime: [], startTime: [],
endTime: [], endTime: [],
createTime: [], createTime: [],
electricityModelId:props.selectId, electricityModelId:undefined,
}) })
const queryFormRef = ref() // const queryFormRef = ref() //
const exportLoading = ref(false) // const exportLoading = ref(false) //
@ -149,7 +149,7 @@ const exportLoading = ref(false) // 导出的加载中
const getList = async () => { const getList = async () => {
loading.value = true loading.value = true
try { try {
queryParams.electricityModelId=props.selectId queryParams.dateId=props.selectId
const data = await ElectricityTimeApi.getElectricityTimePage(queryParams) const data = await ElectricityTimeApi.getElectricityTimePage(queryParams)
list.value = data.list list.value = data.list
total.value = data.total total.value = data.total

@ -123,7 +123,7 @@ defineOptions({ name: 'ElectricityDateForm' })
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
const props=defineProps({ const props=defineProps({
modeId:{ priceId:{
type:String, type:String,
default:'' default:''
} }
@ -131,10 +131,10 @@ const props=defineProps({
const dialogVisible = ref(false) // const dialogVisible = ref(false) //
const dialogTitle = ref('') // const dialogTitle = ref('') //
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const formType = ref('') // create - update - const formType = ref('create') // create - update -
const formData = ref({ const formData = ref({
id: undefined, id: undefined,
priceId: undefined, // priceId: undefined,
name: undefined, name: undefined,
periodsAmount: undefined, periodsAmount: undefined,
no: undefined, no: undefined,
@ -148,7 +148,8 @@ const formData = ref({
remark: undefined, remark: undefined,
source: undefined, source: undefined,
code: undefined, code: undefined,
modeId:'', // priceId:'',
priceId:props.priceId,
}) })
const formRules = reactive({ const formRules = reactive({
name: [{ required: true, message: '计费模型名称不能为空', trigger: 'blur' }], name: [{ required: true, message: '计费模型名称不能为空', trigger: 'blur' }],
@ -189,9 +190,9 @@ const submitForm = async () => {
// //
formLoading.value = true formLoading.value = true
try { try {
console.log('props.modeI电价',props.modeId) console.log('props.modelId电价',props.priceId)
const data = formData.value as unknown as ElectricityDateApi.ElectricityDateVO const data = formData.value as unknown as ElectricityDateApi.ElectricityDateVO
data.modeId =props.modeId data.priceId =props.priceId
if (formType.value === 'create') { if (formType.value === 'create') {
await ElectricityDateApi.createElectricityDate(data) await ElectricityDateApi.createElectricityDate(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
@ -211,7 +212,7 @@ const submitForm = async () => {
const resetForm = () => { const resetForm = () => {
formData.value = { formData.value = {
id: undefined, id: undefined,
priceId: undefined, // priceId: undefined,
name: undefined, name: undefined,
periodsAmount: undefined, periodsAmount: undefined,
no: undefined, no: undefined,

@ -97,8 +97,8 @@
backgroundColor: '#eff4fa' backgroundColor: '#eff4fa'
}"> }">
<el-table-column label="序号" type="index" align="center" width="80" /> <el-table-column label="序号" type="index" align="center" width="80" />
<!-- <el-table-column label="电网电价月份模型 ID" align="center" prop="id" /> --> <el-table-column label="电网电价月份模型 ID" align="center" prop="id" />
<!-- <el-table-column label="电网电价模型id" align="center" prop="priceId" /> --> <el-table-column label="电网电价模型id" align="center" prop="priceId" />
<el-table-column label="计费模型名称" align="center" prop="name" /> <el-table-column label="计费模型名称" align="center" prop="name" />
<!-- <el-table-column label="时段数量" align="center" prop="periodsAmount" /> <!-- <el-table-column label="时段数量" align="center" prop="periodsAmount" />
<el-table-column label="序列" align="center" prop="no" /> --> <el-table-column label="序列" align="center" prop="no" /> -->
@ -172,7 +172,8 @@ const total = ref(0)
const queryParams = reactive({ const queryParams = reactive({
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
priceId:undefined, priceId:props.selectId,
// priceId:undefined,
name: undefined, name: undefined,
periodsAmount: undefined, periodsAmount: undefined,
no: undefined, no: undefined,
@ -195,7 +196,7 @@ const exportLoading = ref(false) // 导出的加载中
const getList = async () => { const getList = async () => {
loading.value = true loading.value = true
try { try {
queryParams.modeId=props.selectId queryParams.priceId=props.selectId
const data = await ElectricityDateApi.getElectricityDatePage(queryParams) const data = await ElectricityDateApi.getElectricityDatePage(queryParams)
list.value = data.list list.value = data.list
total.value = data.total total.value = data.total

@ -23,8 +23,8 @@
<el-button @click="resetQuery"><Icon icon="ep:refresh" 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')"> <!-- <el-button type="primary" plain @click="openForm('create')">
<Icon icon="ep:plus" class="mr-5px" /> 新增 <Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button> </el-button> -->
<el-button type="success" plain @click="handleExport" :loading="exportLoading"> <!-- <el-button type="success" plain @click="handleExport" :loading="exportLoading">
<Icon icon="ep:download" class="mr-5px" /> 导出 <Icon icon="ep:download" class="mr-5px" /> 导出
</el-button> --> </el-button> -->
</el-form-item> </el-form-item>

@ -68,7 +68,7 @@
/** 提交表单 */ /** 提交表单 */
const emit = defineEmits(['success']) // success const emit = defineEmits(['success']) // success
const modelOpen=(type,id)=>{ const modelOpen=(type,id)=>{
formRef.value.open(type,id,selectId.value) formRef.value.open(type,id)
// console.log(type,id) // console.log(type,id)
} }
const submitForm = async () => { const submitForm = async () => {

@ -8,11 +8,11 @@
v-loading="formLoading" v-loading="formLoading"
> >
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="12"> <!-- <el-col :span="12">
<el-form-item label="运营模型id" prop="modelId"> <el-form-item label="运营模型id" prop="modelId">
<el-input v-model="formData.modelId" placeholder="请输入运营模型id" /> <el-input v-model="formData.modelId" placeholder="请输入运营模型id" />
</el-form-item> </el-form-item>
</el-col> </el-col> -->
<el-col :span="12"> <el-col :span="12">
<el-form-item label="运营区间模型名称" prop="name"> <el-form-item label="运营区间模型名称" prop="name">
<el-input v-model="formData.name" placeholder="请输入运营区间模型名称" /> <el-input v-model="formData.name" placeholder="请输入运营区间模型名称" />
@ -77,17 +77,17 @@ const message = useMessage() // 消息弹窗
const dialogVisible = ref(false) // const dialogVisible = ref(false) //
const dialogTitle = ref('') // const dialogTitle = ref('') //
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const formType = ref('') // create - update - const formType = ref('create') // create - update -
const formData = ref({ const formData = ref({
id: undefined, id: undefined,
modelId: undefined, modelId: props.selectId,
name: undefined, name: undefined,
// startTime: undefined, // startTime: undefined,
// endTime: undefined, // endTime: undefined,
Time:[] Time:[]
}) })
const formRules = reactive({ const formRules = reactive({
modelId: [{ required: true, message: '运营模型id不能为空', trigger: 'blur' }], // modelId: [{ required: true, message: 'id', trigger: 'blur' }],
name: [{ required: true, message: '运营区间模型名称不能为空', trigger: 'blur' }], name: [{ required: true, message: '运营区间模型名称不能为空', trigger: 'blur' }],
time: [{ required: true, message: '时间不能为空', trigger: 'blur' }], time: [{ required: true, message: '时间不能为空', trigger: 'blur' }],
// startTime: [{ required: true, message: '', trigger: 'blur' }], // startTime: [{ required: true, message: '', trigger: 'blur' }],
@ -126,9 +126,10 @@ const submitForm = async () => {
await formRef.value.validate() await formRef.value.validate()
// //
formLoading.value = true formLoading.value = true
formData.value.modelId=props.selectId
try { try {
const data = formData.value as unknown as RunModelDetailApi.RunModelDetailVO const data = formData.value as unknown as RunModelDetailApi.RunModelDetailVO
data.modelId=props.selectId
data.startTime=formData.value.Time[0] data.startTime=formData.value.Time[0]
data.endTime=formData.value.Time[1] data.endTime=formData.value.Time[1]
if (formType.value === 'create') { if (formType.value === 'create') {

@ -46,16 +46,16 @@
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true"> <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="id" align="center" prop="id" />
<el-table-column label="运营模型id" align="center" prop="modelId" /> <el-table-column label="运营模型id" align="center" prop="modelId" />
<el-table-column label="运营区间模型名称" align="center" prop="name" /> <el-table-column label="运营区间模型名称" align="center" prop="name" width="180"/>
<el-table-column <!-- <el-table-column
label="创建时间" label="创建时间"
align="center" align="center"
prop="createTime" prop="createTime"
:formatter="dateFormatter" :formatter="dateFormatter"
width="180px" width="180px"
/> /> -->
<el-table-column label="开始时刻" align="center" prop="startTime" /> <el-table-column label="开始时刻" align="center" prop="startTime" />
<el-table-column label="结束时刻" align="center" prop="endTime" /> <el-table-column label="结束时刻" align="center" prop="endTime" />
<el-table-column label="操作" align="center" width="120" fixed="right"> <el-table-column label="操作" align="center" width="120" fixed="right">
@ -101,6 +101,12 @@ import RunModelDetailForm from './RunModelDetailForm.vue'
/** 场站运营模型详情 列表 */ /** 场站运营模型详情 列表 */
defineOptions({ name: 'RunModelDetail' }) defineOptions({ name: 'RunModelDetail' })
const props=defineProps({
selectId:{
type:String,
default:''
}
})
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
const emit=defineEmits(["open"]) const emit=defineEmits(["open"])
@ -111,7 +117,7 @@ const total = ref(0)
const queryParams = reactive({ const queryParams = reactive({
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
modelId: undefined, modelId: props.selectId,
name: undefined, name: undefined,
createTime: [], createTime: [],
startTime: [], startTime: [],
@ -124,6 +130,7 @@ const exportLoading = ref(false) // 导出的加载中
const getList = async () => { const getList = async () => {
loading.value = true loading.value = true
try { try {
queryParams.modelId=props.selectId
const data = await RunModelDetailApi.getRunModelDetailPage(queryParams) const data = await RunModelDetailApi.getRunModelDetailPage(queryParams)
list.value = data.list list.value = data.list
total.value = data.total total.value = data.total
@ -179,8 +186,15 @@ const handleExport = async () => {
} }
} }
/** 初始化 **/ // /** **/
onMounted(() => { // onMounted(() => {
// getList()
// })
watch(()=>props.selectId,(newValue)=>{
getList() getList()
},{
deep:true,
immediate:true
}) })
defineExpose({ getList })
</script> </script>

@ -46,6 +46,7 @@
<ContentWrap> <ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true"> <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="模型id" align="center" prop="id" />
<el-table-column label="运营模型名称" align="center" prop="name" />
<el-table-column label="站点" align="center"> <el-table-column label="站点" align="center">
<template #default="scope"> <template #default="scope">
<el-dropdown placement="bottom-start"> <el-dropdown placement="bottom-start">

Loading…
Cancel
Save