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

xignzi006 发布系统代码

上级 a988c15f
......@@ -639,6 +639,16 @@
"viewtag": "697373026d90700244354625e1d01cc2",
"memo": "系统自动添加"
},
"accountgradation": {
"title": "客户树导航视图",
"caption": "客户",
"viewtype": "DETREEEXPVIEW",
"viewmodule": "Base",
"viewname": "AccountGradation",
"viewfilename": "account-gradation",
"viewtag": "6978259896338a7ace85a9fbc5d70395",
"memo": ""
},
"opportunityproductopp_oppprogridview": {
"title": "商机产品表格视图",
"caption": "商机产品",
......
......@@ -196,6 +196,10 @@ export default {
edit_accountinfo: {
caption: "账户信息",
title: '账户信息',
},
gradation: {
caption: "客户",
title: '客户树导航视图',
},
editview: {
caption: "客户",
......@@ -701,4 +705,11 @@ export default {
tip: "Filter",
},
},
account_treeview: {
nodes: {
root: '全部客户',
},
uiactions: {
},
},
};
\ No newline at end of file
......@@ -195,6 +195,10 @@ export default {
edit_accountinfo: {
caption: '账户信息',
title: '账户信息',
},
gradation: {
caption: '客户',
title: '客户树导航视图',
},
editview: {
caption: '客户',
......@@ -700,4 +704,11 @@ export default {
tip: '过滤',
},
},
account_treeview: {
nodes: {
root: '全部客户',
},
uiactions: {
},
},
};
\ No newline at end of file
......@@ -271,6 +271,50 @@ mock.onGet(new RegExp(/^\/accounts\/getdraft$/)).reply((config: any) => {
return [status, {}];
});
// FetchRoot
mock.onGet(new RegExp(/^\/accounts\/fetchroot$/)).reply((config: any) => {
console.groupCollapsed("实体:account 方法: FetchRoot");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas);
console.groupEnd();
console.groupEnd();
return [status, mockDatas ? mockDatas : []];
});
// FetchRoot
mock.onGet(new RegExp(/^\/accounts\/fetchroot(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:account 方法: FetchRoot");
console.table({url:config.url, method: config.method, data:config.data});
if(config.url.includes('page')){
let url = config.url.split('?')[1];
let params = qs.parse(url);
Object.assign(config, params);
}
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
let total = mockDatas.length;
let records: Array<any> = [];
if(!config.page || !config.size){
records = mockDatas;
}else{
if((config.page-1)*config.size < total){
records = mockDatas.slice(config.page,config.size);
}
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(records ? records : []);
console.groupEnd();
console.groupEnd();
return [status, records ? records : []];
});
// FetchDefault
mock.onGet(new RegExp(/^\/accounts\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:account 方法: FetchDefault");
......
......@@ -519,6 +519,14 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => {
"viewname": "CampaignInfo_Manager",
"viewtag": "697373026d90700244354625e1d01cc2"
},
"accountgradation": {
"title": "客户树导航视图",
"caption": "客户",
"viewtype": "DETREEEXPVIEW",
"viewmodule": "Base",
"viewname": "AccountGradation",
"viewtag": "6978259896338a7ace85a9fbc5d70395"
},
"opportunityproductopp_oppprogridview": {
"title": "商机产品表格视图",
"caption": "商机产品",
......
<template>
<studio-view-style2 viewName="accountgradation" viewTitle="客户树导航视图" class='detreeexpview account-gradation'>
<template slot='title'>
<span class='caption-info'>{{$t(model.srfTitle)}}</span>
</template>
<view_treeexpbar
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:viewUID="viewUID"
name="treeexpbar"
ref='treeexpbar'
@selectionchange="treeexpbar_selectionchange($event)"
@activated="treeexpbar_activated($event)"
@load="treeexpbar_load($event)"
@closeview="closeView($event)">
</view_treeexpbar>
</studio-view-style2>
</template>
<script lang='tsx'>
import { Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
import { Subject } from 'rxjs';
import { UIActionTool, Util } from '@/utils';
import { VueLifeCycleProcessing, TreeExpViewBase } from '@/studio-core';
import AccountService from '@/service/account/account-service';
import TreeExpViewEngine from '@engine/view/tree-exp-view-engine';
/**
* 客户树导航视图视图基类
*
* @export
* @class AccountGradationBase
* @extends {TreeExpViewBase}
*/
@Component({})
@VueLifeCycleProcessing()
export default class AccountGradationBase extends TreeExpViewBase {
/**
* 实体服务对象
*
* @type {AccountService}
* @memberof AccountGradationBase
*/
protected appEntityService: AccountService = new AccountService;
/**
* 计数器服务对象集合
*
* @protected
* @type {Array<*>}
* @memberof AccountGradationBase
*/
protected counterServiceArray: Array<any> = [];
/**
* 自定义视图导航上下文集合
*
* @protected
* @type {*}
* @memberof AccountGradationBase
*/
protected customViewNavContexts: any = {
};
/**
* 自定义视图导航参数集合
*
* @protected
* @type {*}
* @memberof AccountGradationBase
*/
protected customViewParams: any = {
};
/**
* 视图模型数据
*
* @protected
* @type {*}
* @memberof AccountGradationBase
*/
protected model: any = {
srfCaption: 'entities.account.views.gradation.caption',
srfTitle: 'entities.account.views.gradation.title',
srfSubTitle: 'entities.account.views.gradation.subtitle',
dataInfo: ''
}
/**
* 容器模型
*
* @protected
* @type {*}
* @memberof AccountGradationBase
*/
protected containerModel: any = {
view_treeexpbar: { name: 'treeexpbar', type: 'TREEEXPBAR' },
};
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof AccountGradationBase
*/
public engine: TreeExpViewEngine = new TreeExpViewEngine();
/**
* 引擎初始化
*
* @public
* @memberof AccountGradationBase
*/
public engineInit(): void {
this.engine.init({
view: this,
treeexpbar: this.$refs.treeexpbar,
keyPSDEField: 'account',
majorPSDEField: 'accountname',
isLoadDefault: true,
});
}
/**
* treeexpbar 部件 selectionchange 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof AccountGradationBase
*/
public treeexpbar_selectionchange($event: any, $event2?: any): void {
this.engine.onCtrlEvent('treeexpbar', 'selectionchange', $event);
}
/**
* treeexpbar 部件 activated 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof AccountGradationBase
*/
public treeexpbar_activated($event: any, $event2?: any): void {
this.engine.onCtrlEvent('treeexpbar', 'activated', $event);
}
/**
* treeexpbar 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof AccountGradationBase
*/
public treeexpbar_load($event: any, $event2?: any): void {
this.engine.onCtrlEvent('treeexpbar', 'load', $event);
}
/**
* 打开新建数据视图
*
* @param {any[]} args
* @param {*} [params]
* @param {*} [fullargs]
* @param {*} [$event]
* @param {*} [xData]
* @memberof AccountGradation
*/
public newdata(args: any[],fullargs?:any[], params?: any, $event?: any, xData?: any) {
let localContext:any = null;
let localViewParam:any =null;
this.$Notice.warning({ title: '错误', desc: '未指定关系视图' });
}
/**
* 打开编辑数据视图
*
* @param {any[]} args
* @param {*} [params]
* @param {*} [fullargs]
* @param {*} [$event]
* @param {*} [xData]
* @memberof AccountGradation
*/
public opendata(args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any) {
let localContext:any = null;
let localViewParam:any =null;
this.$Notice.warning({ title: '错误', desc: '未指定关系视图' });
}
/**
* 视图唯一标识
*
* @type {string}
* @memberof AccountGradation
*/
public viewUID: string = 'base-account-gradation';
}
</script>
<style lang='less'>
@import './account-gradation.less';
</style>
\ No newline at end of file
// 避免空文件,后台不让空文件过
.account-gradation {
--account-gradation: 0;
}
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import AccountGradationBase from './account-gradation-base.vue';
import view_treeexpbar from '@widgets/account/gradationtreeexpbar-treeexpbar/gradationtreeexpbar-treeexpbar.vue';
@Component({
components: {
view_treeexpbar,
},
beforeRouteEnter: (to: any, from: any, next: any) => {
next((vm: any) => {
vm.$store.commit('addCurPageViewtag', { route: to, viewtag: vm.viewtag });
});
},
})
export default class AccountGradation extends AccountGradationBase {
}
</script>
\ No newline at end of file
<template>
<studio-view-style2 viewName="competitorsummary" viewTitle="竞争对手概览" class='deportalview competitor-summary'>
<template slot='title'>
<span class='caption-info'>{{$t(model.srfTitle)}}</span>
</template>
<view_dashboard
:viewState="viewState"
:viewparams="viewparams"
......
export const PageComponents = {
install(Vue: any, opt: any) {
Vue.component('account-quick-create', () => import('@pages/base/account-quick-create/account-quick-create.vue'));
Vue.component('account-gradation', () => import('@pages/base/account-gradation/account-gradation.vue'));
Vue.component('account-quick-create', () => import('@pages/base/account-quick-create/account-quick-create.vue'));
Vue.component('list-account-by-list', () => import('@pages/marketing/list-account-by-list/list-account-by-list.vue'));
Vue.component('competitor-option-view', () => import('@pages/sales/competitor-option-view/competitor-option-view.vue'));
Vue.component('campaign-response-by-parent-key', () => import('@pages/marketing/campaign-response-by-parent-key/campaign-response-by-parent-key.vue'));
......@@ -16,8 +17,8 @@ export const PageComponents = {
Vue.component('contact-info-person', () => import('@pages/base/contact-info-person/contact-info-person.vue'));
Vue.component('campaign-info-schedule', () => import('@pages/marketing/campaign-info-schedule/campaign-info-schedule.vue'));
Vue.component('opportunity-grid-view', () => import('@pages/sales/opportunity-grid-view/opportunity-grid-view.vue'));
Vue.component('letter-edit-view', () => import('@pages/base/letter-edit-view/letter-edit-view.vue'));
Vue.component('goal-edit-view', () => import('@pages/sales/goal-edit-view/goal-edit-view.vue'));
Vue.component('letter-edit-view', () => import('@pages/base/letter-edit-view/letter-edit-view.vue'));
Vue.component('transaction-currency-pickup-view', () => import('@pages/base/transaction-currency-pickup-view/transaction-currency-pickup-view.vue'));
Vue.component('opportunity-product-edit-view', () => import('@pages/sales/opportunity-product-edit-view/opportunity-product-edit-view.vue'));
Vue.component('email-edit-view', () => import('@pages/base/email-edit-view/email-edit-view.vue'));
......
......@@ -35,6 +35,20 @@ const router = new Router({
},
component: () => import('@pages/ungroup/central/central.vue'),
children: [
{
path: 'accounts/:account?/gradation/:gradation?',
meta: {
caption: 'entities.account.views.gradation.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'gradation', parameterName: 'gradation' },
],
requireAuth: true,
},
component: () => import('@pages/base/account-gradation/account-gradation.vue'),
},
{
path: 'accounts/:account?/quickcreate/:quickcreate?',
meta: {
......@@ -521,32 +535,32 @@ const router = new Router({
component: () => import('@pages/sales/opportunity-grid-view/opportunity-grid-view.vue'),
},
{
path: 'letters/:letter?/editview/:editview?',
path: 'goals/:goal?/editview/:editview?',
meta: {
caption: 'entities.letter.views.editview.title',
caption: 'entities.goal.views.editview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'letters', parameterName: 'letter' },
{ pathName: 'goals', parameterName: 'goal' },
{ pathName: 'editview', parameterName: 'editview' },
],
requireAuth: true,
},
component: () => import('@pages/base/letter-edit-view/letter-edit-view.vue'),
component: () => import('@pages/sales/goal-edit-view/goal-edit-view.vue'),
},
{
path: 'goals/:goal?/editview/:editview?',
path: 'letters/:letter?/editview/:editview?',
meta: {
caption: 'entities.goal.views.editview.title',
caption: 'entities.letter.views.editview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'goals', parameterName: 'goal' },
{ pathName: 'letters', parameterName: 'letter' },
{ pathName: 'editview', parameterName: 'editview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/goal-edit-view/goal-edit-view.vue'),
component: () => import('@pages/base/letter-edit-view/letter-edit-view.vue'),
},
{
path: 'transactioncurrencies/:transactioncurrency?/pickupview/:pickupview?',
......@@ -3304,28 +3318,27 @@ const router = new Router({
component: () => import('@pages/base/account-inner-pickup-grid-view/account-inner-pickup-grid-view.vue'),
},
{
path: 'ibizlists/:ibizlist?/listaccounts/:listaccount?/inner/:inner?',
path: 'accounts/:account?/edit_introduction/:edit_introduction?',
meta: {
caption: 'entities.listaccount.views.inner.title',
caption: 'entities.account.views.edit_introduction.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'ibizlists', parameterName: 'ibizlist' },
{ pathName: 'listaccounts', parameterName: 'listaccount' },
{ pathName: 'inner', parameterName: 'inner' },
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'edit_introduction', parameterName: 'edit_introduction' },
],
requireAuth: true,
},
component: () => import('@pages/marketing/list-account-inner/list-account-inner.vue'),
component: () => import('@pages/base/account-edit-introduction/account-edit-introduction.vue'),
},
{
path: 'accounts/:account?/listaccounts/:listaccount?/inner/:inner?',
path: 'ibizlists/:ibizlist?/listaccounts/:listaccount?/inner/:inner?',
meta: {
caption: 'entities.listaccount.views.inner.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'ibizlists', parameterName: 'ibizlist' },
{ pathName: 'listaccounts', parameterName: 'listaccount' },
{ pathName: 'inner', parameterName: 'inner' },
],
......@@ -3334,12 +3347,13 @@ const router = new Router({
component: () => import('@pages/marketing/list-account-inner/list-account-inner.vue'),
},
{
path: 'listaccounts/:listaccount?/inner/:inner?',
path: 'accounts/:account?/listaccounts/:listaccount?/inner/:inner?',
meta: {
caption: 'entities.listaccount.views.inner.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'listaccounts', parameterName: 'listaccount' },
{ pathName: 'inner', parameterName: 'inner' },
],
......@@ -3348,18 +3362,18 @@ const router = new Router({
component: () => import('@pages/marketing/list-account-inner/list-account-inner.vue'),
},
{
path: 'accounts/:account?/edit_introduction/:edit_introduction?',
path: 'listaccounts/:listaccount?/inner/:inner?',
meta: {
caption: 'entities.account.views.edit_introduction.title',
caption: 'entities.listaccount.views.inner.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'edit_introduction', parameterName: 'edit_introduction' },
{ pathName: 'listaccounts', parameterName: 'listaccount' },
{ pathName: 'inner', parameterName: 'inner' },
],
requireAuth: true,
},
component: () => import('@pages/base/account-edit-introduction/account-edit-introduction.vue'),
component: () => import('@pages/marketing/list-account-inner/list-account-inner.vue'),
},
{
path: 'accounts/:account?/contacts/:contact?/summary/:summary?',
......@@ -5115,6 +5129,19 @@ const router = new Router({
},
component: () => import('@pages/marketing/campaign-info-manager/campaign-info-manager.vue'),
},
{
path: '/accounts/:account?/gradation/:gradation?',
meta: {
caption: 'entities.account.views.gradation.title',
info:'',
parameters: [
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'gradation', parameterName: 'gradation' },
],
requireAuth: true,
},
component: () => import('@pages/base/account-gradation/account-gradation.vue'),
},
{
path: '/accounts/:account?/contacts/:contact?/opportunities/:opportunity?/opportunityproducts/:opportunityproduct?/opp_oppprogridview/:opp_oppprogridview?',
meta: {
......
......@@ -92,6 +92,21 @@ export default class AccountServiceBase extends EntityService {
}
}
masterData.contacts = contactsData;
let accountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_accounts'),'undefined')){
accountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_accounts') as any);
if(accountsData && accountsData.length && accountsData.length > 0){
accountsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.accountid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.accounts = accountsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -103,6 +118,7 @@ export default class AccountServiceBase extends EntityService {
let res:any = await Http.getInstance().post(`/accounts`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_accounts',JSON.stringify(res.data.accounts));
return res;
}
......@@ -147,10 +163,26 @@ export default class AccountServiceBase extends EntityService {
}
}
masterData.contacts = contactsData;
let accountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_accounts'),'undefined')){
accountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_accounts') as any);
if(accountsData && accountsData.length && accountsData.length > 0){
accountsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.accountid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.accounts = accountsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
this.tempStorage.setItem(context.srfsessionkey+'_accounts',JSON.stringify(res.data.accounts));
return res;
}
......@@ -209,10 +241,26 @@ export default class AccountServiceBase extends EntityService {
}
}
masterData.contacts = contactsData;
let accountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_accounts'),'undefined')){
accountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_accounts') as any);
if(accountsData && accountsData.length && accountsData.length > 0){
accountsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.accountid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.accounts = accountsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
this.tempStorage.setItem(context.srfsessionkey+'_accounts',JSON.stringify(res.data.accounts));
return res;
}
......@@ -242,6 +290,7 @@ export default class AccountServiceBase extends EntityService {
let res:any = await Http.getInstance().get(`/accounts/${context.account}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
this.tempStorage.setItem(context.srfsessionkey+'_accounts',JSON.stringify(res.data.accounts));
return res;
}
......@@ -260,9 +309,24 @@ export default class AccountServiceBase extends EntityService {
res.data.account = data.account;
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
this.tempStorage.setItem(context.srfsessionkey+'_accounts',JSON.stringify(res.data.accounts));
return res;
}
/**
* FetchRoot接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof AccountServiceBase
*/
public async FetchRoot(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/accounts/fetchroot`,tempData,isloading);
}
/**
* FetchDefault接口方法
*
......
......@@ -605,6 +605,16 @@ export const viewstate: any = {
refviews: [
],
},
{
viewtag: '6978259896338a7ace85a9fbc5d70395',
viewmodule: 'Base',
viewname: 'AccountGradation',
viewaction: '',
viewdatachange: false,
refviews: [
'5c7e90ccfaeb49b5bd84ae6c17b479e3',
],
},
{
viewtag: '6c67094479c2f8af7ea1575eee584056',
viewmodule: 'Sales',
......@@ -764,13 +774,13 @@ export const viewstate: any = {
refviews: [
'07c5035fbb847e889f3dbb9657723f30',
'24a93674ec4c976c08902a3e95421ca6',
'6978259896338a7ace85a9fbc5d70395',
'b38bc0256ecd5be1a58a3c2210a98d05',
'5f8f689d5dccc3db6d2b74a24a8b24ef',
'dfc0051ae4813115e03f3d095f8cd7d3',
'631a4276161c551802f3aaf4bd7e607c',
'15d12c1173fcb6e742b6a6d92cbc53ed',
'0326a502bb574cddc41da4323786dcb5',
'5c7e90ccfaeb49b5bd84ae6c17b479e3',
'90b48a107932f432e0dde42791a51887',
'45fdc8ee4d1401d2d625e80177395ddc',
'7FCD2E75-E34A-493C-922E-8AE47BCE08CA',
......
......@@ -87,6 +87,7 @@ export default class AccountUIServiceBase extends UIService {
this.allViewMap.set(':',{viewname:'info_all',srfappde:'accounts'});
this.allViewMap.set('MDATAVIEW:',{viewname:'gridview',srfappde:'accounts'});
this.allViewMap.set(':',{viewname:'edit_accountinfo',srfappde:'accounts'});
this.allViewMap.set(':',{viewname:'gradation',srfappde:'accounts'});
this.allViewMap.set('EDITVIEW:',{viewname:'editview',srfappde:'accounts'});
this.allViewMap.set(':',{viewname:'innerpickupgridview',srfappde:'accounts'});
this.allViewMap.set(':',{viewname:'info_introduction',srfappde:'accounts'});
......
<template>
<div class="design-tree-container">
<context-menu-container>
<el-tree
v-if="inited"
ref="treeexpbar_tree"
class="design-tree"
node-key="id"
lazy
:show-checkbox="!isSingleSelect"
:check-on-click-node="!isSingleSelect"
:default-expanded-keys="expandedKeys"
:props="{
label: 'text',
isLeaf: 'leaf',
children: 'children'
}"
:load="load"
:highlight-current="true"
:expand-on-click-node="false"
@check="onCheck"
@current-change="selectionChange"
:filter-node-method="filterNode"
>
<template slot-scope="{ node, data }">
<context-menu :contextMenuStyle="{width: '100%'}" :data="node" :renderContent="renderContextMenu">
<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 } from 'vue-property-decorator';
import { CreateElement } from 'vue';
import { Subject, Subscription } from 'rxjs';
import { ControlInterface } from '@/interface/control';
import { UIActionTool,Util } from '@/utils';
import AccountService from '@/service/account/account-service';
import AccountService from './account-treeview-service';
@Component({
components: {
}
})
export default class AccountBase extends Vue implements ControlInterface {
/**
* 名称
*
* @type {string}
* @memberof Account
*/
@Prop() public name?: string;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof Account
*/
@Prop() public viewState!: Subject<ViewState>;
/**
* 应用上下文
*
* @type {*}
* @memberof Account
*/
@Prop() public context: any;
/**
* 视图参数
*
* @type {*}
* @memberof Account
*/
@Prop() public viewparams: any;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof Account
*/
public viewStateEvent: Subscription | undefined;
/**
* 获取部件类型
*
* @returns {string}
* @memberof Account
*/
public getControlType(): string {
return 'TREEVIEW'
}
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof Account
*/
public counterServiceArray:Array<any> = [];
/**
* 建构部件服务对象
*
* @type {AccountService}
* @memberof Account
*/
public service: AccountService = new AccountService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {AccountService}
* @memberof Account
*/
public appEntityService: AccountService = new AccountService({ $store: this.$store });
/**
* 关闭视图
*
* @param {any} args
* @memberof Account
*/
public closeView(args: any): void {
let _this: any = this;
_this.$emit('closeview', [args]);
}
/**
* 计数器刷新
*
* @memberof Account
*/
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 Account
*/
public getDatas(): any[] {
return [this.currentselectedNode];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof Account
*/
public getData(): any {
return this.currentselectedNode;
}
/**
* 是否单选
*
* @type {boolean}
* @memberof Account
*/
@Prop({ default: true }) public isSingleSelect!: boolean;
/**
* 是否默认选中第一条数据
*
* @type {boolean}
* @memberof Account
*/
@Prop({ default: false }) public isSelectFirstDefault!: boolean;
/**
* 枝干节点是否可用(具有数据能力,可抛出)
*
* @type {string}
* @memberof Account
*/
@Prop({default:true}) public isBranchAvailable!: boolean;
/**
* 显示处理提示
*
* @type {boolean}
* @memberof Account
*/
@Prop({ default: true }) public showBusyIndicator?: boolean;
/**
* 初始化完成
*
* @type {boolean}
* @memberof Account
*/
public inited: boolean = false;
/**
* 已选中数据集合
*
* @type {*}
* @memberof Account
*/
public selectedNodes: any = [];
/**
* 当前选中数据项
*
* @type {*}
* @memberof Account
*/
public currentselectedNode: any = {};
/**
* 选中数据字符串
*
* @type {string}
* @memberof Account
*/
@Prop() public selectedData?: string;
/**
* 选中值变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof Account
*/
@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 Account
*/
public echoselectedNodes:any[] = this.selectedData ? ( this.isSingleSelect ? [JSON.parse(this.selectedData)[0]] : JSON.parse(this.selectedData)) : [];
/**
* 部件行为--update
*
* @type {string}
* @memberof Account
*/
@Prop() public updateAction!: string;
/**
* 部件行为--fetch
*
* @type {string}
* @memberof Account
*/
@Prop() public fetchAction!: string;
/**
* 部件行为--remove
*
* @type {string}
* @memberof Account
*/
@Prop() public removeAction!: string;
/**
* 部件行为--load
*
* @type {string}
* @memberof Account
*/
@Prop() public loadAction!: string;
/**
* 部件行为--create
*
* @type {string}
* @memberof Account
*/
@Prop() public createAction!: string;
/**
* 过滤属性
*
* @type {string}
* @memberof Account
*/
public srfnodefilter: string = '';
/**
* 默认输出图标
*
* @type {boolean}
* @memberof Account
*/
public isOutputIconDefault: boolean = true;
/**
* 数据展开主键
*
* @type {string[]}
* @memberof Account
*/
@Provide()
public expandedKeys: string[] = [];
/**
* 选中数据变更事件
*
* @public
* @param {*} data
* @param {*} data 当前节点对应传入对象
* @param {*} checkedState 树目前选中状态对象
* @memberof Account
*/
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 Account
*/
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 Account
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof Account
*/
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();
}
});
}
}
/**
* 对树节点进行筛选操作
* @memberof OrderTree
*/
public filterNode(value:any, data:any) {
if (!value) return true;
return data.text.indexOf(value) !== -1;
}
/**
* vue 生命周期
*
* @memberof Account
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof Account
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
}
/**
* 刷新数据
*
* @memberof Account
*/
public refresh_all(): void {
this.inited = false;
this.$nextTick(() => {
this.inited = true;
});
}
/**
* 刷新父节点
*
* @memberof Account
*/
public refresh_parent(): void {
if (Object.keys(this.currentselectedNode).length === 0) {
return;
}
const tree: any = this.$refs.treeexpbar_tree;
const node: any = tree.getNode(this.currentselectedNode.id);
if (!node || !node.parent) {
return;
}
let curNode:any = {};
const { parent: _parent } = node;
curNode = Util.deepObjectMerge(curNode,_parent);
let tempContext:any = {};
if(curNode.data && curNode.data.srfappctx){
Object.assign(tempContext,curNode.data.srfappctx);
}else{
Object.assign(tempContext,this.context);
}
const id: string = _parent.key ? _parent.key : '#';
const param: any = { srfnodeid: id };
this.refresh_node(tempContext,param, true);
}
/**
* 数据加载
*
* @param {*} node
* @memberof Account
*/
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: "错误", 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: "错误", desc: response.info });
});
}
/**
* 计算当前节点的上下文
*
* @param {*} curNode 当前节点
* @memberof Account
*/
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 Account
*/
public refresh(args: any[]): void {
this.refresh_all();
}
/**
* 刷新节点
*
* @public
* @param {*} [curContext] 当前节点上下文
* @param {*} [arg={}] 当前节点附加参数
* @param {boolean} parentnode 是否是刷新父节点
* @memberof Account
*/
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: '错误', desc: response.info });
return;
}
const _items = [...response.data];
this.formatExpanded(_items);
const tree: any = this.$refs.treeexpbar_tree;
tree.updateKeyChildren(id, _items);
if (parentnode) {
this.currentselectedNode = {};
}
this.setDefaultSelection(_items);
}).catch((response: any) => {
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: '错误', desc: response.info });
});
}
/**
* 默认展开节点
*
* @public
* @param {any[]} items
* @returns {any[]}
* @memberof Account
*/
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 MainTree
*/
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 = items.findIndex((item: any) => item.selected);
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;
return true;
}
});
});
if(checkedNodes.length > 0){
this.echoselectedNodes = this.echoselectedNodes.filter((item:any)=> !item.used);
// 父节点选中时,不需要执行这段,会选中所有子节点
if(!isSelectedAll){
if(this.isSingleSelect){
this.setTreeNodeHighLight(checkedNodes[0]);
this.currentselectedNode = JSON.parse(JSON.stringify(checkedNodes[0]));
this.selectedNodes = [this.currentselectedNode];
}else{
this.selectedNodes = this.selectedNodes.concat(checkedNodes);
const tree: any = this.$refs.treeexpbar_tree;
tree.setCheckedNodes(this.selectedNodes);
}
}
}
}
// 父节点选中时,选中所有子节点
if(isSelectedAll){
let leafNodes = items.filter((item:any) => item.leaf);
this.selectedNodes = this.selectedNodes.concat(leafNodes);
this.$emit('selectionchange', this.selectedNodes);
}
}
/**
* 绘制右击菜单
*
* @param {*} node
* @returns
* @memberof Account
*/
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(';');
}
return content;
}
/**
* 设置选中高亮
*
* @param {*} data
* @memberof Account
*/
public setTreeNodeHighLight(data: any): void {
const tree: any = this.$refs.treeexpbar_tree;
tree.setCurrentKey(data.id);
}
/**
* 执行默认界面行为
*
* @param {*} node
* @memberof AppView
*/
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 './account-treeview.less';
</style>
\ No newline at end of file
/**
* Account 部件模型
*
* @export
* @class AccountModel
*/
export default class AccountModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof AccountModel
*/
public getDataItems(): any[] {
return [
{
name: 'address1_primarycontactname',
},
{
name: 'openrevenue_date',
},
{
name: 'address2_utcoffset',
},
{
name: 'fax',
},
{
name: 'address1_composite',
},
{
name: 'entityimage',
},
{
name: 'emailaddress1',
},
{
name: 'overriddencreatedon',
},
{
name: 'address1_stateorprovince',
},
{
name: 'openrevenue',
},
{
name: 'address1_upszone',
},
{
name: 'followemail',
},
{
name: 'marketingonly',
},
{
name: 'numberofemployees',
},
{
name: 'telephone1',
},
{
name: 'aging60',
},
{
name: 'sharesoutstanding',
},
{
name: 'address2_freighttermscode',
},
{
name: 'entityimage_timestamp',
},
{
name: 'revenue_base',
},
{
name: 'accountratingcode',
},
{
name: 'donotbulkemail',
},
{
name: 'aging30',
},
{
name: 'donotbulkpostalmail',
},
{
name: 'creditlimit_base',
},
{
name: 'timezoneruleversionnumber',
},
{
name: 'customertypecode',
},
{
name: 'address2_longitude',
},
{
name: 'accountname',
},
{
name: 'participatesinworkflow',
},
{
name: 'preferredcontactmethodcode',
},
{
name: 'preferredappointmentdaycode',
},
{
name: 'marketcap',
},
{
name: 'address2_telephone1',
},
{
name: 'businesstypecode',
},
{
name: 'entityimageid',
},
{
name: 'address2_city',
},
{
name: 'ownershipcode',
},
{
name: 'utcconversiontimezonecode',
},
{
name: 'accountnumber',
},
{
name: 'address1_telephone2',
},
{
name: 'address1_line1',
},
{
name: 'donotphone',
},
{
name: 'address1_telephone3',
},
{
name: 'exchangerate',
},
{
name: 'address2_line2',
},
{
name: 'address2_telephone3',
},
{
name: 'address1_telephone1',
},
{
name: 'address1_fax',
},
{
name: 'address1_freighttermscode',
},
{
name: 'description',
},
{
name: 'merged',
},
{
name: 'address1_shippingmethodcode',
},
{
name: 'address1_name',
},
{
name: 'aging30_base',
},
{
name: 'address2_telephone2',
},
{
name: 'account',
prop: 'accountid',
},
{
name: 'primarytwitterid',
},
{
name: 'tickersymbol',
},
{
name: 'stockexchange',
},
{
name: 'address2_stateorprovince',
},
{
name: 'ftpsiteurl',
},
{
name: 'statuscode',
},
{
name: 'websiteurl',
},
{
name: 'donotpostalmail',
},
{
name: 'address1_city',
},
{
name: 'address2_fax',
},
{
name: 'aging90_base',
},
{
name: 'opendeals_date',
},
{
name: 'traversedpath',
},
{
name: 'shippingmethodcode',
},
{
name: 'address1_line2',
},
{
name: 'openrevenue_base',
},
{
name: 'updatedate',
},
{
name: 'preferredsystemuseridyominame',
},
{
name: 'address2_line3',
},
{
name: 'address1_postalcode',
},
{
name: 'address2_latitude',
},
{
name: 'ibizprivate',
},
{
name: 'territorycode',
},
{
name: 'teamsfollowed',
},
{
name: 'yominame',
},
{
name: 'address1_latitude',
},
{
name: 'telephone3',
},
{
name: 'ownerid',
},
{
name: 'address2_country',
},
{
name: 'masteraccountidyominame',
},
{
name: 'industrycode',
},
{
name: 'lastonholdtime',
},
{
name: 'address2_addressid',
},
{
name: 'onholdtime',
},
{
name: 'accountclassificationcode',
},
{
name: 'address1_country',
},
{
name: 'address1_addresstypecode',
},
{
name: 'statecode',
},
{
name: 'address2_addresstypecode',
},
{
name: 'accountcategorycode',
},
{
name: 'emailaddress2',
},
{
name: 'address2_shippingmethodcode',
},
{
name: 'importsequencenumber',
},
{
name: 'primarysatoriid',
},
{
name: 'customersizecode',
},
{
name: 'opendeals',
},
{
name: 'donotsendmm',
},
{
name: 'processid',
},
{
name: 'paymenttermscode',
},
{
name: 'sic',
},
{
name: 'address2_primarycontactname',
},
{
name: 'address1_utcoffset',
},
{
name: 'owneridyominame',
},
{
name: 'lastusedincampaign',
},
{
name: 'aging60_base',
},
{
name: 'donotfax',
},
{
name: 'updateman',
},
{
name: 'openrevenue_state',
},
{
name: 'opendeals_state',
},
{
name: 'versionnumber',
},
{
name: 'address1_longitude',
},
{
name: 'aging90',
},
{
name: 'entityimage_url',
},
{
name: 'creditlimit',
},
{
name: 'preferredsystemuserid',
},
{
name: 'revenue',
},
{
name: 'address1_county',
},
{
name: 'address1_line3',
},
{
name: 'stageid',
},
{
name: 'donotemail',
},
{
name: 'address2_postalcode',
},
{
name: 'preferredappointmenttimecode',
},
{
name: 'address2_upszone',
},
{
name: 'createdate',
},
{
name: 'address2_county',
},
{
name: 'owneridtype',
},
{
name: 'address2_composite',
},
{
name: 'address2_name',
},
{
name: 'address2_line1',
},
{
name: 'marketcap_base',
},
{
name: 'emailaddress3',
},
{
name: 'telephone2',
},
{
name: 'createman',
},
{
name: 'address1_postofficebox',
},
{
name: 'creditonhold',
},
{
name: 'address1_addressid',
},
{
name: 'address2_postofficebox',
},
{
name: 'slaname',
},
{
name: 'originatingleadid',
},
{
name: 'transactioncurrencyid',
},
{
name: 'defaultpricelevelid',
},
{
name: 'parentaccountid',
},
{
name: 'preferredequipmentid',
},
{
name: 'territoryid',
},
{
name: 'primarycontactid',
},
{
name: 'slaid',
},
{
name: 'preferredserviceid',
},
{
name: 'originatingleadname',
},
{
name: 'defaultpricelevelname',
},
{
name: 'territoryname',
},
{
name: 'parentaccountname',
},
{
name: 'preferredequipmentname',
},
{
name: 'preferredservicename',
},
{
name: 'primarycontactname',
},
{
name: 'transactioncurrencyname',
},
]
}
}
\ No newline at end of file
import { Http,Util,Errorlog } from '@/utils';
import ControlService from '@/widgets/control-service';
import AccountService from '@/service/account/account-service';
import AccountModel from './account-treeview-model';
import CodeListService from '@service/app/codelist-service';
import i18n from '@/locale';
/**
* Account 部件服务对象
*
* @export
* @class AccountService
*/
export default class AccountService extends ControlService {
/**
* 客户服务对象
*
* @type {AccountService}
* @memberof AccountService
*/
public appEntityService: AccountService = new AccountService({ $store: this.getStore() });
/**
* 设置从数据模式
*
* @type {boolean}
* @memberof AccountService
*/
public setTempMode(){
this.isTempMode = false;
}
/**
* Creates an instance of AccountService.
*
* @param {*} [opts={}]
* @memberof AccountService
*/
constructor(opts: any = {}) {
super(opts);
this.model = new AccountModel();
}
/**
* 代码表服务对象
*
* @type {CodeListService}
* @memberof AccountService
*/
public codeListService:CodeListService = new CodeListService({ $store: this.getStore() });
/**
* 节点分隔符号
*
* @public
* @type {string}
* @memberof AccountService
*/
public TREENODE_SEPARATOR: string = ';';
/**
* RootAccount节点分隔符号
*
* @public
* @type {string}
* @memberof AccountService
*/
public TREENODE_ROOTACCOUNT: string = 'RootAccount';
/**
* 全部客户节点分隔符号
*
* @public
* @type {string}
* @memberof AccountService
*/
public TREENODE_ROOT: string = 'ROOT';
/**
* ChildAccount节点分隔符号
*
* @public
* @type {string}
* @memberof AccountService
*/
public TREENODE_CHILDACCOUNT: string = 'ChildAccount';
/**
* 获取节点数据
*
* @param {string} action
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof AccountService
*/
@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, '#')) {
await this.fillRootNodes(context, filter, list);
return Promise.resolve({ status: 200, data: list });
}
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_ROOTACCOUNT)) {
await this.fillRootaccountNodeChilds(context,filter, list);
return Promise.resolve({ status: 200, data: list });
}
if (Object.is(strNodeType, this.TREENODE_ROOT)) {
await this.fillRootNodeChilds(context,filter, list);
return Promise.resolve({ status: 200, data: list });
}
if (Object.is(strNodeType, this.TREENODE_CHILDACCOUNT)) {
await this.fillChildaccountNodeChilds(context,filter, list);
return Promise.resolve({ status: 200, data: list });
}
return Promise.resolve({ status: 500, data: { title: '失败', message: `树节点${strTreeNodeId}标识无效` } });
}
/**
* 填充 树视图节点[RootAccount]
*
* @public
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @param {*} rsNavContext
* @param {*} rsNavParams
* @param {*} rsParams
* @returns {Promise<any>}
* @memberof AccountService
*/
@Errorlog
public fillRootaccountNodes(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.searchRootaccount(context, searchFilter, filter).then((records:any) =>{
if(records && records.length >0){
records.forEach((entity: any) => {
let treeNode: any = {};
// 整理context
let strId: string = entity.accountid;
let strText: string = entity.accountname;
Object.assign(treeNode,{srfparentdename:'Account',srfparentkey:entity.accountid});
let tempContext:any = JSON.parse(JSON.stringify(context));
Object.assign(tempContext,{srfparentdename:'Account',srfparentkey:entity.accountid,account:strId})
Object.assign(treeNode,{srfappctx:tempContext});
Object.assign(treeNode,{'account':strId});
Object.assign(treeNode, { srfkey: strId });
Object.assign(treeNode, { text: strText, srfmajortext: strText });
let strNodeId: string = 'RootAccount';
strNodeId += this.TREENODE_SEPARATOR;
strNodeId += strId;
Object.assign(treeNode, { id: strNodeId });
Object.assign(treeNode, { expanded: filter.isautoexpand });
Object.assign(treeNode, { leaf: false });
Object.assign(treeNode, { curData: entity });
Object.assign(treeNode, { nodeid: treeNode.srfkey });
Object.assign(treeNode, { nodeid2: filter.strRealNodeId });
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 searchRootaccount(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['FetchRoot'] && _appEntityService['FetchRoot'] instanceof Function) {
const response: Promise<any> = _appEntityService['FetchRoot'](context, searchFilter, false);
response.then((response: any) => {
if (!response.status || response.status !== 200) {
resolve([]);
console.log(JSON.stringify(context));
console.error('查询FetchRoot数据集异常!');
}
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('查询FetchRoot数据集异常!');
});
}
})
}
/**
* 填充 树视图节点[RootAccount]子节点
*
* @public
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @returns {Promise<any>}
* @memberof AccountService
*/
@Errorlog
public async fillRootaccountNodeChilds(context:any={}, filter: any, list: any[]): Promise<any> {
if (filter.srfnodefilter && !Object.is(filter.srfnodefilter,"")) {
// 填充ChildAccount
let ChildaccountRsNavContext:any = {};
let ChildaccountRsNavParams:any = {};
let ChildaccountRsParams:any = {};
await this.fillChildaccountNodes(context, filter, list ,ChildaccountRsNavContext,ChildaccountRsNavParams,ChildaccountRsParams);
} else {
// 填充ChildAccount
let ChildaccountRsNavContext:any = {};
let ChildaccountRsNavParams:any = {};
let ChildaccountRsParams:any = {};
await this.fillChildaccountNodes(context, filter, list ,ChildaccountRsNavContext,ChildaccountRsNavParams,ChildaccountRsParams);
}
}
/**
* 填充 树视图节点[全部客户]
*
* @public
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @param {*} rsNavContext
* @param {*} rsNavParams
* @param {*} rsParams
* @returns {Promise<any>}
* @memberof AccountService
*/
@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: 'entities.account.account_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 });
list.push(treeNode);
resolve(list);
});
}
/**
* 填充 树视图节点[全部客户]子节点
*
* @public
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @returns {Promise<any>}
* @memberof AccountService
*/
@Errorlog
public async fillRootNodeChilds(context:any={}, filter: any, list: any[]): Promise<any> {
if (filter.srfnodefilter && !Object.is(filter.srfnodefilter,"")) {
// 填充RootAccount
let RootaccountRsNavContext:any = {};
let RootaccountRsNavParams:any = {};
let RootaccountRsParams:any = {};
await this.fillRootaccountNodes(context, filter, list ,RootaccountRsNavContext,RootaccountRsNavParams,RootaccountRsParams);
} else {
// 填充RootAccount
let RootaccountRsNavContext:any = {};
let RootaccountRsNavParams:any = {};
let RootaccountRsParams:any = {};
await this.fillRootaccountNodes(context, filter, list ,RootaccountRsNavContext,RootaccountRsNavParams,RootaccountRsParams);
}
}
/**
* 填充 树视图节点[ChildAccount]
*
* @public
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @param {*} rsNavContext
* @param {*} rsNavParams
* @param {*} rsParams
* @returns {Promise<any>}
* @memberof AccountService
*/
@Errorlog
public fillChildaccountNodes(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 = {};
if (Object.is(filter.strNodeType, this.TREENODE_ROOTACCOUNT)) {
Object.assign(searchFilter, { n_parentaccountid_eq: filter.nodeid });
}
Object.assign(searchFilter, { total: false });
let bFirst: boolean = true;
let records: any[] = [];
try {
this.searchChildaccount(context, searchFilter, filter).then((records:any) =>{
if(records && records.length >0){
records.forEach((entity: any) => {
let treeNode: any = {};
// 整理context
let strId: string = entity.accountid;
let strText: string = entity.accountname;
Object.assign(treeNode,{srfparentdename:'Account',srfparentkey:entity.accountid});
let tempContext:any = JSON.parse(JSON.stringify(context));
Object.assign(tempContext,{srfparentdename:'Account',srfparentkey:entity.accountid,account:strId})
Object.assign(treeNode,{srfappctx:tempContext});
Object.assign(treeNode,{'account':strId});
Object.assign(treeNode, { srfkey: strId });
Object.assign(treeNode, { text: strText, srfmajortext: strText });
let strNodeId: string = 'ChildAccount';
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 });
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 searchChildaccount(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数据集异常!');
});
}
})
}
/**
* 填充 树视图节点[ChildAccount]子节点
*
* @public
* @param {any{}} context
* @param {*} filter
* @param {any[]} list
* @returns {Promise<any>}
* @memberof AccountService
*/
@Errorlog
public async fillChildaccountNodeChilds(context:any={}, filter: any, list: any[]): Promise<any> {
if (filter.srfnodefilter && !Object.is(filter.srfnodefilter,"")) {
} else {
}
}
/**
* 处理代码表返回数据(树状结构)
*
* @param result 返回数组
* @param context 应用上下文
* @param callBack 回调
* @memberof AccountService
*/
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 AccountService
*/
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 AccountService
*/
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 AccountService
*/
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 AccountService
*/
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 AccountService
*/
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()]){
Object.defineProperty(tempData, item.toLowerCase(), {
value: context[(curNavData.value).toLowerCase()],
writable : true,
enumerable : true,
configurable : true
});
}else{
if(viewparams[(curNavData.value).toLowerCase()]){
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
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import AccountBase from './account-treeview-base.vue';
@Component({
components: {
}
})
export default class Account extends AccountBase {
}
</script>
\ No newline at end of file
<template>
<split id="gradationtreeexpbar" class='app-tree-exp-bar' v-model="split" mode="horizontal" @on-move-end="onSplitChange">
<div class="app-tree-exp-bar-left show-title-bar" slot='left'>
<div class='tree-exp-bar-header'>
<div>树视图导航栏</div>
</div>
<div class='tree-exp-content'>
<view_treeexpbar_tree
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:showBusyIndicator="true"
updateAction='Update'
removeAction='Remove'
loadAction='Get'
createAction='Create'
:isSelectFirstDefault="true"
:isBranchAvailable="true"
name="treeexpbar_tree"
ref='treeexpbar_tree'
@selectionchange="treeexpbar_tree_selectionchange($event)"
@load="treeexpbar_tree_load($event)"
@closeview="closeView($event)">
</view_treeexpbar_tree>
</div>
</div>
<div class="app-tree-exp-bar-right" slot='right'>
<component
v-if="selection.view && !Object.is(this.selection.view.viewname, '')"
:is="selection.view.viewname"
class="viewcontainer2"
:viewDefaultUsage="false"
:viewdata="JSON.stringify(selection.context)"
:viewparam="JSON.stringify(selection.viewparam)"
@viewdataschange="onViewDatasChange"
@viewdatasactivated="viewDatasActivated"
@viewload="onViewLoad">
</component>
</div>
</split>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch, Model } from 'vue-property-decorator';
import { CreateElement } from 'vue';
import { Subject, Subscription } from 'rxjs';
import { ControlInterface } from '@/interface/control';
import { UIActionTool,Util } from '@/utils';
import AccountService from '@/service/account/account-service';
import GradationtreeexpbarService from './gradationtreeexpbar-treeexpbar-service';
@Component({
components: {
}
})
export default class GradationtreeexpbarBase extends Vue implements ControlInterface {
/**
* 名称
*
* @type {string}
* @memberof Gradationtreeexpbar
*/
@Prop() public name?: string;
/**
* 视图通讯对象
*
* @type {Subject<ViewState>}
* @memberof Gradationtreeexpbar
*/
@Prop() public viewState!: Subject<ViewState>;
/**
* 应用上下文
*
* @type {*}
* @memberof Gradationtreeexpbar
*/
@Prop() public context: any;
/**
* 视图参数
*
* @type {*}
* @memberof Gradationtreeexpbar
*/
@Prop() public viewparams: any;
/**
* 视图状态事件
*
* @public
* @type {(Subscription | undefined)}
* @memberof Gradationtreeexpbar
*/
public viewStateEvent: Subscription | undefined;
/**
* 获取部件类型
*
* @returns {string}
* @memberof Gradationtreeexpbar
*/
public getControlType(): string {
return 'TREEEXPBAR'
}
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof Gradationtreeexpbar
*/
public counterServiceArray:Array<any> = [];
/**
* 建构部件服务对象
*
* @type {GradationtreeexpbarService}
* @memberof Gradationtreeexpbar
*/
public service: GradationtreeexpbarService = new GradationtreeexpbarService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {AccountService}
* @memberof Gradationtreeexpbar
*/
public appEntityService: AccountService = new AccountService({ $store: this.$store });
/**
* treeexpbar_tree 部件 selectionchange 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof Gradationtreeexpbar
*/
public treeexpbar_tree_selectionchange($event: any, $event2?: any) {
this.treeexpbar_selectionchange($event, 'treeexpbar_tree', $event2);
}
/**
* treeexpbar_tree 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof Gradationtreeexpbar
*/
public treeexpbar_tree_load($event: any, $event2?: any) {
this.treeexpbar_load($event, 'treeexpbar_tree', $event2);
}
/**
* 关闭视图
*
* @param {any} args
* @memberof Gradationtreeexpbar
*/
public closeView(args: any): void {
let _this: any = this;
_this.$emit('closeview', [args]);
}
/**
* 计数器刷新
*
* @memberof Gradationtreeexpbar
*/
public counterRefresh(){
const _this:any =this;
if(_this.counterServiceArray && _this.counterServiceArray.length >0){
_this.counterServiceArray.forEach((item:any) =>{
if(item.refreshData && item.refreshData instanceof Function){
item.refreshData();
}
})
}
}
/**
* 视图唯一标识
*
* @type {boolean}
* @memberof GradationtreeexpbarBase
*/
@Prop() public viewUID!:string;
/**
* 获取多项数据
*
* @returns {any[]}
* @memberof GradationtreeexpbarBase
*/
public getDatas(): any[] {
return [];
}
/**
* 获取单项树
*
* @returns {*}
* @memberof GradationtreeexpbarBase
*/
public getData(): any {
return {};
}
/**
* 选中数据
*
* @type {*}
* @memberof GradationtreeexpbarBase
*/
public selection: any = {};
/**
* 控件宽度
*
* @type {number}
* @memberof GradationtreeexpbarBase
*/
public ctrlWidth:number = 0;
/**
* 过滤值
*
* @type {string}
* @memberof GradationtreeexpbarBase
*/
public srfnodefilter: string = '';
/**
* 刷新标识
*
* @public
* @type {number}
* @memberof GradationtreeexpbarBase
*/
public counter:number = 0;
/**
* 是否加载默认关联视图
*
* @public
* @type {boolean}
* @memberof GradationtreeexpbarBase
*/
public istLoadDefaultRefView: boolean = false;
/**
* 分割宽度
*
* @type {number}
* @memberof GradationtreeexpbarBase
*/
public split: number = 0.15;
/**
* split值变化事件
*
* @memberof GradationtreeexpbarBase
*/
public onSplitChange() {
if(this.split){
this.$store.commit("setViewSplit",{viewUID:this.viewUID,viewSplit:this.split});
}
}
/**
* 获取关系项视图
*
* @param {*} [arg={}]
* @returns {*}
* @memberof GradationtreeexpbarBase
*/
public getExpItemView(arg: any = {}): any {
let expmode = arg.nodetype.toUpperCase();
if (!expmode) {
expmode = '';
}
if (Object.is(expmode, 'ROOTACCOUNT')) {
return {
viewname: 'account-grid-view',
parentdata: {},
deKeyField:'account'
};
}
if (Object.is(expmode, 'CHILDACCOUNT')) {
return {
viewname: 'account-grid-view',
parentdata: {},
deKeyField:'account'
};
}
return null;
}
/**
* 树导航选中
*
* @param {any []} args
* @param {string} [tag]
* @param {*} [$event2]
* @returns {void}
* @memberof GradationtreeexpbarBase
*/
public treeexpbar_selectionchange(args: any [], tag?: string, $event2?: any): void {
if (args.length === 0) {
return ;
}
const arg:any = args[0];
if (!arg.id) {
return;
}
const nodetype = arg.id.split(';')[0];
const refview = this.getExpItemView({ nodetype: nodetype });
if (!refview) {
return;
}
let tempViewparam:any = {};
let tempContext:any ={};
if(arg && arg.navfilter){
this.counter += 1;
Object.defineProperty(tempViewparam, arg.navfilter, {
value : arg.srfkey,
writable : true,
enumerable : true,
configurable : true
})
Object.assign(tempContext,{srfcounter:this.counter});
}
Object.assign(tempContext,JSON.parse(JSON.stringify(this.context)));
if(arg.srfappctx){
Object.assign(tempContext,JSON.parse(JSON.stringify(arg.srfappctx)));
}
// 计算导航上下文
if(arg && arg.navigateContext && Object.keys(arg.navigateContext).length >0){
let tempData:any = arg.curData?JSON.parse(JSON.stringify(arg.curData)):{};
Object.assign(tempData,arg);
let _context = this.$util.computedNavData(tempData,tempContext,tempViewparam,arg.navigateContext);
Object.assign(tempContext,_context);
}
if(arg.srfparentdename){
Object.assign(tempContext,{srfparentdename:arg.srfparentdename});
}
if(arg.srfparentkey){
Object.assign(tempContext,{srfparentkey:arg.srfparentkey});
}
// 计算导航参数
if(arg && arg.navigateParams && Object.keys(arg.navigateParams).length >0){
let tempData:any = arg.curData?JSON.parse(JSON.stringify(arg.curData)):{};
Object.assign(tempData,arg);
let _params = this.$util.computedNavData(tempData,tempContext,tempViewparam,arg.navigateParams);
Object.assign(tempViewparam,_params);
this.counter += 1;
Object.assign(tempContext,{srfcounter:this.counter});
}
this.selection = {};
Object.assign(this.selection, { view: { viewname: refview.viewname } });
Object.assign(this.selection,{'viewparam':tempViewparam,'context':tempContext});
this.$emit('selectionchange',args);
this.$forceUpdate();
}
/**
* 树加载完成
*
* @param {any[]} args
* @param {string} [tag]
* @param {*} [$event2]
* @returns {void}
* @memberof GradationtreeexpbarBase
*/
public treeexpbar_load(args: any[], tag?: string, $event2?: any): void {
this.$emit('load',args);
}
/**
* 执行搜索
*
* @memberof GradationtreeexpbarBase
*/
public onSearch(): void {
if (!this.viewState) {
return;
}
this.istLoadDefaultRefView = false;
this.viewState.next({ tag: 'treeexpbar_tree', action: 'filter', data: { srfnodefilter: this.srfnodefilter } });
}
/**
* vue 声明周期
*
* @memberof @memberof GradationtreeexpbarBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof GradationtreeexpbarBase
*/
public afterCreated(){
if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if (!Object.is(tag, this.name)) {
return;
}
this.istLoadDefaultRefView = false;
this.viewState.next({ tag: 'treeexpbar_tree', action: action, data: data });
});
}
}
/**
* Vue声明周期(组件渲染完毕)
*
* @memberof GradationtreeexpbarBase
*/
public mounted() {
this.afterMounted();
}
/**
* 执行mounted后的逻辑
*
* @memberof GradationtreeexpbarBase
*/
public afterMounted(){
if(this.$store.getters.getViewSplit(this.viewUID)){
this.split = this.$store.getters.getViewSplit(this.viewUID);
}else{
let containerWidth:number = (document.getElementById("gradationtreeexpbar") as any).offsetWidth;
if(this.ctrlWidth){
this.split = this.ctrlWidth/containerWidth;
}
this.$store.commit("setViewSplit",{viewUID:this.viewUID,viewSplit:this.split});
}
}
/**
* vue 生命周期
*
* @memberof GradationtreeexpbarBase
*/
public destroyed() {
this.afterDestroy();
}
/**
* 执行destroyed后的逻辑
*
* @memberof GradationtreeexpbarBase
*/
public afterDestroy() {
if (this.viewStateEvent) {
this.viewStateEvent.unsubscribe();
}
}
/**
* 视图数据变化
*
* @param {*} $event
* @memberof GradationtreeexpbarBase
*/
public onViewDatasChange($event: any): void {
this.$emit('selectionchange', $event);
}
/**
* 视图数据被激活
*
* @param {*} $event
* @memberof GradationtreeexpbarBase
*/
public viewDatasActivated($event: any): void {
this.$emit('activated', $event);
}
/**
* 视图数据加载完成
*
* @param {*} $event
* @memberof GradationtreeexpbarBase
*/
public onViewLoad($event: any): void {
this.$emit('load', $event);
}
}
</script>
<style lang='less'>
@import './gradationtreeexpbar-treeexpbar.less';
</style>
/**
* Gradationtreeexpbar 部件模型
*
* @export
* @class GradationtreeexpbarModel
*/
export default class GradationtreeexpbarModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof GradationtreeexpbarModel
*/
public getDataItems(): any[] {
return [
{
name: 'address1_primarycontactname',
},
{
name: 'openrevenue_date',
},
{
name: 'address2_utcoffset',
},
{
name: 'fax',
},
{
name: 'address1_composite',
},
{
name: 'entityimage',
},
{
name: 'emailaddress1',
},
{
name: 'overriddencreatedon',
},
{
name: 'address1_stateorprovince',
},
{
name: 'openrevenue',
},
{
name: 'address1_upszone',
},
{
name: 'followemail',
},
{
name: 'marketingonly',
},
{
name: 'numberofemployees',
},
{
name: 'telephone1',
},
{
name: 'aging60',
},
{
name: 'sharesoutstanding',
},
{
name: 'address2_freighttermscode',
},
{
name: 'entityimage_timestamp',
},
{
name: 'revenue_base',
},
{
name: 'accountratingcode',
},
{
name: 'donotbulkemail',
},
{
name: 'aging30',
},
{
name: 'donotbulkpostalmail',
},
{
name: 'creditlimit_base',
},
{
name: 'timezoneruleversionnumber',
},
{
name: 'customertypecode',
},
{
name: 'address2_longitude',
},
{
name: 'accountname',
},
{
name: 'participatesinworkflow',
},
{
name: 'preferredcontactmethodcode',
},
{
name: 'preferredappointmentdaycode',
},
{
name: 'marketcap',
},
{
name: 'address2_telephone1',
},
{
name: 'businesstypecode',
},
{
name: 'entityimageid',
},
{
name: 'address2_city',
},
{
name: 'ownershipcode',
},
{
name: 'utcconversiontimezonecode',
},
{
name: 'accountnumber',
},
{
name: 'address1_telephone2',
},
{
name: 'address1_line1',
},
{
name: 'donotphone',
},
{
name: 'address1_telephone3',
},
{
name: 'exchangerate',
},
{
name: 'address2_line2',
},
{
name: 'address2_telephone3',
},
{
name: 'address1_telephone1',
},
{
name: 'address1_fax',
},
{
name: 'address1_freighttermscode',
},
{
name: 'description',
},
{
name: 'merged',
},
{
name: 'address1_shippingmethodcode',
},
{
name: 'address1_name',
},
{
name: 'aging30_base',
},
{
name: 'address2_telephone2',
},
{
name: 'account',
prop: 'accountid',
},
{
name: 'primarytwitterid',
},
{
name: 'tickersymbol',
},
{
name: 'stockexchange',
},
{
name: 'address2_stateorprovince',
},
{
name: 'ftpsiteurl',
},
{
name: 'statuscode',
},
{
name: 'websiteurl',
},
{
name: 'donotpostalmail',
},
{
name: 'address1_city',
},
{
name: 'address2_fax',
},
{
name: 'aging90_base',
},
{
name: 'opendeals_date',
},
{
name: 'traversedpath',
},
{
name: 'shippingmethodcode',
},
{
name: 'address1_line2',
},
{
name: 'openrevenue_base',
},
{
name: 'updatedate',
},
{
name: 'preferredsystemuseridyominame',
},
{
name: 'address2_line3',
},
{
name: 'address1_postalcode',
},
{
name: 'address2_latitude',
},
{
name: 'ibizprivate',
},
{
name: 'territorycode',
},
{
name: 'teamsfollowed',
},
{
name: 'yominame',
},
{
name: 'address1_latitude',
},
{
name: 'telephone3',
},
{
name: 'ownerid',
},
{
name: 'address2_country',
},
{
name: 'masteraccountidyominame',
},
{
name: 'industrycode',
},
{
name: 'lastonholdtime',
},
{
name: 'address2_addressid',
},
{
name: 'onholdtime',
},
{
name: 'accountclassificationcode',
},
{
name: 'address1_country',
},
{
name: 'address1_addresstypecode',
},
{
name: 'statecode',
},
{
name: 'address2_addresstypecode',
},
{
name: 'accountcategorycode',
},
{
name: 'emailaddress2',
},
{
name: 'address2_shippingmethodcode',
},
{
name: 'importsequencenumber',
},
{
name: 'primarysatoriid',
},
{
name: 'customersizecode',
},
{
name: 'opendeals',
},
{
name: 'donotsendmm',
},
{
name: 'processid',
},
{
name: 'paymenttermscode',
},
{
name: 'sic',
},
{
name: 'address2_primarycontactname',
},
{
name: 'address1_utcoffset',
},
{
name: 'owneridyominame',
},
{
name: 'lastusedincampaign',
},
{
name: 'aging60_base',
},
{
name: 'donotfax',
},
{
name: 'updateman',
},
{
name: 'openrevenue_state',
},
{
name: 'opendeals_state',
},
{
name: 'versionnumber',
},
{
name: 'address1_longitude',
},
{
name: 'aging90',
},
{
name: 'entityimage_url',
},
{
name: 'creditlimit',
},
{
name: 'preferredsystemuserid',
},
{
name: 'revenue',
},
{
name: 'address1_county',
},
{
name: 'address1_line3',
},
{
name: 'stageid',
},
{
name: 'donotemail',
},
{
name: 'address2_postalcode',
},
{
name: 'preferredappointmenttimecode',
},
{
name: 'address2_upszone',
},
{
name: 'createdate',
},
{
name: 'address2_county',
},
{
name: 'owneridtype',
},
{
name: 'address2_composite',
},
{
name: 'address2_name',
},
{
name: 'address2_line1',
},
{
name: 'marketcap_base',
},
{
name: 'emailaddress3',
},
{
name: 'telephone2',
},
{
name: 'createman',
},
{
name: 'address1_postofficebox',
},
{
name: 'creditonhold',
},
{
name: 'address1_addressid',
},
{
name: 'address2_postofficebox',
},
{
name: 'slaname',
},
{
name: 'originatingleadid',
},
{
name: 'transactioncurrencyid',
},
{
name: 'defaultpricelevelid',
},
{
name: 'parentaccountid',
},
{
name: 'preferredequipmentid',
},
{
name: 'territoryid',
},
{
name: 'primarycontactid',
},
{
name: 'slaid',
},
{
name: 'preferredserviceid',
},
{
name: 'originatingleadname',
},
{
name: 'defaultpricelevelname',
},
{
name: 'territoryname',
},
{
name: 'parentaccountname',
},
{
name: 'preferredequipmentname',
},
{
name: 'preferredservicename',
},
{
name: 'primarycontactname',
},
{
name: 'transactioncurrencyname',
},
]
}
}
\ No newline at end of file
import { Http } from '@/utils';
import ControlService from '@/widgets/control-service';
/**
* Gradationtreeexpbar 部件服务对象
*
* @export
* @class GradationtreeexpbarService
*/
export default class GradationtreeexpbarService extends ControlService {
}
\ No newline at end of file
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import GradationtreeexpbarBase from './gradationtreeexpbar-treeexpbar-base.vue';
import view_treeexpbar_tree from '@widgets/account/account-treeview/account-treeview.vue';
@Component({
components: {
view_treeexpbar_tree,
}
})
export default class Gradationtreeexpbar extends GradationtreeexpbarBase {
}
</script>
\ No newline at end of file
......@@ -325,7 +325,7 @@ export default class CentralBase extends Vue {
}
/**
* 客户管理
* 客户层级管理
*
* @param {*} [item={}]
* @memberof Central
......@@ -336,7 +336,7 @@ export default class CentralBase extends Vue {
const deResParameters: any[] = [];
const parameters: any[] = [
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'gridview', parameterName: 'gridview' },
{ pathName: 'gradation', parameterName: 'gradation' },
];
const path: string = this.$viewTool.buildUpRoutePath(this.$route, {}, deResParameters, parameters, [], viewparam);
this.$router.push(path);
......
......@@ -265,7 +265,7 @@ export default class CentralModel {
textcls: '',
appfunctag: 'Auto4',
appfuncyype: 'APPVIEW',
viewname: 'account-grid-view',
viewname: 'account-gradation',
resourcetag: '',
}
,
......@@ -948,12 +948,12 @@ export default class CentralModel {
appfunctag: 'Auto4',
appfuncyype: 'APPVIEW',
openmode: '',
codename: 'accountgridview',
codename: 'accountgradation',
deResParameters: [],
routepath: '/central/:central?/accounts/:account?/gridview/:gridview?',
routepath: '/central/:central?/accounts/:account?/gradation/:gradation?',
parameters: [
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'gridview', parameterName: 'gridview' },
{ pathName: 'gradation', parameterName: 'gradation' },
],
},
{
......
......@@ -19,6 +19,7 @@ import com.alibaba.fastjson.JSONObject;
public interface AccountMapper extends BaseMapper<Account>{
Page<Account> searchRoot(IPage page, @Param("srf") AccountSearchContext context, @Param("ew") Wrapper<Account> wrapper) ;
Page<Account> searchDefault(IPage page, @Param("srf") AccountSearchContext context, @Param("ew") Wrapper<Account> wrapper) ;
@Override
Account selectById(Serializable id);
......
......@@ -36,6 +36,7 @@ public interface IAccountService extends IService<Account>{
boolean checkKey(Account et) ;
Account get(String key) ;
Account getDraft(Account et) ;
Page<Account> searchRoot(AccountSearchContext context) ;
Page<Account> searchDefault(AccountSearchContext context) ;
List<Account> selectByParentaccountid(String accountid) ;
void removeByParentaccountid(String accountid) ;
......
......@@ -277,6 +277,15 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
}
/**
* 查询集合 Root
*/
@Override
public Page<Account> searchRoot(AccountSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Account> pages=baseMapper.searchRoot(context.getPages(),context,context.getSelectCond());
return new PageImpl<Account>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 查询集合 DEFAULT
*/
......
......@@ -4514,7 +4514,7 @@
<!--输出实体[ACCOUNT]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-account-311-54">
<changeSet author="a_LAB01_e85d8801c" id="tab-account-314-54">
<createTable tableName="ACCOUNT">
<column name="ADDRESS1_PRIMARYCONTACTNAME" remarks="" type="VARCHAR(100)">
</column>
......@@ -8085,7 +8085,7 @@
<!--输出实体[COMPETITOR]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-competitor-33-89">
<changeSet author="a_LAB01_e85d8801c" id="tab-competitor-34-89">
<createTable tableName="COMPETITOR">
<column name="ENTITYIMAGE" remarks="" type="VARCHAR(100)">
</column>
......@@ -11135,31 +11135,31 @@
<addForeignKeyConstraint baseColumnNames="METRICID" baseTableName="GOAL" constraintName="DER1N_GOAL__METRIC__METRICID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="METRICID" referencedTableName="METRIC" validate="true"/>
</changeSet>
<!--输出实体[ACCOUNT]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-account-311-255">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-314-255">
<addForeignKeyConstraint baseColumnNames="PARENTACCOUNTID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__ACCOUNT__PARENT" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ACCOUNTID" referencedTableName="ACCOUNT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-311-256">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-314-256">
<addForeignKeyConstraint baseColumnNames="PRIMARYCONTACTID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__CONTACT__PRIMAR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="CONTACTID" referencedTableName="CONTACT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-311-257">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-314-257">
<addForeignKeyConstraint baseColumnNames="PREFERREDEQUIPMENTID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__EQUIPMENT__PREF" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EQUIPMENTID" referencedTableName="EQUIPMENT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-311-258">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-314-258">
<addForeignKeyConstraint baseColumnNames="ORIGINATINGLEADID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__LEAD__ORIGINATI" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="LEADID" referencedTableName="LEAD" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-311-259">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-314-259">
<addForeignKeyConstraint baseColumnNames="DEFAULTPRICELEVELID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__PRICELEVEL__DEF" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="PRICELEVELID" referencedTableName="PRICELEVEL" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-311-260">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-314-260">
<addForeignKeyConstraint baseColumnNames="PREFERREDSERVICEID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__SERVICE__PREFER" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SERVICEID" referencedTableName="SERVICE" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-311-261">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-314-261">
<addForeignKeyConstraint baseColumnNames="SLAID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__SLA__SLAID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SLAID" referencedTableName="SLA" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-311-262">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-314-262">
<addForeignKeyConstraint baseColumnNames="TERRITORYID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__TERRITORY__TERR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TERRITORYID" referencedTableName="TERRITORY" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-311-263">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-314-263">
<addForeignKeyConstraint baseColumnNames="TRANSACTIONCURRENCYID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__TRANSACTIONCURR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TRANSACTIONCURRENCYID" referencedTableName="TRANSACTIONCURRENCY" validate="true"/>
</changeSet>
<!--输出实体[KNOWLEDGEARTICLEVIEWS]外键关系 -->
......@@ -11419,7 +11419,7 @@
<!--输出实体[CAMPAIGNLIST]外键关系 -->
<!--输出实体[LISTCONTACT]外键关系 -->
<!--输出实体[COMPETITOR]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-competitor-33-346">
<changeSet author="a_LAB01_e85d8801c" id="fk-competitor-34-346">
<addForeignKeyConstraint baseColumnNames="TRANSACTIONCURRENCYID" baseTableName="COMPETITOR" constraintName="DER1N_COMPETITOR__TRANSACTIONC" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TRANSACTIONCURRENCYID" referencedTableName="TRANSACTIONCURRENCY" validate="true"/>
</changeSet>
<!--输出实体[PRODUCT]外键关系 -->
......
......@@ -168,6 +168,15 @@
where transactioncurrencyid=#{transactioncurrencyid}
</select>
<!--数据集合[Root]-->
<select id="searchRoot" parameterType="cn.ibizlab.businesscentral.core.base.filter.AccountSearchContext" resultMap="AccountResultMap">
select t1.* from (
<include refid="Root" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.businesscentral.core.base.filter.AccountSearchContext" resultMap="AccountResultMap">
select t1.* from (
......@@ -182,6 +191,12 @@
<![CDATA[ SELECT t1.`ACCOUNTCATEGORYCODE`, t1.`ACCOUNTCLASSIFICATIONCODE`, t1.`ACCOUNTID`, t1.`ACCOUNTNAME`, t1.`ACCOUNTNUMBER`, t1.`ACCOUNTRATINGCODE`, t1.`ADDRESS1_ADDRESSID`, t1.`ADDRESS1_ADDRESSTYPECODE`, t1.`ADDRESS1_CITY`, t1.`ADDRESS1_COMPOSITE`, t1.`ADDRESS1_COUNTRY`, t1.`ADDRESS1_COUNTY`, t1.`ADDRESS1_FAX`, t1.`ADDRESS1_FREIGHTTERMSCODE`, t1.`ADDRESS1_LATITUDE`, t1.`ADDRESS1_LINE1`, t1.`ADDRESS1_LINE2`, t1.`ADDRESS1_LINE3`, t1.`ADDRESS1_LONGITUDE`, t1.`ADDRESS1_NAME`, t1.`ADDRESS1_POSTALCODE`, t1.`ADDRESS1_POSTOFFICEBOX`, t1.`ADDRESS1_PRIMARYCONTACTNAME`, t1.`ADDRESS1_SHIPPINGMETHODCODE`, t1.`ADDRESS1_STATEORPROVINCE`, t1.`ADDRESS1_TELEPHONE1`, t1.`ADDRESS1_TELEPHONE2`, t1.`ADDRESS1_TELEPHONE3`, t1.`ADDRESS1_UPSZONE`, t1.`ADDRESS1_UTCOFFSET`, t1.`ADDRESS2_ADDRESSID`, t1.`ADDRESS2_ADDRESSTYPECODE`, t1.`ADDRESS2_CITY`, t1.`ADDRESS2_COMPOSITE`, t1.`ADDRESS2_COUNTRY`, t1.`ADDRESS2_COUNTY`, t1.`ADDRESS2_FAX`, t1.`ADDRESS2_FREIGHTTERMSCODE`, t1.`ADDRESS2_LATITUDE`, t1.`ADDRESS2_LINE1`, t1.`ADDRESS2_LINE2`, t1.`ADDRESS2_LINE3`, t1.`ADDRESS2_LONGITUDE`, t1.`ADDRESS2_NAME`, t1.`ADDRESS2_POSTALCODE`, t1.`ADDRESS2_POSTOFFICEBOX`, t1.`ADDRESS2_PRIMARYCONTACTNAME`, t1.`ADDRESS2_SHIPPINGMETHODCODE`, t1.`ADDRESS2_STATEORPROVINCE`, t1.`ADDRESS2_TELEPHONE1`, t1.`ADDRESS2_TELEPHONE2`, t1.`ADDRESS2_TELEPHONE3`, t1.`ADDRESS2_UPSZONE`, t1.`ADDRESS2_UTCOFFSET`, t1.`AGING30`, t1.`AGING30_BASE`, t1.`AGING60`, t1.`AGING60_BASE`, t1.`AGING90`, t1.`AGING90_BASE`, t1.`BUSINESSTYPECODE`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`CREDITLIMIT`, t1.`CREDITLIMIT_BASE`, t1.`CREDITONHOLD`, t1.`CUSTOMERSIZECODE`, t1.`CUSTOMERTYPECODE`, t1.`DEFAULTPRICELEVELID`, t1.`DEFAULTPRICELEVELNAME`, t1.`DESCRIPTION`, t1.`DONOTBULKEMAIL`, t1.`DONOTBULKPOSTALMAIL`, t1.`DONOTEMAIL`, t1.`DONOTFAX`, t1.`DONOTPHONE`, t1.`DONOTPOSTALMAIL`, t1.`DONOTSENDMM`, t1.`EMAILADDRESS1`, t1.`EMAILADDRESS2`, t1.`EMAILADDRESS3`, t1.`ENTITYIMAGE`, t1.`ENTITYIMAGEID`, t1.`ENTITYIMAGE_TIMESTAMP`, t1.`ENTITYIMAGE_URL`, t1.`EXCHANGERATE`, t1.`FAX`, t1.`FOLLOWEMAIL`, t1.`FTPSITEURL`, t1.`IMPORTSEQUENCENUMBER`, t1.`INDUSTRYCODE`, t1.`LASTONHOLDTIME`, t1.`LASTUSEDINCAMPAIGN`, t1.`MARKETCAP`, t1.`MARKETCAP_BASE`, t1.`MARKETINGONLY`, t1.`MASTERACCOUNTIDYOMINAME`, t1.`MERGED`, t1.`NUMBEROFEMPLOYEES`, t1.`ONHOLDTIME`, t1.`OPENDEALS`, t1.`OPENDEALS_DATE`, t1.`OPENDEALS_STATE`, t1.`OPENREVENUE`, t1.`OPENREVENUE_BASE`, t1.`OPENREVENUE_DATE`, t1.`OPENREVENUE_STATE`, t1.`ORIGINATINGLEADID`, t1.`ORIGINATINGLEADNAME`, t1.`OVERRIDDENCREATEDON`, t1.`OWNERID`, t1.`OWNERIDTYPE`, t1.`OWNERIDYOMINAME`, t1.`OWNERSHIPCODE`, t1.`PARENTACCOUNTID`, t1.`PARENTACCOUNTNAME`, t1.`PARTICIPATESINWORKFLOW`, t1.`PAYMENTTERMSCODE`, t1.`PREFERREDAPPOINTMENTDAYCODE`, t1.`PREFERREDAPPOINTMENTTIMECODE`, t1.`PREFERREDCONTACTMETHODCODE`, t1.`PREFERREDEQUIPMENTID`, t1.`PREFERREDEQUIPMENTNAME`, t1.`PREFERREDSERVICEID`, t1.`PREFERREDSERVICENAME`, t1.`PREFERREDSYSTEMUSERID`, t1.`PREFERREDSYSTEMUSERIDYOMINAME`, t1.`PRIMARYCONTACTID`, t1.`PRIMARYCONTACTNAME`, t1.`PRIMARYSATORIID`, t1.`PRIMARYTWITTERID`, t1.`PRIVATE`, t1.`PROCESSID`, t1.`REVENUE`, t1.`REVENUE_BASE`, t1.`SHARESOUTSTANDING`, t1.`SHIPPINGMETHODCODE`, t1.`SIC`, t1.`SLAID`, t1.`SLANAME`, t1.`STAGEID`, t1.`STATECODE`, t1.`STATUSCODE`, t1.`STOCKEXCHANGE`, t1.`TEAMSFOLLOWED`, t1.`TELEPHONE1`, t1.`TELEPHONE2`, t1.`TELEPHONE3`, t1.`TERRITORYCODE`, t1.`TERRITORYID`, t1.`TERRITORYNAME`, t1.`TICKERSYMBOL`, t1.`TIMEZONERULEVERSIONNUMBER`, t1.`TRANSACTIONCURRENCYID`, t1.`TRANSACTIONCURRENCYNAME`, t1.`TRAVERSEDPATH`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`UTCCONVERSIONTIMEZONECODE`, t1.`VERSIONNUMBER`, t1.`WEBSITEURL`, t1.`YOMINAME` FROM `ACCOUNT` t1
]]>
</sql>
<!--数据查询[Root]-->
<sql id="Root" databaseId="mysql">
<![CDATA[ SELECT t1.`ACCOUNTCATEGORYCODE`, t1.`ACCOUNTCLASSIFICATIONCODE`, t1.`ACCOUNTID`, t1.`ACCOUNTNAME`, t1.`ACCOUNTNUMBER`, t1.`ACCOUNTRATINGCODE`, t1.`ADDRESS1_ADDRESSID`, t1.`ADDRESS1_ADDRESSTYPECODE`, t1.`ADDRESS1_CITY`, t1.`ADDRESS1_COMPOSITE`, t1.`ADDRESS1_COUNTRY`, t1.`ADDRESS1_COUNTY`, t1.`ADDRESS1_FAX`, t1.`ADDRESS1_FREIGHTTERMSCODE`, t1.`ADDRESS1_LATITUDE`, t1.`ADDRESS1_LINE1`, t1.`ADDRESS1_LINE2`, t1.`ADDRESS1_LINE3`, t1.`ADDRESS1_LONGITUDE`, t1.`ADDRESS1_NAME`, t1.`ADDRESS1_POSTALCODE`, t1.`ADDRESS1_POSTOFFICEBOX`, t1.`ADDRESS1_PRIMARYCONTACTNAME`, t1.`ADDRESS1_SHIPPINGMETHODCODE`, t1.`ADDRESS1_STATEORPROVINCE`, t1.`ADDRESS1_TELEPHONE1`, t1.`ADDRESS1_TELEPHONE2`, t1.`ADDRESS1_TELEPHONE3`, t1.`ADDRESS1_UPSZONE`, t1.`ADDRESS1_UTCOFFSET`, t1.`ADDRESS2_ADDRESSID`, t1.`ADDRESS2_ADDRESSTYPECODE`, t1.`ADDRESS2_CITY`, t1.`ADDRESS2_COMPOSITE`, t1.`ADDRESS2_COUNTRY`, t1.`ADDRESS2_COUNTY`, t1.`ADDRESS2_FAX`, t1.`ADDRESS2_FREIGHTTERMSCODE`, t1.`ADDRESS2_LATITUDE`, t1.`ADDRESS2_LINE1`, t1.`ADDRESS2_LINE2`, t1.`ADDRESS2_LINE3`, t1.`ADDRESS2_LONGITUDE`, t1.`ADDRESS2_NAME`, t1.`ADDRESS2_POSTALCODE`, t1.`ADDRESS2_POSTOFFICEBOX`, t1.`ADDRESS2_PRIMARYCONTACTNAME`, t1.`ADDRESS2_SHIPPINGMETHODCODE`, t1.`ADDRESS2_STATEORPROVINCE`, t1.`ADDRESS2_TELEPHONE1`, t1.`ADDRESS2_TELEPHONE2`, t1.`ADDRESS2_TELEPHONE3`, t1.`ADDRESS2_UPSZONE`, t1.`ADDRESS2_UTCOFFSET`, t1.`AGING30`, t1.`AGING30_BASE`, t1.`AGING60`, t1.`AGING60_BASE`, t1.`AGING90`, t1.`AGING90_BASE`, t1.`BUSINESSTYPECODE`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`CREDITLIMIT`, t1.`CREDITLIMIT_BASE`, t1.`CREDITONHOLD`, t1.`CUSTOMERSIZECODE`, t1.`CUSTOMERTYPECODE`, t1.`DEFAULTPRICELEVELID`, t1.`DEFAULTPRICELEVELNAME`, t1.`DESCRIPTION`, t1.`DONOTBULKEMAIL`, t1.`DONOTBULKPOSTALMAIL`, t1.`DONOTEMAIL`, t1.`DONOTFAX`, t1.`DONOTPHONE`, t1.`DONOTPOSTALMAIL`, t1.`DONOTSENDMM`, t1.`EMAILADDRESS1`, t1.`EMAILADDRESS2`, t1.`EMAILADDRESS3`, t1.`ENTITYIMAGE`, t1.`ENTITYIMAGEID`, t1.`ENTITYIMAGE_TIMESTAMP`, t1.`ENTITYIMAGE_URL`, t1.`EXCHANGERATE`, t1.`FAX`, t1.`FOLLOWEMAIL`, t1.`FTPSITEURL`, t1.`IMPORTSEQUENCENUMBER`, t1.`INDUSTRYCODE`, t1.`LASTONHOLDTIME`, t1.`LASTUSEDINCAMPAIGN`, t1.`MARKETCAP`, t1.`MARKETCAP_BASE`, t1.`MARKETINGONLY`, t1.`MASTERACCOUNTIDYOMINAME`, t1.`MERGED`, t1.`NUMBEROFEMPLOYEES`, t1.`ONHOLDTIME`, t1.`OPENDEALS`, t1.`OPENDEALS_DATE`, t1.`OPENDEALS_STATE`, t1.`OPENREVENUE`, t1.`OPENREVENUE_BASE`, t1.`OPENREVENUE_DATE`, t1.`OPENREVENUE_STATE`, t1.`ORIGINATINGLEADID`, t1.`ORIGINATINGLEADNAME`, t1.`OVERRIDDENCREATEDON`, t1.`OWNERID`, t1.`OWNERIDTYPE`, t1.`OWNERIDYOMINAME`, t1.`OWNERSHIPCODE`, t1.`PARENTACCOUNTID`, t1.`PARENTACCOUNTNAME`, t1.`PARTICIPATESINWORKFLOW`, t1.`PAYMENTTERMSCODE`, t1.`PREFERREDAPPOINTMENTDAYCODE`, t1.`PREFERREDAPPOINTMENTTIMECODE`, t1.`PREFERREDCONTACTMETHODCODE`, t1.`PREFERREDEQUIPMENTID`, t1.`PREFERREDEQUIPMENTNAME`, t1.`PREFERREDSERVICEID`, t1.`PREFERREDSERVICENAME`, t1.`PREFERREDSYSTEMUSERID`, t1.`PREFERREDSYSTEMUSERIDYOMINAME`, t1.`PRIMARYCONTACTID`, t1.`PRIMARYCONTACTNAME`, t1.`PRIMARYSATORIID`, t1.`PRIMARYTWITTERID`, t1.`PRIVATE`, t1.`PROCESSID`, t1.`REVENUE`, t1.`REVENUE_BASE`, t1.`SHARESOUTSTANDING`, t1.`SHIPPINGMETHODCODE`, t1.`SIC`, t1.`SLAID`, t1.`SLANAME`, t1.`STAGEID`, t1.`STATECODE`, t1.`STATUSCODE`, t1.`STOCKEXCHANGE`, t1.`TEAMSFOLLOWED`, t1.`TELEPHONE1`, t1.`TELEPHONE2`, t1.`TELEPHONE3`, t1.`TERRITORYCODE`, t1.`TERRITORYID`, t1.`TERRITORYNAME`, t1.`TICKERSYMBOL`, t1.`TIMEZONERULEVERSIONNUMBER`, t1.`TRANSACTIONCURRENCYID`, t1.`TRANSACTIONCURRENCYNAME`, t1.`TRAVERSEDPATH`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`UTCCONVERSIONTIMEZONECODE`, t1.`VERSIONNUMBER`, t1.`WEBSITEURL`, t1.`YOMINAME` FROM `ACCOUNT` t1
WHERE ( t1.`PARENTACCOUNTID` IS NULL )
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`ACCOUNTCATEGORYCODE`, t1.`ACCOUNTCLASSIFICATIONCODE`, t1.`ACCOUNTID`, t1.`ACCOUNTNAME`, t1.`ACCOUNTNUMBER`, t1.`ACCOUNTRATINGCODE`, t1.`ADDRESS1_ADDRESSID`, t1.`ADDRESS1_ADDRESSTYPECODE`, t1.`ADDRESS1_CITY`, t1.`ADDRESS1_COMPOSITE`, t1.`ADDRESS1_COUNTRY`, t1.`ADDRESS1_COUNTY`, t1.`ADDRESS1_FAX`, t1.`ADDRESS1_FREIGHTTERMSCODE`, t1.`ADDRESS1_LATITUDE`, t1.`ADDRESS1_LINE1`, t1.`ADDRESS1_LINE2`, t1.`ADDRESS1_LINE3`, t1.`ADDRESS1_LONGITUDE`, t1.`ADDRESS1_NAME`, t1.`ADDRESS1_POSTALCODE`, t1.`ADDRESS1_POSTOFFICEBOX`, t1.`ADDRESS1_PRIMARYCONTACTNAME`, t1.`ADDRESS1_SHIPPINGMETHODCODE`, t1.`ADDRESS1_STATEORPROVINCE`, t1.`ADDRESS1_TELEPHONE1`, t1.`ADDRESS1_TELEPHONE2`, t1.`ADDRESS1_TELEPHONE3`, t1.`ADDRESS1_UPSZONE`, t1.`ADDRESS1_UTCOFFSET`, t1.`ADDRESS2_ADDRESSID`, t1.`ADDRESS2_ADDRESSTYPECODE`, t1.`ADDRESS2_CITY`, t1.`ADDRESS2_COMPOSITE`, t1.`ADDRESS2_COUNTRY`, t1.`ADDRESS2_COUNTY`, t1.`ADDRESS2_FAX`, t1.`ADDRESS2_FREIGHTTERMSCODE`, t1.`ADDRESS2_LATITUDE`, t1.`ADDRESS2_LINE1`, t1.`ADDRESS2_LINE2`, t1.`ADDRESS2_LINE3`, t1.`ADDRESS2_LONGITUDE`, t1.`ADDRESS2_NAME`, t1.`ADDRESS2_POSTALCODE`, t1.`ADDRESS2_POSTOFFICEBOX`, t1.`ADDRESS2_PRIMARYCONTACTNAME`, t1.`ADDRESS2_SHIPPINGMETHODCODE`, t1.`ADDRESS2_STATEORPROVINCE`, t1.`ADDRESS2_TELEPHONE1`, t1.`ADDRESS2_TELEPHONE2`, t1.`ADDRESS2_TELEPHONE3`, t1.`ADDRESS2_UPSZONE`, t1.`ADDRESS2_UTCOFFSET`, t1.`AGING30`, t1.`AGING30_BASE`, t1.`AGING60`, t1.`AGING60_BASE`, t1.`AGING90`, t1.`AGING90_BASE`, t1.`BUSINESSTYPECODE`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`CREDITLIMIT`, t1.`CREDITLIMIT_BASE`, t1.`CREDITONHOLD`, t1.`CUSTOMERSIZECODE`, t1.`CUSTOMERTYPECODE`, t1.`DEFAULTPRICELEVELID`, t1.`DEFAULTPRICELEVELNAME`, t1.`DESCRIPTION`, t1.`DONOTBULKEMAIL`, t1.`DONOTBULKPOSTALMAIL`, t1.`DONOTEMAIL`, t1.`DONOTFAX`, t1.`DONOTPHONE`, t1.`DONOTPOSTALMAIL`, t1.`DONOTSENDMM`, t1.`EMAILADDRESS1`, t1.`EMAILADDRESS2`, t1.`EMAILADDRESS3`, t1.`ENTITYIMAGE`, t1.`ENTITYIMAGEID`, t1.`ENTITYIMAGE_TIMESTAMP`, t1.`ENTITYIMAGE_URL`, t1.`EXCHANGERATE`, t1.`FAX`, t1.`FOLLOWEMAIL`, t1.`FTPSITEURL`, t1.`IMPORTSEQUENCENUMBER`, t1.`INDUSTRYCODE`, t1.`LASTONHOLDTIME`, t1.`LASTUSEDINCAMPAIGN`, t1.`MARKETCAP`, t1.`MARKETCAP_BASE`, t1.`MARKETINGONLY`, t1.`MASTERACCOUNTIDYOMINAME`, t1.`MERGED`, t1.`NUMBEROFEMPLOYEES`, t1.`ONHOLDTIME`, t1.`OPENDEALS`, t1.`OPENDEALS_DATE`, t1.`OPENDEALS_STATE`, t1.`OPENREVENUE`, t1.`OPENREVENUE_BASE`, t1.`OPENREVENUE_DATE`, t1.`OPENREVENUE_STATE`, t1.`ORIGINATINGLEADID`, t1.`ORIGINATINGLEADNAME`, t1.`OVERRIDDENCREATEDON`, t1.`OWNERID`, t1.`OWNERIDTYPE`, t1.`OWNERIDYOMINAME`, t1.`OWNERSHIPCODE`, t1.`PARENTACCOUNTID`, t1.`PARENTACCOUNTNAME`, t1.`PARTICIPATESINWORKFLOW`, t1.`PAYMENTTERMSCODE`, t1.`PREFERREDAPPOINTMENTDAYCODE`, t1.`PREFERREDAPPOINTMENTTIMECODE`, t1.`PREFERREDCONTACTMETHODCODE`, t1.`PREFERREDEQUIPMENTID`, t1.`PREFERREDEQUIPMENTNAME`, t1.`PREFERREDSERVICEID`, t1.`PREFERREDSERVICENAME`, t1.`PREFERREDSYSTEMUSERID`, t1.`PREFERREDSYSTEMUSERIDYOMINAME`, t1.`PRIMARYCONTACTID`, t1.`PRIMARYCONTACTNAME`, t1.`PRIMARYSATORIID`, t1.`PRIMARYTWITTERID`, t1.`PRIVATE`, t1.`PROCESSID`, t1.`REVENUE`, t1.`REVENUE_BASE`, t1.`SHARESOUTSTANDING`, t1.`SHIPPINGMETHODCODE`, t1.`SIC`, t1.`SLAID`, t1.`SLANAME`, t1.`STAGEID`, t1.`STATECODE`, t1.`STATUSCODE`, t1.`STOCKEXCHANGE`, t1.`TEAMSFOLLOWED`, t1.`TELEPHONE1`, t1.`TELEPHONE2`, t1.`TELEPHONE3`, t1.`TERRITORYCODE`, t1.`TERRITORYID`, t1.`TERRITORYNAME`, t1.`TICKERSYMBOL`, t1.`TIMEZONERULEVERSIONNUMBER`, t1.`TRANSACTIONCURRENCYID`, t1.`TRANSACTIONCURRENCYNAME`, t1.`TRAVERSEDPATH`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`UTCCONVERSIONTIMEZONECODE`, t1.`VERSIONNUMBER`, t1.`WEBSITEURL`, t1.`YOMINAME` FROM `ACCOUNT` t1
......
......@@ -263,7 +263,7 @@
"dename":"Account",
"delogicname":"客户",
"sysmoudle":{"id":"BASE","name":"Base"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"dedataset":[{"id":"Root" , "name":"Root"},{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
......
......@@ -137,6 +137,27 @@ public class AccountResource {
return ResponseEntity.status(HttpStatus.OK).body(accountMapping.toDto(accountService.getDraft(new Account())));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Account-Root-all')")
@ApiOperation(value = "获取Root", tags = {"客户" } ,notes = "获取Root")
@RequestMapping(method= RequestMethod.GET , value="/accounts/fetchroot")
public ResponseEntity<List<AccountDTO>> fetchRoot(AccountSearchContext context) {
Page<Account> domains = accountService.searchRoot(context) ;
List<AccountDTO> list = accountMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Account-Root-all')")
@ApiOperation(value = "查询Root", tags = {"客户" } ,notes = "查询Root")
@RequestMapping(method= RequestMethod.POST , value="/accounts/searchroot")
public ResponseEntity<Page<AccountDTO>> searchRoot(@RequestBody AccountSearchContext context) {
Page<Account> domains = accountService.searchRoot(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(accountMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Account-Default-all')")
@ApiOperation(value = "获取DEFAULT", tags = {"客户" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/accounts/fetchdefault")
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册