提交 f5b850f7 编写于 作者: sq3536's avatar sq3536

Merge remote-tracking branch 'origin/master'

......@@ -69,6 +69,8 @@ public class AppEntityModel extends BaseModel{
}
// 初始化界面行为
keyField = getAppDataEntity().getPSDataEntity().getKeyPSDEField().getCodeName();
majorField = getAppDataEntity().getPSDataEntity().getMajorPSDEField().getCodeName();
if(getAppDataEntity().getAllPSAppDEUIActions() != null){
getAppDataEntity().getAllPSAppDEUIActions().forEach(appDEUIAction ->{
JSONObject actionJson = new JSONObject();
......@@ -81,6 +83,24 @@ public class AppEntityModel extends BaseModel{
actionJson.put("htmlPageUrl",appDEUIAction.getHtmlPageUrl());
actionJson.put("refreshMode",appDEUIAction.getRefreshMode());
actionJson.put("uILogicAttachMode",appDEUIAction.getUILogicAttachMode());
StringBuffer navContexts = new StringBuffer();
navContexts.append("{");
if(appDEUIAction.getPSNavigateContexts() != null){
appDEUIAction.getPSNavigateContexts().forEach(context ->{
navContexts.append(context.getName().toLowerCase() + ":'"+(context.isRawValue()?"":"%") +context.getValue()+(context.isRawValue()?"":"%")+"',");
});
}
navContexts.append("}");
actionJson.put("navContexts",navContexts);
StringBuffer navParams = new StringBuffer();
navParams.append("{");
if(appDEUIAction.getPSNavigateParams() != null){
appDEUIAction.getPSNavigateParams().forEach(param ->{
navParams.append(param.getName().toLowerCase() + ":'"+(param.isRawValue()?"":"%")+param.getValue()+(param.isRawValue()?"":"%")+"',");
});
}
navParams.append("}");
actionJson.put("navParams",navParams);
if(appDEUIAction.getPSAppDEMethod() != null){
actionJson.put("methodCodeName",appDEUIAction.getPSAppDEMethod().getCodeName());
}
......@@ -95,6 +115,10 @@ public class AppEntityModel extends BaseModel{
});
}
}
// 主键属性名称
public String keyField = "";
// 主信息属性名称
public String majorField = "";
public IPSAppDataEntity getAppDataEntity()
{
......
......@@ -44,6 +44,6 @@
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event: IActionParam) => onEditorEvent(index,$event)"
@editorEvent="onEditorEvent($event,index)"
{{/eq}}
/>
......@@ -26,6 +26,6 @@
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event: IActionParam) => onEditorEvent(index,$event)"
@editorEvent="onEditorEvent($event,index)"
{{/eq}}
/>
......@@ -12,6 +12,6 @@
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event: IActionParam) => onEditorEvent(index,$event)"
@editorEvent="onEditorEvent($event,index)"
{{/eq}}
/>
......@@ -9,7 +9,7 @@
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event: IActionParam) => 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: IActionParam) => 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: IActionParam) => 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: IActionParam) => onEditorEvent(index,$event)"
@editorEvent="onEditorEvent($event,index)"
{{/eq}}
/>
......@@ -33,6 +33,6 @@
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
:data="record"
@editorEvent="($event: IActionParam) => onEditorEvent(index,$event)"
@editorEvent="onEditorEvent($event,index)"
{{/eq}}
/>
......@@ -12,7 +12,7 @@
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event: IActionParam) => onEditorEvent(index,$event)"
@editorEvent="onEditorEvent($event,index)"
{{/eq}}
/>
......@@ -42,6 +42,6 @@
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event: IActionParam) => onEditorEvent(index,$event)"
@editorEvent="onEditorEvent($event,index)"
{{/eq}}
/>
......@@ -42,6 +42,6 @@
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event: IActionParam) => onEditorEvent(index,$event)"
@editorEvent="onEditorEvent($event,index)"
{{/eq}}
/>
......@@ -26,6 +26,6 @@
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event: IActionParam) => 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: IActionParam) => onEditorEvent(index,$event)"
@editorEvent="onEditorEvent($event,index)"
{{/eq}}
/>
......@@ -16,6 +16,6 @@
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event: IActionParam) => onEditorEvent(index,$event)"
@editorEvent="onEditorEvent($event,index)"
{{/eq}}
/>
......@@ -25,6 +25,6 @@
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
:data="record"
@editorEvent="($event: IActionParam) => onEditorEvent(index,$event)"
@editorEvent="onEditorEvent($event,index)"
{{/eq}}
/>
......@@ -22,6 +22,6 @@
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event: IActionParam) => onEditorEvent(index,$event)"
@editorEvent="onEditorEvent($event,index)"
{{/eq}}
/>
......@@ -24,6 +24,6 @@
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event: IActionParam) => onEditorEvent(index,$event)"
@editorEvent="onEditorEvent($event,index)"
{{/eq}}
/>
......@@ -15,6 +15,6 @@
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event: IActionParam) => onEditorEvent(index,$event)"
@editorEvent="onEditorEvent($event,index)"
{{/eq}}
/>
......@@ -35,6 +35,6 @@
{{/if}}
{{#eq ctrlType 'grid'}}
:value="record.{{item.psEditor.name}}"
@editorEvent="($event: IActionParam) => onEditorEvent(index,$event)"
@editorEvent="onEditorEvent($event,index)"
{{/eq}}
/>
......@@ -18,16 +18,16 @@
},
{{/if}}
appEntityName: '{{page.appEntity.codeName}}',
isLoadDefault: true,
isLoadDefault: {{#if (or page.loadDefault (eq page.loadDefault false))}}{{page.loadDefault}}{{else}}true{{/if}},
keyPSDEField: '{{lowerCase page.appEntity.codeName}}',
{{!-- viewMsgGroup: '{{page.psAppViewMsgGroup}}', --}}
{{!-- viewUIActions: '{{page.psAppViewUIActions}}', --}}
viewSysCss: '{{page.psSysCss}}',
viewSysCss: '{{page.psSysCss.cssName}}',
{{!-- viewSysImage: '{{page.psSysImage}}', --}}
subCaption: '{{page.subCaption}}',
viewType: '{{page.viewType}}',
viewStyle: '{{page.viewStyle}}',
showCaptionBar: '{{page.viewStyle}}',
showCaptionBar: {{page.showCaptionBar}},
xDataControlName:'{{page.xDataControlName}}',
openDataViewName: 'ExampleEditorEditView',
appViewNavContexts:{{> @macro/front-end/common/navparam.hbs appNavParams=page.psAppViewNavContexts}},
......
关系界面未实现
\ No newline at end of file
{{#eq item.psLayoutPos 'FLEX'}}
<div style="flex-grow: {{#if item.psLayoutPos.grow}}{{item.psLayoutPos.grow}}{{else}}0{{/if}};">
<AppFormDruipart v-show="state.detailsModel.{{item.codeName}}.visible" name="{{item.codeName}}" title="{{item.caption}}">
<{{item.psAppView.codeName}}
:class="['app-view-layout--from-druipart']"
:context="druipartParams.context"
:viewParams="druipartParams.viewParams"
:viewDefaultUsage="false"
:noViewCaption="true"
@viewEvent="druipartParams.viewEvent"
>
</{{item.psAppView.codeName}}>
</AppFormDruipart>
</div>
{{else}}
<a-col
{{> @macro/front-end/widgets/common/layout-pos.hbs item=item.psLayoutPos}} >
<AppFormDruipart v-show="state.detailsModel.{{item.codeName}}.visible" name="{{item.codeName}}" title="{{item.caption}}">
<{{item.psAppView.codeName}}
:class="['app-view-layout--from-druipart']"
:context="druipartParams.context"
:viewParams="druipartParams.viewParams"
:viewDefaultUsage="false"
:noViewCaption="true"
@viewEvent="druipartParams.viewEvent"
>
</{{item.psAppView.codeName}}>
</AppFormDruipart>
</a-col>
{{/eq}}
\ No newline at end of file
......@@ -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}}
......
import { Environment } from "@/environments/environment";
import { OpenViewService } from "@/utils";
import { AppBase, IParam, ViewDetail, IApp, IOpenViewService, deepCopy, getSessionStorage, Http, AppUtil } from "@core";
import { AppBase, IParam, ViewDetail, IApp, IOpenViewService, deepCopy, getSessionStorage, Http, AppUtil, NavDataService, INavDataService } from "@core";
import { SyncSeriesHook } from "qx-util";
import { AppFuncConfig, AppViewConfig } from './config';
import { AppFuncConfig, AppViewConfig, AppEntityConfig } from './config';
import { DataServiceRegister, UIServiceRegister } from "./register";
export class App extends AppBase implements IApp {
......@@ -131,4 +131,24 @@ export class App extends AppBase implements IApp {
return AppViewConfig[codeName] ? (deepCopy(AppViewConfig[codeName]) as ViewDetail) : undefined;;
}
/**
* 获取实体信息
*
* @static
* @param codeName 实体codeName
* @return {*}
*/
public getEntityInfo(codeName: string): any {
return AppEntityConfig[codeName] ? deepCopy(AppEntityConfig[codeName]) : undefined;
}
/**
* @description 获取导航数据服务
* @return {*} {*}
* @memberof App
*/
public getNavDataService(): INavDataService {
return NavDataService.getInstance();
}
}
\ No newline at end of file
import { IParam } from "@core";
export const AppEntityConfig:IParam = {
{{#each app.appEntitiesMap as |appEntity|}}
"{{appEntity.codeName}}":{
"name": "{{appEntity.name}}",
"codeName": "{{appEntity.codeName}}",
"majorField":"{{appEntity.majorField}}",
"keyField":"{{appEntity.keyField}}"
}{{#unless @last}},{{/unless}}
{{/each}}
}
\ No newline at end of file
......@@ -16,6 +16,12 @@ export const AppViewConfig:IParam = {
"parameters": [
{ "pathName": "views", "parameterName": "{{lowerCase appView.codeName}}" }
],
{{#if (gt appView.height 0)}}
"height": {{appView.height}},
{{/if}}
{{#if (gt appView.width 0)}}
"width": {{appView.width}},
{{/if}}
{{#if appView.capPSLanguageRes}}
"captionTag": "{{appView.capPSLanguageRes.lanResTag}}",
{{/if}}
......
export { AppFuncConfig } from './app-func-config';
export { AppViewConfig } from './app-view-config';
export { AppCodeListConfig } from './app-code-list-config';
export { AppEntityConfig } from './app-entity-config';
\ No newline at end of file
......@@ -20,6 +20,7 @@
<template v-slot:header-bottom>
<slot name="quickSearchForm" />
<slot name="searchForm" />
<slot name="searchBar" />
</template>
<template v-slot:body-top>
<slot name="bodyMessage" />
......
<script setup lang="ts">
import { IActionParam, IParam } from "@core";
interface FilterTreeProps{
datas:any[]
fields:any[]
}
const props = withDefaults(defineProps<FilterTreeProps>(), {
});
onMounted(() => {
console.log(props)
});
</script>
<template>
<div class="app-filter-tree">暂未支持</div>
</template>
<style lang="scss">
</style>
\ No newline at end of file
<script setup lang="ts">
import { IActionParam, IParam, RouteUtil } from '@core';
import { Subject, Subscription } from 'rxjs';
interface FormDruipartProps {
// 关联视图
viewName: string;
// 刷新关系项
tempMode: string;
// 禁止加载
isForbidLoad: string;
// 传入参数项名称
paramItem: string;
// 视图上下文
context: string;
// 视图参数
viewParams: boolean;
// 应用实体参数名称
parentName: number;
// 应用实体映射实体名称
parentDeName: boolean;
// 标题
title: string;
// 刷新关系项
refreshItems: string;
// 表单数据
data: string;
// 表单订阅对象
formState: Subject<any>;
// 视图路由参数
parameters: any[];
// 名称
name: string;
// 是否忽略表单项值变化
ignoreFieldValueChange: boolean;
}
interface FormDruipartEmit {
(name: 'componentEvent', value: IActionParam): void;
}
const props = withDefaults(defineProps<FormDruipartProps>(), {});
const emit = defineEmits<FormDruipartEmit>();
let formStateEvent: undefined | Subscription = undefined;
const formDruipart: Subject<any> = new Subject<any>();
// 关秀界面上下文
let druipartContext:any = undefined;
// 关秀界面视图参数
let druipartViewParams:any = undefined;
onBeforeMount(() => {
watch(
() => props.data,
(newVal: any, oldVal: any) => {
if (props.ignoreFieldValueChange) {
return;
}
if (Object.is(newVal, oldVal)) {
return;
}
refreshDRUIPart();
},
);
druipartInit();
});
// 关系界面初始化
const druipartInit = () => {
if (!props.formState) {
return;
}
formStateEvent = props.formState.subscribe(($event: any) => {
// 表单加载完成
if (Object.is($event.type, 'load')) {
refreshDRUIPart($event.data);
}
});
};
// 刷新关系界面
const refreshDRUIPart = (data?: any) => {
// const formData: any = data ? data : JSON.parse(props.data);
// const _paramItem = formData[props.paramItem];
// let tempContext: any = {};
// let tempParam: any = {};
// const _parameters: any[] = [RouteUtil.getIndexViewParam(), ...props.parameters];
// _parameters.forEach((parameter: any) => {
// const { pathName, parameterName }: { pathName: string; parameterName: string } = parameter;
// if (formData[parameterName] && !Object.is(formData[parameterName], '')) {
// Object.assign(tempContext, {
// [parameterName]: formData[parameterName],
// });
// }
// });
// Object.assign(tempContext, { [props.paramItem]: _paramItem });
// //设置顶层视图唯一标识
// Object.assign(tempContext, props.context);
// Object.assign(tempContext, {
// srfParentDeName: props.parentName,
// srfParentDeMapName: props.parentDeName,
// srfParentKey: _paramItem,
// });
// Object.assign(tempParam, {
// srfParentDeName: props.parentName,
// srfParentDeMapName: props.parentDeName,
// srfParentKey: _paramItem,
// });
// 设置局部上下文
formDruipart.next({ action: 'load' });
};
const viewEvent = (action:any) => {
};
</script>
<template>
<a-card :class="['app-form-druipart', `app-form-druipart-${name}`]" :bordered="false">
<template #title>
<p :class="['app-form-druipart-title']">
<AppIconText :text="title" />
</p>
</template>
<slot :context="druipartContext" :viewParams="druipartViewParams" :viewEvent="viewEvent" ></slot>
</a-card>
</template>
<style lang="scss">
.app-form-druipart {
height: 100%;
width: 100%;
.ant-card-head {
text-align: left;
.app-form-druipart-title {
margin: 0px;
}
}
.app-view-layout--from-druipart {
padding: 0;
}
}
</style>
\ No newline at end of file
import { IParam, ViewDetail } from "../common";
import { IAppFuncService, IDataServiceRegister, IOpenViewService, IUIServiceRegister } from "../service";
import { IAppFuncService, IDataServiceRegister, INavDataService, IOpenViewService, IUIServiceRegister } from "../service";
/**
......@@ -72,6 +72,17 @@ export interface IApp {
*/
getViewInfo(codeName: string): ViewDetail | undefined;
/**
* 获取实体信息
*
* @static
* @param codeName 实体codeName
* @return {*}
*/
getEntityInfo(codeName: string): any;
/**
* 获取应用数据
*
......@@ -86,6 +97,13 @@ export interface IApp {
* @param {IParam} opt
* @memberof IApp
*/
setAppData(opt:IParam): void;
setAppData(opt: IParam): void;
/**
* @description 获取导航数据服务
* @return {*} {INavDataService}
* @memberof IApp
*/
getNavDataService(): INavDataService;
}
\ No newline at end of file
import { INavDataParam, IParam, ViewDetail } from "@core";
import { Subject } from 'rxjs';
/**
* @description 打开视图服务接口
* @export
* @interface INavDataService
*/
export interface INavDataService {
addNavData(curNavData: INavDataParam): void;
getNavData(): Array<INavDataParam>;
getPreNavData(tag: string): INavDataParam | null;
skipNavData(tag: string): void;
removeNavData(tag: string): void;
removeNavDataFirst(): void;
removeNavDataLast(): void;
removeAllNavData(): void;
}
\ No newline at end of file
......@@ -3,3 +3,4 @@ export * from './i-app-action-service';
export * from './i-open-view-service';
export * from './i-data-service-register';
export * from './i-ui-service-register';
export * from './i-nav-data-service';
\ No newline at end of file
import { AppActionService, IContext, IParam } from "@core";
import { AppActionService, IContext, IParam, UIActionUtil } from "@core";
export interface ActionParams {
/**
......@@ -60,7 +60,7 @@ export class AppActionBase {
* @memberof AppActionBase
*/
public static async getUIService(actionEnvironment: IParam) {
const entityName = actionEnvironment?.viewState?.appEntityName;
const entityName = actionEnvironment?.state?.appEntityName;
if (!entityName) {
console.log("实体名称不存在");
return;
......@@ -76,13 +76,48 @@ export class AppActionBase {
/**
* 根据数据目标处理行为参数
*
* @param {string} ActionTarget
* @param {string} action
* @param { context: IContext, viewParams: IParam, data: IParam, event: MouseEvent, actionEnvironment: IParam } params
* @memberof AppFrontAction
*/
public static handleActionTarget(ActionTarget: string, params: { context: IContext, viewParams: IParam, data: IParam, event: MouseEvent, actionEnvironment: IParam }): IParam {
// todo
return {};
public static handleActionTarget(action: IParam, params: { context: IContext, viewParams: IParam, data: IParam, event: MouseEvent, actionEnvironment: IParam }): ActionParams {
const { actionTarget, entityCodeName } = action;
const { data } = params;
// 数据目标值
let resultData: ActionParams = {
context: {},
viewParams: {},
data: {}
};
switch (actionTarget) {
case 'SINGLEKEY':
case 'MULTIKEY':
// 多数据主键和单数据主键,合并实体的主键参数和主信息参数 到上下文 后续统一合并进数据目标值
if (!entityCodeName) {
console.log("实体名称不存在");
break;
}
const entity = App.getEntityInfo(entityCodeName);
if (!entity) {
console.log("实体不存在");
break;
}
const entityName = entityCodeName.toLowerCase();
const keyField = entity.keyField.toLowerCase();
const majorField = entity.majorField.toLowerCase();
if (data?.[0]?.[keyField]) {
Object.assign(resultData.context, { [entityName]: `%${keyField}%` });
} else {
Object.assign(resultData.context, { [entityName]: `%${entityName}%` });
}
Object.assign(resultData.viewParams, { [keyField]: `%${keyField}%` });
Object.assign(resultData.viewParams, { [majorField]: `%${majorField}%` });
break;
case 'SINGLEDATA':
resultData.data = data?.[0]?data?.[0]:{};
break;
}
return resultData;
}
/**
......@@ -93,9 +128,39 @@ export class AppActionBase {
* @param { context: IContext, viewParams: IParam, data: IParam, event: MouseEvent, actionEnvironment: IParam } params
* @memberof AppFrontAction
*/
public static handleActionParam(uiAction: IParam, params: { context: IContext, viewParams: IParam, data: IParam, event: MouseEvent, actionEnvironment: IParam }, data: IParam): ActionParams {
// todo
return { context: {}, viewParams: {}, data: {} };
public static handleActionParam(uiAction: IParam, params: { context: IContext, viewParams: IParam, data: IParam, event: MouseEvent, actionEnvironment: IParam }, data: ActionParams): ActionParams {
const { navContexts, navParams, actionTarget } = uiAction;
const { viewParams, context, data: _data } = params;
const { context: tempContext, viewParams: tempViewParams, } = data;
let { data: resultData } = data;
// 合并导航参数和导航上下文至数据目标处理后的参数
Object.assign(tempContext, navContexts);
Object.assign(tempViewParams, navParams);
// 根据上下文和导航参数,解析参数
const _context = UIActionUtil.formatDataActionData(actionTarget, _data, context, viewParams, tempContext);
const _viewParams = UIActionUtil.formatDataActionData(actionTarget, _data, context, viewParams, tempViewParams);
if (Object.is(actionTarget, 'SINGLEDATA')) {
Object.assign(resultData, _viewParams);
} else {
resultData = _viewParams;
}
// 多项数据主键转换数据
if (Object.is(actionTarget, 'MULTIKEY')) {
let tempDataArray: Array<any> = [];
if (_data.length > 1 && Object.keys(data).length > 0) {
for (let i = 0; i < _data.length; i++) {
let tempObject: any = {};
Object.keys(resultData).forEach((key: string) => {
Object.assign(tempObject, { [key]: resultData[key].split(',')[i] });
});
tempDataArray.push(tempObject);
}
} else {
tempDataArray.push(data);
}
resultData = tempDataArray;
}
return { context: _context, viewParams: _viewParams, data: resultData };
}
/**
......
......@@ -16,14 +16,14 @@ export class AppBackendAction extends AppActionBase {
*/
public static async doBackendAction(uiAction: IParam, params: { context: IContext, viewParams: IParam, data: IParam, event: MouseEvent, actionEnvironment: IParam }, actionParams: ActionParams): Promise<UIActionResult> {
try {
const { context, actionEnvironment } = params;
const entityName = actionEnvironment?.viewState?.appEntityName;
const { actionEnvironment } = params;
const { context } = actionParams;
const entityName = actionEnvironment?.state?.appEntityName;
if (!entityName) {
console.log("实体名称不存在");
return { ok: false, result: null };
}
const methodCodeName: string = uiAction.methodCodeName;
if (!methodCodeName) {
console.log("实体行为不存在");
return { ok: false, result: null };
......@@ -31,7 +31,7 @@ export class AppBackendAction extends AppActionBase {
// 获取实体服务
const dataService = await App.getDataService(entityName.toLowerCase(), context)
// 获取实体行为名称
const response = await dataService[methodCodeName](context, actionParams);
const response = await dataService[methodCodeName](context, actionParams.data);
return new Promise((resolve: any, reject: any) => {
if (response && response.ok) {
this.doSuccessMessage(uiAction);
......@@ -112,7 +112,7 @@ export class AppBackendAction extends AppActionBase {
/**
* 执行台行为
* 执行台行为
*
* @param {IParam} uiAction
* @memberof AppFrontAction
......@@ -125,7 +125,7 @@ export class AppBackendAction extends AppActionBase {
// 消息确认提示
this.doConfirmMessage(uiAction);
// 根据行为目标 合并行为参数
const data = this.handleActionTarget(uiAction.actionTarget, params);
const data = this.handleActionTarget(uiAction, params);
// 处理行为参数 导航参数、数据项、信息项、参数项
const actionParams = this.handleActionParam(uiAction, params, data);
// 执行行为
......
......@@ -19,8 +19,8 @@ export class AppFrontAction extends AppActionBase {
*/
public static openView(uiAction: IParam, params: { context: IContext, viewParams: IParam, data: IParam, event: MouseEvent, actionEnvironment: IParam }, actionParams: ActionParams): Promise<UIActionResult> {
return new Promise((resolve: any, reject: any) => {
const { context, viewParams } = params;
const { frontPSAppView } = uiAction;
const { context, viewParams, data } = actionParams;
if (!frontPSAppView) {
console.log("模型视图名称不存在");
return reject({ ok: false, result: null });
......@@ -103,7 +103,7 @@ export class AppFrontAction extends AppActionBase {
return this.executeUILogic(uiAction, params);
}
// 根据行为目标 合并行为参数
const data = this.handleActionTarget(uiAction.actionTarget, params);
const data = this.handleActionTarget(uiAction, params);
// 处理行为参数 导航参数、数据项、信息项、参数项
const actionParams = this.handleActionParam(uiAction, params, data);
// 执行行为
......
import { AppFuncService, IApp, IAppFuncService, IOpenViewService, ViewDetail } from "@core";
import { IDataServiceRegister, IParam, IUIServiceRegister } from "@core/interface";
import { IDataServiceRegister, INavDataService, IParam, IUIServiceRegister } from "@core/interface";
/**
* 应用基类
......@@ -120,4 +120,13 @@ export abstract class AppBase implements IApp {
public getViewInfo(codeName: string): ViewDetail | undefined {
return undefined;
}
/**
* @description 获取导航数据服务
* @return {*} {INavDataService}
* @memberof AppBase
*/
public getNavDataService(): INavDataService {
throw new Error("Method not implemented.");
}
}
\ No newline at end of file
......@@ -41,12 +41,12 @@ public declare state: GridViewState;
* @param {IActionParam} actionParam
* @memberof MDView
*/
public handleCtrlEvent(actionParam: IActionParam) {
public onCtrlEvent(actionParam: IActionParam) {
const { tag, action, data } = actionParam;
if (Object.is(tag, 'grid')) {
this.MDCtrlEvent(action, data);
}
super.handleCtrlEvent(actionParam);
super.onCtrlEvent(actionParam);
}
/**
......
......@@ -66,7 +66,7 @@ export class MDView extends MainView {
* @param {IActionParam} actionParam
* @memberof MDView
*/
public handleCtrlEvent(actionParam: IActionParam) {
public onCtrlEvent(actionParam: IActionParam) {
const { tag, action, data } = actionParam;
if (Object.is(tag, 'searchform')) {
this.handleSearchFormEvent(action, data);
......
......@@ -38,7 +38,7 @@ export class PickupGridView extends PickupView {
* @param {IActionParam} actionParam
* @memberof PickupGridView
*/
public handleCtrlEvent(actionParam: IActionParam) {
public onCtrlEvent(actionParam: IActionParam) {
const { tag, action, data } = actionParam;
if (tag !== 'grid') {
return;
......
......@@ -49,7 +49,7 @@ export class PickupView extends MainView {
this.emit('viewEvent', { data: this.selectData, tag: '', action: 'close' })
}
public handleCtrlEvent(actionParam: IActionParam) {
public onCtrlEvent(actionParam: IActionParam) {
const { tag, action, data } = actionParam;
// TODO
......
......@@ -194,7 +194,19 @@ export class ViewBase {
*
* @memberof ViewBase
*/
public useViewInit() { }
public useViewInit() {
const route = useRoute();
App.getNavDataService().addNavData({title: this.state.viewCaption, viewType: this.state.viewType, path: unref(route.fullPath), openType: this.props.openType, tag: this.state.viewCodeName, key: '', data: {}});
}
/**
* @description 视图销毁
* @memberof ViewBase
*/
public useViewDestroyed() {
// 视图销毁从导航栈里面删除数据
App.getNavDataService().removeNavData(this.state.viewCodeName);
}
/**
* @description 安装视图所有功能模块的方法
......
......@@ -21,7 +21,7 @@ export class ExpBarControl extends MainControl {
* @param {IActionParam} actionParam
* @memberof ExpBarControl
*/
public handleCtrlEvent(actionParam: IActionParam) {
public onCtrlEvent(actionParam: IActionParam) {
const { tag, action, data } = actionParam;
const { selection } = this.state;
switch (action) {
......@@ -73,7 +73,7 @@ export class ExpBarControl extends MainControl {
const superParams = super.moduleInstall();
return {
...superParams,
handleCtrlEvent: this.handleCtrlEvent.bind(this)
onCtrlEvent: this.onCtrlEvent.bind(this)
};
}
}
\ No newline at end of file
import { DataTypes, dateFormat, deepCopy, FormControlProps, FormControlState, IActionParam, IParam, MainControl, UIUtil, verifyValue } from '@core';
import {
DataTypes,
dateFormat,
deepCopy,
FormControlProps,
FormControlState,
IActionParam,
IParam,
MainControl,
UIUtil,
verifyValue,
} from '@core';
/**
* @description 表单部件
......@@ -28,12 +39,12 @@ export class FormControl extends MainControl {
if (logic.groupOP == 'AND') {
const falseItem = logic.logics.find((childLogic: IParam) => {
return !this.verifyGroupLogic(data, childLogic);
})
});
result = falseItem ? false : true;
} else if (logic.groupOP == 'OR') {
const trueItem = logic.logics.find((childLogic: IParam) => {
return this.verifyGroupLogic(data, childLogic);
})
});
result = trueItem ? true : false;
}
// 是否取反
......@@ -62,7 +73,7 @@ export class FormControl extends MainControl {
this.formItemUpdate(name);
this.formDynamicLogic(name);
if (enableAutoSave) {
this.useSave().save();
this.save();
}
}
......@@ -80,7 +91,7 @@ export class FormControl extends MainControl {
this.handleFormDataChange(item.valueItemName, null);
}
}
})
});
}
/**
......@@ -110,7 +121,7 @@ export class FormControl extends MainControl {
if (data.value.hasOwnProperty(detailsName)) {
data.value[detailsName] = response.data[detailsName];
}
})
});
this.afterFormAction('formItemUpdate');
}
}
......@@ -284,12 +295,14 @@ export class FormControl extends MainControl {
data.value[detail.codeName] = controlService.getRemoteCopyData()?.[detail.codeName] || null;
break;
default:
data.value[detail.codeName] = DataTypes.isNumber(detail.dataType) ? Number(detail?.createDV) : detail?.createDV;
data.value[detail.codeName] = DataTypes.isNumber(detail.dataType)
? Number(detail?.createDV)
: detail?.createDV;
break;
}
}
}
})
});
}
/**
......@@ -325,14 +338,24 @@ export class FormControl extends MainControl {
data.value[detail.codeName] = controlService.getRemoteCopyData()?.[detail.codeName] || null;
break;
default:
data.value[detail.codeName] = DataTypes.isNumber(detail.dataType) ? Number(detail.updateDV) : detail.updateDV;
data.value[detail.codeName] = DataTypes.isNumber(detail.dataType)
? Number(detail.updateDV)
: detail.updateDV;
break;
}
}
}
})
});
}
/**
* 加载草稿行为
*
* @protected
* @param [opt={}]
*/
protected async loadDraft(opt: any = {}) {}
/**
* @description 使用加载草稿功能模块
* @param {FormControlProps} props 传入的props
......@@ -371,6 +394,10 @@ export class FormControl extends MainControl {
console.log(error);
}
};
// 在类里绑定能力方法
this.loadDraft = loadDraft;
// 订阅viewSubject,监听load行为
if (viewSubject) {
let subscription = viewSubject.subscribe(({ tag, action, data }: IActionParam) => {
......@@ -378,14 +405,23 @@ export class FormControl extends MainControl {
loadDraft(data);
}
});
// 部件卸载时退订viewSubject
onUnmounted(() => {
subscription.unsubscribe();
});
}
return { loadDraft };
return loadDraft;
}
/**
* 加载行为
*
* @protected
* @param [opt={}]
*/
protected async load(opt: any = {}) {}
/**
* @description 使用加载功能模块
* @return {*}
......@@ -427,6 +463,9 @@ export class FormControl extends MainControl {
}
};
// 在类里绑定能力方法
this.load = load;
// 订阅viewSubject,监听load行为
if (viewSubject) {
let subscription = viewSubject.subscribe(({ tag, action, data }: IActionParam) => {
......@@ -441,11 +480,17 @@ export class FormControl extends MainControl {
});
}
return {
load: load,
};
return load;
}
/**
* 保存行为
*
* @protected
* @param [opt={}]
*/
protected async save(opt: any = {}) {}
/**
* @description 使用加载功能模块
* @return {*}
......@@ -482,19 +527,14 @@ export class FormControl extends MainControl {
Object.assign(arg, data.getDo());
Object.assign(arg, { viewParams: _viewParams });
// TODO 关系界面保存通知处理,做成异步。
// TODO 拷贝相关。
// 发起请求处理与解析请求
const response = await controlService[saveFunName](
_context,
arg,
{
const response = await controlService[saveFunName](_context, arg, {
action: saveAction,
isLoading: showBusyIndicator,
},
);
});
if (!response.status || response.status !== 200) {
// TODO 统一Error格式
return;
......@@ -510,6 +550,9 @@ export class FormControl extends MainControl {
}
};
// 在类里绑定能力方法
this.save = save;
// 订阅viewSubject,监听load行为
if (viewSubject) {
let subscription = viewSubject.subscribe(({ tag, action, data }: IActionParam) => {
......@@ -523,11 +566,17 @@ export class FormControl extends MainControl {
});
}
return {
save: save,
};
return save;
}
/**
* 删除行为
*
* @protected
* @param [opt={}]
*/
protected async remove(opt: any = {}) {}
/**
* @description 使用加载功能模块
* @param {FormControlProps} props 传入的props
......@@ -558,17 +607,13 @@ 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: _viewParams });
// 发起请求处理与解析请求
const response = await controlService.remove(
_context,
arg,
{
const response = await controlService.remove(_context, arg, {
action: removeAction,
isLoading: showBusyIndicator
},
);
isLoading: showBusyIndicator,
});
if (!response.status || response.status !== 200) {
return;
}
......@@ -581,6 +626,9 @@ export class FormControl extends MainControl {
}
};
// 在类里绑定能力方法
this.remove = remove;
// 订阅viewSubject,监听load行为
if (viewSubject) {
let subscription = viewSubject.subscribe(({ tag, action, data }: IActionParam) => {
......@@ -595,9 +643,7 @@ export class FormControl extends MainControl {
});
}
return {
remove: remove,
};
return remove;
}
/**
......@@ -639,7 +685,7 @@ export class FormControl extends MainControl {
* @memberof FormControl
*/
public handleFormGroupAction(tag: string, data: any) {
console.log(tag, data)
console.log(tag, data);
}
/**
......
......@@ -55,16 +55,16 @@ export class GridControl extends MDControl {
if (!rowEditState) {
selectedRowKeys.value = [record.srfkey];
if (!record.children) {
this.emit("onCtrlEvent", { tag: controlName, action: "selectionChange", data: [deepCopy(record)] })
this.emit("ctrlEvent", { tag: this.props.name, action: "selectionChange", data: [deepCopy(record)] })
if (Object.is(rowActiveMode, 1)) {
this.emit("onCtrlEvent", { tag: controlName, action: "rowClick", data: [deepCopy(record)] })
this.emit("ctrlEvent", { tag: this.props.name, action: "rowClick", data: [deepCopy(record)] })
}
}
}
},
onDblclick: () => {
if (!record.children && Object.is(rowActiveMode, 2)) {
this.emit("onCtrlEvent", { tag: controlName, action: "rowDbClick", data: [deepCopy(record)] })
this.emit("ctrlEvent", { tag: this.props.name, action: "rowDbClick", data: [deepCopy(record)] })
}
}
};
......@@ -86,7 +86,7 @@ export class GridControl extends MDControl {
selection.push(select);
}
})
this.emit("onCtrlEvent", { tag: controlName, action: "selectionChange", data: selection })
this.emit("ctrlEvent", { tag: this.props.name, action: "selectionChange", data: selection })
},
};
});
......@@ -97,7 +97,7 @@ export class GridControl extends MDControl {
// 处理表格变化(分页,过滤,排序)
const onGridChange = (pagination: IParam, filters: IParam, sorter: IParam, data: IParam) => {
if (pagination) {
this.useLoad().load();
this.load();
}
}
return {
......@@ -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 行为参数
......@@ -179,8 +189,8 @@ export class GridControl extends MDControl {
selectedRowKeys.value = _selectedRowKeys;
} else if (isSelectDefault) {
if (items && items.length > 0) {
this.emit("onCtrlEvent", {
tag: controlName,
this.emit("ctrlEvent", {
tag: this.props.name,
action: "selectionChange",
data: [deepCopy(items[0])],
});
......@@ -433,6 +443,7 @@ export class GridControl extends MDControl {
...superParams,
useCustom: this.useCustom(),
onEditorEvent: this.onEditorEvent.bind(this),
onToolbarEvent: this.onToolbarEvent.bind(this)
};
}
}
......@@ -10,3 +10,4 @@ export * from './tree-exp-bar-control'
export * from './tree-control'
export * from './search-form-control'
export * from './quick-search-form-control'
export * from './searchbar-control'
......@@ -7,7 +7,6 @@ import { MDControlState, MainControl, deepCopy, IActionParam, IParam } from '@co
* @extends {MainControl}
*/
export class MDControl extends MainControl {
/**
* @description 多数据部件状态
* @type {MDControlState}
......@@ -22,13 +21,21 @@ export class MDControl extends MainControl {
public setState() {
super.setState();
// 交联输入Props
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 = toRef(this.props, "selectedData") as any;
this.state.isSelectDefault = toRef(this.props, "isSelectDefault") as any;
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 = toRef(this.props, 'selectedData') as any;
this.state.isSelectDefault = toRef(this.props, 'isSelectDefault') as any;
}
/**
* 加载行为
*
* @protected
* @param [opt={}]
*/
protected async load(opt: any = {}) {}
/**
* @description 使用加载功能模块
* @return {*}
......@@ -36,37 +43,38 @@ export class MDControl extends MainControl {
*/
public useLoad() {
const { viewSubject, controlName } = this.state;
const load = async (opt: any = {}) => {
try {
let {
controlService, context, viewParams, showBusyIndicator, controlAction, mdCtrlSort, mdCtrlPaging
} = this.state;
let { controlService, context, viewParams, showBusyIndicator, controlAction, mdCtrlSort, mdCtrlPaging } =
this.state;
if (!controlAction.fetchAction) {
return;
}
// 组装查询参数
const arg: any = { ...opt };
let tempContext = deepCopy(context ? context : {});
let tempViewParams = deepCopy(viewParams ? viewParams : {});
const { noSort, minorSortDir, minorSortPSDEF } = mdCtrlSort;
let { enablePagingBar, current, pageSize } = mdCtrlPaging;
if (noSort && minorSortDir && minorSortPSDEF) {
if (!noSort && minorSortDir && minorSortPSDEF) {
Object.assign(tempViewParams, { sort: `${minorSortPSDEF},${minorSortDir}` });
}
if (enablePagingBar) {
Object.assign(tempViewParams, { page: current - 1, size: pageSize });
}
Object.assign(arg, tempViewParams);
// 组装视图其他查询参数
this.emit('ctrlevent', { tag: controlName.toLowerCase(), action: 'beforeload', data: arg });
const response = await controlService.search(
tempContext,
arg,
{ action: controlAction.fetchAction, isLoading: showBusyIndicator }
);
this.emit("ctrlEvent", { tag: this.props.name, action: 'beforeload', data: arg });
const response = await controlService.search(tempContext, arg, {
action: controlAction.fetchAction,
isLoading: showBusyIndicator,
});
if (response.status || response.status == 200) {
this.state.items = response.data;
this.emit('ctrlevent', { tag: controlName.toLowerCase(), action: 'load', data: response.data });
this.emit("ctrlEvent", { tag: this.props.name, action: 'load', data: response.data });
if (enablePagingBar) {
this.state.mdCtrlPaging.pagination['total'] = response.total;
}
......@@ -76,22 +84,35 @@ export class MDControl extends MainControl {
// todo 错误异常处理
console.log(error);
}
}
};
// 在类里绑定能力方法
this.load = load;
// 订阅viewSubject,监听load行为
if (viewSubject) {
let subscription = viewSubject.subscribe(({ tag, action, data }: IActionParam) => {
if (Object.is(controlName, tag) && Object.is("load", action)) {
if (Object.is(controlName, tag) && Object.is('load', action)) {
load(data);
}
})
});
// 部件卸载时退订viewSubject
onUnmounted(() => {
subscription.unsubscribe();
})
});
}
return { load };
return load;
}
/**
* 保存行为
*
* @protected
* @param [opt={}]
*/
protected async save(opt: any = {}) {}
/**
* @description 使用保存功能模块
* @return {*}
......@@ -105,7 +126,8 @@ export class MDControl extends MainControl {
// TODO 值规则校验处理
for (const item of items) {
const { updateAction, createAction } = controlAction;
const saveAction: any = item.rowDataState == "update" ? updateAction : item.rowDataState == "create" ? createAction : "";
const saveAction: any =
item.rowDataState == 'update' ? updateAction : item.rowDataState == 'create' ? createAction : '';
if (!saveAction) {
return;
}
......@@ -114,13 +136,11 @@ export class MDControl extends MainControl {
let _viewParams = deepCopy(viewParams);
Object.assign(arg, item.getDo());
Object.assign(arg, { viewParams: _viewParams });
const response = await controlService[saveAction](
_context,
arg,
{ action: saveAction, isLoading: showBusyIndicator },
);
const response = await controlService[saveAction](_context, arg, {
action: saveAction,
isLoading: showBusyIndicator,
});
if (response.status || response.status == 200) {
}
}
} catch (error) {
......@@ -128,21 +148,34 @@ export class MDControl extends MainControl {
console.log(error);
}
};
// 在类里绑定能力方法
this.save = save;
// 订阅viewSubject,监听load行为
if (viewSubject) {
let subscription = viewSubject.subscribe(({ tag, action, data }: IActionParam) => {
if (Object.is(controlName, tag) && Object.is("save", action)) {
if (Object.is(controlName, tag) && Object.is('save', action)) {
save(data);
}
});
// 部件卸载时退订viewSubject
onUnmounted(() => {
subscription.unsubscribe();
});
}
return { save };
return save;
}
/**
* 删除行为
*
* @protected
* @param [opt={}]
*/
protected async remove(opt: any = {}) {}
/**
* @description 使用删除功能模块
* @return {*}
......@@ -159,7 +192,7 @@ export class MDControl extends MainControl {
}
const _data: IParam[] = [];
opt.forEach((item: IParam, index: number) => {
if (Object.is(item.srfuf, "0")) {
if (Object.is(item.srfuf, '0')) {
items.value.some((val: any, num: number) => {
if (JSON.stringify(val) == JSON.stringify(item)) {
items.value.splice(num, 1);
......@@ -175,7 +208,7 @@ export class MDControl extends MainControl {
_data.forEach((item: IParam) => {
keys.push(item.srfkey);
});
const _removeAction = keys.length > 1 ? "removeBatch" : controlAction.removeAction;
const _removeAction = keys.length > 1 ? 'removeBatch' : controlAction.removeAction;
let _context = deepCopy(context);
Object.assign(_context, { [appDeCodeName]: keys });
let _viewParams = deepCopy(viewParams);
......@@ -183,13 +216,11 @@ export class MDControl extends MainControl {
[appDeCodeName]: keys,
};
Object.assign(arg, { viewParams: _viewParams });
const response = await controlService.remove(
_context,
arg,
{ action: _removeAction, isLoading: showBusyIndicator },
);
const response = await controlService.remove(_context, arg, {
action: _removeAction,
isLoading: showBusyIndicator,
});
if (response.status || response.status == 200) {
}
}
} catch (error) {
......@@ -197,21 +228,34 @@ export class MDControl extends MainControl {
console.log(error);
}
};
// 在类里绑定能力方法
this.remove = remove;
// 订阅viewSubject,监听load行为
if (viewSubject) {
let subscription = viewSubject.subscribe(({ tag, action, data }: IActionParam) => {
if (Object.is(controlName, tag) && Object.is("remove", action)) {
if (Object.is(controlName, tag) && Object.is('remove', action)) {
remove(data);
}
});
// 部件卸载时退订viewSubject
onUnmounted(() => {
subscription.unsubscribe();
});
}
return { remove };
return remove;
}
/**
* 新建行行为(新增一条数据)
*
* @protected
* @param [opt={}]
*/
protected async newRow(opt: any = {}) {}
/**
* @description 使用新建功能模块
* @return {*}
......@@ -230,11 +274,10 @@ export class MDControl extends MainControl {
let _viewParams = deepCopy(viewParams);
const arg: any = { ...opt };
Object.assign(arg, { viewParams: _viewParams });
const response = await controlService.loadDraft(
_context,
arg,
{ action: controlAction.loadDraftAction, isLoading: showBusyIndicator },
);
const response = await controlService.loadDraft(_context, arg, {
action: controlAction.loadDraftAction,
isLoading: showBusyIndicator,
});
if (response.status || response.status == 200) {
items.value = [...items.value, [response.data]];
}
......@@ -244,10 +287,13 @@ export class MDControl extends MainControl {
}
};
// 在类里绑定能力方法
this.newRow = newRow;
// 订阅viewSubject,监听load行为
if (viewSubject) {
let subscription = viewSubject.subscribe(({ tag, action, data }: IActionParam) => {
if (Object.is(controlName, tag) && Object.is("newRow", action)) {
if (Object.is(controlName, tag) && Object.is('newRow', action)) {
newRow(data);
}
});
......@@ -257,9 +303,7 @@ export class MDControl extends MainControl {
});
}
return {
newRow,
};
return newRow;
}
/**
......@@ -267,7 +311,7 @@ export class MDControl extends MainControl {
*
* @memberof MDControl
*/
public handleStateChange() { }
public handleStateChange() {}
/**
* 处理数据分组
......@@ -276,10 +320,10 @@ export class MDControl extends MainControl {
*/
public handleDataGroup() {
const { enableGroup, groupField, groupMode } = this.state.mdCtrlGroup;
if (enableGroup && groupField && !Object.is(groupMode, "NONE")) {
if (Object.is(groupMode, "AUTO")) {
if (enableGroup && groupField && !Object.is(groupMode, 'NONE')) {
if (Object.is(groupMode, 'AUTO')) {
this.autoGroupData();
} else if (Object.is(groupMode, "CODELIST")) {
} else if (Object.is(groupMode, 'CODELIST')) {
this.codeListGroupData();
}
}
......@@ -291,7 +335,7 @@ export class MDControl extends MainControl {
* @protected
* @memberof MDControl
*/
protected autoGroupData() { }
protected autoGroupData() {}
/**
* 代码表分组
......@@ -299,7 +343,7 @@ export class MDControl extends MainControl {
* @protected
* @memberof MDControl
*/
protected codeListGroupData() { }
protected codeListGroupData() {}
/**
* 获取当前激活数据
......@@ -322,8 +366,8 @@ export class MDControl extends MainControl {
...superParams,
load: this.useLoad(),
save: this.useSave(),
romove: this.useRemove(),
new: this.useNewRow()
remove: this.useRemove(),
newRow: this.useNewRow(),
};
}
}
......@@ -49,7 +49,7 @@ export class PickupViewPanelControl extends MainControl {
const { tag, action, data } = actionParam;
const { controlName } = this.state;
if (Object.is("selectionChange", action)) {
this.emit('ctrlEvent', { tag: controlName, action: action, data: data });
this.emit("ctrlEvent", { tag: this.props.name, action: action, data: data });
}
}
......
......@@ -21,8 +21,8 @@ export class QuickSearchFormControl extends FormControl {
*/
public onEditorEvent(actionParam: IActionParam) {
super.onEditorEvent(actionParam);
this.emit("onCtrlEvent", {
tag: this.state.controlName,
this.emit("ctrlEvent", {
tag: this.props.name,
action: "selectionChange",
data: this.state.data,
});
......
......@@ -19,9 +19,8 @@ export class SearchFormControl extends FormControl {
* @memberof SearchFormControl
*/
public onSearch() {
const { controlName } = this.state;
this.emit("onCtrlEvent", {
tag: controlName,
this.emit("ctrlEvent", {
tag: this.props.name,
action: "selectionChange",
data: this.state.data,
});
......@@ -75,7 +74,6 @@ export class SearchFormControl extends FormControl {
public moduleInstall() {
const superParams = super.moduleInstall();
// 表单行为能力启用
const { loadDraft } = this.useLoadDraft();
return {
...superParams,
onSearch: this.onSearch.bind(this),
......
export * from './searchbar-control-prop'
export * from './searchbar-control-state'
export * from './searchbar-control'
\ No newline at end of file
import { IParam, MainControlProps } from "@core";
/**
* @description 搜索栏部件的props
* @export
* @interface SearchBarControlProps
* @extends {MainControlProps}
*/
export interface SearchBarControlProps extends MainControlProps {
}
\ No newline at end of file
import { IParam, MainControlState } from '@core';
/**
* @description 搜索栏部件状态
* @export
* @interface SearchBarControlState
* @extends {MainControlState}
*/
export interface SearchBarControlState extends MainControlState {
}
\ No newline at end of file
import { UIUtil, deepCopy, IActionParam, IParam, MainControl, SearchBarControlState, SearchBarControlProps } from '@core';
/**
* @description 搜索栏部件
* @export
* @class SearchBarControl
* @extends {MainControl}
*/
export class SearchBarControl extends MainControl {
/**
* @description 部件状态
* @type {SearchBarControlState}
* @memberof SearchBarControl
*/
public declare state: SearchBarControlState;
/**
* @description
* @param {SearchBarControlProps} props
* @memberof SearchBarControl
*/
public setState(props: SearchBarControlState) {
super.setState(props);
this.state.filterFields = Object.values(this.state.detailsModel);
this.state.filterItems = [];
}
/**
* @description 安装部件所有功能模块的方法
* @param {SearchBarControlProps} props
* @param {Function} [emit]
* @return {*}
* @memberof SearchBarControl [emit] 事件
*/
public moduleInstall(props: SearchBarControlProps, emit?: Function) {
const superParams = super.moduleInstall(props, emit);
return {
...superParams,
state: this.state,
};
}
}
\ No newline at end of file
import { toRef } from "vue";
import { deepCopy, deepObjectMerge, IActionParam, MainControl } from "@core";
import { TreeControlProps } from "./tree-control-prop";
import { TreeControlState } from "./tree-control-state";
......@@ -46,7 +45,7 @@ export class TreeControl extends MainControl {
currentselectedNode.value = e.node;
if (!multiple) {
selectedNodes.push(currentselectedNode.value);
this.emit("ctrlEvent", { tag: controlName, action: 'selectionchange', data: deepCopy(selectedNodes) });
this.emit("ctrlEvent", { tag: this.props.name, action: 'selectionchange', data: deepCopy(selectedNodes) });
}
}
}
......@@ -126,7 +125,7 @@ export class TreeControl extends MainControl {
const isSelectedAll = node.checked;
// TODO 默认选中
// this.setDefaultSelection(items, isRoot, isSelectedAll);
this.emit("ctrlEvent", { tag: controlName, action: "load", data: items });
this.emit("ctrlEvent", { tag: this.props.name, action: "load", data: items });
} catch (error) {
console.error(error);
}
......@@ -143,9 +142,7 @@ export class TreeControl extends MainControl {
subscription.unsubscribe();
})
}
return {
load
};
return load;
}
/**
......@@ -155,11 +152,10 @@ export class TreeControl extends MainControl {
*/
public moduleInstall() {
const superParams = super.moduleInstall();
const { load } = this.useLoad();
return {
...superParams,
treeNodeSelect: this.treeNodeSelect.bind(this),
load
load: this.useLoad(),
};
}
}
\ No newline at end of file
export * from './navdata-service';
export * from './navdata-param';
\ No newline at end of file
import { IParam } from '@core';
export interface INavDataParam {
/**
* @description 视图标题
* @type {*}
* @memberof INavDataParam
*/
title: string;
/**
* @description 视图数据
* @type {*}
* @memberof INavDataParam
*/
data: IParam;
/**
* @description 视图路径
* @type {string}
* @memberof INavDataParam
*/
path: string;
/**
* @description 视图打开模式("ROUTE" | "MODAL" | "EMBED")
* @type {("ROUTE" | "MODAL" | "EMBED")}
* @memberof INavDataParam
*/
openType: "ROUTE" | "MODAL" | "EMBED";
/**
* @description 视图类型
* @type {string}
* @memberof INavDataParam
*/
viewType: string;
/**
* @description 视图标识
* @type {string}
* @memberof INavDataParam
*/
tag: string;
/**
* @description 数据标识
* @type {*}
* @memberof INavDataParam
*/
key: string;
}
import { IActionParam, INavDataService } from '@core';
import { Subject } from 'rxjs';
import { INavDataParam } from './navdata-param';
/**
* 导航数据服务
*
* @export
* @class CodeListService
*/
export class NavDataService implements INavDataService {
/**
* 单例变量声明
*
* @private
* @static
* @type {NavDataService}
* @memberof NavDataService
*/
private static navDataService: NavDataService;
/**
* 服务状态
*
* @memberof NavDataService
*/
public serviceState: Subject<IActionParam> = new Subject();
/**
* 导航数据栈
*
* @memberof NavDataService
*/
public navDataStack: Array<INavDataParam> = [];
/**
* 初始化实例
*
* @memberof NavDataService
*/
constructor(opts: any = {}) { }
/**
* 获取 NavDataService 单例对象
*
* @static
* @returns {NavDataService}
* @memberof NavDataService
*/
public static getInstance(): NavDataService {
if (!NavDataService.navDataService) {
NavDataService.navDataService = new NavDataService();
}
return this.navDataService;
}
/**
* 添加基础导航数据到栈中
*
* @memberof NavDataService
*/
public addNavData(curNavData: INavDataParam) {
this.navDataStack.push(curNavData);
}
/**
* 设置指定数据到基础导航数据栈中
*
* @memberof NavDataService
*/
public setNavDataByTag(tag: string, isSingleMode: boolean, data: any) {
if (this.navDataStack.length > 0) {
let tempIndex: number = this.navDataStack.findIndex((element: INavDataParam) => {
return Object.is(element.tag, tag);
})
if(this.navDataStack[tempIndex]){
this.navDataStack[tempIndex].data = data;
if (isSingleMode && data.srfkey && data.srfmajortext) {
this.navDataStack[tempIndex].key = data.srfkey;
this.navDataStack[tempIndex].title = data.srfmajortext;
}
return this.navDataStack[tempIndex];
}else{
return null;
}
} else {
return null;
}
}
/**
* 获取基础导航数据
*
* @memberof NavDataService
*/
public getNavData() {
return this.navDataStack;
}
/**
* 从导航数据栈中获取指定数据的前一条数据
*
* @memberof NavDataService
*/
public getPreNavData(tag: string) {
if (this.navDataStack.length > 0) {
let tempIndex: number = this.navDataStack.findIndex((element: INavDataParam) => {
return Object.is(element.tag, tag);
})
return this.navDataStack[tempIndex - 1];
} else {
return null;
}
}
/**
* 跳转到导航数据栈中指定数据
*
* @memberof NavDataService
*/
public skipNavData(tag: string) {
if ((this.navDataStack.length > 0) && tag) {
let tempIndex: number = this.navDataStack.findIndex((element: INavDataParam) => {
return Object.is(element.tag, tag);
})
if (tempIndex !== -1) {
this.navDataStack = this.navDataStack.slice(0, tempIndex + 1);
}
}
}
/**
* 从导航数据栈中指定数据
*
* @memberof NavDataService
*/
public removeNavData(tag: string) {
if ((this.navDataStack.length > 0) && tag) {
let tempIndex: number = this.navDataStack.findIndex((element: INavDataParam) => {
return Object.is(element.tag, tag);
})
if (tempIndex !== -1) {
this.navDataStack = this.navDataStack.slice(0, tempIndex);
}
}
}
/**
* 从导航数据栈中删除仅剩第一条数据
*
* @memberof NavDataService
*/
public removeNavDataFirst() {
if (this.navDataStack.length > 0) {
this.navDataStack = this.navDataStack.slice(0, 1);
}
}
/**
* 从导航数据栈中删除最后一条数据
*
* @memberof NavDataService
*/
public removeNavDataLast() {
if (this.navDataStack.length > 0) {
this.navDataStack.pop();
}
}
/**
* 从导航数据栈中删除所有数据
*
* @memberof NavDataService
*/
public removeAllNavData() {
this.navDataStack = [];
}
}
\ No newline at end of file
export * from './control-service'
export * from './entity-service'
export * from './ui-service'
export * from './common-service'
\ No newline at end of file
......@@ -21,7 +21,10 @@ export class UIActionUtil {
Object.is(actionTarget, 'NONE') ||
Object.is(actionTarget, 'SINGLEDATA')
) {
const [arg] = args;
let arg:any = {};
if(args){
[arg] = args;
}
Object.keys(_params).forEach((name: string) => {
let hasProperty = true;
if (!name) {
......
......@@ -31,13 +31,15 @@ export class {{pascalCase appEntity.codeName}}UIServiceBase extends UIServiceBas
uIActionTag:'{{upperCase appDEUIAction.uIActionTag}}',
frontPSAppView:'{{appDEUIAction.frontPSAppView}}',
caption:'{{appDEUIAction.caption}}',
entityCodeName:'{{appDEUIAction.entityCodeName}}',
entityCodeName:'{{appEntity.codeName}}',
methodCodeName:'{{appDEUIAction.methodCodeName}}',
frontProcessType:'{{appDEUIAction.frontProcessType}}',
refreshMode:'{{appDEUIAction.refreshMode}}',
htmlPageUrl:'{{appDEUIAction.htmlPageUrl}}',
uILogicAttachMode:'{{appDEUIAction.uILogicAttachMode}}',
nextActionCodeName:'{{appDEUIAction.nextActionCodeName}}',
navContexts:{{appDEUIAction.navContexts}},
navParams:{{appDEUIAction.navParams}}
},
{{/each}}
};
......@@ -49,7 +51,7 @@ export class {{pascalCase appEntity.codeName}}UIServiceBase extends UIServiceBas
* @param {*} params
* @memberof {{pascalCase appEntity.codeName}}UIServiceBase
*/
public async {{appDEUIAction.codeName}}(params:any){
public async {{appDEUIAction.codeName}}(uiAction:any, params:any){
const actionModel = this.getUIActionModel('{{appDEUIAction.codeName}}');
{{#eq appDEUIAction.UIActionMode 'FRONT'}}
AppFrontAction.doAction(actionModel, params);
......
......@@ -196,14 +196,13 @@ const handleShowState = ($event: any) => {
:maskClosable="true"
:destroyOnClose="true"
:width="width"
:height="height"
:bodyStyle="style"
@cancel="onVisibleChange($event)"
>
<component
:is="viewName"
class="app-modal-view-component"
:width="width"
:height="height"
:context="context"
:viewParams="viewParams"
:viewDefaultUsage="false"
......
......@@ -39,7 +39,7 @@ const collapsedChange = () => {
</script>
<template>
<AppDefaultIndexViewLayout class="app-index-view" :menuAlign="state.menuAlign" :collapsed="collapsed">
<AppDefaultIndexViewLayout :class="['app-index-view', state.viewSysCss]" :menuAlign="state.menuAlign" :collapsed="collapsed">
<template #caption>
<div class="index-view-header">
\{{state.viewCaption}}
......
......@@ -13,6 +13,9 @@ import { {{codeName}}SearchForm } from '@widgets/{{spinalCase appEntity.codeName
{{#if (and (eq controlType "SEARCHFORM") (eq name 'quicksearchform'))}}
import { {{codeName}}QuickSearchForm } from '@widgets/{{spinalCase appEntity.codeName}}/{{spinalCase codeName}}-quick-search-form';
{{/if}}
{{#eq controlType "SEARCHBAR"}}
import { {{codeName}}SearchBar } from '@widgets/{{spinalCase appEntity.codeName}}/{{spinalCase codeName}}-searchBar';
{{/eq}}
{{/page.ctrls}}
// props声明和默认值处理
......@@ -41,7 +44,7 @@ const { state, grid, onCtrlEvent, onToolbarEvent, onQuickGroupEvent } = new Grid
</script>
<template>
<AppGridViewLayout class="app-grid-view">
<AppGridViewLayout :class="['app-grid-view', state.viewSysCss]">
<template v-slot:caption>
<AppIconText class="app-view__caption" size="large" :text="state.viewCaption" />
</template>
......@@ -72,7 +75,7 @@ const { state, grid, onCtrlEvent, onToolbarEvent, onQuickGroupEvent } = new Grid
:viewParams="state.viewParams"
:controlAction="state.{{camelCase name}}.action"
:viewSubject="state.viewSubject"
@onCtrlEvent="onCtrlEvent"
@ctrlEvent="onCtrlEvent"
></{{codeName}}SearchForm>
</template>
<a-button><filter-outlined /></a-button>
......@@ -86,7 +89,7 @@ const { state, grid, onCtrlEvent, onToolbarEvent, onQuickGroupEvent } = new Grid
:viewParams="state.viewParams"
:controlAction="state.{{camelCase name}}.action"
:viewSubject="state.viewSubject"
@onCtrlEvent="onCtrlEvent"
@ctrlEvent="onCtrlEvent"
></{{codeName}}SearchForm>
</template>
{{/if}}
......@@ -98,10 +101,17 @@ const { state, grid, onCtrlEvent, onToolbarEvent, onQuickGroupEvent } = new Grid
:viewParams="state.viewParams"
:controlAction="state.{{camelCase name}}.action"
:viewSubject="state.viewSubject"
@onCtrlEvent="onCtrlEvent"
@ctrlEvent="onCtrlEvent"
></{{codeName}}QuickSearchForm>
</template>
{{/if}}
{{#eq controlType "SEARCHBAR"}}
<template v-slot:searchBar>
<{{codeName}}SearchBar
:controlAction="state.{{camelCase name}}.action"
:viewSubject="state.viewSubject"/>
</template>
{{/eq}}
{{#eq controlType "GRID"}}
<{{codeName}}Grid
ref="grid"
......@@ -112,7 +122,7 @@ const { state, grid, onCtrlEvent, onToolbarEvent, onQuickGroupEvent } = new Grid
:viewParams="state.viewParams"
:controlAction="state.{{name}}.action"
:viewSubject="state.viewSubject"
@onCtrlEvent="onCtrlEvent"
@ctrlEvent="onCtrlEvent"
></{{codeName}}Grid>
{{/eq}}
{{/page.ctrls}}
......
......@@ -32,11 +32,11 @@ interface ViewEmit {
const emit = defineEmits<ViewEmit>();
// 安装功能模块,提供状态和能力方法
const { state, confirm, handleCtrlEvent } = new PickupGridView(viewState, props, emit).moduleInstall();
const { state, confirm, onCtrlEvent } = new PickupGridView(viewState, props, emit).moduleInstall();
</script>
<template>
<AppPickerUpGridViewLayout class="app-pickup-grid-view">
<AppPickerUpGridViewLayout :class="['app-pickup-grid-view', state.viewSysCss]">
<template v-slot:header-left>
<AppIconText class="app-view__caption" size="large" :text="state.viewCaption" />
</template>
......@@ -62,7 +62,7 @@ const { state, confirm, handleCtrlEvent } = new PickupGridView(viewState, props,
:viewParams="state.viewParams"
:controlAction="state.controlsAction.grid"
:viewSubject="state.viewSubject"
@ctrlEvent="handleCtrlEvent"
@ctrlEvent="onCtrlEvent"
></MainGrid>
</AppPickerUpGridViewLayout>
</template>
......@@ -28,11 +28,11 @@ interface ViewEmit {
const emit = defineEmits<ViewEmit>();
// 安装功能模块,提供状态和能力方法
const { state, cancel, confirm,handleCtrlEvent } = new PickupView(viewState, props, emit).moduleInstall();
const { state, cancel, confirm,onCtrlEvent } = new PickupView(viewState, props, emit).moduleInstall();
</script>
<template>
<AppPickerUpViewLayout class="app-pickup-view">
<AppPickerUpViewLayout :class="['app-pickup-view', state.viewSysCss]">
<template v-slot:header-left>
<AppIconText class="app-view__caption" size="large" :text="state.viewCaption" />
</template>
......@@ -56,7 +56,7 @@ const { state, cancel, confirm,handleCtrlEvent } = new PickupView(viewState, pro
:viewParams="state.viewParams"
:controlAction="state.controlsAction.{{name}}"
:viewSubject="state.viewSubject"
@ctrlEvent="handleCtrlEvent"
@ctrlEvent="onCtrlEvent"
></{{codeName}}PickUpViewPanel>
{{/eq}}
{{/page.ctrls}}
......
......@@ -25,11 +25,11 @@ interface ViewEmit {
const emit = defineEmits<ViewEmit>();
// 安装功能模块
const { state, handleCtrlEvent, onToolbarEvent } = new TreeExpView(viewState, props, emit).moduleInstall();
const { state, onCtrlEvent, onToolbarEvent } = new TreeExpView(viewState, props, emit).moduleInstall();
</script>
<template>
<AppTreeExpViewLayout class="app-tree-exp-view">
<AppTreeExpViewLayout :class="['app-tree-exp-view', state.viewSysCss]">
<template v-slot:caption>
<AppIconText class="app-view__caption" size="large" :text="state.viewCaption" />
</template>
......@@ -49,7 +49,7 @@ const { state, handleCtrlEvent, onToolbarEvent } = new TreeExpView(viewState, pr
:showBusyIndicator="true"
:viewParams="state.viewParams"
:viewSubject="state.viewSubject"
@ctrlEvent="handleCtrlEvent"
@ctrlEvent="onCtrlEvent"
></{{codeName}}TreeExpBar>
{{/eq}}
{{/page.ctrls}}
......
......@@ -18,7 +18,7 @@ const props = withDefaults(defineProps < Props > (), {
interface CtrlEmit {
(name: "ctrlEvent", value: IActionParam): void;
}
const emit = defineEmits < CtrlEmit > ();
const emit = defineEmits <CtrlEmit> ();
const { state, menuSelect } = new MenuControl(ctrlState, props, emit).moduleInstall();
......@@ -27,7 +27,7 @@ defineExpose({ state, name: '{{ctrl.name}}' });
</script>
<template>
<a-menu class="app-menu" v-model:openKeys="state.defaultOpens" v-model:selectedKeys="state.defaultSelect"
<a-menu class="app-menu{{#if ctrl.psSysCss}} {{ctrl.psSysCss.cssName}}{{/if}}" v-model:openKeys="state.defaultOpens" v-model:selectedKeys="state.defaultSelect"
:mode="Object.is('LEFT', state.menuAlign) ? 'inline' : 'horizontal'" @select="menuSelect">
<AppMenuItem :items="state.menus" :collapsed="collapsed" />
</a-menu>
......
......@@ -3,7 +3,21 @@
import { Subject } from 'rxjs';
import { ctrlState } from './{{spinalCase ctrl.codeName}}-form-state';
import { FormControl, IActionParam, IParam, ControlAction, IContext } from '@core';
{{#*inline "importFormDruipart"}}
{{#each items as | formDetail | }}
{{#eq formDetail.detailType 'DRUIPART'}}
import {{formDetail.psAppView.codeName}} from '@views/{{spinalCase formDetail.psAppView.psAppModule.codeName}}/{{spinalCase formDetail.psAppView.codeName}}';
{{/eq}}
{{#if formDetail.psDEFormDetails}}
{{>(lookup 'importFormDruipart') items=formDetail.psDEFormDetails}}
{{/if}}
{{/each }}
{{/inline}}
{{#each ctrl.psDEFormPages as | items | }}
{{#if items.psDEFormDetails}}
{{>(lookup 'importFormDruipart') items=items.psDEFormDetails}}
{{/if}}
{{/each}}
interface Props {
context: IContext;
viewParams?: IParam;
......@@ -19,10 +33,10 @@ const props = withDefaults(defineProps < Props > (), {
// emit声明
interface CtrlEmit {
(name: "onCtrlEvent", value: IActionParam): void;
(name: "ctrlEvent", value: IActionParam): void;
}
const emit = defineEmits < CtrlEmit > ();
const emit = defineEmits <CtrlEmit> ();
// 安装功能模块,提供状态和能力方法
const { state, onEditorEvent, onComponentEvent } = new FormControl(ctrlState, props, emit).moduleInstall();
......
......@@ -27,7 +27,12 @@ const props = withDefaults(defineProps < Props > (), {
})
// emit声明
const emit = defineEmits<{(event: 'onCtrlevent', value: IActionParam): void;}>();
interface CtrlEmit {
(name: "ctrlEvent", value: IActionParam): void;
}
// emit声明
const emit = defineEmits<CtrlEmit>();
// 安装功能模块,提供状态和能力
const { state, useCustom, onEditorEvent, onToolbarEvent } = new GridControl(ctrlState, props, emit).moduleInstall();
......@@ -40,7 +45,7 @@ defineExpose({ state, name: '{{ctrl.name}}' });
<a-table
bordered
sticky
class="app-grid"
class="app-grid{{#if ctrl.psSysCss}} {{ctrl.psSysCss.cssName}}{{/if}}"
:rowKey="rowKey"
:showHeader="true"
:scroll="scrollOption"
......
......@@ -28,7 +28,7 @@ interface CtrlEmit {
(name: "ctrlEvent", value: IActionParam): void;
}
const emit = defineEmits < CtrlEmit > ();
const emit = defineEmits <CtrlEmit> ();
// 安装功能模块,提供状态和能力方法
const { state, inited, viewdata, viewparam } = new PickupViewPanelControl(ctrlState, props, emit).moduleInstall();
......@@ -38,7 +38,7 @@ defineExpose({ state, name: '{{ctrl.name}}' });
</script>
<template>
<div class="app-pickupviewpanel">
<div class="app-pickupviewpanel{{#if ctrl.psSysCss}} {{ctrl.psSysCss.cssName}}{{/if}}">
<component v-if="inited && state.embeddedView && state.embeddedView.viewName" :if="state.embeddedView.viewName"
:viewdata="viewdata" :viewparam="viewparam" :isSingleSelect="state.isSingleSelect"
:isShowButton="state.isShowButton" :selectedData="state.selectedData"></component>
......
......@@ -20,7 +20,7 @@ const props = withDefaults(defineProps<Props>(), {
// emit声明
interface CtrlEmit {
(name: "onCtrlEvent", value: IActionParam): void;
(name: "ctrlEvent", value: IActionParam): void;
}
const emit = defineEmits<CtrlEmit>();
......
import {{ctrl.codeName}}SearchBar from "./{{spinalCase ctrl.codeName}}-searchBar.vue";
export { {{ctrl.codeName}}SearchBar };
\ No newline at end of file
export const CtrlConfig = {
controlCodeName: "{{ctrl.codeName}}",
controlName: "{{ctrl.name}}",
detailsModel: {
{{#each ctrl.psSearchBarFilters as | filter | }}
{{filter.name}} : {
label: '{{filter.psAppDEField.logicName}}',
name: '{{filter.name}}',
prop: '{{lowerCase filter.psAppDEField.codeName}}',
disabled: false,
{{#if filter.psDEFSearchMode}}mode: '{{filter.psDEFSearchMode.valueOP}}',{{/if}}
},
{{/each}}
},
}
\ No newline at end of file
<script setup lang="ts">
import { Subject } from 'rxjs';
import { CtrlConfig } from './{{spinalCase ctrl.codeName}}-searchBar-config';
import { SearchBarControl, IActionParam, IParam, IContext, ControlAction, deepCopy } from '@core';
interface Props {
controlAction: ControlAction;
viewSubject: Subject<IActionParam>;
}
const props = withDefaults(defineProps<Props>(), {
})
// emit声明
interface CtrlEmit {
(name: "ctrlEvent", value: IActionParam): void;
}
const emit = defineEmits<CtrlEmit>();
// 安装功能模块,提供状态和能力方法
const { state } = new SearchBarControl(CtrlConfig).moduleInstall(props, emit);
// 暴露内部状态及能力
defineExpose({ state, name: '{{ctrl.name}}' });
</script>
<template>
<div class="search-bar{{#if ctrl.psSysCss}} {{ctrl.psSysCss.cssName}}{{/if}}">
<app-filter-tree :datas="state.filterItems" :fields="state.filterFields"/>
</div>
</template>
<style lang="scss">
</style>
\ No newline at end of file
......@@ -20,7 +20,7 @@ const props = withDefaults(defineProps<Props>(), {
// emit声明
interface CtrlEmit {
(name: "onCtrlEvent", value: IActionParam): void;
(name: "ctrlEvent", value: IActionParam): void;
}
const emit = defineEmits<CtrlEmit>();
......
......@@ -32,10 +32,10 @@ interface CtrlEmit {
(name: "ctrlEvent", value: IActionParam): void;
}
const emit = defineEmits < CtrlEmit > ();
const emit = defineEmits <CtrlEmit> ();
// 安装功能模块,提供状态和能力方法
const { state, handleCtrlEvent } = new TreeExpBarControl(ctrlState, props, emit).moduleInstall();
const { state, onCtrlEvent } = new TreeExpBarControl(ctrlState, props, emit).moduleInstall();
// 暴露内部状态及能力
defineExpose({ state, name: '{{ctrl.name}}' });
......@@ -53,7 +53,7 @@ defineExpose({ state, name: '{{ctrl.name}}' });
:viewParams="state.viewParams"
:viewSubject="state.viewSubject"
:isBranchAvailable="true"
@ctrlEvent="handleCtrlEvent"
@ctrlEvent="onCtrlEvent"
></{{codeName}}Tree>
{{/eq}}
{{/ctrl.ctrls}}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册