提交 4e2411c0 编写于 作者: tony001's avatar tony001

update:更新

上级 2bff2322
...@@ -72,8 +72,7 @@ public declare state: GridViewState; ...@@ -72,8 +72,7 @@ public declare state: GridViewState;
const superParams = super.moduleInstall(); const superParams = super.moduleInstall();
return { return {
...superParams, ...superParams,
grid: this.grid, grid: this.grid
onSearchFormSearch: this.onSearchFormSearch.bind(this)
}; };
} }
} }
...@@ -127,6 +127,12 @@ export class MDView extends MainView { ...@@ -127,6 +127,12 @@ export class MDView extends MainView {
* @memberof MDView * @memberof MDView
*/ */
public MDCtrlEvent(eventName: string, args: any): void { public MDCtrlEvent(eventName: string, args: any): void {
if (Object.is(eventName, 'beforeload')) {
this.MDCtrlBeforeLoad(args)
}
if (Object.is(eventName, 'load')) {
this.MDCtrlLoaded(args);
}
if (Object.is(eventName, 'rowclick')) { if (Object.is(eventName, 'rowclick')) {
this.doEdit(args); this.doEdit(args);
} }
...@@ -136,12 +142,6 @@ export class MDView extends MainView { ...@@ -136,12 +142,6 @@ export class MDView extends MainView {
if (Object.is(eventName, 'selectionchange')) { if (Object.is(eventName, 'selectionchange')) {
this.selectionChange(args); this.selectionChange(args);
} }
if (Object.is(eventName, 'load')) {
this.MDCtrlLoaded(args);
}
if (Object.is(eventName, 'beforeload')) {
this.MDCtrlBeforeLoad(args)
}
} }
/** /**
...@@ -157,6 +157,7 @@ export class MDView extends MainView { ...@@ -157,6 +157,7 @@ export class MDView extends MainView {
if (this.getSearchBar()) { if (this.getSearchBar()) {
Object.assign(args, this.getSearchBar().getData()); Object.assign(args, this.getSearchBar().getData());
} }
Object.assign(args, { test: 111 });
// if (this.view && !this.view.isExpandSearchForm) { // if (this.view && !this.view.isExpandSearchForm) {
// Object.assign(args, { query: this.view.query }); // Object.assign(args, { query: this.view.query });
// } // }
...@@ -181,7 +182,7 @@ export class MDView extends MainView { ...@@ -181,7 +182,7 @@ export class MDView extends MainView {
* @memberof MDView * @memberof MDView
*/ */
public MDCtrlLoaded(args: any) { public MDCtrlLoaded(args: any) {
throw new Error('Method not implemented.'); console.log("数据加载完成", args);
} }
/** /**
......
...@@ -50,7 +50,6 @@ export class PickupView extends MainView { ...@@ -50,7 +50,6 @@ export class PickupView extends MainView {
} }
public handleCtrlEvent(actionParam: IActionParam) { public handleCtrlEvent(actionParam: IActionParam) {
debugger
const { tag, action, data } = actionParam; const { tag, action, data } = actionParam;
// TODO // TODO
......
import { ControlPropsBase, ControlStateBase, IParam, UIBase } from '@core'; import { ControlPropsBase, ControlStateBase, IActionParam, IParam, UIBase } from '@core';
/** /**
* @description 部件基类 * @description 部件基类
...@@ -31,11 +31,6 @@ export class ControlBase { ...@@ -31,11 +31,6 @@ export class ControlBase {
*/ */
public declare emit: Function; public declare emit: Function;
/**
* Creates an instance of ControlBase.
* @param {*} options 配置参数
* @memberof ControlBase
*/
/** /**
* Creates an instance of ControlBase. * Creates an instance of ControlBase.
* @param {*} options 配置参数 * @param {*} options 配置参数
...@@ -68,8 +63,15 @@ export class ControlBase { ...@@ -68,8 +63,15 @@ export class ControlBase {
// 把Ref赋值到State上进行解包 // 把Ref赋值到State上进行解包
this.state.context = context; this.state.context = context;
this.state.viewParams = viewParams; this.state.viewParams = viewParams;
}
return { context, viewParams }; /**
* 获取当前激活数据
*
* @memberof ControlBase
*/
public getData(): IParam[] {
return [];
} }
/** /**
...@@ -83,7 +85,8 @@ export class ControlBase { ...@@ -83,7 +85,8 @@ export class ControlBase {
this.setState(); this.setState();
this.useControlContextParams(); this.useControlContextParams();
return { return {
state: this.state state: this.state,
activeData: this.getData()
}; };
} }
} }
import { IParam, MainControlProps } from "@core"; import { MDControlProps } from "@core";
/** /**
* @description 表格部件的props * @description 表格部件的props
* @export * @export
* @interface GridControlProps * @interface GridControlProps
* @extends {MainControlProps} * @extends {MDControlProps}
*/ */
export interface GridControlProps extends MainControlProps { export interface GridControlProps extends MDControlProps {
/**
* @description 是否多选
* @type {boolean}
* @memberof GridControlProps
*/
multiple: boolean;
/**
* @description 行编辑状态
* @type {boolean}
* @memberof GridControlProps
*/
rowEditState: boolean;
/**
* @description 行激活模式
* @type {(0 | 1 | 2)} 不激活 | 单击激活 | 双击激活
* @memberof GridControlProps
*/
rowActiveMode: 0 | 1 | 2;
/**
* @description 选中数据
* @type {IParam[]}
* @memberof GridControlProps
*/
selectedData: IParam[];
/**
* @description 是否默认选中第一项数据
* @type {boolean}
* @memberof GridControlProps
*/
selectFirstDefault: boolean;
} }
\ No newline at end of file
import { IParam, MainControlState } from '@core'; import { IParam, MDControlState } from '@core';
/** /**
* @description 表格部件状态 * @description 表格部件状态
* @export * @export
* @interface GridControlState * @interface GridControlState
* @extends {MainControlState} * @extends {MDControlState}
*/ */
export interface GridControlState extends MainControlState { export interface GridControlState extends MDControlState {
/**
* @description 表格数据集合
* @type {IParam[]}
* @memberof GridControlState
*/
data: IParam[];
/** /**
* @description 表格列模型 * @description 表格列模型
...@@ -36,48 +29,6 @@ export interface GridControlState extends MainControlState { ...@@ -36,48 +29,6 @@ export interface GridControlState extends MainControlState {
*/ */
rules: IParam; rules: IParam;
/**
* @description 是否多选
* @type {boolean}
* @memberof GridControlState
*/
multiple: boolean;
/**
* @description 行编辑状态
* @type {boolean}
* @memberof GridControlState
*/
rowEditState: boolean;
/**
* @description 行激活模式
* @type {(0 | 1 | 2)} 不激活 | 单击激活 | 双击激活
* @memberof GridControlState
*/
rowActiveMode: 0 | 1 | 2;
/**
* @description 选中数据
* @type {IParam[]}
* @memberof GridControlState
*/
selectedData: IParam[];
/**
* @description 选中行keys
* @type {string[]}
* @memberof GridControlState
*/
selectedRowKeys: string[];
/**
* @description 是否默认选中第一条数据
* @type {boolean}
* @memberof GridControlState
*/
selectFirstDefault: boolean;
/** /**
* @description 表格聚合 * @description 表格聚合
* @type {IParam} * @type {IParam}
...@@ -85,24 +36,4 @@ export interface GridControlState extends MainControlState { ...@@ -85,24 +36,4 @@ export interface GridControlState extends MainControlState {
*/ */
gridAgg: IParam; gridAgg: IParam;
/**
* @description 表格分组
* @type {IParam}
* @memberof GridControlState
*/
gridGroup: IParam;
/**
* @description 表格排序
* @type {IParam}
* @memberof GridControlState
*/
gridSort: IParam;
/**
* @description 表格分页
* @type {IParam}
* @memberof GridControlState
*/
gridPaging: IParam;
} }
import { ControlBase, MainControlProps, MainControlState } from '@core'; import { ControlBase, IParam, MainControlProps, MainControlState, UIUtil } from '@core';
/** /**
* @description 实体部件 * @description 实体部件
...@@ -24,6 +24,20 @@ export class MainControl extends ControlBase { ...@@ -24,6 +24,20 @@ export class MainControl extends ControlBase {
this.state.controlAction = toRef(this.props, 'controlAction') as any; this.state.controlAction = toRef(this.props, 'controlAction') as any;
} }
/**
* 获取指定数据的操作权限
*
* @param {IParam} data 指定数据
* @param {IParam} actionModel 界面行为模型
* @memberof MainControl
*/
public async getActionAuthState(data: IParam, actionModel: IParam) {
const { context, appEntityCodeName } = this.state;
const tempUIservice = await App.getUIService(appEntityCodeName.toLowerCase(), context);
UIUtil.calcActionItemAuthState(data, actionModel, tempUIservice);
return actionModel;
}
/** /**
* @description 安装部件所有功能模块的方法 * @description 安装部件所有功能模块的方法
* @return {*} * @return {*}
......
export * from './md-control-prop'
export * from './md-control-state'
export * from './md-control'
\ No newline at end of file
import { IParam, MainControlProps } from "@core";
/**
* @description 多数据部件的props
* @export
* @interface MDControlProps
* @extends {MainControlProps}
*/
export interface MDControlProps extends MainControlProps {
/**
* @description 是否多选
* @type {boolean}
* @memberof MDControlProps
*/
isMultiple: boolean;
/**
* @description 行编辑状态
* @type {boolean}
* @memberof MDControlProps
*/
rowEditState: boolean;
/**
* @description 行激活模式
* @type {(0 | 1 | 2)} 不激活 | 单击激活 | 双击激活
* @memberof MDControlProps
*/
rowActiveMode: 0 | 1 | 2;
/**
* @description 选中数据
* @type {IParam[]}
* @memberof MDControlProps
*/
selectedData: IParam[];
/**
* @description 是否默认选中第一项数据
* @type {boolean}
* @memberof MDControlProps
*/
isSelectDefault: boolean;
}
\ No newline at end of file
import { IParam, MainControlState } from '@core';
/**
* @description 多数据部件状态
* @export
* @interface MDControlState
* @extends {MainControlState}
*/
export interface MDControlState extends MainControlState {
/**
* @description 多数据部件数据
* @type {IParam[]}
* @memberof MDControlState
*/
items: IParam[];
/**
* @description 是否多选
* @type {boolean}
* @memberof MDControlState
*/
isMultiple: boolean;
/**
* @description 行编辑状态
* @type {boolean}
* @memberof MDControlState
*/
rowEditState: boolean;
/**
* @description 行激活模式
* @type {(0 | 1 | 2)} 不激活 | 单击激活 | 双击激活
* @memberof MDControlState
*/
rowActiveMode: 0 | 1 | 2;
/**
* @description 选中数据
* @type {IParam[]}
* @memberof MDControlState
*/
selectedData: IParam[];
/**
* @description 选中行keys
* @type {string[]}
* @memberof MDControlState
*/
selectedRowKeys: string[];
/**
* @description 是否默认选中第一条数据
* @type {boolean}
* @memberof MDControlState
*/
isSelectDefault: boolean;
}
...@@ -23,7 +23,6 @@ export class GridService<T extends ControlVOBase> extends ControlServiceBase<T> ...@@ -23,7 +23,6 @@ export class GridService<T extends ControlVOBase> extends ControlServiceBase<T>
// todo主键 // todo主键
const action = hasFunction(_entityService, opts.action) ? opts.action : 'GetDraft'; const action = hasFunction(_entityService, opts.action) ? opts.action : 'GetDraft';
const response = await _entityService[action](Context, Data, opts.isLoading); const response = await _entityService[action](Context, Data, opts.isLoading);
// this.setRemoteCopyData(response);
response.data = this.newControlVO(response.data); response.data = this.newControlVO(response.data);
response.data.srfuf = '0'; response.data.srfuf = '0';
return this.handleResponse(response, opts); return this.handleResponse(response, opts);
...@@ -37,13 +36,12 @@ export class GridService<T extends ControlVOBase> extends ControlServiceBase<T> ...@@ -37,13 +36,12 @@ export class GridService<T extends ControlVOBase> extends ControlServiceBase<T>
* @return {*} {Promise<any>} * @return {*} {Promise<any>}
* @memberof GridService * @memberof GridService
*/ */
public async get(context: IParam, data: IParam, opts: { action: string; isLoading?: boolean }): Promise<any> { public async search(context: IParam, data: IParam, opts: { action: string; isLoading?: boolean }): Promise<any> {
let _entityService: any = this.entityService; let _entityService: any = this.entityService;
const { context: Context, data: Data } = this.handleRequestData(context, data, opts); const { context: Context, data: Data } = this.handleRequestData(context, data, opts);
const action = hasFunction(_entityService, opts.action) ? opts.action : 'GET'; const action = hasFunction(_entityService, opts.action) ? opts.action : 'GET';
const response = await _entityService[action](Context, Data, opts.isLoading); const response = await _entityService[action](Context, Data, opts.isLoading);
//this.setCopynativeData(response.data); response.data?.forEach((item: IParam) => {
response.data?.forEach((item: IParam) =>{
item = this.newControlVO(item); item = this.newControlVO(item);
}) })
return this.handleResponse(response, opts); return this.handleResponse(response, opts);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册