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

xignzi006 发布系统代码

上级 3ef3a75d
......@@ -939,13 +939,13 @@
"viewtag": "7d00f63c306adf3537efeabb3326095d",
"memo": "系统自动添加"
},
"productdashboard_proinfo": {
"productsummaryview": {
"title": "产品数据看板视图",
"caption": "产品",
"viewtype": "DEPORTALVIEW",
"viewmodule": "Product",
"viewname": "ProductDashboard_ProInfo",
"viewfilename": "product-dashboard-pro-info",
"viewname": "ProductSummaryView",
"viewfilename": "product-summary-view",
"viewtag": "7d6cff9fab81efce5b7dbc0ae11d3c15",
"memo": ""
},
......@@ -1369,13 +1369,13 @@
"viewtag": "ad6abf83dc1bc466b988194cd868d98a",
"memo": "系统自动添加"
},
"productedit_quickcreate": {
"productquickcreateview": {
"title": "快速新建",
"caption": "产品",
"viewtype": "DEOPTVIEW",
"viewmodule": "Product",
"viewname": "ProductEdit_QuickCreate",
"viewfilename": "product-edit-quick-create",
"viewname": "ProductQuickCreateView",
"viewfilename": "product-quick-create-view",
"viewtag": "afcf2380565ebffe4c3a23035c2e3b6e",
"memo": ""
},
......
......@@ -157,7 +157,7 @@ export default class DropDownList extends Vue {
* @memberof DropDownList
*/
get currentVal() {
return this.itemValue;
return this.itemValue ? this.itemValue.toString() : undefined;
}
/**
......
......@@ -59,6 +59,14 @@ export default {
},
},
sallitcompgridviewtoolbar_toolbar: {
deuiaction1: {
caption: "New",
tip: "New",
},
tbitem2: {
caption: "-",
tip: "",
},
tbitem4: {
caption: "Edit",
tip: "Edit {0}",
......
......@@ -58,6 +58,14 @@ export default {
},
},
sallitcompgridviewtoolbar_toolbar: {
deuiaction1: {
caption: "新建",
tip: "新建",
},
tbitem2: {
caption: "-",
tip: "",
},
tbitem4: {
caption: "编辑",
tip: "编辑",
......
......@@ -125,6 +125,14 @@ export default {
},
},
invoiceprogridviewtoolbar_toolbar: {
deuiaction1: {
caption: "New",
tip: "New",
},
tbitem2: {
caption: "-",
tip: "",
},
tbitem4: {
caption: "Edit",
tip: "Edit {0}",
......
......@@ -124,6 +124,14 @@ export default {
},
},
invoiceprogridviewtoolbar_toolbar: {
deuiaction1: {
caption: "新建",
tip: "新建",
},
tbitem2: {
caption: "-",
tip: "",
},
tbitem4: {
caption: "编辑",
tip: "编辑",
......
......@@ -293,6 +293,14 @@ export default {
},
},
conoppgridviewtoolbar_toolbar: {
deuiaction1: {
caption: "New",
tip: "New",
},
tbitem2: {
caption: "-",
tip: "",
},
tbitem4: {
caption: "Edit",
tip: "Edit {0}",
......
......@@ -292,6 +292,14 @@ export default {
},
},
conoppgridviewtoolbar_toolbar: {
deuiaction1: {
caption: "新建",
tip: "新建",
},
tbitem2: {
caption: "-",
tip: "",
},
tbitem4: {
caption: "编辑",
tip: "编辑",
......
......@@ -59,6 +59,14 @@ export default {
},
},
sallitprogridviewtoolbar_toolbar: {
deuiaction1: {
caption: "New",
tip: "New",
},
tbitem2: {
caption: "-",
tip: "",
},
tbitem4: {
caption: "Edit",
tip: "Edit {0}",
......
......@@ -58,6 +58,14 @@ export default {
},
},
sallitprogridviewtoolbar_toolbar: {
deuiaction1: {
caption: "新建",
tip: "新建",
},
tbitem2: {
caption: "-",
tip: "",
},
tbitem4: {
caption: "编辑",
tip: "编辑",
......
......@@ -71,7 +71,7 @@ export default {
caption: "产品",
title: "产品编辑视图",
},
dashboard_proinfo: {
summaryview: {
caption: "产品",
title: "产品数据看板视图",
},
......@@ -79,7 +79,7 @@ export default {
caption: "产品",
title: "产品选择表格视图",
},
edit_quickcreate: {
quickcreateview: {
caption: "产品",
title: "快速新建",
},
......
......@@ -70,7 +70,7 @@ export default {
caption: "产品",
title: "产品编辑视图",
},
dashboard_proinfo: {
summaryview: {
caption: "产品",
title: "产品数据看板视图",
},
......@@ -78,7 +78,7 @@ export default {
caption: "产品",
title: "产品选择表格视图",
},
edit_quickcreate: {
quickcreateview: {
caption: "产品",
title: "快速新建",
},
......
......@@ -157,6 +157,14 @@ export default {
},
},
quodetailgridviewtoolbar_toolbar: {
deuiaction1: {
caption: "New",
tip: "New",
},
tbitem2: {
caption: "-",
tip: "",
},
tbitem4: {
caption: "Edit",
tip: "Edit {0}",
......
......@@ -156,6 +156,14 @@ export default {
},
},
quodetailgridviewtoolbar_toolbar: {
deuiaction1: {
caption: "新建",
tip: "新建",
},
tbitem2: {
caption: "-",
tip: "",
},
tbitem4: {
caption: "编辑",
tip: "编辑",
......
......@@ -75,6 +75,14 @@ export default {
},
},
gridviewtoolbar_toolbar: {
deuiaction1: {
caption: "New",
tip: "New",
},
tbitem2: {
caption: "-",
tip: "",
},
tbitem4: {
caption: "Edit",
tip: "Edit {0}",
......
......@@ -74,6 +74,14 @@ export default {
},
},
gridviewtoolbar_toolbar: {
deuiaction1: {
caption: "新建",
tip: "新建",
},
tbitem2: {
caption: "-",
tip: "",
},
tbitem4: {
caption: "编辑",
tip: "编辑",
......
......@@ -76,6 +76,7 @@ export default {
salesliteraturename: "标题",
subjectname: "主题",
literaturetypecode: "类型",
description: "说明",
subjectid: "主题",
salesliteratureid: "销售宣传资料",
},
......
......@@ -75,6 +75,7 @@ export default {
salesliteraturename: "标题",
subjectname: "主题",
literaturetypecode: "类型",
description: "说明",
subjectid: "主题",
salesliteratureid: "销售宣传资料",
},
......
......@@ -128,6 +128,14 @@ export default {
},
},
soproductgridviewtoolbar_toolbar: {
deuiaction1: {
caption: "New",
tip: "New",
},
tbitem2: {
caption: "-",
tip: "",
},
tbitem4: {
caption: "Edit",
tip: "Edit {0}",
......
......@@ -127,6 +127,14 @@ export default {
},
},
soproductgridviewtoolbar_toolbar: {
deuiaction1: {
caption: "新建",
tip: "新建",
},
tbitem2: {
caption: "-",
tip: "",
},
tbitem4: {
caption: "编辑",
tip: "编辑",
......
......@@ -178,17 +178,33 @@ mock.onPut(new RegExp(/^\/accounts\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config:
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/accounts\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:account 方法: 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, {}];
});
// Save
mock.onPost(new RegExp(/^\/accounts\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:account 方法: Save");
// CheckKey
mock.onPost(new RegExp(/^\/accounts\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:account 方法: 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> = ['accountid'];
const matchArray:any = new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
const matchArray:any = new RegExp(/^\/accounts\/([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) => {
......@@ -217,16 +233,16 @@ mock.onPost(new RegExp(/^\/accounts\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((c
return [status, data];
});
// CheckKey
mock.onPost(new RegExp(/^\/accounts\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:account 方法: CheckKey");
// Save
mock.onPost(new RegExp(/^\/accounts\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:account 方法: 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> = ['accountid'];
const matchArray:any = new RegExp(/^\/accounts\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
const matchArray:any = new RegExp(/^\/accounts\/([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) => {
......@@ -254,26 +270,10 @@ mock.onPost(new RegExp(/^\/accounts\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).repl
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/accounts\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:account 方法: 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, {}];
});
// FetchRoot
mock.onGet(new RegExp(/^\/accounts\/fetchroot$/)).reply((config: any) => {
console.groupCollapsed("实体:account 方法: FetchRoot");
// FetchDefault
mock.onGet(new RegExp(/^\/accounts\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:account 方法: FetchDefault");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......@@ -286,9 +286,9 @@ mock.onGet(new RegExp(/^\/accounts\/fetchroot$/)).reply((config: any) => {
return [status, mockDatas ? mockDatas : []];
});
// FetchRoot
mock.onGet(new RegExp(/^\/accounts\/fetchroot(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:account 方法: FetchRoot");
// FetchDefault
mock.onGet(new RegExp(/^\/accounts\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:account 方法: FetchDefault");
console.table({url:config.url, method: config.method, data:config.data});
if(config.url.includes('page')){
let url = config.url.split('?')[1];
......@@ -315,9 +315,9 @@ mock.onGet(new RegExp(/^\/accounts\/fetchroot(\?[\w-./?%&=,]*)*$/)).reply((confi
return [status, records ? records : []];
});
// FetchDefault
mock.onGet(new RegExp(/^\/accounts\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:account 方法: FetchDefault");
// FetchRoot
mock.onGet(new RegExp(/^\/accounts\/fetchroot$/)).reply((config: any) => {
console.groupCollapsed("实体:account 方法: FetchRoot");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......@@ -330,9 +330,9 @@ mock.onGet(new RegExp(/^\/accounts\/fetchdefault$/)).reply((config: any) => {
return [status, mockDatas ? mockDatas : []];
});
// FetchDefault
mock.onGet(new RegExp(/^\/accounts\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:account 方法: FetchDefault");
// FetchRoot
mock.onGet(new RegExp(/^\/accounts\/fetchroot(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:account 方法: FetchRoot");
console.table({url:config.url, method: config.method, data:config.data});
if(config.url.includes('page')){
let url = config.url.split('?')[1];
......
......@@ -178,6 +178,22 @@ mock.onPut(new RegExp(/^\/activitypointers\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/activitypointers\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:activitypointer 方法: 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(/^\/activitypointers\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
......@@ -254,22 +270,6 @@ mock.onPost(new RegExp(/^\/activitypointers\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/activitypointers\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:activitypointer 方法: 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, {}];
});
// FetchByParentKey
mock.onGet(new RegExp(/^\/activitypointers\/fetchbyparentkey$/)).reply((config: any) => {
......@@ -367,9 +367,9 @@ mock.onGet(new RegExp(/^\/activitypointers\/fetchdefault(\?[\w-./?%&=,]*)*$/)).r
// URI参数传递情况未实现
// Get
mock.onGet(new RegExp(/^\/activitypointers\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:activitypointer 方法: Get");
// Remove
mock.onDelete(new RegExp(/^\/activitypointers\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:activitypointer 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......@@ -395,9 +395,9 @@ mock.onGet(new RegExp(/^\/activitypointers\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((c
return [status, _items?_items:{}];
});
// Remove
mock.onDelete(new RegExp(/^\/activitypointers\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:activitypointer 方法: Remove");
// Get
mock.onGet(new RegExp(/^\/activitypointers\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:activitypointer 方法: Get");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......
......@@ -140,33 +140,17 @@ mock.onPost(new RegExp(/^\/appointments\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((con
console.groupEnd();
return [status, mockDatas[0]];
});
// GetDraft
mock.onGet(new RegExp(/^\/appointments\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:appointment 方法: 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(/^\/appointments\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:appointment 方法: CheckKey");
// Update
mock.onPut(new RegExp(/^\/appointments\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:appointment 方法: 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> = ['activityid'];
const matchArray:any = new RegExp(/^\/appointments\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
const matchArray:any = new RegExp(/^\/appointments\/([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) => {
......@@ -194,17 +178,33 @@ mock.onPost(new RegExp(/^\/appointments\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/appointments\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:appointment 方法: 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, {}];
});
// Save
mock.onPost(new RegExp(/^\/appointments\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:appointment 方法: Save");
// CheckKey
mock.onPost(new RegExp(/^\/appointments\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:appointment 方法: 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> = ['activityid'];
const matchArray:any = new RegExp(/^\/appointments\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
const matchArray:any = new RegExp(/^\/appointments\/([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) => {
......@@ -233,16 +233,16 @@ mock.onPost(new RegExp(/^\/appointments\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).repl
return [status, data];
});
// Update
mock.onPut(new RegExp(/^\/appointments\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:appointment 方法: Update");
// Save
mock.onPost(new RegExp(/^\/appointments\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:appointment 方法: 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> = ['activityid'];
const matchArray:any = new RegExp(/^\/appointments\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
const matchArray:any = new RegExp(/^\/appointments\/([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) => {
......
......@@ -115,16 +115,16 @@ mock.onGet(new RegExp(/^\/campaignactivities\/([a-zA-Z0-9\-\;]{1,35})\/select$/)
return [status, _items];
});
// Save
mock.onPost(new RegExp(/^\/campaignactivities\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:campaignactivity 方法: Save");
// Create
mock.onPost(new RegExp(/^\/campaignactivities\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:campaignactivity 方法: 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> = ['activityid'];
const matchArray:any = new RegExp(/^\/campaignactivities\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
const matchArray:any = new RegExp(/^\/campaignactivities\/([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) => {
......@@ -134,23 +134,11 @@ mock.onPost(new RegExp(/^\/campaignactivities\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.activityid, tempValue.activityid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['activityid'] == tempValue['activityid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.table(mockDatas[0]);
console.groupEnd();
console.groupEnd();
return [status, data];
return [status, mockDatas[0]];
});
// Update
......@@ -190,6 +178,22 @@ mock.onPut(new RegExp(/^\/campaignactivities\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/campaignactivities\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:campaignactivity 方法: 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(/^\/campaignactivities\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
......@@ -228,33 +232,17 @@ mock.onPost(new RegExp(/^\/campaignactivities\/?([a-zA-Z0-9\-\;]{0,35})\/checkke
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/campaignactivities\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:campaignactivity 方法: 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, {}];
});
// Create
mock.onPost(new RegExp(/^\/campaignactivities\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:campaignactivity 方法: Create");
// Save
mock.onPost(new RegExp(/^\/campaignactivities\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:campaignactivity 方法: 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> = ['activityid'];
const matchArray:any = new RegExp(/^\/campaignactivities\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
const matchArray:any = new RegExp(/^\/campaignactivities\/([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) => {
......@@ -264,16 +252,28 @@ mock.onPost(new RegExp(/^\/campaignactivities\/?([a-zA-Z0-9\-\;]{0,35})$/)).repl
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.activityid, tempValue.activityid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['activityid'] == tempValue['activityid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas[0]);
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, mockDatas[0]];
return [status, data];
});
// FetchDefault
mock.onGet(new RegExp(/^\/campaignactivities\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:campaignactivity 方法: FetchDefault");
// FetchByParentKey
mock.onGet(new RegExp(/^\/campaignactivities\/fetchbyparentkey$/)).reply((config: any) => {
console.groupCollapsed("实体:campaignactivity 方法: FetchByParentKey");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......@@ -286,9 +286,9 @@ mock.onGet(new RegExp(/^\/campaignactivities\/fetchdefault$/)).reply((config: an
return [status, mockDatas ? mockDatas : []];
});
// FetchDefault
mock.onGet(new RegExp(/^\/campaignactivities\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:campaignactivity 方法: FetchDefault");
// FetchByParentKey
mock.onGet(new RegExp(/^\/campaignactivities\/fetchbyparentkey(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:campaignactivity 方法: FetchByParentKey");
console.table({url:config.url, method: config.method, data:config.data});
if(config.url.includes('page')){
let url = config.url.split('?')[1];
......@@ -315,9 +315,9 @@ mock.onGet(new RegExp(/^\/campaignactivities\/fetchdefault(\?[\w-./?%&=,]*)*$/))
return [status, records ? records : []];
});
// FetchByParentKey
mock.onGet(new RegExp(/^\/campaignactivities\/fetchbyparentkey$/)).reply((config: any) => {
console.groupCollapsed("实体:campaignactivity 方法: FetchByParentKey");
// FetchDefault
mock.onGet(new RegExp(/^\/campaignactivities\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:campaignactivity 方法: FetchDefault");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......@@ -330,9 +330,9 @@ mock.onGet(new RegExp(/^\/campaignactivities\/fetchbyparentkey$/)).reply((config
return [status, mockDatas ? mockDatas : []];
});
// FetchByParentKey
mock.onGet(new RegExp(/^\/campaignactivities\/fetchbyparentkey(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:campaignactivity 方法: FetchByParentKey");
// FetchDefault
mock.onGet(new RegExp(/^\/campaignactivities\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:campaignactivity 方法: FetchDefault");
console.table({url:config.url, method: config.method, data:config.data});
if(config.url.includes('page')){
let url = config.url.split('?')[1];
......
......@@ -140,33 +140,17 @@ mock.onPost(new RegExp(/^\/campaignresponses\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply
console.groupEnd();
return [status, mockDatas[0]];
});
// GetDraft
mock.onGet(new RegExp(/^\/campaignresponses\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:campaignresponse 方法: 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, {}];
});
// Save
mock.onPost(new RegExp(/^\/campaignresponses\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:campaignresponse 方法: Save");
// Update
mock.onPut(new RegExp(/^\/campaignresponses\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:campaignresponse 方法: 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> = ['activityid'];
const matchArray:any = new RegExp(/^\/campaignresponses\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
const matchArray:any = new RegExp(/^\/campaignresponses\/([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) => {
......@@ -194,17 +178,33 @@ mock.onPost(new RegExp(/^\/campaignresponses\/?([a-zA-Z0-9\-\;]{0,35})\/save$/))
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/campaignresponses\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:campaignresponse 方法: 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, {}];
});
// Update
mock.onPut(new RegExp(/^\/campaignresponses\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:campaignresponse 方法: Update");
// CheckKey
mock.onPost(new RegExp(/^\/campaignresponses\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:campaignresponse 方法: 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> = ['activityid'];
const matchArray:any = new RegExp(/^\/campaignresponses\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
const matchArray:any = new RegExp(/^\/campaignresponses\/([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) => {
......@@ -233,16 +233,16 @@ mock.onPut(new RegExp(/^\/campaignresponses\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply(
return [status, data];
});
// CheckKey
mock.onPost(new RegExp(/^\/campaignresponses\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:campaignresponse 方法: CheckKey");
// Save
mock.onPost(new RegExp(/^\/campaignresponses\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:campaignresponse 方法: 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> = ['activityid'];
const matchArray:any = new RegExp(/^\/campaignresponses\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
const matchArray:any = new RegExp(/^\/campaignresponses\/([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) => {
......
......@@ -141,16 +141,16 @@ mock.onPost(new RegExp(/^\/campaigns\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config
return [status, mockDatas[0]];
});
// Save
mock.onPost(new RegExp(/^\/campaigns\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:campaign 方法: Save");
// Update
mock.onPut(new RegExp(/^\/campaigns\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:campaign 方法: 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> = ['campaignid'];
const matchArray:any = new RegExp(/^\/campaigns\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
const matchArray:any = new RegExp(/^\/campaigns\/([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) => {
......@@ -195,16 +195,16 @@ mock.onGet(new RegExp(/^\/campaigns\/getdraft$/)).reply((config: any) => {
return [status, {}];
});
// Update
mock.onPut(new RegExp(/^\/campaigns\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:campaign 方法: Update");
// CheckKey
mock.onPost(new RegExp(/^\/campaigns\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:campaign 方法: 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> = ['campaignid'];
const matchArray:any = new RegExp(/^\/campaigns\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
const matchArray:any = new RegExp(/^\/campaigns\/([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) => {
......@@ -233,16 +233,16 @@ mock.onPut(new RegExp(/^\/campaigns\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config:
return [status, data];
});
// CheckKey
mock.onPost(new RegExp(/^\/campaigns\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:campaign 方法: CheckKey");
// Save
mock.onPost(new RegExp(/^\/campaigns\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:campaign 方法: 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> = ['campaignid'];
const matchArray:any = new RegExp(/^\/campaigns\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
const matchArray:any = new RegExp(/^\/campaigns\/([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) => {
......@@ -323,9 +323,9 @@ mock.onGet(new RegExp(/^\/campaigns\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((c
// URI参数传递情况未实现
// Get
mock.onGet(new RegExp(/^\/campaigns\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:campaign 方法: Get");
// Remove
mock.onDelete(new RegExp(/^\/campaigns\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:campaign 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......@@ -351,9 +351,9 @@ mock.onGet(new RegExp(/^\/campaigns\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config:
return [status, _items?_items:{}];
});
// Remove
mock.onDelete(new RegExp(/^\/campaigns\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:campaign 方法: Remove");
// Get
mock.onGet(new RegExp(/^\/campaigns\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:campaign 方法: Get");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......
......@@ -115,9 +115,9 @@ mock.onGet(new RegExp(/^\/competitors\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply
return [status, _items];
});
// Update
mock.onPut(new RegExp(/^\/competitors\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:competitor 方法: Update");
// Create
mock.onPost(new RegExp(/^\/competitors\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:competitor 方法: Create");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......@@ -134,35 +134,23 @@ mock.onPut(new RegExp(/^\/competitors\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((confi
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.competitorid, tempValue.competitorid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['competitorid'] == tempValue['competitorid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.table(mockDatas[0]);
console.groupEnd();
console.groupEnd();
return [status, data];
return [status, mockDatas[0]];
});
// Save
mock.onPost(new RegExp(/^\/competitors\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:competitor 方法: Save");
// Update
mock.onPut(new RegExp(/^\/competitors\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:competitor 方法: 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> = ['competitorid'];
const matchArray:any = new RegExp(/^\/competitors\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
const matchArray:any = new RegExp(/^\/competitors\/([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) => {
......@@ -190,31 +178,21 @@ mock.onPost(new RegExp(/^\/competitors\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply
console.groupEnd();
return [status, data];
});
// Create
mock.onPost(new RegExp(/^\/competitors\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:competitor 方法: Create");
// GetDraft
mock.onGet(new RegExp(/^\/competitors\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:competitor 方法: GetDraft");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['competitorid'];
const matchArray:any = new RegExp(/^\/competitors\/([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.table({});
console.groupEnd();
console.groupEnd();
return [status, mockDatas[0]];
return [status, {}];
});
// CheckKey
......@@ -254,21 +232,43 @@ mock.onPost(new RegExp(/^\/competitors\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).r
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/competitors\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:competitor 方法: GetDraft");
// Save
mock.onPost(new RegExp(/^\/competitors\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:competitor 方法: Save");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['competitorid'];
const matchArray:any = new RegExp(/^\/competitors\/([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.competitorid, tempValue.competitorid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['competitorid'] == tempValue['competitorid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, {}];
return [status, data];
});
// FetchDefault
......
......@@ -141,16 +141,16 @@ mock.onPost(new RegExp(/^\/emails\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: a
return [status, mockDatas[0]];
});
// Save
mock.onPost(new RegExp(/^\/emails\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:email 方法: Save");
// Update
mock.onPut(new RegExp(/^\/emails\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:email 方法: 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> = ['activityid'];
const matchArray:any = new RegExp(/^\/emails\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
const matchArray:any = new RegExp(/^\/emails\/([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) => {
......@@ -178,17 +178,33 @@ mock.onPost(new RegExp(/^\/emails\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((con
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/emails\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:email 方法: 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, {}];
});
// Update
mock.onPut(new RegExp(/^\/emails\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:email 方法: Update");
// CheckKey
mock.onPost(new RegExp(/^\/emails\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:email 方法: 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> = ['activityid'];
const matchArray:any = new RegExp(/^\/emails\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
const matchArray:any = new RegExp(/^\/emails\/([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) => {
......@@ -216,33 +232,17 @@ mock.onPut(new RegExp(/^\/emails\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: an
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/emails\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:email 方法: 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(/^\/emails\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:email 方法: CheckKey");
// Save
mock.onPost(new RegExp(/^\/emails\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:email 方法: 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> = ['activityid'];
const matchArray:any = new RegExp(/^\/emails\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
const matchArray:any = new RegExp(/^\/emails\/([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) => {
......@@ -323,9 +323,9 @@ mock.onGet(new RegExp(/^\/emails\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((conf
// URI参数传递情况未实现
// Get
mock.onGet(new RegExp(/^\/emails\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:email 方法: Get");
// Remove
mock.onDelete(new RegExp(/^\/emails\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:email 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......@@ -351,9 +351,9 @@ mock.onGet(new RegExp(/^\/emails\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any
return [status, _items?_items:{}];
});
// Remove
mock.onDelete(new RegExp(/^\/emails\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:email 方法: Remove");
// Get
mock.onGet(new RegExp(/^\/emails\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:email 方法: Get");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......
......@@ -115,16 +115,42 @@ mock.onGet(new RegExp(/^\/faxes\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((conf
return [status, _items];
});
// CheckKey
mock.onPost(new RegExp(/^\/faxes\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:fax 方法: CheckKey");
// Create
mock.onPost(new RegExp(/^\/faxes\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:fax 方法: 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> = ['activityid'];
const matchArray:any = new RegExp(/^\/faxes\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
const matchArray:any = new RegExp(/^\/faxes\/([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(/^\/faxes\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:fax 方法: 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> = ['activityid'];
const matchArray:any = new RegExp(/^\/faxes\/([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) => {
......@@ -152,43 +178,33 @@ mock.onPost(new RegExp(/^\/faxes\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((
console.groupEnd();
return [status, data];
});
// Create
mock.onPost(new RegExp(/^\/faxes\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:fax 方法: Create");
// GetDraft
mock.onGet(new RegExp(/^\/faxes\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:fax 方法: GetDraft");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['activityid'];
const matchArray:any = new RegExp(/^\/faxes\/([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.table({});
console.groupEnd();
console.groupEnd();
return [status, mockDatas[0]];
return [status, {}];
});
// Update
mock.onPut(new RegExp(/^\/faxes\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:fax 方法: Update");
// CheckKey
mock.onPost(new RegExp(/^\/faxes\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:fax 方法: 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> = ['activityid'];
const matchArray:any = new RegExp(/^\/faxes\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
const matchArray:any = new RegExp(/^\/faxes\/([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) => {
......@@ -254,22 +270,6 @@ mock.onPost(new RegExp(/^\/faxes\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((conf
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/faxes\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:fax 方法: 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, {}];
});
// FetchDefault
mock.onGet(new RegExp(/^\/faxes\/fetchdefault$/)).reply((config: any) => {
......@@ -323,9 +323,9 @@ mock.onGet(new RegExp(/^\/faxes\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((confi
// URI参数传递情况未实现
// Get
mock.onGet(new RegExp(/^\/faxes\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:fax 方法: Get");
// Remove
mock.onDelete(new RegExp(/^\/faxes\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:fax 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......@@ -351,9 +351,9 @@ mock.onGet(new RegExp(/^\/faxes\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any)
return [status, _items?_items:{}];
});
// Remove
mock.onDelete(new RegExp(/^\/faxes\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:fax 方法: Remove");
// Get
mock.onGet(new RegExp(/^\/faxes\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:fax 方法: Get");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......
......@@ -115,44 +115,6 @@ mock.onGet(new RegExp(/^\/goals\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((conf
return [status, _items];
});
// Save
mock.onPost(new RegExp(/^\/goals\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:goal 方法: 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> = ['goalid'];
const matchArray:any = new RegExp(/^\/goals\/([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.goalid, tempValue.goalid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['goalid'] == tempValue['goalid'] ){
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];
});
// Create
mock.onPost(new RegExp(/^\/goals\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:goal 方法: Create");
......@@ -216,6 +178,22 @@ mock.onPut(new RegExp(/^\/goals\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/goals\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:goal 方法: 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(/^\/goals\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
......@@ -254,21 +232,43 @@ mock.onPost(new RegExp(/^\/goals\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/goals\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:goal 方法: GetDraft");
// Save
mock.onPost(new RegExp(/^\/goals\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:goal 方法: Save");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['goalid'];
const matchArray:any = new RegExp(/^\/goals\/([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.goalid, tempValue.goalid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['goalid'] == tempValue['goalid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table({});
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, {}];
return [status, data];
});
// FetchDefault
......
......@@ -115,16 +115,16 @@ mock.onGet(new RegExp(/^\/ibizlists\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((
return [status, _items];
});
// Save
mock.onPost(new RegExp(/^\/ibizlists\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:ibizlist 方法: Save");
// Create
mock.onPost(new RegExp(/^\/ibizlists\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:ibizlist 方法: 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> = ['listid'];
const matchArray:any = new RegExp(/^\/ibizlists\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
const matchArray:any = new RegExp(/^\/ibizlists\/([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) => {
......@@ -134,35 +134,23 @@ mock.onPost(new RegExp(/^\/ibizlists\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.listid, tempValue.listid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['listid'] == tempValue['listid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.table(mockDatas[0]);
console.groupEnd();
console.groupEnd();
return [status, data];
return [status, mockDatas[0]];
});
// CheckKey
mock.onPost(new RegExp(/^\/ibizlists\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:ibizlist 方法: CheckKey");
// Update
mock.onPut(new RegExp(/^\/ibizlists\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:ibizlist 方法: 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> = ['listid'];
const matchArray:any = new RegExp(/^\/ibizlists\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
const matchArray:any = new RegExp(/^\/ibizlists\/([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) => {
......@@ -190,17 +178,33 @@ mock.onPost(new RegExp(/^\/ibizlists\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).rep
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/ibizlists\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:ibizlist 方法: 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, {}];
});
// Update
mock.onPut(new RegExp(/^\/ibizlists\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:ibizlist 方法: Update");
// CheckKey
mock.onPost(new RegExp(/^\/ibizlists\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:ibizlist 方法: 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> = ['listid'];
const matchArray:any = new RegExp(/^\/ibizlists\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
const matchArray:any = new RegExp(/^\/ibizlists\/([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) => {
......@@ -229,16 +233,16 @@ mock.onPut(new RegExp(/^\/ibizlists\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config:
return [status, data];
});
// Create
mock.onPost(new RegExp(/^\/ibizlists\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:ibizlist 方法: Create");
// Save
mock.onPost(new RegExp(/^\/ibizlists\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:ibizlist 方法: 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> = ['listid'];
const matchArray:any = new RegExp(/^\/ibizlists\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
const matchArray:any = new RegExp(/^\/ibizlists\/([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) => {
......@@ -248,27 +252,23 @@ mock.onPost(new RegExp(/^\/ibizlists\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.listid, tempValue.listid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['listid'] == tempValue['listid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas[0]);
console.groupEnd();
console.groupEnd();
return [status, mockDatas[0]];
});
// GetDraft
mock.onGet(new RegExp(/^\/ibizlists\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:ibizlist 方法: 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.table(data);
console.groupEnd();
console.groupEnd();
return [status, {}];
return [status, data];
});
// FetchDefault
......
......@@ -114,33 +114,43 @@ mock.onGet(new RegExp(/^\/ibizservices\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).repl
console.groupEnd();
return [status, _items];
});
// GetDraft
mock.onGet(new RegExp(/^\/ibizservices\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:ibizservice 方法: GetDraft");
// Create
mock.onPost(new RegExp(/^\/ibizservices\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:ibizservice 方法: Create");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['serviceid'];
const matchArray:any = new RegExp(/^\/ibizservices\/([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({});
console.table(mockDatas[0]);
console.groupEnd();
console.groupEnd();
return [status, {}];
return [status, mockDatas[0]];
});
// CheckKey
mock.onPost(new RegExp(/^\/ibizservices\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:ibizservice 方法: CheckKey");
// Update
mock.onPut(new RegExp(/^\/ibizservices\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:ibizservice 方法: 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> = ['serviceid'];
const matchArray:any = new RegExp(/^\/ibizservices\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
const matchArray:any = new RegExp(/^\/ibizservices\/([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) => {
......@@ -168,17 +178,33 @@ mock.onPost(new RegExp(/^\/ibizservices\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/ibizservices\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:ibizservice 方法: 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, {}];
});
// Save
mock.onPost(new RegExp(/^\/ibizservices\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:ibizservice 方法: Save");
// CheckKey
mock.onPost(new RegExp(/^\/ibizservices\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:ibizservice 方法: 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> = ['serviceid'];
const matchArray:any = new RegExp(/^\/ibizservices\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
const matchArray:any = new RegExp(/^\/ibizservices\/([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) => {
......@@ -207,16 +233,16 @@ mock.onPost(new RegExp(/^\/ibizservices\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).repl
return [status, data];
});
// Update
mock.onPut(new RegExp(/^\/ibizservices\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:ibizservice 方法: Update");
// Save
mock.onPost(new RegExp(/^\/ibizservices\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:ibizservice 方法: 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> = ['serviceid'];
const matchArray:any = new RegExp(/^\/ibizservices\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
const matchArray:any = new RegExp(/^\/ibizservices\/([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) => {
......@@ -244,32 +270,6 @@ mock.onPut(new RegExp(/^\/ibizservices\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((conf
console.groupEnd();
return [status, data];
});
// Create
mock.onPost(new RegExp(/^\/ibizservices\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:ibizservice 方法: 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> = ['serviceid'];
const matchArray:any = new RegExp(/^\/ibizservices\/([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]];
});
// FetchDefault
mock.onGet(new RegExp(/^\/ibizservices\/fetchdefault$/)).reply((config: any) => {
......
......@@ -114,21 +114,31 @@ mock.onGet(new RegExp(/^\/incidents\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((
console.groupEnd();
return [status, _items];
});
// GetDraft
mock.onGet(new RegExp(/^\/incidents\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:incident 方法: GetDraft");
// Create
mock.onPost(new RegExp(/^\/incidents\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:incident 方法: Create");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['incidentid'];
const matchArray:any = new RegExp(/^\/incidents\/([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({});
console.table(mockDatas[0]);
console.groupEnd();
console.groupEnd();
return [status, {}];
return [status, mockDatas[0]];
});
// Update
......@@ -168,43 +178,33 @@ mock.onPut(new RegExp(/^\/incidents\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config:
console.groupEnd();
return [status, data];
});
// Create
mock.onPost(new RegExp(/^\/incidents\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:incident 方法: Create");
// GetDraft
mock.onGet(new RegExp(/^\/incidents\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:incident 方法: GetDraft");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['incidentid'];
const matchArray:any = new RegExp(/^\/incidents\/([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.table({});
console.groupEnd();
console.groupEnd();
return [status, mockDatas[0]];
return [status, {}];
});
// Save
mock.onPost(new RegExp(/^\/incidents\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:incident 方法: Save");
// CheckKey
mock.onPost(new RegExp(/^\/incidents\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:incident 方法: 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> = ['incidentid'];
const matchArray:any = new RegExp(/^\/incidents\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
const matchArray:any = new RegExp(/^\/incidents\/([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) => {
......@@ -233,16 +233,16 @@ mock.onPost(new RegExp(/^\/incidents\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((
return [status, data];
});
// CheckKey
mock.onPost(new RegExp(/^\/incidents\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:incident 方法: CheckKey");
// Save
mock.onPost(new RegExp(/^\/incidents\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:incident 方法: 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> = ['incidentid'];
const matchArray:any = new RegExp(/^\/incidents\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
const matchArray:any = new RegExp(/^\/incidents\/([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) => {
......
......@@ -140,22 +140,6 @@ mock.onPost(new RegExp(/^\/invoices\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config:
console.groupEnd();
return [status, mockDatas[0]];
});
// GetDraft
mock.onGet(new RegExp(/^\/invoices\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:invoice 方法: 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, {}];
});
// Update
mock.onPut(new RegExp(/^\/invoices\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
......@@ -194,6 +178,22 @@ mock.onPut(new RegExp(/^\/invoices\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config:
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/invoices\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:invoice 方法: 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(/^\/invoices\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
......
......@@ -141,16 +141,16 @@ mock.onPost(new RegExp(/^\/letters\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config:
return [status, mockDatas[0]];
});
// Save
mock.onPost(new RegExp(/^\/letters\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:letter 方法: Save");
// Update
mock.onPut(new RegExp(/^\/letters\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:letter 方法: 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> = ['activityid'];
const matchArray:any = new RegExp(/^\/letters\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
const matchArray:any = new RegExp(/^\/letters\/([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) => {
......@@ -178,17 +178,33 @@ mock.onPost(new RegExp(/^\/letters\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((co
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/letters\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:letter 方法: 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, {}];
});
// Update
mock.onPut(new RegExp(/^\/letters\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:letter 方法: Update");
// CheckKey
mock.onPost(new RegExp(/^\/letters\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:letter 方法: 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> = ['activityid'];
const matchArray:any = new RegExp(/^\/letters\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
const matchArray:any = new RegExp(/^\/letters\/([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) => {
......@@ -216,33 +232,17 @@ mock.onPut(new RegExp(/^\/letters\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: a
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/letters\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:letter 方法: 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(/^\/letters\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:letter 方法: CheckKey");
// Save
mock.onPost(new RegExp(/^\/letters\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:letter 方法: 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> = ['activityid'];
const matchArray:any = new RegExp(/^\/letters\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
const matchArray:any = new RegExp(/^\/letters\/([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) => {
......
......@@ -141,16 +141,16 @@ mock.onPost(new RegExp(/^\/phonecalls\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((confi
return [status, mockDatas[0]];
});
// CheckKey
mock.onPost(new RegExp(/^\/phonecalls\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:phonecall 方法: CheckKey");
// Update
mock.onPut(new RegExp(/^\/phonecalls\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:phonecall 方法: 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> = ['activityid'];
const matchArray:any = new RegExp(/^\/phonecalls\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
const matchArray:any = new RegExp(/^\/phonecalls\/([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) => {
......@@ -178,17 +178,33 @@ mock.onPost(new RegExp(/^\/phonecalls\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).re
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/phonecalls\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:phonecall 方法: 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, {}];
});
// Update
mock.onPut(new RegExp(/^\/phonecalls\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:phonecall 方法: Update");
// CheckKey
mock.onPost(new RegExp(/^\/phonecalls\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:phonecall 方法: 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> = ['activityid'];
const matchArray:any = new RegExp(/^\/phonecalls\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
const matchArray:any = new RegExp(/^\/phonecalls\/([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) => {
......@@ -254,22 +270,6 @@ mock.onPost(new RegExp(/^\/phonecalls\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply(
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/phonecalls\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:phonecall 方法: 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, {}];
});
// FetchDefault
mock.onGet(new RegExp(/^\/phonecalls\/fetchdefault$/)).reply((config: any) => {
......@@ -323,9 +323,9 @@ mock.onGet(new RegExp(/^\/phonecalls\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((
// URI参数传递情况未实现
// Get
mock.onGet(new RegExp(/^\/phonecalls\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:phonecall 方法: Get");
// Remove
mock.onDelete(new RegExp(/^\/phonecalls\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:phonecall 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......@@ -351,9 +351,9 @@ mock.onGet(new RegExp(/^\/phonecalls\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config:
return [status, _items?_items:{}];
});
// Remove
mock.onDelete(new RegExp(/^\/phonecalls\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:phonecall 方法: Remove");
// Get
mock.onGet(new RegExp(/^\/phonecalls\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:phonecall 方法: Get");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......
......@@ -140,22 +140,6 @@ mock.onPost(new RegExp(/^\/pricelevels\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((conf
console.groupEnd();
return [status, mockDatas[0]];
});
// GetDraft
mock.onGet(new RegExp(/^\/pricelevels\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:pricelevel 方法: 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, {}];
});
// Update
mock.onPut(new RegExp(/^\/pricelevels\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
......@@ -194,17 +178,33 @@ mock.onPut(new RegExp(/^\/pricelevels\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((confi
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/pricelevels\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:pricelevel 方法: 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, {}];
});
// Save
mock.onPost(new RegExp(/^\/pricelevels\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:pricelevel 方法: Save");
// CheckKey
mock.onPost(new RegExp(/^\/pricelevels\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:pricelevel 方法: 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> = ['pricelevelid'];
const matchArray:any = new RegExp(/^\/pricelevels\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
const matchArray:any = new RegExp(/^\/pricelevels\/([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) => {
......@@ -233,16 +233,16 @@ mock.onPost(new RegExp(/^\/pricelevels\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply
return [status, data];
});
// CheckKey
mock.onPost(new RegExp(/^\/pricelevels\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:pricelevel 方法: CheckKey");
// Save
mock.onPost(new RegExp(/^\/pricelevels\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:pricelevel 方法: 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> = ['pricelevelid'];
const matchArray:any = new RegExp(/^\/pricelevels\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
const matchArray:any = new RegExp(/^\/pricelevels\/([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) => {
......@@ -323,9 +323,9 @@ mock.onGet(new RegExp(/^\/pricelevels\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply(
// URI参数传递情况未实现
// Get
mock.onGet(new RegExp(/^\/pricelevels\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:pricelevel 方法: Get");
// Remove
mock.onDelete(new RegExp(/^\/pricelevels\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:pricelevel 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......@@ -351,9 +351,9 @@ mock.onGet(new RegExp(/^\/pricelevels\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config
return [status, _items?_items:{}];
});
// Remove
mock.onDelete(new RegExp(/^\/pricelevels\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:pricelevel 方法: Remove");
// Get
mock.onGet(new RegExp(/^\/pricelevels\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:pricelevel 方法: Get");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......
......@@ -115,16 +115,42 @@ mock.onGet(new RegExp(/^\/subjects\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((c
return [status, _items];
});
// Save
mock.onPost(new RegExp(/^\/subjects\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:subject 方法: Save");
// Create
mock.onPost(new RegExp(/^\/subjects\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:subject 方法: 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> = ['subjectid'];
const matchArray:any = new RegExp(/^\/subjects\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
const matchArray:any = new RegExp(/^\/subjects\/([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(/^\/subjects\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:subject 方法: 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> = ['subjectid'];
const matchArray:any = new RegExp(/^\/subjects\/([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) => {
......@@ -152,31 +178,21 @@ mock.onPost(new RegExp(/^\/subjects\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((c
console.groupEnd();
return [status, data];
});
// Create
mock.onPost(new RegExp(/^\/subjects\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:subject 方法: Create");
// GetDraft
mock.onGet(new RegExp(/^\/subjects\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:subject 方法: GetDraft");
console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['subjectid'];
const matchArray:any = new RegExp(/^\/subjects\/([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.table({});
console.groupEnd();
console.groupEnd();
return [status, mockDatas[0]];
return [status, {}];
});
// CheckKey
......@@ -217,16 +233,16 @@ mock.onPost(new RegExp(/^\/subjects\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).repl
return [status, data];
});
// Update
mock.onPut(new RegExp(/^\/subjects\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:subject 方法: Update");
// Save
mock.onPost(new RegExp(/^\/subjects\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:subject 方法: 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> = ['subjectid'];
const matchArray:any = new RegExp(/^\/subjects\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
const matchArray:any = new RegExp(/^\/subjects\/([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) => {
......@@ -254,22 +270,6 @@ mock.onPut(new RegExp(/^\/subjects\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config:
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/subjects\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:subject 方法: 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, {}];
});
// FetchDefault
mock.onGet(new RegExp(/^\/subjects\/fetchdefault$/)).reply((config: any) => {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册