添加数据转移,iec服务器功能

jc1.0
fanluyan 8 months ago
parent 5e563d1e5a
commit d1faf7e428

@ -70,6 +70,10 @@ export default {
path: "/rptparam", path: "/rptparam",
name: "rptparam配置", name: "rptparam配置",
}, },
{
path: "/iecserver",
name: "IEC服务器",
},
], ],
}, },
@ -78,8 +82,18 @@ export default {
name: "告警规则", name: "告警规则",
}, },
{ {
path: "/I2config", path: "/datago",
name: "I2配置", name: "数据转移",
subs: [
{
path: "/I2config",
name: "I2配置",
},
{
path: "/datatransfer",
name: "下载录波文件",
},
],
}, },
], ],
}; };

@ -138,6 +138,14 @@ const routes = [
title: "rptparam配置", title: "rptparam配置",
}, },
}, },
{
path: "/iecserver",
component: () => import("../views/iceserver/index.vue"),
name: "iecserver",
meta: {
title: "iecserver服务器",
},
},
{ {
path: "/alarmRules", path: "/alarmRules",
component: () => import("../views/alarmRules/index.vue"), component: () => import("../views/alarmRules/index.vue"),
@ -187,6 +195,41 @@ const routes = [
}, },
], ],
}, },
{
path: "/dataTransfer",
component: () => import("../views/dataTransfer/index.vue"),
name: "dataTransfer",
meta: {
title: "数据转移",
},
path: "/dataTransfer",
component: () => import("../views/dataTransfer/index.vue"),
name: "dataTransfer",
redirect: "/dataTransfer/server",
meta: {
title: "数据转移",
},
children: [
{
path: "/dataTransfer/server",
component: () => import("../views/dataTransfer/server/index.vue"),
name: "server",
meta: {
title: "远端服务器",
},
},
{
path: "/dataTransfer/downrecord",
component: () =>
import("../views/dataTransfer/downrecord/index.vue"),
name: "downrecord",
meta: {
title: "下载记录",
},
},
],
},
], ],
}, },
]; ];

@ -162,6 +162,14 @@ export function deleteAttApi(data) {
}, },
}); });
} }
//生成rpt
export function generateRptApi(data) {
return request({
url: "/icdconfig/generateParamindex",
method: "post",
data,
});
}
//设备台账管理列表api //设备台账管理列表api
//变电站相关接口 //变电站相关接口
@ -525,9 +533,9 @@ export function unbindApi(data) {
}); });
} }
export function generateParamindexApi(data) { export function updateParamindexApi(data) {
return request({ return request({
url: "/parambind/generateParamindex", url: "/parambind/updateParamindex",
method: "post", method: "post",
data, data,
}); });
@ -827,3 +835,108 @@ export function updateRptApi(data) {
data, data,
}); });
} }
//查询I2状态
export function i2statusApi(data) {
return request({
url: "/i2sync/status",
method: "get",
params: data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}
//远端服务器
//获取所有列表
export function serverlistApi(data) {
return request({
url: "/remote/listAll",
method: "get",
params: data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}
//新增
export function serveAddApi(data) {
return request({
url: "/remote/add",
method: "post",
data,
});
}
//修改
export function serveUpdateApi(data) {
return request({
url: "/remote/update",
method: "post",
data,
});
}
//删除导出类型
export function serveDelApi(data) {
return request({
url: "/remote/delete",
method: "post",
params: data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}
//下载记录
export function DownloadAllApi(data) {
return request({
url: "/remote/listDownload",
method: "get",
params: data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}
//IEC服务器
//启动IEC服务端
export function serverstartApi(data) {
return request({
url: "/iecserver/start",
method: "get",
params: data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}
//查看IEC服务端状态
export function serverstatusApi(data) {
return request({
url: "/iecserver/status",
method: "get",
params: data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}
//停止IEC服务端
export function serverstopApi(data) {
return request({
url: "/iecserver/stop",
method: "get",
params: data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}

@ -2,7 +2,18 @@
<div class="I2Box"> <div class="I2Box">
<div class="equimentList"> <div class="equimentList">
<div class="sideNav"> <div class="sideNav">
<h3><i class="el-icon-s-tools"></i>I2导出配置</h3> <h3>
<i class="el-icon-s-tools"></i>I2导出配置
<el-tooltip
class="item"
effect="dark"
:content="statusUrl"
placement="bottom"
>
<el-tag type="success" v-if="statusFlag"></el-tag>
<el-tag type="warning" v-else></el-tag>
</el-tooltip>
</h3>
<ul class="navList"> <ul class="navList">
<li v-for="(item, index) in navlist" :key="index"> <li v-for="(item, index) in navlist" :key="index">
<router-link :to="item.path"> <router-link :to="item.path">
@ -21,7 +32,7 @@
<script> <script>
// import addRules from "./components/addRules"; // import addRules from "./components/addRules";
// import copyRules from "./components/copyRules"; // import copyRules from "./components/copyRules";
import {} from "@/utils/api/index"; import { i2statusApi } from "@/utils/api/index";
export default { export default {
name: "I2config", name: "I2config",
components: {}, components: {},
@ -42,12 +53,28 @@ export default {
path: "/I2config/record", path: "/I2config/record",
}, },
], ],
statusUrl: "",
statusFlag: false,
}; };
}, },
watch: {}, watch: {},
computed: {}, computed: {},
created() {}, created() {
methods: {}, this.getI2Status();
},
methods: {
getI2Status() {
i2statusApi()
.then((res) => {
console.log(res);
this.statusFlag = res.data.enable;
this.statusUrl = res.data.url;
})
.catch((err) => {
console.log(err); //
});
},
},
}; };
</script> </script>
<style lang="less"> <style lang="less">
@ -88,6 +115,10 @@ export default {
i { i {
margin-right: 6px; margin-right: 6px;
} }
.el-tag {
margin-left: auto;
cursor: pointer;
}
} }
.navList { .navList {
box-shadow: inset 0 4px 4px -2px rgba(0, 0, 0, 0.15), box-shadow: inset 0 4px 4px -2px rgba(0, 0, 0, 0.15),

@ -0,0 +1,210 @@
<template>
<div class="recordBoxdown">
<div class="reportHead">
<h3>下载记录</h3>
</div>
<div class="page-body">
<div class="title">
<span>选择服务器</span>
<el-select v-model="serverVal" @change="changeServer">
<el-option
v-for="item in serverOption"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</div>
<div class="zsbTableBox">
<el-table
:data="recordData"
style="width: 100%"
height="calc(100% - 0px)"
v-loading="recordLoading"
>
<el-table-column label="服务器名称" prop="server">
<template slot-scope="scope">
<span>{{ scope.row.server.name }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="id" prop="id">
<template slot-scope="scope">
<span>{{ scope.row.id }}</span>
</template>
</el-table-column> -->
<el-table-column label="remotePath" prop="remotePath">
<template slot-scope="scope">
<span>{{ scope.row.remotePath }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="path" prop="path">
<template slot-scope="scope">
<span>{{ scope.row.path }}</span>
</template>
</el-table-column> -->
<el-table-column label="filename" prop="filename">
<template slot-scope="scope">
<el-button
type="text"
@click="downFile(scope.row)"
class="buttonText"
>{{ scope.row.filename }}</el-button
>
<!-- <span>{{ scope.row.filename }}</span> -->
</template>
</el-table-column>
<el-table-column label="创建时间" prop="createTime">
<template slot-scope="scope">
<span>{{ scope.row.createTime }}</span>
</template>
</el-table-column>
</el-table>
<div class="pageNation">
<el-pagination
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
:current-page="page"
:page-size="pageSize"
:page-sizes="[20, 40, 100]"
layout="sizes, prev, pager, next, jumper,total"
:total="total"
>
</el-pagination>
</div>
</div>
</div>
</div>
</template>
<script>
import { DownloadAllApi, serverlistApi } from "@/utils/api/index";
// import addzsbDialog from "./components/addzsbDialog";
export default {
name: "record",
components: {},
data() {
return {
recordData: [],
recordLoading: false,
page: 1, //
pageSize: 20, //
total: 0, //
serverOption: [{ id: -1, name: "全部" }], //
serverVal: "",
};
},
created() {
this.getServerList();
},
mounted() {},
watch: {},
methods: {
//
getServerList() {
serverlistApi()
.then((res) => {
console.log(res);
this.serverOption = this.serverOption.concat(res.data);
this.serverVal = this.serverOption[0].id;
this.getdownAll();
})
.catch((err) => {
console.log(err); //
});
},
//
//tablename
changeServer(val) {
console.log(val);
let selectedOption = this.serverOption.find((item) => item.id === val);
if (selectedOption) {
// 访 tablename
this.serverVal = selectedOption.id;
console.log(this.serverVal); // 使 tablename
this.getdownAll();
}
},
getdownAll() {
console.log(this.serverVal);
let params = { pageNum: this.page, pageSize: this.pageSize };
if (this.serverVal !== -1) {
params.configId = this.serverVal;
}
DownloadAllApi(params)
.then((res) => {
console.log(res);
this.recordData = res.data.content;
this.total = res.data.totalPages;
})
.catch((err) => {
console.log(err); //
});
},
//
downFile(row) {
// a
const a = document.createElement("a");
// ahrefURL
a.href = row.path;
console.log(a.href);
//
a.download = row.filename; //
//
document.body.appendChild(a);
a.click();
// a
document.body.removeChild(a);
},
//
handleCurrentChange(val) {
this.page = val;
this.recordData = [];
this.getdownAll();
},
//
handleSizeChange(val) {
this.pageSize = val;
this.recordData = [];
this.getdownAll();
},
},
};
</script>
<style lang="less">
.recordBoxdown {
width: 100%;
height: 100%;
.page-body {
width: calc(100% - 24px);
height: calc(100% - 74px);
padding: 12px;
background: #eee;
.title {
display: flex;
align-items: center;
span {
color: #000;
font-size: 14px;
}
}
.zsbTableBox {
margin-top: 8px;
height: calc(100% - 72px);
box-shadow: 1px 0 10px 1px rgba(0, 0, 0, 0.3);
.pageNation {
margin-top: 6px;
display: flex;
justify-content: flex-end;
}
.buttonText {
cursor: pointer;
white-space: pre-wrap;
&:hover {
text-decoration: underline;
}
}
}
}
}
</style>

@ -0,0 +1,182 @@
<template>
<div class="I2Box">
<div class="equimentList">
<div class="sideNav">
<h3><i class="el-icon-s-tools"></i>数据转移</h3>
<ul class="navList">
<li v-for="(item, index) in navlist" :key="index">
<router-link :to="item.path">
<span>{{ item.name }}</span
><i class="el-icon-arrow-right"></i>
</router-link>
</li>
</ul>
</div>
</div>
<div class="reportTable">
<router-view></router-view>
</div>
</div>
</template>
<script>
// import addRules from "./components/addRules";
// import copyRules from "./components/copyRules";
import {} from "@/utils/api/index";
export default {
name: "dataTransfer",
components: {},
data() {
return {
activeIndex: 0,
navlist: [
{
name: "远端服务器",
path: "/dataTransfer/server",
},
{
name: "下载记录",
path: "/dataTransfer/downrecord",
},
],
};
},
watch: {},
computed: {},
created() {},
methods: {},
};
</script>
<style lang="less">
.I2Box {
display: flex;
height: 100%;
.equimentList {
min-width: 240px;
max-width: 240px;
height: 100%;
overflow: auto;
//border: 1px solid #fff;
margin-right: 24px;
background: rgba(8, 9, 36, 0.28);
box-shadow: inset 0 4px 44px 0 #106cde;
//padding: 0px 12px;
.sideNav {
margin: 10px;
height: calc(100% - 20px);
background-color: #fff;
}
h3 {
font-weight: normal;
display: block;
height: 38px;
line-height: 36px;
margin: 0;
padding: 0 16px 0 16px;
-webkit-text-shadow: none !important;
text-shadow: none !important;
font-size: 14px;
text-decoration: none;
color: #262626;
display: flex;
align-items: center;
i {
margin-right: 6px;
}
.el-tag {
margin-left: auto;
cursor: pointer;
}
}
.navList {
box-shadow: inset 0 4px 4px -2px rgba(0, 0, 0, 0.15),
inset 0 -4px 4px -2px rgba(0, 0, 0, 0.15);
position: relative;
background-color: #fbfbfb;
li {
padding: 0 16px 0 38px;
color: #262626;
height: 38px;
line-height: 36px;
font-size: 14px;
display: flex;
align-items: center;
&::before {
content: "";
display: block;
position: absolute;
z-index: 1;
left: 23px;
top: 0;
bottom: 19px;
border-left: 1px solid #e2e2e2;
}
&:hover {
a {
cursor: pointer;
color: #106cde;
}
}
a {
position: relative;
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
color: #262626;
&::before {
content: "";
display: inline-block;
position: absolute;
width: 5px;
height: 5px;
left: -18px;
top: 16px;
background-color: #fff;
border: 1px solid #e2e2e2;
z-index: 2;
border-radius: 4px;
}
}
.router-link-active {
color: #106cde;
}
}
}
}
.reportTable {
flex: 1;
overflow-x: hidden;
background: rgba(8, 9, 36, 0.28);
// -webkit-backdrop-filter: blur(10px);
// backdrop-filter: blur(10px);
box-shadow: inset 0 4px 44px 0 #106cde;
padding: 0px 12px;
.reportHead {
height: 40px;
line-height: 40px;
display: flex;
align-items: center;
justify-content: space-between;
h3 {
font-size: 14px;
color: #fff;
font-weight: normal;
height: 40px;
line-height: 40px;
}
}
.el-table .el-table__cell {
text-align: center;
}
.editClass {
.el-link.el-link--primary {
margin-right: 14px;
}
}
}
}
</style>

@ -0,0 +1,255 @@
<template>
<div class="filedAddBoxServer">
<el-dialog
class="AddDialogBox"
:title="title"
:visible.sync="serverDialogShow"
@close="hide"
width="520px"
:close-on-click-modal="false"
>
<div class="filedInfo">
<el-form
label-position="left"
ref="formInforef"
label-width="104px"
:rules="rules"
:model="formInfo"
>
<el-form-item label="名称:" prop="name">
<el-input v-model="formInfo.name"></el-input>
</el-form-item>
<el-form-item label="ip" prop="ip">
<el-input v-model="formInfo.ip"></el-input>
</el-form-item>
<el-form-item label="端口:" prop="port">
<el-input v-model="formInfo.port"></el-input>
</el-form-item>
<el-form-item label="用户名:" prop="user">
<el-input v-model="formInfo.user"></el-input>
</el-form-item>
<el-form-item label="密码:" prop="passwd">
<el-input v-model="formInfo.passwd"></el-input>
</el-form-item>
<el-form-item label="路径:" prop="pathList">
<el-input
type="textarea"
:autosize="{ minRows: 4, maxRows: 4 }"
v-model="formInfo.pathList"
></el-input>
</el-form-item>
<el-form-item label="下载文件:" prop="suffix">
<el-select v-model="formInfo.suffix" placeholder="请选择">
<el-option
v-for="item in suffixOptions"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="状态:" prop="active">
<el-radio-group v-model="formInfo.active">
<el-radio :label="1">启用</el-radio>
<el-radio :label="0">停用</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="下载后删除:" prop="todel">
<el-radio-group v-model="formInfo.todel">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="hide"> </el-button>
<el-button type="primary" @click="submitForm()"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { serveAddApi, serveUpdateApi } from "@/utils/api/index";
export default {
props: ["title"],
data() {
return {
serverDialogShow: false,
formInfo: {
active: 1,
todel: 0,
},
rules: {},
pathObjects: [], //
suffixOptions: [
{
value: "全部",
label: "",
},
{
value: "dat",
label: "dat",
},
],
};
},
created() {},
mounted() {
// selected value
},
watch: {},
methods: {
//
getdataform(val) {
console.log(val);
this.formInfo = JSON.parse(JSON.stringify(val));
const columnData = this.formInfo.pathList.map((item) => item);
this.formInfo.pathList = columnData.join("\n");
},
submitForm() {
this.$refs.formInforef.validate((valid) => {
if (valid) {
if (this.title == "新增远端服务器") {
console.log(this.formInfo);
const pathArray = this.formInfo.pathList
.split("\n")
.map((path) => path.trim())
.filter((path) => path);
let params = {
name: this.formInfo.name,
ip: this.formInfo.ip,
port: this.formInfo.port,
user: this.formInfo.user,
passwd: this.formInfo.passwd,
pathList: pathArray,
active: this.formInfo.active,
todel: this.formInfo.todel,
suffix: this.formInfo.suffix,
};
console.log(params);
serveAddApi(params)
.then((res) => {
if (res.success) {
this.$message({
duration: 1500,
showClose: true,
message: "添加成功",
type: "success",
});
this.hide();
this.$parent.getServerList(); //
} else {
this.$message({
duration: 1500,
showClose: true,
message: res.errorMsg,
type: "error",
});
}
})
.catch((err) => {});
} else {
console.log(this.formInfo);
const pathArray = this.formInfo.pathList
.split("\n")
.map((path) => path.trim())
.filter((path) => path);
let params = {
id: this.formInfo.id,
name: this.formInfo.name,
ip: this.formInfo.ip,
port: this.formInfo.port,
user: this.formInfo.user,
passwd: this.formInfo.passwd,
pathList: pathArray,
active: this.formInfo.active,
todel: this.formInfo.todel,
suffix: this.formInfo.suffix,
};
serveUpdateApi(params)
.then((res) => {
if (res.success) {
this.$message({
duration: 1500,
showClose: true,
message: "添加成功",
type: "success",
});
this.hide();
this.$parent.getServerList(); //
} else {
this.$message({
duration: 1500,
showClose: true,
message: res.errorMsg,
type: "error",
});
}
})
.catch((err) => {});
}
} else {
console.log("error submit!!");
return false;
}
});
},
//
display() {
this.serverDialogShow = true;
},
hide() {
this.serverDialogShow = false;
console.log("我关闭了");
this.formInfo = {};
this.$refs.formInforef.resetFields(); //
console.log(this.formInfo);
},
},
};
</script>
<style lang="less">
.filedAddBoxServer {
.AddDialogBox {
.el-select {
width: 376px;
}
.filedInfo {
.colListBox {
overflow: auto;
height: 400px;
.coltitle {
display: flex;
align-items: center;
margin-bottom: 8px;
span {
font-weight: bold;
&:first-child {
width: 40%;
margin-right: 24px;
}
&:last-child {
width: 50%;
}
}
}
.selectCol {
display: flex;
align-items: center;
margin-bottom: 10px;
.el-checkbox {
width: 40%;
margin-right: 24px;
}
.el-input {
width: 50%;
}
}
}
}
}
}
</style>

@ -0,0 +1,157 @@
<template>
<div class="filedBoxServer">
<div class="reportHead">
<h3>远端服务器</h3>
</div>
<div class="page-body">
<el-button type="primary" icon="el-icon-plus" @click="handleAddClick"
>新增</el-button
>
<div class="zsbTableBox">
<el-table
:data="serverData"
style="width: 100%"
height="calc(100% - 0px)"
>
<el-table-column label="名称" prop="name"> </el-table-column>
<el-table-column label="ip" prop="ip"> </el-table-column>
<el-table-column label="端口" prop="port">
<template slot-scope="scope">
<span>{{ scope.row.port }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="用户名" prop="user"> </el-table-column>
<el-table-column label="密码" prop="passwd"> </el-table-column> -->
<el-table-column label="路径" prop="pathList">
<template slot-scope="scope">
<p v-for="(item, index) in scope.row.pathList">
{{ item }}
</p>
</template>
</el-table-column>
<el-table-column label="状态" prop="active">
<template slot-scope="scope">
<span>{{ scope.row.active == 1 ? "启用" : "停用" }}</span>
</template>
</el-table-column>
<el-table-column label="下载文件后缀" prop="suffix">
</el-table-column>
<el-table-column label="操作" class-name="editClass">
<template slot-scope="scope">
<el-link
type="primary"
@click="handleEditClick(scope.row)"
size="small"
icon="el-icon-document"
>修改</el-link
>
<el-link
type="danger"
@click="handleDeleteClick(scope.row)"
size="small"
icon="el-icon-delete"
>删除</el-link
>
</template>
</el-table-column>
</el-table>
</div>
</div>
<addserverDialog ref="serverAddRef" :title="title"></addserverDialog>
</div>
</template>
<script>
import { serverlistApi, serveDelApi } from "@/utils/api/index";
import addserverDialog from "./components/addserverDialog";
export default {
components: {
addserverDialog,
},
name: "server",
data() {
return {
filedLoading: false,
serverData: [],
title: "",
};
},
created() {
this.getServerList();
},
mounted() {},
watch: {},
methods: {
//
getServerList() {
this.filedLoading = true;
serverlistApi()
.then((res) => {
console.log(res);
this.serverData = res.data;
this.filedLoading = false;
})
.catch((err) => {
console.log(err); //
});
},
//
handleAddClick() {
this.title = "新增远端服务器";
this.$refs.serverAddRef.display();
},
handleEditClick(data) {
this.title = "修改";
this.$refs.serverAddRef.display();
this.$refs.serverAddRef.getdataform(data);
},
//
handleDeleteClick(data) {
console.log(data);
this.$confirm(`确定要删除${data.name}远端服务器记录吗?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
serveDelApi({ id: data.id }).then((res) => {
if (res.success) {
this.$message({
duration: 1500,
showClose: true,
type: "success",
message: "删除成功",
});
this.getServerList(); //
} else {
this.$message({
duration: 1500,
showClose: true,
type: "error",
message: res.errorMsg,
});
}
});
})
.catch(() => {});
},
},
};
</script>
<style lang="less">
.filedBoxServer {
width: 100%;
height: 100%;
.page-body {
width: calc(100% - 24px);
height: calc(100% - 74px);
padding: 12px;
background: #eee;
.zsbTableBox {
margin-top: 8px;
height: calc(100% - 38px);
box-shadow: 1px 0 10px 1px rgba(0, 0, 0, 0.3);
}
}
}
</style>

@ -10,7 +10,7 @@
<el-form <el-form
label-position="left" label-position="left"
ref="formInfo" ref="formInfo"
label-width="104px" label-width="124px"
:rules="rules" :rules="rules"
:model="formInfo" :model="formInfo"
> >
@ -39,6 +39,9 @@
<el-form-item label="类型编码:" prop="typeCode"> <el-form-item label="类型编码:" prop="typeCode">
<el-input v-model="formInfo.typeCode"></el-input> <el-input v-model="formInfo.typeCode"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="采集间隔(分钟)" prop="intervals">
<el-input v-model="formInfo.intervals"></el-input>
</el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="hide"> </el-button> <el-button @click="hide"> </el-button>
@ -170,7 +173,7 @@ export default {
.modevtypeAddBox { .modevtypeAddBox {
.modevtypeAddDialogBox { .modevtypeAddDialogBox {
.el-select { .el-select {
width: 376px; width: 356px;
} }
} }
} }

@ -20,6 +20,8 @@
<el-table-column prop="mc" label="设备名称"> </el-table-column> <el-table-column prop="mc" label="设备名称"> </el-table-column>
<el-table-column prop="tablename" label="表名"> </el-table-column> <el-table-column prop="tablename" label="表名"> </el-table-column>
<el-table-column prop="typeCode" label="类型编码"> </el-table-column> <el-table-column prop="typeCode" label="类型编码"> </el-table-column>
<el-table-column prop="intervals" label="采集间隔(分钟)">
</el-table-column>
<el-table-column label="操作" class-name="editClass"> <el-table-column label="操作" class-name="editClass">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link <el-link

@ -26,13 +26,22 @@
@click="submitUpload" @click="submitUpload"
>上传到服务器</el-button >上传到服务器</el-button
> >
<el-button <div class="grouprpt">
class="clearBtn" <el-button
size="small" class="clearBtn"
type="primary" size="small"
@click="clearAllicd" type="primary"
>清空全部文件</el-button @click="clearAllicd"
> >清空文件和配置</el-button
>
<el-button
class="clearBtn"
size="small"
type="primary"
@click="creatRpt"
>生成rptparamindex</el-button
>
</div>
</div> </div>
<div class="iedContain"> <div class="iedContain">
<div class="leftMenu" v-if="iedListData.length !== 0"> <div class="leftMenu" v-if="iedListData.length !== 0">
@ -152,6 +161,7 @@ import {
icdDeleteApi, icdDeleteApi,
tableListApi, tableListApi,
icdclearAllApi, icdclearAllApi,
generateRptApi,
} from "@/utils/api/index"; } from "@/utils/api/index";
import colDialog from "./colDialog.vue"; import colDialog from "./colDialog.vue";
export default { export default {
@ -373,6 +383,31 @@ export default {
}) })
.catch(() => {}); .catch(() => {});
}, },
//rptparamindex
creatRpt() {
generateRptApi()
.then((res) => {
console.log(res);
if (res.success) {
this.$message({
duration: 1500,
showClose: true,
message: res.data,
type: "success",
});
} else {
this.$message({
duration: 1500,
showClose: true,
message: res.errorMsg,
type: "error",
});
}
})
.catch((err) => {
console.log(err); //
});
},
}, },
}; };
</script> </script>
@ -433,9 +468,11 @@ export default {
} }
.uploadBtn { .uploadBtn {
} }
.clearBtn { .grouprpt {
margin-left: auto; margin-left: auto;
} }
// .clearBtn {
// }
} }
.iedContain { .iedContain {
width: 100%; width: 100%;

@ -0,0 +1,140 @@
<template>
<div class="iceConfig">
<div class="cardBox">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span> IEC服务器状态</span>
</div>
<div class="concard">
<p>端口{{ port }}</p>
<p>
服务器状态
<el-tag type="success" v-if="serverStatus"></el-tag>
<el-tag type="danger" v-else></el-tag>
</p>
<el-switch
v-model="serverVal"
active-text="服务器开启"
inactive-text="服务器关闭"
active-color="#13ce66"
inactive-color="#ff4949"
@change="changeStatus"
>
</el-switch>
</div>
</el-card>
</div>
</div>
</template>
<script>
import {
serverstartApi,
serverstatusApi,
serverstopApi,
} from "@/utils/api/index";
export default {
components: {},
data() {
return {
port: "",
serverStatus: false,
serverVal: true,
};
},
mounted() {
this.geticeStatus(); //iedName
},
methods: {
//ice
geticeStatus() {
serverstatusApi()
.then((res) => {
if (res.success) {
console.log(res);
this.port = res.data.port;
this.serverStatus = res.data.started;
this.serverVal = res.data.started;
} else {
this.$message({
duration: 1500,
showClose: true,
message: res.errorMsg,
type: "error",
});
}
})
.catch((err) => {
console.log(err); //
});
},
changeStatus() {
console.log(this.serverVal);
if (this.serverVal) {
serverstartApi()
.then((res) => {
if (res.success) {
console.log(res);
this.geticeStatus();
} else {
this.$message({
duration: 1500,
showClose: true,
message: res.errorMsg,
type: "error",
});
}
})
.catch((err) => {
console.log(err); //
});
} else {
serverstopApi()
.then((res) => {
if (res.success) {
console.log(res);
this.geticeStatus();
} else {
this.$message({
duration: 1500,
showClose: true,
message: res.errorMsg,
type: "error",
});
}
})
.catch((err) => {
console.log(err); //
});
}
},
},
};
</script>
<style lang="less">
.iceConfig {
width: calc(100% - 24px);
overflow-x: hidden;
background: rgba(8, 9, 36, 0.28);
box-shadow: inset 0 4px 44px 0 #106cde;
padding: 0px 12px;
height: 100%;
.cardBox {
width: 260px;
margin-top: 20px;
.el-card__header {
padding: 12px;
}
.el-card__body {
padding: 12px;
}
p {
&:nth-child(2) {
margin-top: 12px;
margin-bottom: 12px;
}
}
}
}
</style>

@ -1,12 +1,7 @@
<template> <template>
<div class="paramBindingBox"> <div class="paramBindingBox">
<div class="leftTree"> <div class="leftTree">
<h3> <h3>设备列表</h3>
设备列表
<el-button type="primary" @click="generate" size="mini"
>生成rptparamindex</el-button
>
</h3>
<div class="treeBox"> <div class="treeBox">
<div class="searchBar"> <div class="searchBar">
<el-input <el-input
@ -46,7 +41,12 @@
<div class="paramTable"> <div class="paramTable">
<div class="paramHead"> <div class="paramHead">
<h3>icd参数绑定</h3> <h3>icd参数绑定</h3>
<el-button @click="clearAllBind" type="primary"> 全部解绑 </el-button> <div class="groupgen">
<el-button @click="clearAllBind" type="primary"> 全部解绑 </el-button>
<el-button type="primary" @click="generate" size="mini"
>更新rptparamindex</el-button
>
</div>
</div> </div>
<div class="paramContain"> <div class="paramContain">
<div class="headSelect"> <div class="headSelect">
@ -138,7 +138,7 @@ import {
previewApi, previewApi,
bindApi, bindApi,
unbindApi, unbindApi,
generateParamindexApi, updateParamindexApi,
paramclearAllApi, paramclearAllApi,
} from "@/utils/api/index"; } from "@/utils/api/index";
export default { export default {
@ -359,7 +359,7 @@ export default {
}); });
}, },
generate() { generate() {
generateParamindexApi() updateParamindexApi()
.then((res) => { .then((res) => {
console.log(res); console.log(res);
if (res.success) { if (res.success) {

Loading…
Cancel
Save