提交 2f4cc689 编写于 作者: RedPig97's avatar RedPig97

update: 优化事件回调参数

上级 4bbf7cb6
......@@ -44,6 +44,6 @@
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event: any) => onEditorEvent(index,$event)"
@editorEvent="onEditorEvent($event,index)"
{{/eq}}
/>
......@@ -26,6 +26,6 @@
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event: any) => onEditorEvent(index,$event)"
@editorEvent="onEditorEvent($event,index)"
{{/eq}}
/>
......@@ -12,6 +12,6 @@
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event: any) => onEditorEvent(index,$event)"
@editorEvent="onEditorEvent($event,index)"
{{/eq}}
/>
......@@ -9,7 +9,7 @@
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event: any) => onEditorEvent(index,$event)"
@editorEvent="onEditorEvent($event,index)"
{{/eq}}
:context="state.context"
:viewParams="state.viewParams"/>
\ No newline at end of file
......@@ -30,6 +30,6 @@
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event: any) => onEditorEvent(index,$event)"
@editorEvent="onEditorEvent($event,index)"
{{/eq}}
/>
\ No newline at end of file
......@@ -57,6 +57,6 @@
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event: any) => onEditorEvent(index,$event)"
@editorEvent="onEditorEvent($event,index)"
{{/eq}}
/>
\ No newline at end of file
......@@ -51,6 +51,6 @@
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event: any) => onEditorEvent(index,$event)"
@editorEvent="onEditorEvent($event,index)"
{{/eq}}
/>
......@@ -33,6 +33,6 @@
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
:data="record"
@editorEvent="($event: any) => onEditorEvent(index,$event)"
@editorEvent="onEditorEvent($event,index)"
{{/eq}}
/>
......@@ -12,7 +12,7 @@
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event: any) => onEditorEvent(index,$event)"
@editorEvent="onEditorEvent($event,index)"
{{/eq}}
/>
......@@ -42,6 +42,6 @@
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event: any) => onEditorEvent(index,$event)"
@editorEvent="onEditorEvent($event,index)"
{{/eq}}
/>
......@@ -42,6 +42,6 @@
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event: any) => onEditorEvent(index,$event)"
@editorEvent="onEditorEvent($event,index)"
{{/eq}}
/>
......@@ -26,6 +26,6 @@
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event: any) => onEditorEvent(index,$event)"
@editorEvent="onEditorEvent($event,index)"
{{/eq}}
/>
\ No newline at end of file
......@@ -18,6 +18,6 @@
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event: any) => onEditorEvent(index,$event)"
@editorEvent="onEditorEvent($event,index)"
{{/eq}}
/>
......@@ -16,6 +16,6 @@
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event: any) => onEditorEvent(index,$event)"
@editorEvent="onEditorEvent($event,index)"
{{/eq}}
/>
......@@ -25,6 +25,6 @@
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
:data="record"
@editorEvent="($event: any) => onEditorEvent(index,$event)"
@editorEvent="onEditorEvent($event,index)"
{{/eq}}
/>
......@@ -22,6 +22,6 @@
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event: any) => onEditorEvent(index,$event)"
@editorEvent="onEditorEvent($event,index)"
{{/eq}}
/>
......@@ -24,6 +24,6 @@
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event: any) => onEditorEvent(index,$event)"
@editorEvent="onEditorEvent($event,index)"
{{/eq}}
/>
......@@ -15,6 +15,6 @@
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event: any) => onEditorEvent(index,$event)"
@editorEvent="onEditorEvent($event,index)"
{{/eq}}
/>
......@@ -35,6 +35,6 @@
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event: any) => onEditorEvent(index,$event)"
@editorEvent="onEditorEvent($event,index)"
{{/eq}}
/>
......@@ -28,7 +28,7 @@
mode="link"
name="{{lowerCase item.codeName}}"
:actionModel="record.{{lowerCase item.codeName}}"
@onToolbarEvent="($event: IActionParam) => onToolbarEvent(record, $event)"/>
@onToolbarEvent="onToolbarEvent($event, record)"/>
{{/if}}
</div>
{{/unless}}
......
......@@ -116,7 +116,7 @@ export class GridControl extends MDControl {
* @param {IActionParam} actionParam 行为参数
* @memberof GridControl
*/
public onEditorEvent(rowIndex: number, actionParam: IActionParam) {
public onEditorEvent(actionParam: IActionParam, rowIndex: number) {
const { tag, action, data } = actionParam;
switch (action) {
case "valueChange":
......@@ -131,6 +131,16 @@ export class GridControl extends MDControl {
}
}
/**
* @description 操作列事件触发
* @param {IActionParam} action
* @param {IParam} record
* @memberof GridControl
*/
public onToolbarEvent(action: IActionParam, record: IParam) {
//todo 界面行为
}
/**
* @description 处理表格操作列事件
* @param {IActionParam} actionParam 行为参数
......@@ -433,6 +443,7 @@ export class GridControl extends MDControl {
...superParams,
useCustom: this.useCustom(),
onEditorEvent: this.onEditorEvent.bind(this),
onToolbarEvent: this.onToolbarEvent.bind(this)
};
}
}
......@@ -30,7 +30,7 @@ const props = withDefaults(defineProps < Props > (), {
const emit = defineEmits<{(event: 'onCtrlEvent', value: IActionParam): void;}>();
// 安装功能模块,提供状态和能力
const { state, useCustom, onEditorEvent } = new GridControl(ctrlState, props, emit).moduleInstall();
const { state, useCustom, onEditorEvent, onToolbarEvent } = new GridControl(ctrlState, props, emit).moduleInstall();
const { useScrollOption, useRowKey, useRowClassName, useCustomRow, useRowSelectionOption, onResizeColumn, onGridChange } = useCustom;
// 暴露内部状态及能力
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册