Commit 7699210c authored by xuke's avatar xuke

瞬时热量-输入格式

parent 9dece472
<script setup> <script setup>
import {computed, onBeforeMount, onMounted, reactive, ref} from "vue"; import { computed, onBeforeMount, onMounted, reactive, ref } from "vue";
import { import {
getAnnualParam, getAnnualParam,
alterAnnualParam, alterAnnualParam,
...@@ -100,11 +100,11 @@ function handleSearch() { ...@@ -100,11 +100,11 @@ function handleSearch() {
} }
} // 处理查询 } // 处理查询
function onReviseSubmit() { function onReviseSubmit() {
if(reviseForm.value.hasOwnProperty('supplyName')){ if (reviseForm.value.hasOwnProperty('supplyName')) {
delete reviseForm.value.supplyName delete reviseForm.value.supplyName
} }
if(reviseForm.value.year.length > 4){ if (reviseForm.value.year.length > 4) {
reviseForm.value.year = reviseForm.value.year.slice(6,10) reviseForm.value.year = reviseForm.value.year.slice(6, 10)
} }
alterAnnualParam(reviseForm.value).then(res => { alterAnnualParam(reviseForm.value).then(res => {
if (res.success) { if (res.success) {
...@@ -135,11 +135,8 @@ function onAddSubmit() { // 提交新增 ...@@ -135,11 +135,8 @@ function onAddSubmit() { // 提交新增
return return
} }
}) })
<<<<<<< HEAD
console.log('>>>>>>>>==', addForm.value) console.log('>>>>>>>>==', addForm.value)
console.log('========>>>>', addForm.value.year) console.log('========>>>>', addForm.value.year)
=======
>>>>>>> 9264ee33b707bc7814b1379ef943cba565c98072
addAnnualParam(addForm.value).then(res => { addAnnualParam(addForm.value).then(res => {
if (res.success) { if (res.success) {
getData() getData()
...@@ -166,7 +163,7 @@ function handleClose() { ...@@ -166,7 +163,7 @@ function handleClose() {
addWindowOpen.value = false addWindowOpen.value = false
resetInput() resetInput()
} // 关闭弹窗 } // 关闭弹窗
onBeforeMount(()=>{ onBeforeMount(() => {
getData() getData()
getOrganizationStructure() getOrganizationStructure()
}) })
...@@ -232,7 +229,7 @@ function getSupply() { ...@@ -232,7 +229,7 @@ function getSupply() {
supplyId: sec_item.supplyId, supplyId: sec_item.supplyId,
supplyName: sec_item.supplyName, supplyName: sec_item.supplyName,
} }
supplyData.value.push({...temp}) supplyData.value.push({ ...temp })
}) })
}) })
} // 根据组织结构获取供热站数据 } // 根据组织结构获取供热站数据
...@@ -244,10 +241,10 @@ function getOrganizationStructure() { ...@@ -244,10 +241,10 @@ function getOrganizationStructure() {
ElMessage.error('接口异常,获取数据失败.') ElMessage.error('接口异常,获取数据失败.')
}) })
} // 获取组织结构 } // 获取组织结构
function showSupplyName(id){ function showSupplyName(id) {
let supplyName = "" let supplyName = ""
supplyData.value.forEach(item=>{ supplyData.value.forEach(item => {
if(item.supplyId === id){ if (item.supplyId === id) {
supplyName = item.supplyName supplyName = item.supplyName
} }
}) })
...@@ -275,7 +272,7 @@ function showSupplyName(id){ ...@@ -275,7 +272,7 @@ function showSupplyName(id){
<el-table-column label="节能类型" sortable :sort-method="customSort" prop="energyType" /> <el-table-column label="节能类型" sortable :sort-method="customSort" prop="energyType" />
<el-table-column label="供热站名称"> <el-table-column label="供热站名称">
<template #default="scope"> <template #default="scope">
{{showSupplyName(scope.row.supplyId)}} {{ showSupplyName(scope.row.supplyId) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="年度" sortable prop="year" /> <el-table-column label="年度" sortable prop="year" />
...@@ -317,7 +314,8 @@ function showSupplyName(id){ ...@@ -317,7 +314,8 @@ function showSupplyName(id){
<el-col :span="8" col-label>供热站:</el-col> <el-col :span="8" col-label>供热站:</el-col>
<el-col :span="16" col-value> <el-col :span="16" col-value>
<el-select placeholder="请选择供热站" size="small" v-model="reviseForm.supplyId" style="width: 370px"> <el-select placeholder="请选择供热站" size="small" v-model="reviseForm.supplyId" style="width: 370px">
<el-option v-for="item in supplyData" :key="item.supplyId" :value="item.supplyId" :label="item.supplyName" /> <el-option v-for="item in supplyData" :key="item.supplyId" :value="item.supplyId"
:label="item.supplyName" />
</el-select> </el-select>
</el-col> </el-col>
</el-row> </el-row>
...@@ -382,7 +380,8 @@ function showSupplyName(id){ ...@@ -382,7 +380,8 @@ function showSupplyName(id){
<el-col :span="8" col-label>供热站:</el-col> <el-col :span="8" col-label>供热站:</el-col>
<el-col :span="16" col-value> <el-col :span="16" col-value>
<el-select placeholder="请选择供热站" size="small" v-model="addForm.supplyId" style="width: 370px"> <el-select placeholder="请选择供热站" size="small" v-model="addForm.supplyId" style="width: 370px">
<el-option v-for="item in supplyData" :key="item.supplyId" :value="item.supplyId" :label="item.supplyName" /> <el-option v-for="item in supplyData" :key="item.supplyId" :value="item.supplyId"
:label="item.supplyName" />
</el-select> </el-select>
</el-col> </el-col>
</el-row> </el-row>
......
...@@ -117,10 +117,10 @@ const rules = reactive({ ...@@ -117,10 +117,10 @@ const rules = reactive({
{ pattern: /^([0-9]\d{0,1}|100$)(\.\d{1,4})?$/, "message": "请输入正确的百分比格式", trigger: "blur" } { pattern: /^([0-9]\d{0,1}|100$)(\.\d{1,4})?$/, "message": "请输入正确的百分比格式", trigger: "blur" }
], ],
timeoutMin: [ timeoutMin: [
{ pattern: /^(\d{1,5})(\.[0-9]{1,4})?$/, "message": "判断时间必须是1-10位实数", trigger: "blur" } { pattern: /^(\d{1,10})(\.[0-9]{1,4})?$/, "message": "判断时间必须是1-10位实数", trigger: "blur" }
], ],
tempRegulation: [ tempRegulation: [
{ pattern: /^(-?\d{1,5})(\.[0-9]{1,4})?$/, message: "请输入正确的调节温度最大值", trigger: "blur" } { pattern: /^(-?\d{1,10})(\.[0-9]{1,4})?$/, message: "请输入正确的调节温度最大值", trigger: "blur" }
], ],
description: [ description: [
{ pattern: /^.{1,50}$/, "message": "备注必须是1-50位字符", trigger: "blur" } { pattern: /^.{1,50}$/, "message": "备注必须是1-50位字符", trigger: "blur" }
...@@ -137,15 +137,16 @@ const getInstanceHeat = () => { ...@@ -137,15 +137,16 @@ const getInstanceHeat = () => {
} }
}) })
} }
const onSave = () => { const onSave = async () => {
http.post("/api/Scheduling/BizInstantaneousHeat/Update", { ...List.value }, false).then((res) => { await formRef.value.validate()
if (res.success) { await http.post("/api/Scheduling/BizInstantaneousHeat/Update", { ...List.value }, false).then((res) => {
ElMessage.success(res.message) if (res.success) {
getInstanceHeat() ElMessage.success(res.message)
} getInstanceHeat()
}).catch((error) => { }
console.log(error) }).catch((error) => {
}) console.log(error)
})
} }
onMounted(() => { onMounted(() => {
getInstanceHeat() getInstanceHeat()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment