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

update:更新

上级 37276ff2
......@@ -14,7 +14,7 @@
<i-button v-if="index == 0" type="primary" @click="handleAdd">
{{ $t('app.local.add') + $t('<#if ctrl.getEmbeddedPSAppView().getPSAppDataEntity()??>entities.${ctrl.getEmbeddedPSAppView().getPSAppDataEntity().getCodeName()?lower_case}.views.${ctrl.getEmbeddedPSAppView().getPSDEViewCodeName()?lower_case}.caption<#else>app.views.${ctrl.getEmbeddedPSAppView().getCodeName()?lower_case}.caption</#if>') }}
</i-button>
<icon v-if="item.srfuf == 1" class="remove-icon" type="md-remove-circle" @click="handleRemove(item)" />
<icon v-if="!(index == 0 && item.srfuf == 0)" class="remove-icon" type="md-remove-circle" @click="handleRemove(item)" />
</div>
</template>
<${srffilepath2(ctrl.getEmbeddedPSAppView().getCodeName())}
......@@ -431,36 +431,39 @@
*/
public handleRemove(item:any){
if (item.data.srfuf == "0") {
//删除items中已删除的项
let index = this.items.findIndex((value: any, index: any, arr: any) => {
return value === item;
});
this.items.splice(index, 1);
} else {
// 原有的走接口删除
let tempContext: any = JSON.parse(JSON.stringify(this.context));
Object.assign(tempContext, { '${ctrl.getPSAppDataEntity().getCodeName()?lower_case}': item.data.${ctrl.getPSAppDataEntity().getCodeName()?lower_case} });
let arg: any = JSON.parse(JSON.stringify(this.viewparams));
Object.assign(arg, { '${ctrl.getPSAppDataEntity().getKeyPSAppDEField().getCodeName()?lower_case}': item.data.${ctrl.getPSAppDataEntity().getCodeName()?lower_case} });
const promice: Promise<any> = this.service.delete(this.removeAction, tempContext, arg, this.showBusyIndicator);
promice.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return;
}
//删除items中已删除的项
let index = this.items.findIndex((value: any, index: any, arr: any) => {
return value.data.${ctrl.getPSAppDataEntity().getCodeName()?lower_case} === item.data.${ctrl.getPSAppDataEntity().getCodeName()?lower_case};
});
this.items.splice(index, 1);
}).catch((response: any) => {
//删除items中已删除的项
let index = this.items.findIndex((value: any, index: any, arr: any) => {
return value === item;
});
this.items.splice(index, 1);
} else {
// 原有的走接口删除
let tempContext: any = JSON.parse(JSON.stringify(this.context));
Object.assign(tempContext, { '${ctrl.getPSAppDataEntity().getCodeName()?lower_case}': item.data.${ctrl.getPSAppDataEntity().getCodeName()?lower_case} });
let arg: any = JSON.parse(JSON.stringify(this.viewparams));
Object.assign(arg, { '${ctrl.getPSAppDataEntity().getKeyPSAppDEField().getCodeName()?lower_case}': item.data.${ctrl.getPSAppDataEntity().getCodeName()?lower_case} });
const promice: Promise<any> = this.service.delete(this.removeAction, tempContext, arg, this.showBusyIndicator);
promice.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return;
}
//删除items中已删除的项
let index = this.items.findIndex((value: any, index: any, arr: any) => {
return value.data.${ctrl.getPSAppDataEntity().getCodeName()?lower_case} === item.data.${ctrl.getPSAppDataEntity().getCodeName()?lower_case};
});
}
this.items.splice(index, 1);
}).catch((response: any) => {
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
});
}
if (this.items.length == 0) {
this.handleAdd();
}
}
/**
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册