提交 4a6c238b 编写于 作者: Neuromancer255's avatar Neuromancer255

补充数据视图

上级 7fa5a3fe
......@@ -2,111 +2,5 @@
<#if ctrl.render??>
${ctrl.render.code}
<#else>
<div class="app-mob-mdctrl <#if ctrl.getPSSysCss()??><#assign singleCss = ctrl.getPSSysCss()> ${singleCss.getCssName()}</#if>">
<div v-if="listMode==='LISTEXPBAR'">
<van-sidebar v-model="listItem" @change="SwitchView">
<van-sidebar-item class="app-mob-list-item" v-for="item in items" :key="item.srfkey" :title='item.srfmajortext'/>
</van-sidebar>
</div>
<div v-else class="app-mob-mdctrl-${ctrl.name}">
<ion-list class="items">
<template v-if="controlStyle != 'SWIPERVIEW' ">
<ion-item-sliding v-for="(item, index) in items" :key="index" class="app-mob-mdctrl-item">
<#if ctrl.getItemPSLayoutPanel()??>
<#assign layoutpanel=ctrl.getItemPSLayoutPanel()>
<div style="width:100%;">
<layout_${layoutpanel.getName()} :context="{}" :viewparams="{}" :item="item"></layout_${layoutpanel.getName()}>
</div>
<#else>
<#if ctrl.getPSDEUIActionGroup?? && ctrl.getPSDEUIActionGroup()?? && ctrl.getPSDEUIActionGroup().getPSUIActionGroupDetails()??>
<#assign details = ctrl.getPSDEUIActionGroup().getPSUIActionGroupDetails()>
<ion-item-options v-if="controlStyle != 'LISTVIEW3'" side="start">
<#list details as detail>
<#if detail.getPSUIAction()??>
<#assign uiaction = detail.getPSUIAction()>
<ion-item-option color="<#if uiaction.getUIActionTag() == "Remove">danger<#else>primary</#if>" @click="mdctrl_click($event, '${detail.getName()}', item)">${uiaction.getCaption()}</ion-item-option>
</#if>
</#list>
</ion-item-options>
</#if>
<ion-item>
<#-- 实体列表项集合-->
<#if ctrl.getPSDEListItems()??>
<!-- 列表视图样式 -->
<app-list-default :item="item" v-if="controlStyle.substring(0,8) === 'LISTVIEW'"></app-list-default>
<!-- 图标视图样式 -->
<app-icon-list :item="item" v-if="controlStyle === 'ICONVIEW'"></app-icon-list>
<#else>
<div>暂无数据</div>
</#if>
</ion-item>
<#if ctrl.getPSDEUIActionGroup2?? && ctrl.getPSDEUIActionGroup2()?? && ctrl.getPSDEUIActionGroup2().getPSUIActionGroupDetails()??>
<#assign details = ctrl.getPSDEUIActionGroup2().getPSUIActionGroupDetails()>
<ion-item-options v-if="controlStyle != 'LISTVIEW3'" side="end">
<#list details as detail>
<#if detail.getPSUIAction()??>
<#assign uiaction = detail.getPSUIAction()>
<ion-item-option color="<#if uiaction.getUIActionTag() == "Remove">danger<#else>primary</#if>" @click="mdctrl_click($event, '${detail.getName()}', item)">${uiaction.getCaption()}</ion-item-option>
</#if>
</#list>
</ion-item-options>
</#if>
</#if>
</ion-item-sliding>
</template>
<#--多数据视图||多数据视图(部件视图)-->
<template v-else-if="controlStyle != 'LISTVIEW' ">
<ion-item-sliding v-for="(item, index) in items" :key="index" class="app-mob-mdctrl-item">
<#if ctrl.getItemPSLayoutPanel()??>
<#assign layoutpanel=ctrl.getItemPSLayoutPanel()>
<div style="width:100%;">
<layout_${layoutpanel.getName()} :context="{}" :viewparams="{}" :item="item"></layout_${layoutpanel.getName()}>
</div>
<#else>
<#if ctrl.getPSDEUIActionGroup?? && ctrl.getPSDEUIActionGroup()?? && ctrl.getPSDEUIActionGroup().getPSUIActionGroupDetails()??>
<#assign details = ctrl.getPSDEUIActionGroup().getPSUIActionGroupDetails()>
<ion-item-options v-if="controlStyle != 'LISTVIEW3'" side="start">
<#list details as detail>
<#if detail.getPSUIAction()??>
<#assign uiaction = detail.getPSUIAction()>
<ion-item-option color="<#if uiaction.getUIActionTag() == "Remove">danger<#else>primary</#if>" @click="mdctrl_click($event, '${detail.getName()}', item)">${uiaction.getCaption()}</ion-item-option>
</#if>
</#list>
</ion-item-options>
</#if>
<ion-item>
<#-- 实体列表项集合-->
<#if ctrl.getPSDEListItems()??>
<!-- 列表视图样式 -->
<app-list-default :item="item" v-if="controlStyle.substring(0,8) === 'LISTVIEW'"></app-list-default>
<!-- 图标视图样式 -->
<app-icon-list :item="item" v-if="controlStyle === 'ICONVIEW'"></app-icon-list>
<#else>
<div>暂无数据</div>
</#if>
</ion-item>
<#if ctrl.getPSDEUIActionGroup2?? && ctrl.getPSDEUIActionGroup2()?? && ctrl.getPSDEUIActionGroup2().getPSUIActionGroupDetails()??>
<#assign details = ctrl.getPSDEUIActionGroup2().getPSUIActionGroupDetails()>
<ion-item-options v-if="controlStyle != 'LISTVIEW3'" side="end">
<#list details as detail>
<#if detail.getPSUIAction()??>
<#assign uiaction = detail.getPSUIAction()>
<ion-item-option color="<#if uiaction.getUIActionTag() == "Remove">danger<#else>primary</#if>" @click="mdctrl_click($event, '${detail.getName()}', item)">${uiaction.getCaption()}</ion-item-option>
</#if>
</#list>
</ion-item-options>
</#if>
</#if>
</ion-item-sliding>
</template>
<template v-else-if="controlStyle === 'SWIPERVIEW'">
<app-list-swipe :items="items"></app-list-swipe>
</template>
</ion-list>
</div>
</div>
</#if>
</template>
\ No newline at end of file
<template>
<#if ctrl.render??>
${ctrl.render.code}
<#else>
<div class="app-mob-mdctrl <#if ctrl.getPSSysCss()??><#assign singleCss = ctrl.getPSSysCss()> ${singleCss.getCssName()}</#if>">
<div v-if="listMode==='LISTEXPBAR'">
<van-sidebar v-model="listItem" @change="SwitchView">
<van-sidebar-item class="app-mob-list-item" v-for="item in items" :key="item.srfkey" :title='item.srfmajortext'/>
</van-sidebar>
</div>
<div v-else class="app-mob-mdctrl-${ctrl.name}">
<ion-list class="items">
<template v-if="controlStyle != 'SWIPERVIEW' ">
<ion-item-sliding v-for="(item, index) in items" :key="index" class="app-mob-mdctrl-item">
<#if ctrl.getItemPSLayoutPanel()??>
<#assign layoutpanel=ctrl.getItemPSLayoutPanel()>
<div style="width:100%;">
<layout_${layoutpanel.getName()} :context="{}" :viewparams="{}" :item="item"></layout_${layoutpanel.getName()}>
</div>
<#else>
<#if ctrl.getPSDEUIActionGroup?? && ctrl.getPSDEUIActionGroup()?? && ctrl.getPSDEUIActionGroup().getPSUIActionGroupDetails()??>
<#assign details = ctrl.getPSDEUIActionGroup().getPSUIActionGroupDetails()>
<ion-item-options v-if="controlStyle != 'LISTVIEW3'" side="start">
<#list details as detail>
<#if detail.getPSUIAction()??>
<#assign uiaction = detail.getPSUIAction()>
<ion-item-option color="<#if uiaction.getUIActionTag() == "Remove">danger<#else>primary</#if>" @click="mdctrl_click($event, '${detail.getName()}', item)">${uiaction.getCaption()}</ion-item-option>
</#if>
</#list>
</ion-item-options>
</#if>
<ion-item>
<#-- 实体列表项集合-->
<#if ctrl.getPSDEListItems()??>
<!-- 列表视图样式 -->
<app-list-default :item="item" v-if="controlStyle.substring(0,8) === 'LISTVIEW'"></app-list-default>
<!-- 图标视图样式 -->
<app-icon-list :item="item" v-if="controlStyle === 'ICONVIEW'"></app-icon-list>
<#else>
<div>暂无数据</div>
</#if>
</ion-item>
<#if ctrl.getPSDEUIActionGroup2?? && ctrl.getPSDEUIActionGroup2()?? && ctrl.getPSDEUIActionGroup2().getPSUIActionGroupDetails()??>
<#assign details = ctrl.getPSDEUIActionGroup2().getPSUIActionGroupDetails()>
<ion-item-options v-if="controlStyle != 'LISTVIEW3'" side="end">
<#list details as detail>
<#if detail.getPSUIAction()??>
<#assign uiaction = detail.getPSUIAction()>
<ion-item-option color="<#if uiaction.getUIActionTag() == "Remove">danger<#else>primary</#if>" @click="mdctrl_click($event, '${detail.getName()}', item)">${uiaction.getCaption()}</ion-item-option>
</#if>
</#list>
</ion-item-options>
</#if>
</#if>
</ion-item-sliding>
</template>
<#--多数据视图||多数据视图(部件视图)-->
<template v-else-if="controlStyle != 'LISTVIEW' ">
<ion-item-sliding v-for="(item, index) in items" :key="index" class="app-mob-mdctrl-item">
<#if ctrl.getItemPSLayoutPanel()??>
<#assign layoutpanel=ctrl.getItemPSLayoutPanel()>
<div style="width:100%;">
<layout_${layoutpanel.getName()} :context="{}" :viewparams="{}" :item="item"></layout_${layoutpanel.getName()}>
</div>
<#else>
<#if ctrl.getPSDEUIActionGroup?? && ctrl.getPSDEUIActionGroup()?? && ctrl.getPSDEUIActionGroup().getPSUIActionGroupDetails()??>
<#assign details = ctrl.getPSDEUIActionGroup().getPSUIActionGroupDetails()>
<ion-item-options v-if="controlStyle != 'LISTVIEW3'" side="start">
<#list details as detail>
<#if detail.getPSUIAction()??>
<#assign uiaction = detail.getPSUIAction()>
<ion-item-option color="<#if uiaction.getUIActionTag() == "Remove">danger<#else>primary</#if>" @click="mdctrl_click($event, '${detail.getName()}', item)">${uiaction.getCaption()}</ion-item-option>
</#if>
</#list>
</ion-item-options>
</#if>
<ion-item>
<#-- 实体列表项集合-->
<#if ctrl.getPSDEListItems()??>
<!-- 列表视图样式 -->
<app-list-default :item="item" v-if="controlStyle.substring(0,8) === 'LISTVIEW'"></app-list-default>
<!-- 图标视图样式 -->
<app-icon-list :item="item" v-if="controlStyle === 'ICONVIEW'"></app-icon-list>
<#else>
<div>暂无数据</div>
</#if>
</ion-item>
<#if ctrl.getPSDEUIActionGroup2?? && ctrl.getPSDEUIActionGroup2()?? && ctrl.getPSDEUIActionGroup2().getPSUIActionGroupDetails()??>
<#assign details = ctrl.getPSDEUIActionGroup2().getPSUIActionGroupDetails()>
<ion-item-options v-if="controlStyle != 'LISTVIEW3'" side="end">
<#list details as detail>
<#if detail.getPSUIAction()??>
<#assign uiaction = detail.getPSUIAction()>
<ion-item-option color="<#if uiaction.getUIActionTag() == "Remove">danger<#else>primary</#if>" @click="mdctrl_click($event, '${detail.getName()}', item)">${uiaction.getCaption()}</ion-item-option>
</#if>
</#list>
</ion-item-options>
</#if>
</#if>
</ion-item-sliding>
</template>
<template v-else-if="controlStyle === 'SWIPERVIEW'">
<app-list-swipe :items="items"></app-list-swipe>
</template>
</ion-list>
</div>
</div>
</#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
<#ibiztemplate>
TARGET=PSAPPVIEWCTRL_DATAVIEWEXPBAR
</#ibiztemplate>
${P.getCtrlCode('SERVICE.ts').code}
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册