优化icd服务器

jc1.0
fanluyan 8 months ago
parent d1faf7e428
commit 0e26a4bc78

@ -0,0 +1,4 @@
[ViewState]
Mode=
Vid=
FolderType=Generic

@ -119,6 +119,17 @@ export function icdUpdateApi(data) {
data, data,
}); });
} }
//查询icd文件列表
export function icdFileApi(data) {
return request({
url: "/icdconfig/listFile",
method: "get",
params: data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}
//查询data表名 //查询data表名
export function tableListApi(data) { export function tableListApi(data) {
@ -909,7 +920,7 @@ export function DownloadAllApi(data) {
export function serverstartApi(data) { export function serverstartApi(data) {
return request({ return request({
url: "/iecserver/start", url: "/iecserver/start",
method: "get", method: "post",
params: data, params: data,
headers: { headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
@ -933,7 +944,7 @@ export function serverstatusApi(data) {
export function serverstopApi(data) { export function serverstopApi(data) {
return request({ return request({
url: "/iecserver/stop", url: "/iecserver/stop",
method: "get", method: "post",
params: data, params: data,
headers: { headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",

@ -353,11 +353,15 @@ export default {
} }
}, },
clearAllicd() { clearAllicd() {
this.$confirm("此操作将清除所有上传的文件, 是否继续?", "提示", { this.$confirm(
confirmButtonText: "确定", "此操作将清除所有icd文件、相关配置、rptparamindex, 是否继续?",
cancelButtonText: "取消", "提示",
type: "warning", {
}) confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(() => { .then(() => {
icdclearAllApi() icdclearAllApi()
.then((res) => { .then((res) => {

@ -1,12 +1,35 @@
<template> <template>
<div class="iceConfig"> <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"> <el-card class="box-card">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span> IEC服务器状态</span> <span> IEC服务器状态</span>
</div> </div>
<div class="concard"> <div class="concard">
<p>端口{{ port }}</p> <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> <p>
服务器状态 服务器状态
<el-tag type="success" v-if="serverStatus"></el-tag> <el-tag type="success" v-if="serverStatus"></el-tag>
@ -31,6 +54,7 @@ import {
serverstartApi, serverstartApi,
serverstatusApi, serverstatusApi,
serverstopApi, serverstopApi,
icdFileApi,
} from "@/utils/api/index"; } from "@/utils/api/index";
export default { export default {
@ -38,12 +62,17 @@ export default {
data() { data() {
return { return {
port: "", port: "",
filename: "", //
serverStatus: false, serverStatus: false,
serverVal: true, serverVal: true,
fileNameVal: "",
icdFileOptions: [],
serveLoading: false,
}; };
}, },
mounted() { mounted() {
this.geticeStatus(); //iedName this.geticeStatus(); //iedName
this.getIcdListFile();
}, },
methods: { methods: {
//ice //ice
@ -55,6 +84,8 @@ export default {
this.port = res.data.port; this.port = res.data.port;
this.serverStatus = res.data.started; this.serverStatus = res.data.started;
this.serverVal = res.data.started; this.serverVal = res.data.started;
this.filename = res.data.filename;
this.fileNameVal = res.data.fileId;
} else { } else {
this.$message({ this.$message({
duration: 1500, duration: 1500,
@ -70,12 +101,22 @@ export default {
}, },
changeStatus() { changeStatus() {
console.log(this.serverVal); console.log(this.serverVal);
this.serveLoading = true;
if (this.serverVal) { if (this.serverVal) {
serverstartApi() serverstartApi({
fileId: this.fileNameVal,
})
.then((res) => { .then((res) => {
if (res.success) { if (res.success) {
console.log(res); console.log(res);
this.$message({
duration: 1500,
showClose: true,
message: "服务器开始成功",
type: "success",
});
this.geticeStatus(); this.geticeStatus();
this.serveLoading = false;
} else { } else {
this.$message({ this.$message({
duration: 1500, duration: 1500,
@ -83,6 +124,8 @@ export default {
message: res.errorMsg, message: res.errorMsg,
type: "error", type: "error",
}); });
this.geticeStatus();
this.serveLoading = false;
} }
}) })
.catch((err) => { .catch((err) => {
@ -93,8 +136,10 @@ export default {
.then((res) => { .then((res) => {
if (res.success) { if (res.success) {
console.log(res); console.log(res);
this.serveLoading = false;
this.geticeStatus(); this.geticeStatus();
} else { } else {
this.serveLoading = false;
this.$message({ this.$message({
duration: 1500, duration: 1500,
showClose: true, 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> </script>
@ -121,7 +188,7 @@ export default {
padding: 0px 12px; padding: 0px 12px;
height: 100%; height: 100%;
.cardBox { .cardBox {
width: 260px; width: 360px;
margin-top: 20px; margin-top: 20px;
.el-card__header { .el-card__header {
padding: 12px; padding: 12px;
@ -129,10 +196,25 @@ export default {
.el-card__body { .el-card__body {
padding: 12px; padding: 12px;
} }
p { .concard {
&:nth-child(2) { .flieSet {
margin-top: 12px; display: flex;
align-items: center;
margin-bottom: 12px; 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;
}
} }
} }
} }

Loading…
Cancel
Save