Commit 76205dae authored by 裴文涛's avatar 裴文涛

删除接口调整

parent f9b76a0e
...@@ -100,7 +100,7 @@ export const addAnnualParam = params => { // 新增年度参数 ...@@ -100,7 +100,7 @@ export const addAnnualParam = params => { // 新增年度参数
export const deleteAnnualParam = params => { // 删除年度参数 export const deleteAnnualParam = params => { // 删除年度参数
// console.log("地址:",`/api/Scheduling/BizHeatSet/Delete?Id=${params}`) // console.log("地址:",`/api/Scheduling/BizHeatSet/Delete?Id=${params}`)
return http.post(`/api/Scheduling/BizHeatSet/Delete?Id=${params}`) return http.post(`/api/Scheduling/BizHeatSet/Delete`,params)
} }
export const getPhenomenon = () => { // 获取数据列表————天气工况 export const getPhenomenon = () => { // 获取数据列表————天气工况
...@@ -115,7 +115,7 @@ export const alterPhenomenon = params => { // 修改数据————天气工 ...@@ -115,7 +115,7 @@ export const alterPhenomenon = params => { // 修改数据————天气工
} }
export const deletePhenomenon = params => { // 删除数据————天气工况 export const deletePhenomenon = params => { // 删除数据————天气工况
return http.post(`/api/Scheduling/WeatherCondition/Delete?Id=${params}`) return http.post(`/api/Scheduling/WeatherCondition/Delete`,params)
} }
export const getWind = () => { // 获取数据列表————风力配置 export const getWind = () => { // 获取数据列表————风力配置
...@@ -131,5 +131,5 @@ export const alterWind = params => { // 修改数据————风力配置 ...@@ -131,5 +131,5 @@ export const alterWind = params => { // 修改数据————风力配置
} }
export const deleteWind = params => { // 删除数据————风力配置 export const deleteWind = params => { // 删除数据————风力配置
return http.post(`/api/Scheduling/WindConfiguration/Delete?Id=${params}`) return http.post(`/api/Scheduling/WindConfiguration/Delete`,params)
} }
...@@ -54,7 +54,10 @@ function handleDelete(val) { ...@@ -54,7 +54,10 @@ function handleDelete(val) {
type: 'warning' type: 'warning'
} }
).then(() => { ).then(() => {
deleteAnnualParam(val.paramId).then(res => { let param = {
id: val.paramId
}
deleteAnnualParam(param).then(res => {
if (res.success) { if (res.success) {
getData() getData()
ElMessage({ ElMessage({
...@@ -62,12 +65,12 @@ function handleDelete(val) { ...@@ -62,12 +65,12 @@ function handleDelete(val) {
type: 'success', type: 'success',
}) })
} }
}) }).catch(err => {
}).catch(err => { ElMessage({
ElMessage({ message: '删除失败.',
message: '删除失败.', type: 'error',
type: 'error', })
}) })
}) })
} // 处理删除 } // 处理删除
function handleAdd() { function handleAdd() {
...@@ -147,6 +150,10 @@ function resetInput() { ...@@ -147,6 +150,10 @@ function resetInput() {
backWaterTemperature: '' backWaterTemperature: ''
} }
} }
function energyTypeSort(){
return ['一步节能','二步节能','三步节能','四步节能','非节能']
} // 节能类型排序自定义方法
</script> </script>
<template> <template>
...@@ -166,12 +173,13 @@ function resetInput() { ...@@ -166,12 +173,13 @@ function resetInput() {
:data="data" :data="data"
border border
stripe stripe
: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%">
<el-table-column label="序号" type="index" align="center" width="60"/> <el-table-column label="序号" type="index" align="center" width="60"/>
<el-table-column label="节能类型" prop="energyType"/> <el-table-column label="节能类型" sortable :sort-method="energyTypeSort" prop="energyType"/>
<el-table-column label="年度" prop="year"/> <el-table-column label="年度" sortable prop="year"/>
<el-table-column label="热指标(W/m²)" prop="standard"/> <el-table-column label="热指标(W/m²)" prop="standard"/>
<el-table-column label="度日数标定值" prop="degreeStandard"/> <el-table-column label="度日数标定值" prop="degreeStandard"/>
<el-table-column label="室内温度(℃)" prop="indoorTemperature"/> <el-table-column label="室内温度(℃)" prop="indoorTemperature"/>
......
...@@ -33,7 +33,9 @@ function search(){ ...@@ -33,7 +33,9 @@ function search(){
} }
} }
function omit(val){ function omit(val){
let id = val.phenomenonId let param = {
id: val.phenomenonId
}
ElMessageBox.confirm( ElMessageBox.confirm(
'点击确定后,该条数据将删除,是否继续?', '点击确定后,该条数据将删除,是否继续?',
'Warning', 'Warning',
...@@ -43,18 +45,18 @@ function omit(val){ ...@@ -43,18 +45,18 @@ function omit(val){
type:'warning' type:'warning'
} }
).then(()=>{ ).then(()=>{
deletePhenomenon(id).then(res=>{ deletePhenomenon(param).then(res=>{
getData() getData()
ElMessage({ ElMessage({
message: '删除成功.', message: '删除成功.',
type: 'success', type: 'success',
}) })
}) }).catch(err=>{
}).catch(err=>{ ElMessage({
ElMessage({ message: '删除失败.',
message: '删除失败.', type: 'error',
type: 'error', })
}) })
}) })
} // 删除按钮单击事件 } // 删除按钮单击事件
function handleClose(){ function handleClose(){
......
...@@ -30,27 +30,29 @@ function revise(val) { ...@@ -30,27 +30,29 @@ function revise(val) {
reviseWindowOpen.value = true; reviseWindowOpen.value = true;
} // 修改按钮单击事件 } // 修改按钮单击事件
function omit(val) { function omit(val) {
let id = val.windId; let param = {
id: val.windId,
}
ElMessageBox.confirm("点击确定后,该条数据将删除,是否继续?", "Warning", { ElMessageBox.confirm("点击确定后,该条数据将删除,是否继续?", "Warning", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",
}) })
.then(() => { .then(() => {
deleteWind(id).then((res) => { deleteWind(param).then((res) => {
getData(); getData();
ElMessage({ ElMessage({
message: "删除成功.", message: "删除成功.",
type: "success", type: "success",
}); });
}); }).catch((err) => {
ElMessage({
message: "删除失败.",
type: "error",
});
});
}) })
.catch((err) => {
ElMessage({
message: "删除失败.",
type: "error",
});
});
} // 删除按钮单击事件 } // 删除按钮单击事件
function search() { function search() {
if (!searchKey.value) { if (!searchKey.value) {
......
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