Commit 3a91eaa3 authored by 张伯涛's avatar 张伯涛

修改

parent a7928ba4
......@@ -14,13 +14,19 @@
:expand-row-keys="expand"
:tree-props="{children: 'child'}"
>
<el-table-column label="公司" prop="company" show-overflow-tooltip />
<el-table-column label="公司" prop="company" show-overflow-tooltip>
<template slot-scope="scope">
<img v-if="scope.row.noIcon !== '1'" :src="scope.row.icon" class="name-icon">
<span v-if="scope.row.noIcon === '1' " class="square-green" />
<span>{{ scope.row.company }}</span>
</template>
</el-table-column>
<el-table-column label="类型" prop="type" show-overflow-tooltip />
<el-table-column width="300px" label="操作">
<!-- <template slot-scope="scope">-->
<el-link @click="addGroup">添加逻辑组</el-link>
<el-link @click="addWarn">添加告警</el-link>
<!-- <el-link @click="addObject">添加对象</el-link>-->
<el-link @click="addObject">添加对象</el-link>
<el-link @click="addGroup">编辑</el-link>
<el-link @click="deleteRow">移除</el-link>
<!-- </template>-->
......@@ -138,6 +144,33 @@
<el-button @click="closeAddDialog">取消</el-button>
</span>
</el-dialog>
<el-dialog class="addWarnClass" width="50%" title="告警添加" :visible.sync="objectDialog">
<el-form v-if="stepActive === 1" ref="addForm" style="width: 100%;height: 300px" label-width="auto" :model="addForm">
<el-form-item label=" ">
<div class="treebody">
<el-tree
:data="dataTree"
show-checkbox
node-key="id"
:default-expanded-keys="[1, 3]"
:default-checked-keys="[5]"
:props="defaultProps"
>
<template slot-scope="{ node, data }">
<span>
<img :src="data.icon" class="treeIcon">
<label>{{ node.label }}</label>
</span>
</template>
</el-tree>
</div>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="closeObjectDialog">确定</el-button>
<el-button @click="closeObjectDialog">取消</el-button>
</span>
</el-dialog>
</div>
</template>
......@@ -148,6 +181,39 @@ export default {
name: 'LogicalGroup',
data() {
return {
dataTree: [{
id: 1,
icon: require('@/assets/image/shebei.png'),
label: '本机容器',
children: [{
id: 11,
icon: require('@/assets/image/shebei9-guzhang.png'),
label: '虚拟化平台',
children: [{
id: 111,
icon: require('@/assets/image/shebei2-zhengchang.png'),
label: '三级 1-1-1'
}, {
id: 112,
icon: require('@/assets/image/shebei2-zhengchang.png'),
label: '三级 1-1-2'
}]
},
{
id: 12,
icon: require('@/assets/image/shebei9-weixian.png'),
label: '虚拟设备(默认每个设备支持5个监测点)',
children: [{
id: 121,
icon: require('@/assets/image/shebei2-guzhang.png'),
label: '三级 1-1-1'
}, {
id: 122,
icon: require('@/assets/image/shebei2-guzhang.png'),
label: '三级 1-1-2'
}]
}]
}],
defaultProps: {
children: 'children',
label: 'label'
......@@ -210,22 +276,23 @@ export default {
},
stepActive: 1,
addWarnDialog: false,
objectDialog: false,
addgroupForm: {
groupName: ''
},
addGroupDialog: false,
dataList: [
{ id: '1', company: '公司', type: '公司',
{ id: '1', icon: require('@/assets/image/gongsi-zhengchang.png'), company: '公司', type: '公司',
child: [
{ id: '11', company: '中国联通', type: '逻辑组',
{ id: '11', icon: require('@/assets/image/liantong-zhengchang.png'), company: '中国联通', type: '逻辑组',
child: [
{ id: '111', company: '服务器硬件', type: '',
{ id: '111', icon: require('@/assets/image/shebei9-zhengchang.png'), company: '服务器硬件', type: '',
child: [
{ id: '1111', company: '云打印服务器-硬件', type: '' }
{ id: '1111', icon: require('@/assets/image/shebei2-zhengchang.png'), company: '云打印服务器-硬件', type: '' }
] },
{ id: '112', company: '云打印服务器-硬件', type: '',
{ id: '112', icon: require('@/assets/image/shebei2-zhengchang.png'), company: '云打印服务器-硬件', type: '',
child: [
{ id: '1121', company: 'Power Supply -PS 2 Presence-0045', type: '' }
{ id: '1121', noIcon: '1', company: 'Power Supply -PS 2 Presence-0045', type: '' }
] }
] }
] }
......@@ -254,6 +321,12 @@ export default {
nextStep() {
if (this.stepActive++ > 2) this.stepActive = 1
},
closeObjectDialog() {
this.objectDialog = false
},
addObject() {
this.objectDialog = true
},
addWarn() {
this.stepActive = 1
this.addWarnDialog = true
......@@ -264,6 +337,13 @@ export default {
addGroup() {
this.addGroupDialog = true
},
deleteRow() {
this.$confirm('此操作将删除该数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {})
},
handleExpandList() {
this.expand.push(this.dataList[0].id)
},
......@@ -290,6 +370,21 @@ export default {
.strategyRow{
padding: 5px 0;
}
.logicalBody{
.name-icon{
width: 20px;
height: 20px;
position: relative;
top: 5px;
}
.square-green{
background-color: #3db58d;
margin-right: 6px;
width: 9px;
height: 9px;
display: inline-block;
}
}
.logicalHead{
height: 58px;
padding: 15px 20px 10px 20px;
......
......@@ -186,7 +186,7 @@ export default {
{
id: 12,
icon: require('@/assets/image/shebei9-weixian.png'),
label: '虚拟化平台',
label: '虚拟设备(默认每个设备支持5个监测点)',
children: [{
id: 121,
icon: require('@/assets/image/shebei2-guzhang.png'),
......
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