|
@@ -1,11 +1,12 @@
|
|
<template>
|
|
<template>
|
|
- <div class="container">
|
|
|
|
|
|
+ <div class="container" v-loading.fullscreen.lock="fullscreenLoading">
|
|
<div class="header">
|
|
<div class="header">
|
|
<div class="searchInputDiv">
|
|
<div class="searchInputDiv">
|
|
<el-input
|
|
<el-input
|
|
placeholder="搜索系统实例"
|
|
placeholder="搜索系统实例"
|
|
prefix-icon="el-icon-search"
|
|
prefix-icon="el-icon-search"
|
|
v-model="searchVal"
|
|
v-model="searchVal"
|
|
|
|
+ @input="searchInputChange"
|
|
>
|
|
>
|
|
</el-input>
|
|
</el-input>
|
|
</div>
|
|
</div>
|
|
@@ -16,34 +17,40 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="content">
|
|
<div class="content">
|
|
- <el-table :data="tableData" border style="width: 100%">
|
|
|
|
- <el-table-column prop="name" label="系统图名称"> </el-table-column>
|
|
|
|
- <el-table-column prop="type" label="系统类"> </el-table-column>
|
|
|
|
- <el-table-column prop="instanceName" label="系统实例名称">
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column prop="templateName" label="系统图模版">
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column prop="state" label="状态"> </el-table-column>
|
|
|
|
- <el-table-column prop="createTime" label="创建时间"> </el-table-column>
|
|
|
|
- <el-table-column label="操作" width="100">
|
|
|
|
- <template>
|
|
|
|
- <el-button type="text" size="small">预览</el-button>
|
|
|
|
- <el-button type="text" size="small">编辑</el-button>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- </el-table>
|
|
|
|
- <el-pagination
|
|
|
|
- background
|
|
|
|
- v-if="dataCount > 0"
|
|
|
|
- @size-change="handlePageSizeChange"
|
|
|
|
- @current-change="handleCurrentPageChange"
|
|
|
|
- :current-page="currentPage"
|
|
|
|
- :page-sizes="[20, 30, 50, 100]"
|
|
|
|
- :page-size="pageSize"
|
|
|
|
- layout="total, prev, pager, next, sizes"
|
|
|
|
- :total="dataCount"
|
|
|
|
- >
|
|
|
|
- </el-pagination>
|
|
|
|
|
|
+ <div class="tableContainer">
|
|
|
|
+ <el-table :data="graphArr" border style="width: 100%">
|
|
|
|
+ <el-table-column prop="name" label="系统图名称"> </el-table-column>
|
|
|
|
+ <el-table-column prop="sysType" label="系统类"> </el-table-column>
|
|
|
|
+ <el-table-column prop="sysInstance" label="系统实例名称">
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="sysTemplate" label="系统图模版">
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="stateName" label="状态"> </el-table-column>
|
|
|
|
+ <el-table-column prop="createTime" label="创建时间">
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="操作" width="100">
|
|
|
|
+ <template>
|
|
|
|
+ <el-button type="text" size="small">预览</el-button>
|
|
|
|
+ <el-button type="text" size="small">编辑</el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div class="pageContainer">
|
|
|
|
+ <el-pagination
|
|
|
|
+ background
|
|
|
|
+ v-if="dataCount > 0"
|
|
|
|
+ @size-change="handlePageSizeChange"
|
|
|
|
+ @current-change="handleCurrentPageChange"
|
|
|
|
+ :current-page="currentPage"
|
|
|
|
+ :page-sizes="[20, 30, 50, 100]"
|
|
|
|
+ :page-size="pageSize"
|
|
|
|
+ layout="total, prev, pager, next, sizes"
|
|
|
|
+ :total="dataCount"
|
|
|
|
+ >
|
|
|
|
+ </el-pagination>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -51,6 +58,7 @@
|
|
import { mapState } from "vuex";
|
|
import { mapState } from "vuex";
|
|
import { logicConfig } from "@/logicConfig";
|
|
import { logicConfig } from "@/logicConfig";
|
|
import packageConfig from "../../../package.json";
|
|
import packageConfig from "../../../package.json";
|
|
|
|
+import { sysGraphController } from "@/controller/sysGraphController";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
props: [],
|
|
props: [],
|
|
@@ -58,7 +66,10 @@ export default {
|
|
return {
|
|
return {
|
|
//搜索关键字
|
|
//搜索关键字
|
|
searchVal: "",
|
|
searchVal: "",
|
|
- tableData: [],
|
|
|
|
|
|
+ //后台返回的所有的数据
|
|
|
|
+ allGraphArr: [],
|
|
|
|
+ //用于表格内绑定
|
|
|
|
+ graphArr: [],
|
|
//当前页码
|
|
//当前页码
|
|
currentPage: 1,
|
|
currentPage: 1,
|
|
//每页条数
|
|
//每页条数
|
|
@@ -67,8 +78,9 @@ export default {
|
|
dataCount: 0,
|
|
dataCount: 0,
|
|
//进入编辑页面时的状态 0 预览; 1 编辑; 2 新建
|
|
//进入编辑页面时的状态 0 预览; 1 编辑; 2 新建
|
|
state: 0,
|
|
state: 0,
|
|
- //系统图ID
|
|
|
|
- diagramId: "",
|
|
|
|
|
|
+ //选择的某一个系统图
|
|
|
|
+ selDiagram: {},
|
|
|
|
+ fullscreenLoading: true,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -76,9 +88,16 @@ export default {
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
//每页条数改变
|
|
//每页条数改变
|
|
- handlePageSizeChange: function () {},
|
|
|
|
|
|
+ handlePageSizeChange: function (pageSize) {
|
|
|
|
+ this.currentPage = 1;
|
|
|
|
+ this.pageSize = pageSize;
|
|
|
|
+ this.getCurrPageData();
|
|
|
|
+ },
|
|
//页码改变
|
|
//页码改变
|
|
- handleCurrentPageChange: function () {},
|
|
|
|
|
|
+ handleCurrentPageChange: function (currentPage) {
|
|
|
|
+ this.currentPage = currentPage;
|
|
|
|
+ this.getCurrPageData();
|
|
|
|
+ },
|
|
//新建系统图
|
|
//新建系统图
|
|
createSystemGraph: function () {
|
|
createSystemGraph: function () {
|
|
this.state = 2;
|
|
this.state = 2;
|
|
@@ -89,12 +108,40 @@ export default {
|
|
"?ost=" +
|
|
"?ost=" +
|
|
this.state +
|
|
this.state +
|
|
"&did=" +
|
|
"&did=" +
|
|
- this.diagramId
|
|
|
|
|
|
+ (this.selDiagram.id || "")
|
|
);
|
|
);
|
|
},
|
|
},
|
|
- },
|
|
|
|
- created() {},
|
|
|
|
|
|
+ //从allGraphArr中取出对应页数的数据
|
|
|
|
+ getCurrPageData: function () {
|
|
|
|
+ var startIndex = (this.currentPage - 1) * this.pageSize;
|
|
|
|
+ var endIndex = startIndex + this.pageSize;
|
|
|
|
+ this.graphArr = this.allGraphArr.slice(startIndex, endIndex);
|
|
|
|
+ },
|
|
|
|
+ //关键词输入框输入改变事件
|
|
|
|
+ searchInputChange: function () {
|
|
|
|
+ this.currentPage = 1;
|
|
|
|
+ this.getData();
|
|
|
|
+ },
|
|
|
|
+ //查询数据
|
|
|
|
+ getData: async function () {
|
|
|
|
+ try {
|
|
|
|
+ this.allGraphArr = await sysGraphController.getDiagrams(this.searchVal);
|
|
|
|
+ this.dataCount = this.allGraphArr.length;
|
|
|
|
+ this.getCurrPageData();
|
|
|
|
|
|
|
|
+ this.fullscreenLoading = false;
|
|
|
|
+ } catch (error) {
|
|
|
|
+ console.error(error);
|
|
|
|
+ this.allGraphArr = [];
|
|
|
|
+ this.graphArr = [];
|
|
|
|
+ this.dataCount = 0;
|
|
|
|
+ this.fullscreenLoading = false;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ created() {
|
|
|
|
+ this.getData();
|
|
|
|
+ },
|
|
mounted() {},
|
|
mounted() {},
|
|
components: {},
|
|
components: {},
|
|
};
|
|
};
|
|
@@ -104,6 +151,7 @@ export default {
|
|
.container {
|
|
.container {
|
|
display: flex;
|
|
display: flex;
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
|
|
+ background: #ffffff;
|
|
}
|
|
}
|
|
|
|
|
|
.header {
|
|
.header {
|
|
@@ -114,6 +162,7 @@ export default {
|
|
|
|
|
|
.content {
|
|
.content {
|
|
flex: 1;
|
|
flex: 1;
|
|
|
|
+ overflow: hidden;
|
|
}
|
|
}
|
|
|
|
|
|
.searchInputDiv {
|
|
.searchInputDiv {
|
|
@@ -127,4 +176,14 @@ export default {
|
|
height: 100%;
|
|
height: 100%;
|
|
display: inline-block;
|
|
display: inline-block;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+.tableContainer {
|
|
|
|
+ height: calc(100% - 148px);
|
|
|
|
+ overflow: auto;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.pageContainer {
|
|
|
|
+ margin-top: 66px;
|
|
|
|
+ margin-bottom: 50px;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|