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

jackwang 部署微服务应用

上级 0e1f7730
......@@ -319,6 +319,16 @@
"viewtag": "bf8512a46ea22c59413ae598a88eda3a",
"memo": ""
},
"hromhierarchycatdashboardview": {
"title": "结构层次类别看板",
"caption": "结构层次",
"viewtype": "DEPORTALVIEW",
"viewmodule": "Base",
"viewname": "HROMHierarchyCatDashboardView",
"viewfilename": "hromhierarchy-cat-dashboard-view",
"viewtag": "c62ff001669cca98c0a2a7bc3383c775",
"memo": ""
},
"hroperationunitv_001": {
"title": "快速新建",
"caption": "快速新建",
......
......@@ -34,6 +34,10 @@ export default {
caption: "结构层次类别",
title: "结构层次类别编辑视图",
},
dashboardview: {
caption: "结构层次",
title: "结构层次类别看板",
},
},
main_form: {
details: {
......
......@@ -33,6 +33,10 @@ export default {
caption: "结构层次类别",
title: "结构层次类别编辑视图",
},
dashboardview: {
caption: "结构层次",
title: "结构层次类别看板",
},
},
main_form: {
details: {
......
......@@ -263,6 +263,14 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => {
"viewname": "HROperationUnitTabExpView",
"viewtag": "bf8512a46ea22c59413ae598a88eda3a"
},
"hromhierarchycatdashboardview": {
"title": "结构层次类别看板",
"caption": "结构层次",
"viewtype": "DEPORTALVIEW",
"viewmodule": "Base",
"viewname": "HROMHierarchyCatDashboardView",
"viewtag": "c62ff001669cca98c0a2a7bc3383c775"
},
"hroperationunitv_001": {
"title": "快速新建",
"caption": "快速新建",
......
import { Subject } from 'rxjs';
import { DashboardViewBase } from '@/studio-core';
import HROMHierarchyCatService from '@/service/hromhierarchy-cat/hromhierarchy-cat-service';
import HROMHierarchyCatAuthService from '@/authservice/hromhierarchy-cat/hromhierarchy-cat-auth-service';
import PortalViewEngine from '@engine/view/portal-view-engine';
import HROMHierarchyCatUIService from '@/uiservice/hromhierarchy-cat/hromhierarchy-cat-ui-service';
/**
* 结构层次类别看板视图基类
*
* @export
* @class HROMHierarchyCatDashboardViewBase
* @extends {DashboardViewBase}
*/
export class HROMHierarchyCatDashboardViewBase extends DashboardViewBase {
/**
* 视图对应应用实体名称
*
* @protected
* @type {string}
* @memberof HROMHierarchyCatDashboardViewBase
*/
protected appDeName: string = 'hromhierarchycat';
/**
* 应用实体主键
*
* @protected
* @type {string}
* @memberof HROMHierarchyCatDashboardViewBase
*/
protected appDeKey: string = 'omhierarchycatid';
/**
* 应用实体主信息
*
* @protected
* @type {string}
* @memberof HROMHierarchyCatDashboardViewBase
*/
protected appDeMajor: string = 'omhierarchycatname';
/**
* 实体服务对象
*
* @type {HROMHierarchyCatService}
* @memberof HROMHierarchyCatDashboardViewBase
*/
protected appEntityService: HROMHierarchyCatService = new HROMHierarchyCatService;
/**
* 实体权限服务对象
*
* @type HROMHierarchyCatUIService
* @memberof HROMHierarchyCatDashboardViewBase
*/
public appUIService: HROMHierarchyCatUIService = new HROMHierarchyCatUIService(this.$store);
/**
* 计数器服务对象集合
*
* @protected
* @type {Array<*>}
* @memberof HROMHierarchyCatDashboardViewBase
*/
protected counterServiceArray: Array<any> = [];
/**
* 视图模型数据
*
* @protected
* @type {*}
* @memberof HROMHierarchyCatDashboardViewBase
*/
protected model: any = {
srfCaption: 'entities.hromhierarchycat.views.dashboardview.caption',
srfTitle: 'entities.hromhierarchycat.views.dashboardview.title',
srfSubTitle: 'entities.hromhierarchycat.views.dashboardview.subtitle',
dataInfo: ''
}
/**
* 容器模型
*
* @protected
* @type {*}
* @memberof HROMHierarchyCatDashboardViewBase
*/
protected containerModel: any = {
view_dashboard: { name: 'dashboard', type: 'DASHBOARD' },
};
/**
* 视图唯一标识
*
* @protected
* @type {string}
* @memberof ViewBase
*/
protected viewtag: string = 'c62ff001669cca98c0a2a7bc3383c775';
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof HROMHierarchyCatDashboardViewBase
*/
public engine: PortalViewEngine = new PortalViewEngine();
/**
* 引擎初始化
*
* @public
* @memberof HROMHierarchyCatDashboardViewBase
*/
public engineInit(): void {
this.engine.init({
view: this,
dashboard: this.$refs.dashboard,
keyPSDEField: 'hromhierarchycat',
majorPSDEField: 'omhierarchycatname',
isLoadDefault: true,
});
}
/**
* dashboard 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof HROMHierarchyCatDashboardViewBase
*/
public dashboard_load($event: any, $event2?: any): void {
this.engine.onCtrlEvent('dashboard', 'load', $event);
}
}
\ No newline at end of file
<studio-view-style2 viewName="hromhierarchycatdashboardview" viewTitle="结构层次类别看板" class='deportalview hromhierarchy-cat-dashboard-view'>
<view_dashboard
:viewState="viewState"
:viewparams="viewparams"
:context="JSON.parse(JSON.stringify(context))"
:isEnableCustomized = "false"
name="dashboard"
ref='dashboard'
@load="dashboard_load($event)"
@closeview="closeView($event)">
</view_dashboard>
</studio-view-style2>
\ No newline at end of file
<template src="./hromhierarchy-cat-dashboard-view.html"/>
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { HROMHierarchyCatDashboardViewBase } from './hromhierarchy-cat-dashboard-view-base';
import view_dashboard from '@widgets/hromhierarchy-cat/board-001-dashboard/board-001-dashboard.vue';
/**
* 结构层次类别看板视图
*
* @export
* @class HROMHierarchyCatDashboardView
* @extends {HROMHierarchyCatDashboardViewBase}
*/
@Component({
components: {
view_dashboard,
}
})
@VueLifeCycleProcessing()
export default class HROMHierarchyCatDashboardView extends HROMHierarchyCatDashboardViewBase { }
</script>
......@@ -610,7 +610,7 @@ export class HROMHierarchyCatGridViewBase extends GridViewBase {
const deResParameters: any[] = [];
const parameters: any[] = [
{ pathName: 'hromhierarchycats', parameterName: 'hromhierarchycat' },
{ pathName: 'v_002', parameterName: 'v_002' },
{ pathName: 'dashboardview', parameterName: 'dashboardview' },
];
const _this: any = this;
const openIndexViewTab = (data: any) => {
......
......@@ -18,12 +18,13 @@ export const PageComponents = {
Vue.component('hroperation-unit-v-002', () => import('@pages/base/hroperation-unit-v-002/hroperation-unit-v-002.vue'));
Vue.component('hromhierarchy-cat-pickup-view', () => import('@pages/base/hromhierarchy-cat-pickup-view/hromhierarchy-cat-pickup-view.vue'));
Vue.component('hrlegal-edit-view', () => import('@pages/base/hrlegal-edit-view/hrlegal-edit-view.vue'));
Vue.component('hromhierarchy-cat-dashboard-view', () => import('@pages/base/hromhierarchy-cat-dashboard-view/hromhierarchy-cat-dashboard-view.vue'));
Vue.component('hrorganization-pickup-view', () => import('@pages/base/hrorganization-pickup-view/hrorganization-pickup-view.vue'));
Vue.component('hrorganization-grid-view', () => import('@pages/base/hrorganization-grid-view/hrorganization-grid-view.vue'));
Vue.component('hromhierarchy-edit-view', () => import('@pages/base/hromhierarchy-edit-view/hromhierarchy-edit-view.vue'));
Vue.component('hromhierarchy-cat-edit-view', () => import('@pages/base/hromhierarchy-cat-edit-view/hromhierarchy-cat-edit-view.vue'));
Vue.component('hrorg-contact-edit-view', () => import('@pages/base/hrorg-contact-edit-view/hrorg-contact-edit-view.vue'));
Vue.component('hromhierarchy-tree-exp-view', () => import('@pages/base/hromhierarchy-tree-exp-view/hromhierarchy-tree-exp-view.vue'));
Vue.component('hrorg-contact-edit-view', () => import('@pages/base/hrorg-contact-edit-view/hrorg-contact-edit-view.vue'));
Vue.component('hrlegal-grid-view', () => import('@pages/base/hrlegal-grid-view/hrlegal-grid-view.vue'));
Vue.component('hrlegal-v-002', () => import('@pages/base/hrlegal-v-002/hrlegal-v-002.vue'));
Vue.component('hroperation-unit-tab-exp-view', () => import('@pages/base/hroperation-unit-tab-exp-view/hroperation-unit-tab-exp-view.vue'));
......
......@@ -445,6 +445,20 @@ const router = new Router({
},
component: () => import('@pages/base/hrlegal-edit-view/hrlegal-edit-view.vue'),
},
{
path: 'hromhierarchycats/:hromhierarchycat?/dashboardview/:dashboardview?',
meta: {
caption: 'entities.hromhierarchycat.views.dashboardview.title',
info:'',
parameters: [
{ pathName: 'pim', parameterName: 'pim' },
{ pathName: 'hromhierarchycats', parameterName: 'hromhierarchycat' },
{ pathName: 'dashboardview', parameterName: 'dashboardview' },
],
requireAuth: true,
},
component: () => import('@pages/base/hromhierarchy-cat-dashboard-view/hromhierarchy-cat-dashboard-view.vue'),
},
{
path: 'hrorganizations/:hrorganization?/pickupview/:pickupview?',
meta: {
......@@ -517,42 +531,42 @@ const router = new Router({
component: () => import('@pages/base/hromhierarchy-cat-edit-view/hromhierarchy-cat-edit-view.vue'),
},
{
path: 'hroperationunits/:hroperationunit?/hrorgcontacts/:hrorgcontact?/editview/:editview?',
path: 'hromhierarchycats/:hromhierarchycat?/hromhierarchies/:hromhierarchy?/treeexpview/:treeexpview?',
meta: {
caption: 'entities.hrorgcontact.views.editview.title',
caption: 'entities.hromhierarchy.views.treeexpview.title',
info:'',
parameters: [
{ pathName: 'pim', parameterName: 'pim' },
{ pathName: 'hroperationunits', parameterName: 'hroperationunit' },
{ pathName: 'hrorgcontacts', parameterName: 'hrorgcontact' },
{ pathName: 'editview', parameterName: 'editview' },
{ pathName: 'hromhierarchycats', parameterName: 'hromhierarchycat' },
{ pathName: 'hromhierarchies', parameterName: 'hromhierarchy' },
{ pathName: 'treeexpview', parameterName: 'treeexpview' },
],
requireAuth: true,
},
component: () => import('@pages/base/hrorg-contact-edit-view/hrorg-contact-edit-view.vue'),
component: () => import('@pages/base/hromhierarchy-tree-exp-view/hromhierarchy-tree-exp-view.vue'),
},
{
path: 'hrlegals/:hrlegal?/hrorgcontacts/:hrorgcontact?/editview/:editview?',
path: 'hromhierarchies/:hromhierarchy?/treeexpview/:treeexpview?',
meta: {
caption: 'entities.hrorgcontact.views.editview.title',
caption: 'entities.hromhierarchy.views.treeexpview.title',
info:'',
parameters: [
{ pathName: 'pim', parameterName: 'pim' },
{ pathName: 'hrlegals', parameterName: 'hrlegal' },
{ pathName: 'hrorgcontacts', parameterName: 'hrorgcontact' },
{ pathName: 'editview', parameterName: 'editview' },
{ pathName: 'hromhierarchies', parameterName: 'hromhierarchy' },
{ pathName: 'treeexpview', parameterName: 'treeexpview' },
],
requireAuth: true,
},
component: () => import('@pages/base/hrorg-contact-edit-view/hrorg-contact-edit-view.vue'),
component: () => import('@pages/base/hromhierarchy-tree-exp-view/hromhierarchy-tree-exp-view.vue'),
},
{
path: 'hrorgcontacts/:hrorgcontact?/editview/:editview?',
path: 'hroperationunits/:hroperationunit?/hrorgcontacts/:hrorgcontact?/editview/:editview?',
meta: {
caption: 'entities.hrorgcontact.views.editview.title',
info:'',
parameters: [
{ pathName: 'pim', parameterName: 'pim' },
{ pathName: 'hroperationunits', parameterName: 'hroperationunit' },
{ pathName: 'hrorgcontacts', parameterName: 'hrorgcontact' },
{ pathName: 'editview', parameterName: 'editview' },
],
......@@ -561,33 +575,33 @@ const router = new Router({
component: () => import('@pages/base/hrorg-contact-edit-view/hrorg-contact-edit-view.vue'),
},
{
path: 'hromhierarchycats/:hromhierarchycat?/hromhierarchies/:hromhierarchy?/treeexpview/:treeexpview?',
path: 'hrlegals/:hrlegal?/hrorgcontacts/:hrorgcontact?/editview/:editview?',
meta: {
caption: 'entities.hromhierarchy.views.treeexpview.title',
caption: 'entities.hrorgcontact.views.editview.title',
info:'',
parameters: [
{ pathName: 'pim', parameterName: 'pim' },
{ pathName: 'hromhierarchycats', parameterName: 'hromhierarchycat' },
{ pathName: 'hromhierarchies', parameterName: 'hromhierarchy' },
{ pathName: 'treeexpview', parameterName: 'treeexpview' },
{ pathName: 'hrlegals', parameterName: 'hrlegal' },
{ pathName: 'hrorgcontacts', parameterName: 'hrorgcontact' },
{ pathName: 'editview', parameterName: 'editview' },
],
requireAuth: true,
},
component: () => import('@pages/base/hromhierarchy-tree-exp-view/hromhierarchy-tree-exp-view.vue'),
component: () => import('@pages/base/hrorg-contact-edit-view/hrorg-contact-edit-view.vue'),
},
{
path: 'hromhierarchies/:hromhierarchy?/treeexpview/:treeexpview?',
path: 'hrorgcontacts/:hrorgcontact?/editview/:editview?',
meta: {
caption: 'entities.hromhierarchy.views.treeexpview.title',
caption: 'entities.hrorgcontact.views.editview.title',
info:'',
parameters: [
{ pathName: 'pim', parameterName: 'pim' },
{ pathName: 'hromhierarchies', parameterName: 'hromhierarchy' },
{ pathName: 'treeexpview', parameterName: 'treeexpview' },
{ pathName: 'hrorgcontacts', parameterName: 'hrorgcontact' },
{ pathName: 'editview', parameterName: 'editview' },
],
requireAuth: true,
},
component: () => import('@pages/base/hromhierarchy-tree-exp-view/hromhierarchy-tree-exp-view.vue'),
component: () => import('@pages/base/hrorg-contact-edit-view/hrorg-contact-edit-view.vue'),
},
{
path: 'hrlegals/:hrlegal?/gridview/:gridview?',
......
......@@ -49,8 +49,8 @@ export const viewstate: any = {
viewaction: '',
viewdatachange: false,
refviews: [
'c62ff001669cca98c0a2a7bc3383c775',
'aa2c4d945f9d880dd836ebe74ca9f547',
'1316a3add8f01af03edf978ef21af6b1',
],
},
{
......@@ -313,6 +313,16 @@ export const viewstate: any = {
'2b64c322042da1808776304d21c90e45',
],
},
{
viewtag: 'c62ff001669cca98c0a2a7bc3383c775',
viewmodule: 'Base',
viewname: 'HROMHierarchyCatDashboardView',
viewaction: '',
viewdatachange: false,
refviews: [
'1316a3add8f01af03edf978ef21af6b1',
],
},
{
viewtag: 'd32b549b3c49b790b092eca97d1de2c1',
viewmodule: 'Base',
......
......@@ -95,6 +95,7 @@ export default class HROMHierarchyCatUIServiceBase extends UIService {
this.allViewMap.set('MPICKUPVIEW:',{viewname:'mpickupview',srfappde:'hromhierarchycats'});
this.allViewMap.set('PICKUPVIEW:',{viewname:'pickupview',srfappde:'hromhierarchycats'});
this.allViewMap.set('EDITVIEW:',{viewname:'editview',srfappde:'hromhierarchycats'});
this.allViewMap.set(':',{viewname:'dashboardview',srfappde:'hromhierarchycats'});
}
/**
......
import { Prop, Provide, Emit, Model } from 'vue-property-decorator';
import { Subject, Subscription } from 'rxjs';
import { Watch, MainControlBase } from '@/studio-core';
import HROMHierarchyCatService from '@/service/hromhierarchy-cat/hromhierarchy-cat-service';
import BOARD_001Service from './board-001-dashboard-service';
import HROMHierarchyCatUIService from '@/uiservice/hromhierarchy-cat/hromhierarchy-cat-ui-service';
import UtilService from '@/utilservice/util-service';
/**
* dashboard部件基类
*
* @export
* @class MainControlBase
* @extends {BOARD_001DashboardBase}
*/
export class BOARD_001DashboardBase extends MainControlBase {
/**
* 获取部件类型
*
* @protected
* @type {string}
* @memberof BOARD_001DashboardBase
*/
protected controlType: string = 'DASHBOARD';
/**
* 建构部件服务对象
*
* @type {BOARD_001Service}
* @memberof BOARD_001DashboardBase
*/
public service: BOARD_001Service = new BOARD_001Service({ $store: this.$store });
/**
* 实体服务对象
*
* @type {HROMHierarchyCatService}
* @memberof BOARD_001DashboardBase
*/
public appEntityService: HROMHierarchyCatService = new HROMHierarchyCatService({ $store: this.$store });
/**
* 应用实体名称
*
* @protected
* @type {string}
* @memberof BOARD_001DashboardBase
*/
protected appDeName: string = 'hromhierarchycat';
/**
* 是否支持看板定制
*
* @public
* @type {(boolean)}
* @memberof BOARD_001
*/
@Prop() public isEnableCustomized!:boolean;
/**
* 是否已有看板定制
*
* @public
* @type {(boolean)}
* @memberof BOARD_001
*/
public isHasCustomized:boolean = false;
/**
* 模型数据
*
* @public
* @type {(*)}
* @memberof BOARD_001
*/
public modelDta:any;
/**
* modleId
*
* @type {string}
* @memberof BOARD_001
*/
public modelId:string = "dashboard_hromhierarchycat_board_001";
/**
* 建构功能服务对象
*
* @type {UtilService}
* @memberof BOARD_001
*/
public utilService:UtilService = new UtilService();
/**
* 功能服务名称
*
* @type {string}
* @memberof BOARD_001
*/
public utilServiceName:string = "";
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof BOARD_001
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof BOARD_001
*/
public getData(): any {
return {};
}
/**
* vue 生命周期
*
* @memberof BOARD_001
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof BOARD_001
*/
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 BOARD_001
*/
public layoutColNum:number = 12;
/**
* 动态设计单元格高度,80px
*
* @memberof BOARD_001
*/
public layoutRowH:number = 80;
/**
* 通知状态
*
* @memberof BOARD_001
*/
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 BOARD_001
*/
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 BOARD_001
*/
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:'HROMHierarchyCat'
}
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 BOARD_001
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof BOARD_001
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
}
}
\ No newline at end of file
/**
* BOARD_001 部件模型
*
* @export
* @class BOARD_001Model
*/
export default class BOARD_001Model {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof BOARD_001Model
*/
public getDataItems(): any[] {
return [
{
name: 'hromhierarchycat',
prop: 'omhierarchycatid',
},
{
name: 'omhierarchycatname',
},
{
name: 'createman',
},
{
name: 'createdate',
},
{
name: 'updateman',
},
{
name: 'updatedate',
},
{
name: 'memo',
},
]
}
}
\ No newline at end of file
import { Http } from '@/utils';
import ControlService from '@/widgets/control-service';
/**
* BOARD_001 部件服务对象
*
* @export
* @class BOARD_001Service
*/
export default class BOARD_001Service extends ControlService {
}
\ No newline at end of file
<div class='dashboard'>
<row v-if="isEnableCustomized">
<app-build @handleClick="handleClick.apply(_self, arguments)"></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 dashboard-viewdashboard-container1 portlet-container-no-border' :style="{}">
<row>
<i-col :md="{ span: 24, offset: 0 }">
<div class="portlet-without-title">
<card class="portlet-card" :bordered="false" dis-hover :padding="0">
<span>
<view_dashboard_sysportlet1
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:height="0"
:width="0"
name="dashboard_sysportlet1"
ref='dashboard_sysportlet1'
@closeview="closeView($event)">
</view_dashboard_sysportlet1>
</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>
\ No newline at end of file
<template src="./board-001-dashboard.html"/>
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { BOARD_001DashboardBase } from './board-001-dashboard-base';
import view_dashboard_sysportlet1 from '@widgets/hromhierarchy-cat/part-v-001-portlet/part-v-001-portlet.vue';
/**
* dashboard部件
*
* @export
* @class BOARD_001Dashboard
* @extends {BOARD_001DashboardBase}
*/
@Component({
components: {
view_dashboard_sysportlet1,
}
})
@VueLifeCycleProcessing()
export default class BOARD_001Dashboard extends BOARD_001DashboardBase { }
</script>
import { Prop, Provide, Emit, Model } from 'vue-property-decorator';
import { Subject, Subscription } from 'rxjs';
import { Watch, MainControlBase } from '@/studio-core';
import HROMHierarchyCatService from '@/service/hromhierarchy-cat/hromhierarchy-cat-service';
import PART_V_001Service from './part-v-001-portlet-service';
import HROMHierarchyCatUIService from '@/uiservice/hromhierarchy-cat/hromhierarchy-cat-ui-service';
import { Environment } from '@/environments/environment';
/**
* dashboard_sysportlet1部件基类
*
* @export
* @class MainControlBase
* @extends {PART_V_001PortletBase}
*/
export class PART_V_001PortletBase extends MainControlBase {
/**
* 获取部件类型
*
* @protected
* @type {string}
* @memberof PART_V_001PortletBase
*/
protected controlType: string = 'PORTLET';
/**
* 建构部件服务对象
*
* @type {PART_V_001Service}
* @memberof PART_V_001PortletBase
*/
public service: PART_V_001Service = new PART_V_001Service({ $store: this.$store });
/**
* 实体服务对象
*
* @type {HROMHierarchyCatService}
* @memberof PART_V_001PortletBase
*/
public appEntityService: HROMHierarchyCatService = new HROMHierarchyCatService({ $store: this.$store });
/**
* 应用实体名称
*
* @protected
* @type {string}
* @memberof PART_V_001PortletBase
*/
protected appDeName: string = 'hromhierarchycat';
/**
* 长度
*
* @type {number}
* @memberof PART_V_001
*/
@Prop() public height?: number;
/**
* 宽度
*
* @type {number}
* @memberof PART_V_001
*/
@Prop() public width?: number;
/**
* 是否自适应大小
*
* @returns {boolean}
* @memberof PART_V_001Base
*/
@Prop({default: false})public isAdaptiveSize!: boolean;
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof PART_V_001Base
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof PART_V_001Base
*/
public getData(): any {
return {};
}
/**
* 获取高度
*
* @returns {any[]}
* @memberof PART_V_001Base
*/
get getHeight(): any{
if(!this.$util.isEmpty(this.height) && !this.$util.isNumberNaN(this.height)){
if(this.height == 0){
return 'auto';
} else {
return this.height+'px';
}
} else {
return 'auto';
}
}
/**
* vue 生命周期
*
* @memberof PART_V_001Base
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof PART_V_001Base
*/
public afterCreated(){
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, 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 PART_V_001Base
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof PART_V_001Base
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
}
}
/**
* PART_V_001 部件模型
*
* @export
* @class PART_V_001Model
*/
export default class PART_V_001Model {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof PART_V_001Model
*/
public getDataItems(): any[] {
return [
{
name: 'hromhierarchycat',
prop: 'omhierarchycatid',
},
{
name: 'omhierarchycatname',
},
{
name: 'createman',
},
{
name: 'createdate',
},
{
name: 'updateman',
},
{
name: 'updatedate',
},
{
name: 'memo',
},
]
}
}
import { Http } from '@/utils';
import ControlService from '@/widgets/control-service';
/**
* PART_V_001 部件服务对象
*
* @export
* @class PART_V_001Service
*/
export default class PART_V_001Service extends ControlService {
}
<div class='portlet part-v-001 ' :style="{}">
<div class="portlet-without-title">
<hromhierarchy-cat-v-002 :viewUsage="4" :viewdata="JSON.stringify(context)" :viewDefaultUsage="false" ></hromhierarchy-cat-v-002>
</div>
</div>
<template src="./part-v-001-portlet.html"/>
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { PART_V_001PortletBase } from './part-v-001-portlet-base';
/**
* dashboard_sysportlet1部件
*
* @export
* @class PART_V_001Portlet
* @extends {PART_V_001PortletBase}
*/
@Component({
components: {
}
})
@VueLifeCycleProcessing()
export default class PART_V_001Portlet extends PART_V_001PortletBase { }
</script>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册