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

update:更新

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