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

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

上级 cfce44f8
...@@ -152,6 +152,10 @@ export default { ...@@ -152,6 +152,10 @@ export default {
caption: "R7 Vue示例", caption: "R7 Vue示例",
title: "", title: "",
}, },
appportalview: {
caption: "",
title: "应用门户视图",
},
apppanelview: { apppanelview: {
caption: "", caption: "",
title: "应用面板视图", title: "应用面板视图",
......
...@@ -152,6 +152,10 @@ export default { ...@@ -152,6 +152,10 @@ export default {
caption: "R7 Vue示例", caption: "R7 Vue示例",
title: "", title: "",
}, },
appportalview: {
caption: "",
title: "应用门户视图",
},
apppanelview: { apppanelview: {
caption: "", caption: "",
title: "应用面板视图", title: "应用面板视图",
......
...@@ -1881,7 +1881,7 @@ mock.onGet('v7/main-menuappmenu').reply((config: any) => { ...@@ -1881,7 +1881,7 @@ mock.onGet('v7/main-menuappmenu').reply((config: any) => {
iconcls: '', iconcls: '',
icon: '', icon: '',
textcls: '', textcls: '',
appfunctag: '', appfunctag: 'AppFunc66',
resourcetag: '', resourcetag: '',
}, },
], ],
......
...@@ -136,6 +136,7 @@ export const PageComponents = { ...@@ -136,6 +136,7 @@ export const PageComponents = {
Vue.component('ibizorder-detail-f6-edit-view', () => import('@pages/sample/ibizorder-detail-f6-edit-view/ibizorder-detail-f6-edit-view.vue')); Vue.component('ibizorder-detail-f6-edit-view', () => import('@pages/sample/ibizorder-detail-f6-edit-view/ibizorder-detail-f6-edit-view.vue'));
Vue.component('ibizbookusr4-grid-view', () => import('@pages/sample/ibizbookusr4-grid-view/ibizbookusr4-grid-view.vue')); Vue.component('ibizbookusr4-grid-view', () => import('@pages/sample/ibizbookusr4-grid-view/ibizbookusr4-grid-view.vue'));
Vue.component('ibizbookusr2-medit-view9', () => import('@pages/sample/ibizbookusr2-medit-view9/ibizbookusr2-medit-view9.vue')); Vue.component('ibizbookusr2-medit-view9', () => import('@pages/sample/ibizbookusr2-medit-view9/ibizbookusr2-medit-view9.vue'));
Vue.component('app-portal-view', () => import('@pages/ungroup/app-portal-view/app-portal-view.vue'));
Vue.component('ibizorder-sedit-view3', () => import('@pages/sample/ibizorder-sedit-view3/ibizorder-sedit-view3.vue')); Vue.component('ibizorder-sedit-view3', () => import('@pages/sample/ibizorder-sedit-view3/ibizorder-sedit-view3.vue'));
Vue.component('ibizorder-odsp-d10-wfgrid-view', () => import('@pages/sample/ibizorder-odsp-d10-wfgrid-view/ibizorder-odsp-d10-wfgrid-view.vue')); Vue.component('ibizorder-odsp-d10-wfgrid-view', () => import('@pages/sample/ibizorder-odsp-d10-wfgrid-view/ibizorder-odsp-d10-wfgrid-view.vue'));
Vue.component('ibizbookinternal-func-grid-view', () => import('@pages/sample/ibizbookinternal-func-grid-view/ibizbookinternal-func-grid-view.vue')); Vue.component('ibizbookinternal-func-grid-view', () => import('@pages/sample/ibizbookinternal-func-grid-view/ibizbookinternal-func-grid-view.vue'));
......
...@@ -2179,6 +2179,19 @@ const router = new Router({ ...@@ -2179,6 +2179,19 @@ const router = new Router({
}, },
component: () => import('@pages/sample/ibizbookusr2-medit-view9/ibizbookusr2-medit-view9.vue'), component: () => import('@pages/sample/ibizbookusr2-medit-view9/ibizbookusr2-medit-view9.vue'),
}, },
{
path: 'appportalview/:appportalview?',
meta: {
caption: 'app.views.appportalview.caption',
info:'',
parameters: [
{ pathName: 'index', parameterName: 'index' },
{ pathName: 'appportalview', parameterName: 'appportalview' },
],
requireAuth: true,
},
component: () => import('@pages/ungroup/app-portal-view/app-portal-view.vue'),
},
{ {
path: 'ibizorders/:ibizorder?/seditview3/:seditview3?', path: 'ibizorders/:ibizorder?/seditview3/:seditview3?',
meta: { meta: {
...@@ -5283,6 +5296,18 @@ const router = new Router({ ...@@ -5283,6 +5296,18 @@ const router = new Router({
}, },
component: () => import('@pages/sample/ibizorder-sf15-grid-view/ibizorder-sf15-grid-view.vue'), component: () => import('@pages/sample/ibizorder-sf15-grid-view/ibizorder-sf15-grid-view.vue'),
}, },
{
path: '/appportalview/:appportalview?',
meta: {
caption: 'app.views.appportalview.caption',
info:'',
parameters: [
{ pathName: 'appportalview', parameterName: 'appportalview' },
],
requireAuth: true,
},
component: () => import('@pages/ungroup/app-portal-view/app-portal-view.vue'),
},
{ {
path: '/apppanelview/:apppanelview?', path: '/apppanelview/:apppanelview?',
meta: { meta: {
......
<template>
<div class='view-container appportalview app-portal-view '>
<app-studioaction :viewTitle="$t(model.srfCaption)" viewName="appportalview"></app-studioaction>
<card class='view-card view-no-toolbar' dis-hover :bordered="false">
<div slot='title' class="header-container">
<span class='caption-info'>{{$t(model.srfCaption)}}</span>
</div>
<div class='content-container'>
<div class='view-top-messages'>
</div>
<view_dashboard
:viewState="viewState"
:viewparams="viewparams"
:context="JSON.parse(JSON.stringify(context))"
:isEnableCustomized = "false"
name="dashboard"
ref='dashboard'
@closeview="closeView($event)">
</view_dashboard>
<div class='view-bottom-messages'>
</div>
</div>
</card>
</div>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch,Inject } from 'vue-property-decorator';
import { UIActionTool,Util } from '@/utils';
import NavDataService from '@/service/app/navdata-service';
import { Subject,Subscription } from 'rxjs';
@Component({
components: {
},
})
export default class AppPortalViewBase extends Vue {
/**
* 数据变化
*
* @param {*} val
* @returns {*}
* @memberof AppPortalViewBase
*/
@Emit()
public viewDatasChange(val: any):any {
return val;
}
/**
* 传入视图上下文
*
* @type {string}
* @memberof AppPortalViewBase
*/
@Prop() public viewdata!: string;
/**
* 传入视图参数
*
* @type {string}
* @memberof AppPortalViewBase
*/
@Prop() public viewparam!: string;
/**
* 视图默认使用
*
* @type {boolean}
* @memberof AppPortalViewBase
*/
@Prop({ default: true }) public viewDefaultUsage!: boolean;
/**
* 视图默认使用
*
* @type {string}
* @memberof AppPortalViewBase
*/
@Inject({from:'navModel',default: 'tab'})
public navModel!:string;
/**
* 视图标识
*
* @type {string}
* @memberof AppPortalViewBase
*/
public viewtag: string = '06E447F9-1AF8-464F-8F47-39CFC64B9A21';
/**
* 自定义视图导航上下文集合
*
* @type {*}
* @memberof AppPortalViewBase
*/
public customViewNavContexts:any ={
};
/**
* 自定义视图导航参数集合
*
* @type {*}
* @memberof AppPortalViewBase
*/
public customViewParams:any ={
};
/**
* 视图模型数据
*
* @type {*}
* @memberof AppPortalViewBase
*/
public model: any = {
srfCaption: 'app.views.appportalview.caption',
srfTitle: 'app.views.appportalview.title',
srfSubTitle: 'app.views.appportalview.subtitle',
dataInfo: ''
}
/**
* 视图参数变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof AppPortalViewBase
*/
@Watch('viewparam',{immediate: true, deep: true})
onParamData(newVal: any, oldVal: any) {
if(newVal){
this.viewparams = {};
if(typeof newVal == 'string') {
Object.assign(this.viewparams, JSON.parse(this.viewparam));
}else{
this.viewparams = Util.deepCopy(this.viewparam);
}
}
}
/**
* 处理应用上下文变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof AppPortalViewBase
*/
@Watch('viewdata')
onViewData(newVal: any, oldVal: any) {
const _this: any = this;
if (!Object.is(newVal, oldVal) && _this.engine) {
this.$nextTick(()=>{
_this.parseViewParam();
_this.engine.load();
});
} else if(!Object.is(newVal, oldVal) && _this.refresh && _this.refresh instanceof Function) {
_this.refresh();
}
}
/**
* 容器模型
*
* @type {*}
* @memberof AppPortalViewBase
*/
public containerModel: any = {
view_dashboard: { name: 'dashboard', type: 'DASHBOARD' },
};
/**
* 计数器刷新
*
* @memberof AppPortalViewBase
*/
public counterRefresh(){
const _this:any =this;
if(_this.counterServiceArray && _this.counterServiceArray.length >0){
_this.counterServiceArray.forEach((item:any) =>{
if(item.refreshData && item.refreshData instanceof Function){
item.refreshData();
}
})
}
}
/**
* 视图状态订阅对象
*
* @public
* @type {Subject<{action: string, data: any}>}
* @memberof AppPortalViewBase
*/
public viewState: Subject<ViewState> = new Subject();
/**
* 引擎初始化
*
* @public
* @memberof AppPortalViewBase
*/
public engineInit(): void {
}
/**
* 应用导航服务
*
* @type {*}
* @memberof AppPortalViewBase
*/
public navDataService = NavDataService.getInstance(this.$store);
/**
* 导航服务事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof AppPortalViewBase
*/
public serviceStateEvent: Subscription | undefined;
/**
* 门户部件状态对象
*
* @type {*}
* @memberof AppPortalViewBase
*/
@Prop() public portletState?: any;
/**
* 门户部件状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof AppPortalViewBase
*/
public portletStateEvent: Subscription | undefined;
/**
* 应用上下文
*
* @type {*}
* @memberof AppPortalViewBase
*/
public context:any = {};
/**
* 视图参数
*
* @type {*}
* @memberof AppPortalViewBase
*/
public viewparams:any = {};
/**
* 视图缓存数据
*
* @type {*}
* @memberof AppPortalViewBase
*/
public viewCacheData:any;
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof AppPortalViewBase
*/
public counterServiceArray:Array<any> = [];
/**
* 解析视图参数
*
* @public
* @memberof AppPortalViewBase
*/
public parseViewParam(inputvalue:any = null): void {
for(let key in this.context){
delete this.context[key];
}
if(this.$store.getters.getAppData() && this.$store.getters.getAppData().context){
Object.assign(this.context,this.$store.getters.getAppData().context);
}
if (!this.viewDefaultUsage && this.viewdata && !Object.is(this.viewdata, '')) {
if(typeof this.viewdata == 'string') {
Object.assign(this.context, JSON.parse(this.viewdata));
}
if(this.context && this.context.srfparentdename){
Object.assign(this.viewparams,{srfparentdename:this.context.srfparentdename});
}
if(this.context && this.context.srfparentkey){
Object.assign(this.viewparams,{srfparentkey:this.context.srfparentkey});
}
this.handleCustomViewData();
return;
}
const path = (this.$route.matched[this.$route.matched.length - 1]).path;
const keys: Array<any> = [];
const curReg = this.$pathToRegExp.pathToRegexp(path, keys);
const matchArray = curReg.exec(this.$route.path);
let tempValue: Object = {};
keys.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item.name, {
enumerable: true,
value: matchArray[index + 1]
});
});
this.$viewTool.formatRouteParams(tempValue,this.$route,this.context,this.viewparams);
this.handleCustomViewData();
//初始化导航数据
this.initNavDataWithRoute();
}
/**
* 处理自定义视图数据
*
* @memberof AppPortalViewBase
*/
public handleCustomViewData(){
if(Object.keys(this.customViewNavContexts).length > 0){
Object.keys(this.customViewNavContexts).forEach((item:any) =>{
let tempContext:any = {};
let curNavContext:any = this.customViewNavContexts[item];
this.handleCustomDataLogic(curNavContext,tempContext,item);
Object.assign(this.context,tempContext);
})
}
if(Object.keys(this.customViewParams).length > 0){
Object.keys(this.customViewParams).forEach((item:any) =>{
let tempParam:any = {};
let curNavParam:any = this.customViewParams[item];
this.handleCustomDataLogic(curNavParam,tempParam,item);
Object.assign(this.viewparams,tempParam);
})
}
}
/**
* 处理自定义视图数据逻辑
*
* @memberof AppPortalViewBase
*/
public handleCustomDataLogic(curNavData:any,tempData:any,item:string){
// 直接值直接赋值
if(curNavData.isRawValue){
if(Object.is(curNavData.value,"null") || Object.is(curNavData.value,"")){
Object.defineProperty(tempData, item.toLowerCase(), {
value: null,
writable : true,
enumerable : true,
configurable : true
});
}else{
Object.defineProperty(tempData, item.toLowerCase(), {
value: curNavData.value,
writable : true,
enumerable : true,
configurable : true
});
}
}else{
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
if(this.context[(curNavData.value).toLowerCase()] != null){
Object.defineProperty(tempData, item.toLowerCase(), {
value: this.context[(curNavData.value).toLowerCase()],
writable : true,
enumerable : true,
configurable : true
});
}else{
if(this.viewparams[(curNavData.value).toLowerCase()] != null){
Object.defineProperty(tempData, item.toLowerCase(), {
value: this.viewparams[(curNavData.value).toLowerCase()],
writable : true,
enumerable : true,
configurable : true
});
}else{
Object.defineProperty(tempData, item.toLowerCase(), {
value: null,
writable : true,
enumerable : true,
configurable : true
});
}
}
}
}
/**
* 初始化导航数据(路由模式)
*
* @memberof AppPortalViewBase
*/
public initNavDataWithRoute(data:any = null, isNew:boolean = false, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && Object.is(this.navModel,"route")) ){
this.navDataService.addNavData({id:'app-portal-view',tag:this.viewtag,srfkey:isNew ? null : null,title:this.$t(this.model.srfCaption),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath});
}
}
/**
* 初始化导航数据(分页模式)
*
* @memberof AppPortalViewBase
*/
public initNavDataWithTab(data:any = null,isOnlyAdd:boolean = true, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && !Object.is(this.navModel,"route")) ){
this.navDataService.addNavDataByOnly({id:'app-portal-view',tag:this.viewtag,srfkey:null,title:this.$t(this.model.srfCaption),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath},isOnlyAdd);
}
}
/**
* Vue声明周期
*
* @memberof AppPortalViewBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof AppPortalViewBase
*/
public afterCreated(){
let _this:any = this;
const secondtag = _this.$util.createUUID();
_this.$store.commit('viewaction/createdView', { viewtag: _this.viewtag, secondtag: secondtag });
_this.viewtag = secondtag;
_this.parseViewParam();
_this.serviceStateEvent = _this.navDataService.serviceState.subscribe(({ action,name, data }:{ action:string,name:any,data:any }) => {
if(!Object.is(name,'app-portal-view')){
return;
}
if (Object.is(action, 'viewrefresh')) {
_this.$nextTick(()=>{
_this.parseViewParam(data);
if(_this.engine){
_this.engine.load();
}
});
}
});
if(_this.portletState){
_this.portletStateEvent = _this.portletState.subscribe((res:any) =>{
if(!Object.is(res.name,'AppPortalView')){
return;
}
if(Object.is(res.action,'refresh') && _this.refresh && _this.refresh instanceof Function){
_this.refresh();
}
})
}
}
/**
* 销毁之前
*
* @memberof AppPortalViewBase
*/
public beforeDestroy() {
this.$store.commit('viewaction/removeView', this.viewtag);
}
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof AppPortalViewBase
*/
public mounted() {
this.afterMounted();
}
/**
* 执行mounted后的逻辑
*
* @memberof AppPortalViewBase
*/
public afterMounted(){
const _this: any = this;
_this.engineInit();
if (_this.loadModel && _this.loadModel instanceof Function) {
_this.loadModel();
}
this.viewState.next({ tag: 'dashboard', action: 'load', data: {} });
}
/**
* 关闭视图
*
* @param {any[]} args
* @memberof AppPortalViewBase
*/
public closeView(args: any[]): void {
let _view: any = this;
if (_view.viewdata) {
_view.$emit('viewdataschange', [args]);
_view.$emit('close', [args]);
} else if (_view.$tabPageExp) {
_view.$tabPageExp.onClose(_view.$route.fullPath);
}
}
/**
* 应用起始页面
*
* @type {boolean}
* @memberof AppPortalViewBase
*/
public isDefaultPage: boolean = false;
/**
* 加载数据
*
* @type {boolean}
* @memberof AppPortalViewBase
*/
public loadModel() {
this.viewState.next({ tag: 'all-portlet', action: 'loadmodel', data: {}});
}
}
</script>
<style lang='less'>
@import './app-portal-view.less';
</style>
\ No newline at end of file
.app-portal-view{
position: relative;
}
.app-portal-view{
display: block;
}
\ No newline at end of file
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import AppPortalViewBase from './app-portal-view-base.vue';
import view_dashboard from '@widgets/app/app-portal-view-db-dashboard/app-portal-view-db-dashboard.vue';
@Component({
components: {
view_dashboard,
},
beforeRouteEnter: (to: any, from: any, next: any) => {
next((vm: any) => {
if(!Object.is(vm.navModel,"route")){
vm.initNavDataWithTab(vm.viewCacheData);
}
vm.$store.commit('addCurPageViewtag', { fullPath: to.fullPath, viewtag: vm.viewtag });
});
},
})
export default class AppPortalView extends AppPortalViewBase {
}
</script>
\ No newline at end of file
...@@ -236,8 +236,8 @@ export const viewstate: any = { ...@@ -236,8 +236,8 @@ export const viewstate: any = {
'd3321077dfab8bc6b92c649e5b69daf3', 'd3321077dfab8bc6b92c649e5b69daf3',
'e54ae8e27a53b3425ac78a229a163bd5', 'e54ae8e27a53b3425ac78a229a163bd5',
'836bdb4063978b55fedd6a180d60c323', '836bdb4063978b55fedd6a180d60c323',
'794fbfb192285c60dc9ce640270d79c0',
'369a14f21cbff0d0fe23831aecfca7ba', '369a14f21cbff0d0fe23831aecfca7ba',
'794fbfb192285c60dc9ce640270d79c0',
'a894de140705ecab2f39797d2922a3ce', 'a894de140705ecab2f39797d2922a3ce',
'ea604a66caf499c70c9002a917dd1694', 'ea604a66caf499c70c9002a917dd1694',
'4981c4ae8facb75582f8dcbc51850318', '4981c4ae8facb75582f8dcbc51850318',
...@@ -274,6 +274,7 @@ export const viewstate: any = { ...@@ -274,6 +274,7 @@ export const viewstate: any = {
'9f80ed66360fbbb9bc57c575fdd8814f', '9f80ed66360fbbb9bc57c575fdd8814f',
'94e6694a65d9cacb171b6e0b581216ba', '94e6694a65d9cacb171b6e0b581216ba',
'5686558064d641b7ff599746970461cd', '5686558064d641b7ff599746970461cd',
'06E447F9-1AF8-464F-8F47-39CFC64B9A21',
'3bbf72a3e5b59fed0dee362a9b1384a8', '3bbf72a3e5b59fed0dee362a9b1384a8',
'f73da4cb47a88d3fe5b92716e0137741', 'f73da4cb47a88d3fe5b92716e0137741',
'fdb8ed39fbfea00f65416b9aaebd64e7', 'fdb8ed39fbfea00f65416b9aaebd64e7',
...@@ -1900,6 +1901,15 @@ export const viewstate: any = { ...@@ -1900,6 +1901,15 @@ export const viewstate: any = {
'2cd3a77cbd2aad4551b7a6a009419d52', '2cd3a77cbd2aad4551b7a6a009419d52',
], ],
}, },
{
viewtag: '06E447F9-1AF8-464F-8F47-39CFC64B9A21',
viewmodule: 'Ungroup',
viewname: 'AppPortalView',
viewaction: '',
viewdatachange: false,
refviews: [
],
},
{ {
viewtag: '694422a6002b5b601257dbc5340c01bd', viewtag: '694422a6002b5b601257dbc5340c01bd',
viewmodule: 'Ungroup', viewmodule: 'Ungroup',
......
<template>
<div class='dashboard'>
<row v-if="isEnableCustomized">
<app-build @handleClick="handleClick"></app-build>
</row>
<row v-if="!isHasCustomized">
<i-col :md="{ span: 24, offset: 0 }">
<card class="portlet-card" :bordered="false" dis-hover :padding="0">
<span>
<div class='portlet-container db-container1 ' :style="{}">
<row>
<i-col :md="{ span: 24, offset: 0 }" :lg="{ span: 6, offset: 0 }">
<div class="portlet-without-title">
<card class="portlet-card" :bordered="false" dis-hover :padding="0">
<span>
<div class='portlet-container db-container2 ' :style="{}">
<row>
<i-col :md="{ span: 24, offset: 0 }">
<div class="portlet-without-title">
<card class="portlet-card custom-card" :bordered="false" dis-hover :padding="10">
<span>
<view_db_rawitem1
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:height="100"
:width="0"
name="db_rawitem1"
ref='db_rawitem1'
@closeview="closeView($event)">
</view_db_rawitem1>
</span>
</card>
</div>
</i-col>
</row>
</div>
</span>
</card>
</div>
</i-col>
<i-col :md="{ span: 24, offset: 0 }" :lg="{ span: 6, offset: 0 }">
<div class="portlet-without-title">
<card class="portlet-card" :bordered="false" dis-hover :padding="0">
<span>
<div class='portlet-container db-container3 ' :style="{}">
<row>
<i-col :md="{ span: 24, offset: 0 }">
<div class="portlet-without-title">
<card class="portlet-card custom-card" :bordered="false" dis-hover :padding="10">
<span>
<view_db_rawitem2
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:height="100"
:width="0"
name="db_rawitem2"
ref='db_rawitem2'
@closeview="closeView($event)">
</view_db_rawitem2>
</span>
</card>
</div>
</i-col>
</row>
</div>
</span>
</card>
</div>
</i-col>
<i-col :md="{ span: 24, offset: 0 }" :lg="{ span: 6, offset: 0 }">
<div class="portlet-without-title">
<card class="portlet-card" :bordered="false" dis-hover :padding="0">
<span>
<div class='portlet-container db-container4 ' :style="{}">
<row>
<i-col :md="{ span: 24, offset: 0 }">
<div class="portlet-without-title">
<card class="portlet-card custom-card" :bordered="false" dis-hover :padding="10">
<span>
<view_db_rawitem3
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:height="100"
:width="0"
name="db_rawitem3"
ref='db_rawitem3'
@closeview="closeView($event)">
</view_db_rawitem3>
</span>
</card>
</div>
</i-col>
</row>
</div>
</span>
</card>
</div>
</i-col>
<i-col :md="{ span: 24, offset: 0 }" :lg="{ span: 6, offset: 0 }">
<div class="portlet-without-title">
<card class="portlet-card" :bordered="false" dis-hover :padding="0">
<span>
<div class='portlet-container db-container5 ' :style="{}">
<row>
<i-col :md="{ span: 24, offset: 0 }">
<div class="portlet-without-title">
<card class="portlet-card custom-card" :bordered="false" dis-hover :padding="10">
<span>
<view_db_rawitem4
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:height="100"
:width="0"
name="db_rawitem4"
ref='db_rawitem4'
@closeview="closeView($event)">
</view_db_rawitem4>
</span>
</card>
</div>
</i-col>
</row>
</div>
</span>
</card>
</div>
</i-col>
<i-col :md="{ span: 24, offset: 0 }" :lg="{ span: 12, offset: 0 }">
<div class="portlet-without-title">
<card class="portlet-card custom-card" :bordered="false" dis-hover :padding="10">
<span>
<view_db_rawitem5
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:height="400"
:width="0"
name="db_rawitem5"
ref='db_rawitem5'
@closeview="closeView($event)">
</view_db_rawitem5>
</span>
</card>
</div>
</i-col>
<i-col :md="{ span: 24, offset: 0 }" :lg="{ span: 12, offset: 0 }">
<div class="portlet-without-title">
<card class="portlet-card custom-card" :bordered="false" dis-hover :padding="10">
<span>
<view_db_rawitem6
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:height="400"
:width="0"
name="db_rawitem6"
ref='db_rawitem6'
@closeview="closeView($event)">
</view_db_rawitem6>
</span>
</card>
</div>
</i-col>
</row>
</div>
</span>
</card>
</i-col>
</row>
<row v-if="isHasCustomized" style="width: 100%;min-height: calc(100% - 40px);">
<div class="portlet-container" style="position: relative;width:100%;">
<template v-for="(item, index) of modelDta">
<div :key="index" :style="{zIndex: 10, position: 'absolute', height: item.h*layoutRowH + 'px', width: `calc(100% / ${layoutColNum} * ${item.w})`,top: item.y*layoutRowH + 'px', left: `calc(100% / ${layoutColNum} * ${item.x})`}">
<component :key="$util.createUUID()" :is="item.componentName" :name="item.portletCodeName" :context="JSON.parse(JSON.stringify(context))" :viewDefaultUsage="false" :isAdaptiveSize="true" :viewState="viewState"></component>
</div>
</template>
</div>
</row>
</div>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch, Model,Inject } from 'vue-property-decorator';
import { CreateElement } from 'vue';
import { Subject, Subscription } from 'rxjs';
import { ControlInterface } from '@/interface/control';
import { UIActionTool,Util,ViewTool } from '@/utils';
import NavDataService from '@/service/app/navdata-service';
import AppCenterService from "@service/app/app-center-service";
import AppPortalView_dbService from './app-portal-view-db-dashboard-service';
import UtilService from '@/utilservice/util-service';
@Component({
components: {
}
})
export default class AppPortalView_dbBase extends Vue implements ControlInterface {
/**
* 名称
*
* @type {string}
* @memberof AppPortalView_dbBase
*/
@Prop() public name?: string;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof AppPortalView_dbBase
*/
@Prop() public viewState!: Subject<ViewState>;
/**
* 应用上下文
*
* @type {*}
* @memberof AppPortalView_dbBase
*/
@Prop() public context!: any;
/**
* 视图参数
*
* @type {*}
* @memberof AppPortalView_dbBase
*/
@Prop() public viewparams!: any;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof AppPortalView_dbBase
*/
public viewStateEvent: Subscription | undefined;
/**
* 获取部件类型
*
* @returns {string}
* @memberof AppPortalView_dbBase
*/
public getControlType(): string {
return 'DASHBOARD'
}
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof AppPortalView_dbBase
*/
public counterServiceArray:Array<any> = [];
/**
* 建构部件服务对象
*
* @type {AppPortalView_dbService}
* @memberof AppPortalView_dbBase
*/
public service: AppPortalView_dbService = new AppPortalView_dbService({ $store: this.$store });
/**
* 关闭视图
*
* @param {any} args
* @memberof AppPortalView_dbBase
*/
public closeView(args: any): void {
let _this: any = this;
_this.$emit('closeview', [args]);
}
/**
* 计数器刷新
*
* @memberof AppPortalView_dbBase
*/
public counterRefresh(){
const _this:any =this;
if(_this.counterServiceArray && _this.counterServiceArray.length >0){
_this.counterServiceArray.forEach((item:any) =>{
if(item.refreshData && item.refreshData instanceof Function){
item.refreshData();
}
})
}
}
/**
* 是否支持看板定制
*
* @public
* @type {(boolean)}
* @memberof AppPortalView_dbBase
*/
@Prop() public isEnableCustomized!:boolean;
/**
* 是否已有看板定制
*
* @public
* @type {(boolean)}
* @memberof AppPortalView_dbBase
*/
public isHasCustomized:boolean = false;
/**
* 模型数据
*
* @public
* @type {(*)}
* @memberof AppPortalView_dbBase
*/
public modelDta:any;
/**
* modleId
*
* @type {string}
* @memberof AppPortalView_dbBase
*/
public modelId:string = "dashboard_app_appportalview_db";
/**
* 建构功能服务对象
*
* @type {UtilService}
* @memberof AppPortalView_dbBase
*/
public utilService:UtilService = new UtilService();
/**
* 功能服务名称
*
* @type {string}
* @memberof AppPortalView_dbBase
*/
public utilServiceName:string = "";
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof AppPortalView_dbBase
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof AppPortalView_dbBase
*/
public getData(): any {
return {};
}
/**
* vue 生命周期
*
* @memberof AppPortalView_dbBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof AppPortalView_dbBase
*/
public afterCreated(){
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if (!Object.is(tag, this.name)) {
return;
}
if (Object.is('load', action)) {
this.loadModel();
}
});
}
}
/**
* 动态设计水平列数
*
* @memberof AppPortalView_dbBase
*/
public layoutColNum:number = 12;
/**
* 动态设计单元格高度,80px
*
* @memberof AppPortalView_dbBase
*/
public layoutRowH:number = 80;
/**
* 通知状态
*
* @memberof AppPortalView_dbBase
*/
public notifyState(){
this.$nextTick(() =>{
if (this.isHasCustomized) {
if (this.modelDta && this.modelDta.length > 0) {
this.modelDta.forEach((item: any) => {
this.viewState.next({
tag: item.portletCodeName,
action: "load",
data: JSON.parse(JSON.stringify(this.viewparams))
});
});
}
} else {
if (this.viewState) {
const refs: any = this.$refs;
Object.keys(refs).forEach((name: string) => {
this.viewState.next({
tag: name,
action: "load",
data: JSON.parse(JSON.stringify(this.viewparams))
});
});
}
}
})
}
/**
* 加载布局与数据模型
*
* @memberof AppPortalView_dbBase
*/
public loadModel(){
if(this.isEnableCustomized){
this.utilService.getService(this.utilServiceName).then((service:any) =>{
service.loadModelData(JSON.parse(JSON.stringify(this.context)),{modelid:this.modelId,utilServiceName:this.utilServiceName}).then((res:any) =>{
if(res && res.status == 200){
const data:any = res.data;
if(data && data.length >0){
this.isHasCustomized = true;
this.modelDta = data;
this.$forceUpdate();
}else{
this.isHasCustomized = false;
}
this.notifyState();
}else{
console.error("加载面板模型异常");
this.isHasCustomized = false;
this.notifyState();
}
}).catch((error:any)=>{
console.error("加载面板模型异常");
console.error(error);
this.isHasCustomized = false;
this.notifyState();
});
})
}else{
this.notifyState();
}
}
/**
* 处理私人定制按钮
*
* @memberof AppPortalView_dbBase
*/
public handleClick(){
const view:any ={
viewname: 'app-portal-design',
title: (this.$t('app.dashBoard.handleClick.title')),
width: 1600,
placement: 'DRAWER_RIGHT'
}
const viewparam:any ={
modelid:this.modelId,
utilServiceName:this.utilServiceName,
appdeName:'app'
}
const appdrawer = this.$appdrawer.openDrawer(view, JSON.parse(JSON.stringify(this.context)), viewparam);
appdrawer.subscribe((result: any) => {
if(Object.is(result.ret,'OK')){
this.loadModel();
}
});
}
/**
* vue 生命周期
*
* @memberof AppPortalView_dbBase
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof AppPortalView_dbBase
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
}
}
</script>
<style lang='less'>
@import './app-portal-view-db-dashboard.less';
</style>
\ No newline at end of file
/**
* AppPortalView_db 部件模型
*
* @export
* @class AppPortalView_dbModel
*/
export default class AppPortalView_dbModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof AppPortalView_dbModel
*/
public getDataItems(): any[] {
return [
]
}
}
\ No newline at end of file
import { Http } from '@/utils';
import ControlService from '@/widgets/control-service';
/**
* AppPortalView_db 部件服务对象
*
* @export
* @class AppPortalView_dbService
*/
export default class AppPortalView_dbService extends ControlService {
}
\ No newline at end of file
.dashboard {
flex-grow: 1;
height: 100%;
overflow: auto;
.portlet-without-title{
width: 100%;
}
.ivu-row{
.ivu-card{
.ivu-card-head{
border-bottom:0;
p{
display: flex;
height: 24px;
align-items: center;
.line{
width:100%;
border-bottom: 1px solid #e8eaec;
margin-left: 14px;
}
}
}
}
}
}
// this is less
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import AppPortalView_dbBase from './app-portal-view-db-dashboard-base.vue';
import view_db_rawitem1 from '@widgets/app/db-rawitem1-portlet/db-rawitem1-portlet.vue';
import view_db_rawitem6 from '@widgets/app/db-rawitem6-portlet/db-rawitem6-portlet.vue';
import view_db_rawitem4 from '@widgets/app/db-rawitem4-portlet/db-rawitem4-portlet.vue';
import view_db_rawitem5 from '@widgets/app/db-rawitem5-portlet/db-rawitem5-portlet.vue';
import view_db_rawitem2 from '@widgets/app/db-rawitem2-portlet/db-rawitem2-portlet.vue';
import view_db_rawitem3 from '@widgets/app/db-rawitem3-portlet/db-rawitem3-portlet.vue';
@Component({
components: {
view_db_rawitem1,
view_db_rawitem6,
view_db_rawitem4,
view_db_rawitem5,
view_db_rawitem2,
view_db_rawitem3,
}
})
export default class AppPortalView_db extends AppPortalView_dbBase {
}
</script>
\ No newline at end of file
<template>
<div class='portlet db-rawitem1 ' :style="{'height': isAdaptiveSize ? 'calc(100% - 16px)' : getHeight,}">
<div class="portlet-without-title">
<app-rawitem
:viewparams="viewparams"
:context="context"
contentStyle=""
sizeStyle="height: 100px;"
contentType="RAW"
:htmlContent='``'
>
</app-rawitem>
</div>
</div>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch, Model,Inject } from 'vue-property-decorator';
import { CreateElement } from 'vue';
import { Subject, Subscription } from 'rxjs';
import { ControlInterface } from '@/interface/control';
import { UIActionTool,Util, ViewTool } from '@/utils';
import NavDataService from '@/service/app/navdata-service';
import Db_rawitem1Service from './db-rawitem1-portlet-service';
import UIService from '@/uiservice/ui-service';
import { Environment } from '@/environments/environment';
@Component({
components: {
}
})
export default class Db_rawitem1Base extends Vue implements ControlInterface {
/**
* 名称
*
* @type {string}
* @memberof Db_rawitem1Base
*/
@Prop() public name?: string;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof Db_rawitem1Base
*/
@Prop() public viewState!: Subject<ViewState>;
/**
* 应用上下文
*
* @type {*}
* @memberof Db_rawitem1Base
*/
@Prop() public context!: any;
/**
* 视图参数
*
* @type {*}
* @memberof Db_rawitem1Base
*/
@Prop() public viewparams!: any;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof Db_rawitem1Base
*/
public viewStateEvent: Subscription | undefined;
/**
* 获取部件类型
*
* @returns {string}
* @memberof Db_rawitem1Base
*/
public getControlType(): string {
return 'PORTLET'
}
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof Db_rawitem1Base
*/
public counterServiceArray:Array<any> = [];
/**
* 建构部件服务对象
*
* @type {Db_rawitem1Service}
* @memberof Db_rawitem1Base
*/
public service: Db_rawitem1Service = new Db_rawitem1Service({ $store: this.$store });
/**
* 关闭视图
*
* @param {any} args
* @memberof Db_rawitem1Base
*/
public closeView(args: any): void {
let _this: any = this;
_this.$emit('closeview', [args]);
}
/**
* 计数器刷新
*
* @memberof Db_rawitem1Base
*/
public counterRefresh(){
const _this:any =this;
if(_this.counterServiceArray && _this.counterServiceArray.length >0){
_this.counterServiceArray.forEach((item:any) =>{
if(item.refreshData && item.refreshData instanceof Function){
item.refreshData();
}
})
}
}
/**
* 长度
*
* @type {number}
* @memberof Db_rawitem1Base
*/
@Prop() public height?: number;
/**
* 宽度
*
* @type {number}
* @memberof Db_rawitem1Base
*/
@Prop() public width?: number;
/**
* 门户部件类型
*
* @type {number}
* @memberof Db_rawitem1Base
*/
public portletType: string = 'rawitem';
/**
* 视图默认使用
*
* @type {string}
* @memberof Db_rawitem1Base
*/
@Inject({from:'navModel',default: 'tab'})
public navModel!:string;
/**
* 界面行为模型数据
*
* @memberof Db_rawitem1Base
*/
public uiactionModel: any = {
}
/**
* 是否自适应大小
*
* @returns {boolean}
* @memberof Db_rawitem1Base
*/
@Prop({default: false})public isAdaptiveSize!: boolean;
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof Db_rawitem1Base
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof Db_rawitem1Base
*/
public getData(): any {
return {};
}
/**
* 获取高度
*
* @returns {any[]}
* @memberof Db_rawitem1Base
*/
get getHeight(){
if(!this.$util.isEmpty(this.height) && !this.$util.isNumberNaN(this.height)){
if(this.height == 0){
return 'auto';
}else{
return this.height+'px';
}
}else{
return '100px';
}
}
/**
* 刷新
*
* @memberof Db_rawitem1Base
*/
public refresh(args?: any) {
}
/**
* vue 生命周期
*
* @memberof Db_rawitem1Base
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof Db_rawitem1Base
*/
public afterCreated(){
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if(Object.is(tag, "all-portlet") && Object.is(action,'loadmodel')){
this.calcUIActionAuthState(data);
}
if (!Object.is(tag, this.name)) {
return;
}
const refs: any = this.$refs;
Object.keys(refs).forEach((_name: string) => {
this.viewState.next({ tag: _name, action: action, data: data });
});
});
}
}
/**
* vue 生命周期
*
* @memberof Db_rawitem1Base
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof Db_rawitem1Base
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
}
/**
* 计算界面行为权限
*
* @memberof Db_rawitem1Base
*/
public calcUIActionAuthState(data:any = {}) {
// 如果是操作栏,不计算权限
if(this.portletType && Object.is('actionbar', this.portletType)) {
return;
}
let _this: any = this;
let uiservice: any = _this.appUIService ? _this.appUIService : new UIService(_this.$store);
if(_this.uiactionModel){
ViewTool.calcActionItemAuthState(data,_this.uiactionModel,uiservice);
}
}
}
</script>
<style lang='less'>
@import './db-rawitem1-portlet.less';
</style>
/**
* Db_rawitem1 部件模型
*
* @export
* @class Db_rawitem1Model
*/
export default class Db_rawitem1Model {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof Db_rawitem1Model
*/
public getDataItems(): any[] {
return [
]
}
}
import { Http } from '@/utils';
import ControlService from '@/widgets/control-service';
/**
* Db_rawitem1 部件服务对象
*
* @export
* @class Db_rawitem1Service
*/
export default class Db_rawitem1Service extends ControlService {
}
// this is less
.portlet{
height: 100%;
width: 100%;
> .portlet-title{
padding: 14px 16px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
height: 52px;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
justify-content: space-between;
width:100%;
line-height: 22px;
font-size: 16px;
font-weight: 500;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: #304265;
font-weight: 600;
i{
margin-right: 5px;
}
>.portlet-action{
margin-left: 12px;
font-size: 14px;
>a{
padding: 6px;
}
}
}
> .portlet-with-title{
width:100%;
height:calc(100% - 58px);
overflow:auto;
padding:0px 12px;
}
> .portlet-without-title{
width:100%;
height:100%;
overflow:auto;
padding:0px 12px;
}
.app-charts{
height: 100%!important;
}
.toolbar-container {
button{
margin: 6px 0px 4px 16px;
}
.ivu-badge{
.ivu-badge-count{
top: 0;
}
}
}
}
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import Db_rawitem1Base from './db-rawitem1-portlet-base.vue';
@Component({
components: {
}
})
export default class Db_rawitem1 extends Db_rawitem1Base {
}
</script>
<template>
<div class='portlet db-rawitem2 ' :style="{'height': isAdaptiveSize ? 'calc(100% - 16px)' : getHeight,}">
<p class='portlet-title'>
<span>
</span>
</p>
<el-divider class="divider"></el-divider>
<div class="portlet-with-title">
<app-rawitem
:viewparams="viewparams"
:context="context"
contentStyle=""
sizeStyle="height: 100px;"
contentType="RAW"
:htmlContent='``'
>
</app-rawitem>
</div>
</div>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch, Model,Inject } from 'vue-property-decorator';
import { CreateElement } from 'vue';
import { Subject, Subscription } from 'rxjs';
import { ControlInterface } from '@/interface/control';
import { UIActionTool,Util, ViewTool } from '@/utils';
import NavDataService from '@/service/app/navdata-service';
import Db_rawitem2Service from './db-rawitem2-portlet-service';
import UIService from '@/uiservice/ui-service';
import { Environment } from '@/environments/environment';
@Component({
components: {
}
})
export default class Db_rawitem2Base extends Vue implements ControlInterface {
/**
* 名称
*
* @type {string}
* @memberof Db_rawitem2Base
*/
@Prop() public name?: string;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof Db_rawitem2Base
*/
@Prop() public viewState!: Subject<ViewState>;
/**
* 应用上下文
*
* @type {*}
* @memberof Db_rawitem2Base
*/
@Prop() public context!: any;
/**
* 视图参数
*
* @type {*}
* @memberof Db_rawitem2Base
*/
@Prop() public viewparams!: any;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof Db_rawitem2Base
*/
public viewStateEvent: Subscription | undefined;
/**
* 获取部件类型
*
* @returns {string}
* @memberof Db_rawitem2Base
*/
public getControlType(): string {
return 'PORTLET'
}
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof Db_rawitem2Base
*/
public counterServiceArray:Array<any> = [];
/**
* 建构部件服务对象
*
* @type {Db_rawitem2Service}
* @memberof Db_rawitem2Base
*/
public service: Db_rawitem2Service = new Db_rawitem2Service({ $store: this.$store });
/**
* 关闭视图
*
* @param {any} args
* @memberof Db_rawitem2Base
*/
public closeView(args: any): void {
let _this: any = this;
_this.$emit('closeview', [args]);
}
/**
* 计数器刷新
*
* @memberof Db_rawitem2Base
*/
public counterRefresh(){
const _this:any =this;
if(_this.counterServiceArray && _this.counterServiceArray.length >0){
_this.counterServiceArray.forEach((item:any) =>{
if(item.refreshData && item.refreshData instanceof Function){
item.refreshData();
}
})
}
}
/**
* 长度
*
* @type {number}
* @memberof Db_rawitem2Base
*/
@Prop() public height?: number;
/**
* 宽度
*
* @type {number}
* @memberof Db_rawitem2Base
*/
@Prop() public width?: number;
/**
* 门户部件类型
*
* @type {number}
* @memberof Db_rawitem2Base
*/
public portletType: string = 'rawitem';
/**
* 视图默认使用
*
* @type {string}
* @memberof Db_rawitem2Base
*/
@Inject({from:'navModel',default: 'tab'})
public navModel!:string;
/**
* 界面行为模型数据
*
* @memberof Db_rawitem2Base
*/
public uiactionModel: any = {
}
/**
* 是否自适应大小
*
* @returns {boolean}
* @memberof Db_rawitem2Base
*/
@Prop({default: false})public isAdaptiveSize!: boolean;
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof Db_rawitem2Base
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof Db_rawitem2Base
*/
public getData(): any {
return {};
}
/**
* 获取高度
*
* @returns {any[]}
* @memberof Db_rawitem2Base
*/
get getHeight(){
if(!this.$util.isEmpty(this.height) && !this.$util.isNumberNaN(this.height)){
if(this.height == 0){
return 'auto';
}else{
return this.height+'px';
}
}else{
return '100px';
}
}
/**
* 刷新
*
* @memberof Db_rawitem2Base
*/
public refresh(args?: any) {
}
/**
* vue 生命周期
*
* @memberof Db_rawitem2Base
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof Db_rawitem2Base
*/
public afterCreated(){
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if(Object.is(tag, "all-portlet") && Object.is(action,'loadmodel')){
this.calcUIActionAuthState(data);
}
if (!Object.is(tag, this.name)) {
return;
}
const refs: any = this.$refs;
Object.keys(refs).forEach((_name: string) => {
this.viewState.next({ tag: _name, action: action, data: data });
});
});
}
}
/**
* vue 生命周期
*
* @memberof Db_rawitem2Base
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof Db_rawitem2Base
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
}
/**
* 计算界面行为权限
*
* @memberof Db_rawitem2Base
*/
public calcUIActionAuthState(data:any = {}) {
// 如果是操作栏,不计算权限
if(this.portletType && Object.is('actionbar', this.portletType)) {
return;
}
let _this: any = this;
let uiservice: any = _this.appUIService ? _this.appUIService : new UIService(_this.$store);
if(_this.uiactionModel){
ViewTool.calcActionItemAuthState(data,_this.uiactionModel,uiservice);
}
}
}
</script>
<style lang='less'>
@import './db-rawitem2-portlet.less';
</style>
/**
* Db_rawitem2 部件模型
*
* @export
* @class Db_rawitem2Model
*/
export default class Db_rawitem2Model {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof Db_rawitem2Model
*/
public getDataItems(): any[] {
return [
]
}
}
import { Http } from '@/utils';
import ControlService from '@/widgets/control-service';
/**
* Db_rawitem2 部件服务对象
*
* @export
* @class Db_rawitem2Service
*/
export default class Db_rawitem2Service extends ControlService {
}
// this is less
.portlet{
height: 100%;
width: 100%;
> .portlet-title{
padding: 14px 16px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
height: 52px;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
justify-content: space-between;
width:100%;
line-height: 22px;
font-size: 16px;
font-weight: 500;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: #304265;
font-weight: 600;
i{
margin-right: 5px;
}
>.portlet-action{
margin-left: 12px;
font-size: 14px;
>a{
padding: 6px;
}
}
}
> .divider {
margin: 0px 0px 11px 0px;
}
> .portlet-with-title{
width:100%;
height:calc(100% - 58px);
overflow:auto;
padding:0px 12px;
}
> .portlet-without-title{
width:100%;
height:100%;
overflow:auto;
padding:0px 12px;
}
.app-charts{
height: 100%!important;
}
.toolbar-container {
button{
margin: 6px 0px 4px 16px;
}
.ivu-badge{
.ivu-badge-count{
top: 0;
}
}
}
}
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import Db_rawitem2Base from './db-rawitem2-portlet-base.vue';
@Component({
components: {
}
})
export default class Db_rawitem2 extends Db_rawitem2Base {
}
</script>
<template>
<div class='portlet db-rawitem3 ' :style="{'height': isAdaptiveSize ? 'calc(100% - 16px)' : getHeight,}">
<p class='portlet-title'>
<span>
</span>
</p>
<el-divider class="divider"></el-divider>
<div class="portlet-with-title">
<app-rawitem
:viewparams="viewparams"
:context="context"
contentStyle=""
sizeStyle="height: 100px;"
contentType="RAW"
:htmlContent='``'
>
</app-rawitem>
</div>
</div>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch, Model,Inject } from 'vue-property-decorator';
import { CreateElement } from 'vue';
import { Subject, Subscription } from 'rxjs';
import { ControlInterface } from '@/interface/control';
import { UIActionTool,Util, ViewTool } from '@/utils';
import NavDataService from '@/service/app/navdata-service';
import Db_rawitem3Service from './db-rawitem3-portlet-service';
import UIService from '@/uiservice/ui-service';
import { Environment } from '@/environments/environment';
@Component({
components: {
}
})
export default class Db_rawitem3Base extends Vue implements ControlInterface {
/**
* 名称
*
* @type {string}
* @memberof Db_rawitem3Base
*/
@Prop() public name?: string;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof Db_rawitem3Base
*/
@Prop() public viewState!: Subject<ViewState>;
/**
* 应用上下文
*
* @type {*}
* @memberof Db_rawitem3Base
*/
@Prop() public context!: any;
/**
* 视图参数
*
* @type {*}
* @memberof Db_rawitem3Base
*/
@Prop() public viewparams!: any;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof Db_rawitem3Base
*/
public viewStateEvent: Subscription | undefined;
/**
* 获取部件类型
*
* @returns {string}
* @memberof Db_rawitem3Base
*/
public getControlType(): string {
return 'PORTLET'
}
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof Db_rawitem3Base
*/
public counterServiceArray:Array<any> = [];
/**
* 建构部件服务对象
*
* @type {Db_rawitem3Service}
* @memberof Db_rawitem3Base
*/
public service: Db_rawitem3Service = new Db_rawitem3Service({ $store: this.$store });
/**
* 关闭视图
*
* @param {any} args
* @memberof Db_rawitem3Base
*/
public closeView(args: any): void {
let _this: any = this;
_this.$emit('closeview', [args]);
}
/**
* 计数器刷新
*
* @memberof Db_rawitem3Base
*/
public counterRefresh(){
const _this:any =this;
if(_this.counterServiceArray && _this.counterServiceArray.length >0){
_this.counterServiceArray.forEach((item:any) =>{
if(item.refreshData && item.refreshData instanceof Function){
item.refreshData();
}
})
}
}
/**
* 长度
*
* @type {number}
* @memberof Db_rawitem3Base
*/
@Prop() public height?: number;
/**
* 宽度
*
* @type {number}
* @memberof Db_rawitem3Base
*/
@Prop() public width?: number;
/**
* 门户部件类型
*
* @type {number}
* @memberof Db_rawitem3Base
*/
public portletType: string = 'rawitem';
/**
* 视图默认使用
*
* @type {string}
* @memberof Db_rawitem3Base
*/
@Inject({from:'navModel',default: 'tab'})
public navModel!:string;
/**
* 界面行为模型数据
*
* @memberof Db_rawitem3Base
*/
public uiactionModel: any = {
}
/**
* 是否自适应大小
*
* @returns {boolean}
* @memberof Db_rawitem3Base
*/
@Prop({default: false})public isAdaptiveSize!: boolean;
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof Db_rawitem3Base
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof Db_rawitem3Base
*/
public getData(): any {
return {};
}
/**
* 获取高度
*
* @returns {any[]}
* @memberof Db_rawitem3Base
*/
get getHeight(){
if(!this.$util.isEmpty(this.height) && !this.$util.isNumberNaN(this.height)){
if(this.height == 0){
return 'auto';
}else{
return this.height+'px';
}
}else{
return '100px';
}
}
/**
* 刷新
*
* @memberof Db_rawitem3Base
*/
public refresh(args?: any) {
}
/**
* vue 生命周期
*
* @memberof Db_rawitem3Base
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof Db_rawitem3Base
*/
public afterCreated(){
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if(Object.is(tag, "all-portlet") && Object.is(action,'loadmodel')){
this.calcUIActionAuthState(data);
}
if (!Object.is(tag, this.name)) {
return;
}
const refs: any = this.$refs;
Object.keys(refs).forEach((_name: string) => {
this.viewState.next({ tag: _name, action: action, data: data });
});
});
}
}
/**
* vue 生命周期
*
* @memberof Db_rawitem3Base
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof Db_rawitem3Base
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
}
/**
* 计算界面行为权限
*
* @memberof Db_rawitem3Base
*/
public calcUIActionAuthState(data:any = {}) {
// 如果是操作栏,不计算权限
if(this.portletType && Object.is('actionbar', this.portletType)) {
return;
}
let _this: any = this;
let uiservice: any = _this.appUIService ? _this.appUIService : new UIService(_this.$store);
if(_this.uiactionModel){
ViewTool.calcActionItemAuthState(data,_this.uiactionModel,uiservice);
}
}
}
</script>
<style lang='less'>
@import './db-rawitem3-portlet.less';
</style>
/**
* Db_rawitem3 部件模型
*
* @export
* @class Db_rawitem3Model
*/
export default class Db_rawitem3Model {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof Db_rawitem3Model
*/
public getDataItems(): any[] {
return [
]
}
}
import { Http } from '@/utils';
import ControlService from '@/widgets/control-service';
/**
* Db_rawitem3 部件服务对象
*
* @export
* @class Db_rawitem3Service
*/
export default class Db_rawitem3Service extends ControlService {
}
// this is less
.portlet{
height: 100%;
width: 100%;
> .portlet-title{
padding: 14px 16px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
height: 52px;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
justify-content: space-between;
width:100%;
line-height: 22px;
font-size: 16px;
font-weight: 500;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: #304265;
font-weight: 600;
i{
margin-right: 5px;
}
>.portlet-action{
margin-left: 12px;
font-size: 14px;
>a{
padding: 6px;
}
}
}
> .divider {
margin: 0px 0px 11px 0px;
}
> .portlet-with-title{
width:100%;
height:calc(100% - 58px);
overflow:auto;
padding:0px 12px;
}
> .portlet-without-title{
width:100%;
height:100%;
overflow:auto;
padding:0px 12px;
}
.app-charts{
height: 100%!important;
}
.toolbar-container {
button{
margin: 6px 0px 4px 16px;
}
.ivu-badge{
.ivu-badge-count{
top: 0;
}
}
}
}
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import Db_rawitem3Base from './db-rawitem3-portlet-base.vue';
@Component({
components: {
}
})
export default class Db_rawitem3 extends Db_rawitem3Base {
}
</script>
<template>
<div class='portlet db-rawitem4 ' :style="{'height': isAdaptiveSize ? 'calc(100% - 16px)' : getHeight,}">
<p class='portlet-title'>
<span>
</span>
</p>
<el-divider class="divider"></el-divider>
<div class="portlet-with-title">
<app-rawitem
:viewparams="viewparams"
:context="context"
contentStyle=""
sizeStyle="height: 100px;"
contentType="RAW"
:htmlContent='``'
>
</app-rawitem>
</div>
</div>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch, Model,Inject } from 'vue-property-decorator';
import { CreateElement } from 'vue';
import { Subject, Subscription } from 'rxjs';
import { ControlInterface } from '@/interface/control';
import { UIActionTool,Util, ViewTool } from '@/utils';
import NavDataService from '@/service/app/navdata-service';
import Db_rawitem4Service from './db-rawitem4-portlet-service';
import UIService from '@/uiservice/ui-service';
import { Environment } from '@/environments/environment';
@Component({
components: {
}
})
export default class Db_rawitem4Base extends Vue implements ControlInterface {
/**
* 名称
*
* @type {string}
* @memberof Db_rawitem4Base
*/
@Prop() public name?: string;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof Db_rawitem4Base
*/
@Prop() public viewState!: Subject<ViewState>;
/**
* 应用上下文
*
* @type {*}
* @memberof Db_rawitem4Base
*/
@Prop() public context!: any;
/**
* 视图参数
*
* @type {*}
* @memberof Db_rawitem4Base
*/
@Prop() public viewparams!: any;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof Db_rawitem4Base
*/
public viewStateEvent: Subscription | undefined;
/**
* 获取部件类型
*
* @returns {string}
* @memberof Db_rawitem4Base
*/
public getControlType(): string {
return 'PORTLET'
}
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof Db_rawitem4Base
*/
public counterServiceArray:Array<any> = [];
/**
* 建构部件服务对象
*
* @type {Db_rawitem4Service}
* @memberof Db_rawitem4Base
*/
public service: Db_rawitem4Service = new Db_rawitem4Service({ $store: this.$store });
/**
* 关闭视图
*
* @param {any} args
* @memberof Db_rawitem4Base
*/
public closeView(args: any): void {
let _this: any = this;
_this.$emit('closeview', [args]);
}
/**
* 计数器刷新
*
* @memberof Db_rawitem4Base
*/
public counterRefresh(){
const _this:any =this;
if(_this.counterServiceArray && _this.counterServiceArray.length >0){
_this.counterServiceArray.forEach((item:any) =>{
if(item.refreshData && item.refreshData instanceof Function){
item.refreshData();
}
})
}
}
/**
* 长度
*
* @type {number}
* @memberof Db_rawitem4Base
*/
@Prop() public height?: number;
/**
* 宽度
*
* @type {number}
* @memberof Db_rawitem4Base
*/
@Prop() public width?: number;
/**
* 门户部件类型
*
* @type {number}
* @memberof Db_rawitem4Base
*/
public portletType: string = 'rawitem';
/**
* 视图默认使用
*
* @type {string}
* @memberof Db_rawitem4Base
*/
@Inject({from:'navModel',default: 'tab'})
public navModel!:string;
/**
* 界面行为模型数据
*
* @memberof Db_rawitem4Base
*/
public uiactionModel: any = {
}
/**
* 是否自适应大小
*
* @returns {boolean}
* @memberof Db_rawitem4Base
*/
@Prop({default: false})public isAdaptiveSize!: boolean;
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof Db_rawitem4Base
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof Db_rawitem4Base
*/
public getData(): any {
return {};
}
/**
* 获取高度
*
* @returns {any[]}
* @memberof Db_rawitem4Base
*/
get getHeight(){
if(!this.$util.isEmpty(this.height) && !this.$util.isNumberNaN(this.height)){
if(this.height == 0){
return 'auto';
}else{
return this.height+'px';
}
}else{
return '100px';
}
}
/**
* 刷新
*
* @memberof Db_rawitem4Base
*/
public refresh(args?: any) {
}
/**
* vue 生命周期
*
* @memberof Db_rawitem4Base
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof Db_rawitem4Base
*/
public afterCreated(){
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if(Object.is(tag, "all-portlet") && Object.is(action,'loadmodel')){
this.calcUIActionAuthState(data);
}
if (!Object.is(tag, this.name)) {
return;
}
const refs: any = this.$refs;
Object.keys(refs).forEach((_name: string) => {
this.viewState.next({ tag: _name, action: action, data: data });
});
});
}
}
/**
* vue 生命周期
*
* @memberof Db_rawitem4Base
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof Db_rawitem4Base
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
}
/**
* 计算界面行为权限
*
* @memberof Db_rawitem4Base
*/
public calcUIActionAuthState(data:any = {}) {
// 如果是操作栏,不计算权限
if(this.portletType && Object.is('actionbar', this.portletType)) {
return;
}
let _this: any = this;
let uiservice: any = _this.appUIService ? _this.appUIService : new UIService(_this.$store);
if(_this.uiactionModel){
ViewTool.calcActionItemAuthState(data,_this.uiactionModel,uiservice);
}
}
}
</script>
<style lang='less'>
@import './db-rawitem4-portlet.less';
</style>
/**
* Db_rawitem4 部件模型
*
* @export
* @class Db_rawitem4Model
*/
export default class Db_rawitem4Model {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof Db_rawitem4Model
*/
public getDataItems(): any[] {
return [
]
}
}
import { Http } from '@/utils';
import ControlService from '@/widgets/control-service';
/**
* Db_rawitem4 部件服务对象
*
* @export
* @class Db_rawitem4Service
*/
export default class Db_rawitem4Service extends ControlService {
}
// this is less
.portlet{
height: 100%;
width: 100%;
> .portlet-title{
padding: 14px 16px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
height: 52px;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
justify-content: space-between;
width:100%;
line-height: 22px;
font-size: 16px;
font-weight: 500;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: #304265;
font-weight: 600;
i{
margin-right: 5px;
}
>.portlet-action{
margin-left: 12px;
font-size: 14px;
>a{
padding: 6px;
}
}
}
> .divider {
margin: 0px 0px 11px 0px;
}
> .portlet-with-title{
width:100%;
height:calc(100% - 58px);
overflow:auto;
padding:0px 12px;
}
> .portlet-without-title{
width:100%;
height:100%;
overflow:auto;
padding:0px 12px;
}
.app-charts{
height: 100%!important;
}
.toolbar-container {
button{
margin: 6px 0px 4px 16px;
}
.ivu-badge{
.ivu-badge-count{
top: 0;
}
}
}
}
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import Db_rawitem4Base from './db-rawitem4-portlet-base.vue';
@Component({
components: {
}
})
export default class Db_rawitem4 extends Db_rawitem4Base {
}
</script>
<template>
<div class='portlet db-rawitem5 ' :style="{'height': isAdaptiveSize ? 'calc(100% - 16px)' : getHeight,}">
<div class="portlet-without-title">
<app-rawitem
:viewparams="viewparams"
:context="context"
contentStyle=""
sizeStyle="height: 400px;"
contentType="RAW"
:htmlContent='``'
>
</app-rawitem>
</div>
</div>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch, Model,Inject } from 'vue-property-decorator';
import { CreateElement } from 'vue';
import { Subject, Subscription } from 'rxjs';
import { ControlInterface } from '@/interface/control';
import { UIActionTool,Util, ViewTool } from '@/utils';
import NavDataService from '@/service/app/navdata-service';
import Db_rawitem5Service from './db-rawitem5-portlet-service';
import UIService from '@/uiservice/ui-service';
import { Environment } from '@/environments/environment';
@Component({
components: {
}
})
export default class Db_rawitem5Base extends Vue implements ControlInterface {
/**
* 名称
*
* @type {string}
* @memberof Db_rawitem5Base
*/
@Prop() public name?: string;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof Db_rawitem5Base
*/
@Prop() public viewState!: Subject<ViewState>;
/**
* 应用上下文
*
* @type {*}
* @memberof Db_rawitem5Base
*/
@Prop() public context!: any;
/**
* 视图参数
*
* @type {*}
* @memberof Db_rawitem5Base
*/
@Prop() public viewparams!: any;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof Db_rawitem5Base
*/
public viewStateEvent: Subscription | undefined;
/**
* 获取部件类型
*
* @returns {string}
* @memberof Db_rawitem5Base
*/
public getControlType(): string {
return 'PORTLET'
}
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof Db_rawitem5Base
*/
public counterServiceArray:Array<any> = [];
/**
* 建构部件服务对象
*
* @type {Db_rawitem5Service}
* @memberof Db_rawitem5Base
*/
public service: Db_rawitem5Service = new Db_rawitem5Service({ $store: this.$store });
/**
* 关闭视图
*
* @param {any} args
* @memberof Db_rawitem5Base
*/
public closeView(args: any): void {
let _this: any = this;
_this.$emit('closeview', [args]);
}
/**
* 计数器刷新
*
* @memberof Db_rawitem5Base
*/
public counterRefresh(){
const _this:any =this;
if(_this.counterServiceArray && _this.counterServiceArray.length >0){
_this.counterServiceArray.forEach((item:any) =>{
if(item.refreshData && item.refreshData instanceof Function){
item.refreshData();
}
})
}
}
/**
* 长度
*
* @type {number}
* @memberof Db_rawitem5Base
*/
@Prop() public height?: number;
/**
* 宽度
*
* @type {number}
* @memberof Db_rawitem5Base
*/
@Prop() public width?: number;
/**
* 门户部件类型
*
* @type {number}
* @memberof Db_rawitem5Base
*/
public portletType: string = 'rawitem';
/**
* 视图默认使用
*
* @type {string}
* @memberof Db_rawitem5Base
*/
@Inject({from:'navModel',default: 'tab'})
public navModel!:string;
/**
* 界面行为模型数据
*
* @memberof Db_rawitem5Base
*/
public uiactionModel: any = {
}
/**
* 是否自适应大小
*
* @returns {boolean}
* @memberof Db_rawitem5Base
*/
@Prop({default: false})public isAdaptiveSize!: boolean;
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof Db_rawitem5Base
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof Db_rawitem5Base
*/
public getData(): any {
return {};
}
/**
* 获取高度
*
* @returns {any[]}
* @memberof Db_rawitem5Base
*/
get getHeight(){
if(!this.$util.isEmpty(this.height) && !this.$util.isNumberNaN(this.height)){
if(this.height == 0){
return 'auto';
}else{
return this.height+'px';
}
}else{
return '400px';
}
}
/**
* 刷新
*
* @memberof Db_rawitem5Base
*/
public refresh(args?: any) {
}
/**
* vue 生命周期
*
* @memberof Db_rawitem5Base
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof Db_rawitem5Base
*/
public afterCreated(){
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if(Object.is(tag, "all-portlet") && Object.is(action,'loadmodel')){
this.calcUIActionAuthState(data);
}
if (!Object.is(tag, this.name)) {
return;
}
const refs: any = this.$refs;
Object.keys(refs).forEach((_name: string) => {
this.viewState.next({ tag: _name, action: action, data: data });
});
});
}
}
/**
* vue 生命周期
*
* @memberof Db_rawitem5Base
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof Db_rawitem5Base
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
}
/**
* 计算界面行为权限
*
* @memberof Db_rawitem5Base
*/
public calcUIActionAuthState(data:any = {}) {
// 如果是操作栏,不计算权限
if(this.portletType && Object.is('actionbar', this.portletType)) {
return;
}
let _this: any = this;
let uiservice: any = _this.appUIService ? _this.appUIService : new UIService(_this.$store);
if(_this.uiactionModel){
ViewTool.calcActionItemAuthState(data,_this.uiactionModel,uiservice);
}
}
}
</script>
<style lang='less'>
@import './db-rawitem5-portlet.less';
</style>
/**
* Db_rawitem5 部件模型
*
* @export
* @class Db_rawitem5Model
*/
export default class Db_rawitem5Model {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof Db_rawitem5Model
*/
public getDataItems(): any[] {
return [
]
}
}
import { Http } from '@/utils';
import ControlService from '@/widgets/control-service';
/**
* Db_rawitem5 部件服务对象
*
* @export
* @class Db_rawitem5Service
*/
export default class Db_rawitem5Service extends ControlService {
}
// this is less
.portlet{
height: 100%;
width: 100%;
> .portlet-title{
padding: 14px 16px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
height: 52px;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
justify-content: space-between;
width:100%;
line-height: 22px;
font-size: 16px;
font-weight: 500;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: #304265;
font-weight: 600;
i{
margin-right: 5px;
}
>.portlet-action{
margin-left: 12px;
font-size: 14px;
>a{
padding: 6px;
}
}
}
> .portlet-with-title{
width:100%;
height:calc(100% - 58px);
overflow:auto;
padding:0px 12px;
}
> .portlet-without-title{
width:100%;
height:100%;
overflow:auto;
padding:0px 12px;
}
.app-charts{
height: 100%!important;
}
.toolbar-container {
button{
margin: 6px 0px 4px 16px;
}
.ivu-badge{
.ivu-badge-count{
top: 0;
}
}
}
}
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import Db_rawitem5Base from './db-rawitem5-portlet-base.vue';
@Component({
components: {
}
})
export default class Db_rawitem5 extends Db_rawitem5Base {
}
</script>
<template>
<div class='portlet db-rawitem6 ' :style="{'height': isAdaptiveSize ? 'calc(100% - 16px)' : getHeight,}">
<p class='portlet-title'>
<span>
</span>
</p>
<el-divider class="divider"></el-divider>
<div class="portlet-with-title">
<app-rawitem
:viewparams="viewparams"
:context="context"
contentStyle=""
sizeStyle="height: 400px;"
contentType="RAW"
:htmlContent='``'
>
</app-rawitem>
</div>
</div>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch, Model,Inject } from 'vue-property-decorator';
import { CreateElement } from 'vue';
import { Subject, Subscription } from 'rxjs';
import { ControlInterface } from '@/interface/control';
import { UIActionTool,Util, ViewTool } from '@/utils';
import NavDataService from '@/service/app/navdata-service';
import Db_rawitem6Service from './db-rawitem6-portlet-service';
import UIService from '@/uiservice/ui-service';
import { Environment } from '@/environments/environment';
@Component({
components: {
}
})
export default class Db_rawitem6Base extends Vue implements ControlInterface {
/**
* 名称
*
* @type {string}
* @memberof Db_rawitem6Base
*/
@Prop() public name?: string;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof Db_rawitem6Base
*/
@Prop() public viewState!: Subject<ViewState>;
/**
* 应用上下文
*
* @type {*}
* @memberof Db_rawitem6Base
*/
@Prop() public context!: any;
/**
* 视图参数
*
* @type {*}
* @memberof Db_rawitem6Base
*/
@Prop() public viewparams!: any;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof Db_rawitem6Base
*/
public viewStateEvent: Subscription | undefined;
/**
* 获取部件类型
*
* @returns {string}
* @memberof Db_rawitem6Base
*/
public getControlType(): string {
return 'PORTLET'
}
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof Db_rawitem6Base
*/
public counterServiceArray:Array<any> = [];
/**
* 建构部件服务对象
*
* @type {Db_rawitem6Service}
* @memberof Db_rawitem6Base
*/
public service: Db_rawitem6Service = new Db_rawitem6Service({ $store: this.$store });
/**
* 关闭视图
*
* @param {any} args
* @memberof Db_rawitem6Base
*/
public closeView(args: any): void {
let _this: any = this;
_this.$emit('closeview', [args]);
}
/**
* 计数器刷新
*
* @memberof Db_rawitem6Base
*/
public counterRefresh(){
const _this:any =this;
if(_this.counterServiceArray && _this.counterServiceArray.length >0){
_this.counterServiceArray.forEach((item:any) =>{
if(item.refreshData && item.refreshData instanceof Function){
item.refreshData();
}
})
}
}
/**
* 长度
*
* @type {number}
* @memberof Db_rawitem6Base
*/
@Prop() public height?: number;
/**
* 宽度
*
* @type {number}
* @memberof Db_rawitem6Base
*/
@Prop() public width?: number;
/**
* 门户部件类型
*
* @type {number}
* @memberof Db_rawitem6Base
*/
public portletType: string = 'rawitem';
/**
* 视图默认使用
*
* @type {string}
* @memberof Db_rawitem6Base
*/
@Inject({from:'navModel',default: 'tab'})
public navModel!:string;
/**
* 界面行为模型数据
*
* @memberof Db_rawitem6Base
*/
public uiactionModel: any = {
}
/**
* 是否自适应大小
*
* @returns {boolean}
* @memberof Db_rawitem6Base
*/
@Prop({default: false})public isAdaptiveSize!: boolean;
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof Db_rawitem6Base
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof Db_rawitem6Base
*/
public getData(): any {
return {};
}
/**
* 获取高度
*
* @returns {any[]}
* @memberof Db_rawitem6Base
*/
get getHeight(){
if(!this.$util.isEmpty(this.height) && !this.$util.isNumberNaN(this.height)){
if(this.height == 0){
return 'auto';
}else{
return this.height+'px';
}
}else{
return '400px';
}
}
/**
* 刷新
*
* @memberof Db_rawitem6Base
*/
public refresh(args?: any) {
}
/**
* vue 生命周期
*
* @memberof Db_rawitem6Base
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof Db_rawitem6Base
*/
public afterCreated(){
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if(Object.is(tag, "all-portlet") && Object.is(action,'loadmodel')){
this.calcUIActionAuthState(data);
}
if (!Object.is(tag, this.name)) {
return;
}
const refs: any = this.$refs;
Object.keys(refs).forEach((_name: string) => {
this.viewState.next({ tag: _name, action: action, data: data });
});
});
}
}
/**
* vue 生命周期
*
* @memberof Db_rawitem6Base
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof Db_rawitem6Base
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
}
/**
* 计算界面行为权限
*
* @memberof Db_rawitem6Base
*/
public calcUIActionAuthState(data:any = {}) {
// 如果是操作栏,不计算权限
if(this.portletType && Object.is('actionbar', this.portletType)) {
return;
}
let _this: any = this;
let uiservice: any = _this.appUIService ? _this.appUIService : new UIService(_this.$store);
if(_this.uiactionModel){
ViewTool.calcActionItemAuthState(data,_this.uiactionModel,uiservice);
}
}
}
</script>
<style lang='less'>
@import './db-rawitem6-portlet.less';
</style>
/**
* Db_rawitem6 部件模型
*
* @export
* @class Db_rawitem6Model
*/
export default class Db_rawitem6Model {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof Db_rawitem6Model
*/
public getDataItems(): any[] {
return [
]
}
}
import { Http } from '@/utils';
import ControlService from '@/widgets/control-service';
/**
* Db_rawitem6 部件服务对象
*
* @export
* @class Db_rawitem6Service
*/
export default class Db_rawitem6Service extends ControlService {
}
// this is less
.portlet{
height: 100%;
width: 100%;
> .portlet-title{
padding: 14px 16px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
height: 52px;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
justify-content: space-between;
width:100%;
line-height: 22px;
font-size: 16px;
font-weight: 500;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: #304265;
font-weight: 600;
i{
margin-right: 5px;
}
>.portlet-action{
margin-left: 12px;
font-size: 14px;
>a{
padding: 6px;
}
}
}
> .divider {
margin: 0px 0px 11px 0px;
}
> .portlet-with-title{
width:100%;
height:calc(100% - 58px);
overflow:auto;
padding:0px 12px;
}
> .portlet-without-title{
width:100%;
height:100%;
overflow:auto;
padding:0px 12px;
}
.app-charts{
height: 100%!important;
}
.toolbar-container {
button{
margin: 6px 0px 4px 16px;
}
.ivu-badge{
.ivu-badge-count{
top: 0;
}
}
}
}
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import Db_rawitem6Base from './db-rawitem6-portlet-base.vue';
@Component({
components: {
}
})
export default class Db_rawitem6 extends Db_rawitem6Base {
}
</script>
...@@ -755,6 +755,9 @@ export default class MainMenuBase extends Vue implements ControlInterface { ...@@ -755,6 +755,9 @@ export default class MainMenuBase extends Vue implements ControlInterface {
case 'AppFunc30': case 'AppFunc30':
this.clickAppFunc30(item); this.clickAppFunc30(item);
return; return;
case 'AppFunc66':
this.clickAppFunc66(item);
return;
case 'AppFunc5': case 'AppFunc5':
this.clickAppFunc5(item); this.clickAppFunc5(item);
return; return;
...@@ -2683,6 +2686,28 @@ export default class MainMenuBase extends Vue implements ControlInterface { ...@@ -2683,6 +2686,28 @@ export default class MainMenuBase extends Vue implements ControlInterface {
}) })
} }
/**
* 应用门户视图
*
* @param {*} [item={}]
* @memberof MainMenu
*/
public clickAppFunc66(item: any = {}) {
const viewparam: any = {};
Object.assign(viewparam, {});
const deResParameters: any[] = [];
const parameters: any[] = [
{ pathName: 'appportalview', parameterName: 'appportalview' },
];
const path: string = this.$viewTool.buildUpRoutePath(this.$route, {}, deResParameters, parameters, [], viewparam);
if(Object.is(this.$route.fullPath,path)){
return;
}
this.$nextTick(function(){
this.$router.push(path);
})
}
/** /**
* 图书表格视图-更新默认值 * 图书表格视图-更新默认值
* *
......
...@@ -1986,7 +1986,7 @@ export default class MainMenuModel { ...@@ -1986,7 +1986,7 @@ export default class MainMenuModel {
iconcls: '', iconcls: '',
icon: '', icon: '',
textcls: '', textcls: '',
appfunctag: '', appfunctag: 'AppFunc66',
resourcetag: '', resourcetag: '',
authtag:'Web-MainMenu-menuitem148', authtag:'Web-MainMenu-menuitem148',
}, },
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册