添加微气象覆冰转发

menu1.0
fanluyan 6 months ago
parent 2791fffcd4
commit 15b220d37d

@ -167,6 +167,10 @@ export default {
index: "/aiWork",
title: "AI绘图",
},
{
index: "/weatherIceConfig",
title: "覆冰微气象转发",
},
],
},
],

@ -231,6 +231,18 @@ const routes = [
requiresAuth: true,
},
},
{
path: "/weatherIceConfig",
component: () => import("../views/system/weatherIceConfig.vue"),
name: "weatherIceConfig",
meta: {
title: "微气象覆冰转发",
icon: "",
keepAlive: true,
requiresAuth: true,
},
},
{
path: "/echarts",
component: () => import("../echartsDemo.vue"),

@ -76,3 +76,67 @@ export function exportJoggle(data) {
responseType: "blob",
});
}
//查询天气装置列表
export function getWeatherListApi(data) {
return request({
url: "/xymanager/henan/getWeatherList",
method: "get",
params: data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}
//查询拉力装置点表
export function getPointListApi(data) {
return request({
url: "/xymanager/henan/getPointList",
method: "get",
params: data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}
//新增微气象转发
export function addWeatherApi(data) {
return request({
url: "/xymanager/henan/addWeather",
method: "post",
data,
});
}
//新增覆冰转发
export function addIcePointApi(data) {
return request({
url: "/xymanager/henan/addPoint",
method: "post",
data,
});
}
//删除微气象转发
export function delWeatherApi(data) {
return request({
url: "/xymanager/henan/delWeather",
method: "post",
params: data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}
//删除覆冰转发
export function delPointApi(data) {
return request({
url: "/xymanager/henan/delPoint",
method: "post",
params: data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}

@ -0,0 +1,363 @@
<template>
<div class="weatherIceBox">
<div class="weatherDiv">
<div class="headTitle">
<span>微气象转发列表{{ weatherTable.length }}</span>
<el-button type="primary" icon="el-icon-plus" @click="addWeather"
>新增</el-button
>
</div>
<el-table
:data="weatherTable"
border
style="width: 100%"
height="calc(100% - 42px)"
v-loading="weatherLoading"
>
<el-table-column prop="cmdid" label="cmdid"> </el-table-column>
<el-table-column prop="termId" label="termId"> </el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button
type="text"
class="deleteText"
@click.native.stop="handleWeatherDelete(scope.row)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
</div>
<el-dialog
title="新增微气象转发"
:visible.sync="weatherVisible"
width="334px"
>
<el-form :model="weatherForm">
<el-form-item label="装置编号">
<el-autocomplete
clearable
v-model="weatherForm.cmdidVal"
:fetch-suggestions="querySearch"
placeholder="请输入内容"
@select="handleSelect"
></el-autocomplete>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="weatherVisible = false"> </el-button>
<el-button type="primary" @click="confirmWeather"> </el-button>
</span>
</el-dialog>
<div class="iceDiv">
<div class="headTitle">
<span>覆冰转发列表{{ pullTable.length }}</span>
<el-button type="primary" icon="el-icon-plus" @click="addIce"
>新增</el-button
>
</div>
<el-table
:data="pullTable"
border
style="width: 100%"
height="calc(100% - 42px)"
v-loading="pullLoading"
>
<el-table-column prop="cmdid" label="cmdid"> </el-table-column>
<el-table-column prop="termId" label="termId"> </el-table-column>
<el-table-column prop="funcCode" label="funcCode"> </el-table-column>
<el-table-column prop="point" label="point"> </el-table-column>
<el-table-column prop="ccll" label="ccll"> </el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button
type="text"
class="deleteText"
@click.native.stop="handleIceDelete(scope.row)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
</div>
<el-dialog title="新增覆冰转发" :visible.sync="iceVisible" width="334px">
<el-form :model="iceForm" label-width="80px">
<el-form-item label="装置编号">
<el-autocomplete
clearable
v-model="iceForm.cmdidVal"
:fetch-suggestions="querySearch"
placeholder="请输入内容"
@select="handleSelect"
></el-autocomplete>
</el-form-item>
<el-form-item label="相位">
<el-input
placeholder="请输入内容"
v-model="iceForm.funcCode"
clearable
>
</el-input>
</el-form-item>
<el-form-item label="point">
<el-input placeholder="请输入内容" v-model="iceForm.point" clearable>
</el-input>
</el-form-item>
<el-form-item label="初始拉力">
<el-input placeholder="请输入内容" v-model="iceForm.ccll" clearable>
</el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="iceVisible = false"> </el-button>
<el-button type="primary" @click="confirmIce"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import {
getWeatherListApi,
getPointListApi,
addWeatherApi,
addIcePointApi,
delWeatherApi,
delPointApi,
} from "@/utils/api/iceApi";
import { gettermAllList } from "@/utils/api/reportApi";
export default {
name: "weatherIceConfig",
data() {
return {
weatherTable: [], //
weatherLoading: false,
weatherVisible: false,
weatherForm: {},
termidOptions: [], //termid,
selectVal: "",
pullTable: [], //
pullLoading: false,
iceVisible: false,
iceForm: {},
};
},
created() {
this.getWeather();
this.getPull();
},
computed: {},
methods: {
//
getWeather() {
this.weatherLoading = true;
getWeatherListApi()
.then((res) => {
if (res.code == 200) {
this.weatherTable = res.data;
this.weatherLoading = false;
} else {
this.weatherLoading = false;
this.$message({
duration: 1500,
showClose: true,
message: res.msg,
type: "success",
});
}
})
.catch((err) => {});
},
//
getPull() {
this.pullLoading = true;
getPointListApi()
.then((res) => {
if (res.code == 200) {
this.pullLoading = false;
this.pullTable = res.data;
} else {
this.pullLoading = false;
this.$message({
duration: 1500,
showClose: true,
message: res.msg,
type: "success",
});
}
})
.catch((err) => {});
},
//
addWeather() {
this.weatherVisible = true;
},
//
addIce() {
this.iceVisible = true;
},
//
handleWeatherDelete(data) {
console.log(data);
this.$confirm("确定要删除该微气象装置的数据转发?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
delWeatherApi({ id: data.id }).then((res) => {
console.log(res.code);
if (res.code == 200) {
this.$message.success("删除成功");
this.getWeather(); //
} else if (res.code == 400) {
this.$message.error(res.msg);
}
});
})
.catch(() => {});
},
//
handleIceDelete(data) {
console.log(data);
this.$confirm("确定要删除该覆冰装置的数据转发?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
delPointApi({ id: data.id }).then((res) => {
console.log(res.code);
if (res.code == 200) {
this.$message.success("删除成功");
this.getPull(); //
} else if (res.code == 400) {
this.$message.error(res.msg);
}
});
})
.catch(() => {});
},
//termid
//
async querySearch(queryString, cb) {
//
this.getTermid({ pageNum: 1, pageSize: 30, cmdid: queryString })
.then((response) => {
// { data: { list: [{ id: ..., name: ... }, ...] } }
const suggestions = response.data.list.map((item) => ({
value: item.cmdid,
}));
cb(suggestions);
})
.catch((error) => {
console.error("查询建议时出错:", error);
cb([]);
});
},
// ID
getTermid(params) {
return new Promise((resolve, reject) => {
//
setTimeout(() => {
gettermAllList(params)
.then((res) => {
console.log(res);
this.termidOptions = res.data.list;
resolve(res); //
})
.catch((err) => {
console.error("接口调用失败:", err);
reject(err); // Promise
});
}, 100);
});
},
//
handleSelect(item) {
console.log(item);
console.log(this.termidOptions);
// termidOptions
const selectedOption = this.termidOptions.find(
(option) => option.cmdid === item.value
);
if (selectedOption) {
this.selectVal = selectedOption.id;
console.log("选中的ID:", selectedOption.id); // ID
}
},
//
confirmWeather() {
addWeatherApi({ termId: this.selectVal })
.then((res) => {
if (res.code == 200) {
this.$message({
duration: 1500,
showClose: true,
message: "新增转发成功",
type: "success",
});
this.getWeather();
this.selectVal = "";
this.weatherVisible = false;
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {});
},
//
confirmIce() {
addIcePointApi({
termId: this.selectVal,
ccll: this.iceForm.ccll,
funcCode: this.iceForm.funcCode,
point: this.iceForm.point,
})
.then((res) => {
if (res.code == 200) {
this.$message({
duration: 1500,
showClose: true,
message: "新增转发成功",
type: "success",
});
this.getPull();
this.selectVal = "";
this.iceVisible = false;
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {});
},
},
};
</script>
<style lang="less">
.weatherIceBox {
width: calc(100% - 24px);
height: calc(100% - 24px);
padding: 12px 12px;
background: #fff;
display: flex;
.headTitle {
display: flex;
align-items: center;
margin-bottom: 12px;
justify-content: space-between;
}
.weatherDiv {
width: 49%;
margin-right: 2%;
}
.iceDiv {
width: 49%;
}
.el-table::before,
.el-table__fixed-right::before,
.el-table__fixed::before {
height: 1px;
}
}
</style>
Loading…
Cancel
Save