提交 1a0d7b81 编写于 作者: Neuromancer255's avatar Neuromancer255

列表部件调整

上级 c31956ea
......@@ -3,7 +3,7 @@
${ctrl.render.code}
<#else>
<div class="app-mob-mdctrl <#if ctrl.getPSSysCss()??><#assign singleCss = ctrl.getPSSysCss()> ${singleCss.getCssName()}</#if>">
<div class="app-mob-mdctrl-${ctrl.name}">
<div v-if="listType==='ordinary'" 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">
......@@ -102,6 +102,11 @@
</template>
</ion-list>
</div>
<div v-if="listType==='listNav'">
<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>
</#if>
</template>
\ No newline at end of file
......@@ -6,26 +6,6 @@
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
</#ibizinclude>
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public getData(): any {
return {};
}
/**
* 显示处理提示
*
......@@ -34,14 +14,6 @@
*/
@Prop({ default: true }) protected showBusyIndicator?: boolean;
/**
* 部件行为--update
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Prop() protected updateAction!: string;
/**
* 部件行为--fetch
*
......@@ -51,36 +23,28 @@
@Prop() protected fetchAction!: string;
/**
* 部件行为--remove
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Prop() protected removeAction!: string;
/**
* 部件行为--load
* 列表数组
*
* @type {string}
* @type {Array<any>}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Prop() protected loadAction!: string;
public items: Array<any> = [];
/**
* 部件行为--loaddraft
* 列表类型
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Prop() protected loaddraftAction!: string;
public listType: string = "";
/**
* 部件行为--create
* 列表选中项的索引
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Prop() protected createAction!: string;
public listItem: number = 0;
/**
* 列表数组
......@@ -122,36 +86,6 @@
*/
@Prop({default: '<#if ctrl.getMobListStyle?? && ctrl.getMobListStyle()??>${ctrl.getMobListStyle()}</#if>'}) protected controlStyle!: string;
/**
* 格式化数据
*
* @param {*} datelist
* @memberof IBizChartViewController
*/
public formatdate(datelist: any) {
this.items = datelist;
}
/**
* 数据加载
*
* @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);
} else if (response && response.status !== 401) {
const { data: _data } = response;
this.$notice.error(_data.message)
}
}
/**
* vue生命周期created
*
......@@ -200,6 +134,49 @@
</#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);
} 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>
......
<#-- content -->
<#assign content>
:showBusyIndicator="${ctrl.isShowBusyIndicator()?c}"
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>"
fetchAction="<#if ctrl.getFetchPSControlAction?? && ctrl.getFetchPSControlAction()?? && ctrl.getFetchPSControlAction().getPSAppDEMethod()??>${ctrl.getFetchPSControlAction().getPSAppDEMethod().getCodeName()}</#if>"
<#if ctrl.getControlStyle?? && ctrl.getControlStyle()??>controlStyle="${ctrl.getControlStyle()}"</#if>
</#assign>
......
......@@ -5,3 +5,6 @@
<#assign layoutpanel=ctrl.getItemPSLayoutPanel()>
${P.getCtrlCode(layoutpanel, 'CONTROL.less').code}
</#if>
.app-mob-list-item{
width: 100%;
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册