提交 bb53d3c4 编写于 作者: Shine-zwj's avatar Shine-zwj

update:更新

上级 7396389c
......@@ -579,7 +579,7 @@ import UIService from '@/uiservice/ui-service';
* @public
* @memberof ${srfclassname('${ctrl.name}')}Base
*/
public handleButtonClick(name: string, $event?: any) {
public async handleButtonClick(name: string, $event?: any) {
const datas: any[] = [this.layoutData];
const xData: any = this.getButtonXData(name);
const paramJO: any = {};
......@@ -590,8 +590,10 @@ import UIService from '@/uiservice/ui-service';
if (Object.is(name, '${panelItem.name}')) {
<#if panelItem.getPSUIAction().getPSAppDataEntity?? && panelItem.getPSUIAction().getPSAppDataEntity()?? && panelItem.getPSUIAction().getUIActionMode()?? && (panelItem.getPSUIAction().getUIActionMode() == "FRONT" || panelItem.getPSUIAction().getUIActionMode() == "BACKEND" || panelItem.getPSUIAction().getUIActionMode() == "WFFRONT" || panelItem.getPSUIAction().getUIActionMode() == "WFBACKEND")>
<#assign curAppEntity = panelItem.getPSUIAction().getPSAppDataEntity() />
const curUIService: ${srfclassname('${curAppEntity.codeName}')}UIService = new ${srfclassname('${curAppEntity.codeName}')}UIService();
curUIService.${panelItem.getPSUIAction().getFullCodeName()}(datas, contextJO, paramJO, $event, xData, this, undefined);
const UIService = await window.uiServiceRegister.getService()('${curAppEntity.codeName}');
if (UIService && UIService[`${panelItem.getPSUIAction().getFullCodeName()}`] && UIService[`${panelItem.getPSUIAction().getFullCodeName()}`] instanceof Function) {
UIService[`${panelItem.getPSUIAction().getFullCodeName()}`](datas, contextJO, paramJO, $event, xData, this, undefined);
}
<#else>
_this.${panelItem.getPSUIAction().getFullCodeName()}(datas, contextJO, paramJO, $event, xData, this, undefined);
</#if>
......
......@@ -48,13 +48,6 @@ import ${srfclassname('${appde.getCodeName()}')}UIService from '@/uiservice/${sr
</#if>
<#if view.getPSViewLayoutPanel()?? && !view.getPSViewLayoutPanel().isUseDefaultLayout()>
import { PanelContainerModel, PanelRawitemModel, PanelFieldModel, PanelControlModel, PanelButtonModel, PanelUserControlModel, PanelTabPanelModel, PanelTabPageModel, PanelCtrlPosModel} from '@/model/panel-detail';
<#if view.getPSViewLayoutPanel().getAllPSPanelItems()??>
<#list view.getPSViewLayoutPanel().getAllPSPanelItems() as panelItem>
<#if panelItem.getItemType() == 'BUTTON' && panelItem.getPSUIAction?? && panelItem.getPSUIAction()?? && panelItem.getPSUIAction().getPSAppDataEntity?? && panelItem.getPSUIAction().getPSAppDataEntity()?? && panelItem.getPSUIAction().getUIActionMode()?? && (panelItem.getPSUIAction().getUIActionMode() == "FRONT" || panelItem.getPSUIAction().getUIActionMode() == "BACKEND" || panelItem.getPSUIAction().getUIActionMode() == "WFFRONT" || panelItem.getPSUIAction().getUIActionMode() == "WFBACKEND")>
import ${srfclassname('${panelItem.getPSUIAction().getPSAppDataEntity().getCodeName()}')}UIService from '@/uiservice/${srffilepath2(panelItem.getPSUIAction().getPSAppDataEntity().getCodeName())}/${srffilepath2(panelItem.getPSUIAction().getPSAppDataEntity().getCodeName())}-ui-service';
</#if>
</#list>
</#if>
</#if>
<#if import_block??>
......@@ -696,7 +689,7 @@ ${P.getCtrlCode('toolbar', 'CONTROL.vue').code}
* @public
* @memberof ${srfclassname('${view.name}')}Base
*/
public handleButtonClick(name: string, $event?: any) {
public async handleButtonClick(name: string, $event?: any) {
const datas: any[] = [this.layoutData];
const xData: any = this.getButtonXData(name);
const paramJO: any = {};
......@@ -707,8 +700,10 @@ ${P.getCtrlCode('toolbar', 'CONTROL.vue').code}
if (Object.is(name, '${panelItem.name}')) {
<#if panelItem.getPSUIAction().getPSAppDataEntity?? && panelItem.getPSUIAction().getPSAppDataEntity()?? && panelItem.getPSUIAction().getUIActionMode()?? && (panelItem.getPSUIAction().getUIActionMode() == "FRONT" || panelItem.getPSUIAction().getUIActionMode() == "BACKEND" || panelItem.getPSUIAction().getUIActionMode() == "WFFRONT" || panelItem.getPSUIAction().getUIActionMode() == "WFBACKEND")>
<#assign curAppEntity = panelItem.getPSUIAction().getPSAppDataEntity() />
const curUIService: ${srfclassname('${curAppEntity.codeName}')}UIService = new ${srfclassname('${curAppEntity.codeName}')}UIService();
curUIService.${panelItem.getPSUIAction().getFullCodeName()}(datas, contextJO, paramJO, $event, xData, this, undefined);
const UIService = await window.uiServiceRegister.getService()('${curAppEntity.codeName}');
if (UIService && UIService[`${panelItem.getPSUIAction().getFullCodeName()}`] && UIService[`${panelItem.getPSUIAction().getFullCodeName()}`] instanceof Function) {
UIService[`${panelItem.getPSUIAction().getFullCodeName()}`](datas, contextJO, paramJO, $event, xData, this, undefined);
}
<#else>
_this.${panelItem.getPSUIAction().getFullCodeName()}(datas, contextJO, paramJO, $event, xData, this, undefined);
</#if>
......
......@@ -11,7 +11,7 @@
* @param {*} [actionContext] 执行行为上下文
* @param {*} [srfParentDeName] 父实体名称
*/
public ${item.getFullCodeName()}(args: any[], context: any = {}, params: any = {}, $event?: any, xData?: any, actionContext?: any, srfParentDeName?: string) {
public async ${item.getFullCodeName()}(args: any[], context: any = {}, params: any = {}, $event?: any, xData?: any, actionContext?: any, srfParentDeName?: string) {
<#if item.getPSAppDataEntity?? && item.getPSAppDataEntity()??>
// 准备上下文参数
const tempContext = {...context};
......@@ -19,12 +19,13 @@
Object.assign(tempContext, xData.context);
}
const data = args[0];
const appEntityService: ${srfclassname('${item.getPSAppDataEntity().getCodeName()}')}Service = new ${srfclassname('${item.getPSAppDataEntity().getCodeName()}')}Service();
if (data.hasOwnProperty(appEntityService.APPDEKEY.toLowerCase())) {
delete data[appEntityService.APPDEKEY.toLowerCase()];
const service = await window.entityServiceRegister.getService('${item.getPSAppDataEntity().getCodeName()}');
if (service) {
if (data.hasOwnProperty(service.APPDEKEY.toLowerCase())) {
delete data[service.APPDEKEY.toLowerCase()];
}
try {
appEntityService.Create(tempContext, data).then((response: any) => {
service.Create(tempContext, data).then((response: any) => {
if (!response.status || response.status !== 200) {
this.$Notice.error({ title: '错误', desc: '当前环境无法执行建立数据逻辑[执行行为异常]' });
}
......@@ -32,6 +33,7 @@
} catch (error: any) {
this.$Notice.error({ title: '错误', desc: '当前环境无法执行建立数据逻辑[执行行为异常]' });
}
}
<#else>
this.$Notice.error({ title: '错误', desc: '建立数据行未配置实体' });
</#if>
......
......@@ -11,7 +11,7 @@
* @param {*} [actionContext] 执行行为上下文
* @param {*} [srfParentDeName] 父实体名称
*/
public ${item.getFullCodeName()}(args: any[], context: any = {}, params: any = {}, $event?: any, xData?: any, actionContext?: any, srfParentDeName?: string) {
public async ${item.getFullCodeName()}(args: any[], context: any = {}, params: any = {}, $event?: any, xData?: any, actionContext?: any, srfParentDeName?: string) {
<#if item.getPSAppDataEntity?? && item.getPSAppDataEntity()??>
// 准备上下文参数
const tempContext = {...context};
......@@ -19,9 +19,10 @@
Object.assign(tempContext, xData.context);
}
const data = args[0];
const appEntityService: ${srfclassname('${item.getPSAppDataEntity().getCodeName()}')}Service = new ${srfclassname('${item.getPSAppDataEntity().getCodeName()}')}Service();
const key = appEntityService.APPDEKEY.toLowerCase();
const name = appEntityService.APPDENAME.toLowerCase();
const service = await window.entityServiceRegister.getService('${item.getPSAppDataEntity().getCodeName()}');
if (service) {
const key = service.APPDEKEY.toLowerCase();
const name = service.APPDENAME.toLowerCase();
if (data.hasOwnProperty(name)) {
Object.assign(tempContext, { [name]: data[name] });
}
......@@ -29,7 +30,7 @@
Object.assign(tempContext, { [name]: data[key] });
}
try {
appEntityService.Remove(tempContext, data).then((response: any) => {
service.Remove(tempContext, data).then((response: any) => {
if (!response.status || response.status !== 200) {
this.$Notice.error({ title: '错误', desc: '当前环境无法执行删除数据逻辑[执行行为异常]' });
}
......@@ -37,6 +38,7 @@
} catch (error: any) {
this.$Notice.error({ title: '错误', desc: '当前环境无法执行删除数据逻辑[执行行为异常]' });
}
}
<#else>
this.$Notice.error({ title: '错误', desc: '删除数据行未配置实体' });
</#if>
......
......@@ -11,7 +11,7 @@
* @param {*} [actionContext] 执行行为上下文
* @param {*} [srfParentDeName] 父实体名称
*/
public ${item.getFullCodeName()}(args: any[], context: any = {}, params: any = {}, $event?: any, xData?: any, actionContext?: any, srfParentDeName?: string) {
public async ${item.getFullCodeName()}(args: any[], context: any = {}, params: any = {}, $event?: any, xData?: any, actionContext?: any, srfParentDeName?: string) {
<#if item.getPSAppDataEntity?? && item.getPSAppDataEntity()??>
// 准备上下文参数
const tempContext = {...context};
......@@ -20,9 +20,10 @@
}
const data = args[0];
let action: string | undefined = undefined;
const appEntityService: any = new ${srfclassname('${item.getPSAppDataEntity().getCodeName()}')}Service();
const key = appEntityService.APPDEKEY.toLowerCase();
const name = appEntityService.APPDENAME.toLowerCase();
const service = await window.entityServiceRegister.getService('${item.getPSAppDataEntity().getCodeName()}');
if (service) {
const key = service.APPDEKEY.toLowerCase();
const name = service.APPDENAME.toLowerCase();
if (data.hasOwnProperty(key) || data.hasOwnProperty(name)) {
if (data.hasOwnProperty(key)) {
Object.assign(context, { [name]: data[key] });
......@@ -34,8 +35,8 @@
action = 'Create';
}
try {
if (action) {
appEntityService[action](tempContext, data).then((response: any) => {
if (service[action] && service[action] instanceof Function) {
service[action](tempContext, data).then((response: any) => {
if (!response.status || response.status !== 200) {
this.$Notice.error({ title: '错误', desc: '当前环境无法执行保存变更逻辑[执行行为异常]' });
}
......@@ -46,6 +47,7 @@
} catch (error: any) {
this.$Notice.error({ title: '错误', desc: '当前环境无法执行保存变更逻辑[执行行为异常]' });
}
}
<#else>
this.$Notice.error({ title: '错误', desc: '保存变更行为未配置实体' });
</#if>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册