Commit 9cf906c1 authored by 裴文涛's avatar 裴文涛

年度参数年度计算方式修改,表格,查询输入框等修改

parent 3d41ec8a
......@@ -123,9 +123,9 @@ const currentYear = ref(0)
const addSaveBtnLoading = ref(false)
const selectYearValue = computed(() => {
if (currentMonth.value >= 7) {
return currentYear.value + "年-" + (currentYear.value + 1) + "年"
return currentYear.value
} else {
return (currentYear.value - 1) + "年-" + currentYear.value + "年"
return currentYear.value - 1
}
})
const organizationStructure = ref([]) // 组织结构数据
......@@ -397,26 +397,26 @@ function customSort(a, b) {
let valA;
let valB;
if (a.energyType === '一步节能') {
valA = 1
valA = 4
} else if (a.energyType === '二步节能') {
valA = 2
} else if (a.energyType === '三步节能') {
valA = 3
} else if (a.energyType === '三步节能') {
valA = 2
} else if (a.energyType === '四步节能') {
valA = 4
valA = 1
} else if (a.energyType === '非节能') {
valA = 5
} else {
valA = 6
}
if (b.energyType === '一步节能') {
valB = 1
valB = 4
} else if (b.energyType === '二步节能') {
valB = 2
} else if (b.energyType === '三步节能') {
valB = 3
} else if (b.energyType === '三步节能') {
valB = 2
} else if (b.energyType === '四步节能') {
valB = 4
valB = 1
} else if (b.energyType === '非节能') {
valB = 5
} else {
......@@ -466,16 +466,16 @@ function getOrganizationStructure() {
border
stripe
ref="elTableRef"
height="calc(100vh - 180px)"
:default-sort="{ prop: 'year', order: 'descending' }"
:header-cell-class-name="tableHeaderClass"
:row-class-name="tableBodyClass"
style="width: 100%"
height="750px"
>
<el-table-column label="序号" type="index" align="center" width="100"/>
<el-table-column label="节能类型" sortable :sort-method="customSort" prop="energyType" width="150"/>
<el-table-column label="供热站名称" prop="supplyName" width="200"/>
<el-table-column label="年度" sortable prop="year" width="150"/>
<el-table-column label="年度" sortable :sort-method="customSort" prop="year" width="150"/>
<el-table-column label="热指标(W/m²)" prop="standard" width="150"/>
<el-table-column label="度日数标定值" prop="degreeStandard" width="200"/>
<el-table-column label="室内温度(℃)" prop="indoorTemperature" width="150"/>
......@@ -509,9 +509,10 @@ function getOrganizationStructure() {
<el-col :span="8" col-label>年度:</el-col>
<el-col :span="16" col-value>
<el-form-item prop="year" style="margin: 0;padding: 0">
<el-select placeholder="" size="small" v-model="reviseForm.year" style="width: 290px">
<el-option :value="selectYearValue" :label="selectYearValue"/>
</el-select>
<span>{{reviseForm.year}}</span>
<!-- <el-select placeholder="" size="small" v-model="reviseForm.year" style="width: 290px">-->
<!-- <el-option :value="selectYearValue" :label="selectYearValue"/>-->
<!-- </el-select>-->
</el-form-item>
</el-col>
</el-row>
......@@ -594,9 +595,10 @@ function getOrganizationStructure() {
<el-col :span="8" col-label>年度:</el-col>
<el-col :span="16" col-value>
<el-form-item prop="year" style="margin: 0;padding: 0">
<el-select placeholder="" size="small" v-model="addForm.year" style="width: 290px">
<el-option :value="selectYearValue" :label="selectYearValue"/>
</el-select>
<span>{{selectYearValue}}</span>
<!-- <el-select placeholder="" size="small" v-model="addForm.year" style="width: 290px">-->
<!-- <el-option :value="selectYearValue" :label="selectYearValue"/>-->
<!-- </el-select>-->
</el-form-item>
</el-col>
</el-row>
......@@ -669,7 +671,6 @@ function getOrganizationStructure() {
<style scoped lang="less">
.annual-param-container {
width: 100%;
margin: 4px;
}
.search-add-wrapper {
......
......@@ -222,7 +222,7 @@ function customSort(a, b) {
<el-row >
<el-col :span="8" label style="font-size: 18px">名称:</el-col>
<el-col :span="16" >
<el-input clearable style="height: 31px" v-model="searchKey"/>
<el-input clearable style="height: 31px; width: 400px" v-model="searchKey"/>
</el-col>
</el-row>
<el-button type="primary" @click="search" class="add-search-btn">查询</el-button>
......@@ -234,9 +234,9 @@ function customSort(a, b) {
:data="data"
stripe border style="width: 100%"
:default-sort="{ prop: 'phenomenonName', order: 'descending' }"
height="calc(100vh - 180px)"
:header-cell-class-name="tableHeaderClass"
:row-class-name="tableBodyClass"
height="750px"
>
<el-table-column type="index" label="序号" align="center" width="100"/>
<el-table-column prop="phenomenonName" sortable :sort-method="customSort" label="名称" width="100"/>
......@@ -353,7 +353,6 @@ function customSort(a, b) {
<style lang="less" scoped>
.phenomenon-container {
width: 100%;
margin: 4px;
}
.search-wrapper {
......
......@@ -235,7 +235,6 @@ const tableHeight = ref(h);
<el-table
:data="data"
stripe
height="750px"
border
style="width: 100%"
height="calc(100vh - 180px)"
......
......@@ -89,11 +89,11 @@ function omit(val) {
.then(() => {
deleteWind(param).then((res) => {
if (res.success) {
getData();
ElMessage({
message: "删除成功.",
type: "success",
});
getData();
} else {
ElMessage({
message: "删除失败.",
......@@ -135,6 +135,17 @@ function onReviseSubmit() {
reviseSaveBtnLoading.value = false
return
}
for(const item of data.value){
if(String(item.windLevel).trim() === String(reviseForm.value.windLevel).trim() && item.windId !== reviseForm.value.windId){
ElMessage({
message: '该风力级数已存在',
type: 'error',
})
reviseSaveBtnLoading.value = false
return
}
}
alterWind(reviseForm.value)
.then((res) => {
if (res.success) {
......@@ -167,6 +178,7 @@ function onAddSubmit() {
addSaveBtnLoading.value = true;
formRef.value.validate(valid=>{
if(valid){
if(Number(addForm.value.windTemp) > 45 || Number(addForm.value.windTemp) < -30){
ElMessage({
message: '对应温度不能大于45度或小于-30度',
......@@ -175,6 +187,18 @@ function onAddSubmit() {
addSaveBtnLoading.value = false
return
}
for(const item of data.value){
if(String(item.windLevel).trim() === String(addForm.value.windLevel).trim()){
ElMessage({
message: '该风力级数已存在',
type: 'error',
})
addSaveBtnLoading.value = false
return
}
}
addWind(addForm.value)
.then((res) => {
if (res.success) {
......@@ -238,7 +262,7 @@ function customSort(a, b) {
<el-row>
<el-col :span="8" label style="font-size: 20px">级数:</el-col>
<el-col :span="16">
<el-select placeholder="" clearable style="width: 200px" v-model="searchKey">
<el-select placeholder="" clearable style="width: 400px" v-model="searchKey">
<el-option v-for="item in 14" :key="item" :value="item" :label="item + '级风'" />
</el-select>
</el-col>
......@@ -254,9 +278,9 @@ function customSort(a, b) {
border
style="width: 100%"
:default-sort="{ prop: 'windLevel', order: 'descending' }"
height="calc(100vh - 180px)"
:header-cell-class-name="tableHeaderClass"
:row-class-name="tableBodyClass"
height="750px"
>
<el-table-column type="index" label="序号" align="center" width="100" />
<el-table-column prop="windLevel" sortable :sort-method="customSort" label="级数" width="100" />
......@@ -371,7 +395,6 @@ function customSort(a, b) {
<style lang="less" scoped>
.windManage-container {
width: 100%;
margin: 4px;
}
.search-wrapper {
......@@ -409,9 +432,7 @@ function customSort(a, b) {
font-size: 12px;
color: black;
}
.dialog-window{
height: 500px;
}
.table-operate-column {
display: flex;
justify-content: center;
......@@ -423,9 +444,7 @@ function customSort(a, b) {
}
::v-deep .el-table__body tr:hover>td {
background: linear-gradient(to top,
rgb(0, 198, 255),
rgb(255, 255, 255)) !important;
background: linear-gradient(to top, rgb(0, 198, 255), rgb(255, 255, 255)) !important;
}
.el-row[first] {
......
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