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

update:更新

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