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

ibiz4j 发布系统代码 [ibiz-rt,ibizlab-runtime]

上级 cf50d6b1
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<template v-else> <template v-else>
<i v-if="isFirst" class='fa fa-cogs app-menu-icon'></i> <i v-if="isFirst" class='fa fa-cogs app-menu-icon'></i>
</template> </template>
<span ref="circleText" :class="{'app-menu-circle' : appMenuCollapseFlag, 'text' : true}" :title="$t(`app.menus.${ctrlName}.${item.name}`)">{{$t(`app.menus.${ctrlName}.${item.name}`)}}</span> <span ref="circleText" :class="{'app-menu-circle' : appMenuCollapseFlag, 'text' : true}" :title="$t(`app.menus.${ctrlName}.${item.name.toLowerCase()}`)">{{$t(`app.menus.${ctrlName}.${item.name.toLowerCase()}`)}}</span>
</template> </template>
<app-menu-item :isCollapse="isCollapse" :menus="item.items" :ctrlName="ctrlName" :isFirst="false" :counterdata="counterdata" :popper-class="popperClass"></app-menu-item> <app-menu-item :isCollapse="isCollapse" :menus="item.items" :ctrlName="ctrlName" :isFirst="false" :counterdata="counterdata" :popper-class="popperClass"></app-menu-item>
</el-submenu> </el-submenu>
...@@ -23,18 +23,18 @@ ...@@ -23,18 +23,18 @@
<el-menu-item :class="[{'isFirst' : isFirst},item.textcls]" v-show="!item.hidden" :index="item.name" :key="item.id"> <el-menu-item :class="[{'isFirst' : isFirst},item.textcls]" v-show="!item.hidden" :index="item.name" :key="item.id">
<template v-if="item.icon && item.icon != ''"> <template v-if="item.icon && item.icon != ''">
<img :src="item.icon" class='app-menu-icon' /> <img :src="item.icon" class='app-menu-icon' />
<span v-if="(isFirst && isCollapse) ? true : false" ref="circleText" :class="{'app-menu-circle' : appMenuCollapseFlag, 'text' : true}" :title="$t(`app.menus.${ctrlName}.${item.name}`)">{{$t(`app.menus.${ctrlName}.${item.name}`)}}</span> <span v-if="(isFirst && isCollapse) ? true : false" ref="circleText" :class="{'app-menu-circle' : appMenuCollapseFlag, 'text' : true}" :title="$t(`app.menus.${ctrlName}.${item.name.toLowerCase()}`)">{{$t(`app.menus.${ctrlName}.${item.name.toLowerCase()}`)}}</span>
</template> </template>
<template v-else-if="item.iconcls && item.iconcls != ''"> <template v-else-if="item.iconcls && item.iconcls != ''">
<i :class="[item.iconcls, 'app-menu-icon']"></i> <i :class="[item.iconcls, 'app-menu-icon']"></i>
<span v-if="(isFirst && isCollapse) ? true : false" ref="circleText" :class="{'app-menu-circle' : appMenuCollapseFlag, 'text' : true}" :title="$t(`app.menus.${ctrlName}.${item.name}`)">{{$t(`app.menus.${ctrlName}.${item.name}`)}}</span> <span v-if="(isFirst && isCollapse) ? true : false" ref="circleText" :class="{'app-menu-circle' : appMenuCollapseFlag, 'text' : true}" :title="$t(`app.menus.${ctrlName}.${item.name.toLowerCase()}`)">{{$t(`app.menus.${ctrlName}.${item.name.toLowerCase()}`)}}</span>
</template> </template>
<template v-else> <template v-else>
<i v-if="isFirst" class='fa fa-cogs app-menu-icon'></i> <i v-if="isFirst" class='fa fa-cogs app-menu-icon'></i>
<span v-if="(isFirst && isCollapse) ? true : false" ref="circleText" :class="{'app-menu-circle' : appMenuCollapseFlag, 'text' : true}" :title="$t(`app.menus.${ctrlName}.${item.name}`)">{{$t(`app.menus.${ctrlName}.${item.name}`)}}</span> <span v-if="(isFirst && isCollapse) ? true : false" ref="circleText" :class="{'app-menu-circle' : appMenuCollapseFlag, 'text' : true}" :title="$t(`app.menus.${ctrlName}.${item.name.toLowerCase()}`)">{{$t(`app.menus.${ctrlName}.${item.name.toLowerCase()}`)}}</span>
</template> </template>
<template slot="title"> <template slot="title">
<span :class="{'app-menu-circle' : appMenuCollapseFlag, 'text' : true}" :title="$t(`app.menus.${ctrlName}.${item.name}`)">{{$t(`app.menus.${ctrlName}.${item.name}`)}}</span> <span :class="{'app-menu-circle' : appMenuCollapseFlag, 'text' : true}" :title="$t(`app.menus.${ctrlName}.${item.name.toLowerCase()}`)">{{$t(`app.menus.${ctrlName}.${item.name.toLowerCase()}`)}}</span>
<template v-if="counterdata && counterdata[item.counterid] && counterdata[item.counterid] > 0"> <template v-if="counterdata && counterdata[item.counterid] && counterdata[item.counterid] > 0">
<span class="pull-right"> <span class="pull-right">
<badge :count="counterdata[item.counterid]" :overflow-count="9999"></badge> <badge :count="counterdata[item.counterid]" :overflow-count="9999"></badge>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<img :src="item.iconcls" v-else-if="!Object.is(item.iconcls, '')" /> <img :src="item.iconcls" v-else-if="!Object.is(item.iconcls, '')" />
<i class="fa fa-cogs" v-else></i> <i class="fa fa-cogs" v-else></i>
</span> </span>
<span>{{$t(`app.menus.${ctrlName}.${item.name}`)}}</span> <span>{{$t(`app.menus.${ctrlName}.${item.name.toLowerCase()}`)}}</span>
<span class="line"></span> <span class="line"></span>
</p> </p>
<p style=" display: 'flex' "> <p style=" display: 'flex' ">
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<img :src="item.iconcls" v-else-if="!Object.is(item.iconcls, '')" /> <img :src="item.iconcls" v-else-if="!Object.is(item.iconcls, '')" />
<i class="fa fa-cogs" v-else></i> <i class="fa fa-cogs" v-else></i>
</span> </span>
<h4>{{$t(`app.menus.${ctrlName}.${item.name}`)}}</h4> <h4>{{$t(`app.menus.${ctrlName}.${item.name.toLowerCase()}`)}}</h4>
</div> </div>
</card> </card>
</template> </template>
......
...@@ -9,14 +9,6 @@ import GridViewEngine from './grid-view-engine'; ...@@ -9,14 +9,6 @@ import GridViewEngine from './grid-view-engine';
*/ */
export default class GridView8Engine extends GridViewEngine { export default class GridView8Engine extends GridViewEngine {
/**
* 表格部件
*
* @type {*}
* @memberof GridView8Engine
*/
protected grid: any;
/** /**
* 表格部件 * 表格部件
* *
......
...@@ -61,6 +61,8 @@ function getAppLocale(){ ...@@ -61,6 +61,8 @@ function getAppLocale(){
nomore:"དེ་ལས་མང་བ་མི་འདུག", nomore:"དེ་ལས་མང་བ་མི་འདུག",
other:"གཞན་དག", other:"གཞན་དག",
valueNotEmpty:"སྟོང་མི་ཆོག", valueNotEmpty:"སྟོང་མི་ཆོག",
createFailed:"གསར་འཛུགས་ཕམ་པ།",
isExist:"གནས་པ་",
}, },
local:{ local:{
new: "གསར་འཛུགས།", new: "གསར་འཛུགས།",
......
...@@ -61,6 +61,8 @@ function getAppLocale(){ ...@@ -61,6 +61,8 @@ function getAppLocale(){
nomore:"No more", nomore:"No more",
other:"other", other:"other",
valueNotEmpty:"The value cannot be null", valueNotEmpty:"The value cannot be null",
createFailed:"Create Failed",
isExist:"Exist",
}, },
local:{ local:{
new: "New", new: "New",
......
...@@ -61,6 +61,8 @@ function getAppLocale(){ ...@@ -61,6 +61,8 @@ function getAppLocale(){
nomore:"没有更多了", nomore:"没有更多了",
other:"其他", other:"其他",
valueNotEmpty:"值不能为空", valueNotEmpty:"值不能为空",
createFailed:"创建失败",
isExist:"已存在",
}, },
local:{ local:{
new: "新建", new: "新建",
......
...@@ -10,6 +10,7 @@ function getLocaleResourceBase(){ ...@@ -10,6 +10,7 @@ function getLocaleResourceBase(){
memo: commonLogic.appcommonhandle("备注",null), memo: commonLogic.appcommonhandle("备注",null),
enable: commonLogic.appcommonhandle("是否有效",null), enable: commonLogic.appcommonhandle("是否有效",null),
updatedate: commonLogic.appcommonhandle("最后修改时间",null), updatedate: commonLogic.appcommonhandle("最后修改时间",null),
ext_params: commonLogic.appcommonhandle("扩展参数",null),
}, },
views: { views: {
gridview: { gridview: {
......
...@@ -10,6 +10,7 @@ function getLocaleResourceBase(){ ...@@ -10,6 +10,7 @@ function getLocaleResourceBase(){
memo: commonLogic.appcommonhandle("备注",null), memo: commonLogic.appcommonhandle("备注",null),
enable: commonLogic.appcommonhandle("是否有效",null), enable: commonLogic.appcommonhandle("是否有效",null),
updatedate: commonLogic.appcommonhandle("最后修改时间",null), updatedate: commonLogic.appcommonhandle("最后修改时间",null),
ext_params: commonLogic.appcommonhandle("扩展参数",null),
}, },
views: { views: {
gridview: { gridview: {
......
...@@ -10,6 +10,7 @@ function getLocaleResourceBase(){ ...@@ -10,6 +10,7 @@ function getLocaleResourceBase(){
memo: commonLogic.appcommonhandle("备注",null), memo: commonLogic.appcommonhandle("备注",null),
enable: commonLogic.appcommonhandle("是否有效",null), enable: commonLogic.appcommonhandle("是否有效",null),
updatedate: commonLogic.appcommonhandle("最后修改时间",null), updatedate: commonLogic.appcommonhandle("最后修改时间",null),
ext_params: commonLogic.appcommonhandle("扩展参数",null),
}, },
views: { views: {
gridview: { gridview: {
......
...@@ -87,16 +87,16 @@ mock.onDelete(new RegExp(/^\/dictcatalogs\/batch$/)).reply((config: any) => { ...@@ -87,16 +87,16 @@ mock.onDelete(new RegExp(/^\/dictcatalogs\/batch$/)).reply((config: any) => {
}); });
// Select // CheckKey
mock.onGet(new RegExp(/^\/dictcatalogs\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/dictcatalogs\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:dictcatalog 方法: Select"); console.groupCollapsed("实体:dictcatalog 方法: CheckKey");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id']; const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/dictcatalogs\/([a-zA-Z0-9\-\;]{1,35})\/select$/).exec(config.url); const matchArray:any = new RegExp(/^\/dictcatalogs\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -106,13 +106,23 @@ mock.onGet(new RegExp(/^\/dictcatalogs\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).repl ...@@ -106,13 +106,23 @@ mock.onGet(new RegExp(/^\/dictcatalogs\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).repl
}); });
}); });
} }
let items = mockDatas ? mockDatas : []; //let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.id, tempValue.id)); //let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: "); console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items); console.table(data);
console.groupEnd(); console.groupEnd();
console.groupEnd(); console.groupEnd();
return [status, _items]; return [status, data];
}); });
// Create // Create
...@@ -141,44 +151,6 @@ mock.onPost(new RegExp(/^\/dictcatalogs\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((con ...@@ -141,44 +151,6 @@ mock.onPost(new RegExp(/^\/dictcatalogs\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((con
return [status, mockDatas[0]]; return [status, mockDatas[0]];
}); });
// Update
mock.onPut(new RegExp(/^\/dictcatalogs\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:dictcatalog 方法: 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> = ['id'];
const matchArray:any = new RegExp(/^\/dictcatalogs\/([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.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
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 // GetDraft
mock.onGet(new RegExp(/^\/dictcatalogs\/getdraft$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/dictcatalogs\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:dictcatalog 方法: GetDraft"); console.groupCollapsed("实体:dictcatalog 方法: GetDraft");
...@@ -195,16 +167,16 @@ mock.onGet(new RegExp(/^\/dictcatalogs\/getdraft$/)).reply((config: any) => { ...@@ -195,16 +167,16 @@ mock.onGet(new RegExp(/^\/dictcatalogs\/getdraft$/)).reply((config: any) => {
return [status, {}]; return [status, {}];
}); });
// CheckKey // Save
mock.onPost(new RegExp(/^\/dictcatalogs\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/dictcatalogs\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:dictcatalog 方法: CheckKey"); console.groupCollapsed("实体:dictcatalog 方法: Save");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id']; const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/dictcatalogs\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url); const matchArray:any = new RegExp(/^\/dictcatalogs\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -233,16 +205,16 @@ mock.onPost(new RegExp(/^\/dictcatalogs\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)). ...@@ -233,16 +205,16 @@ mock.onPost(new RegExp(/^\/dictcatalogs\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).
return [status, data]; return [status, data];
}); });
// Save // Update
mock.onPost(new RegExp(/^\/dictcatalogs\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => { mock.onPut(new RegExp(/^\/dictcatalogs\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:dictcatalog 方法: Save"); console.groupCollapsed("实体:dictcatalog 方法: Update");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id']; const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/dictcatalogs\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url); const matchArray:any = new RegExp(/^\/dictcatalogs\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -322,10 +294,38 @@ mock.onGet(new RegExp(/^\/dictcatalogs\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply ...@@ -322,10 +294,38 @@ mock.onGet(new RegExp(/^\/dictcatalogs\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply
// URI参数传递情况未实现 // URI参数传递情况未实现
// URI参数传递情况未实现 // URI参数传递情况未实现
// Select
mock.onGet(new RegExp(/^\/dictcatalogs\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:dictcatalog 方法: 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> = ['id'];
const matchArray:any = new RegExp(/^\/dictcatalogs\/([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.id, tempValue.id));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items);
console.groupEnd();
console.groupEnd();
return [status, _items];
});
// Remove // Get
mock.onDelete(new RegExp(/^\/dictcatalogs\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/dictcatalogs\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:dictcatalog 方法: Remove"); console.groupCollapsed("实体:dictcatalog 方法: Get");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
...@@ -351,9 +351,9 @@ mock.onDelete(new RegExp(/^\/dictcatalogs\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((co ...@@ -351,9 +351,9 @@ mock.onDelete(new RegExp(/^\/dictcatalogs\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((co
return [status, _items?_items:{}]; return [status, _items?_items:{}];
}); });
// Get // Remove
mock.onGet(new RegExp(/^\/dictcatalogs\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onDelete(new RegExp(/^\/dictcatalogs\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:dictcatalog 方法: Get"); console.groupCollapsed("实体:dictcatalog 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
......
...@@ -87,16 +87,16 @@ mock.onDelete(new RegExp(/^\/jobslogs\/batch$/)).reply((config: any) => { ...@@ -87,16 +87,16 @@ mock.onDelete(new RegExp(/^\/jobslogs\/batch$/)).reply((config: any) => {
}); });
// Select // CheckKey
mock.onGet(new RegExp(/^\/jobslogs\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/jobslogs\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslog 方法: Select"); console.groupCollapsed("实体:jobslog 方法: CheckKey");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id']; const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/jobslogs\/([a-zA-Z0-9\-\;]{1,35})\/select$/).exec(config.url); const matchArray:any = new RegExp(/^\/jobslogs\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -106,13 +106,23 @@ mock.onGet(new RegExp(/^\/jobslogs\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((c ...@@ -106,13 +106,23 @@ mock.onGet(new RegExp(/^\/jobslogs\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((c
}); });
}); });
} }
let items = mockDatas ? mockDatas : []; //let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.id, tempValue.id)); //let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: "); console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items); console.table(data);
console.groupEnd(); console.groupEnd();
console.groupEnd(); console.groupEnd();
return [status, _items]; return [status, data];
}); });
// Create // Create
...@@ -141,44 +151,6 @@ mock.onPost(new RegExp(/^\/jobslogs\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: ...@@ -141,44 +151,6 @@ mock.onPost(new RegExp(/^\/jobslogs\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config:
return [status, mockDatas[0]]; return [status, mockDatas[0]];
}); });
// Update
mock.onPut(new RegExp(/^\/jobslogs\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslog 方法: 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> = ['id'];
const matchArray:any = new RegExp(/^\/jobslogs\/([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.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
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 // GetDraft
mock.onGet(new RegExp(/^\/jobslogs\/getdraft$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/jobslogs\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslog 方法: GetDraft"); console.groupCollapsed("实体:jobslog 方法: GetDraft");
...@@ -195,16 +167,16 @@ mock.onGet(new RegExp(/^\/jobslogs\/getdraft$/)).reply((config: any) => { ...@@ -195,16 +167,16 @@ mock.onGet(new RegExp(/^\/jobslogs\/getdraft$/)).reply((config: any) => {
return [status, {}]; return [status, {}];
}); });
// CheckKey // Save
mock.onPost(new RegExp(/^\/jobslogs\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/jobslogs\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslog 方法: CheckKey"); console.groupCollapsed("实体:jobslog 方法: Save");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id']; const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/jobslogs\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url); const matchArray:any = new RegExp(/^\/jobslogs\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -233,16 +205,16 @@ mock.onPost(new RegExp(/^\/jobslogs\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).repl ...@@ -233,16 +205,16 @@ mock.onPost(new RegExp(/^\/jobslogs\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).repl
return [status, data]; return [status, data];
}); });
// Save // Update
mock.onPost(new RegExp(/^\/jobslogs\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => { mock.onPut(new RegExp(/^\/jobslogs\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslog 方法: Save"); console.groupCollapsed("实体:jobslog 方法: Update");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id']; const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/jobslogs\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url); const matchArray:any = new RegExp(/^\/jobslogs\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -322,10 +294,38 @@ mock.onGet(new RegExp(/^\/jobslogs\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((co ...@@ -322,10 +294,38 @@ mock.onGet(new RegExp(/^\/jobslogs\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((co
// URI参数传递情况未实现 // URI参数传递情况未实现
// URI参数传递情况未实现 // URI参数传递情况未实现
// Select
mock.onGet(new RegExp(/^\/jobslogs\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslog 方法: 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> = ['id'];
const matchArray:any = new RegExp(/^\/jobslogs\/([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.id, tempValue.id));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items);
console.groupEnd();
console.groupEnd();
return [status, _items];
});
// Remove // Get
mock.onDelete(new RegExp(/^\/jobslogs\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/jobslogs\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslog 方法: Remove"); console.groupCollapsed("实体:jobslog 方法: Get");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
...@@ -351,9 +351,9 @@ mock.onDelete(new RegExp(/^\/jobslogs\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config ...@@ -351,9 +351,9 @@ mock.onDelete(new RegExp(/^\/jobslogs\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config
return [status, _items?_items:{}]; return [status, _items?_items:{}];
}); });
// Get // Remove
mock.onGet(new RegExp(/^\/jobslogs\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onDelete(new RegExp(/^\/jobslogs\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:jobslog 方法: Get"); console.groupCollapsed("实体:jobslog 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
......
...@@ -87,16 +87,16 @@ mock.onDelete(new RegExp(/^\/jobsregistries\/batch$/)).reply((config: any) => { ...@@ -87,16 +87,16 @@ mock.onDelete(new RegExp(/^\/jobsregistries\/batch$/)).reply((config: any) => {
}); });
// Select // CheckKey
mock.onGet(new RegExp(/^\/jobsregistries\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/jobsregistries\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsregistry 方法: Select"); console.groupCollapsed("实体:jobsregistry 方法: CheckKey");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id']; const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/jobsregistries\/([a-zA-Z0-9\-\;]{1,35})\/select$/).exec(config.url); const matchArray:any = new RegExp(/^\/jobsregistries\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -106,13 +106,23 @@ mock.onGet(new RegExp(/^\/jobsregistries\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).re ...@@ -106,13 +106,23 @@ mock.onGet(new RegExp(/^\/jobsregistries\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).re
}); });
}); });
} }
let items = mockDatas ? mockDatas : []; //let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.id, tempValue.id)); //let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: "); console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items); console.table(data);
console.groupEnd(); console.groupEnd();
console.groupEnd(); console.groupEnd();
return [status, _items]; return [status, data];
}); });
// Create // Create
...@@ -141,44 +151,6 @@ mock.onPost(new RegExp(/^\/jobsregistries\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((c ...@@ -141,44 +151,6 @@ mock.onPost(new RegExp(/^\/jobsregistries\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((c
return [status, mockDatas[0]]; return [status, mockDatas[0]];
}); });
// Update
mock.onPut(new RegExp(/^\/jobsregistries\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsregistry 方法: 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> = ['id'];
const matchArray:any = new RegExp(/^\/jobsregistries\/([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.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
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 // GetDraft
mock.onGet(new RegExp(/^\/jobsregistries\/getdraft$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/jobsregistries\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsregistry 方法: GetDraft"); console.groupCollapsed("实体:jobsregistry 方法: GetDraft");
...@@ -195,16 +167,16 @@ mock.onGet(new RegExp(/^\/jobsregistries\/getdraft$/)).reply((config: any) => { ...@@ -195,16 +167,16 @@ mock.onGet(new RegExp(/^\/jobsregistries\/getdraft$/)).reply((config: any) => {
return [status, {}]; return [status, {}];
}); });
// CheckKey // Save
mock.onPost(new RegExp(/^\/jobsregistries\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/jobsregistries\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsregistry 方法: CheckKey"); console.groupCollapsed("实体:jobsregistry 方法: Save");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id']; const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/jobsregistries\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url); const matchArray:any = new RegExp(/^\/jobsregistries\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -233,16 +205,16 @@ mock.onPost(new RegExp(/^\/jobsregistries\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/) ...@@ -233,16 +205,16 @@ mock.onPost(new RegExp(/^\/jobsregistries\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)
return [status, data]; return [status, data];
}); });
// Save // Update
mock.onPost(new RegExp(/^\/jobsregistries\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => { mock.onPut(new RegExp(/^\/jobsregistries\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsregistry 方法: Save"); console.groupCollapsed("实体:jobsregistry 方法: Update");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id']; const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/jobsregistries\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url); const matchArray:any = new RegExp(/^\/jobsregistries\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -322,10 +294,38 @@ mock.onGet(new RegExp(/^\/jobsregistries\/fetchdefault(\?[\w-./?%&=,]*)*$/)).rep ...@@ -322,10 +294,38 @@ mock.onGet(new RegExp(/^\/jobsregistries\/fetchdefault(\?[\w-./?%&=,]*)*$/)).rep
// URI参数传递情况未实现 // URI参数传递情况未实现
// URI参数传递情况未实现 // URI参数传递情况未实现
// Select
mock.onGet(new RegExp(/^\/jobsregistries\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsregistry 方法: 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> = ['id'];
const matchArray:any = new RegExp(/^\/jobsregistries\/([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.id, tempValue.id));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items);
console.groupEnd();
console.groupEnd();
return [status, _items];
});
// Remove // Get
mock.onDelete(new RegExp(/^\/jobsregistries\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/jobsregistries\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsregistry 方法: Remove"); console.groupCollapsed("实体:jobsregistry 方法: Get");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
...@@ -351,9 +351,9 @@ mock.onDelete(new RegExp(/^\/jobsregistries\/([a-zA-Z0-9\-\;]{1,35})$/)).reply(( ...@@ -351,9 +351,9 @@ mock.onDelete(new RegExp(/^\/jobsregistries\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((
return [status, _items?_items:{}]; return [status, _items?_items:{}];
}); });
// Get // Remove
mock.onGet(new RegExp(/^\/jobsregistries\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onDelete(new RegExp(/^\/jobsregistries\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:jobsregistry 方法: Get"); console.groupCollapsed("实体:jobsregistry 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
......
...@@ -87,16 +87,16 @@ mock.onDelete(new RegExp(/^\/msgopenaccesses\/batch$/)).reply((config: any) => { ...@@ -87,16 +87,16 @@ mock.onDelete(new RegExp(/^\/msgopenaccesses\/batch$/)).reply((config: any) => {
}); });
// Select // CheckKey
mock.onGet(new RegExp(/^\/msgopenaccesses\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/msgopenaccesses\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:msgopenaccess 方法: Select"); console.groupCollapsed("实体:msgopenaccess 方法: CheckKey");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id']; const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/msgopenaccesses\/([a-zA-Z0-9\-\;]{1,35})\/select$/).exec(config.url); const matchArray:any = new RegExp(/^\/msgopenaccesses\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -106,13 +106,23 @@ mock.onGet(new RegExp(/^\/msgopenaccesses\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).r ...@@ -106,13 +106,23 @@ mock.onGet(new RegExp(/^\/msgopenaccesses\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).r
}); });
}); });
} }
let items = mockDatas ? mockDatas : []; //let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.id, tempValue.id)); //let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: "); console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items); console.table(data);
console.groupEnd(); console.groupEnd();
console.groupEnd(); console.groupEnd();
return [status, _items]; return [status, data];
}); });
// Create // Create
...@@ -141,44 +151,6 @@ mock.onPost(new RegExp(/^\/msgopenaccesses\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply(( ...@@ -141,44 +151,6 @@ mock.onPost(new RegExp(/^\/msgopenaccesses\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((
return [status, mockDatas[0]]; return [status, mockDatas[0]];
}); });
// Update
mock.onPut(new RegExp(/^\/msgopenaccesses\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:msgopenaccess 方法: 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> = ['id'];
const matchArray:any = new RegExp(/^\/msgopenaccesses\/([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.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
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 // GetDraft
mock.onGet(new RegExp(/^\/msgopenaccesses\/getdraft$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/msgopenaccesses\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:msgopenaccess 方法: GetDraft"); console.groupCollapsed("实体:msgopenaccess 方法: GetDraft");
...@@ -195,16 +167,16 @@ mock.onGet(new RegExp(/^\/msgopenaccesses\/getdraft$/)).reply((config: any) => { ...@@ -195,16 +167,16 @@ mock.onGet(new RegExp(/^\/msgopenaccesses\/getdraft$/)).reply((config: any) => {
return [status, {}]; return [status, {}];
}); });
// CheckKey // Save
mock.onPost(new RegExp(/^\/msgopenaccesses\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/msgopenaccesses\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:msgopenaccess 方法: CheckKey"); console.groupCollapsed("实体:msgopenaccess 方法: Save");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id']; const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/msgopenaccesses\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url); const matchArray:any = new RegExp(/^\/msgopenaccesses\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -233,16 +205,16 @@ mock.onPost(new RegExp(/^\/msgopenaccesses\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/ ...@@ -233,16 +205,16 @@ mock.onPost(new RegExp(/^\/msgopenaccesses\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/
return [status, data]; return [status, data];
}); });
// Save // Update
mock.onPost(new RegExp(/^\/msgopenaccesses\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => { mock.onPut(new RegExp(/^\/msgopenaccesses\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:msgopenaccess 方法: Save"); console.groupCollapsed("实体:msgopenaccess 方法: Update");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id']; const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/msgopenaccesses\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url); const matchArray:any = new RegExp(/^\/msgopenaccesses\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -322,10 +294,38 @@ mock.onGet(new RegExp(/^\/msgopenaccesses\/fetchdefault(\?[\w-./?%&=,]*)*$/)).re ...@@ -322,10 +294,38 @@ mock.onGet(new RegExp(/^\/msgopenaccesses\/fetchdefault(\?[\w-./?%&=,]*)*$/)).re
// URI参数传递情况未实现 // URI参数传递情况未实现
// URI参数传递情况未实现 // URI参数传递情况未实现
// Select
mock.onGet(new RegExp(/^\/msgopenaccesses\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:msgopenaccess 方法: 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> = ['id'];
const matchArray:any = new RegExp(/^\/msgopenaccesses\/([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.id, tempValue.id));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items);
console.groupEnd();
console.groupEnd();
return [status, _items];
});
// Remove // Get
mock.onDelete(new RegExp(/^\/msgopenaccesses\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/msgopenaccesses\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:msgopenaccess 方法: Remove"); console.groupCollapsed("实体:msgopenaccess 方法: Get");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
...@@ -351,9 +351,9 @@ mock.onDelete(new RegExp(/^\/msgopenaccesses\/([a-zA-Z0-9\-\;]{1,35})$/)).reply( ...@@ -351,9 +351,9 @@ mock.onDelete(new RegExp(/^\/msgopenaccesses\/([a-zA-Z0-9\-\;]{1,35})$/)).reply(
return [status, _items?_items:{}]; return [status, _items?_items:{}];
}); });
// Get // Remove
mock.onGet(new RegExp(/^\/msgopenaccesses\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onDelete(new RegExp(/^\/msgopenaccesses\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:msgopenaccess 方法: Get"); console.groupCollapsed("实体:msgopenaccess 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
......
...@@ -87,16 +87,16 @@ mock.onDelete(new RegExp(/^\/msgtemplates\/batch$/)).reply((config: any) => { ...@@ -87,16 +87,16 @@ mock.onDelete(new RegExp(/^\/msgtemplates\/batch$/)).reply((config: any) => {
}); });
// Select // CheckKey
mock.onGet(new RegExp(/^\/msgtemplates\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/msgtemplates\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:msgtemplate 方法: Select"); console.groupCollapsed("实体:msgtemplate 方法: CheckKey");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['tid']; const paramArray:Array<any> = ['tid'];
const matchArray:any = new RegExp(/^\/msgtemplates\/([a-zA-Z0-9\-\;]{1,35})\/select$/).exec(config.url); const matchArray:any = new RegExp(/^\/msgtemplates\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -106,13 +106,23 @@ mock.onGet(new RegExp(/^\/msgtemplates\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).repl ...@@ -106,13 +106,23 @@ mock.onGet(new RegExp(/^\/msgtemplates\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).repl
}); });
}); });
} }
let items = mockDatas ? mockDatas : []; //let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.tid, tempValue.tid)); //let _items = items.find((item: any) => Object.is(item.tid, tempValue.tid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['tid'] == tempValue['tid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: "); console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items); console.table(data);
console.groupEnd(); console.groupEnd();
console.groupEnd(); console.groupEnd();
return [status, _items]; return [status, data];
}); });
// Create // Create
...@@ -141,44 +151,6 @@ mock.onPost(new RegExp(/^\/msgtemplates\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((con ...@@ -141,44 +151,6 @@ mock.onPost(new RegExp(/^\/msgtemplates\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((con
return [status, mockDatas[0]]; return [status, mockDatas[0]];
}); });
// Update
mock.onPut(new RegExp(/^\/msgtemplates\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:msgtemplate 方法: 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> = ['tid'];
const matchArray:any = new RegExp(/^\/msgtemplates\/([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.tid, tempValue.tid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['tid'] == tempValue['tid'] ){
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 // GetDraft
mock.onGet(new RegExp(/^\/msgtemplates\/getdraft$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/msgtemplates\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:msgtemplate 方法: GetDraft"); console.groupCollapsed("实体:msgtemplate 方法: GetDraft");
...@@ -195,16 +167,16 @@ mock.onGet(new RegExp(/^\/msgtemplates\/getdraft$/)).reply((config: any) => { ...@@ -195,16 +167,16 @@ mock.onGet(new RegExp(/^\/msgtemplates\/getdraft$/)).reply((config: any) => {
return [status, {}]; return [status, {}];
}); });
// CheckKey // Save
mock.onPost(new RegExp(/^\/msgtemplates\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/msgtemplates\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:msgtemplate 方法: CheckKey"); console.groupCollapsed("实体:msgtemplate 方法: Save");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['tid']; const paramArray:Array<any> = ['tid'];
const matchArray:any = new RegExp(/^\/msgtemplates\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url); const matchArray:any = new RegExp(/^\/msgtemplates\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -233,16 +205,16 @@ mock.onPost(new RegExp(/^\/msgtemplates\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)). ...@@ -233,16 +205,16 @@ mock.onPost(new RegExp(/^\/msgtemplates\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).
return [status, data]; return [status, data];
}); });
// Save // Update
mock.onPost(new RegExp(/^\/msgtemplates\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => { mock.onPut(new RegExp(/^\/msgtemplates\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:msgtemplate 方法: Save"); console.groupCollapsed("实体:msgtemplate 方法: Update");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['tid']; const paramArray:Array<any> = ['tid'];
const matchArray:any = new RegExp(/^\/msgtemplates\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url); const matchArray:any = new RegExp(/^\/msgtemplates\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -322,10 +294,38 @@ mock.onGet(new RegExp(/^\/msgtemplates\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply ...@@ -322,10 +294,38 @@ mock.onGet(new RegExp(/^\/msgtemplates\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply
// URI参数传递情况未实现 // URI参数传递情况未实现
// URI参数传递情况未实现 // URI参数传递情况未实现
// Select
mock.onGet(new RegExp(/^\/msgtemplates\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:msgtemplate 方法: 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> = ['tid'];
const matchArray:any = new RegExp(/^\/msgtemplates\/([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.tid, tempValue.tid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items);
console.groupEnd();
console.groupEnd();
return [status, _items];
});
// Remove // Get
mock.onDelete(new RegExp(/^\/msgtemplates\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/msgtemplates\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:msgtemplate 方法: Remove"); console.groupCollapsed("实体:msgtemplate 方法: Get");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
...@@ -351,9 +351,9 @@ mock.onDelete(new RegExp(/^\/msgtemplates\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((co ...@@ -351,9 +351,9 @@ mock.onDelete(new RegExp(/^\/msgtemplates\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((co
return [status, _items?_items:{}]; return [status, _items?_items:{}];
}); });
// Get // Remove
mock.onGet(new RegExp(/^\/msgtemplates\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onDelete(new RegExp(/^\/msgtemplates\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:msgtemplate 方法: Get"); console.groupCollapsed("实体:msgtemplate 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
......
...@@ -87,16 +87,16 @@ mock.onDelete(new RegExp(/^\/msguseraccounts\/batch$/)).reply((config: any) => { ...@@ -87,16 +87,16 @@ mock.onDelete(new RegExp(/^\/msguseraccounts\/batch$/)).reply((config: any) => {
}); });
// Select // CheckKey
mock.onGet(new RegExp(/^\/msguseraccounts\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/msguseraccounts\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:msguseraccount 方法: Select"); console.groupCollapsed("实体:msguseraccount 方法: CheckKey");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id']; const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/msguseraccounts\/([a-zA-Z0-9\-\;]{1,35})\/select$/).exec(config.url); const matchArray:any = new RegExp(/^\/msguseraccounts\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -106,13 +106,23 @@ mock.onGet(new RegExp(/^\/msguseraccounts\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).r ...@@ -106,13 +106,23 @@ mock.onGet(new RegExp(/^\/msguseraccounts\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).r
}); });
}); });
} }
let items = mockDatas ? mockDatas : []; //let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.id, tempValue.id)); //let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: "); console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items); console.table(data);
console.groupEnd(); console.groupEnd();
console.groupEnd(); console.groupEnd();
return [status, _items]; return [status, data];
}); });
// Create // Create
...@@ -141,44 +151,6 @@ mock.onPost(new RegExp(/^\/msguseraccounts\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply(( ...@@ -141,44 +151,6 @@ mock.onPost(new RegExp(/^\/msguseraccounts\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((
return [status, mockDatas[0]]; return [status, mockDatas[0]];
}); });
// Update
mock.onPut(new RegExp(/^\/msguseraccounts\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:msguseraccount 方法: 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> = ['id'];
const matchArray:any = new RegExp(/^\/msguseraccounts\/([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.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
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 // GetDraft
mock.onGet(new RegExp(/^\/msguseraccounts\/getdraft$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/msguseraccounts\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:msguseraccount 方法: GetDraft"); console.groupCollapsed("实体:msguseraccount 方法: GetDraft");
...@@ -195,16 +167,16 @@ mock.onGet(new RegExp(/^\/msguseraccounts\/getdraft$/)).reply((config: any) => { ...@@ -195,16 +167,16 @@ mock.onGet(new RegExp(/^\/msguseraccounts\/getdraft$/)).reply((config: any) => {
return [status, {}]; return [status, {}];
}); });
// CheckKey // Save
mock.onPost(new RegExp(/^\/msguseraccounts\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/msguseraccounts\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:msguseraccount 方法: CheckKey"); console.groupCollapsed("实体:msguseraccount 方法: Save");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id']; const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/msguseraccounts\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url); const matchArray:any = new RegExp(/^\/msguseraccounts\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -233,16 +205,16 @@ mock.onPost(new RegExp(/^\/msguseraccounts\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/ ...@@ -233,16 +205,16 @@ mock.onPost(new RegExp(/^\/msguseraccounts\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/
return [status, data]; return [status, data];
}); });
// Save // Update
mock.onPost(new RegExp(/^\/msguseraccounts\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => { mock.onPut(new RegExp(/^\/msguseraccounts\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:msguseraccount 方法: Save"); console.groupCollapsed("实体:msguseraccount 方法: Update");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id']; const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/msguseraccounts\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url); const matchArray:any = new RegExp(/^\/msguseraccounts\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -322,10 +294,38 @@ mock.onGet(new RegExp(/^\/msguseraccounts\/fetchdefault(\?[\w-./?%&=,]*)*$/)).re ...@@ -322,10 +294,38 @@ mock.onGet(new RegExp(/^\/msguseraccounts\/fetchdefault(\?[\w-./?%&=,]*)*$/)).re
// URI参数传递情况未实现 // URI参数传递情况未实现
// URI参数传递情况未实现 // URI参数传递情况未实现
// Select
mock.onGet(new RegExp(/^\/msguseraccounts\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:msguseraccount 方法: 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> = ['id'];
const matchArray:any = new RegExp(/^\/msguseraccounts\/([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.id, tempValue.id));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items);
console.groupEnd();
console.groupEnd();
return [status, _items];
});
// Remove // Get
mock.onDelete(new RegExp(/^\/msguseraccounts\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/msguseraccounts\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:msguseraccount 方法: Remove"); console.groupCollapsed("实体:msguseraccount 方法: Get");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
...@@ -351,9 +351,9 @@ mock.onDelete(new RegExp(/^\/msguseraccounts\/([a-zA-Z0-9\-\;]{1,35})$/)).reply( ...@@ -351,9 +351,9 @@ mock.onDelete(new RegExp(/^\/msguseraccounts\/([a-zA-Z0-9\-\;]{1,35})$/)).reply(
return [status, _items?_items:{}]; return [status, _items?_items:{}];
}); });
// Get // Remove
mock.onGet(new RegExp(/^\/msguseraccounts\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onDelete(new RegExp(/^\/msguseraccounts\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:msguseraccount 方法: Get"); console.groupCollapsed("实体:msguseraccount 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
......
...@@ -87,16 +87,16 @@ mock.onDelete(new RegExp(/^\/payopenaccesses\/batch$/)).reply((config: any) => { ...@@ -87,16 +87,16 @@ mock.onDelete(new RegExp(/^\/payopenaccesses\/batch$/)).reply((config: any) => {
}); });
// Select // CheckKey
mock.onGet(new RegExp(/^\/payopenaccesses\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/payopenaccesses\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:payopenaccess 方法: Select"); console.groupCollapsed("实体:payopenaccess 方法: CheckKey");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id']; const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/payopenaccesses\/([a-zA-Z0-9\-\;]{1,35})\/select$/).exec(config.url); const matchArray:any = new RegExp(/^\/payopenaccesses\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -106,13 +106,23 @@ mock.onGet(new RegExp(/^\/payopenaccesses\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).r ...@@ -106,13 +106,23 @@ mock.onGet(new RegExp(/^\/payopenaccesses\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).r
}); });
}); });
} }
let items = mockDatas ? mockDatas : []; //let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.id, tempValue.id)); //let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: "); console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items); console.table(data);
console.groupEnd(); console.groupEnd();
console.groupEnd(); console.groupEnd();
return [status, _items]; return [status, data];
}); });
// Create // Create
...@@ -141,44 +151,6 @@ mock.onPost(new RegExp(/^\/payopenaccesses\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply(( ...@@ -141,44 +151,6 @@ mock.onPost(new RegExp(/^\/payopenaccesses\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((
return [status, mockDatas[0]]; return [status, mockDatas[0]];
}); });
// Update
mock.onPut(new RegExp(/^\/payopenaccesses\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:payopenaccess 方法: 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> = ['id'];
const matchArray:any = new RegExp(/^\/payopenaccesses\/([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.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
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 // GetDraft
mock.onGet(new RegExp(/^\/payopenaccesses\/getdraft$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/payopenaccesses\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:payopenaccess 方法: GetDraft"); console.groupCollapsed("实体:payopenaccess 方法: GetDraft");
...@@ -195,16 +167,16 @@ mock.onGet(new RegExp(/^\/payopenaccesses\/getdraft$/)).reply((config: any) => { ...@@ -195,16 +167,16 @@ mock.onGet(new RegExp(/^\/payopenaccesses\/getdraft$/)).reply((config: any) => {
return [status, {}]; return [status, {}];
}); });
// CheckKey // Save
mock.onPost(new RegExp(/^\/payopenaccesses\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/payopenaccesses\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:payopenaccess 方法: CheckKey"); console.groupCollapsed("实体:payopenaccess 方法: Save");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id']; const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/payopenaccesses\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url); const matchArray:any = new RegExp(/^\/payopenaccesses\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -233,16 +205,16 @@ mock.onPost(new RegExp(/^\/payopenaccesses\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/ ...@@ -233,16 +205,16 @@ mock.onPost(new RegExp(/^\/payopenaccesses\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/
return [status, data]; return [status, data];
}); });
// Save // Update
mock.onPost(new RegExp(/^\/payopenaccesses\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => { mock.onPut(new RegExp(/^\/payopenaccesses\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:payopenaccess 方法: Save"); console.groupCollapsed("实体:payopenaccess 方法: Update");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id']; const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/payopenaccesses\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url); const matchArray:any = new RegExp(/^\/payopenaccesses\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -322,10 +294,38 @@ mock.onGet(new RegExp(/^\/payopenaccesses\/fetchdefault(\?[\w-./?%&=,]*)*$/)).re ...@@ -322,10 +294,38 @@ mock.onGet(new RegExp(/^\/payopenaccesses\/fetchdefault(\?[\w-./?%&=,]*)*$/)).re
// URI参数传递情况未实现 // URI参数传递情况未实现
// URI参数传递情况未实现 // URI参数传递情况未实现
// Select
mock.onGet(new RegExp(/^\/payopenaccesses\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:payopenaccess 方法: 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> = ['id'];
const matchArray:any = new RegExp(/^\/payopenaccesses\/([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.id, tempValue.id));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items);
console.groupEnd();
console.groupEnd();
return [status, _items];
});
// Remove // Get
mock.onDelete(new RegExp(/^\/payopenaccesses\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/payopenaccesses\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:payopenaccess 方法: Remove"); console.groupCollapsed("实体:payopenaccess 方法: Get");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
...@@ -351,9 +351,9 @@ mock.onDelete(new RegExp(/^\/payopenaccesses\/([a-zA-Z0-9\-\;]{1,35})$/)).reply( ...@@ -351,9 +351,9 @@ mock.onDelete(new RegExp(/^\/payopenaccesses\/([a-zA-Z0-9\-\;]{1,35})$/)).reply(
return [status, _items?_items:{}]; return [status, _items?_items:{}];
}); });
// Get // Remove
mock.onGet(new RegExp(/^\/payopenaccesses\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onDelete(new RegExp(/^\/payopenaccesses\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:payopenaccess 方法: Get"); console.groupCollapsed("实体:payopenaccess 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
......
...@@ -87,16 +87,16 @@ mock.onDelete(new RegExp(/^\/paytrades\/batch$/)).reply((config: any) => { ...@@ -87,16 +87,16 @@ mock.onDelete(new RegExp(/^\/paytrades\/batch$/)).reply((config: any) => {
}); });
// Select // CheckKey
mock.onGet(new RegExp(/^\/paytrades\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/paytrades\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:paytrade 方法: Select"); console.groupCollapsed("实体:paytrade 方法: CheckKey");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['trade_id']; const paramArray:Array<any> = ['trade_id'];
const matchArray:any = new RegExp(/^\/paytrades\/([a-zA-Z0-9\-\;]{1,35})\/select$/).exec(config.url); const matchArray:any = new RegExp(/^\/paytrades\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -106,13 +106,23 @@ mock.onGet(new RegExp(/^\/paytrades\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply(( ...@@ -106,13 +106,23 @@ mock.onGet(new RegExp(/^\/paytrades\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((
}); });
}); });
} }
let items = mockDatas ? mockDatas : []; //let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.trade_id, tempValue.trade_id)); //let _items = items.find((item: any) => Object.is(item.trade_id, tempValue.trade_id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['trade_id'] == tempValue['trade_id'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: "); console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items); console.table(data);
console.groupEnd(); console.groupEnd();
console.groupEnd(); console.groupEnd();
return [status, _items]; return [status, data];
}); });
// Create // Create
...@@ -141,44 +151,6 @@ mock.onPost(new RegExp(/^\/paytrades\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config ...@@ -141,44 +151,6 @@ mock.onPost(new RegExp(/^\/paytrades\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config
return [status, mockDatas[0]]; return [status, mockDatas[0]];
}); });
// Update
mock.onPut(new RegExp(/^\/paytrades\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:paytrade 方法: 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> = ['trade_id'];
const matchArray:any = new RegExp(/^\/paytrades\/([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.trade_id, tempValue.trade_id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['trade_id'] == tempValue['trade_id'] ){
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 // GetDraft
mock.onGet(new RegExp(/^\/paytrades\/getdraft$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/paytrades\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:paytrade 方法: GetDraft"); console.groupCollapsed("实体:paytrade 方法: GetDraft");
...@@ -195,16 +167,16 @@ mock.onGet(new RegExp(/^\/paytrades\/getdraft$/)).reply((config: any) => { ...@@ -195,16 +167,16 @@ mock.onGet(new RegExp(/^\/paytrades\/getdraft$/)).reply((config: any) => {
return [status, {}]; return [status, {}];
}); });
// CheckKey // Save
mock.onPost(new RegExp(/^\/paytrades\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/paytrades\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:paytrade 方法: CheckKey"); console.groupCollapsed("实体:paytrade 方法: Save");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['trade_id']; const paramArray:Array<any> = ['trade_id'];
const matchArray:any = new RegExp(/^\/paytrades\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url); const matchArray:any = new RegExp(/^\/paytrades\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -233,16 +205,16 @@ mock.onPost(new RegExp(/^\/paytrades\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).rep ...@@ -233,16 +205,16 @@ mock.onPost(new RegExp(/^\/paytrades\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).rep
return [status, data]; return [status, data];
}); });
// Save // Update
mock.onPost(new RegExp(/^\/paytrades\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => { mock.onPut(new RegExp(/^\/paytrades\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:paytrade 方法: Save"); console.groupCollapsed("实体:paytrade 方法: Update");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['trade_id']; const paramArray:Array<any> = ['trade_id'];
const matchArray:any = new RegExp(/^\/paytrades\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url); const matchArray:any = new RegExp(/^\/paytrades\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -322,10 +294,38 @@ mock.onGet(new RegExp(/^\/paytrades\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((c ...@@ -322,10 +294,38 @@ mock.onGet(new RegExp(/^\/paytrades\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((c
// URI参数传递情况未实现 // URI参数传递情况未实现
// URI参数传递情况未实现 // URI参数传递情况未实现
// Select
mock.onGet(new RegExp(/^\/paytrades\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:paytrade 方法: 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> = ['trade_id'];
const matchArray:any = new RegExp(/^\/paytrades\/([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.trade_id, tempValue.trade_id));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items);
console.groupEnd();
console.groupEnd();
return [status, _items];
});
// Remove // Get
mock.onDelete(new RegExp(/^\/paytrades\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/paytrades\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:paytrade 方法: Remove"); console.groupCollapsed("实体:paytrade 方法: Get");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
...@@ -351,9 +351,9 @@ mock.onDelete(new RegExp(/^\/paytrades\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((confi ...@@ -351,9 +351,9 @@ mock.onDelete(new RegExp(/^\/paytrades\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((confi
return [status, _items?_items:{}]; return [status, _items?_items:{}];
}); });
// Get // Remove
mock.onGet(new RegExp(/^\/paytrades\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onDelete(new RegExp(/^\/paytrades\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:paytrade 方法: Get"); console.groupCollapsed("实体:paytrade 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
......
...@@ -87,16 +87,16 @@ mock.onDelete(new RegExp(/^\/sysapps\/batch$/)).reply((config: any) => { ...@@ -87,16 +87,16 @@ mock.onDelete(new RegExp(/^\/sysapps\/batch$/)).reply((config: any) => {
}); });
// Select // CheckKey
mock.onGet(new RegExp(/^\/sysapps\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/sysapps\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:sysapp 方法: Select"); console.groupCollapsed("实体:sysapp 方法: CheckKey");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id']; const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/sysapps\/([a-zA-Z0-9\-\;]{1,35})\/select$/).exec(config.url); const matchArray:any = new RegExp(/^\/sysapps\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -106,13 +106,23 @@ mock.onGet(new RegExp(/^\/sysapps\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((co ...@@ -106,13 +106,23 @@ mock.onGet(new RegExp(/^\/sysapps\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((co
}); });
}); });
} }
let items = mockDatas ? mockDatas : []; //let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.id, tempValue.id)); //let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: "); console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items); console.table(data);
console.groupEnd(); console.groupEnd();
console.groupEnd(); console.groupEnd();
return [status, _items]; return [status, data];
}); });
// Create // Create
...@@ -141,44 +151,6 @@ mock.onPost(new RegExp(/^\/sysapps\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: ...@@ -141,44 +151,6 @@ mock.onPost(new RegExp(/^\/sysapps\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config:
return [status, mockDatas[0]]; return [status, mockDatas[0]];
}); });
// Update
mock.onPut(new RegExp(/^\/sysapps\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysapp 方法: 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> = ['id'];
const matchArray:any = new RegExp(/^\/sysapps\/([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.id, tempValue.id));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['id'] == tempValue['id'] ){
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 // GetDraft
mock.onGet(new RegExp(/^\/sysapps\/getdraft$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/sysapps\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:sysapp 方法: GetDraft"); console.groupCollapsed("实体:sysapp 方法: GetDraft");
...@@ -195,16 +167,16 @@ mock.onGet(new RegExp(/^\/sysapps\/getdraft$/)).reply((config: any) => { ...@@ -195,16 +167,16 @@ mock.onGet(new RegExp(/^\/sysapps\/getdraft$/)).reply((config: any) => {
return [status, {}]; return [status, {}];
}); });
// CheckKey // Save
mock.onPost(new RegExp(/^\/sysapps\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/sysapps\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:sysapp 方法: CheckKey"); console.groupCollapsed("实体:sysapp 方法: Save");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id']; const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/sysapps\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url); const matchArray:any = new RegExp(/^\/sysapps\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -233,16 +205,16 @@ mock.onPost(new RegExp(/^\/sysapps\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply ...@@ -233,16 +205,16 @@ mock.onPost(new RegExp(/^\/sysapps\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply
return [status, data]; return [status, data];
}); });
// Save // Update
mock.onPost(new RegExp(/^\/sysapps\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => { mock.onPut(new RegExp(/^\/sysapps\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysapp 方法: Save"); console.groupCollapsed("实体:sysapp 方法: Update");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id']; const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/sysapps\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url); const matchArray:any = new RegExp(/^\/sysapps\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -322,10 +294,38 @@ mock.onGet(new RegExp(/^\/sysapps\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((con ...@@ -322,10 +294,38 @@ mock.onGet(new RegExp(/^\/sysapps\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((con
// URI参数传递情况未实现 // URI参数传递情况未实现
// URI参数传递情况未实现 // URI参数传递情况未实现
// Select
mock.onGet(new RegExp(/^\/sysapps\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:sysapp 方法: 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> = ['id'];
const matchArray:any = new RegExp(/^\/sysapps\/([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.id, tempValue.id));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items);
console.groupEnd();
console.groupEnd();
return [status, _items];
});
// Remove // Get
mock.onDelete(new RegExp(/^\/sysapps\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/sysapps\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysapp 方法: Remove"); console.groupCollapsed("实体:sysapp 方法: Get");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
...@@ -351,9 +351,9 @@ mock.onDelete(new RegExp(/^\/sysapps\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: ...@@ -351,9 +351,9 @@ mock.onDelete(new RegExp(/^\/sysapps\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config:
return [status, _items?_items:{}]; return [status, _items?_items:{}];
}); });
// Get // Remove
mock.onGet(new RegExp(/^\/sysapps\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onDelete(new RegExp(/^\/sysapps\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysapp 方法: Get"); console.groupCollapsed("实体:sysapp 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
......
...@@ -87,16 +87,16 @@ mock.onDelete(new RegExp(/^\/sysauthlogs\/batch$/)).reply((config: any) => { ...@@ -87,16 +87,16 @@ mock.onDelete(new RegExp(/^\/sysauthlogs\/batch$/)).reply((config: any) => {
}); });
// Select // CheckKey
mock.onGet(new RegExp(/^\/sysauthlogs\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/sysauthlogs\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:sysauthlog 方法: Select"); console.groupCollapsed("实体:sysauthlog 方法: CheckKey");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['logid']; const paramArray:Array<any> = ['logid'];
const matchArray:any = new RegExp(/^\/sysauthlogs\/([a-zA-Z0-9\-\;]{1,35})\/select$/).exec(config.url); const matchArray:any = new RegExp(/^\/sysauthlogs\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -106,13 +106,23 @@ mock.onGet(new RegExp(/^\/sysauthlogs\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply ...@@ -106,13 +106,23 @@ mock.onGet(new RegExp(/^\/sysauthlogs\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply
}); });
}); });
} }
let items = mockDatas ? mockDatas : []; //let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.logid, tempValue.logid)); //let _items = items.find((item: any) => Object.is(item.logid, tempValue.logid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['logid'] == tempValue['logid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: "); console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items); console.table(data);
console.groupEnd(); console.groupEnd();
console.groupEnd(); console.groupEnd();
return [status, _items]; return [status, data];
}); });
// Create // Create
...@@ -141,44 +151,6 @@ mock.onPost(new RegExp(/^\/sysauthlogs\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((conf ...@@ -141,44 +151,6 @@ mock.onPost(new RegExp(/^\/sysauthlogs\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((conf
return [status, mockDatas[0]]; return [status, mockDatas[0]];
}); });
// Update
mock.onPut(new RegExp(/^\/sysauthlogs\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysauthlog 方法: 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> = ['logid'];
const matchArray:any = new RegExp(/^\/sysauthlogs\/([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.logid, tempValue.logid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['logid'] == tempValue['logid'] ){
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 // GetDraft
mock.onGet(new RegExp(/^\/sysauthlogs\/getdraft$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/sysauthlogs\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:sysauthlog 方法: GetDraft"); console.groupCollapsed("实体:sysauthlog 方法: GetDraft");
...@@ -195,16 +167,16 @@ mock.onGet(new RegExp(/^\/sysauthlogs\/getdraft$/)).reply((config: any) => { ...@@ -195,16 +167,16 @@ mock.onGet(new RegExp(/^\/sysauthlogs\/getdraft$/)).reply((config: any) => {
return [status, {}]; return [status, {}];
}); });
// CheckKey // Save
mock.onPost(new RegExp(/^\/sysauthlogs\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/sysauthlogs\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:sysauthlog 方法: CheckKey"); console.groupCollapsed("实体:sysauthlog 方法: Save");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['logid']; const paramArray:Array<any> = ['logid'];
const matchArray:any = new RegExp(/^\/sysauthlogs\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url); const matchArray:any = new RegExp(/^\/sysauthlogs\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -233,16 +205,16 @@ mock.onPost(new RegExp(/^\/sysauthlogs\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).r ...@@ -233,16 +205,16 @@ mock.onPost(new RegExp(/^\/sysauthlogs\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).r
return [status, data]; return [status, data];
}); });
// Save // Update
mock.onPost(new RegExp(/^\/sysauthlogs\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => { mock.onPut(new RegExp(/^\/sysauthlogs\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysauthlog 方法: Save"); console.groupCollapsed("实体:sysauthlog 方法: Update");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['logid']; const paramArray:Array<any> = ['logid'];
const matchArray:any = new RegExp(/^\/sysauthlogs\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url); const matchArray:any = new RegExp(/^\/sysauthlogs\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){ if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => { paramArray.forEach((item: any, index: number) => {
...@@ -322,10 +294,38 @@ mock.onGet(new RegExp(/^\/sysauthlogs\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply( ...@@ -322,10 +294,38 @@ mock.onGet(new RegExp(/^\/sysauthlogs\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply(
// URI参数传递情况未实现 // URI参数传递情况未实现
// URI参数传递情况未实现 // URI参数传递情况未实现
// Select
mock.onGet(new RegExp(/^\/sysauthlogs\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:sysauthlog 方法: 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> = ['logid'];
const matchArray:any = new RegExp(/^\/sysauthlogs\/([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.logid, tempValue.logid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items);
console.groupEnd();
console.groupEnd();
return [status, _items];
});
// Remove // Get
mock.onDelete(new RegExp(/^\/sysauthlogs\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/sysauthlogs\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysauthlog 方法: Remove"); console.groupCollapsed("实体:sysauthlog 方法: Get");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
...@@ -351,9 +351,9 @@ mock.onDelete(new RegExp(/^\/sysauthlogs\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((con ...@@ -351,9 +351,9 @@ mock.onDelete(new RegExp(/^\/sysauthlogs\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((con
return [status, _items?_items:{}]; return [status, _items?_items:{}];
}); });
// Get // Remove
mock.onGet(new RegExp(/^\/sysauthlogs\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onDelete(new RegExp(/^\/sysauthlogs\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysauthlog 方法: Get"); console.groupCollapsed("实体:sysauthlog 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
......
...@@ -843,7 +843,7 @@ export default class SysDepartmentMPickupViewBase extends Vue { ...@@ -843,7 +843,7 @@ export default class SysDepartmentMPickupViewBase extends Vue {
} }
if(model.datas.length>0){ if(model.datas.length>0){
model.datas.forEach((data:any,index:any)=>{ model.datas.forEach((data:any,index:any)=>{
Object.assign(data,{srfmajortext: data['deptname']}); Object.assign(data,{srfmajortext: data.hasOwnProperty('srfmajortext') ? data['srfmajortext'] : data['deptname']});
}) })
} }
model.datas.forEach((item: any) => { model.datas.forEach((item: any) => {
......
...@@ -884,6 +884,8 @@ export default class SysDeptMemberGridViewBase extends Vue { ...@@ -884,6 +884,8 @@ export default class SysDeptMemberGridViewBase extends Vue {
public newdata(args: any[],fullargs?:any[], params?: any, $event?: any, xData?: any) { public newdata(args: any[],fullargs?:any[], params?: any, $event?: any, xData?: any) {
let localContext:any = null; let localContext:any = null;
let localViewParam:any =null; let localViewParam:any =null;
let tempContext:any = this.$util.deepCopy(this.context);
let data:any = this.$util.deepCopy(args[0]);
let batchAddPSAppViews:Array<any>=[]; let batchAddPSAppViews:Array<any>=[];
batchAddPSAppViews=[ batchAddPSAppViews=[
{view:{viewname:'sys-employee-mpickup-view',height: 0,width: 0,title: '人员数据多项选择视图'}, {view:{viewname:'sys-employee-mpickup-view',height: 0,width: 0,title: '人员数据多项选择视图'},
...@@ -903,7 +905,7 @@ export default class SysDeptMemberGridViewBase extends Vue { ...@@ -903,7 +905,7 @@ export default class SysDeptMemberGridViewBase extends Vue {
let otherViewModel:any = batchAddPSAppViews.find((item:any) =>{ let otherViewModel:any = batchAddPSAppViews.find((item:any) =>{
return (item.res && (item.res[0] == this.context.srfparentdename)); return (item.res && (item.res[0] == this.context.srfparentdename));
}) })
let container: Subject<any> = this.$appmodal.openModal(openViewModel.view, JSON.parse(JSON.stringify(this.context)), args[0]); let container: Subject<any> = this.$appmodal.openModal(openViewModel.view, tempContext, data);
container.subscribe((result: any) => { container.subscribe((result: any) => {
if (!result || !Object.is(result.ret, 'OK')) { if (!result || !Object.is(result.ret, 'OK')) {
return; return;
......
...@@ -843,7 +843,7 @@ export default class SysEmployeeMPickupViewBase extends Vue { ...@@ -843,7 +843,7 @@ export default class SysEmployeeMPickupViewBase extends Vue {
} }
if(model.datas.length>0){ if(model.datas.length>0){
model.datas.forEach((data:any,index:any)=>{ model.datas.forEach((data:any,index:any)=>{
Object.assign(data,{srfmajortext: data['personname']}); Object.assign(data,{srfmajortext: data.hasOwnProperty('srfmajortext') ? data['srfmajortext'] : data['personname']});
}) })
} }
model.datas.forEach((item: any) => { model.datas.forEach((item: any) => {
......
...@@ -843,7 +843,7 @@ export default class SysPermissionMPickupViewBase extends Vue { ...@@ -843,7 +843,7 @@ export default class SysPermissionMPickupViewBase extends Vue {
} }
if(model.datas.length>0){ if(model.datas.length>0){
model.datas.forEach((data:any,index:any)=>{ model.datas.forEach((data:any,index:any)=>{
Object.assign(data,{srfmajortext: data['permissionname']}); Object.assign(data,{srfmajortext: data.hasOwnProperty('srfmajortext') ? data['srfmajortext'] : data['permissionname']});
}) })
} }
model.datas.forEach((item: any) => { model.datas.forEach((item: any) => {
......
...@@ -843,7 +843,7 @@ export default class SysRoleMPickupViewBase extends Vue { ...@@ -843,7 +843,7 @@ export default class SysRoleMPickupViewBase extends Vue {
} }
if(model.datas.length>0){ if(model.datas.length>0){
model.datas.forEach((data:any,index:any)=>{ model.datas.forEach((data:any,index:any)=>{
Object.assign(data,{srfmajortext: data['rolename']}); Object.assign(data,{srfmajortext: data.hasOwnProperty('srfmajortext') ? data['srfmajortext'] : data['rolename']});
}) })
} }
model.datas.forEach((item: any) => { model.datas.forEach((item: any) => {
......
此差异已折叠。
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册