提交 1b4f4220 编写于 作者: tony001's avatar tony001

update:更新

上级 5592e3ca
import { ControlPropsBase, ControlStateBase, UIBase } from '@core';
import { RouteLocationNormalizedLoaded, Router, useRoute, useRouter } from 'vue-router';
import { ControlPropsBase, ControlStateBase, IParam, UIBase } from '@core';
/**
* @description 部件基类
......@@ -9,67 +8,66 @@ import { RouteLocationNormalizedLoaded, Router, useRoute, useRouter } from 'vue-
export class ControlBase {
/**
* @description 部件状态
* 部件状态数据
*
* @type {ControlStateBase}
* @memberof ControlBase
*/
public controlState: ControlStateBase;
public declare state: ControlStateBase;
/**
* @description 路由器
* @type {Router}
* 输入参数
*
* @type {IParam}
* @memberof ControlBase
*/
public router: Router = useRouter();
public declare props: IParam;
/**
* @description 路由
* @type {RouteLocationNormalizedLoaded}
* 输出事件
*
* @type {Function}
* @memberof ControlBase
*/
public route: RouteLocationNormalizedLoaded = useRoute();
public declare emit: Function;
/**
* @description 事件
* @type {*}
* Creates an instance of ControlBase.
* @param {*} options 配置参数
* @memberof ControlBase
*/
public emit: any;
/**
* Creates an instance of ControlBase.
* @param {*} options 配置参数
* @param {ControlPropsBase} props 输入参数
* @param {Function} emit 输出事件
* @memberof ControlBase
*/
constructor(options: any) {
this.controlState = reactive(options);
constructor(options: any, props: ControlPropsBase, emit: Function) {
this.state = reactive(options);
this.props = props;
this.emit = emit;
}
/**
* @description 根据props调整设置部分部件基类
* @param {ControlPropsBase} props 传入props
* @memberof ControlBase
*/
public setState(props: ControlPropsBase) {
// toDo 项目级配置入口,优先级大于平台,提供全局的一次性配置
// 只读属性处理:把props的属性的Ref赋给state,以维持响应性。
this.controlState.viewSubject = toRef(props, 'viewSubject') as any;
public setState() {
this.state.viewSubject = toRef(this.props, 'viewSubject') as any;
}
/**
* @description 使用部件上下文参数逻辑块
* @param {ControlPropsBase} props
* @return {*}
* @memberof ControlBase
*/
public useControlContextParams(props: ControlPropsBase) {
const context = UIBase.toOneWayRef(props, 'context');
const viewParams = UIBase.toOneWayRef(props, 'viewParams');
public useControlContextParams() {
const context = UIBase.toOneWayRef(this.props, 'context');
const viewParams = UIBase.toOneWayRef(this.props, 'viewParams');
// 把Ref赋值到State上进行解包
this.controlState.context = context;
this.controlState.viewParams = viewParams;
this.state.context = context;
this.state.viewParams = viewParams;
return { context, viewParams };
}
......@@ -81,12 +79,11 @@ export class ControlBase {
* @return {*}
* @memberof ControlBase
*/
public moduleInstall(props: ControlPropsBase, emit?: Function) {
this.emit = emit?.bind(this);
this.setState(props);
this.useControlContextParams(props);
public moduleInstall() {
this.setState();
this.useControlContextParams();
return {
state: this.controlState,
state: this.state
};
}
}
......@@ -14,7 +14,7 @@ export class ExpBarControl extends MainControl {
* @type {ExpBarControlState}
* @memberof ExpBarControl
*/
public declare controlState: ExpBarControlState;
public declare state: ExpBarControlState;
/**
* @description 处理部件事件
......@@ -23,7 +23,7 @@ export class ExpBarControl extends MainControl {
*/
public handleCtrlEvent(actionParam: IActionParam) {
const { tag, action, data } = actionParam;
const { selection } = this.controlState;
const { selection } = this.state;
switch (action) {
case 'selectionchange':
this.onSelectionChange(data);
......@@ -66,16 +66,13 @@ export class ExpBarControl extends MainControl {
/**
* @description 安装部件所有功能模块的方法
* @param {ExpBarControlProps} props 传入的Props
* @param {Function} [emit]
* @return {*}
* @memberof ExpBarControl [emit] 事件
*/
public moduleInstall(props: ExpBarControlProps, emit?: Function) {
const superParams = super.moduleInstall(props, emit);
public moduleInstall() {
const superParams = super.moduleInstall();
return {
...superParams,
state: this.controlState,
handleCtrlEvent: this.handleCtrlEvent.bind(this)
};
}
......
......@@ -13,32 +13,26 @@ export class MainControl extends ControlBase {
* @type {MainControlState}
* @memberof MainControl
*/
public declare controlState: MainControlState;
public declare state: MainControlState;
/**
* @description 根据props调整设置部件state
* @param {MainControlProps} props 传入的Props
* @memberof MainControl
*/
public setState(props: MainControlProps) {
super.setState(props);
// 只读属性处理:把props的属性的Ref赋给state,以维持响应性。
this.controlState.showBusyIndicator = toRef(props, 'showBusyIndicator') as any;
this.controlState.controlAction = toRef(props, 'controlAction') as any;
public setState() {
super.setState();
this.state.showBusyIndicator = toRef(this.props, 'showBusyIndicator') as any;
this.state.controlAction = toRef(this.props, 'controlAction') as any;
}
/**
* @description 安装部件所有功能模块的方法
* @param {MainControlProps} props 传入的Props
* @param {Function} [emit] [emit] 事件
* @return {*}
* @memberof MainControl
*/
public moduleInstall(props: MainControlProps, emit?: Function) {
const superParams = super.moduleInstall(props, emit);
public moduleInstall() {
const superParams = super.moduleInstall();
return {
...superParams,
state: this.controlState,
...superParams
};
}
}
import { Ref } from 'vue';
import { MenuControlProps, MenuControlState, IActionParam, ControlBase, IParam, AppFuncService, deepCopy } from '@core';
import { MenuControlState, IActionParam, ControlBase, IParam, deepCopy } from '@core';
import { useRoute } from 'vue-router';
/**
* @description 菜单部件
......@@ -14,17 +15,16 @@ export class MenuControl extends ControlBase {
* @type {MenuControlState}
* @memberof MenuControl
*/
public declare controlState: MenuControlState;
public declare state: MenuControlState;
/**
* @description 根据props调整设置部分部件基类
* @param {MenuControlProps} props 菜单输入属性
* @memberof MenuControl
*/
public setState(props: MenuControlProps) {
super.setState(props);
this.controlState.defaultView = toRef(props, 'defaultView') as any;
this.controlState.menuAlign = toRef(props, 'menuAlign') as any;
public setState() {
super.setState();
this.state.defaultView = toRef(this.props, 'defaultView') as any;
this.state.menuAlign = toRef(this.props, 'menuAlign') as any;
}
/**
......@@ -34,7 +34,7 @@ export class MenuControl extends ControlBase {
*/
public computedEffectiveMenus(items: IParam[]) {
items.forEach((item: IParam) => {
const { authService } = this.controlState;
const { authService } = this.state;
// TODO 获取菜单权限
// if (!authService?.getMenusPermission?.(item)) {
// item.hidden = true;
......@@ -53,7 +53,7 @@ export class MenuControl extends ControlBase {
public handleDefaultOpens(items: IParam[], defaultOpens: Ref<string[]>) {
items.forEach((item: any) => {
if (item.expanded) {
defaultOpens.value = [... defaultOpens.value, item.name];
defaultOpens.value = [...defaultOpens.value, item.name];
}
if (item.items?.length > 0) {
this.handleDefaultOpens(item.items, defaultOpens);
......@@ -66,11 +66,12 @@ export class MenuControl extends ControlBase {
* @memberof MenuControl
*/
public handleDefaultSelect() {
const { funcs, defaultView, menuAlign } = this.controlState;
const defaultSelectRef = toRef(this.controlState, 'defaultSelect');
const dataRef = toRef(this.controlState, 'menus');
if (this.route.matched?.length == 2) {
const [{ }, matched] = this.route.matched;
const route = useRoute();
const { funcs, defaultView, menuAlign } = this.state;
const defaultSelectRef = toRef(this.state, 'defaultSelect');
const dataRef = toRef(this.state, 'menus');
if (route.matched?.length == 2) {
const [{ }, matched] = route.matched;
const appFunc: any = funcs.find((func: any) => Object.is(func.routePath, matched.path) && Object.is(func.funcType, 'APPVIEW'));
if (appFunc) {
this.computeMenuSelect(dataRef.value, appFunc.funcTag);
......@@ -102,9 +103,9 @@ export class MenuControl extends ControlBase {
* @memberof MenuControl
*/
public computeMenuSelect(menus: IParam[], funcTag: string): boolean {
const { funcs } = this.controlState;
const defaultSelectRef = toRef(this.controlState, 'defaultSelect');
const defaultOpensRef = toRef(this.controlState, 'defaultOpens');
const { funcs } = this.state;
const defaultSelectRef = toRef(this.state, 'defaultSelect');
const defaultOpensRef = toRef(this.state, 'defaultOpens');
return menus.some((item: any) => {
if (Object.is(funcTag, '') && item.funcTag && item.openDefault && !item.hidden) {
const appFunc = funcs?.find((func: any) => Object.is(func.funcTag, item.funcTag));
......@@ -163,34 +164,33 @@ export class MenuControl extends ControlBase {
* @memberof MenuControl
*/
public menuClick(item: IParam) {
const { context, viewParams } = this.controlState;
const { context, viewParams } = this.state;
App.getAppFuncService().executeAppFunc(item, deepCopy(context), deepCopy(viewParams));
}
/**
* @description 使用加载功能模块
* @param {MenuControlProps} props 传入的props
* @return {*}
* @memberof MenuControl
*/
public useLoad(props: MenuControlProps){
const { viewSubject, controlName } = this.controlState;
const load = async (opt: any = {})=>{
const dataRef = toRef(this.controlState, 'menus');
const defaultOpensRef = toRef(this.controlState, 'defaultOpens');
public useLoad() {
const { viewSubject, controlName } = this.state;
const load = async (opt: any = {}) => {
const dataRef = toRef(this.state, 'menus');
const defaultOpensRef = toRef(this.state, 'defaultOpens');
this.computedEffectiveMenus(dataRef.value);
this.handleDefaultOpens(dataRef.value, defaultOpensRef);
this.handleDefaultSelect();
}
// 订阅viewSubject,监听load行为
if(viewSubject){
let subscription = viewSubject.subscribe(({ tag, action, data }: IActionParam)=>{
if(Object.is(controlName, tag) && Object.is("load", action) ){
if (viewSubject) {
let subscription = viewSubject.subscribe(({ tag, action, data }: IActionParam) => {
if (Object.is(controlName, tag) && Object.is("load", action)) {
load(data);
}
})
// 部件卸载时退订viewSubject
onUnmounted(()=>{
onUnmounted(() => {
subscription.unsubscribe();
})
}
......@@ -206,7 +206,7 @@ export class MenuControl extends ControlBase {
*/
public menuSelect($event: IParam) {
const { key } = $event;
const dataRef = toRef(this.controlState, 'menus');
const dataRef = toRef(this.state, 'menus');
let item = this.compute(dataRef.value, key);
if (Object.keys(item).length > 0) {
this.menuClick(item);
......@@ -215,23 +215,20 @@ export class MenuControl extends ControlBase {
/**
* @description 安装部件所有功能模块的方法
* @param {MenuControlProps} props 传入的Props
* @param {Function} [emit] [emit] 事件
* @return {*}
* @memberof MenuControl
*/
public moduleInstall(props: MenuControlProps, emit?: Function) {
const superParams = super.moduleInstall(props, emit);
const { load } = this.useLoad(props)
public moduleInstall() {
const superParams = super.moduleInstall();
const { load } = this.useLoad();
const menuSelect = this.menuSelect.bind(this);
this.menuSelect =($event: IParam) => {
this.menuSelect = ($event: IParam) => {
menuSelect($event);
}
return {
...superParams,
state: this.controlState,
load,
menuSelect: this.menuSelect,
};
......
import { Ref, ref } from 'vue';
import { IActionParam, MainControl } from '@core';
import { PickupViewPanelControlProps } from './pickupviewpanel-control-prop';
import { PickupViewPanelControlState } from './pickupviewpanel-control-state';
......@@ -14,19 +13,9 @@ export class PickupViewPanelControl extends MainControl {
/**
* @description 部件状态
* @type {FormControlState}
* @memberof FormControl
*/
public declare controlState: PickupViewPanelControlState;
/**
* @description 根据props设置部件state
* @param {PickupViewPanelControlProps} props
* @memberof PickupViewPanelControl
*/
public setState(props: PickupViewPanelControlProps) {
super.setState(props);
}
public declare state: PickupViewPanelControlState;
/**
* @description
......@@ -34,7 +23,7 @@ export class PickupViewPanelControl extends MainControl {
* @memberof PickupViewPanelControl
*/
public useLoad(props: PickupViewPanelControlProps) {
const { viewSubject, controlName, context, viewParams } = this.controlState;
const { viewSubject, controlName, context, viewParams } = this.state;
// 订阅viewSubject,监听load行为
if (viewSubject) {
let subscription = viewSubject.subscribe(({ tag, action, data }: IActionParam) => {
......@@ -58,7 +47,7 @@ export class PickupViewPanelControl extends MainControl {
*/
public handleViewEvent(actionParam: IActionParam) {
const { tag, action, data } = actionParam;
const { controlName } = this.controlState;
const { controlName } = this.state;
if (Object.is("selectionChange", action)) {
this.emit('ctrlEvent', { tag: controlName, action: action, data: data });
}
......@@ -66,17 +55,14 @@ export class PickupViewPanelControl extends MainControl {
/**
* @description 安装部件所有功能模块的方法
* @param {PickupViewPanelControlProps} props 传入的Props
* @param {Function} [emit]
* @return {*}
* @memberof FormControl [emit] 事件
* @memberof PickupViewPanelControl
*/
public moduleInstall(props: PickupViewPanelControlProps, emit?: Function) {
const superParams = super.moduleInstall(props, emit);
public moduleInstall() {
const superParams = super.moduleInstall();
return {
...superParams,
handleViewEvent: this.handleViewEvent.bind(this),
state: this.controlState
handleViewEvent: this.handleViewEvent.bind(this)
};
}
}
\ No newline at end of file
import { deepCopy, FormControl, FormControlProps, FormControlState } from '@core';
import { FormControl, FormControlState } from '@core';
/**
* @description 表单部件
* @description 搜索表单部件
* @export
* @class FormControl
* @extends {MainControl}
* @todo 部件加载loading,能否不写在行为方法里。
*/
export class SearchFormControl extends FormControl {
/**
......@@ -13,18 +12,18 @@ export class SearchFormControl extends FormControl {
* @type {FormControlState}
* @memberof FormControl
*/
public declare controlState: FormControlState;
public declare state: FormControlState;
/**
* @description 查询
* @memberof SearchFormControl
*/
public onSearch() {
const { controlName } = this.controlState;
const { controlName } = this.state;
this.emit("ctrlEvent", {
tag: controlName,
action: "selectionChange",
data: this.controlState.data,
data: this.state.data,
});
}
......@@ -47,18 +46,15 @@ export class SearchFormControl extends FormControl {
/**
* @description 安装部件所有功能模块的方法
* @param {FormControlProps} props 传入的Props
* @param {Function} [emit]
* @return {*}
* @memberof FormControl [emit] 事件
* @memberof SearchFormControl
*/
public moduleInstall(props: FormControlProps, emit?: Function) {
const superParams = super.moduleInstall(props, emit);
public moduleInstall() {
const superParams = super.moduleInstall();
// 表单行为能力启用
const { loadDraft } = this.useLoadDraft(props);
const { loadDraft } = this.useLoadDraft();
return {
...superParams,
state: this.controlState,
loadDraft,
onSearch: this.onSearch.bind(this),
onCancel: this.onCancel.bind(this),
......
......@@ -15,16 +15,15 @@ export class TreeControl extends MainControl {
* @type {TreeControlState}
* @memberof TreeControl
*/
public declare controlState: TreeControlState;
public declare state: TreeControlState;
/**
* @description 根据props调整设置部件state
* @param {TreeControlProps} props 传入的props
* @memberof TreeControl
*/
public setState(props: TreeControlProps): void {
super.setState(props);
this.controlState.isBranchAvailable = toRef(props, 'isBranchAvailable') as any;
public setState(): void {
super.setState();
this.state.isBranchAvailable = toRef(this.props, 'isBranchAvailable') as any;
}
/**
......@@ -38,7 +37,7 @@ export class TreeControl extends MainControl {
e.node.isCurrent = false;
return;
}
const { isBranchAvailable, currentselectedNode, multiple, selectedNodes, controlName } = this.controlState;
const { isBranchAvailable, currentselectedNode, multiple, selectedNodes, controlName } = this.state;
if (isBranchAvailable && e.node.leaf) {
if (currentselectedNode && Object.keys(currentselectedNode).length > 0) {
currentselectedNode.value.srfchecked = 0;
......@@ -47,7 +46,7 @@ export class TreeControl extends MainControl {
currentselectedNode.value = e.node;
if (!multiple) {
selectedNodes.push(currentselectedNode.value);
this.emit("ctrlEvent",{ tag: controlName, action: 'selectionchange', data: deepCopy(selectedNodes) });
this.emit("ctrlEvent", { tag: controlName, action: 'selectionchange', data: deepCopy(selectedNodes) });
}
}
}
......@@ -60,7 +59,7 @@ export class TreeControl extends MainControl {
* @memberof TreeControl
*/
private computecurNodeContext(curNode: any) {
const { context } = this.controlState;
const { context } = this.state;
let tempContext: any = {};
if (curNode && curNode.data && curNode.data.srfappctx) {
tempContext = deepCopy(curNode.data.srfappctx);
......@@ -72,19 +71,18 @@ export class TreeControl extends MainControl {
/**
* @description 使用加载功能模块
* @param {TreeControlProps} props 传入的props
* @return {*}
* @memberof TreeControl
*/
public useLoad(props: TreeControlProps) {
const { viewSubject, controlName } = this.controlState;
public useLoad() {
const { viewSubject, controlName } = this.state;
const load = async (node: any, isFirst: boolean = false) => {
if (node?.dataRef?.children) {
return null;
}
const {
controlService, data, viewParams, srfnodefilter
} = this.controlState;
} = this.state;
let tempViewParams: any = deepCopy(viewParams);
let curNode: any = {};
curNode = deepObjectMerge(curNode, node);
......@@ -128,7 +126,7 @@ export class TreeControl extends MainControl {
const isSelectedAll = node.checked;
// TODO 默认选中
// this.setDefaultSelection(items, isRoot, isSelectedAll);
this.emit("ctrlEvent",{ tag: controlName, action: "load", data: items });
this.emit("ctrlEvent", { tag: controlName, action: "load", data: items });
} catch (error) {
console.error(error);
}
......@@ -152,17 +150,14 @@ export class TreeControl extends MainControl {
/**
* @description 安装部件所有功能模块的方法
* @param {TreeControlProps} props 传入的Props
* @param {Function} [emit]
* @return {*}
* @memberof TreeControl [emit] 事件
* @memberof TreeControl
*/
public moduleInstall(props: TreeControlProps, emit?: Function) {
const superParams = super.moduleInstall(props, emit);
const { load } = this.useLoad(props);
public moduleInstall() {
const superParams = super.moduleInstall();
const { load } = this.useLoad();
return {
...superParams,
state: this.controlState,
treeNodeSelect: this.treeNodeSelect.bind(this),
load
};
......
import { deepCopy, ExpBarControl, IActionParam, IParam, UIUtil } from "@core";
import { TreeExpBarControlProps } from "./tree-exp-bar-control-prop";
import { TreeExpBarControlState } from "./tree-exp-bar-control-state";
/**
......@@ -14,7 +13,7 @@ export class TreeExpBarControl extends ExpBarControl {
* @type {ExpBarControlState}
* @memberof TreeExpBarControl
*/
public declare controlState: TreeExpBarControlState;
public declare state: TreeExpBarControlState;
protected onSelectionChange(args: any[]) {
if (args.length == 0) {
......@@ -31,7 +30,7 @@ export class TreeExpBarControl extends ExpBarControl {
const refView = this.getExpItemView({ nodeType: nodeType });
// TODO 选择视图面板支持
if (refView) {
const { selection } = this.controlState;
const { selection } = this.state;
const { tempContext, tempViewParams } = this.computeNavParams(arg);
// 置空
Object.assign(selection, {});
......@@ -48,7 +47,7 @@ export class TreeExpBarControl extends ExpBarControl {
protected getExpItemView(arg: any = {}): IParam | null {
const expMode: string = `EXPITEM:${arg.nodeType}`;
const { viewRefs } = this.controlState;
const { viewRefs } = this.state;
if (viewRefs && viewRefs.length > 0) {
const viewRef = viewRefs.find((_viewRef: any) => _viewRef.name == expMode);
return viewRef ? deepCopy(viewRef) : null;
......@@ -60,7 +59,7 @@ export class TreeExpBarControl extends ExpBarControl {
protected computeNavParams(arg: any): { tempContext: any, tempViewParams: any } {
const tempContext: any = {};
const tempViewParams: any = {};
let { counter, context } = this.controlState;
let { counter, context } = this.state;
if (arg && arg.navfilter) {
Object.defineProperty(tempViewParams, arg.navfilter, {
value: arg.srfkey,
......@@ -104,11 +103,10 @@ export class TreeExpBarControl extends ExpBarControl {
/**
* @description 使用加载功能模块
* @param {TreeExpBarControlProps} props 传入的props
* @memberof TreeExpBarControl
*/
public useLoad(props: TreeExpBarControlProps) {
const { viewSubject, controlName, xDataControlName } = this.controlState;
public useLoad() {
const { viewSubject, controlName, xDataControlName } = this.state;
if (viewSubject) {
let subscription = viewSubject.subscribe(({ tag, action, data }: IActionParam) => {
if (Object.is(controlName, tag)) {
......@@ -124,16 +122,14 @@ export class TreeExpBarControl extends ExpBarControl {
/**
* @description 安装部件所有功能模块的方法
* @param {TreeExpBarControlProps} props 传入的Props
* @param {Function} [emit]
* @return {*}
* @memberof TreeExpBarControl [emit] 事件
* @memberof TreeExpBarControl
*/
public moduleInstall(props: TreeExpBarControlProps, emit?: Function) {
const superParams = super.moduleInstall(props, emit);
this.useLoad(props);
public moduleInstall() {
const superParams = super.moduleInstall();
this.useLoad();
return {
...superParams,
...superParams
};
}
}
\ No newline at end of file
......@@ -20,7 +20,7 @@ interface CtrlEmit {
}
const emit = defineEmits < CtrlEmit > ();
const { state, menuSelect } = new MenuControl(CtrlConfig).moduleInstall(props, emit);
const { state, menuSelect } = new MenuControl(CtrlConfig, props, emit).moduleInstall();
// 暴露内部状态及能力
defineExpose({ state, name: '{{ctrl.name}}' });
......
......@@ -25,7 +25,7 @@ interface CtrlEmit {
const emit = defineEmits < CtrlEmit > ();
// 安装功能模块,提供状态和能力方法
const { state, handleEditorEvent, handleComponentEvent } = new FormControl(CtrlConfig).moduleInstall(props, emit);
const { state, handleEditorEvent, handleComponentEvent } = new FormControl(CtrlConfig, props, emit).moduleInstall();
// 暴露内部状态及能力
defineExpose({ state, name: '{{ctrl.name}}' });
......
......@@ -33,7 +33,7 @@ interface CtrlEmit {
const emit = defineEmits < CtrlEmit > ();
// 安装功能模块,提供状态和能力
const { state, load, handleEditorEvent, handleToolbarEvent, custom } = new GridControl(CtrlConfig).moduleInstall(props, emit);
const { state, load, handleEditorEvent, handleToolbarEvent, custom } = new GridControl(CtrlConfig, props, emit).moduleInstall();
const { scrollOption, rowKey, rowClassName, customRow, rowSelectionOption, resizeColumn, handleGridChange } = custom;
// 暴露内部状态及能力
......
......@@ -31,7 +31,7 @@ interface CtrlEmit {
const emit = defineEmits < CtrlEmit > ();
// 安装功能模块,提供状态和能力方法
const { state, handleViewEvent } = new PickupViewPanelControl(CtrlConfig).moduleInstall(props, emit);
const { state, handleViewEvent } = new PickupViewPanelControl(CtrlConfig, props, emit).moduleInstall();
// 暴露内部状态及能力
defineExpose({ state, name: '{{ctrl.name}}' });
......
......@@ -31,7 +31,7 @@ interface CtrlEmit {
const emit = defineEmits < CtrlEmit > ();
// 安装功能模块,提供状态和能力方法
const { state, inited, viewdata, viewparam } = new PickupViewPanelControl(CtrlConfig).moduleInstall(props, emit);
const { state, inited, viewdata, viewparam } = new PickupViewPanelControl(CtrlConfig, props, emit).moduleInstall();
// 暴露内部状态及能力
defineExpose({ state, name: '{{ctrl.name}}' });
......
......@@ -26,7 +26,7 @@ interface CtrlEmit {
const emit = defineEmits<CtrlEmit>();
// 安装功能模块,提供状态和能力方法
const { state, handleEditorEvent, handleComponentEvent, onSearch, loadDraft, onOk, onCancel } = new SearchFormControl(CtrlConfig).moduleInstall(props, emit);
const { state, handleEditorEvent, handleComponentEvent, onSearch, loadDraft, onOk, onCancel } = new SearchFormControl(CtrlConfig, props, emit).moduleInstall();
</script>
<template>
......
......@@ -35,7 +35,7 @@ interface CtrlEmit {
const emit = defineEmits < CtrlEmit > ();
// 安装功能模块,提供状态和能力方法
const { state, handleCtrlEvent } = new TreeExpBarControl(CtrlConfig).moduleInstall(props, emit);
const { state, handleCtrlEvent } = new TreeExpBarControl(CtrlConfig, props, emit).moduleInstall();
// 暴露内部状态及能力
defineExpose({ state, name: '{{ctrl.name}}' });
......
......@@ -29,7 +29,7 @@ interface CtrlEmit {
const emit = defineEmits<CtrlEmit>();
// 安装功能模块,提供状态和能力方法
const { state, load, treeNodeSelect } = new TreeControl(CtrlConfig).moduleInstall(props, emit);
const { state, load, treeNodeSelect } = new TreeControl(CtrlConfig, props, emit).moduleInstall();
// 暴露内部状态及能力
defineExpose({ state, name: '{{ctrl.name}}' });
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册