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

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

上级 649a1f1c
......@@ -67,6 +67,9 @@ export default {
uiactions: {
},
},
viewchart_chart: {
nodata:"",
},
default_searchform: {
details: {
formpage1: "常规条件",
......
......@@ -66,6 +66,9 @@ export default {
uiactions: {
},
},
viewchart_chart: {
nodata:"",
},
default_searchform: {
details: {
formpage1: "常规条件",
......
......@@ -71,16 +71,16 @@
<i-col :md="{ span: 24, offset: 0 }" :lg="{ span: 12, offset: 0 }">
<card class="portlet-card custom-card" :bordered="false" dis-hover :padding="10">
<span>
<view_db_rawitem5
<view_db_sysportlet2
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:height="400"
:width="0"
name="db_rawitem5"
ref='db_rawitem5'
name="db_sysportlet2"
ref='db_sysportlet2'
@closeview="closeView($event)">
</view_db_rawitem5>
</view_db_sysportlet2>
</span>
</card>
</i-col>
......
......@@ -2,10 +2,10 @@
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_sysportlet2 from '@widgets/ibizappview/view-chart-portlet/view-chart-portlet.vue';
import view_db_sysportlet1 from '@widgets/ibizappview/app-view-list-portlet/app-view-list-portlet.vue';
import view_db_rawitem7 from '@widgets/app/db-rawitem7-portlet/db-rawitem7-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';
......@@ -13,10 +13,10 @@ import view_db_rawitem3 from '@widgets/app/db-rawitem3-portlet/db-rawitem3-portl
@Component({
components: {
view_db_rawitem1,
view_db_sysportlet2,
view_db_sysportlet1,
view_db_rawitem7,
view_db_rawitem4,
view_db_rawitem5,
view_db_rawitem2,
view_db_rawitem3,
......
/**
* ViewChart 部件模型
*
* @export
* @class ViewChartModel
*/
export default class ViewChartModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof ViewChartDb_sysportlet2_chartMode
*/
public getDataItems(): any[] {
return [
{
name:'size',
prop:'size'
},
{
name:'query',
prop:'query'
},
{
name:'page',
prop:'page'
},
{
name:'sort',
prop:'sort'
}
]
}
}
\ No newline at end of file
import { Http,Util,Errorlog } from '@/utils';
import ControlService from '@/widgets/control-service';
import IBIZAPPVIEWService from '@/service/ibizappview/ibizappview-service';
import ViewChartModel from './view-chart-chart-model';
/**
* ViewChart 部件服务对象
*
* @export
* @class ViewChartService
*/
export default class ViewChartService extends ControlService {
/**
* 应用视图服务对象
*
* @type {IBIZAPPVIEWService}
* @memberof ViewChartService
*/
public appEntityService: IBIZAPPVIEWService = new IBIZAPPVIEWService({ $store: this.getStore() });
/**
* 设置从数据模式
*
* @type {boolean}
* @memberof ViewChartService
*/
public setTempMode(){
this.isTempMode = false;
}
/**
* Creates an instance of ViewChartService.
*
* @param {*} [opts={}]
* @memberof ViewChartService
*/
constructor(opts: any = {}) {
super(opts);
this.model = new ViewChartModel();
}
/**
* 查询数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof ViewChartService
*/
@Errorlog
public search(action: string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true);
return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService;
let result: Promise<any>;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
}else{
result =_appEntityService.FetchDefault(Context,Data, isloading);
}
result.then((response) => {
resolve(response);
}).catch(response => {
reject(response);
});
});
}
}
\ No newline at end of file
// this is less
.app-data-chart {
width: 100%;
height: 100%;
.chart-no-data{
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
i{
margin-right: 5px;
}
}
}
\ No newline at end of file
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import ViewChartBase from './view-chart-chart-base.vue';
@Component({
components: {
}
})
export default class ViewChart extends ViewChartBase {
}
</script>
\ No newline at end of file
<template>
<div class='portlet view-chart ' :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">
<!-- 测试 -->
<view_db_sysportlet2_chart
:viewState="viewState"
:viewparams="viewparams"
:context="context"
fetchAction="FetchDefault"
:showBusyIndicator="true"
name="db_sysportlet2_chart"
ref='db_sysportlet2_chart'
@closeview="closeView($event)">
</view_db_sysportlet2_chart>
</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 IBIZAPPVIEWService from '@/service/ibizappview/ibizappview-service';
import ViewChartService from './view-chart-portlet-service';
import IBIZAPPVIEWUIService from '@/uiservice/ibizappview/ibizappview-ui-service';
import UIService from '@/uiservice/ui-service';
import { Environment } from '@/environments/environment';
@Component({
components: {
}
})
export default class IBIZAPPVIEWViewChartBase extends Vue implements ControlInterface {
/**
* 名称
*
* @type {string}
* @memberof ViewChartBase
*/
@Prop() public name?: string;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof ViewChartBase
*/
@Prop() public viewState!: Subject<ViewState>;
/**
* 应用上下文
*
* @type {*}
* @memberof ViewChartBase
*/
@Prop() public context!: any;
/**
* 视图参数
*
* @type {*}
* @memberof ViewChartBase
*/
@Prop() public viewparams!: any;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof ViewChartBase
*/
public viewStateEvent: Subscription | undefined;
/**
* 获取部件类型
*
* @returns {string}
* @memberof ViewChartBase
*/
public getControlType(): string {
return 'PORTLET'
}
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof ViewChartBase
*/
public counterServiceArray:Array<any> = [];
/**
* 建构部件服务对象
*
* @type {ViewChartService}
* @memberof ViewChartBase
*/
public service: ViewChartService = new ViewChartService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {IBIZAPPVIEWService}
* @memberof ViewChartBase
*/
public appEntityService: IBIZAPPVIEWService = new IBIZAPPVIEWService({ $store: this.$store });
/**
* 界面UI服务对象
*
* @type {IBIZAPPVIEWUIService}
* @memberof ViewChartBase
*/
public appUIService:IBIZAPPVIEWUIService = new IBIZAPPVIEWUIService(this.$store);
/**
* 关闭视图
*
* @param {any} args
* @memberof ViewChartBase
*/
public closeView(args: any): void {
let _this: any = this;
_this.$emit('closeview', [args]);
}
/**
* 计数器刷新
*
* @memberof ViewChartBase
*/
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 ViewChartBase
*/
@Prop() public height?: number;
/**
* 宽度
*
* @type {number}
* @memberof ViewChartBase
*/
@Prop() public width?: number;
/**
* 门户部件类型
*
* @type {number}
* @memberof ViewChartBase
*/
public portletType: string = 'chart';
/**
* 视图默认使用
*
* @type {string}
* @memberof ViewChartBase
*/
@Inject({from:'navModel',default: 'tab'})
public navModel!:string;
/**
* 界面行为模型数据
*
* @memberof ViewChartBase
*/
public uiactionModel: any = {
}
/**
* 是否自适应大小
*
* @returns {boolean}
* @memberof ViewChartBase
*/
@Prop({default: false})public isAdaptiveSize!: boolean;
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof ViewChartBase
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof ViewChartBase
*/
public getData(): any {
return {};
}
/**
* 获取高度
*
* @returns {any[]}
* @memberof ViewChartBase
*/
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 ViewChartBase
*/
public refresh(args?: any) {
this.viewState.next({ tag: 'db_sysportlet2_chart', action: 'refresh', data: args });
}
/**
* vue 生命周期
*
* @memberof ViewChartBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof ViewChartBase
*/
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 ViewChartBase
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof ViewChartBase
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
}
/**
* 计算界面行为权限
*
* @memberof ViewChartBase
*/
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 './view-chart-portlet.less';
</style>
/**
* ViewChart 部件模型
*
* @export
* @class ViewChartModel
*/
export default class ViewChartModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof ViewChartModel
*/
public getDataItems(): any[] {
return [
{
name: 'createman',
},
{
name: 'createdate',
},
{
name: 'ibizappviewname',
},
{
name: 'ibizappview',
prop: 'ibizappviewid',
},
{
name: 'updateman',
},
{
name: 'updatedate',
},
{
name: 'ibizappviewtype',
},
{
name: 'documentaddress',
},
{
name: 'instanceaddress',
},
{
name: 'viewdescription',
},
{
name: 'amount',
},
]
}
}
import { Http } from '@/utils';
import ControlService from '@/widgets/control-service';
/**
* ViewChart 部件服务对象
*
* @export
* @class ViewChartService
*/
export default class ViewChartService 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 IBIZAPPVIEWViewChartBase from './view-chart-portlet-base.vue';
import view_db_sysportlet2_chart from '@widgets/ibizappview/view-chart-chart/view-chart-chart.vue';
@Component({
components: {
view_db_sysportlet2_chart,
}
})
export default class IBIZAPPVIEWViewChart extends IBIZAPPVIEWViewChartBase {
}
</script>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册