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

xignzi006 发布系统代码

上级 bb16e04c
...@@ -449,6 +449,16 @@ ...@@ -449,6 +449,16 @@
"viewtag": "21eb3cee3363f2590cf0cf6af8446300", "viewtag": "21eb3cee3363f2590cf0cf6af8446300",
"memo": "" "memo": ""
}, },
"territorygridview": {
"title": "区域表格视图",
"caption": "区域",
"viewtype": "DEGRIDVIEW",
"viewmodule": "Base",
"viewname": "TerritoryGridView",
"viewfilename": "territory-grid-view",
"viewtag": "224e212f2d5e9c0a6a07b3c650f9b30c",
"memo": ""
},
"campaignstopgridview": { "campaignstopgridview": {
"title": "市场活动信息", "title": "市场活动信息",
"caption": "市场活动", "caption": "市场活动",
...@@ -739,6 +749,16 @@ ...@@ -739,6 +749,16 @@
"viewtag": "321c9f14181d1afaf18a8ffacea2a29f", "viewtag": "321c9f14181d1afaf18a8ffacea2a29f",
"memo": "" "memo": ""
}, },
"territoryeditview": {
"title": "区域编辑视图",
"caption": "区域",
"viewtype": "DEEDITVIEW",
"viewmodule": "Base",
"viewname": "TerritoryEditView",
"viewfilename": "territory-edit-view",
"viewtag": "3415a4be4d65d2bdf6069eecfa2effaa",
"memo": ""
},
"leadinfo": { "leadinfo": {
"title": "潜在顾客", "title": "潜在顾客",
"caption": "潜在顾客", "caption": "潜在顾客",
......
...@@ -63,6 +63,7 @@ export class AuthServiceRegister { ...@@ -63,6 +63,7 @@ export class AuthServiceRegister {
this.allAuthService.set('connection', () => import('@/authservice/connection/connection-auth-service')); this.allAuthService.set('connection', () => import('@/authservice/connection/connection-auth-service'));
this.allAuthService.set('leadcompetitor', () => import('@/authservice/lead-competitor/lead-competitor-auth-service')); this.allAuthService.set('leadcompetitor', () => import('@/authservice/lead-competitor/lead-competitor-auth-service'));
this.allAuthService.set('campaignresponse', () => import('@/authservice/campaign-response/campaign-response-auth-service')); this.allAuthService.set('campaignresponse', () => import('@/authservice/campaign-response/campaign-response-auth-service'));
this.allAuthService.set('territory', () => import('@/authservice/territory/territory-auth-service'));
this.allAuthService.set('phonecall', () => import('@/authservice/phone-call/phone-call-auth-service')); this.allAuthService.set('phonecall', () => import('@/authservice/phone-call/phone-call-auth-service'));
this.allAuthService.set('salesorderdetail', () => import('@/authservice/sales-order-detail/sales-order-detail-auth-service')); this.allAuthService.set('salesorderdetail', () => import('@/authservice/sales-order-detail/sales-order-detail-auth-service'));
this.allAuthService.set('connectionrole', () => import('@/authservice/connection-role/connection-role-auth-service')); this.allAuthService.set('connectionrole', () => import('@/authservice/connection-role/connection-role-auth-service'));
......
import AuthService from '../auth-service';
/**
* 区域权限服务对象基类
*
* @export
* @class TerritoryAuthServiceBase
* @extends {AuthService}
*/
export default class TerritoryAuthServiceBase extends AuthService {
/**
* Creates an instance of TerritoryAuthServiceBase.
*
* @param {*} [opts={}]
* @memberof TerritoryAuthServiceBase
*/
constructor(opts: any = {}) {
super(opts);
}
/**
* 根据当前数据获取实体操作标识
*
* @param {*} mainSateOPPrivs 传入数据操作标识
* @returns {any}
* @memberof TerritoryAuthServiceBase
*/
public getOPPrivs(mainSateOPPrivs:any):any{
let curDefaultOPPrivs:any = JSON.parse(JSON.stringify(this.defaultOPPrivs));
if(mainSateOPPrivs){
Object.assign(curDefaultOPPrivs,mainSateOPPrivs);
}
return curDefaultOPPrivs;
}
}
\ No newline at end of file
import TerritoryAuthServiceBase from './territory-auth-service-base';
/**
* 区域权限服务对象
*
* @export
* @class TerritoryAuthService
* @extends {TerritoryAuthServiceBase}
*/
export default class TerritoryAuthService extends TerritoryAuthServiceBase {
/**
* Creates an instance of TerritoryAuthService.
*
* @param {*} [opts={}]
* @memberof TerritoryAuthService
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
/**
* 区域
*
* @export
* @interface Territory
*/
export interface Territory {
/**
* 更新人
*
* @returns {*}
* @memberof Territory
*/
updateman?: any;
/**
* 建立时间
*
* @returns {*}
* @memberof Territory
*/
createdate?: any;
/**
* 汇率
*
* @returns {*}
* @memberof Territory
*/
exchangerate?: any;
/**
* 区域
*
* @returns {*}
* @memberof Territory
*/
territoryid?: any;
/**
* 更新时间
*
* @returns {*}
* @memberof Territory
*/
updatedate?: any;
/**
* EntityImageId
*
* @returns {*}
* @memberof Territory
*/
entityimageid?: any;
/**
* 经理
*
* @returns {*}
* @memberof Territory
*/
managerid?: any;
/**
* EntityImage_URL
*
* @returns {*}
* @memberof Territory
*/
entityimage_url?: any;
/**
* Import Sequence Number
*
* @returns {*}
* @memberof Territory
*/
importsequencenumber?: any;
/**
* 时区
*
* @returns {*}
* @memberof Territory
*/
utcconversiontimezonecode?: any;
/**
* 地区名称
*
* @returns {*}
* @memberof Territory
*/
territoryname?: any;
/**
* 建立人
*
* @returns {*}
* @memberof Territory
*/
createman?: any;
/**
* Record Created On
*
* @returns {*}
* @memberof Territory
*/
overriddencreatedon?: any;
/**
* 实体图像
*
* @returns {*}
* @memberof Territory
*/
entityimage?: any;
/**
* Version Number
*
* @returns {*}
* @memberof Territory
*/
versionnumber?: any;
/**
* EntityImage_Timestamp
*
* @returns {*}
* @memberof Territory
*/
entityimage_timestamp?: any;
/**
* 管理员
*
* @returns {*}
* @memberof Territory
*/
managername?: any;
/**
* Time Zone Rule Version Number
*
* @returns {*}
* @memberof Territory
*/
timezoneruleversionnumber?: any;
/**
* 说明
*
* @returns {*}
* @memberof Territory
*/
description?: any;
/**
* 货币
*
* @returns {*}
* @memberof Territory
*/
transactioncurrencyid?: any;
/**
* 货币
*
* @returns {*}
* @memberof Territory
*/
transactioncurrencyname?: any;
}
\ No newline at end of file
...@@ -22,6 +22,7 @@ import ibizlist_en_US from '@locale/lanres/entities/ibiz-list/ibiz-list_en_US'; ...@@ -22,6 +22,7 @@ import ibizlist_en_US from '@locale/lanres/entities/ibiz-list/ibiz-list_en_US';
import connection_en_US from '@locale/lanres/entities/connection/connection_en_US'; import connection_en_US from '@locale/lanres/entities/connection/connection_en_US';
import leadcompetitor_en_US from '@locale/lanres/entities/lead-competitor/lead-competitor_en_US'; import leadcompetitor_en_US from '@locale/lanres/entities/lead-competitor/lead-competitor_en_US';
import campaignresponse_en_US from '@locale/lanres/entities/campaign-response/campaign-response_en_US'; import campaignresponse_en_US from '@locale/lanres/entities/campaign-response/campaign-response_en_US';
import territory_en_US from '@locale/lanres/entities/territory/territory_en_US';
import phonecall_en_US from '@locale/lanres/entities/phone-call/phone-call_en_US'; import phonecall_en_US from '@locale/lanres/entities/phone-call/phone-call_en_US';
import salesorderdetail_en_US from '@locale/lanres/entities/sales-order-detail/sales-order-detail_en_US'; import salesorderdetail_en_US from '@locale/lanres/entities/sales-order-detail/sales-order-detail_en_US';
import connectionrole_en_US from '@locale/lanres/entities/connection-role/connection-role_en_US'; import connectionrole_en_US from '@locale/lanres/entities/connection-role/connection-role_en_US';
...@@ -188,8 +189,9 @@ export default { ...@@ -188,8 +189,9 @@ export default {
user_menus: "用户菜单", user_menus: "用户菜单",
top_menus: "顶部菜单", top_menus: "顶部菜单",
menuitem3: "系统设置", menuitem3: "系统设置",
menuitem4: "链接角色", menuitem33: "区域",
menuitem26: "货币", menuitem26: "货币",
menuitem4: "链接角色",
menuitem34: "消息通知", menuitem34: "消息通知",
menuitem35: "帮助", menuitem35: "帮助",
left_exp: "左侧菜单", left_exp: "左侧菜单",
...@@ -350,6 +352,7 @@ export default { ...@@ -350,6 +352,7 @@ export default {
connection: connection_en_US, connection: connection_en_US,
leadcompetitor: leadcompetitor_en_US, leadcompetitor: leadcompetitor_en_US,
campaignresponse: campaignresponse_en_US, campaignresponse: campaignresponse_en_US,
territory: territory_en_US,
phonecall: phonecall_en_US, phonecall: phonecall_en_US,
salesorderdetail: salesorderdetail_en_US, salesorderdetail: salesorderdetail_en_US,
connectionrole: connectionrole_en_US, connectionrole: connectionrole_en_US,
......
...@@ -22,6 +22,7 @@ import ibizlist_zh_CN from '@locale/lanres/entities/ibiz-list/ibiz-list_zh_CN'; ...@@ -22,6 +22,7 @@ import ibizlist_zh_CN from '@locale/lanres/entities/ibiz-list/ibiz-list_zh_CN';
import connection_zh_CN from '@locale/lanres/entities/connection/connection_zh_CN'; import connection_zh_CN from '@locale/lanres/entities/connection/connection_zh_CN';
import leadcompetitor_zh_CN from '@locale/lanres/entities/lead-competitor/lead-competitor_zh_CN'; import leadcompetitor_zh_CN from '@locale/lanres/entities/lead-competitor/lead-competitor_zh_CN';
import campaignresponse_zh_CN from '@locale/lanres/entities/campaign-response/campaign-response_zh_CN'; import campaignresponse_zh_CN from '@locale/lanres/entities/campaign-response/campaign-response_zh_CN';
import territory_zh_CN from '@locale/lanres/entities/territory/territory_zh_CN';
import phonecall_zh_CN from '@locale/lanres/entities/phone-call/phone-call_zh_CN'; import phonecall_zh_CN from '@locale/lanres/entities/phone-call/phone-call_zh_CN';
import salesorderdetail_zh_CN from '@locale/lanres/entities/sales-order-detail/sales-order-detail_zh_CN'; import salesorderdetail_zh_CN from '@locale/lanres/entities/sales-order-detail/sales-order-detail_zh_CN';
import connectionrole_zh_CN from '@locale/lanres/entities/connection-role/connection-role_zh_CN'; import connectionrole_zh_CN from '@locale/lanres/entities/connection-role/connection-role_zh_CN';
...@@ -188,8 +189,9 @@ export default { ...@@ -188,8 +189,9 @@ export default {
user_menus: "用户菜单", user_menus: "用户菜单",
top_menus: "顶部菜单", top_menus: "顶部菜单",
menuitem3: "系统设置", menuitem3: "系统设置",
menuitem4: "链接角色", menuitem33: "区域",
menuitem26: "货币", menuitem26: "货币",
menuitem4: "链接角色",
menuitem34: "消息通知", menuitem34: "消息通知",
menuitem35: "帮助", menuitem35: "帮助",
left_exp: "左侧菜单", left_exp: "左侧菜单",
...@@ -349,6 +351,7 @@ export default { ...@@ -349,6 +351,7 @@ export default {
connection: connection_zh_CN, connection: connection_zh_CN,
leadcompetitor: leadcompetitor_zh_CN, leadcompetitor: leadcompetitor_zh_CN,
campaignresponse: campaignresponse_zh_CN, campaignresponse: campaignresponse_zh_CN,
territory: territory_zh_CN,
phonecall: phonecall_zh_CN, phonecall: phonecall_zh_CN,
salesorderdetail: salesorderdetail_zh_CN, salesorderdetail: salesorderdetail_zh_CN,
connectionrole: connectionrole_zh_CN, connectionrole: connectionrole_zh_CN,
......
export default {
fields: {
updateman: "更新人",
createdate: "建立时间",
exchangerate: "汇率",
territoryid: "区域",
updatedate: "更新时间",
entityimageid: "EntityImageId",
managerid: "经理",
entityimage_url: "EntityImage_URL",
importsequencenumber: "Import Sequence Number",
utcconversiontimezonecode: "时区",
territoryname: "地区名称",
createman: "建立人",
overriddencreatedon: "Record Created On",
entityimage: "实体图像",
versionnumber: "Version Number",
entityimage_timestamp: "EntityImage_Timestamp",
managername: "管理员",
timezoneruleversionnumber: "Time Zone Rule Version Number",
description: "说明",
transactioncurrencyid: "货币",
transactioncurrencyname: "货币",
},
views: {
gridview: {
caption: "区域",
title: "区域表格视图",
},
editview: {
caption: "区域",
title: "区域编辑视图",
},
},
main_form: {
details: {
group1: "territory基本信息",
formpage1: "基本信息",
srfupdatedate: "更新时间",
srforikey: "",
srfkey: "区域",
srfmajortext: "地区名称",
srftempmode: "",
srfuf: "",
srfdeid: "",
srfsourcekey: "",
territoryname: "地区名称",
managername: "管理员",
transactioncurrencyname: "货币",
exchangerate: "汇率",
transactioncurrencyid: "货币",
territoryid: "区域",
},
uiactions: {
},
},
main_grid: {
columns: {
territoryname: "地区名称",
managername: "管理员",
transactioncurrencyname: "货币",
exchangerate: "汇率",
updatedate: "更新时间",
},
uiactions: {
},
},
default_searchform: {
details: {
formpage1: "常规条件",
},
uiactions: {
},
},
gridviewtoolbar_toolbar: {
tbitem3: {
caption: "New",
tip: "New",
},
tbitem4: {
caption: "Edit",
tip: "Edit {0}",
},
tbitem6: {
caption: "Copy",
tip: "Copy {0}",
},
tbitem7: {
caption: "-",
tip: "",
},
tbitem8: {
caption: "Remove",
tip: "Remove {0}",
},
tbitem9: {
caption: "-",
tip: "",
},
tbitem13: {
caption: "Export",
tip: "Export {0} Data To Excel",
},
tbitem10: {
caption: "-",
tip: "",
},
tbitem19: {
caption: "Filter",
tip: "Filter",
},
},
editviewtoolbar_toolbar: {
tbitem3: {
caption: "Save",
tip: "Save",
},
tbitem4: {
caption: "Save And New",
tip: "Save And New",
},
tbitem5: {
caption: "Save And Close",
tip: "Save And Close Window",
},
tbitem6: {
caption: "-",
tip: "",
},
tbitem7: {
caption: "Remove And Close",
tip: "Remove And Close Window",
},
tbitem8: {
caption: "-",
tip: "",
},
tbitem12: {
caption: "New",
tip: "New",
},
tbitem13: {
caption: "-",
tip: "",
},
tbitem14: {
caption: "Copy",
tip: "Copy {0}",
},
},
};
\ No newline at end of file
export default {
fields: {
updateman: "更新人",
createdate: "建立时间",
exchangerate: "汇率",
territoryid: "区域",
updatedate: "更新时间",
entityimageid: "EntityImageId",
managerid: "经理",
entityimage_url: "EntityImage_URL",
importsequencenumber: "Import Sequence Number",
utcconversiontimezonecode: "时区",
territoryname: "地区名称",
createman: "建立人",
overriddencreatedon: "Record Created On",
entityimage: "实体图像",
versionnumber: "Version Number",
entityimage_timestamp: "EntityImage_Timestamp",
managername: "管理员",
timezoneruleversionnumber: "Time Zone Rule Version Number",
description: "说明",
transactioncurrencyid: "货币",
transactioncurrencyname: "货币",
},
views: {
gridview: {
caption: "区域",
title: "区域表格视图",
},
editview: {
caption: "区域",
title: "区域编辑视图",
},
},
main_form: {
details: {
group1: "territory基本信息",
formpage1: "基本信息",
srfupdatedate: "更新时间",
srforikey: "",
srfkey: "区域",
srfmajortext: "地区名称",
srftempmode: "",
srfuf: "",
srfdeid: "",
srfsourcekey: "",
territoryname: "地区名称",
managername: "管理员",
transactioncurrencyname: "货币",
exchangerate: "汇率",
transactioncurrencyid: "货币",
territoryid: "区域",
},
uiactions: {
},
},
main_grid: {
columns: {
territoryname: "地区名称",
managername: "管理员",
transactioncurrencyname: "货币",
exchangerate: "汇率",
updatedate: "更新时间",
},
uiactions: {
},
},
default_searchform: {
details: {
formpage1: "常规条件",
},
uiactions: {
},
},
gridviewtoolbar_toolbar: {
tbitem3: {
caption: "新建",
tip: "新建",
},
tbitem4: {
caption: "编辑",
tip: "编辑",
},
tbitem6: {
caption: "拷贝",
tip: "拷贝",
},
tbitem7: {
caption: "-",
tip: "",
},
tbitem8: {
caption: "删除",
tip: "删除",
},
tbitem9: {
caption: "-",
tip: "",
},
tbitem13: {
caption: "导出",
tip: "导出",
},
tbitem10: {
caption: "-",
tip: "",
},
tbitem19: {
caption: "过滤",
tip: "过滤",
},
},
editviewtoolbar_toolbar: {
tbitem3: {
caption: "保存",
tip: "保存",
},
tbitem4: {
caption: "保存并新建",
tip: "保存并新建",
},
tbitem5: {
caption: "保存并关闭",
tip: "保存并关闭",
},
tbitem6: {
caption: "-",
tip: "",
},
tbitem7: {
caption: "删除并关闭",
tip: "删除并关闭",
},
tbitem8: {
caption: "-",
tip: "",
},
tbitem12: {
caption: "新建",
tip: "新建",
},
tbitem13: {
caption: "-",
tip: "",
},
tbitem14: {
caption: "拷贝",
tip: "拷贝",
},
},
};
\ No newline at end of file
...@@ -61,25 +61,25 @@ mock.onGet('v7/centralappmenu').reply((config: any) => { ...@@ -61,25 +61,25 @@ mock.onGet('v7/centralappmenu').reply((config: any) => {
iconcls: 'fa fa-certificate', iconcls: 'fa fa-certificate',
icon: '', icon: '',
textcls: '', textcls: '',
appfunctag: '_4', appfunctag: '_5',
resourcetag: '', resourcetag: '',
items: [ items: [
{ {
id: '214745B6-68CB-4548-B138-81E07338033C', id: 'DEFD42F2-BBE6-464F-A669-FF16D127830B',
name: 'menuitem4', name: 'menuitem33',
text: '链接角色', text: '区域',
type: 'MENUITEM', type: 'MENUITEM',
counterid: '', counterid: '',
tooltip: '链接角色', tooltip: '区域',
expanded: false, expanded: false,
separator: false, separator: false,
hidden: false, hidden: false,
hidesidebar: false, hidesidebar: false,
opendefault: false, opendefault: false,
iconcls: 'fa fa-link', iconcls: 'fa fa-medium',
icon: '', icon: '',
textcls: '', textcls: '',
appfunctag: '_5', appfunctag: '_4',
resourcetag: '', resourcetag: '',
}, },
{ {
...@@ -97,7 +97,25 @@ mock.onGet('v7/centralappmenu').reply((config: any) => { ...@@ -97,7 +97,25 @@ mock.onGet('v7/centralappmenu').reply((config: any) => {
iconcls: 'fa fa-rmb', iconcls: 'fa fa-rmb',
icon: '', icon: '',
textcls: '', textcls: '',
appfunctag: '_7', appfunctag: '_8',
resourcetag: '',
},
{
id: '214745B6-68CB-4548-B138-81E07338033C',
name: 'menuitem4',
text: '链接角色',
type: 'MENUITEM',
counterid: '',
tooltip: '链接角色',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: 'fa fa-link',
icon: '',
textcls: '',
appfunctag: '_6',
resourcetag: '', resourcetag: '',
}, },
], ],
...@@ -301,7 +319,7 @@ mock.onGet('v7/centralappmenu').reply((config: any) => { ...@@ -301,7 +319,7 @@ mock.onGet('v7/centralappmenu').reply((config: any) => {
iconcls: 'fa fa-users', iconcls: 'fa fa-users',
icon: '', icon: '',
textcls: '', textcls: '',
appfunctag: '_8', appfunctag: '_9',
resourcetag: '', resourcetag: '',
}, },
{ {
...@@ -615,7 +633,7 @@ mock.onGet('v7/centralappmenu').reply((config: any) => { ...@@ -615,7 +633,7 @@ mock.onGet('v7/centralappmenu').reply((config: any) => {
iconcls: 'fa fa-line-chart', iconcls: 'fa fa-line-chart',
icon: '', icon: '',
textcls: '', textcls: '',
appfunctag: '_6', appfunctag: '_7',
resourcetag: '', resourcetag: '',
}, },
], ],
......
...@@ -25,7 +25,7 @@ mock.onGet('v7/settingappmenu').reply((config: any) => { ...@@ -25,7 +25,7 @@ mock.onGet('v7/settingappmenu').reply((config: any) => {
iconcls: 'fa fa-connectdevelop', iconcls: 'fa fa-connectdevelop',
icon: '', icon: '',
textcls: '', textcls: '',
appfunctag: '_5', appfunctag: '_6',
resourcetag: '', resourcetag: '',
}, },
], ],
......
import qs from 'qs';
import { MockAdapter } from '@/mock/mock-adapter';
const mock = MockAdapter.getInstance();
// 模拟数据
const mockDatas: Array<any> = [
];
//getwflink
mock.onGet(new RegExp(/^\/wfcore\/ibizbusinesscentral-app-crm\/territories\/[a-zA-Z0-9\-\;]+\/usertasks\/[a-zA-Z0-9\-\;]+\/ways$/)).reply((config: any) => {
console.groupCollapsed("实体:territory 方法: getwflink");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status,[
{"sequenceFlowId":"dfdsfdsfdsfdsfds","sequenceFlowName":"同意",
"taskId":"aaaaddddccccddddd","processDefinitionKey":"support-workorders-approve-v1",
"processInstanceId":"ddlfldldfldsfds","refViewKey":""},
{"sequenceFlowId":"ddssdfdfdfdfsfdf","sequenceFlowName":"不同意",
"taskId":"aaaaddddccccddddd","processDefinitionKey":"support-workorders-approve-v1",
"processInstanceId":"ddfdsldlfdlldsf","refViewKey":"workorder_ltform_editview"}
]];
});
// getwfstep
mock.onGet(new RegExp(/^\/wfcore\/ibizbusinesscentral-app-crm\/territories\/process-definitions-nodes$/)).reply((config: any) => {
console.groupCollapsed("实体:territory 方法: getwfstep");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, [
{"userTaskId":"sddfddfd-dfdf-fdfd-fdf-dfdfd",
"userTaskName":"待审",
"cnt":0,
"processDefinitionKey":"support-workorders-approve-v1",
"processDefinitionName":"工单审批流程v1"
},
{"userTaskId":"sddfddfd-dfdf-fdfd-fdf-87927",
"userTaskName":"待分配",
"cnt":3,
"processDefinitionKey":"support-workorders-approve-v1",
"processDefinitionName":"工单审批流程v1"}
]];
});
// createBatch
mock.onPost(new RegExp(/^\/territories\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:territory 方法: createBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// updateBatch
mock.onPut(new RegExp(/^\/territories\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:territory 方法: updateBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// removeBatch
mock.onDelete(new RegExp(/^\/territories\/batch$/)).reply((config: any) => {
console.groupCollapsed("实体:territory 方法: removeBatch");
console.table({url:config.url, method: config.method, data:config.data});
console.groupEnd();
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, {}];
}
return [status, {}];
});
// Select
mock.onGet(new RegExp(/^\/territories\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:territory 方法: Select");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['territoryid'];
const matchArray:any = new RegExp(/^\/territories\/([a-zA-Z0-9\-\;]{1,35})\/select$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.territoryid, tempValue.territoryid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items);
console.groupEnd();
console.groupEnd();
return [status, _items];
});
// Create
mock.onPost(new RegExp(/^\/territories\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:territory 方法: Create");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['territoryid'];
const matchArray:any = new RegExp(/^\/territories\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas[0]);
console.groupEnd();
console.groupEnd();
return [status, mockDatas[0]];
});
// Update
mock.onPut(new RegExp(/^\/territories\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:territory 方法: Update");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['territoryid'];
const matchArray:any = new RegExp(/^\/territories\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.territoryid, tempValue.territoryid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['territoryid'] == tempValue['territoryid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/territories\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:territory 方法: GetDraft");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// CheckKey
mock.onPost(new RegExp(/^\/territories\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:territory 方法: CheckKey");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['territoryid'];
const matchArray:any = new RegExp(/^\/territories\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.territoryid, tempValue.territoryid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['territoryid'] == tempValue['territoryid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// Save
mock.onPost(new RegExp(/^\/territories\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:territory 方法: Save");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['territoryid'];
const matchArray:any = new RegExp(/^\/territories\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.territoryid, tempValue.territoryid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['territoryid'] == tempValue['territoryid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// FetchDefault
mock.onGet(new RegExp(/^\/territories\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:territory 方法: FetchDefault");
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 : []];
});
// FetchDefault
mock.onGet(new RegExp(/^\/territories\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:territory 方法: FetchDefault");
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 : []];
});
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// Remove
mock.onDelete(new RegExp(/^\/territories\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:territory 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['territoryid'];
const matchArray:any = new RegExp(/^\/territories\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.territoryid, tempValue.territoryid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items?_items:{});
console.groupEnd();
console.groupEnd();
return [status, _items?_items:{}];
});
// Get
mock.onGet(new RegExp(/^\/territories\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:territory 方法: Get");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['territoryid'];
const matchArray:any = new RegExp(/^\/territories\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.territoryid, tempValue.territoryid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items?_items:{});
console.groupEnd();
console.groupEnd();
return [status, _items?_items:{}];
});
...@@ -31,6 +31,7 @@ import './entity/ibiz-lists/ibiz-lists'; ...@@ -31,6 +31,7 @@ import './entity/ibiz-lists/ibiz-lists';
import './entity/connections/connections'; import './entity/connections/connections';
import './entity/lead-competitors/lead-competitors'; import './entity/lead-competitors/lead-competitors';
import './entity/campaign-responses/campaign-responses'; import './entity/campaign-responses/campaign-responses';
import './entity/territorys/territorys';
import './entity/phone-calls/phone-calls'; import './entity/phone-calls/phone-calls';
import './entity/sales-order-details/sales-order-details'; import './entity/sales-order-details/sales-order-details';
import './entity/connection-roles/connection-roles'; import './entity/connection-roles/connection-roles';
......
...@@ -367,6 +367,14 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => { ...@@ -367,6 +367,14 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => {
"viewname": "ContactInfo_Person", "viewname": "ContactInfo_Person",
"viewtag": "21eb3cee3363f2590cf0cf6af8446300" "viewtag": "21eb3cee3363f2590cf0cf6af8446300"
}, },
"territorygridview": {
"title": "区域表格视图",
"caption": "区域",
"viewtype": "DEGRIDVIEW",
"viewmodule": "Base",
"viewname": "TerritoryGridView",
"viewtag": "224e212f2d5e9c0a6a07b3c650f9b30c"
},
"campaignstopgridview": { "campaignstopgridview": {
"title": "市场活动信息", "title": "市场活动信息",
"caption": "市场活动", "caption": "市场活动",
...@@ -599,6 +607,14 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => { ...@@ -599,6 +607,14 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => {
"viewname": "CompetitorProductEdit_CompProView", "viewname": "CompetitorProductEdit_CompProView",
"viewtag": "321c9f14181d1afaf18a8ffacea2a29f" "viewtag": "321c9f14181d1afaf18a8ffacea2a29f"
}, },
"territoryeditview": {
"title": "区域编辑视图",
"caption": "区域",
"viewtype": "DEEDITVIEW",
"viewmodule": "Base",
"viewname": "TerritoryEditView",
"viewtag": "3415a4be4d65d2bdf6069eecfa2effaa"
},
"leadinfo": { "leadinfo": {
"title": "潜在顾客", "title": "潜在顾客",
"caption": "潜在顾客", "caption": "潜在顾客",
......
...@@ -19,8 +19,8 @@ export const PageComponents = { ...@@ -19,8 +19,8 @@ export const PageComponents = {
Vue.component('sales-order-invoice-grid-view', () => import('@pages/sales/sales-order-invoice-grid-view/sales-order-invoice-grid-view.vue')); Vue.component('sales-order-invoice-grid-view', () => import('@pages/sales/sales-order-invoice-grid-view/sales-order-invoice-grid-view.vue'));
Vue.component('sales-order-edit-data-panel-view', () => import('@pages/sales/sales-order-edit-data-panel-view/sales-order-edit-data-panel-view.vue')); Vue.component('sales-order-edit-data-panel-view', () => import('@pages/sales/sales-order-edit-data-panel-view/sales-order-edit-data-panel-view.vue'));
Vue.component('opportunity-competitor-opp-comp-grid-view', () => import('@pages/sales/opportunity-competitor-opp-comp-grid-view/opportunity-competitor-opp-comp-grid-view.vue')); Vue.component('opportunity-competitor-opp-comp-grid-view', () => import('@pages/sales/opportunity-competitor-opp-comp-grid-view/opportunity-competitor-opp-comp-grid-view.vue'));
Vue.component('invoice-by-parent-key', () => import('@pages/finance/invoice-by-parent-key/invoice-by-parent-key.vue'));
Vue.component('goal-info-goal-view', () => import('@pages/sales/goal-info-goal-view/goal-info-goal-view.vue')); Vue.component('goal-info-goal-view', () => import('@pages/sales/goal-info-goal-view/goal-info-goal-view.vue'));
Vue.component('invoice-by-parent-key', () => import('@pages/finance/invoice-by-parent-key/invoice-by-parent-key.vue'));
Vue.component('invoice-paid-grid-view', () => import('@pages/finance/invoice-paid-grid-view/invoice-paid-grid-view.vue')); Vue.component('invoice-paid-grid-view', () => import('@pages/finance/invoice-paid-grid-view/invoice-paid-grid-view.vue'));
Vue.component('goal-info-view', () => import('@pages/sales/goal-info-view/goal-info-view.vue')); Vue.component('goal-info-view', () => import('@pages/sales/goal-info-view/goal-info-view.vue'));
Vue.component('opportunity-grid-view', () => import('@pages/sales/opportunity-grid-view/opportunity-grid-view.vue')); Vue.component('opportunity-grid-view', () => import('@pages/sales/opportunity-grid-view/opportunity-grid-view.vue'));
...@@ -42,6 +42,7 @@ export const PageComponents = { ...@@ -42,6 +42,7 @@ export const PageComponents = {
Vue.component('knowledge-article-grid-view', () => import('@pages/base/knowledge-article-grid-view/knowledge-article-grid-view.vue')); Vue.component('knowledge-article-grid-view', () => import('@pages/base/knowledge-article-grid-view/knowledge-article-grid-view.vue'));
Vue.component('product-quick-create-view', () => import('@pages/product/product-quick-create-view/product-quick-create-view.vue')); Vue.component('product-quick-create-view', () => import('@pages/product/product-quick-create-view/product-quick-create-view.vue'));
Vue.component('campaign-info-manager', () => import('@pages/marketing/campaign-info-manager/campaign-info-manager.vue')); Vue.component('campaign-info-manager', () => import('@pages/marketing/campaign-info-manager/campaign-info-manager.vue'));
Vue.component('territory-grid-view', () => import('@pages/base/territory-grid-view/territory-grid-view.vue'));
Vue.component('opportunity-info-abstract', () => import('@pages/sales/opportunity-info-abstract/opportunity-info-abstract.vue')); Vue.component('opportunity-info-abstract', () => import('@pages/sales/opportunity-info-abstract/opportunity-info-abstract.vue'));
Vue.component('list-contact-edit-view', () => import('@pages/marketing/list-contact-edit-view/list-contact-edit-view.vue')); Vue.component('list-contact-edit-view', () => import('@pages/marketing/list-contact-edit-view/list-contact-edit-view.vue'));
Vue.component('opportunity-state-tab-view', () => import('@pages/sales/opportunity-state-tab-view/opportunity-state-tab-view.vue')); Vue.component('opportunity-state-tab-view', () => import('@pages/sales/opportunity-state-tab-view/opportunity-state-tab-view.vue'));
...@@ -114,6 +115,7 @@ export const PageComponents = { ...@@ -114,6 +115,7 @@ export const PageComponents = {
Vue.component('sales-order-detail-soproduct-grid-view', () => import('@pages/sales/sales-order-detail-soproduct-grid-view/sales-order-detail-soproduct-grid-view.vue')); Vue.component('sales-order-detail-soproduct-grid-view', () => import('@pages/sales/sales-order-detail-soproduct-grid-view/sales-order-detail-soproduct-grid-view.vue'));
Vue.component('opportunity-competitor-edit-view', () => import('@pages/sales/opportunity-competitor-edit-view/opportunity-competitor-edit-view.vue')); Vue.component('opportunity-competitor-edit-view', () => import('@pages/sales/opportunity-competitor-edit-view/opportunity-competitor-edit-view.vue'));
Vue.component('incident-info-incident-view', () => import('@pages/service/incident-info-incident-view/incident-info-incident-view.vue')); Vue.component('incident-info-incident-view', () => import('@pages/service/incident-info-incident-view/incident-info-incident-view.vue'));
Vue.component('territory-edit-view', () => import('@pages/base/territory-edit-view/territory-edit-view.vue'));
Vue.component('account-usable-grid-view', () => import('@pages/base/account-usable-grid-view/account-usable-grid-view.vue')); Vue.component('account-usable-grid-view', () => import('@pages/base/account-usable-grid-view/account-usable-grid-view.vue'));
Vue.component('sales-order-info-soview', () => import('@pages/sales/sales-order-info-soview/sales-order-info-soview.vue')); Vue.component('sales-order-info-soview', () => import('@pages/sales/sales-order-info-soview/sales-order-info-soview.vue'));
Vue.component('quote-state-tab-view', () => import('@pages/sales/quote-state-tab-view/quote-state-tab-view.vue')); Vue.component('quote-state-tab-view', () => import('@pages/sales/quote-state-tab-view/quote-state-tab-view.vue'));
......
...@@ -879,6 +879,20 @@ const router = new Router({ ...@@ -879,6 +879,20 @@ const router = new Router({
}, },
component: () => import('@pages/sales/opportunity-competitor-opp-comp-grid-view/opportunity-competitor-opp-comp-grid-view.vue'), component: () => import('@pages/sales/opportunity-competitor-opp-comp-grid-view/opportunity-competitor-opp-comp-grid-view.vue'),
}, },
{
path: 'goals/:goal?/info_goalview/:info_goalview?',
meta: {
caption: 'entities.goal.views.info_goalview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'goals', parameterName: 'goal' },
{ pathName: 'info_goalview', parameterName: 'info_goalview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/goal-info-goal-view/goal-info-goal-view.vue'),
},
{ {
path: 'accounts/:account?/contacts/:contact?/opportunities/:opportunity?/quotes/:quote?/salesorders/:salesorder?/invoices/:invoice?/byparentkey/:byparentkey?', path: 'accounts/:account?/contacts/:contact?/opportunities/:opportunity?/quotes/:quote?/salesorders/:salesorder?/invoices/:invoice?/byparentkey/:byparentkey?',
meta: { meta: {
...@@ -996,20 +1010,6 @@ const router = new Router({ ...@@ -996,20 +1010,6 @@ const router = new Router({
}, },
component: () => import('@pages/finance/invoice-by-parent-key/invoice-by-parent-key.vue'), component: () => import('@pages/finance/invoice-by-parent-key/invoice-by-parent-key.vue'),
}, },
{
path: 'goals/:goal?/info_goalview/:info_goalview?',
meta: {
caption: 'entities.goal.views.info_goalview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'goals', parameterName: 'goal' },
{ pathName: 'info_goalview', parameterName: 'info_goalview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/goal-info-goal-view/goal-info-goal-view.vue'),
},
{ {
path: 'accounts/:account?/contacts/:contact?/opportunities/:opportunity?/quotes/:quote?/salesorders/:salesorder?/invoices/:invoice?/paidgridview/:paidgridview?', path: 'accounts/:account?/contacts/:contact?/opportunities/:opportunity?/quotes/:quote?/salesorders/:salesorder?/invoices/:invoice?/paidgridview/:paidgridview?',
meta: { meta: {
...@@ -1919,6 +1919,20 @@ const router = new Router({ ...@@ -1919,6 +1919,20 @@ const router = new Router({
}, },
component: () => import('@pages/marketing/campaign-info-manager/campaign-info-manager.vue'), component: () => import('@pages/marketing/campaign-info-manager/campaign-info-manager.vue'),
}, },
{
path: 'territories/:territory?/gridview/:gridview?',
meta: {
caption: 'entities.territory.views.gridview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'territories', parameterName: 'territory' },
{ pathName: 'gridview', parameterName: 'gridview' },
],
requireAuth: true,
},
component: () => import('@pages/base/territory-grid-view/territory-grid-view.vue'),
},
{ {
path: 'accounts/:account?/contacts/:contact?/opportunities/:opportunity?/info_abstract/:info_abstract?', path: 'accounts/:account?/contacts/:contact?/opportunities/:opportunity?/info_abstract/:info_abstract?',
meta: { meta: {
...@@ -4904,6 +4918,20 @@ const router = new Router({ ...@@ -4904,6 +4918,20 @@ const router = new Router({
}, },
component: () => import('@pages/service/incident-info-incident-view/incident-info-incident-view.vue'), component: () => import('@pages/service/incident-info-incident-view/incident-info-incident-view.vue'),
}, },
{
path: 'territories/:territory?/editview/:editview?',
meta: {
caption: 'entities.territory.views.editview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'territories', parameterName: 'territory' },
{ pathName: 'editview', parameterName: 'editview' },
],
requireAuth: true,
},
component: () => import('@pages/base/territory-edit-view/territory-edit-view.vue'),
},
{ {
path: 'accounts/:account?/usablegridview/:usablegridview?', path: 'accounts/:account?/usablegridview/:usablegridview?',
meta: { meta: {
......
import { Subject } from 'rxjs';
import { EditViewBase } from '@/studio-core';
import TerritoryService from '@/service/territory/territory-service';
import TerritoryAuthService from '@/authservice/territory/territory-auth-service';
import EditViewEngine from '@engine/view/edit-view-engine';
import TerritoryUIService from '@/uiservice/territory/territory-ui-service';
/**
* 区域编辑视图视图基类
*
* @export
* @class TerritoryEditViewBase
* @extends {EditViewBase}
*/
export class TerritoryEditViewBase extends EditViewBase {
/**
* 视图对应应用实体名称
*
* @protected
* @type {string}
* @memberof TerritoryEditViewBase
*/
protected appDeName: string = 'territory';
/**
* 应用实体主键
*
* @protected
* @type {string}
* @memberof TerritoryEditViewBase
*/
protected appDeKey: string = 'territoryid';
/**
* 应用实体主信息
*
* @protected
* @type {string}
* @memberof TerritoryEditViewBase
*/
protected appDeMajor: string = 'territoryname';
/**
* 实体服务对象
*
* @type {TerritoryService}
* @memberof TerritoryEditViewBase
*/
protected appEntityService: TerritoryService = new TerritoryService;
/**
* 实体权限服务对象
*
* @type TerritoryUIService
* @memberof TerritoryEditViewBase
*/
public appUIService: TerritoryUIService = new TerritoryUIService(this.$store);
/**
* 计数器服务对象集合
*
* @protected
* @type {Array<*>}
* @memberof TerritoryEditViewBase
*/
protected counterServiceArray: Array<any> = [];
/**
* 视图模型数据
*
* @protected
* @type {*}
* @memberof TerritoryEditViewBase
*/
protected model: any = {
srfCaption: 'entities.territory.views.editview.caption',
srfTitle: 'entities.territory.views.editview.title',
srfSubTitle: 'entities.territory.views.editview.subtitle',
dataInfo: ''
}
/**
* 容器模型
*
* @protected
* @type {*}
* @memberof TerritoryEditViewBase
*/
protected containerModel: any = {
view_toolbar: { name: 'toolbar', type: 'TOOLBAR' },
view_form: { name: 'form', type: 'FORM' },
};
/**
* 工具栏模型
*
* @type {*}
* @memberof TerritoryEditView
*/
public toolBarModels: any = {
tbitem3: { name: 'tbitem3', caption: '保存', 'isShowCaption': true, 'isShowIcon': true, tooltip: '保存', iconcls: 'fa fa-save', icon: '', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'Save', target: '', class: '' } },
tbitem4: { name: 'tbitem4', caption: '保存并新建', 'isShowCaption': true, 'isShowIcon': true, tooltip: '保存并新建', iconcls: 'sx-tb-saveandnew', icon: '../sasrfex/images/default/icon_saveandnew.png', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'SaveAndNew', target: '', class: '' } },
tbitem5: { name: 'tbitem5', caption: '保存并关闭', 'isShowCaption': true, 'isShowIcon': true, tooltip: '保存并关闭', iconcls: 'fa fa-power-off', icon: '', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'SaveAndExit', target: '', class: '' } },
tbitem6: { name: 'tbitem6', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem7: { name: 'tbitem7', caption: '删除并关闭', 'isShowCaption': true, 'isShowIcon': true, tooltip: '删除并关闭', iconcls: 'fa fa-remove', icon: '', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'RemoveAndExit', target: 'SINGLEKEY', class: '' } },
tbitem8: { name: 'tbitem8', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem12: { name: 'tbitem12', caption: '新建', 'isShowCaption': true, 'isShowIcon': true, tooltip: '新建', iconcls: 'fa fa-file-text-o', icon: '', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'New', target: '', class: '' } },
tbitem13: { name: 'tbitem13', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem14: { name: 'tbitem14', caption: '拷贝', 'isShowCaption': true, 'isShowIcon': true, tooltip: '拷贝', iconcls: 'fa fa-copy', icon: '', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'Copy', target: 'SINGLEKEY', class: '' } },
};
/**
* 视图唯一标识
*
* @protected
* @type {string}
* @memberof ViewBase
*/
protected viewtag: string = '3415a4be4d65d2bdf6069eecfa2effaa';
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof TerritoryEditViewBase
*/
public engine: EditViewEngine = new EditViewEngine();
/**
* 引擎初始化
*
* @public
* @memberof TerritoryEditViewBase
*/
public engineInit(): void {
this.engine.init({
view: this,
form: this.$refs.form,
p2k: '0',
keyPSDEField: 'territory',
majorPSDEField: 'territoryname',
isLoadDefault: true,
});
}
/**
* toolbar 部件 click 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof TerritoryEditViewBase
*/
public toolbar_click($event: any, $event2?: any): void {
if (Object.is($event.tag, 'tbitem3')) {
this.toolbar_tbitem3_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem4')) {
this.toolbar_tbitem4_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem5')) {
this.toolbar_tbitem5_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem7')) {
this.toolbar_tbitem7_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem9')) {
this.toolbar_tbitem9_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem10')) {
this.toolbar_tbitem10_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem12')) {
this.toolbar_tbitem12_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem14')) {
this.toolbar_tbitem14_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem15')) {
this.toolbar_tbitem15_click(null, '', $event2);
}
}
/**
* form 部件 save 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof TerritoryEditViewBase
*/
public form_save($event: any, $event2?: any): void {
this.engine.onCtrlEvent('form', 'save', $event);
}
/**
* form 部件 remove 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof TerritoryEditViewBase
*/
public form_remove($event: any, $event2?: any): void {
this.engine.onCtrlEvent('form', 'remove', $event);
}
/**
* form 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof TerritoryEditViewBase
*/
public form_load($event: any, $event2?: any): void {
this.engine.onCtrlEvent('form', 'load', $event);
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem3_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.Save(datas, contextJO,paramJO, $event, xData,this,"Territory");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem4_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.SaveAndNew(datas, contextJO,paramJO, $event, xData,this,"Territory");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem5_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.SaveAndExit(datas, contextJO,paramJO, $event, xData,this,"Territory");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem7_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.RemoveAndExit(datas, contextJO,paramJO, $event, xData,this,"Territory");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem9_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.SaveAndStart(datas, contextJO,paramJO, $event, xData,this,"Territory");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem10_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.ViewWFStep(datas, contextJO,paramJO, $event, xData,this,"Territory");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem12_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.New(datas, contextJO,paramJO, $event, xData,this,"Territory");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem14_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.Copy(datas, contextJO,paramJO, $event, xData,this,"Territory");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem15_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.Print(datas, contextJO,paramJO, $event, xData,this,"Territory");
}
/**
* 保存
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof TerritoryEditViewBase
*/
public Save(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
// 界面行为容器对象 _this
const _this: any = this;
if (xData && xData.save instanceof Function) {
xData.save().then((response: any) => {
if (!response || response.status !== 200) {
return;
}
_this.$emit('viewdataschange', [{ ...response.data }]);
});
} else if (_this.save && _this.save instanceof Function) {
_this.save();
}
}
/**
* 保存并新建
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof TerritoryEditViewBase
*/
public SaveAndNew(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (!xData || !(xData.saveAndNew instanceof Function)) {
return;
}
xData.saveAndNew().then((response: any) => {
if (!response || response.status !== 200) {
_this.$emit('viewdataschange', JSON.stringify({status:'error',action:'saveAndNew'}));
return;
}
_this.$emit('viewdataschange', JSON.stringify({status:'success',action:'saveAndNew',data:response.data}));
if (xData.autoLoad instanceof Function) {
xData.autoLoad();
}
});
}
/**
* 保存并关闭
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof TerritoryEditViewBase
*/
public SaveAndExit(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (xData && xData.saveAndExit instanceof Function) {
xData.saveAndExit().then((response: any) => {
if (!response || response.status !== 200) {
return;
}
if(window.parent){
window.parent.postMessage([{ ...response.data }],'*');
}
});
} else if (_this.saveAndExit && _this.saveAndExit instanceof Function) {
_this.saveAndExit().then((response: any) => {
if (!response || response.status !== 200) {
return;
}
if(window.parent){
window.parent.postMessage([{ ...response.data }],'*');
}
});
}
}
/**
* 删除并关闭
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof TerritoryEditViewBase
*/
public RemoveAndExit(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (xData && xData.removeAndExit instanceof Function) {
xData.removeAndExit().then((response: any) => {
if (!response || response.status !== 200) {
return;
}
if(window.parent){
window.parent.postMessage([{ ...response.data }],'*');
}
});
} else if (_this.removeAndExit && _this.removeAndExit instanceof Function) {
_this.removeAndExit().then((response: any) => {
if (!response || response.status !== 200) {
return;
}
if(window.parent){
window.parent.postMessage([{ ...response.data }],'*');
}
});
}
}
/**
* 开始流程
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof TerritoryEditViewBase
*/
public SaveAndStart(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (!xData || !(xData.wfstart instanceof Function)) {
return;
}
xData.wfstart(args).then((response: any) => {
if (!response || response.status !== 200) {
return;
}
const { data: _data } = response;
if(window.parent){
window.parent.postMessage({ ..._data },'*');
}
if (_this.viewdata) {
_this.$emit('viewdataschange', [{ ..._data }]);
_this.$emit('close');
}else if (this.$tabPageExp) {
this.$tabPageExp.onClose(this.$route.fullPath);
}
});
}
/**
* 当前流程步骤
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof TerritoryEditViewBase
*/
public ViewWFStep(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
let _this:any = this;
if (!xData || !(xData.wfsubmit instanceof Function)) {
return;
}
xData.wfsubmit(args).then((response: any) => {
if (!response || response.status !== 200) {
return;
}
const { data: _data } = response;
if (_this.viewdata) {
_this.$emit('viewdataschange', [{ ..._data }]);
_this.$emit('close');
} else if (_this.$tabPageExp) {
_this.$tabPageExp.onClose(_this.$route.fullPath);
}
});
}
/**
* 新建
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof TerritoryEditViewBase
*/
public New(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (_this.newdata && _this.newdata instanceof Function) {
const data: any = {};
_this.newdata([{ ...data }],[{ ...data }], params, $event, xData);
} else {
_this.$Notice.error({ title: '错误', desc: 'newdata 视图处理逻辑不存在,请添加!' });
}
}
/**
* 拷贝
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof TerritoryEditViewBase
*/
public Copy(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
if (args.length === 0) {
return;
}
const _this: any = this;
if (_this.newdata && _this.newdata instanceof Function) {
const data: any = {};
if (args.length > 0) {
Object.assign(data, { srfsourcekey: args[0].srfkey })
actionContext.$store.commit('addCopyData', { srfkey: args[0].srfkey, copyData: args[0] });
}
_this.newdata([{ ...data }],[{ ...data }],params, $event, xData);
} else if (xData && xData.copy instanceof Function) {
if (args.length > 0) {
actionContext.$store.commit('addCopyData', { srfkey: args[0].srfkey, copyData: args[0] });
}
xData.copy(args[0].srfkey);
} else {
_this.$Notice.error({ title: '错误', desc: 'opendata 视图处理逻辑不存在,请添加!' });
}
}
/**
* 打印
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof TerritoryEditViewBase
*/
public Print(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
let _this:any = this;
if (!xData || !(xData.print instanceof Function) || !$event) {
return ;
}
xData.print();
}
}
\ No newline at end of file
<studio-view-style2 viewName="territoryeditview" viewTitle="区域编辑视图" class='deeditview territory-edit-view'>
<template slot='title'>
<span class='caption-info'>{{$t(model.srfTitle)}}</span>
</template>
<template slot="toolbar">
<view-toolbar mode="STYLE2" :model="toolBarModels" @item-click="toolbar_click($event)"/> </template>
<view_form
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:autosave="false"
:viewtag="viewtag"
:showBusyIndicator="true"
updateAction="Update"
removeAction="Remove"
loaddraftAction="GetDraft"
loadAction="Get"
createAction="Create"
WFSubmitAction=""
WFStartAction=""
style=''
name="form"
ref='form'
@save="form_save($event)"
@remove="form_remove($event)"
@load="form_load($event)"
@closeview="closeView($event)">
</view_form>
</studio-view-style2>
\ No newline at end of file
<template src="./territory-edit-view.html"/>
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { TerritoryEditViewBase } from './territory-edit-view-base';
import view_form from '@widgets/territory/main-form/main-form.vue';
/**
* 区域编辑视图视图
*
* @export
* @class TerritoryEditView
* @extends {TerritoryEditViewBase}
*/
@Component({
components: {
view_form,
}
})
@VueLifeCycleProcessing()
export default class TerritoryEditView extends TerritoryEditViewBase { }
</script>
import { Subject } from 'rxjs';
import { GridViewBase } from '@/studio-core';
import TerritoryService from '@/service/territory/territory-service';
import TerritoryAuthService from '@/authservice/territory/territory-auth-service';
import GridViewEngine from '@engine/view/grid-view-engine';
import TerritoryUIService from '@/uiservice/territory/territory-ui-service';
import CodeListService from "@service/app/codelist-service";
/**
* 区域表格视图视图基类
*
* @export
* @class TerritoryGridViewBase
* @extends {GridViewBase}
*/
export class TerritoryGridViewBase extends GridViewBase {
/**
* 视图对应应用实体名称
*
* @protected
* @type {string}
* @memberof TerritoryGridViewBase
*/
protected appDeName: string = 'territory';
/**
* 应用实体主键
*
* @protected
* @type {string}
* @memberof TerritoryGridViewBase
*/
protected appDeKey: string = 'territoryid';
/**
* 应用实体主信息
*
* @protected
* @type {string}
* @memberof TerritoryGridViewBase
*/
protected appDeMajor: string = 'territoryname';
/**
* 实体服务对象
*
* @type {TerritoryService}
* @memberof TerritoryGridViewBase
*/
protected appEntityService: TerritoryService = new TerritoryService;
/**
* 实体权限服务对象
*
* @type TerritoryUIService
* @memberof TerritoryGridViewBase
*/
public appUIService: TerritoryUIService = new TerritoryUIService(this.$store);
/**
* 计数器服务对象集合
*
* @protected
* @type {Array<*>}
* @memberof TerritoryGridViewBase
*/
protected counterServiceArray: Array<any> = [];
/**
* 视图模型数据
*
* @protected
* @type {*}
* @memberof TerritoryGridViewBase
*/
protected model: any = {
srfCaption: 'entities.territory.views.gridview.caption',
srfTitle: 'entities.territory.views.gridview.title',
srfSubTitle: 'entities.territory.views.gridview.subtitle',
dataInfo: ''
}
/**
* 容器模型
*
* @protected
* @type {*}
* @memberof TerritoryGridViewBase
*/
protected containerModel: any = {
view_toolbar: { name: 'toolbar', type: 'TOOLBAR' },
view_grid: { name: 'grid', type: 'GRID' },
view_searchform: { name: 'searchform', type: 'SEARCHFORM' },
};
/**
* 工具栏模型
*
* @type {*}
* @memberof TerritoryGridView
*/
public toolBarModels: any = {
tbitem3: { name: 'tbitem3', caption: '新建', 'isShowCaption': true, 'isShowIcon': true, tooltip: '新建', iconcls: 'fa fa-file-text-o', icon: '', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'New', target: '', class: '' } },
tbitem4: { name: 'tbitem4', caption: '编辑', 'isShowCaption': true, 'isShowIcon': true, tooltip: '编辑', iconcls: 'fa fa-edit', icon: '', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'Edit', target: 'SINGLEKEY', class: '' } },
tbitem6: { name: 'tbitem6', caption: '拷贝', 'isShowCaption': true, 'isShowIcon': true, tooltip: '拷贝', iconcls: 'fa fa-copy', icon: '', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'Copy', target: 'SINGLEKEY', class: '' } },
tbitem7: { name: 'tbitem7', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem8: { name: 'tbitem8', caption: '删除', 'isShowCaption': true, 'isShowIcon': true, tooltip: '删除', iconcls: 'fa fa-remove', icon: '', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'Remove', target: 'MULTIKEY', class: '' } },
tbitem9: { name: 'tbitem9', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem13: { name: 'tbitem13', caption: '导出', 'isShowCaption': true, 'isShowIcon': true, tooltip: '导出', iconcls: 'fa fa-file-excel-o', icon: '', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'ExportExcel', target: '' }, MaxRowCount: 1000, class: '' },
tbitem10: { name: 'tbitem10', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem19: { name: 'tbitem19', caption: '过滤', 'isShowCaption': true, 'isShowIcon': true, tooltip: '过滤', iconcls: 'fa fa-filter', icon: '', disabled: false, type: 'DEUIACTION', visabled: true,noprivdisplaymode:2,dataaccaction: '', uiaction: { tag: 'ToggleFilter', target: '', class: '' } },
};
/**
* 视图唯一标识
*
* @protected
* @type {string}
* @memberof ViewBase
*/
protected viewtag: string = '224e212f2d5e9c0a6a07b3c650f9b30c';
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof TerritoryGridViewBase
*/
public engine: GridViewEngine = new GridViewEngine();
/**
* 引擎初始化
*
* @public
* @memberof TerritoryGridViewBase
*/
public engineInit(): void {
this.engine.init({
view: this,
opendata: (args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any) => {
this.opendata(args,fullargs, params, $event, xData);
},
newdata: (args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any) => {
this.newdata(args,fullargs, params, $event, xData);
},
grid: this.$refs.grid,
searchform: this.$refs.searchform,
keyPSDEField: 'territory',
majorPSDEField: 'territoryname',
isLoadDefault: true,
});
}
/**
* toolbar 部件 click 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof TerritoryGridViewBase
*/
public toolbar_click($event: any, $event2?: any): void {
if (Object.is($event.tag, 'tbitem3')) {
this.toolbar_tbitem3_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem4')) {
this.toolbar_tbitem4_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem6')) {
this.toolbar_tbitem6_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem24')) {
this.toolbar_tbitem24_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem25')) {
this.toolbar_tbitem25_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem8')) {
this.toolbar_tbitem8_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem13')) {
this.toolbar_tbitem13_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem11')) {
this.toolbar_tbitem11_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem19')) {
this.toolbar_tbitem19_click(null, '', $event2);
}
}
/**
* grid 部件 selectionchange 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof TerritoryGridViewBase
*/
public grid_selectionchange($event: any, $event2?: any): void {
this.engine.onCtrlEvent('grid', 'selectionchange', $event);
}
/**
* grid 部件 beforeload 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof TerritoryGridViewBase
*/
public grid_beforeload($event: any, $event2?: any): void {
this.engine.onCtrlEvent('grid', 'beforeload', $event);
}
/**
* grid 部件 rowdblclick 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof TerritoryGridViewBase
*/
public grid_rowdblclick($event: any, $event2?: any): void {
this.engine.onCtrlEvent('grid', 'rowdblclick', $event);
}
/**
* grid 部件 remove 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof TerritoryGridViewBase
*/
public grid_remove($event: any, $event2?: any): void {
this.engine.onCtrlEvent('grid', 'remove', $event);
}
/**
* grid 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof TerritoryGridViewBase
*/
public grid_load($event: any, $event2?: any): void {
this.engine.onCtrlEvent('grid', 'load', $event);
}
/**
* searchform 部件 save 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof TerritoryGridViewBase
*/
public searchform_save($event: any, $event2?: any): void {
this.engine.onCtrlEvent('searchform', 'save', $event);
}
/**
* searchform 部件 search 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof TerritoryGridViewBase
*/
public searchform_search($event: any, $event2?: any): void {
this.engine.onCtrlEvent('searchform', 'search', $event);
}
/**
* searchform 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof TerritoryGridViewBase
*/
public searchform_load($event: any, $event2?: any): void {
this.engine.onCtrlEvent('searchform', 'load', $event);
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem3_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.New(datas, contextJO,paramJO, $event, xData,this,"Territory");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem4_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.Edit(datas, contextJO,paramJO, $event, xData,this,"Territory");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem6_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.Copy(datas, contextJO,paramJO, $event, xData,this,"Territory");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem24_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.ToggleRowEdit(datas, contextJO,paramJO, $event, xData,this,"Territory");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem25_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.NewRow(datas, contextJO,paramJO, $event, xData,this,"Territory");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem8_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.Remove(datas, contextJO,paramJO, $event, xData,this,"Territory");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem13_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.ExportExcel(datas, contextJO,paramJO, $event, xData,this,"Territory");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem11_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.Print(datas, contextJO,paramJO, $event, xData,this,"Territory");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem19_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.ToggleFilter(datas, contextJO,paramJO, $event, xData,this,"Territory");
}
/**
* 打开新建数据视图
*
* @param {any[]} args
* @param {*} [params]
* @param {*} [fullargs]
* @param {*} [$event]
* @param {*} [xData]
* @memberof TerritoryGridView
*/
public newdata(args: any[],fullargs?:any[], params?: any, $event?: any, xData?: any) {
let localContext:any = null;
let localViewParam:any =null;
const data: any = {};
if(args[0].srfsourcekey){
data.srfsourcekey = args[0].srfsourcekey;
}
let tempContext = JSON.parse(JSON.stringify(this.context));
delete tempContext.territory;
if(args.length >0){
Object.assign(tempContext,args[0]);
}
const deResParameters: any[] = [];
const parameters: any[] = [
{ pathName: 'territories', parameterName: 'territory' },
{ pathName: 'editview', parameterName: 'editview' },
];
const _this: any = this;
const openIndexViewTab = (data: any) => {
const _data: any = { w: (new Date().getTime()) };
Object.assign(_data, data);
const routePath = this.$viewTool.buildUpRoutePath(this.$route, tempContext, deResParameters, parameters, args, _data);
this.$router.push(routePath);
}
openIndexViewTab(data);
}
/**
* 打开编辑数据视图
*
* @param {any[]} args
* @param {*} [params]
* @param {*} [fullargs]
* @param {*} [$event]
* @param {*} [xData]
* @memberof TerritoryGridView
*/
public opendata(args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any) {
const localContext: any = null;
const localViewParam: any =null;
const data: any = {};
let tempContext = JSON.parse(JSON.stringify(this.context));
if(args.length >0){
Object.assign(tempContext,args[0]);
}
const deResParameters: any[] = [];
const parameters: any[] = [
{ pathName: 'territories', parameterName: 'territory' },
{ pathName: 'editview', parameterName: 'editview' },
];
const _this: any = this;
const openIndexViewTab = (data: any) => {
const routePath = this.$viewTool.buildUpRoutePath(this.$route, tempContext, deResParameters, parameters, args, data);
this.$router.push(routePath);
}
openIndexViewTab(data);
}
/**
* 新建
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof TerritoryGridViewBase
*/
public New(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (_this.newdata && _this.newdata instanceof Function) {
const data: any = {};
_this.newdata([{ ...data }],[{ ...data }], params, $event, xData);
} else {
_this.$Notice.error({ title: '错误', desc: 'newdata 视图处理逻辑不存在,请添加!' });
}
}
/**
* 编辑
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof TerritoryGridViewBase
*/
public Edit(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
if (args.length === 0) {
return;
}
const _this: any = this;
if (_this.opendata && _this.opendata instanceof Function) {
const data: any = { };
if (args.length > 0) {
Object.assign(data, { territory: args[0].territory })
}
_this.opendata([{ ...data }], params, $event, xData);
} else {
_this.$Notice.error({ title: '错误', desc: 'opendata 视图处理逻辑不存在,请添加!' });
}
}
/**
* 拷贝
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof TerritoryGridViewBase
*/
public Copy(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
if (args.length === 0) {
return;
}
const _this: any = this;
if (_this.newdata && _this.newdata instanceof Function) {
const data: any = {};
if (args.length > 0) {
Object.assign(data, { srfsourcekey: args[0].srfkey })
actionContext.$store.commit('addCopyData', { srfkey: args[0].srfkey, copyData: args[0] });
}
_this.newdata([{ ...data }],[{ ...data }],params, $event, xData);
} else if (xData && xData.copy instanceof Function) {
if (args.length > 0) {
actionContext.$store.commit('addCopyData', { srfkey: args[0].srfkey, copyData: args[0] });
}
xData.copy(args[0].srfkey);
} else {
_this.$Notice.error({ title: '错误', desc: 'opendata 视图处理逻辑不存在,请添加!' });
}
}
/**
* 行编辑
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof TerritoryGridViewBase
*/
public ToggleRowEdit(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
xData.actualIsOpenEdit = !xData.actualIsOpenEdit;
}
/**
* 新建行
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof TerritoryGridViewBase
*/
public NewRow(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
const data: any = {};
if (_this.newRow && _this.newRow instanceof Function) {
_this.newRow([{ ...data }], params, $event, xData);
} else if(xData.newRow && xData.newRow instanceof Function) {
xData.newRow([{ ...data }], params, $event, xData);
}else{
_this.$Notice.error({ title: '错误', desc: 'newRow 视图处理逻辑不存在,请添加!' });
}
}
/**
* 删除
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof TerritoryGridViewBase
*/
public Remove(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (!xData || !(xData.remove instanceof Function)) {
return ;
}
xData.remove(args);
}
/**
* 导出
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof TerritoryGridViewBase
*/
public ExportExcel(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (!xData || !(xData.exportExcel instanceof Function) || !$event) {
return ;
}
xData.exportExcel($event.exportparms);
}
/**
* 打印
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof TerritoryGridViewBase
*/
public Print(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
let _this:any = this;
if (!xData || !(xData.print instanceof Function) || !$event) {
return ;
}
xData.print();
}
/**
* 过滤
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof TerritoryGridViewBase
*/
public ToggleFilter(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (_this.hasOwnProperty('isExpandSearchForm')) {
_this.isExpandSearchForm = !_this.isExpandSearchForm;
}
}
}
\ No newline at end of file
<studio-view-style2 viewName="territorygridview" viewTitle="区域表格视图" class='degridview territory-grid-view'>
<template slot='title'>
<span class='caption-info'>{{$t(model.srfTitle)}}</span>
</template>
<i-input slot="quickSearch" v-show="!isExpandSearchForm" v-model="query" search @on-search="onSearch($event)"/>
<template slot="toolbar">
<view-toolbar mode="STYLE2" :model="toolBarModels" @item-click="toolbar_click($event)"/> </template>
<template slot="searchForm">
<view_searchform
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:showBusyIndicator="true"
v-show="isExpandSearchForm"
loaddraftAction="FilterGetDraft"
loadAction="FilterGet"
name="searchform"
ref='searchform'
@save="searchform_save($event)"
@search="searchform_search($event)"
@load="searchform_load($event)"
@closeview="closeView($event)">
</view_searchform>
</template>
<view_grid
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isGridSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
@save="onSave.apply(_self, arguments)"
updateAction=""
removeAction="Remove"
loaddraftAction=""
loadAction=""
createAction=""
fetchAction="FetchDefault"
:newdata="newdata.bind(_self)"
:opendata="opendata.bind(_self)"
name="grid"
ref='grid'
@selectionchange="grid_selectionchange($event)"
@beforeload="grid_beforeload($event)"
@rowdblclick="grid_rowdblclick($event)"
@remove="grid_remove($event)"
@load="grid_load($event)"
@closeview="closeView($event)">
</view_grid>
</studio-view-style2>
\ No newline at end of file
<template src="./territory-grid-view.html"/>
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { TerritoryGridViewBase } from './territory-grid-view-base';
import view_grid from '@widgets/territory/main-grid/main-grid.vue';
import view_searchform from '@widgets/territory/default-searchform/default-searchform.vue';
/**
* 区域表格视图视图
*
* @export
* @class TerritoryGridView
* @extends {TerritoryGridViewBase}
*/
@Component({
components: {
view_grid,
view_searchform,
}
})
@VueLifeCycleProcessing()
export default class TerritoryGridView extends TerritoryGridViewBase { }
</script>
...@@ -63,6 +63,7 @@ export class EntityServiceRegister { ...@@ -63,6 +63,7 @@ export class EntityServiceRegister {
this.allEntityService.set('connection', () => import('@/service/connection/connection-service')); this.allEntityService.set('connection', () => import('@/service/connection/connection-service'));
this.allEntityService.set('leadcompetitor', () => import('@/service/lead-competitor/lead-competitor-service')); this.allEntityService.set('leadcompetitor', () => import('@/service/lead-competitor/lead-competitor-service'));
this.allEntityService.set('campaignresponse', () => import('@/service/campaign-response/campaign-response-service')); this.allEntityService.set('campaignresponse', () => import('@/service/campaign-response/campaign-response-service'));
this.allEntityService.set('territory', () => import('@/service/territory/territory-service'));
this.allEntityService.set('phonecall', () => import('@/service/phone-call/phone-call-service')); this.allEntityService.set('phonecall', () => import('@/service/phone-call/phone-call-service'));
this.allEntityService.set('salesorderdetail', () => import('@/service/sales-order-detail/sales-order-detail-service')); this.allEntityService.set('salesorderdetail', () => import('@/service/sales-order-detail/sales-order-detail-service'));
this.allEntityService.set('connectionrole', () => import('@/service/connection-role/connection-role-service')); this.allEntityService.set('connectionrole', () => import('@/service/connection-role/connection-role-service'));
......
import { Http,Util } from '@/utils';
import EntityService from '../entity-service';
/**
* 区域服务对象基类
*
* @export
* @class TerritoryServiceBase
* @extends {EntityServie}
*/
export default class TerritoryServiceBase extends EntityService {
/**
* Creates an instance of TerritoryServiceBase.
*
* @param {*} [opts={}]
* @memberof TerritoryServiceBase
*/
constructor(opts: any = {}) {
super(opts);
}
/**
* 初始化基础数据
*
* @memberof TerritoryServiceBase
*/
public initBasicData(){
this.APPLYDEKEY ='territory';
this.APPDEKEY = 'territoryid';
this.APPDENAME = 'territories';
this.APPDETEXT = 'territoryname';
this.APPNAME = 'crm';
this.SYSTEMNAME = 'ibizbusinesscentral';
}
// 实体接口
/**
* Select接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof TerritoryServiceBase
*/
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().get(`/territories/${context.territory}/select`,isloading);
}
/**
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof TerritoryServiceBase
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/territories`,data,isloading);
return res;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof TerritoryServiceBase
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/territories/${context.territory}`,data,isloading);
return res;
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof TerritoryServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().delete(`/territories/${context.territory}`,isloading);
}
/**
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof TerritoryServiceBase
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/territories/${context.territory}`,isloading);
return res;
}
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof TerritoryServiceBase
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/territories/getdraft`,isloading);
res.data.territory = data.territory;
return res;
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof TerritoryServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().post(`/territories/${context.territory}/checkkey`,data,isloading);
}
/**
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof TerritoryServiceBase
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/territories/${context.territory}/save`,data,isloading);
return res;
}
/**
* FetchDefault接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof TerritoryServiceBase
*/
public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/territories/fetchdefault`,tempData,isloading);
}
}
\ No newline at end of file
import { Http,Util } from '@/utils';
import TerritoryServiceBase from './territory-service-base';
/**
* 区域服务对象
*
* @export
* @class TerritoryService
* @extends {TerritoryServiceBase}
*/
export default class TerritoryService extends TerritoryServiceBase {
/**
* Creates an instance of TerritoryService.
*
* @param {*} [opts={}]
* @memberof TerritoryService
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
...@@ -410,6 +410,16 @@ export const viewstate: any = { ...@@ -410,6 +410,16 @@ export const viewstate: any = {
'e9c822edbc51531e713b561101e783a6', 'e9c822edbc51531e713b561101e783a6',
], ],
}, },
{
viewtag: '224e212f2d5e9c0a6a07b3c650f9b30c',
viewmodule: 'Base',
viewname: 'TerritoryGridView',
viewaction: '',
viewdatachange: false,
refviews: [
'3415a4be4d65d2bdf6069eecfa2effaa',
],
},
{ {
viewtag: '236d90aa8adf8a3e08dae1a9fa5112a9', viewtag: '236d90aa8adf8a3e08dae1a9fa5112a9',
viewmodule: 'Marketing', viewmodule: 'Marketing',
...@@ -680,6 +690,16 @@ export const viewstate: any = { ...@@ -680,6 +690,16 @@ export const viewstate: any = {
'ba34ee36c1d0de288403607e17e7eb3e', 'ba34ee36c1d0de288403607e17e7eb3e',
], ],
}, },
{
viewtag: '3415a4be4d65d2bdf6069eecfa2effaa',
viewmodule: 'Base',
viewname: 'TerritoryEditView',
viewaction: '',
viewdatachange: false,
refviews: [
'da3f8c1f20f440f3df54d6c13a8de586',
],
},
{ {
viewtag: '35728a12ceecb647982051842853547c', viewtag: '35728a12ceecb647982051842853547c',
viewmodule: 'Sales', viewmodule: 'Sales',
...@@ -1612,6 +1632,7 @@ export const viewstate: any = { ...@@ -1612,6 +1632,7 @@ export const viewstate: any = {
'02131b45343ed8c70e500cd8ac520361', '02131b45343ed8c70e500cd8ac520361',
'90b48a107932f432e0dde42791a51887', '90b48a107932f432e0dde42791a51887',
'c67b638daa17df2f9ecf99fc1c396e2f', 'c67b638daa17df2f9ecf99fc1c396e2f',
'224e212f2d5e9c0a6a07b3c650f9b30c',
'9af073dea1ea05903d52e8bdc5a03dd5', '9af073dea1ea05903d52e8bdc5a03dd5',
'45fdc8ee4d1401d2d625e80177395ddc', '45fdc8ee4d1401d2d625e80177395ddc',
'9AE386A9-53DE-4F99-BCCA-747AEFE666A4', '9AE386A9-53DE-4F99-BCCA-747AEFE666A4',
......
import { Environment } from '@/environments/environment';
import { UIActionTool,Util } from '@/utils';
import UIService from '../ui-service';
import { Subject } from 'rxjs';
import TerritoryService from '@/service/territory/territory-service';
import TerritoryAuthService from '@/authservice/territory/territory-auth-service';
/**
* 区域UI服务对象基类
*
* @export
* @class TerritoryUIServiceBase
*/
export default class TerritoryUIServiceBase extends UIService {
/**
* 是否支持工作流
*
* @memberof TerritoryUIServiceBase
*/
public isEnableWorkflow:boolean = false;
/**
* 当前UI服务对应的数据服务对象
*
* @memberof TerritoryUIServiceBase
*/
public dataService:TerritoryService = new TerritoryService();
/**
* 所有关联视图
*
* @memberof TerritoryUIServiceBase
*/
public allViewMap: Map<string, Object> = new Map();
/**
* 状态值
*
* @memberof TerritoryUIServiceBase
*/
public stateValue: number = 0;
/**
* 状态属性
*
* @memberof TerritoryUIServiceBase
*/
public stateField: string = "";
/**
* 主状态属性集合
*
* @memberof TerritoryUIServiceBase
*/
public mainStateFields:Array<any> = [];
/**
* 主状态集合Map
*
* @memberof TerritoryUIServiceBase
*/
public allDeMainStateMap:Map<string,string> = new Map();
/**
* 主状态操作标识Map
*
* @memberof TerritoryUIServiceBase
*/
public allDeMainStateOPPrivsMap:Map<string,any> = new Map();
/**
* Creates an instance of TerritoryUIServiceBase.
*
* @param {*} [opts={}]
* @memberof TerritoryUIServiceBase
*/
constructor(opts: any = {}) {
super(opts);
this.authService = new TerritoryAuthService(opts);
this.initViewMap();
this.initDeMainStateMap();
this.initDeMainStateOPPrivsMap();
}
/**
* 初始化视图Map
*
* @memberof TerritoryUIServiceBase
*/
public initViewMap(){
this.allViewMap.set('MDATAVIEW:',{viewname:'gridview',srfappde:'territories'});
this.allViewMap.set('EDITVIEW:',{viewname:'editview',srfappde:'territories'});
}
/**
* 初始化主状态集合
*
* @memberof TerritoryUIServiceBase
*/
public initDeMainStateMap(){
}
/**
* 初始化主状态操作标识
*
* @memberof TerritoryUIServiceBase
*/
public initDeMainStateOPPrivsMap(){
}
/**
* 获取指定数据的重定向页面
*
* @param srfkey 数据主键
* @param isEnableWorkflow 重定向视图是否需要处理流程中的数据
* @memberof TerritoryUIServiceBase
*/
public async getRDAppView(srfkey:string,isEnableWorkflow:boolean){
this.isEnableWorkflow = isEnableWorkflow;
// 进行数据查询
let result:any = await this.dataService.Get({territory:srfkey});
const curData:any = result.data;
//判断当前数据模式,默认为true,todo
const iRealDEModel:boolean = true;
let bDataInWF:boolean = false;
let bWFMode:any = false;
// 计算数据模式
if (this.isEnableWorkflow) {
bDataInWF = await this.dataService.testDataInWF({stateValue:this.stateValue,stateField:this.stateField},curData);
if (bDataInWF) {
bDataInWF = true;
bWFMode = await this.dataService.testUserExistWorklist(null,curData);
}
}
let strPDTViewParam:string = await this.getDESDDEViewPDTParam(curData, bDataInWF, bWFMode);
//若不是当前数据模式,处理strPDTViewParam,todo
//查找视图
//返回视图
return this.allViewMap.get(strPDTViewParam);
}
/**
* 获取实际的数据类型
*
* @memberof TerritoryUIServiceBase
*/
public getRealDEType(entity:any){
}
/**
* 获取实体单数据实体视图预定义参数
*
* @param curData 当前数据
* @param bDataInWF 是否有数据在工作流中
* @param bWFMode 是否工作流模式
* @memberof TerritoryUIServiceBase
*/
public async getDESDDEViewPDTParam(curData:any, bDataInWF:boolean, bWFMode:boolean){
let strPDTParam:string = '';
if (bDataInWF) {
// 判断数据是否在流程中
}
//多表单,todo
const isEnableMultiForm:boolean = false;
const multiFormDEField:string|null =null;
if (isEnableMultiForm && multiFormDEField) {
const objFormValue:string = curData[multiFormDEField];
if(!Environment.isAppMode){
return 'MOBEDITVIEW'+objFormValue;
}
return 'EDITVIEW'+objFormValue;
}
if(!Environment.isAppMode){
if(this.getDEMainStateTag(curData)){
return `MOBEDITVIEW:MSTAG:${ this.getDEMainStateTag(curData)}`;
}
return 'MOBEDITVIEW:';
}
if(this.getDEMainStateTag(curData)){
return `EDITVIEW:MSTAG:${ this.getDEMainStateTag(curData)}`;
}
return 'EDITVIEW:';
}
/**
* 获取数据对象的主状态标识
*
* @param curData 当前数据
* @memberof TerritoryUIServiceBase
*/
public getDEMainStateTag(curData:any){
if(this.mainStateFields.length === 0) return null;
this.mainStateFields.forEach((singleMainField:any) =>{
if(!(singleMainField in curData)){
console.error(`当前数据对象不包含属性singleMainField,可能会发生错误`);
}
})
for (let i = 0; i <= 1; i++) {
let strTag:string = (curData[this.mainStateFields[0]])?(i == 0) ? curData[this.mainStateFields[0]] : "":"";
if (this.mainStateFields.length >= 2) {
for (let j = 0; j <= 1; j++) {
let strTag2:string = (curData[this.mainStateFields[1]])?`${strTag}__${(j == 0) ? curData[this.mainStateFields[1]] : ""}`:strTag;
if (this.mainStateFields.length >= 3) {
for (let k = 0; k <= 1; k++) {
let strTag3:string = (curData[this.mainStateFields[2]])?`${strTag2}__${(k == 0) ? curData[this.mainStateFields[2]] : ""}`:strTag2;
// 判断是否存在
return this.allDeMainStateMap.get(strTag3);
}
}else{
return this.allDeMainStateMap.get(strTag2);
}
}
}else{
return this.allDeMainStateMap.get(strTag);
}
}
return null;
}
/**
* 获取数据对象当前操作标识
*
* @param data 当前数据
* @memberof TerritoryUIServiceBase
*/
public getDEMainStateOPPrivs(data:any){
if(this.getDEMainStateTag(data)){
return this.allDeMainStateOPPrivsMap.get((this.getDEMainStateTag(data) as string));
}else{
return null;
}
}
/**
* 获取数据对象所有的操作标识
*
* @param data 当前数据
* @memberof TerritoryUIServiceBase
*/
public getAllOPPrivs(data:any){
return this.authService.getOPPrivs(this.getDEMainStateOPPrivs(data));
}
}
\ No newline at end of file
import TerritoryUIServiceBase from './territory-ui-service-base';
/**
* 区域UI服务对象
*
* @export
* @class TerritoryUIService
*/
export default class TerritoryUIService extends TerritoryUIServiceBase {
/**
* Creates an instance of TerritoryUIService.
*
* @param {*} [opts={}]
* @memberof TerritoryUIService
*/
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
...@@ -63,6 +63,7 @@ export class UIServiceRegister { ...@@ -63,6 +63,7 @@ export class UIServiceRegister {
this.allUIService.set('connection', () => import('@/uiservice/connection/connection-ui-service')); this.allUIService.set('connection', () => import('@/uiservice/connection/connection-ui-service'));
this.allUIService.set('leadcompetitor', () => import('@/uiservice/lead-competitor/lead-competitor-ui-service')); this.allUIService.set('leadcompetitor', () => import('@/uiservice/lead-competitor/lead-competitor-ui-service'));
this.allUIService.set('campaignresponse', () => import('@/uiservice/campaign-response/campaign-response-ui-service')); this.allUIService.set('campaignresponse', () => import('@/uiservice/campaign-response/campaign-response-ui-service'));
this.allUIService.set('territory', () => import('@/uiservice/territory/territory-ui-service'));
this.allUIService.set('phonecall', () => import('@/uiservice/phone-call/phone-call-ui-service')); this.allUIService.set('phonecall', () => import('@/uiservice/phone-call/phone-call-ui-service'));
this.allUIService.set('salesorderdetail', () => import('@/uiservice/sales-order-detail/sales-order-detail-ui-service')); this.allUIService.set('salesorderdetail', () => import('@/uiservice/sales-order-detail/sales-order-detail-ui-service'));
this.allUIService.set('connectionrole', () => import('@/uiservice/connection-role/connection-role-ui-service')); this.allUIService.set('connectionrole', () => import('@/uiservice/connection-role/connection-role-ui-service'));
......
...@@ -30,32 +30,34 @@ export class CentralBase extends Vue { ...@@ -30,32 +30,34 @@ export class CentralBase extends Vue {
this.clickAuto6(item); break; this.clickAuto6(item); break;
case 'Auto3': case 'Auto3':
this.clickAuto3(item); break; this.clickAuto3(item); break;
case '_6': case '_7':
this.click_6(item); break; this.click_7(item); break;
case 'Auto15': case 'Auto15':
this.clickAuto15(item); break; this.clickAuto15(item); break;
case 'Auto11': case 'Auto11':
this.clickAuto11(item); break; this.clickAuto11(item); break;
case '_5': case '_6':
this.click_5(item); break; this.click_6(item); break;
case 'Auto14': case 'Auto14':
this.clickAuto14(item); break; this.clickAuto14(item); break;
case '_4': case '_5':
this.click_4(item); break; this.click_5(item); break;
case 'Auto10': case 'Auto10':
this.clickAuto10(item); break; this.clickAuto10(item); break;
case 'Auto16': case 'Auto16':
this.clickAuto16(item); break; this.clickAuto16(item); break;
case 'Auto1': case 'Auto1':
this.clickAuto1(item); break; this.clickAuto1(item); break;
case '_7': case '_8':
this.click_7(item); break; this.click_8(item); break;
case '_4':
this.click_4(item); break;
case '_2': case '_2':
this.click_2(item); break; this.click_2(item); break;
case 'Auto7': case 'Auto7':
this.clickAuto7(item); break; this.clickAuto7(item); break;
case '_8': case '_9':
this.click_8(item); break; this.click_9(item); break;
case 'Auto5': case 'Auto5':
this.clickAuto5(item); break; this.clickAuto5(item); break;
default: default:
...@@ -235,7 +237,7 @@ export class CentralBase extends Vue { ...@@ -235,7 +237,7 @@ export class CentralBase extends Vue {
* @param {*} [item={}] * @param {*} [item={}]
* @memberof Central * @memberof Central
*/ */
public click_6(item: any = {}) { public click_7(item: any = {}) {
const viewparam: any = {}; const viewparam: any = {};
Object.assign(viewparam, {}); Object.assign(viewparam, {});
const deResParameters: any[] = []; const deResParameters: any[] = [];
...@@ -304,7 +306,7 @@ export class CentralBase extends Vue { ...@@ -304,7 +306,7 @@ export class CentralBase extends Vue {
* @param {*} [item={}] * @param {*} [item={}]
* @memberof Central * @memberof Central
*/ */
public click_5(item: any = {}) { public click_6(item: any = {}) {
const viewparam: any = {}; const viewparam: any = {};
Object.assign(viewparam, {}); Object.assign(viewparam, {});
const deResParameters: any[] = []; const deResParameters: any[] = [];
...@@ -350,7 +352,7 @@ export class CentralBase extends Vue { ...@@ -350,7 +352,7 @@ export class CentralBase extends Vue {
* @param {*} [item={}] * @param {*} [item={}]
* @memberof Central * @memberof Central
*/ */
public click_4(item: any = {}) { public click_5(item: any = {}) {
const viewparam: any = {}; const viewparam: any = {};
Object.assign(viewparam, {}); Object.assign(viewparam, {});
const deResParameters: any[] = []; const deResParameters: any[] = [];
...@@ -440,7 +442,7 @@ export class CentralBase extends Vue { ...@@ -440,7 +442,7 @@ export class CentralBase extends Vue {
* @param {*} [item={}] * @param {*} [item={}]
* @memberof Central * @memberof Central
*/ */
public click_7(item: any = {}) { public click_8(item: any = {}) {
const viewparam: any = {}; const viewparam: any = {};
Object.assign(viewparam, {}); Object.assign(viewparam, {});
const deResParameters: any[] = []; const deResParameters: any[] = [];
...@@ -457,6 +459,29 @@ export class CentralBase extends Vue { ...@@ -457,6 +459,29 @@ export class CentralBase extends Vue {
}) })
} }
/**
* 区域
*
* @param {*} [item={}]
* @memberof Central
*/
public click_4(item: any = {}) {
const viewparam: any = {};
Object.assign(viewparam, {});
const deResParameters: any[] = [];
const parameters: any[] = [
{ pathName: 'territories', parameterName: 'territory' },
{ pathName: 'gridview', parameterName: 'gridview' },
];
const path: string = this.$viewTool.buildUpRoutePath(this.$route, {}, deResParameters, parameters, [], viewparam);
if(Object.is(this.$route.fullPath,path)){
return;
}
this.$nextTick(function(){
this.$router.push(path);
})
}
/** /**
* 知识文章 * 知识文章
* *
...@@ -509,7 +534,7 @@ export class CentralBase extends Vue { ...@@ -509,7 +534,7 @@ export class CentralBase extends Vue {
* @param {*} [item={}] * @param {*} [item={}]
* @memberof Central * @memberof Central
*/ */
public click_8(item: any = {}) { public click_9(item: any = {}) {
const viewparam: any = {}; const viewparam: any = {};
Object.assign(viewparam, {}); Object.assign(viewparam, {});
const deResParameters: any[] = []; const deResParameters: any[] = [];
......
...@@ -66,29 +66,29 @@ export default class CentralModel { ...@@ -66,29 +66,29 @@ export default class CentralModel {
iconcls: 'fa fa-certificate', iconcls: 'fa fa-certificate',
icon: '', icon: '',
textcls: '', textcls: '',
appfunctag: '_4', appfunctag: '_5',
appfuncyype: 'APPVIEW', appfuncyype: 'APPVIEW',
viewname: 'setting', viewname: 'setting',
resourcetag: '', resourcetag: '',
items: [ items: [
{ {
id: '214745B6-68CB-4548-B138-81E07338033C', id: 'DEFD42F2-BBE6-464F-A669-FF16D127830B',
name: 'menuitem4', name: 'menuitem33',
text: '链接角色', text: '区域',
type: 'MENUITEM', type: 'MENUITEM',
counterid: '', counterid: '',
tooltip: '链接角色', tooltip: '区域',
expanded: false, expanded: false,
separator: false, separator: false,
hidden: false, hidden: false,
hidesidebar: false, hidesidebar: false,
opendefault: false, opendefault: false,
iconcls: 'fa fa-link', iconcls: 'fa fa-medium',
icon: '', icon: '',
textcls: '', textcls: '',
appfunctag: '_5', appfunctag: '_4',
appfuncyype: 'APPVIEW', appfuncyype: 'APPVIEW',
viewname: 'connection-role-grid-view', viewname: 'territory-grid-view',
resourcetag: '', resourcetag: '',
} }
, ,
...@@ -107,11 +107,32 @@ export default class CentralModel { ...@@ -107,11 +107,32 @@ export default class CentralModel {
iconcls: 'fa fa-rmb', iconcls: 'fa fa-rmb',
icon: '', icon: '',
textcls: '', textcls: '',
appfunctag: '_7', appfunctag: '_8',
appfuncyype: 'APPVIEW', appfuncyype: 'APPVIEW',
viewname: 'transaction-currency-grid-view', viewname: 'transaction-currency-grid-view',
resourcetag: '', resourcetag: '',
} }
,
{
id: '214745B6-68CB-4548-B138-81E07338033C',
name: 'menuitem4',
text: '链接角色',
type: 'MENUITEM',
counterid: '',
tooltip: '链接角色',
expanded: false,
separator: false,
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: 'fa fa-link',
icon: '',
textcls: '',
appfunctag: '_6',
appfuncyype: 'APPVIEW',
viewname: 'connection-role-grid-view',
resourcetag: '',
}
, ,
], ],
} }
...@@ -328,7 +349,7 @@ export default class CentralModel { ...@@ -328,7 +349,7 @@ export default class CentralModel {
iconcls: 'fa fa-users', iconcls: 'fa fa-users',
icon: '', icon: '',
textcls: '', textcls: '',
appfunctag: '_8', appfunctag: '_9',
appfuncyype: 'APPVIEW', appfuncyype: 'APPVIEW',
viewname: 'account-status-tab-view', viewname: 'account-status-tab-view',
resourcetag: '', resourcetag: '',
...@@ -685,7 +706,7 @@ export default class CentralModel { ...@@ -685,7 +706,7 @@ export default class CentralModel {
iconcls: 'fa fa-line-chart', iconcls: 'fa fa-line-chart',
icon: '', icon: '',
textcls: '', textcls: '',
appfunctag: '_6', appfunctag: '_7',
appfuncyype: 'APPVIEW', appfuncyype: 'APPVIEW',
viewname: 'metric-grid-view', viewname: 'metric-grid-view',
resourcetag: '', resourcetag: '',
...@@ -931,7 +952,7 @@ export default class CentralModel { ...@@ -931,7 +952,7 @@ export default class CentralModel {
], ],
}, },
{ {
appfunctag: '_6', appfunctag: '_7',
appfuncyype: 'APPVIEW', appfuncyype: 'APPVIEW',
openmode: '', openmode: '',
codename: 'metricgridview', codename: 'metricgridview',
...@@ -967,7 +988,7 @@ export default class CentralModel { ...@@ -967,7 +988,7 @@ export default class CentralModel {
], ],
}, },
{ {
appfunctag: '_5', appfunctag: '_6',
appfuncyype: 'APPVIEW', appfuncyype: 'APPVIEW',
openmode: '', openmode: '',
codename: 'connectionrolegridview', codename: 'connectionrolegridview',
...@@ -991,7 +1012,7 @@ export default class CentralModel { ...@@ -991,7 +1012,7 @@ export default class CentralModel {
], ],
}, },
{ {
appfunctag: '_4', appfunctag: '_5',
appfuncyype: 'APPVIEW', appfuncyype: 'APPVIEW',
openmode: '', openmode: '',
codename: 'setting', codename: 'setting',
...@@ -1037,7 +1058,7 @@ export default class CentralModel { ...@@ -1037,7 +1058,7 @@ export default class CentralModel {
], ],
}, },
{ {
appfunctag: '_7', appfunctag: '_8',
appfuncyype: 'APPVIEW', appfuncyype: 'APPVIEW',
openmode: '', openmode: '',
codename: 'transactioncurrencygridview', codename: 'transactioncurrencygridview',
...@@ -1048,6 +1069,18 @@ export default class CentralModel { ...@@ -1048,6 +1069,18 @@ export default class CentralModel {
{ pathName: 'gridview', parameterName: 'gridview' }, { pathName: 'gridview', parameterName: 'gridview' },
], ],
}, },
{
appfunctag: '_4',
appfuncyype: 'APPVIEW',
openmode: '',
codename: 'territorygridview',
deResParameters: [],
routepath: '/central/:central?/territories/:territory?/gridview/:gridview?',
parameters: [
{ pathName: 'territories', parameterName: 'territory' },
{ pathName: 'gridview', parameterName: 'gridview' },
],
},
{ {
appfunctag: '_2', appfunctag: '_2',
appfuncyype: 'APPVIEW', appfuncyype: 'APPVIEW',
...@@ -1073,7 +1106,7 @@ export default class CentralModel { ...@@ -1073,7 +1106,7 @@ export default class CentralModel {
], ],
}, },
{ {
appfunctag: '_8', appfunctag: '_9',
appfuncyype: 'APPVIEW', appfuncyype: 'APPVIEW',
openmode: '', openmode: '',
codename: 'accountstatustabview', codename: 'accountstatustabview',
......
...@@ -16,8 +16,8 @@ export class SettingBase extends Vue { ...@@ -16,8 +16,8 @@ export class SettingBase extends Vue {
if (item) { if (item) {
let judge = true; let judge = true;
switch (item.appfunctag) { switch (item.appfunctag) {
case '_5': case '_6':
this.click_5(item); break; this.click_6(item); break;
default: default:
judge = false; judge = false;
console.warn('未指定应用功能'); console.warn('未指定应用功能');
...@@ -34,7 +34,7 @@ export class SettingBase extends Vue { ...@@ -34,7 +34,7 @@ export class SettingBase extends Vue {
* @param {*} [item={}] * @param {*} [item={}]
* @memberof Setting * @memberof Setting
*/ */
public click_5(item: any = {}) { public click_6(item: any = {}) {
const viewparam: any = {}; const viewparam: any = {};
Object.assign(viewparam, {}); Object.assign(viewparam, {});
const deResParameters: any[] = []; const deResParameters: any[] = [];
......
...@@ -29,7 +29,7 @@ export default class SettingModel { ...@@ -29,7 +29,7 @@ export default class SettingModel {
iconcls: 'fa fa-connectdevelop', iconcls: 'fa fa-connectdevelop',
icon: '', icon: '',
textcls: '', textcls: '',
appfunctag: '_5', appfunctag: '_6',
appfuncyype: 'APPVIEW', appfuncyype: 'APPVIEW',
viewname: 'connection-role-grid-view', viewname: 'connection-role-grid-view',
resourcetag: '', resourcetag: '',
......
import { Prop, Provide, Emit, Model } from 'vue-property-decorator';
import { Subject, Subscription } from 'rxjs';
import { Watch, SearchFormControlBase } from '@/studio-core';
import TerritoryService from '@/service/territory/territory-service';
import DefaultService from './default-searchform-service';
import TerritoryUIService from '@/uiservice/territory/territory-ui-service';
import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail';
import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
/**
* searchform部件基类
*
* @export
* @class SearchFormControlBase
* @extends {DefaultSearchFormBase}
*/
export class DefaultSearchFormBase extends SearchFormControlBase {
/**
* 获取部件类型
*
* @protected
* @type {string}
* @memberof DefaultSearchFormBase
*/
protected controlType: string = 'SEARCHFORM';
/**
* 建构部件服务对象
*
* @type {DefaultService}
* @memberof DefaultSearchFormBase
*/
public service: DefaultService = new DefaultService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {TerritoryService}
* @memberof DefaultSearchFormBase
*/
public appEntityService: TerritoryService = new TerritoryService({ $store: this.$store });
/**
* 应用实体名称
*
* @protected
* @type {string}
* @memberof DefaultSearchFormBase
*/
protected appDeName: string = 'territory';
/**
* 表单数据对象
*
* @type {*}
* @memberof DefaultSearchFormBase
*/
public data: any = {
};
/**
* 详情模型集合
*
* @type {*}
* @memberof DefaultSearchFormBase
*/
public detailsModel: any = {
formpage1: new FormPageModel({ caption: '常规条件', detailType: 'FORMPAGE', name: 'formpage1', visible: true, isShowCaption: true, form: this })
,
};
}
\ No newline at end of file
/**
* Default 部件模型
*
* @export
* @class DefaultModel
*/
export default class DefaultModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof DefaultModel
*/
public getDataItems(): any[] {
return [
{
name: 'srfwfmemo',
prop: 'srfwfmemo',
dataType: 'TEXT',
},
// 前端新增修改标识,新增为"0",修改为"1"或未设值
{
name: 'srffrontuf',
prop: 'srffrontuf',
dataType: 'TEXT',
},
]
}
}
\ No newline at end of file
import { Http,Util,Errorlog } from '@/utils';
import ControlService from '@/widgets/control-service';
import TerritoryService from '@/service/territory/territory-service';
import DefaultModel from './default-searchform-model';
/**
* Default 部件服务对象
*
* @export
* @class DefaultService
*/
export default class DefaultService extends ControlService {
/**
* 区域服务对象
*
* @type {TerritoryService}
* @memberof DefaultService
*/
public appEntityService: TerritoryService = new TerritoryService({ $store: this.getStore() });
/**
* 设置从数据模式
*
* @type {boolean}
* @memberof DefaultService
*/
public setTempMode(){
this.isTempMode = false;
}
/**
* Creates an instance of DefaultService.
*
* @param {*} [opts={}]
* @memberof DefaultService
*/
constructor(opts: any = {}) {
super(opts);
this.model = new DefaultModel();
}
/**
* 处理数据
*
* @private
* @param {Promise<any>} promise
* @returns {Promise<any>}
* @memberof DefaultService
*/
private doItems(promise: Promise<any>, deKeyField: string, deName: string): Promise<any> {
return new Promise((resolve, reject) => {
promise.then((response: any) => {
if (response && response.status === 200) {
const data = response.data;
data.forEach((item:any,index:number) =>{
item[deName] = item[deKeyField];
data[index] = item;
});
resolve(data);
} else {
reject([])
}
}).catch((response: any) => {
reject([])
});
});
}
/**
* 获取跨实体数据集合
*
* @param {string} serviceName 服务名称
* @param {string} interfaceName 接口名称
* @param {*} data
* @param {boolean} [isloading]
* @returns {Promise<any[]>}
* @memberof DefaultService
*/
@Errorlog
public getItems(serviceName: string, interfaceName: string, context: any = {}, data: any, isloading?: boolean): Promise<any[]> {
return Promise.reject([])
}
/**
* 启动工作流
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @param {*} [localdata]
* @returns {Promise<any>}
* @memberof DefaultService
*/
@Errorlog
public wfstart(action: string,context: any = {},data: any = {}, isloading?: boolean,localdata?:any): Promise<any> {
data = this.handleWFData(data);
context = this.handleRequestData(action,context,data).context;
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](context,data, isloading,localdata);
} else {
result = this.appEntityService.WFStart(context,data, isloading,localdata);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 提交工作流
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @param {*} [localdata]
* @returns {Promise<any>}
* @memberof DefaultService
*/
@Errorlog
public wfsubmit(action: string,context: any = {}, data: any = {}, isloading?: boolean,localdata?:any): Promise<any> {
data = this.handleWFData(data,true);
context = this.handleRequestData(action,context,data,true).context;
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](context,data, isloading,localdata);
} else {
result = this.appEntityService.WFSubmit(context,data, isloading,localdata);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 添加数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof DefaultService
*/
@Errorlog
public add(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.Create(Context,Data, isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 删除数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof DefaultService
*/
@Errorlog
public delete(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.Remove(Context,Data, isloading);
}
result.then((response) => {
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 修改数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof DefaultService
*/
@Errorlog
public update(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.Update(Context,Data, isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 查询数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof DefaultService
*/
@Errorlog
public get(action: string,context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.Get(Context,Data, isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 加载草稿
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof DefaultService
*/
@Errorlog
public loadDraft(action: string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.GetDraft(Context,Data, isloading);
}
result.then((response) => {
this.handleResponse(action, response, true);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 前台逻辑
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof DefaultService
*/
@Errorlog
public frontLogic(action:string,context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
return new Promise((resolve: any, reject: any)=>{
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
return Promise.reject({ status: 500, data: { title: '失败', message: '系统异常' } });
}
result.then((response) => {
this.handleResponse(action, response,true);
resolve(response);
}).catch(response => {
reject(response);
});
})
}
/**
* 处理请求数据
*
* @param action 行为
* @param data 数据
* @memberof DefaultService
*/
public handleRequestData(action: string,context:any, data: any = {},isMerge:boolean = false){
let mode: any = this.getMode();
if (!mode && mode.getDataItems instanceof Function) {
return data;
}
let formItemItems: any[] = mode.getDataItems();
let requestData:any = {};
if(isMerge && (data && data.viewparams)){
Object.assign(requestData,data.viewparams);
}
formItemItems.forEach((item:any) =>{
if(item && item.dataType && Object.is(item.dataType,'FONTKEY')){
if(item && item.prop){
requestData[item.prop] = context[item.name];
}
}else{
if(item && item.prop){
requestData[item.prop] = data[item.name];
}
}
});
let tempContext:any = JSON.parse(JSON.stringify(context));
if(tempContext && tempContext.srfsessionid){
tempContext.srfsessionkey = tempContext.srfsessionid;
delete tempContext.srfsessionid;
}
return {context:tempContext,data:requestData};
}
}
\ No newline at end of file
<i-form :model="this.data" class='app-search-form' ref='searchform' style="">
<input style="display:none;"/>
<div class="search-button">
<i-button size="small" type="primary" ghost @click="onSearch.apply(_self, arguments)">{{$t('app.searchButton.search')}}</i-button>
<i-button size="small" type="default" ghost @click="onReset.apply(_self, arguments)">{{this.$t('app.searchButton.reset')}}</i-button>
</div>
<div class="form-content">
</div>
</i-form>
\ No newline at end of file
<template src="./default-searchform.html"/>
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { DefaultSearchFormBase } from './default-searchform-base';
/**
* searchform部件
*
* @export
* @class DefaultSearchForm
* @extends {DefaultSearchFormBase}
*/
@Component({
components: {
}
})
@VueLifeCycleProcessing()
export default class DefaultSearchForm extends DefaultSearchFormBase { }
</script>
import { Prop, Provide, Emit, Model } from 'vue-property-decorator';
import { Subject, Subscription } from 'rxjs';
import { Watch, EditFormControlBase } from '@/studio-core';
import TerritoryService from '@/service/territory/territory-service';
import MainService from './main-form-service';
import TerritoryUIService from '@/uiservice/territory/territory-ui-service';
import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail';
/**
* form部件基类
*
* @export
* @class EditFormControlBase
* @extends {MainEditFormBase}
*/
export class MainEditFormBase extends EditFormControlBase {
/**
* 获取部件类型
*
* @protected
* @type {string}
* @memberof MainEditFormBase
*/
protected controlType: string = 'FORM';
/**
* 建构部件服务对象
*
* @type {MainService}
* @memberof MainEditFormBase
*/
public service: MainService = new MainService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {TerritoryService}
* @memberof MainEditFormBase
*/
public appEntityService: TerritoryService = new TerritoryService({ $store: this.$store });
/**
* 应用实体名称
*
* @protected
* @type {string}
* @memberof MainEditFormBase
*/
protected appDeName: string = 'territory';
/**
* 界面UI服务对象
*
* @type {TerritoryUIService}
* @memberof MainEditFormBase
*/
public appUIService:TerritoryUIService = new TerritoryUIService(this.$store);
/**
* 表单数据对象
*
* @type {*}
* @memberof MainEditFormBase
*/
public data: any = {
srfupdatedate: null,
srforikey: null,
srfkey: null,
srfmajortext: null,
srftempmode: null,
srfuf: null,
srfdeid: null,
srfsourcekey: null,
territoryname: null,
managername: null,
transactioncurrencyname: null,
exchangerate: null,
transactioncurrencyid: null,
territoryid: null,
territory:null,
};
/**
* 属性值规则
*
* @type {*}
* @memberof MainEditFormBase
*/
public rules: any = {
territoryname: [
{ required: true, type: 'string', message: '地区名称 值不能为空', trigger: 'change' },
{ required: true, type: 'string', message: '地区名称 值不能为空', trigger: 'blur' },
],
}
/**
* 详情模型集合
*
* @type {*}
* @memberof MainEditFormBase
*/
public detailsModel: any = {
group1: new FormGroupPanelModel({ caption: 'territory基本信息', detailType: 'GROUPPANEL', name: 'group1', visible: true, isShowCaption: true, form: this, showMoreMode: 0, uiActionGroup: { caption: '', langbase: 'entities.territory.main_form', extractMode: 'ITEM', details: [] } }),
formpage1: new FormPageModel({ caption: '基本信息', detailType: 'FORMPAGE', name: 'formpage1', visible: true, isShowCaption: true, form: this, showMoreMode: 0 }),
srfupdatedate: new FormItemModel({ caption: '更新时间', detailType: 'FORMITEM', name: 'srfupdatedate', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 0 }),
srforikey: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srforikey', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
srfkey: new FormItemModel({ caption: '区域', detailType: 'FORMITEM', name: 'srfkey', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
srfmajortext: new FormItemModel({ caption: '地区名称', detailType: 'FORMITEM', name: 'srfmajortext', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
srftempmode: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srftempmode', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
srfuf: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfuf', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
srfdeid: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfdeid', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
srfsourcekey: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfsourcekey', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
territoryname: new FormItemModel({ caption: '地区名称', detailType: 'FORMITEM', name: 'territoryname', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
managername: new FormItemModel({ caption: '管理员', detailType: 'FORMITEM', name: 'managername', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
transactioncurrencyname: new FormItemModel({ caption: '货币', detailType: 'FORMITEM', name: 'transactioncurrencyname', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
exchangerate: new FormItemModel({ caption: '汇率', detailType: 'FORMITEM', name: 'exchangerate', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
transactioncurrencyid: new FormItemModel({ caption: '货币', detailType: 'FORMITEM', name: 'transactioncurrencyid', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
territoryid: new FormItemModel({ caption: '区域', detailType: 'FORMITEM', name: 'territoryid', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
};
}
\ No newline at end of file
/**
* Main 部件模型
*
* @export
* @class MainModel
*/
export default class MainModel {
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof MainModel
*/
public getDataItems(): any[] {
return [
{
name: 'srfwfmemo',
prop: 'srfwfmemo',
dataType: 'TEXT',
},
// 前端新增修改标识,新增为"0",修改为"1"或未设值
{
name: 'srffrontuf',
prop: 'srffrontuf',
dataType: 'TEXT',
},
{
name: 'srfupdatedate',
prop: 'updatedate',
dataType: 'DATETIME',
},
{
name: 'srforikey',
},
{
name: 'srfkey',
prop: 'territoryid',
dataType: 'GUID',
},
{
name: 'srfmajortext',
prop: 'territoryname',
dataType: 'TEXT',
},
{
name: 'srftempmode',
},
{
name: 'srfuf',
},
{
name: 'srfdeid',
},
{
name: 'srfsourcekey',
},
{
name: 'territoryname',
prop: 'territoryname',
dataType: 'TEXT',
},
{
name: 'managername',
prop: 'managername',
dataType: 'TEXT',
},
{
name: 'transactioncurrencyname',
prop: 'transactioncurrencyname',
dataType: 'PICKUPTEXT',
},
{
name: 'exchangerate',
prop: 'exchangerate',
dataType: 'BIGDECIMAL',
},
{
name: 'transactioncurrencyid',
prop: 'transactioncurrencyid',
dataType: 'PICKUP',
},
{
name: 'territoryid',
prop: 'territoryid',
dataType: 'GUID',
},
{
name: 'territory',
prop: 'territoryid',
dataType: 'FONTKEY',
},
]
}
}
\ No newline at end of file
import { Http,Util,Errorlog } from '@/utils';
import ControlService from '@/widgets/control-service';
import TerritoryService from '@/service/territory/territory-service';
import MainModel from './main-form-model';
import TransactionCurrencyService from '@/service/transaction-currency/transaction-currency-service';
/**
* Main 部件服务对象
*
* @export
* @class MainService
*/
export default class MainService extends ControlService {
/**
* 区域服务对象
*
* @type {TerritoryService}
* @memberof MainService
*/
public appEntityService: TerritoryService = new TerritoryService({ $store: this.getStore() });
/**
* 设置从数据模式
*
* @type {boolean}
* @memberof MainService
*/
public setTempMode(){
this.isTempMode = false;
}
/**
* Creates an instance of MainService.
*
* @param {*} [opts={}]
* @memberof MainService
*/
constructor(opts: any = {}) {
super(opts);
this.model = new MainModel();
}
/**
* 货币服务对象
*
* @type {TransactionCurrencyService}
* @memberof MainService
*/
public transactioncurrencyService: TransactionCurrencyService = new TransactionCurrencyService();
/**
* 处理数据
*
* @private
* @param {Promise<any>} promise
* @returns {Promise<any>}
* @memberof MainService
*/
private doItems(promise: Promise<any>, deKeyField: string, deName: string): Promise<any> {
return new Promise((resolve, reject) => {
promise.then((response: any) => {
if (response && response.status === 200) {
const data = response.data;
data.forEach((item:any,index:number) =>{
item[deName] = item[deKeyField];
data[index] = item;
});
resolve(data);
} else {
reject([])
}
}).catch((response: any) => {
reject([])
});
});
}
/**
* 获取跨实体数据集合
*
* @param {string} serviceName 服务名称
* @param {string} interfaceName 接口名称
* @param {*} data
* @param {boolean} [isloading]
* @returns {Promise<any[]>}
* @memberof MainService
*/
@Errorlog
public getItems(serviceName: string, interfaceName: string, context: any = {}, data: any, isloading?: boolean): Promise<any[]> {
if (Object.is(serviceName, 'TransactionCurrencyService') && Object.is(interfaceName, 'FetchDefault')) {
return this.doItems(this.transactioncurrencyService.FetchDefault(JSON.parse(JSON.stringify(context)),data, isloading), 'transactioncurrencyid', 'transactioncurrency');
}
return Promise.reject([])
}
/**
* 启动工作流
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @param {*} [localdata]
* @returns {Promise<any>}
* @memberof MainService
*/
@Errorlog
public wfstart(action: string,context: any = {},data: any = {}, isloading?: boolean,localdata?:any): Promise<any> {
data = this.handleWFData(data);
context = this.handleRequestData(action,context,data).context;
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](context,data, isloading,localdata);
} else {
result = this.appEntityService.WFStart(context,data, isloading,localdata);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 提交工作流
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @param {*} [localdata]
* @returns {Promise<any>}
* @memberof MainService
*/
@Errorlog
public wfsubmit(action: string,context: any = {}, data: any = {}, isloading?: boolean,localdata?:any): Promise<any> {
data = this.handleWFData(data,true);
context = this.handleRequestData(action,context,data,true).context;
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](context,data, isloading,localdata);
} else {
result = this.appEntityService.WFSubmit(context,data, isloading,localdata);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 添加数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MainService
*/
@Errorlog
public add(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.Create(Context,Data, isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 删除数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MainService
*/
@Errorlog
public delete(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.Remove(Context,Data, isloading);
}
result.then((response) => {
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 修改数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MainService
*/
@Errorlog
public update(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.Update(Context,Data, isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 查询数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MainService
*/
@Errorlog
public get(action: string,context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.Get(Context,Data, isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 加载草稿
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MainService
*/
@Errorlog
public loadDraft(action: string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
//仿真主键数据
const PrimaryKey = Util.createUUID();
Data.territoryid = PrimaryKey;
Data.territory = PrimaryKey;
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.GetDraft(Context,Data, isloading);
}
result.then((response) => {
response.data.territoryid = PrimaryKey;
this.handleResponse(action, response, true);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 前台逻辑
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MainService
*/
@Errorlog
public frontLogic(action:string,context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
return new Promise((resolve: any, reject: any)=>{
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
return Promise.reject({ status: 500, data: { title: '失败', message: '系统异常' } });
}
result.then((response) => {
this.handleResponse(action, response,true);
resolve(response);
}).catch(response => {
reject(response);
});
})
}
/**
* 处理请求数据
*
* @param action 行为
* @param data 数据
* @memberof MainService
*/
public handleRequestData(action: string,context:any, data: any = {},isMerge:boolean = false){
let mode: any = this.getMode();
if (!mode && mode.getDataItems instanceof Function) {
return data;
}
let formItemItems: any[] = mode.getDataItems();
let requestData:any = {};
if(isMerge && (data && data.viewparams)){
Object.assign(requestData,data.viewparams);
}
formItemItems.forEach((item:any) =>{
if(item && item.dataType && Object.is(item.dataType,'FONTKEY')){
if(item && item.prop){
requestData[item.prop] = context[item.name];
}
}else{
if(item && item.prop){
requestData[item.prop] = data[item.name];
}
}
});
let tempContext:any = JSON.parse(JSON.stringify(context));
if(tempContext && tempContext.srfsessionid){
tempContext.srfsessionkey = tempContext.srfsessionid;
delete tempContext.srfsessionid;
}
return {context:tempContext,data:requestData};
}
}
\ No newline at end of file
<i-form :model="this.data" class='app-form' ref='form' id='territory_main' style="">
<input style="display:none;" />
<row >
<i-col v-show="detailsModel.group1.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-group :model="detailsModel.group1" layoutType="TABLE_24COL" titleStyle="" class='' :uiActionGroup="detailsModel.group1.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('entities.territory.main_form.details.group1')" :isShowCaption="true" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="false" >
<app-form-group-data-panel slot="dataInfoPanel" :model="detailsModel.group1" :data="data" :context="context" :viewparams="viewparams"/>
<row>
<i-col v-show="detailsModel.territoryname.visible" :style="{}" :md="{ span: 12, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 6, offset: 0 }">
<app-form-item name='territoryname' :itemRules="this.rules.territoryname" class='' :caption="$t('entities.territory.main_form.details.territoryname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.territoryname.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.territoryname" @enter="onEnter($event)" unit="" :disabled="detailsModel.territoryname.disabled" type='text' style=""></input-box>
</app-form-item>
</i-col>
<i-col v-show="detailsModel.managername.visible" :style="{}" :md="{ span: 12, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 6, offset: 0 }">
<app-form-item name='managername' :itemRules="this.rules.managername" class='' :caption="$t('entities.territory.main_form.details.managername')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.managername.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.managername" @enter="onEnter($event)" unit="" :disabled="detailsModel.managername.disabled" type='text' style=""></input-box>
</app-form-item>
</i-col>
<i-col v-show="detailsModel.transactioncurrencyname.visible" :style="{}" :md="{ span: 12, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 6, offset: 0 }">
<app-form-item name='transactioncurrencyname' :itemRules="this.rules.transactioncurrencyname" class='' :caption="$t('entities.territory.main_form.details.transactioncurrencyname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.transactioncurrencyname.error" :isEmptyCaption="false" labelPos="LEFT">
<app-picker
:formState="formState"
:data="data"
:context="context"
:viewparams="viewparams"
:localContext ='{ }'
:localParam ='{ }'
:disabled="detailsModel.transactioncurrencyname.disabled"
name='transactioncurrencyname'
deMajorField='currencyname'
deKeyField='transactioncurrency'
:service="service"
:acParams="{ serviceName: 'TransactionCurrencyService', interfaceName: 'FetchDefault'}"
valueitem='transactioncurrencyid'
:value="data.transactioncurrencyname"
editortype=""
:pickupView="{ viewname: 'transaction-currency-pickup-view', title: $t('entities.transactioncurrency.views.pickupview.title'), deResParameters: [], parameters: [{ pathName: 'transactioncurrencies', parameterName: 'transactioncurrency' }, { pathName: 'pickupview', parameterName: 'pickupview' } ], placement:'' }"
style=""
@formitemvaluechange="onFormItemValueChange($event)">
</app-picker>
</app-form-item>
</i-col>
<i-col v-show="detailsModel.exchangerate.visible" :style="{}" :md="{ span: 12, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 6, offset: 0 }">
<app-form-item name='exchangerate' :itemRules="this.rules.exchangerate" class='' :caption="$t('entities.territory.main_form.details.exchangerate')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.exchangerate.error" :isEmptyCaption="false" labelPos="LEFT">
<input-box v-model="data.exchangerate" @enter="onEnter($event)" unit="" :disabled="detailsModel.exchangerate.disabled" type='number' style=""></input-box>
</app-form-item>
</i-col>
</row>
</app-form-group>
</i-col>
</row>
</i-form>
\ No newline at end of file
<template src="./main-form.html"/>
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { MainEditFormBase } from './main-form-base';
/**
* form部件
*
* @export
* @class MainEditForm
* @extends {MainEditFormBase}
*/
@Component({
components: {
}
})
@VueLifeCycleProcessing()
export default class MainEditForm extends MainEditFormBase { }
</script>
import { Prop, Provide, Emit, Model } from 'vue-property-decorator';
import { Subject, Subscription } from 'rxjs';
import { Watch, GridControllerBase } from '@/studio-core';
import TerritoryService from '@/service/territory/territory-service';
import MainService from './main-grid-service';
import TerritoryUIService from '@/uiservice/territory/territory-ui-service';
import { FormItemModel } from '@/model/form-detail';
/**
* grid部件基类
*
* @export
* @class GridControllerBase
* @extends {MainGridBase}
*/
export class MainGridBase extends GridControllerBase {
/**
* 获取部件类型
*
* @protected
* @type {string}
* @memberof MainGridBase
*/
protected controlType: string = 'GRID';
/**
* 建构部件服务对象
*
* @type {MainService}
* @memberof MainGridBase
*/
public service: MainService = new MainService({ $store: this.$store });
/**
* 实体服务对象
*
* @type {TerritoryService}
* @memberof MainGridBase
*/
public appEntityService: TerritoryService = new TerritoryService({ $store: this.$store });
/**
* 应用实体名称
*
* @protected
* @type {string}
* @memberof MainGridBase
*/
protected appDeName: string = 'territory';
/**
* 界面UI服务对象
*
* @type {TerritoryUIService}
* @memberof MainBase
*/
public appUIService:TerritoryUIService = new TerritoryUIService(this.$store);
/**
* 界面行为模型
*
* @type {*}
* @memberof MainBase
*/
public ActionModel: any = {
};
/**
* 本地缓存标识
*
* @protected
* @type {string}
* @memberof GridControllerBase
*/
protected localStorageTag: string = 'territory_main_grid';
/**
* 所有列成员
*
* @type {any[]}
* @memberof MainGridBase
*/
public allColumns: any[] = [
{
name: 'territoryname',
label: '地区名称',
langtag: 'entities.territory.main_grid.columns.territoryname',
show: true,
util: 'PX',
isEnableRowEdit: false,
},
{
name: 'managername',
label: '管理员',
langtag: 'entities.territory.main_grid.columns.managername',
show: true,
util: 'PX',
isEnableRowEdit: false,
},
{
name: 'transactioncurrencyname',
label: '货币',
langtag: 'entities.territory.main_grid.columns.transactioncurrencyname',
show: true,
util: 'PX',
isEnableRowEdit: false,
},
{
name: 'exchangerate',
label: '汇率',
langtag: 'entities.territory.main_grid.columns.exchangerate',
show: true,
util: 'PX',
isEnableRowEdit: false,
},
{
name: 'updatedate',
label: '更新时间',
langtag: 'entities.territory.main_grid.columns.updatedate',
show: true,
util: 'PX',
isEnableRowEdit: false,
},
]
/**
* 获取表格行模型
*
* @type {*}
* @memberof MainGridBase
*/
public getGridRowModel(){
return {
srfkey: new FormItemModel(),
}
}
/**
* 属性值规则
*
* @type {*}
* @memberof MainGridBase
*/
public rules: any = {
srfkey: [
{ required: false, validator: (rule:any, value:any, callback:any) => { return (rule.required && (value === null || value === undefined || value === "")) ? false : true;}, message: '区域 值不能为空', trigger: 'change' },
{ required: false, validator: (rule:any, value:any, callback:any) => { return (rule.required && (value === null || value === undefined || value === "")) ? false : true;}, message: '区域 值不能为空', trigger: 'blur' },
],
}
/**
* 获取对应列class
*
* @type {*}
* @memberof MainBase
*/
public hasRowEdit: any = {
'territoryname':false,
'managername':false,
'transactioncurrencyname':false,
'exchangerate':false,
'updatedate':false,
};
/**
* 获取对应列class
*
* @param {*} $args row 行数据,column 列数据,rowIndex 行索引,列索引
* @returns {void}
* @memberof MainBase
*/
public getCellClassName(args: {row: any, column: any, rowIndex: number, columnIndex: number}): any {
return ( this.hasRowEdit[args.column.property] && this.actualIsOpenEdit ) ? "edit-cell" : "info-cell";
}
/**
* 导出数据格式化
*
* @param {*} filterVal
* @param {*} jsonData
* @param {any[]} [codelistColumns=[]]
* @returns {Promise<any>}
* @memberof MainGridBase
*/
public async formatExcelData(filterVal: any, jsonData: any, codelistColumns?: any[]): Promise<any> {
return super.formatExcelData(filterVal, jsonData, [
]);
}
}
\ No newline at end of file
/**
* Main 部件模型
*
* @export
* @class MainModel
*/
export default class MainModel {
/**
* 是否是实体数据导出
*
* @returns {any[]}
* @memberof MainGridMode
*/
public isDEExport: boolean = false;
/**
* 获取数据项集合
*
* @returns {any[]}
* @memberof MainGridMode
*/
public getDataItems(): any[] {
if(this.isDEExport){
return [
]
}else{
return [
{
name: 'managername',
prop: 'managername',
dataType: 'TEXT',
},
{
name: 'territoryname',
prop: 'territoryname',
dataType: 'TEXT',
},
{
name: 'transactioncurrencyname',
prop: 'transactioncurrencyname',
dataType: 'PICKUPTEXT',
},
{
name: 'transactioncurrencyid',
prop: 'transactioncurrencyid',
dataType: 'PICKUP',
},
{
name: 'updatedate',
prop: 'updatedate',
dataType: 'DATETIME',
},
{
name: 'srfmajortext',
prop: 'territoryname',
dataType: 'TEXT',
},
{
name: 'srfdataaccaction',
prop: 'territoryid',
dataType: 'GUID',
},
{
name: 'srfkey',
prop: 'territoryid',
dataType: 'GUID',
},
{
name: 'exchangerate',
prop: 'exchangerate',
dataType: 'BIGDECIMAL',
},
{
name: 'territory',
prop: 'territoryid',
},
{
name:'size',
prop:'size'
},
{
name:'query',
prop:'query'
},
{
name:'filter',
prop:'filter'
},
{
name:'page',
prop:'page'
},
{
name:'sort',
prop:'sort'
},
{
name:'srfparentdata',
prop:'srfparentdata'
},
// 前端新增修改标识,新增为"0",修改为"1"或未设值
{
name: 'srffrontuf',
prop: 'srffrontuf',
dataType: 'TEXT',
},
]
}
}
}
\ No newline at end of file
import { Http,Util,Errorlog } from '@/utils';
import ControlService from '@/widgets/control-service';
import TerritoryService from '@/service/territory/territory-service';
import MainModel from './main-grid-model';
/**
* Main 部件服务对象
*
* @export
* @class MainService
*/
export default class MainService extends ControlService {
/**
* 区域服务对象
*
* @type {TerritoryService}
* @memberof MainService
*/
public appEntityService: TerritoryService = new TerritoryService({ $store: this.getStore() });
/**
* 设置从数据模式
*
* @type {boolean}
* @memberof MainService
*/
public setTempMode(){
this.isTempMode = false;
}
/**
* Creates an instance of MainService.
*
* @param {*} [opts={}]
* @memberof MainService
*/
constructor(opts: any = {}) {
super(opts);
this.model = new MainModel();
}
/**
* 处理数据
*
* @public
* @param {Promise<any>} promise
* @returns {Promise<any>}
* @memberof MainService
*/
public doItems(promise: Promise<any>, deKeyField: string, deName: string): Promise<any> {
return new Promise((resolve, reject) => {
promise.then((response: any) => {
if (response && response.status === 200) {
const data = response.data;
data.forEach((item:any,index:number) =>{
item[deName] = item[deKeyField];
data[index] = item;
});
resolve(data);
} else {
reject([])
}
}).catch((response: any) => {
reject([])
});
});
}
/**
* 获取跨实体数据集合
*
* @param {string} serviceName 服务名称
* @param {string} interfaceName 接口名称
* @param {*} data
* @param {boolean} [isloading]
* @returns {Promise<any[]>}
* @memberof MainService
*/
@Errorlog
public getItems(serviceName: string, interfaceName: string, context: any = {}, data: any, isloading?: boolean): Promise<any[]> {
data.page = data.page ? data.page : 0;
data.size = data.size ? data.size : 1000;
return Promise.reject([])
}
/**
* 添加数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MainService
*/
@Errorlog
public add(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true);
return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService;
let result: Promise<any>;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
}else{
result =_appEntityService.Create(Context,Data, isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 删除数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MainService
*/
@Errorlog
public delete(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true);
return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService;
let result: Promise<any>;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
}else{
result =_appEntityService.Remove(Context,Data, isloading);
}
result.then((response) => {
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 修改数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MainService
*/
@Errorlog
public update(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true);
return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService;
let result: Promise<any>;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Data,Context,isloading);
}else{
result =_appEntityService.Update(Data,Context,isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 获取数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MainService
*/
@Errorlog
public get(action: string, context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.Get(Context,Data, isloading);
}
result.then((response) => {
//处理返回数据,补充判断标识
if(response.data){
Object.assign(response.data,{srfuf:0});
}
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 查询数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MainService
*/
@Errorlog
public search(action: string,context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true);
return new Promise((resolve: any, reject: any) => {
const _appEntityService: any = this.appEntityService;
let result: Promise<any>;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
}else{
result =_appEntityService.FetchDefault(Context,Data, isloading);
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 加载草稿
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MainService
*/
@Errorlog
public loadDraft(action: string, context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
result = this.appEntityService.GetDraft(Context,Data, isloading);
}
result.then((response) => {
//处理返回数据,补充判断标识
if(response.data){
Object.assign(response.data,{srfuf:'0'});
//仿真主键数据
response.data.territoryid = Util.createUUID();
}
this.handleResponse(action, response, true);
resolve(response);
}).catch(response => {
reject(response);
});
});
}
/**
* 前台逻辑
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MainService
*/
@Errorlog
public frontLogic(action:string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data,true);
return new Promise((resolve: any, reject: any)=>{
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](Context,Data, isloading);
} else {
return Promise.reject({ status: 500, data: { title: '失败', message: '系统异常' } });
}
result.then((response) => {
this.handleResponse(action, response);
resolve(response);
}).catch(response => {
reject(response);
});
})
}
}
\ No newline at end of file
<div :class="{ 'grid': true, 'show-paging-bar': isEnablePagingBar, 'hidden-paging-bar': !isEnablePagingBar }">
<i-form>
<el-table v-if="isDisplay === true"
:default-sort="{ prop: minorSortPSDEF, order: Object.is(minorSortDir, 'ASC') ? 'ascending' : Object.is(minorSortDir, 'DESC') ? 'descending' : '' }"
@sort-change="onSortChange($event)"
:border="isDragendCol"
:highlight-current-row ="isSingleSelect"
:row-class-name="getRowClassName.bind(_self)"
:cell-class-name="getCellClassName.bind(_self)"
size="mini"
stripe
@row-click="rowClick($event)"
@select-all="selectAll($event)"
@select="select($event)"
@row-class-name="onRowClassName($event)"
@row-dblclick="rowDBLClick($event)"
ref='multipleTable' :data="items" :show-header="!isHideHeader">
<template slot="empty">
无数据
<span class="quick-toolbar">
</span>
</template>
<template v-if="!isSingleSelect">
<el-table-column align="center" type='selection' :width="checkboxColWidth"></el-table-column>
</template>
<template v-if="getColumnState('territoryname')">
<el-table-column show-overflow-tooltip :prop="'territoryname'" :label="$t('entities.territory.main_grid.columns.territoryname')" :width="150" :align="'left'" :sortable="'custom'">
<template v-slot:header="{column}">
<span class="column-header ">
{{$t('entities.territory.main_grid.columns.territoryname')}}
</span>
</template>
<template v-slot="{row,column,$index}">
<span>{{row.territoryname}}</span>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('managername')">
<el-table-column show-overflow-tooltip :prop="'managername'" :label="$t('entities.territory.main_grid.columns.managername')" :width="100" :align="'left'" :sortable="'custom'">
<template v-slot:header="{column}">
<span class="column-header ">
{{$t('entities.territory.main_grid.columns.managername')}}
</span>
</template>
<template v-slot="{row,column,$index}">
<span>{{row.managername}}</span>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('transactioncurrencyname')">
<el-table-column show-overflow-tooltip :prop="'transactioncurrencyname'" :label="$t('entities.territory.main_grid.columns.transactioncurrencyname')" :width="100" :align="'left'" :sortable="'custom'">
<template v-slot:header="{column}">
<span class="column-header ">
{{$t('entities.territory.main_grid.columns.transactioncurrencyname')}}
</span>
</template>
<template v-slot="{row,column,$index}">
<span>{{row.transactioncurrencyname}}</span>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('exchangerate')">
<el-table-column show-overflow-tooltip :prop="'exchangerate'" :label="$t('entities.territory.main_grid.columns.exchangerate')" :width="100" :align="'left'" :sortable="'custom'">
<template v-slot:header="{column}">
<span class="column-header ">
{{$t('entities.territory.main_grid.columns.exchangerate')}}
</span>
</template>
<template v-slot="{row,column,$index}">
<span>{{row.exchangerate}}</span>
</template>
</el-table-column>
</template>
<template v-if="getColumnState('updatedate')">
<el-table-column show-overflow-tooltip :prop="'updatedate'" :label="$t('entities.territory.main_grid.columns.updatedate')" :width="150" :align="'left'" :sortable="'custom'">
<template v-slot:header="{column}">
<span class="column-header ">
{{$t('entities.territory.main_grid.columns.updatedate')}}
</span>
</template>
<template v-slot="{row,column,$index}">
<app-format-data format="YYYY-MM-DD hh:mm:ss" :data="row.updatedate"></app-format-data>
</template>
</el-table-column>
</template>
<template v-if="adaptiveState">
<el-table-column></el-table-column>
</template>
</el-table>
<row class='grid-pagination' v-show="items.length > 0">
<page class='pull-right' @on-change="pageOnChange($event)"
@on-page-size-change="onPageSizeChange($event)"
:transfer="true" :total="totalRecord"
show-sizer :current="curPage" :page-size="limit"
:page-size-opts="[10, 20, 30, 40, 50, 60, 70, 80, 90, 100]" show-elevator show-total>
<span>
<span class="page-column">
<poptip transfer placement="top-start">
<i-button icon="md-menu">{{$t('app.gridpage.choicecolumns')}}</i-button>
<div slot="content">
<template v-for="col in allColumns">
<div :key="col.name"><el-checkbox v-model="col.show" @change="onColChange()">{{$t(col.langtag)}}</el-checkbox></div>
</template>
</div>
</poptip>
</span>
<span v-if="selections.length > 0" class="batch-toolbar">
</span>
<span class="page-button"><i-button icon="md-refresh" :title="$t('app.gridpage.refresh')" @click="pageRefresh()"></i-button></span>&nbsp;
<span>
{{$t('app.gridpage.show')}}&nbsp;
<span>
<template v-if="items.length === 1">
1
</template>
<template v-else>
<span>{{(curPage - 1) * limit + 1}}&nbsp;-&nbsp;{{totalRecord > curPage * limit ? curPage * limit : totalRecord}}</span>
</template>
</span>&nbsp;
{{$t('app.gridpage.records')}},{{$t('app.gridpage.totle')}}&nbsp;{{totalRecord}}&nbsp;{{$t('app.gridpage.records')}}
</span>
</span>
</page>
</row>
</i-form>
</div>
\ No newline at end of file
<template src="./main-grid.html"/>
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '@/studio-core';
import { MainGridBase } from './main-grid-base';
/**
* grid部件
*
* @export
* @class MainGrid
* @extends {MainGridBase}
*/
@Component({
components: {
}
})
@VueLifeCycleProcessing()
export default class MainGrid extends MainGridBase { }
</script>
...@@ -103,6 +103,10 @@ zuul: ...@@ -103,6 +103,10 @@ zuul:
path: /campaignresponses/** path: /campaignresponses/**
serviceId: ibizbusinesscentral-centralapi serviceId: ibizbusinesscentral-centralapi
stripPrefix: false stripPrefix: false
territory:
path: /territories/**
serviceId: ibizbusinesscentral-centralapi
stripPrefix: false
phonecall: phonecall:
path: /phonecalls/** path: /phonecalls/**
serviceId: ibizbusinesscentral-centralapi serviceId: ibizbusinesscentral-centralapi
......
...@@ -111,7 +111,7 @@ public class Territory extends EntityMP implements Serializable { ...@@ -111,7 +111,7 @@ public class Territory extends EntityMP implements Serializable {
@JsonProperty("importsequencenumber") @JsonProperty("importsequencenumber")
private Integer importsequencenumber; private Integer importsequencenumber;
/** /**
* UTC Conversion Time Zone Code * 时区
*/ */
@TableField(value = "utcconversiontimezonecode") @TableField(value = "utcconversiontimezonecode")
@JSONField(name = "utcconversiontimezonecode") @JSONField(name = "utcconversiontimezonecode")
...@@ -190,6 +190,13 @@ public class Territory extends EntityMP implements Serializable { ...@@ -190,6 +190,13 @@ public class Territory extends EntityMP implements Serializable {
@JSONField(name = "transactioncurrencyid") @JSONField(name = "transactioncurrencyid")
@JsonProperty("transactioncurrencyid") @JsonProperty("transactioncurrencyid")
private String transactioncurrencyid; private String transactioncurrencyid;
/**
* 货币
*/
@TableField(exist = false)
@JSONField(name = "transactioncurrencyname")
@JsonProperty("transactioncurrencyname")
private String transactioncurrencyname;
/** /**
* *
...@@ -242,7 +249,7 @@ public class Territory extends EntityMP implements Serializable { ...@@ -242,7 +249,7 @@ public class Territory extends EntityMP implements Serializable {
} }
/** /**
* 设置 [UTC Conversion Time Zone Code] * 设置 [时区]
*/ */
public void setUtcconversiontimezonecode(Integer utcconversiontimezonecode){ public void setUtcconversiontimezonecode(Integer utcconversiontimezonecode){
this.utcconversiontimezonecode = utcconversiontimezonecode ; this.utcconversiontimezonecode = utcconversiontimezonecode ;
......
...@@ -41,6 +41,20 @@ public class TerritorySearchContext extends QueryWrapperContext<Territory> { ...@@ -41,6 +41,20 @@ public class TerritorySearchContext extends QueryWrapperContext<Territory> {
this.getSearchCond().eq("transactioncurrencyid", n_transactioncurrencyid_eq); this.getSearchCond().eq("transactioncurrencyid", n_transactioncurrencyid_eq);
} }
} }
private String n_transactioncurrencyname_eq;//[货币]
public void setN_transactioncurrencyname_eq(String n_transactioncurrencyname_eq) {
this.n_transactioncurrencyname_eq = n_transactioncurrencyname_eq;
if(!ObjectUtils.isEmpty(this.n_transactioncurrencyname_eq)){
this.getSearchCond().eq("transactioncurrencyname", n_transactioncurrencyname_eq);
}
}
private String n_transactioncurrencyname_like;//[货币]
public void setN_transactioncurrencyname_like(String n_transactioncurrencyname_like) {
this.n_transactioncurrencyname_like = n_transactioncurrencyname_like;
if(!ObjectUtils.isEmpty(this.n_transactioncurrencyname_like)){
this.getSearchCond().like("transactioncurrencyname", n_transactioncurrencyname_like);
}
}
/** /**
* 启用快速搜索 * 启用快速搜索
......
...@@ -56,6 +56,7 @@ public class TerritoryServiceImpl extends ServiceImpl<TerritoryMapper, Territory ...@@ -56,6 +56,7 @@ public class TerritoryServiceImpl extends ServiceImpl<TerritoryMapper, Territory
@Override @Override
@Transactional @Transactional
public boolean create(Territory et) { public boolean create(Territory et) {
fillParentData(et);
if(!this.retBool(this.baseMapper.insert(et))) if(!this.retBool(this.baseMapper.insert(et)))
return false; return false;
CachedBeanCopier.copy(get(et.getTerritoryid()),et); CachedBeanCopier.copy(get(et.getTerritoryid()),et);
...@@ -64,12 +65,14 @@ public class TerritoryServiceImpl extends ServiceImpl<TerritoryMapper, Territory ...@@ -64,12 +65,14 @@ public class TerritoryServiceImpl extends ServiceImpl<TerritoryMapper, Territory
@Override @Override
public void createBatch(List<Territory> list) { public void createBatch(List<Territory> list) {
list.forEach(item->fillParentData(item));
this.saveBatch(list,batchSize); this.saveBatch(list,batchSize);
} }
@Override @Override
@Transactional @Transactional
public boolean update(Territory et) { public boolean update(Territory et) {
fillParentData(et);
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("territoryid",et.getTerritoryid()))) if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("territoryid",et.getTerritoryid())))
return false; return false;
CachedBeanCopier.copy(get(et.getTerritoryid()),et); CachedBeanCopier.copy(get(et.getTerritoryid()),et);
...@@ -78,6 +81,7 @@ public class TerritoryServiceImpl extends ServiceImpl<TerritoryMapper, Territory ...@@ -78,6 +81,7 @@ public class TerritoryServiceImpl extends ServiceImpl<TerritoryMapper, Territory
@Override @Override
public void updateBatch(List<Territory> list) { public void updateBatch(List<Territory> list) {
list.forEach(item->fillParentData(item));
updateBatchById(list,batchSize); updateBatchById(list,batchSize);
} }
...@@ -108,6 +112,7 @@ public class TerritoryServiceImpl extends ServiceImpl<TerritoryMapper, Territory ...@@ -108,6 +112,7 @@ public class TerritoryServiceImpl extends ServiceImpl<TerritoryMapper, Territory
@Override @Override
public Territory getDraft(Territory et) { public Territory getDraft(Territory et) {
fillParentData(et);
return et; return et;
} }
...@@ -137,12 +142,14 @@ public class TerritoryServiceImpl extends ServiceImpl<TerritoryMapper, Territory ...@@ -137,12 +142,14 @@ public class TerritoryServiceImpl extends ServiceImpl<TerritoryMapper, Territory
@Override @Override
public boolean saveBatch(Collection<Territory> list) { public boolean saveBatch(Collection<Territory> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize); saveOrUpdateBatch(list,batchSize);
return true; return true;
} }
@Override @Override
public void saveBatch(List<Territory> list) { public void saveBatch(List<Territory> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize); saveOrUpdateBatch(list,batchSize);
} }
...@@ -169,6 +176,22 @@ public class TerritoryServiceImpl extends ServiceImpl<TerritoryMapper, Territory ...@@ -169,6 +176,22 @@ public class TerritoryServiceImpl extends ServiceImpl<TerritoryMapper, Territory
/**
* 为当前实体填充父数据(外键值文本、外键值附加数据)
* @param et
*/
private void fillParentData(Territory et){
//实体关系[DER1N_TERRITORY__TRANSACTIONCURRENCY__TRANSACTIONCURRENCYID]
if(!ObjectUtils.isEmpty(et.getTransactioncurrencyid())){
cn.ibizlab.businesscentral.core.base.domain.TransactionCurrency transactioncurrency=et.getTransactioncurrency();
if(ObjectUtils.isEmpty(transactioncurrency)){
cn.ibizlab.businesscentral.core.base.domain.TransactionCurrency majorEntity=transactioncurrencyService.get(et.getTransactioncurrencyid());
et.setTransactioncurrency(majorEntity);
transactioncurrency=majorEntity;
}
et.setTransactioncurrencyname(transactioncurrency.getCurrencyname());
}
}
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性--> <!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="TerritoryResultMap" databaseId="mysql"> <select id="selectById" resultMap="TerritoryResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`DESCRIPTION`, t1.`ENTITYIMAGE`, t1.`ENTITYIMAGEID`, t1.`ENTITYIMAGE_TIMESTAMP`, t1.`ENTITYIMAGE_URL`, t1.`EXCHANGERATE`, t1.`IMPORTSEQUENCENUMBER`, t1.`MANAGERID`, t1.`MANAGERNAME`, t1.`OVERRIDDENCREATEDON`, t1.`TERRITORYID`, t1.`TERRITORYNAME`, t1.`TIMEZONERULEVERSIONNUMBER`, t1.`TRANSACTIONCURRENCYID`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`UTCCONVERSIONTIMEZONECODE`, t1.`VERSIONNUMBER` FROM `TERRITORY` t1 ) t1 where territoryid=#{id}]]> <![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`DESCRIPTION`, t1.`ENTITYIMAGE`, t1.`ENTITYIMAGEID`, t1.`ENTITYIMAGE_TIMESTAMP`, t1.`ENTITYIMAGE_URL`, t1.`EXCHANGERATE`, t1.`IMPORTSEQUENCENUMBER`, t1.`MANAGERID`, t1.`MANAGERNAME`, t1.`OVERRIDDENCREATEDON`, t1.`TERRITORYID`, t1.`TERRITORYNAME`, t1.`TIMEZONERULEVERSIONNUMBER`, t1.`TRANSACTIONCURRENCYID`, t11.`CURRENCYNAME` AS `TRANSACTIONCURRENCYNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`UTCCONVERSIONTIMEZONECODE`, t1.`VERSIONNUMBER` FROM `TERRITORY` t1 LEFT JOIN TRANSACTIONCURRENCY t11 ON t1.TRANSACTIONCURRENCYID = t11.TRANSACTIONCURRENCYID ) t1 where territoryid=#{id}]]>
</select> </select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 --> <!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
...@@ -39,12 +39,12 @@ ...@@ -39,12 +39,12 @@
<!--数据查询[Default]--> <!--数据查询[Default]-->
<sql id="Default" databaseId="mysql"> <sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`DESCRIPTION`, t1.`ENTITYIMAGE`, t1.`ENTITYIMAGEID`, t1.`ENTITYIMAGE_TIMESTAMP`, t1.`ENTITYIMAGE_URL`, t1.`EXCHANGERATE`, t1.`IMPORTSEQUENCENUMBER`, t1.`MANAGERID`, t1.`MANAGERNAME`, t1.`OVERRIDDENCREATEDON`, t1.`TERRITORYID`, t1.`TERRITORYNAME`, t1.`TIMEZONERULEVERSIONNUMBER`, t1.`TRANSACTIONCURRENCYID`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`UTCCONVERSIONTIMEZONECODE`, t1.`VERSIONNUMBER` FROM `TERRITORY` t1 <![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`DESCRIPTION`, t1.`ENTITYIMAGE`, t1.`ENTITYIMAGEID`, t1.`ENTITYIMAGE_TIMESTAMP`, t1.`ENTITYIMAGE_URL`, t1.`EXCHANGERATE`, t1.`IMPORTSEQUENCENUMBER`, t1.`MANAGERID`, t1.`MANAGERNAME`, t1.`OVERRIDDENCREATEDON`, t1.`TERRITORYID`, t1.`TERRITORYNAME`, t1.`TIMEZONERULEVERSIONNUMBER`, t1.`TRANSACTIONCURRENCYID`, t11.`CURRENCYNAME` AS `TRANSACTIONCURRENCYNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`UTCCONVERSIONTIMEZONECODE`, t1.`VERSIONNUMBER` FROM `TERRITORY` t1 LEFT JOIN TRANSACTIONCURRENCY t11 ON t1.TRANSACTIONCURRENCYID = t11.TRANSACTIONCURRENCYID
]]> ]]>
</sql> </sql>
<!--数据查询[View]--> <!--数据查询[View]-->
<sql id="View" databaseId="mysql"> <sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`DESCRIPTION`, t1.`ENTITYIMAGE`, t1.`ENTITYIMAGEID`, t1.`ENTITYIMAGE_TIMESTAMP`, t1.`ENTITYIMAGE_URL`, t1.`EXCHANGERATE`, t1.`IMPORTSEQUENCENUMBER`, t1.`MANAGERID`, t1.`MANAGERNAME`, t1.`OVERRIDDENCREATEDON`, t1.`TERRITORYID`, t1.`TERRITORYNAME`, t1.`TIMEZONERULEVERSIONNUMBER`, t1.`TRANSACTIONCURRENCYID`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`UTCCONVERSIONTIMEZONECODE`, t1.`VERSIONNUMBER` FROM `TERRITORY` t1 <![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`DESCRIPTION`, t1.`ENTITYIMAGE`, t1.`ENTITYIMAGEID`, t1.`ENTITYIMAGE_TIMESTAMP`, t1.`ENTITYIMAGE_URL`, t1.`EXCHANGERATE`, t1.`IMPORTSEQUENCENUMBER`, t1.`MANAGERID`, t1.`MANAGERNAME`, t1.`OVERRIDDENCREATEDON`, t1.`TERRITORYID`, t1.`TERRITORYNAME`, t1.`TIMEZONERULEVERSIONNUMBER`, t1.`TRANSACTIONCURRENCYID`, t11.`CURRENCYNAME` AS `TRANSACTIONCURRENCYNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN`, t1.`UTCCONVERSIONTIMEZONECODE`, t1.`VERSIONNUMBER` FROM `TERRITORY` t1 LEFT JOIN TRANSACTIONCURRENCY t11 ON t1.TRANSACTIONCURRENCYID = t11.TRANSACTIONCURRENCYID
]]> ]]>
</sql> </sql>
</mapper> </mapper>
......
...@@ -196,6 +196,14 @@ ...@@ -196,6 +196,14 @@
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}] "datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
} }
, { , {
"dename":"Territory",
"delogicname":"区域",
"sysmoudle":{"id":"BASE","name":"Base"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"PhoneCall", "dename":"PhoneCall",
"delogicname":"电话联络", "delogicname":"电话联络",
"sysmoudle":{"id":"BASE","name":"Base"}, "sysmoudle":{"id":"BASE","name":"Base"},
...@@ -505,7 +513,7 @@ ...@@ -505,7 +513,7 @@
{ {
"appid":"CRM", "appid":"CRM",
"appname":"客户管理", "appname":"客户管理",
"appmenu":[{"menuid":"Central", "menuname":"Central", "menuitem":[{ "id":"user_menus" , "name":"用户菜单" },{ "id":"top_menus" , "name":"顶部菜单" , "items":[{ "id":"menuitem3" , "name":"系统设置" , "items":[{ "id":"menuitem4" , "name":"链接角色" },{ "id":"menuitem26" , "name":"货币" }]},{ "id":"menuitem34" , "name":"消息通知" },{ "id":"menuitem35" , "name":"帮助" }]},{ "id":"left_exp" , "name":"左侧菜单" , "items":[{ "id":"menuitem17" , "name":"主页" },{ "id":"menuitem18" , "name":"最近" },{ "id":"menuitem19" , "name":"固定" },{ "id":"menuitem16" , "name":"我的工作" , "items":[{ "id":"menuitem1" , "name":"仪表盘" },{ "id":"menuitem2" , "name":"活动" }]},{ "id":"menuitem20" , "name":"客户" , "items":[{ "id":"menuitem5" , "name":"客户" },{ "id":"menuitem7" , "name":"联系人" }]},{ "id":"menuitem21" , "name":"销售" , "items":[{ "id":"menuitem8" , "name":"潜在客户" },{ "id":"menuitem9" , "name":"商机" },{ "id":"menuitem10" , "name":"竞争对手" }]},{ "id":"menuitem22" , "name":"宣传资料" , "items":[{ "id":"menuitem11" , "name":"报价单" },{ "id":"menuitem12" , "name":"订单" },{ "id":"menuitem13" , "name":"发票" },{ "id":"menuitem6" , "name":"产品" },{ "id":"menuitem14" , "name":"销售宣传资料" }]},{ "id":"menuitem23" , "name":"市场营销" , "items":[{ "id":"menuitem30" , "name":"市场活动" },{ "id":"menuitem15" , "name":"市场营销列表" }]},{ "id":"menuitem24" , "name":"绩效" , "items":[{ "id":"menuitem25" , "name":"目标" },{ "id":"menuitem31" , "name":"目标度量" }]},{ "id":"menuitem27" , "name":"服务" , "items":[{ "id":"menuitem28" , "name":"服务案例" },{ "id":"menuitem32" , "name":"知识文章" }]}]},{ "id":"bottom_exp" , "name":"底部内容" },{ "id":"footer_left" , "name":"底部左侧" },{ "id":"footer_center" , "name":"底部中间" },{ "id":"footer_right" , "name":"底部右侧" }] },{"menuid":"Setting", "menuname":"Setting", "menuitem":[{ "id":"menuitem1" , "name":"链接角色" }] }] "appmenu":[{"menuid":"Central", "menuname":"Central", "menuitem":[{ "id":"user_menus" , "name":"用户菜单" },{ "id":"top_menus" , "name":"顶部菜单" , "items":[{ "id":"menuitem3" , "name":"系统设置" , "items":[{ "id":"menuitem33" , "name":"区域" },{ "id":"menuitem26" , "name":"货币" },{ "id":"menuitem4" , "name":"链接角色" }]},{ "id":"menuitem34" , "name":"消息通知" },{ "id":"menuitem35" , "name":"帮助" }]},{ "id":"left_exp" , "name":"左侧菜单" , "items":[{ "id":"menuitem17" , "name":"主页" },{ "id":"menuitem18" , "name":"最近" },{ "id":"menuitem19" , "name":"固定" },{ "id":"menuitem16" , "name":"我的工作" , "items":[{ "id":"menuitem1" , "name":"仪表盘" },{ "id":"menuitem2" , "name":"活动" }]},{ "id":"menuitem20" , "name":"客户" , "items":[{ "id":"menuitem5" , "name":"客户" },{ "id":"menuitem7" , "name":"联系人" }]},{ "id":"menuitem21" , "name":"销售" , "items":[{ "id":"menuitem8" , "name":"潜在客户" },{ "id":"menuitem9" , "name":"商机" },{ "id":"menuitem10" , "name":"竞争对手" }]},{ "id":"menuitem22" , "name":"宣传资料" , "items":[{ "id":"menuitem11" , "name":"报价单" },{ "id":"menuitem12" , "name":"订单" },{ "id":"menuitem13" , "name":"发票" },{ "id":"menuitem6" , "name":"产品" },{ "id":"menuitem14" , "name":"销售宣传资料" }]},{ "id":"menuitem23" , "name":"市场营销" , "items":[{ "id":"menuitem30" , "name":"市场活动" },{ "id":"menuitem15" , "name":"市场营销列表" }]},{ "id":"menuitem24" , "name":"绩效" , "items":[{ "id":"menuitem25" , "name":"目标" },{ "id":"menuitem31" , "name":"目标度量" }]},{ "id":"menuitem27" , "name":"服务" , "items":[{ "id":"menuitem28" , "name":"服务案例" },{ "id":"menuitem32" , "name":"知识文章" }]}]},{ "id":"bottom_exp" , "name":"底部内容" },{ "id":"footer_left" , "name":"底部左侧" },{ "id":"footer_center" , "name":"底部中间" },{ "id":"footer_right" , "name":"底部右侧" }] },{"menuid":"Setting", "menuname":"Setting", "menuitem":[{ "id":"menuitem1" , "name":"链接角色" }] }]
} }
, ,
{ {
......
package cn.ibizlab.businesscentral.centralapi.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.businesscentral.util.domain.DTOBase;
import lombok.Data;
/**
* 服务DTO对象[TerritoryDTO]
*/
@Data
public class TerritoryDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [UPDATEMAN]
*
*/
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 属性 [CREATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 属性 [EXCHANGERATE]
*
*/
@JSONField(name = "exchangerate")
@JsonProperty("exchangerate")
private BigDecimal exchangerate;
/**
* 属性 [TERRITORYID]
*
*/
@JSONField(name = "territoryid")
@JsonProperty("territoryid")
private String territoryid;
/**
* 属性 [UPDATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 属性 [ENTITYIMAGEID]
*
*/
@JSONField(name = "entityimageid")
@JsonProperty("entityimageid")
private String entityimageid;
/**
* 属性 [MANAGERID]
*
*/
@JSONField(name = "managerid")
@JsonProperty("managerid")
private String managerid;
/**
* 属性 [ENTITYIMAGE_URL]
*
*/
@JSONField(name = "entityimage_url")
@JsonProperty("entityimage_url")
private String entityimageUrl;
/**
* 属性 [IMPORTSEQUENCENUMBER]
*
*/
@JSONField(name = "importsequencenumber")
@JsonProperty("importsequencenumber")
private Integer importsequencenumber;
/**
* 属性 [UTCCONVERSIONTIMEZONECODE]
*
*/
@JSONField(name = "utcconversiontimezonecode")
@JsonProperty("utcconversiontimezonecode")
private Integer utcconversiontimezonecode;
/**
* 属性 [TERRITORYNAME]
*
*/
@JSONField(name = "territoryname")
@JsonProperty("territoryname")
private String territoryname;
/**
* 属性 [CREATEMAN]
*
*/
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 属性 [OVERRIDDENCREATEDON]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "overriddencreatedon" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("overriddencreatedon")
private Timestamp overriddencreatedon;
/**
* 属性 [ENTITYIMAGE]
*
*/
@JSONField(name = "entityimage")
@JsonProperty("entityimage")
private String entityimage;
/**
* 属性 [VERSIONNUMBER]
*
*/
@JSONField(name = "versionnumber")
@JsonProperty("versionnumber")
private BigInteger versionnumber;
/**
* 属性 [ENTITYIMAGE_TIMESTAMP]
*
*/
@JSONField(name = "entityimage_timestamp")
@JsonProperty("entityimage_timestamp")
private BigInteger entityimageTimestamp;
/**
* 属性 [MANAGERNAME]
*
*/
@JSONField(name = "managername")
@JsonProperty("managername")
private String managername;
/**
* 属性 [TIMEZONERULEVERSIONNUMBER]
*
*/
@JSONField(name = "timezoneruleversionnumber")
@JsonProperty("timezoneruleversionnumber")
private Integer timezoneruleversionnumber;
/**
* 属性 [DESCRIPTION]
*
*/
@JSONField(name = "description")
@JsonProperty("description")
private String description;
/**
* 属性 [TRANSACTIONCURRENCYID]
*
*/
@JSONField(name = "transactioncurrencyid")
@JsonProperty("transactioncurrencyid")
private String transactioncurrencyid;
/**
* 属性 [TRANSACTIONCURRENCYNAME]
*
*/
@JSONField(name = "transactioncurrencyname")
@JsonProperty("transactioncurrencyname")
private String transactioncurrencyname;
/**
* 设置 [EXCHANGERATE]
*/
public void setExchangerate(BigDecimal exchangerate){
this.exchangerate = exchangerate ;
this.modify("exchangerate",exchangerate);
}
/**
* 设置 [ENTITYIMAGEID]
*/
public void setEntityimageid(String entityimageid){
this.entityimageid = entityimageid ;
this.modify("entityimageid",entityimageid);
}
/**
* 设置 [MANAGERID]
*/
public void setManagerid(String managerid){
this.managerid = managerid ;
this.modify("managerid",managerid);
}
/**
* 设置 [ENTITYIMAGE_URL]
*/
public void setEntityimageUrl(String entityimageUrl){
this.entityimageUrl = entityimageUrl ;
this.modify("entityimage_url",entityimageUrl);
}
/**
* 设置 [IMPORTSEQUENCENUMBER]
*/
public void setImportsequencenumber(Integer importsequencenumber){
this.importsequencenumber = importsequencenumber ;
this.modify("importsequencenumber",importsequencenumber);
}
/**
* 设置 [UTCCONVERSIONTIMEZONECODE]
*/
public void setUtcconversiontimezonecode(Integer utcconversiontimezonecode){
this.utcconversiontimezonecode = utcconversiontimezonecode ;
this.modify("utcconversiontimezonecode",utcconversiontimezonecode);
}
/**
* 设置 [TERRITORYNAME]
*/
public void setTerritoryname(String territoryname){
this.territoryname = territoryname ;
this.modify("territoryname",territoryname);
}
/**
* 设置 [OVERRIDDENCREATEDON]
*/
public void setOverriddencreatedon(Timestamp overriddencreatedon){
this.overriddencreatedon = overriddencreatedon ;
this.modify("overriddencreatedon",overriddencreatedon);
}
/**
* 设置 [ENTITYIMAGE]
*/
public void setEntityimage(String entityimage){
this.entityimage = entityimage ;
this.modify("entityimage",entityimage);
}
/**
* 设置 [VERSIONNUMBER]
*/
public void setVersionnumber(BigInteger versionnumber){
this.versionnumber = versionnumber ;
this.modify("versionnumber",versionnumber);
}
/**
* 设置 [ENTITYIMAGE_TIMESTAMP]
*/
public void setEntityimageTimestamp(BigInteger entityimageTimestamp){
this.entityimageTimestamp = entityimageTimestamp ;
this.modify("entityimage_timestamp",entityimageTimestamp);
}
/**
* 设置 [MANAGERNAME]
*/
public void setManagername(String managername){
this.managername = managername ;
this.modify("managername",managername);
}
/**
* 设置 [TIMEZONERULEVERSIONNUMBER]
*/
public void setTimezoneruleversionnumber(Integer timezoneruleversionnumber){
this.timezoneruleversionnumber = timezoneruleversionnumber ;
this.modify("timezoneruleversionnumber",timezoneruleversionnumber);
}
/**
* 设置 [DESCRIPTION]
*/
public void setDescription(String description){
this.description = description ;
this.modify("description",description);
}
/**
* 设置 [TRANSACTIONCURRENCYID]
*/
public void setTransactioncurrencyid(String transactioncurrencyid){
this.transactioncurrencyid = transactioncurrencyid ;
this.modify("transactioncurrencyid",transactioncurrencyid);
}
}
package cn.ibizlab.businesscentral.centralapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.businesscentral.core.base.domain.Territory;
import cn.ibizlab.businesscentral.centralapi.dto.TerritoryDTO;
import cn.ibizlab.businesscentral.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface TerritoryMapping extends MappingBase<TerritoryDTO, Territory> {
}
package cn.ibizlab.businesscentral.centralapi.rest;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.businesscentral.centralapi.dto.*;
import cn.ibizlab.businesscentral.centralapi.mapping.*;
import cn.ibizlab.businesscentral.core.base.domain.Territory;
import cn.ibizlab.businesscentral.core.base.service.ITerritoryService;
import cn.ibizlab.businesscentral.core.base.filter.TerritorySearchContext;
import cn.ibizlab.businesscentral.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"区域" })
@RestController("CentralApi-territory")
@RequestMapping("")
public class TerritoryResource {
@Autowired
public ITerritoryService territoryService;
@Autowired
@Lazy
public TerritoryMapping territoryMapping;
@PreAuthorize("hasPermission(this.territoryMapping.toDomain(#territorydto),'iBizBusinessCentral-Territory-Create')")
@ApiOperation(value = "新建区域", tags = {"区域" }, notes = "新建区域")
@RequestMapping(method = RequestMethod.POST, value = "/territories")
@Transactional
public ResponseEntity<TerritoryDTO> create(@RequestBody TerritoryDTO territorydto) {
Territory domain = territoryMapping.toDomain(territorydto);
territoryService.create(domain);
TerritoryDTO dto = territoryMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.territoryMapping.toDomain(#territorydtos),'iBizBusinessCentral-Territory-Create')")
@ApiOperation(value = "批量新建区域", tags = {"区域" }, notes = "批量新建区域")
@RequestMapping(method = RequestMethod.POST, value = "/territories/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<TerritoryDTO> territorydtos) {
territoryService.createBatch(territoryMapping.toDomain(territorydtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "territory" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.territoryService.get(#territory_id),'iBizBusinessCentral-Territory-Update')")
@ApiOperation(value = "更新区域", tags = {"区域" }, notes = "更新区域")
@RequestMapping(method = RequestMethod.PUT, value = "/territories/{territory_id}")
@Transactional
public ResponseEntity<TerritoryDTO> update(@PathVariable("territory_id") String territory_id, @RequestBody TerritoryDTO territorydto) {
Territory domain = territoryMapping.toDomain(territorydto);
domain .setTerritoryid(territory_id);
territoryService.update(domain );
TerritoryDTO dto = territoryMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.territoryService.getTerritoryByEntities(this.territoryMapping.toDomain(#territorydtos)),'iBizBusinessCentral-Territory-Update')")
@ApiOperation(value = "批量更新区域", tags = {"区域" }, notes = "批量更新区域")
@RequestMapping(method = RequestMethod.PUT, value = "/territories/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<TerritoryDTO> territorydtos) {
territoryService.updateBatch(territoryMapping.toDomain(territorydtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.territoryService.get(#territory_id),'iBizBusinessCentral-Territory-Remove')")
@ApiOperation(value = "删除区域", tags = {"区域" }, notes = "删除区域")
@RequestMapping(method = RequestMethod.DELETE, value = "/territories/{territory_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("territory_id") String territory_id) {
return ResponseEntity.status(HttpStatus.OK).body(territoryService.remove(territory_id));
}
@PreAuthorize("hasPermission(this.territoryService.getTerritoryByIds(#ids),'iBizBusinessCentral-Territory-Remove')")
@ApiOperation(value = "批量删除区域", tags = {"区域" }, notes = "批量删除区域")
@RequestMapping(method = RequestMethod.DELETE, value = "/territories/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
territoryService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.territoryMapping.toDomain(returnObject.body),'iBizBusinessCentral-Territory-Get')")
@ApiOperation(value = "获取区域", tags = {"区域" }, notes = "获取区域")
@RequestMapping(method = RequestMethod.GET, value = "/territories/{territory_id}")
public ResponseEntity<TerritoryDTO> get(@PathVariable("territory_id") String territory_id) {
Territory domain = territoryService.get(territory_id);
TerritoryDTO dto = territoryMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取区域草稿", tags = {"区域" }, notes = "获取区域草稿")
@RequestMapping(method = RequestMethod.GET, value = "/territories/getdraft")
public ResponseEntity<TerritoryDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(territoryMapping.toDto(territoryService.getDraft(new Territory())));
}
@ApiOperation(value = "检查区域", tags = {"区域" }, notes = "检查区域")
@RequestMapping(method = RequestMethod.POST, value = "/territories/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody TerritoryDTO territorydto) {
return ResponseEntity.status(HttpStatus.OK).body(territoryService.checkKey(territoryMapping.toDomain(territorydto)));
}
@PreAuthorize("hasPermission(this.territoryMapping.toDomain(#territorydto),'iBizBusinessCentral-Territory-Save')")
@ApiOperation(value = "保存区域", tags = {"区域" }, notes = "保存区域")
@RequestMapping(method = RequestMethod.POST, value = "/territories/save")
public ResponseEntity<Boolean> save(@RequestBody TerritoryDTO territorydto) {
return ResponseEntity.status(HttpStatus.OK).body(territoryService.save(territoryMapping.toDomain(territorydto)));
}
@PreAuthorize("hasPermission(this.territoryMapping.toDomain(#territorydtos),'iBizBusinessCentral-Territory-Save')")
@ApiOperation(value = "批量保存区域", tags = {"区域" }, notes = "批量保存区域")
@RequestMapping(method = RequestMethod.POST, value = "/territories/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<TerritoryDTO> territorydtos) {
territoryService.saveBatch(territoryMapping.toDomain(territorydtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Territory-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Territory-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"区域" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/territories/fetchdefault")
public ResponseEntity<List<TerritoryDTO>> fetchDefault(TerritorySearchContext context) {
Page<Territory> domains = territoryService.searchDefault(context) ;
List<TerritoryDTO> list = territoryMapping.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-Territory-searchDefault-all') and hasPermission(#context,'iBizBusinessCentral-Territory-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"区域" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/territories/searchdefault")
public ResponseEntity<Page<TerritoryDTO>> searchDefault(@RequestBody TerritorySearchContext context) {
Page<Territory> domains = territoryService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(territoryMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册