提交 34bd0d72 编写于 作者: KK's avatar KK

看板视图调整

上级 ea42502c
......@@ -3,10 +3,15 @@
<div v-show="isEnableCustomized" class="dashboard-enableCustomized" @click="openCustomized">定制仪表盘<ion-icon name="settings-outline"></ion-icon></div>
<#list ctrl.getAllPSPortlets() as portlet><#t>
<#if portlet.getPortletType?? && portlet.getPortletType()?? && portlet.getPortletType() != 'CONTAINER'><#t>
<div class="dashboard-item">
<div class="dashboard-item" v-if="!isEnableCustomized">
${P.getCtrlCode(portlet, 'CONTROL.html').code}
</div>
</#if>
</#list>
<template v-for="item in customizeModel">
<div class="dashboard-item" :key="item.id" v-if="isEnableCustomized">
<component :is="item.componentName" :viewState="viewState" :name="item.portletCodeName" :context="context" :viewparams="viewparams"></component>
</div>
</template>
</ion-grid>
</template>
\ No newline at end of file
<#assign import_block>
import UtilService from '@/utilservice/util-service';
</#assign>
<#ibizinclude>
./CONTROL-BASE.template.ftl
</#ibizinclude>
......@@ -43,6 +46,44 @@
*/
public utilServiceName:string = "<#if ctrl.getPSAppDynaDashboardUtil?? && ctrl.getPSAppDynaDashboardUtil()??>${ctrl.getPSAppDynaDashboardUtil().getCodeName()?lower_case}</#if>";
/**
* 工具服务对象
*
* @protected
* @type {UtilService}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected utilService: UtilService = new UtilService();
/**
* 加载数据模型
*
* @param {string} serviceName
* @param {*} context
* @param {*} viewparams
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public loadModel(serviceName: string, context: any, viewparams: any) {
return new Promise((resolve: any, reject: any) => {
this.utilService.getService(serviceName).then((service: any) => {
service.loadModelData(JSON.stringify(context), viewparams).then((response: any) => {
this.customizeModel = response.data;
setTimeout(() => {
this.customizeModel.forEach((item: any) => {
this.viewState.next({ tag: item.portletCodeName, action: "", data: {} });});
}, 1);
resolve(response);
}).catch((response: any) => {
reject(response);
});
}).catch((response: any) => {
reject(response);
});
});
}
public customizeModel :any = [];
/**
* 获取单项树
......@@ -78,6 +119,9 @@
Object.keys(refs).forEach((name: string) => {
this.viewState.next({ tag: name, action: action, data: data });
});
if(this.isEnableCustomized){
this.loadModel(this.utilServiceName,this.context,Object.assign(this.viewparams,{utilServiceName:this.utilServiceName,modelid:this.modelId}));
}
});
}
}
......@@ -111,7 +155,7 @@
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public openCustomized() {
this.openPopupModal({ viewname: 'app-customize', title: 'app-customize'},{},{modelId:this.modelId,utilServiceName:this.utilServiceName});
this.openPopupModal({ viewname: 'app-customize', title: 'app-customize'},{},{modelId:this.modelId,utilServiceName:this.utilServiceName,selectMode:this.customizeModel});
}
/**
......@@ -123,7 +167,7 @@
private async openPopupModal(view: any, context: any, param: any): Promise<any> {
const result: any = await this.$appmodal.openModal(view, context, param);
if (result || Object.is(result.ret, 'OK')) {
// this.reValue = result.datas[0];
this.loadModel(this.utilServiceName,this.context,Object.assign(this.viewparams,{utilServiceName:this.utilServiceName,modelid:this.modelId}));
}
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册