2021-11-21 16:53:18 +08:00
|
|
|
<template>
|
|
|
|
<div class="property-group">
|
2021-12-05 18:21:00 +08:00
|
|
|
<div class="header" @click="onClickHeader"
|
|
|
|
@mouseenter="showLogBtn=true"
|
|
|
|
@mouseleave="showLogBtn=false">
|
2021-11-21 16:53:18 +08:00
|
|
|
<div style="margin: 0 5px;">
|
|
|
|
<i v-if="fold" class="el-icon-caret-right"></i>
|
|
|
|
<i v-if="!fold" class="el-icon-caret-bottom"></i>
|
|
|
|
</div>
|
2021-12-05 18:21:00 +08:00
|
|
|
<div style="flex:1;">
|
|
|
|
{{ group.name }}
|
|
|
|
</div>
|
|
|
|
<el-button style="margin-right: 10px;"
|
|
|
|
v-show="showLogBtn"
|
|
|
|
type="success" icon="el-icon-chat-dot-round" @click.stop="onLog">
|
|
|
|
</el-button>
|
2021-11-21 16:53:18 +08:00
|
|
|
</div>
|
|
|
|
<div class="content" v-show="!fold">
|
|
|
|
<ui-prop v-for="(item, index) in group.data" :key="index"
|
|
|
|
:name="item.name" :value="item.value">
|
|
|
|
</ui-prop>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from "vue";
|
|
|
|
import Component from "vue-class-component";
|
|
|
|
import {Prop} from "vue-property-decorator";
|
|
|
|
import {Group} from "@/devtools/data";
|
|
|
|
import UiProp from "@/devtools/ui/ui-prop.vue";
|
2021-11-21 17:18:59 +08:00
|
|
|
import Bus, {BusMsg} from "@/devtools/bus";
|
2021-11-21 16:53:18 +08:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
name: "property-group",
|
|
|
|
components: {UiProp}
|
|
|
|
})
|
|
|
|
export default class PropertyGroup extends Vue {
|
|
|
|
private fold = false;
|
2021-12-05 18:21:00 +08:00
|
|
|
private showLogBtn = false;
|
2021-11-21 16:53:18 +08:00
|
|
|
@Prop({
|
|
|
|
default: () => {
|
2021-11-21 17:18:59 +08:00
|
|
|
return new Group("test")
|
2021-11-21 16:53:18 +08:00
|
|
|
}
|
|
|
|
})
|
|
|
|
group!: Group;
|
|
|
|
|
|
|
|
created() {
|
2021-11-21 21:36:16 +08:00
|
|
|
Bus.$on(BusMsg.FoldAllGroup, (b: boolean) => {
|
|
|
|
this.fold = b;
|
2021-11-21 17:18:59 +08:00
|
|
|
})
|
2021-11-21 16:53:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
mounted() {
|
|
|
|
}
|
|
|
|
|
2021-12-05 18:21:00 +08:00
|
|
|
onLog() {
|
|
|
|
Bus.$emit(BusMsg.LogData, [this.group.id]);
|
|
|
|
}
|
|
|
|
|
2021-11-21 17:18:59 +08:00
|
|
|
onClickHeader() {
|
2021-11-21 16:53:18 +08:00
|
|
|
this.fold = !this.fold;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="less">
|
|
|
|
.property-group {
|
|
|
|
.header {
|
|
|
|
height: 40px;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
align-items: center;
|
|
|
|
user-select: none;
|
|
|
|
cursor: pointer;
|
|
|
|
border-bottom: 1px #6d6d6d solid;
|
|
|
|
background-color: #1da1f7;
|
|
|
|
}
|
|
|
|
|
|
|
|
.header:hover {
|
|
|
|
color: #6d6d6d;
|
|
|
|
}
|
|
|
|
|
|
|
|
.content {
|
|
|
|
padding: 0 5px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|