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

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

上级 50adefb5
......@@ -245,6 +245,8 @@ export default {
menuitem116: "编辑视图(左右关系)",
menuitem117: "编辑视图(上下关系)",
menuitem118: "编辑视图(分页关系)",
menuitem125: "数据看板",
menuitem126: "实体数据看板",
menuitem5: "视图",
menuitem9: "列表视图",
menuitem19: "常规表格视图",
......
......@@ -245,6 +245,8 @@ export default {
menuitem116: "编辑视图(左右关系)",
menuitem117: "编辑视图(上下关系)",
menuitem118: "编辑视图(分页关系)",
menuitem125: "数据看板",
menuitem126: "实体数据看板",
menuitem5: "视图",
menuitem9: "列表视图",
menuitem19: "常规表格视图",
......
......@@ -914,33 +914,13 @@ export default {
tip: "Save And Close Window",
},
},
editview4toolbar_toolbar: {
},
listviewtoolbar_toolbar: {
deuiaction1: {
caption: "New",
tip: "New",
},
deuiaction3: {
caption: "Edit",
tip: "Edit {0}",
},
deuiaction2: {
caption: "Remove",
tip: "Remove {0}",
},
deuiaction4: {
caption: "Filter",
tip: "Filter",
},
},
listviewlist_quicktoolbar_toolbar: {
dashboardviewdashboard_sysportlet2_list_quicktoolbar_toolbar: {
deuiaction1: {
caption: "New",
tip: "New",
},
},
listviewlist_batchtoolbar_toolbar: {
dashboardviewdashboard_sysportlet2_list_batchtoolbar_toolbar: {
deuiaction1: {
caption: "Edit",
tip: "Edit {0}",
......@@ -1008,6 +988,42 @@ export default {
tip: "数据导入",
},
},
editview4toolbar_toolbar: {
},
listviewtoolbar_toolbar: {
deuiaction1: {
caption: "New",
tip: "New",
},
deuiaction3: {
caption: "Edit",
tip: "Edit {0}",
},
deuiaction2: {
caption: "Remove",
tip: "Remove {0}",
},
deuiaction4: {
caption: "Filter",
tip: "Filter",
},
},
listviewlist_quicktoolbar_toolbar: {
deuiaction1: {
caption: "New",
tip: "New",
},
},
listviewlist_batchtoolbar_toolbar: {
deuiaction1: {
caption: "Edit",
tip: "Edit {0}",
},
deuiaction2: {
caption: "Remove",
tip: "Remove {0}",
},
},
usr5gridviewtoolbar_toolbar: {
},
valuerulesgridviewtoolbar_toolbar: {
......@@ -1150,22 +1166,6 @@ export default {
},
haspanellistviewtoolbar_toolbar: {
},
dashboardviewdashboard_sysportlet2_list_quicktoolbar_toolbar: {
deuiaction1: {
caption: "New",
tip: "New",
},
},
dashboardviewdashboard_sysportlet2_list_batchtoolbar_toolbar: {
deuiaction1: {
caption: "Edit",
tip: "Edit {0}",
},
deuiaction2: {
caption: "Remove",
tip: "Remove {0}",
},
},
tree_treeview: {
nodata:"",
nodes: {
......
......@@ -913,33 +913,13 @@ export default {
tip: "保存并关闭",
},
},
editview4toolbar_toolbar: {
},
listviewtoolbar_toolbar: {
deuiaction1: {
caption: "新建",
tip: "新建",
},
deuiaction3: {
caption: "编辑",
tip: "编辑",
},
deuiaction2: {
caption: "删除",
tip: "删除",
},
deuiaction4: {
caption: "过滤",
tip: "过滤",
},
},
listviewlist_quicktoolbar_toolbar: {
dashboardviewdashboard_sysportlet2_list_quicktoolbar_toolbar: {
deuiaction1: {
caption: "新建",
tip: "新建",
},
},
listviewlist_batchtoolbar_toolbar: {
dashboardviewdashboard_sysportlet2_list_batchtoolbar_toolbar: {
deuiaction1: {
caption: "编辑",
tip: "编辑",
......@@ -1007,6 +987,42 @@ export default {
tip: "数据导入",
},
},
editview4toolbar_toolbar: {
},
listviewtoolbar_toolbar: {
deuiaction1: {
caption: "新建",
tip: "新建",
},
deuiaction3: {
caption: "编辑",
tip: "编辑",
},
deuiaction2: {
caption: "删除",
tip: "删除",
},
deuiaction4: {
caption: "过滤",
tip: "过滤",
},
},
listviewlist_quicktoolbar_toolbar: {
deuiaction1: {
caption: "新建",
tip: "新建",
},
},
listviewlist_batchtoolbar_toolbar: {
deuiaction1: {
caption: "编辑",
tip: "编辑",
},
deuiaction2: {
caption: "删除",
tip: "删除",
},
},
usr5gridviewtoolbar_toolbar: {
},
valuerulesgridviewtoolbar_toolbar: {
......@@ -1149,22 +1165,6 @@ export default {
},
haspanellistviewtoolbar_toolbar: {
},
dashboardviewdashboard_sysportlet2_list_quicktoolbar_toolbar: {
deuiaction1: {
caption: "新建",
tip: "新建",
},
},
dashboardviewdashboard_sysportlet2_list_batchtoolbar_toolbar: {
deuiaction1: {
caption: "编辑",
tip: "编辑",
},
deuiaction2: {
caption: "删除",
tip: "删除",
},
},
tree_treeview: {
nodata:"",
nodes: {
......
......@@ -464,6 +464,62 @@ export default {
},
},
usr3gridviewtoolbar_toolbar: {
tbitem3: {
caption: "New",
tip: "New",
},
deuiaction2: {
caption: "Save",
tip: "Save",
},
tbitem4: {
caption: "Edit",
tip: "Edit {0}",
},
tbitem6: {
caption: "Copy",
tip: "Copy {0}",
},
deuiaction3: {
caption: "Filter",
tip: "Filter",
},
tbitem7: {
caption: "-",
tip: "",
},
tbitem8: {
caption: "Remove",
tip: "Remove {0}",
},
tbitem9: {
caption: "-",
tip: "",
},
tbitem13: {
caption: "Export",
tip: "Export {0} Data To Excel",
},
deuiaction1: {
caption: "导入",
tip: "导入",
},
tbitem10: {
caption: "-",
tip: "",
},
tbitem16: {
caption: "其它",
tip: "其它",
},
tbitem21: {
caption: "Export Data Model",
tip: "导出数据模型",
},
tbitem23: {
caption: "数据导入",
tip: "数据导入",
},
},
usr2editviewtoolbar_toolbar: {
tbitem3: {
......
......@@ -463,6 +463,62 @@ export default {
},
},
usr3gridviewtoolbar_toolbar: {
tbitem3: {
caption: "新建",
tip: "新建",
},
deuiaction2: {
caption: "保存",
tip: "保存",
},
tbitem4: {
caption: "编辑",
tip: "编辑",
},
tbitem6: {
caption: "拷贝",
tip: "拷贝",
},
deuiaction3: {
caption: "过滤",
tip: "过滤",
},
tbitem7: {
caption: "-",
tip: "",
},
tbitem8: {
caption: "删除",
tip: "删除",
},
tbitem9: {
caption: "-",
tip: "",
},
tbitem13: {
caption: "导出",
tip: "导出",
},
deuiaction1: {
caption: "导入",
tip: "导入",
},
tbitem10: {
caption: "-",
tip: "",
},
tbitem16: {
caption: "其它",
tip: "其它",
},
tbitem21: {
caption: "导出数据模型",
tip: "导出数据模型",
},
tbitem23: {
caption: "数据导入",
tip: "数据导入",
},
},
usr2editviewtoolbar_toolbar: {
tbitem3: {
......
......@@ -1513,6 +1513,44 @@ mock.onGet('v7/main-menuappmenu').reply((config: any) => {
resourcetag: '',
},
],
},
{
id: 'AAFF4FF3-7C14-451F-B6D7-4980DF4FA146',
name: 'menuitem125',
text: '数据看板',
type: 'MENUITEM',
counterid: '',
tooltip: '数据看板',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: '',
resourcetag: '',
items: [
{
id: 'E9E999AF-66D4-4328-A847-03428F2652DA',
name: 'menuitem126',
text: '实体数据看板',
type: 'MENUITEM',
counterid: '',
tooltip: '实体数据看板',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: 'AppFunc45',
resourcetag: '',
},
],
},
],
},
......
<template>
<div class="view-container deportalview ibizbookdashboard-view ">
<app-studioaction :viewTitle="$t(model.srfCaption)" viewName="ibizbookdashboardview"></app-studioaction>
<card class='view-card view-no-toolbar' :disHover="true" :padding="0" :bordered="false">
<div slot='title' class="header-container">
<span class='caption-info'>{{$t(model.srfCaption)}}</span>
</div>
<div class='view-top-messages'>
</div>
<div class="content-container">
<div class='view-body-messages'>
</div>
<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>
</div>
<div class='view-bottom-messages'>
</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';
import IBIZBOOKService from '@/service/ibizbook/ibizbook-service';
import IBIZBOOKAuthService from '@/authservice/ibizbook/ibizbook-auth-service';
import PortalViewEngine from '@engine/view/portal-view-engine';
import IBIZBOOKUIService from '@/uiservice/ibizbook/ibizbook-ui-service';
@Component({
components: {
},
})
export default class IBIZBOOKDashboardViewBase extends Vue {
/**
* 实体服务对象
*
* @type {IBIZBOOKService}
* @memberof IBIZBOOKDashboardViewBase
*/
public appEntityService: IBIZBOOKService = new IBIZBOOKService;
/**
* 实体UI服务对象
*
* @type IBIZBOOKUIService
* @memberof IBIZBOOKDashboardViewBase
*/
public appUIService: IBIZBOOKUIService = new IBIZBOOKUIService(this.$store);
/**
* 数据变化
*
* @param {*} val
* @returns {*}
* @memberof IBIZBOOKDashboardViewBase
*/
@Emit()
public viewDatasChange(val: any):any {
return val;
}
/**
* 传入视图上下文
*
* @type {string}
* @memberof IBIZBOOKDashboardViewBase
*/
@Prop() public viewdata!: string;
/**
* 传入视图参数
*
* @type {string}
* @memberof IBIZBOOKDashboardViewBase
*/
@Prop() public viewparam!: string;
/**
* 视图默认使用
*
* @type {boolean}
* @memberof IBIZBOOKDashboardViewBase
*/
@Prop({ default: true }) public viewDefaultUsage!: boolean;
/**
* 视图默认使用
*
* @type {string}
* @memberof IBIZBOOKDashboardViewBase
*/
@Inject({from:'navModel',default: 'tab'})
public navModel!:string;
/**
* 视图标识
*
* @type {string}
* @memberof IBIZBOOKDashboardViewBase
*/
public viewtag: string = '427821f1e67ee5b79dde237e66a7b9c9';
/**
* 自定义视图导航上下文集合
*
* @type {*}
* @memberof IBIZBOOKDashboardViewBase
*/
public customViewNavContexts:any ={
};
/**
* 自定义视图导航参数集合
*
* @type {*}
* @memberof IBIZBOOKDashboardViewBase
*/
public customViewParams:any ={
};
/**
* 视图模型数据
*
* @type {*}
* @memberof IBIZBOOKDashboardViewBase
*/
public model: any = {
srfCaption: 'entities.ibizbook.views.dashboardview.caption',
srfTitle: 'entities.ibizbook.views.dashboardview.title',
srfSubTitle: 'entities.ibizbook.views.dashboardview.subtitle',
dataInfo: ''
}
/**
* 视图参数变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof IBIZBOOKDashboardViewBase
*/
@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 IBIZBOOKDashboardViewBase
*/
@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 IBIZBOOKDashboardViewBase
*/
public containerModel: any = {
view_dashboard: { name: 'dashboard', type: 'DASHBOARD' },
};
/**
* 计数器刷新
*
* @memberof IBIZBOOKDashboardViewBase
*/
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 IBIZBOOKDashboardViewBase
*/
public viewState: Subject<ViewState> = new Subject();
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof IBIZBOOKDashboardViewBase
*/
public engine: PortalViewEngine = new PortalViewEngine();
/**
* 引擎初始化
*
* @public
* @memberof IBIZBOOKDashboardViewBase
*/
public engineInit(): void {
this.engine.init({
view: this,
dashboard: this.$refs.dashboard,
keyPSDEField: 'ibizbook',
majorPSDEField: 'ibizbookname',
isLoadDefault: true,
});
}
/**
* 应用导航服务
*
* @type {*}
* @memberof IBIZBOOKDashboardViewBase
*/
public navDataService = NavDataService.getInstance(this.$store);
/**
* 导航服务事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof IBIZBOOKDashboardViewBase
*/
public serviceStateEvent: Subscription | undefined;
/**
* 门户部件状态对象
*
* @type {*}
* @memberof IBIZBOOKDashboardViewBase
*/
@Prop() public portletState?: any;
/**
* 门户部件状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof IBIZBOOKDashboardViewBase
*/
public portletStateEvent: Subscription | undefined;
/**
* 应用上下文
*
* @type {*}
* @memberof IBIZBOOKDashboardViewBase
*/
public context:any = {};
/**
* 视图参数
*
* @type {*}
* @memberof IBIZBOOKDashboardViewBase
*/
public viewparams:any = {};
/**
* 视图缓存数据
*
* @type {*}
* @memberof IBIZBOOKDashboardViewBase
*/
public viewCacheData:any;
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof IBIZBOOKDashboardViewBase
*/
public counterServiceArray:Array<any> = [];
/**
* 解析视图参数
*
* @public
* @memberof IBIZBOOKDashboardViewBase
*/
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();
this.$forceUpdate();
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);
if(inputvalue){
Object.assign(this.context,{'ibizbook':inputvalue});
}
//初始化视图唯一标识
Object.assign(this.context,{srfsessionid:this.$util.createUUID()});
this.handleCustomViewData();
//初始化导航数据
this.initNavDataWithRoute();
}
/**
* 处理自定义视图数据
*
* @memberof IBIZBOOKDashboardViewBase
*/
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 IBIZBOOKDashboardViewBase
*/
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 IBIZBOOKDashboardViewBase
*/
public initNavDataWithRoute(data:any = null, isNew:boolean = false, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && Object.is(this.navModel,"route")) ){
this.navDataService.addNavData({id:'ibizbookdashboard-view',tag:this.viewtag,srfkey:isNew ? null : this.context.ibizbook,title:this.$t(this.model.srfCaption),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath});
}
}
/**
* 初始化导航数据(分页模式)
*
* @memberof IBIZBOOKDashboardViewBase
*/
public initNavDataWithTab(data:any = null,isOnlyAdd:boolean = true, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && !Object.is(this.navModel,"route")) ){
this.navDataService.addNavDataByOnly({id:'ibizbookdashboard-view',tag:this.viewtag,srfkey:this.context.ibizbook,title:this.$t(this.model.srfCaption),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath},isOnlyAdd);
}
}
/**
* Vue声明周期
*
* @memberof IBIZBOOKDashboardViewBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof IBIZBOOKDashboardViewBase
*/
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,'ibizbookdashboard-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,'IBIZBOOKDashboardView')){
return;
}
if(Object.is(res.action,'refresh') && _this.refresh && _this.refresh instanceof Function){
_this.refresh();
}
})
}
}
/**
* 销毁之前
*
* @memberof IBIZBOOKDashboardViewBase
*/
public beforeDestroy() {
this.$store.commit('viewaction/removeView', this.viewtag);
}
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof IBIZBOOKDashboardViewBase
*/
public mounted() {
this.afterMounted();
}
/**
* 执行mounted后的逻辑
*
* @memberof IBIZBOOKDashboardViewBase
*/
public afterMounted(){
const _this: any = this;
_this.engineInit();
if (_this.loadModel && _this.loadModel instanceof Function) {
_this.loadModel();
}
}
/**
* dashboard 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZBOOKDashboardViewBase
*/
public dashboard_load($event: any, $event2?: any) {
this.engine.onCtrlEvent('dashboard', 'load', $event);
}
/**
* 关闭视图
*
* @param {any[]} args
* @memberof IBIZBOOKDashboardViewBase
*/
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);
}
}
/**
* 销毁视图回调
*
* @memberof IBIZBOOKDashboardViewBase
*/
public destroyed(){
this.afterDestroyed();
}
/**
* 执行destroyed后的逻辑
*
* @memberof IBIZBOOKDashboardViewBase
*/
public afterDestroyed(){
if(this.viewDefaultUsage){
let localStoreLength = Object.keys(localStorage);
if(localStoreLength.length > 0){
localStoreLength.forEach((item:string) =>{
if(item.startsWith(this.context.srfsessionid)){
localStorage.removeItem(item);
}
})
}
if(Object.is(this.navModel,"tab")){
this.navDataService.removeNavDataByTag(this.viewtag);
}
if (this.serviceStateEvent) {
this.serviceStateEvent.unsubscribe();
}
}
// 销毁计数器定时器
if(this.counterServiceArray && this.counterServiceArray.length >0){
this.counterServiceArray.forEach((item:any) =>{
if(item.destroyCounter && item.destroyCounter instanceof Function){
item.destroyCounter();
}
})
}
if(this.portletStateEvent){
this.portletStateEvent.unsubscribe();
}
}
/**
* 加载数据
*
* @memberof IBIZBOOKDashboardViewBase
*/
public loadModel(){
if(this.context.ibizbook){
this.appEntityService.getDataInfo(JSON.parse(JSON.stringify(this.context)),{},false).then((response:any) =>{
if (!response || response.status !== 200) {
return;
}
const { data: _data } = response;
this.viewState.next({ tag: 'all-portlet', action: 'loadmodel', data:_data});
if (_data.ibizbookname) {
Object.assign(this.model, { dataInfo: _data.ibizbookname });
if(this.$tabPageExp){
let _this:any = this;
this.$tabPageExp.setCurPageCaption(_this.$t(this.model.srfCaption), _this.$t(this.model.srfCaption), _this.model.dataInfo);
}
if(this.$route){
this.$route.meta.info = this.model.dataInfo;
}
Object.assign(this.model, { srfCaption: `${this.$t(this.model.srfCaption)} - ${this.model.dataInfo}` });
}
})
}
}
}
</script>
<style lang='less'>
@import './ibizbookdashboard-view.less';
</style>
\ No newline at end of file
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import IBIZBOOKDashboardViewBase from './ibizbookdashboard-view-base.vue';
import view_dashboard from '@widgets/ibizbook/usr2-dashboard/usr2-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 IBIZBOOKDashboardView extends IBIZBOOKDashboardViewBase {
}
</script>
\ No newline at end of file
......@@ -12,6 +12,96 @@
<i-input v-show="!isExpandSearchForm" v-model="query" search enter-button @on-search="onSearch($event)" class='quick-search-input' style='max-width: 400px;padding-left: 24px' placeholder="名称" />
<div class='pull-right'>
<div class='toolbar-container'>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem3.visabled" :disabled="toolBarModels.tbitem3.disabled" class=' deepskyblueToolBar' v-loading:i-button @click="toolbar_click({ tag: 'tbitem3' }, $event)">
<i class='fa fa-file-text-o'></i>
<span class='caption'>{{$t('entities.ibizsample0001.usr3gridviewtoolbar_toolbar.tbitem3.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.ibizsample0001.usr3gridviewtoolbar_toolbar.tbitem3.tip')}}</div>
</tooltip>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.deuiaction2.visabled" :disabled="toolBarModels.deuiaction2.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'deuiaction2' }, $event)">
<i class='fa fa-save'></i>
<span class='caption'>{{$t('entities.ibizsample0001.usr3gridviewtoolbar_toolbar.deuiaction2.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.ibizsample0001.usr3gridviewtoolbar_toolbar.deuiaction2.tip')}}</div>
</tooltip>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem4.visabled" :disabled="toolBarModels.tbitem4.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'tbitem4' }, $event)">
<span class='caption'>{{$t('entities.ibizsample0001.usr3gridviewtoolbar_toolbar.tbitem4.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.ibizsample0001.usr3gridviewtoolbar_toolbar.tbitem4.tip')}}</div>
</tooltip>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem6.visabled" :disabled="toolBarModels.tbitem6.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'tbitem6' }, $event)">
<span class='caption'>{{$t('entities.ibizsample0001.usr3gridviewtoolbar_toolbar.tbitem6.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.ibizsample0001.usr3gridviewtoolbar_toolbar.tbitem6.tip')}}</div>
</tooltip>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.deuiaction3.visabled" :disabled="toolBarModels.deuiaction3.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'deuiaction3' }, $event)">
<i class='fa fa-filter'></i>
<span class='caption'>{{$t('entities.ibizsample0001.usr3gridviewtoolbar_toolbar.deuiaction3.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.ibizsample0001.usr3gridviewtoolbar_toolbar.deuiaction3.tip')}}</div>
</tooltip>
<span class='seperator'>|</span>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem8.visabled" :disabled="toolBarModels.tbitem8.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'tbitem8' }, $event)">
<span class='caption'>{{$t('entities.ibizsample0001.usr3gridviewtoolbar_toolbar.tbitem8.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.ibizsample0001.usr3gridviewtoolbar_toolbar.tbitem8.tip')}}</div>
</tooltip>
<span class='seperator'>|</span>
<tooltip :transfer="true" :max-width="600">
<app-export-excel :item="toolBarModels.tbitem13" :caption="$t('entities.ibizsample0001.usr3gridviewtoolbar_toolbar.tbitem13.caption')" @exportexcel="toolbar_click({ tag: 'tbitem13' }, $event)"></app-export-excel>
<div slot='content'>{{$t('entities.ibizsample0001.usr3gridviewtoolbar_toolbar.tbitem13.tip')}}</div>
</tooltip>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.deuiaction1.visabled" :disabled="toolBarModels.deuiaction1.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'deuiaction1' }, $event)">
<i class='fa fa-upload'></i>
<span class='caption'>{{$t('entities.ibizsample0001.usr3gridviewtoolbar_toolbar.deuiaction1.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.ibizsample0001.usr3gridviewtoolbar_toolbar.deuiaction1.tip')}}</div>
</tooltip>
<span class='seperator'>|</span>
<dropdown v-show="toolBarModels.tbitem16.visabled" trigger='click'>
<tooltip :transfer="true" :max-width="600">
<i-button class=''>
<i class=''></i>
<span class='caption'>{{$t('entities.ibizsample0001.usr3gridviewtoolbar_toolbar.tbitem16.caption')}}</span>
<icon type="ios-arrow-down"></icon>
</i-button>
<div slot='content'>{{$t('entities.ibizsample0001.usr3gridviewtoolbar_toolbar.tbitem16.tip')}}</div>
</tooltip>
<dropdown-menu slot='list'>
<dropdown-item>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem21.visabled" :disabled="toolBarModels.tbitem21.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'tbitem21' }, $event)">
<i class='fa fa-download'></i>
<span class='caption'>{{$t('entities.ibizsample0001.usr3gridviewtoolbar_toolbar.tbitem21.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.ibizsample0001.usr3gridviewtoolbar_toolbar.tbitem21.tip')}}</div>
</tooltip>
</dropdown-item>
<dropdown-item>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem23.visabled" :disabled="toolBarModels.tbitem23.disabled" class='' v-loading:i-button @click="toolbar_click({ tag: 'tbitem23' }, $event)">
<i class='fa fa-upload'></i>
<span class='caption'>{{$t('entities.ibizsample0001.usr3gridviewtoolbar_toolbar.tbitem23.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.ibizsample0001.usr3gridviewtoolbar_toolbar.tbitem23.tip')}}</div>
</tooltip>
</dropdown-item>
</dropdown-menu>
</dropdown>
</div>
</div>
</div>
......@@ -285,6 +375,31 @@ export default class IBIZSample0001Usr3GridViewBase extends Vue {
* @memberof IBIZSample0001Usr3GridView
*/
public toolBarModels: any = {
tbitem3: { name: 'tbitem3', actiontarget: 'NONE', caption: '新建', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'New', target: '' } },
deuiaction2: { name: 'deuiaction2', actiontarget: 'NONE', caption: '保存', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'Save', target: '' } },
tbitem4: { name: 'tbitem4', actiontarget: 'NONE', caption: '编辑', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'Edit', target: 'SINGLEKEY' } },
tbitem6: { name: 'tbitem6', actiontarget: 'NONE', caption: '拷贝', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'Copy', target: 'SINGLEKEY' } },
deuiaction3: { name: 'deuiaction3', actiontarget: 'NONE', caption: '过滤', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'ToggleFilter', target: '' } },
tbitem7: { name: 'tbitem7', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem8: { name: 'tbitem8', actiontarget: 'NONE', caption: '删除', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'Remove', target: 'MULTIKEY' } },
tbitem9: { name: 'tbitem9', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem13: { name: 'tbitem13', actiontarget: 'NONE', caption: '导出', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'ExportExcel', target: '' }, MaxRowCount: 1000 },
deuiaction1: { name: 'deuiaction1', actiontarget: 'NONE', caption: '导入', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'ImportExcel', target: 'NONE' } },
tbitem10: { name: 'tbitem10', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem16: { name: 'tbitem16', caption: '其它', disabled: false, type: 'ITEMS', visabled: true, dataaccaction: '', uiaction: { } },
tbitem21: { name: 'tbitem21', actiontarget: 'NONE', caption: '导出数据模型', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'ExportModel', target: '' } },
tbitem23: { name: 'tbitem23', actiontarget: 'NONE', caption: '数据导入', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'Import', target: '' } },
};
......@@ -628,6 +743,56 @@ export default class IBIZSample0001Usr3GridViewBase extends Vue {
}
/**
* toolbar 部件 click 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZSample0001Usr3GridViewBase
*/
public toolbar_click($event: any, $event2?: any) {
if (Object.is($event.tag, 'tbitem3')) {
this.toolbar_tbitem3_click(null, '', $event2);
}
if (Object.is($event.tag, 'deuiaction2')) {
this.toolbar_deuiaction2_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem4')) {
this.toolbar_tbitem4_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem6')) {
this.toolbar_tbitem6_click(null, '', $event2);
}
if (Object.is($event.tag, 'deuiaction3')) {
this.toolbar_deuiaction3_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem24')) {
this.toolbar_tbitem24_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem25')) {
this.toolbar_tbitem25_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem8')) {
this.toolbar_tbitem8_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem13')) {
this.toolbar_tbitem13_click(null, '', $event2);
}
if (Object.is($event.tag, 'deuiaction1')) {
this.toolbar_deuiaction1_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem11')) {
this.toolbar_tbitem11_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem21')) {
this.toolbar_tbitem21_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem23')) {
this.toolbar_tbitem23_click(null, '', $event2);
}
}
/**
* grid 部件 selectionchange 事件
*
......@@ -725,6 +890,370 @@ export default class IBIZSample0001Usr3GridViewBase extends Vue {
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem3_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.New(datas, contextJO,paramJO, $event, xData,this,"IBIZSample0001");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_deuiaction2_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.Save(datas, contextJO,paramJO, $event, xData,this,"IBIZSample0001");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem4_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.Edit(datas, contextJO,paramJO, $event, xData,this,"IBIZSample0001");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem6_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.Copy(datas, contextJO,paramJO, $event, xData,this,"IBIZSample0001");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_deuiaction3_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.ToggleFilter(datas, contextJO,paramJO, $event, xData,this,"IBIZSample0001");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem24_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.ToggleRowEdit(datas, contextJO,paramJO, $event, xData,this,"IBIZSample0001");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem25_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.NewRow(datas, contextJO,paramJO, $event, xData,this,"IBIZSample0001");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem8_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.Remove(datas, contextJO,paramJO, $event, xData,this,"IBIZSample0001");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem13_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.ExportExcel(datas, contextJO,paramJO, $event, xData,this,"IBIZSample0001");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_deuiaction1_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.ImportExcel(datas, contextJO,paramJO, $event, xData,this,"IBIZSample0001");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem11_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.Print(datas, contextJO,paramJO, $event, xData,this,"IBIZSample0001");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem21_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.ExportModel(datas, contextJO,paramJO, $event, xData,this,"IBIZSample0001");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem23_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.Import(datas, contextJO,paramJO, $event, xData,this,"IBIZSample0001");
}
/**
* 打开新建数据视图
*
......@@ -815,6 +1344,286 @@ export default class IBIZSample0001Usr3GridViewBase extends Vue {
}
/**
* 新建
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof IBIZSample0001Usr3GridViewBase
*/
public New(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (_this.newdata && _this.newdata instanceof Function) {
const data: any = {};
_this.newdata([{ ...data }],[{ ...data }], params, $event, xData);
} else {
_this.$Notice.error({ title: '错误', desc: 'newdata 视图处理逻辑不存在,请添加!' });
}
}
/**
* 保存
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof IBIZSample0001Usr3GridViewBase
*/
public Save(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
// 界面行为容器对象 _this
const _this: any = this;
if (xData && xData.save instanceof Function) {
xData.save().then((response: any) => {
if (!response || response.status !== 200) {
return;
}
_this.$emit('viewdataschange', [{ ...response.data }]);
});
} else if (_this.save && _this.save instanceof Function) {
_this.save();
}
}
/**
* 编辑
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof IBIZSample0001Usr3GridViewBase
*/
public Edit(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
if (args.length === 0) {
return;
}
const _this: any = this;
if (_this.opendata && _this.opendata instanceof Function) {
const data: any = { };
if (args.length > 0) {
Object.assign(data, { ibizsample0001: args[0].ibizsample0001 })
}
_this.opendata([{ ...data }], params, $event, xData);
} else {
_this.$Notice.error({ title: '错误', desc: 'opendata 视图处理逻辑不存在,请添加!' });
}
}
/**
* 拷贝
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof IBIZSample0001Usr3GridViewBase
*/
public Copy(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
if (args.length === 0) {
return;
}
const _this: any = this;
if (_this.opendata && _this.opendata instanceof Function) {
const data: any = { };
if (args.length > 0) {
Object.assign(data, { ibizsample0001: args[0].ibizsample0001 });
}
if(!params) params = {};
Object.assign(params,{copymode:true});
_this.opendata([{ ...data }], params, $event, xData);
} else {
Object.assign(this.viewparams,{copymode:true});
}
}
/**
* 过滤
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof IBIZSample0001Usr3GridViewBase
*/
public ToggleFilter(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (_this.hasOwnProperty('isExpandSearchForm')) {
_this.isExpandSearchForm = !_this.isExpandSearchForm;
}
}
/**
* 行编辑
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof IBIZSample0001Usr3GridViewBase
*/
public ToggleRowEdit(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
xData.actualIsOpenEdit = !xData.actualIsOpenEdit;
}
/**
* 新建行
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof IBIZSample0001Usr3GridViewBase
*/
public NewRow(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
const data: any = {};
if (_this.hasOwnProperty('newRow') && _this.newRow instanceof Function) {
_this.newRow([{ ...data }], params, $event, xData);
} else if(xData.newRow && xData.newRow instanceof Function) {
xData.newRow([{ ...data }], params, $event, xData);
}else{
_this.$Notice.error({ title: '错误', desc: 'newRow 视图处理逻辑不存在,请添加!' });
}
}
/**
* 删除
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof IBIZSample0001Usr3GridViewBase
*/
public Remove(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (!xData || !(xData.remove instanceof Function)) {
return ;
}
xData.remove(args);
}
/**
* 导出
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof IBIZSample0001Usr3GridViewBase
*/
public ExportExcel(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (!xData || !(xData.exportExcel instanceof Function) || !$event) {
return ;
}
xData.exportExcel($event.exportparms);
}
/**
* 导入
*
* @param {any[]} args 当前数据
* @param {any} context 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @param {*} [srfParentDeName] 父实体名称
* @returns {Promise<any>}
*/
public async ImportExcel(args: any[], context:any = {} ,params: any={}, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
let data: any = {};
let parentContext:any = {};
let parentViewParam:any = {};
const _this: any = actionContext;
const _args: any[] = Util.deepCopy(args);
const actionTarget: string | null = 'NONE';
if(_this.context){
parentContext = _this.context;
}
if(_this.viewparams){
parentViewParam = _this.viewparams;
}
context = UIActionTool.handleContextParam(actionTarget,_args,parentContext,parentViewParam,context);
data = UIActionTool.handleActionParam(actionTarget,_args,parentContext,parentViewParam,params);
context = Object.assign({},actionContext.context,context);
let parentObj:any = {srfparentdename:srfParentDeName?srfParentDeName:null,srfparentkey:srfParentDeName?context[srfParentDeName.toLowerCase()]:null};
Object.assign(data,parentObj);
Object.assign(context,parentObj);
const openPopupApp = (url: string) => {
window.open(url, '_blank');
return null;
}
const url = `../../ibizutil/uploaddedataview.jsp?srfdeid=`;
openPopupApp(url);
}
/**
* 打印
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof IBIZSample0001Usr3GridViewBase
*/
public Print(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
let _this:any = this;
if (!xData || !(xData.print instanceof Function) || !$event) {
return ;
}
xData.print();
}
/**
* 导出数据模型
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof IBIZSample0001Usr3GridViewBase
*/
public ExportModel(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
this.$Notice.error({ title: '错误', desc: '导出数据模型未支持' });
}
/**
* 数据导入
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof IBIZSample0001Usr3GridViewBase
*/
public Import(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (!xData || !(xData.importExcel instanceof Function) || !$event) {
return ;
}
xData.importExcel(params);
}
/**
* 关闭视图
......
......@@ -16,4 +16,5 @@
// this is less
.deepskyblueToolBar {color:white !important;background-color:#108cee !important;}
......@@ -138,6 +138,7 @@ export const PageComponents = {
Vue.component('ibizsample0002-mpickup-view', () => import('@pages/sample/ibizsample0002-mpickup-view/ibizsample0002-mpickup-view.vue'));
Vue.component('ibizorder-sf7-edit-view', () => import('@pages/sample/ibizorder-sf7-edit-view/ibizorder-sf7-edit-view.vue'));
Vue.component('ibizbookedit-view', () => import('@pages/sample/ibizbookedit-view/ibizbookedit-view.vue'));
Vue.component('ibizbookdashboard-view', () => import('@pages/sample/ibizbookdashboard-view/ibizbookdashboard-view.vue'));
Vue.component('ibizsample0001-sf5-edit-view', () => import('@pages/sample/ibizsample0001-sf5-edit-view/ibizsample0001-sf5-edit-view.vue'));
Vue.component('ibizbookgroup-by-codelist-list-view', () => import('@pages/sample/ibizbookgroup-by-codelist-list-view/ibizbookgroup-by-codelist-list-view.vue'));
Vue.component('ibizbookhas-panel-kan-ban-view', () => import('@pages/sample/ibizbookhas-panel-kan-ban-view/ibizbookhas-panel-kan-ban-view.vue'));
......
......@@ -2072,6 +2072,20 @@ const router = new Router({
},
component: () => import('@pages/sample/ibizbookedit-view/ibizbookedit-view.vue'),
},
{
path: 'ibizbooks/:ibizbook?/dashboardview/:dashboardview?',
meta: {
caption: 'entities.ibizbook.views.dashboardview.caption',
info:'',
parameters: [
{ pathName: 'index', parameterName: 'index' },
{ pathName: 'ibizbooks', parameterName: 'ibizbook' },
{ pathName: 'dashboardview', parameterName: 'dashboardview' },
],
requireAuth: true,
},
component: () => import('@pages/sample/ibizbookdashboard-view/ibizbookdashboard-view.vue'),
},
{
path: 'ibizsample0002s/:ibizsample0002?/ibizsample0001s/:ibizsample0001?/sf5editview/:sf5editview?',
meta: {
......@@ -2822,6 +2836,19 @@ const router = new Router({
},
component: () => import('@pages/sample/ibizorder-line-chart-view/ibizorder-line-chart-view.vue'),
},
{
path: '/ibizbooks/:ibizbook?/dashboardview/:dashboardview?',
meta: {
caption: 'entities.ibizbook.views.dashboardview.caption',
info:'',
parameters: [
{ pathName: 'ibizbooks', parameterName: 'ibizbook' },
{ pathName: 'dashboardview', parameterName: 'dashboardview' },
],
requireAuth: true,
},
component: () => import('@pages/sample/ibizbookdashboard-view/ibizbookdashboard-view.vue'),
},
{
path: '/ibizcustomers/:ibizcustomer?/pickupgridview/:pickupgridview?',
meta: {
......
......@@ -250,6 +250,7 @@ export const viewstate: any = {
'84904c93ceea3ab6551555ee20c41e27',
'6b3607e849c8517fd7ae1cab583f7393',
'41d3da0d37fb0135ace813f1ba06bd39',
'427821f1e67ee5b79dde237e66a7b9c9',
'b1256beac1e95915b675893c61559b59',
'b8ae19200ec9d4e8e588bc31e3f9bcb4',
'09663b7a4e3dce70524d1b64e02b5e2d',
......@@ -487,6 +488,16 @@ export const viewstate: any = {
refviews: [
],
},
{
viewtag: '427821f1e67ee5b79dde237e66a7b9c9',
viewmodule: 'Sample',
viewname: 'IBIZBOOKDashboardView',
viewaction: '',
viewdatachange: false,
refviews: [
'f73da4cb47a88d3fe5b92716e0137741',
],
},
{
viewtag: '460fc1d5b6f2e2012b281df34d929f3b',
viewmodule: 'Sample',
......
......@@ -764,6 +764,9 @@ export default class MainMenuBase extends Vue implements ControlInterface {
case 'AppFunc24':
this.clickAppFunc24(item);
return;
case 'AppFunc45':
this.clickAppFunc45(item);
return;
case 'AppFunc17':
this.clickAppFunc17(item);
return;
......@@ -2704,6 +2707,29 @@ export default class MainMenuBase extends Vue implements ControlInterface {
})
}
/**
* 功能名称
*
* @param {*} [item={}]
* @memberof MainMenu
*/
public clickAppFunc45(item: any = {}) {
const viewparam: any = {};
Object.assign(viewparam, {});
const deResParameters: any[] = [];
const parameters: any[] = [
{ pathName: 'ibizbooks', parameterName: 'ibizbook' },
{ pathName: 'dashboardview', parameterName: 'dashboardview' },
];
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);
})
}
/**
* 图书列表(嵌入面板)
*
......
......@@ -1599,6 +1599,46 @@ export default class MainMenuModel {
authtag:'Web-MainMenu-menuitem118',
},
],
},
{
id: 'AAFF4FF3-7C14-451F-B6D7-4980DF4FA146',
name: 'menuitem125',
text: '数据看板',
type: 'MENUITEM',
counterid: '',
tooltip: '数据看板',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: '',
resourcetag: '',
authtag:'Web-MainMenu-menuitem125',
items: [
{
id: 'E9E999AF-66D4-4328-A847-03428F2652DA',
name: 'menuitem126',
text: '实体数据看板',
type: 'MENUITEM',
counterid: '',
tooltip: '实体数据看板',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: 'AppFunc45',
resourcetag: '',
authtag:'Web-MainMenu-menuitem126',
},
],
},
],
},
......
<template>
<div class='portlet portal-components-list ' :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_dashboard_sysportlet2_list
:viewState="viewState"
:viewparams="viewparams"
:context="context"
createAction="Create"
removeAction="Remove"
updateAction="Update"
fetchAction="FetchDefault"
:showBusyIndicator="true"
name="dashboard_sysportlet2_list"
ref='dashboard_sysportlet2_list'
@closeview="closeView($event)">
</view_dashboard_sysportlet2_list>
</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 IBIZBOOKService from '@/service/ibizbook/ibizbook-service';
import PortalComponentsListService from './portal-components-list-portlet-service';
import IBIZBOOKUIService from '@/uiservice/ibizbook/ibizbook-ui-service';
import UIService from '@/uiservice/ui-service';
import { Environment } from '@/environments/environment';
@Component({
components: {
}
})
export default class IBIZBOOKPortalComponentsListBase extends Vue implements ControlInterface {
/**
* 名称
*
* @type {string}
* @memberof PortalComponentsListBase
*/
@Prop() public name?: string;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof PortalComponentsListBase
*/
@Prop() public viewState!: Subject<ViewState>;
/**
* 应用上下文
*
* @type {*}
* @memberof PortalComponentsListBase
*/
@Prop() public context!: any;
/**
* 视图参数
*
* @type {*}
* @memberof PortalComponentsListBase
*/
@Prop() public viewparams!: any;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof PortalComponentsListBase
*/
public viewStateEvent: Subscription | undefined;
/**
* 获取部件类型
*
* @returns {string}
* @memberof PortalComponentsListBase
*/
public getControlType(): string {
return 'PORTLET'
}
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof PortalComponentsListBase
*/
public counterServiceArray:Array<any> = [];
/**
* 建构部件服务对象
*
* @type {PortalComponentsListService}
* @memberof PortalComponentsListBase
*/
public service: PortalComponentsListService = new PortalComponentsListService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {IBIZBOOKService}
* @memberof PortalComponentsListBase
*/
public appEntityService: IBIZBOOKService = new IBIZBOOKService({ $store: this.$store });
/**
* 界面UI服务对象
*
* @type {IBIZBOOKUIService}
* @memberof PortalComponentsListBase
*/
public appUIService:IBIZBOOKUIService = new IBIZBOOKUIService(this.$store);
/**
* 关闭视图
*
* @param {any} args
* @memberof PortalComponentsListBase
*/
public closeView(args: any): void {
let _this: any = this;
_this.$emit('closeview', [args]);
}
/**
* 计数器刷新
*
* @memberof PortalComponentsListBase
*/
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 PortalComponentsListBase
*/
@Prop() public height?: number;
/**
* 宽度
*
* @type {number}
* @memberof PortalComponentsListBase
*/
@Prop() public width?: number;
/**
* 门户部件类型
*
* @type {number}
* @memberof PortalComponentsListBase
*/
public portletType: string = 'list';
/**
* 视图默认使用
*
* @type {string}
* @memberof PortalComponentsListBase
*/
@Inject({from:'navModel',default: 'tab'})
public navModel!:string;
/**
* 界面行为模型数据
*
* @memberof PortalComponentsListBase
*/
public uiactionModel: any = {
}
/**
* 是否自适应大小
*
* @returns {boolean}
* @memberof PortalComponentsListBase
*/
@Prop({default: false})public isAdaptiveSize!: boolean;
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof PortalComponentsListBase
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof PortalComponentsListBase
*/
public getData(): any {
return {};
}
/**
* 获取高度
*
* @returns {any[]}
* @memberof PortalComponentsListBase
*/
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 '300px';
}
}
/**
* 刷新
*
* @memberof PortalComponentsListBase
*/
public refresh(args?: any) {
this.viewState.next({ tag: 'dashboard_sysportlet2_list', action: 'refresh', data: args });
}
/**
* vue 生命周期
*
* @memberof PortalComponentsListBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof PortalComponentsListBase
*/
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 PortalComponentsListBase
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof PortalComponentsListBase
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
}
/**
* 计算界面行为权限
*
* @memberof PortalComponentsListBase
*/
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 './portal-components-list-portlet.less';
</style>
/**
* PortalComponentsList 部件模型
*
* @export
* @class PortalComponentsListModel
*/
export default class PortalComponentsListModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof PortalComponentsListModel
*/
public getDataItems(): any[] {
return [
{
name: 'createman',
},
{
name: 'ibizbookname',
},
{
name: 'ibizbook',
prop: 'ibizbookid',
},
{
name: 'createdate',
},
{
name: 'updateman',
},
{
name: 'updatedate',
},
{
name: 'author',
},
{
name: 'price',
},
{
name: 'press',
},
{
name: 'type',
},
{
name: 'booknumber',
},
{
name: 'subtext',
},
{
name: 'lendouttime',
},
{
name: 'returntime',
},
{
name: 'icon',
},
]
}
}
import { Http } from '@/utils';
import ControlService from '@/widgets/control-service';
/**
* PortalComponentsList 部件服务对象
*
* @export
* @class PortalComponentsListService
*/
export default class PortalComponentsListService 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% - 52px);
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 IBIZBOOKPortalComponentsListBase from './portal-components-list-portlet-base.vue';
import view_dashboard_sysportlet2_list from '@widgets/ibizbook/lnternal-func-list-list/lnternal-func-list-list.vue';
@Component({
components: {
view_dashboard_sysportlet2_list,
}
})
export default class IBIZBOOKPortalComponentsList extends IBIZBOOKPortalComponentsListBase {
}
</script>
<template>
<div class='portlet portal-components-view ' :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">
<ibizbookinternal-func-grid-view :portletState="viewState" :viewdata="JSON.stringify(context)" :viewDefaultUsage="false" ></ibizbookinternal-func-grid-view>
</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 IBIZBOOKService from '@/service/ibizbook/ibizbook-service';
import PortalComponentsViewService from './portal-components-view-portlet-service';
import IBIZBOOKUIService from '@/uiservice/ibizbook/ibizbook-ui-service';
import UIService from '@/uiservice/ui-service';
import { Environment } from '@/environments/environment';
@Component({
components: {
}
})
export default class IBIZBOOKPortalComponentsViewBase extends Vue implements ControlInterface {
/**
* 名称
*
* @type {string}
* @memberof PortalComponentsViewBase
*/
@Prop() public name?: string;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof PortalComponentsViewBase
*/
@Prop() public viewState!: Subject<ViewState>;
/**
* 应用上下文
*
* @type {*}
* @memberof PortalComponentsViewBase
*/
@Prop() public context!: any;
/**
* 视图参数
*
* @type {*}
* @memberof PortalComponentsViewBase
*/
@Prop() public viewparams!: any;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof PortalComponentsViewBase
*/
public viewStateEvent: Subscription | undefined;
/**
* 获取部件类型
*
* @returns {string}
* @memberof PortalComponentsViewBase
*/
public getControlType(): string {
return 'PORTLET'
}
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof PortalComponentsViewBase
*/
public counterServiceArray:Array<any> = [];
/**
* 建构部件服务对象
*
* @type {PortalComponentsViewService}
* @memberof PortalComponentsViewBase
*/
public service: PortalComponentsViewService = new PortalComponentsViewService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {IBIZBOOKService}
* @memberof PortalComponentsViewBase
*/
public appEntityService: IBIZBOOKService = new IBIZBOOKService({ $store: this.$store });
/**
* 界面UI服务对象
*
* @type {IBIZBOOKUIService}
* @memberof PortalComponentsViewBase
*/
public appUIService:IBIZBOOKUIService = new IBIZBOOKUIService(this.$store);
/**
* 关闭视图
*
* @param {any} args
* @memberof PortalComponentsViewBase
*/
public closeView(args: any): void {
let _this: any = this;
_this.$emit('closeview', [args]);
}
/**
* 计数器刷新
*
* @memberof PortalComponentsViewBase
*/
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 PortalComponentsViewBase
*/
@Prop() public height?: number;
/**
* 宽度
*
* @type {number}
* @memberof PortalComponentsViewBase
*/
@Prop() public width?: number;
/**
* 门户部件类型
*
* @type {number}
* @memberof PortalComponentsViewBase
*/
public portletType: string = 'view';
/**
* 视图默认使用
*
* @type {string}
* @memberof PortalComponentsViewBase
*/
@Inject({from:'navModel',default: 'tab'})
public navModel!:string;
/**
* 界面行为模型数据
*
* @memberof PortalComponentsViewBase
*/
public uiactionModel: any = {
}
/**
* 是否自适应大小
*
* @returns {boolean}
* @memberof PortalComponentsViewBase
*/
@Prop({default: false})public isAdaptiveSize!: boolean;
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof PortalComponentsViewBase
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof PortalComponentsViewBase
*/
public getData(): any {
return {};
}
/**
* 获取高度
*
* @returns {any[]}
* @memberof PortalComponentsViewBase
*/
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 '300px';
}
}
/**
* 刷新
*
* @memberof PortalComponentsViewBase
*/
public refresh(args?: any) {
this.viewState.next({ tag: 'IBIZBOOKInternalFuncGridView', action: 'refresh', data: args });
}
/**
* vue 生命周期
*
* @memberof PortalComponentsViewBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof PortalComponentsViewBase
*/
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 PortalComponentsViewBase
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof PortalComponentsViewBase
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
}
/**
* 计算界面行为权限
*
* @memberof PortalComponentsViewBase
*/
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 './portal-components-view-portlet.less';
</style>
/**
* PortalComponentsView 部件模型
*
* @export
* @class PortalComponentsViewModel
*/
export default class PortalComponentsViewModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof PortalComponentsViewModel
*/
public getDataItems(): any[] {
return [
{
name: 'createman',
},
{
name: 'ibizbookname',
},
{
name: 'ibizbook',
prop: 'ibizbookid',
},
{
name: 'createdate',
},
{
name: 'updateman',
},
{
name: 'updatedate',
},
{
name: 'author',
},
{
name: 'price',
},
{
name: 'press',
},
{
name: 'type',
},
{
name: 'booknumber',
},
{
name: 'subtext',
},
{
name: 'lendouttime',
},
{
name: 'returntime',
},
{
name: 'icon',
},
]
}
}
import { Http } from '@/utils';
import ControlService from '@/widgets/control-service';
/**
* PortalComponentsView 部件服务对象
*
* @export
* @class PortalComponentsViewService
*/
export default class PortalComponentsViewService 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% - 52px);
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 IBIZBOOKPortalComponentsViewBase from './portal-components-view-portlet-base.vue';
@Component({
components: {
}
})
export default class IBIZBOOKPortalComponentsView extends IBIZBOOKPortalComponentsViewBase {
}
</script>
<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 dashboard-viewdashboard-container1 ' :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>
<div class='portlet-container dashboard-viewdashboard-container2 ' :style="{}">
<row>
<i-col :md="{ span: 24, offset: 0 }" :lg="{ span: 11, offset: 1 }">
<div class="portlet-without-title">
<card class="portlet-card custom-card" :bordered="false" dis-hover :padding="10">
<span>
<view_dashboard_sysportlet1
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:height="300"
:width="0"
name="dashboard_sysportlet1"
ref='dashboard_sysportlet1'
@closeview="closeView($event)">
</view_dashboard_sysportlet1>
</span>
</card>
</div>
</i-col>
<i-col :md="{ span: 24, offset: 0 }" :lg="{ span: 11, offset: 0 }">
<div class="portlet-without-title">
<card class="portlet-card custom-card" :bordered="false" dis-hover :padding="10">
<span>
<view_dashboard_sysportlet2
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:height="300"
:width="0"
name="dashboard_sysportlet2"
ref='dashboard_sysportlet2'
@closeview="closeView($event)">
</view_dashboard_sysportlet2>
</span>
</card>
</div>
</i-col>
<i-col :md="{ span: 24, offset: 0 }" :lg="{ span: 22, offset: 1 }">
<div class="portlet-without-title">
<card class="portlet-card custom-card" :bordered="false" dis-hover :padding="10">
<span>
<view_dashboard_sysportlet3
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:height="300"
:width="0"
name="dashboard_sysportlet3"
ref='dashboard_sysportlet3'
@closeview="closeView($event)">
</view_dashboard_sysportlet3>
</span>
</card>
</div>
</i-col>
</row>
</div>
</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 IBIZBOOKService from '@/service/ibizbook/ibizbook-service';
import Usr2Service from './usr2-dashboard-service';
import IBIZBOOKUIService from '@/uiservice/ibizbook/ibizbook-ui-service';
import UtilService from '@/utilservice/util-service';
@Component({
components: {
}
})
export default class Usr2Base extends Vue implements ControlInterface {
/**
* 名称
*
* @type {string}
* @memberof Usr2Base
*/
@Prop() public name?: string;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof Usr2Base
*/
@Prop() public viewState!: Subject<ViewState>;
/**
* 应用上下文
*
* @type {*}
* @memberof Usr2Base
*/
@Prop() public context!: any;
/**
* 视图参数
*
* @type {*}
* @memberof Usr2Base
*/
@Prop() public viewparams!: any;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof Usr2Base
*/
public viewStateEvent: Subscription | undefined;
/**
* 获取部件类型
*
* @returns {string}
* @memberof Usr2Base
*/
public getControlType(): string {
return 'DASHBOARD'
}
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof Usr2Base
*/
public counterServiceArray:Array<any> = [];
/**
* 建构部件服务对象
*
* @type {Usr2Service}
* @memberof Usr2Base
*/
public service: Usr2Service = new Usr2Service({ $store: this.$store });
/**
* 实体服务对象
*
* @type {IBIZBOOKService}
* @memberof Usr2Base
*/
public appEntityService: IBIZBOOKService = new IBIZBOOKService({ $store: this.$store });
/**
* 转化数据
*
* @param {any} args
* @memberof Usr2Base
*/
public transformData(args: any) {
let _this: any = this;
if(_this.service && _this.service.handleRequestData instanceof Function && _this.service.handleRequestData('transform',_this.context,args)){
return _this.service.handleRequestData('transform',_this.context,args)['data'];
}
}
/**
* 关闭视图
*
* @param {any} args
* @memberof Usr2Base
*/
public closeView(args: any): void {
let _this: any = this;
_this.$emit('closeview', [args]);
}
/**
* 计数器刷新
*
* @memberof Usr2Base
*/
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 Usr2Base
*/
@Prop() public isEnableCustomized!:boolean;
/**
* 是否已有看板定制
*
* @public
* @type {(boolean)}
* @memberof Usr2Base
*/
public isHasCustomized:boolean = false;
/**
* 模型数据
*
* @public
* @type {(*)}
* @memberof Usr2Base
*/
public modelDta:any;
/**
* modleId
*
* @type {string}
* @memberof Usr2Base
*/
public modelId:string = "dashboard_ibizbook_usr2";
/**
* 建构功能服务对象
*
* @type {UtilService}
* @memberof Usr2Base
*/
public utilService:UtilService = new UtilService();
/**
* 功能服务名称
*
* @type {string}
* @memberof Usr2Base
*/
public utilServiceName:string = "";
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof Usr2Base
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof Usr2Base
*/
public getData(): any {
return {};
}
/**
* vue 生命周期
*
* @memberof Usr2Base
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof Usr2Base
*/
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 Usr2Base
*/
public layoutColNum:number = 12;
/**
* 动态设计单元格高度,80px
*
* @memberof Usr2Base
*/
public layoutRowH:number = 80;
/**
* 通知状态
*
* @memberof Usr2Base
*/
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 Usr2Base
*/
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 Usr2Base
*/
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:'IBIZBOOK'
}
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 Usr2Base
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof Usr2Base
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
}
}
</script>
<style lang='less'>
@import './usr2-dashboard.less';
</style>
\ No newline at end of file
/**
* Usr2 部件模型
*
* @export
* @class Usr2Model
*/
export default class Usr2Model {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof Usr2Model
*/
public getDataItems(): any[] {
return [
{
name: 'createman',
},
{
name: 'ibizbookname',
},
{
name: 'ibizbook',
prop: 'ibizbookid',
},
{
name: 'createdate',
},
{
name: 'updateman',
},
{
name: 'updatedate',
},
{
name: 'author',
},
{
name: 'price',
},
{
name: 'press',
},
{
name: 'type',
},
{
name: 'booknumber',
},
{
name: 'subtext',
},
{
name: 'lendouttime',
},
{
name: 'returntime',
},
{
name: 'icon',
},
]
}
}
\ No newline at end of file
import { Http } from '@/utils';
import ControlService from '@/widgets/control-service';
/**
* Usr2 部件服务对象
*
* @export
* @class Usr2Service
*/
export default class Usr2Service 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 Usr2Base from './usr2-dashboard-base.vue';
import view_dashboard_sysportlet2 from '@widgets/ibizbook/portal-components-list-portlet/portal-components-list-portlet.vue';
import view_dashboard_sysportlet3 from '@widgets/ibizbook/portal-components-view-portlet/portal-components-view-portlet.vue';
import view_dashboard_sysportlet1 from '@widgets/ibizorder/portal-components-chart-portlet/portal-components-chart-portlet.vue';
@Component({
components: {
view_dashboard_sysportlet2,
view_dashboard_sysportlet3,
view_dashboard_sysportlet1,
}
})
export default class Usr2 extends Usr2Base {
}
</script>
\ No newline at end of file
<template>
<div class='portlet portal-components-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_dashboard_sysportlet1_chart
:viewState="viewState"
:viewparams="viewparams"
:context="context"
fetchAction="FetchDefault"
:showBusyIndicator="true"
name="dashboard_sysportlet1_chart"
ref='dashboard_sysportlet1_chart'
@closeview="closeView($event)">
</view_dashboard_sysportlet1_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 IBIZOrderService from '@/service/ibizorder/ibizorder-service';
import PortalComponentsChartService from './portal-components-chart-portlet-service';
import IBIZOrderUIService from '@/uiservice/ibizorder/ibizorder-ui-service';
import UIService from '@/uiservice/ui-service';
import { Environment } from '@/environments/environment';
@Component({
components: {
}
})
export default class IBIZOrderPortalComponentsChartBase extends Vue implements ControlInterface {
/**
* 名称
*
* @type {string}
* @memberof PortalComponentsChartBase
*/
@Prop() public name?: string;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof PortalComponentsChartBase
*/
@Prop() public viewState!: Subject<ViewState>;
/**
* 应用上下文
*
* @type {*}
* @memberof PortalComponentsChartBase
*/
@Prop() public context!: any;
/**
* 视图参数
*
* @type {*}
* @memberof PortalComponentsChartBase
*/
@Prop() public viewparams!: any;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof PortalComponentsChartBase
*/
public viewStateEvent: Subscription | undefined;
/**
* 获取部件类型
*
* @returns {string}
* @memberof PortalComponentsChartBase
*/
public getControlType(): string {
return 'PORTLET'
}
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof PortalComponentsChartBase
*/
public counterServiceArray:Array<any> = [];
/**
* 建构部件服务对象
*
* @type {PortalComponentsChartService}
* @memberof PortalComponentsChartBase
*/
public service: PortalComponentsChartService = new PortalComponentsChartService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {IBIZOrderService}
* @memberof PortalComponentsChartBase
*/
public appEntityService: IBIZOrderService = new IBIZOrderService({ $store: this.$store });
/**
* 界面UI服务对象
*
* @type {IBIZOrderUIService}
* @memberof PortalComponentsChartBase
*/
public appUIService:IBIZOrderUIService = new IBIZOrderUIService(this.$store);
/**
* 关闭视图
*
* @param {any} args
* @memberof PortalComponentsChartBase
*/
public closeView(args: any): void {
let _this: any = this;
_this.$emit('closeview', [args]);
}
/**
* 计数器刷新
*
* @memberof PortalComponentsChartBase
*/
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 PortalComponentsChartBase
*/
@Prop() public height?: number;
/**
* 宽度
*
* @type {number}
* @memberof PortalComponentsChartBase
*/
@Prop() public width?: number;
/**
* 门户部件类型
*
* @type {number}
* @memberof PortalComponentsChartBase
*/
public portletType: string = 'chart';
/**
* 视图默认使用
*
* @type {string}
* @memberof PortalComponentsChartBase
*/
@Inject({from:'navModel',default: 'tab'})
public navModel!:string;
/**
* 界面行为模型数据
*
* @memberof PortalComponentsChartBase
*/
public uiactionModel: any = {
}
/**
* 是否自适应大小
*
* @returns {boolean}
* @memberof PortalComponentsChartBase
*/
@Prop({default: false})public isAdaptiveSize!: boolean;
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof PortalComponentsChartBase
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof PortalComponentsChartBase
*/
public getData(): any {
return {};
}
/**
* 获取高度
*
* @returns {any[]}
* @memberof PortalComponentsChartBase
*/
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 '300px';
}
}
/**
* 刷新
*
* @memberof PortalComponentsChartBase
*/
public refresh(args?: any) {
this.viewState.next({ tag: 'dashboard_sysportlet1_chart', action: 'refresh', data: args });
}
/**
* vue 生命周期
*
* @memberof PortalComponentsChartBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof PortalComponentsChartBase
*/
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 PortalComponentsChartBase
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof PortalComponentsChartBase
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
}
/**
* 计算界面行为权限
*
* @memberof PortalComponentsChartBase
*/
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 './portal-components-chart-portlet.less';
</style>
/**
* PortalComponentsChart 部件模型
*
* @export
* @class PortalComponentsChartModel
*/
export default class PortalComponentsChartModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof PortalComponentsChartModel
*/
public getDataItems(): any[] {
return [
{
name: 'tp',
},
{
name: 'endtime',
},
{
name: 'wfstate',
},
{
name: 'createdate',
},
{
name: 'opinion',
},
{
name: 'updatedate',
},
{
name: 'ordertype',
},
{
name: 'detailnum',
},
{
name: 'wfinstanceid',
},
{
name: 'amount',
},
{
name: 'orderuid',
},
{
name: 'ibizorder',
prop: 'ibizorderid',
},
{
name: 'orderstate',
},
{
name: 'starttime',
},
{
name: 'updateman',
},
{
name: 'wfstep',
},
{
name: 'createman',
},
{
name: 'ibizordername',
},
{
name: 'ordertime',
},
{
name: 'memo',
},
{
name: 'ibizcustomername',
},
{
name: 'ibizcustomerid',
},
]
}
}
import { Http } from '@/utils';
import ControlService from '@/widgets/control-service';
/**
* PortalComponentsChart 部件服务对象
*
* @export
* @class PortalComponentsChartService
*/
export default class PortalComponentsChartService 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% - 52px);
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 IBIZOrderPortalComponentsChartBase from './portal-components-chart-portlet-base.vue';
import view_dashboard_sysportlet1_chart from '@widgets/ibizorder/area-chart/area-chart.vue';
@Component({
components: {
view_dashboard_sysportlet1_chart,
}
})
export default class IBIZOrderPortalComponentsChart extends IBIZOrderPortalComponentsChartBase {
}
</script>
......@@ -302,7 +302,7 @@
{
"appid":"Web",
"appname":"演示应用",
"appmenu":[{"menuid":"MainMenu", "menuname":"MainMenu", "menuitem":[{ "id":"menuitem1" , "name":"工作台" },{ "id":"menuitem3" , "name":"控件" , "items":[{ "id":"menuitem6" , "name":"默认数据类型" },{ "id":"menuitem7" , "name":"默认编辑器类型" },{ "id":"menuitem15" , "name":"基础表单项" },{ "id":"menuitem72" , "name":"扩展编辑器" },{ "id":"menuitem114" , "name":"扩展编辑器表格" }]},{ "id":"menuitem4" , "name":"部件" , "items":[{ "id":"menuitem12" , "name":"编辑表单" , "items":[{ "id":"menuitem107" , "name":"内置功能" },{ "id":"menuitem47" , "name":"新建默认值" },{ "id":"menuitem99" , "name":"更新默认值" },{ "id":"menuitem48" , "name":"输入提示" },{ "id":"menuitem49" , "name":"辅助输入" },{ "id":"menuitem50" , "name":"自动填充" },{ "id":"menuitem51" , "name":"超链接" },{ "id":"menuitem52" , "name":"表单值重置" },{ "id":"menuitem55" , "name":"动态显示" },{ "id":"menuitem53" , "name":"动态启用" },{ "id":"menuitem54" , "name":"动态空输入" },{ "id":"menuitem56" , "name":"表单项更新" },{ "id":"menuitem108" , "name":"表单值规则" }]},{ "id":"menuitem16" , "name":"搜索表单" },{ "id":"menuitem13" , "name":"表格" , "items":[{ "id":"menuitem57" , "name":"禁用排序" },{ "id":"menuitem59" , "name":"行操作" },{ "id":"menuitem58" , "name":"行编辑" },{ "id":"menuitem73" , "name":"表格内置功能" },{ "id":"menuitem74" , "name":"表格行编辑" },{ "id":"menuitem75" , "name":"新建默认值" },{ "id":"menuitem76" , "name":"更新默认值" },{ "id":"menuitem77" , "name":"表格值规则" },{ "id":"menuitem78" , "name":"自动分组" },{ "id":"menuitem80" , "name":"代码表分组" },{ "id":"menuitem81" , "name":"当前页聚合" },{ "id":"menuitem82" , "name":"远程聚合" }]},{ "id":"menuitem83" , "name":"列表" , "items":[{ "id":"menuitem84" , "name":"列表内置功能" },{ "id":"menuitem85" , "name":"列表自动分组" },{ "id":"menuitem86" , "name":"代码表分组" },{ "id":"menuitem91" , "name":"列表嵌入面板" }]},{ "id":"menuitem14" , "name":"树视图" , "items":[{ "id":"menuitem60" , "name":"静态节点" },{ "id":"menuitem61" , "name":"动态节点(代码表)" },{ "id":"menuitem62" , "name":"动态节点(实体)" },{ "id":"menuitem63" , "name":"右键操作" },{ "id":"menuitem64" , "name":"动态参数过滤" },{ "id":"menuitem110" , "name":"树表格" }]},{ "id":"menuitem37" , "name":"图表" , "items":[{ "id":"menuitem38" , "name":"柱状图" },{ "id":"menuitem39" , "name":"折线图" },{ "id":"menuitem40" , "name":"饼图" },{ "id":"menuitem41" , "name":"区域图" },{ "id":"menuitem42" , "name":"雷达图" }]},{ "id":"menuitem17" , "name":"向导" },{ "id":"menuitem18" , "name":"界面行为" , "items":[{ "id":"menuitem65" , "name":"前端界面行为" },{ "id":"menuitem66" , "name":"后台界面行为" }]},{ "id":"menuitem87" , "name":"数据视图" , "items":[{ "id":"menuitem88" , "name":"内置功能" },{ "id":"menuitem89" , "name":"自动分组" },{ "id":"menuitem90" , "name":"代码表分组" },{ "id":"menuitem94" , "name":"项布局面板" }]},{ "id":"menuitem95" , "name":"日历" , "items":[{ "id":"menuitem96" , "name":"内置功能" },{ "id":"menuitem97" , "name":"时间轴样式" },{ "id":"menuitem109" , "name":"项布局面板" }]},{ "id":"menuitem101" , "name":"看板" , "items":[{ "id":"menuitem102" , "name":"看板内置功能" },{ "id":"menuitem104" , "name":"代码表分组" },{ "id":"menuitem105" , "name":"嵌入视图面板" }]},{ "id":"menuitem111" , "name":"甘特图" , "items":[{ "id":"menuitem112" , "name":"甘特图" }]},{ "id":"menuitem119" , "name":"分页视图" , "items":[{ "id":"menuitem120" , "name":"分页导航" }]},{ "id":"menuitem121" , "name":"多编辑视图" , "items":[{ "id":"menuitem115" , "name":"多表单(行记录)" },{ "id":"menuitem123" , "name":"多表单(上分页)" }]},{ "id":"menuitem122" , "name":"数据关系栏" , "items":[{ "id":"menuitem116" , "name":"编辑视图(左右关系)" },{ "id":"menuitem117" , "name":"编辑视图(上下关系)" },{ "id":"menuitem118" , "name":"编辑视图(分页关系)" }]}]},{ "id":"menuitem5" , "name":"视图" , "items":[{ "id":"menuitem9" , "name":"列表视图" , "items":[{ "id":"menuitem19" , "name":"常规表格视图" },{ "id":"menuitem21" , "name":"左右表格视图" },{ "id":"menuitem20" , "name":"嵌入表格视图" }]},{ "id":"menuitem8" , "name":"编辑视图" , "items":[{ "id":"menuitem22" , "name":"常规编辑视图" },{ "id":"menuitem23" , "name":"左右编辑视图" },{ "id":"menuitem24" , "name":"分页编辑视图" },{ "id":"menuitem25" , "name":"嵌入编辑视图" }]},{ "id":"menuitem26" , "name":"选择视图" , "items":[{ "id":"menuitem27" , "name":"单选视图" },{ "id":"menuitem28" , "name":"多选视图" },{ "id":"menuitem29" , "name":"树形选择视图" },{ "id":"menuitem30" , "name":"左右单选视图" },{ "id":"menuitem31" , "name":"左右多选视图" }]},{ "id":"menuitem10" , "name":"导航视图" , "items":[{ "id":"menuitem32" , "name":"常规导航视图" },{ "id":"menuitem33" , "name":"分页导航视图" },{ "id":"menuitem34" , "name":"嵌入导航视图" }]},{ "id":"menuitem11" , "name":"其他视图" , "items":[{ "id":"menuitem35" , "name":"图表视图" },{ "id":"menuitem36" , "name":"报表视图" },{ "id":"menuitem98" , "name":"自定义视图" }]},{ "id":"menuitem79" , "name":"表格视图" }]},{ "id":"menuitem69" , "name":"工作流" },{ "id":"menuitem2" , "name":"更多" , "items":[{ "id":"menuitem46" , "name":"数据导出导入" },{ "id":"menuitem45" , "name":"数据打印" },{ "id":"menuitem67" , "name":"索引实体" },{ "id":"menuitem68" , "name":"继承实体" },{ "id":"menuitem70" , "name":"主状态" },{ "id":"menuitem71" , "name":"多表单" }]},{ "id":"menuitem92" , "name":"其他" , "items":[{ "id":"menuitem93" , "name":"示例实体02示例数据补充" },{ "id":"menuitem100" , "name":"订单示例数据补充" },{ "id":"menuitem103" , "name":"产品示例数据补充" },{ "id":"menuitem106" , "name":"示例实体03示例数据补充" },{ "id":"menuitem113" , "name":"订单类型添加" },{ "id":"menuitem124" , "name":"示例实体01数据补充" }]}] }]
"appmenu":[{"menuid":"MainMenu", "menuname":"MainMenu", "menuitem":[{ "id":"menuitem1" , "name":"工作台" },{ "id":"menuitem3" , "name":"控件" , "items":[{ "id":"menuitem6" , "name":"默认数据类型" },{ "id":"menuitem7" , "name":"默认编辑器类型" },{ "id":"menuitem15" , "name":"基础表单项" },{ "id":"menuitem72" , "name":"扩展编辑器" },{ "id":"menuitem114" , "name":"扩展编辑器表格" }]},{ "id":"menuitem4" , "name":"部件" , "items":[{ "id":"menuitem12" , "name":"编辑表单" , "items":[{ "id":"menuitem107" , "name":"内置功能" },{ "id":"menuitem47" , "name":"新建默认值" },{ "id":"menuitem99" , "name":"更新默认值" },{ "id":"menuitem48" , "name":"输入提示" },{ "id":"menuitem49" , "name":"辅助输入" },{ "id":"menuitem50" , "name":"自动填充" },{ "id":"menuitem51" , "name":"超链接" },{ "id":"menuitem52" , "name":"表单值重置" },{ "id":"menuitem55" , "name":"动态显示" },{ "id":"menuitem53" , "name":"动态启用" },{ "id":"menuitem54" , "name":"动态空输入" },{ "id":"menuitem56" , "name":"表单项更新" },{ "id":"menuitem108" , "name":"表单值规则" }]},{ "id":"menuitem16" , "name":"搜索表单" },{ "id":"menuitem13" , "name":"表格" , "items":[{ "id":"menuitem57" , "name":"禁用排序" },{ "id":"menuitem59" , "name":"行操作" },{ "id":"menuitem58" , "name":"行编辑" },{ "id":"menuitem73" , "name":"表格内置功能" },{ "id":"menuitem74" , "name":"表格行编辑" },{ "id":"menuitem75" , "name":"新建默认值" },{ "id":"menuitem76" , "name":"更新默认值" },{ "id":"menuitem77" , "name":"表格值规则" },{ "id":"menuitem78" , "name":"自动分组" },{ "id":"menuitem80" , "name":"代码表分组" },{ "id":"menuitem81" , "name":"当前页聚合" },{ "id":"menuitem82" , "name":"远程聚合" }]},{ "id":"menuitem83" , "name":"列表" , "items":[{ "id":"menuitem84" , "name":"列表内置功能" },{ "id":"menuitem85" , "name":"列表自动分组" },{ "id":"menuitem86" , "name":"代码表分组" },{ "id":"menuitem91" , "name":"列表嵌入面板" }]},{ "id":"menuitem14" , "name":"树视图" , "items":[{ "id":"menuitem60" , "name":"静态节点" },{ "id":"menuitem61" , "name":"动态节点(代码表)" },{ "id":"menuitem62" , "name":"动态节点(实体)" },{ "id":"menuitem63" , "name":"右键操作" },{ "id":"menuitem64" , "name":"动态参数过滤" },{ "id":"menuitem110" , "name":"树表格" }]},{ "id":"menuitem37" , "name":"图表" , "items":[{ "id":"menuitem38" , "name":"柱状图" },{ "id":"menuitem39" , "name":"折线图" },{ "id":"menuitem40" , "name":"饼图" },{ "id":"menuitem41" , "name":"区域图" },{ "id":"menuitem42" , "name":"雷达图" }]},{ "id":"menuitem17" , "name":"向导" },{ "id":"menuitem18" , "name":"界面行为" , "items":[{ "id":"menuitem65" , "name":"前端界面行为" },{ "id":"menuitem66" , "name":"后台界面行为" }]},{ "id":"menuitem87" , "name":"数据视图" , "items":[{ "id":"menuitem88" , "name":"内置功能" },{ "id":"menuitem89" , "name":"自动分组" },{ "id":"menuitem90" , "name":"代码表分组" },{ "id":"menuitem94" , "name":"项布局面板" }]},{ "id":"menuitem95" , "name":"日历" , "items":[{ "id":"menuitem96" , "name":"内置功能" },{ "id":"menuitem97" , "name":"时间轴样式" },{ "id":"menuitem109" , "name":"项布局面板" }]},{ "id":"menuitem101" , "name":"看板" , "items":[{ "id":"menuitem102" , "name":"看板内置功能" },{ "id":"menuitem104" , "name":"代码表分组" },{ "id":"menuitem105" , "name":"嵌入视图面板" }]},{ "id":"menuitem111" , "name":"甘特图" , "items":[{ "id":"menuitem112" , "name":"甘特图" }]},{ "id":"menuitem119" , "name":"分页视图" , "items":[{ "id":"menuitem120" , "name":"分页导航" }]},{ "id":"menuitem121" , "name":"多编辑视图" , "items":[{ "id":"menuitem115" , "name":"多表单(行记录)" },{ "id":"menuitem123" , "name":"多表单(上分页)" }]},{ "id":"menuitem122" , "name":"数据关系栏" , "items":[{ "id":"menuitem116" , "name":"编辑视图(左右关系)" },{ "id":"menuitem117" , "name":"编辑视图(上下关系)" },{ "id":"menuitem118" , "name":"编辑视图(分页关系)" }]},{ "id":"menuitem125" , "name":"数据看板" , "items":[{ "id":"menuitem126" , "name":"实体数据看板" }]}]},{ "id":"menuitem5" , "name":"视图" , "items":[{ "id":"menuitem9" , "name":"列表视图" , "items":[{ "id":"menuitem19" , "name":"常规表格视图" },{ "id":"menuitem21" , "name":"左右表格视图" },{ "id":"menuitem20" , "name":"嵌入表格视图" }]},{ "id":"menuitem8" , "name":"编辑视图" , "items":[{ "id":"menuitem22" , "name":"常规编辑视图" },{ "id":"menuitem23" , "name":"左右编辑视图" },{ "id":"menuitem24" , "name":"分页编辑视图" },{ "id":"menuitem25" , "name":"嵌入编辑视图" }]},{ "id":"menuitem26" , "name":"选择视图" , "items":[{ "id":"menuitem27" , "name":"单选视图" },{ "id":"menuitem28" , "name":"多选视图" },{ "id":"menuitem29" , "name":"树形选择视图" },{ "id":"menuitem30" , "name":"左右单选视图" },{ "id":"menuitem31" , "name":"左右多选视图" }]},{ "id":"menuitem10" , "name":"导航视图" , "items":[{ "id":"menuitem32" , "name":"常规导航视图" },{ "id":"menuitem33" , "name":"分页导航视图" },{ "id":"menuitem34" , "name":"嵌入导航视图" }]},{ "id":"menuitem11" , "name":"其他视图" , "items":[{ "id":"menuitem35" , "name":"图表视图" },{ "id":"menuitem36" , "name":"报表视图" },{ "id":"menuitem98" , "name":"自定义视图" }]},{ "id":"menuitem79" , "name":"表格视图" }]},{ "id":"menuitem69" , "name":"工作流" },{ "id":"menuitem2" , "name":"更多" , "items":[{ "id":"menuitem46" , "name":"数据导出导入" },{ "id":"menuitem45" , "name":"数据打印" },{ "id":"menuitem67" , "name":"索引实体" },{ "id":"menuitem68" , "name":"继承实体" },{ "id":"menuitem70" , "name":"主状态" },{ "id":"menuitem71" , "name":"多表单" }]},{ "id":"menuitem92" , "name":"其他" , "items":[{ "id":"menuitem93" , "name":"示例实体02示例数据补充" },{ "id":"menuitem100" , "name":"订单示例数据补充" },{ "id":"menuitem103" , "name":"产品示例数据补充" },{ "id":"menuitem106" , "name":"示例实体03示例数据补充" },{ "id":"menuitem113" , "name":"订单类型添加" },{ "id":"menuitem124" , "name":"示例实体01数据补充" }]}] }]
}
]
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册