view

code

list.css

:host {
display: flex;
width: 100%;
border-left: 1px solid #ccc;
font: normal 12px/20px \5B8B\4F53, Arial, Verdana, Lucida, Helvetica, simsun, sans-serif;
}
ul {
margin:;
padding:;
}
.version-container {
width: 100%;
overflow-x: hidden;
overflow-y: auto;
padding-bottom: 20px;
font-family: "Microsoft YaHei",Avenir,Helvetica,Verdana,Hiragino Sans GB,STHeiti,WenQuanYi Micro Hei,Droid Sans Fallback,SimSun,sans-serif;
position: relative;
color: #666666;
padding: 12px 0 0 25px;
}
.version-container .title {
font-size: 20px;
line-height: 36px;
text-shadow: 0 0 3px #DFDFDF;
}
.version-container .sub_title {
margin-top: 11px;
font-size: 14px;
}
.version-container .sub_title,
.version-container .title {
font-weight: bold;
color: #666666;
}
.fxc-monitorchart-container .list {
list-style: none;
margin:;
padding:;
}
.fxc-monitorchart-container li {
line-height: 20px;
width: 90%;
font-size: 10px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.fxc-monitorchart-container .description {
width: 100%;
text-overflow: ellipsis;
white-space: normal;
word-wrap: break-word;
}
.fxc-monitorchart-container li > span.app-sec-item {
width: 30%;
display: inline-block;
float: right;
text-align: left;
}
.fxc-monitorchart-container li > span.app-fir-item {
width: 45%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.version-desc {
padding-left: 15px;
overflow: hidden;
text-overflow: ellipsis;
height: 80px;
}
.version-desc li {
list-style: disc;
width: 100%;
white-space: normal;
overflow: hidden;
text-overflow: ellipsis;
}
.version-dot {
font-weight: bold;
float: left;
margin-right: 10px;
}
.fxc-monitorchart-clickable {
cursor: pointer;
}
.fxc-monitorchart-chart-multiple {
height: 270px;
max-width: 48%;
min-width: 48%;
float:left;
}
.fxc-monitorchart-chart-wrapper {
padding: 10px;
position: relative;
box-sizing: border-box;
}
.fxc-monitorchart-chart-multiple .fxc-monitorchart-chart {
padding: 15px;
border: 1px solid #d6d6d6;
box-sizing: border-box;
}
.fxc-monitorchart-chart {
height: 100%;
width: 100%;
}
.fxc-monitorchart-header {
display: flex;
display: -webkit-flex;
-webkit-flex-flow: row nowrap;
flex-flow: row nowrap;
height: 47px;
flex: none;
}
.fxc-monitorchart-title-container {
-webkit-flex: 1 1 0%;
flex: 1 1 0%;
}
.fxc-monitorchart-title {
font-size: 14px;
line-height: 17px;
padding-bottom: 1px;
}
.fxc-monitorchart-subtitle, .fxc-monitorchart-title {
margin:;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.fxc-monitorchart-subtitle {
font-family: az_ea_font,wf_segoe-ui_semibold,"Segoe UI Semibold","Segoe WP Semibold","Segoe UI","Segoe WP",Tahoma,Arial,sans-serif;
font-size: 10px;
line-height: 10px;
margin-top: 3px;
}
.fxs-mode-light .azc-fill-text {
fill: #252525;
}
.fxc-monitorchart-toolbar-item {
height: 18px;
width: 18px;
padding: 5px;
float: right;
display: block;
}
.fxc-monitorchart-container {
height:100%;
}
.fxs-contextMenu-small {
width:100px;
}
.ext-hubs-browse-empty {
text-align:center;
margin-top:30px;
}
.ext-hubs-browse-emptytitle {
font-size: 15px;
line-height: 20px
}
.ext-hubs-browse-emptytext {
margin-bottom: 15px;
}
.selected-blue-box {
border: 1px solid #0078d7 !important;
}
.arrow {
width:;
height:;
border-top: 18px solid transparent;
border-bottom: 18px solid transparent;
border-left: 18px solid #0078d7;
transform-origin: center;
transform: rotate(45deg);
-webkit-transform: rotate(45deg);
position:absolute;
bottom:-1px;
right:8px;
}
.arrow::before {
content: '';
display: block;
width: 5px;
height: 10px;
border: solid #fff;
border-width: 0 3px 3px 0;
transform-origin: center;
transform: translate(-16px, -8px) scale(.7);
-webkit-transform: translate(-16px, -8px) scale(.7);
-ms-transform: translate(-16px, -8px) scale(.7);
-moz-transform: translate(-16px, -8px) scale(.7);
-o-transform: translate(-16px, -8px) scale(.7);
}

list.html

<panel-component [menuItems]="menuItems" headerTitle="{{currApp.displayName}}/{{currPkg.version}}" initWidth="600px" (closeEvent)="onClose()">
<div class="version-container" (click)="activeContextMenu(null,false,null)" (scroll)="activeContextMenu(null,false,null)">
<div class="main">
<h1 class="title">{{currPkg.version}}</h1>
<p>时间:{{currPkg.createdAt | date: 'yyyy-MM-dd hh:mm:ss'}}</p>
<p>端口:{{currPkg.ports}}</p>
<div class="description">
描述:{{currPkg.description}}
</div>
</div>
<h2 class="sub_title">部署应用</h2>
<!--列表信息-->
<div class="fxc-monitorchart-chart-wrapper fxc-monitorchart-chart-multiple" *ngFor="let app of lstApp;let i = index;">
<div class="fxc-monitorchart-chart" [ngClass]="{'selected-blue-box':app.isChecked}" (click)="onCheck(i)">
<div class="fxc-monitorchart-header">
<div class="fxc-monitorchart-title-container">
<h3 class="fxc-monitorchart-title msportalfx-tooltip-overflow">{{app.displayName}}</h3>
<a href="https://sflinux.china-inv.cn:19080" target="_blank" class="fxc-monitorchart-subtitle msportalfx-tooltip-overflow">https://sflinux.china-inv.cn:19080</a>
</div>
<div class="fxc-monitorchart-toolbar-container">
<div (click)="activeContextMenu($event,true,app.id)" class="fxc-monitorchart-toolbar-item azc-fill-text fxs-portal-hover fxc-monitorchart-toolbar-pin" role="button" title="单击以打开上下文菜单">
<svg height="100%" width="100%" aria-hidden="true" role="presentation" focusable="false"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#FxSymbol0-013"></use></svg>
</div>
</div>
</div>
<div class="fxc-monitorchart-container">
<ul>
<li>App Id:{{app.name}}</li>
<li>级别:{{getDictLabel(lstLevel,app.level)}}<span class="app-sec-item">状态:{{app.status}}</span></li>
<li>端口号:<span class="app-fir-item">{{getJsonValues(app.ports)}}</span><span class="app-sec-item">实例数:{{app.instanceCount}}</span></li>
<li>时间:{{app.createdAt | date: 'yyyy-MM-dd hh:mm:ss'}}</li>
<li>
描述:
<ul class="version-desc" *ngIf="app.description">
<li *ngFor="let desc of app.description.split(';')"><i class="version-dot">·</i>{{desc}}</li>
</ul>
</li>
</ul>
</div>
<div *ngIf="app.isChecked" class="arrow"></div>
</div>
</div> <div class="fxs-commands-contextMenu fxs-contextMenu fxs-popup fxs-portal-bg-txt-br fxs-contextMenu-small" [ngClass]="{'fxs-contextMenu-active' : isActiveMenu}" [ngStyle]="{'top.px': menuTop,'left.px': menuLeft}">
<ul role="menu" class="fxs-contextMenu-itemList" aria-label="上下文菜单">
<li role="menuitem" class="fxs-contextMenu-item fxs-portal-hover" tabindex="0" aria-posinset="1" aria-setsize="1" (click)="removeCurApp()">
<div class="fxs-contextMenu-text fxs-portal-text msportalfx-text-ellipsis">删除</div>
</li>
<li role="menuitem" class="fxs-contextMenu-item fxs-portal-hover" tabindex="0" aria-posinset="1" aria-setsize="1">
<a class="fxs-contextMenu-text fxs-portal-text msportalfx-text-ellipsis" target="_blank" href="https://sflinux.china-inv.cn:19080">管理</a>
</li>
</ul>
</div> <div *ngIf="lstApp.length<=0" class="ext-hubs-browse-empty msportalfx-font-semilight">
<div class="ext-hubs-browse-emptyicon msportalfx-svg-disabled">
<svg aria-hidden="true" focusable="false" height="100%" width="100%">
<use xlink:href="#FxSymbol0-016" xmlns:xlink="http://www.w3.org/1999/xlink"></use>
</svg>
</div>
<h2 class="ext-hubs-browse-emptytitle">没有可显示的部署应用程序</h2>
<div class="ext-hubs-browse-emptytext"><span>如果看不到任何内容信息,请尝试刷新操作。</span></div>
<div class="fxc-base fxc-simplebutton" (click)="onOpenDpy()">
<div class="fxs-button fxt-button fxs-portal-button-primary fxs-inner-dotted-border" role="button" tabindex="0" title="创建新的应用部署">
<span class="fxs-button-text" data-bind="text: data.text">创建新的应用部署</span>
</div>
</div>
</div>
</div>
</panel-component>
<router-outlet></router-outlet>

list.ts

import { Component} from '@angular/core';
import { Router, ActivatedRoute, Params } from '@angular/router';
import { AppStoreService } from '../service/appStoreService';
import { CommonService } from '../../providers/commonService'; @Component({
selector: 'version-page',
templateUrl: './version.html',
styleUrls: ['./version.css']
}) export class VersionPage { constructor(
private router: Router,
private actRouter: ActivatedRoute,
private appStoreService: AppStoreService,
private comService: CommonService) {
this.subscribeUpdate(comService);
} id: string;
pkgId: any;
lstLevel: {} = [
{
"key": 0,
"value": "高"
},
{
"key": 1,
"value": "中"
},
{
"key": 2,
"value": "低"
}
];
currApp: any = {
displayName:''
};
currPkg: any = {
description: '',
appId: '',
version: '',
status: '',
ports: '',
createdAt:''
};
currId: string;
lstApp:any[] = [];
isActiveMenu: boolean = false;
menuTop: any;
menuLeft: any;
parentUrl: string;
menuItems: any = [
{ title: "创建新部署", icon: "#FxSymbol0-010", event: this.onOpenDpy.bind(this) },
{ title: "审核", icon: "#FxSymbol0-077", event: this.auditWebDpy.bind(this) },
{ title: "刷新部署应用", icon: "#FxSymbol0-0c4", event: this.loanDpyApp.bind(this, this.pkgId) }
]
ngOnInit(): void {
this.actRouter.params.subscribe((params: Params) => {
this.id = params["id"] || this.id;
this.pkgId = params["pkgId"] || this.pkgId;
this.appStoreService.GetPkgOne(this.pkgId, (rtv) => {
this.currPkg = rtv;
});
this.appStoreService.GetAppOne(this.id, (rtv) => {
this.currApp = rtv;
});
this.parentUrl = "/webAppStore/" + this.id;
this.loanDpyApp(this.pkgId);
});
}
onClose() {
this.router.navigate([this.parentUrl]);
}
onOpenDpy() {
this.router.navigate([this.parentUrl + '/version/deploy', { id: this.id, pkgId: this.pkgId }]);
}
activeContextMenu(event: any, isActive: boolean, id: string) {
this.isActiveMenu = isActive;
if (event) {
this.menuLeft = event.pageX - 20;
this.menuTop = event.pageY - 10;
event.stopPropagation();
}
this.currId = id;
}
loanDpyApp(id: string) {
this.appStoreService.GetAppDpyList(id || this.pkgId,(rtv) => {
this.lstApp = rtv;
});
}
subscribeUpdate(comService: CommonService) {
this.comService.notifyObservable$.subscribe(data => {
if (data && data.action == 'refreshWebDpy') {
this.loanDpyApp(data.pkgId);
}
}, error => {
console.log(`subscribe error:${error}`)
})
}
removeCurApp() {
let _this = this;
this.currId && this.appStoreService.DeleteDpy(this.currId, (result) => {
_this.loanDpyApp(_this.pkgId)
})
}
getDictLabel(dict: any, key: any) {
if (dict && dict.length > 0) {
let curItem = dict.filter(item => { return item.key == key });
return curItem.length > 0 ? curItem[0].value : '';
}
}
getJsonValues(dict: any) {
let jsonObject: any = dict && JSON.parse(dict) || {};
return jsonObject.map(obj => { return obj.app }).join(',');
}
auditWebDpy() {
this.router.navigate([this.parentUrl + '/version/dpyAudit', { id: this.id }]);
}
onCheck(index: any) {
this.lstApp[index].isChecked = !this.lstApp[index].isChecked;
}
}

【angular5项目积累总结】列表多选样式框(2)的更多相关文章

  1. 【angular5项目积累总结】列表多选样式框(1)

    憋不住想说一下:angular坑太多,各种教程各种不完整,官网还只是简单的画饼充饥,没办法只有自己研究自己总结,便于以后提高工作效率. 第一种: view      code list.css :ho ...

  2. 【angular5 项目积累总结】项目公共样式

    main.css @font-face { font-family: 'wf_segoe-ui_normal'; src: local('Segoe UI'),url('../fonts/segoe- ...

  3. 【angular5项目积累总结】遇到的一些问题以及解决办法

    1.项目中字符串特别是\r\n,替换成br之后,在页面换行无法生效? 答:绑定元素 innerHTML. <div class="panel-body" [innerHTML ...

  4. 【angular5项目积累总结】消息订阅服务

    code import { Injectable } from '@angular/core'; import { Subject } from 'rxjs/Subject'; @Injectable ...

  5. 【angular5项目积累总结】优秀组件以及应用实例

    1.手机端 图片预览组件 组件:sideshow 效果图:(预览图全屏 且可以左右移动)                  code: <div class="row ui-app-s ...

  6. 【angular5项目积累总结】表单复杂校验

    view code form.css :host { display: flex; width: 100%; height:100%; border-left:1px solid #ccc; } .i ...

  7. 【angular5项目积累总结】侧栏菜单 navmenu

    View Code import { Component, OnInit } from '@angular/core'; import { HttpClient } from '@angular/co ...

  8. 【angular5项目积累总结】avatar组件

    View Code import { Component, HostListener, ElementRef } from '@angular/core'; import { Adal4Service ...

  9. 【angular5项目积累总结】breadcrumb面包屑组件

    view code <div class="fxs-breadcrumb-wrapper" aria-label="Navigation history" ...

随机推荐

  1. (zxing.net)二维码QR Code的简介、实现与解码

    一.简介 二维码QR Code(Quick Response Code)是由Denso公司于1994年9月研制的一种矩阵二维码符号,它具有一维条码及其它二维条码所具有的信息容量大.可靠性高.可表示汉字 ...

  2. [C#]C#中ToString()和Convert.ToString()的区别

    一.一般用法说明 ToString()是Object的扩展方法,所以都有ToString()方法;而Convert.ToString(param)(其中param参数的数据类型可以是各种基本数据类型, ...

  3. WPF 新手引导

    参考了https://www.cnblogs.com/ZXdeveloper/p/8391864.html,自己随便实现了一个,记录下,比较丑 <Window x:Class="Use ...

  4. c++实验5 顺序/链式队列

    链式队列及循环队列 1.循环队列的实现(请采用模板类及模板函数实现) [实现提示] 同时可参见教材p65-p67页的ADT描述及算法实现及ppt)函数.类名称等可自定义,部分变量请加上学号后3位.也可 ...

  5. 【OCP题库-12c】最新CUUG OCP 071考试题库(70题)

    70.(31-2)choose the best answer: View the Exhibit and examine the structure of the Book table. The B ...

  6. 如何自己写aspx过狗D盾一句话木马

    hi,我是凉风,(以下内容纯属个人见解,如有不同的意见欢迎回复指出) ,本菜比发现aspx过狗的姿势不常见,不像php一样一抓一大把,于是我决定研究一下aspx 本文作者:i春秋签约作家——凉风 引用 ...

  7. jquery源码解析:val方法和valHooks对象详解

    这一课,我们将讲解val方法,以及对value属性的兼容性处理,jQuery中通过valHooks对象来处理. 首先,我们先来看下val方法的使用: $("#input1").va ...

  8. tf入门-池化函数 tf.nn.max_pool 的介绍

    转载自此大神 http://blog.csdn.net/mao_xiao_feng/article/details/53453926 max pooling是CNN当中的最大值池化操作,其实用法和卷积 ...

  9. Python之机器学习K-means算法实现

    一.前言: 今天在宿舍弄了一个下午的代码,总算还好,把这个东西算是熟悉了,还不算是力竭,只算是知道了怎么回事.今天就给大家分享一下我的代码.代码可以运行,运行的Python环境是Python3.6以上 ...

  10. 架构师养成记--31.Redis的几种类型

    String类型 Redis一共分为五种基本数据类型:String.Hash.List.Set.ZSet String类型是包含很多张类型的特殊类型,并且是二进制安全的.比如对序列化的对象进行存储,比 ...