fix: dc列表、侧滑相关

1.列表增加assetStat
2.列表中asset、机柜放后,area放前
3.侧滑area弹框去掉复选框,去掉ok按钮
This commit is contained in:
陈劲松
2020-02-27 15:47:44 +08:00
parent 058eddd575
commit b51684b80b
6 changed files with 90 additions and 38 deletions

View File

@@ -389,7 +389,8 @@ const en = {
dc: 'Datacenter',
area: "Area",
selectArea: 'Select area',
cabinetNum: "Cabinet number"
cabinetNum: "Cabinet number",
assets: "Assets",
}
},
alert: {

View File

@@ -12,22 +12,24 @@
<div class="pop-title">{{$t('config.dc.selectArea')}}</div>
<div class="pop-item-wider">
<el-scrollbar class="select-area-tree">
<el-tree
ref="areaTree"
node-key="id"
class="select-area-tree"
:props="{label: 'name', children: 'children'}"
show-checkbox
:data="areaData"
default-expand-all
:expand-on-click-node="false"
check-on-click-node
check-strictly
:check-on-click-node="false"
@node-click="selectArea"
@check-change="clearOthers">
</el-tree>
</el-scrollbar>
</div>
<div class="">
<!--<div class="">
<button class="float-right nz-btn nz-btn-size-small nz-btn-style-normal nz-btn-min-width-60" type="button" @click="selectArea">{{$t('overall.ok')}}</button>
</div>
</div>-->
</div>
<div slot="reference">
<slot name="trigger">
@@ -63,7 +65,8 @@
this.popBox.show = false;
},
//确认选择某个节点,与父组件交互
selectArea() {
selectArea(data, checked, child) {
this.area = data;
this.$emit('selectArea', this.area);
this.esc();
},
@@ -84,6 +87,6 @@
<style>
.select-area-tree {
height: 300px;
height: 350px;
}
</style>

View File

@@ -2,6 +2,31 @@
.dc {
height: 100%;
}
.dc-asset-states {
display: flex;
align-items: center;
height: 100%;
}
.dc-asset-state {
display: inline-block;
min-width: 25px;
height: 20px;
color: white;
text-align: center;
line-height: 20px;
margin-right: 6px;
border-radius: 3px;
}
.dc-asset-state.dc-asset-state-total {
background-color: #1166bb;
margin-right: 15px
}
.dc-asset-state-in {
background-color: #90ee90;
}
.dc-asset-state-out {
background-color: orange;
}
</style>
<template>
<div class="dc">
@@ -66,6 +91,19 @@
<template v-if="scope.row.area">{{scope.row.area.name}}</template>
<template v-else>-</template>
</template>
<template v-else-if="item.prop == 'assetStat'">
<el-popover
placement="top"
trigger="hover"
:content="$t('overall.result.total') + '' + scope.row.assetStat.total + '' + $t('asset.createAssetTab.inStock') + '' + scope.row.assetStat.inStock + '' + $t('asset.createAssetTab.notInStock') + '' + scope.row.assetStat.outStock">
<div slot="reference" class="dc-asset-states">
<span class="dc-asset-state dc-asset-state-total">{{scope.row.assetStat.total}}</span>
<span class="dc-asset-state dc-asset-state-in">{{scope.row.assetStat.inStock}}</span>
<span class="dc-asset-state dc-asset-state-out">{{scope.row.assetStat.outStock}}</span>
</div>
</el-popover>
</template>
<template v-else-if="scope.row[item.prop]">{{scope.row[item.prop]}}</template>
<template v-else>-</template>
</template>
@@ -123,13 +161,21 @@
label: this.$t("overall.name"),
prop: 'name',
show: true,
}, {
label: this.$t('config.dc.area'),
prop: 'area',
show: true
}, {
label: this.$t("asset.createAssetTab.location"),
prop: 'location',
show: true,
}, {
label: this.$t("config.dc.cabinetNum"),
prop: 'cabinetNum',
show: true,
}, {
label: this.$t("asset.createAssetTab.location"),
prop: 'location',
label: this.$t("config.dc.assets"),
prop: 'assetStat',
show: true,
}, {
label: this.$t('asset.createAssetTab.tel'),
@@ -139,10 +185,6 @@
label: this.$t('asset.createAssetTab.principal'),
prop: 'principal',
show: true
}, {
label: this.$t('config.dc.area'),
prop: 'area',
show: true
}, {
label: this.$t('config.account.option'),
prop: 'option',

View File

@@ -76,13 +76,16 @@
<i class="nz-icon-create-square nz-icon"></i>
</button>
</div>
</div>
</div><!--<happy-scroll color="rgba(0,0,0,1)" size="15">-->
<!--<el-scrollbar style="height: 100%">-->
<div class="table-list" @scroll="onScroll" id="tableList">
<el-scrollbar style="height: 100%">
<div class="box-content">
<chart-list @on-edit-chart="editData" @on-refresh-time="refreshTime" @on-remove-chart="removeData"
ref="chartList"></chart-list>
</div>
</div>
</el-scrollbar>
</div><!--</happy-scroll>--><!--</el-scrollbar>-->
</div>
<panel-box :panel="panel" @reload="panelReload" @reloadForDel="panelReloadForDel" ref="panelBox"></panel-box>

View File

@@ -1,8 +1,8 @@
import axios from 'axios'
import router from './router'
import qs from 'qs'
import he from "element-ui/src/locale/lang/he"; //引入数据格式化
//import qs from 'qs'
//import he from "element-ui/src/locale/lang/he"; //引入数据格式化
//axios.defaults.baseURL = 'http://localhost:8088/nz-admin';
// axios.defaults.baseURL = 'http://192.168.41.101:8088/nz-admin';
//axios.defaults.baseURL = 'http://192.168.40.247:8080/nz-admin';
@@ -24,9 +24,10 @@ axios.interceptors.response.use(
response => {
if(response.status === 200){
if(response.data.code == 101007) {
router.push({
window.location.href = "/";
/*router.push({
path: "/login"
})
});*/
}
}
return response

View File

@@ -34,7 +34,9 @@ import moduleListPop from "./components/page/asset/moduleListPop"; //面板弹
import cabinetConfigBox from "./components/common/popBox/cabinetConfig"; //面板弹框组件
import dcBox from "./components/common/rightBox/dcBox"; //dc弹框
import selectArea from "./components/common/popBox/selectArea"; //dc弹框
/*import 'vue-happy-scroll/docs/happy-scroll.css'
import {HappyScroll} from 'vue-happy-scroll'
Vue.component('happy-scroll', HappyScroll)*/
Vue.component("Pagination", Pagination);
Vue.component("searchInput", searchInput);
@@ -73,7 +75,7 @@ const clickoutside = {
if (el.contains(e.target)) {
return false;
} else {
console.info(e)
//console.info(e)
let flag = true;
top: for (let i = 0; i < e.path.length; i++) {
for (let j = 0; j < exceptClassName.length; j++) {
@@ -125,7 +127,7 @@ window.vm = new Vue({
})
export default vm
router.beforeEach((to, from, next) => {
/*router.beforeEach((to, from, next) => {
if (to.path === '/login') {
next()
} else {
@@ -136,4 +138,4 @@ router.beforeEach((to, from, next) => {
next({ path: '/dashboard' })
}
}
})
})*/