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

update:更新

上级 1691b89b
......@@ -116,11 +116,14 @@ this.$verify.testCond(_${item.getDstModelField()?lower_case}, "${item.getCondOp(
* 处理按钮点击
*
* @public
* @params name 按钮项名称
* @params index 多数据容器下标
* @memberof ${srfclassname('${item.name}')}Base
*/
public handleButtonClick(name: string, $event?: any) {
public handleButtonClick(name: string, index?: number) {
let datas: any[] = [];
const data: any = this.layoutModelDetails[name].getData();
<#noparse>let fullName = (index || index === 0) ? `${name}_${index}` : name;</#noparse>
const data: any = this.layoutModelDetails[fullName].getData();
if (data) {
if (data instanceof Array) {
datas = [...data];
......@@ -128,7 +131,7 @@ this.$verify.testCond(_${item.getDstModelField()?lower_case}, "${item.getCondOp(
datas = [data];
}
}
const xData: any = this.layoutModelDetails[name].getDataArea();
const xData: any = this.layoutModelDetails[fullName].getDataArea();
const paramJO: any = {};
const contextJO: any = {};
const _this: any = this;
......@@ -139,11 +142,11 @@ this.$verify.testCond(_${item.getDstModelField()?lower_case}, "${item.getCondOp(
<#assign curAppEntity = panelItem.getPSUIAction().getPSAppDataEntity() />
window.uiServiceRegister.getService('${curAppEntity.getCodeName()?lower_case}').then((UIService: any) => {
if (UIService && UIService[`${panelItem.getPSUIAction().getFullCodeName()}`] && UIService[`${panelItem.getPSUIAction().getFullCodeName()}`] instanceof Function) {
UIService[`${panelItem.getPSUIAction().getFullCodeName()}`](datas, contextJO, paramJO, $event, xData, this, undefined);
UIService[`${panelItem.getPSUIAction().getFullCodeName()}`](datas, contextJO, paramJO, undefined, xData, this, undefined);
}
})
<#else>
_this.${panelItem.getPSUIAction().getFullCodeName()}(datas, contextJO, paramJO, $event, xData, this, undefined);
_this.${panelItem.getPSUIAction().getFullCodeName()}(datas, contextJO, paramJO, undefined, xData, this, undefined);
</#if>
}
</#if>
......
......@@ -363,33 +363,33 @@
name="${panelDetail.getName()}"
<#if isMultiData == true >:index="slotProps.data.index"</#if>
:layoutModelDetails="layoutModelDetails"
@itemClick="handleButtonClick" /></@compress>
@itemClick="handleButtonClick('${panelDetail.name}'<#if isMultiData == true >, `<#noparse>${slotProps.data.index}</#noparse>`</#if>)"/></@compress>
<#elseif panelDetail.getPSUIAction?? && panelDetail.getPSUIAction()?? && panelDetail.getPSUIAction().getPredefinedType?? && panelDetail.getPSUIAction().getPredefinedType()?? && panelDetail.getPSUIAction().getPredefinedType() == "DATA_CANCELCHANGES">
<@compress single_line=true><app-login-button
class="app-reset-button"
name="${panelDetail.getName()}"
<#if isMultiData == true >:index="slotProps.data.index"</#if>
:layoutModelDetails="layoutModelDetails"
@itemClick="handleButtonClick" /></@compress>
@itemClick="handleButtonClick('${panelDetail.name}'<#if isMultiData == true >, `<#noparse>${slotProps.data.index}</#noparse>`</#if>)"/></@compress>
<#elseif panelDetail.getPSUIAction?? && panelDetail.getPSUIAction()?? && panelDetail.getPSUIAction().getPredefinedType?? && panelDetail.getPSUIAction().getPredefinedType()?? && panelDetail.getPSUIAction().getPredefinedType() == "APP_LOGOUT">
<@compress single_line=true><app-login-button
class="app-logout-button"
name="${panelDetail.getName()}"
<#if isMultiData == true >:index="slotProps.data.index"</#if>
:layoutModelDetails="layoutModelDetails"
@itemClick="handleButtonClick" /></@compress>
@itemClick="handleButtonClick('${panelDetail.name}'<#if isMultiData == true >, `<#noparse>${slotProps.data.index}</#noparse>`</#if>)"/></@compress>
<#elseif panelDetail.getPSUIAction?? && panelDetail.getPSUIAction()??>
<@compress single_line=true><app-preset-button
name="${panelDetail.getName()}"
<#if isMultiData == true > :index="slotProps.data.index"</#if>
:layoutModelDetails="layoutModelDetails"
@itemClick="handleButtonClick" /></@compress>
@itemClick="handleButtonClick('${panelDetail.name}'<#if isMultiData == true >, `<#noparse>${slotProps.data.index}</#noparse>`</#if>)"/></@compress>
<#else>
<@compress single_line=true><app-preset-button
name="${panelDetail.getName()}"
<#if isMultiData == true > :index="slotProps.data.index"</#if>
:layoutModelDetails="layoutModelDetails"
@itemClick="handleButtonClick"/></@compress>
@itemClick="handleButtonClick('${panelDetail.name}'<#if isMultiData == true >, `<#noparse>${slotProps.data.index}</#noparse>`</#if>)"/></@compress>
</#if>
<#elseif panelDetail.getItemType()?? && panelDetail.getItemType() == "CTRLPOS">
<app-ctrl-pos name="${panelDetail.getName()}"<#if isMultiData == true > :index="slotProps.data.index"</#if> :layoutModelDetails="layoutModelDetails">
......
......@@ -24,15 +24,13 @@
if (data.hasOwnProperty(service.APPDEKEY.toLowerCase())) {
delete data[service.APPDEKEY.toLowerCase()];
}
try {
service.Create(tempContext, data).then((response: any) => {
if (!response.status || response.status !== 200) {
actionContext.$Notice.error({ title: '错误', desc: '当前环境无法执行建立数据逻辑[执行行为异常]' });
}
})
} catch (error: any) {
}).catch((error: any) => {
actionContext.$Notice.error({ title: '错误', desc: '当前环境无法执行建立数据逻辑[执行行为异常]' });
}
})
}
<#else>
actionContext.$Notice.error({ title: '错误', desc: '建立数据行未配置实体' });
......
......@@ -29,7 +29,6 @@
if (data.hasOwnProperty(key)) {
Object.assign(tempContext, { [name]: data[key] });
}
try {
service.Remove(tempContext, data).then((response: any) => {
if (!response.status || response.status !== 200) {
actionContext.$Notice.error({ title: '错误', desc: '当前环境无法执行删除数据逻辑[执行行为异常]' });
......@@ -40,10 +39,9 @@
} else if (actionContext.closeView && (actionContext.closeView instanceof Function)) {
actionContext.closeView(args);
}
})
} catch (error: any) {
}).catch((error: any) => {
actionContext.$Notice.error({ title: '错误', desc: '当前环境无法执行删除数据逻辑[执行行为异常]' });
}
})
}
<#else>
actionContext.$Notice.error({ title: '错误', desc: '删除数据行未配置实体' });
......
......@@ -34,19 +34,17 @@
} else {
action = 'Create';
}
try {
if (service[action] && service[action] instanceof Function) {
service[action](tempContext, data).then((response: any) => {
if (!response.status || response.status !== 200) {
actionContext.$Notice.error({ title: '错误', desc: '当前环境无法执行保存变更逻辑[执行行为异常]' });
}
}).catch((error: any) => {
actionContext.$Notice.error({ title: '错误', desc: '当前环境无法执行保存变更逻辑[执行行为异常]' });
})
} else {
actionContext.$Notice.error({ title: '错误', desc: '当前环境无法执行保存变更逻辑[执行行为异常]' });
}
} catch (error: any) {
actionContext.$Notice.error({ title: '错误', desc: '当前环境无法执行保存变更逻辑[执行行为异常]' });
}
}
<#else>
actionContext.$Notice.error({ title: '错误', desc: '保存变更行为未配置实体' });
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册