提交 64779705 编写于 作者: WodahsOrez's avatar WodahsOrez

fix: 表格修复

上级 bce14421
...@@ -30,13 +30,13 @@ export class MainView extends ViewBase { ...@@ -30,13 +30,13 @@ export class MainView extends ViewBase {
* @memberof MainView * @memberof MainView
*/ */
public onToolbarEvent(actionParam: IActionParam) { public onToolbarEvent(actionParam: IActionParam) {
const { tag, action, data } = actionParam; const { data } = actionParam;
if (!tag || !action || !data) { if (!data) {
console.warn("工具栏执行参数不足"); console.warn("工具栏执行参数不足");
return; return;
} }
const { xDataControlName, uIAction } = data; const { uIAction } = data;
if (!xDataControlName || !uIAction) { if (!uIAction) {
console.warn("工具栏执行参数不足"); console.warn("工具栏执行参数不足");
return; return;
} }
......
...@@ -8,7 +8,6 @@ import { IActionParam, IParam, MainView, MDViewState } from '@core'; ...@@ -8,7 +8,6 @@ import { IActionParam, IParam, MainView, MDViewState } from '@core';
* @extends {MainView} * @extends {MainView}
*/ */
export class MDView extends MainView { export class MDView extends MainView {
/** /**
* 视图状态数据 * 视图状态数据
* *
...@@ -57,7 +56,7 @@ export class MDView extends MainView { ...@@ -57,7 +56,7 @@ export class MDView extends MainView {
} else { } else {
this.state.isLoadDefault = true; this.state.isLoadDefault = true;
} }
}) });
} }
/** /**
...@@ -111,7 +110,7 @@ export class MDView extends MainView { ...@@ -111,7 +110,7 @@ export class MDView extends MainView {
*/ */
public handleQuickGroupSearch(args: any = {}): void { public handleQuickGroupSearch(args: any = {}): void {
const { viewParams } = this.state; const { viewParams } = this.state;
Object.assign(viewParams,{quickGroup: args.data}) Object.assign(viewParams, { quickGroup: args.data });
const tag = this.getMDCtrl().name; const tag = this.getMDCtrl().name;
this.next({ tag: tag, action: 'load', data: viewParams }); this.next({ tag: tag, action: 'load', data: viewParams });
} }
...@@ -124,7 +123,7 @@ export class MDView extends MainView { ...@@ -124,7 +123,7 @@ export class MDView extends MainView {
public handleQuickSearch(args: any = {}): void { public handleQuickSearch(args: any = {}): void {
const { viewParams } = this.state; const { viewParams } = this.state;
const query = args?.target?._value || ''; const query = args?.target?._value || '';
Object.assign(viewParams,{query: query}); Object.assign(viewParams, { query: query });
const tag = this.getMDCtrl().name; const tag = this.getMDCtrl().name;
this.next({ tag: tag, action: 'load', data: viewParams }); this.next({ tag: tag, action: 'load', data: viewParams });
} }
...@@ -153,15 +152,15 @@ export class MDView extends MainView { ...@@ -153,15 +152,15 @@ export class MDView extends MainView {
*/ */
public MDCtrlEvent(eventName: string, args: any): void { public MDCtrlEvent(eventName: string, args: any): void {
if (Object.is(eventName, 'beforeload')) { if (Object.is(eventName, 'beforeload')) {
this.MDCtrlBeforeLoad(args) this.MDCtrlBeforeLoad(args);
} }
if (Object.is(eventName, 'load')) { if (Object.is(eventName, 'load')) {
this.MDCtrlLoaded(args); this.MDCtrlLoaded(args);
} }
if (Object.is(eventName, 'rowclick')) { if (Object.is(eventName, 'rowClick') && this.state.gridRowActiveMode === 1) {
this.doEdit(args); this.doEdit(args);
} }
if (Object.is(eventName, 'rowdblclick')) { if (Object.is(eventName, 'rowDbClick') && this.state.gridRowActiveMode === 2) {
this.doEdit(args); this.doEdit(args);
} }
if (Object.is(eventName, 'selectionchange')) { if (Object.is(eventName, 'selectionchange')) {
...@@ -207,7 +206,7 @@ export class MDView extends MainView { ...@@ -207,7 +206,7 @@ export class MDView extends MainView {
* @memberof MDView * @memberof MDView
*/ */
public MDCtrlLoaded(args: any) { public MDCtrlLoaded(args: any) {
console.log("数据加载完成", args); console.log('数据加载完成', args);
} }
/** /**
...@@ -227,7 +226,19 @@ export class MDView extends MainView { ...@@ -227,7 +226,19 @@ export class MDView extends MainView {
* @memberof MDView * @memberof MDView
*/ */
public doEdit(args: any) { public doEdit(args: any) {
throw new Error('Method not implemented.'); this.onToolbarEvent({
tag: '',
action: '',
data: {
uIAction: {
codeName: 'Edit',
fullCodeName: 'Edit',
uIActionMode: 'SYS',
uIActionTag: 'Edit',
uIActionType: 'DEUIACTION',
},
},
});
} }
/** /**
...@@ -254,7 +265,7 @@ export class MDView extends MainView { ...@@ -254,7 +265,7 @@ export class MDView extends MainView {
/** /**
* @description 安装视图所有功能模块的方法 * @description 安装视图所有功能模块的方法
* *
* @memberof MDView * @memberof MDView
*/ */
public moduleInstall() { public moduleInstall() {
...@@ -265,7 +276,7 @@ export class MDView extends MainView { ...@@ -265,7 +276,7 @@ export class MDView extends MainView {
searchForm: this.searchForm, searchForm: this.searchForm,
searchBar: this.searchBar, searchBar: this.searchBar,
onQuickGroupEvent: this.onQuickGroupEvent.bind(this), onQuickGroupEvent: this.onQuickGroupEvent.bind(this),
onQuickSearchEvent: this.onQuickSearchEvent.bind(this) onQuickSearchEvent: this.onQuickSearchEvent.bind(this),
}; };
} }
...@@ -295,6 +306,5 @@ export class MDView extends MainView { ...@@ -295,6 +306,5 @@ export class MDView extends MainView {
* @return {*} {*} * @return {*} {*}
* @memberof MDView * @memberof MDView
*/ */
public getMDCtrl(): any { } public getMDCtrl(): any {}
} }
...@@ -56,14 +56,12 @@ export class GridControl extends MDControl { ...@@ -56,14 +56,12 @@ export class GridControl extends MDControl {
selectedRowKeys.value = [record.srfkey]; selectedRowKeys.value = [record.srfkey];
if (!record.children) { if (!record.children) {
this.emit("ctrlEvent", { tag: this.props.name, action: "selectionChange", data: [deepCopy(record)] }) this.emit("ctrlEvent", { tag: this.props.name, action: "selectionChange", data: [deepCopy(record)] })
if (Object.is(rowActiveMode, 1)) { this.emit("ctrlEvent", { tag: this.props.name, action: "rowClick", data: [deepCopy(record)] })
this.emit("ctrlEvent", { tag: this.props.name, action: "rowClick", data: [deepCopy(record)] })
}
} }
} }
}, },
onDblclick: () => { onDblclick: () => {
if (!record.children && Object.is(rowActiveMode, 2)) { if (!record.children) {
this.emit("ctrlEvent", { tag: this.props.name, action: "rowDbClick", data: [deepCopy(record)] }) this.emit("ctrlEvent", { tag: this.props.name, action: "rowDbClick", data: [deepCopy(record)] })
} }
} }
......
...@@ -53,7 +53,7 @@ export const ctrlState = { ...@@ -53,7 +53,7 @@ export const ctrlState = {
position: ['bottomRight'], position: ['bottomRight'],
defaultPageSize: {{#if ctrl.pagingSize}}{{ctrl.pagingSize}}{{else}}20{{/if}}, defaultPageSize: {{#if ctrl.pagingSize}}{{ctrl.pagingSize}}{{else}}20{{/if}},
showQuickJumper: true, showQuickJumper: true,
showTotal: (total: number, range: IParam[]) => `${range[0]}-${range[1]} of ${total} items`, showTotal: (total: number, range: IParam[]) => `显示 ${range[0]} - ${range[1]} 条数据,共 ${total} 条数据`,
pageSizeOptions: ['10','20','50','100'], pageSizeOptions: ['10','20','50','100'],
}{{else}}false{{/if}}, }{{else}}false{{/if}},
}, },
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册