Commit bd4560ea authored by wangqinghua's avatar wangqinghua

login

parent b7bcd648
......@@ -559,7 +559,7 @@
style="height: 580px;width: 100%;">
您的浏览器不支持HTML5!
</canvas>
<span>{{topoType}}</span>
<span class="tips">{{topoType}}</span>
</div>
</div>
</div>
......
......@@ -24,6 +24,13 @@ declare let layui: any;
margin-right: 15px;
cursor: pointer;
}
.tips{
position: absolute;
top: 10px;
left: 20px;
color: #ca0814;
font-size: 20px;
}
`
]
})
......@@ -35,7 +42,7 @@ export class NeTopologyComponent implements OnInit {
image;
topoId;
name;
topoType = '查看';
topoType = '只读模式';
constructor(private topologySer: TopologyService, private message: NzMessageService,
private sanitizer: DomSanitizer, private modalSer: NzModalService) {
......@@ -51,17 +58,19 @@ export class NeTopologyComponent implements OnInit {
//新增拓扑图
addTopo() {
this.topoType = '新增';
this.topoType = '添加模式';
this.message.info('添加模式');
editor.utils.clearTopology();
}
//编辑拓扑图
editTopo() {
if(!this.topoId){
this.message.info("请选择需要编辑的拓扑图")
this.message.info("请选择需要编辑的拓扑图");
return false;
}
this.topoType = '编辑';
this.topoType = '编辑模式';
this.message.info('编辑模式');
editor.utils.editTopology();
}
......@@ -79,7 +88,7 @@ export class NeTopologyComponent implements OnInit {
}
save() {
if (this.topoType == '新增') {
if (this.topoType == '添加模式') {
this.create();
} else {
this.update();
......@@ -101,6 +110,7 @@ export class NeTopologyComponent implements OnInit {
(res) => {
if (res.errCode == 10000) {
this.message.info('创建成功');
editor.utils.normalTopology();
this.getList();
} else {
this.message.info(res.errMsg);
......@@ -124,6 +134,7 @@ export class NeTopologyComponent implements OnInit {
(res) => {
if (res.errCode == 10000) {
this.message.info('编辑成功');
editor.utils.normalTopology();
this.getList();
} else {
this.message.info(res.errMsg);
......@@ -134,13 +145,14 @@ export class NeTopologyComponent implements OnInit {
//查询单个
getDetail(id) {
editor.utils.clearTopology();
this.topologySer.findItem(id).subscribe(
(res) => {
if (res.errCode == 10000) {
let json = JSON.parse(res.data.json);
this.name = res.data.name;
this.topoId = res.data.id;
editor.utils.normalTopology();
this.topoType = '只读模式';
editor.loadTopologyByJson(json, 'img/backimg.png');
}
}
......
......@@ -149,12 +149,12 @@
<nz-table #checkTable [nzData]="checkList" [nzFrontPagination]="false" [nzTotal]="totalNum" [nzPageIndex]="pageIndex" [nzPageSize]="pageSize" (nzPageIndexChange)="change($event)" [nzLoading]="loading">
<thead>
<tr>
<th nzWidth="350px">监测点名称</th>
<th nzWidth="150px">最新数据</th>
<th>最新数据时间</th>
<th nzWidth="250px">监测点名称</th>
<th >最新数据</th>
<th nzWidth="250px">最新数据时间</th>
<th>监测点分类</th>
<th>更新时间间隔</th>
<th>来源</th>
<!--<th>来源</th>-->
<th>图表</th>
<th>操作</th>
</tr>
......@@ -162,11 +162,11 @@
<tbody>
<tr *ngFor="let data of checkTable.data">
<td>{{data.name}}</td>
<td>{{data.lastclock}}</td>
<td>{{data.lastvalue}}</td>
<td>{{data.lastclock}}</td>
<td>{{data.itemType}}</td>
<td>{{data.delay}}</td>
<td>{{data.source}}</td>
<!--<td>{{data.source}}</td>-->
<td class="cursor">
<span (click)="showImageModal(data)">图表</span>
</td>
......
......@@ -1043,12 +1043,10 @@ var editor = new TopologyEditor('mainControl')
editor.utils = {
// 编辑模式
editTopology: function () {
alert("编辑模式")
editor.utils.setEditMode();
},
// 取消编辑模式
normalTopology: function () {
alert("只读模式")
editor.utils.setNormalMode();
},
// 添加节点, 编辑模式下才能添加
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment