提交 054a22c1 编写于 作者: KK's avatar KK

删除事件

上级 60713690
......@@ -10,7 +10,7 @@
</#list>
<template v-for="item in customizeModel">
<ion-card class="dashboard-item ios hydrated" :class="item.componentName + 'dashboard'" :key="item.id" v-if="isEnableCustomized">
<component :is="item.componentName" :item="item" :isCustomize="true" :customizeTitle="item.customizeTitle" :viewState="viewState" :name="item.portletCodeName" :context="context" :isChildView="true" :viewparams="viewparams" @customizeRename="customizeRename"></component>
<component :is="item.componentName" :item="item" :isCustomize="true" :customizeTitle="item.customizeTitle" :viewState="viewState" :name="item.portletCodeName" :context="context" :isChildView="true" :viewparams="viewparams" @enableCustomizedEvent="enableCustomizedEvent"></component>
</ion-card>
</template>
</ion-grid>
......
......@@ -202,22 +202,31 @@ import UtilService from '@/utilservice/util-service';
}
/**
* 重命名
* 定制事件
*
* @type {string}
* @memberof AppRichTextEditor
*/
public customizeRename(customizeModelItem:any,title:string) {
public async enableCustomizedEvent(tag:string,customizeModelItem:any,title:string) {
let index = this.customizeModel.findIndex((item:any)=>{
return item.id === customizeModelItem.id;
return item.id === customizeModelItem.id;
})
this.customizeModel.splice(index,1,(customizeModelItem as never));
this.saveModel(this.utilServiceName,{},
let meassage :string= '';
if(tag === 'rename'){
this.customizeModel.splice(index,1,(customizeModelItem as never));
meassage = '重命名';
}
if(tag === 'delete'){
this.customizeModel.splice(index,1);
meassage = '删除';
}
let falg = await this.saveModel(this.utilServiceName,{},
{
utilServiceName: this.utilServiceName,
modelid: this.modelId,
model: this.customizeModel,
});
falg? this.$notice.success(meassage+'成功'):this.$notice.error(meassage+'失败');
}
<#ibizinclude>
......
......@@ -37,7 +37,7 @@
</#if>
</#if>
</ion-list>
<ion-select ref="select" v-show="false" @ionChange="change" interface="action-sheet" :cancel-text="$t('app.button.cancel')">
<ion-select ref="select" v-show="false" @ionChange="actionBarClick" interface="action-sheet" :cancel-text="$t('app.button.cancel')">
<ion-select-option v-for="option of actionBarModelData" :key="option.viewlogicname" :value="option.viewlogicname">{{option.actionName}}</ion-select-option>
</ion-select>
</ion-row>
......
......@@ -211,22 +211,21 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/ap
*
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public change(value:any) {
public actionBarClick(value:any) {
if(value.detail.value){
if(value.detail.value == 'rename' ){
this.isEditTitle = true;
}else if(value.detail.value == 'delete' ){
this.$emit("enableCustomizedEvent",'delete',this.item)
}
else{
this.handleItemClick(value.detail.value);
}
}
setTimeout(() => {
let select :any = this.$refs['select'];
if (select) {
select.value = null;
}
}, 1);
let select :any = this.$refs['select'];
if (select) {
select.value = null;
}
}
/**
......@@ -288,7 +287,7 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/ap
*/
public onConfirmClick(val:boolean) {
if(val){
this.$emit("customizeRename",Object.assign(this.item,{customizeTitle:this.reTitleValue?this.reTitleValue:this.editTitle}),this.reTitleValue?this.reTitleValue:this.editTitle)
this.$emit("enableCustomizedEvent",'rename',Object.assign(this.item,{customizeTitle:this.reTitleValue?this.reTitleValue:this.editTitle}),this.reTitleValue?this.reTitleValue:this.editTitle)
}
this.isEditTitle = false;
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册