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

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

上级 58893749
......@@ -326,7 +326,7 @@ function getAppLocale(){
menuitem147: commonLogic.appcommonhandle("打开HTML页面",null),
menuitem160: commonLogic.appcommonhandle("执行JavaScript",null),
menuitem155: commonLogic.appcommonhandle("界面行为",null),
menuitem181: commonLogic.appcommonhandle("前界面行为",null),
menuitem181: commonLogic.appcommonhandle("前界面行为",null),
menuitem182: commonLogic.appcommonhandle("后台界面行为",null),
menuitem2: commonLogic.appcommonhandle("更多",null),
menuitem46: commonLogic.appcommonhandle("数据导出导入",null),
......
......@@ -326,7 +326,7 @@ function getAppLocale(){
menuitem147: commonLogic.appcommonhandle("打开HTML页面",null),
menuitem160: commonLogic.appcommonhandle("执行JavaScript",null),
menuitem155: commonLogic.appcommonhandle("界面行为",null),
menuitem181: commonLogic.appcommonhandle("前界面行为",null),
menuitem181: commonLogic.appcommonhandle("前界面行为",null),
menuitem182: commonLogic.appcommonhandle("后台界面行为",null),
menuitem2: commonLogic.appcommonhandle("更多",null),
menuitem46: commonLogic.appcommonhandle("数据导出导入",null),
......
......@@ -1317,6 +1317,24 @@ function getLocaleResourceBase(){
tip: commonLogic.appcommonhandle("数据导入",null),
},
},
usr4listviewtoolbar_toolbar: {
},
usr4listviewlist_quicktoolbar_toolbar: {
deuiaction1: {
caption: commonLogic.appcommonhandle("New",null),
tip: commonLogic.appcommonhandle("New",null),
},
},
usr4listviewlist_batchtoolbar_toolbar: {
deuiaction1: {
caption: commonLogic.appcommonhandle("Edit",null),
tip: commonLogic.appcommonhandle("Edit {0}",null),
},
deuiaction2: {
caption: commonLogic.appcommonhandle("Remove",null),
tip: commonLogic.appcommonhandle("Remove {0}",null),
},
},
usr8gridviewtoolbar_toolbar: {
tbitem3: {
caption: commonLogic.appcommonhandle("New",null),
......@@ -1793,24 +1811,6 @@ function getLocaleResourceBase(){
},
haspanellistviewtoolbar_toolbar: {
},
usr4listviewtoolbar_toolbar: {
},
usr4listviewlist_quicktoolbar_toolbar: {
deuiaction1: {
caption: commonLogic.appcommonhandle("New",null),
tip: commonLogic.appcommonhandle("New",null),
},
},
usr4listviewlist_batchtoolbar_toolbar: {
deuiaction1: {
caption: commonLogic.appcommonhandle("Edit",null),
tip: commonLogic.appcommonhandle("Edit {0}",null),
},
deuiaction2: {
caption: commonLogic.appcommonhandle("Remove",null),
tip: commonLogic.appcommonhandle("Remove {0}",null),
},
},
portlet_booklist_list_quicktoolbar_toolbar: {
deuiaction1: {
caption: commonLogic.appcommonhandle("New",null),
......@@ -1839,27 +1839,27 @@ function getLocaleResourceBase(){
ibizbook_opendocument: commonLogic.appcommonhandle("打开文档",null),
},
},
tree_treeview: {
treeview_treeview: {
nodata:commonLogic.appcommonhandle("",null),
nodes: {
root: commonLogic.appcommonhandle("默认根节点",null),
book: commonLogic.appcommonhandle("图书",null),
},
uiactions: {
},
},
booktypeselect_treeview: {
tree_treeview: {
nodata:commonLogic.appcommonhandle("",null),
nodes: {
ibizbooktype: commonLogic.appcommonhandle("图书类型",null),
root: commonLogic.appcommonhandle("默认根节点",null),
},
uiactions: {
},
},
treeview_treeview: {
booktypeselect_treeview: {
nodata:commonLogic.appcommonhandle("",null),
nodes: {
ibizbooktype: commonLogic.appcommonhandle("图书类型",null),
root: commonLogic.appcommonhandle("默认根节点",null),
book: commonLogic.appcommonhandle("图书",null),
},
uiactions: {
},
......
......@@ -1317,6 +1317,24 @@ function getLocaleResourceBase(){
tip: commonLogic.appcommonhandle("数据导入",null),
},
},
usr4listviewtoolbar_toolbar: {
},
usr4listviewlist_quicktoolbar_toolbar: {
deuiaction1: {
caption: commonLogic.appcommonhandle("新建",null),
tip: commonLogic.appcommonhandle("新建",null),
},
},
usr4listviewlist_batchtoolbar_toolbar: {
deuiaction1: {
caption: commonLogic.appcommonhandle("编辑",null),
tip: commonLogic.appcommonhandle("编辑",null),
},
deuiaction2: {
caption: commonLogic.appcommonhandle("删除",null),
tip: commonLogic.appcommonhandle("删除",null),
},
},
usr8gridviewtoolbar_toolbar: {
tbitem3: {
caption: commonLogic.appcommonhandle("新建",null),
......@@ -1793,24 +1811,6 @@ function getLocaleResourceBase(){
},
haspanellistviewtoolbar_toolbar: {
},
usr4listviewtoolbar_toolbar: {
},
usr4listviewlist_quicktoolbar_toolbar: {
deuiaction1: {
caption: commonLogic.appcommonhandle("新建",null),
tip: commonLogic.appcommonhandle("新建",null),
},
},
usr4listviewlist_batchtoolbar_toolbar: {
deuiaction1: {
caption: commonLogic.appcommonhandle("编辑",null),
tip: commonLogic.appcommonhandle("编辑",null),
},
deuiaction2: {
caption: commonLogic.appcommonhandle("删除",null),
tip: commonLogic.appcommonhandle("删除",null),
},
},
portlet_booklist_list_quicktoolbar_toolbar: {
deuiaction1: {
caption: commonLogic.appcommonhandle("新建",null),
......@@ -1839,27 +1839,27 @@ function getLocaleResourceBase(){
ibizbook_opendocument: commonLogic.appcommonhandle("打开文档",null),
},
},
tree_treeview: {
treeview_treeview: {
nodata:commonLogic.appcommonhandle("",null),
nodes: {
root: commonLogic.appcommonhandle("默认根节点",null),
book: commonLogic.appcommonhandle("图书",null),
},
uiactions: {
},
},
booktypeselect_treeview: {
tree_treeview: {
nodata:commonLogic.appcommonhandle("",null),
nodes: {
ibizbooktype: commonLogic.appcommonhandle("图书类型",null),
root: commonLogic.appcommonhandle("默认根节点",null),
},
uiactions: {
},
},
treeview_treeview: {
booktypeselect_treeview: {
nodata:commonLogic.appcommonhandle("",null),
nodes: {
ibizbooktype: commonLogic.appcommonhandle("图书类型",null),
root: commonLogic.appcommonhandle("默认根节点",null),
book: commonLogic.appcommonhandle("图书",null),
},
uiactions: {
},
......
......@@ -2169,7 +2169,7 @@ mock.onGet('v7/main-menuappmenu').reply((config: any) => {
iconcls: '',
icon: '',
textcls: '',
appfunctag: '',
appfunctag: 'AppFunc90',
resourcetag: '',
},
{
......@@ -2241,7 +2241,7 @@ mock.onGet('v7/main-menuappmenu').reply((config: any) => {
iconcls: '',
icon: '',
textcls: '',
appfunctag: '',
appfunctag: 'AppFunc91',
resourcetag: '',
},
{
......@@ -2693,10 +2693,10 @@ mock.onGet('v7/main-menuappmenu').reply((config: any) => {
{
id: '5BD8B4AB-A156-45B0-9C2F-9C7E80F5AB07',
name: 'menuitem181',
text: '前界面行为',
text: '前界面行为',
type: 'MENUITEM',
counterid: '',
tooltip: '前界面行为',
tooltip: '前界面行为',
expanded: false,
separator: false,
hidden: false,
......
<template>
<div class='view-container detreeview ibizbookusr2-tree-view'>
<app-studioaction :viewTitle="$t(model.srfCaption)" viewName="ibizbookusr2treeview"></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>
<div class="tree-contant">
<view_tree
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:showBusyIndicator="true"
updateAction='Update'
removeAction='Remove'
loadAction='Get'
createAction='Create'
name="tree"
ref='tree'
@selectionchange="tree_selectionchange($event)"
@load="tree_load($event)"
@closeview="closeView($event)">
</view_tree>
</div>
</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 TreeViewEngine from '@engine/view/tree-view-engine';
import IBIZBOOKUIService from '@/uiservice/ibizbook/ibizbook-ui-service';
@Component({
components: {
},
})
export default class IBIZBOOKUsr2TreeViewBase extends Vue {
/**
* 实体服务对象
*
* @type {IBIZBOOKService}
* @memberof IBIZBOOKUsr2TreeViewBase
*/
public appEntityService: IBIZBOOKService = new IBIZBOOKService;
/**
* 实体UI服务对象
*
* @type IBIZBOOKUIService
* @memberof IBIZBOOKUsr2TreeViewBase
*/
public appUIService: IBIZBOOKUIService = new IBIZBOOKUIService(this.$store);
/**
* 数据变化
*
* @param {*} val
* @returns {*}
* @memberof IBIZBOOKUsr2TreeViewBase
*/
@Emit()
public viewDatasChange(val: any):any {
return val;
}
/**
* 传入视图上下文
*
* @type {string}
* @memberof IBIZBOOKUsr2TreeViewBase
*/
@Prop() public viewdata!: string;
/**
* 传入视图参数
*
* @type {string}
* @memberof IBIZBOOKUsr2TreeViewBase
*/
@Prop() public viewparam!: string;
/**
* 视图默认使用
*
* @type {boolean}
* @memberof IBIZBOOKUsr2TreeViewBase
*/
@Prop({ default: true }) public viewDefaultUsage!: boolean;
/**
* 视图默认使用
*
* @type {string}
* @memberof IBIZBOOKUsr2TreeViewBase
*/
@Inject({from:'navModel',default: 'tab'})
public navModel!:string;
/**
* 视图标识
*
* @type {string}
* @memberof IBIZBOOKUsr2TreeViewBase
*/
public viewtag: string = 'e240a385ba3c1e752f1a3aed838e9b58';
/**
* 自定义视图导航上下文集合
*
* @type {*}
* @memberof IBIZBOOKUsr2TreeViewBase
*/
public customViewNavContexts:any ={
};
/**
* 自定义视图导航参数集合
*
* @type {*}
* @memberof IBIZBOOKUsr2TreeViewBase
*/
public customViewParams:any ={
};
/**
* 视图模型数据
*
* @type {*}
* @memberof IBIZBOOKUsr2TreeViewBase
*/
public model: any = {
srfCaption: 'entities.ibizbook.views.usr2treeview.caption',
srfTitle: 'entities.ibizbook.views.usr2treeview.title',
srfSubTitle: 'entities.ibizbook.views.usr2treeview.subtitle',
dataInfo: ''
}
/**
* 视图参数变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof IBIZBOOKUsr2TreeViewBase
*/
@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 IBIZBOOKUsr2TreeViewBase
*/
@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 IBIZBOOKUsr2TreeViewBase
*/
public containerModel: any = {
view_tree: { name: 'tree', type: 'TREEVIEW' },
};
/**
* 视图刷新
*
* @param {*} args
* @memberof IBIZBOOKUsr2TreeViewBase
*/
public refresh(args?: any): void {
const refs: any = this.$refs;
if (refs && refs.tree) {
refs.tree.refresh();
}
}
/**
* 计数器刷新
*
* @memberof IBIZBOOKUsr2TreeViewBase
*/
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 IBIZBOOKUsr2TreeViewBase
*/
public viewState: Subject<ViewState> = new Subject();
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof IBIZBOOKUsr2TreeViewBase
*/
public engine: TreeViewEngine = new TreeViewEngine();
/**
* 引擎初始化
*
* @public
* @memberof IBIZBOOKUsr2TreeViewBase
*/
public engineInit(): void {
this.engine.init({
view: this,
tree: this.$refs.tree,
keyPSDEField: 'ibizbook',
majorPSDEField: 'ibizbookname',
isLoadDefault: true,
});
}
/**
* 应用导航服务
*
* @type {*}
* @memberof IBIZBOOKUsr2TreeViewBase
*/
public navDataService = NavDataService.getInstance(this.$store);
/**
* 导航服务事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof IBIZBOOKUsr2TreeViewBase
*/
public serviceStateEvent: Subscription | undefined;
/**
* 门户部件状态对象
*
* @type {*}
* @memberof IBIZBOOKUsr2TreeViewBase
*/
@Prop() public portletState?: any;
/**
* 门户部件状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof IBIZBOOKUsr2TreeViewBase
*/
public portletStateEvent: Subscription | undefined;
/**
* 应用上下文
*
* @type {*}
* @memberof IBIZBOOKUsr2TreeViewBase
*/
public context:any = {};
/**
* 视图参数
*
* @type {*}
* @memberof IBIZBOOKUsr2TreeViewBase
*/
public viewparams:any = {};
/**
* 视图缓存数据
*
* @type {*}
* @memberof IBIZBOOKUsr2TreeViewBase
*/
public viewCacheData:any;
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof IBIZBOOKUsr2TreeViewBase
*/
public counterServiceArray:Array<any> = [];
/**
* 解析视图参数
*
* @public
* @memberof IBIZBOOKUsr2TreeViewBase
*/
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 IBIZBOOKUsr2TreeViewBase
*/
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 IBIZBOOKUsr2TreeViewBase
*/
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 IBIZBOOKUsr2TreeViewBase
*/
public initNavDataWithRoute(data:any = null, isNew:boolean = false, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && Object.is(this.navModel,"route")) ){
this.navDataService.addNavData({id:'ibizbookusr2-tree-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 IBIZBOOKUsr2TreeViewBase
*/
public initNavDataWithTab(data:any = null,isOnlyAdd:boolean = true, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && !Object.is(this.navModel,"route")) ){
this.navDataService.addNavDataByOnly({id:'ibizbookusr2-tree-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 IBIZBOOKUsr2TreeViewBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof IBIZBOOKUsr2TreeViewBase
*/
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,'ibizbookusr2-tree-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,'IBIZBOOKUsr2TreeView')){
return;
}
if(Object.is(res.action,'refresh') && _this.refresh && _this.refresh instanceof Function){
_this.refresh();
}
})
}
}
/**
* 销毁之前
*
* @memberof IBIZBOOKUsr2TreeViewBase
*/
public beforeDestroy() {
this.$store.commit('viewaction/removeView', this.viewtag);
}
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof IBIZBOOKUsr2TreeViewBase
*/
public mounted() {
this.afterMounted();
}
/**
* 执行mounted后的逻辑
*
* @memberof IBIZBOOKUsr2TreeViewBase
*/
public afterMounted(){
const _this: any = this;
_this.engineInit();
if (_this.loadModel && _this.loadModel instanceof Function) {
_this.loadModel();
}
}
/**
* tree 部件 selectionchange 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZBOOKUsr2TreeViewBase
*/
public tree_selectionchange($event: any, $event2?: any) {
this.engine.onCtrlEvent('tree', 'selectionchange', $event);
}
/**
* tree 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZBOOKUsr2TreeViewBase
*/
public tree_load($event: any, $event2?: any) {
this.engine.onCtrlEvent('tree', 'load', $event);
}
/**
* 关闭视图
*
* @param {any[]} args
* @memberof IBIZBOOKUsr2TreeViewBase
*/
public closeView(args: any[]): void {
let _view: any = this;
if (_view.viewdata) {
_view.$emit('viewdataschange', Array.isArray(args)?args:[args]);
_view.$emit('close', Array.isArray(args)?args:[args]);
} else if (_view.$tabPageExp) {
_view.$tabPageExp.onClose(_view.$route.fullPath);
}
}
/**
* 销毁视图回调
*
* @memberof IBIZBOOKUsr2TreeViewBase
*/
public destroyed(){
this.afterDestroyed();
}
/**
* 执行destroyed后的逻辑
*
* @memberof IBIZBOOKUsr2TreeViewBase
*/
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 IBIZBOOKUsr2TreeViewBase
*/
public srfnodefilter: string = '';
/**
* 快速搜索
*
* @returns {void}
* @memberof IBIZBOOKUsr2TreeViewBase
*/
public onSearch(): void {
if (!this.viewState) {
return;
}
this.viewState.next({ tag: 'tree', action: 'filter', data: { srfnodefilter: this.srfnodefilter } });
}
}
</script>
<style lang='less'>
@import './ibizbookusr2-tree-view.less';
</style>
\ No newline at end of file
.view-card {
>.ivu-card-extra {
top: 5px;
right: 0px;
}
}
.search-contant {
height: 40px;
.ivu-input-wrapper {
max-width: 400px;
padding-top: 6px;
}
}
.tree-contant {
height: 100%;
margin: 0px 0px 16px 0;
overflow: auto;
}
.ibizbookusr2-tree-view{
position: relative;
}
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import IBIZBOOKUsr2TreeViewBase from './ibizbookusr2-tree-view-base.vue';
import view_tree from '@widgets/ibizbook/tree-view-treeview/tree-view-treeview.vue';
@Component({
components: {
view_tree,
},
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 IBIZBOOKUsr2TreeView extends IBIZBOOKUsr2TreeViewBase {
}
</script>
\ No newline at end of file
<template>
<div class='view-container delistview ibizbookusr4-list-view'>
<app-studioaction :viewTitle="$t(model.srfCaption)" viewName="ibizbookusr4listview"></app-studioaction>
<card class='view-card ' :bordered="false" :dis-hover="true" >
<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 style="margin-bottom:6px;">
<i-input v-show="!isExpandSearchForm" v-model="query" search enter-button @on-search="onSearch($event)" class='pull-left' placeholder="图书名称" style='max-width: 400px;margin-top:6px;padding-left: 24px' />
<div class='pull-right'>
<div class='toolbar-container'>
</div>
</div>
</div>
<view_searchform
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:showBusyIndicator="true"
v-show="isExpandSearchForm"
loaddraftAction="FilterGetDraft"
loadAction="FilterGet"
name="searchform"
ref='searchform'
@save="searchform_save($event)"
@search="searchform_search($event)"
@load="searchform_load($event)"
@closeview="closeView($event)">
</view_searchform>
<div class='view-body-messages'>
</div>
<view_list
:viewState="viewState"
:viewparams="viewparams"
:context="context"
createAction="Create"
removeAction="Remove"
updateAction="Update"
fetchAction="FetchDefault"
:showBusyIndicator="true"
:newdata="newdata"
:opendata="opendata"
name="list"
ref='list'
@selectionchange="list_selectionchange($event)"
@beforeload="list_beforeload($event)"
@rowdblclick="list_rowdblclick($event)"
@remove="list_remove($event)"
@load="list_load($event)"
@closeview="closeView($event)">
</view_list>
</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 ListViewEngine from '@engine/view/list-view-engine';
import IBIZBOOKUIService from '@/uiservice/ibizbook/ibizbook-ui-service';
import CodeListService from "@/codelist/codelist-service";
@Component({
components: {
},
})
export default class IBIZBOOKUsr4ListViewBase extends Vue {
/**
* 实体服务对象
*
* @type {IBIZBOOKService}
* @memberof IBIZBOOKUsr4ListViewBase
*/
public appEntityService: IBIZBOOKService = new IBIZBOOKService;
/**
* 实体UI服务对象
*
* @type IBIZBOOKUIService
* @memberof IBIZBOOKUsr4ListViewBase
*/
public appUIService: IBIZBOOKUIService = new IBIZBOOKUIService(this.$store);
/**
* 数据变化
*
* @param {*} val
* @returns {*}
* @memberof IBIZBOOKUsr4ListViewBase
*/
@Emit()
public viewDatasChange(val: any):any {
return val;
}
/**
* 传入视图上下文
*
* @type {string}
* @memberof IBIZBOOKUsr4ListViewBase
*/
@Prop() public viewdata!: string;
/**
* 传入视图参数
*
* @type {string}
* @memberof IBIZBOOKUsr4ListViewBase
*/
@Prop() public viewparam!: string;
/**
* 视图默认使用
*
* @type {boolean}
* @memberof IBIZBOOKUsr4ListViewBase
*/
@Prop({ default: true }) public viewDefaultUsage!: boolean;
/**
* 视图默认使用
*
* @type {string}
* @memberof IBIZBOOKUsr4ListViewBase
*/
@Inject({from:'navModel',default: 'tab'})
public navModel!:string;
/**
* 视图标识
*
* @type {string}
* @memberof IBIZBOOKUsr4ListViewBase
*/
public viewtag: string = 'ec074fd503f6c149b57e2d5b19815f1a';
/**
* 自定义视图导航上下文集合
*
* @type {*}
* @memberof IBIZBOOKUsr4ListViewBase
*/
public customViewNavContexts:any ={
};
/**
* 自定义视图导航参数集合
*
* @type {*}
* @memberof IBIZBOOKUsr4ListViewBase
*/
public customViewParams:any ={
};
/**
* 视图模型数据
*
* @type {*}
* @memberof IBIZBOOKUsr4ListViewBase
*/
public model: any = {
srfCaption: 'entities.ibizbook.views.usr4listview.caption',
srfTitle: 'entities.ibizbook.views.usr4listview.title',
srfSubTitle: 'entities.ibizbook.views.usr4listview.subtitle',
dataInfo: ''
}
/**
* 视图参数变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof IBIZBOOKUsr4ListViewBase
*/
@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 IBIZBOOKUsr4ListViewBase
*/
@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 IBIZBOOKUsr4ListViewBase
*/
public containerModel: any = {
view_toolbar: { name: 'toolbar', type: 'TOOLBAR' },
view_list: { name: 'list', type: 'LIST' },
view_searchform: { name: 'searchform', type: 'SEARCHFORM' },
};
/**
* 视图刷新
*
* @param {*} args
* @memberof IBIZBOOKUsr4ListViewBase
*/
public refresh(args?: any): void {
const refs: any = this.$refs;
if (refs && refs.list) {
refs.list.refresh();
}
}
/**
* 计数器刷新
*
* @memberof IBIZBOOKUsr4ListViewBase
*/
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 IBIZBOOKUsr4ListViewBase
*/
public viewState: Subject<ViewState> = new Subject();
/**
* 工具栏模型
*
* @type {*}
* @memberof IBIZBOOKUsr4ListView
*/
public toolBarModels: any = {
};
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof IBIZBOOKUsr4ListViewBase
*/
public engine: ListViewEngine = new ListViewEngine();
/**
* 引擎初始化
*
* @public
* @memberof IBIZBOOKUsr4ListViewBase
*/
public engineInit(): void {
this.engine.init({
view: this,
list: this.$refs.list,
opendata: (args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any) => {
this.opendata(args,fullargs, params, $event, xData);
},
newdata: (args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any) => {
this.newdata(args,fullargs, params, $event, xData);
},
searchform: this.$refs.searchform,
keyPSDEField: 'ibizbook',
majorPSDEField: 'ibizbookname',
isLoadDefault: true,
});
}
/**
* 应用导航服务
*
* @type {*}
* @memberof IBIZBOOKUsr4ListViewBase
*/
public navDataService = NavDataService.getInstance(this.$store);
/**
* 导航服务事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof IBIZBOOKUsr4ListViewBase
*/
public serviceStateEvent: Subscription | undefined;
/**
* 门户部件状态对象
*
* @type {*}
* @memberof IBIZBOOKUsr4ListViewBase
*/
@Prop() public portletState?: any;
/**
* 门户部件状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof IBIZBOOKUsr4ListViewBase
*/
public portletStateEvent: Subscription | undefined;
/**
* 应用上下文
*
* @type {*}
* @memberof IBIZBOOKUsr4ListViewBase
*/
public context:any = {};
/**
* 视图参数
*
* @type {*}
* @memberof IBIZBOOKUsr4ListViewBase
*/
public viewparams:any = {};
/**
* 视图缓存数据
*
* @type {*}
* @memberof IBIZBOOKUsr4ListViewBase
*/
public viewCacheData:any;
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof IBIZBOOKUsr4ListViewBase
*/
public counterServiceArray:Array<any> = [];
/**
* 解析视图参数
*
* @public
* @memberof IBIZBOOKUsr4ListViewBase
*/
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 IBIZBOOKUsr4ListViewBase
*/
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 IBIZBOOKUsr4ListViewBase
*/
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 IBIZBOOKUsr4ListViewBase
*/
public initNavDataWithRoute(data:any = null, isNew:boolean = false, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && Object.is(this.navModel,"route")) ){
this.navDataService.addNavData({id:'ibizbookusr4-list-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 IBIZBOOKUsr4ListViewBase
*/
public initNavDataWithTab(data:any = null,isOnlyAdd:boolean = true, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && !Object.is(this.navModel,"route")) ){
this.navDataService.addNavDataByOnly({id:'ibizbookusr4-list-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 IBIZBOOKUsr4ListViewBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof IBIZBOOKUsr4ListViewBase
*/
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,'ibizbookusr4-list-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,'IBIZBOOKUsr4ListView')){
return;
}
if(Object.is(res.action,'refresh') && _this.refresh && _this.refresh instanceof Function){
_this.refresh();
}
})
}
}
/**
* 销毁之前
*
* @memberof IBIZBOOKUsr4ListViewBase
*/
public beforeDestroy() {
this.$store.commit('viewaction/removeView', this.viewtag);
}
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof IBIZBOOKUsr4ListViewBase
*/
public mounted() {
this.afterMounted();
}
/**
* 执行mounted后的逻辑
*
* @memberof IBIZBOOKUsr4ListViewBase
*/
public afterMounted(){
const _this: any = this;
_this.engineInit();
if (_this.loadModel && _this.loadModel instanceof Function) {
_this.loadModel();
}
}
/**
* list 部件 selectionchange 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZBOOKUsr4ListViewBase
*/
public list_selectionchange($event: any, $event2?: any) {
this.engine.onCtrlEvent('list', 'selectionchange', $event);
}
/**
* list 部件 beforeload 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZBOOKUsr4ListViewBase
*/
public list_beforeload($event: any, $event2?: any) {
this.engine.onCtrlEvent('list', 'beforeload', $event);
}
/**
* list 部件 rowdblclick 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZBOOKUsr4ListViewBase
*/
public list_rowdblclick($event: any, $event2?: any) {
this.engine.onCtrlEvent('list', 'rowdblclick', $event);
}
/**
* list 部件 remove 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZBOOKUsr4ListViewBase
*/
public list_remove($event: any, $event2?: any) {
this.engine.onCtrlEvent('list', 'remove', $event);
}
/**
* list 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZBOOKUsr4ListViewBase
*/
public list_load($event: any, $event2?: any) {
this.engine.onCtrlEvent('list', 'load', $event);
}
/**
* searchform 部件 save 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZBOOKUsr4ListViewBase
*/
public searchform_save($event: any, $event2?: any) {
this.engine.onCtrlEvent('searchform', 'save', $event);
}
/**
* searchform 部件 search 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZBOOKUsr4ListViewBase
*/
public searchform_search($event: any, $event2?: any) {
this.engine.onCtrlEvent('searchform', 'search', $event);
}
/**
* searchform 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof IBIZBOOKUsr4ListViewBase
*/
public searchform_load($event: any, $event2?: any) {
this.engine.onCtrlEvent('searchform', 'load', $event);
}
/**
* 打开新建数据视图
*
* @param {any[]} args
* @param {*} [params]
* @param {*} [fullargs]
* @param {*} [$event]
* @param {*} [xData]
* @memberof IBIZBOOKUsr4ListView
*/
public newdata(args: any[],fullargs?:any[], params?: any, $event?: any, xData?: any) {
let localContext:any = null;
let localViewParam:any =null;
const data: any = {};
if(args[0].srfsourcekey){
data.srfsourcekey = args[0].srfsourcekey;
}
let tempContext = JSON.parse(JSON.stringify(this.context));
delete tempContext.ibizbook;
if(args.length >0){
Object.assign(tempContext,args[0]);
}
const deResParameters: any[] = [];
const parameters: any[] = [
{ pathName: 'ibizbooks', parameterName: 'ibizbook' },
{ pathName: 'editview', parameterName: 'editview' },
];
const _this: any = this;
const openIndexViewTab = (data: any) => {
const _data: any = { w: (new Date().getTime()) };
Object.assign(_data, data);
const routePath = this.$viewTool.buildUpRoutePath(this.$route, tempContext, deResParameters, parameters, args, _data);
this.$router.push(routePath);
}
openIndexViewTab(data);
}
/**
* 打开编辑数据视图
*
* @param {any[]} args
* @param {*} [params]
* @param {*} [fullargs]
* @param {*} [$event]
* @param {*} [xData]
* @memberof IBIZBOOKUsr4ListView
*/
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;
const data: any = {};
let tempContext = JSON.parse(JSON.stringify(this.context));
if(args.length >0){
Object.assign(tempContext,args[0]);
}
const deResParameters: any[] = [];
const parameters: any[] = [
{ pathName: 'ibizbooks', parameterName: 'ibizbook' },
{ pathName: 'editview', parameterName: 'editview' },
];
const _this: any = this;
if(fullargs && fullargs.copymode){
Object.assign(data,{copymode:true});
}
const openIndexViewTab = (data: any) => {
const routePath = this.$viewTool.buildUpRoutePath(this.$route, tempContext, deResParameters, parameters, args, data);
this.$router.push(routePath);
}
openIndexViewTab(data);
}
/**
* 关闭视图
*
* @param {any[]} args
* @memberof IBIZBOOKUsr4ListViewBase
*/
public closeView(args: any[]): void {
let _view: any = this;
if (_view.viewdata) {
_view.$emit('viewdataschange', Array.isArray(args)?args:[args]);
_view.$emit('close', Array.isArray(args)?args:[args]);
} else if (_view.$tabPageExp) {
_view.$tabPageExp.onClose(_view.$route.fullPath);
}
}
/**
* 销毁视图回调
*
* @memberof IBIZBOOKUsr4ListViewBase
*/
public destroyed(){
this.afterDestroyed();
}
/**
* 执行destroyed后的逻辑
*
* @memberof IBIZBOOKUsr4ListViewBase
*/
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 IBIZBOOKUsr4ListView
*/
public query: string = '';
/**
* 是否展开搜索表单
*
* @type {boolean}
* @memberof IBIZBOOKUsr4ListView
*/
public isExpandSearchForm: boolean = false;
/**
* 快速搜索
*
* @param {*} $event
* @memberof IBIZBOOKUsr4ListView
*/
public onSearch($event: any): void {
const refs: any = this.$refs;
if (refs.list) {
refs.list.load({});
}
}
}
</script>
<style lang='less'>
@import './ibizbookusr4-list-view.less';
</style>
\ No newline at end of file
.ibizbookusr4-list-view{
position: relative;
}
.toolbar-container {
button {
margin: 6px 0px 4px 4px;
.caption {
margin-left: 4px;
}
}
.seperator {
color: #dcdee2;
margin: 0 0px 0 4px;
}
}
// this is less
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import IBIZBOOKUsr4ListViewBase from './ibizbookusr4-list-view-base.vue';
import view_list from '@widgets/ibizbook/lnternal-func-list-list/lnternal-func-list-list.vue';
import view_searchform from '@widgets/ibizbook/default-searchform/default-searchform.vue';
@Component({
components: {
view_list,
view_searchform,
},
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 IBIZBOOKUsr4ListView extends IBIZBOOKUsr4ListViewBase {
}
</script>
\ No newline at end of file
......@@ -52,6 +52,7 @@ export const PageComponents = {
Vue.component('ibizbookmedit-view9', () => import('@pages/sample/ibizbookmedit-view9/ibizbookmedit-view9.vue'));
Vue.component('ibizorder-sf5-grid-view', () => import('@pages/sample/ibizorder-sf5-grid-view/ibizorder-sf5-grid-view.vue'));
Vue.component('ibizcustomer-edit-view', () => import('@pages/sample/ibizcustomer-edit-view/ibizcustomer-edit-view.vue'));
Vue.component('ibizbookusr4-list-view', () => import('@pages/sample/ibizbookusr4-list-view/ibizbookusr4-list-view.vue'));
Vue.component('ibizbookgroup-by-codelist-kan-ban-view', () => import('@pages/sample/ibizbookgroup-by-codelist-kan-ban-view/ibizbookgroup-by-codelist-kan-ban-view.vue'));
Vue.component('ibizbookusr3-data-view', () => import('@pages/sample/ibizbookusr3-data-view/ibizbookusr3-data-view.vue'));
Vue.component('ibizorder-detail-grid-view9', () => import('@pages/sample/ibizorder-detail-grid-view9/ibizorder-detail-grid-view9.vue'));
......@@ -109,6 +110,7 @@ export const PageComponents = {
Vue.component('ibizorder-f9-edit-view', () => import('@pages/sample/ibizorder-f9-edit-view/ibizorder-f9-edit-view.vue'));
Vue.component('ibizbookrules-edit-view', () => import('@pages/sample/ibizbookrules-edit-view/ibizbookrules-edit-view.vue'));
Vue.component('ibizsample0001-usr3-grid-view', () => import('@pages/sample/ibizsample0001-usr3-grid-view/ibizsample0001-usr3-grid-view.vue'));
Vue.component('ibizbookusr2-tree-view', () => import('@pages/sample/ibizbookusr2-tree-view/ibizbookusr2-tree-view.vue'));
Vue.component('ibizorder-wfstart-view', () => import('@pages/sample/ibizorder-wfstart-view/ibizorder-wfstart-view.vue'));
Vue.component('ibizsample0003-f4-tree-exp-view', () => import('@pages/sample/ibizsample0003-f4-tree-exp-view/ibizsample0003-f4-tree-exp-view.vue'));
Vue.component('ibizorder-f10-edit-view', () => import('@pages/sample/ibizorder-f10-edit-view/ibizorder-f10-edit-view.vue'));
......
......@@ -882,6 +882,20 @@ const router = new Router({
},
component: () => import('@pages/sample/ibizcustomer-edit-view/ibizcustomer-edit-view.vue'),
},
{
path: 'ibizbooks/:ibizbook?/usr4listview/:usr4listview?',
meta: {
caption: 'entities.ibizbook.views.usr4listview.caption',
info:'',
parameters: [
{ pathName: 'index', parameterName: 'index' },
{ pathName: 'ibizbooks', parameterName: 'ibizbook' },
{ pathName: 'usr4listview', parameterName: 'usr4listview' },
],
requireAuth: true,
},
component: () => import('@pages/sample/ibizbookusr4-list-view/ibizbookusr4-list-view.vue'),
},
{
path: 'ibizbooks/:ibizbook?/groupbycodelistkanbanview/:groupbycodelistkanbanview?',
meta: {
......@@ -1755,6 +1769,20 @@ const router = new Router({
},
component: () => import('@pages/sample/ibizsample0001-usr3-grid-view/ibizsample0001-usr3-grid-view.vue'),
},
{
path: 'ibizbooks/:ibizbook?/usr2treeview/:usr2treeview?',
meta: {
caption: 'entities.ibizbook.views.usr2treeview.caption',
info:'',
parameters: [
{ pathName: 'index', parameterName: 'index' },
{ pathName: 'ibizbooks', parameterName: 'ibizbook' },
{ pathName: 'usr2treeview', parameterName: 'usr2treeview' },
],
requireAuth: true,
},
component: () => import('@pages/sample/ibizbookusr2-tree-view/ibizbookusr2-tree-view.vue'),
},
{
path: 'ibizorders/:ibizorder?/wfstartview/:wfstartview?',
meta: {
......@@ -5006,6 +5034,19 @@ const router = new Router({
},
component: () => import('@pages/sample/ibizappctrledit-view/ibizappctrledit-view.vue'),
},
{
path: '/ibizbooks/:ibizbook?/usr2treeview/:usr2treeview?',
meta: {
caption: 'entities.ibizbook.views.usr2treeview.caption',
info:'',
parameters: [
{ pathName: 'ibizbooks', parameterName: 'ibizbook' },
{ pathName: 'usr2treeview', parameterName: 'usr2treeview' },
],
requireAuth: true,
},
component: () => import('@pages/sample/ibizbookusr2-tree-view/ibizbookusr2-tree-view.vue'),
},
{
path: '/ibizorders/:ibizorder?/zdytpgridview/:zdytpgridview?',
meta: {
......@@ -5136,6 +5177,19 @@ const router = new Router({
},
component: () => import('@pages/sample/ibizsample0003-f1-tree-exp-view/ibizsample0003-f1-tree-exp-view.vue'),
},
{
path: '/ibizbooks/:ibizbook?/usr4listview/:usr4listview?',
meta: {
caption: 'entities.ibizbook.views.usr4listview.caption',
info:'',
parameters: [
{ pathName: 'ibizbooks', parameterName: 'ibizbook' },
{ pathName: 'usr4listview', parameterName: 'usr4listview' },
],
requireAuth: true,
},
component: () => import('@pages/sample/ibizbookusr4-list-view/ibizbookusr4-list-view.vue'),
},
{
path: '/ibizuniproducts/:ibizuniproduct?/pickupview/:pickupview?',
meta: {
......
......@@ -233,6 +233,7 @@ export const viewstate: any = {
'0b8c0a8b7a5b8b73595b23fc502652fc',
'59500fe075fdae44c35c88b95e64d9c8',
'b7c0a73eb248d41eb750bbf095fa5505',
'ec074fd503f6c149b57e2d5b19815f1a',
'3041238537beef69c0f3410a1ba04c84',
'e14e0fa8f3def77ebbcf18f1f39c0225',
'd3255261c8522c660c1000cd0a61c3b0',
......@@ -248,8 +249,8 @@ export const viewstate: any = {
'd3321077dfab8bc6b92c649e5b69daf3',
'836bdb4063978b55fedd6a180d60c323',
'e54ae8e27a53b3425ac78a229a163bd5',
'794fbfb192285c60dc9ce640270d79c0',
'369a14f21cbff0d0fe23831aecfca7ba',
'794fbfb192285c60dc9ce640270d79c0',
'cceb88c50ae9567f3f0ee1d7164f1d6e',
'a894de140705ecab2f39797d2922a3ce',
'ea604a66caf499c70c9002a917dd1694',
......@@ -271,6 +272,7 @@ export const viewstate: any = {
'16b68282950fb352dfe27e94bda47304',
'2bf74d5d66fa6d8d38b21b090586529b',
'8d1205a914564cbd528cadc3963c2905',
'e240a385ba3c1e752f1a3aed838e9b58',
'59c5d311d09a7f68f8b6962ca652374a',
'ad37d44e57c18e4431a609968203c646',
'7f65e6161c444d29e1f53f1cb76e92de',
......@@ -1683,6 +1685,15 @@ export const viewstate: any = {
refviews: [
],
},
{
viewtag: 'e240a385ba3c1e752f1a3aed838e9b58',
viewmodule: 'Sample',
viewname: 'IBIZBOOKUsr2TreeView',
viewaction: '',
viewdatachange: false,
refviews: [
],
},
{
viewtag: 'e2a1c9cb077cd2c74f2f2b914fb1db84',
viewmodule: 'Sample',
......@@ -1783,6 +1794,16 @@ export const viewstate: any = {
'b29d930f430c127162f83753d85dd40c',
],
},
{
viewtag: 'ec074fd503f6c149b57e2d5b19815f1a',
viewmodule: 'Sample',
viewname: 'IBIZBOOKUsr4ListView',
viewaction: '',
viewdatachange: false,
refviews: [
'b3429ecc4d89a02bc5f5279f1bd7f620',
],
},
{
viewtag: 'ec6cfd868c34a036250a813b24068519',
viewmodule: 'Sample',
......
......@@ -674,6 +674,9 @@ export default class MainMenuBase extends Vue implements ControlInterface {
case 'Auto402':
this.clickAuto402(item);
return;
case 'AppFunc90':
this.clickAppFunc90(item);
return;
case 'AppFunc62':
this.clickAppFunc62(item);
return;
......@@ -707,6 +710,9 @@ export default class MainMenuBase extends Vue implements ControlInterface {
case 'AppFunc84':
this.clickAppFunc84(item);
return;
case 'AppFunc91':
this.clickAppFunc91(item);
return;
case 'AppFunc58':
this.clickAppFunc58(item);
return;
......@@ -1562,6 +1568,29 @@ export default class MainMenuBase extends Vue implements ControlInterface {
})
}
/**
* 列表视图
*
* @param {*} [item={}]
* @memberof MainMenu
*/
public clickAppFunc90(item: any = {}) {
const viewparam: any = {};
Object.assign(viewparam, {});
const deResParameters: any[] = [];
const parameters: any[] = [
{ pathName: 'ibizbooks', parameterName: 'ibizbook' },
{ pathName: 'usr4listview', parameterName: 'usr4listview' },
];
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);
})
}
/**
* 客户实体示例数据补充
*
......@@ -1815,6 +1844,29 @@ export default class MainMenuBase extends Vue implements ControlInterface {
})
}
/**
* 实体树视图
*
* @param {*} [item={}]
* @memberof MainMenu
*/
public clickAppFunc91(item: any = {}) {
const viewparam: any = {};
Object.assign(viewparam, {});
const deResParameters: any[] = [];
const parameters: any[] = [
{ pathName: 'ibizbooks', parameterName: 'ibizbook' },
{ pathName: 'usr2treeview', parameterName: 'usr2treeview' },
];
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);
})
}
/**
* 实体卡片导航视图
*
......
......@@ -2290,7 +2290,7 @@ export default class MainMenuModel {
iconcls: '',
icon: '',
textcls: '',
appfunctag: '',
appfunctag: 'AppFunc90',
resourcetag: '',
authtag:'Web-MainMenu-menuitem9',
},
......@@ -2366,7 +2366,7 @@ export default class MainMenuModel {
iconcls: '',
icon: '',
textcls: '',
appfunctag: '',
appfunctag: 'AppFunc91',
resourcetag: '',
authtag:'Web-MainMenu-menuitem173',
},
......@@ -2843,10 +2843,10 @@ export default class MainMenuModel {
{
id: '5BD8B4AB-A156-45B0-9C2F-9C7E80F5AB07',
name: 'menuitem181',
text: '前界面行为',
text: '前界面行为',
type: 'MENUITEM',
counterid: '',
tooltip: '前界面行为',
tooltip: '前界面行为',
expanded: false,
separator: false,
hidden: false,
......@@ -3658,6 +3658,18 @@ export default class MainMenuModel {
{ pathName: 'seditview2', parameterName: 'seditview2' },
],
},
{
appfunctag: 'AppFunc90',
appfuncyype: 'APPVIEW',
openmode: '',
codename: 'ibizbookusr4listview',
deResParameters: [],
routepath: '/index/:index?/ibizbooks/:ibizbook?/usr4listview/:usr4listview?',
parameters: [
{ pathName: 'ibizbooks', parameterName: 'ibizbook' },
{ pathName: 'usr4listview', parameterName: 'usr4listview' },
],
},
{
appfunctag: 'AppFunc62',
appfuncyype: 'APPVIEW',
......@@ -3790,6 +3802,18 @@ export default class MainMenuModel {
{ pathName: 'treeview', parameterName: 'treeview' },
],
},
{
appfunctag: 'AppFunc91',
appfuncyype: 'APPVIEW',
openmode: '',
codename: 'ibizbookusr2treeview',
deResParameters: [],
routepath: '/index/:index?/ibizbooks/:ibizbook?/usr2treeview/:usr2treeview?',
parameters: [
{ pathName: 'ibizbooks', parameterName: 'ibizbook' },
{ pathName: 'usr2treeview', parameterName: 'usr2treeview' },
],
},
{
appfunctag: 'AppFunc58',
appfuncyype: 'APPVIEW',
......
......@@ -47,11 +47,11 @@
<span class="quick-toolbar">
<div class='toolbar-container'>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="listviewlist_quicktoolbarModels.deuiaction1.visabled" :disabled="listviewlist_quicktoolbarModels.deuiaction1.disabled" class='' v-loading:i-button @click="list_quicktoolbar_click({ tag: 'deuiaction1' }, $event)">
<i-button v-show="usr4listviewlist_quicktoolbarModels.deuiaction1.visabled" :disabled="usr4listviewlist_quicktoolbarModels.deuiaction1.disabled" class='' v-loading:i-button @click="list_quicktoolbar_click({ tag: 'deuiaction1' }, $event)">
<i class='fa fa-file-text-o'></i>
<span class='caption'>{{$t('entities.ibizbook.listviewlist_quicktoolbar_toolbar.deuiaction1.caption')}}</span>
<span class='caption'>{{$t('entities.ibizbook.usr4listviewlist_quicktoolbar_toolbar.deuiaction1.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.ibizbook.listviewlist_quicktoolbar_toolbar.deuiaction1.tip')}}</div>
<div slot='content'>{{$t('entities.ibizbook.usr4listviewlist_quicktoolbar_toolbar.deuiaction1.tip')}}</div>
</tooltip>
</div>
</span>
......@@ -62,18 +62,18 @@
<span class="batch-toolbar">
<div class='toolbar-container'>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="listviewlist_batchtoolbarModels.deuiaction1.visabled" :disabled="listviewlist_batchtoolbarModels.deuiaction1.disabled" class='' v-loading:i-button @click="list_batchtoolbar_click({ tag: 'deuiaction1' }, $event)">
<i-button v-show="usr4listviewlist_batchtoolbarModels.deuiaction1.visabled" :disabled="usr4listviewlist_batchtoolbarModels.deuiaction1.disabled" class='' v-loading:i-button @click="list_batchtoolbar_click({ tag: 'deuiaction1' }, $event)">
<i class='fa fa-edit'></i>
<span class='caption'>{{$t('entities.ibizbook.listviewlist_batchtoolbar_toolbar.deuiaction1.caption')}}</span>
<span class='caption'>{{$t('entities.ibizbook.usr4listviewlist_batchtoolbar_toolbar.deuiaction1.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.ibizbook.listviewlist_batchtoolbar_toolbar.deuiaction1.tip')}}</div>
<div slot='content'>{{$t('entities.ibizbook.usr4listviewlist_batchtoolbar_toolbar.deuiaction1.tip')}}</div>
</tooltip>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="listviewlist_batchtoolbarModels.deuiaction2.visabled" :disabled="listviewlist_batchtoolbarModels.deuiaction2.disabled" class='' v-loading:i-button @click="list_batchtoolbar_click({ tag: 'deuiaction2' }, $event)">
<i-button v-show="usr4listviewlist_batchtoolbarModels.deuiaction2.visabled" :disabled="usr4listviewlist_batchtoolbarModels.deuiaction2.disabled" class='' v-loading:i-button @click="list_batchtoolbar_click({ tag: 'deuiaction2' }, $event)">
<i class='fa fa-remove'></i>
<span class='caption'>{{$t('entities.ibizbook.listviewlist_batchtoolbar_toolbar.deuiaction2.caption')}}</span>
<span class='caption'>{{$t('entities.ibizbook.usr4listviewlist_batchtoolbar_toolbar.deuiaction2.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.ibizbook.listviewlist_batchtoolbar_toolbar.deuiaction2.tip')}}</div>
<div slot='content'>{{$t('entities.ibizbook.usr4listviewlist_batchtoolbar_toolbar.deuiaction2.tip')}}</div>
</tooltip>
</div>
</span>
......@@ -355,7 +355,7 @@ export default class LnternalFuncListBase extends Vue implements ControlInterfac
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof IBIZBOOKListViewBase
* @memberof IBIZBOOKUsr4ListViewBase
*/
public New(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
......@@ -375,7 +375,7 @@ export default class LnternalFuncListBase extends Vue implements ControlInterfac
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof IBIZBOOKListViewBase
* @memberof IBIZBOOKUsr4ListViewBase
*/
public Edit(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
if (args.length === 0) {
......@@ -401,7 +401,7 @@ export default class LnternalFuncListBase extends Vue implements ControlInterfac
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof IBIZBOOKListViewBase
* @memberof IBIZBOOKUsr4ListViewBase
*/
public Remove(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
......@@ -568,9 +568,9 @@ export default class LnternalFuncListBase extends Vue implements ControlInterfac
* 工具栏模型
*
* @type {*}
* @memberof IBIZBOOKListView
* @memberof IBIZBOOKUsr4ListView
*/
public listviewlist_quicktoolbarModels: any = {
public usr4listviewlist_quicktoolbarModels: any = {
deuiaction1: { name: 'deuiaction1', actiontarget: 'NONE', caption: '新建', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'New', target: '' } },
};
......@@ -580,9 +580,9 @@ export default class LnternalFuncListBase extends Vue implements ControlInterfac
* 工具栏模型
*
* @type {*}
* @memberof IBIZBOOKListView
* @memberof IBIZBOOKUsr4ListView
*/
public listviewlist_batchtoolbarModels: any = {
public usr4listviewlist_batchtoolbarModels: any = {
deuiaction1: { name: 'deuiaction1', actiontarget: 'NONE', caption: '编辑', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'Edit', target: 'SINGLEKEY' } },
deuiaction2: { name: 'deuiaction2', actiontarget: 'NONE', caption: '删除', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'Remove', target: 'MULTIKEY' } },
......@@ -804,7 +804,7 @@ export default class LnternalFuncListBase extends Vue implements ControlInterfac
*/
public load(opt: any = {}): void {
if(!this.fetchAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKListView' + (this.$t('app.list.notConfig.fetchAction') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKUsr4ListView' + (this.$t('app.list.notConfig.fetchAction') as string) });
return;
}
const arg: any = {...opt};
......@@ -920,7 +920,7 @@ export default class LnternalFuncListBase extends Vue implements ControlInterfac
*/
public async remove(datas: any[]): Promise<any> {
if(!this.removeAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKListView' + (this.$t('app.list.notConfig.removeAction') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKUsr4ListView' + (this.$t('app.list.notConfig.removeAction') as string) });
return;
}
if (datas.length === 0) {
......@@ -1015,7 +1015,7 @@ export default class LnternalFuncListBase extends Vue implements ControlInterfac
try {
if(Object.is(item.rowDataState, 'create')){
if(!this.createAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKListView' + (this.$t('app.list.notConfig.createAction') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKUsr4ListView' + (this.$t('app.list.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);
......@@ -1023,7 +1023,7 @@ export default class LnternalFuncListBase extends Vue implements ControlInterfac
}
}else if(Object.is(item.rowDataState, 'update')){
if(!this.updateAction){
this.$Notice.error({ title: (this.$t('app.commonWords.warning') as string), desc: 'IBIZBOOKListView' + (this.$t('app.list.notConfig.updateAction') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.warning') as string), desc: 'IBIZBOOKUsr4ListView' + (this.$t('app.list.notConfig.updateAction') as string) });
}else{
Object.assign(item,{viewparams:this.viewparams});
if(item.ibizbook){
......
<template>
<div class="design-tree-container">
<context-menu-container>
<el-tree
v-if="inited"
ref="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.ibizbook.treeview_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 IBIZBOOKService from '@/service/ibizbook/ibizbook-service';
import TreeService from './tree-view-treeview-service';
import IBIZBOOKUIService from '@/uiservice/ibizbook/ibizbook-ui-service';
import { Environment } from '@/environments/environment';
import UIService from '@/uiservice/ui-service';
@Component({
components: {
}
})
export default class TreeBase extends Vue implements ControlInterface {
/**
* 名称
*
* @type {string}
* @memberof TreeBase
*/
@Prop() public name?: string;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof TreeBase
*/
@Prop() public viewState!: Subject<ViewState>;
/**
* 应用上下文
*
* @type {*}
* @memberof TreeBase
*/
@Prop() public context!: any;
/**
* 视图参数
*
* @type {*}
* @memberof TreeBase
*/
@Prop() public viewparams!: any;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof TreeBase
*/
public viewStateEvent: Subscription | undefined;
/**
* 获取部件类型
*
* @returns {string}
* @memberof TreeBase
*/
public getControlType(): string {
return 'TREEVIEW'
}
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof TreeBase
*/
public counterServiceArray:Array<any> = [];
/**
* 建构部件服务对象
*
* @type {TreeService}
* @memberof TreeBase
*/
public service: TreeService = new TreeService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {IBIZBOOKService}
* @memberof TreeBase
*/
public appEntityService: IBIZBOOKService = new IBIZBOOKService({ $store: this.$store });
/**
* 转化数据
*
* @param {any} args
* @memberof TreeBase
*/
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 TreeBase
*/
public closeView(args: any): void {
let _this: any = this;
_this.$emit('closeview', [args]);
}
/**
* 计数器刷新
*
* @memberof TreeBase
*/
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 TreeBase
*/
public getDatas(): any[] {
return [this.currentselectedNode];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof TreeBase
*/
public getData(): any {
return this.currentselectedNode;
}
/**
* 是否单选
*
* @type {boolean}
* @memberof TreeBase
*/
@Prop({ default: true }) public isSingleSelect!: boolean;
/**
* 是否默认选中第一条数据
*
* @type {boolean}
* @memberof TreeBase
*/
@Prop({ default: false }) public isSelectFirstDefault!: boolean;
/**
* 枝干节点是否可用(具有数据能力,可抛出)
*
* @type {string}
* @memberof TreeBase
*/
@Prop({default:true}) public isBranchAvailable!: boolean;
/**
* 显示处理提示
*
* @type {boolean}
* @memberof TreeBase
*/
@Prop({ default: true }) public showBusyIndicator?: boolean;
/**
* 初始化完成
*
* @type {boolean}
* @memberof TreeBase
*/
public inited: boolean = false;
/**
* 已选中数据集合
*
* @type {*}
* @memberof TreeBase
*/
public selectedNodes: any = [];
/**
* 当前选中数据项
*
* @type {*}
* @memberof TreeBase
*/
public currentselectedNode: any = {};
/**
* 选中数据字符串
*
* @type {string}
* @memberof TreeBase
*/
@Prop() public selectedData!: string;
/**
* 选中值变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof TreeBase
*/
@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 TreeBase
*/
public echoselectedNodes:any[] = this.selectedData ? ( this.isSingleSelect ? [JSON.parse(this.selectedData)[0]] : JSON.parse(this.selectedData)) : [];
/**
* 部件行为--update
*
* @type {string}
* @memberof TreeBase
*/
@Prop() public updateAction!: string;
/**
* 部件行为--fetch
*
* @type {string}
* @memberof TreeBase
*/
@Prop() public fetchAction!: string;
/**
* 部件行为--remove
*
* @type {string}
* @memberof TreeBase
*/
@Prop() public removeAction!: string;
/**
* 部件行为--load
*
* @type {string}
* @memberof TreeBase
*/
@Prop() public loadAction!: string;
/**
* 部件行为--create
*
* @type {string}
* @memberof TreeBase
*/
@Prop() public createAction!: string;
/**
* 过滤属性
*
* @type {string}
* @memberof TreeBase
*/
public srfnodefilter: string = '';
/**
* 默认输出图标
*
* @type {boolean}
* @memberof TreeBase
*/
public isOutputIconDefault: boolean = true;
/**
* 数据展开主键
*
* @type {string[]}
* @memberof TreeBase
*/
@Provide()
public expandedKeys: string[] = [];
/**
* 应用状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof TreeBase
*/
public appStateEvent: Subscription | undefined;
/**
* 树节点上下文菜单集合
*
* @type {string[]}
* @memberof TreeBase
*/
public actionModel: any = {
}
/**
* 备份树节点上下文菜单
*
* @type any
* @memberof MainTreeBase
*/
public copyActionModel:any;
/**
* 选中数据变更事件
*
* @public
* @param {*} data
* @param {*} data 当前节点对应传入对象
* @param {*} checkedState 树目前选中状态对象
* @memberof TreeBase
*/
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 TreeBase
*/
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 TreeBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof TreeBase
*/
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,"IBIZBOOK")){
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 TreeBase
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof TreeBase
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
if(this.appStateEvent){
this.appStateEvent.unsubscribe();
}
}
/**
* 刷新数据
*
* @memberof TreeBase
*/
public refresh_all(): void {
this.inited = false;
this.$nextTick(() => {
this.inited = true;
});
}
/**
* 刷新当前节点
*
* @memberof TreeBase
*/
public refresh_current(): void {
if (Object.keys(this.currentselectedNode).length === 0) {
return;
}
const tree: any = this.$refs.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 TreeBase
*/
public refresh_parent(): void {
if (Object.keys(this.currentselectedNode).length === 0) {
return;
}
const tree: any = this.$refs.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 TreeBase
*/
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 TreeBase
*/
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 TreeBase
*/
public refresh(args?: any): void {
this.refresh_all();
}
/**
* 刷新节点
*
* @public
* @param {*} [curContext] 当前节点上下文
* @param {*} [arg={}] 当前节点附加参数
* @param {boolean} parentnode 是否是刷新父节点
* @memberof TreeBase
*/
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.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 TreeBase
*/
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 TreeBase
*/
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.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 TreeBase
*/
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 TreeBase
*/
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 TreeBase
*/
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 TreeBase
*/
public setTreeNodeHighLight(data: any): void {
const tree: any = this.$refs.tree;
tree.setCurrentKey(data.id);
}
/**
* 执行默认界面行为
*
* @param {*} node
* @memberof TreeBase
*/
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-view-treeview.less';
</style>
\ No newline at end of file
/**
* Tree 部件模型
*
* @export
* @class TreeModel
*/
export default class TreeModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof TreeModel
*/
public getDataItems(): any[] {
return [
{
name: 'createman',
},
{
name: 'ibizbookname',
},
{
name: 'ibizbook',
prop: 'ibizbookid',
},
{
name: 'createdate',
},
{
name: 'updateman',
},
{
name: 'updatedate',
},
{
name: 'author',
},
{
name: 'price',
},
{
name: 'press',
},
{
name: 'type',
},
{
name: 'booknumber',
},
{
name: 'subtext',
},
{
name: 'lendouttime',
},
{
name: 'returntime',
},
{
name: 'icon',
},
{
name: 'sailstate',
},
{
name: 'borrowstatus',
},
{
name: 'stepstatus',
},
{
name: 'borrower',
},
{
name: 'borrowway',
},
{
name: 'returnlib',
},
{
name: 'borrowerid',
},
{
name: 'borrower1',
},
{
name: 'borrower1_id',
},
{
name: 'borrower2',
},
{
name: 'borrower2_id',
},
{
name: 'borrower3',
},
{
name: 'borrower3_id',
},
{
name: 'tag',
},
]
}
}
\ 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 TreeModel from './tree-view-treeview-model';
import CodeListService from "@/codelist/codelist-service";
import i18n from '@/locale';
/**
* Tree 部件服务对象
*
* @export
* @class TreeService
*/
export default class TreeService extends ControlService {
/**
* 图书服务对象
*
* @type {IBIZBOOKService}
* @memberof TreeService
*/
public appEntityService: IBIZBOOKService = new IBIZBOOKService({ $store: this.getStore() });
/**
* 设置从数据模式
*
* @type {boolean}
* @memberof TreeService
*/
public setTempMode(){
this.isTempMode = false;
}
/**
* Creates an instance of TreeService.
*
* @param {*} [opts={}]
* @memberof TreeService
*/
constructor(opts: any = {}) {
super(opts);
this.model = new TreeModel();
}
/**
* 代码表服务对象
*
* @type {CodeListService}
* @memberof TreeService
*/
public codeListService:CodeListService = new CodeListService({ $store: this.getStore() });
/**
* 节点分隔符号
*
* @public
* @type {string}
* @memberof TreeService
*/
public TREENODE_SEPARATOR: string = ';';
/**
* 默认根节点节点分隔符号
*
* @public
* @type {string}
* @memberof TreeService
*/
public TREENODE_ROOT: string = 'ROOT';
/**
* 图书数据节点分隔符号
*
* @public
* @type {string}
* @memberof TreeService
*/
public TREENODE_BOOKDATA: string = 'bookdata';
/**
* 图书节点分隔符号
*
* @public
* @type {string}
* @memberof TreeService
*/
public TREENODE_BOOK: string = 'book';
/**
* 获取节点数据
*
* @param {string} action
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof TreeService
*/
@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_ROOT)) {
await this.fillRootNodeChilds(context,filter, list);
return Promise.resolve({ status: 200, data: list });
}
if (Object.is(strNodeType, this.TREENODE_BOOKDATA)) {
await this.fillBookdataNodeChilds(context,filter, list);
return Promise.resolve({ status: 200, data: list });
}
if (Object.is(strNodeType, this.TREENODE_BOOK)) {
await this.fillBookNodeChilds(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 TreeService
*/
@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.ibizbook.treeview_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 TreeService
*/
@Errorlog
public async fillRootNodeChilds(context:any={}, filter: any, list: any[]): Promise<any> {
if (filter.srfnodefilter && !Object.is(filter.srfnodefilter,"")) {
// 填充图书
let BookRsNavContext:any = {};
let BookRsNavParams:any = {};
let BookRsParams:any = {};
await this.fillBookNodes(context, filter, list ,BookRsNavContext,BookRsNavParams,BookRsParams);
} else {
// 填充图书
let BookRsNavContext:any = {};
let BookRsNavParams:any = {};
let BookRsParams:any = {};
await this.fillBookNodes(context, filter, list ,BookRsNavContext,BookRsNavParams,BookRsParams);
}
}
/**
* 填充 树视图节点[图书数据]
*
* @public
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @param {*} rsNavContext
* @param {*} rsNavParams
* @param {*} rsParams
* @returns {Promise<any>}
* @memberof TreeService
*/
@Errorlog
public fillBookdataNodes(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 searchFilter: any = {};
Object.assign(searchFilter, { total: false });
let bFirst: boolean = true;
let records: any[] = [];
try {
this.searchBookdata(context, searchFilter, filter).then((records:any) =>{
if(records && records.length >0){
records.forEach((entity: any) => {
let treeNode: any = {};
// 整理context
let strId: string = entity.ibizbookid;
let strText: string = entity.ibizbookname;
Object.assign(treeNode,{srfparentdename:'IBIZBOOK',srfparentkey:entity.ibizbookid});
let tempContext:any = JSON.parse(JSON.stringify(context));
Object.assign(tempContext,{srfparentdename:'IBIZBOOK',srfparentkey:entity.ibizbookid,ibizbook:strId})
Object.assign(treeNode,{srfappctx:tempContext});
Object.assign(treeNode,{'ibizbook':strId});
Object.assign(treeNode, { srfkey: strId });
Object.assign(treeNode, { text: strText, srfmajortext: strText });
let strNodeId: string = 'bookdata';
strNodeId += this.TREENODE_SEPARATOR;
strNodeId += strId;
Object.assign(treeNode, { id: strNodeId });
Object.assign(treeNode, { expanded: filter.isautoexpand });
Object.assign(treeNode, { leaf: true });
Object.assign(treeNode, { curData: entity });
Object.assign(treeNode, { nodeid: treeNode.srfkey });
Object.assign(treeNode, { nodeid2: filter.strRealNodeId });
Object.assign(treeNode, { nodeType: "DE",appEntityName:"ibizbook" });
list.push(treeNode);
resolve(list);
bFirst = false;
});
}else{
resolve(list);
}
});
} catch (error) {
console.error(error);
}
});
}
/**
* 获取查询集合
*
* @public
* @param {any{}} context
* @param {*} searchFilter
* @param {*} filter
* @returns {any[]}
* @memberof TestEnetityDatasService
*/
@Errorlog
public searchBookdata(context:any={}, searchFilter: any, filter: any): Promise<any> {
return new Promise((resolve:any,reject:any) =>{
if(filter.viewparams){
Object.assign(searchFilter,filter.viewparams);
}
if(!searchFilter.page){
Object.assign(searchFilter,{page:0});
}
if(!searchFilter.size){
Object.assign(searchFilter,{size:1000});
}
if(context && context.srfparentdename){
Object.assign(searchFilter,{srfparentdename:JSON.parse(JSON.stringify(context)).srfparentdename});
}
if(context && context.srfparentkey){
Object.assign(searchFilter,{srfparentkey:JSON.parse(JSON.stringify(context)).srfparentkey});
}
const _appEntityService: any = this.appEntityService;
let list: any[] = [];
if (_appEntityService['FetchDefault'] && _appEntityService['FetchDefault'] instanceof Function) {
const response: Promise<any> = _appEntityService['FetchDefault'](context, searchFilter, false);
response.then((response: any) => {
if (!response.status || response.status !== 200) {
resolve([]);
console.log(JSON.stringify(context));
console.error('查询FetchDefault数据集异常!');
}
const data: any = response.data;
if (Object.keys(data).length > 0) {
list = JSON.parse(JSON.stringify(data));
resolve(list);
} else {
resolve([]);
}
}).catch((response: any) => {
resolve([]);
console.log(JSON.stringify(context));
console.error('查询FetchDefault数据集异常!');
});
}
})
}
/**
* 填充 树视图节点[图书数据]子节点
*
* @public
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @returns {Promise<any>}
* @memberof TreeService
*/
@Errorlog
public async fillBookdataNodeChilds(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 TreeService
*/
@Errorlog
public fillBookNodes(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.ibizbook.treeview_treeview.nodes.book') });
Object.assign(treeNode, { isUseLangRes: true });
Object.assign(treeNode,{srfappctx:context});
Object.assign(treeNode, { srfmajortext: treeNode.text });
let strNodeId: string = 'book';
// 没有指定节点值,直接使用父节点值
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 TreeService
*/
@Errorlog
public async fillBookNodeChilds(context:any={}, filter: any, list: any[]): Promise<any> {
if (filter.srfnodefilter && !Object.is(filter.srfnodefilter,"")) {
// 填充图书数据
let BookdataRsNavContext:any = {};
let BookdataRsNavParams:any = {};
let BookdataRsParams:any = {};
await this.fillBookdataNodes(context, filter, list ,BookdataRsNavContext,BookdataRsNavParams,BookdataRsParams);
} else {
// 填充图书数据
let BookdataRsNavContext:any = {};
let BookdataRsNavParams:any = {};
let BookdataRsParams:any = {};
await this.fillBookdataNodes(context, filter, list ,BookdataRsNavContext,BookdataRsNavParams,BookdataRsParams);
}
}
/**
* 处理代码表返回数据(树状结构)
*
* @param result 返回数组
* @param context 应用上下文
* @param callBack 回调
* @memberof TreeService
*/
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 TreeService
*/
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 TreeService
*/
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 TreeService
*/
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 TreeService
*/
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 TreeService
*/
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 TreeBase from './tree-view-treeview-base.vue';
@Component({
components: {
}
})
export default class Tree extends TreeBase {
}
</script>
\ No newline at end of file
......@@ -358,7 +358,7 @@
{
"appid":"Web",
"appname":"演示应用",
"appmenu":[{"menuid":"MainMenu", "menuname":"MainMenu", "menuitem":[{ "id":"menuitem1" , "name":"工作台" },{ "id":"menuitem3" , "name":"控件" , "items":[{ "id":"menuitem6" , "name":"默认数据类型" },{ "id":"menuitem7" , "name":"默认编辑器类型" },{ "id":"menuitem72" , "name":"扩展编辑器" },{ "id":"menuitem151" , "name":"编辑器插件示例" },{ "id":"menuitem65" , "name":"微服务组件" }]},{ "id":"menuitem4" , "name":"部件" , "items":[{ "id":"menuitem112" , "name":"应用类" , "items":[{ "id":"menuitem186" , "name":"数据看板" },{ "id":"menuitem129" , "name":"门户部件" }]},{ "id":"menuitem156" , "name":"表单类" , "items":[{ "id":"menuitem12" , "name":"编辑表单" , "items":[{ "id":"menuitem15" , "name":"基础表单项" },{ "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":"menuitem126" , "name":"实体数据看板" }]},{ "id":"menuitem157" , "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":"menuitem145" , "name":"选择视图面板" },{ "id":"menuitem17" , "name":"向导面板" , "items":[{ "id":"menuitem134" , "name":"基础用法" },{ "id":"menuitem135" , "name":"状态属性" }]},{ "id":"menuitem121" , "name":"多编辑视图面板" , "items":[{ "id":"menuitem115" , "name":"多表单(行记录)" },{ "id":"menuitem123" , "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":"menuitem83" , "name":"列表" , "items":[{ "id":"menuitem84" , "name":"内置功能" },{ "id":"menuitem85" , "name":"自动分组" },{ "id":"menuitem86" , "name":"代码表分组" },{ "id":"menuitem91" , "name":"项布局面板" },{ "id":"menuitem143" , "name":"自定义插件" }]},{ "id":"menuitem95" , "name":"日历" , "items":[{ "id":"menuitem96" , "name":"内置功能" },{ "id":"menuitem97" , "name":"时间轴样式" },{ "id":"menuitem109" , "name":"项布局面板" },{ "id":"menuitem64" , "name":"自定义插件" }]},{ "id":"menuitem14" , "name":"树视图" , "items":[{ "id":"menuitem60" , "name":"静态节点" },{ "id":"menuitem61" , "name":"动态节点(代码表)" },{ "id":"menuitem62" , "name":"动态节点(实体)" },{ "id":"menuitem63" , "name":"右键操作" }]},{ "id":"menuitem111" , "name":"甘特图" },{ "id":"menuitem110" , "name":"树表格" },{ "id":"menuitem87" , "name":"数据视图" , "items":[{ "id":"menuitem88" , "name":"内置功能" },{ "id":"menuitem89" , "name":"自动分组" },{ "id":"menuitem90" , "name":"代码表分组" },{ "id":"menuitem94" , "name":"项布局面板" },{ "id":"menuitem152" , "name":"自定义插件" }]},{ "id":"menuitem101" , "name":"看板视图" , "items":[{ "id":"menuitem102" , "name":"内置功能" },{ "id":"menuitem104" , "name":"代码表分组" },{ "id":"menuitem105" , "name":"项布局面板" }]},{ "id":"menuitem37" , "name":"数据图表" , "items":[{ "id":"menuitem38" , "name":"柱状图" },{ "id":"menuitem39" , "name":"折线图" },{ "id":"menuitem40" , "name":"饼图" },{ "id":"menuitem41" , "name":"区域图" },{ "id":"menuitem42" , "name":"雷达图" }]}]},{ "id":"menuitem159" , "name":"其他类" }]},{ "id":"menuitem5" , "name":"视图" , "items":[{ "id":"menuitem140" , "name":"单数据视图" , "items":[{ "id":"menuitem161" , "name":"实体向导视图" },{ "id":"menuitem8" , "name":"编辑视图" , "items":[{ "id":"menuitem22" , "name":"常规编辑视图" },{ "id":"menuitem23" , "name":"左右编辑视图" },{ "id":"menuitem24" , "name":"分页编辑视图" },{ "id":"menuitem25" , "name":"嵌入编辑视图" }]},{ "id":"menuitem162" , "name":"实体编辑视图(分页关系)" },{ "id":"menuitem163" , "name":"实体编辑视图(上下关系)" },{ "id":"menuitem164" , "name":"实体编辑视图(左右关系)" },{ "id":"menuitem165" , "name":"实体分页导航视图" },{ "id":"menuitem166" , "name":"实体数据看板视图" },{ "id":"menuitem167" , "name":"实体选项操作视图" }]},{ "id":"menuitem141" , "name":"多数据视图" , "items":[{ "id":"menuitem79" , "name":"表格视图" },{ "id":"menuitem168" , "name":"实体多表单编辑视图" },{ "id":"menuitem169" , "name":"实体甘特视图" },{ "id":"menuitem9" , "name":"列表视图" },{ "id":"menuitem170" , "name":"实体日历视图" },{ "id":"menuitem171" , "name":"实体看板视图" },{ "id":"menuitem172" , "name":"实体树表格视图" },{ "id":"menuitem173" , "name":"实体树视图" },{ "id":"menuitem174" , "name":"实体数据视图" },{ "id":"menuitem175" , "name":"实体图表视图" }]},{ "id":"menuitem10" , "name":"导航视图" , "items":[{ "id":"menuitem176" , "name":"实体表格导航视图" },{ "id":"menuitem177" , "name":"实体列表导航视图" },{ "id":"menuitem178" , "name":"实体卡片导航视图" },{ "id":"menuitem179" , "name":"实体日历导航视图" },{ "id":"menuitem180" , "name":"实体树导航视图" }]},{ "id":"menuitem26" , "name":"选择视图" , "items":[{ "id":"menuitem18" , "name":"数据选择视图" },{ "id":"menuitem27" , "name":"索引选择视图" }]},{ "id":"menuitem69" , "name":"工作流" , "items":[{ "id":"menuitem30" , "name":"工作流动态导航视图" },{ "id":"menuitem31" , "name":"工作流启动" }]},{ "id":"menuitem11" , "name":"其他视图" , "items":[{ "id":"menuitem35" , "name":"图表视图" },{ "id":"menuitem36" , "name":"报表视图" },{ "id":"menuitem98" , "name":"自定义视图" }]}]},{ "id":"menuitem153" , "name":"逻辑" , "items":[{ "id":"menuitem154" , "name":"应用功能" , "items":[{ "id":"menuitem127" , "name":"打开应用视图" },{ "id":"menuitem147" , "name":"打开HTML页面" },{ "id":"menuitem160" , "name":"执行JavaScript" }]},{ "id":"menuitem155" , "name":"界面行为" , "items":[{ "id":"menuitem181" , "name":"前界面行为" },{ "id":"menuitem182" , "name":"后台界面行为" }]}]},{ "id":"menuitem2" , "name":"更多" , "items":[{ "id":"menuitem46" , "name":"数据导出导入" },{ "id":"menuitem45" , "name":"数据打印" },{ "id":"menuitem67" , "name":"索引实体" },{ "id":"menuitem68" , "name":"继承实体" },{ "id":"menuitem71" , "name":"多表单" },{ "id":"menuitem184" , "name":"主状态" , "items":[{ "id":"menuitem70" , "name":"表格主状态" },{ "id":"menuitem148" , "name":"列表主状态" },{ "id":"menuitem183" , "name":"数据主状态" },{ "id":"menuitem28" , "name":"日历主状态" },{ "id":"menuitem29" , "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":"menuitem72" , "name":"扩展编辑器" },{ "id":"menuitem151" , "name":"编辑器插件示例" },{ "id":"menuitem65" , "name":"微服务组件" }]},{ "id":"menuitem4" , "name":"部件" , "items":[{ "id":"menuitem112" , "name":"应用类" , "items":[{ "id":"menuitem186" , "name":"数据看板" },{ "id":"menuitem129" , "name":"门户部件" }]},{ "id":"menuitem156" , "name":"表单类" , "items":[{ "id":"menuitem12" , "name":"编辑表单" , "items":[{ "id":"menuitem15" , "name":"基础表单项" },{ "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":"menuitem126" , "name":"实体数据看板" }]},{ "id":"menuitem157" , "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":"menuitem145" , "name":"选择视图面板" },{ "id":"menuitem17" , "name":"向导面板" , "items":[{ "id":"menuitem134" , "name":"基础用法" },{ "id":"menuitem135" , "name":"状态属性" }]},{ "id":"menuitem121" , "name":"多编辑视图面板" , "items":[{ "id":"menuitem115" , "name":"多表单(行记录)" },{ "id":"menuitem123" , "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":"menuitem83" , "name":"列表" , "items":[{ "id":"menuitem84" , "name":"内置功能" },{ "id":"menuitem85" , "name":"自动分组" },{ "id":"menuitem86" , "name":"代码表分组" },{ "id":"menuitem91" , "name":"项布局面板" },{ "id":"menuitem143" , "name":"自定义插件" }]},{ "id":"menuitem95" , "name":"日历" , "items":[{ "id":"menuitem96" , "name":"内置功能" },{ "id":"menuitem97" , "name":"时间轴样式" },{ "id":"menuitem109" , "name":"项布局面板" },{ "id":"menuitem64" , "name":"自定义插件" }]},{ "id":"menuitem14" , "name":"树视图" , "items":[{ "id":"menuitem60" , "name":"静态节点" },{ "id":"menuitem61" , "name":"动态节点(代码表)" },{ "id":"menuitem62" , "name":"动态节点(实体)" },{ "id":"menuitem63" , "name":"右键操作" }]},{ "id":"menuitem111" , "name":"甘特图" },{ "id":"menuitem110" , "name":"树表格" },{ "id":"menuitem87" , "name":"数据视图" , "items":[{ "id":"menuitem88" , "name":"内置功能" },{ "id":"menuitem89" , "name":"自动分组" },{ "id":"menuitem90" , "name":"代码表分组" },{ "id":"menuitem94" , "name":"项布局面板" },{ "id":"menuitem152" , "name":"自定义插件" }]},{ "id":"menuitem101" , "name":"看板视图" , "items":[{ "id":"menuitem102" , "name":"内置功能" },{ "id":"menuitem104" , "name":"代码表分组" },{ "id":"menuitem105" , "name":"项布局面板" }]},{ "id":"menuitem37" , "name":"数据图表" , "items":[{ "id":"menuitem38" , "name":"柱状图" },{ "id":"menuitem39" , "name":"折线图" },{ "id":"menuitem40" , "name":"饼图" },{ "id":"menuitem41" , "name":"区域图" },{ "id":"menuitem42" , "name":"雷达图" }]}]},{ "id":"menuitem159" , "name":"其他类" }]},{ "id":"menuitem5" , "name":"视图" , "items":[{ "id":"menuitem140" , "name":"单数据视图" , "items":[{ "id":"menuitem161" , "name":"实体向导视图" },{ "id":"menuitem8" , "name":"编辑视图" , "items":[{ "id":"menuitem22" , "name":"常规编辑视图" },{ "id":"menuitem23" , "name":"左右编辑视图" },{ "id":"menuitem24" , "name":"分页编辑视图" },{ "id":"menuitem25" , "name":"嵌入编辑视图" }]},{ "id":"menuitem162" , "name":"实体编辑视图(分页关系)" },{ "id":"menuitem163" , "name":"实体编辑视图(上下关系)" },{ "id":"menuitem164" , "name":"实体编辑视图(左右关系)" },{ "id":"menuitem165" , "name":"实体分页导航视图" },{ "id":"menuitem166" , "name":"实体数据看板视图" },{ "id":"menuitem167" , "name":"实体选项操作视图" }]},{ "id":"menuitem141" , "name":"多数据视图" , "items":[{ "id":"menuitem79" , "name":"表格视图" },{ "id":"menuitem168" , "name":"实体多表单编辑视图" },{ "id":"menuitem169" , "name":"实体甘特视图" },{ "id":"menuitem9" , "name":"列表视图" },{ "id":"menuitem170" , "name":"实体日历视图" },{ "id":"menuitem171" , "name":"实体看板视图" },{ "id":"menuitem172" , "name":"实体树表格视图" },{ "id":"menuitem173" , "name":"实体树视图" },{ "id":"menuitem174" , "name":"实体数据视图" },{ "id":"menuitem175" , "name":"实体图表视图" }]},{ "id":"menuitem10" , "name":"导航视图" , "items":[{ "id":"menuitem176" , "name":"实体表格导航视图" },{ "id":"menuitem177" , "name":"实体列表导航视图" },{ "id":"menuitem178" , "name":"实体卡片导航视图" },{ "id":"menuitem179" , "name":"实体日历导航视图" },{ "id":"menuitem180" , "name":"实体树导航视图" }]},{ "id":"menuitem26" , "name":"选择视图" , "items":[{ "id":"menuitem18" , "name":"数据选择视图" },{ "id":"menuitem27" , "name":"索引选择视图" }]},{ "id":"menuitem69" , "name":"工作流" , "items":[{ "id":"menuitem30" , "name":"工作流动态导航视图" },{ "id":"menuitem31" , "name":"工作流启动" }]},{ "id":"menuitem11" , "name":"其他视图" , "items":[{ "id":"menuitem35" , "name":"图表视图" },{ "id":"menuitem36" , "name":"报表视图" },{ "id":"menuitem98" , "name":"自定义视图" }]}]},{ "id":"menuitem153" , "name":"逻辑" , "items":[{ "id":"menuitem154" , "name":"应用功能" , "items":[{ "id":"menuitem127" , "name":"打开应用视图" },{ "id":"menuitem147" , "name":"打开HTML页面" },{ "id":"menuitem160" , "name":"执行JavaScript" }]},{ "id":"menuitem155" , "name":"界面行为" , "items":[{ "id":"menuitem181" , "name":"前界面行为" },{ "id":"menuitem182" , "name":"后台界面行为" }]}]},{ "id":"menuitem2" , "name":"更多" , "items":[{ "id":"menuitem46" , "name":"数据导出导入" },{ "id":"menuitem45" , "name":"数据打印" },{ "id":"menuitem67" , "name":"索引实体" },{ "id":"menuitem68" , "name":"继承实体" },{ "id":"menuitem71" , "name":"多表单" },{ "id":"menuitem184" , "name":"主状态" , "items":[{ "id":"menuitem70" , "name":"表格主状态" },{ "id":"menuitem148" , "name":"列表主状态" },{ "id":"menuitem183" , "name":"数据主状态" },{ "id":"menuitem28" , "name":"日历主状态" },{ "id":"menuitem29" , "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 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册