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

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

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