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

删除事件

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