diff --git a/packages/ui-vue/components/checkbox/src/property-config/checkbox.property-config.ts b/packages/ui-vue/components/checkbox/src/property-config/checkbox.property-config.ts index a509f562262c70022fabbaf7d61091157870197a..fe077147129b33f4e5df027d885e383a7511a6ab 100644 --- a/packages/ui-vue/components/checkbox/src/property-config/checkbox.property-config.ts +++ b/packages/ui-vue/components/checkbox/src/property-config/checkbox.property-config.ts @@ -20,8 +20,8 @@ export class CheckBoxProperty extends InputBaseProperty { type: "string" }, trueValue: { - description: "选中值", - title: "选中时的值", + description: "选中时的值", + title: "选中的值", type: this.getBindingDataType(), visible: this.designViewModelField.type.name !== 'Boolean', refreshPanelAfterChanged: true, @@ -29,8 +29,8 @@ export class CheckBoxProperty extends InputBaseProperty { $converter: this.getTrueValueConverter() }, falseValue: { - description: "未选中值", - title: "未选中时的值", + description: "未选中时的值", + title: "未选中的值", type: this.getBindingDataType(), visible: this.designViewModelField.type.name !== 'Boolean', refreshPanelAfterChanged: true, diff --git a/packages/ui-vue/components/combo-tree/src/combo-tree.component.tsx b/packages/ui-vue/components/combo-tree/src/combo-tree.component.tsx index 5ab2f6e4ae2339b26648a849175f77d9338d782b..22c83afa22e02b998c6cfe3384302feb194575f5 100644 --- a/packages/ui-vue/components/combo-tree/src/combo-tree.component.tsx +++ b/packages/ui-vue/components/combo-tree/src/combo-tree.component.tsx @@ -53,10 +53,10 @@ export default defineComponent({ function onClear($event: Event) { modelValue.value = ''; if (showPopover.value) { - // comboTreeRef.value?.treeInstance?.clearSelection(); comboEditorRef.value?.hidePopup(); } context.emit('update:modelValue', ''); + context.emit('change', null, modelValue.value); context.emit('clear'); } diff --git a/packages/ui-vue/components/common/radio-checkbox/use-check.ts b/packages/ui-vue/components/common/radio-checkbox/use-check.ts index 78570a8ae9400b53d7822b5b2b8e17ca93b95597..0b7542813e81d675f5c9c1728f014f00c9cf762e 100644 --- a/packages/ui-vue/components/common/radio-checkbox/use-check.ts +++ b/packages/ui-vue/components/common/radio-checkbox/use-check.ts @@ -19,10 +19,12 @@ export function useCheck( // 展示原生单选框或者复选框 const shouldRenderNative = computed(() => parentProps?.type === 'default' || isUndefined(parentProps?.type)); + const modelValue = ref(props.modelValue); + // 如果是group const checked = computed(() => parentProps ? parentProps.modelValue === props.value || parentProps.modelValue.includes(props.value) : - props.trueValue != null ? props.modelValue === props.trueValue: !!props.modelValue + (props.trueValue != null ? props.modelValue === props.trueValue: !!props.modelValue) || !!props.checked ); // 按钮样式 @@ -36,7 +38,6 @@ export function useCheck( }); - const modelValue = ref(props.modelValue); const indeterminate = ref(props.indeterminate); watch(() => props.modelValue, (newValue: boolean) => { modelValue.value = newValue; @@ -86,7 +87,7 @@ export function useCheck( } } else { context.emit('update:checked', !checked.value); - context.emit('update:modelValue', !checked.value? props.trueValue : props.falseValue); + context.emit('update:modelValue', !checked.value? props.trueValue: props.falseValu); context.emit('changeValue', !checked.value? props.trueValue : props.falseValue); context.emit('change', { originalEvent: e, checked: !checked.value }); } diff --git a/packages/ui-vue/components/component/src/property-config/component.property-config.ts b/packages/ui-vue/components/component/src/property-config/component.property-config.ts index 8865e97f789c3f5c6e98c3512ab7d20975c0c24f..3310e5688e14384ab5d206e23f1711f1caffd7e4 100644 --- a/packages/ui-vue/components/component/src/property-config/component.property-config.ts +++ b/packages/ui-vue/components/component/src/property-config/component.property-config.ts @@ -55,13 +55,8 @@ export class ComponentProperty extends BaseControlProperty { ]; const self = this; const initialData = self.eventsEditorUtils['formProperties'](propertyData, self.viewModelId, events); - const properties = {}; - properties[self.viewModelId] = { - type: 'events-editor', - editor: { - initialData - } - }; + const properties = self.createBaseEventProperty(initialData); + this.propertyConfig.categories['eventsEditor'] = { title: '事件', hideTitle: true, diff --git a/packages/ui-vue/components/data-grid/src/property-config/data-grid-column.property-config.ts b/packages/ui-vue/components/data-grid/src/property-config/data-grid-column.property-config.ts index 2d752e56aa3ea029770441065e0112736857747d..adb667ef024095b840e7dd68b6d96957c631c563 100644 --- a/packages/ui-vue/components/data-grid/src/property-config/data-grid-column.property-config.ts +++ b/packages/ui-vue/components/data-grid/src/property-config/data-grid-column.property-config.ts @@ -48,13 +48,8 @@ export class DataGriColumnProperty extends BaseControlProperty { ]; const self = this; const initialData = self.eventsEditorUtils['formProperties'](propertyData, self.viewModelId, events); - const properties = {}; - properties[self.viewModelId] = { - type: 'events-editor', - editor: { - initialData - } - }; + const properties = self.createBaseEventProperty(initialData); + this.propertyConfig.categories['eventsEditor'] = { title: '事件', hideTitle: true, diff --git a/packages/ui-vue/components/data-grid/src/property-config/data-grid.property-config.ts b/packages/ui-vue/components/data-grid/src/property-config/data-grid.property-config.ts index 86256e7155abfb84972e52af4e5e555eee6b9461..530a88c7ae4605d3db3f6fa1d6ed069dee4bee4e 100644 --- a/packages/ui-vue/components/data-grid/src/property-config/data-grid.property-config.ts +++ b/packages/ui-vue/components/data-grid/src/property-config/data-grid.property-config.ts @@ -325,16 +325,8 @@ export class DataGridProperty extends BaseControlProperty { } const self = this; const initialData = self.eventsEditorUtils['formProperties'](propertyData, self.viewModelId, events); - const properties = {}; - properties[self.viewModelId] = { - type: 'events-editor', - editor: { - initialData, - viewSourceHandle: (commandInfo: any) => { - self.eventsEditorUtils.jumpToMethod(commandInfo); - } - } - }; + const properties = self.createBaseEventProperty(initialData); + this.propertyConfig.categories['eventsEditor'] = { title: '事件', hideTitle: true, diff --git a/packages/ui-vue/components/external-container/src/property-config/external-container.property-config.ts b/packages/ui-vue/components/external-container/src/property-config/external-container.property-config.ts index 56c17a6adff5703adeff222ea0dc50ddce730e00..80826e9b8b4d5b0fb4fe543efb742e8219195180 100644 --- a/packages/ui-vue/components/external-container/src/property-config/external-container.property-config.ts +++ b/packages/ui-vue/components/external-container/src/property-config/external-container.property-config.ts @@ -98,11 +98,8 @@ export class ExternalContainerProperty extends BaseControlProperty { ]; const self = this; const initialData = self.eventsEditorUtils['formProperties'](propertyData, self.viewModelId, events); - const properties = {}; - properties[self.viewModelId] = { - type: 'events-editor', - editor: { initialData } - }; + const properties = self.createBaseEventProperty(initialData); + return { title: '事件', hideTitle: true, diff --git a/packages/ui-vue/components/filter-bar/src/property-config/filter-bar.property-config.ts b/packages/ui-vue/components/filter-bar/src/property-config/filter-bar.property-config.ts index c20cc0d0c8f4a7cb7a96afef7cd7dd7d02bb1e88..7557a13e3033fe70b88c336251f614d6f9e6a1a5 100644 --- a/packages/ui-vue/components/filter-bar/src/property-config/filter-bar.property-config.ts +++ b/packages/ui-vue/components/filter-bar/src/property-config/filter-bar.property-config.ts @@ -87,13 +87,8 @@ export class FilterBarPropertyConfig extends InputBaseProperty { ]; const self = this; const initialData = self.eventsEditorUtils['formProperties'](propertyData, self.viewModelId, events); - const properties = {}; - properties[self.viewModelId] = { - type: 'events-editor', - editor: { - initialData - } - }; + const properties = self.createBaseEventProperty(initialData); + this.propertyConfig.categories['eventsEditor'] = { title: '事件', hideTitle: true, diff --git a/packages/ui-vue/components/lookup/src/composition/use-treegrid.tsx b/packages/ui-vue/components/lookup/src/composition/use-treegrid.tsx index c22892e838ec3e64b0ccc9db1cfafe6490313c1c..6dc7352a04631145ad83e40e4554e5069f1ef8a3 100644 --- a/packages/ui-vue/components/lookup/src/composition/use-treegrid.tsx +++ b/packages/ui-vue/components/lookup/src/composition/use-treegrid.tsx @@ -26,7 +26,6 @@ export function useTreegrid(props: LookupProps, context: SetupContext) { // const treeRowOptions = useTreeRowOptions(lookupOptions, false); const treeRowOptions = inject(LOOKUP_TREEROW_OPTIONS) as any; - const lookupSelectionsManager = inject(LOOKUP_SELECTIONS_MANAGER) as LookupSelectionsManager; const useCheckPropsComposition = useCheckProps(props, lookupStates); @@ -86,9 +85,21 @@ export function useTreegrid(props: LookupProps, context: SetupContext) { function onUnSelectItem(item: VisualData) { unSelectTreeNode(item); const nodeId = get(item.raw, lookupOptions.idField); - const selectedNodeIds = getTreeNodeIdsWithCascadeValue(nodeId, false); - if (selectedNodeIds.length) { - unSelectTreeNodes([nodeId, ...selectedNodeIds]); + const selectedNodeIds = getTreeNodeIdsWithCascadeValue(nodeId); + + if (needGetAllChildNodes(item.raw)) { + const params = buildGetAllChildrenQueryParams(item.raw); + getData(params).then((result: LookupHttpResult) => { + const children: any[] = result.items || []; + const items = children.filter(n => !n.addtional && (n.selectable || n.selectable === undefined)); + if (items && items.length) { + selectTreeNodes(items); + } + const childs = (items || []).map(node => node.id); + unSelectTreeNodes([nodeId, ...selectedNodeIds, ...childs]); + }); + } else { + unSelectTreeNodes([nodeId,...selectedNodeIds]); } } diff --git a/packages/ui-vue/components/lookup/src/property-config/lookup.property-config.ts b/packages/ui-vue/components/lookup/src/property-config/lookup.property-config.ts index 445d194aee64456f4724fbbdc533bdc605592d24..0cd6bddc1f999556c0aa05aacba75ac23af2f98a 100644 --- a/packages/ui-vue/components/lookup/src/property-config/lookup.property-config.ts +++ b/packages/ui-vue/components/lookup/src/property-config/lookup.property-config.ts @@ -809,21 +809,21 @@ export class LookupPropertyConfig extends InputBaseProperty { refreshPanelAfterChanged: true, title: "启用级联选择", type: "boolean", - visible: this.isTree(editorOptions) && !!editorOptions.multiSelect + visible: false // this.isTree(editorOptions) && !!editorOptions.multiSelect }, showCascadeControl: { description: "显示级联选择控件", $converter: lookupDefaultConverter, title: "显示级联选择控件", type: "boolean", - visible: !!editorOptions.enableCascade && this.isTree(editorOptions) + visible: false // !!editorOptions.enableCascade && this.isTree(editorOptions) }, cascadeValue: { description: "级联选择默认状态", $converter: lookupDefaultConverter, title: "级联状态", type: "string", - visible: !!editorOptions.enableCascade && this.isTree(editorOptions), + visible: false, // !!editorOptions.enableCascade && this.isTree(editorOptions), editor: { ...this.comboListEditor, data: cascadeItems, @@ -851,19 +851,9 @@ export class LookupPropertyConfig extends InputBaseProperty { const self = this; const events = LookupEvents; - // this.appendFieldValueChangeEvents(propertyData, events); - const initialData = self.eventsEditorUtils['formProperties'](propertyData, self.viewModelId, events); - const properties = {}; - properties[self.viewModelId] = { - type: 'events-editor', - editor: { - initialData, - viewSourceHandle: (commandInfo: any) => { - self.eventsEditorUtils.jumpToMethod(commandInfo); - } - } - }; + const properties = self.createBaseEventProperty(initialData); + return { title: '事件', hideTitle: true, diff --git a/packages/ui-vue/components/property-panel/src/composition/entity/base-property.ts b/packages/ui-vue/components/property-panel/src/composition/entity/base-property.ts index d37b0f6e2d7b8c78b67dc88bcb827c2be2e0553e..d49cb78a1c8395db8542f024a4b24ecd09619ac0 100644 --- a/packages/ui-vue/components/property-panel/src/composition/entity/base-property.ts +++ b/packages/ui-vue/components/property-panel/src/composition/entity/base-property.ts @@ -379,4 +379,19 @@ export class BaseControlProperty { } return 'Container'; } + + createBaseEventProperty(initialData: any) { + const properties = {}; + properties[this.viewModelId] = { + type: 'events-editor', + editor: { + initialData: initialData, + viewSourceHandle: (commandInfo: any) => { + this.eventsEditorUtils.jumpToMethod(commandInfo); + } + } + }; + + return properties; + } } diff --git a/packages/ui-vue/components/property-panel/src/composition/entity/input-base-property.ts b/packages/ui-vue/components/property-panel/src/composition/entity/input-base-property.ts index 7b116f703501d7e752e0c964ec06ce0355bcac7c..dd7ecfe458d1804902a2dde1e0eb568f96447f43 100644 --- a/packages/ui-vue/components/property-panel/src/composition/entity/input-base-property.ts +++ b/packages/ui-vue/components/property-panel/src/composition/entity/input-base-property.ts @@ -589,16 +589,8 @@ export class InputBaseProperty extends BaseControlProperty { this.appendFieldValueChangeEvents(propertyData, eventList); const initialData = self.eventsEditorUtils['formProperties'](propertyData, self.viewModelId, eventList); - const properties = {}; - properties[self.viewModelId] = { - type: 'events-editor', - editor: { - initialData, - viewSourceHandle: (commandInfo: any) => { - self.eventsEditorUtils.jumpToMethod(commandInfo); - } - } - }; + const properties = self.createBaseEventProperty(initialData); + const eventsEditorConfig = { title: '事件', hideTitle: true, diff --git a/packages/ui-vue/components/query-solution/src/property-config/query-solution.property-config.ts b/packages/ui-vue/components/query-solution/src/property-config/query-solution.property-config.ts index 93c54d4d8709fc7cbbfd58648a0291214f9fcd93..5b592e79ef9f23d39aefd587e2e4b89c65c280f8 100644 --- a/packages/ui-vue/components/query-solution/src/property-config/query-solution.property-config.ts +++ b/packages/ui-vue/components/query-solution/src/property-config/query-solution.property-config.ts @@ -124,13 +124,8 @@ export class QuerySolutionPropertyConfig extends InputBaseProperty { ]; const self = this; const initialData = self.eventsEditorUtils['formProperties'](propertyData, self.viewModelId, events); - const properties = {}; - properties[self.viewModelId] = { - type: 'events-editor', - editor: { - initialData - } - }; + const properties = self.createBaseEventProperty(initialData); + this.propertyConfig.categories['eventsEditor'] = { title: '事件', hideTitle: true, diff --git a/packages/ui-vue/components/response-toolbar/src/property-config/response-toolbar-item.property-config.ts b/packages/ui-vue/components/response-toolbar/src/property-config/response-toolbar-item.property-config.ts index b236505c47cd437191be0781fd013ee18fcb406e..ce434095f09e2451d884aab803d387d94c3e8749 100644 --- a/packages/ui-vue/components/response-toolbar/src/property-config/response-toolbar-item.property-config.ts +++ b/packages/ui-vue/components/response-toolbar/src/property-config/response-toolbar-item.property-config.ts @@ -106,13 +106,8 @@ export class ResponseToolbarItemProperty extends BaseControlProperty { ]; const self = this; const initialData = self.eventsEditorUtils['formProperties'](propertyData, self.viewModelId, events); - const properties = {}; - properties[self.viewModelId] = { - type: 'events-editor', - editor: { - initialData - } - }; + const properties = self.createBaseEventProperty(initialData); + this.propertyConfig.categories['eventsEditor'] = { title: '事件', hideTitle: true, diff --git a/packages/ui-vue/components/switch/src/property-config/switch.property-config.ts b/packages/ui-vue/components/switch/src/property-config/switch.property-config.ts index 77947a3711353e9a76a894acac597d87f03840eb..7bbe224c30dbf4ad164aa3cbb41e06ae417625e2 100644 --- a/packages/ui-vue/components/switch/src/property-config/switch.property-config.ts +++ b/packages/ui-vue/components/switch/src/property-config/switch.property-config.ts @@ -58,8 +58,8 @@ export class SwitchProperty extends InputBaseProperty { } }, trueValue: { - description: "打开值", - title: "打开时的值", + description: "打开时的值", + title: "打开的值", type: this.getBindingDataType(), visible: this.designViewModelField.type.name !== 'Boolean', refreshPanelAfterChanged: true, @@ -67,8 +67,8 @@ export class SwitchProperty extends InputBaseProperty { $converter: this.getTrueValueConverter() }, falseValue: { - description: "关闭值", - title: "关闭时的值", + description: "关闭时的值", + title: "关闭的值", type: this.getBindingDataType(), visible: this.designViewModelField.type.name !== 'Boolean', refreshPanelAfterChanged: true, diff --git a/packages/ui-vue/components/tabs/src/property-config/tab-toolbar-item.property-config.ts b/packages/ui-vue/components/tabs/src/property-config/tab-toolbar-item.property-config.ts index a169fb9d3e5ff6590fd99a66fb24d92994ff2840..cdd89377672fd1b8774f5ed9a7cf0202aa6cfc64 100644 --- a/packages/ui-vue/components/tabs/src/property-config/tab-toolbar-item.property-config.ts +++ b/packages/ui-vue/components/tabs/src/property-config/tab-toolbar-item.property-config.ts @@ -75,13 +75,8 @@ export class TabToolbarItemProperty extends BaseControlProperty { ]; const self = this; const initialData = self.eventsEditorUtils['formProperties'](propertyData, self.viewModelId, events); - const properties = {}; - properties[self.viewModelId] = { - type: 'events-editor', - editor: { - initialData - } - }; + const properties = self.createBaseEventProperty(initialData); + this.propertyConfig.categories['eventsEditor'] = { title: '事件', hideTitle: true, diff --git a/packages/ui-vue/components/tabs/src/property-config/tabs.property-config.ts b/packages/ui-vue/components/tabs/src/property-config/tabs.property-config.ts index 260c553cfe818c4d89e9903544bcca22d2322d48..8f93ae374a75c3d3dd4805a1dbe39bf2510ec74b 100644 --- a/packages/ui-vue/components/tabs/src/property-config/tabs.property-config.ts +++ b/packages/ui-vue/components/tabs/src/property-config/tabs.property-config.ts @@ -115,13 +115,8 @@ export class TabsProperty extends BaseControlProperty { ]; const self = this; const initialData = self.eventsEditorUtils['formProperties'](propertyData, self.viewModelId, events); - const properties = {}; - properties[self.viewModelId] = { - type: 'events-editor', - editor: { - initialData - } - }; + const properties = self.createBaseEventProperty(initialData); + this.propertyConfig.categories['eventsEditor'] = { title: '事件', hideTitle: true, diff --git a/packages/ui-vue/components/tree-grid/src/property-config/tree-grid.property-config.ts b/packages/ui-vue/components/tree-grid/src/property-config/tree-grid.property-config.ts index 4c1061692e5dfbb65d87bc51b282c3d39ee7abbf..6f18c159a98151ed13ed344933254ab184a99402 100644 --- a/packages/ui-vue/components/tree-grid/src/property-config/tree-grid.property-config.ts +++ b/packages/ui-vue/components/tree-grid/src/property-config/tree-grid.property-config.ts @@ -170,13 +170,8 @@ export class TreeGridProperty extends BaseControlProperty { ]; const self = this; const initialData = self.eventsEditorUtils['formProperties'](propertyData, self.viewModelId, events); - const properties = {}; - properties[self.viewModelId] = { - type: 'events-editor', - editor: { - initialData - } - }; + const properties = self.createBaseEventProperty(initialData); + this.propertyConfig.categories['eventsEditor'] = { title: '事件', hideTitle: true,