优化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,
});
}
//查询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表名
export function tableListApi(data) {
@ -909,7 +920,7 @@ export function DownloadAllApi(data) {
export function serverstartApi(data) {
return request({
url: "/iecserver/start",
method: "get",
method: "post",
params: data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
@ -933,7 +944,7 @@ export function serverstatusApi(data) {
export function serverstopApi(data) {
return request({
url: "/iecserver/stop",
method: "get",
method: "post",
params: data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",

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

@ -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;
}
}
}
}

Loading…
Cancel
Save