提交 7a5fa2d2 编写于 作者: Neuromancer255's avatar Neuromancer255

数据视图修改 --fix1

上级 2273ac66
<template>
<#if ctrl.render??>
${ctrl.render.code}
<#else>
</#if>
</template>
\ No newline at end of file
<#ibizinclude>
./CONTROL-BASE.template.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
</#ibizinclude>
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public getData(): any {
return null;
}
/**
* 显示处理提示
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Prop({ default: true }) protected showBusyIndicator?: boolean;
/**
* 部件行为--fetch
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Prop() protected fetchAction!: string;
/**
* 列表数组
*
* @type {Array<any>}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public items: Array<any> = [];
/**
* 列表类型
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Prop({default:'DATAVIEW'}) protected dataViewMode?: 'LISTEXPBAR' | 'DATAVIEW' | string;
/**
* 列表选中项的索引
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public listItem: number = 0;
/**
* 分页大小
*
* @type {number}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public pageSize: number = ${ ctrl.getPagingSize()?c};
/**
* 总页数
*
* @type {number}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public pageTotal: number = 0;
/**
* 当前页数
*
* @type {number}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public pageNumber: number = 0;
/**
* vue生命周期created
*
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public created() {
this.handleCreated();
}
/**
* 执行created后的逻辑
*
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public handleCreated() {
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if (!Object.is(tag, this.name)) {
return;
}
this.load(Object.assign(data, { page: this.pageNumber, size: this.pageSize }), "");
});
}
}
/**
* vue 生命周期
*
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
<#if destroyed_block??>
${destroyed_block}
</#if>
}
/**
* 列表切换回调
* @param {number} listIndex
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public SwitchView(listIndex:number){
this.items.findIndex((item,index)=>{
if(index === listIndex){
this.$emit('selectionchange', item);
}
})
}
/**
* 数据加载
*
* @protected
* @param {*} data
* @param {*} type
* @returns {Promise<any>}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected async load(data: any, type: any): Promise<any> {
const response: any = await this.service.search(this.fetchAction, this.context, data, this.showBusyIndicator);
if (response && response.status === 200) {
let datelist = response.data.records;
this.formatdate(datelist);
this.$emit("load",this.items);
} else if (response && response.status !== 401) {
const { data: _data } = response;
this.$notice.error(_data.message)
}
}
/**
* 格式化数据
*
* @param {*} datelist
* @memberof IBizChartViewController
*/
public formatdate(datelist: any) {
this.items = datelist;
}
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/CONTROL/CONTROL-BASE.style.ftl
</#ibizinclude>
\ No newline at end of file
<#-- content -->
<#assign content>
<#if view.getViewType?? && view.getViewType()??>
listMode="<#if view.getViewType()=='DEMOBLISTEXPVIEW'>LISTEXPBAR<#else>LIST</#if>"
</#if>
updateAction="<#if ctrl.getUpdatePSControlAction?? && ctrl.getUpdatePSControlAction()?? && ctrl.getUpdatePSControlAction().getPSAppDEMethod()??>${ctrl.getUpdatePSControlAction().getPSAppDEMethod().getCodeName()}</#if>"
removeAction="<#if ctrl.getRemovePSControlAction?? && ctrl.getRemovePSControlAction()?? && ctrl.getRemovePSControlAction().getPSAppDEMethod()??>${ctrl.getRemovePSControlAction().getPSAppDEMethod().getCodeName()}</#if>"
loaddraftAction="<#if ctrl.getGetDraftPSControlAction?? && ctrl.getGetDraftPSControlAction()?? && ctrl.getGetDraftPSControlAction().getPSAppDEMethod()??>${ctrl.getGetDraftPSControlAction().getPSAppDEMethod().getCodeName()}</#if>"
loadAction="<#if ctrl.getGetPSControlAction?? && ctrl.getGetPSControlAction()?? && ctrl.getGetPSControlAction().getPSAppDEMethod()??>${ctrl.getGetPSControlAction().getPSAppDEMethod().getCodeName()}</#if>"
createAction="<#if ctrl.getCreatePSControlAction?? && ctrl.getCreatePSControlAction()?? && ctrl.getCreatePSControlAction().getPSAppDEMethod()??>${ctrl.getCreatePSControlAction().getPSAppDEMethod().getCodeName()}</#if>"
:showBusyIndicator="${ctrl.isShowBusyIndicator()?c}"
fetchAction="<#if ctrl.getFetchPSControlAction?? && ctrl.getFetchPSControlAction()?? && ctrl.getFetchPSControlAction().getPSAppDEMethod()??>${ctrl.getFetchPSControlAction().getPSAppDEMethod().getCodeName()}</#if>"
<#if ctrl.getControlStyle?? && ctrl.getControlStyle()??>controlStyle="${ctrl.getControlStyle()}"</#if>
</#assign>
<#ibizinclude>
../@MACRO/HTML/DEFAULT.html.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/CSS/DEFAULT.less.ftl
</#ibizinclude>
<#if ctrl.getItemPSLayoutPanel()??>
<#assign layoutpanel=ctrl.getItemPSLayoutPanel()>
${P.getCtrlCode(layoutpanel, 'CONTROL.less').code}
</#if>
.van-sidebar{
width: 100%;
}
.van-sidebar-item--select::before{
width: 4%;
height: 100%;
}
\ No newline at end of file
<#ibizinclude>
../@MACRO/CONTROL/CONTROL.vue.ftl
</#ibizinclude>
\ No newline at end of file
<#ibizinclude>
../@MACRO/MODEL/MODEL_HEADER.ts.ftl
</#ibizinclude>
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof ${srfclassname('${ctrl.getCodeName()}')}${srfclassname('${ctrl.name}')}Mode
*/
public getDataItems(): any[] {
return [
<#-- 数据视图数据项 -->
<#if ctrl.getPSDEDataViewDataItems()??>
<#list ctrl.getPSDEDataViewDataItems() as dataitem>
{
name: '${dataitem.getName()}',
<#if dataitem.getPSDEField()??>
prop: '${dataitem.getPSDEField().getCodeName()?lower_case}',
dataType: '${dataitem.getPSDEField().getDataType()}',
</#if>
},
</#list>
</#if>
<#-- 关联主实体的主键 -->
<#if ctrl.getPSAppDataEntity()??>
<#assign appDataEntity = ctrl.getPSAppDataEntity() />
<#if appDataEntity.isMajor() == false && appDataEntity.getMinorPSAppDERSs()??>
<#list appDataEntity.getMinorPSAppDERSs() as minorAppDERSs>
<#if minorAppDERSs.getMajorPSAppDataEntity()??>
<#assign majorAppDataEntity = minorAppDERSs.getMajorPSAppDataEntity() />
{
name: '${majorAppDataEntity.getCodeName()?lower_case}',
prop: '${majorAppDataEntity.getKeyPSAppDEField().getCodeName()?lower_case}'
},
</#if>
</#list>
</#if>
</#if>
<#if ctrl.getPSDEDataViewDataItems()??>
<#list ctrl.getPSDEDataViewDataItems() as dataitem>
<#-- 界面主键标识 -->
<#if dataitem.getPSDEField?? && dataitem.getPSDEField()?? && dataitem.getPSDEField().isKeyDEField() == true>
<#if !P.exists("importService", dataitem.getPSDEField().getId(), "")>
{
name: '${ctrl.getPSAppDataEntity().getCodeName()?lower_case}',
prop: '${dataitem.getPSDEField().getCodeName()?lower_case}',
dataType: 'FONTKEY',
},
</#if>
</#if>
</#list>
</#if>
<#if view.hasPSControl('searchform')>
${P.getCtrlCode('searchform', 'MODEL_CONTENT.ts').code}
</#if>
{
name:'size',
prop:'size'
},
{
name:'query',
prop:'query'
},
{
name:'sort',
prop:'sort'
},
{
name:'page',
prop:'page'
},
{
name:'srfparentdata',
prop:'srfparentdata'
}
]
}
<#ibizinclude>
../@MACRO/MODEL/MODEL_BOTTOM.ts.ftl
</#ibizinclude>
\ No newline at end of file
<#assign extendsClass>DataViewServiceBase</#assign>
<#ibizinclude>
../@MACRO/SERVICE/SERVICE_HEADER.ts.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/SERVICE/SERVICE_BOTTOM.ts.ftl
</#ibizinclude>
\ No newline at end of file
CTRLTYPE=DATAVIEW
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册