提交 c46c93eb 编写于 作者: Mosher's avatar Mosher

update:更新导航视图

上级 f0e5cc64
......@@ -21,8 +21,9 @@
</#if>
<#if ctrl.isEnableSearch()>
<div class='search-container'>
<i-input :search="true"
@on-change="($event) => { this.searchText = $event.target.value; }"
<i-input
v-model="searchText"
:search="true"
:placeholder="placeholder"
@on-search="onSearch">
</i-input>
......@@ -462,7 +463,7 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/co
</#if>
if (this.navigateContext && Object.keys(this.navigateContext).length > 0) {
let _context:any = this.$util.computedNavData(arg, tempContext, tempViewParam, this.navigateContext);
Object.assign(tempContext, _context);
Object.assign(tempContext,_context);
}
if (this.navigateParams && Object.keys(this.navigateParams).length > 0) {
let _params:any = this.$util.computedNavData(arg, tempContext, tempViewParam, this.navigateParams);
......
......@@ -2,7 +2,7 @@
<#if ctrl.render??>
${ctrl.render.code}
<#else>
<split id="${ctrl.getCodeName()?lower_case}" class="app-dataview-exp-bar<#if ctrl.getPSSysCss()??><#assign singleCss = ctrl.getPSSysCss()> ${singleCss.getCssName()}</#if>" v-model="split" mode="<#if view.getSideBarLayout()?? && view.getSideBarLayout() == "LEFT">horizontal<#else>vertical</#if>" @on-move-end="onSplitChange">
<div id="${ctrl.getCodeName()?lower_case}" class="app-dataview-exp-bar<#if ctrl.getPSSysCss()??><#assign singleCss = ctrl.getPSSysCss()> ${singleCss.getCssName()}</#if>">
<div slot='<#if view.getSideBarLayout()?? && view.getSideBarLayout() == "LEFT">left<#else>top</#if>'>
<#if ctrl.isShowTitleBar()>
<div class='dataview-exp-bar-header'>
......@@ -11,23 +11,24 @@
</div>
</div>
</#if>
<div class="container-header">
<div class="exp-bar-action-container">
<#if view.isEnableQuickGroup()>
<#if view.getPSSysCounterRef?? && view.getPSSysCounterRef()?? && view.getPSSysCounterRef().getPSAppCounter()??>
<#assign appCounter = view.getPSSysCounterRef().getPSAppCounter() />
</#if>
<div class="quick-group-container">
<app-quick-group :items="quickGroupModel" <#if appCounter??>:counterService="${appCounter.getCodeName()?lower_case}counterservice"</#if> @valuechange="quickGroupValueChange"></app-quick-group>
</div>
<div class="quick-group-container">
<app-quick-group :items="quickGroupModel" <#if appCounter??>:counterService="${appCounter.getCodeName()?lower_case}counterservice"</#if> @valuechange="quickGroupValueChange"></app-quick-group>
</div>
</#if>
<#if ctrl.isEnableSearch()>
<div class='search-container'>
<i-input :search="true"
@on-change="($event) => { this.searchText = $event.target.value; }"
:placeholder="placeholder"
@on-search="onSearch">
</i-input>
</div>
<div class='search-container'>
<i-input
v-model="searchText"
:search="true"
:placeholder="placeholder"
@on-search="onSearch">
</i-input>
</div>
</#if>
<#if ctrl.getPSControls()??>
<#assign controls = ctrl.getPSControls()/>
......@@ -38,29 +39,19 @@
</#list>
</#if>
</div>
<div class='<#if ctrl.isShowTitleBar()>dataview-exp-bar-content<#else>dataview-exp-bar-content2</#if>'>
<#if ctrl.getPSControls()??>
<#assign controls = ctrl.getPSControls()/>
<#list controls as singleControl>
<#if singleControl.getControlType() == "DATAVIEW">
${P.getCtrlCode(singleControl, 'CONTROL.html').code}
</#if>
</#list>
</#if>
</div>
</div>
<div slot='<#if view.getSideBarLayout()?? && view.getSideBarLayout() == "LEFT">right<#else>bottom</#if>'>
<component
v-if="selection.view && !Object.is(this.selection.view.viewname, '')"
:is="selection.view.viewname"
class="viewcontainer2"
:viewDefaultUsage="false"
:viewdata="JSON.stringify(selection.context)"
:viewparam="JSON.stringify(selection.viewparam)">
</component>
<div class='dataview-exp-bar-content'>
<#if ctrl.getPSControls()??>
<#assign controls = ctrl.getPSControls()/>
<#list controls as singleControl>
<#if singleControl.getControlType() == "DATAVIEW">
${P.getCtrlCode(singleControl, 'CONTROL.html').code}
</#if>
</#list>
</#if>
</div>
</split>
</#if>
</div>
</#if>
</template>
<#assign import_block>
......@@ -131,31 +122,6 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/co
public ${appCounter.getCodeName()?lower_case}counterservice: ${srfclassname('${appCounter.getCodeName()}')}CounterService = new ${srfclassname('${appCounter.getCodeName()}')}CounterService({ context:this.context,viewparams:this.viewparams });
</#if>
/**
* 呈现模式,可选值:horizontal或者vertical
*
* @public
* @type {(string)}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public showMode:string ="<#if view.getSideBarLayout()?? && view.getSideBarLayout() == "LEFT">horizontal<#else>vertical</#if>";
/**
* 控件宽度
*
* @type {number}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public ctrlWidth:number = <#if ctrl.getWidth()??>${ctrl.getWidth()?c}<#else>0</#if>;
/**
* 控件高度
*
* @type {number}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public ctrlHeight: number = <#if ctrl.getHeight()??>${ctrl.getHeight()?c}<#else>0</#if>;
/**
* 可搜索字段名称
*
......@@ -163,7 +129,7 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/co
* @type {(string)}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public placeholder="<@getQuickSearchPlaceholder ctrl />";
public placeholder = "<@getQuickSearchPlaceholder ctrl />";
/**
* 搜素值
......@@ -172,15 +138,7 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/co
* @type {(string)}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public searchText:string = "";
/**
* 分割宽度
*
* @type {number}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public split: number = 0.5;
public searchText: string = "";
<#if ctrl.getXDataPSControl()??>
<#assign xDataControl = ctrl.getXDataPSControl() />
......@@ -382,32 +340,13 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/co
return null;
}
/**
* 选中数据
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public selection: any = {};
/**
* split值变化事件
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public onSplitChange() {
if(this.split){
this.$store.commit("setViewSplit",{viewUID:this.viewUID,viewSplit:this.split});
}
}
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public created() {
this.afterCreated();
this.afterCreated();
}
/**
......@@ -446,24 +385,7 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/co
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public afterMounted(){
if(this.$store.getters.getViewSplit(this.viewUID)){
this.split = this.$store.getters.getViewSplit(this.viewUID);
}else{
let containerWidth:number = (document.getElementById("${ctrl.getCodeName()?lower_case}") as any).offsetWidth;
let containerHeight:number = (document.getElementById("${ctrl.getCodeName()?lower_case}") as any).offsetHeight;
if(Object.is(this.showMode,'horizontal')){
if(this.ctrlWidth && containerWidth != 0){
this.split = this.ctrlWidth/containerWidth;
}
}else{
if(this.ctrlHeight && containerHeight != 0){
this.split = this.ctrlHeight/containerHeight;
}
}
this.$store.commit("setViewSplit",{viewUID:this.viewUID,viewSplit:this.split});
}
}
public afterMounted() { }
/**
* vue 生命周期
......@@ -545,10 +467,16 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/co
let _params:any = this.$util.computedNavData(arg,tempContext,tempViewParam,this.navigateParams);
Object.assign(tempViewParam,_params);
}
this.selection = {};
Object.assign(this.selection, { view: { viewname: this.navViewName },context:tempContext,viewparam:tempViewParam});
const navItem: any = {
navView: this.navViewName,
data: args,
srfnavdata: {
context: tempContext,
viewparams: tempViewParam
}
}
this.calcToolbarItemState(false);
this.$forceUpdate();
this.$emit('selectionchange', navItem);
}
/**
......
.app-dataview-exp-bar {
> .ivu-split-horizontal {
> .ivu-split-trigger-con {
height: 100%;
width: 1px;
}
> .ivu-split-pane {
> div {
height: 100%;
overflow: auto;
display: flex;
flex-direction: column;
.dataview-exp-bar-header {
line-height: 50px;
border-bottom: 1px solid #ddd;
.dataview-exp-bar-title {
font-size: 18px;
padding-left: 8px;
i {
font-size: 20px;
margin-top: -2px;
}
}
}
.container-header{
display: flex;
justify-content: flex-start;
align-items: center;
flex-wrap: wrap;
.quick-group-container {
padding-top: 8px;
padding-right: 20px;
}
.search-container {
width: 30%;
height: 48px;
padding: 10px 10px 10px 0;
min-width: 200px;
max-width: 400px;
}
.toolbar-container{
padding: 4px;
display: flex;
flex-wrap: wrap;
align-items: center;
}
}
.dataview-exp-bar-content {
<#-- 计算高度 -->
<#if ctrl.isShowTitleBar() && ctrl.isEnableSearch()>
height: calc(100% - 88px);
<#elseif ctrl.isShowTitleBar() && !ctrl.isEnableSearch()>
height: calc(100% - 40px);
<#elseif !ctrl.isShowTitleBar() && ctrl.isEnableSearch()>
height: calc(100% - 38px);
<#else>
height: 100%;
</#if>
overflow: auto;
padding: 16px 0;
margin-bottom: 10px;
}
.dataview-exp-bar-content2 {
height: 100%;
overflow: auto;
flex-grow: 1;
}
}
}
> .right-pane.ivu-split-pane {
> div {
padding-left: 10px;
}
}
> .left-pane.ivu-split-pane {
padding-right: 10px;
}
}
> .ivu-split-vertical{
> .ivu-split-pane {
> div {
height: 100%;
.dataview-exp-bar-header {
line-height: 50px;
border-bottom: 1px solid #ddd;
.dataview-exp-bar-title {
font-size: 18px;
padding-left: 8px;
i {
font-size: 20px;
margin-top: -2px;
}
}
}
.container-header{
display: flex;
justify-content: flex-start;
align-items: center;
flex-wrap: wrap;
.search-container {
width: 30%;
height: 48px;
padding: 10px 10px 10px 0;
min-width: 200px;
max-width: 400px;
}
.toolbar-container{
padding: 4px;
}
.quick-group-container{
padding-top: 8px;
padding-right: 20px;
}
}
.dataview-exp-bar-content {
<#-- 计算高度 -->
<#if ctrl.isShowTitleBar() && ctrl.isEnableSearch()>
height: calc(100% - 88px);
<#elseif ctrl.isShowTitleBar() && !ctrl.isEnableSearch()>
height: calc(100% - 40px);
<#elseif !ctrl.isShowTitleBar() && ctrl.isEnableSearch()>
height: calc(100% - 38px);
<#else>
height: 100%;
</#if>
overflow: auto;
margin-bottom: 10px;
}
.dataview-exp-bar-content2 {
height: 100%;
overflow: auto;
flex-grow: 1;
}
}
}
> .top-pane.ivu-split-pane {
> div {
padding-bottom: 10px;
}
}
> .bottom-pane.ivu-split-pane {
padding-top: 10px;
}
}
}
<#ibizinclude>
../@MACRO/CSS/DEFAULT.less.ftl
.app-dataview-exp-bar {
height: 100%;
display: flex;
flex-direction: column;
.dataview-exp-bar-header {
line-height: 50px;
border-bottom: 1px solid #ddd;
.dataview-exp-bar-title {
font-size: 18px;
padding-left: 8px;
i {
font-size: 20px;
margin-top: -2px;
}
}
}
.exp-bar-action-container {
display: flex;
align-items: center;
}
.container-header{
display: flex;
justify-content: flex-start;
align-items: center;
flex-wrap: wrap;
.search-container {
width: 30%;
height: 48px;
padding: 10px 10px 10px 0;
min-width: 200px;
max-width: 400px;
}
.toolbar-container{
padding: 4px;
}
.quick-group-container {
padding-top: 8px;
padding-right: 20px;
}
}
.dataview-exp-bar-content {
flex-grow: 1;
overflow: auto;
}
}
<#ibizinclude>
../@MACRO/CSS/DEFAULT.less.ftl
</#ibizinclude>
\ No newline at end of file
<template>
<#if ctrl.render??>
${ctrl.render.code}
<#else>
<split id="${ctrl.getCodeName()?lower_case}" class="app-calendar-exp-bar<#if ctrl.getPSSysCss?? && ctrl.getPSSysCss()??><#assign singleCss = ctrl.getPSSysCss()> ${singleCss.getCssName()}</#if>" v-model="split" mode="<#if view.getSideBarLayout()?? && view.getSideBarLayout() == "LEFT">horizontal<#else>vertical</#if>" @on-move-end="onSplitChange">
<div slot='<#if view.getSideBarLayout()?? && view.getSideBarLayout() == "LEFT">left<#else>top</#if>'>
<#if ctrl.isShowTitleBar()>
<div class='calendar-exp-bar-header'>
<div class="calendar-exp-bar-title">
<icon type='ios-home-outline'/><#if ctrl.getTitle() == ''>{{ $t('app.calendarExpBar.title') }}<#else>${ctrl.getTitle()}</#if>
</div>
</div>
</#if>
<div class="container-header">
<#if ctrl.isEnableSearch()>
<div class='search-container'>
<i-input :search="true"
@on-change="($event) => { this.searchText = $event.target.value; }"
:placeholder="placeholder"
@on-search="onSearch">
</i-input>
</div>
</#if>
<#if ctrl.getPSControls()??>
<#assign controls = ctrl.getPSControls()/>
<#list controls as singleControl>
<#if singleControl.getControlType() == "TOOLBAR">
${P.getCtrlCode(singleControl, 'CONTROL.html').code}
</#if>
</#list>
</#if>
</div>
<div class='<#if ctrl.isShowTitleBar()>calendar-exp-bar-content<#else>calendar-exp-bar-content2</#if>'>
<#if ctrl.getPSControls()??>
<#assign controls = ctrl.getPSControls()/>
<#list controls as singleControl>
<#if singleControl.getControlType() == "CALENDAR">
${P.getCtrlCode(singleControl, 'CONTROL.html').code}
</#if>
</#list>
</#if>
</div>
</div>
<div slot='<#if view.getSideBarLayout()?? && view.getSideBarLayout() == "LEFT">right<#else>bottom</#if>'>
<component
v-if="selection.view && !Object.is(this.selection.view.viewname, '')"
:is="selection.view.viewname"
class="viewcontainer2"
:viewDefaultUsage="false"
:viewdata="JSON.stringify(selection.context)"
:viewparam="JSON.stringify(selection.viewparam)">
</component>
</div>
</split>
</#if>
</template>
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/FUNC/MACRO.ftl
</#ibizinclude>
/**
* 视图唯一标识
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop() public viewUID!:string;
<#if view.getPSAppViewLogics?? && view.getPSAppViewLogics()??>
<#list view.getPSAppViewLogics() as logic>
<#if logic.getPFLogicCodeType() == 'APP_NEWDATA'>
/**
* 打开新建数据视图
*
* @type {any}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop() public newdata: any;
</#if>
<#if logic.getPFLogicCodeType() == 'APP_OPENDATA'>
/**
* 打开编辑数据视图
*
* @type {any}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop() public opendata: any;
</#if>
</#list>
</#if>
/**
* 是否单选
*
* @public
* @type {(boolean)}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public isSingleSelect:boolean = true;
/**
* 呈现模式,可选值:horizontal或者vertical
*
* @public
* @type {(string)}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public showMode:string ="<#if view.getSideBarLayout()?? && view.getSideBarLayout() == "LEFT">horizontal<#else>vertical</#if>";
/**
* 控件宽度
*
* @type {number}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public ctrlWidth:number = <#if ctrl.getWidth()??>${ctrl.getWidth()?c}<#else>0</#if>;
/**
* 控件高度
*
* @type {number}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public ctrlHeight: number = <#if ctrl.getHeight()??>${ctrl.getHeight()?c}<#else>0</#if>;
/**
* 可搜索字段名称
*
*
* @type {(string)}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public placeholder="<@getQuickSearchPlaceholder ctrl />";
/**
* 搜素值
*
* @public
* @type {(string)}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public searchText:string = "";
/**
* 分割宽度
*
* @type {number}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public split: number = 0.5;
<#if ctrl.getXDataPSControl()??>
<#assign xDataControl = ctrl.getXDataPSControl() />
/**
* 导航视图名称
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public navViewName: any = {
<#if xDataControl.getPSSysCalendarItems()??>
<#list xDataControl.getPSSysCalendarItems() as calendarItem>
${calendarItem.getItemType()}: "<#if calendarItem.getNavPSAppView?? && calendarItem.getNavPSAppView()??><#assign navPSAppView = calendarItem.getNavPSAppView() />${srffilepath2(navPSAppView.getCodeName())}</#if>"<#if calendarItem_has_next>,</#if>
</#list>
</#if>
};
/**
* 导航参数
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public navParam: any = {
<#if xDataControl.getPSSysCalendarItems()??>
<#list xDataControl.getPSSysCalendarItems() as calendarItem>
${calendarItem.getItemType()}: {
navigateContext:<#if calendarItem.getPSNavigateContexts?? && calendarItem.getPSNavigateContexts()??><@getNavigateContext calendarItem /><#else>null</#if>,
navigateParams:<#if calendarItem.getPSNavigateParams?? && calendarItem.getPSNavigateParams()??><@getNavigateParams calendarItem /><#else>null</#if>
}<#if calendarItem_has_next>,</#if>
</#list>
</#if>
};
/**
* 导航过滤项
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public navFilter: any = {
<#if xDataControl.getPSSysCalendarItems()??>
<#list xDataControl.getPSSysCalendarItems() as calendarItem>
${calendarItem.getItemType()}: "<#if calendarItem.getNavFilter?? && calendarItem.getNavFilter()??>${calendarItem.getNavFilter()}</#if>"<#if calendarItem_has_next>,</#if>
</#list>
</#if>
};
/**
* 导航关系
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public navPSDer: any = {
<#if xDataControl.getPSSysCalendarItems()??>
<#list xDataControl.getPSSysCalendarItems() as calendarItem>
${calendarItem.getItemType()}: "<#if calendarItem.getNavPSDER?? && calendarItem.getNavPSDER()??>n_${calendarItem.getNavPSDER().getPSPickupDEField().getCodeName()?lower_case}_eq</#if>"<#if calendarItem_has_next>,</#if>
</#list>
</#if>
};
</#if>
/**
* 显示处理提示
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop({ default: true }) public showBusyIndicator!: boolean;
<#if ctrl.getPSControls()??>
<#assign controls = ctrl.getPSControls()/>
<#list controls as singleControl>
<#if singleControl.getControlType() == "TOOLBAR">
${P.getCtrlCode(singleControl, 'CONTROL.vue').code}
</#if>
</#list>
</#if>
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public getData(): any {
return null;
}
/**
* 选中数据
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public selection: any = {};
/**
* split值变化事件
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public onSplitChange() {
<#if ctrl.getXDataPSControl()??>
<#assign xDataControl = ctrl.getXDataPSControl() />
if(this.$refs.${xDataControl.getName()}){
const calendarContainer:any = this.$refs.${xDataControl.getName()};
if(calendarContainer.$refs.calendar){
const appCalendar: any = calendarContainer.$refs.calendar;
const api = appCalendar.getApi();
api.updateSize();
}
}
</#if>
if(this.split){
this.$store.commit("setViewSplit",{viewUID:this.viewUID,viewSplit:this.split});
}
}
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public afterCreated(){
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if (!Object.is(tag, this.name)) {
return;
}
<#if ctrl.getXDataPSControl?? && ctrl.getXDataPSControl()??>
<#assign xDataControl = ctrl.getXDataPSControl() />
this.viewState.next({ tag: '${xDataControl.getName()}', action: action, data: data });
</#if>
});
}
}
/**
* Vue声明周期(组件渲染完毕)
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public mounted() {
this.afterMounted();
}
/**
* 执行mounted后的逻辑
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public afterMounted(){
if(this.$store.getters.getViewSplit(this.viewUID)){
this.split = this.$store.getters.getViewSplit(this.viewUID);
}else{
let containerWidth:number = (document.getElementById("${ctrl.getCodeName()?lower_case}") as any).offsetWidth;
let containerHeight:number = (document.getElementById("${ctrl.getCodeName()?lower_case}") as any).offsetHeight;
if(Object.is(this.showMode,'horizontal')){
if(this.ctrlWidth && containerWidth != 0){
this.split = this.ctrlWidth/containerWidth;
}
}else{
if(this.ctrlHeight && containerHeight != 0){
this.split = this.ctrlHeight/containerHeight;
}
}
this.$store.commit("setViewSplit",{viewUID:this.viewUID,viewSplit:this.split});
}
}
/**
* vue 生命周期
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
<#if destroyed_block??>
${destroyed_block}
</#if>
}
/**
* 刷新
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public refresh(args?: any): void {
<#if ctrl.getXDataPSControl?? && ctrl.getXDataPSControl()??>
<#assign dataControl = ctrl.getXDataPSControl() />
const refs: any = this.$refs;
if (refs && refs.${dataControl.name}) {
refs.${dataControl.name}.refresh();
}
</#if>
}
/**
* ${ctrl.name}的选中数据事件
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public ${ctrl.name}_selectionchange(args: any [], tag?: string, $event2?: any): void {
let tempContext:any = {};
let tempViewParam:any = {};
if (args.length === 0) {
this.calcToolbarItemState(true);
return ;
}
const arg:any = args[0];
if(this.context){
Object.assign(tempContext,JSON.parse(JSON.stringify(this.context)));
}
switch(arg.itemType) {
<#if xDataControl?? && xDataControl.getPSSysCalendarItems()??>
<#list xDataControl.getPSSysCalendarItems() as calendarItem>
<#if calendarItem.getPSAppDataEntity()??>
<#assign _appde = calendarItem.getPSAppDataEntity() />
case "${calendarItem.getItemType()}":
Object.assign(tempContext,{ ${_appde.getCodeName()?lower_case} : arg.${_appde.getCodeName()?lower_case}});
Object.assign(tempContext,{srfparentdename:'${_appde.getCodeName()}',srfparentkey:arg['${_appde.getCodeName()?lower_case}']});
if(this.navFilter && this.navFilter['${calendarItem.getItemType()}'] && !Object.is(this.navFilter['${calendarItem.getItemType()}'],"")){
Object.assign(tempViewParam,{[this.navFilter['${calendarItem.getItemType()}']]:arg['${_appde.getCodeName()?lower_case}']});
}
if(this.navPSDer && this.navFilter['${calendarItem.getItemType()}'] && !Object.is(this.navPSDer['${calendarItem.getItemType()}'],"")){
Object.assign(tempViewParam,{[this.navPSDer['${calendarItem.getItemType()}']]:arg['${_appde.getCodeName()?lower_case}']});
}
if(this.navParam && this.navParam['${calendarItem.getItemType()}'] && this.navParam['${calendarItem.getItemType()}'].navigateContext && Object.keys(this.navParam['${calendarItem.getItemType()}'].navigateContext).length >0){
let _context:any = this.$util.computedNavData(arg,tempContext,tempViewParam,this.navParam['${calendarItem.getItemType()}'].navigateContext);
Object.assign(tempContext,_context);
}
if(this.navParam && this.navParam['${calendarItem.getItemType()}'] && this.navParam['${calendarItem.getItemType()}'].navigateParams && Object.keys(this.navParam['${calendarItem.getItemType()}'].navigateParams).length >0){
let _params:any = this.$util.computedNavData(arg,tempContext,tempViewParam,this.navParam['${calendarItem.getItemType()}'].navigateParams);
Object.assign(tempViewParam,_params);
}
break;
</#if>
</#list>
</#if>
}
this.selection = {};
Object.assign(this.selection, { view: { viewname: this.navViewName[arg.itemType] }, context:tempContext,viewparam:tempViewParam });
this.calcToolbarItemState(false);
this.$emit('selectionchange',args);
this.$forceUpdate();
}
/**
* ${ctrl.name}的load完成事件
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public ${ctrl.name}_load(args:any, tag?: string, $event2?: any){
this.calcToolbarItemState(true);
this.$emit('load',args);
}
/**
* 设置导航区工具栏禁用状态
*
* @param {boolean} state
* @return {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public calcToolbarItemState(state: boolean) {
let _this: any = this;
const models:any = _this.${ctrl.getCodeName()?lower_case}_toolbarModels;
if (models) {
for (const key in models) {
if (!models.hasOwnProperty(key)) {
return;
}
const _item = models[key];
if (_item.uiaction && (Object.is(_item.uiaction.target, 'SINGLEKEY') || Object.is(_item.uiaction.target, 'MULTIKEY'))) {
_item.disabled = state;
}
_item.visabled = true;
if (_item.noprivdisplaymode && _item.noprivdisplaymode === 6) {
_item.visabled = false;
}
}
this.calcNavigationToolbarState();
}
}
/**
* 计算导航工具栏权限状态
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public calcNavigationToolbarState(){
let _this: any = this;
// 界面行为
<#assign ModelsName>${ctrl.getCodeName()?lower_case}_toolbarModels</#assign>
if(_this.${ModelsName}){
<#if ctrl.getPSAppDataEntity?? && ctrl.getPSAppDataEntity()??>
<#assign curAppEntity = ctrl.getPSAppDataEntity() />
const curUIService:${srfclassname('${curAppEntity.getCodeName()}')}UIService = new ${srfclassname('${curAppEntity.getCodeName()}')}UIService();
ViewTool.calcActionItemAuthState({},_this.${ModelsName},curUIService);
</#if>
}
}
/**
* 执行搜索
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public onSearch($event:any) {
<#if ctrl.getXDataPSControl()??>
<#assign xDataControl = ctrl.getXDataPSControl()/>
let calendar:any = this.$refs.${xDataControl.getName()};
calendar.searchEvents({ query: this.searchText });
</#if>
}
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/CONTROL/CONTROL-BASE.style.ftl
<template>
<#if ctrl.render??>
${ctrl.render.code}
<#else>
<div id="${ctrl.getCodeName()?lower_case}" class="app-calendar-exp-bar<#if ctrl.getPSSysCss?? && ctrl.getPSSysCss()??><#assign singleCss = ctrl.getPSSysCss()> ${singleCss.getCssName()}</#if>">
<#if ctrl.isShowTitleBar()>
<div class='calendar-exp-bar-header'>
<div class="calendar-exp-bar-title">
<icon type='ios-home-outline'/><#if ctrl.getTitle() == ''>{{ $t('app.calendarExpBar.title') }}<#else>${ctrl.getTitle()}</#if>
</div>
</div>
</#if>
<div class="exp-bar-action-container">
<#if ctrl.isEnableSearch()>
<div class='search-container'>
<i-input
v-model="searchText"
:search="true"
:placeholder="placeholder"
@on-search="onSearch">
</i-input>
</div>
</#if>
<#if ctrl.getPSControls()??>
<#assign controls = ctrl.getPSControls()/>
<#list controls as singleControl>
<#if singleControl.getControlType() == "TOOLBAR">
${P.getCtrlCode(singleControl, 'CONTROL.html').code}
</#if>
</#list>
</#if>
</div>
<div class='calendar-exp-bar-content'>
<#if ctrl.getPSControls()??>
<#assign controls = ctrl.getPSControls()/>
<#list controls as singleControl>
<#if singleControl.getControlType() == "CALENDAR">
${P.getCtrlCode(singleControl, 'CONTROL.html').code}
</#if>
</#list>
</#if>
</div>
</div>
</#if>
</template>
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/FUNC/MACRO.ftl
</#ibizinclude>
/**
* 视图唯一标识
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop() public viewUID!:string;
<#if view.getPSAppViewLogics?? && view.getPSAppViewLogics()??>
<#list view.getPSAppViewLogics() as logic>
<#if logic.getPFLogicCodeType() == 'APP_NEWDATA'>
/**
* 打开新建数据视图
*
* @type {any}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop() public newdata: any;
</#if>
<#if logic.getPFLogicCodeType() == 'APP_OPENDATA'>
/**
* 打开编辑数据视图
*
* @type {any}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop() public opendata: any;
</#if>
</#list>
</#if>
/**
* 是否单选
*
* @public
* @type {(boolean)}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public isSingleSelect:boolean = true;
/**
* 可搜索字段名称
*
*
* @type {(string)}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public placeholder = "<@getQuickSearchPlaceholder ctrl />";
/**
* 搜素值
*
* @public
* @type {(string)}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public searchText: string = "";
<#if ctrl.getXDataPSControl()??>
<#assign xDataControl = ctrl.getXDataPSControl() />
/**
* 导航视图名称
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public navViewName: any = {
<#if xDataControl.getPSSysCalendarItems()??>
<#list xDataControl.getPSSysCalendarItems() as calendarItem>
${calendarItem.getItemType()}: "<#if calendarItem.getNavPSAppView?? && calendarItem.getNavPSAppView()??><#assign navPSAppView = calendarItem.getNavPSAppView() />${srffilepath2(navPSAppView.getCodeName())}</#if>"<#if calendarItem_has_next>,</#if>
</#list>
</#if>
};
/**
* 导航参数
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public navParam: any = {
<#if xDataControl.getPSSysCalendarItems()??>
<#list xDataControl.getPSSysCalendarItems() as calendarItem>
${calendarItem.getItemType()}: {
navigateContext:<#if calendarItem.getPSNavigateContexts?? && calendarItem.getPSNavigateContexts()??><@getNavigateContext calendarItem /><#else>null</#if>,
navigateParams:<#if calendarItem.getPSNavigateParams?? && calendarItem.getPSNavigateParams()??><@getNavigateParams calendarItem /><#else>null</#if>
}<#if calendarItem_has_next>,</#if>
</#list>
</#if>
};
/**
* 导航过滤项
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public navFilter: any = {
<#if xDataControl.getPSSysCalendarItems()??>
<#list xDataControl.getPSSysCalendarItems() as calendarItem>
${calendarItem.getItemType()}: "<#if calendarItem.getNavFilter?? && calendarItem.getNavFilter()??>${calendarItem.getNavFilter()}</#if>"<#if calendarItem_has_next>,</#if>
</#list>
</#if>
};
/**
* 导航关系
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public navPSDer: any = {
<#if xDataControl.getPSSysCalendarItems()??>
<#list xDataControl.getPSSysCalendarItems() as calendarItem>
${calendarItem.getItemType()}: "<#if calendarItem.getNavPSDER?? && calendarItem.getNavPSDER()??>n_${calendarItem.getNavPSDER().getPSPickupDEField().getCodeName()?lower_case}_eq</#if>"<#if calendarItem_has_next>,</#if>
</#list>
</#if>
};
</#if>
/**
* 显示处理提示
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop({ default: true }) public showBusyIndicator!: boolean;
<#if ctrl.getPSControls()??>
<#assign controls = ctrl.getPSControls()/>
<#list controls as singleControl>
<#if singleControl.getControlType() == "TOOLBAR">
${P.getCtrlCode(singleControl, 'CONTROL.vue').code}
</#if>
</#list>
</#if>
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public getData(): any {
return null;
}
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public afterCreated(){
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if (!Object.is(tag, this.name)) {
return;
}
<#if ctrl.getXDataPSControl?? && ctrl.getXDataPSControl()??>
<#assign xDataControl = ctrl.getXDataPSControl() />
this.viewState.next({ tag: '${xDataControl.getName()}', action: action, data: data });
</#if>
});
}
}
/**
* Vue声明周期(组件渲染完毕)
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public mounted() {
this.afterMounted();
}
/**
* 执行mounted后的逻辑
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public afterMounted() { }
/**
* vue 生命周期
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
<#if destroyed_block??>
${destroyed_block}
</#if>
}
/**
* 刷新
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public refresh(args?: any): void {
<#if ctrl.getXDataPSControl?? && ctrl.getXDataPSControl()??>
<#assign dataControl = ctrl.getXDataPSControl() />
const refs: any = this.$refs;
if (refs && refs.${dataControl.name}) {
refs.${dataControl.name}.refresh();
}
</#if>
}
/**
* ${ctrl.name}的选中数据事件
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public ${ctrl.name}_selectionchange(args: any [], tag?: string, $event2?: any): void {
let tempContext:any = {};
let tempViewParam:any = {};
if (args.length === 0) {
this.calcToolbarItemState(true);
return ;
}
const arg:any = args[0];
if(this.context){
Object.assign(tempContext,JSON.parse(JSON.stringify(this.context)));
}
switch(arg.itemType) {
<#if xDataControl?? && xDataControl.getPSSysCalendarItems()??>
<#list xDataControl.getPSSysCalendarItems() as calendarItem>
<#if calendarItem.getPSAppDataEntity()??>
<#assign _appde = calendarItem.getPSAppDataEntity() />
case "${calendarItem.getItemType()}":
Object.assign(tempContext,{ ${_appde.getCodeName()?lower_case} : arg.${_appde.getCodeName()?lower_case}});
Object.assign(tempContext,{srfparentdename:'${_appde.getCodeName()}',srfparentkey:arg['${_appde.getCodeName()?lower_case}']});
if(this.navFilter && this.navFilter['${calendarItem.getItemType()}'] && !Object.is(this.navFilter['${calendarItem.getItemType()}'],"")){
Object.assign(tempViewParam,{[this.navFilter['${calendarItem.getItemType()}']]:arg['${_appde.getCodeName()?lower_case}']});
}
if(this.navPSDer && this.navFilter['${calendarItem.getItemType()}'] && !Object.is(this.navPSDer['${calendarItem.getItemType()}'],"")){
Object.assign(tempViewParam,{[this.navPSDer['${calendarItem.getItemType()}']]:arg['${_appde.getCodeName()?lower_case}']});
}
if(this.navParam && this.navParam['${calendarItem.getItemType()}'] && this.navParam['${calendarItem.getItemType()}'].navigateContext && Object.keys(this.navParam['${calendarItem.getItemType()}'].navigateContext).length >0){
let _context:any = this.$util.computedNavData(arg,tempContext,tempViewParam,this.navParam['${calendarItem.getItemType()}'].navigateContext);
Object.assign(tempContext,_context);
}
if(this.navParam && this.navParam['${calendarItem.getItemType()}'] && this.navParam['${calendarItem.getItemType()}'].navigateParams && Object.keys(this.navParam['${calendarItem.getItemType()}'].navigateParams).length >0){
let _params:any = this.$util.computedNavData(arg,tempContext,tempViewParam,this.navParam['${calendarItem.getItemType()}'].navigateParams);
Object.assign(tempViewParam,_params);
}
break;
</#if>
</#list>
</#if>
}
const navItem: any = {
navView: this.navViewName,
data: args,
srfnavdata: {
context: tempContext,
viewparams: tempViewParam
}
}
this.calcToolbarItemState(false);
this.$emit('selectionchange', navItem);
}
/**
* ${ctrl.name}的load完成事件
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public ${ctrl.name}_load(args:any, tag?: string, $event2?: any){
this.calcToolbarItemState(true);
this.$emit('load',args);
}
/**
* 设置导航区工具栏禁用状态
*
* @param {boolean} state
* @return {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public calcToolbarItemState(state: boolean) {
let _this: any = this;
const models:any = _this.${ctrl.getCodeName()?lower_case}_toolbarModels;
if (models) {
for (const key in models) {
if (!models.hasOwnProperty(key)) {
return;
}
const _item = models[key];
if (_item.uiaction && (Object.is(_item.uiaction.target, 'SINGLEKEY') || Object.is(_item.uiaction.target, 'MULTIKEY'))) {
_item.disabled = state;
}
_item.visabled = true;
if (_item.noprivdisplaymode && _item.noprivdisplaymode === 6) {
_item.visabled = false;
}
}
this.calcNavigationToolbarState();
}
}
/**
* 计算导航工具栏权限状态
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public calcNavigationToolbarState(){
let _this: any = this;
// 界面行为
<#assign ModelsName>${ctrl.getCodeName()?lower_case}_toolbarModels</#assign>
if(_this.${ModelsName}){
<#if ctrl.getPSAppDataEntity?? && ctrl.getPSAppDataEntity()??>
<#assign curAppEntity = ctrl.getPSAppDataEntity() />
const curUIService:${srfclassname('${curAppEntity.getCodeName()}')}UIService = new ${srfclassname('${curAppEntity.getCodeName()}')}UIService();
ViewTool.calcActionItemAuthState({},_this.${ModelsName},curUIService);
</#if>
}
}
/**
* 执行搜索
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public onSearch($event:any) {
<#if ctrl.getXDataPSControl()??>
<#assign xDataControl = ctrl.getXDataPSControl()/>
let calendar:any = this.$refs.${xDataControl.getName()};
calendar.searchEvents({ query: this.searchText });
</#if>
}
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/CONTROL/CONTROL-BASE.style.ftl
</#ibizinclude>
\ No newline at end of file
.app-calendar-exp-bar {
> .ivu-split-horizontal {
> .ivu-split-trigger-con {
height: 100%;
width: 1px;
}
> .ivu-split-pane {
> div {
height: 100%;
overflow: auto;
display: flex;
flex-direction: column;
.calendar-exp-bar-header {
line-height: 50px;
border-bottom: 1px solid #ddd;
.calendar-exp-bar-title {
font-size: 18px;
padding-left: 8px;
i {
font-size: 20px;
margin-top: -2px;
}
}
}
.container-header{
display: flex;
justify-content: flex-start;
align-items: center;
flex-wrap: wrap;
.quick-group-container {
padding-top: 8px;
padding-right: 20px;
}
.search-container {
width: 30%;
height: 48px;
padding: 10px;
min-width: 200px;
max-width: 400px;
}
.toolbar-container{
padding: 4px;
display: flex;
flex-wrap: wrap;
align-items: center;
}
}
.calendar-exp-bar-content {
<#-- 计算高度 -->
<#if ctrl.isShowTitleBar() && ctrl.isEnableSearch()>
height: calc(100% - 88px);
<#elseif ctrl.isShowTitleBar() && !ctrl.isEnableSearch()>
height: calc(100% - 40px);
<#elseif !ctrl.isShowTitleBar() && ctrl.isEnableSearch()>
height: calc(100% - 38px);
<#else>
height: 100%;
</#if>
overflow: auto;
padding: 16px 0;
margin-bottom: 10px;
}
.calendar-exp-bar-content2 {
height: 100%;
overflow: auto;
flex-grow: 1;
}
}
}
> .right-pane.ivu-split-pane {
> div {
padding-left: 10px;
}
}
> .left-pane.ivu-split-pane {
padding-right: 10px;
}
}
> .ivu-split-vertical{
> .ivu-split-pane {
> div {
height: 100%;
overflow: auto;
display: flex;
flex-direction: column;
.calendar-exp-bar-header {
line-height: 50px;
border-bottom: 1px solid #ddd;
.calendar-exp-bar-title {
font-size: 18px;
padding-left: 8px;
i {
font-size: 20px;
margin-top: -2px;
}
}
}
.container-header{
display: flex;
justify-content: flex-start;
align-items: center;
flex-wrap: wrap;
.quick-group-container {
padding-top: 8px;
padding-right: 20px;
}
.search-container {
width: 30%;
height: 48px;
padding: 10px 10px 10px 0;
min-width: 200px;
max-width: 400px;
}
.toolbar-container{
padding: 4px;
}
}
.calendar-exp-bar-content {
<#-- 计算高度 -->
<#if ctrl.isShowTitleBar() && ctrl.isEnableSearch()>
height: calc(100% - 88px);
<#elseif ctrl.isShowTitleBar() && !ctrl.isEnableSearch()>
height: calc(100% - 40px);
<#elseif !ctrl.isShowTitleBar() && ctrl.isEnableSearch()>
height: calc(100% - 38px);
<#else>
height: 100%;
</#if>
overflow: auto;
margin-bottom: 10px;
}
.calendar-exp-bar-content2 {
height: 100%;
overflow: auto;
flex-grow: 1;
}
}
}
> .top-pane.ivu-split-pane {
> div {
padding-bottom: 10px;
}
}
> .bottom-pane.ivu-split-pane {
padding-top: 10px;
}
}
}
<#ibizinclude>
../@MACRO/CSS/DEFAULT.less.ftl
.app-calendar-exp-bar {
height: 100%;
display: flex;
flex-direction: column;
.calendar-exp-bar-header {
line-height: 50px;
border-bottom: 1px solid #ddd;
.calendar-exp-bar-title {
font-size: 18px;
padding-left: 8px;
i {
font-size: 20px;
margin-top: -2px;
}
}
}
.exp-bar-action-container {
display: flex;
align-items: center;
}
.container-header{
display: flex;
justify-content: flex-start;
align-items: center;
flex-wrap: wrap;
.search-container {
width: 30%;
height: 48px;
padding: 10px 10px 10px 0;
min-width: 200px;
max-width: 400px;
}
.toolbar-container{
padding: 4px;
}
.quick-group-container {
padding-top: 8px;
padding-right: 20px;
}
}
.calendar-exp-bar-content {
flex-grow: 1;
overflow: auto;
}
}
<#ibizinclude>
../@MACRO/CSS/DEFAULT.less.ftl
</#ibizinclude>
\ No newline at end of file
<template>
<#if ctrl.render??>
${ctrl.render.code}
<#else>
<split id="${ctrl.getCodeName()?lower_case}" class='app-tree-exp-bar<#if ctrl.getPSSysCss?? && ctrl.getPSSysCss()??><#assign singleCss = ctrl.getPSSysCss()> ${singleCss.getCssName()}</#if>' v-model="split" mode="horizontal" @on-move-end="onSplitChange">
<div slot='left'>
<#if ctrl.isShowTitleBar()>
<div class='tree-exp-bar-header'>
<div class="tree-exp-bar-title">
<icon type='ios-home-outline'/><#if ctrl.getTitle() == ''>{{ $t('app.treeExpBar.title') }}<#else>${ctrl.getTitle()}</#if>
</div>
<#if ctrl.getPSControls()??>
<#assign controls = ctrl.getPSControls()/>
<#list controls as singleControl>
<#if singleControl.getControlType() == "TOOLBAR">
${P.getCtrlCode(singleControl, 'CONTROL.html').code}
</#if>
</#list>
</#if>
</div>
</#if>
<#if ctrl.isEnableSearch()>
<div class='search-content'>
<i-input :search="true"
@on-change="($event) => { this.srfnodefilter = $event.target.value; }"
:placeholder="placeholder"
@on-search="onSearch">
</i-input>
</div>
</#if>
<div class='<#if ctrl.isShowTitleBar()>tree-exp-content<#else>tree-exp-content2</#if>'>
<#if ctrl.getPSDETree()??><#t>
<#assign tree = ctrl.getPSDETree()/>
<@ibizindent blank=12>
${P.getCtrlCode(tree, 'CONTROL.html').code}
</@ibizindent>
</#if>
</div>
</div>
<div slot='right'>
<component
v-if="selection.view && !Object.is(this.selection.view.viewname, '')"
:is="selection.view.viewname"
class="viewcontainer2"
:viewDefaultUsage="false"
:viewdata="JSON.stringify(selection.context)"
:viewparam="JSON.stringify(selection.viewparam)"
@viewdataschange="onViewDatasChange"
@drdatasaved="onDrViewDatasChange"
@drdatasremove="onDrViewDatasChange"
@viewdatasactivated="viewDatasActivated"
@viewload="onViewLoad">
</component>
</div>
</split>
</#if>
</template>
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/FUNC/MACRO.ftl
</#ibizinclude>
<#if view.getPSAppViewLogics?? && view.getPSAppViewLogics()??>
<#list view.getPSAppViewLogics() as logic>
<#if logic.getPFLogicCodeType() == 'APP_NEWDATA'>
/**
* 打开新建数据视图
*
* @type {any}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop() public newdata: any;
</#if>
<#if logic.getPFLogicCodeType() == 'APP_OPENDATA'>
/**
* 打开编辑数据视图
*
* @type {any}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop() public opendata: any;
</#if>
</#list>
</#if>
/**
* 视图唯一标识
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop() public viewUID!:string;
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public getData(): any {
return {};
}
/**
* 选中数据
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public selection: any = {};
/**
* 控件宽度
*
* @type {number}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public ctrlWidth:number = <#if ctrl.getWidth()??>${ctrl.getWidth()?c}<#else>0</#if>;
/**
* 可搜索字段名称
*
*
* @type {(string)}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public placeholder="<@getQuickSearchPlaceholder ctrl />";
/**
* 过滤值
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public srfnodefilter: string = '';
/**
* 刷新标识
*
* @public
* @type {number}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public counter:number = 0;
/**
* 是否加载默认关联视图
*
* @public
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public istLoadDefaultRefView: boolean = false;
/**
* 分割宽度
*
* @type {number}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public split: number = 0.2;
/**
* split值变化事件
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public onSplitChange() {
if(this.split){
this.$store.commit("setViewSplit",{viewUID:this.viewUID,viewSplit:this.split});
}
}
/**
* 获取关系项视图
*
* @param {*} [arg={}]
* @returns {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public getExpItemView(arg: any = {}): any {
let expmode = arg.nodetype.toUpperCase();
if (!expmode) {
expmode = '';
}
<#list ctrl.getPSAppViewRefs() as item>
<#if (item.getName()?index_of("EXPITEM:")==0)>
<#assign refview = item.getRefPSAppView()>
if (Object.is(expmode, '${item.getName()?substring(8)?upper_case}')) {
return {
viewname: '${srffilepath2(refview.codeName)}',
parentdata: <#if item.getParentDataJO()??>${item.getParentDataJO()},<#else>{},</#if>
<#if refview.getPSAppDataEntity?? && refview.getPSAppDataEntity()??>
deKeyField:'${refview.getPSAppDataEntity().codeName?lower_case}'
</#if>
};
}
</#if>
</#list>
return null;
}
/**
* 树导航选中
*
* @param {any []} args
* @param {string} [tag]
* @param {*} [$event2]
* @returns {void}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public ${ctrl.name}_selectionchange(args: any [], tag?: string, $event2?: any): void {
if (args.length === 0) {
this.calcToolbarItemState(true);
return ;
}
const arg:any = args[0];
if (!arg.id) {
this.calcToolbarItemState(true);
return;
}
const nodetype = arg.id.split(';')[0];
const refview = this.getExpItemView({ nodetype: nodetype });
if (!refview) {
this.calcToolbarItemState(true);
return;
}
let tempViewparam:any = {};
let tempContext:any ={};
if(arg && arg.navfilter){
this.counter += 1;
Object.defineProperty(tempViewparam, arg.navfilter, {
value : arg.srfkey,
writable : true,
enumerable : true,
configurable : true
})
Object.assign(tempContext,{srfcounter:this.counter});
}
Object.assign(tempContext,JSON.parse(JSON.stringify(this.context)));
if(arg.srfappctx){
Object.assign(tempContext,JSON.parse(JSON.stringify(arg.srfappctx)));
}
// 计算导航上下文
if(arg && arg.navigateContext && Object.keys(arg.navigateContext).length >0){
let tempData:any = arg.curData?JSON.parse(JSON.stringify(arg.curData)):{};
Object.assign(tempData,arg);
let _context = this.$util.computedNavData(tempData,tempContext,tempViewparam,arg.navigateContext);
Object.assign(tempContext,_context);
}
if(arg.srfparentdename){
Object.assign(tempContext,{srfparentdename:arg.srfparentdename});
}
if(arg.srfparentkey){
Object.assign(tempContext,{srfparentkey:arg.srfparentkey});
}
// 计算导航参数
if(arg && arg.navigateParams && Object.keys(arg.navigateParams).length >0){
let tempData:any = arg.curData?JSON.parse(JSON.stringify(arg.curData)):{};
Object.assign(tempData,arg);
let _params = this.$util.computedNavData(tempData,tempContext,tempViewparam,arg.navigateParams);
Object.assign(tempViewparam,_params);
this.counter += 1;
Object.assign(tempContext,{srfcounter:this.counter});
}
this.selection = {};
Object.assign(this.selection, { view: { viewname: refview.viewname } });
Object.assign(this.selection,{'viewparam':tempViewparam,'context':tempContext});
this.calcToolbarItemState(false);
this.$forceUpdate();
}
/**
* 树加载完成
*
* @param {any[]} args
* @param {string} [tag]
* @param {*} [$event2]
* @returns {void}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public ${ctrl.name}_load(args: any[], tag?: string, $event2?: any): void {
this.calcToolbarItemState(true);
this.$emit('load',args);
}
/**
* 执行搜索
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public onSearch(): void {
if (!this.viewState) {
return;
}
<#if ctrl.getPSDETree()??>
<#assign tree = ctrl.getPSDETree()/>
this.istLoadDefaultRefView = false;
this.viewState.next({ tag: '${tree.name}', action: 'filter', data: { srfnodefilter: this.srfnodefilter } });
</#if>
}
/**
* vue 声明周期
*
* @memberof @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public afterCreated(){
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if (!Object.is(tag, this.name)) {
return;
}
<#if ctrl.getPSDETree()??>
<#assign tree = ctrl.getPSDETree()/>
this.istLoadDefaultRefView = false;
this.viewState.next({ tag: '${tree.name}', action: action, data: data });
</#if>
});
}
}
/**
* Vue声明周期(组件渲染完毕)
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public mounted() {
this.afterMounted();
}
/**
* 执行mounted后的逻辑
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public afterMounted(){
if(this.$store.getters.getViewSplit(this.viewUID)){
this.split = this.$store.getters.getViewSplit(this.viewUID);
}else{
let containerWidth:number = (document.getElementById("${ctrl.getCodeName()?lower_case}") as any).offsetWidth;
if(this.ctrlWidth && containerWidth != 0){
this.split = this.ctrlWidth/containerWidth;
}
this.$store.commit("setViewSplit",{viewUID:this.viewUID,viewSplit:this.split});
}
}
/**
* vue 生命周期
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
<#if destroyed_block??>
${destroyed_block}
</#if>
}
/**
* 视图数据变化
*
* @param {*} $event
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public onViewDatasChange($event: any): void {
this.$emit('selectionchange', $event);
}
/**
* 视图数据变化
*
* @param {*} $event
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public onDrViewDatasChange($event: any): void {
<#if ctrl.getPSDETree()??>
<#assign tree = ctrl.getPSDETree()/>
this.viewState.next({ tag: '${tree.name}', action: 'refresh_parent' });
</#if>
}
/**
* 视图数据被激活
*
* @param {*} $event
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public viewDatasActivated($event: any): void {
this.$emit('activated', $event);
}
/**
* 视图数据加载完成
*
* @param {*} $event
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public onViewLoad($event: any): void {
this.$emit('load', $event);
}
/**
* 设置导航区工具栏禁用状态
*
* @param {boolean} state
* @return {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public calcToolbarItemState(state: boolean) {
let _this: any = this;
const models:any = _this.${ctrl.getCodeName()?lower_case}_toolbarModels;
if (models) {
for (const key in models) {
if (!models.hasOwnProperty(key)) {
return;
}
const _item = models[key];
if (_item.uiaction && (Object.is(_item.uiaction.target, 'SINGLEKEY') || Object.is(_item.uiaction.target, 'MULTIKEY'))) {
_item.disabled = state;
}
_item.visabled = true;
if (_item.noprivdisplaymode && _item.noprivdisplaymode === 6) {
_item.visabled = false;
}
}
this.calcNavigationToolbarState();
}
}
/**
* 计算导航工具栏权限状态
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public calcNavigationToolbarState(){
let _this: any = this;
// 界面行为
<#assign ModelsName>${ctrl.getCodeName()?lower_case}_toolbarModels</#assign>
if(_this.${ModelsName}){
<#if ctrl.getPSAppDataEntity?? && ctrl.getPSAppDataEntity()??>
<#assign curAppEntity = ctrl.getPSAppDataEntity() />
const curUIService:${srfclassname('${curAppEntity.getCodeName()}')}UIService = new ${srfclassname('${curAppEntity.getCodeName()}')}UIService();
ViewTool.calcActionItemAuthState({},_this.${ModelsName},curUIService);
</#if>
}
}
<#if ctrl.getPSControls()??>
<#assign controls = ctrl.getPSControls()/>
<#list controls as singleControl>
<#if singleControl.getControlType() == "TOOLBAR">
${P.getCtrlCode(singleControl, 'CONTROL.vue').code}
</#if>
</#list>
</#if>
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/CONTROL/CONTROL-BASE.style.ftl
</#ibizinclude>
<template>
<#if ctrl.render??>
${ctrl.render.code}
<#else>
<div id="${ctrl.getCodeName()?lower_case}" class='app-tree-exp-bar<#if ctrl.getPSSysCss?? && ctrl.getPSSysCss()??><#assign singleCss = ctrl.getPSSysCss()> ${singleCss.getCssName()}</#if>'>
<#if ctrl.isShowTitleBar()>
<div class='tree-exp-bar-header'>
<div class="tree-exp-bar-title">
<icon type='ios-home-outline'/><#if ctrl.getTitle() == ''>{{ $t('app.treeExpBar.title') }}<#else>${ctrl.getTitle()}</#if>
</div>
<#if ctrl.getPSControls()??>
<#assign controls = ctrl.getPSControls()/>
<#list controls as singleControl>
<#if singleControl.getControlType() == "TOOLBAR">
${P.getCtrlCode(singleControl, 'CONTROL.html').code}
</#if>
</#list>
</#if>
</div>
</#if>
<#if ctrl.isEnableSearch()>
<div class='search-content'>
<i-input
v-model="srfnodefilter"
:search="true"
:placeholder="placeholder"
@on-search="onSearch">
</i-input>
</div>
</#if>
<div class='tree-exp-content'>
<#if ctrl.getPSDETree()??><#t>
<#assign tree = ctrl.getPSDETree()/>
<@ibizindent blank=12>
${P.getCtrlCode(tree, 'CONTROL.html').code}
</@ibizindent>
</#if>
</div>
</div>
</#if>
</template>
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/FUNC/MACRO.ftl
</#ibizinclude>
<#if view.getPSAppViewLogics?? && view.getPSAppViewLogics()??>
<#list view.getPSAppViewLogics() as logic>
<#if logic.getPFLogicCodeType() == 'APP_NEWDATA'>
/**
* 打开新建数据视图
*
* @type {any}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop() public newdata: any;
</#if>
<#if logic.getPFLogicCodeType() == 'APP_OPENDATA'>
/**
* 打开编辑数据视图
*
* @type {any}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop() public opendata: any;
</#if>
</#list>
</#if>
/**
* 视图唯一标识
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop() public viewUID!:string;
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public getData(): any {
return {};
}
/**
* 可搜索字段名称
*
*
* @type {(string)}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public placeholder = "<@getQuickSearchPlaceholder ctrl />";
/**
* 过滤值
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public srfnodefilter: string = '';
/**
* 刷新标识
*
* @public
* @type {number}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public counter:number = 0;
/**
* 是否加载默认关联视图
*
* @public
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public istLoadDefaultRefView: boolean = false;
/**
* 获取关系项视图
*
* @param {*} [arg={}]
* @returns {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public getExpItemView(arg: any = {}): any {
let expmode = arg.nodetype.toUpperCase();
if (!expmode) {
expmode = '';
}
<#list ctrl.getPSAppViewRefs() as item>
<#if (item.getName()?index_of("EXPITEM:")==0)>
<#assign refview = item.getRefPSAppView()>
if (Object.is(expmode, '${item.getName()?substring(8)?upper_case}')) {
return {
viewname: '${srffilepath2(refview.codeName)}',
parentdata: <#if item.getParentDataJO()??>${item.getParentDataJO()},<#else>{},</#if>
<#if refview.getPSAppDataEntity?? && refview.getPSAppDataEntity()??>
deKeyField:'${refview.getPSAppDataEntity().codeName?lower_case}'
</#if>
};
}
</#if>
</#list>
return null;
}
/**
* 树导航选中
*
* @param {any []} args
* @param {string} [tag]
* @param {*} [$event2]
* @returns {void}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public ${ctrl.name}_selectionchange(args: any [], tag?: string, $event2?: any): void {
if (args.length === 0) {
this.calcToolbarItemState(true);
return ;
}
const arg:any = args[0];
if (!arg.id) {
this.calcToolbarItemState(true);
return;
}
const nodetype = arg.id.split(';')[0];
const refview = this.getExpItemView({ nodetype: nodetype });
if (!refview) {
this.calcToolbarItemState(true);
return;
}
let tempViewparam:any = {};
let tempContext:any ={};
if(arg && arg.navfilter){
this.counter += 1;
Object.defineProperty(tempViewparam, arg.navfilter, {
value : arg.srfkey,
writable : true,
enumerable : true,
configurable : true
})
Object.assign(tempContext,{srfcounter:this.counter});
}
Object.assign(tempContext,JSON.parse(JSON.stringify(this.context)));
if(arg.srfappctx){
Object.assign(tempContext,JSON.parse(JSON.stringify(arg.srfappctx)));
}
// 计算导航上下文
if(arg && arg.navigateContext && Object.keys(arg.navigateContext).length >0){
let tempData:any = arg.curData?JSON.parse(JSON.stringify(arg.curData)):{};
Object.assign(tempData,arg);
let _context = this.$util.computedNavData(tempData,tempContext,tempViewparam,arg.navigateContext);
Object.assign(tempContext,_context);
}
if(arg.srfparentdename){
Object.assign(tempContext,{srfparentdename:arg.srfparentdename});
}
if(arg.srfparentkey){
Object.assign(tempContext,{srfparentkey:arg.srfparentkey});
}
// 计算导航参数
if(arg && arg.navigateParams && Object.keys(arg.navigateParams).length >0){
let tempData:any = arg.curData?JSON.parse(JSON.stringify(arg.curData)):{};
Object.assign(tempData,arg);
let _params = this.$util.computedNavData(tempData,tempContext,tempViewparam,arg.navigateParams);
Object.assign(tempViewparam,_params);
this.counter += 1;
Object.assign(tempContext,{srfcounter:this.counter});
}
const navItem: any = {
navView: this.navViewName,
data: args,
srfnavdata: {
context: tempContext,
viewparams: tempViewParam
}
}
this.calcToolbarItemState(false);
this.$emit('selectionchange', navItem);
}
/**
* 树加载完成
*
* @param {any[]} args
* @param {string} [tag]
* @param {*} [$event2]
* @returns {void}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public ${ctrl.name}_load(args: any[], tag?: string, $event2?: any): void {
this.calcToolbarItemState(true);
this.$emit('load',args);
}
/**
* 执行搜索
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public onSearch(): void {
if (!this.viewState) {
return;
}
<#if ctrl.getPSDETree()??>
<#assign tree = ctrl.getPSDETree()/>
this.istLoadDefaultRefView = false;
this.viewState.next({ tag: '${tree.name}', action: 'filter', data: { srfnodefilter: this.srfnodefilter } });
</#if>
}
/**
* vue 声明周期
*
* @memberof @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public afterCreated() {
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if (!Object.is(tag, this.name)) {
return;
}
<#if ctrl.getPSDETree()??>
<#assign tree = ctrl.getPSDETree()/>
this.istLoadDefaultRefView = false;
this.viewState.next({ tag: '${tree.name}', action: action, data: data });
</#if>
});
}
}
/**
* Vue声明周期(组件渲染完毕)
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public mounted() {
this.afterMounted();
}
/**
* 执行mounted后的逻辑
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public afterMounted() { }
/**
* vue 生命周期
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
<#if destroyed_block??>
${destroyed_block}
</#if>
}
/**
* 视图数据变化
*
* @param {*} $event
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public onViewDatasChange($event: any): void {
this.$emit('selectionchange', $event);
}
/**
* 视图数据变化
*
* @param {*} $event
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public onDrViewDatasChange($event: any): void {
<#if ctrl.getPSDETree()??>
<#assign tree = ctrl.getPSDETree()/>
this.viewState.next({ tag: '${tree.name}', action: 'refresh_parent' });
</#if>
}
/**
* 视图数据被激活
*
* @param {*} $event
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public viewDatasActivated($event: any): void {
this.$emit('activated', $event);
}
/**
* 视图数据加载完成
*
* @param {*} $event
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public onViewLoad($event: any): void {
this.$emit('load', $event);
}
/**
* 设置导航区工具栏禁用状态
*
* @param {boolean} state
* @return {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public calcToolbarItemState(state: boolean) {
let _this: any = this;
const models:any = _this.${ctrl.getCodeName()?lower_case}_toolbarModels;
if (models) {
for (const key in models) {
if (!models.hasOwnProperty(key)) {
return;
}
const _item = models[key];
if (_item.uiaction && (Object.is(_item.uiaction.target, 'SINGLEKEY') || Object.is(_item.uiaction.target, 'MULTIKEY'))) {
_item.disabled = state;
}
_item.visabled = true;
if (_item.noprivdisplaymode && _item.noprivdisplaymode === 6) {
_item.visabled = false;
}
}
this.calcNavigationToolbarState();
}
}
/**
* 计算导航工具栏权限状态
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public calcNavigationToolbarState(){
let _this: any = this;
// 界面行为
<#assign ModelsName>${ctrl.getCodeName()?lower_case}_toolbarModels</#assign>
if(_this.${ModelsName}){
<#if ctrl.getPSAppDataEntity?? && ctrl.getPSAppDataEntity()??>
<#assign curAppEntity = ctrl.getPSAppDataEntity() />
const curUIService:${srfclassname('${curAppEntity.getCodeName()}')}UIService = new ${srfclassname('${curAppEntity.getCodeName()}')}UIService();
ViewTool.calcActionItemAuthState({},_this.${ModelsName},curUIService);
</#if>
}
}
<#if ctrl.getPSControls()??>
<#assign controls = ctrl.getPSControls()/>
<#list controls as singleControl>
<#if singleControl.getControlType() == "TOOLBAR">
${P.getCtrlCode(singleControl, 'CONTROL.vue').code}
</#if>
</#list>
</#if>
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/CONTROL/CONTROL-BASE.style.ftl
</#ibizinclude>
<div class="view-container ${view.getViewType()?lower_case} ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>">
<app-studioaction :viewTitle="$t(model.srfCaption)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<card class='view-card <#if !view.isShowCaptionBar()> view-no-caption</#if> <#if !view.hasPSControl('toolbar')> view-no-toolbar</#if>' :dis-hover="true" :bordered="false">
<#ibizinclude>
../@MACRO/VIEW_CAPTION_DATAINFO.vue.ftl
</#ibizinclude>
<#-- BEGIN:视图顶部视图消息 -->
<@ibizindent blank=8>
<#ibizinclude>
../@MACRO/View_Pos_Top_Msgs.vue.ftl
</#ibizinclude>
</@ibizindent>
<#-- END:视图顶部视图消息 -->
<div class="content-container">
<#-- BEGIN:视图内容区视图消息 -->
<@ibizindent blank=8>
<#ibizinclude>
../@MACRO/View_Pos_Body_Msgs.vue.ftl
</#ibizinclude>
</@ibizindent>
<#-- END:视图内容区视图消息 -->
<#if view.hasPSControl('dataviewexpbar')>
${P.getCtrlCode('dataviewexpbar', 'CONTROL.html').code}
</#if>
</div>
<#-- BEGIN:视图底部视图消息 -->
<@ibizindent blank=8>
<#ibizinclude>
../@MACRO/View_Pos_Bottom_Msgs.vue.ftl
</#ibizinclude>
</@ibizindent>
<#-- END:视图底部视图消息 -->
</card>
<div class="view-container ${view.getViewType()?lower_case} ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>">
<app-studioaction :viewTitle="$t(model.srfCaption)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<card class='view-card <#if !view.isShowCaptionBar()> view-no-caption</#if> <#if !view.hasPSControl('toolbar')> view-no-toolbar</#if>' :dis-hover="true" :bordered="false">
<#ibizinclude>
../@MACRO/VIEW_CAPTION_DATAINFO.vue.ftl
</#ibizinclude>
<#-- BEGIN:视图顶部视图消息 -->
<@ibizindent blank=8>
<#ibizinclude>
../@MACRO/View_Pos_Top_Msgs.vue.ftl
</#ibizinclude>
</@ibizindent>
<#-- END:视图顶部视图消息 -->
<div class="content-container">
<#-- BEGIN:视图内容区视图消息 -->
<@ibizindent blank=8>
<#ibizinclude>
../@MACRO/View_Pos_Body_Msgs.vue.ftl
</#ibizinclude>
</@ibizindent>
<split v-model="split" mode="<#if view.getSideBarLayout()?? && view.getSideBarLayout() == "LEFT">horizontal<#else>vertical</#if>" @on-move-end="onSplitChange">
<template slot="<#if view.getSideBarLayout()?? && view.getSideBarLayout() == "LEFT">left<#else>top</#if>">
<#if view.hasPSControl('dataviewexpbar')>
${P.getCtrlCode('dataviewexpbar', 'CONTROL.html').code}
</#if>
</template>
<template slot="<#if view.getSideBarLayout()?? && view.getSideBarLayout() == "LEFT">right<#else>bottom</#if>">
<component
v-if="navItem && navItem.navView"
:is="navItem.navView"
:key="navItem.data && navItem.data.length ? navItem.data[0].srfkey : ''"
class="viewcontainer2"
:viewDefaultUsage="false"
:viewdata="JSON.stringify(navItem.srfnavdata.context)"
:viewparam="JSON.stringify(navItem.srfnavdata.viewparams)">
</component>
</template>
</split>
<#-- END:视图内容区视图消息 -->
</div>
<#-- BEGIN:视图底部视图消息 -->
<@ibizindent blank=8>
<#ibizinclude>
../@MACRO/View_Pos_Bottom_Msgs.vue.ftl
</#ibizinclude>
</@ibizindent>
<#-- END:视图底部视图消息 -->
</card>
</div>
\ No newline at end of file
<div class="view-container ${view.getViewType()?lower_case} ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>">
<app-studioaction :viewTitle="$t(model.srfCaption)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<card class='view-card <#if !view.isShowCaptionBar()> view-no-caption</#if> <#if !view.hasPSControl('toolbar')> view-no-toolbar</#if>' :dis-hover="true" :bordered="false">
<#ibizinclude>
../@MACRO/VIEW_CAPTION_DATAINFO.vue.ftl
</#ibizinclude>
<#-- BEGIN:视图顶部视图消息 -->
<@ibizindent blank=8>
<#ibizinclude>
../@MACRO/View_Pos_Top_Msgs.vue.ftl
</#ibizinclude>
</@ibizindent>
<#-- END:视图顶部视图消息 -->
<div class="content-container">
<#-- BEGIN:视图内容区视图消息 -->
<@ibizindent blank=8>
<#ibizinclude>
../@MACRO/View_Pos_Body_Msgs.vue.ftl
</#ibizinclude>
</@ibizindent>
<#-- END:视图内容区视图消息 -->
<#if view.hasPSControl('calendarexpbar')>
${P.getCtrlCode('calendarexpbar', 'CONTROL.html').code}
</#if>
</div>
<#-- BEGIN:视图底部视图消息 -->
<@ibizindent blank=8>
<#ibizinclude>
../@MACRO/View_Pos_Bottom_Msgs.vue.ftl
</#ibizinclude>
</@ibizindent>
<#-- END:视图底部视图消息 -->
</card>
<div class="view-container ${view.getViewType()?lower_case} ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>">
<app-studioaction :viewTitle="$t(model.srfCaption)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<card class='view-card <#if !view.isShowCaptionBar()> view-no-caption</#if> <#if !view.hasPSControl('toolbar')> view-no-toolbar</#if>' :dis-hover="true" :bordered="false">
<#ibizinclude>
../@MACRO/VIEW_CAPTION_DATAINFO.vue.ftl
</#ibizinclude>
<#-- BEGIN:视图顶部视图消息 -->
<@ibizindent blank=8>
<#ibizinclude>
../@MACRO/View_Pos_Top_Msgs.vue.ftl
</#ibizinclude>
</@ibizindent>
<#-- END:视图顶部视图消息 -->
<div class="content-container">
<#-- BEGIN:视图内容区视图消息 -->
<@ibizindent blank=8>
<#ibizinclude>
../@MACRO/View_Pos_Body_Msgs.vue.ftl
</#ibizinclude>
</@ibizindent>
<split v-model="split" mode="<#if view.getSideBarLayout()?? && view.getSideBarLayout() == "LEFT">horizontal<#else>vertical</#if>" @on-move-end="onSplitChange">
<template slot="<#if view.getSideBarLayout()?? && view.getSideBarLayout() == "LEFT">left<#else>top</#if>">
<#if view.hasPSControl('calendarexpbar')>
${P.getCtrlCode('calendarexpbar', 'CONTROL.html').code}
</#if>
</template>
<template slot="<#if view.getSideBarLayout()?? && view.getSideBarLayout() == "LEFT">right<#else>bottom</#if>">
<component
v-if="navItem && navItem.navView"
:is="navItem.navView"
:key="navItem.data && navItem.data.length ? navItem.data[0].srfkey : ''"
class="viewcontainer2"
:viewDefaultUsage="false"
:viewdata="JSON.stringify(navItem.srfnavdata.context)"
:viewparam="JSON.stringify(navItem.srfnavdata.viewparams)">
</component>
</template>
</split>
</div>
<#-- END:视图内容区视图消息 -->
<#-- BEGIN:视图底部视图消息 -->
<@ibizindent blank=8>
<#ibizinclude>
../@MACRO/View_Pos_Bottom_Msgs.vue.ftl
</#ibizinclude>
</@ibizindent>
<#-- END:视图底部视图消息 -->
</card>
</div>
\ No newline at end of file
<div class='view-container ${view.getViewType()?lower_case} ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>'>
<app-studioaction :viewTitle="$t(model.srfCaption)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<card class='view-card <#if !view.isShowCaptionBar()> view-no-caption</#if> <#if !view.hasPSControl('toolbar')> view-no-toolbar</#if>' :dis-hover="true" :bordered="false">
<@ibizindent blank=8>
<#ibizinclude>
../@MACRO/VIEW_CAPTION_DATAINFO.vue.ftl
</#ibizinclude>
</@ibizindent>
<#-- BEGIN:视图顶部视图消息 -->
<@ibizindent blank=12>
<#ibizinclude>
../@MACRO/View_Pos_Top_Msgs.vue.ftl
</#ibizinclude>
</@ibizindent>
<#-- END:视图顶部视图消息 -->
<div class='content-container'>
<#-- BEGIN:视图内容区视图消息 -->
<@ibizindent blank=8>
<#ibizinclude>
../@MACRO/View_Pos_Body_Msgs.vue.ftl
</#ibizinclude>
</@ibizindent>
<#-- END:视图内容区视图消息 -->
<#if view.hasPSControl('treeexpbar')>
<@ibizindent blank=12>
${P.getCtrlCode('treeexpbar', 'CONTROL.html').code}<#t>
</@ibizindent>
</#if>
</div>
<#-- BEGIN:视图底部视图消息 -->
<@ibizindent blank=12>
<#ibizinclude>
../@MACRO/View_Pos_Bottom_Msgs.vue.ftl
</#ibizinclude>
</@ibizindent>
<#-- END:视图底部视图消息 -->
</card>
<div class='view-container ${view.getViewType()?lower_case} ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>'>
<app-studioaction :viewTitle="$t(model.srfCaption)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<card class='view-card <#if !view.isShowCaptionBar()> view-no-caption</#if> <#if !view.hasPSControl('toolbar')> view-no-toolbar</#if>' :dis-hover="true" :bordered="false">
<@ibizindent blank=8>
<#ibizinclude>
../@MACRO/VIEW_CAPTION_DATAINFO.vue.ftl
</#ibizinclude>
</@ibizindent>
<#-- BEGIN:视图顶部视图消息 -->
<@ibizindent blank=12>
<#ibizinclude>
../@MACRO/View_Pos_Top_Msgs.vue.ftl
</#ibizinclude>
</@ibizindent>
<#-- END:视图顶部视图消息 -->
<div class='content-container'>
<split v-model="split" mode="<#if view.getSideBarLayout()?? && view.getSideBarLayout() == "LEFT">horizontal<#else>vertical</#if>" @on-move-end="onSplitChange">
<template slot="<#if view.getSideBarLayout()?? && view.getSideBarLayout() == "LEFT">left<#else>top</#if>">
<#if view.hasPSControl('treeexpbar')>
<@ibizindent blank=12>
${P.getCtrlCode('treeexpbar', 'CONTROL.html').code}<#t>
</@ibizindent>
</#if>
</template>
<template slot="<#if view.getSideBarLayout()?? && view.getSideBarLayout() == "LEFT">right<#else>bottom</#if>">
<component
v-if="navItem && navItem.navView"
:is="navItem.navView"
:key="navItem.data && navItem.data.length ? navItem.data[0].srfkey : ''"
class="viewcontainer2"
:viewDefaultUsage="false"
:viewdata="JSON.stringify(navItem.srfnavdata.context)"
:viewparam="JSON.stringify(navItem.srfnavdata.viewparams)">
</component>
</template>
</split>
<#-- BEGIN:视图内容区视图消息 -->
<@ibizindent blank=8>
<#ibizinclude>
../@MACRO/View_Pos_Body_Msgs.vue.ftl
</#ibizinclude>
</@ibizindent>
<#-- END:视图内容区视图消息 -->
</div>
<#-- BEGIN:视图底部视图消息 -->
<@ibizindent blank=12>
<#ibizinclude>
../@MACRO/View_Pos_Bottom_Msgs.vue.ftl
</#ibizinclude>
</@ibizindent>
<#-- END:视图底部视图消息 -->
</card>
</div>
\ No newline at end of file
<#ibizinclude>
../@MACRO/DATAVIEW_VIEW.vue.ftl
<#ibizinclude>
../@MACRO/LAYOUTPANEL_VIEW.template.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/VIEW_HEADER-BASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/VIEW_CONTENT-BASE.vue.ftl
</#ibizinclude>
/**
* 视图唯一标识
*
* @type {string}
* @memberof ${srfclassname('${view.name}')}Base
*/
public viewUID: string = '${srffilepath2(view.getPSAppModule().getCodeName())}-${srffilepath2(view.getCodeName())}';
/**
* 分隔值
*
* @type {number}
* @memberof ${srfclassname('${view.name}')}Base
*/
public split: number = 0.5;
/**
* 导航项
*
* @type {*}
* @memberof ${srfclassname('${view.name}')}Base
*/
public navItem: any = {};
/**
* split值变化事件
*
* @memberof ${srfclassname('${view.name}')}Base
*/
public onSplitChange() {
if (this.split) {
this.$store.commit("setViewSplit", { viewUID: this.viewUID, viewSplit: this.split });
}
}
/**
* 初始化分隔值
*
* @memberof ${srfclassname('${view.name}')}Base
*/
public initSplit() {
if (this.$store.getters.getViewSplit(this.viewUID)) {
this.split = this.$store.getters.getViewSplit(this.viewUID);
} else {
<#if view.getSideBarLayout()?? && view.getSideBarLayout() == "LEFT">
const containerWidth = (this.$el as any).offsetWidth;
<#list view.getPSControls() as singleCtrl>
<#if singleCtrl.getControlType() == 'DATAVIEWEXPBAR' && singleCtrl.getWidth()??>
this.split = ${singleCtrl.getWidth()?c} / containerWidth;
</#if>
</#list>
<#else>
const containerHeight = (this.$el as any).offsetHeight;
<#list view.getPSControls() as singleCtrl>
<#if singleCtrl.getControlType() == 'DATAVIEWEXPBAR' && singleCtrl.getHeight()??>
this.split = ${singleCtrl.getHeight()?c} / containerHeight;
</#if>
</#list>
</#if>
this.$store.commit("setViewSplit", { viewUID: this.viewUID, viewSplit: this.split });
}
}
<#ibizinclude>
../@MACRO/VIEW_BOTTOM-BASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/VIEW-BASE.style.ftl
</#ibizinclude>
\ No newline at end of file
<#ibizinclude>
../@MACRO/LAYOUTPANEL_VIEW.template.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/VIEW_HEADER-BASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/VIEW_CONTENT-BASE.vue.ftl
</#ibizinclude>
/**
* 视图唯一标识
*
* @type {string}
* @memberof ${srfclassname('${view.name}')}Base
*/
public viewUID: string = '${srffilepath2(view.getPSAppModule().getCodeName())}-${srffilepath2(view.getCodeName())}';
<#ibizinclude>
../@MACRO/VIEW_BOTTOM-BASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/VIEW-BASE.style.ftl
<#ibizinclude>
../@MACRO/LAYOUTPANEL_VIEW.template.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/VIEW_HEADER-BASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/VIEW_CONTENT-BASE.vue.ftl
</#ibizinclude>
/**
* 视图唯一标识
*
* @type {string}
* @memberof ${srfclassname('${view.name}')}Base
*/
public viewUID: string = '${srffilepath2(view.getPSAppModule().getCodeName())}-${srffilepath2(view.getCodeName())}';
/**
* 分隔值
*
* @type {number}
* @memberof ${srfclassname('${view.name}')}Base
*/
public split: number = 0.5;
/**
* 导航项
*
* @type {*}
* @memberof ${srfclassname('${view.name}')}Base
*/
public navItem: any = {};
/**
* split值变化事件
*
* @memberof ${srfclassname('${view.name}')}Base
*/
public onSplitChange() {
if (this.split) {
this.$store.commit("setViewSplit", { viewUID: this.viewUID, viewSplit: this.split });
}
}
/**
* 初始化分隔值
*
* @memberof ${srfclassname('${view.name}')}Base
*/
public initSplit() {
if (this.$store.getters.getViewSplit(this.viewUID)) {
this.split = this.$store.getters.getViewSplit(this.viewUID);
} else {
<#if view.getSideBarLayout()?? && view.getSideBarLayout() == "LEFT">
const containerWidth = (this.$el as any).offsetWidth;
<#list view.getPSControls() as singleCtrl>
<#if singleCtrl.getControlType() == 'CALENDAREXPBAR' && singleCtrl.getWidth()??>
this.split = ${singleCtrl.getWidth()?c} / containerWidth;
</#if>
</#list>
<#else>
const containerHeight = (this.$el as any).offsetHeight;
<#list view.getPSControls() as singleCtrl>
<#if singleCtrl.getControlType() == 'CALENDAREXPBAR' && singleCtrl.getHeight()??>
this.split = ${singleCtrl.getHeight()?c} / containerHeight;
</#if>
</#list>
</#if>
this.$store.commit("setViewSplit", { viewUID: this.viewUID, viewSplit: this.split });
}
}
<#ibizinclude>
../@MACRO/VIEW_BOTTOM-BASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/VIEW-BASE.style.ftl
</#ibizinclude>
\ No newline at end of file
<#ibizinclude>
../@MACRO/LAYOUTPANEL_VIEW.template.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/VIEW_HEADER-BASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/VIEW_CONTENT-BASE.vue.ftl
</#ibizinclude>
/**
* 视图唯一标识
*
* @type {string}
* @memberof ${srfclassname('${view.name}')}Base
*/
public viewUID: string = '${srffilepath2(view.getPSAppModule().getCodeName())}-${srffilepath2(view.getCodeName())}';
<#ibizinclude>
../@MACRO/VIEW_BOTTOM-BASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/VIEW-BASE.style.ftl
<#ibizinclude>
../@MACRO/LAYOUTPANEL_VIEW.template.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/VIEW_HEADER-BASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/VIEW_CONTENT-BASE.vue.ftl
</#ibizinclude>
/**
* 视图唯一标识
*
* @type {string}
* @memberof ${srfclassname('${view.name}')}Base
*/
public viewUID: string = '${srffilepath2(view.getPSAppModule().getCodeName())}-${srffilepath2(view.getCodeName())}';
/**
* 分隔值
*
* @type {number}
* @memberof ${srfclassname('${view.name}')}Base
*/
public split: number = 0.5;
/**
* 导航项
*
* @type {*}
* @memberof ${srfclassname('${view.name}')}Base
*/
public navItem: any = {};
/**
* split值变化事件
*
* @memberof ${srfclassname('${view.name}')}Base
*/
public onSplitChange() {
if (this.split) {
this.$store.commit("setViewSplit", { viewUID: this.viewUID, viewSplit: this.split });
}
}
/**
* 初始化分隔值
*
* @memberof ${srfclassname('${view.name}')}Base
*/
public initSplit() {
if (this.$store.getters.getViewSplit(this.viewUID)) {
this.split = this.$store.getters.getViewSplit(this.viewUID);
} else {
<#if view.getSideBarLayout()?? && view.getSideBarLayout() == "LEFT">
const containerWidth = (this.$el as any).offsetWidth;
<#list view.getPSControls() as singleCtrl>
<#if singleCtrl.getControlType() == 'TREEEXPBAR' && singleCtrl.getWidth()??>
this.split = ${singleCtrl.getWidth()?c} / containerWidth;
</#if>
</#list>
<#else>
const containerHeight = (this.$el as any).offsetHeight;
<#list view.getPSControls() as singleCtrl>
<#if singleCtrl.getControlType() == 'TREEEXPBAR' && singleCtrl.getHeight()??>
this.split = ${singleCtrl.getHeight()?c} / containerHeight;
</#if>
</#list>
</#if>
this.$store.commit("setViewSplit", { viewUID: this.viewUID, viewSplit: this.split });
}
}
<#ibizinclude>
../@MACRO/VIEW_BOTTOM-BASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/VIEW-BASE.style.ftl
</#ibizinclude>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册