提交 272ed9fb 编写于 作者: tony001's avatar tony001

update:更新

上级 a3ab3e1d
......@@ -14,10 +14,10 @@ export interface IActionParam {
/**
* @description 触发行为
* @type {('LOAD' | 'SAVE' | 'REMOVE' | 'AUTOLOAD' | 'LOADDRAFT' | 'FILTER' | 'REFRESH_PARENT' | string)}
* @type { string }
* @memberof IActionParam
*/
action: 'LOAD' | 'SAVE' | 'REMOVE' | 'AUTOLOAD' | 'LOADDRAFT' | 'FILTER' | 'REFRESH_PARENT' | string;
action: string;
/**
* @description 数据
......
......@@ -96,15 +96,23 @@ export class AppSysAction {
* @return {*}
*/
public static edit(params: IUIActionParams) {
const { actionEnvironment } = params;
const { actionEnvironment, data } = params;
// 准备视图参数
if (!actionEnvironment?.state?.viewLogics?.openData?.openDataViewName) {
return;
}
const viewName = actionEnvironment?.state.viewLogics.openData.openDataViewName;
const view = App.getViewInfo(viewName);
if (!view) {
console.warn("视图参数不足");
return;
}
// 准备数据参数
if (!data || !Array.isArray(data) || (data.length == 0)) {
console.warn("数据参数不足");
return;
}
Object.assign(params.context, { [actionEnvironment.state.keyPSDEField]: data[0].srfkey })
ViewUtil.openData(view, params);
}
......@@ -116,6 +124,7 @@ export class AppSysAction {
*/
public static new(params: IUIActionParams) {
const { actionEnvironment } = params;
// 准备视图参数
if (!actionEnvironment?.state?.viewLogics?.newData?.newDataViewName) {
return;
}
......@@ -124,6 +133,8 @@ export class AppSysAction {
if (!view) {
return;
}
// 准备数据参数
Object.assign(params.viewParams, { w: new Date().getTime() });
ViewUtil.newData(view, params);
}
......@@ -135,7 +146,7 @@ export class AppSysAction {
*/
public static toggleRowEdit(params: IUIActionParams) {
const { actionEnvironment } = params;
if(isExist(actionEnvironment.state.rowEditState)){
if (isExist(actionEnvironment.state.rowEditState)) {
actionEnvironment.state.rowEditState = !actionEnvironment.state.rowEditState;
}
}
......@@ -149,9 +160,9 @@ export class AppSysAction {
public static newRow(params: IUIActionParams) {
const { actionEnvironment } = params;
// 视图里获取多数据部件
if(hasFunction(actionEnvironment.xDataControl, "newRow")){
if (hasFunction(actionEnvironment.xDataControl, "newRow")) {
actionEnvironment.xDataControl.newRow();
}else if(isExist(actionEnvironment.newRow)){
} else if (isExist(actionEnvironment.newRow)) {
actionEnvironment.newRow();
}
}
......@@ -165,9 +176,9 @@ export class AppSysAction {
public static save(params: IUIActionParams) {
const { actionEnvironment } = params;
// 视图里获取多数据部件
if(hasFunction(actionEnvironment.xDataControl, "save")){
if (hasFunction(actionEnvironment.xDataControl, "save")) {
actionEnvironment.xDataControl.save();
}else if(isExist(actionEnvironment.save)){
} else if (isExist(actionEnvironment.save)) {
actionEnvironment.save();
}
}
......@@ -181,9 +192,9 @@ export class AppSysAction {
public static saveRow(params: IUIActionParams) {
const { actionEnvironment } = params;
// 视图里获取多数据部件
if(hasFunction(actionEnvironment.xDataControl, "save")){
if (hasFunction(actionEnvironment.xDataControl, "save")) {
actionEnvironment.xDataControl.save();
}else if(isExist(actionEnvironment.save)){
} else if (isExist(actionEnvironment.save)) {
actionEnvironment.save();
}
}
......@@ -197,9 +208,9 @@ export class AppSysAction {
public static remove(params: IUIActionParams) {
const { actionEnvironment } = params;
// 视图里获取多数据部件
if(hasFunction(actionEnvironment.xDataControl, "remove")){
if (hasFunction(actionEnvironment.xDataControl, "remove")) {
actionEnvironment.xDataControl.remove();
}else if(isExist(actionEnvironment.remove)){
} else if (isExist(actionEnvironment.remove)) {
actionEnvironment.remove();
}
}
......@@ -213,9 +224,9 @@ export class AppSysAction {
public static refresh(params: IUIActionParams) {
const { actionEnvironment } = params;
// 视图里获取多数据部件
if(hasFunction(actionEnvironment.xDataControl, "refresh")){
if (hasFunction(actionEnvironment.xDataControl, "refresh")) {
actionEnvironment.xDataControl.refresh();
}else if(isExist(actionEnvironment.refresh)){
} else if (isExist(actionEnvironment.refresh)) {
actionEnvironment.refresh();
}
}
......@@ -228,7 +239,7 @@ export class AppSysAction {
*/
public static exit(params: IUIActionParams) {
const { actionEnvironment } = params;
if(isExist(actionEnvironment.closeView)){
if (isExist(actionEnvironment.closeView)) {
actionEnvironment.refresh();
}
}
......@@ -242,9 +253,9 @@ export class AppSysAction {
public static async saveAndExit(params: IUIActionParams) {
const { actionEnvironment } = params;
// 视图里获取多数据部件
if(hasFunction(actionEnvironment.xDataControl, "save")){
if (hasFunction(actionEnvironment.xDataControl, "save")) {
await actionEnvironment.xDataControl.save();
}else if(isExist(actionEnvironment.save)){
} else if (isExist(actionEnvironment.save)) {
await actionEnvironment.save();
}
// 关闭视图
......@@ -260,9 +271,9 @@ export class AppSysAction {
public static async removeAndExit(params: IUIActionParams) {
const { actionEnvironment } = params;
// 视图里获取多数据部件
if(hasFunction(actionEnvironment.xDataControl, "remove")){
if (hasFunction(actionEnvironment.xDataControl, "remove")) {
await actionEnvironment.xDataControl.remove();
}else if(isExist(actionEnvironment.remove)){
} else if (isExist(actionEnvironment.remove)) {
await actionEnvironment.remove();
}
// 关闭视图
......@@ -275,9 +286,9 @@ export class AppSysAction {
* @param params 界面行为参数对象
* @return {*}
*/
public static toggleFilter(params: IUIActionParams) {
public static toggleFilter(params: IUIActionParams) {
const { actionEnvironment } = params;
if(isExist(actionEnvironment.state.expandSearchForm)){
if (isExist(actionEnvironment.state.expandSearchForm)) {
actionEnvironment.state.expandSearchForm = !actionEnvironment.state.expandSearchForm;
}
}
......
......@@ -44,7 +44,7 @@ export class MainView extends ViewBase {
const inputParam = {
context: this.state.context,
viewParams: this.state.viewParams,
data: this.xDataControl?.getData?.(),
data: this.xDataControl.getData(),
event: data.event,
actionEnvironment: this
};
......
import { IActionParam, IParam, MainView, MDViewState } from '@core';
import { IActionParam, IParam, MainView, MDViewState, ViewUtil } from '@core';
/**
* 多数据视图
......@@ -157,13 +157,13 @@ export class MDView extends MainView {
if (Object.is(eventName, 'load')) {
this.MDCtrlLoaded(args);
}
if (Object.is(eventName, 'rowClick') && this.state.gridRowActiveMode === 1) {
if (Object.is(eventName, 'rowClick')) {
this.doEdit(args);
}
if (Object.is(eventName, 'rowDbClick') && this.state.gridRowActiveMode === 2) {
if (Object.is(eventName, 'rowDbClick')) {
this.doEdit(args);
}
if (Object.is(eventName, 'selectionchange')) {
if (Object.is(eventName, 'selectionChange')) {
this.selectionChange(args);
}
}
......@@ -215,7 +215,9 @@ export class MDView extends MainView {
* @memberof MDView
*/
public selectionChange(args: any) {
throw new Error('Method not implemented.');
// 抛出数据
this.emit("onViewEvent", { tag: this.state.viewName, action: 'selectionChange', data: args });
// 计算按钮权限 todo
}
/**
......@@ -225,19 +227,27 @@ export class MDView extends MainView {
* @memberof MDView
*/
public doEdit(args: any) {
this.onToolbarEvent({
tag: '',
action: '',
data: {
uIAction: {
codeName: 'Edit',
fullCodeName: 'Edit',
uIActionMode: 'SYS',
uIActionTag: 'Edit',
uIActionType: 'DEUIACTION',
},
},
});
//准备打开视图
if (!this.state?.viewLogics?.openData?.openDataViewName) {
return;
}
const viewName = this.state.viewLogics.openData.openDataViewName;
const view = App.getViewInfo(viewName);
if (!view) {
return;
}
// 准备参数
const tempContext = {};
Object.assign(tempContext, { [this.state.keyPSDEField]: args[0].srfkey });
Object.assign(tempContext, this.state.context);
const params = {
context: tempContext,
viewParams: this.state.viewParams,
data: args,
event: undefined,
actionEnvironment: this
}
ViewUtil.openData(view, params);
}
/**
......@@ -305,5 +315,5 @@ export class MDView extends MainView {
* @return {*} {*}
* @memberof MDView
*/
public getMDCtrl(): any {}
public getMDCtrl(): any { }
}
......@@ -50,6 +50,7 @@ export class ControlBase {
*/
public setState() {
this.state.viewSubject = toRef(this.props, 'viewSubject') as any;
this.state.controlName = this.props.name;
}
/**
......@@ -78,7 +79,7 @@ export class ControlBase {
* 关闭视图
*
*/
public closeView(){
public closeView() {
this.emit('ctrlEvent', { tag: this.props.name, action: 'closeView', data: undefined });
}
......@@ -88,7 +89,7 @@ export class ControlBase {
* @param {IActionParam} actionParam
* @memberof ControlBase
*/
public onCtrlEvent(actionParam: IActionParam) {}
public onCtrlEvent(actionParam: IActionParam) { }
/**
* @description 安装部件所有功能模块的方法
......@@ -102,8 +103,9 @@ export class ControlBase {
this.useControlContextParams();
return {
state: this.state,
getData: this.getData.bind(this),
onCtrlEvent: this.onCtrlEvent.bind(this),
name: this.state.controlName,
getData: this.getData,
onCtrlEvent: this.onCtrlEvent,
};
}
}
......@@ -354,7 +354,7 @@ export class FormControl extends MainControl {
* @protected
* @param [opt={}]
*/
protected async loadDraft(opt: any = {}) {}
protected async loadDraft(opt: any = {}) { }
/**
* @description 使用加载草稿功能模块
......@@ -378,7 +378,7 @@ export class FormControl extends MainControl {
// 发起请求处理与解析请求
const response = await controlService.loadDraft(
_context,
{ viewParams: _viewParams },
_viewParams,
{ action: controlAction.loadDraftAction, isLoading: showBusyIndicator },
);
if (response.status && response.status == 200) {
......@@ -419,7 +419,7 @@ export class FormControl extends MainControl {
* @protected
* @param [opt={}]
*/
protected async load(opt: any = {}) {}
protected async load(opt: any = {}) { }
/**
* @description 使用加载功能模块
......@@ -449,7 +449,7 @@ export class FormControl extends MainControl {
// 发起请求处理与解析请求
const response = await controlService.get(
_context,
{ viewParams: _viewParams },
_viewParams,
{ action: controlAction.loadAction, isLoading: showBusyIndicator },
);
if (response.status && response.status == 200) {
......@@ -488,7 +488,7 @@ export class FormControl extends MainControl {
* @protected
* @param [opt={}]
*/
protected async save(opt: any = {}) {}
protected async save(opt: any = {}) { }
/**
* @description 使用加载功能模块
......@@ -524,7 +524,7 @@ export class FormControl extends MainControl {
let _viewParams = deepCopy(viewParams);
const arg: any = { ...opt };
Object.assign(arg, data.getDo());
Object.assign(arg, { viewParams: _viewParams });
Object.assign(arg, _viewParams);
// TODO 关系界面保存通知处理,做成异步。
// TODO 拷贝相关。
......@@ -574,7 +574,7 @@ export class FormControl extends MainControl {
* @protected
* @param [opt={}]
*/
protected async remove(opt: any = {}) {}
protected async remove(opt: any = {}) { }
/**
* @description 使用加载功能模块
......@@ -605,7 +605,7 @@ export class FormControl extends MainControl {
let _context = deepCopy(context);
let _viewParams = deepCopy(viewParams);
const arg: any = opt[0];
Object.assign(arg, { viewParams: _viewParams });
Object.assign(arg, _viewParams);
// 发起请求处理与解析请求
const response = await controlService.remove(_context, arg, {
......@@ -650,7 +650,7 @@ export class FormControl extends MainControl {
* @protected
* @param [opt={}]
*/
protected async refresh(opt: any = {}) {}
protected async refresh(opt: any = {}) { }
/**
* @description 使用刷新功能模块
......
......@@ -31,13 +31,12 @@ export class GridControl extends MDControl {
*/
public useCustom() {
const { controlName, selectFirstDefault, rowEditState, rowActiveMode, isSingleSelect } = this.state;
const { selectedRowKeys } = toRefs(this.state);
// 滚动条配置
const useScrollOption = computed(() => {
return {
scrollToFirstRowOnChange: true,
x: '110%',
y: '690px',
x: '100%',
y: '100%',
}
});
// 指定表格行key
......@@ -52,17 +51,51 @@ export class GridControl extends MDControl {
const useCustomRow = (record: IParam, index: number) => {
return {
onClick: () => {
if (!rowEditState) {
selectedRowKeys.value = [record.srfkey];
if (!record.children) {
this.emit("ctrlEvent", { tag: this.props.name, action: "selectionChange", data: [deepCopy(record)] })
this.emit("ctrlEvent", { tag: this.props.name, action: "rowClick", data: [deepCopy(record)] })
// 单击激活
if (this.state.rowActiveMode === 1) {
if (!rowEditState) {
const activeIndex: number = this.state.selectedRowKeys.findIndex((key: string) => {
return record.srfkey === key;
});
if (activeIndex === -1) {
this.state.selectedRowKeys.push(record.srfkey);
this.state.selectedData.push(record);
} else {
this.state.selectedRowKeys = this.state.selectedRowKeys.filter((key: string) => {
return key !== record.srfkey;
})
this.state.selectedData = this.state.selectedData.filter((item: any) => {
return item.srfkey !== record.srfkey;
})
}
if (!record.children) {
this.emit("ctrlEvent", { tag: this.props.name, action: "selectionChange", data: [record] });
this.emit("ctrlEvent", { tag: this.props.name, action: "rowClick", data: [record] });
}
}
}
},
onDblclick: () => {
if (!record.children) {
this.emit("ctrlEvent", { tag: this.props.name, action: "rowDbClick", data: [deepCopy(record)] })
// 双击激活
if (this.state.rowActiveMode === 2) {
if (!record.children) {
const activeIndex: number = this.state.selectedRowKeys.findIndex((key: string) => {
return record.srfkey === key;
});
if (activeIndex === -1) {
this.state.selectedRowKeys.push(record.srfkey);
this.state.selectedData.push(record);
} else {
this.state.selectedRowKeys = this.state.selectedRowKeys.filter((key: string) => {
return key !== record.srfkey;
})
this.state.selectedData = this.state.selectedData.filter((item: any) => {
return item.srfkey !== record.srfkey;
})
}
this.emit("ctrlEvent", { tag: this.props.name, action: "rowDbClick", data: [record] });
}
}
}
};
......@@ -74,11 +107,11 @@ export class GridControl extends MDControl {
}
return {
type: isSingleSelect ? 'radio' : 'checkbox',
columnWidth: 90,
selectedRowKeys: selectedRowKeys.value,
columnWidth: 32,
selectedRowKeys: this.state.selectedRowKeys,
checkStrictly: this.props.multiple ? false : true,
onChange: (_selectedRowKeys: string[], selectedRows: IParam[]) => {
selectedRowKeys.value = _selectedRowKeys;
this.state.selectedRowKeys = _selectedRowKeys;
const selection: IParam[] = [];
selectedRows.forEach((select: IParam) => {
if (!select.children) {
......@@ -151,8 +184,8 @@ export class GridControl extends MDControl {
}
const validator = new schema({ [name]: fileRule });
validator.validate({ [name]: value }, undefined, (errors: ErrorList, fields: FieldErrorList) => {
const error =errors?.find((item:any)=>{
return item.field === name;
const error = errors?.find((item: any) => {
return item.field === name;
})
gridEditState.value[name][rowIndex] = error;
})
......@@ -467,13 +500,11 @@ export class GridControl extends MDControl {
*/
public moduleInstall() {
const superParams = super.moduleInstall();
console.log(this.state);
return {
...superParams,
useCustom: this.useCustom(),
onEditorEvent: this.onEditorEvent.bind(this),
onToolbarEvent: this.onToolbarEvent.bind(this)
onEditorEvent: this.onEditorEvent,
onToolbarEvent: this.onToolbarEvent
};
}
}
......@@ -24,7 +24,13 @@ export class MDControl extends MainControl {
this.state.isMultiple = toRef(this.props, 'isMultiple') as any;
this.state.rowEditState = toRef(this.props, 'rowEditState') as any;
this.state.rowActiveMode = toRef(this.props, 'rowActiveMode') as any;
this.state.selectedData = UIBase.toOneWayRef(this.props, 'selectedData') as any;
if (this.props['selectedData']) {
this.state.selectedData = UIBase.toOneWayRef(this.props, 'selectedData') as any;
} else {
if (!this.state.selectedData) {
this.state.selectedData = ref([]) as any;
}
}
this.state.selectFirstDefault = toRef(this.props, 'selectFirstDefault') as any;
}
......
......@@ -89,7 +89,7 @@ export class ViewUtil {
* @param {ViewDetail} view
* @memberof ViewUtil
*/
public static async openData(view: ViewDetail, params: { context: IContext, viewParams: IParam, data: IParam, event: MouseEvent, actionEnvironment: IParam }) {
public static async openData(view: ViewDetail, params: { context: IContext, viewParams: IParam, data: IParam, event: MouseEvent | undefined, actionEnvironment: IParam }) {
const { context, viewParams, data, event, actionEnvironment } = params
if (view) {
// const _data: any = {};
......
......@@ -21,10 +21,10 @@ interface CtrlEmit {
}
const emit = defineEmits <CtrlEmit> ();
const { state, onMenuSelect } = new MenuControl(ctrlState, props, emit).moduleInstall();
const { name, state, onMenuSelect } = new MenuControl(ctrlState, props, emit).moduleInstall();
// 暴露内部状态及能力
defineExpose({ state, name: '{{ctrl.name}}' });
defineExpose({ name, state });
</script>
<template>
......
......@@ -42,10 +42,10 @@ interface CtrlEmit {
const emit = defineEmits <CtrlEmit> ();
// 安装功能模块,提供状态和能力方法
const { state } = new DashboardControl(ctrlState, props, emit).moduleInstall();
const { name, state } = new DashboardControl(ctrlState, props, emit).moduleInstall();
// 暴露内部状态及能力
defineExpose({ state, name: '{{ctrl.name}}' });
defineExpose({ name, state });
</script>
<template>
<div class="app-dashboard{{#if ctrl.psSysCss}} {{ctrl.psSysCss.cssName}}{{/if}}">
......
......@@ -40,10 +40,10 @@ interface CtrlEmit {
const emit = defineEmits <CtrlEmit> ();
// 安装功能模块,提供状态和能力方法
const { state, onEditorEvent, onComponentEvent } = new FormControl(ctrlState, props, emit).moduleInstall();
const { name, state, onEditorEvent, onComponentEvent } = new FormControl(ctrlState, props, emit).moduleInstall();
// 暴露内部状态及能力
defineExpose({ state, name: '{{ctrl.name}}' });
defineExpose({ name, state });
</script>
<template>
<a-form name="{{ctrl.codeName}}" class="app-form{{#if ctrl.psSysCss}} {{ctrl.psSysCss.cssName}}{{/if}}{{#if ctrl.infoFormMode}} app-info-form{{/if}}" style="{{#if ctrl.formWidth}}width: {{ctrl.formWidth}}px;{{/if}}" :model="state.data" :rules="state.rules">
......
......@@ -36,11 +36,11 @@ interface CtrlEmit {
const emit = defineEmits<CtrlEmit>();
// 安装功能模块,提供状态和能力
const { state, useCustom, onEditorEvent, onToolbarEvent, newRow, remove, save, load, refresh, getData } = new GridControl(ctrlState, props, emit).moduleInstall();
const { name, state, useCustom, onEditorEvent, onToolbarEvent, newRow, remove, save, load, refresh, getData } = new GridControl(ctrlState, props, emit).moduleInstall();
const { useScrollOption, useRowKey, useRowClassName, useCustomRow, useRowSelectionOption, onResizeColumn, onGridChange } = useCustom;
// 暴露内部状态及能力
defineExpose({ state, name: '{{ctrl.name}}', newRow, remove, save, load, refresh, getData });
defineExpose({ name, state, newRow, remove, save, load, refresh, getData });
</script>
<template>
<a-form name="{{ctrl.name}}" class="app-grid-form" >
......
......@@ -34,10 +34,10 @@ interface CtrlEmit {
const emit = defineEmits <CtrlEmit> ();
// 安装功能模块,提供状态和能力方法
const { state, onViewEvent } = new PickupViewPanelControl(ctrlState, props, emit).moduleInstall();
const { name, state, onViewEvent } = new PickupViewPanelControl(ctrlState, props, emit).moduleInstall();
// 暴露内部状态及能力
defineExpose({ state, name: '{{ctrl.name}}' });
defineExpose({ name, state});
</script>
<template>
......
......@@ -26,10 +26,10 @@ interface CtrlEmit {
const emit = defineEmits <CtrlEmit> ();
// 安装功能模块,提供状态和能力方法
const { state, onViewEvent } = new PortletControl(ctrlState, props, emit).moduleInstall();
const { name, state, onViewEvent } = new PortletControl(ctrlState, props, emit).moduleInstall();
// 暴露内部状态及能力
defineExpose({ state, name: '{{ctrl.name}}' });
defineExpose({ name, state });
</script>
<template>
<div class="app-portlet{{#if ctrl.psSysCss}} {{ctrl.psSysCss.cssName}}{{/if}}" >
......
......@@ -27,7 +27,7 @@ interface CtrlEmit {
const emit = defineEmits<CtrlEmit>();
// 安装功能模块,提供状态和能力方法
const { state, onEditorEvent } = new QuickSearchFormControl(ctrlState, props, emit).moduleInstall();
const { name, state, onEditorEvent } = new QuickSearchFormControl(ctrlState, props, emit).moduleInstall();
</script>
<template>
......
......@@ -22,10 +22,10 @@ interface CtrlEmit {
const emit = defineEmits<CtrlEmit>();
// 安装功能模块,提供状态和能力方法
const { state } = new SearchBarControl(CtrlConfig).moduleInstall(props, emit);
const { name, state } = new SearchBarControl(CtrlConfig).moduleInstall(props, emit);
// 暴露内部状态及能力
defineExpose({ state, name: '{{ctrl.name}}' });
defineExpose({ name, state});
</script>
<template>
<div class="search-bar{{#if ctrl.psSysCss}} {{ctrl.psSysCss.cssName}}{{/if}}">
......
......@@ -35,10 +35,10 @@ interface CtrlEmit {
const emit = defineEmits <CtrlEmit> ();
// 安装功能模块,提供状态和能力方法
const { state, onCtrlEvent } = new TabExpPanelControl(ctrlState, props, emit).moduleInstall();
const { name, state, onCtrlEvent } = new TabExpPanelControl(ctrlState, props, emit).moduleInstall();
// 暴露内部状态及能力
defineExpose({ state, name: '{{ctrl.name}}' });
defineExpose({ name, state });
</script>
<template>
......
......@@ -26,10 +26,10 @@ interface CtrlEmit {
const emit = defineEmits <CtrlEmit> ();
// 安装功能模块,提供状态和能力方法
const { state, onViewEvent } = new TabViewPanelControl(ctrlState, props, emit).moduleInstall();
const { name, state, onViewEvent } = new TabViewPanelControl(ctrlState, props, emit).moduleInstall();
// 暴露内部状态及能力
defineExpose({ state, name: '{{ctrl.name}}' });
defineExpose({ name, state });
</script>
<template>
......
......@@ -36,10 +36,10 @@ interface CtrlEmit {
const emit = defineEmits <CtrlEmit> ();
// 安装功能模块,提供状态和能力方法
const { state, onCtrlEvent, xData } = new TreeExpBarControl(ctrlState, props, emit).moduleInstall();
const { name, state, onCtrlEvent, xData } = new TreeExpBarControl(ctrlState, props, emit).moduleInstall();
// 暴露内部状态及能力
defineExpose({ state, name: '{{ctrl.name}}' });
defineExpose({ name, state });
</script>
<template>
......
......@@ -29,10 +29,10 @@ interface CtrlEmit {
const emit = defineEmits<CtrlEmit>();
// 安装功能模块,提供状态和能力方法
const { state, load, treeNodeSelect } = new TreeControl(ctrlState, props, emit).moduleInstall();
const { name, state, load, treeNodeSelect } = new TreeControl(ctrlState, props, emit).moduleInstall();
// 暴露内部状态及能力
defineExpose({ state, name: '{{ctrl.name}}' });
defineExpose({ name, state });
</script>
// TODO 树节点待支持图标和自定义绘制
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册