提交 70977341 编写于 作者: ibizdev's avatar ibizdev

Mosher 发布系统代码 [后台服务,演示应用]

上级 5d3de2e5
import ViewEngine from './view-engine';
import { ExpViewEngine } from './exp-view-engine';
/**
* 列表导航视图界面引擎
......@@ -7,24 +7,7 @@ import ViewEngine from './view-engine';
* @class ListExpViewEngine
* @extends {ViewEngine}
*/
export default class ListExpViewEngine extends ViewEngine {
/**
* 列表导航栏部件
*
* @type {*}
* @memberof ListExpViewEngine
*/
public listExpBar: any = null;
/**
* Creates an instance of ListExpViewEngine.
*
* @memberof ListExpViewEngine
*/
constructor() {
super();
}
export class ListExpViewEngine extends ExpViewEngine {
/**
* 初始化引擎
......@@ -33,77 +16,17 @@ export default class ListExpViewEngine extends ViewEngine {
* @memberof ListExpViewEngine
*/
public init(options: any): void {
this.listExpBar = options.listexpbar;
this.expBar = options.listexpbar;
super.init(options);
}
/**
* 引擎加载
*
* @description 视图销毁
* @memberof ListExpViewEngine
*/
public load(): void {
super.load();
if (this.getListExpBar() && this.isLoadDefault) {
const tag = this.getListExpBar().name;
this.setViewState2({ tag: tag, action: 'load', viewdata: this.view.viewparams });
} else {
this.isLoadDefault = true;
}
public destroyed() {
super.destroyed();
this.expBar = null;
}
/**
* 部件事件机制
*
* @param {string} ctrlName
* @param {string} eventName
* @param {*} args
* @memberof ListExpViewEngine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
super.onCtrlEvent(ctrlName, eventName, args);
if (Object.is(ctrlName, 'listexpbar')) {
this.listExpBarEvent(eventName, args);
}
}
/**
* 列表导航事件
*
* @param {string} eventName
* @param {*} args
* @memberof ListExpViewEngine
*/
public listExpBarEvent(eventName: string, args: any): void {
if (Object.is(eventName, 'load')) {
this.view.$emit('viewload', args);
}
if (Object.is(eventName, 'selectionchange')) {
this.view.$emit('viewdataschange', args);
}
if (Object.is(eventName, 'activated')) {
this.view.$emit('viewdatasactivated', args);
}
}
/**
* 获取部件对象
*
* @returns {*}
* @memberof ListExpViewEngine
*/
public getListExpBar(): any {
return this.listExpBar;
}
/**
* @description 销毁
* @memberof ListExpViewEngine
*/
public destroy() {
super.destroy();
this.listExpBar = null;
}
}
\ No newline at end of file
......@@ -4,11 +4,11 @@
<div class="view-container delistexpview ibizorder-list-exp-view">
<app-studioaction :viewTitle="$t(model.srfCaption)" viewName="ibizorderlistexpview"></app-studioaction>
<card class='view-card view-no-caption view-no-toolbar' :dis-hover="true" :bordered="false">
<div class='view-top-messages'>
<app-alert-group position='TOP' :context="context" :viewparam="viewparams" infoGroup='VMGroup45' viewname='ibizorderlistexpview'></app-alert-group> </div>
<div class="content-container">
<split v-model="split" mode="horizontal" @on-move-end="onSplitChange">
<template slot="left">
<view_listexpbar
:viewState="viewState"
:viewparams="viewparams"
......@@ -24,6 +24,19 @@
@activated="listexpbar_activated($event)"
@closeview="closeView($event)">
</view_listexpbar>
</template>
<template slot="right">
<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>
</card>
</div>
......@@ -769,6 +782,47 @@ export default class IBIZOrderListExpViewBase extends Vue {
*/
public viewUID: string = 'sample-ibizorder-list-exp-view';
/**
* 分隔值
*
* @type {number}
* @memberof IBIZOrderListExpViewBase
*/
public split: number = 0.5;
/**
* 导航项
*
* @type {*}
* @memberof IBIZOrderListExpViewBase
*/
public navItem: any = {};
/**
* split值变化事件
*
* @memberof IBIZOrderListExpViewBase
*/
public onSplitChange() {
if (this.split) {
this.$store.commit("setViewSplit", { viewUID: this.viewUID, viewSplit: this.split });
}
}
/**
* 初始化分隔值
*
* @memberof IBIZOrderListExpViewBase
*/
public initSplit() {
if (this.$store.getters.getViewSplit(this.viewUID)) {
this.split = this.$store.getters.getViewSplit(this.viewUID);
} else {
const containerWidth = (this.$el as any).offsetWidth;
this.split = 500 / containerWidth;
this.$store.commit("setViewSplit", { viewUID: this.viewUID, viewSplit: this.split });
}
}
}
</script>
......
......@@ -23,6 +23,7 @@
<div slot='content'>{{$t('entities.ibizorder.gridexpviewgridexpbar_toolbar_toolbar.deuiaction3.tip')}}</div>
</tooltip>
</div>
</div>
<div class='grid-exp-bar-content'>
<view_gridexpbar_grid
:viewState="viewState"
......@@ -47,7 +48,6 @@
</view_gridexpbar_grid>
</div>
</div>
</div>
</template>
......
<template>
<split id="listexpviewlistexpbar" class="app-list-exp-bar" v-model="split" mode="horizontal" @on-move-end="onSplitChange">
<div slot='left'>
<div id="listexpviewlistexpbar" class="app-list-exp-bar">
<div class='list-exp-bar-header'>
<div class="list-exp-bar-title">
<icon type='ios-home-outline'/>{{$t('app.listExpBar.title')}}
</div>
</div>
<div class="container-header">
<div class="exp-bar-action-container">
<div class='search-container'>
<i-input :search="true"
@on-change="($event) => { this.searchText = $event.target.value; }"
......@@ -46,17 +45,6 @@
</view_listexpbar_list>
</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)">
</component>
</div>
</split>
</template>
......@@ -322,34 +310,9 @@ export default class ListExpViewlistexpbarBase extends Vue implements ControlInt
* @type {(boolean)}
* @memberof ListExpViewlistexpbarBase
*/
public isSingleSelect:boolean = true;
public isSingleSelect: boolean = true;
/**
* 呈现模式,可选值:horizontal或者vertical
*
* @public
* @type {(string)}
* @memberof ListExpViewlistexpbarBase
*/
public showMode:string ="horizontal";
/**
* 控件宽度
*
* @type {number}
* @memberof ListExpViewlistexpbarBase
*/
public ctrlWidth:number = 500;
/**
* 控件高度
*
* @type {number}
* @memberof ListExpViewlistexpbarBase
*/
public ctrlHeight: number = 0;
/**
* 可搜索字段名称
*
......@@ -366,7 +329,7 @@ export default class ListExpViewlistexpbarBase extends Vue implements ControlInt
* @type {(string)}
* @memberof ListExpViewlistexpbarBase
*/
public searchText:string = "";
public searchText: string = "";
/**
* 部件类型
......@@ -377,14 +340,6 @@ export default class ListExpViewlistexpbarBase extends Vue implements ControlInt
*/
public controlType: string = "listExpBar";
/**
* 分割宽度
*
* @type {number}
* @memberof ListExpViewlistexpbarBase
*/
public split: number = 0.5;
/**
* 导航视图名称
......@@ -475,25 +430,6 @@ export default class ListExpViewlistexpbarBase extends Vue implements ControlInt
return null;
}
/**
* 选中数据
*
* @type {*}
* @memberof ListExpViewlistexpbarBase
*/
public selection: any = {};
/**
* split值变化事件
*
* @memberof ListExpViewlistexpbarBase
*/
public onSplitChange() {
if(this.split){
this.$store.commit("setViewSplit",{viewUID:this.viewUID,viewSplit:this.split});
}
}
/**
* Vue声明周期(组件初始化完毕)
*
......@@ -524,24 +460,7 @@ export default class ListExpViewlistexpbarBase extends Vue implements ControlInt
*
* @memberof ListExpViewlistexpbarBase
*/
public afterMounted(){
if(this.$store.getters.getViewSplit(this.viewUID)){
this.split = this.$store.getters.getViewSplit(this.viewUID);
}else{
let containerWidth:number = (document.getElementById("listexpviewlistexpbar") as any).offsetWidth;
let containerHeight:number = (document.getElementById("listexpviewlistexpbar") 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声明周期(组件渲染完毕)
......
.app-list-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;
.list-exp-bar-header {
......@@ -22,6 +14,10 @@
}
}
}
.exp-bar-action-container {
display: flex;
align-items: center;
}
.container-header{
display: flex;
justify-content: flex-start;
......@@ -36,9 +32,6 @@
}
.toolbar-container{
padding: 4px;
display: flex;
flex-wrap: wrap;
align-items: center;
}
.quick-group-container {
padding-top: 8px;
......@@ -46,81 +39,8 @@
}
}
.list-exp-bar-content {
height: calc(100% - 88px);
overflow: auto;
padding: 16px 0;
margin-bottom: 10px;
}
.list-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;
.list-exp-bar-header {
line-height: 50px;
border-bottom: 1px solid #ddd;
.list-exp-bar-title {
font-size: 18px;
padding-left: 8px;
i {
font-size: 20px;
margin-top: -2px;
}
}
}
.container-header{
display: flex;
justify-content: space-between;
align-items: center;
.search-container {
width: 30%;
height: 48px;
padding: 10px 10px 10px 0;
min-width: 200px;
max-width: 400px;
}
.toolbar-container{
padding: 4px;
}
}
.list-exp-bar-content {
height: calc(100% - 88px);
overflow: auto;
margin-bottom: 10px;
}
.list-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;
}
}
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册