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

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

上级 3d294727
......@@ -287,6 +287,8 @@ export default {
menuitem32: "常规导航视图",
menuitem33: "分页导航视图",
menuitem34: "嵌入导航视图",
menuitem176: "实体表格导航视图",
menuitem177: "实体列表导航视图",
menuitem11: "其他视图",
menuitem35: "图表视图",
menuitem36: "报表视图",
......@@ -313,6 +315,11 @@ export default {
menuitem168: "实体多表单编辑视图",
menuitem169: "实体甘特视图",
menuitem170: "实体日历视图",
menuitem171: "实体看板视图",
menuitem172: "实体树表格视图",
menuitem173: "实体树视图",
menuitem174: "实体数据视图",
menuitem175: "实体图表视图",
menuitem69: "工作流",
menuitem153: "逻辑",
menuitem154: "应用功能",
......
......@@ -287,6 +287,8 @@ export default {
menuitem32: "常规导航视图",
menuitem33: "分页导航视图",
menuitem34: "嵌入导航视图",
menuitem176: "实体表格导航视图",
menuitem177: "实体列表导航视图",
menuitem11: "其他视图",
menuitem35: "图表视图",
menuitem36: "报表视图",
......@@ -313,6 +315,11 @@ export default {
menuitem168: "实体多表单编辑视图",
menuitem169: "实体甘特视图",
menuitem170: "实体日历视图",
menuitem171: "实体看板视图",
menuitem172: "实体树表格视图",
menuitem173: "实体树视图",
menuitem174: "实体数据视图",
menuitem175: "实体图表视图",
menuitem69: "工作流",
menuitem153: "逻辑",
menuitem154: "应用功能",
......
......@@ -409,6 +409,13 @@ export default {
uiactions: {
},
},
gridexpbar_grid_grid: {
columns: {
},
nodata:"",
uiactions: {
},
},
rowedit_grid: {
columns: {
ibizbookname: "图书名称",
......@@ -555,13 +562,6 @@ export default {
uiactions: {
},
},
gridexpbar_grid_grid: {
columns: {
},
nodata:"",
uiactions: {
},
},
groupbycodelistlist_list: {
nodata:"",
uiactions: {
......
......@@ -408,6 +408,13 @@ export default {
uiactions: {
},
},
gridexpbar_grid_grid: {
columns: {
},
nodata:"",
uiactions: {
},
},
rowedit_grid: {
columns: {
ibizbookname: "图书名称",
......@@ -554,13 +561,6 @@ export default {
uiactions: {
},
},
gridexpbar_grid_grid: {
columns: {
},
nodata:"",
uiactions: {
},
},
groupbycodelistlist_list: {
nodata:"",
uiactions: {
......
......@@ -2161,6 +2161,42 @@ mock.onGet('v7/main-menuappmenu').reply((config: any) => {
textcls: '',
appfunctag: 'Auto126',
resourcetag: '',
},
{
id: 'C12171AD-42C7-4CA4-BF57-34B949E33EF2',
name: 'menuitem176',
text: '实体表格导航视图',
type: 'MENUITEM',
counterid: '',
tooltip: '实体表格导航视图',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: 'AppFunc77',
resourcetag: '',
},
{
id: '06F9EF42-448C-42C1-BDD9-44858FFDD2F1',
name: 'menuitem177',
text: '实体列表导航视图',
type: 'MENUITEM',
counterid: '',
tooltip: '实体列表导航视图',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: 'AppFunc56',
resourcetag: '',
},
],
},
......@@ -2641,6 +2677,96 @@ mock.onGet('v7/main-menuappmenu').reply((config: any) => {
textcls: '',
appfunctag: 'AppFunc20',
resourcetag: '',
},
{
id: '9453E9F0-DBA0-4F2B-A45E-3474E2C57FB5',
name: 'menuitem171',
text: '实体看板视图',
type: 'MENUITEM',
counterid: '',
tooltip: '实体看板视图',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: 'AppFunc25',
resourcetag: '',
},
{
id: '06128DC9-8F55-4AD4-95A0-E4BD1F91DA30',
name: 'menuitem172',
text: '实体树表格视图',
type: 'MENUITEM',
counterid: '',
tooltip: '实体树表格视图',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: 'AppFunc30',
resourcetag: '',
},
{
id: '8229A864-9DE3-4F2D-BBFE-A3453A22D7DD',
name: 'menuitem173',
text: '实体树视图',
type: 'MENUITEM',
counterid: '',
tooltip: '实体树视图',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: '',
resourcetag: '',
},
{
id: 'CDCBE495-DEDA-49D8-ABEB-7B3B7DC898F4',
name: 'menuitem174',
text: '实体数据视图',
type: 'MENUITEM',
counterid: '',
tooltip: '实体数据视图',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: 'AppFunc14',
resourcetag: '',
},
{
id: '5726035D-58B6-4016-9359-00A1E7318174',
name: 'menuitem175',
text: '实体图表视图',
type: 'MENUITEM',
counterid: '',
tooltip: '实体图表视图',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: 'AppFunc35',
resourcetag: '',
},
],
},
......
<template>
<div class="view-container degridexpview ibizbookgrid-exp-view">
<app-studioaction :viewTitle="$t(model.srfCaption)" viewName="ibizbookgridexpview"></app-studioaction>
<card class='view-card view-no-toolbar' :dis-hover="true" :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_gridexpbar
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:showBusyIndicator="true"
:viewUID="viewUID"
:newdata="newdata"
:opendata="opendata"
name="gridexpbar"
ref='gridexpbar'
@selectionchange="gridexpbar_selectionchange($event)"
@activated="gridexpbar_activated($event)"
@load="gridexpbar_load($event)"
@closeview="closeView($event)">
</view_gridexpbar>
</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 GridExpViewEngine from '@engine/view/grid-exp-view-engine';
import IBIZBOOKUIService from '@/uiservice/ibizbook/ibizbook-ui-service';
@Component({
components: {
},
})
export default class IBIZBOOKGridExpViewBase extends Vue {
/**
* 实体服务对象
*
* @type {IBIZBOOKService}
* @memberof IBIZBOOKGridExpViewBase
*/
public appEntityService: IBIZBOOKService = new IBIZBOOKService;
/**
* 实体UI服务对象
*
* @type IBIZBOOKUIService
* @memberof IBIZBOOKGridExpViewBase
*/
public appUIService: IBIZBOOKUIService = new IBIZBOOKUIService(this.$store);
/**
* 数据变化
*
* @param {*} val
* @returns {*}
* @memberof IBIZBOOKGridExpViewBase
*/
@Emit()
public viewDatasChange(val: any):any {
return val;
}
/**
* 传入视图上下文
*
* @type {string}
* @memberof IBIZBOOKGridExpViewBase
*/
@Prop() public viewdata!: string;
/**
* 传入视图参数
*
* @type {string}
* @memberof IBIZBOOKGridExpViewBase
*/
@Prop() public viewparam!: string;
/**
* 视图默认使用
*
* @type {boolean}
* @memberof IBIZBOOKGridExpViewBase
*/
@Prop({ default: true }) public viewDefaultUsage!: boolean;
/**
* 视图默认使用
*
* @type {string}
* @memberof IBIZBOOKGridExpViewBase
*/
@Inject({from:'navModel',default: 'tab'})
public navModel!:string;
/**
* 视图标识
*
* @type {string}
* @memberof IBIZBOOKGridExpViewBase
*/
public viewtag: string = 'e8777dd0c1ad16060fed5e7ed2380cc7';
/**
* 自定义视图导航上下文集合
*
* @type {*}
* @memberof IBIZBOOKGridExpViewBase
*/
public customViewNavContexts:any ={
};
/**
* 自定义视图导航参数集合
*
* @type {*}
* @memberof IBIZBOOKGridExpViewBase
*/
public customViewParams:any ={
};
/**
* 视图模型数据
*
* @type {*}
* @memberof IBIZBOOKGridExpViewBase
*/
public model: any = {
srfCaption: 'entities.ibizbook.views.gridexpview.caption',
srfTitle: 'entities.ibizbook.views.gridexpview.title',
srfSubTitle: 'entities.ibizbook.views.gridexpview.subtitle',
dataInfo: ''
}
/**
* 视图参数变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof IBIZBOOKGridExpViewBase
*/
@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 IBIZBOOKGridExpViewBase
*/
@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 IBIZBOOKGridExpViewBase
*/
public containerModel: any = {
view_gridexpbar: { name: 'gridexpbar', type: 'GRIDEXPBAR' },
};
/**
* 计数器刷新
*
* @memberof IBIZBOOKGridExpViewBase
*/
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 IBIZBOOKGridExpViewBase
*/
public viewState: Subject<ViewState> = new Subject();
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof IBIZBOOKGridExpViewBase
*/
public engine: GridExpViewEngine = new GridExpViewEngine();
/**
* 引擎初始化
*
* @public
* @memberof IBIZBOOKGridExpViewBase
*/
public engineInit(): void {
this.engine.init({
view: this,
gridexpbar: this.$refs.gridexpbar,
keyPSDEField: 'ibizbook',
majorPSDEField: 'ibizbookname',
isLoadDefault: true,
});
}
/**
* 应用导航服务
*
* @type {*}
* @memberof IBIZBOOKGridExpViewBase
*/
public navDataService = NavDataService.getInstance(this.$store);
/**
* 导航服务事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof IBIZBOOKGridExpViewBase
*/
public serviceStateEvent: Subscription | undefined;
/**
* 门户部件状态对象
*
* @type {*}
* @memberof IBIZBOOKGridExpViewBase
*/
@Prop() public portletState?: any;
/**
* 门户部件状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof IBIZBOOKGridExpViewBase
*/
public portletStateEvent: Subscription | undefined;
/**
* 应用上下文
*
* @type {*}
* @memberof IBIZBOOKGridExpViewBase
*/
public context:any = {};
/**
* 视图参数
*
* @type {*}
* @memberof IBIZBOOKGridExpViewBase
*/
public viewparams:any = {};
/**
* 视图缓存数据
*
* @type {*}
* @memberof IBIZBOOKGridExpViewBase
*/
public viewCacheData:any;
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof IBIZBOOKGridExpViewBase
*/
public counterServiceArray:Array<any> = [];
/**
* 解析视图参数
*
* @public
* @memberof IBIZBOOKGridExpViewBase
*/
public parseViewParam(inputvalue:any = null): void {
for(let key in this.context){
delete this.context[key];
}
if(this.$store.getters.getAppData() && this.$store.getters.getAppData().context){
Object.assign(this.context,this.$store.getters.getAppData().context);
}
if (!this.viewDefaultUsage && this.viewdata && !Object.is(this.viewdata, '')) {
if(typeof this.viewdata == 'string') {
Object.assign(this.context, JSON.parse(this.viewdata));
}
if(this.context && this.context.srfparentdename){
Object.assign(this.viewparams,{srfparentdename:this.context.srfparentdename});
}
if(this.context && this.context.srfparentkey){
Object.assign(this.viewparams,{srfparentkey:this.context.srfparentkey});
}
this.handleCustomViewData();
return;
}
const path = (this.$route.matched[this.$route.matched.length - 1]).path;
const keys: Array<any> = [];
const curReg = this.$pathToRegExp.pathToRegexp(path, keys);
const matchArray = curReg.exec(this.$route.path);
let tempValue: Object = {};
keys.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item.name, {
enumerable: true,
value: matchArray[index + 1]
});
});
this.$viewTool.formatRouteParams(tempValue,this.$route,this.context,this.viewparams);
if(inputvalue){
Object.assign(this.context,{'ibizbook':inputvalue});
}
//初始化视图唯一标识
Object.assign(this.context,{srfsessionid:this.$util.createUUID()});
this.handleCustomViewData();
//初始化导航数据
this.initNavDataWithRoute();
}
/**
* 处理自定义视图数据
*
* @memberof IBIZBOOKGridExpViewBase
*/
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 IBIZBOOKGridExpViewBase
*/
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 IBIZBOOKGridExpViewBase
*/
public initNavDataWithRoute(data:any = null, isNew:boolean = false, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && Object.is(this.navModel,"route")) ){
this.navDataService.addNavData({id:'ibizbookgrid-exp-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 IBIZBOOKGridExpViewBase
*/
public initNavDataWithTab(data:any = null,isOnlyAdd:boolean = true, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && !Object.is(this.navModel,"route")) ){
this.navDataService.addNavDataByOnly({id:'ibizbookgrid-exp-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 IBIZBOOKGridExpViewBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof IBIZBOOKGridExpViewBase
*/
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,'ibizbookgrid-exp-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,'IBIZBOOKGridExpView')){
return;
}
if(Object.is(res.action,'refresh') && _this.refresh && _this.refresh instanceof Function){
_this.refresh();
}
})
}
}
/**
* 销毁之前
*
* @memberof IBIZBOOKGridExpViewBase
*/
public beforeDestroy() {
this.$store.commit('viewaction/removeView', this.viewtag);
}
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof IBIZBOOKGridExpViewBase
*/
public mounted() {
this.afterMounted();
}
/**
* 执行mounted后的逻辑
*
* @memberof IBIZBOOKGridExpViewBase
*/
public afterMounted(){
const _this: any = this;
_this.engineInit();
if (_this.loadModel && _this.loadModel instanceof Function) {
_this.loadModel();
}
}
/**
* gridexpbar 部件 selectionchange 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZBOOKGridExpViewBase
*/
public gridexpbar_selectionchange($event: any, $event2?: any) {
this.engine.onCtrlEvent('gridexpbar', 'selectionchange', $event);
}
/**
* gridexpbar 部件 activated 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZBOOKGridExpViewBase
*/
public gridexpbar_activated($event: any, $event2?: any) {
this.engine.onCtrlEvent('gridexpbar', 'activated', $event);
}
/**
* gridexpbar 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZBOOKGridExpViewBase
*/
public gridexpbar_load($event: any, $event2?: any) {
this.engine.onCtrlEvent('gridexpbar', 'load', $event);
}
/**
* 打开新建数据视图
*
* @param {any[]} args
* @param {*} [params]
* @param {*} [fullargs]
* @param {*} [$event]
* @param {*} [xData]
* @memberof IBIZBOOKGridExpView
*/
public newdata(args: any[],fullargs?:any[], params?: any, $event?: any, xData?: any) {
let localContext:any = null;
let localViewParam:any =null;
this.$Notice.warning({ title: '错误', desc: '未指定关系视图' });
}
/**
* 打开编辑数据视图
*
* @param {any[]} args
* @param {*} [params]
* @param {*} [fullargs]
* @param {*} [$event]
* @param {*} [xData]
* @memberof IBIZBOOKGridExpView
*/
public opendata(args: any[],fullargs?:any,params?: any, $event?: any, xData?: any) {
if(!this.viewDefaultUsage){
if(Object.is(this.navModel,"route")){
this.initNavDataWithRoute(this.viewCacheData, false, true);
}else{
this.initNavDataWithTab(this.viewCacheData, false, true);
}
}
let localContext:any = null;
let localViewParam:any =null;
this.$Notice.warning({ title: '错误', desc: '未指定关系视图' });
}
/**
* 关闭视图
*
* @param {any[]} args
* @memberof IBIZBOOKGridExpViewBase
*/
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 IBIZBOOKGridExpViewBase
*/
public destroyed(){
this.afterDestroyed();
}
/**
* 执行destroyed后的逻辑
*
* @memberof IBIZBOOKGridExpViewBase
*/
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();
}
}
/**
* 视图唯一标识
*
* @type {string}
* @memberof IBIZBOOKGridExpViewBase
*/
public viewUID: string = 'sample-ibizbookgrid-exp-view';
}
</script>
<style lang='less'>
@import './ibizbookgrid-exp-view.less';
</style>
\ No newline at end of file
.ibizbookgrid-exp-view{
position: relative;
}
.ibizbookgrid-exp-view{
display: block;
}
\ No newline at end of file
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import IBIZBOOKGridExpViewBase from './ibizbookgrid-exp-view-base.vue';
import view_gridexpbar from '@widgets/ibizbook/grid-exp-viewgridexpbar-gridexpbar/grid-exp-viewgridexpbar-gridexpbar.vue';
@Component({
components: {
view_gridexpbar,
},
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 IBIZBOOKGridExpView extends IBIZBOOKGridExpViewBase {
}
</script>
\ No newline at end of file
......@@ -30,6 +30,7 @@ export const PageComponents = {
Vue.component('ibizhardware-index-pickup-data-view', () => import('@pages/sample/ibizhardware-index-pickup-data-view/ibizhardware-index-pickup-data-view.vue'));
Vue.component('ibizorder-sgrid-view2', () => import('@pages/sample/ibizorder-sgrid-view2/ibizorder-sgrid-view2.vue'));
Vue.component('ibizbookui-action-grid-view', () => import('@pages/sample/ibizbookui-action-grid-view/ibizbookui-action-grid-view.vue'));
Vue.component('ibizbooktree-grid-ex-view', () => import('@pages/sample/ibizbooktree-grid-ex-view/ibizbooktree-grid-ex-view.vue'));
Vue.component('ibizcustomer-mpickup-view', () => import('@pages/sample/ibizcustomer-mpickup-view/ibizcustomer-mpickup-view.vue'));
Vue.component('ibizuniproduct-pickup-grid-view', () => import('@pages/sample/ibizuniproduct-pickup-grid-view/ibizuniproduct-pickup-grid-view.vue'));
Vue.component('ibizorder-odsp-wfexp-view', () => import('@pages/sample/ibizorder-odsp-wfexp-view/ibizorder-odsp-wfexp-view.vue'));
......@@ -67,6 +68,7 @@ export const PageComponents = {
Vue.component('ibizorder-grid-exp-view', () => import('@pages/sample/ibizorder-grid-exp-view/ibizorder-grid-exp-view.vue'));
Vue.component('ibizsample0003-f2-tree-exp-view', () => import('@pages/sample/ibizsample0003-f2-tree-exp-view/ibizsample0003-f2-tree-exp-view.vue'));
Vue.component('ibizorder-sf15-grid-view', () => import('@pages/sample/ibizorder-sf15-grid-view/ibizorder-sf15-grid-view.vue'));
Vue.component('ibizorder-usr2-chart-view', () => import('@pages/sample/ibizorder-usr2-chart-view/ibizorder-usr2-chart-view.vue'));
Vue.component('ibizsample0003-sf3-edit-view', () => import('@pages/sample/ibizsample0003-sf3-edit-view/ibizsample0003-sf3-edit-view.vue'));
Vue.component('ibizorder-edit-view', () => import('@pages/sample/ibizorder-edit-view/ibizorder-edit-view.vue'));
Vue.component('ibizorder-data-view-exp-view', () => import('@pages/sample/ibizorder-data-view-exp-view/ibizorder-data-view-exp-view.vue'));
......@@ -95,6 +97,7 @@ export const PageComponents = {
Vue.component('ibizsample0003-sf1-edit-view', () => import('@pages/sample/ibizsample0003-sf1-edit-view/ibizsample0003-sf1-edit-view.vue'));
Vue.component('ibizbookinter-func-edit-view', () => import('@pages/sample/ibizbookinter-func-edit-view/ibizbookinter-func-edit-view.vue'));
Vue.component('ibizorder-pie-chart-view', () => import('@pages/sample/ibizorder-pie-chart-view/ibizorder-pie-chart-view.vue'));
Vue.component('ibizbookgrid-exp-view', () => import('@pages/sample/ibizbookgrid-exp-view/ibizbookgrid-exp-view.vue'));
Vue.component('ibizorder-detail-sgrid-view9', () => import('@pages/sample/ibizorder-detail-sgrid-view9/ibizorder-detail-sgrid-view9.vue'));
Vue.component('ibizuniproduct-sgrid-view', () => import('@pages/sample/ibizuniproduct-sgrid-view/ibizuniproduct-sgrid-view.vue'));
Vue.component('ibizsample0003-f3-tree-exp-view', () => import('@pages/sample/ibizsample0003-f3-tree-exp-view/ibizsample0003-f3-tree-exp-view.vue'));
......
......@@ -545,6 +545,20 @@ const router = new Router({
},
component: () => import('@pages/sample/ibizbookui-action-grid-view/ibizbookui-action-grid-view.vue'),
},
{
path: 'ibizbooks/:ibizbook?/treegridexview/:treegridexview?',
meta: {
caption: 'entities.ibizbook.views.treegridexview.caption',
info:'',
parameters: [
{ pathName: 'index', parameterName: 'index' },
{ pathName: 'ibizbooks', parameterName: 'ibizbook' },
{ pathName: 'treegridexview', parameterName: 'treegridexview' },
],
requireAuth: true,
},
component: () => import('@pages/sample/ibizbooktree-grid-ex-view/ibizbooktree-grid-ex-view.vue'),
},
{
path: 'ibizcustomers/:ibizcustomer?/mpickupview/:mpickupview?',
meta: {
......@@ -1108,6 +1122,20 @@ const router = new Router({
},
component: () => import('@pages/sample/ibizorder-sf15-grid-view/ibizorder-sf15-grid-view.vue'),
},
{
path: 'ibizorders/:ibizorder?/usr2chartview/:usr2chartview?',
meta: {
caption: 'entities.ibizorder.views.usr2chartview.caption',
info:'',
parameters: [
{ pathName: 'index', parameterName: 'index' },
{ pathName: 'ibizorders', parameterName: 'ibizorder' },
{ pathName: 'usr2chartview', parameterName: 'usr2chartview' },
],
requireAuth: true,
},
component: () => import('@pages/sample/ibizorder-usr2-chart-view/ibizorder-usr2-chart-view.vue'),
},
{
path: 'ibizsample0003s/:ibizsample0003?/sf3editview/:sf3editview?',
meta: {
......@@ -1515,6 +1543,20 @@ const router = new Router({
},
component: () => import('@pages/sample/ibizorder-pie-chart-view/ibizorder-pie-chart-view.vue'),
},
{
path: 'ibizbooks/:ibizbook?/gridexpview/:gridexpview?',
meta: {
caption: 'entities.ibizbook.views.gridexpview.caption',
info:'',
parameters: [
{ pathName: 'index', parameterName: 'index' },
{ pathName: 'ibizbooks', parameterName: 'ibizbook' },
{ pathName: 'gridexpview', parameterName: 'gridexpview' },
],
requireAuth: true,
},
component: () => import('@pages/sample/ibizbookgrid-exp-view/ibizbookgrid-exp-view.vue'),
},
{
path: 'ibizorders/:ibizorder?/ibizorderdetails/:ibizorderdetail?/sgridview9/:sgridview9?',
meta: {
......@@ -3468,6 +3510,19 @@ const router = new Router({
},
component: () => import('@pages/sample/ibizbookrules-edit-view/ibizbookrules-edit-view.vue'),
},
{
path: '/ibizbooks/:ibizbook?/treegridexview/:treegridexview?',
meta: {
caption: 'entities.ibizbook.views.treegridexview.caption',
info:'',
parameters: [
{ pathName: 'ibizbooks', parameterName: 'ibizbook' },
{ pathName: 'treegridexview', parameterName: 'treegridexview' },
],
requireAuth: true,
},
component: () => import('@pages/sample/ibizbooktree-grid-ex-view/ibizbooktree-grid-ex-view.vue'),
},
{
path: '/ibizorders/:ibizorder?/f13editview/:f13editview?',
meta: {
......@@ -3808,6 +3863,19 @@ const router = new Router({
},
component: () => import('@pages/sample/ibizsample0017-edit-view/ibizsample0017-edit-view.vue'),
},
{
path: '/ibizorders/:ibizorder?/usr2chartview/:usr2chartview?',
meta: {
caption: 'entities.ibizorder.views.usr2chartview.caption',
info:'',
parameters: [
{ pathName: 'ibizorders', parameterName: 'ibizorder' },
{ pathName: 'usr2chartview', parameterName: 'usr2chartview' },
],
requireAuth: true,
},
component: () => import('@pages/sample/ibizorder-usr2-chart-view/ibizorder-usr2-chart-view.vue'),
},
{
path: '/ibizsoftwaresuits/:ibizsoftwaresuit?/gridview9/:gridview9?',
meta: {
......@@ -5428,6 +5496,19 @@ const router = new Router({
},
component: () => import('@pages/sample/ibizorder-sgrid-view2/ibizorder-sgrid-view2.vue'),
},
{
path: '/ibizbooks/:ibizbook?/gridexpview/:gridexpview?',
meta: {
caption: 'entities.ibizbook.views.gridexpview.caption',
info:'',
parameters: [
{ pathName: 'ibizbooks', parameterName: 'ibizbook' },
{ pathName: 'gridexpview', parameterName: 'gridexpview' },
],
requireAuth: true,
},
component: () => import('@pages/sample/ibizbookgrid-exp-view/ibizbookgrid-exp-view.vue'),
},
{
path: '/ibizbooks/:ibizbook?/ganttview/:ganttview?',
meta: {
......
......@@ -212,6 +212,7 @@ export const viewstate: any = {
'f4c5c766fd5755b694e0401dddc4d1ad',
'e7441fa67d425df343d996c745fb5d6b',
'6e88651a11e5ea2de4f397a904f7847a',
'2ccd29eeaeded3ea5a713a19cd67a83e',
'aa68a83577209ff0ec3864aec4e194f2',
'692ede21641dfdb7075ede69d7c4ad33',
'd69d223e4d3aeb8d947ac9b9ddc60a7e',
......@@ -230,6 +231,7 @@ export const viewstate: any = {
'5f21463b9d808170d4023d8402cc6e9e',
'd9f9f0dede285235e3d0ad5101188d1e',
'ffedffb9c57cb200c275ba15e9100da4',
'502736ae9280400d7b8f74f057d363ab',
'84904c93ceea3ab6551555ee20c41e27',
'1ee924c4a616343b6b4cd42150b799fa',
'41d3da0d37fb0135ace813f1ba06bd39',
......@@ -248,6 +250,7 @@ export const viewstate: any = {
'875222727b7ab7dcaccc45808fd38b09',
'de9166f936946237e2d0e5367db078c2',
'9db924c804154be5b442a9737514a6f9',
'e8777dd0c1ad16060fed5e7ed2380cc7',
'b29d930f430c127162f83753d85dd40c',
'36763886cbec62729dca4d4b8dad8161',
'dbbbaa36390b7c2f2be33b8551b0d137',
......@@ -442,6 +445,16 @@ export const viewstate: any = {
refviews: [
],
},
{
viewtag: '2ccd29eeaeded3ea5a713a19cd67a83e',
viewmodule: 'Sample',
viewname: 'IBIZBOOKTreeGridExView',
viewaction: '',
viewdatachange: false,
refviews: [
'b3429ecc4d89a02bc5f5279f1bd7f620',
],
},
{
viewtag: '2cd3a77cbd2aad4551b7a6a009419d52',
viewmodule: 'Sample',
......@@ -685,6 +698,15 @@ export const viewstate: any = {
refviews: [
],
},
{
viewtag: '502736ae9280400d7b8f74f057d363ab',
viewmodule: 'Sample',
viewname: 'IBIZOrderUsr2ChartView',
viewaction: '',
viewdatachange: false,
refviews: [
],
},
{
viewtag: '5147eb94c8aa1cf6ad57b360e0abde28',
viewmodule: 'Sample',
......@@ -1852,6 +1874,15 @@ export const viewstate: any = {
'f90fa878f2ed0eb4e27353786b10c3f4',
],
},
{
viewtag: 'e8777dd0c1ad16060fed5e7ed2380cc7',
viewmodule: 'Sample',
viewname: 'IBIZBOOKGridExpView',
viewaction: '',
viewdatachange: false,
refviews: [
],
},
{
viewtag: 'e92ac401e96f4e17763322eca8355c30',
viewmodule: 'Sample',
......
......@@ -617,6 +617,9 @@ export default class MainMenuBase extends Vue implements ControlInterface {
case 'AppFunc13':
this.clickAppFunc13(item);
return;
case 'AppFunc35':
this.clickAppFunc35(item);
return;
case 'AppFunc41':
this.clickAppFunc41(item);
return;
......@@ -725,6 +728,9 @@ export default class MainMenuBase extends Vue implements ControlInterface {
case 'AppFunc18':
this.clickAppFunc18(item);
return;
case 'AppFunc77':
this.clickAppFunc77(item);
return;
case 'AppFunc36':
this.clickAppFunc36(item);
return;
......@@ -773,6 +779,9 @@ export default class MainMenuBase extends Vue implements ControlInterface {
case 'Auto243':
this.clickAuto243(item);
return;
case 'AppFunc30':
this.clickAppFunc30(item);
return;
case 'AppFunc66':
this.clickAppFunc66(item);
return;
......@@ -1658,6 +1667,29 @@ export default class MainMenuBase extends Vue implements ControlInterface {
})
}
/**
* 图表视图(k线图)
*
* @param {*} [item={}]
* @memberof MainMenu
*/
public clickAppFunc35(item: any = {}) {
const viewparam: any = {};
Object.assign(viewparam, {});
const deResParameters: any[] = [];
const parameters: any[] = [
{ pathName: 'ibizorders', parameterName: 'ibizorder' },
{ pathName: 'usr2chartview', parameterName: 'usr2chartview' },
];
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);
})
}
/**
* 编辑视图(上下关系)
*
......@@ -2372,7 +2404,7 @@ export default class MainMenuBase extends Vue implements ControlInterface {
}
/**
* 功能名称
* 实体数据视图
*
* @param {*} [item={}]
* @memberof MainMenu
......@@ -2486,6 +2518,29 @@ export default class MainMenuBase extends Vue implements ControlInterface {
})
}
/**
* 实体表格导航视图
*
* @param {*} [item={}]
* @memberof MainMenu
*/
public clickAppFunc77(item: any = {}) {
const viewparam: any = {};
Object.assign(viewparam, {});
const deResParameters: any[] = [];
const parameters: any[] = [
{ pathName: 'ibizbooks', parameterName: 'ibizbook' },
{ pathName: 'gridexpview', parameterName: 'gridexpview' },
];
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);
})
}
/**
* 功能名称
*
......@@ -2854,6 +2909,29 @@ export default class MainMenuBase extends Vue implements ControlInterface {
})
}
/**
* 图书实体树表格
*
* @param {*} [item={}]
* @memberof MainMenu
*/
public clickAppFunc30(item: any = {}) {
const viewparam: any = {};
Object.assign(viewparam, {});
const deResParameters: any[] = [];
const parameters: any[] = [
{ pathName: 'ibizbooks', parameterName: 'ibizbook' },
{ pathName: 'treegridexview', parameterName: 'treegridexview' },
];
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);
})
}
/**
* 应用门户视图
*
......
......@@ -2282,6 +2282,44 @@ export default class MainMenuModel {
appfunctag: 'Auto126',
resourcetag: '',
authtag:'Web-MainMenu-menuitem34',
},
{
id: 'C12171AD-42C7-4CA4-BF57-34B949E33EF2',
name: 'menuitem176',
text: '实体表格导航视图',
type: 'MENUITEM',
counterid: '',
tooltip: '实体表格导航视图',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: 'AppFunc77',
resourcetag: '',
authtag:'Web-MainMenu-menuitem176',
},
{
id: '06F9EF42-448C-42C1-BDD9-44858FFDD2F1',
name: 'menuitem177',
text: '实体列表导航视图',
type: 'MENUITEM',
counterid: '',
tooltip: '实体列表导航视图',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: 'AppFunc56',
resourcetag: '',
authtag:'Web-MainMenu-menuitem177',
},
],
},
......@@ -2788,6 +2826,101 @@ export default class MainMenuModel {
appfunctag: 'AppFunc20',
resourcetag: '',
authtag:'Web-MainMenu-menuitem170',
},
{
id: '9453E9F0-DBA0-4F2B-A45E-3474E2C57FB5',
name: 'menuitem171',
text: '实体看板视图',
type: 'MENUITEM',
counterid: '',
tooltip: '实体看板视图',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: 'AppFunc25',
resourcetag: '',
authtag:'Web-MainMenu-menuitem171',
},
{
id: '06128DC9-8F55-4AD4-95A0-E4BD1F91DA30',
name: 'menuitem172',
text: '实体树表格视图',
type: 'MENUITEM',
counterid: '',
tooltip: '实体树表格视图',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: 'AppFunc30',
resourcetag: '',
authtag:'Web-MainMenu-menuitem172',
},
{
id: '8229A864-9DE3-4F2D-BBFE-A3453A22D7DD',
name: 'menuitem173',
text: '实体树视图',
type: 'MENUITEM',
counterid: '',
tooltip: '实体树视图',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: '',
resourcetag: '',
authtag:'Web-MainMenu-menuitem173',
},
{
id: 'CDCBE495-DEDA-49D8-ABEB-7B3B7DC898F4',
name: 'menuitem174',
text: '实体数据视图',
type: 'MENUITEM',
counterid: '',
tooltip: '实体数据视图',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: 'AppFunc14',
resourcetag: '',
authtag:'Web-MainMenu-menuitem174',
},
{
id: '5726035D-58B6-4016-9359-00A1E7318174',
name: 'menuitem175',
text: '实体图表视图',
type: 'MENUITEM',
counterid: '',
tooltip: '实体图表视图',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: 'AppFunc35',
resourcetag: '',
authtag:'Web-MainMenu-menuitem175',
},
],
},
......
......@@ -4,11 +4,11 @@
<div style="height: 80px;width: 80px;display: flex;align-items: center;justify-content: center;">
<i class="el-icon-share" style="font-size: 50px;color: #36a3f7"/>
</div>
<div style="height: 80px;width: 80px;display: flex;flex-direction: column;justify-content: center;">
<div style="height: 80px;width: 165px;display: flex;flex-direction: column;justify-content: center;text-align: center;">
<div style="margin-bottom: 8px;color: rgba(0,0,0,.45);font-size: 18px;font-weight: 700;">
<span> 支持部件总数 </span>
</div>
<div style="color: #666;font-size: 24px;font-weight: 700;text-align: center;">
<div style="color: #666;font-size: 24px;font-weight: 700;">
<span> {{ calculation() }} </span>
</div>
</div>
......
......@@ -4,11 +4,11 @@
<div style="height: 80px;width: 80px;display: flex;align-items: center;justify-content: center;">
<i class="el-icon-s-operation" style="font-size: 50px;color: #34bfa3"/>
</div>
<div style="height: 80px;width: 80px;display: flex;flex-direction: column;justify-content: center;">
<div style="height: 80px;width: 165px;display: flex;flex-direction: column;justify-content: center;text-align: center;">
<div style="margin-bottom: 8px;color: rgba(0,0,0,.45);font-size: 18px;font-weight: 700;">
<span> 支持编辑器总数 </span>
</div>
<div style="color: #666;font-size: 24px;font-weight: 700;text-align: center;">
<div style="color: #666;font-size: 24px;font-weight: 700;">
<span> {{ calculation() }} </span>
</div>
</div>
......
......@@ -4,11 +4,11 @@
<div style="height: 80px;width: 80px;display: flex;align-items: center;justify-content: center;">
<Icon type="md-analytics" size="50" color="#40c9c6"/>
</div>
<div style="height: 80px;width: 80px;display: flex;flex-direction: column;justify-content: center;">
<div style="height: 80px;width: 165px;display: flex;flex-direction: column;justify-content: center;text-align: center;">
<div style="margin-bottom: 8px;color: rgba(0,0,0,.45);font-size: 18px;font-weight: 700;">
<span> 支持视图总数 </span>
</div>
<div style="color: #666;font-size: 24px;font-weight: 700;text-align: center;">
<div style="color: #666;font-size: 24px;font-weight: 700;">
<span> {{ calculation() }} </span>
</div>
</div>
......
<template>
<split id="gridexpviewgridexpbar" class="app-grid-exp-bar" v-model="split" mode="horizontal" @on-move-end="onSplitChange">
<div slot='left'>
<div class='grid-exp-bar-header'>
<div class="grid-exp-bar-title">
<icon type='ios-home-outline'/>{{ $t('app.gridBar.title') }}
</div>
</div>
<div class="container-header">
</div>
<div class='grid-exp-bar-content'>
<view_gridexpbar_grid
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:showBusyIndicator="true"
updateAction=""
removeAction="Remove"
loaddraftAction=""
loadAction=""
createAction=""
fetchAction="FetchDefault"
:isSelectFirstDefault="true"
:newdata="newdata"
:opendata="opendata"
name="gridexpbar_grid"
ref='gridexpbar_grid'
@selectionchange="gridexpbar_grid_selectionchange($event)"
@load="gridexpbar_grid_load($event)"
@closeview="closeView($event)">
</view_gridexpbar_grid>
</div>
</div>
<div slot='right'>
<component
v-if="selection.view && !Object.is(this.selection.view.viewname, '')"
:is="selection.view.viewname"
class="viewcontainer2"
:viewDefaultUsage="false"
:viewdata="JSON.stringify(selection.context)"
:viewparam="JSON.stringify(selection.viewparam)">
</component>
</div>
</split>
</template>
<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 GridExpViewgridexpbarService from './grid-exp-viewgridexpbar-gridexpbar-service';
import IBIZBOOKUIService from '@/uiservice/ibizbook/ibizbook-ui-service';
import CodeListService from "@/codelist/codelist-service";
@Component({
components: {
}
})
export default class GridExpViewgridexpbarBase extends Vue implements ControlInterface {
/**
* 名称
*
* @type {string}
* @memberof GridExpViewgridexpbarBase
*/
@Prop() public name?: string;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof GridExpViewgridexpbarBase
*/
@Prop() public viewState!: Subject<ViewState>;
/**
* 应用上下文
*
* @type {*}
* @memberof GridExpViewgridexpbarBase
*/
@Prop() public context!: any;
/**
* 视图参数
*
* @type {*}
* @memberof GridExpViewgridexpbarBase
*/
@Prop() public viewparams!: any;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof GridExpViewgridexpbarBase
*/
public viewStateEvent: Subscription | undefined;
/**
* 获取部件类型
*
* @returns {string}
* @memberof GridExpViewgridexpbarBase
*/
public getControlType(): string {
return 'GRIDEXPBAR'
}
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof GridExpViewgridexpbarBase
*/
public counterServiceArray:Array<any> = [];
/**
* 建构部件服务对象
*
* @type {GridExpViewgridexpbarService}
* @memberof GridExpViewgridexpbarBase
*/
public service: GridExpViewgridexpbarService = new GridExpViewgridexpbarService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {IBIZBOOKService}
* @memberof GridExpViewgridexpbarBase
*/
public appEntityService: IBIZBOOKService = new IBIZBOOKService({ $store: this.$store });
/**
* gridexpbar_grid 部件 selectionchange 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof GridExpViewgridexpbarBase
*/
public gridexpbar_grid_selectionchange($event: any, $event2?: any) {
this.gridexpbar_selectionchange($event, 'gridexpbar_grid', $event2);
}
/**
* gridexpbar_grid 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof GridExpViewgridexpbarBase
*/
public gridexpbar_grid_load($event: any, $event2?: any) {
this.gridexpbar_load($event, 'gridexpbar_grid', $event2);
}
/**
* 转化数据
*
* @param {any} args
* @memberof GridExpViewgridexpbarBase
*/
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 GridExpViewgridexpbarBase
*/
public closeView(args: any): void {
let _this: any = this;
_this.$emit('closeview', [args]);
}
/**
* 计数器刷新
*
* @memberof GridExpViewgridexpbarBase
*/
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 {any}
* @memberof GridExpViewgridexpbarBase
*/
@Prop() public newdata: any;
/**
* 打开编辑数据视图
*
* @type {any}
* @memberof GridExpViewgridexpbarBase
*/
@Prop() public opendata: any;
/**
* 视图唯一标识
*
* @type {string}
* @memberof GridExpViewgridexpbarBase
*/
@Prop() public viewUID!:string;
/**
* 是否单选
*
* @public
* @type {(boolean)}
* @memberof GridExpViewgridexpbarBase
*/
public isSingleSelect:boolean = true;
/**
* 呈现模式,可选值:horizontal或者vertical
*
* @public
* @type {(string)}
* @memberof GridExpViewgridexpbarBase
*/
public showMode:string ="horizontal";
/**
* 控件宽度
*
* @type {number}
* @memberof GridExpViewgridexpbarBase
*/
public ctrlWidth:number = 0;
/**
* 控件高度
*
* @type {number}
* @memberof GridExpViewgridexpbarBase
*/
public ctrlHeight: number = 0;
/**
* 选中数据
*
* @type {*}
* @memberof GridExpViewgridexpbarBase
*/
public selection: any = {};
/**
* 可搜索字段名称
*
*
* @type {(string)}
* @memberof GridExpViewgridexpbarBase
*/
public placeholder="图书名称";
/**
* 搜素值
*
* @public
* @type {(string)}
* @memberof GridExpViewgridexpbarBase
*/
public searchText:string = "";
/**
* 分割宽度
*
* @type {number}
* @memberof GridExpViewgridexpbarBase
*/
public split: number = 0.5;
/**
* 导航视图名称
*
* @type {string}
* @memberof GridExpViewgridexpbarBase
*/
public navViewName: string = "";
/**
* 导航过滤项
*
* @type {string}
* @memberof GridExpViewgridexpbarBase
*/
public navFilter: string = "";
/**
* 导航关系
*
* @type {string}
* @memberof GridExpViewgridexpbarBase
*/
public navPSDer: string = "";
/**
* 导航上下文参数
*
* @type {*}
* @memberof GridExpViewgridexpbarBase
*/
public navigateContext:any =null;
/**
* 导航视图参数
*
* @type {*}
* @memberof GridExpViewgridexpbarBase
*/
public navigateParams:any = null;
/**
* 显示处理提示
*
* @type {boolean}
* @memberof MOBILEENTITY3Canlen
*/
@Prop({ default: true }) public showBusyIndicator!: boolean;
/**
* split值变化事件
*
* @memberof GridExpViewgridexpbarBase
*/
public onSplitChange() {
if(this.split){
this.$store.commit("setViewSplit",{viewUID:this.viewUID,viewSplit:this.split});
}
}
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof GridExpViewgridexpbarBase
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof GridExpViewgridexpbarBase
*/
public getData(): any {
return null;
}
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof GridExpViewgridexpbarBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof GridExpViewgridexpbarBase
*/
public afterCreated(){
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if (!Object.is(tag, this.name)) {
return;
}
this.viewState.next({ tag: 'gridexpbar_grid', action: action, data: data });
});
}
}
/**
* Vue声明周期(组件渲染完毕)
*
* @memberof GridExpViewgridexpbarBase
*/
public mounted() {
this.afterMounted();
}
/**
* 执行mounted后的逻辑
*
* @memberof GridExpViewgridexpbarBase
*/
public afterMounted(){
if(this.$store.getters.getViewSplit(this.viewUID)){
this.split = this.$store.getters.getViewSplit(this.viewUID);
}else{
let containerWidth:number = (document.getElementById("gridexpviewgridexpbar") as any).offsetWidth;
let containerHeight:number = (document.getElementById("gridexpviewgridexpbar") as any).offsetHeight;
if(Object.is(this.showMode,'horizontal')){
if(this.ctrlWidth){
this.split = this.ctrlWidth/containerWidth;
}
}else{
if(this.ctrlHeight){
this.split = this.ctrlHeight/containerHeight;
}
}
this.$store.commit("setViewSplit",{viewUID:this.viewUID,viewSplit:this.split});
}
}
/**
* vue 生命周期
*
* @memberof GridExpViewgridexpbarBase
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof GridExpViewgridexpbarBase
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
}
/**
* 执行搜索
*
* @memberof GridExpViewgridexpbarBase
*/
public onSearch($event:any) {
let grid:any = this.$refs.gridexpbar_grid;
grid.load({ query: this.searchText });
}
/**
* 刷新
*
* @memberof GridExpViewgridexpbarBase
*/
public refresh(args?: any): void {
const refs: any = this.$refs;
if (refs && refs.gridexpbar_grid) {
refs.gridexpbar_grid.refresh();
}
}
/**
* gridexpbar的选中数据事件
*
* @memberof GridExpViewgridexpbarBase
*/
public gridexpbar_selectionchange(args: any [], tag?: string, $event2?: any): void {
let tempContext:any = {};
let tempViewParam:any = {};
if (args.length === 0) {
this.calcToolbarItemState(true);
return ;
}
const arg:any = args[0];
if(this.context){
Object.assign(tempContext,JSON.parse(JSON.stringify(this.context)));
}
Object.assign(tempContext,{'ibizbook':arg['ibizbook']});
Object.assign(tempContext,{srfparentdename:'IBIZBOOK',srfparentkey:arg['ibizbook']});
if(this.navFilter && !Object.is(this.navFilter,"")){
Object.assign(tempViewParam,{[this.navFilter]:arg['ibizbook']});
}
if(this.navPSDer && !Object.is(this.navPSDer,"")){
Object.assign(tempViewParam,{[this.navPSDer]:arg['ibizbook']});
}
if(this.navigateContext && Object.keys(this.navigateContext).length >0){
let _context:any = this.$util.computedNavData(arg,tempContext,tempViewParam,this.navigateContext);
Object.assign(tempContext,_context);
}
if(this.navigateParams && Object.keys(this.navigateParams).length >0){
let _params:any = this.$util.computedNavData(arg,tempContext,tempViewParam,this.navigateParams);
Object.assign(tempViewParam,_params);
}
this.selection = {};
Object.assign(this.selection, { view: { viewname: this.navViewName }, context:tempContext,viewparam:tempViewParam });
this.calcToolbarItemState(false);
this.$forceUpdate();
}
/**
* gridexpbar的load完成事件
*
* @memberof GridExpViewgridexpbarBase
*/
public gridexpbar_load(args:any, tag?: string, $event2?: any){
this.calcToolbarItemState(true);
this.$emit('load',args);
}
/**
* 设置导航区工具栏禁用状态
*
* @param {boolean} state
* @return {*}
* @memberof GridExpViewgridexpbarBase
*/
public calcToolbarItemState(state: boolean) {
let _this: any = this;
const models:any = _this.gridexpviewgridexpbar_toolbarModels;
if (models) {
for (const key in models) {
if (!models.hasOwnProperty(key)) {
return;
}
const _item = models[key];
if (_item.uiaction && (Object.is(_item.uiaction.target, 'SINGLEKEY') || Object.is(_item.uiaction.target, 'MULTIKEY'))) {
_item.disabled = state;
}
_item.visabled = true;
if (_item.noprivdisplaymode && _item.noprivdisplaymode === 6) {
_item.visabled = false;
}
}
this.calcNavigationToolbarState();
}
}
/**
* 计算导航工具栏权限状态
*
* @memberof GridExpViewgridexpbarBase
*/
public calcNavigationToolbarState(){
let _this: any = this;
// 界面行为
if(_this.gridexpviewgridexpbar_toolbarModels){
const curUIService:IBIZBOOKUIService = new IBIZBOOKUIService();
ViewTool.calcActionItemAuthState({},_this.gridexpviewgridexpbar_toolbarModels,curUIService);
}
}
}
</script>
<style lang='less'>
@import './grid-exp-viewgridexpbar-gridexpbar.less';
</style>
\ No newline at end of file
/**
* GridExpViewgridexpbar 部件模型
*
* @export
* @class GridExpViewgridexpbarModel
*/
export default class GridExpViewgridexpbarModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof GridExpViewgridexpbarGridexpbarMode
*/
public getDataItems(): any[] {
return [
]
}
}
\ No newline at end of file
import { Http,Util,Errorlog } from '@/utils';
import ControlService from '@/widgets/control-service';
import IBIZBOOKService from '@/service/ibizbook/ibizbook-service';
import GridExpViewgridexpbarModel from './grid-exp-viewgridexpbar-gridexpbar-model';
/**
* GridExpViewgridexpbar 部件服务对象
*
* @export
* @class GridExpViewgridexpbarService
*/
export default class GridExpViewgridexpbarService extends ControlService {
/**
* 图书服务对象
*
* @type {IBIZBOOKService}
* @memberof GridExpViewgridexpbarService
*/
public appEntityService: IBIZBOOKService = new IBIZBOOKService({ $store: this.getStore() });
/**
* 设置从数据模式
*
* @type {boolean}
* @memberof GridExpViewgridexpbarService
*/
public setTempMode(){
this.isTempMode = false;
}
/**
* Creates an instance of GridExpViewgridexpbarService.
*
* @param {*} [opts={}]
* @memberof GridExpViewgridexpbarService
*/
constructor(opts: any = {}) {
super(opts);
this.model = new GridExpViewgridexpbarModel();
}
}
\ No newline at end of file
.app-grid-exp-bar {
> .ivu-split-horizontal {
> .ivu-split-trigger-con {
height: 100%;
width: 1px;
}
> .ivu-split-pane {
> div {
height: 100%;
overflow: auto;
display: flex;
flex-direction: column;
.grid-exp-bar-header {
line-height: 50px;
border-bottom: 1px solid #ddd;
.grid-exp-bar-title {
font-size: 18px;
padding-left: 8px;
i {
font-size: 20px;
margin-top: -2px;
}
}
}
.container-header{
display: flex;
justify-content: flex-start;
align-items: center;
flex-wrap: wrap;
.quick-group-container {
padding-top: 8px;
padding-right: 20px;
}
.search-container {
width: 30%;
height: 48px;
padding: 10px 10px 10px 0;
min-width: 200px;
max-width: 400px;
}
.toolbar-container{
padding: 4px;
display: flex;
flex-wrap: wrap;
align-items: center;
}
}
.grid-exp-bar-content {
height: calc(100% - 40px);
overflow: auto;
padding: 16px 0;
margin-bottom: 10px;
}
.grid-exp-bar-content2 {
height: calc(100% - 40px);
overflow: auto;
flex-grow: 1;
}
}
}
> .right-pane.ivu-split-pane {
> div {
padding-left: 10px;
}
}
> .left-pane.ivu-split-pane {
padding-right: 10px;
}
}
> .ivu-split-vertical{
> .ivu-split-pane {
> div {
height: 100%;
.grid-exp-bar-header {
line-height: 50px;
border-bottom: 1px solid #ddd;
>div {
font-size: 18px;
i {
font-size: 20px;
margin-top: -2px;
}
}
}
.container-header{
display: flex;
justify-content: flex-start;
align-items: center;
flex-wrap: wrap;
.search-container {
width: 30%;
height: 48px;
padding: 10px 10px 10px 0;
min-width: 200px;
max-width: 400px;
}
.toolbar-container{
padding: 4px;
}
.quick-group-container {
padding-top: 8px;
padding-right: 20px;
}
}
.grid-exp-bar-content {
height: calc(100% - 40px);
overflow: auto;
margin-bottom: 10px;
}
.grid-exp-bar-content2 {
height: calc(100% - 40px);
overflow: auto;
flex-grow: 1;
}
}
}
> .top-pane.ivu-split-pane {
> div {
padding-bottom: 10px;
}
}
> .bottom-pane.ivu-split-pane {
padding-top: 10px;
}
}
}
// this is less
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import GridExpViewgridexpbarBase from './grid-exp-viewgridexpbar-gridexpbar-base.vue';
import view_gridexpbar_grid from '@widgets/ibizbook/gridexpbar-grid-grid/gridexpbar-grid-grid.vue';
@Component({
components: {
view_gridexpbar_grid,
}
})
export default class GridExpViewgridexpbar extends GridExpViewgridexpbarBase {
}
</script>
\ No newline at end of file
<template>
<div class='grid' style="height:100%">
<i-form style="height:100%;display:flex;flex-direction: column;justify-content: space-between">
<el-table v-if="isDisplay === true"
:default-sort="{ prop: minorSortPSDEF, order: Object.is(minorSortDir, 'ASC') ? 'ascending' : Object.is(minorSortDir, 'DESC') ? 'descending' : '' }"
@sort-change="onSortChange($event)"
:border="isDragendCol"
:highlight-current-row ="isSingleSelect"
:row-class-name="getRowClassName"
:cell-class-name="getCellClassName"
max-height="100%"
@row-click="rowClick($event)"
@select-all="selectAll($event)"
@select="select"
@row-class-name="onRowClassName($event)"
@row-dblclick="rowDBLClick($event)"
ref='multipleTable' :data="items" :show-header="!isHideHeader">
<template slot="empty">
{{$t('entities.ibizbook.gridexpbar_grid_grid.nodata')}}
</template>
<template v-if="!isSingleSelect">
<el-table-column align="center" type='selection' :width="checkboxColWidth"></el-table-column>
</template>
<template v-if="adaptiveState">
<el-table-column></el-table-column>
</template>
</el-table>
</i-form>
</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 Gridexpbar_gridService from './gridexpbar-grid-grid-service';
import IBIZBOOKUIService from '@/uiservice/ibizbook/ibizbook-ui-service';
import CodeListService from "@/codelist/codelist-service";
import { FormItemModel } from '@/model/form-detail';
import { Environment } from '@/environments/environment';
@Component({
components: {
}
})
export default class Gridexpbar_gridBase extends Vue implements ControlInterface {
/**
* 名称
*
* @type {string}
* @memberof Gridexpbar_gridBase
*/
@Prop() public name?: string;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof Gridexpbar_gridBase
*/
@Prop() public viewState!: Subject<ViewState>;
/**
* 应用上下文
*
* @type {*}
* @memberof Gridexpbar_gridBase
*/
@Prop() public context!: any;
/**
* 视图参数
*
* @type {*}
* @memberof Gridexpbar_gridBase
*/
@Prop() public viewparams!: any;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof Gridexpbar_gridBase
*/
public viewStateEvent: Subscription | undefined;
/**
* 获取部件类型
*
* @returns {string}
* @memberof Gridexpbar_gridBase
*/
public getControlType(): string {
return 'GRID'
}
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof Gridexpbar_gridBase
*/
public counterServiceArray:Array<any> = [];
/**
* 建构部件服务对象
*
* @type {Gridexpbar_gridService}
* @memberof Gridexpbar_gridBase
*/
public service: Gridexpbar_gridService = new Gridexpbar_gridService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {IBIZBOOKService}
* @memberof Gridexpbar_gridBase
*/
public appEntityService: IBIZBOOKService = new IBIZBOOKService({ $store: this.$store });
/**
* 转化数据
*
* @param {any} args
* @memberof Gridexpbar_gridBase
*/
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 Gridexpbar_gridBase
*/
public closeView(args: any): void {
let _this: any = this;
_this.$emit('closeview', [args]);
}
/**
* 计数器刷新
*
* @memberof Gridexpbar_gridBase
*/
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 {CodeListService}
* @memberof Gridexpbar_gridBase
*/
public codeListService:CodeListService = new CodeListService({ $store: this.$store });
/**
* 主信息表格列
*
* @type {string}
* @memberof Gridexpbar_gridBase
*/
public majorInfoColName:string = "";
/**
* 界面UI服务对象
*
* @type {IBIZBOOKUIService}
* @memberof Gridexpbar_gridBase
*/
public appUIService:IBIZBOOKUIService = new IBIZBOOKUIService(this.$store);
/**
* 界面行为模型
*
* @type {*}
* @memberof Gridexpbar_gridBase
*/
public actionModel:any ={
};
/**
* 应用状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof Gridexpbar_gridBase
*/
public appStateEvent: Subscription | undefined;
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof Gridexpbar_gridBase
*/
public getDatas(): any[] {
return this.selections;
}
/**
* 获取单项树
*
* @returns {*}
* @memberof Gridexpbar_gridBase
*/
public getData(): any {
return this.selections[0];
}
/**
* 打开新建数据视图
*
* @type {any}
* @memberof Gridexpbar_gridBase
*/
@Prop() public newdata: any;
/**
* 打开编辑数据视图
*
* @type {any}
* @memberof Gridexpbar_gridBase
*/
@Prop() public opendata: any;
/**
* 是否嵌入关系界面
*
* @type {boolean}
* @memberof Gridexpbar_gridBase
*/
@Prop({default:false}) public isformDruipart?: boolean;
/**
* 显示处理提示
*
* @type {boolean}
* @memberof Gridexpbar_gridBase
*/
@Prop({ default: true }) public showBusyIndicator?: boolean;
/**
* 部件行为--update
*
* @type {string}
* @memberof Gridexpbar_gridBase
*/
@Prop() public updateAction!: string;
/**
* 部件行为--fetch
*
* @type {string}
* @memberof Gridexpbar_gridBase
*/
@Prop() public fetchAction!: string;
/**
* 部件行为--remove
*
* @type {string}
* @memberof Gridexpbar_gridBase
*/
@Prop() public removeAction!: string;
/**
* 部件行为--load
*
* @type {string}
* @memberof Gridexpbar_gridBase
*/
@Prop() public loadAction!: string;
/**
* 部件行为--loaddraft
*
* @type {string}
* @memberof Gridexpbar_gridBase
*/
@Prop() public loaddraftAction!: string;
/**
* 部件行为--create
*
* @type {string}
* @memberof Gridexpbar_gridBase
*/
@Prop() public createAction!: string;
/**
* 当前页
*
* @type {number}
* @memberof Gridexpbar_gridBase
*/
public curPage: number = 1;
/**
* 数据
*
* @type {any[]}
* @memberof Gridexpbar_gridBase
*/
public items: any[] = [];
/**
* 是否支持分页
*
* @type {boolean}
* @memberof Gridexpbar_gridBase
*/
public isEnablePagingBar: boolean = false;
/**
* 是否禁用排序
*
* @type {boolean}
* @memberof Gridexpbar_gridBase
*/
public isNoSort: boolean = false;
/**
* 排序方向
*
* @type {string}
* @memberof Gridexpbar_gridBase
*/
public minorSortDir: string = '';
/**
* 排序字段
*
* @type {string}
* @memberof Gridexpbar_gridBase
*/
public minorSortPSDEF: string = '';
/**
* 分页条数
*
* @type {number}
* @memberof Gridexpbar_gridBase
*/
public limit: number = 20;
/**
* 是否显示标题
*
* @type {boolean}
* @memberof Gridexpbar_gridBase
*/
public isHideHeader: boolean = false;
/**
* 是否默认选中第一条数据
*
* @type {boolean}
* @memberof Gridexpbar_gridBase
*/
@Prop({ default: false }) public isSelectFirstDefault!: boolean;
/**
* 是否单选
*
* @type {boolean}
* @memberof Gridexpbar_gridBase
*/
@Prop() public isSingleSelect?: boolean;
/**
* 选中数据字符串
*
* @type {string}
* @memberof Gridexpbar_gridBase
*/
@Prop() public selectedData?: string;
/**
* 选中值变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Gridexpbar_gridBase
*/
@Watch('selectedData')
public onValueChange(newVal: any, oldVal: any) {
this.selections = [];
if(this.selectedData){
const refs: any = this.$refs;
if (refs.multipleTable) {
refs.multipleTable.clearSelection();
JSON.parse(this.selectedData).forEach((selection:any)=>{
let selectedItem = this.items.find((item:any)=>{
return Object.is(item.srfkey, selection.srfkey);
});
if(selectedItem){
this.rowClick(selectedItem);
}
});
}
}
}
/**
* 表格行数据默认激活模式
* 0 不激活
* 1 单击激活
* 2 双击激活
*
* @type {(number | 0 | 1 | 2)}
* @memberof Gridexpbar_gridBase
*/
@Prop({default: 2}) public gridRowActiveMode!: number;
/**
* 是否开启行编辑
*
* @type {boolean}
* @memberof Gridexpbar_gridBase
*/
@Prop({default: false}) public isOpenEdit!: boolean;
/**
* 实际是否开启行编辑
*
* @type {boolean}
* @memberof Gridexpbar_gridBase
*/
public actualIsOpenEdit: boolean = this.isOpenEdit;
/**
* 总条数
*
* @type {number}
* @memberof Gridexpbar_gridBase
*/
public totalrow: number = 0;
/**
* 表格更新默认值项
*
* @memberof Gridexpbar_gridBase
*/
public defaultUpdateItems:Array<any> =[];
/**
* 选中行数据
*
* @type {any[]}
* @memberof Gridexpbar_gridBase
*/
public selections: any[] = [];
/**
* 拦截行选中
*
* @type {boolean}
* @memberof Gridexpbar_gridBase
*/
public stopRowClick: boolean = false;
/**
* 当前编辑行数据
*
* @type {boolean}
* @memberof Gridexpbar_gridBase
*/
public curEditRowData:any;
/**
* 表格是否显示
*
* @type {boolean}
* @memberof Gridexpbar_gridBase
*/
public isDisplay:boolean = true;
/**
* 表格行编辑项校验错误提示信息
*
* @type {boolean}
* @memberof Gridexpbar_gridBase
*/
public errorMessages: Array<any> = [];
/**
* 部件刷新
*
* @param {any} args
* @memberof Gridexpbar_gridBase
*/
public refresh(args?: any): void {
this.load();
}
/**
* 选项框列宽
*
* @type {number}
* @memberof AppIndex
*/
public checkboxColWidth: number = 50;
/**
* 是否允许拖动列宽
*
* @type {boolean}
* @memberof AppEmbedPicker
*/
public isDragendCol: boolean = true;
/**
* 所有列成员
*
* @type {any[]}
* @memberof Gridexpbar_gridBase
*/
public allColumns: any[] = [
]
/**
* 表格模型集合
*
* @type {*}
* @memberof Gridexpbar_gridBase
*/
public gridItemsModel: any[] = [];
/**
* 是否启用分组
*
* @type {boolean}
* @memberof Gridexpbar_gridBase
*/
public isEnableGroup:boolean = false;
/**
* 分组属性
*
* @type {string}
* @memberof Gridexpbar_gridBase
*/
public groupAppField:string ="";
/**
* 分组属性代码表标识
*
* @type {string}
* @memberof Gridexpbar_gridBase
*/
public groupAppFieldCodelistTag:string ="";
/**
* 分组属性代码表类型
*
* @type {string}
* @memberof Gridexpbar_gridBase
*/
public groupAppFieldCodelistType: string = "";
/**
* 分组模式
*
* @type {string}
* @memberof Gridexpbar_gridBase
*/
public groupMode:string ="NONE";
/**
* 分组代码表标识
*
* @type {string}
* @memberof Gridexpbar_gridBase
*/
public codelistTag: string = "";
/**
* 分组代码表类型
*
* @type {string}
* @memberof Gridexpbar_gridBase
*/
public codelistType: string = "";
/**
* 获取界面行为权限状态
*
* @memberof Gridexpbar_gridBase
*/
public getActionState(data:any){
let tempActionModel:any = JSON.parse(JSON.stringify(this.actionModel));
let targetData:any = this.transformData(data);
ViewTool.calcActionItemAuthState(targetData,tempActionModel,this.appUIService);
return tempActionModel;
}
/**
* 获取表格行模型
*
* @type {*}
* @memberof Gridexpbar_gridBase
*/
public getGridRowModel(){
return {
srfkey: new FormItemModel(),
}
}
/**
* 属性值规则
*
* @type {*}
* @memberof Gridexpbar_gridBase
*/
public deRules:any = {
};
/**
* 值规则集合
*
* @type {*}
* @memberof Gridexpbar_gridBase
*/
public rules: any = {
srfkey: [
{ required: false, validator: (rule:any, value:any, callback:any) => { return (rule.required && (value === null || value === undefined || value === "")) ? false : true;}, message: '图书标识 值不能为空', trigger: 'change' },
{ required: false, validator: (rule:any, value:any, callback:any) => { return (rule.required && (value === null || value === undefined || value === "")) ? false : true;}, message: '图书标识 值不能为空', trigger: 'blur' },
],
}
/**
* 表格行编辑项校验
*
* @param {string} property 属性名
* @param {*} data 行数据
* @param {number} rowIndex 行索引
* @returns Promise<any>
*
* @memberof Gridexpbar_gridBase
*/
public validate(property:string, data:any, rowIndex:number):Promise<any>{
return new Promise((resolve, reject) => {
this.$util.validateItem(property,data,this.rules).then(()=>{
this.gridItemsModel[rowIndex][property].setError(null);
resolve(true);
}).catch(({ errors, fields }) => {
this.gridItemsModel[rowIndex][property].setError(errors[0].message);
resolve(false);
});
});
}
/**
* 校验所有修改过的编辑项
*
* @returns Promise<any>
* @memberof Gridexpbar_gridBase
*/
public async validateAll(){
this.errorMessages = [];
let validateState = true;
let index = -1;
for (let item of this.items) {
let tempMessage: string = '';
index++;
if (item.rowDataState === "create" || item.rowDataState === "update") {
for (let property of Object.keys(this.rules)) {
if (!await this.validate(property, item, index)) {
validateState = false;
tempMessage = tempMessage + '<p>' + this.gridItemsModel[index][property].error + '<p>';
}
}
}
this.errorMessages.push(tempMessage);
}
return validateState;
}
/**
* 表格数据加载
*
* @param {*} [arg={}]
* @memberof Gridexpbar_gridBase
*/
public load(opt: any = {}, pageReset: boolean = false): void {
if(!this.fetchAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKGridExpView'+(this.$t('app.gridpage.notConfig.fetchAction') as string) });
return;
}
if(pageReset){
this.curPage = 1;
}
const arg: any = {...opt};
const page: any = {};
if (this.isEnablePagingBar) {
Object.assign(page, { page: this.curPage-1, size: this.limit });
}
// 设置排序
if (!this.isNoSort && !Object.is(this.minorSortDir, '') && !Object.is(this.minorSortPSDEF, '')) {
const sort: string = this.minorSortPSDEF+","+this.minorSortDir;
Object.assign(page, { sort: sort });
}
Object.assign(arg, page);
const parentdata: any = {};
this.$emit('beforeload', parentdata);
Object.assign(arg, parentdata);
let tempViewParams:any = parentdata.viewparams?parentdata.viewparams:{};
Object.assign(tempViewParams,JSON.parse(JSON.stringify(this.viewparams)));
Object.assign(arg,{viewparams:tempViewParams});
const post: Promise<any> = this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
}
return;
}
const data: any = response.data;
this.totalrow = response.total;
this.items = JSON.parse(JSON.stringify(data));
// 清空selections,gridItemsModel
//this.selections = [];
this.gridItemsModel = [];
this.items.forEach(()=>{this.gridItemsModel.push(this.getGridRowModel())});
this.items.forEach((item:any)=>{
Object.assign(item,this.getActionState(item));
});
this.$emit('load', this.items);
// 设置默认选中
let _this = this;
setTimeout(() => {
//在导航视图中,如已有选中数据,则右侧展开已选中数据的视图,如无选中数据则默认选中第一条
if(_this.isSelectFirstDefault){
if(_this.selections && _this.selections.length > 0){
_this.selections.forEach((select: any)=>{
const index = _this.items.findIndex((item:any) => Object.is(item.srfkey,select.srfkey));
if(index != -1){
_this.rowClick(_this.items[index]);
}
})
}else{
_this.rowClick(this.items[0]);
}
}
if(_this.selectedData){
const refs: any = _this.$refs;
if (refs.multipleTable) {
refs.multipleTable.clearSelection();
JSON.parse(_this.selectedData).forEach((selection:any)=>{
let selectedItem = _this.items.find((item:any)=>{
return Object.is(item.srfkey, selection.srfkey);
});
if(selectedItem){
_this.rowClick(selectedItem);
}
});
}
}
}, 300);
}).catch((response: any) => {
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
});
}
/**
* 删除
*
* @param {any[]} datas
* @returns {Promise<any>}
* @memberof Gridexpbar_gridBase
*/
public async remove(datas: any[]): Promise<any> {
if(!this.removeAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKGridExpView'+(this.$t('app.gridpage.notConfig.removeAction') as string) });
return;
}
let _datas:any[] = [];
datas.forEach((record: any, index: number) => {
if (Object.is(record.srfuf,"0")) {
this.items.some((val: any, num: number) =>{
if(JSON.stringify(val) == JSON.stringify(record)){
this.items.splice(num,1);
this.gridItemsModel.splice(num,1);
return true;
}
});
}else{
_datas.push(datas[index]);
}
});
if (_datas.length === 0) {
return;
}
let dataInfo = '';
_datas.forEach((record: any, index: number) => {
let srfmajortext = record.ibizbookname;
if (index < 5) {
if (!Object.is(dataInfo, '')) {
dataInfo += '、';
}
dataInfo += srfmajortext;
} else {
return false;
}
});
if (_datas.length < 5) {
dataInfo = dataInfo + ' ' + (this.$t('app.gridpage.totle') as string) + _datas.length + (this.$t('app.gridpage.records') as string) + (this.$t('app.gridpage.data') as string);
} else {
dataInfo = ' ... ' + (this.$t('app.gridpage.totle') as string) + _datas.length + (this.$t('app.gridpage.records') as string) + (this.$t('app.gridpage.data') as string);
}
const removeData = () => {
let keys: any[] = [];
_datas.forEach((data: any) => {
keys.push(data.srfkey);
});
let _removeAction = keys.length > 1 ? 'removeBatch' : this.removeAction ;
let _keys = keys.length > 1 ? keys : keys[0] ;
const context:any = JSON.parse(JSON.stringify(this.context));
const post: Promise<any> = this.service.delete(_removeAction,Object.assign(context,{ ibizbook: _keys }),Object.assign({ ibizbook: _keys },{viewparams:this.viewparams}), this.showBusyIndicator);
return new Promise((resolve: any, reject: any) => {
post.then((response: any) => {
if (!response || response.status !== 200) {
this.$Notice.error({ title: '', desc: (this.$t('app.gridpage.delDataFail') as string)+',' + response.info });
return;
} else {
this.$Notice.success({ title: '', desc: (this.$t('app.gridpage.delSuccess') as string) });
}
//删除items中已删除的项
_datas.forEach((data: any) => {
this.items.some((item:any,index:number)=>{
if(Object.is(item.srfkey,data.srfkey)){
this.items.splice(index,1);
this.gridItemsModel.splice(index,1);
return true;
}
});
});
this.totalrow -= _datas.length;
this.$emit('remove', null);
this.selections = [];
resolve(response);
}).catch((response: any) => {
if (response && response.status === 401) {
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) });
reject(response);
return;
}
reject(response);
});
});
}
dataInfo = dataInfo.replace(/[null]/g, '').replace(/[undefined]/g, '');
this.$Modal.confirm({
title: (this.$t('app.commonWords.warning') as string),
content: (this.$t('app.gridpage.confirmDel') as string)+' ' + dataInfo + ','+(this.$t('app.gridpage.notRecoverable') as string),
onOk: () => {
removeData();
},
onCancel: () => { }
});
return removeData;
}
/**
* 批量添加
*
* @param {*} [arg={}]
* @memberof Gridexpbar_gridBase
*/
public addBatch(arg: any = {}): void {
if(!this.fetchAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKGridExpView'+(this.$t('app.gridpage.notConfig.fetchAction') as string) });
return;
}
if(!arg){
arg = {};
}
console.error((this.$t('app.gridpage.notBatch') as string));
}
/**
* 数据导入
*
* @param {*} data
* @memberof Gridexpbar_gridBase
*/
public importExcel(data:any ={}):void{
//导入excel
const importDataModel:any ={
importId:'DataImport',
serviceName:'ibizbook',
appDeLogicName:'图书',
importData:{
"UPDATEDATE":{"headername":"更新时间","isuniqueitem":false,"name":"updatedate","order":1000},
"PRESS":{"headername":"图书出版社","isuniqueitem":false,"name":"press","order":1000},
"IBIZBOOKID":{"headername":"图书标识","isuniqueitem":false,"name":"ibizbookid","order":1000},
"AUTHOR":{"headername":"图书作者","isuniqueitem":false,"name":"author","order":1000},
"PRICE":{"headername":"图书价格","isuniqueitem":false,"name":"price","order":1000},
"BOOKNUMBER":{"headername":"图书数量","isuniqueitem":false,"name":"booknumber","order":1000},
"TYPE":{"headername":"图书类型","isuniqueitem":false,"name":"type","order":1000},
"CREATEMAN":{"codelist":{"type":"DYNAMIC","tag":"SysOperator","isnumber":false},"headername":"建立人","isuniqueitem":false,"name":"createman","order":1000},
"CREATEDATE":{"headername":"建立时间","isuniqueitem":false,"name":"createdate","order":1000},
"IBIZBOOKNAME":{"headername":"图书名称","isuniqueitem":false,"name":"ibizbookname","order":1000},
"UPDATEMAN":{"codelist":{"type":"DYNAMIC","tag":"SysOperator","isnumber":false},"headername":"更新人","isuniqueitem":false,"name":"updateman","order":1000}
}
}
if(Object.keys(importDataModel).length == 0){
this.$Notice.warning({ 'title': (this.$t("app.utilview.warning") as string), 'desc': (this.$t("app.utilview.info") as string) });
return;
}
const view:any ={
viewname: 'app-data-upload',
title: this.$t("app.utilview.importview"),
width: 900,
height: 700
}
let container: Subject<any> = this.$appmodal.openModal(view, JSON.parse(JSON.stringify(this.context)), importDataModel);
container.subscribe((result: any) => {
if(Object.is(result.ret,'OK')){
this.refresh(result.datas);
}
});
}
/**
* 数据导出
*
* @param {*} data
* @memberof Gridexpbar_gridBase
*/
public exportExcel(data: any = {}): void {
// 导出Excel
const doExport = async (_data:any) => {
const tHeader: Array<any> = [];
const filterVal: Array<any> = [];
this.allColumns.forEach((item: any) => {
item.show && item.label ? tHeader.push(this.$t(item.langtag)) : "";
item.show && item.name ? filterVal.push(item.name) : "";
});
const data = await this.formatExcelData(filterVal, _data);
this.$export.exportExcel().then((excel:any)=>{
excel.export_json_to_excel({
header: tHeader, //表头 必填
data, //具体数据 必填
filename: "图书"+(this.$t('app.gridpage.grid') as string), //非必填
autoWidth: true, //非必填
bookType: "xlsx" //非必填
});
});
};
const page: any = {};
// 设置page,size
if (Object.is(data.type, 'maxRowCount')) {
Object.assign(page, { page: 0, size: data.maxRowCount });
} else if (Object.is(data.type, 'activatedPage')) {
try {
doExport(JSON.parse(JSON.stringify(this.items)));
} catch (error) {
console.error(error);
}
return;
}
// 设置排序
if (!this.isNoSort && !Object.is(this.minorSortDir, '') && !Object.is(this.minorSortPSDEF, '')) {
const sort: string = this.minorSortPSDEF+","+this.minorSortDir;
Object.assign(page, { sort: sort });
}
const arg: any = {};
Object.assign(arg, page);
// 获取query,搜索表单,viewparams等父数据
const parentdata: any = {};
this.$emit('beforeload', parentdata);
Object.assign(arg, parentdata);
const post: Promise<any> = this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response || response.status !== 200) {
this.$Notice.error({ title: '', desc: (this.$t('app.gridpage.exportFail') as string)+',' + response.info });
return;
}
try {
doExport(JSON.parse(JSON.stringify(response.data)));
} catch (error) {
console.error(error);
}
}).catch((response: any) => {
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: '', desc: (this.$t('app.gridpage.exportFail') as string) });
});
}
/**
* 导出数据格式化
*
* @param {*} filterVal
* @param {*} jsonData
* @returns {[]}
* @memberof Gridexpbar_gridBase
*/
public async formatExcelData(filterVal:any, jsonData:any) {
let codelistColumns:Array<any> = [
];
let _this = this;
for (const codelist of codelistColumns) {
// 动态代码表处理
if (Object.is(codelist.codelistType, "DYNAMIC")) {
let items = await _this.codeListService.getItems(codelist.srfkey);
jsonData.forEach((row:any)=>{
row[codelist.name] = _this.getCodelistValue(items, row[codelist.name], codelist);
});
// 静态处理
} else if(Object.is(codelist.codelistType, "STATIC")){
let items = await _this.$store.getters.getCodeListItems(codelist.srfkey);
jsonData.forEach((row:any)=>{
row[codelist.name] = _this.getCodelistValue(items, row[codelist.name], codelist);
});
}
}
return jsonData.map((v:any) => filterVal.map((j:any) => v[j]))
}
/**
* 解析代码表和vlaue,设置items
*
* @public
* @param {any[]} items 代码表数据
* @param {*} value
* @returns {*}
* @memberof Gridexpbar_gridBase
*/
public getCodelistValue(items: any[], value: any, codelist: any,){
if(!value && value !== 0 && value !== false){
return this.$t('codelist.'+codelist.srfkey+'.empty');
}
if (items) {
let result:any = [];
if(Object.is(codelist.renderMode,"number")){
items.map((_item: any, index: number)=>{
const nValue = parseInt((value as any), 10);
const codevalue = _item.value;
if((parseInt(codevalue, 10) & nValue) > 0){
result.push(_item);
}
});
} else if(Object.is(codelist.renderMode,"string")){
const arrayValue: Array<any> = (value as any).split(codelist.valueSeparator);
arrayValue.map((value: any, index: number) => {
result.push([]);
let values: any[] = Object.is(this.$util.typeOf(value), 'number') ? [value] : [...(value as any).split(codelist.valueSeparator)];
values.map((val:any ,num: number)=>{
const item = this.getItem(items, val, codelist);
if(item){
result[index].push(item);
}
});
});
} else {
let values: any[] = Object.is(this.$util.typeOf(value), 'number') ? [value] : [...(value as any).split(codelist.valueSeparator)];
values.map((value:any ,index: number)=>{
const item = this.getItem(items, value, codelist);
if(item){
result.push(item);
}
});
}
// 设置items
if(result.length != 0){
return result.join(codelist.valueSeparator);
}else{
return value;
}
}
}
/**
* 获取代码项
*
* @public
* @param {any[]} items
* @param {*} value
* @returns {*}
* @memberof Gridexpbar_gridBase
*/
public getItem(items: any[], value: any, codelist: any): any {
const arr: Array<any> = items.filter(item => {return item.value == value});
if (arr.length !== 1) {
return undefined;
}
if(Object.is(codelist.codelistType,'STATIC')){
return this.$t('codelist.'+codelist.srfkey+'.'+arr[0].value);
}else{
return arr[0].text;
}
}
/**
* 生命周期
*
* @memberof Gridexpbar_gridBase
*/
public created(): void {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof Gridexpbar_gridBase
*/
public afterCreated(){
this.setColState();
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if (!Object.is(tag, this.name)) {
return;
}
if (Object.is('load', action)) {
this.load(data,true);
}
if (Object.is('remove', action)) {
this.remove(data);
}
if (Object.is('save', action)) {
this.save(data);
}
});
}
if(AppCenterService && AppCenterService.getMessageCenter()){
this.appStateEvent = AppCenterService.getMessageCenter().subscribe(({ name, action, data }) =>{
if(!Object.is(name,"IBIZBOOK")){
return;
}
if(Object.is(action,'appRefresh')){
if(this.selections && this.selections.length > 0) {
this.selections = [];
this.$emit('selectionchange', this.selections);
}
this.refresh([data]);
}
})
}
}
/**
* vue 生命周期
*
* @memberof Gridexpbar_gridBase
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof Gridexpbar_gridBase
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
if(this.appStateEvent){
this.appStateEvent.unsubscribe();
}
}
/**
* 获取选中行胡数据
*
* @returns {any[]}
* @memberof Gridexpbar_gridBase
*/
public getSelection(): any[] {
return this.selections;
}
/**
* 行双击事件
*
* @param {*} $event
* @returns {void}
* @memberof Gridexpbar_gridBase
*/
public rowDBLClick($event: any): void {
// 分组行跳过
if($event && $event.children){
return;
}
if (!$event || this.actualIsOpenEdit || Object.is(this.gridRowActiveMode,0)) {
return;
}
this.selections = [];
this.selections.push(JSON.parse(JSON.stringify($event)));
const refs: any = this.$refs;
if (refs.multipleTable) {
refs.multipleTable.clearSelection();
refs.multipleTable.toggleRowSelection($event);
}
this.$emit('rowdblclick', this.selections);
this.$emit('selectionchange', this.selections);
}
/**
* 合并分组行
*
* @memberof Gridexpbar_gridBase
*/
public arraySpanMethod({row, column, rowIndex, columnIndex} : any) {
let allColumns:Array<any> = [];
if(row && row.children) {
if(columnIndex == (this.isSingleSelect ? 0:1)) {
return [1, allColumns.length+1];
} else if(columnIndex > (this.isSingleSelect ? 0:1)) {
return [0,0];
}
}
}
/**
* 分组方法
*
* @memberof Gridexpbar_gridBase
*/
public group(){
if(Object.is(this.groupMode,"AUTO")){
this.drawGroup();
}else if(Object.is(this.groupMode,"CODELIST")){
this.drawCodelistGroup();
}
}
/**
* 获取表格分组相关代码表
*
* @param {string} codelistType 代码表类型
* @param {string} codelistTag 代码表标识
* @memberof Gridexpbar_gridBase
*/
public getGroupCodelist(codelistType: string,codelistTag:string){
let codelist: Array<any> = [];
// 动态代码表
if (Object.is(codelistType, "DYNAMIC")) {
this.codeListService.getItems(codelistTag).then((res: any)=>{
codelist = res;
}).catch((error: any) => {
});
// 静态代码表
} else if(Object.is(codelistType, "STATIC")){
codelist = this.$store.getters.getCodeListItems(codelistTag);
}
return codelist;
}
/**
* 根据分组代码表绘制分组列表
*
* @memberof Gridexpbar_gridBase
*/
public drawCodelistGroup(){
if(!this.isEnableGroup) return;
// 分组
let allGroup: Array<any> = [];
let allGroupField: Array<any> =[];
let groupTree:Array<any> = [];
allGroup = this.getGroupCodelist(this.codelistType,this.codelistTag);
allGroupField = this.getGroupCodelist(this.groupAppFieldCodelistType,this.groupAppFieldCodelistTag);
if(allGroup.length == 0){
console.warn("分组数据无效");
}
allGroup.forEach((group: any,i: number)=>{
let children:Array<any> = [];
this.items.forEach((item: any,j: number)=>{
if(allGroupField && allGroupField.length > 0){
if(Object.is(group.label,item[this.groupAppField])){
item.groupById = Number((i+1) * 100 + (j+1) * 1);
item.group = '';
children.push(item);
}
}else if(Object.is(group.value,item[this.groupAppField])){
item.groupById = Number((i+1) * 100 + (j+1) * 1);
item.group = '';
children.push(item);
}
});
const tree: any ={
groupById: Number((i+1)*100),
group: group.label,
children: children
}
groupTree.push(tree);
});
let child:Array<any> = [];
this.items.forEach((item: any,index: number)=>{
let i: number = 0;
if(allGroupField && allGroupField.length > 0){
i = allGroup.findIndex((group: any)=>Object.is(group.label,item[this.groupAppField]));
}else{
i = allGroup.findIndex((group: any)=>Object.is(group.value,item[this.groupAppField]));
}
if(i < 0){
item.groupById = Number((allGroup.length+1) * 100 + (index+1) * 1);
item.group = '';
child.push(item);
}
if(i < 0){
item.groupById = Number((allGroup.length+1) * 100 + (index+1) * 1);
item.group = '';
child.push(item);
}
})
const Tree: any = {
groupById: Number((allGroup.length+1)*100),
group: this.$t('app.gridpage.other'),
children: child
}
if(child && child.length > 0){
groupTree.push(Tree);
}
this.items = groupTree;
if(this.actualIsOpenEdit) {
for(let i = 0; i < this.items.length; i++) {
this.gridItemsModel.push(this.getGridRowModel());
}
}
}
/**
* 绘制分组
*
* @memberof Gridexpbar_gridBase
*/
public drawGroup(){
if(!this.isEnableGroup) return;
// 分组
let allGroup: Array<any> = [];
this.items.forEach((item: any)=>{
if(item.hasOwnProperty(this.groupAppField)){
allGroup.push(item[this.groupAppField]);
}
});
let groupTree:Array<any> = [];
allGroup = [...new Set(allGroup)];
if(allGroup.length == 0){
console.warn("分组数据无效");
}
// 组装数据
allGroup.forEach((group: any, groupIndex: number)=>{
let children:Array<any> = [];
this.items.forEach((item: any,itemIndex: number)=>{
if(Object.is(group,item[this.groupAppField])){
item.groupById = Number((groupIndex+1) * 100 + (itemIndex+1) * 1);
item.group = '';
children.push(item);
}
});
group = group ? group : this.$t('app.gridpage.other');
const tree: any ={
groupById: Number((groupIndex+1)*100),
group: group,
children: children,
}
groupTree.push(tree);
});
this.items = groupTree;
if(this.actualIsOpenEdit) {
for(let i = 0; i < this.items.length; i++) {
this.gridItemsModel.push(this.getGridRowModel());
}
}
}
/**
* 单个复选框选中
*
* @param {*} selection 所有选中行数据
* @param {*} row 当前选中行数据
* @memberof Gridexpbar_gridBase
*/
public select(selection: any, row: any): void {
if(this.groupAppField) {
let isContain:boolean = selection.some((item:any) =>{
return item == row;
})
// 是否选中当前行,选中为true,否则为false
if(isContain) {
// 当前行为分组行
if(row.children && row.children.length > 0) {
this.toggleSelection(row.children, true);
row.children.forEach((children: any) => {
this.selections.push(children);
});
} else {
this.selections.push(row);
}
} else {
if(row.children && row.children.length > 0) {
this.toggleSelection(row.children, false);
this.selections = this.computeCheckedData(this.selections, row.children);
} else {
this.selections = this.computeCheckedData(this.selections, row);
}
}
this.selections = [...new Set(this.selections)]
} else {
if(!selection) {
return;
}
this.selections = [...JSON.parse(JSON.stringify(selection))];
}
this.$emit('selectionchange', this.selections);
}
/**
* 计算当前选中数据
*
* @param {*} selectionArray 所有选中行数据
* @param {*} cancelData 被取消选中行数据,分组行为数组,非分组行为对象
* @memberof Gridexpbar_gridBase
*/
public computeCheckedData(selectionArray: any[], cancelData: Array<any> | any) {
let targetArray: Array<any> = [];
// 分组行
if(Array.isArray(cancelData)) {
if(selectionArray && selectionArray.length > 0) {
selectionArray.forEach((selection:any) =>{
let tempFlag:boolean = true;
cancelData.forEach((child:any) =>{
if(selection.groupById===child.groupById){
tempFlag = false;
}
})
if(tempFlag) targetArray.push(selection);
})
}
} else {
// 非分组行
if(selectionArray && selectionArray.length > 0) {
selectionArray.forEach((selection:any) =>{
let tempFlag:boolean = true;
if(selection.groupById===cancelData.groupById){
tempFlag = false;
}
if(tempFlag) targetArray.push(selection);
})
}
}
return targetArray;
}
/**
* 设置非分组行checkbox选中状态
*
* @param {*} rows 选中数据数组
* @param {boolean} flag 是否选中
* @memberof Gridexpbar_gridBase
*/
public toggleSelection(rows?: any, flag?: boolean) {
if(rows) {
rows.forEach((row:any) => {
(this.$refs.multipleTable as any).toggleRowSelection(row, flag);
});
} else {
(this.$refs.multipleTable as any).clearSelection();
}
}
/**
* 复选框数据全部选中
*
* @param {*} $event
* @memberof Gridexpbar_gridBase
*/
public selectAll(selection: any): void {
this.selections = [];
if(this.groupAppField) {
let flag: boolean = true;
if(selection && selection.length === this.items.length) {
selection.forEach((element: any) => {
if(element.children) {
this.toggleSelection(element.children, flag);
element.children.forEach((children: any) => {
this.selections.push(children);
});
} else {
flag = false;
}
});
} else {
flag = false;
}
if(!flag) {
this.toggleSelection();
}
} else {
if(!selection) {
return;
}
this.selections = [...JSON.parse(JSON.stringify(selection))];
}
this.$emit('selectionchange', this.selections);
}
/**
* 行单击选中
*
* @param {*} $event
* @returns {void}
* @memberof Gridexpbar_gridBase
*/
public rowClick($event: any, ifAlways: boolean = false): void {
// 分组行跳过
if($event && $event.children){
return;
}
if (!ifAlways && (!$event || this.actualIsOpenEdit)) {
return;
}
if(this.stopRowClick) {
this.stopRowClick = false;
return;
}
if(this.isSingleSelect){
this.selections = [];
}
// 已选中则删除,没选中则添加
let selectIndex = this.selections.findIndex((item:any)=>{
return Object.is(item.ibizbook,$event.ibizbook);
});
if (Object.is(selectIndex,-1)){
this.selections.push(JSON.parse(JSON.stringify($event)));
} else {
this.selections.splice(selectIndex,1);
}
const refs: any = this.$refs;
if (refs.multipleTable) {
if(this.isSingleSelect){
refs.multipleTable.clearSelection();
refs.multipleTable.setCurrentRow($event);
}else{
refs.multipleTable.toggleRowSelection($event);
}
}
this.$emit('selectionchange', this.selections);
}
/**
* 页面变化
*
* @param {*} $event
* @returns {void}
* @memberof Gridexpbar_gridBase
*/
public pageOnChange($event: any): void {
if (!$event) {
return;
}
if ($event === this.curPage) {
return;
}
this.curPage = $event;
this.load({});
}
/**
* 分页条数变化
*
* @param {*} $event
* @returns {void}
* @memberof Gridexpbar_gridBase
*/
public onPageSizeChange($event: any): void {
if (!$event) {
return;
}
if ($event === this.limit) {
return;
}
this.limit = $event;
if (this.curPage === 1) {
this.load({});
}
}
/**
* 分页刷新
*
* @memberof Gridexpbar_gridBase
*/
public pageRefresh(): void {
this.load({});
}
/**
* 排序变化
*
* @param {{ column: any, prop: any, order: any }} { column, prop, order }
* @memberof Gridexpbar_gridBase
*/
public onSortChange({ column, prop, order }: { column: any, prop: any, order: any }): void {
const dir = Object.is(order, 'ascending') ? 'asc' : Object.is(order, 'descending') ? 'desc' : '';
if (Object.is(dir, this.minorSortDir) && Object.is(this.minorSortPSDEF, prop)) {
return;
}
this.minorSortDir = dir;
this.minorSortPSDEF = prop ? prop : '';
this.load({});
}
/**
* 表格行选中样式
*
* @param {{ row: any, rowIndex: any }} { row, rowIndex }
* @returns {string}
* @memberof Gridexpbar_gridBase
*/
public onRowClassName({ row, rowIndex }: { row: any, rowIndex: any }): string {
const index = this.selections.findIndex((select: any) => Object.is(select.srfkey, row.srfkey));
return index !== -1 ? 'grid-row-select' : '';
}
/**
* 界面行为
*
* @param {*} row
* @param {*} tag
* @param {*} $event
* @memberof Gridexpbar_gridBase
*/
public uiAction(row: any, tag: any, $event: any) {
// this.rowClick(row, true);
$event.stopPropagation();
}
/**
* 设置列状态
*
* @memberof Gridexpbar_gridBase
*/
public setColState() {
const _data: any = localStorage.getItem('ibizbook_gridexpbar_grid_gridexpbar_grid');
if (_data) {
let columns = JSON.parse(_data);
columns.forEach((col: any) => {
let column = this.allColumns.find((item) => Object.is(col.name, item.name));
if (column) {
Object.assign(column, col);
}
});
}
}
/**
* 列变化
*
* @memberof Gridexpbar_gridBase
*/
public onColChange() {
localStorage.setItem('ibizbook_gridexpbar_grid_gridexpbar_grid', JSON.stringify(this.allColumns));
}
/**
* 获取列状态
*
* @param {string} name
* @returns {boolean}
* @memberof Gridexpbar_gridBase
*/
public getColumnState(name: string): boolean {
let column = this.allColumns.find((col: any) =>
Object.is(name, col.name)
);
return column.show ? true : false;
}
/**
* 表格列是否自适应布局
*
* @readonly
* @type {boolean}
* @memberof Gridexpbar_gridBase
*/
get adaptiveState(): boolean {
return !this.allColumns.find((column: any) => column.show && Object.is(column.unit, 'STAR'));
}
/**
* 保存
*
* @param {*} $event
* @returns {Promise<any>}
* @memberof Gridexpbar_gridBase
*/
public async save(args: any[], params?: any, $event?: any, xData?: any){
let _this = this;
// 拷贝模式
if(_this.viewparams && _this.viewparams.copymode && Object.is(_this.viewparams.copymode,'true') && _this.items && _this.items.length >0){
for (const item of _this.items) {
item.rowDataState = 'create';
}
}
if(_this.items && _this.items.length >0){
for (const item of _this.items) {
if(Object.is(item.rowDataState, 'update')){
_this.updateDefault(item);
}
}
}
if (!await this.validateAll()) {
if(this.errorMessages && this.errorMessages.length > 0) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: this.errorMessages[0] });
} else {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.rulesException') as string) });
}
return [];
}
let successItems:any = [];
let errorItems:any = [];
let errorMessage:any = [];
for (const item of _this.items) {
try {
if(Object.is(item.rowDataState, 'create')){
if(!this.createAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKGridExpView'+(this.$t('app.gridpage.notConfig.createAction') as string) });
}else{
Object.assign(item,{viewparams:this.viewparams});
let response = await this.service.add(this.createAction, JSON.parse(JSON.stringify(this.context)),item, this.showBusyIndicator);
successItems.push(JSON.parse(JSON.stringify(response.data)));
}
}else if(Object.is(item.rowDataState, 'update')){
if(!this.updateAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKGridExpView'+(this.$t('app.gridpage.notConfig.updateAction') as string) });
}else{
Object.assign(item,{viewparams:this.viewparams});
if(item.ibizbook){
Object.assign(this.context,{ibizbook:item.ibizbook});
}
let response = await this.service.update(this.updateAction,JSON.parse(JSON.stringify(this.context)),item, this.showBusyIndicator);
successItems.push(JSON.parse(JSON.stringify(response.data)));
}
}
} catch (error) {
errorItems.push(JSON.parse(JSON.stringify(item)));
errorMessage.push(error);
}
}
this.$emit('save', successItems);
this.refresh([]);
if(errorItems.length === 0 && successItems.length > 0){
this.$Notice.success({ title: '', desc: (this.$t('app.commonWords.saveSuccess') as string) });
}else{
errorItems.forEach((item: any, index: number) => {
if(errorMessage[index] && errorMessage[index].data) {
if(Object.is(errorMessage[index].data.errorKey, 'DupCheck')) {
let errorProp: string = errorMessage[index].data.message.match(/\[[a-zA-Z]*\]/)[0];
let name: string = errorProp ? this.service.getNameByProp(errorProp.substr(1, errorProp.length-2)) : '';
if(name) {
let desc: any = this.allColumns.find((column: any) =>{
return Object.is(column.name, name);
});
this.$Notice.error({
title: (this.$t('app.commonWords.createFailed') as string),
desc: (desc ? desc.label : '') + " : " + item[name] + (this.$t('app.commonWords.isExist') as string) + '!',
});
} else {
this.$Notice.error({
title: (this.$t('app.commonWords.createFailed') as string),
desc: errorMessage[index].data.message?errorMessage[index].data.message:(this.$t('app.commonWords.sysException') as string),
});
}
} else if(Object.is(errorMessage[index].data.errorKey, 'DuplicateKeyException')){
this.$Notice.error({
title: (this.$t('app.commonWords.saveFailed') as string),
desc: errorMessage[index].data.message?errorMessage[index].data.message:(this.$t('app.commonWords.sysException') as string),
});
}else {
this.$Notice.error({
title: (this.$t('app.commonWords.saveFailed') as string),
desc: errorMessage[index].data.message?errorMessage[index].data.message:(this.$t('app.commonWords.sysException') as string),
});
}
} else {
this.$Notice.error({ title: (this.$t('app.commonWords.saveFailed') as string), desc: (item[this.majorInfoColName]?item[this.majorInfoColName]:"") + (this.$t('app.commonWords.saveFailed') as string) + '!' });
}
});
}
return successItems;
}
/**
* 新建行
*
* @param {*} $event
* @returns {void}
* @memberof Gridexpbar_gridBase
*/
public newRow(args: any[], params?: any, $event?: any, xData?: any): void {
if(!this.loaddraftAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKGridExpView'+(this.$t('app.gridpage.notConfig.loaddraftAction') as string) });
return;
}
let _this = this;
Object.assign(args[0],{viewparams:this.viewparams});
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction, JSON.parse(JSON.stringify(this.context)), args[0], this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
}
return;
}
const data = response.data;
this.createDefault(data);
data.rowDataState = "create";
this.items.splice(0,0,data);
_this.gridItemsModel.push(_this.getGridRowModel());
}).catch((response: any) => {
if (response && response.status === 401) {
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) });
return;
}
});
}
/**
* 表格编辑项值变更
*
* @param row 行数据
* @param {{ name: string, value: any }} $event
* @returns {void}
* @memberof Gridexpbar_gridBase
*/
public onGridItemValueChange(row: any,$event: { name: string, value: any },rowIndex: number): void {
if (!$event) {
return;
}
if (!$event.name || Object.is($event.name, '') || !row.hasOwnProperty($event.name)) {
return;
}
row[$event.name] = $event.value;
this.gridEditItemChange(row, $event.name, $event.value, rowIndex);
}
/**
* 表格编辑项值变化
*
* @public
* @param row 行数据
* @param property 列编辑项名
* @param row 列编辑项值
* @returns {void}
* @memberof Gridexpbar_gridBase
*/
public gridEditItemChange(row: any, property: string, value: any, rowIndex: number){
row.rowDataState = row.rowDataState ? row.rowDataState : "update" ;
if(Object.is(row.rowDataState,"update")){
if(this.defaultUpdateItems.includes(property)){
row.hasUpdated = true;
}
}
this.curEditRowData = row;
this.resetGridData(row, property, rowIndex);
this.validate(property,row,rowIndex);
}
/**
* 表格编辑项更新
*
* @param {string} mode 界面行为名称
* @param {*} [data={}] 请求数据
* @param {string[]} updateDetails 更新项
* @param {boolean} [showloading] 是否显示加载状态
* @returns {void}
* @memberof Gridexpbar_gridBase
*/
public updateGridEditItem(mode: string, data: any = {}, updateDetails: string[], showloading?: boolean): void {
if (!mode || (mode && Object.is(mode, ''))) {
return;
}
let tempContext: any = this.$util.deepCopy(this.context);
const arg: any = JSON.parse(JSON.stringify(data));
Object.assign(arg,{viewparams:this.viewparams});
const post: Promise<any> = this.service.frontLogic(mode,JSON.parse(JSON.stringify(tempContext)),arg, showloading);
post.then((response: any) => {
if (!response || response.status !== 200) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.gridpage.formitemFailed') as string) });
return;
}
const _data: any = response.data;
if(!_data){
return;
}
updateDetails.forEach((name: string) => {
if (!_data.hasOwnProperty(name)) {
return;
}
data[name] = _data[name];
});
}).catch((response: any) => {
if (response && response.status === 401) {
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) });
return;
}
});
}
/**
* 获取对应行class
*
* @param {*} $args row 行数据,rowIndex 行索引
* @returns {void}
* @memberof Gridexpbar_gridBase
*/
public getRowClassName(args:{row: any,rowIndex: number}){
let isSelected = this.selections.some((item:any)=>{
return Object.is(item.ibizbook,args.row.ibizbook);
});
return isSelected ? "grid-selected-row" : "";
}
/**
* 获取对应单元格class
*
* @param {*} $args row 行数据,column 列数据,rowIndex 行索引,columnIndex 列索引
* @returns {void}
* @memberof Gridexpbar_gridBase
*/
public getCellClassName(args:{row: any, column: any, rowIndex: number, columnIndex:number}){
let className: string = '';
if(args.column.property){
let col = this.allColumns.find((item:any)=>{
return Object.is(args.column.property,item.name);
})
if(col !== undefined){
if(col.isEnableRowEdit && this.actualIsOpenEdit ){
className += 'edit-cell ';
}
} else {
className += 'info-cell';
}
}
if(this.groupAppField && args.columnIndex === 0 && !this.isSingleSelect) {
if(args.row.children && args.row.children.length > 0) {
className += this.computeGroupRow(args.row.children, args.row);
}
}
return className;
}
/**
* 计算分组行checkbox选中样式
*
* @param {*} rows 当前分组行下的所有数据
* @returns {*} currentRow 当前分组行
* @memberof Gridexpbar_gridBase
*/
public computeGroupRow(rows: any[], currentRow: any) {
let count: number = 0;
this.selections.forEach((select: any) => {
rows.forEach((row: any) => {
if(row.groupById === select.groupById) {
count++;
}
})
})
if(count === rows.length) {
(this.$refs.multipleTable as any).toggleRowSelection(currentRow, true);
return 'cell-select-all ';
} else if(count !== 0 && count < rows.length) {
return 'cell-indeterminate '
} else if(count === 0) {
(this.$refs.multipleTable as any).toggleRowSelection(currentRow, false);
return '';
}
}
/**
* 新建默认值
* @param {*} row 行数据
* @memberof Gridexpbar_gridBase
*/
public createDefault(row: any){
}
/**
* 更新默认值
* @param {*} row 行数据
* @memberof Gridexpbar_gridBase
*/
public updateDefault(row: any){
}
/**
* 计算数据对象类型的默认值
* @param {string} action 行为
* @param {string} param 默认值参数
* @param {*} data 当前行数据
* @memberof Gridexpbar_gridBase
*/
public computeDefaultValueWithParam(action:string,param:string,data:any){
if(Object.is(action,"UPDATE")){
const nativeData:any = this.service.getCopynativeData();
if(nativeData && (nativeData instanceof Array) && nativeData.length >0){
let targetData:any = nativeData.find((item:any) =>{
return item.ibizbookid === data.srfkey;
})
if(targetData){
return targetData[param]?targetData[param]:null;
}else{
return null;
}
}else{
return null;
}
}else{
return this.service.getRemoteCopyData()[param]?this.service.getRemoteCopyData()[param]:null;
}
}
/**
* 校验属性值规则
*
* @public
* @param {{ name: string }} { name }
* @memberof Gridexpbar_gridBase
*/
public verifyDeRules(name:string,rule:any = this.deRules,op:string = "AND",value:any) :{isPast:boolean}{
let falg:any = {};
if(!rule || !rule[name]){
return falg;
}
let opValue = op == 'AND'? true :false;
let startOp = (val:boolean)=>{
if(falg.isPast){
if(opValue){
falg.isPast = falg.isPast && val;
}else{
falg.isPast = falg.isPast || val;
}
}else{
falg.isPast = val;
}
}
for(let i=0; i < rule[name].length; i++) {
let item: any = rule[name][i];
if((value === null || value === undefined || value === "") && (item.type != 'GROUP')){
startOp(true);
return falg;
}
try {
// 常规规则
if(item.type == 'SIMPLE'){
startOp(!this.$verify.checkFieldSimpleRule(value,item.condOP,item.paramValue,item.ruleInfo,item.paramType,this.curEditRowData,item.isKeyCond));
falg.infoMessage = item.ruleInfo;
if(!falg.isPast) return falg;
}
// 数值范围
if(item.type == 'VALUERANGE2'){
startOp( !this.$verify.checkFieldValueRangeRule(value,item.minValue,item.isIncludeMinValue,item.maxValue,item.isIncludeMaxValue,item.ruleInfo,item.isKeyCond));
falg.infoMessage = item.ruleInfo;
if(!falg.isPast) return falg;
}
// 正则式
if (item.type == "REGEX") {
startOp(!this.$verify.checkFieldRegExRule(value,item.regExCode,item.ruleInfo,item.isKeyCond));
falg.infoMessage = item.ruleInfo;
if(!falg.isPast) return falg;
}
// 长度
if (item.type == "STRINGLENGTH") {
startOp(!this.$verify.checkFieldStringLengthRule(value,item.minValue,item.isIncludeMinValue,item.maxValue,item.isIncludeMaxValue,item.ruleInfo,item.isKeyCond));
falg.infoMessage = item.ruleInfo;
if(!falg.isPast) return falg;
}
// 系统值规则
if(item.type == "SYSVALUERULE") {
startOp(!this.$verify.checkFieldSysValueRule(value,item.sysRule.regExCode,item.ruleInfo,item.isKeyCond));
falg.infoMessage = item.ruleInfo;
if(!falg.isPast) return falg;
}
} catch(error) {
falg.infoMessage = item.ruleInfo;
startOp(false);
if(!falg.isPast) return falg;
}
// 分组
if(item.type == 'GROUP'){
falg = this.verifyDeRules('group',item,item.condOP?item.condOP:"AND",value)
if(item.isNotMode){
falg.isPast = !falg.isPast;
}
}
};
if(!falg.hasOwnProperty("isPast")){
falg.isPast = true;
}
if(!value && value != 0){
falg.isPast = true;
}
return falg;
}
/**
* 工作流提交
*
* @param {*} [data={}]
* @param {*} [localdata={}]
* @returns {Promise<any>}
* @memberof Gridexpbar_gridBase
*/
public async submitbatch(data: any,localdata:any): Promise<any> {
return new Promise((resolve: any, reject: any) => {
const _this: any = this;
const arg: any = data;
const result: Promise<any> = this.service.submitbatch(_this.WFSubmitAction, JSON.parse(JSON.stringify(this.context)),arg,localdata,this.showBusyIndicator);
result.then((response: any) => {
if (!response || response.status !== 200) {
if(response.data){
this.$Notice.error({ title: '', desc: (this.$t('app.formpage.workflow.submiterror') as string) + ', ' + response.data.message });
}
return;
}
this.$Notice.info({ title: '', desc: (this.$t('app.formpage.workflow.submitsuccess') as string) });
resolve(response);
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
reject(response);
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) });
reject(response);
return;
}
reject(response);
});
})
}
/**
* 获取表格列禁用状态
*
* @memberof Gridexpbar_gridBase
*/
public getColumnDisabled(data:any,name:string){
if(this.allColumns || Array.isArray(this.allColumns)){
const curColumn:any = this.allColumns.find((item:any) =>{
return item.name === name;
})
if(curColumn.hasOwnProperty('enableCond')){
return data.srfuf == 1 ? (curColumn.enableCond & 2) !== 2 : (curColumn.enableCond & 1) !== 1
}else{
return false;
}
}
}
/**
* 重置表格项值
*
* @param {*} row 当前行
* @param {string} property 属性名
* @param {number} rowIndex 行下标
* @memberof Gridexpbar_gridBase
*/
public resetGridData(row: any, property: string, rowIndex: number) {
if(this.actualIsOpenEdit) {
}
}
}
</script>
<style lang='less'>
@import './gridexpbar-grid-grid.less';
</style>
\ No newline at end of file
/**
* Gridexpbar_grid 部件模型
*
* @export
* @class Gridexpbar_gridModel
*/
export default class Gridexpbar_gridModel {
/**
* 是否是实体数据导出
*
* @returns {any[]}
* @memberof Gridexpbar_gridGridexpbar_gridMode
*/
public isDEExport: boolean = false;
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof Gridexpbar_gridGridexpbar_gridMode
*/
public getDataItems(): any[] {
if(this.isDEExport){
return [
]
}else{
return [
{
name: 'ibizbookid',
prop: 'ibizbookid',
dataType: 'GUID',
},
{
name: 'srfmajortext',
prop: 'ibizbookname',
dataType: 'TEXT',
},
{
name: 'srfdataaccaction',
prop: 'ibizbookid',
dataType: 'GUID',
},
{
name: 'srfkey',
prop: 'ibizbookid',
dataType: 'GUID',
isEditable:true
},
{
name: 'ibizbook',
prop: 'ibizbookid',
},
{
name:'size',
prop:'size',
dataType: 'QUERYPARAM'
},
{
name:'query',
prop:'query',
dataType: 'QUERYPARAM'
},
{
name:'filter',
prop:'filter',
dataType: 'QUERYPARAM'
},
{
name:'page',
prop:'page',
dataType: 'QUERYPARAM'
},
{
name:'sort',
prop:'sort',
dataType: 'QUERYPARAM'
},
{
name:'srfparentdata',
prop:'srfparentdata',
dataType: 'QUERYPARAM'
},
// 前端新增修改标识,新增为"0",修改为"1"或未设值
{
name: 'srffrontuf',
prop: 'srffrontuf',
dataType: 'TEXT',
},
]
}
}
}
\ No newline at end of file
import { Http,Util,Errorlog } from '@/utils';
import ControlService from '@/widgets/control-service';
import IBIZBOOKService from '@/service/ibizbook/ibizbook-service';
import Gridexpbar_gridModel from './gridexpbar-grid-grid-model';
/**
* Gridexpbar_grid 部件服务对象
*
* @export
* @class Gridexpbar_gridService
*/
export default class Gridexpbar_gridService extends ControlService {
/**
* 图书服务对象
*
* @type {IBIZBOOKService}
* @memberof Gridexpbar_gridService
*/
public appEntityService: IBIZBOOKService = new IBIZBOOKService({ $store: this.getStore() });
/**
* 设置从数据模式
*
* @type {boolean}
* @memberof Gridexpbar_gridService
*/
public setTempMode(){
this.isTempMode = false;
}
/**
* Creates an instance of Gridexpbar_gridService.
*
* @param {*} [opts={}]
* @memberof Gridexpbar_gridService
*/
constructor(opts: any = {}) {
super(opts);
this.model = new Gridexpbar_gridModel();
}
/**
* 备份原生数据
*
* @type {*}
* @memberof Gridexpbar_gridService
*/
private copynativeData:any;
/**
* 远端数据
*
* @type {*}
* @memberof Gridexpbar_gridService
*/
private remoteCopyData:any = {};
/**
* 处理数据
*
* @public
* @param {Promise<any>} promise
* @returns {Promise<any>}
* @memberof Gridexpbar_gridService
*/
public doItems(promise: Promise<any>, deKeyField: string, deName: string): Promise<any> {
return new Promise((resolve, reject) => {
promise.then((response: any) => {
if (response && response.status === 200) {
const data = response.data;
data.forEach((item:any,index:number) =>{
item[deName] = item[deKeyField];
data[index] = item;
});
resolve(data);
} else {
reject([])
}
}).catch((response: any) => {
reject([])
});
});
}
/**
* 获取跨实体数据集合
*
* @param {string} serviceName 服务名称
* @param {string} interfaceName 接口名称
* @param {*} data
* @param {boolean} [isloading]
* @returns {Promise<any[]>}
* @memberof Gridexpbar_gridService
*/
@Errorlog
public getItems(serviceName: string, interfaceName: string, context: any = {}, data: any, isloading?: boolean): Promise<any[]> {
data.page = data.page ? data.page : 0;
data.size = data.size ? data.size : 1000;
return Promise.reject([])
}
/**
* 添加数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof Gridexpbar_gridService
*/
@Errorlog
public add(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestDataWithUpdate(action,context,data,true);
return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService;
let result: Promise<any>;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
}else{
result =_appEntityService.Create(Context,Data, isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 删除数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof Gridexpbar_gridService
*/
@Errorlog
public delete(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true);
return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService;
let result: Promise<any>;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
}else{
result =_appEntityService.Remove(Context,Data, isloading);
}
result.then((response) => {
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 修改数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof Gridexpbar_gridService
*/
@Errorlog
public update(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestDataWithUpdate(action,context,data,true);
return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService;
let result: Promise<any>;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data,isloading);
}else{
result =_appEntityService.Update(Context,Data,isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 获取数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof Gridexpbar_gridService
*/
@Errorlog
public get(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.Get(Context,Data, isloading);
}
result.then((response) => {
//处理返回数据,补充判断标识
if(response.data){
Object.assign(response.data,{srfuf:'0'});
}
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 查询数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof Gridexpbar_gridService
*/
@Errorlog
public search(action: string,context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true);
return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService;
let result: Promise<any>;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
}else{
result =_appEntityService.FetchDefault(Context,Data, isloading);
}
result.then((response) => {
this.setCopynativeData(response.data);
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 加载草稿
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof Gridexpbar_gridService
*/
@Errorlog
public loadDraft(action: string, context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.GetDraft(Context,Data, isloading);
}
result.then((response) => {
//处理返回数据,补充判断标识
if(response.data){
Object.assign(response.data,{srfuf:'0'});
//仿真主键数据
response.data.ibizbookid = Util.createUUID();
}
this.setRemoteCopyData(response);
this.handleResponse(action, response, true);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 前台逻辑
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof Gridexpbar_gridService
*/
@Errorlog
public frontLogic(action:string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true);
return new Promise((resolve: any, reject: any)=>{
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
return Promise.reject({ status: 500, data: { title: '失败', message: '系统异常' } });
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
})
}
/**
* 处理请求数据(修改或增加数据)
*
* @param action 行为
* @param data 数据
* @memberof Gridexpbar_gridService
*/
public handleRequestDataWithUpdate(action: string,context:any ={},data: any = {},isMerge:boolean = false){
let model: any = this.getMode();
if (!model && model.getDataItems instanceof Function) {
return data;
}
let dataItems: any[] = model.getDataItems();
let requestData:any = {};
if(isMerge && (data && data.viewparams)){
Object.assign(requestData,data.viewparams);
}
dataItems.forEach((item:any) =>{
if(item && item.dataType && Object.is(item.dataType,'FONTKEY')){
if(item && item.prop && item.name ){
requestData[item.prop] = context[item.name];
}
}else{
if(item && item.isEditable && item.prop && item.name && data.hasOwnProperty(item.name)){
requestData[item.prop] = data[item.name];
}
}
});
let tempContext:any = JSON.parse(JSON.stringify(context));
if(tempContext && tempContext.srfsessionid){
tempContext.srfsessionkey = tempContext.srfsessionid;
delete tempContext.srfsessionid;
}
return {context:tempContext,data:requestData};
}
/**
* 处理工作流数据
*
* @param data 传入数据
* @memberof Gridexpbar_gridService
*/
public handleWFData(data:any, isMerge:boolean = false){
let model: any = this.getMode();
if (!model && model.getDataItems instanceof Function) {
return data;
}
let dataItems: any[] = model.getDataItems();
let requestData:any = {};
dataItems.forEach((item:any) =>{
if(item && item.prop){
if(item.dataType){
if(!Object.is(item.dataType,'QUERYPARAM')){
requestData[item.prop] = data[item.name];
}
}else{
requestData[item.prop] = data[item.name];
}
}
});
if(isMerge && (data.viewparams && Object.keys(data.viewparams).length > 0)){
Object.assign(requestData,data.viewparams);
}
// 删除前端srffrontuf标识
if(requestData.hasOwnProperty('srffrontuf')){
delete requestData.srffrontuf;
}
//补充工作流所需主键
requestData.srfkey = data.ibizbook;
//补充全量数据
requestData = this.fillNativeData(requestData);
return requestData;
}
/**
* 补充全量数据
*
* @param {*} [data]
* @memberof Gridexpbar_gridService
*/
public fillNativeData(data:any){
if(this.copynativeData && this.copynativeData.length >0){
let targetData:any = this.copynativeData.find((item:any) =>{
return item.ibizbookid === data.srfkey;
})
data = Object.assign(targetData,data);
return data;
}
}
/**
* 提交工作流
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @param {*} [localdata]
* @returns {Promise<any>}
* @memberof Gridexpbar_gridService
*/
@Errorlog
public submitbatch(action: string,context: any = {}, data: any,localdata:any,isloading?: boolean): Promise<any> {
let tempData:any = [];
if(data && data.length > 0){
data.forEach((item:any) => {
let data:any = this.handleWFData(item,true);
tempData.push(data);
});
}
context = this.handleRequestData(action,context,data,true).context;
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](context,tempData, localdata,isloading);
} else {
result = this.appEntityService.wfSubmitBatch(context,tempData,localdata,isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 设置远端数据
*
* @param result 远端请求结果
* @memberof Gridexpbar_gridService
*/
public setRemoteCopyData(result:any){
if (result && result.status === 200) {
this.remoteCopyData = Util.deepCopy(result.data);
}
}
/**
* 获取远端数据
*
* @memberof Gridexpbar_gridService
*/
public getRemoteCopyData(){
return this.remoteCopyData;
}
/**
* 设置备份原生数据
*
* @param data 远端请求结果
* @memberof Gridexpbar_gridService
*/
public setCopynativeData(data:any){
this.copynativeData = Util.deepCopy(data);
}
/**
* 获取备份原生数据
*
* @memberof Gridexpbar_gridService
*/
public getCopynativeData(){
return this.copynativeData;
}
}
\ No newline at end of file
.grid {
flex-grow: 1;
height: 100%;
overflow: auto;
.el-table__body-wrapper::-webkit-scrollbar {
/*滚动条整体样式*/
width : 10px !important; /*高宽分别对应横竖滚动条的尺寸*/
height: 10px !important;
}
.el-table__body-wrapper::-webkit-scrollbar-thumb {
/*滚动条颜色*/
border-radius : 10px !important;
background-color: #cecece !important;
}
.el-table__body-wrapper::-webkit-scrollbar-track {
/*滚动条里面轨道*/
box-shadow : inset 0 0 5px rgba(0, 0, 0, 0.2) !important;
background : #ededed !important;
border-radius: 10px !important;
}
/*表格文字过长省略*/
.el-table th>.cell, .el-table td>.cell{
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
word-break: break-all;
}
.el-table-column--selection .cell {
padding-left: 0px;
padding-right: 0px;
}
.app-column-link, .app-format-data{
display: inline;
}
.el-table {
height: 100%;
display:flex;
flex-direction: column;
justify-content: flex-start;
.el-table__row{
.grid-uiaction-divider {
padding:0 10px 0 10px;
border-left: 1px #b3b3b3 solid;
}
.grid-first-uiaction {
padding:0 10px 0 10px;
}
}
.quick-toolbar{
display: inline-block;
button{
background: #ebf3fb;
color: #2575ca;
border: 0;
}
}
.el-tooltip{
.ivu-form-item{
margin-bottom: unset !important;
}
}
.el-table__body .edit-cell{
padding:0;
.app-form-item{
margin-top: 20px;
margin-bottom: 20px;
}
}
.el-table__header-wrapper{
min-height: 45px;
max-height: 100px;
height: auto;
}
.el-table__footer-wrapper{
min-height: 45px;
max-height: 100px;
height: auto;
}
}
.grid-pagination {
height: 50px;
padding: 6px 0px;
.page-button {
button {
padding: 0;
font-size: 16px;
min-width: 32px;
height: 32px;
margin-right: 4px;
}
}
.page-column {
position: absolute;
left: 0;
}
.batch-toolbar{
position: absolute;
left: 105px;
>.toolbar-container{
button {
font-size: 16px;
min-width: 32px;
height: 32px;
margin-right: 4px;
margin-top: 0;
margin-bottom: 0;
}
}
}
}
}
.ivu-modal-content{
.footer{
.ivu-row{
text-align: right;
}
}
}
.cell-indeterminate {
>div>label {
>span {
.el-checkbox__inner {
background-color: #409eff;
border-color: #409eff;
}
.el-checkbox__inner:before {
content: "";
position: absolute;
display: block;
background-color: #fff;
height: 2px;
transform: scale(.5);
left: 0;
right: 0;
top: 5px;
}
}
>span.is-checked {
.el-checkbox__inner {
background-color: #409eff;
border-color: #409eff;
}
.el-checkbox__inner:after {
border: 0px;
}
}
}
}
.cell-select-all {
>div>label {
>span {
.el-checkbox__inner {
background-color: #409eff;
border-color: #409eff;
}
.el-checkbox__inner:after {
box-sizing: content-box;
content: "";
border: 1px solid #fff;
border-left: 0;
border-top: 0;
height: 7px;
left: 4px;
position: absolute;
top: 1px;
transform: rotate(45deg) scaleY(1);
width: 3px;
transition: transform .15s ease-in .05s;
transform-origin: center;
}
}
}
}
// this is less
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import Gridexpbar_gridBase from './gridexpbar-grid-grid-base.vue';
@Component({
components: {
}
})
export default class Gridexpbar_grid extends Gridexpbar_gridBase {
}
</script>
\ No newline at end of file
......@@ -15,6 +15,11 @@
<template slot="empty">
{{$t('entities.ibizbook.treetable_treegridex.nodata')}}
</template>
<el-table-column show-overflow-tooltip prop="subtext" label="图书描述" :width="50" :align="''">
<template v-slot="{ row }">
<span>{{ getColumnValue(row, 'subtext') }}</span>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="ibizbookname" label="图书名称" :width="50" :align="''">
<template v-slot="{ row }">
<span>{{ getColumnValue(row, 'ibizbookname') }}</span>
......@@ -25,11 +30,6 @@
<span>{{ getColumnValue(row, 'author') }}</span>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="subtext" label="图书描述" :width="50" :align="''">
<template v-slot="{ row }">
<span>{{ getColumnValue(row, 'subtext') }}</span>
</template>
</el-table-column>
</el-table>
</template>
......
<template>
<div class="app-data-chart">
<div v-show="isNoData" class="chart-no-data"><i class="el-icon-data-analysis"></i>{{$t('entities.ibizorder.usr_chart.nodata')}}</div>
<div v-show="!isNoData" class="app-charts" :id="chartId" style="height: 100%;padding: 6px 0;"></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 AppCenterService from "@service/app/app-center-service";
import IBIZOrderService from '@/service/ibizorder/ibizorder-service';
import UsrService from './usr-chart-service';
import IBIZOrderUIService from '@/uiservice/ibizorder/ibizorder-ui-service';
import echarts from 'echarts';
import moment from "moment";
import CodeListService from "@/codelist/codelist-service";
import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,ChartBarSeries,ChartRadarSeries} from '@/model/chart-detail';
@Component({
components: {
}
})
export default class UsrBase extends Vue implements ControlInterface {
/**
* 名称
*
* @type {string}
* @memberof UsrBase
*/
@Prop() public name?: string;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof UsrBase
*/
@Prop() public viewState!: Subject<ViewState>;
/**
* 应用上下文
*
* @type {*}
* @memberof UsrBase
*/
@Prop() public context!: any;
/**
* 视图参数
*
* @type {*}
* @memberof UsrBase
*/
@Prop() public viewparams!: any;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof UsrBase
*/
public viewStateEvent: Subscription | undefined;
/**
* 获取部件类型
*
* @returns {string}
* @memberof UsrBase
*/
public getControlType(): string {
return 'CHART'
}
/**
* 建构部件服务对象
*
* @type {UsrService}
* @memberof UsrBase
*/
public service: UsrService = new UsrService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {IBIZOrderService}
* @memberof UsrBase
*/
public appEntityService: IBIZOrderService = new IBIZOrderService({ $store: this.$store });
/**
* 转化数据
*
* @param {any} args
* @memberof UsrBase
*/
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 UsrBase
*/
public closeView(args: any): void {
let _this: any = this;
_this.$emit('closeview', [args]);
}
/**
* 计数器刷新
*
* @memberof UsrBase
*/
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();
}
})
}
}
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof UsrBase
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof UsrBase
*/
public getData(): any {
return null;
}
/**
* 显示处理提示
*
* @type {boolean}
* @memberof UsrBase
*/
@Prop({ default: true }) public showBusyIndicator!: boolean;
/**
* 部件行为--fetch
*
* @type {string}
* @memberof UsrBase
*/
@Prop() public fetchAction!: string;
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof UsrBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof UsrBase
*/
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.load(data);
}
if (Object.is('refresh', action)) {
this.refresh(data);
}
});
}
}
/**
* vue 生命周期
*
* @memberof UsrBase
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof UsrBase
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
}
/**
* 是否无数据
*
* @public
* @type {boolean}
* @memberof ChartBase
*/
public isNoData: boolean = false;
/**
* 图表div绑定的id
*
* @type {}
* @memberof ChartBase
*/
public chartId:string = this.$util.createUUID();
/**
* echarts图表对象
*
* @type {}
* @memberof ChartBase
*/
public myChart:any;
/**
* 代码表服务对象
*
* @type {CodeListService}
* @memberof ChartBase
*/
public codeListService:CodeListService = new CodeListService({ $store: this.$store });
/**
* 序列模型
*
* @type {}
* @memberof ChartBase
*/
public seriesModel:any = {
kline:!!!!模版产生代码错误:----
Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----
----
FTL stack trace ("~" means nesting-related):
- Failed at: ${item.getCatalogField()?lower_case} [in template "TEMPLCODE_en_US" at line 8, column 19]
----
};
/**
* 图表自定义参数集合
*
* @memberof ChartBase
*/
public chartUserParams:any ={
};
/**
* 图表基础动态模型
*
* @memberof ChartBase
*/
public chartBaseOPtion:any = {};
/**
* 图表绘制最终参数
*
* @memberof ChartBase
*/
public chartRenderOption:any = {};
/**
* 初始化图表所需参数
*
* @type {}
* @memberof ChartBase
*/
public chartOption:any = {
title:{
show:true ,
text:'图表(k线图)',
subtext:''
},
legend:{
show:true
},
grid:[
{
}
],
xAxis: [
{
gridIndex:0,
position:"bottom",
type:'category',
name:'分类',
}
],
yAxis:[
{
gridIndex:0,
position:"top",
type:'value',
name:'金额',
}
],
tooltip:{
show:true
},
dataset:[],
series:[
{
id:'kline',
name:'k线图',
type:'line',
xAxisIndex:0,
yAxisIndex:0,
datasetIndex:0,
encode: {
x: [],
y: []
}}
]
};
/**
* 刷新
*
* @param {*} [args={}]
* @memberof ChartBase
*/
public refresh(args?: any) {
this.load(args);
}
/**
* 获取图表数据
*
* @returns {*}
* @memberof ChartBase
*/
public load(opt?:any) {
let _this = this;
const arg: any = { ...opt };
const parentdata: any = {};
this.$emit('beforeload', parentdata);
Object.assign(arg, parentdata);
let tempViewParams:any = parentdata.viewparams?parentdata.viewparams:{};
Object.assign(tempViewParams,JSON.parse(JSON.stringify(this.viewparams)));
Object.assign(arg,{viewparams:tempViewParams});
Object.assign(arg,{page:0,size:1000});
Object.assign(arg,{sort: 'orderstate,asc'});
this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)),arg,this.showBusyIndicator).then((res) => {
if (res) {
this.transformToBasicChartSetData(res.data,(codelist:any) =>{_this.drawCharts(codelist)});
}
}).catch((error) => {
console.error(error);
});
}
/**
* 绘制图表
*
* @returns {*}
* @memberof ChartBase
*/
public drawCharts(codelist:any){
if(!this.myChart){
let element:any = document.getElementById(this.chartId);
this.myChart = echarts.init(element);
}
let _chartOption = this.handleChartOPtion(codelist);
this.chartRenderOption = {..._chartOption};
this.myChart.setOption(_chartOption);
this.myChart.resize();
}
/**
* 处理图表参数
*
* @memberof ChartBase
*/
public handleChartOPtion(allcodelist:any){
let _chartOption:any = JSON.parse(JSON.stringify(this.chartOption));
if(Object.keys(this.seriesModel).length > 0){
let tempDataSourceMap:Map<string,any> = new Map();
for(let i=0;i<Object.keys(this.seriesModel).length;i++){
Object.values(this.seriesModel).forEach((seriesvalue:any) =>{
if(seriesvalue.seriesIndex === i){
tempDataSourceMap.set(seriesvalue.name,seriesvalue.data);
}
})
}
if(tempDataSourceMap.size > 0){
tempDataSourceMap.forEach((item:any) =>{
_chartOption.dataset.push({'source':item});
})
}
Object.keys(this.seriesModel).forEach((seriesName:string) =>{
if(_chartOption && _chartOption.series.length > 0){
_chartOption.series.forEach((item:any) =>{
if(this.seriesModel[seriesName].ecxObject && Object.is(seriesName,item.id)){
item = Util.deepObjectMerge(item,this.seriesModel[seriesName].ecxObject);
}
if(this.seriesModel[seriesName].baseOption && Object.keys(this.seriesModel[seriesName].baseOption).length > 0 && Object.is(seriesName,item.id)){
item = Util.deepObjectMerge(item,this.seriesModel[seriesName].baseOption);
}
if(this.seriesModel[seriesName].ecObject && Object.is(seriesName,item.id)){
item = Util.deepObjectMerge(item,this.seriesModel[seriesName].ecObject);
}
})
}
//设置多序列
let tempSeries:any = this.seriesModel[seriesName];
// 非雷达图
if(tempSeries && tempSeries.seriesIdField && tempSeries.seriesValues.length > 0 && !Object.is(tempSeries.type,'radar')){
const returnIndex:number = _chartOption.series.findIndex((item:any) =>{
return Object.is(item.id,seriesName);
})
_chartOption.series.splice(returnIndex,1);
let tempSeriesArray:Array<any> = [];
tempSeries.seriesValues.forEach((seriesvalueItem:any) =>{
let tempSeriesTemp:any = JSON.parse(JSON.stringify(tempSeries.seriesTemp));
Object.assign(tempSeriesTemp,{name:tempSeries.seriesMap[seriesvalueItem],datasetIndex:tempSeries.seriesIndex,encode:{x:tempSeries.categorField,y:`${seriesvalueItem}`}});
_chartOption.series.push(tempSeriesTemp);
})
}
})
}
if(Object.keys(this.chartBaseOPtion).length > 0){
Object.assign(_chartOption,this.chartBaseOPtion);
}
if(Object.keys(this.chartUserParams).length >0){
Object.assign(_chartOption,this.chartUserParams);
}
return _chartOption;
}
/**
* 实体数据集转化为图表数据集
*
* 1.获取图表所有代码表值
* 2.查询集合映射图表数据集
* 3.补全图表数据集
* 4.图表数据集分组求和
* 5.排序图表数据集
*
* @param {*} data 实体数据集
* @param {Function} callback 回调
* @memberof ChartBase
*/
public async transformToBasicChartSetData(data:any,callback:Function){
if(!data || !Array.isArray(data) || data.length === 0){
this.isNoData = true;
return;
}
this.isNoData = false;
//获取代码表值
let allCodeList:any = await this.getChartAllCodeList();
if(Object.values(this.seriesModel).length > 0){
Object.values(this.seriesModel).forEach((singleSeries:any,index:number) =>{
// 值属性为srfcount设置{srfcount:1}到data
let valueField = singleSeries.dataSetFields.find((datasetField:any) =>{
return datasetField.name === singleSeries.valueField;
});
if(valueField && valueField.name && Object.is(valueField.name,"srfcount")){
data.forEach((singleData:any) =>{
Object.assign(singleData,{srfcount:1});
})
}
// 分组属性
let groupField = singleSeries.dataSetFields.find((datasetField:any) =>{
return datasetField.name === singleSeries.categorField;
});
let tempChartSetData:Array<any> = [];
let tempSeriesValues:Map<string,any> = new Map();
data.forEach((item:any) =>{
let tempChartSetDataItem:any = {};
// 序列属性不存在
if(!singleSeries.seriesIdField){
Object.assign(tempChartSetDataItem,{name:singleSeries.name});
if(singleSeries.dataSetFields && singleSeries.dataSetFields.length >0){
singleSeries.dataSetFields.forEach((singleDataSetField:any) =>{
this.handleSingleDataSetField(item,singleDataSetField,allCodeList,tempChartSetDataItem,groupField);
})
}
}else{
// 序列属性存在时
// 序列代码表存在时,翻译tempSeriesValues的键值对
if(singleSeries.seriesCodeList){
const seriesCodeList:Map<string,any> = allCodeList.get(singleSeries.seriesCodeList.tag);
let tempSeriesValueItem = tempSeriesValues.get(seriesCodeList.get(item[singleSeries.seriesIdField]));
if(!tempSeriesValueItem){
tempSeriesValues.set(seriesCodeList.get(item[singleSeries.seriesIdField]),seriesCodeList.get(item[singleSeries.seriesIdField]));
}
}else{
let tempSeriesValueItem = tempSeriesValues.get(item[singleSeries.seriesIdField]);
if(!tempSeriesValueItem){
tempSeriesValues.set(item[singleSeries.seriesIdField],item[singleSeries.seriesNameField]);
}
}
Object.assign(tempChartSetDataItem,{name:item[singleSeries.seriesIdField]});
if(singleSeries.dataSetFields && singleSeries.dataSetFields.length >0){
singleSeries.dataSetFields.forEach((singleDataSetField:any) =>{
this.handleSingleDataSetField(item,singleDataSetField,allCodeList,tempChartSetDataItem,groupField);
})
}
}
tempChartSetData.push(tempChartSetDataItem);
})
// 补全数据集合
this.completeDataSet(tempChartSetData,singleSeries,allCodeList);
// 序列代码表存在时,补全序列
if(singleSeries.seriesCodeList){
const seriesCodeList:Map<string,any> = allCodeList.get(singleSeries.seriesCodeList.tag);
tempSeriesValues = new Map();
seriesCodeList.forEach((item:any) =>{
tempSeriesValues.set(item,item);
})
}
singleSeries.seriesValues = [...tempSeriesValues.keys()];
let tempSeriesMapObj:any = {};
tempSeriesValues.forEach((value:any,key:any) =>{
tempSeriesMapObj[key] = value;
})
singleSeries.seriesMap = tempSeriesMapObj;
let callbackFunction:any = (index === (Object.values(this.seriesModel).length - 1))?callback:null;
this.transformToChartSeriesDataSet(tempChartSetData,singleSeries,callbackFunction,allCodeList);
})
}
}
/**
* 构建图表序列数据集合
*
* 1.分组求和
* 2.排序求和数组
*
* @param {Array<any>} data 传入数据
* @param {Array<any>} item 单个序列
* @param {Array<any>} callback 回调
* @param {*} allCodeList 所有代码表
*
* @memberof ChartBase
*/
public transformToChartSeriesDataSet(data:any,item:any,callback:Function,allCodeList:any):any{
if(item.seriesIdField){
// 多序列
let groupField = item.dataSetFields.filter((datasetField:any) =>{
return datasetField.name === item.categorField;
});
let tempGroupField:Array<any> = groupField.map((item:any) =>{
return item.name;
});
let seriesField = item.dataSetFields.filter((datasetField:any) =>{
return datasetField.name === item.seriesIdField;
});
let tempSeriesField:Array<any> = seriesField.map((item:any) =>{
return item.name;
});
let valueField = item.dataSetFields.filter((datasetField:any) =>{
return datasetField.name === item.valueField;
});
let tempValueField:Array<any> = valueField.map((item:any) =>{
return item.name;
});
item.data = this.groupAndAdd(tempGroupField,tempSeriesField,tempValueField,data,item,groupField,allCodeList);
}else{
//单序列
let groupField = item.dataSetFields.filter((datasetField:any) =>{
return datasetField.name === item.categorField;
});
let tempGroupField:Array<any> = groupField.map((item:any) =>{
return item.name;
})
let valueField = item.dataSetFields.filter((datasetField:any) =>{
return datasetField.name === item.valueField;
});
let tempValueField:Array<any> = valueField.map((item:any) =>{
return item.name;
})
item.data = this.groupAndAdd(tempGroupField,[],tempValueField,data,item,groupField,allCodeList);
}
if(callback && callback instanceof Function){
callback(allCodeList);
}
}
/**
* 分组和求和
* @param {Array<any>} groupField 分组属性
* @param {Array<any>} groupField 值属性
* @param {Array<any>} data 传入数据
* @param {*} groupFieldModel 分组属性模型
* @param {*} allCodeList 所有代码表
*
* @memberof ChartBase
*/
public groupAndAdd(groupField:Array<any>,seriesField:Array<any>,valueField:Array<any>,data:any,item:any,groupFieldModel:any,allCodeList:any){
let tempMap:Map<string,any> = new Map();
let groupMode:string = groupFieldModel[0].groupMode;
let groupKeyStr:string = "";
data.forEach((item:any) =>{
let tempGroupField:string = groupField[0];
groupKeyStr = item[tempGroupField];
let tempMapItem:any = tempMap.get(groupKeyStr);
if(tempMapItem){
tempMapItem.push(item);
tempMap.set(groupKeyStr,tempMapItem);
}else{
tempMap.set(groupKeyStr,[item]);
}
})
// 处理多序列
if(seriesField.length > 0 && tempMap.size > 0){
let tempSeriesField:string = seriesField[0];
tempMap.forEach((item:any,key:string) =>{
let tempItemMap:Map<string,any> = new Map();
item.forEach((singleItem:any)=>{
let seriesValueArray:any = tempItemMap.get(singleItem[tempSeriesField]);
if(seriesValueArray){
seriesValueArray.push(singleItem);
tempItemMap.set(singleItem[tempSeriesField],seriesValueArray);
}else{
tempItemMap.set(singleItem[tempSeriesField],[singleItem]);
}
})
tempMap.set(key,tempItemMap);
});
}
let returnArray:Array<any> = [];
if(seriesField.length == 0){
//单序列
tempMap.forEach((tempItem:any) =>{
if(tempItem.length >0){
let curObject:any = {};
let valueResult:number = 0;
let categorResult:any;
tempItem.forEach((singleItem:any) =>{
categorResult = singleItem[groupField[0]];
valueResult += singleItem[valueField[0]];
})
Object.defineProperty(curObject, groupField[0], {
value: categorResult,
writable : true,
enumerable : true,
configurable : true
});
Object.defineProperty(curObject, valueField[0], {
value: valueResult,
writable : true,
enumerable : true,
configurable : true
});
returnArray.push(curObject);
}
})
}else{
// 多序列
let seriesValuesArray:Array<any> = item.seriesValues;
tempMap.forEach((groupItem:any,groupKey:string) =>{
//求和
let curObject:any = {};
Object.defineProperty(curObject, groupField[0], {
value: groupKey,
writable : true,
enumerable : true,
configurable : true
});
seriesValuesArray.forEach((seriesValueItem:any) =>{
Object.defineProperty(curObject, seriesValueItem, {
value: 0,
writable : true,
enumerable : true,
configurable : true
});
});
groupItem.forEach((seriesItem:any,seriesKey:string) =>{
let seriesNum:number = 0;
seriesItem.forEach((dataItem:any) =>{
seriesNum += dataItem[valueField[0]];
})
curObject[seriesKey] = seriesNum;
})
returnArray.push(curObject);
})
}
// 补全空白分类
if(returnArray.length >0){
let emptyText = (groupFieldModel[0] && groupFieldModel[0].codeList)?groupFieldModel[0].codeList.emptytext:(this.$t('app.chart.undefined') as string);
returnArray.forEach((item:any) =>{
if(!item[groupField[0]]){
item[groupField[0]] = emptyText;
}
})
}
returnArray = this.sortReturnArray(returnArray,groupFieldModel,allCodeList);
// 雷达图数据格式处理
if(Object.is(item.type,'radar') && returnArray.length >0){
let tempReturnArray:Array<any> = [];
let seriesValues:Array<any> = item.seriesValues;
if(seriesValues && seriesValues.length >0){
seriesValues.forEach((singleSeriesName:any) =>{
let singleSeriesObj:any = {};
returnArray.forEach((item:any) =>{
Object.assign(singleSeriesObj,{[item[groupField[0]]]:item[singleSeriesName]});
})
Object.assign(singleSeriesObj,{type:singleSeriesName});
tempReturnArray.push(singleSeriesObj);
})
}
returnArray = tempReturnArray;
}
console.log(JSON.stringify(returnArray));
return returnArray;
}
/**
* 排序数组
*
* @param {Array<any>} arr 传入数组
* @param {*} groupField 分组属性
* @param {*} allCodeList 所有代码表
*
* @memberof ChartBase
*/
public sortReturnArray(arr:Array<any>,groupField:any,allCodeList:any){
let returnArray:Array<any> = [];
// todo
// 分组属性有代码表的情况(最后执行)
if(groupField[0].codelist){
let curCodeList:Map<number,any> = allCodeList.get(groupField[0].codelist.tag);
curCodeList.forEach((codelist:any) =>{
arr.forEach((item:any) =>{
if(Object.is(item[groupField[0].name],codelist)){
returnArray.push(item);
item.hasused = true;
}
})
})
arr.forEach((item:any,index:number) =>{
if(!item.hasused){
returnArray.push(item);
}
})
returnArray.forEach((item:any) =>{
delete item.hasused;
})
}else{
// 分组为年份
if(Object.is(groupField[0].groupMode,"YEAR")){
returnArray = arr.sort((a:any, b:any) => {
return Number(a[groupField[0].name]) - Number(b[groupField[0].name]);
});
}else if(Object.is(groupField[0].groupMode,"QUARTER")){
returnArray = this.handleSortGroupData(arr,groupField,(this.$t('app.chart.quarter') as string));
}else if(Object.is(groupField[0].groupMode,"MONTH")){
returnArray = this.handleSortGroupData(arr,groupField,(this.$t('app.calendar.month') as string));
}else if(Object.is(groupField[0].groupMode,"YEARWEEK")){
returnArray = this.handleSortGroupData(arr,groupField,(this.$t('app.calendar.week') as string));
}else if(Object.is(groupField[0].groupMode,"DAY")){
returnArray = arr.sort((a:any, b:any) => {
return moment(a[groupField[0].name]).unix() - moment(b[groupField[0].name]).unix();
});
}else{
let groupFieldName:string = groupField[0].name;
let isConvert:boolean = true;
arr.forEach((item:any) =>{
if(isNaN(item[groupFieldName])){
isConvert = false;
}
})
if(isConvert){
returnArray = arr.sort((a:any, b:any) => {
return a[groupFieldName] - b[groupFieldName];
});
}else{
returnArray = arr;
}
}
}
return returnArray;
}
/**
* 排序分组模式下的数据
*
* @param {Array<any>} arr 传入数据
* @param {Array<any>} groupField 分组属性
* @param {Array<any>} label label标签
*
* @memberof ChartBase
*/
public handleSortGroupData(arr:Array<any>,groupField:any,label:string){
arr.forEach((item:any) =>{
let sortFieldValue:Array<any> = item[groupField[0].name].split("-");
Object.assign(item,{sortField:Number(sortFieldValue[0])*10000+Number(sortFieldValue[1])});
/**
* @judgment 分组为月份时,月份+1 start
* @author mos
* @date 2020.07.20
*/
if(Object.is(label, "月")) {
item[groupField[0].name] = sortFieldValue[0]+(this.$t('app.chart.year') as string)+(Number(sortFieldValue[1])+1)+label;
} else {
item[groupField[0].name] = sortFieldValue[0]+(this.$t('app.chart.year') as string)+sortFieldValue[1]+label;
}
// @judgment 分组为月份时,月份+1 end
})
arr.sort((a:any, b:any) => {
return Number(a.sortField) - Number(b.sortField);
});
arr.forEach((item:any) =>{
delete item.sortField;
})
return arr;
}
/**
* 补全数据集
*
* @param {Array<any>} data 传入数据
* @param {Array<any>} item 单个序列
* @param {Array<any>} allCodeList 所有的代码表
*
* @memberof ChartBase
*/
public completeDataSet(data:any,item:any,allCodeList:any){
// 分组属性
let groupField = item.dataSetFields.find((datasetField:any) =>{
return datasetField.name === item.categorField;
});
if(Object.is(groupField.groupMode,"")){
return;
}
//分组模式为代码表(补值)
if(Object.is(groupField.groupMode,'CODELIST')){
this.completeCodeList(data,item,allCodeList);
}
//分组模式为年/季度/月份(最大值,最小值,分组,补值)
if(Object.is(groupField.groupMode,"YEAR") || Object.is(groupField.groupMode,"QUARTER") || Object.is(groupField.groupMode,"MONTH") || Object.is(groupField.groupMode,"YEARWEEK") || Object.is(groupField.groupMode,"DAY")){
this.handleTimeData(data,item,allCodeList,groupField);
}
}
/**
* 获取最大值最小值
*
* @param {Array<any>} tempTimeArray 传入数据
*
* @memberof ChartBase
*/
public getRangeData(tempTimeArray:Array<any>){
tempTimeArray.forEach((item:any) =>{
let tempParams:Array<any> = item._i.split("-");
item.sortField = Number(tempParams[0] + tempParams[1]);
})
tempTimeArray.sort((a:any, b:any) => {
return Number(a.sortField) - Number(b.sortField);
});
tempTimeArray.forEach((item:any) =>{
delete item.sortField;
})
return tempTimeArray;
}
/**
* 补全时间类型数据集
*
* @param {Array<any>} data 传入数据
* @param {Array<any>} item 单个序列
* @param {Array<any>} allCodeList 所有的代码表
* @param {Array<any>} groupField 分组属性
*
* @memberof ChartBase
*/
public handleTimeData(data:any,item:any,allCodeList:any,groupField:any){
let valueField = item.dataSetFields.find((datasetField:any) =>{
return datasetField.name === item.valueField;
});
let groupMode:string = groupField.groupMode;
// 排序数据,找到最大值、最小值
let tempTimeArray:Array<any> = [];
if(data && data.length >0){
data.forEach((dataItem:any) =>{
// 判断时间类型是否为空,为空不处理
if(dataItem[groupField.name]){
tempTimeArray.push(moment(dataItem[groupField.name]));
}
})
}
let maxTime:any;
let minTime:any;
if(Object.is(groupMode,"YEAR") || Object.is(groupMode,"DAY")){
maxTime = moment.max(tempTimeArray);
minTime = moment.min(tempTimeArray);
}
if(Object.is(groupMode,"QUARTER")){
tempTimeArray = this.getRangeData(tempTimeArray);
minTime = moment().year((tempTimeArray[0]._i.split("-"))[0]).quarters((tempTimeArray[0]._i.split("-"))[1]);
maxTime = moment().year((tempTimeArray[tempTimeArray.length - 1]._i.split("-"))[0]).quarters((tempTimeArray[tempTimeArray.length - 1]._i.split("-"))[1]);
}
if(Object.is(groupMode,"MONTH")){
tempTimeArray = this.getRangeData(tempTimeArray);
minTime = moment().year((tempTimeArray[0]._i.split("-"))[0]).month((tempTimeArray[0]._i.split("-"))[1]);
maxTime = moment().year((tempTimeArray[tempTimeArray.length - 1]._i.split("-"))[0]).month((tempTimeArray[tempTimeArray.length - 1]._i.split("-"))[1]);
}
if(Object.is(groupMode,"YEARWEEK")){
tempTimeArray = this.getRangeData(tempTimeArray);
minTime = moment().year((tempTimeArray[0]._i.split("-"))[0]).week((tempTimeArray[0]._i.split("-"))[1]);
maxTime = moment().year((tempTimeArray[tempTimeArray.length - 1]._i.split("-"))[0]).week((tempTimeArray[tempTimeArray.length - 1]._i.split("-"))[1]);
}
let timeFragmentArray:Array<any> = [];
let tempGrounpData:Map<string,any> = new Map();
// 时间分段
//groupMode为"YEAR"
if(Object.is(groupMode,"YEAR")){
let curTime:any = minTime;
while(curTime){
if(curTime.isSameOrBefore(maxTime)){
let tempcurTime:any = curTime.clone();
timeFragmentArray.push(tempcurTime.year().toString());
curTime = tempcurTime.clone().add(1, 'years');
}else{
curTime = null;
}
}
}
//groupMode为"QUARTER"
if(Object.is(groupMode,"QUARTER")){
let curTime:any = minTime;
while(curTime){
if(curTime.isSameOrBefore(maxTime)){
let tempcurTime:any = curTime.clone();
timeFragmentArray.push(tempcurTime.year().toString()+"-"+tempcurTime.quarter().toString());
curTime = tempcurTime.clone().add(1, 'quarters');
}else{
curTime = null;
}
}
}
//groupMode为"MONTH"
if(Object.is(groupMode,"MONTH")){
let curTime:any = minTime;
while(curTime){
if(curTime.isSameOrBefore(maxTime)){
let tempcurTime:any = curTime.clone();
timeFragmentArray.push(tempcurTime.year().toString()+"-"+tempcurTime.month().toString());
curTime = tempcurTime.clone().add(1, 'months');
}else{
curTime = null;
}
}
}
//groupMode为"YEARWEEK"
if(Object.is(groupMode,"YEARWEEK")){
let curTime:any = minTime;
while(curTime){
if(curTime.isSameOrBefore(maxTime)){
let tempcurTime:any = curTime.clone();
timeFragmentArray.push(tempcurTime.year().toString()+"-"+tempcurTime.week().toString());
curTime = tempcurTime.clone().add(1, 'weeks');
}else{
curTime = null;
}
}
}
//groupMode为"DAY"
if(Object.is(groupMode,"DAY")){
let curTime:any = minTime;
while(curTime){
if(curTime.isSameOrBefore(maxTime)){
let tempcurTime:any = curTime.clone();
timeFragmentArray.push(tempcurTime.format('YYYY-MM-DD'));
curTime = tempcurTime.clone().add(1, 'days');
}else{
curTime = null;
}
}
}
data.forEach((item:any) =>{
let tempKeyStr:string = item[groupField.name];
let tempGrounpItem:any = tempGrounpData.get(tempKeyStr);
if(!tempGrounpItem){
tempGrounpData.set(tempKeyStr,item);
}
})
timeFragmentArray.forEach((timeFragment:any) =>{
if(!tempGrounpData.get(timeFragment)){
let copyTemp:any = JSON.parse(JSON.stringify(data[0]));
let curObj:any = {};
curObj[groupField.name] = timeFragment;
curObj[valueField.name] = 0;
Object.assign(copyTemp,curObj);
data.push(copyTemp);
}
})
}
/**
* 补全代码表
*
* @param {Array<any>} data 传入数据
* @param {Array<any>} item 单个序列
* @param {Array<any>} allCodeList 所有的代码表
*
* @memberof ChartBase
*/
public completeCodeList(data:any,item:any,allCodeList:any){
let groupField = item.dataSetFields.find((datasetField:any) =>{
return datasetField.name === item.categorField;
});
if(!groupField.codelist){
return;
}
let valueField = item.dataSetFields.find((datasetField:any) =>{
return datasetField.name === item.valueField;
});
let curCodeList:Map<number,any> = allCodeList.get(groupField.codelist.tag);
// 对分类实现分组
let tempGrounpData:Map<string,any> = new Map();
data.forEach((item:any) =>{
let tempGrounpItem:any = tempGrounpData.get(item[groupField.name+'_srfvalue']);
if(!tempGrounpItem){
tempGrounpData.set(item[groupField.name+'_srfvalue'],item);
}
})
if(curCodeList.size !== tempGrounpData.size){
curCodeList.forEach((text:any,value:any) =>{
if(!tempGrounpData.get(value)){
let copyTemp:any = JSON.parse(JSON.stringify(data[0]));
let curObj:any = {};
curObj[groupField.name+'_srfvalue'] = value;
curObj[groupField.name] = text;
curObj[valueField.name] = 0;
Object.assign(copyTemp,curObj);
data.push(copyTemp);
}
})
}
}
/**
* 处理单个属性
*
* @param {*} input 输入值
* @param {*} field 属性值
* @param {*} allCodeList 所有代码表
* @param {*} result 结果值
*
* @memberof ChartBase
*/
public handleSingleDataSetField(input:any,field:any,allCodeList:any,result:any,groupField:any){
let tempFieldObj:any = {};
//存在代码表的情况(自动转化值)
if(field.codelist){
//获取代码表
let curCodeList:Map<number,any> = allCodeList.get(field.codelist.tag);
tempFieldObj[field.name] = curCodeList.get(input[field.name]);
tempFieldObj[field.name+'_srfvalue'] = input[field.name];
}else{
// 不存在代码表的情况
if(groupField && Object.is(groupField.name,field.name)){
if(Object.is(groupField.groupMode,"YEAR") ){
tempFieldObj[field.name] = moment(input[field.name]).year().toString();
}else if(Object.is(groupField.groupMode,"QUARTER") ){
tempFieldObj[field.name] = moment(input[field.name]).year().toString()+"-"+moment(input[field.name]).quarters().toString();
}else if(Object.is(groupField.groupMode,"MONTH") ){
tempFieldObj[field.name] = moment(input[field.name]).year().toString()+"-"+moment(input[field.name]).month().toString();
}else if(Object.is(groupField.groupMode,"YEARWEEK") ){
tempFieldObj[field.name] = moment(input[field.name]).year().toString()+"-"+moment(input[field.name]).week().toString();
}else if(Object.is(groupField.groupMode,"DAY") ){
tempFieldObj[field.name] = moment(input[field.name]).format("YYYY-MM-DD");
}else{
tempFieldObj[field.name] = input[field.name];
}
}else{
tempFieldObj[field.name] = input[field.name]
}
}
Object.assign(result,tempFieldObj);
}
/**
* 获取图表所需代码表
*
* @memberof ChartBase
*/
public getChartAllCodeList():Promise<any>{
return new Promise((resolve:any,reject:any) =>{
let codeListMap:Map<string,any> = new Map();
if(Object.values(this.seriesModel).length >0){
let tempFlag:boolean = true;
Object.values(this.seriesModel).forEach((singleSeries:any) =>{
if(singleSeries.dataSetFields && singleSeries.dataSetFields.length >0){
let promiseArray:Array<any> = [];
let promiseKeyArray:Array<any> = [];
singleSeries.dataSetFields.forEach((singleDataSetField:any,index:any) =>{
if(singleDataSetField.codelist){
tempFlag = false;
if(!codeListMap.get(singleDataSetField.codelist.tag)){
promiseArray.push(this.getCodeList(singleDataSetField.codelist));
promiseKeyArray.push(singleDataSetField.codelist.tag);
Promise.all(promiseArray).then((result:any) =>{
if(result && result.length >0){
result.forEach((codeList:any) =>{
let tempCodeListMap:Map<number,any> = new Map();
if(codeList.length >0){
codeList.forEach((codeListItem:any) =>{
tempCodeListMap.set(codeListItem.value,codeListItem.text);
})
}
codeListMap.set(singleDataSetField.codelist.tag,tempCodeListMap);
})
resolve(codeListMap);
}
})
}
}
})
}
})
if(tempFlag){resolve(codeListMap);}
}else{
resolve(codeListMap);
}
})
}
/**
* 获取代码表
*
* @returns {Promise<any>}
* @memberof ChartBase
*/
public getCodeList(codeListObject:any):Promise<any>{
return new Promise((resolve:any,reject:any) =>{
if(codeListObject.tag && Object.is(codeListObject.type,"STATIC")){
const codelist = this.$store.getters.getCodeList(codeListObject.tag);
if (codelist) {
resolve([...JSON.parse(JSON.stringify(codelist.items))]);
} else {
console.log(`----${codeListObject.tag}----代码表不存在`);
}
}else if(codeListObject.tag && Object.is(codeListObject.type,"DYNAMIC")){
this.codeListService.getItems(codeListObject.tag).then((res:any) => {
resolve(res);
}).catch((error:any) => {
console.log(`----${codeListObject.tag}----代码表不存在`);
});
}
})
}
}
</script>
<style lang='less'>
@import './usr-chart.less';
</style>
\ No newline at end of file
/**
* Usr 部件模型
*
* @export
* @class UsrModel
*/
export default class UsrModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof UsrChartMode
*/
public getDataItems(): any[] {
return [
{
name:'size',
prop:'size'
},
{
name:'query',
prop:'query'
},
{
name:'page',
prop:'page'
},
{
name:'sort',
prop:'sort'
}
]
}
}
\ No newline at end of file
import { Http,Util,Errorlog } from '@/utils';
import ControlService from '@/widgets/control-service';
import IBIZOrderService from '@/service/ibizorder/ibizorder-service';
import UsrModel from './usr-chart-model';
/**
* Usr 部件服务对象
*
* @export
* @class UsrService
*/
export default class UsrService extends ControlService {
/**
* 订单服务对象
*
* @type {IBIZOrderService}
* @memberof UsrService
*/
public appEntityService: IBIZOrderService = new IBIZOrderService({ $store: this.getStore() });
/**
* 设置从数据模式
*
* @type {boolean}
* @memberof UsrService
*/
public setTempMode(){
this.isTempMode = false;
}
/**
* Creates an instance of UsrService.
*
* @param {*} [opts={}]
* @memberof UsrService
*/
constructor(opts: any = {}) {
super(opts);
this.model = new UsrModel();
}
/**
* 查询数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof UsrService
*/
@Errorlog
public search(action: string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true);
return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService;
let result: Promise<any>;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
}else{
result =_appEntityService.FetchDefault(Context,Data, isloading);
}
result.then((response) => {
resolve(response);
}).catch(response => {
reject(response);
});
});
}
}
\ No newline at end of file
// this is less
.app-data-chart {
width: 100%;
height: 100%;
.chart-no-data{
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
i{
margin-right: 5px;
}
}
}
\ No newline at end of file
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import UsrBase from './usr-chart-base.vue';
@Component({
components: {
}
})
export default class Usr extends UsrBase {
}
</script>
\ No newline at end of file
......@@ -326,7 +326,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":"menuitem151" , "name":"自定义扩展编辑器" }]},{ "id":"menuitem4" , "name":"部件" , "items":[{ "id":"menuitem101" , "name":"实体看板" , "items":[{ "id":"menuitem102" , "name":"内置功能" },{ "id":"menuitem104" , "name":"代码表分组" },{ "id":"menuitem105" , "name":"项布局面板" }]},{ "id":"menuitem18" , "name":"界面行为" , "items":[{ "id":"menuitem65" , "name":"前端界面行为" },{ "id":"menuitem66" , "name":"后台界面行为" }]},{ "id":"menuitem129" , "name":"选项操作" , "items":[{ "id":"menuitem131" , "name":"表格选项操作" }]},{ "id":"menuitem142" , "name":"选择视图" , "items":[{ "id":"menuitem130" , "name":"索引关系选择视图" },{ "id":"menuitem145" , "name":"选择视图" }]},{ "id":"menuitem112" , "name":"应用类" , "items":[{ "id":"menuitem125" , "name":"数据看板" , "items":[{ "id":"menuitem126" , "name":"实体数据看板" }]}]},{ "id":"menuitem156" , "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":"menuitem121" , "name":"多编辑视图" , "items":[{ "id":"menuitem115" , "name":"多表单(行记录)" },{ "id":"menuitem123" , "name":"多表单(上分页)" }]},{ "id":"menuitem16" , "name":"搜索表单" }]},{ "id":"menuitem157" , "name":"导航类" , "items":[{ "id":"menuitem122" , "name":"数据关系栏" , "items":[{ "id":"menuitem116" , "name":"编辑视图(左右关系)" },{ "id":"menuitem117" , "name":"编辑视图(上下关系)" },{ "id":"menuitem118" , "name":"编辑视图(分页关系)" }]},{ "id":"menuitem120" , "name":"分页导航" },{ "id":"menuitem128" , "name":"表格导航" },{ "id":"menuitem136" , "name":"树导航" },{ "id":"menuitem137" , "name":"卡片导航" },{ "id":"menuitem139" , "name":"时间轴导航" },{ "id":"menuitem114" , "name":"列表导航" },{ "id":"menuitem138" , "name":"日历导航" }]},{ "id":"menuitem158" , "name":"面板类" , "items":[{ "id":"menuitem17" , "name":"向导面板" , "items":[{ "id":"menuitem134" , "name":"基础用法" },{ "id":"menuitem135" , "name":"状态属性" }]}]},{ "id":"menuitem119" , "name":"多数据类" , "items":[{ "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":"menuitem132" , "name":"表格列更新" },{ "id":"menuitem133" , "name":"表格列重置" },{ "id":"menuitem78" , "name":"自动分组" },{ "id":"menuitem80" , "name":"代码表分组" },{ "id":"menuitem81" , "name":"当前页聚合" },{ "id":"menuitem82" , "name":"远程聚合" }]},{ "id":"menuitem95" , "name":"日历" , "items":[{ "id":"menuitem96" , "name":"内置功能" },{ "id":"menuitem97" , "name":"时间轴样式" },{ "id":"menuitem109" , "name":"项布局面板" },{ "id":"menuitem64" , "name":"自定义插件" }]},{ "id":"menuitem148" , "name":"应用看板视图" },{ "id":"menuitem110" , "name":"树表格" },{ "id":"menuitem111" , "name":"甘特图" },{ "id":"menuitem87" , "name":"数据视图" , "items":[{ "id":"menuitem88" , "name":"内置功能" },{ "id":"menuitem89" , "name":"自动分组" },{ "id":"menuitem90" , "name":"代码表分组" },{ "id":"menuitem94" , "name":"项布局面板" },{ "id":"menuitem152" , "name":"自定义插件" }]},{ "id":"menuitem14" , "name":"树视图" , "items":[{ "id":"menuitem60" , "name":"静态节点" },{ "id":"menuitem61" , "name":"动态节点(代码表)" },{ "id":"menuitem62" , "name":"动态节点(实体)" },{ "id":"menuitem63" , "name":"右键操作" }]},{ "id":"menuitem37" , "name":"图表" , "items":[{ "id":"menuitem38" , "name":"柱状图" },{ "id":"menuitem39" , "name":"折线图" },{ "id":"menuitem40" , "name":"饼图" },{ "id":"menuitem41" , "name":"区域图" },{ "id":"menuitem42" , "name":"雷达图" }]},{ "id":"menuitem83" , "name":"列表" , "items":[{ "id":"menuitem84" , "name":"内置功能" },{ "id":"menuitem85" , "name":"自动分组" },{ "id":"menuitem86" , "name":"代码表分组" },{ "id":"menuitem91" , "name":"项布局面板" },{ "id":"menuitem143" , "name":"自定义插件" }]}]},{ "id":"menuitem159" , "name":"其他类" }]},{ "id":"menuitem5" , "name":"视图" , "items":[{ "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":"menuitem140" , "name":"单数据视图" , "items":[{ "id":"menuitem8" , "name":"编辑视图" , "items":[{ "id":"menuitem22" , "name":"常规编辑视图" },{ "id":"menuitem23" , "name":"左右编辑视图" },{ "id":"menuitem24" , "name":"分页编辑视图" },{ "id":"menuitem25" , "name":"嵌入编辑视图" }]},{ "id":"menuitem161" , "name":"实体向导视图" },{ "id":"menuitem162" , "name":"实体编辑视图(分页关系)" },{ "id":"menuitem163" , "name":"实体编辑视图(上下关系)" },{ "id":"menuitem164" , "name":"实体编辑视图(左右关系)" },{ "id":"menuitem165" , "name":"实体分页导航视图" },{ "id":"menuitem166" , "name":"实体数据看板视图" },{ "id":"menuitem167" , "name":"实体选项操作视图" }]},{ "id":"menuitem141" , "name":"多数据视图" , "items":[{ "id":"menuitem9" , "name":"列表视图" , "items":[{ "id":"menuitem21" , "name":"左右表格视图" },{ "id":"menuitem20" , "name":"嵌入表格视图" }]},{ "id":"menuitem79" , "name":"表格视图" , "items":[{ "id":"menuitem19" , "name":"常规表格视图" }]},{ "id":"menuitem168" , "name":"实体多表单编辑视图" },{ "id":"menuitem169" , "name":"实体甘特视图" },{ "id":"menuitem170" , "name":"实体日历视图" }]}]},{ "id":"menuitem69" , "name":"工作流" },{ "id":"menuitem153" , "name":"逻辑" , "items":[{ "id":"menuitem154" , "name":"应用功能" , "items":[{ "id":"menuitem127" , "name":"打开应用视图" },{ "id":"menuitem147" , "name":"打开HTML页面" },{ "id":"menuitem160" , "name":"执行JavaScript" }]},{ "id":"menuitem155" , "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数据补充" },{ "id":"menuitem144" , "name":"客户实体示例数据补充" },{ "id":"menuitem146" , "name":"应用视图数据补充" },{ "id":"menuitem149" , "name":"应用部件数据补充" },{ "id":"menuitem150" , "name":"编辑器数据补充" }]}] }]
"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":"menuitem151" , "name":"自定义扩展编辑器" }]},{ "id":"menuitem4" , "name":"部件" , "items":[{ "id":"menuitem101" , "name":"实体看板" , "items":[{ "id":"menuitem102" , "name":"内置功能" },{ "id":"menuitem104" , "name":"代码表分组" },{ "id":"menuitem105" , "name":"项布局面板" }]},{ "id":"menuitem18" , "name":"界面行为" , "items":[{ "id":"menuitem65" , "name":"前端界面行为" },{ "id":"menuitem66" , "name":"后台界面行为" }]},{ "id":"menuitem129" , "name":"选项操作" , "items":[{ "id":"menuitem131" , "name":"表格选项操作" }]},{ "id":"menuitem142" , "name":"选择视图" , "items":[{ "id":"menuitem130" , "name":"索引关系选择视图" },{ "id":"menuitem145" , "name":"选择视图" }]},{ "id":"menuitem112" , "name":"应用类" , "items":[{ "id":"menuitem125" , "name":"数据看板" , "items":[{ "id":"menuitem126" , "name":"实体数据看板" }]}]},{ "id":"menuitem156" , "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":"menuitem121" , "name":"多编辑视图" , "items":[{ "id":"menuitem115" , "name":"多表单(行记录)" },{ "id":"menuitem123" , "name":"多表单(上分页)" }]},{ "id":"menuitem16" , "name":"搜索表单" }]},{ "id":"menuitem157" , "name":"导航类" , "items":[{ "id":"menuitem122" , "name":"数据关系栏" , "items":[{ "id":"menuitem116" , "name":"编辑视图(左右关系)" },{ "id":"menuitem117" , "name":"编辑视图(上下关系)" },{ "id":"menuitem118" , "name":"编辑视图(分页关系)" }]},{ "id":"menuitem120" , "name":"分页导航" },{ "id":"menuitem128" , "name":"表格导航" },{ "id":"menuitem136" , "name":"树导航" },{ "id":"menuitem137" , "name":"卡片导航" },{ "id":"menuitem139" , "name":"时间轴导航" },{ "id":"menuitem114" , "name":"列表导航" },{ "id":"menuitem138" , "name":"日历导航" }]},{ "id":"menuitem158" , "name":"面板类" , "items":[{ "id":"menuitem17" , "name":"向导面板" , "items":[{ "id":"menuitem134" , "name":"基础用法" },{ "id":"menuitem135" , "name":"状态属性" }]}]},{ "id":"menuitem119" , "name":"多数据类" , "items":[{ "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":"menuitem132" , "name":"表格列更新" },{ "id":"menuitem133" , "name":"表格列重置" },{ "id":"menuitem78" , "name":"自动分组" },{ "id":"menuitem80" , "name":"代码表分组" },{ "id":"menuitem81" , "name":"当前页聚合" },{ "id":"menuitem82" , "name":"远程聚合" }]},{ "id":"menuitem95" , "name":"日历" , "items":[{ "id":"menuitem96" , "name":"内置功能" },{ "id":"menuitem97" , "name":"时间轴样式" },{ "id":"menuitem109" , "name":"项布局面板" },{ "id":"menuitem64" , "name":"自定义插件" }]},{ "id":"menuitem148" , "name":"应用看板视图" },{ "id":"menuitem110" , "name":"树表格" },{ "id":"menuitem111" , "name":"甘特图" },{ "id":"menuitem87" , "name":"数据视图" , "items":[{ "id":"menuitem88" , "name":"内置功能" },{ "id":"menuitem89" , "name":"自动分组" },{ "id":"menuitem90" , "name":"代码表分组" },{ "id":"menuitem94" , "name":"项布局面板" },{ "id":"menuitem152" , "name":"自定义插件" }]},{ "id":"menuitem14" , "name":"树视图" , "items":[{ "id":"menuitem60" , "name":"静态节点" },{ "id":"menuitem61" , "name":"动态节点(代码表)" },{ "id":"menuitem62" , "name":"动态节点(实体)" },{ "id":"menuitem63" , "name":"右键操作" }]},{ "id":"menuitem37" , "name":"图表" , "items":[{ "id":"menuitem38" , "name":"柱状图" },{ "id":"menuitem39" , "name":"折线图" },{ "id":"menuitem40" , "name":"饼图" },{ "id":"menuitem41" , "name":"区域图" },{ "id":"menuitem42" , "name":"雷达图" }]},{ "id":"menuitem83" , "name":"列表" , "items":[{ "id":"menuitem84" , "name":"内置功能" },{ "id":"menuitem85" , "name":"自动分组" },{ "id":"menuitem86" , "name":"代码表分组" },{ "id":"menuitem91" , "name":"项布局面板" },{ "id":"menuitem143" , "name":"自定义插件" }]}]},{ "id":"menuitem159" , "name":"其他类" }]},{ "id":"menuitem5" , "name":"视图" , "items":[{ "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":"menuitem176" , "name":"实体表格导航视图" },{ "id":"menuitem177" , "name":"实体列表导航视图" }]},{ "id":"menuitem11" , "name":"其他视图" , "items":[{ "id":"menuitem35" , "name":"图表视图" },{ "id":"menuitem36" , "name":"报表视图" },{ "id":"menuitem98" , "name":"自定义视图" }]},{ "id":"menuitem140" , "name":"单数据视图" , "items":[{ "id":"menuitem8" , "name":"编辑视图" , "items":[{ "id":"menuitem22" , "name":"常规编辑视图" },{ "id":"menuitem23" , "name":"左右编辑视图" },{ "id":"menuitem24" , "name":"分页编辑视图" },{ "id":"menuitem25" , "name":"嵌入编辑视图" }]},{ "id":"menuitem161" , "name":"实体向导视图" },{ "id":"menuitem162" , "name":"实体编辑视图(分页关系)" },{ "id":"menuitem163" , "name":"实体编辑视图(上下关系)" },{ "id":"menuitem164" , "name":"实体编辑视图(左右关系)" },{ "id":"menuitem165" , "name":"实体分页导航视图" },{ "id":"menuitem166" , "name":"实体数据看板视图" },{ "id":"menuitem167" , "name":"实体选项操作视图" }]},{ "id":"menuitem141" , "name":"多数据视图" , "items":[{ "id":"menuitem9" , "name":"列表视图" , "items":[{ "id":"menuitem21" , "name":"左右表格视图" },{ "id":"menuitem20" , "name":"嵌入表格视图" }]},{ "id":"menuitem79" , "name":"表格视图" , "items":[{ "id":"menuitem19" , "name":"常规表格视图" }]},{ "id":"menuitem168" , "name":"实体多表单编辑视图" },{ "id":"menuitem169" , "name":"实体甘特视图" },{ "id":"menuitem170" , "name":"实体日历视图" },{ "id":"menuitem171" , "name":"实体看板视图" },{ "id":"menuitem172" , "name":"实体树表格视图" },{ "id":"menuitem173" , "name":"实体树视图" },{ "id":"menuitem174" , "name":"实体数据视图" },{ "id":"menuitem175" , "name":"实体图表视图" }]}]},{ "id":"menuitem69" , "name":"工作流" },{ "id":"menuitem153" , "name":"逻辑" , "items":[{ "id":"menuitem154" , "name":"应用功能" , "items":[{ "id":"menuitem127" , "name":"打开应用视图" },{ "id":"menuitem147" , "name":"打开HTML页面" },{ "id":"menuitem160" , "name":"执行JavaScript" }]},{ "id":"menuitem155" , "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数据补充" },{ "id":"menuitem144" , "name":"客户实体示例数据补充" },{ "id":"menuitem146" , "name":"应用视图数据补充" },{ "id":"menuitem149" , "name":"应用部件数据补充" },{ "id":"menuitem150" , "name":"编辑器数据补充" }]}] }]
}
]
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册