|
|
|
@ -1,12 +1,35 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div class="iceConfig">
|
|
|
|
|
<div class="cardBox">
|
|
|
|
|
<div
|
|
|
|
|
class="cardBox"
|
|
|
|
|
v-loading="serveLoading"
|
|
|
|
|
element-loading-text="请稍等"
|
|
|
|
|
element-loading-spinner="el-icon-loading"
|
|
|
|
|
element-loading-background="rgba(0, 0, 0, 0.7)"
|
|
|
|
|
>
|
|
|
|
|
<el-card class="box-card">
|
|
|
|
|
<div slot="header" class="clearfix">
|
|
|
|
|
<span> IEC服务器状态</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="concard">
|
|
|
|
|
<p>端口:{{ port }}</p>
|
|
|
|
|
<p>filename:{{ filename }}</p>
|
|
|
|
|
<div class="flieSet">
|
|
|
|
|
<h5>选择文件:</h5>
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="fileNameVal"
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
:disabled="serverStatus"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in icdFileOptions"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
:label="item.filename"
|
|
|
|
|
:value="item.id"
|
|
|
|
|
>
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
<p>
|
|
|
|
|
服务器状态:
|
|
|
|
|
<el-tag type="success" v-if="serverStatus">开启</el-tag>
|
|
|
|
@ -31,6 +54,7 @@ import {
|
|
|
|
|
serverstartApi,
|
|
|
|
|
serverstatusApi,
|
|
|
|
|
serverstopApi,
|
|
|
|
|
icdFileApi,
|
|
|
|
|
} from "@/utils/api/index";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
@ -38,12 +62,17 @@ export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
port: "",
|
|
|
|
|
filename: "", //文件名
|
|
|
|
|
serverStatus: false,
|
|
|
|
|
serverVal: true,
|
|
|
|
|
fileNameVal: "",
|
|
|
|
|
icdFileOptions: [],
|
|
|
|
|
serveLoading: false,
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
this.geticeStatus(); //获取iedName列表
|
|
|
|
|
this.getIcdListFile();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
//获取ice服务器状态
|
|
|
|
@ -55,6 +84,8 @@ export default {
|
|
|
|
|
this.port = res.data.port;
|
|
|
|
|
this.serverStatus = res.data.started;
|
|
|
|
|
this.serverVal = res.data.started;
|
|
|
|
|
this.filename = res.data.filename;
|
|
|
|
|
this.fileNameVal = res.data.fileId;
|
|
|
|
|
} else {
|
|
|
|
|
this.$message({
|
|
|
|
|
duration: 1500,
|
|
|
|
@ -70,12 +101,22 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
changeStatus() {
|
|
|
|
|
console.log(this.serverVal);
|
|
|
|
|
this.serveLoading = true;
|
|
|
|
|
if (this.serverVal) {
|
|
|
|
|
serverstartApi()
|
|
|
|
|
serverstartApi({
|
|
|
|
|
fileId: this.fileNameVal,
|
|
|
|
|
})
|
|
|
|
|
.then((res) => {
|
|
|
|
|
if (res.success) {
|
|
|
|
|
console.log(res);
|
|
|
|
|
this.$message({
|
|
|
|
|
duration: 1500,
|
|
|
|
|
showClose: true,
|
|
|
|
|
message: "服务器开始成功",
|
|
|
|
|
type: "success",
|
|
|
|
|
});
|
|
|
|
|
this.geticeStatus();
|
|
|
|
|
this.serveLoading = false;
|
|
|
|
|
} else {
|
|
|
|
|
this.$message({
|
|
|
|
|
duration: 1500,
|
|
|
|
@ -83,6 +124,8 @@ export default {
|
|
|
|
|
message: res.errorMsg,
|
|
|
|
|
type: "error",
|
|
|
|
|
});
|
|
|
|
|
this.geticeStatus();
|
|
|
|
|
this.serveLoading = false;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
@ -93,8 +136,10 @@ export default {
|
|
|
|
|
.then((res) => {
|
|
|
|
|
if (res.success) {
|
|
|
|
|
console.log(res);
|
|
|
|
|
this.serveLoading = false;
|
|
|
|
|
this.geticeStatus();
|
|
|
|
|
} else {
|
|
|
|
|
this.serveLoading = false;
|
|
|
|
|
this.$message({
|
|
|
|
|
duration: 1500,
|
|
|
|
|
showClose: true,
|
|
|
|
@ -108,6 +153,28 @@ export default {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
getIcdListFile() {
|
|
|
|
|
icdFileApi()
|
|
|
|
|
.then((res) => {
|
|
|
|
|
if (res.success) {
|
|
|
|
|
console.log(res);
|
|
|
|
|
this.icdFileOptions = res.data;
|
|
|
|
|
if (this.filename == null) {
|
|
|
|
|
this.fileNameVal = this.icdFileOptions[0].id;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.$message({
|
|
|
|
|
duration: 1500,
|
|
|
|
|
showClose: true,
|
|
|
|
|
message: res.errorMsg,
|
|
|
|
|
type: "error",
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
console.log(err); //代码错误、请求失败捕获
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
@ -121,7 +188,7 @@ export default {
|
|
|
|
|
padding: 0px 12px;
|
|
|
|
|
height: 100%;
|
|
|
|
|
.cardBox {
|
|
|
|
|
width: 260px;
|
|
|
|
|
width: 360px;
|
|
|
|
|
margin-top: 20px;
|
|
|
|
|
.el-card__header {
|
|
|
|
|
padding: 12px;
|
|
|
|
@ -129,10 +196,25 @@ export default {
|
|
|
|
|
.el-card__body {
|
|
|
|
|
padding: 12px;
|
|
|
|
|
}
|
|
|
|
|
p {
|
|
|
|
|
&:nth-child(2) {
|
|
|
|
|
margin-top: 12px;
|
|
|
|
|
.concard {
|
|
|
|
|
.flieSet {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
margin-bottom: 12px;
|
|
|
|
|
h5 {
|
|
|
|
|
font-weight: normal;
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
p {
|
|
|
|
|
&:nth-child(2) {
|
|
|
|
|
margin-top: 12px;
|
|
|
|
|
margin-bottom: 12px;
|
|
|
|
|
}
|
|
|
|
|
&:nth-child(4) {
|
|
|
|
|
// margin-top: 12px;
|
|
|
|
|
margin-bottom: 12px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|