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

删除接口调整

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