2021-11-21 16:53:18 +08:00
|
|
|
<template>
|
|
|
|
<div class="property-group">
|
2024-01-09 12:02:47 +08:00
|
|
|
<div
|
|
|
|
class="header"
|
|
|
|
@click="onClickHeader"
|
|
|
|
@mouseenter="showLogBtn = true"
|
|
|
|
@mouseleave="showLogBtn = false"
|
|
|
|
>
|
|
|
|
<div style="margin: 0 5px">
|
2024-01-09 16:34:16 +08:00
|
|
|
<i v-if="fold" class="iconfont icon_arrow_right"></i>
|
|
|
|
<i v-if="!fold" class="iconfont icon_arrow_down"></i>
|
2021-11-21 16:53:18 +08:00
|
|
|
</div>
|
2024-01-09 12:02:47 +08:00
|
|
|
<div style="flex: 1">
|
2021-12-05 18:21:00 +08:00
|
|
|
{{ group.name }}
|
|
|
|
</div>
|
2024-01-09 15:33:34 +08:00
|
|
|
<CCButton
|
2024-01-09 12:02:47 +08:00
|
|
|
style="margin-right: 10px"
|
|
|
|
v-show="showLogBtn"
|
|
|
|
type="success"
|
|
|
|
@click.stop="onLog"
|
|
|
|
>
|
2024-01-09 16:34:16 +08:00
|
|
|
<i class="iconfont icon_print"></i>
|
2024-01-09 15:33:34 +08:00
|
|
|
</CCButton>
|
2021-11-21 16:53:18 +08:00
|
|
|
</div>
|
|
|
|
<div class="content" v-show="!fold">
|
2024-01-09 12:02:47 +08:00
|
|
|
<ui-prop
|
|
|
|
v-for="(item, index) in group.data"
|
|
|
|
:key="index"
|
|
|
|
:name="item.name"
|
|
|
|
:value="item.value"
|
|
|
|
>
|
2021-11-21 16:53:18 +08:00
|
|
|
</ui-prop>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2024-01-09 12:02:47 +08:00
|
|
|
import { defineComponent, ref, PropType } from "vue";
|
|
|
|
import { Group } from "../data";
|
|
|
|
import UiProp from "./ui-prop.vue";
|
|
|
|
import Bus, { BusMsg } from "../bus";
|
2024-01-09 15:33:34 +08:00
|
|
|
import ccui from "@xuyanfeng/cc-ui";
|
|
|
|
const { CCInput, CCButton, CCInputNumber, CCSelect, CCCheckBox, CCColor } =
|
|
|
|
ccui.components;
|
2024-01-09 12:02:47 +08:00
|
|
|
export default defineComponent({
|
2021-11-21 16:53:18 +08:00
|
|
|
name: "property-group",
|
2024-01-09 15:33:34 +08:00
|
|
|
components: {
|
|
|
|
UiProp,
|
|
|
|
CCInput,
|
|
|
|
CCButton,
|
|
|
|
CCInputNumber,
|
|
|
|
CCSelect,
|
|
|
|
CCCheckBox,
|
|
|
|
CCColor,
|
|
|
|
},
|
2024-01-09 12:02:47 +08:00
|
|
|
props: {
|
|
|
|
group: {
|
|
|
|
type: Object as PropType<Group>,
|
|
|
|
default: () => {
|
|
|
|
return new Group("test");
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
setup(props, context) {
|
|
|
|
Bus.on(BusMsg.FoldAllGroup, (b: boolean) => {
|
|
|
|
fold.value = b;
|
|
|
|
});
|
|
|
|
const fold = ref(false);
|
|
|
|
const showLogBtn = ref(false);
|
|
|
|
return {
|
|
|
|
showLogBtn,
|
|
|
|
fold,
|
|
|
|
onLog() {
|
|
|
|
Bus.emit(BusMsg.LogData, [props.group.id]);
|
|
|
|
},
|
2021-11-21 16:53:18 +08:00
|
|
|
|
2024-01-09 12:02:47 +08:00
|
|
|
onClickHeader() {
|
|
|
|
fold.value = !fold.value;
|
|
|
|
},
|
|
|
|
};
|
|
|
|
},
|
|
|
|
});
|
2021-11-21 16:53:18 +08:00
|
|
|
</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>
|