import { AppDefaultViewLayout } from "../app-default-view-layout/app-default-view-layout";
import { Component } from 'vue-property-decorator';
import { Util, AppServiceBase } from '@ibizstudio/runtime';
import { AppLoadingService } from "../../../../app-service/loading-service/app-loading-service";
import { IPSAppIndexView, IPSLanguageRes } from '@ibizstudio/runtime';
import './app-default-indexview-layout.less';
@Component({})
export class AppDefaultIndexViewLayout extends AppDefaultViewLayout {
/**
* 应用loading服务
*
* @memberof AppLayout
*/
appLoadingService = AppLoadingService.getInstance();
/**
* 是否满屏
*
* @type {boolean}
* @memberof IndexViewBase
*/
isFullScreen: boolean = false;
/**
* 菜单收缩变化
*
* @type {boolean}
* @memberof AppDefaultIndexViewLayout
*/
collapseChange: boolean = false;
/**
* 抽屉状态
*
* @type {boolean}
* @memberof AppDefaultIndexViewLayout
*/
contextMenuDragVisiable: boolean = false;
/**
* 当前主题
*
* @memberof AppDefaultIndexViewLayout
*/
selectTheme() {
let _this: any = this;
if (_this.$router.app.$store.state.selectTheme) {
return _this.$router.app.$store.state.selectTheme;
} else if (localStorage.getItem('theme-class')) {
return localStorage.getItem('theme-class');
} else {
return 'app-theme-default';
}
}
/**
* 获取当前语言环境
*
* @memberof AppDefaultIndexViewLayout
*/
getSelectLanguage() { }
/**
* 当前字体
*
* @memberof AppDefaultIndexViewLayout
*/
get selectFont() {
let _this: any = this;
if (_this.$router.app.$store.state.selectFont) {
return _this.$router.app.$store.state.selectFont;
} else if (localStorage.getItem('font-family')) {
return localStorage.getItem('font-family');
} else {
return 'Microsoft YaHei';
}
}
/**
* 菜单收缩
*
* @memberof AppDefaultIndexViewLayout
*/
collapseMenus() {
if (this.$store.getters['getCustomParamByTag']('srffullscreen')) {
this.isFullScreen = !this.isFullScreen;
if (this.isFullScreen) {
this.collapseChange = true;
} else {
this.collapseChange = false;
}
} else {
this.collapseChange = !this.collapseChange;
}
this.$emit('onCollapseChange', this.collapseChange);
}
/**
* 路由列表
*
* @memberof AppDefaultIndexViewLayout
*/
get routerList() {
return this.$store.state.historyPathList;
}
/**
* 路由键值
*
* @memberof AppDefaultIndexViewLayout
*/
get routerViewKey() {
let _this: any = this;
return _this.$route.fullPath;
}
/**
* 是否显示标题栏
*
* @readonly
* @memberof AppDefaultViewLayout
*/
get showCaption(){
if(this.viewInstance && this.$parent && Util.isExist(this.viewInstance.showCaptionBar)){
return this.viewInstance.showCaptionBar && !(this.$parent as any).noViewCaption
}else{
return true;
}
}
/**
* 初始化
*
* @memberof AppDefaultIndexViewLayout
*/
created() {
document.getElementsByTagName('html')[0].className = this.selectTheme();
this.isFullScreen = Boolean(this.$store.getters['getCustomParamByTag']('srffullscreen'));
}
/**
* 渲染左侧菜单样式
*
* @memberof AppDefaultIndexViewLayout
*/
renderContentLeft() {
let contentClass = {
'index_content': true,
'index_tab_content': Object.is(this.viewInstance.viewStyle, 'DEFAULT'),
'index_route_content': !Object.is(this.viewInstance.viewStyle, 'DEFAULT')
}
return (
: null}
{this.showCaption ? {this.model.srfCaption} : null}
{(this.viewInstance as IPSAppIndexView).enableAppSwitch ?
: null}
{this.showCaption ? {this.model.srfCaption} : null}
{(this.viewInstance as IPSAppIndexView).enableAppSwitch ?
: null}
{this.showCaption ? {this.model.srfCaption} : null}