Browse Source
- 移除 IMeta接口,改为使用 PropertySetter - 新增 PropertyPanel 组件用于渲染属性 - 修改 ModuleManager 中的 meta 为 setter - 更新各模块的元数据文件,使用新的 PropertySetter 结构master
31 changed files with 544 additions and 441 deletions
@ -0,0 +1,34 @@ |
|||||
|
import type { FormField } from "@/components/data-form/DataFormTypes.ts"; |
||||
|
|
||||
|
interface PropertyFieldSetter extends FormField { |
||||
|
} |
||||
|
|
||||
|
interface PropertyFlattenSetter { |
||||
|
/** label宽度 */ |
||||
|
labelWidth?: string | number; |
||||
|
/** 表单字段大小 */ |
||||
|
size?: "" | "small" | "default" | "large"; |
||||
|
/** 设置器集合 */ |
||||
|
fields: Array<PropertyFieldSetter>; |
||||
|
} |
||||
|
|
||||
|
interface PropertySetterGroup extends PropertyFlattenSetter { |
||||
|
/** 分组标题 */ |
||||
|
title: string; |
||||
|
/** 是否展开状态(默认为true) */ |
||||
|
expand?: boolean; |
||||
|
} |
||||
|
|
||||
|
interface PropertySetter { |
||||
|
/** 最上面平铺的设置器 */ |
||||
|
flatten?: PropertyFlattenSetter; |
||||
|
/** 设置器分组集合 */ |
||||
|
groups?: Array<PropertySetterGroup>; |
||||
|
} |
||||
|
|
||||
|
export type { |
||||
|
PropertyFieldSetter, |
||||
|
PropertyFlattenSetter, |
||||
|
PropertySetterGroup, |
||||
|
PropertySetter, |
||||
|
} |
||||
@ -0,0 +1,112 @@ |
|||||
|
<script setup lang="ts"> |
||||
|
import { computed, reactive } from "vue"; |
||||
|
import { ElCollapse, ElCollapseItem } from "element-plus"; |
||||
|
import DataForm from "@/components/data-form/DataForm.vue"; |
||||
|
import type { PropertyFlattenSetter, PropertySetterGroup } from "@/core/base/PropertyTypes.ts"; |
||||
|
import type { DataFormProps } from "@/components/data-form/DataFormTypes.ts"; |
||||
|
import { defDataFormProps } from "@/editor/widgets/property/PropertyPanelConstant.ts"; |
||||
|
|
||||
|
defineOptions({ |
||||
|
name: 'PropertyPanel', |
||||
|
}); |
||||
|
|
||||
|
// 定义 Props 类型 |
||||
|
interface PropertyPanelProps { |
||||
|
/** 待编辑数据 */ |
||||
|
data?: any; |
||||
|
/** 默认的DataFormProps */ |
||||
|
defDataFormProps?: DataFormProps; |
||||
|
/** 最上面平铺的设置器 */ |
||||
|
flatten?: PropertyFlattenSetter; |
||||
|
/** 设置器分组集合 */ |
||||
|
groups?: Array<PropertySetterGroup>; |
||||
|
} |
||||
|
|
||||
|
// 读取组件 props 属性 |
||||
|
const props = withDefaults(defineProps<PropertyPanelProps>(), {}); |
||||
|
|
||||
|
// 定义 State 类型 |
||||
|
interface PropertyPanelState { |
||||
|
expandGroups: Array<string>; |
||||
|
} |
||||
|
|
||||
|
// state 属性 |
||||
|
const state = reactive<PropertyPanelState>({ |
||||
|
expandGroups: [], |
||||
|
}); |
||||
|
|
||||
|
// 定义 Data 类型 |
||||
|
interface PropertyPanelData { |
||||
|
} |
||||
|
|
||||
|
// 内部数据 |
||||
|
const data: PropertyPanelData = {}; |
||||
|
const flattenFormProps = computed(() => getDefFormProps(props.flatten)); |
||||
|
|
||||
|
function getDefFormProps(setter?: PropertyFlattenSetter) { |
||||
|
const formProps: DataFormProps = { |
||||
|
...defDataFormProps, |
||||
|
...props.defDataFormProps, |
||||
|
}; |
||||
|
fillFormProps(setter); |
||||
|
return formProps; |
||||
|
} |
||||
|
|
||||
|
function fillFormProps(formProps: DataFormProps, setter?: PropertyFlattenSetter) { |
||||
|
if (!setter) return; |
||||
|
if (setter.size) formProps.size = setter.size; |
||||
|
if (setter.labelWidth) formProps.labelWidth = setter.labelWidth; |
||||
|
} |
||||
|
|
||||
|
function getCollapseItemId(group: PropertySetterGroup, idx: number) { |
||||
|
return `_${idx}_${group.title}`; |
||||
|
} |
||||
|
|
||||
|
interface PropertyPanelExpose { |
||||
|
state: PropertyPanelState; |
||||
|
data: PropertyPanelData; |
||||
|
} |
||||
|
|
||||
|
const expose: PropertyPanelExpose = { |
||||
|
state, |
||||
|
data, |
||||
|
}; |
||||
|
// 定义组件公开内容 |
||||
|
defineExpose(expose); |
||||
|
|
||||
|
export type { |
||||
|
PropertyPanelProps, |
||||
|
PropertyPanelState, |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<template> |
||||
|
<div class="property-panel"> |
||||
|
<DataForm |
||||
|
v-if="props.flatten" |
||||
|
class="property-panel-form" |
||||
|
v-bind="flattenFormProps" |
||||
|
:data="props.data" |
||||
|
:formFields="props.flatten.fields" |
||||
|
/> |
||||
|
<ElCollapse v-if="props.groups" v-model="state.expandGroups"> |
||||
|
<ElCollapseItem |
||||
|
v-for="(group, idx) in props.groups" |
||||
|
:name="getCollapseItemId(group, idx)" |
||||
|
:title="group.title" |
||||
|
> |
||||
|
<DataForm |
||||
|
v-if="group" |
||||
|
class="property-panel-form" |
||||
|
v-bind="getDefFormProps(group)" |
||||
|
:data="props.data" |
||||
|
:formFields="props.flatten.fields" |
||||
|
/> |
||||
|
</ElCollapseItem> |
||||
|
</ElCollapse> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<style scoped> |
||||
|
|
||||
|
</style> |
||||
@ -0,0 +1,58 @@ |
|||||
|
import type { DataFormProps } from "@/components/data-form/DataFormTypes.ts"; |
||||
|
import type { PropertyFieldSetter } from "@/core/base/PropertyTypes.ts"; |
||||
|
|
||||
|
const defDataFormProps: DataFormProps = { |
||||
|
columnCount: 1, |
||||
|
layout: "onlyLabelFixed", |
||||
|
labelWidth: "100px", |
||||
|
size: "small", |
||||
|
}; |
||||
|
|
||||
|
const basicFieldsSetter: Array<PropertyFieldSetter> = [ |
||||
|
{ |
||||
|
dataPath: 'id', label: '唯一ID', input: 'Input', |
||||
|
inputProps: { |
||||
|
readonly: true, |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
dataPath: 'name', label: '名称', input: 'Input', |
||||
|
inputProps: {}, |
||||
|
}, |
||||
|
{ |
||||
|
dataPath: 'visible', label: '可见', input: 'Checkbox', |
||||
|
inputProps: {}, |
||||
|
}, |
||||
|
{ |
||||
|
dataPath: 'dt.selectable', label: '可选中', input: 'Checkbox', |
||||
|
inputProps: {}, |
||||
|
}, |
||||
|
{ |
||||
|
dataPath: 'dt.protected', label: '受保护', input: 'Checkbox', |
||||
|
inputProps: {}, |
||||
|
}, |
||||
|
{ |
||||
|
dataPath: 'dt.label', label: '标签', input: 'Input', |
||||
|
inputProps: {}, |
||||
|
}, |
||||
|
{ |
||||
|
dataPath: 'dt.color', label: '颜色', input: 'ColorPicker', |
||||
|
inputProps: {}, |
||||
|
}, |
||||
|
// {
|
||||
|
// dataPath: 'tf', input: 'TransformEditor',
|
||||
|
// inputProps: {
|
||||
|
// },
|
||||
|
// },
|
||||
|
// {
|
||||
|
// dataPath: 'dt', input: 'InOutCenterEditor',
|
||||
|
// inputProps: {
|
||||
|
// },
|
||||
|
// },
|
||||
|
]; |
||||
|
|
||||
|
|
||||
|
export { |
||||
|
defDataFormProps, |
||||
|
basicFieldsSetter, |
||||
|
} |
||||
@ -0,0 +1,7 @@ |
|||||
|
interface PropertyPanelProps { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
export type { |
||||
|
PropertyPanelProps, |
||||
|
} |
||||
@ -1,188 +1,164 @@ |
|||||
<template> |
<template> |
||||
<div class="title"> |
<div class="title"> |
||||
<template v-if="!!t"> |
<template v-if="!!t"> |
||||
属性 |
属性 |
||||
<el-tag type="primary">{{ t }}</el-tag> |
<el-tag type="primary">{{ t }}</el-tag> |
||||
<el-input v-model="searchKeyword" size="small" style="width: 240px" placeholder="Search"> |
<el-input v-model="searchKeyword" size="small" style="width: 240px" placeholder="Search"> |
||||
<template #prefix> |
<template #prefix> |
||||
<component :is="renderIcon('element Search')"></component> |
<component :is="renderIcon('element Search')"></component> |
||||
|
</template> |
||||
|
</el-input> |
||||
|
<span class="close" @click="closeMe()"> |
||||
|
<component :is="renderIcon('element Close')"/> |
||||
|
</span> |
||||
</template> |
</template> |
||||
</el-input> |
</div> |
||||
<span class="close" @click="closeMe()"> |
<div class="calc-right-panel"> |
||||
<component :is="renderIcon('element Close')" /> |
<el-empty v-if="!t" description="未选中"/> |
||||
</span> |
<PropertyPanel |
||||
</template> |
v-else-if="propertyPanelProps" |
||||
</div> |
v-bind="propertyPanelProps" |
||||
<div class="calc-right-panel"> |
|
||||
<el-empty v-if="!t" description="未选中"> |
|
||||
</el-empty> |
|
||||
<el-form v-else |
|
||||
label-position="right" |
|
||||
label-width="60" |
|
||||
class="property-panel-form" |
|
||||
size="default" |
|
||||
@submit.native.prevent> |
|
||||
<template v-for="(itemMeta, idx) in selectedObjectMeta"> |
|
||||
<el-divider v-if="itemMeta.editor === '-'" /> |
|
||||
|
|
||||
<TextInput |
|
||||
v-else-if="itemMeta.editor === 'TextInput'" |
|
||||
:prop="itemMeta" |
|
||||
:viewport="viewport" |
|
||||
/> |
|
||||
|
|
||||
<Transform |
|
||||
v-else-if="itemMeta.editor === 'TransformEditor'" |
|
||||
:prop="itemMeta" |
|
||||
:viewport="viewport" |
|
||||
/> |
/> |
||||
|
<el-empty v-else description="节点未配置设置器"/> |
||||
<SwitchItem |
</div> |
||||
v-else-if="itemMeta.editor === 'Switch'" |
|
||||
:prop="itemMeta" |
|
||||
:viewport="viewport" |
|
||||
/> |
|
||||
|
|
||||
<ColorItem v-else-if="itemMeta.editor === 'Color'" :prop="itemMeta" :viewport="viewport" /> |
|
||||
|
|
||||
<UUIDItem v-else-if="itemMeta.editor === 'UUID'" :prop="itemMeta" :viewport="viewport" /> |
|
||||
|
|
||||
<NumberInput |
|
||||
v-else-if="itemMeta.editor === 'Number'" |
|
||||
:prop="itemMeta" |
|
||||
:viewport="viewport" |
|
||||
/> |
|
||||
|
|
||||
<template v-else> 未知编辑器: {{ itemMeta.editor }}</template> |
|
||||
</template> |
|
||||
</el-form> |
|
||||
</div> |
|
||||
</template> |
</template> |
||||
<script> |
<script> |
||||
import IWidgets from '../IWidgets.js' |
import IWidgets from '../IWidgets.js' |
||||
import TextInput from '../../propEditors/TextInput.vue' |
import PropertyPanel from "@/editor/widgets/property/PropertyPanel.vue"; |
||||
import Transform from '../../propEditors/Transform.vue' |
|
||||
import SwitchItem from '../../propEditors/SwitchItem.vue' |
|
||||
import ColorItem from '../../propEditors/ColorItem.vue' |
|
||||
import UUIDItem from '../../propEditors/UUIDItem.vue' |
|
||||
import NumberInput from '../../propEditors/NumberInput.vue' |
|
||||
import EventBus from '../../../runtime/EventBus.js' |
|
||||
|
|
||||
export default { |
export default { |
||||
name: 'PropertyView', |
name: 'PropertyView', |
||||
components: { |
components: { |
||||
NumberInput, |
PropertyPanel, |
||||
UUIDItem, |
|
||||
ColorItem, |
|
||||
SwitchItem, |
|
||||
TextInput, Transform |
|
||||
}, |
|
||||
mixins: [IWidgets], |
|
||||
data() { |
|
||||
return { |
|
||||
itemTypeMeta: null, |
|
||||
searchKeyword: '' |
|
||||
} |
|
||||
}, |
|
||||
computed: { |
|
||||
t() { |
|
||||
return this.selectedItem ? this.selectedItem.t : '' |
|
||||
}, |
}, |
||||
selectedItem() { |
mixins: [IWidgets], |
||||
return this.state?.selectedItem |
data() { |
||||
|
return { |
||||
|
searchKeyword: '', |
||||
|
propertySetter: undefined, |
||||
|
} |
||||
}, |
}, |
||||
selectedObject() { |
computed: { |
||||
return this.state?.selectedObject |
t() { |
||||
|
return this.selectedItem ? this.selectedItem.t : '' |
||||
|
}, |
||||
|
selectedItem() { |
||||
|
return this.state?.selectedItem |
||||
|
}, |
||||
|
// selectedObject() { |
||||
|
// return this.state?.selectedObject |
||||
|
// }, |
||||
|
// selectedObjectSetter() { |
||||
|
// return this.state?.selectedObjectSetter |
||||
|
// }, |
||||
|
propertyPanelProps() { |
||||
|
const state = this.state; |
||||
|
if (!state) return; |
||||
|
const { selectedObjectSetter, selectedItem } = state; |
||||
|
if (!selectedObjectSetter || !selectedItem) return; |
||||
|
const data = _.find(this.viewport.stateManager.vdata.items, item => item.id === selectedItem.id); |
||||
|
if (!data) return; |
||||
|
return { |
||||
|
key: data.id, |
||||
|
data: data, |
||||
|
flatten: selectedObjectSetter.flatten, |
||||
|
groups: selectedObjectSetter.groups, |
||||
|
}; |
||||
|
}, |
||||
}, |
}, |
||||
selectedObjectMeta() { |
watch: { |
||||
return this.state?.selectedObjectMeta |
// selectedItem(newV, oldV) { |
||||
} |
// console.log("selectedItem", arguments) |
||||
}, |
// }, |
||||
methods: { |
// selectedObject(newV, oldV) { |
||||
selectedObjectChanged(state) { |
// console.log("selectedObject", arguments) |
||||
const data = state.selectedItem |
// }, |
||||
console.log('selectedObjectChanged data', data) |
}, |
||||
if (data) { |
methods: { |
||||
this.viewport.stateManager.beginStateUpdate() |
selectedObjectChanged(state) { |
||||
const item = _.find(this.viewport.stateManager.vdata.items, item => item.id === data.id) |
const data = state.selectedItem |
||||
// item.tf[0][0] = item.tf[0][0] / 2; |
console.log('selectedObjectChanged data', data) |
||||
console.log('selectedObjectChanged item', item) |
if (data) { |
||||
// _.extend(item, data) |
this.viewport.stateManager.beginStateUpdate() |
||||
this.viewport.stateManager.endStateUpdate() |
const item = _.find(this.viewport.stateManager.vdata.items, item => item.id === data.id) |
||||
} |
// item.tf[0][0] = item.tf[0][0] / 2; |
||||
|
console.log('selectedObjectChanged item', item) |
||||
|
// _.extend(item, data) |
||||
|
this.viewport.stateManager.endStateUpdate() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
mounted() { |
||||
|
// EventBus.on('selectedObjectChanged', this.selectedObjectChanged) |
||||
|
}, |
||||
|
unmounted() { |
||||
|
// EventBus.off('selectedObjectChanged', this.selectedObjectChanged) |
||||
} |
} |
||||
}, |
|
||||
mounted() { |
|
||||
EventBus.on('selectedObjectChanged', this.selectedObjectChanged) |
|
||||
}, |
|
||||
unmounted() { |
|
||||
EventBus.off('selectedObjectChanged', this.selectedObjectChanged) |
|
||||
} |
|
||||
} |
} |
||||
</script> |
</script> |
||||
<style lang="less"> |
<style lang="less"> |
||||
.property-panel-form { |
.property-panel-form { |
||||
margin: 0; |
margin: 0; |
||||
font-size: 14px; |
font-size: 14px; |
||||
color: #606266; |
color: #606266; |
||||
|
|
||||
.el-form-item--default { |
|
||||
margin: 5px 3px 0 0; |
|
||||
|
|
||||
.el-form-item__label { |
|
||||
height: 20px; |
|
||||
line-height: 22px; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
.gui-toolbar { |
.el-form-item--default { |
||||
color: #333; |
margin: 5px 3px 0 0; |
||||
background: #ffffff; |
|
||||
border-top: 1px solid #dcdcdc; |
|
||||
margin-top: 5px; |
|
||||
|
|
||||
.el-input-number.is-without-controls .el-input__wrapper { |
.el-form-item__label { |
||||
padding-left: 2px; |
height: 20px; |
||||
padding-right: 2px; |
line-height: 22px; |
||||
|
} |
||||
} |
} |
||||
|
|
||||
.gui-row { |
.gui-toolbar { |
||||
display: flex; |
color: #333; |
||||
flex-direction: row; |
background: #ffffff; |
||||
gap: 3px; |
border-top: 1px solid #dcdcdc; |
||||
padding: 3px 3px 3px 0; |
margin-top: 5px; |
||||
|
|
||||
.gui-item-name { |
|
||||
width: 26px; |
|
||||
align-self: stretch; |
|
||||
display: flex; |
|
||||
align-items: center; |
|
||||
justify-content: center; |
|
||||
|
|
||||
.el-icon { |
.el-input-number.is-without-controls .el-input__wrapper { |
||||
font-size: 16px; |
padding-left: 2px; |
||||
|
padding-right: 2px; |
||||
} |
} |
||||
} |
|
||||
|
|
||||
.gui-item { |
.gui-row { |
||||
flex: 1; |
display: flex; |
||||
text-align: center; |
flex-direction: row; |
||||
font-size: 12px; |
gap: 3px; |
||||
|
padding: 3px 3px 3px 0; |
||||
.el-input-number { |
|
||||
width: 100%; |
.gui-item-name { |
||||
|
width: 26px; |
||||
.el-input__wrapper { |
align-self: stretch; |
||||
background-color: #efefef; |
display: flex; |
||||
box-shadow: none; |
align-items: center; |
||||
} |
justify-content: center; |
||||
|
|
||||
|
.el-icon { |
||||
|
font-size: 16px; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.gui-item { |
||||
|
flex: 1; |
||||
|
text-align: center; |
||||
|
font-size: 12px; |
||||
|
|
||||
|
.el-input-number { |
||||
|
width: 100%; |
||||
|
|
||||
|
.el-input__wrapper { |
||||
|
background-color: #efefef; |
||||
|
box-shadow: none; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
} |
} |
||||
} |
|
||||
} |
} |
||||
} |
|
||||
|
|
||||
.el-divider { |
.el-divider { |
||||
margin: 5px 0; |
margin: 5px 0; |
||||
} |
} |
||||
} |
} |
||||
</style> |
</style> |
||||
|
|||||
@ -1,14 +0,0 @@ |
|||||
import type { IMeta } from '@/core/base/IMeta.ts' |
|
||||
|
|
||||
export default [ |
|
||||
{ field: 'uuid', editor: 'UUID', label: 'uuid', readonly: true, category: 'basic' }, |
|
||||
{ field: 'name', editor: 'TextInput', label: '名称', category: 'basic' }, |
|
||||
{ field: 'dt.label', editor: 'TextInput', label: '标签', category: 'basic' }, |
|
||||
{ editor: 'TransformEditor', category: 'basic' }, |
|
||||
{ field: 'dt.color', editor: 'Color', label: '颜色', category: 'basic' }, |
|
||||
{ editor: '-', category: 'basic' }, |
|
||||
{ field: 'tf', editor: 'InOutCenterEditor', category: 'basic' }, |
|
||||
{ field: 'dt.selectable', editor: 'Switch', label: '可选中', category: 'basic' }, |
|
||||
{ field: 'dt.protected', editor: 'Switch', label: '受保护', category: 'basic' }, |
|
||||
{ field: 'visible', editor: 'Switch', label: '可见', category: 'basic' } |
|
||||
] as IMeta |
|
||||
@ -0,0 +1,12 @@ |
|||||
|
import type { PropertySetter } from "@/core/base/PropertyTypes.ts"; |
||||
|
import { basicFieldsSetter } from "@/editor/widgets/property/PropertyPanelConstant.ts"; |
||||
|
|
||||
|
const propertySetter: PropertySetter = { |
||||
|
flatten: { |
||||
|
fields: [ |
||||
|
...basicFieldsSetter, |
||||
|
], |
||||
|
}, |
||||
|
}; |
||||
|
|
||||
|
export default propertySetter; |
||||
@ -1,15 +1,15 @@ |
|||||
import { defineModule } from '@/core/manager/ModuleManager.ts' |
import { defineModule } from '@/core/manager/ModuleManager.ts' |
||||
import GstoreRenderer from './GstoreRenderer.ts' |
import GstoreRenderer from './GstoreRenderer.ts' |
||||
import GstoreEntity from './GstoreEntity.ts' |
import GstoreEntity from './GstoreEntity.ts' |
||||
import GstoreMeta from './GstoreMeta.ts' |
|
||||
import GstoreInteraction from './GstoreInteraction.ts' |
import GstoreInteraction from './GstoreInteraction.ts' |
||||
|
import propertySetter from "@/modules/gstore/GstorePropertySetter.ts"; |
||||
|
|
||||
export const ITEM_TYPE_NAME = 'gstore' |
export const ITEM_TYPE_NAME = 'gstore' |
||||
|
|
||||
export default defineModule({ |
export default defineModule({ |
||||
name: ITEM_TYPE_NAME, |
name: ITEM_TYPE_NAME, |
||||
renderer: new GstoreRenderer(ITEM_TYPE_NAME), |
renderer: new GstoreRenderer(ITEM_TYPE_NAME), |
||||
interaction: new GstoreInteraction(ITEM_TYPE_NAME), |
interaction: new GstoreInteraction(ITEM_TYPE_NAME), |
||||
meta: GstoreMeta, |
setter: propertySetter, |
||||
entity: GstoreEntity |
entity: GstoreEntity, |
||||
}) |
}) |
||||
@ -1,15 +0,0 @@ |
|||||
import type { IMeta } from '@/core/base/IMeta.ts' |
|
||||
|
|
||||
const MeasureMeta: IMeta = [ |
|
||||
{ field: 'uuid', editor: 'UUID', label: 'uuid', readonly: true, category: 'basic' }, |
|
||||
{ field: 'name', editor: 'TextInput', label: '名称', category: 'basic' }, |
|
||||
{ field: 'dt.label', editor: 'TextInput', label: '标签', category: 'basic' }, |
|
||||
{ editor: 'TransformEditor', category: 'basic' }, |
|
||||
{ field: 'dt.color', editor: 'Color', label: '颜色', category: 'basic' }, |
|
||||
{ editor: '-', category: 'basic' }, |
|
||||
{ field: 'tf', editor: 'InOutCenterEditor', category: 'basic' }, |
|
||||
{ field: 'dt.selectable', editor: 'Switch', label: '可选中', category: 'basic' }, |
|
||||
{ field: 'dt.protected', editor: 'Switch', label: '受保护', category: 'basic' }, |
|
||||
{ field: 'visible', editor: 'Switch', label: '可见', category: 'basic' } |
|
||||
] |
|
||||
export default MeasureMeta |
|
||||
@ -0,0 +1,12 @@ |
|||||
|
import type { PropertySetter } from "@/core/base/PropertyTypes.ts"; |
||||
|
import { basicFieldsSetter } from "@/editor/widgets/property/PropertyPanelConstant.ts"; |
||||
|
|
||||
|
const propertySetter: PropertySetter = { |
||||
|
flatten: { |
||||
|
fields: [ |
||||
|
...basicFieldsSetter, |
||||
|
], |
||||
|
}, |
||||
|
}; |
||||
|
|
||||
|
export default propertySetter; |
||||
@ -1,15 +1,15 @@ |
|||||
import { defineModule } from '@/core/manager/ModuleManager.ts' |
import { defineModule } from '@/core/manager/ModuleManager.ts' |
||||
import MeasureRenderer from './MeasureRenderer.ts' |
import MeasureRenderer from './MeasureRenderer.ts' |
||||
import MeasureEntity from './MeasureEntity.ts' |
import MeasureEntity from './MeasureEntity.ts' |
||||
import MeasureMeta from './MeasureMeta.ts' |
|
||||
import MeasureInteraction from './MeasureInteraction.ts' |
import MeasureInteraction from './MeasureInteraction.ts' |
||||
|
import propertySetter from "@/modules/measure/MeasurePropertySetter.ts"; |
||||
|
|
||||
export const ITEM_TYPE_NAME = 'measure' |
export const ITEM_TYPE_NAME = 'measure' |
||||
|
|
||||
export default defineModule({ |
export default defineModule({ |
||||
name: ITEM_TYPE_NAME, |
name: ITEM_TYPE_NAME, |
||||
renderer: new MeasureRenderer(ITEM_TYPE_NAME), |
renderer: new MeasureRenderer(ITEM_TYPE_NAME), |
||||
interaction: new MeasureInteraction(ITEM_TYPE_NAME), |
interaction: new MeasureInteraction(ITEM_TYPE_NAME), |
||||
meta: MeasureMeta, |
setter: propertySetter, |
||||
entity: MeasureEntity |
entity: MeasureEntity, |
||||
}) |
}) |
||||
@ -1,49 +0,0 @@ |
|||||
import type { IMeta } from '@/core/base/IMeta.ts' |
|
||||
|
|
||||
export default [ |
|
||||
{ field: 'uuid', editor: 'UUID', label: 'uuid', readonly: true, category: 'basic' }, |
|
||||
{ field: 'name', editor: 'TextInput', label: '名称', category: 'basic' }, |
|
||||
{ field: 'dt.label', editor: 'TextInput', label: '标签', category: 'basic' }, |
|
||||
{ editor: 'TransformEditor', category: 'basic' }, |
|
||||
{ field: 'dt.color', editor: 'Color', label: '颜色', category: 'basic' }, |
|
||||
{ editor: '-', category: 'basic' }, |
|
||||
|
|
||||
{ field: 'dt.palletWidth', editor: 'NumberInput', label: '托盘深度', category: 'basic' }, |
|
||||
{ field: 'dt.palletDepth', editor: 'NumberInput', label: '托盘深度', category: 'basic' }, |
|
||||
/** |
|
||||
* dt.bays 5列3层货架示例 |
|
||||
* { |
|
||||
* dt: { |
|
||||
* rackDepth: 1.1, // 货架深度
|
|
||||
* levelCount: 3, // 总层数
|
|
||||
* bayCount: 5, // 总列数
|
|
||||
* hideFloor: false, // 隐藏底板
|
|
||||
* extendColumns: true, // 扩展挡板
|
|
||||
* columnSpacing: 1, // 支脚跨越
|
|
||||
* bays: [ // 每列的配置
|
|
||||
* { |
|
||||
* bayWidth: 1.6, // 列的宽度
|
|
||||
* levelHeight: [ 1.4, 1.4, 1.4 ] // 每层的高度
|
|
||||
* }, |
|
||||
* {bayWidth: 1.6, levelHeight: [ 1.4, 1.4, 1.4 ]}, |
|
||||
* {bayWidth: 1.6, levelHeight: [ 1.4, 1.4, 1.4 ]}, |
|
||||
* {bayWidth: 1.6, levelHeight: [ 1.4, 1.4, 1.4 ]}, |
|
||||
* {bayWidth: 1.6, levelHeight: [ 1.4, 1.4, 1.4 ]}, |
|
||||
* ] |
|
||||
* } |
|
||||
* } |
|
||||
* |
|
||||
* |
|
||||
* |
|
||||
* |
|
||||
* |
|
||||
* |
|
||||
* |
|
||||
*/ |
|
||||
|
|
||||
|
|
||||
{ field: 'tf', editor: 'InOutCenterEditor', category: 'basic' }, |
|
||||
{ field: 'dt.selectable', editor: 'Switch', label: '可选中', category: 'basic' }, |
|
||||
{ field: 'dt.protected', editor: 'Switch', label: '受保护', category: 'basic' }, |
|
||||
{ field: 'visible', editor: 'Switch', label: '可见', category: 'basic' } |
|
||||
] as IMeta |
|
||||
@ -0,0 +1,20 @@ |
|||||
|
import type { PropertySetter } from "@/core/base/PropertyTypes.ts"; |
||||
|
import { basicFieldsSetter } from "@/editor/widgets/property/PropertyPanelConstant.ts"; |
||||
|
|
||||
|
const propertySetter: PropertySetter = { |
||||
|
flatten: { |
||||
|
fields: [ |
||||
|
...basicFieldsSetter, |
||||
|
{ |
||||
|
dataPath: 'dt.palletWidth', label: '托盘宽度', input: 'InputNumber', |
||||
|
inputProps: {}, |
||||
|
}, |
||||
|
{ |
||||
|
dataPath: 'dt.palletDepth', label: '托盘深度', input: 'InputNumber', |
||||
|
inputProps: {}, |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
}; |
||||
|
|
||||
|
export default propertySetter; |
||||
@ -1,15 +1,15 @@ |
|||||
import { defineModule } from '@/core/manager/ModuleManager.ts' |
import { defineModule } from '@/core/manager/ModuleManager.ts' |
||||
import PalletRenderer from './PalletRenderer.ts' |
import PalletRenderer from './PalletRenderer.ts' |
||||
import PalletEntity from './PalletEntity.ts' |
import PalletEntity from './PalletEntity.ts' |
||||
import PalletMeta from './PalletMeta.ts' |
|
||||
import PalletInteraction from './PalletInteraction.ts' |
import PalletInteraction from './PalletInteraction.ts' |
||||
|
import propertySetter from "@/modules/pallet/PalletPropertySetter.ts"; |
||||
|
|
||||
export const ITEM_TYPE_NAME = 'pallet' |
export const ITEM_TYPE_NAME = 'pallet' |
||||
|
|
||||
export default defineModule({ |
export default defineModule({ |
||||
name: ITEM_TYPE_NAME, |
name: ITEM_TYPE_NAME, |
||||
renderer: new PalletRenderer(ITEM_TYPE_NAME), |
renderer: new PalletRenderer(ITEM_TYPE_NAME), |
||||
interaction: new PalletInteraction(ITEM_TYPE_NAME), |
interaction: new PalletInteraction(ITEM_TYPE_NAME), |
||||
meta: PalletMeta, |
setter: propertySetter, |
||||
entity: PalletEntity |
entity: PalletEntity, |
||||
}) |
}) |
||||
|
|||||
@ -1,49 +0,0 @@ |
|||||
import type { IMeta } from '@/core/base/IMeta.ts' |
|
||||
|
|
||||
export default [ |
|
||||
{ field: 'uuid', editor: 'UUID', label: 'uuid', readonly: true, category: 'basic' }, |
|
||||
{ field: 'name', editor: 'TextInput', label: '名称', category: 'basic' }, |
|
||||
{ field: 'dt.label', editor: 'TextInput', label: '标签', category: 'basic' }, |
|
||||
{ editor: 'TransformEditor', category: 'basic' }, |
|
||||
{ field: 'dt.color', editor: 'Color', label: '颜色', category: 'basic' }, |
|
||||
{ editor: '-', category: 'basic' }, |
|
||||
|
|
||||
{ field: 'dt.palletWidth', editor: 'NumberInput', label: '托盘深度', category: 'basic' }, |
|
||||
{ field: 'dt.palletDepth', editor: 'NumberInput', label: '托盘深度', category: 'basic' }, |
|
||||
/** |
|
||||
* dt.bays 5列3层货架示例 |
|
||||
* { |
|
||||
* dt: { |
|
||||
* rackDepth: 1.1, // 货架深度
|
|
||||
* levelCount: 3, // 总层数
|
|
||||
* bayCount: 5, // 总列数
|
|
||||
* hideFloor: false, // 隐藏底板
|
|
||||
* extendColumns: true, // 扩展挡板
|
|
||||
* columnSpacing: 1, // 支脚跨越
|
|
||||
* bays: [ // 每列的配置
|
|
||||
* { |
|
||||
* bayWidth: 1.6, // 列的宽度
|
|
||||
* levelHeight: [ 1.4, 1.4, 1.4 ] // 每层的高度
|
|
||||
* }, |
|
||||
* {bayWidth: 1.6, levelHeight: [ 1.4, 1.4, 1.4 ]}, |
|
||||
* {bayWidth: 1.6, levelHeight: [ 1.4, 1.4, 1.4 ]}, |
|
||||
* {bayWidth: 1.6, levelHeight: [ 1.4, 1.4, 1.4 ]}, |
|
||||
* {bayWidth: 1.6, levelHeight: [ 1.4, 1.4, 1.4 ]}, |
|
||||
* ] |
|
||||
* } |
|
||||
* } |
|
||||
* |
|
||||
* |
|
||||
* |
|
||||
* |
|
||||
* |
|
||||
* |
|
||||
* |
|
||||
*/ |
|
||||
|
|
||||
|
|
||||
{ field: 'tf', editor: 'InOutCenterEditor', category: 'basic' }, |
|
||||
{ field: 'dt.selectable', editor: 'Switch', label: '可选中', category: 'basic' }, |
|
||||
{ field: 'dt.protected', editor: 'Switch', label: '受保护', category: 'basic' }, |
|
||||
{ field: 'visible', editor: 'Switch', label: '可见', category: 'basic' } |
|
||||
] as IMeta |
|
||||
@ -0,0 +1,20 @@ |
|||||
|
import type { PropertySetter } from "@/core/base/PropertyTypes.ts"; |
||||
|
import { basicFieldsSetter } from "@/editor/widgets/property/PropertyPanelConstant.ts"; |
||||
|
|
||||
|
const propertySetter: PropertySetter = { |
||||
|
flatten: { |
||||
|
fields: [ |
||||
|
...basicFieldsSetter, |
||||
|
{ |
||||
|
dataPath: 'dt.palletWidth', label: '托盘宽度', input: 'InputNumber', |
||||
|
inputProps: {}, |
||||
|
}, |
||||
|
{ |
||||
|
dataPath: 'dt.palletDepth', label: '托盘深度', input: 'InputNumber', |
||||
|
inputProps: {}, |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
}; |
||||
|
|
||||
|
export default propertySetter; |
||||
@ -1,15 +1,15 @@ |
|||||
import { defineModule } from '@/core/manager/ModuleManager.ts' |
import { defineModule } from '@/core/manager/ModuleManager.ts' |
||||
import PtrRenderer from './PtrRenderer.ts' |
import PtrRenderer from './PtrRenderer.ts' |
||||
import PtrEntity from './PtrEntity.ts' |
import PtrEntity from './PtrEntity.ts' |
||||
import PtrMeta from './PtrMeta.ts' |
|
||||
import PtrInteraction from './PtrInteraction.ts' |
import PtrInteraction from './PtrInteraction.ts' |
||||
|
import propertySetter from "@/modules/ptr/PtrPropertySetter.ts"; |
||||
|
|
||||
export const ITEM_TYPE_NAME = 'ptr' |
export const ITEM_TYPE_NAME = 'ptr' |
||||
|
|
||||
export default defineModule({ |
export default defineModule({ |
||||
name: ITEM_TYPE_NAME, |
name: ITEM_TYPE_NAME, |
||||
renderer: new PtrRenderer(ITEM_TYPE_NAME), |
renderer: new PtrRenderer(ITEM_TYPE_NAME), |
||||
interaction: new PtrInteraction(ITEM_TYPE_NAME), |
interaction: new PtrInteraction(ITEM_TYPE_NAME), |
||||
meta: PtrMeta, |
setter: propertySetter, |
||||
entity: PtrEntity |
entity: PtrEntity, |
||||
}) |
}) |
||||
|
|||||
@ -1,55 +0,0 @@ |
|||||
import type { IMeta } from '@/core/base/IMeta.ts' |
|
||||
|
|
||||
export default [ |
|
||||
{ field: 'uuid', editor: 'UUID', label: 'uuid', readonly: true, category: 'basic' }, |
|
||||
{ field: 'name', editor: 'TextInput', label: '名称', category: 'basic' }, |
|
||||
{ field: 'dt.label', editor: 'TextInput', label: '标签', category: 'basic' }, |
|
||||
{ editor: 'TransformEditor', category: 'basic' }, |
|
||||
{ field: 'dt.color', editor: 'Color', label: '颜色', category: 'basic' }, |
|
||||
{ editor: '-', category: 'basic' }, |
|
||||
|
|
||||
|
|
||||
{ field: 'dt.rackDepth', editor: 'NumberInput', label: '货架深度', category: 'basic' }, |
|
||||
{ field: 'dt.levelCount', editor: 'NumberInput', label: '总层数', category: 'basic' }, |
|
||||
{ field: 'dt.bayCount', editor: 'NumberInput', label: '总列数', category: 'basic' }, |
|
||||
{ field: 'dt.hideFloor', editor: 'NumberInput', label: '隐藏底板', category: 'basic' }, |
|
||||
{ field: 'dt.extendColumns', editor: 'NumberInput', label: '扩展挡板', category: 'basic' }, |
|
||||
{ field: 'dt.columnSpacing', editor: 'NumberInput', label: '支脚跨越', category: 'basic' }, |
|
||||
{ field: 'dt.bays', editor: 'BayEditor', category: 'basic' }, |
|
||||
/** |
|
||||
* dt.bays 5列3层货架示例 |
|
||||
* { |
|
||||
* dt: { |
|
||||
* rackDepth: 1.1, // 货架深度
|
|
||||
* levelCount: 3, // 总层数
|
|
||||
* bayCount: 5, // 总列数
|
|
||||
* hideFloor: false, // 隐藏底板
|
|
||||
* extendColumns: true, // 扩展挡板
|
|
||||
* columnSpacing: 1, // 支脚跨越
|
|
||||
* bays: [ // 每列的配置
|
|
||||
* { |
|
||||
* bayWidth: 1.6, // 列的宽度
|
|
||||
* levelHeight: [ 1.4, 1.4, 1.4 ] // 每层的高度
|
|
||||
* }, |
|
||||
* {bayWidth: 1.6, levelHeight: [ 1.4, 1.4, 1.4 ]}, |
|
||||
* {bayWidth: 1.6, levelHeight: [ 1.4, 1.4, 1.4 ]}, |
|
||||
* {bayWidth: 1.6, levelHeight: [ 1.4, 1.4, 1.4 ]}, |
|
||||
* {bayWidth: 1.6, levelHeight: [ 1.4, 1.4, 1.4 ]}, |
|
||||
* ] |
|
||||
* } |
|
||||
* } |
|
||||
* |
|
||||
* |
|
||||
* |
|
||||
* |
|
||||
* |
|
||||
* |
|
||||
* |
|
||||
*/ |
|
||||
|
|
||||
|
|
||||
{ field: 'tf', editor: 'InOutCenterEditor', category: 'basic' }, |
|
||||
{ field: 'dt.selectable', editor: 'Switch', label: '可选中', category: 'basic' }, |
|
||||
{ field: 'dt.protected', editor: 'Switch', label: '受保护', category: 'basic' }, |
|
||||
{ field: 'visible', editor: 'Switch', label: '可见', category: 'basic' } |
|
||||
] as IMeta |
|
||||
@ -0,0 +1,64 @@ |
|||||
|
import type { PropertySetter } from "@/core/base/PropertyTypes.ts"; |
||||
|
import { basicFieldsSetter } from "@/editor/widgets/property/PropertyPanelConstant.ts"; |
||||
|
|
||||
|
const propertySetter: PropertySetter = { |
||||
|
flatten: { |
||||
|
fields: [ |
||||
|
...basicFieldsSetter, |
||||
|
{ |
||||
|
dataPath: 'dt.rackDepth', label: '货架深度', input: 'InputNumber', |
||||
|
inputProps: {}, |
||||
|
}, |
||||
|
{ |
||||
|
dataPath: 'dt.levelCount', label: '总层数', input: 'InputNumber', |
||||
|
inputProps: {}, |
||||
|
}, |
||||
|
{ |
||||
|
dataPath: 'dt.bayCount', label: '总列数', input: 'InputNumber', |
||||
|
inputProps: {}, |
||||
|
}, |
||||
|
{ |
||||
|
dataPath: 'dt.hideFloor', label: '隐藏底板', input: 'InputNumber', |
||||
|
inputProps: {}, |
||||
|
}, |
||||
|
{ |
||||
|
dataPath: 'dt.extendColumns', label: '扩展挡板', input: 'InputNumber', |
||||
|
inputProps: {}, |
||||
|
}, |
||||
|
{ |
||||
|
dataPath: 'dt.columnSpacing', label: '支脚跨越', input: 'InputNumber', |
||||
|
inputProps: {}, |
||||
|
}, |
||||
|
// {
|
||||
|
// dataPath: 'dt.bays', input: 'BayEditor',
|
||||
|
// inputProps: {
|
||||
|
// },
|
||||
|
// },
|
||||
|
/** |
||||
|
* dt.bays 5列3层货架示例 |
||||
|
* { |
||||
|
* dt: { |
||||
|
* rackDepth: 1.1, // 货架深度
|
||||
|
* levelCount: 3, // 总层数
|
||||
|
* bayCount: 5, // 总列数
|
||||
|
* hideFloor: false, // 隐藏底板
|
||||
|
* extendColumns: true, // 扩展挡板
|
||||
|
* columnSpacing: 1, // 支脚跨越
|
||||
|
* bays: [ // 每列的配置
|
||||
|
* { |
||||
|
* bayWidth: 1.6, // 列的宽度
|
||||
|
* levelHeight: [ 1.4, 1.4, 1.4 ] // 每层的高度
|
||||
|
* }, |
||||
|
* {bayWidth: 1.6, levelHeight: [ 1.4, 1.4, 1.4 ]}, |
||||
|
* {bayWidth: 1.6, levelHeight: [ 1.4, 1.4, 1.4 ]}, |
||||
|
* {bayWidth: 1.6, levelHeight: [ 1.4, 1.4, 1.4 ]}, |
||||
|
* {bayWidth: 1.6, levelHeight: [ 1.4, 1.4, 1.4 ]}, |
||||
|
* ] |
||||
|
* } |
||||
|
* } |
||||
|
*/ |
||||
|
], |
||||
|
}, |
||||
|
}; |
||||
|
|
||||
|
export default propertySetter; |
||||
@ -1,15 +1,15 @@ |
|||||
import { defineModule } from '@/core/manager/ModuleManager.ts' |
import { defineModule } from '@/core/manager/ModuleManager.ts' |
||||
import RackRenderer from './RackRenderer.ts' |
import RackRenderer from './RackRenderer.ts' |
||||
import RackEntity from './RackEntity.ts' |
import RackEntity from './RackEntity.ts' |
||||
import RackMeta from './RackMeta.ts' |
|
||||
import RackInteraction from './RackInteraction.ts' |
import RackInteraction from './RackInteraction.ts' |
||||
|
import propertySetter from "@/modules/rack/RackPropertySetter.ts"; |
||||
|
|
||||
export const ITEM_TYPE_NAME = 'rack' |
export const ITEM_TYPE_NAME = 'rack' |
||||
|
|
||||
export default defineModule({ |
export default defineModule({ |
||||
name: ITEM_TYPE_NAME, |
name: ITEM_TYPE_NAME, |
||||
renderer: new RackRenderer(ITEM_TYPE_NAME), |
renderer: new RackRenderer(ITEM_TYPE_NAME), |
||||
interaction: new RackInteraction(ITEM_TYPE_NAME), |
interaction: new RackInteraction(ITEM_TYPE_NAME), |
||||
meta: RackMeta, |
setter: propertySetter, |
||||
entity: RackEntity |
entity: RackEntity, |
||||
}) |
}) |
||||
|
|||||
@ -1,14 +0,0 @@ |
|||||
import type { IMeta } from '@/core/base/IMeta.ts' |
|
||||
|
|
||||
export default [ |
|
||||
{ field: 'uuid', editor: 'UUID', label: 'uuid', readonly: true, category: 'basic' }, |
|
||||
{ field: 'name', editor: 'TextInput', label: '名称', category: 'basic' }, |
|
||||
{ field: 'dt.label', editor: 'TextInput', label: '标签', category: 'basic' }, |
|
||||
{ editor: 'TransformEditor', category: 'basic' }, |
|
||||
{ field: 'dt.color', editor: 'Color', label: '颜色', category: 'basic' }, |
|
||||
{ editor: '-', category: 'basic' }, |
|
||||
{ field: 'tf', editor: 'InOutCenterEditor', category: 'basic' }, |
|
||||
{ field: 'dt.selectable', editor: 'Switch', label: '可选中', category: 'basic' }, |
|
||||
{ field: 'dt.protected', editor: 'Switch', label: '受保护', category: 'basic' }, |
|
||||
{ field: 'visible', editor: 'Switch', label: '可见', category: 'basic' } |
|
||||
] as IMeta |
|
||||
@ -0,0 +1,12 @@ |
|||||
|
import type { PropertySetter } from "@/core/base/PropertyTypes.ts"; |
||||
|
import { basicFieldsSetter } from "@/editor/widgets/property/PropertyPanelConstant.ts"; |
||||
|
|
||||
|
const propertySetter: PropertySetter = { |
||||
|
flatten: { |
||||
|
fields: [ |
||||
|
...basicFieldsSetter, |
||||
|
], |
||||
|
}, |
||||
|
}; |
||||
|
|
||||
|
export default propertySetter; |
||||
@ -1,15 +1,15 @@ |
|||||
import { defineModule } from '@/core/manager/ModuleManager.ts' |
import { defineModule } from '@/core/manager/ModuleManager.ts' |
||||
import WayRenderer from './WayRenderer.ts' |
import WayRenderer from './WayRenderer.ts' |
||||
import WayEntity from './WayEntity.ts' |
import WayEntity from './WayEntity.ts' |
||||
import WayMeta from './WayMeta.ts' |
|
||||
import WayInteraction from './WayInteraction.ts' |
import WayInteraction from './WayInteraction.ts' |
||||
|
import propertySetter from "@/modules/way/WayPropertySetter.ts"; |
||||
|
|
||||
export const ITEM_TYPE_NAME = 'way' |
export const ITEM_TYPE_NAME = 'way' |
||||
|
|
||||
export default defineModule({ |
export default defineModule({ |
||||
name: ITEM_TYPE_NAME, |
name: ITEM_TYPE_NAME, |
||||
renderer: new WayRenderer(ITEM_TYPE_NAME), |
renderer: new WayRenderer(ITEM_TYPE_NAME), |
||||
interaction: new WayInteraction(ITEM_TYPE_NAME), |
interaction: new WayInteraction(ITEM_TYPE_NAME), |
||||
meta: WayMeta, |
setter: propertySetter, |
||||
entity: WayEntity |
entity: WayEntity, |
||||
}) |
}) |
||||
Loading…
Reference in new issue