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

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

上级 640f703e
......@@ -253,6 +253,7 @@ export default {
menuitem127: "导航视图",
menuitem128: "表格导航",
menuitem114: "列表导航",
menuitem136: "树导航",
menuitem129: "选项操作",
menuitem130: "选项操作视图",
menuitem131: "表格选项操作",
......
......@@ -253,6 +253,7 @@ export default {
menuitem127: "导航视图",
menuitem128: "表格导航",
menuitem114: "列表导航",
menuitem136: "树导航",
menuitem129: "选项操作",
menuitem130: "选项操作视图",
menuitem131: "表格选项操作",
......
......@@ -1661,6 +1661,24 @@ mock.onGet('v7/main-menuappmenu').reply((config: any) => {
textcls: '',
appfunctag: 'AppFunc56',
resourcetag: '',
},
{
id: 'E9F0DFF0-6F72-4964-9B12-B035E2383C2D',
name: 'menuitem136',
text: '树导航',
type: 'MENUITEM',
counterid: '',
tooltip: '树导航',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: 'AppFunc57',
resourcetag: '',
},
],
},
......
<template>
<div class='view-container detreeexpview ibizorder-tree-exp-view'>
<app-studioaction :viewTitle="$t(model.srfCaption)" viewName="ibizordertreeexpview"></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_treeexpbar
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:viewUID="viewUID"
:newdata="newdata"
:opendata="opendata"
name="treeexpbar"
ref='treeexpbar'
@selectionchange="treeexpbar_selectionchange($event)"
@activated="treeexpbar_activated($event)"
@load="treeexpbar_load($event)"
@closeview="closeView($event)">
</view_treeexpbar>
</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 IBIZOrderService from '@/service/ibizorder/ibizorder-service';
import IBIZOrderAuthService from '@/authservice/ibizorder/ibizorder-auth-service';
import TreeExpViewEngine from '@engine/view/tree-exp-view-engine';
import IBIZOrderUIService from '@/uiservice/ibizorder/ibizorder-ui-service';
@Component({
components: {
},
})
export default class IBIZOrderTreeExpViewBase extends Vue {
/**
* 实体服务对象
*
* @type {IBIZOrderService}
* @memberof IBIZOrderTreeExpViewBase
*/
public appEntityService: IBIZOrderService = new IBIZOrderService;
/**
* 实体UI服务对象
*
* @type IBIZOrderUIService
* @memberof IBIZOrderTreeExpViewBase
*/
public appUIService: IBIZOrderUIService = new IBIZOrderUIService(this.$store);
/**
* 数据变化
*
* @param {*} val
* @returns {*}
* @memberof IBIZOrderTreeExpViewBase
*/
@Emit()
public viewDatasChange(val: any):any {
return val;
}
/**
* 传入视图上下文
*
* @type {string}
* @memberof IBIZOrderTreeExpViewBase
*/
@Prop() public viewdata!: string;
/**
* 传入视图参数
*
* @type {string}
* @memberof IBIZOrderTreeExpViewBase
*/
@Prop() public viewparam!: string;
/**
* 视图默认使用
*
* @type {boolean}
* @memberof IBIZOrderTreeExpViewBase
*/
@Prop({ default: true }) public viewDefaultUsage!: boolean;
/**
* 视图默认使用
*
* @type {string}
* @memberof IBIZOrderTreeExpViewBase
*/
@Inject({from:'navModel',default: 'tab'})
public navModel!:string;
/**
* 视图标识
*
* @type {string}
* @memberof IBIZOrderTreeExpViewBase
*/
public viewtag: string = '6625a5fb33580f05512d6ba60d17b55f';
/**
* 自定义视图导航上下文集合
*
* @type {*}
* @memberof IBIZOrderTreeExpViewBase
*/
public customViewNavContexts:any ={
};
/**
* 自定义视图导航参数集合
*
* @type {*}
* @memberof IBIZOrderTreeExpViewBase
*/
public customViewParams:any ={
};
/**
* 视图模型数据
*
* @type {*}
* @memberof IBIZOrderTreeExpViewBase
*/
public model: any = {
srfCaption: 'entities.ibizorder.views.treeexpview.caption',
srfTitle: 'entities.ibizorder.views.treeexpview.title',
srfSubTitle: 'entities.ibizorder.views.treeexpview.subtitle',
dataInfo: ''
}
/**
* 视图参数变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof IBIZOrderTreeExpViewBase
*/
@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 IBIZOrderTreeExpViewBase
*/
@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 IBIZOrderTreeExpViewBase
*/
public containerModel: any = {
view_treeexpbar: { name: 'treeexpbar', type: 'TREEEXPBAR' },
wflinks: [],
};
/**
* 计数器刷新
*
* @memberof IBIZOrderTreeExpViewBase
*/
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 IBIZOrderTreeExpViewBase
*/
public viewState: Subject<ViewState> = new Subject();
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof IBIZOrderTreeExpViewBase
*/
public engine: TreeExpViewEngine = new TreeExpViewEngine();
/**
* 引擎初始化
*
* @public
* @memberof IBIZOrderTreeExpViewBase
*/
public engineInit(): void {
this.engine.init({
view: this,
treeexpbar: this.$refs.treeexpbar,
keyPSDEField: 'ibizorder',
majorPSDEField: 'ibizordername',
isLoadDefault: true,
});
}
/**
* 应用导航服务
*
* @type {*}
* @memberof IBIZOrderTreeExpViewBase
*/
public navDataService = NavDataService.getInstance(this.$store);
/**
* 导航服务事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof IBIZOrderTreeExpViewBase
*/
public serviceStateEvent: Subscription | undefined;
/**
* 门户部件状态对象
*
* @type {*}
* @memberof IBIZOrderTreeExpViewBase
*/
@Prop() public portletState?: any;
/**
* 门户部件状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof IBIZOrderTreeExpViewBase
*/
public portletStateEvent: Subscription | undefined;
/**
* 应用上下文
*
* @type {*}
* @memberof IBIZOrderTreeExpViewBase
*/
public context:any = {};
/**
* 视图参数
*
* @type {*}
* @memberof IBIZOrderTreeExpViewBase
*/
public viewparams:any = {};
/**
* 视图缓存数据
*
* @type {*}
* @memberof IBIZOrderTreeExpViewBase
*/
public viewCacheData:any;
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof IBIZOrderTreeExpViewBase
*/
public counterServiceArray:Array<any> = [];
/**
* 解析视图参数
*
* @public
* @memberof IBIZOrderTreeExpViewBase
*/
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,{'ibizorder':inputvalue});
}
//初始化视图唯一标识
Object.assign(this.context,{srfsessionid:this.$util.createUUID()});
this.handleCustomViewData();
//初始化导航数据
this.initNavDataWithRoute();
}
/**
* 处理自定义视图数据
*
* @memberof IBIZOrderTreeExpViewBase
*/
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 IBIZOrderTreeExpViewBase
*/
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 IBIZOrderTreeExpViewBase
*/
public initNavDataWithRoute(data:any = null, isNew:boolean = false, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && Object.is(this.navModel,"route")) ){
this.navDataService.addNavData({id:'ibizorder-tree-exp-view',tag:this.viewtag,srfkey:isNew ? null : this.context.ibizorder,title:this.$t(this.model.srfCaption),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath});
}
}
/**
* 初始化导航数据(分页模式)
*
* @memberof IBIZOrderTreeExpViewBase
*/
public initNavDataWithTab(data:any = null,isOnlyAdd:boolean = true, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && !Object.is(this.navModel,"route")) ){
this.navDataService.addNavDataByOnly({id:'ibizorder-tree-exp-view',tag:this.viewtag,srfkey:this.context.ibizorder,title:this.$t(this.model.srfCaption),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath},isOnlyAdd);
}
}
/**
* Vue声明周期
*
* @memberof IBIZOrderTreeExpViewBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof IBIZOrderTreeExpViewBase
*/
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,'ibizorder-tree-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,'IBIZOrderTreeExpView')){
return;
}
if(Object.is(res.action,'refresh') && _this.refresh && _this.refresh instanceof Function){
_this.refresh();
}
})
}
}
/**
* 销毁之前
*
* @memberof IBIZOrderTreeExpViewBase
*/
public beforeDestroy() {
this.$store.commit('viewaction/removeView', this.viewtag);
}
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof IBIZOrderTreeExpViewBase
*/
public mounted() {
this.afterMounted();
}
/**
* 执行mounted后的逻辑
*
* @memberof IBIZOrderTreeExpViewBase
*/
public afterMounted(){
const _this: any = this;
_this.engineInit();
if (_this.loadModel && _this.loadModel instanceof Function) {
_this.loadModel();
}
}
/**
* treeexpbar 部件 selectionchange 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZOrderTreeExpViewBase
*/
public treeexpbar_selectionchange($event: any, $event2?: any) {
this.engine.onCtrlEvent('treeexpbar', 'selectionchange', $event);
}
/**
* treeexpbar 部件 activated 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZOrderTreeExpViewBase
*/
public treeexpbar_activated($event: any, $event2?: any) {
this.engine.onCtrlEvent('treeexpbar', 'activated', $event);
}
/**
* treeexpbar 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZOrderTreeExpViewBase
*/
public treeexpbar_load($event: any, $event2?: any) {
this.engine.onCtrlEvent('treeexpbar', 'load', $event);
}
/**
* 打开新建数据视图
*
* @param {any[]} args
* @param {*} [params]
* @param {*} [fullargs]
* @param {*} [$event]
* @param {*} [xData]
* @memberof IBIZOrderTreeExpView
*/
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 IBIZOrderTreeExpView
*/
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 IBIZOrderTreeExpViewBase
*/
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 IBIZOrderTreeExpViewBase
*/
public destroyed(){
this.afterDestroyed();
}
/**
* 执行destroyed后的逻辑
*
* @memberof IBIZOrderTreeExpViewBase
*/
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 IBIZOrderTreeExpViewBase
*/
public viewUID: string = 'sample-ibizorder-tree-exp-view';
}
</script>
<style lang='less'>
@import './ibizorder-tree-exp-view.less';
</style>
\ No newline at end of file
.view-card {
>.ivu-card-extra {
top: 5px;
right: 0px;
}
}
.ibizorder-tree-exp-view{
position: relative;
}
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import IBIZOrderTreeExpViewBase from './ibizorder-tree-exp-view-base.vue';
import view_treeexpbar from '@widgets/ibizorder/tree-exp-viewtreeexpbar-treeexpbar/tree-exp-viewtreeexpbar-treeexpbar.vue';
@Component({
components: {
view_treeexpbar,
},
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 IBIZOrderTreeExpView extends IBIZOrderTreeExpViewBase {
}
</script>
\ No newline at end of file
......@@ -137,6 +137,7 @@ export const PageComponents = {
Vue.component('ibizsample0003-mpickup-view', () => import('@pages/sample/ibizsample0003-mpickup-view/ibizsample0003-mpickup-view.vue'));
Vue.component('ibizorder-odsp-d20-wfgrid-view', () => import('@pages/sample/ibizorder-odsp-d20-wfgrid-view/ibizorder-odsp-d20-wfgrid-view.vue'));
Vue.component('ibizorder-wfaction-view', () => import('@pages/sample/ibizorder-wfaction-view/ibizorder-wfaction-view.vue'));
Vue.component('ibizorder-tree-exp-view', () => import('@pages/sample/ibizorder-tree-exp-view/ibizorder-tree-exp-view.vue'));
Vue.component('ibizsample0017-f20-edit-view', () => import('@pages/sample/ibizsample0017-f20-edit-view/ibizsample0017-f20-edit-view.vue'));
Vue.component('ibizorder-odsp-w-wfgrid-view', () => import('@pages/sample/ibizorder-odsp-w-wfgrid-view/ibizorder-odsp-w-wfgrid-view.vue'));
Vue.component('ibizbookvalue-rules-grid-view', () => import('@pages/sample/ibizbookvalue-rules-grid-view/ibizbookvalue-rules-grid-view.vue'));
......@@ -158,8 +159,8 @@ export const PageComponents = {
Vue.component('ibizuniproduct-grid-view9', () => import('@pages/sample/ibizuniproduct-grid-view9/ibizuniproduct-grid-view9.vue'));
Vue.component('ibizsample0003-sf5-edit-view', () => import('@pages/sample/ibizsample0003-sf5-edit-view/ibizsample0003-sf5-edit-view.vue'));
Vue.component('ibizuniproduct-index-pickup-data-view', () => import('@pages/sample/ibizuniproduct-index-pickup-data-view/ibizuniproduct-index-pickup-data-view.vue'));
Vue.component('ibizorder-tab-exp-view', () => import('@pages/sample/ibizorder-tab-exp-view/ibizorder-tab-exp-view.vue'));
Vue.component('ibizorder-type-usr2-grid-view', () => import('@pages/sample/ibizorder-type-usr2-grid-view/ibizorder-type-usr2-grid-view.vue'));
Vue.component('ibizorder-tab-exp-view', () => import('@pages/sample/ibizorder-tab-exp-view/ibizorder-tab-exp-view.vue'));
Vue.component('ibizsample0018-grid-view', () => import('@pages/sample/ibizsample0018-grid-view/ibizsample0018-grid-view.vue'));
Vue.component('ibizsample0014-grid-view', () => import('@pages/sample/ibizsample0014-grid-view/ibizsample0014-grid-view.vue'));
Vue.component('app-panel-view', () => import('@pages/ungroup/app-panel-view/app-panel-view.vue'));
......
......@@ -2193,6 +2193,20 @@ const router = new Router({
},
component: () => import('@pages/sample/ibizorder-wfaction-view/ibizorder-wfaction-view.vue'),
},
{
path: 'ibizorders/:ibizorder?/treeexpview/:treeexpview?',
meta: {
caption: 'entities.ibizorder.views.treeexpview.caption',
info:'',
parameters: [
{ pathName: 'index', parameterName: 'index' },
{ pathName: 'ibizorders', parameterName: 'ibizorder' },
{ pathName: 'treeexpview', parameterName: 'treeexpview' },
],
requireAuth: true,
},
component: () => import('@pages/sample/ibizorder-tree-exp-view/ibizorder-tree-exp-view.vue'),
},
{
path: 'ibizsample0017s/:ibizsample0017?/f20editview/:f20editview?',
meta: {
......@@ -2518,32 +2532,32 @@ const router = new Router({
component: () => import('@pages/sample/ibizuniproduct-index-pickup-data-view/ibizuniproduct-index-pickup-data-view.vue'),
},
{
path: 'ibizorders/:ibizorder?/tabexpview/:tabexpview?',
path: 'ibizordertypes/:ibizordertype?/usr2gridview/:usr2gridview?',
meta: {
caption: 'entities.ibizorder.views.tabexpview.caption',
caption: 'entities.ibizordertype.views.usr2gridview.caption',
info:'',
parameters: [
{ pathName: 'index', parameterName: 'index' },
{ pathName: 'ibizorders', parameterName: 'ibizorder' },
{ pathName: 'tabexpview', parameterName: 'tabexpview' },
{ pathName: 'ibizordertypes', parameterName: 'ibizordertype' },
{ pathName: 'usr2gridview', parameterName: 'usr2gridview' },
],
requireAuth: true,
},
component: () => import('@pages/sample/ibizorder-tab-exp-view/ibizorder-tab-exp-view.vue'),
component: () => import('@pages/sample/ibizorder-type-usr2-grid-view/ibizorder-type-usr2-grid-view.vue'),
},
{
path: 'ibizordertypes/:ibizordertype?/usr2gridview/:usr2gridview?',
path: 'ibizorders/:ibizorder?/tabexpview/:tabexpview?',
meta: {
caption: 'entities.ibizordertype.views.usr2gridview.caption',
caption: 'entities.ibizorder.views.tabexpview.caption',
info:'',
parameters: [
{ pathName: 'index', parameterName: 'index' },
{ pathName: 'ibizordertypes', parameterName: 'ibizordertype' },
{ pathName: 'usr2gridview', parameterName: 'usr2gridview' },
{ pathName: 'ibizorders', parameterName: 'ibizorder' },
{ pathName: 'tabexpview', parameterName: 'tabexpview' },
],
requireAuth: true,
},
component: () => import('@pages/sample/ibizorder-type-usr2-grid-view/ibizorder-type-usr2-grid-view.vue'),
component: () => import('@pages/sample/ibizorder-tab-exp-view/ibizorder-tab-exp-view.vue'),
},
...indexRoutes,
],
......@@ -3495,6 +3509,19 @@ const router = new Router({
},
component: () => import('@pages/sample/ibizsample0001-sf2-edit-view/ibizsample0001-sf2-edit-view.vue'),
},
{
path: '/ibizorders/:ibizorder?/treeexpview/:treeexpview?',
meta: {
caption: 'entities.ibizorder.views.treeexpview.caption',
info:'',
parameters: [
{ pathName: 'ibizorders', parameterName: 'ibizorder' },
{ pathName: 'treeexpview', parameterName: 'treeexpview' },
],
requireAuth: true,
},
component: () => import('@pages/sample/ibizorder-tree-exp-view/ibizorder-tree-exp-view.vue'),
},
{
path: '/ibizsample0003s/:ibizsample0003?/smpickupview2/:smpickupview2?',
meta: {
......
......@@ -248,6 +248,7 @@ export const viewstate: any = {
'dd8d7ffe00cabb07784f30f66a5b34da',
'e14e0fa8f3def77ebbcf18f1f39c0225',
'd3255261c8522c660c1000cd0a61c3b0',
'6625a5fb33580f05512d6ba60d17b55f',
'5ccbd78fe47300a160915d6398b59604',
'bdb15578e295954bc2ecd16771c3e200',
'5f21463b9d808170d4023d8402cc6e9e',
......@@ -719,6 +720,16 @@ export const viewstate: any = {
'ac9add3724d90fba46e7298ac051fa5f',
],
},
{
viewtag: '6625a5fb33580f05512d6ba60d17b55f',
viewmodule: 'Sample',
viewname: 'IBIZOrderTreeExpView',
viewaction: '',
viewdatachange: false,
refviews: [
'2567fdd6130699509d22512564bbb650',
],
},
{
viewtag: '668ab3660db4770c4ef6fc19c40bdc46',
viewmodule: 'Sample',
......
......@@ -650,12 +650,12 @@ export default class MainMenuBase extends Vue implements ControlInterface {
case 'Auto176':
this.clickAuto176(item);
return;
case 'AppFunc48':
this.clickAppFunc48(item);
return;
case 'AppFunc24':
this.clickAppFunc24(item);
return;
case 'AppFunc48':
this.clickAppFunc48(item);
return;
case 'Auto3':
this.clickAuto3(item);
return;
......@@ -671,6 +671,9 @@ export default class MainMenuBase extends Vue implements ControlInterface {
case 'AppFunc46':
this.clickAppFunc46(item);
return;
case 'AppFunc57':
this.clickAppFunc57(item);
return;
case 'AppFunc44':
this.clickAppFunc44(item);
return;
......@@ -1855,18 +1858,18 @@ export default class MainMenuBase extends Vue implements ControlInterface {
}
/**
* 功能名称
* 订单示例数据补充
*
* @param {*} [item={}]
* @memberof MainMenu
*/
public clickAppFunc48(item: any = {}) {
public clickAppFunc24(item: any = {}) {
const viewparam: any = {};
Object.assign(viewparam, {});
const deResParameters: any[] = [];
const parameters: any[] = [
{ pathName: 'ibizbooks', parameterName: 'ibizbook' },
{ pathName: 'usr6gridview', parameterName: 'usr6gridview' },
{ pathName: 'ibizorders', parameterName: 'ibizorder' },
{ pathName: 'zdytpgridview', parameterName: 'zdytpgridview' },
];
const path: string = this.$viewTool.buildUpRoutePath(this.$route, {}, deResParameters, parameters, [], viewparam);
if(Object.is(this.$route.fullPath,path)){
......@@ -1878,18 +1881,18 @@ export default class MainMenuBase extends Vue implements ControlInterface {
}
/**
* 订单示例数据补充
* 功能名称
*
* @param {*} [item={}]
* @memberof MainMenu
*/
public clickAppFunc24(item: any = {}) {
public clickAppFunc48(item: any = {}) {
const viewparam: any = {};
Object.assign(viewparam, {});
const deResParameters: any[] = [];
const parameters: any[] = [
{ pathName: 'ibizorders', parameterName: 'ibizorder' },
{ pathName: 'zdytpgridview', parameterName: 'zdytpgridview' },
{ pathName: 'ibizbooks', parameterName: 'ibizbook' },
{ pathName: 'usr6gridview', parameterName: 'usr6gridview' },
];
const path: string = this.$viewTool.buildUpRoutePath(this.$route, {}, deResParameters, parameters, [], viewparam);
if(Object.is(this.$route.fullPath,path)){
......@@ -2015,6 +2018,29 @@ export default class MainMenuBase extends Vue implements ControlInterface {
})
}
/**
* 订单实体树导航
*
* @param {*} [item={}]
* @memberof MainMenu
*/
public clickAppFunc57(item: any = {}) {
const viewparam: any = {};
Object.assign(viewparam, {});
const deResParameters: any[] = [];
const parameters: any[] = [
{ pathName: 'ibizorders', parameterName: 'ibizorder' },
{ pathName: 'treeexpview', parameterName: 'treeexpview' },
];
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);
})
}
/**
* 示例实体01数据补充
*
......
......@@ -1755,6 +1755,25 @@ export default class MainMenuModel {
appfunctag: 'AppFunc56',
resourcetag: '',
authtag:'Web-MainMenu-menuitem114',
},
{
id: 'E9F0DFF0-6F72-4964-9B12-B035E2383C2D',
name: 'menuitem136',
text: '树导航',
type: 'MENUITEM',
counterid: '',
tooltip: '树导航',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: '',
icon: '',
textcls: '',
appfunctag: 'AppFunc57',
resourcetag: '',
authtag:'Web-MainMenu-menuitem136',
},
],
},
......
<template>
<div class="design-tree-container">
<context-menu-container>
<el-tree
v-if="inited"
ref="treeexpbar_tree"
class="design-tree"
node-key="id"
lazy
:show-checkbox="!isSingleSelect"
:check-on-click-node="!isSingleSelect"
:default-expanded-keys="expandedKeys"
:props="{
label: 'text',
isLeaf: 'leaf',
children: 'children'
}"
:load="load"
:highlight-current="true"
:expand-on-click-node="false"
@check="onCheck"
@current-change="selectionChange"
:filter-node-method="filterNode"
:empty-text="$t('entities.ibizorder.treeexp_treeview.nodata')"
>
<template slot-scope="{ node, data }">
<context-menu :ref='data.id' :isBlocked="true" :contextMenuStyle="{width: '100%'}" :data="node" :renderContent="renderContextMenu" @showContext="showContext(data,$event)">
<tooltip transfer style="width: 100%;" max-width="2000" placement="right">
<div class="tree-node" @dblclick="doDefaultAction(node)">
<span class="icon">
<i v-if=" data.iconcls && !Object.is(data.iconcls, '')" :class="data.iconcls"></i>
<img v-else-if="data.icon && !Object.is(data.icon, '')" :src="data.icon" />
<icon v-else-if="isOutputIconDefault" type="ios-paper-outline"></icon>&nbsp;
</span>
<span class="text">
<span v-if="data.html" v-html="data.html"></span>
<span v-else>{{ data.isUseLangRes ? $t(data.text) : data.text }}</span>
</span>
</div>
<template slot="content">
<span v-if="data.html" v-html="data.html"></span>
<span v-else>{{ data.isUseLangRes ? $t(data.text) : data.text }}</span>
</template>
</tooltip>
</context-menu>
</template>
</el-tree>
</context-menu-container>
</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 TreeExpService from './tree-exp-treeview-service';
import IBIZOrderUIService from '@/uiservice/ibizorder/ibizorder-ui-service';
import { Environment } from '@/environments/environment';
import UIService from '@/uiservice/ui-service';
@Component({
components: {
}
})
export default class TreeExpBase extends Vue implements ControlInterface {
/**
* 名称
*
* @type {string}
* @memberof TreeExpBase
*/
@Prop() public name?: string;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof TreeExpBase
*/
@Prop() public viewState!: Subject<ViewState>;
/**
* 应用上下文
*
* @type {*}
* @memberof TreeExpBase
*/
@Prop() public context!: any;
/**
* 视图参数
*
* @type {*}
* @memberof TreeExpBase
*/
@Prop() public viewparams!: any;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof TreeExpBase
*/
public viewStateEvent: Subscription | undefined;
/**
* 获取部件类型
*
* @returns {string}
* @memberof TreeExpBase
*/
public getControlType(): string {
return 'TREEVIEW'
}
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof TreeExpBase
*/
public counterServiceArray:Array<any> = [];
/**
* 建构部件服务对象
*
* @type {TreeExpService}
* @memberof TreeExpBase
*/
public service: TreeExpService = new TreeExpService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {IBIZOrderService}
* @memberof TreeExpBase
*/
public appEntityService: IBIZOrderService = new IBIZOrderService({ $store: this.$store });
/**
* 转化数据
*
* @param {any} args
* @memberof TreeExpBase
*/
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 TreeExpBase
*/
public closeView(args: any): void {
let _this: any = this;
_this.$emit('closeview', [args]);
}
/**
* 计数器刷新
*
* @memberof TreeExpBase
*/
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 TreeExpBase
*/
public getDatas(): any[] {
return [this.currentselectedNode];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof TreeExpBase
*/
public getData(): any {
return this.currentselectedNode;
}
/**
* 是否单选
*
* @type {boolean}
* @memberof TreeExpBase
*/
@Prop({ default: true }) public isSingleSelect!: boolean;
/**
* 是否默认选中第一条数据
*
* @type {boolean}
* @memberof TreeExpBase
*/
@Prop({ default: false }) public isSelectFirstDefault!: boolean;
/**
* 枝干节点是否可用(具有数据能力,可抛出)
*
* @type {string}
* @memberof TreeExpBase
*/
@Prop({default:true}) public isBranchAvailable!: boolean;
/**
* 显示处理提示
*
* @type {boolean}
* @memberof TreeExpBase
*/
@Prop({ default: true }) public showBusyIndicator?: boolean;
/**
* 初始化完成
*
* @type {boolean}
* @memberof TreeExpBase
*/
public inited: boolean = false;
/**
* 已选中数据集合
*
* @type {*}
* @memberof TreeExpBase
*/
public selectedNodes: any = [];
/**
* 当前选中数据项
*
* @type {*}
* @memberof TreeExpBase
*/
public currentselectedNode: any = {};
/**
* 选中数据字符串
*
* @type {string}
* @memberof TreeExpBase
*/
@Prop() public selectedData!: string;
/**
* 选中值变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof TreeExpBase
*/
@Watch('selectedData')
public onValueChange(newVal: any, oldVal: any) {
this.echoselectedNodes = newVal ? this.isSingleSelect ? [JSON.parse(newVal)[0]] : JSON.parse(newVal) : [];
this.selectedNodes = [];
if(this.echoselectedNodes.length > 0){
let AllnodesObj = (this.$refs.treeexpbar_tree as any).store.nodesMap;
let AllnodesArray : any[] = [];
for (const key in AllnodesObj) {
if (AllnodesObj.hasOwnProperty(key)) {
AllnodesArray.push(AllnodesObj[key].data);
}
}
this.setDefaultSelection(AllnodesArray);
}
}
/**
* 回显选中数据集合
*
* @type {*}
* @memberof TreeExpBase
*/
public echoselectedNodes:any[] = this.selectedData ? ( this.isSingleSelect ? [JSON.parse(this.selectedData)[0]] : JSON.parse(this.selectedData)) : [];
/**
* 部件行为--update
*
* @type {string}
* @memberof TreeExpBase
*/
@Prop() public updateAction!: string;
/**
* 部件行为--fetch
*
* @type {string}
* @memberof TreeExpBase
*/
@Prop() public fetchAction!: string;
/**
* 部件行为--remove
*
* @type {string}
* @memberof TreeExpBase
*/
@Prop() public removeAction!: string;
/**
* 部件行为--load
*
* @type {string}
* @memberof TreeExpBase
*/
@Prop() public loadAction!: string;
/**
* 部件行为--create
*
* @type {string}
* @memberof TreeExpBase
*/
@Prop() public createAction!: string;
/**
* 过滤属性
*
* @type {string}
* @memberof TreeExpBase
*/
public srfnodefilter: string = '';
/**
* 默认输出图标
*
* @type {boolean}
* @memberof TreeExpBase
*/
public isOutputIconDefault: boolean = true;
/**
* 数据展开主键
*
* @type {string[]}
* @memberof TreeExpBase
*/
@Provide()
public expandedKeys: string[] = [];
/**
* 应用状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof TreeExpBase
*/
public appStateEvent: Subscription | undefined;
/**
* 树节点上下文菜单集合
*
* @type {string[]}
* @memberof TreeExpBase
*/
public actionModel: any = {
}
/**
* 备份树节点上下文菜单
*
* @type any
* @memberof MainTreeBase
*/
public copyActionModel:any;
/**
* 选中数据变更事件
*
* @public
* @param {*} data
* @param {*} data 当前节点对应传入对象
* @param {*} checkedState 树目前选中状态对象
* @memberof TreeExpBase
*/
public onCheck(data: any, checkedState: any) {
// 处理多选数据
if(!this.isSingleSelect){
let leafNodes = checkedState.checkedNodes.filter((item:any) => item.leaf);
this.selectedNodes = JSON.parse(JSON.stringify(leafNodes));
this.$emit('selectionchange', this.selectedNodes);
}
}
/**
* 选中数据变更事件
*
* @public
* @param {*} data 节点对应传入对象
* @param {*} node 节点对应node对象
* @memberof TreeExpBase
*/
public selectionChange(data: any, node: any) {
// 禁用项处理
if (data.disabled){
node.isCurrent = false;
return;
}
// 只处理最底层子节点
if(this.isBranchAvailable || data.leaf){
this.currentselectedNode = JSON.parse(JSON.stringify(data));
// 单选直接替换
if(this.isSingleSelect){
this.selectedNodes = [this.currentselectedNode];
this.$emit('selectionchange', this.selectedNodes);
}
// 多选用check方法
}
}
/**
* Vue声明周期(处理组件的输入属性)
*
* @memberof TreeExpBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof TreeExpBase
*/
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.inited = false;
this.$nextTick(() => {
this.inited = true;
});
}
if (Object.is('filter', action)) {
this.srfnodefilter = data.srfnodefilter;
this.refresh_all();
}
if (Object.is('refresh_parent', action)) {
this.refresh_parent();
}
if (Object.is('refresh_current', action)) {
this.refresh_current();
}
});
}
if(AppCenterService && AppCenterService.getMessageCenter()){
this.appStateEvent = AppCenterService.getMessageCenter().subscribe(({ name, action, data }) =>{
if(!Object.is(name,"IBIZOrder")){
return;
}
if(Object.is(action,'appRefresh')){
this.refresh([data]);
}
})
}
}
/**
* 对树节点进行筛选操作
* @memberof OrderTree
*/
public filterNode(value:any, data:any) {
if (!value) return true;
return data.text.indexOf(value) !== -1;
}
/**
* vue 生命周期
*
* @memberof TreeExpBase
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof TreeExpBase
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
if(this.appStateEvent){
this.appStateEvent.unsubscribe();
}
}
/**
* 刷新数据
*
* @memberof TreeExpBase
*/
public refresh_all(): void {
this.inited = false;
this.$nextTick(() => {
this.inited = true;
});
}
/**
* 刷新当前节点
*
* @memberof TreeExpBase
*/
public refresh_current(): void {
if (Object.keys(this.currentselectedNode).length === 0) {
return;
}
const tree: any = this.$refs.treeexpbar_tree;
const node: any = tree.getNode(this.currentselectedNode.id);
if (!node || !node.parent) {
return;
}
let curNode:any = {};
curNode = Util.deepObjectMerge(curNode,node);
let tempContext:any = {};
if(curNode.data && curNode.data.srfappctx){
Object.assign(tempContext,curNode.data.srfappctx);
}else{
Object.assign(tempContext,this.context);
}
const id: string = node.key ? node.key : '#';
const param: any = { srfnodeid: id };
this.refresh_node(tempContext,param, false);
}
/**
* 刷新父节点
*
* @memberof TreeExpBase
*/
public refresh_parent(): void {
if (Object.keys(this.currentselectedNode).length === 0) {
return;
}
const tree: any = this.$refs.treeexpbar_tree;
const node: any = tree.getNode(this.currentselectedNode.id);
if (!node || !node.parent) {
return;
}
let curNode:any = {};
const { parent: _parent } = node;
curNode = Util.deepObjectMerge(curNode,_parent);
let tempContext:any = {};
if(curNode.data && curNode.data.srfappctx){
Object.assign(tempContext,curNode.data.srfappctx);
}else{
Object.assign(tempContext,this.context);
}
const id: string = _parent.key ? _parent.key : '#';
const param: any = { srfnodeid: id };
this.refresh_node(tempContext,param, true);
}
/**
* 数据加载
*
* @param {*} node
* @memberof TreeExpBase
*/
public load(node: any = {}, resolve?: any) {
if (node.data && node.data.children) {
resolve(node.data.children);
return;
}
const params: any = {
srfnodeid: node.data && node.data.id ? node.data.id : "#",
srfnodefilter: this.srfnodefilter
};
let tempViewParams:any = JSON.parse(JSON.stringify(this.viewparams));
let curNode:any = {};
curNode = Util.deepObjectMerge(curNode,node);
let tempContext:any = this.computecurNodeContext(curNode);
if(curNode.data && curNode.data.srfparentdename){
Object.assign(tempContext,{srfparentdename:curNode.data.srfparentdename});
Object.assign(tempViewParams,{srfparentdename:curNode.data.srfparentdename});
}
if(curNode.data && curNode.data.srfparentkey){
Object.assign(tempContext,{srfparentkey:curNode.data.srfparentkey});
Object.assign(tempViewParams,{srfparentkey:curNode.data.srfparentkey});
}
Object.assign(params,{viewparams:tempViewParams});
this.service.getNodes(tempContext,params).then((response: any) => {
if (!response || response.status !== 200) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.info });
resolve([]);
return;
}
const _items = response.data;
this.formatExpanded(_items);
resolve([..._items]);
let isRoot = Object.is(node.level,0);
let isSelectedAll = node.checked;
this.setDefaultSelection(_items, isRoot, isSelectedAll);
this.$emit("load", _items);
}).catch((response: any) => {
resolve([]);
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.info });
});
}
/**
* 计算当前节点的上下文
*
* @param {*} curNode 当前节点
* @memberof TreeExpBase
*/
public computecurNodeContext(curNode:any){
let tempContext:any = {};
if(curNode && curNode.data && curNode.data.srfappctx){
tempContext = JSON.parse(JSON.stringify(curNode.data.srfappctx));
}else{
tempContext = JSON.parse(JSON.stringify(this.context));
}
return tempContext;
}
/**
* 刷新功能
*
* @param {any} args
* @memberof TreeExpBase
*/
public refresh(args?: any): void {
this.refresh_all();
}
/**
* 刷新节点
*
* @public
* @param {*} [curContext] 当前节点上下文
* @param {*} [arg={}] 当前节点附加参数
* @param {boolean} parentnode 是否是刷新父节点
* @memberof TreeExpBase
*/
public refresh_node(curContext:any,arg: any = {}, parentnode: boolean): void {
const { srfnodeid: id } = arg;
Object.assign(arg,{viewparams:this.viewparams});
const get: Promise<any> = this.service.getNodes(JSON.parse(JSON.stringify(this.context)),arg);
get.then((response: any) => {
if (!response || response.status !== 200) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.info });
return;
}
const _items = [...response.data];
this.formatExpanded(_items);
const tree: any = this.$refs.treeexpbar_tree;
tree.updateKeyChildren(id, _items);
if (parentnode) {
this.currentselectedNode = {};
}
this.$forceUpdate();
this.setDefaultSelection(_items);
}).catch((response: any) => {
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.info });
});
}
/**
* 默认展开节点
*
* @public
* @param {any[]} items
* @returns {any[]}
* @memberof TreeExpBase
*/
public formatExpanded(items: any[]): any[] {
const data: any[] = [];
items.forEach((item) => {
if (item.expanded || (item.children && item.children.length > 0)) {
this.expandedKeys.push(item.id);
}
});
return data;
}
/**
* 设置默认选中,回显数项,选中所有子节点
*
* @param {any[]} items 当前节点所有子节点集合
* @param {boolean} isRoot 是否是加载根节点
* @param {boolean} isSelectedAll 是否选中所有子节点
* @memberof TreeExpBase
*/
public setDefaultSelection(items: any[], isRoot: boolean = false, isSelectedAll: boolean = false): void {
if(items.length == 0){
return;
}
let defaultData: any;
//在导航视图中,如已有选中数据,则右侧展开已选中数据的视图,如无选中数据则默认选中第一条
if(this.isSelectFirstDefault){
if(this.isSingleSelect){
let index: number = -1;
if(this.selectedNodes && this.selectedNodes.length > 0){
this.selectedNodes.forEach((select: any) => {
index = items.findIndex((item: any) => Object.is(select.srfkey,item.srfkey));
});
}
if(index === -1) {
if(isRoot){
index = 0;
}else{
return;
}
}
defaultData = items[index];
this.setTreeNodeHighLight(defaultData);
this.currentselectedNode = JSON.parse(JSON.stringify(defaultData));
if(this.isBranchAvailable || defaultData.leaf){
this.selectedNodes = [this.currentselectedNode];
this.$emit('selectionchange', this.selectedNodes);
}
}
}
// 已选数据的回显
if(this.echoselectedNodes && this.echoselectedNodes.length > 0){
let checkedNodes = items.filter((item:any)=>{
return this.echoselectedNodes.some((val:any)=> {
if(Object.is(item.srfkey,val.srfkey) && Object.is(item.srfmajortext,val.srfmajortext)){
val.used = true;
this.selectedNodes.push(val);
this.$emit('selectionchange', this.selectedNodes);
return true;
}
});
});
if(checkedNodes.length > 0){
this.echoselectedNodes = this.echoselectedNodes.filter((item:any)=> !item.used);
// 父节点选中时,不需要执行这段,会选中所有子节点
if(!isSelectedAll){
if(this.isSingleSelect){
this.setTreeNodeHighLight(checkedNodes[0]);
this.currentselectedNode = JSON.parse(JSON.stringify(checkedNodes[0]));
this.selectedNodes = [this.currentselectedNode];
}else{
this.selectedNodes = this.selectedNodes.concat(checkedNodes);
const tree: any = this.$refs.treeexpbar_tree;
tree.setCheckedNodes(this.selectedNodes);
}
}
}
}
// 父节点选中时,选中所有子节点
if(isSelectedAll){
let leafNodes = items.filter((item:any) => item.leaf);
this.selectedNodes = this.selectedNodes.concat(leafNodes);
this.$emit('selectionchange', this.selectedNodes);
}
}
/**
* 绘制右击菜单
*
* @param {*} node
* @returns
* @memberof TreeExpBase
*/
public renderContextMenu(node: any) {
let content;
if (node && node.data) {
const data: any = JSON.parse(JSON.stringify(node.data));
this.currentselectedNode = { ...data };
const tags: string[] = data.id.split(';');
let copyActionModel:any =Util.deepCopy(this.actionModel);
}
return content;
}
/**
* 显示上下文菜单
*
* @param data 节点数据
* @param event 事件源
* @memberof TreeExpBase
*/
public showContext(data:any,event:any){
let _this:any = this;
this.copyActionModel = {};
const tags: string[] = data.id.split(';');
Object.values(this.actionModel).forEach((item:any) =>{
if(Object.is(item.nodeOwner,tags[0])){
this.copyActionModel[item.name] = item;
}
})
if(Object.keys(this.copyActionModel).length === 0){
return;
}
this.computeNodeState(data,data.nodeType,data.appEntityName).then((result:any) => {
let flag:boolean = false;
if(Object.values(result).length>0){
flag =Object.values(result).some((item:any) =>{
return item.visabled === true;
})
}
if(flag){
(_this.$refs[data.id] as any).showContextMenu(event.clientX, event.clientY);
}
});
}
/**
* 计算节点右键权限
*
* @param {*} node 节点数据
* @param {*} nodeType 节点类型
* @param {*} appEntityName 应用实体名称
* @returns
* @memberof TreeExpBase
*/
public async computeNodeState(node:any,nodeType:string,appEntityName:string) {
if(Object.is(nodeType,"STATIC")){
return this.copyActionModel;
}
let service:any = await this.appEntityService.getService(appEntityName);
if(this.copyActionModel && Object.keys(this.copyActionModel).length > 0) {
if(service['Get'] && service['Get'] instanceof Function){
let tempContext:any = Util.deepCopy(this.context);
tempContext[appEntityName] = node.srfkey;
let targetData = await service.Get(tempContext,{}, false);
let uiservice:any = await new UIService().getService(appEntityName);
let result: any[] = ViewTool.calcActionItemAuthState(targetData.data,this.copyActionModel,uiservice);
return this.copyActionModel;
}else{
console.warn("获取数据异常");
return this.copyActionModel;
}
}
}
/**
* 设置选中高亮
*
* @param {*} data
* @memberof TreeExpBase
*/
public setTreeNodeHighLight(data: any): void {
const tree: any = this.$refs.treeexpbar_tree;
tree.setCurrentKey(data.id);
}
/**
* 执行默认界面行为
*
* @param {*} node
* @memberof TreeExpBase
*/
public doDefaultAction(node: any) {
if (node && node.data) {
const data: any = node.data;
const tags: string[] = data.id.split(';');
}
this.$emit('nodedblclick', this.selectedNodes);
}
}
</script>
<style lang='less'>
@import './tree-exp-treeview.less';
</style>
\ No newline at end of file
/**
* TreeExp 部件模型
*
* @export
* @class TreeExpModel
*/
export default class TreeExpModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof TreeExpModel
*/
public getDataItems(): any[] {
return [
{
name: 'tp',
},
{
name: 'endtime',
},
{
name: 'wfstate',
},
{
name: 'createdate',
},
{
name: 'opinion',
},
{
name: 'updatedate',
},
{
name: 'ordertype',
},
{
name: 'detailnum',
},
{
name: 'wfinstanceid',
},
{
name: 'amount',
},
{
name: 'orderuid',
},
{
name: 'ibizorder',
prop: 'ibizorderid',
},
{
name: 'orderstate',
},
{
name: 'starttime',
},
{
name: 'updateman',
},
{
name: 'wfstep',
},
{
name: 'createman',
},
{
name: 'ibizordername',
},
{
name: 'ordertime',
},
{
name: 'memo',
},
{
name: 'ibizcustomername',
},
{
name: 'ibizcustomerid',
},
]
}
}
\ 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 TreeExpModel from './tree-exp-treeview-model';
import CodeListService from "@/codelist/codelist-service";
import i18n from '@/locale';
/**
* TreeExp 部件服务对象
*
* @export
* @class TreeExpService
*/
export default class TreeExpService extends ControlService {
/**
* 订单服务对象
*
* @type {IBIZOrderService}
* @memberof TreeExpService
*/
public appEntityService: IBIZOrderService = new IBIZOrderService({ $store: this.getStore() });
/**
* 设置从数据模式
*
* @type {boolean}
* @memberof TreeExpService
*/
public setTempMode(){
this.isTempMode = false;
}
/**
* Creates an instance of TreeExpService.
*
* @param {*} [opts={}]
* @memberof TreeExpService
*/
constructor(opts: any = {}) {
super(opts);
this.model = new TreeExpModel();
}
/**
* 代码表服务对象
*
* @type {CodeListService}
* @memberof TreeExpService
*/
public codeListService:CodeListService = new CodeListService({ $store: this.getStore() });
/**
* 节点分隔符号
*
* @public
* @type {string}
* @memberof TreeExpService
*/
public TREENODE_SEPARATOR: string = ';';
/**
* 订单实体节点分隔符号
*
* @public
* @type {string}
* @memberof TreeExpService
*/
public TREENODE_ORDERENTITY: string = 'orderentity';
/**
* 默认根节点节点分隔符号
*
* @public
* @type {string}
* @memberof TreeExpService
*/
public TREENODE_ROOT: string = 'ROOT';
/**
* 一级节点节点分隔符号
*
* @public
* @type {string}
* @memberof TreeExpService
*/
public TREENODE_TOP1: string = 'top1';
/**
* 获取节点数据
*
* @param {string} action
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof TreeExpService
*/
@Errorlog
public async getNodes(context:any = {},data: any = {}, isloading?: boolean): Promise<any> {
let { srfparentkey, srfcat, srfnodeid, srfnodefilter, query }: { srfparentkey: string, srfcat: string, srfnodeid: string, srfnodefilter: string, query:string } = data;
srfnodefilter = query ? query : srfnodefilter;
let list: any[] = [];
let filter: any = {};
if (!srfnodeid || Object.is(srfnodeid, '#')) {
srfnodeid = this.TREENODE_ROOT;
}
let strTreeNodeId: string = srfnodeid;
let strRealNodeId: string = '';
let bRootSelect: boolean = false;
let strNodeType: string | null = null;
let strRootSelectNode: string = '';
if (Object.is(strTreeNodeId, this.TREENODE_ROOT)) {
strNodeType = this.TREENODE_ROOT;
if (srfparentkey) {
strRealNodeId = srfparentkey;
}
} else {
let nPos = strTreeNodeId.indexOf(this.TREENODE_SEPARATOR);
if (nPos === -1) {
return Promise.reject({ status: 500, data: { title: '失败', message: `树节点${strTreeNodeId}标识无效` } });
}
strNodeType = strTreeNodeId.substring(0, nPos);
strRealNodeId = strTreeNodeId.substring(nPos + 1);
}
Object.assign(filter,
{
srfparentkey: srfparentkey,
srfcat: srfcat,
srfnodefilter: srfnodefilter,
strRealNodeId: strRealNodeId,
srfnodeid: srfnodeid,
strNodeType: strNodeType,
viewparams: JSON.parse(JSON.stringify(data)).viewparams
}
);
// 分解节点标识
let nodeid: string[] = strRealNodeId.split(this.TREENODE_SEPARATOR);
for (let i = 0; i < nodeid.length; i++) {
switch (i) {
case 0:
Object.assign(filter, { nodeid: nodeid[0] });
break;
case 1:
Object.assign(filter, { nodeid2: nodeid[1] });
break;
case 2:
Object.assign(filter, { nodeid3: nodeid[2] });
break;
case 3:
Object.assign(filter, { nodeid4: nodeid[3] });
break;
default:
break;
}
}
if (Object.is(strNodeType, this.TREENODE_ORDERENTITY)) {
await this.fillOrderentityNodeChilds(context,filter, list);
return Promise.resolve({ status: 200, data: list });
}
if (Object.is(strNodeType, this.TREENODE_ROOT)) {
await this.fillRootNodeChilds(context,filter, list);
return Promise.resolve({ status: 200, data: list });
}
if (Object.is(strNodeType, this.TREENODE_TOP1)) {
await this.fillTop1NodeChilds(context,filter, list);
return Promise.resolve({ status: 200, data: list });
}
return Promise.resolve({ status: 500, data: { title: '失败', message: `树节点${strTreeNodeId}标识无效` } });
}
/**
* 填充 树视图节点[订单实体]
*
* @public
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @param {*} rsNavContext
* @param {*} rsNavParams
* @param {*} rsParams
* @returns {Promise<any>}
* @memberof TreeExpService
*/
@Errorlog
public fillOrderentityNodes(context:any={},filter: any, list: any[],rsNavContext?:any,rsNavParams?:any,rsParams?:any): Promise<any> {
context = this.handleResNavContext(context,filter,rsNavContext);
filter = this.handleResNavParams(context,filter,rsNavParams,rsParams);
return new Promise((resolve:any,reject:any) =>{
this.codeListService.getItems('ORDERENTITYDATA',context).then((codeListIems:any)=>{
if(codeListIems && codeListIems.length >0){
const handleChildData = (context:any,item:any,) =>{
Object.assign(item,{srfappctx:context});
Object.assign(item, { text: item.text });
Object.assign(item, { srfmajortext: item.text });
let strNodeId: string = "orderentity";
Object.assign(item, { srfkey: item.value });
strNodeId += this.TREENODE_SEPARATOR;
strNodeId += item.value;
Object.assign(item, { id: strNodeId });
Object.assign(item, { expanded: filter.isautoexpand });
Object.assign(item, { nodeid: item.srfkey });
Object.assign(item, { nodeid2: item.pvalue });
Object.assign(item, { nodeType: "CODELIST",appEntityName:"ibizorder" });
}
codeListIems = this.handleDataSet(JSON.parse(JSON.stringify(codeListIems)),context,handleChildData);
codeListIems.forEach((item:any) => {
let treeNode: any = {};
Object.assign(treeNode,{srfappctx:context});
Object.assign(treeNode, { text: item.text });
Object.assign(treeNode, { srfmajortext: treeNode.text });
let strNodeId: string = "orderentity";
Object.assign(treeNode, { srfkey: item.value });
strNodeId += this.TREENODE_SEPARATOR;
strNodeId += item.value;
Object.assign(treeNode, { id: strNodeId });
Object.assign(treeNode, { expanded: filter.isautoexpand });
Object.assign(treeNode, { leaf: true });
if(item.children && item.children.length >0){
Object.assign(treeNode, { children: item.children });
}
Object.assign(treeNode, { nodeid: treeNode.srfkey });
Object.assign(treeNode, { nodeid2: filter.strRealNodeId });
Object.assign(treeNode, { nodeType: "CODELIST",appEntityName:"ibizorder" });
list.push(treeNode);
resolve(list);
})
}else{
resolve(list);
}
});
});
}
/**
* 填充 树视图节点[订单实体]子节点
*
* @public
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @returns {Promise<any>}
* @memberof TreeExpService
*/
@Errorlog
public async fillOrderentityNodeChilds(context:any={}, filter: any, list: any[]): Promise<any> {
if (filter.srfnodefilter && !Object.is(filter.srfnodefilter,"")) {
} else {
}
}
/**
* 填充 树视图节点[默认根节点]
*
* @public
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @param {*} rsNavContext
* @param {*} rsNavParams
* @param {*} rsParams
* @returns {Promise<any>}
* @memberof TreeExpService
*/
@Errorlog
public fillRootNodes(context:any={},filter: any, list: any[],rsNavContext?:any,rsNavParams?:any,rsParams?:any): Promise<any> {
context = this.handleResNavContext(context,filter,rsNavContext);
filter = this.handleResNavParams(context,filter,rsNavParams,rsParams);
return new Promise((resolve:any,reject:any) =>{
let treeNode: any = {};
Object.assign(treeNode, { text: i18n.t('entities.ibizorder.treeexp_treeview.nodes.root') });
Object.assign(treeNode, { isUseLangRes: true });
Object.assign(treeNode,{srfappctx:context});
Object.assign(treeNode, { srfmajortext: treeNode.text });
let strNodeId: string = 'ROOT';
Object.assign(treeNode, { srfkey: 'root' });
strNodeId += this.TREENODE_SEPARATOR;
strNodeId += 'root';
Object.assign(treeNode, { id: strNodeId });
Object.assign(treeNode, { expanded: filter.isAutoexpand });
Object.assign(treeNode, { leaf: false });
Object.assign(treeNode, { nodeid: treeNode.srfkey });
Object.assign(treeNode, { nodeid2: filter.strRealNodeId });
Object.assign(treeNode, { nodeType: "STATIC" });
list.push(treeNode);
resolve(list);
});
}
/**
* 填充 树视图节点[默认根节点]子节点
*
* @public
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @returns {Promise<any>}
* @memberof TreeExpService
*/
@Errorlog
public async fillRootNodeChilds(context:any={}, filter: any, list: any[]): Promise<any> {
if (filter.srfnodefilter && !Object.is(filter.srfnodefilter,"")) {
// 填充一级节点
let Top1RsNavContext:any = {};
let Top1RsNavParams:any = {};
let Top1RsParams:any = {};
await this.fillTop1Nodes(context, filter, list ,Top1RsNavContext,Top1RsNavParams,Top1RsParams);
} else {
// 填充一级节点
let Top1RsNavContext:any = {};
let Top1RsNavParams:any = {};
let Top1RsParams:any = {};
await this.fillTop1Nodes(context, filter, list ,Top1RsNavContext,Top1RsNavParams,Top1RsParams);
}
}
/**
* 填充 树视图节点[一级节点]
*
* @public
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @param {*} rsNavContext
* @param {*} rsNavParams
* @param {*} rsParams
* @returns {Promise<any>}
* @memberof TreeExpService
*/
@Errorlog
public fillTop1Nodes(context:any={},filter: any, list: any[],rsNavContext?:any,rsNavParams?:any,rsParams?:any): Promise<any> {
context = this.handleResNavContext(context,filter,rsNavContext);
filter = this.handleResNavParams(context,filter,rsNavParams,rsParams);
return new Promise((resolve:any,reject:any) =>{
let treeNode: any = {};
Object.assign(treeNode, { text: i18n.t('entities.ibizorder.treeexp_treeview.nodes.top1') });
Object.assign(treeNode, { isUseLangRes: true });
Object.assign(treeNode,{srfappctx:context});
Object.assign(treeNode, { srfmajortext: treeNode.text });
let strNodeId: string = 'top1';
// 没有指定节点值,直接使用父节点值
Object.assign(treeNode, { srfkey: filter.strRealNodeId });
strNodeId += this.TREENODE_SEPARATOR;
strNodeId += filter.strRealNodeId;
Object.assign(treeNode, { id: strNodeId });
Object.assign(treeNode, { expanded: filter.isAutoexpand });
Object.assign(treeNode, { leaf: false });
Object.assign(treeNode, { nodeid: treeNode.srfkey });
Object.assign(treeNode, { nodeid2: filter.strRealNodeId });
Object.assign(treeNode, { nodeType: "STATIC" });
list.push(treeNode);
resolve(list);
});
}
/**
* 填充 树视图节点[一级节点]子节点
*
* @public
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @returns {Promise<any>}
* @memberof TreeExpService
*/
@Errorlog
public async fillTop1NodeChilds(context:any={}, filter: any, list: any[]): Promise<any> {
if (filter.srfnodefilter && !Object.is(filter.srfnodefilter,"")) {
// 填充订单实体
let OrderentityRsNavContext:any = {};
let OrderentityRsNavParams:any = {};
let OrderentityRsParams:any = {};
await this.fillOrderentityNodes(context, filter, list ,OrderentityRsNavContext,OrderentityRsNavParams,OrderentityRsParams);
} else {
// 填充订单实体
let OrderentityRsNavContext:any = {};
let OrderentityRsNavParams:any = {};
let OrderentityRsParams:any = {};
await this.fillOrderentityNodes(context, filter, list ,OrderentityRsNavContext,OrderentityRsNavParams,OrderentityRsParams);
}
}
/**
* 处理代码表返回数据(树状结构)
*
* @param result 返回数组
* @param context 应用上下文
* @param callBack 回调
* @memberof TreeExpService
*/
public handleDataSet(result:Array<any>,context:any,callBack:any){
let list:Array<any> = [];
if(result.length === 0){
return list;
}
result.forEach((codeItem:any) =>{
if(!codeItem.pvalue){
let valueField:string = codeItem.value;
this.setChildCodeItems(valueField,result,codeItem);
list.push(codeItem);
}
})
this.setNodeData(list,context,callBack);
return list;
}
/**
* 处理非根节点数据
*
* @param result 返回数组
* @param context 应用上下文
* @param callBack 回调
* @memberof TreeExpService
*/
public setChildCodeItems(pValue:string,result:Array<any>,codeItem:any){
result.forEach((item:any) =>{
if(item.pvalue == pValue){
let valueField:string = item.value;
this.setChildCodeItems(valueField,result,item);
if(!codeItem.children){
codeItem.children = [];
}
codeItem.children.push(item);
}
})
}
/**
* 设置节点UI数据
*
* @param result 返回数组
* @param context 应用上下文
* @param callBack 回调
* @memberof TreeExpService
*/
public setNodeData(result:Array<any>,context:any,callBack:any){
result.forEach((item:any) =>{
if(item.children){
item.leaf = false;
this.setNodeData(item.children,context,callBack);
}else{
item.leaf = true;
}
callBack(context,item);
})
}
/**
* 处理节点关系导航上下文
*
* @param context 应用上下文
* @param filter 参数
* @param resNavContext 节点关系导航上下文
*
* @memberof TreeExpService
*/
public handleResNavContext(context:any,filter:any,resNavContext:any){
if(resNavContext && Object.keys(resNavContext).length > 0){
let tempContextData:any = JSON.parse(JSON.stringify(context));
let tempViewParams:any = {};
if(filter && filter.viewparams){
tempViewParams = filter.viewparams;
}
Object.keys(resNavContext).forEach((item:any) =>{
let curDataObj:any = resNavContext[item];
this.handleCustomDataLogic(context,tempViewParams,curDataObj,tempContextData,item);
})
return tempContextData;
}else{
return context;
}
}
/**
* 处理关系导航参数
*
* @param context 应用上下文
* @param filter 参数
* @param resNavParams 节点关系导航参数
* @param resParams 节点关系参数
*
* @memberof TreeExpService
*/
public handleResNavParams(context:any,filter:any,resNavParams:any,resParams:any){
if((resNavParams && Object.keys(resNavParams).length >0) || (resParams && Object.keys(resParams).length >0)){
let tempViewParamData:any = {};
let tempViewParams:any = {};
if(filter && filter.viewparams){
tempViewParams = filter.viewparams;
tempViewParamData = JSON.parse(JSON.stringify(filter.viewparams));
}
if( Object.keys(resNavParams).length > 0){
Object.keys(resNavParams).forEach((item:any) =>{
let curDataObj:any = resNavParams[item];
this.handleCustomDataLogic(context,tempViewParams,curDataObj,tempViewParamData,item);
})
}
if( Object.keys(resParams).length > 0){
Object.keys(resParams).forEach((item:any) =>{
let curDataObj:any = resParams[item];
tempViewParamData[item.toLowerCase()] = curDataObj.value;
})
}
Object.assign(filter,{viewparams:tempViewParamData});
return filter;
}else{
return filter;
}
}
/**
* 处理自定义节点关系导航数据
*
* @param context 应用上下文
* @param viewparams 参数
* @param curNavData 节点关系导航参数对象
* @param tempData 返回数据
* @param item 节点关系导航参数键值
*
* @memberof TreeExpService
*/
public handleCustomDataLogic(context:any,viewparams:any,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(context[(curNavData.value).toLowerCase()] != null){
Object.defineProperty(tempData, item.toLowerCase(), {
value: context[(curNavData.value).toLowerCase()],
writable : true,
enumerable : true,
configurable : true
});
}else{
if(viewparams[(curNavData.value).toLowerCase()] != null){
Object.defineProperty(tempData, item.toLowerCase(), {
value: viewparams[(curNavData.value).toLowerCase()],
writable : true,
enumerable : true,
configurable : true
});
}else{
Object.defineProperty(tempData, item.toLowerCase(), {
value: null,
writable : true,
enumerable : true,
configurable : true
});
}
}
}
}
}
\ No newline at end of file
.tree-right-menu {
.ivu-divider-horizontal {
width: 100%;
min-width: 100%;
margin: 0 auto;
}
.ivu-dropdown-item {
position: relative;
padding-left: 32px;
> i {
position: absolute;
left: 16px;
top: 10px;
}
.ivu-icon-ios-arrow-forward {
left: initial;
right: 4px;
}
}
.ivu-dropdown {
.ivu-select-dropdown {
margin: 0;
}
}
}
.el-tree .context-menu-component .tree-node{
width: calc(100% - 15px);
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
.icon{
padding-right: 10px;
}
}
// this is less
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import TreeExpBase from './tree-exp-treeview-base.vue';
@Component({
components: {
}
})
export default class TreeExp extends TreeExpBase {
}
</script>
\ No newline at end of file
<template>
<split id="treeexpviewtreeexpbar" class='app-tree-exp-bar' v-model="split" mode="horizontal" @on-move-end="onSplitChange">
<div slot='left'>
<div class='tree-exp-bar-header'>
<div class="tree-exp-bar-title">{{ $t('app.treeExpBar.title') }}</div>
</div>
<div class='tree-exp-content'>
<view_treeexpbar_tree
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:showBusyIndicator="true"
updateAction='Update'
removeAction='Remove'
loadAction='Get'
createAction='Create'
:isSelectFirstDefault="true"
:isBranchAvailable="true"
name="treeexpbar_tree"
ref='treeexpbar_tree'
@selectionchange="treeexpbar_tree_selectionchange($event)"
@load="treeexpbar_tree_load($event)"
@closeview="closeView($event)">
</view_treeexpbar_tree>
</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)"
@viewdataschange="onViewDatasChange"
@drdatasaved="onDrViewDatasChange"
@drdatasremove="onDrViewDatasChange"
@viewdatasactivated="viewDatasActivated"
@viewload="onViewLoad">
</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 IBIZOrderService from '@/service/ibizorder/ibizorder-service';
import TreeExpViewtreeexpbarService from './tree-exp-viewtreeexpbar-treeexpbar-service';
import IBIZOrderUIService from '@/uiservice/ibizorder/ibizorder-ui-service';
@Component({
components: {
}
})
export default class TreeExpViewtreeexpbarBase extends Vue implements ControlInterface {
/**
* 名称
*
* @type {string}
* @memberof TreeExpViewtreeexpbarBase
*/
@Prop() public name?: string;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof TreeExpViewtreeexpbarBase
*/
@Prop() public viewState!: Subject<ViewState>;
/**
* 应用上下文
*
* @type {*}
* @memberof TreeExpViewtreeexpbarBase
*/
@Prop() public context!: any;
/**
* 视图参数
*
* @type {*}
* @memberof TreeExpViewtreeexpbarBase
*/
@Prop() public viewparams!: any;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof TreeExpViewtreeexpbarBase
*/
public viewStateEvent: Subscription | undefined;
/**
* 获取部件类型
*
* @returns {string}
* @memberof TreeExpViewtreeexpbarBase
*/
public getControlType(): string {
return 'TREEEXPBAR'
}
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof TreeExpViewtreeexpbarBase
*/
public counterServiceArray:Array<any> = [];
/**
* 建构部件服务对象
*
* @type {TreeExpViewtreeexpbarService}
* @memberof TreeExpViewtreeexpbarBase
*/
public service: TreeExpViewtreeexpbarService = new TreeExpViewtreeexpbarService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {IBIZOrderService}
* @memberof TreeExpViewtreeexpbarBase
*/
public appEntityService: IBIZOrderService = new IBIZOrderService({ $store: this.$store });
/**
* treeexpbar_tree 部件 selectionchange 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof TreeExpViewtreeexpbarBase
*/
public treeexpbar_tree_selectionchange($event: any, $event2?: any) {
this.treeexpbar_selectionchange($event, 'treeexpbar_tree', $event2);
}
/**
* treeexpbar_tree 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof TreeExpViewtreeexpbarBase
*/
public treeexpbar_tree_load($event: any, $event2?: any) {
this.treeexpbar_load($event, 'treeexpbar_tree', $event2);
}
/**
* 转化数据
*
* @param {any} args
* @memberof TreeExpViewtreeexpbarBase
*/
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 TreeExpViewtreeexpbarBase
*/
public closeView(args: any): void {
let _this: any = this;
_this.$emit('closeview', [args]);
}
/**
* 计数器刷新
*
* @memberof TreeExpViewtreeexpbarBase
*/
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 TreeExpViewtreeexpbarBase
*/
@Prop() public newdata: any;
/**
* 打开编辑数据视图
*
* @type {any}
* @memberof TreeExpViewtreeexpbarBase
*/
@Prop() public opendata: any;
/**
* 视图唯一标识
*
* @type {boolean}
* @memberof TreeExpViewtreeexpbarBase
*/
@Prop() public viewUID!:string;
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof TreeExpViewtreeexpbarBase
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof TreeExpViewtreeexpbarBase
*/
public getData(): any {
return {};
}
/**
* 选中数据
*
* @type {*}
* @memberof TreeExpViewtreeexpbarBase
*/
public selection: any = {};
/**
* 控件宽度
*
* @type {number}
* @memberof TreeExpViewtreeexpbarBase
*/
public ctrlWidth:number = 0;
/**
* 可搜索字段名称
*
*
* @type {(string)}
* @memberof TreeExpViewtreeexpbarBase
*/
public placeholder="订单名称";
/**
* 过滤值
*
* @type {string}
* @memberof TreeExpViewtreeexpbarBase
*/
public srfnodefilter: string = '';
/**
* 刷新标识
*
* @public
* @type {number}
* @memberof TreeExpViewtreeexpbarBase
*/
public counter:number = 0;
/**
* 是否加载默认关联视图
*
* @public
* @type {boolean}
* @memberof TreeExpViewtreeexpbarBase
*/
public istLoadDefaultRefView: boolean = false;
/**
* 分割宽度
*
* @type {number}
* @memberof TreeExpViewtreeexpbarBase
*/
public split: number = 0.2;
/**
* split值变化事件
*
* @memberof TreeExpViewtreeexpbarBase
*/
public onSplitChange() {
if(this.split){
this.$store.commit("setViewSplit",{viewUID:this.viewUID,viewSplit:this.split});
}
}
/**
* 获取关系项视图
*
* @param {*} [arg={}]
* @returns {*}
* @memberof TreeExpViewtreeexpbarBase
*/
public getExpItemView(arg: any = {}): any {
let expmode = arg.nodetype.toUpperCase();
if (!expmode) {
expmode = '';
}
if (Object.is(expmode, 'ORDERENTITY')) {
return {
viewname: 'ibizorder-detail-grid-view9',
parentdata: {"srfparentdefname":"IBIZORDERID","srfparentdename":"IBIZORDER","srfparentmode":"DER1N_IBIZORDERDETAIL_IBIZORDER_IBIZORDERID"},
deKeyField:'ibizorderdetail'
};
}
return null;
}
/**
* 树导航选中
*
* @param {any []} args
* @param {string} [tag]
* @param {*} [$event2]
* @returns {void}
* @memberof TreeExpViewtreeexpbarBase
*/
public treeexpbar_selectionchange(args: any [], tag?: string, $event2?: any): void {
if (args.length === 0) {
this.calcToolbarItemState(true);
return ;
}
const arg:any = args[0];
if (!arg.id) {
this.calcToolbarItemState(true);
return;
}
const nodetype = arg.id.split(';')[0];
const refview = this.getExpItemView({ nodetype: nodetype });
if (!refview) {
this.calcToolbarItemState(true);
return;
}
let tempViewparam:any = {};
let tempContext:any ={};
if(arg && arg.navfilter){
this.counter += 1;
Object.defineProperty(tempViewparam, arg.navfilter, {
value : arg.srfkey,
writable : true,
enumerable : true,
configurable : true
})
Object.assign(tempContext,{srfcounter:this.counter});
}
Object.assign(tempContext,JSON.parse(JSON.stringify(this.context)));
if(arg.srfappctx){
Object.assign(tempContext,JSON.parse(JSON.stringify(arg.srfappctx)));
}
// 计算导航上下文
if(arg && arg.navigateContext && Object.keys(arg.navigateContext).length >0){
let tempData:any = arg.curData?JSON.parse(JSON.stringify(arg.curData)):{};
Object.assign(tempData,arg);
let _context = this.$util.computedNavData(tempData,tempContext,tempViewparam,arg.navigateContext);
Object.assign(tempContext,_context);
}
if(arg.srfparentdename){
Object.assign(tempContext,{srfparentdename:arg.srfparentdename});
}
if(arg.srfparentkey){
Object.assign(tempContext,{srfparentkey:arg.srfparentkey});
}
// 计算导航参数
if(arg && arg.navigateParams && Object.keys(arg.navigateParams).length >0){
let tempData:any = arg.curData?JSON.parse(JSON.stringify(arg.curData)):{};
Object.assign(tempData,arg);
let _params = this.$util.computedNavData(tempData,tempContext,tempViewparam,arg.navigateParams);
Object.assign(tempViewparam,_params);
this.counter += 1;
Object.assign(tempContext,{srfcounter:this.counter});
}
this.selection = {};
Object.assign(this.selection, { view: { viewname: refview.viewname } });
Object.assign(this.selection,{'viewparam':tempViewparam,'context':tempContext});
this.calcToolbarItemState(false);
this.$forceUpdate();
}
/**
* 树加载完成
*
* @param {any[]} args
* @param {string} [tag]
* @param {*} [$event2]
* @returns {void}
* @memberof TreeExpViewtreeexpbarBase
*/
public treeexpbar_load(args: any[], tag?: string, $event2?: any): void {
this.calcToolbarItemState(true);
this.$emit('load',args);
}
/**
* 执行搜索
*
* @memberof TreeExpViewtreeexpbarBase
*/
public onSearch(): void {
if (!this.viewState) {
return;
}
this.istLoadDefaultRefView = false;
this.viewState.next({ tag: 'treeexpbar_tree', action: 'filter', data: { srfnodefilter: this.srfnodefilter } });
}
/**
* vue 声明周期
*
* @memberof @memberof TreeExpViewtreeexpbarBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof TreeExpViewtreeexpbarBase
*/
public afterCreated(){
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if (!Object.is(tag, this.name)) {
return;
}
this.istLoadDefaultRefView = false;
this.viewState.next({ tag: 'treeexpbar_tree', action: action, data: data });
});
}
}
/**
* Vue声明周期(组件渲染完毕)
*
* @memberof TreeExpViewtreeexpbarBase
*/
public mounted() {
this.afterMounted();
}
/**
* 执行mounted后的逻辑
*
* @memberof TreeExpViewtreeexpbarBase
*/
public afterMounted(){
if(this.$store.getters.getViewSplit(this.viewUID)){
this.split = this.$store.getters.getViewSplit(this.viewUID);
}else{
let containerWidth:number = (document.getElementById("treeexpviewtreeexpbar") as any).offsetWidth;
if(this.ctrlWidth){
this.split = this.ctrlWidth/containerWidth;
}
this.$store.commit("setViewSplit",{viewUID:this.viewUID,viewSplit:this.split});
}
}
/**
* vue 生命周期
*
* @memberof TreeExpViewtreeexpbarBase
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof TreeExpViewtreeexpbarBase
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
}
/**
* 视图数据变化
*
* @param {*} $event
* @memberof TreeExpViewtreeexpbarBase
*/
public onViewDatasChange($event: any): void {
this.$emit('selectionchange', $event);
}
/**
* 视图数据变化
*
* @param {*} $event
* @memberof TreeExpViewtreeexpbarBase
*/
public onDrViewDatasChange($event: any): void {
this.viewState.next({ tag: 'treeexpbar_tree', action: 'refresh_parent' });
}
/**
* 视图数据被激活
*
* @param {*} $event
* @memberof TreeExpViewtreeexpbarBase
*/
public viewDatasActivated($event: any): void {
this.$emit('activated', $event);
}
/**
* 视图数据加载完成
*
* @param {*} $event
* @memberof TreeExpViewtreeexpbarBase
*/
public onViewLoad($event: any): void {
this.$emit('load', $event);
}
/**
* 设置导航区工具栏禁用状态
*
* @param {boolean} state
* @return {*}
* @memberof TreeExpViewtreeexpbarBase
*/
public calcToolbarItemState(state: boolean) {
let _this: any = this;
const models:any = _this.treeexpviewtreeexpbar_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 TreeExpViewtreeexpbarBase
*/
public calcNavigationToolbarState(){
let _this: any = this;
// 界面行为
if(_this.treeexpviewtreeexpbar_toolbarModels){
const curUIService:IBIZOrderUIService = new IBIZOrderUIService();
ViewTool.calcActionItemAuthState({},_this.treeexpviewtreeexpbar_toolbarModels,curUIService);
}
}
}
</script>
<style lang='less'>
@import './tree-exp-viewtreeexpbar-treeexpbar.less';
</style>
/**
* TreeExpViewtreeexpbar 部件模型
*
* @export
* @class TreeExpViewtreeexpbarModel
*/
export default class TreeExpViewtreeexpbarModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof TreeExpViewtreeexpbarModel
*/
public getDataItems(): any[] {
return [
{
name: 'tp',
},
{
name: 'endtime',
},
{
name: 'wfstate',
},
{
name: 'createdate',
},
{
name: 'opinion',
},
{
name: 'updatedate',
},
{
name: 'ordertype',
},
{
name: 'detailnum',
},
{
name: 'wfinstanceid',
},
{
name: 'amount',
},
{
name: 'orderuid',
},
{
name: 'ibizorder',
prop: 'ibizorderid',
},
{
name: 'orderstate',
},
{
name: 'starttime',
},
{
name: 'updateman',
},
{
name: 'wfstep',
},
{
name: 'createman',
},
{
name: 'ibizordername',
},
{
name: 'ordertime',
},
{
name: 'memo',
},
{
name: 'ibizcustomername',
},
{
name: 'ibizcustomerid',
},
]
}
}
\ No newline at end of file
import { Http } from '@/utils';
import ControlService from '@/widgets/control-service';
/**
* TreeExpViewtreeexpbar 部件服务对象
*
* @export
* @class TreeExpViewtreeexpbarService
*/
export default class TreeExpViewtreeexpbarService extends ControlService {
}
\ No newline at end of file
.app-tree-exp-bar {
> .ivu-split-horizontal {
> .ivu-split-trigger-con {
height: 100%;
width: 1px;
}
> .ivu-split-pane {
> div {
height: 100%;
overflow-y: auto;
overflow-x: hidden;
display: flex;
flex-direction: column;
.tree-exp-bar-header {
line-height: 50px;
border-bottom: 1px solid #ddd;
display: flex;
justify-content: space-between;
.tree-exp-bar-title {
font-size: 18px;
padding-left: 8px;
flex-shrink: 0;
i {
font-size: 20px;
margin-top: -2px;
}
}
.toolbar-container{
margin-left: auto;
margin-right: 10px;
display: flex;
flex-wrap: wrap;
align-items: center;
.ivu-badge-count{
top: 2px;
}
}
}
.search-content {
width: 100%;
height: 48px;
padding: 10px 5px 10px 5px;
}
.tree-exp-content {
height: calc(100% - 40px);
overflow: auto;
padding: 16px 0;
margin-bottom: 10px;
}
.tree-exp-content2 {
height: 100%;
overflow: auto;
flex-grow: 1;
}
}
}
> .right-pane.ivu-split-pane {
> div {
padding-left: 10px;
}
}
> .left-pane.ivu-split-pane {
padding-right: 10px;
}
}
}
// this is less
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import TreeExpViewtreeexpbarBase from './tree-exp-viewtreeexpbar-treeexpbar-base.vue';
import view_treeexpbar_tree from '@widgets/ibizorder/tree-exp-treeview/tree-exp-treeview.vue';
@Component({
components: {
view_treeexpbar_tree,
}
})
export default class TreeExpViewtreeexpbar extends TreeExpViewtreeexpbarBase {
}
</script>
\ No newline at end of file
......@@ -245,8 +245,8 @@ dataType="LONGTEXT" :precision="0"
ownertype="formitem10"
:ownerid="data.srfkey"
:show-ocrview="false"
:show-preview="false"
:persistence="false"
:show-preview="true"
:persistence="true"
@formitemvaluechange="onFormItemValueChange">
</disk-image-upload>
</app-form-item>
......
......@@ -302,7 +302,7 @@
{
"appid":"Web",
"appname":"演示应用",
"appmenu":[{"menuid":"MainMenu", "menuname":"MainMenu", "menuitem":[{ "id":"menuitem1" , "name":"工作台" },{ "id":"menuitem3" , "name":"控件" , "items":[{ "id":"menuitem6" , "name":"默认数据类型" },{ "id":"menuitem7" , "name":"默认编辑器类型" },{ "id":"menuitem15" , "name":"基础表单项" },{ "id":"menuitem72" , "name":"扩展编辑器" }]},{ "id":"menuitem4" , "name":"部件" , "items":[{ "id":"menuitem12" , "name":"编辑表单" , "items":[{ "id":"menuitem107" , "name":"内置功能" },{ "id":"menuitem47" , "name":"新建默认值" },{ "id":"menuitem99" , "name":"更新默认值" },{ "id":"menuitem48" , "name":"输入提示" },{ "id":"menuitem49" , "name":"辅助输入" },{ "id":"menuitem50" , "name":"自动填充" },{ "id":"menuitem51" , "name":"超链接" },{ "id":"menuitem52" , "name":"表单值重置" },{ "id":"menuitem55" , "name":"动态显示" },{ "id":"menuitem53" , "name":"动态启用" },{ "id":"menuitem54" , "name":"动态空输入" },{ "id":"menuitem56" , "name":"表单项更新" },{ "id":"menuitem108" , "name":"表单值规则" }]},{ "id":"menuitem16" , "name":"搜索表单" },{ "id":"menuitem13" , "name":"表格" , "items":[{ "id":"menuitem57" , "name":"禁用排序" },{ "id":"menuitem59" , "name":"行操作" },{ "id":"menuitem58" , "name":"行编辑" },{ "id":"menuitem73" , "name":"内置功能" },{ "id":"menuitem74" , "name":"表格行编辑" },{ "id":"menuitem75" , "name":"新建默认值" },{ "id":"menuitem76" , "name":"更新默认值" },{ "id":"menuitem77" , "name":"表格值规则" },{ "id":"menuitem132" , "name":"表格列更新" },{ "id":"menuitem133" , "name":"表格列重置" },{ "id":"menuitem78" , "name":"自动分组" },{ "id":"menuitem80" , "name":"代码表分组" },{ "id":"menuitem81" , "name":"当前页聚合" },{ "id":"menuitem82" , "name":"远程聚合" }]},{ "id":"menuitem83" , "name":"列表" , "items":[{ "id":"menuitem84" , "name":"列表内置功能" },{ "id":"menuitem85" , "name":"列表自动分组" },{ "id":"menuitem86" , "name":"代码表分组" },{ "id":"menuitem91" , "name":"列表嵌入面板" }]},{ "id":"menuitem14" , "name":"树视图" , "items":[{ "id":"menuitem60" , "name":"静态节点" },{ "id":"menuitem61" , "name":"动态节点(代码表)" },{ "id":"menuitem62" , "name":"动态节点(实体)" },{ "id":"menuitem63" , "name":"右键操作" },{ "id":"menuitem64" , "name":"动态参数过滤" },{ "id":"menuitem110" , "name":"树表格" }]},{ "id":"menuitem37" , "name":"图表" , "items":[{ "id":"menuitem38" , "name":"柱状图" },{ "id":"menuitem39" , "name":"折线图" },{ "id":"menuitem40" , "name":"饼图" },{ "id":"menuitem41" , "name":"区域图" },{ "id":"menuitem42" , "name":"雷达图" }]},{ "id":"menuitem17" , "name":"向导" , "items":[{ "id":"menuitem134" , "name":"向导视图" },{ "id":"menuitem135" , "name":"状态向导" }]},{ "id":"menuitem18" , "name":"界面行为" , "items":[{ "id":"menuitem65" , "name":"前端界面行为" },{ "id":"menuitem66" , "name":"后台界面行为" }]},{ "id":"menuitem87" , "name":"数据视图" , "items":[{ "id":"menuitem88" , "name":"内置功能" },{ "id":"menuitem89" , "name":"自动分组" },{ "id":"menuitem90" , "name":"代码表分组" },{ "id":"menuitem94" , "name":"项布局面板" }]},{ "id":"menuitem95" , "name":"日历" , "items":[{ "id":"menuitem96" , "name":"内置功能" },{ "id":"menuitem97" , "name":"时间轴样式" },{ "id":"menuitem109" , "name":"项布局面板" }]},{ "id":"menuitem101" , "name":"看板" , "items":[{ "id":"menuitem102" , "name":"看板内置功能" },{ "id":"menuitem104" , "name":"代码表分组" },{ "id":"menuitem105" , "name":"嵌入视图面板" }]},{ "id":"menuitem111" , "name":"甘特图" , "items":[{ "id":"menuitem112" , "name":"甘特图" }]},{ "id":"menuitem119" , "name":"分页视图" , "items":[{ "id":"menuitem120" , "name":"分页导航" }]},{ "id":"menuitem121" , "name":"多编辑视图" , "items":[{ "id":"menuitem115" , "name":"多表单(行记录)" },{ "id":"menuitem123" , "name":"多表单(上分页)" }]},{ "id":"menuitem122" , "name":"数据关系栏" , "items":[{ "id":"menuitem116" , "name":"编辑视图(左右关系)" },{ "id":"menuitem117" , "name":"编辑视图(上下关系)" },{ "id":"menuitem118" , "name":"编辑视图(分页关系)" }]},{ "id":"menuitem125" , "name":"数据看板" , "items":[{ "id":"menuitem126" , "name":"实体数据看板" }]},{ "id":"menuitem127" , "name":"导航视图" , "items":[{ "id":"menuitem128" , "name":"表格导航" },{ "id":"menuitem114" , "name":"列表导航" }]},{ "id":"menuitem129" , "name":"选项操作" , "items":[{ "id":"menuitem130" , "name":"选项操作视图" },{ "id":"menuitem131" , "name":"表格选项操作" }]}]},{ "id":"menuitem5" , "name":"视图" , "items":[{ "id":"menuitem9" , "name":"列表视图" , "items":[{ "id":"menuitem19" , "name":"常规表格视图" },{ "id":"menuitem21" , "name":"左右表格视图" },{ "id":"menuitem20" , "name":"嵌入表格视图" }]},{ "id":"menuitem8" , "name":"编辑视图" , "items":[{ "id":"menuitem22" , "name":"常规编辑视图" },{ "id":"menuitem23" , "name":"左右编辑视图" },{ "id":"menuitem24" , "name":"分页编辑视图" },{ "id":"menuitem25" , "name":"嵌入编辑视图" }]},{ "id":"menuitem26" , "name":"选择视图" , "items":[{ "id":"menuitem27" , "name":"单选视图" },{ "id":"menuitem28" , "name":"多选视图" },{ "id":"menuitem29" , "name":"树形选择视图" },{ "id":"menuitem30" , "name":"左右单选视图" },{ "id":"menuitem31" , "name":"左右多选视图" }]},{ "id":"menuitem10" , "name":"导航视图" , "items":[{ "id":"menuitem32" , "name":"常规导航视图" },{ "id":"menuitem33" , "name":"分页导航视图" },{ "id":"menuitem34" , "name":"嵌入导航视图" }]},{ "id":"menuitem11" , "name":"其他视图" , "items":[{ "id":"menuitem35" , "name":"图表视图" },{ "id":"menuitem36" , "name":"报表视图" },{ "id":"menuitem98" , "name":"自定义视图" }]},{ "id":"menuitem79" , "name":"表格视图" }]},{ "id":"menuitem69" , "name":"工作流" },{ "id":"menuitem2" , "name":"更多" , "items":[{ "id":"menuitem46" , "name":"数据导出导入" },{ "id":"menuitem45" , "name":"数据打印" },{ "id":"menuitem67" , "name":"索引实体" },{ "id":"menuitem68" , "name":"继承实体" },{ "id":"menuitem70" , "name":"主状态" },{ "id":"menuitem71" , "name":"多表单" }]},{ "id":"menuitem92" , "name":"其他" , "items":[{ "id":"menuitem93" , "name":"示例实体02示例数据补充" },{ "id":"menuitem100" , "name":"订单示例数据补充" },{ "id":"menuitem103" , "name":"产品示例数据补充" },{ "id":"menuitem106" , "name":"示例实体03示例数据补充" },{ "id":"menuitem113" , "name":"订单类型添加" },{ "id":"menuitem124" , "name":"示例实体01数据补充" }]}] }]
"appmenu":[{"menuid":"MainMenu", "menuname":"MainMenu", "menuitem":[{ "id":"menuitem1" , "name":"工作台" },{ "id":"menuitem3" , "name":"控件" , "items":[{ "id":"menuitem6" , "name":"默认数据类型" },{ "id":"menuitem7" , "name":"默认编辑器类型" },{ "id":"menuitem15" , "name":"基础表单项" },{ "id":"menuitem72" , "name":"扩展编辑器" }]},{ "id":"menuitem4" , "name":"部件" , "items":[{ "id":"menuitem12" , "name":"编辑表单" , "items":[{ "id":"menuitem107" , "name":"内置功能" },{ "id":"menuitem47" , "name":"新建默认值" },{ "id":"menuitem99" , "name":"更新默认值" },{ "id":"menuitem48" , "name":"输入提示" },{ "id":"menuitem49" , "name":"辅助输入" },{ "id":"menuitem50" , "name":"自动填充" },{ "id":"menuitem51" , "name":"超链接" },{ "id":"menuitem52" , "name":"表单值重置" },{ "id":"menuitem55" , "name":"动态显示" },{ "id":"menuitem53" , "name":"动态启用" },{ "id":"menuitem54" , "name":"动态空输入" },{ "id":"menuitem56" , "name":"表单项更新" },{ "id":"menuitem108" , "name":"表单值规则" }]},{ "id":"menuitem16" , "name":"搜索表单" },{ "id":"menuitem13" , "name":"表格" , "items":[{ "id":"menuitem57" , "name":"禁用排序" },{ "id":"menuitem59" , "name":"行操作" },{ "id":"menuitem58" , "name":"行编辑" },{ "id":"menuitem73" , "name":"内置功能" },{ "id":"menuitem74" , "name":"表格行编辑" },{ "id":"menuitem75" , "name":"新建默认值" },{ "id":"menuitem76" , "name":"更新默认值" },{ "id":"menuitem77" , "name":"表格值规则" },{ "id":"menuitem132" , "name":"表格列更新" },{ "id":"menuitem133" , "name":"表格列重置" },{ "id":"menuitem78" , "name":"自动分组" },{ "id":"menuitem80" , "name":"代码表分组" },{ "id":"menuitem81" , "name":"当前页聚合" },{ "id":"menuitem82" , "name":"远程聚合" }]},{ "id":"menuitem83" , "name":"列表" , "items":[{ "id":"menuitem84" , "name":"列表内置功能" },{ "id":"menuitem85" , "name":"列表自动分组" },{ "id":"menuitem86" , "name":"代码表分组" },{ "id":"menuitem91" , "name":"列表嵌入面板" }]},{ "id":"menuitem14" , "name":"树视图" , "items":[{ "id":"menuitem60" , "name":"静态节点" },{ "id":"menuitem61" , "name":"动态节点(代码表)" },{ "id":"menuitem62" , "name":"动态节点(实体)" },{ "id":"menuitem63" , "name":"右键操作" },{ "id":"menuitem64" , "name":"动态参数过滤" },{ "id":"menuitem110" , "name":"树表格" }]},{ "id":"menuitem37" , "name":"图表" , "items":[{ "id":"menuitem38" , "name":"柱状图" },{ "id":"menuitem39" , "name":"折线图" },{ "id":"menuitem40" , "name":"饼图" },{ "id":"menuitem41" , "name":"区域图" },{ "id":"menuitem42" , "name":"雷达图" }]},{ "id":"menuitem17" , "name":"向导" , "items":[{ "id":"menuitem134" , "name":"向导视图" },{ "id":"menuitem135" , "name":"状态向导" }]},{ "id":"menuitem18" , "name":"界面行为" , "items":[{ "id":"menuitem65" , "name":"前端界面行为" },{ "id":"menuitem66" , "name":"后台界面行为" }]},{ "id":"menuitem87" , "name":"数据视图" , "items":[{ "id":"menuitem88" , "name":"内置功能" },{ "id":"menuitem89" , "name":"自动分组" },{ "id":"menuitem90" , "name":"代码表分组" },{ "id":"menuitem94" , "name":"项布局面板" }]},{ "id":"menuitem95" , "name":"日历" , "items":[{ "id":"menuitem96" , "name":"内置功能" },{ "id":"menuitem97" , "name":"时间轴样式" },{ "id":"menuitem109" , "name":"项布局面板" }]},{ "id":"menuitem101" , "name":"看板" , "items":[{ "id":"menuitem102" , "name":"看板内置功能" },{ "id":"menuitem104" , "name":"代码表分组" },{ "id":"menuitem105" , "name":"嵌入视图面板" }]},{ "id":"menuitem111" , "name":"甘特图" , "items":[{ "id":"menuitem112" , "name":"甘特图" }]},{ "id":"menuitem119" , "name":"分页视图" , "items":[{ "id":"menuitem120" , "name":"分页导航" }]},{ "id":"menuitem121" , "name":"多编辑视图" , "items":[{ "id":"menuitem115" , "name":"多表单(行记录)" },{ "id":"menuitem123" , "name":"多表单(上分页)" }]},{ "id":"menuitem122" , "name":"数据关系栏" , "items":[{ "id":"menuitem116" , "name":"编辑视图(左右关系)" },{ "id":"menuitem117" , "name":"编辑视图(上下关系)" },{ "id":"menuitem118" , "name":"编辑视图(分页关系)" }]},{ "id":"menuitem125" , "name":"数据看板" , "items":[{ "id":"menuitem126" , "name":"实体数据看板" }]},{ "id":"menuitem127" , "name":"导航视图" , "items":[{ "id":"menuitem128" , "name":"表格导航" },{ "id":"menuitem114" , "name":"列表导航" },{ "id":"menuitem136" , "name":"树导航" }]},{ "id":"menuitem129" , "name":"选项操作" , "items":[{ "id":"menuitem130" , "name":"选项操作视图" },{ "id":"menuitem131" , "name":"表格选项操作" }]}]},{ "id":"menuitem5" , "name":"视图" , "items":[{ "id":"menuitem9" , "name":"列表视图" , "items":[{ "id":"menuitem19" , "name":"常规表格视图" },{ "id":"menuitem21" , "name":"左右表格视图" },{ "id":"menuitem20" , "name":"嵌入表格视图" }]},{ "id":"menuitem8" , "name":"编辑视图" , "items":[{ "id":"menuitem22" , "name":"常规编辑视图" },{ "id":"menuitem23" , "name":"左右编辑视图" },{ "id":"menuitem24" , "name":"分页编辑视图" },{ "id":"menuitem25" , "name":"嵌入编辑视图" }]},{ "id":"menuitem26" , "name":"选择视图" , "items":[{ "id":"menuitem27" , "name":"单选视图" },{ "id":"menuitem28" , "name":"多选视图" },{ "id":"menuitem29" , "name":"树形选择视图" },{ "id":"menuitem30" , "name":"左右单选视图" },{ "id":"menuitem31" , "name":"左右多选视图" }]},{ "id":"menuitem10" , "name":"导航视图" , "items":[{ "id":"menuitem32" , "name":"常规导航视图" },{ "id":"menuitem33" , "name":"分页导航视图" },{ "id":"menuitem34" , "name":"嵌入导航视图" }]},{ "id":"menuitem11" , "name":"其他视图" , "items":[{ "id":"menuitem35" , "name":"图表视图" },{ "id":"menuitem36" , "name":"报表视图" },{ "id":"menuitem98" , "name":"自定义视图" }]},{ "id":"menuitem79" , "name":"表格视图" }]},{ "id":"menuitem69" , "name":"工作流" },{ "id":"menuitem2" , "name":"更多" , "items":[{ "id":"menuitem46" , "name":"数据导出导入" },{ "id":"menuitem45" , "name":"数据打印" },{ "id":"menuitem67" , "name":"索引实体" },{ "id":"menuitem68" , "name":"继承实体" },{ "id":"menuitem70" , "name":"主状态" },{ "id":"menuitem71" , "name":"多表单" }]},{ "id":"menuitem92" , "name":"其他" , "items":[{ "id":"menuitem93" , "name":"示例实体02示例数据补充" },{ "id":"menuitem100" , "name":"订单示例数据补充" },{ "id":"menuitem103" , "name":"产品示例数据补充" },{ "id":"menuitem106" , "name":"示例实体03示例数据补充" },{ "id":"menuitem113" , "name":"订单类型添加" },{ "id":"menuitem124" , "name":"示例实体01数据补充" }]}] }]
}
]
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册