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

zhouweidong 发布系统代码 [ibz-wf,统一工作流]

上级 f648e17f
......@@ -13,7 +13,7 @@
<template v-else>
<i v-if="isFirst" class='fa fa-cogs app-menu-icon'></i>
</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>
<app-menu-item :isCollapse="isCollapse" :menus="item.items" :ctrlName="ctrlName" :isFirst="false" :counterdata="counterdata" :popper-class="popperClass"></app-menu-item>
</el-submenu>
......@@ -23,18 +23,18 @@
<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 != ''">
<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 v-else-if="item.iconcls && item.iconcls != ''">
<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 v-else>
<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 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">
<span class="pull-right">
<badge :count="counterdata[item.counterid]" :overflow-count="9999"></badge>
......
......@@ -8,7 +8,7 @@
<img :src="item.iconcls" v-else-if="!Object.is(item.iconcls, '')" />
<i class="fa fa-cogs" v-else></i>
</span>
<span>{{$t(`app.menus.${ctrlName}.${item.name}`)}}</span>
<span>{{$t(`app.menus.${ctrlName}.${item.name.toLowerCase()}`)}}</span>
<span class="line"></span>
</p>
<p style=" display: 'flex' ">
......@@ -37,7 +37,7 @@
<img :src="item.iconcls" v-else-if="!Object.is(item.iconcls, '')" />
<i class="fa fa-cogs" v-else></i>
</span>
<h4>{{$t(`app.menus.${ctrlName}.${item.name}`)}}</h4>
<h4>{{$t(`app.menus.${ctrlName}.${item.name.toLowerCase()}`)}}</h4>
</div>
</card>
</template>
......
......@@ -36,6 +36,8 @@ function getAppLocale(){
nomore:"དེ་ལས་མང་བ་མི་འདུག",
other:"གཞན་དག",
valueNotEmpty:"སྟོང་མི་ཆོག",
createFailed:"གསར་འཛུགས་ཕམ་པ།",
isExist:"གནས་པ་",
},
local:{
new: "གསར་འཛུགས།",
......
......@@ -36,6 +36,8 @@ function getAppLocale(){
nomore:"No more",
other:"other",
valueNotEmpty:"The value cannot be null",
createFailed:"Create Failed",
isExist:"Exist",
},
local:{
new: "New",
......
......@@ -36,6 +36,8 @@ function getAppLocale(){
nomore:"没有更多了",
other:"其他",
valueNotEmpty:"值不能为空",
createFailed:"创建失败",
isExist:"已存在",
},
local:{
new: "新建",
......
......@@ -86,17 +86,17 @@ mock.onDelete(new RegExp(/^\/wfgroups\/batch$/)).reply((config: any) => {
return [status, {}];
});
// Select
mock.onGet(new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:wfgroup 方法: Select");
// CheckKey
mock.onPost(new RegExp(/^\/wfgroups\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:wfgroup 方法: CheckKey");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/select$/).exec(config.url);
const matchArray:any = new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -106,13 +106,23 @@ mock.onGet(new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((c
});
});
}
let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
//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(_items);
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, _items];
return [status, data];
});
// Create
......@@ -140,44 +150,6 @@ mock.onPost(new RegExp(/^\/wfgroups\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config:
console.groupEnd();
return [status, mockDatas[0]];
});
// Update
mock.onPut(new RegExp(/^\/wfgroups\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfgroup 方法: 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(/^\/wfgroups\/([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
mock.onGet(new RegExp(/^\/wfgroups\/getdraft$/)).reply((config: any) => {
......@@ -195,16 +167,16 @@ mock.onGet(new RegExp(/^\/wfgroups\/getdraft$/)).reply((config: any) => {
return [status, {}];
});
// CheckKey
mock.onPost(new RegExp(/^\/wfgroups\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:wfgroup 方法: CheckKey");
// Save
mock.onPost(new RegExp(/^\/wfgroups\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:wfgroup 方法: Save");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
const matchArray:any = new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -233,16 +205,16 @@ mock.onPost(new RegExp(/^\/wfgroups\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).repl
return [status, data];
});
// Save
mock.onPost(new RegExp(/^\/wfgroups\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:wfgroup 方法: Save");
// Update
mock.onPut(new RegExp(/^\/wfgroups\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfgroup 方法: 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(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
const matchArray:any = new RegExp(/^\/wfgroups\/([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) => {
......@@ -322,10 +294,38 @@ mock.onGet(new RegExp(/^\/wfgroups\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((co
// URI参数传递情况未实现
// URI参数传递情况未实现
// Select
mock.onGet(new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:wfgroup 方法: 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(/^\/wfgroups\/([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
mock.onDelete(new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfgroup 方法: Remove");
// Get
mock.onGet(new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfgroup 方法: Get");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......@@ -351,9 +351,9 @@ mock.onDelete(new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config
return [status, _items?_items:{}];
});
// Get
mock.onGet(new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfgroup 方法: Get");
// Remove
mock.onDelete(new RegExp(/^\/wfgroups\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfgroup 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......
......@@ -86,17 +86,17 @@ mock.onDelete(new RegExp(/^\/wfprocessdefinitions\/batch$/)).reply((config: any)
return [status, {}];
});
// Select
mock.onGet(new RegExp(/^\/wfprocessdefinitions\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessdefinition 方法: Select");
// CheckKey
mock.onPost(new RegExp(/^\/wfprocessdefinitions\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessdefinition 方法: CheckKey");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['definitionkey'];
const matchArray:any = new RegExp(/^\/wfprocessdefinitions\/([a-zA-Z0-9\-\;]{1,35})\/select$/).exec(config.url);
const matchArray:any = new RegExp(/^\/wfprocessdefinitions\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -106,13 +106,23 @@ mock.onGet(new RegExp(/^\/wfprocessdefinitions\/([a-zA-Z0-9\-\;]{1,35})\/select$
});
});
}
let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.definitionkey, tempValue.definitionkey));
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.definitionkey, tempValue.definitionkey));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['definitionkey'] == tempValue['definitionkey'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items);
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, _items];
return [status, data];
});
// Create
......@@ -140,44 +150,6 @@ mock.onPost(new RegExp(/^\/wfprocessdefinitions\/?([a-zA-Z0-9\-\;]{0,35})$/)).re
console.groupEnd();
return [status, mockDatas[0]];
});
// Update
mock.onPut(new RegExp(/^\/wfprocessdefinitions\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessdefinition 方法: 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> = ['definitionkey'];
const matchArray:any = new RegExp(/^\/wfprocessdefinitions\/([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.definitionkey, tempValue.definitionkey));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['definitionkey'] == tempValue['definitionkey'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/wfprocessdefinitions\/getdraft$/)).reply((config: any) => {
......@@ -195,16 +167,16 @@ mock.onGet(new RegExp(/^\/wfprocessdefinitions\/getdraft$/)).reply((config: any)
return [status, {}];
});
// CheckKey
mock.onPost(new RegExp(/^\/wfprocessdefinitions\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessdefinition 方法: CheckKey");
// Save
mock.onPost(new RegExp(/^\/wfprocessdefinitions\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessdefinition 方法: Save");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['definitionkey'];
const matchArray:any = new RegExp(/^\/wfprocessdefinitions\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
const matchArray:any = new RegExp(/^\/wfprocessdefinitions\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -233,16 +205,16 @@ mock.onPost(new RegExp(/^\/wfprocessdefinitions\/?([a-zA-Z0-9\-\;]{0,35})\/check
return [status, data];
});
// Save
mock.onPost(new RegExp(/^\/wfprocessdefinitions\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessdefinition 方法: Save");
// Update
mock.onPut(new RegExp(/^\/wfprocessdefinitions\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessdefinition 方法: 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> = ['definitionkey'];
const matchArray:any = new RegExp(/^\/wfprocessdefinitions\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
const matchArray:any = new RegExp(/^\/wfprocessdefinitions\/([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) => {
......@@ -322,10 +294,38 @@ mock.onGet(new RegExp(/^\/wfprocessdefinitions\/fetchdefault(\?[\w-./?%&=,]*)*$/
// URI参数传递情况未实现
// URI参数传递情况未实现
// Select
mock.onGet(new RegExp(/^\/wfprocessdefinitions\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessdefinition 方法: 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> = ['definitionkey'];
const matchArray:any = new RegExp(/^\/wfprocessdefinitions\/([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.definitionkey, tempValue.definitionkey));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items);
console.groupEnd();
console.groupEnd();
return [status, _items];
});
// Remove
mock.onDelete(new RegExp(/^\/wfprocessdefinitions\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessdefinition 方法: Remove");
// Get
mock.onGet(new RegExp(/^\/wfprocessdefinitions\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessdefinition 方法: Get");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......@@ -351,9 +351,9 @@ mock.onDelete(new RegExp(/^\/wfprocessdefinitions\/([a-zA-Z0-9\-\;]{1,35})$/)).r
return [status, _items?_items:{}];
});
// Get
mock.onGet(new RegExp(/^\/wfprocessdefinitions\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessdefinition 方法: Get");
// Remove
mock.onDelete(new RegExp(/^\/wfprocessdefinitions\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfprocessdefinition 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......
......@@ -86,17 +86,17 @@ mock.onDelete(new RegExp(/^\/wfremodels\/batch$/)).reply((config: any) => {
return [status, {}];
});
// Select
mock.onGet(new RegExp(/^\/wfremodels\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:wfremodel 方法: Select");
// CheckKey
mock.onPost(new RegExp(/^\/wfremodels\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:wfremodel 方法: CheckKey");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/wfremodels\/([a-zA-Z0-9\-\;]{1,35})\/select$/).exec(config.url);
const matchArray:any = new RegExp(/^\/wfremodels\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -106,13 +106,23 @@ mock.onGet(new RegExp(/^\/wfremodels\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply(
});
});
}
let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
//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(_items);
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, _items];
return [status, data];
});
// Create
......@@ -140,44 +150,6 @@ mock.onPost(new RegExp(/^\/wfremodels\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((confi
console.groupEnd();
return [status, mockDatas[0]];
});
// Update
mock.onPut(new RegExp(/^\/wfremodels\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfremodel 方法: 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(/^\/wfremodels\/([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
mock.onGet(new RegExp(/^\/wfremodels\/getdraft$/)).reply((config: any) => {
......@@ -195,16 +167,16 @@ mock.onGet(new RegExp(/^\/wfremodels\/getdraft$/)).reply((config: any) => {
return [status, {}];
});
// CheckKey
mock.onPost(new RegExp(/^\/wfremodels\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:wfremodel 方法: CheckKey");
// Save
mock.onPost(new RegExp(/^\/wfremodels\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:wfremodel 方法: Save");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/wfremodels\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
const matchArray:any = new RegExp(/^\/wfremodels\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -233,16 +205,16 @@ mock.onPost(new RegExp(/^\/wfremodels\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).re
return [status, data];
});
// Save
mock.onPost(new RegExp(/^\/wfremodels\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:wfremodel 方法: Save");
// Update
mock.onPut(new RegExp(/^\/wfremodels\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfremodel 方法: 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(/^\/wfremodels\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
const matchArray:any = new RegExp(/^\/wfremodels\/([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) => {
......@@ -322,10 +294,38 @@ mock.onGet(new RegExp(/^\/wfremodels\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((
// URI参数传递情况未实现
// URI参数传递情况未实现
// Select
mock.onGet(new RegExp(/^\/wfremodels\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:wfremodel 方法: 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(/^\/wfremodels\/([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
mock.onDelete(new RegExp(/^\/wfremodels\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfremodel 方法: Remove");
// Get
mock.onGet(new RegExp(/^\/wfremodels\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfremodel 方法: Get");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......@@ -351,9 +351,9 @@ mock.onDelete(new RegExp(/^\/wfremodels\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((conf
return [status, _items?_items:{}];
});
// Get
mock.onGet(new RegExp(/^\/wfremodels\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfremodel 方法: Get");
// Remove
mock.onDelete(new RegExp(/^\/wfremodels\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfremodel 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......
......@@ -86,17 +86,17 @@ mock.onDelete(new RegExp(/^\/wfsystems\/batch$/)).reply((config: any) => {
return [status, {}];
});
// Select
mock.onGet(new RegExp(/^\/wfsystems\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:wfsystem 方法: Select");
// CheckKey
mock.onPost(new RegExp(/^\/wfsystems\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:wfsystem 方法: CheckKey");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['pssystemid'];
const matchArray:any = new RegExp(/^\/wfsystems\/([a-zA-Z0-9\-\;]{1,35})\/select$/).exec(config.url);
const matchArray:any = new RegExp(/^\/wfsystems\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -106,13 +106,23 @@ mock.onGet(new RegExp(/^\/wfsystems\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((
});
});
}
let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.pssystemid, tempValue.pssystemid));
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.pssystemid, tempValue.pssystemid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['pssystemid'] == tempValue['pssystemid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items);
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, _items];
return [status, data];
});
// Create
......@@ -140,44 +150,6 @@ mock.onPost(new RegExp(/^\/wfsystems\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config
console.groupEnd();
return [status, mockDatas[0]];
});
// Update
mock.onPut(new RegExp(/^\/wfsystems\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfsystem 方法: 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> = ['pssystemid'];
const matchArray:any = new RegExp(/^\/wfsystems\/([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.pssystemid, tempValue.pssystemid));
let data = JSON.parse(config.data);
mockDatas.forEach((item)=>{
if(item['pssystemid'] == tempValue['pssystemid'] ){
for(let value in data){
if(item.hasOwnProperty(value)){
item[value] = data[value];
}
}
}
})
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, data];
});
// GetDraft
mock.onGet(new RegExp(/^\/wfsystems\/getdraft$/)).reply((config: any) => {
......@@ -195,16 +167,16 @@ mock.onGet(new RegExp(/^\/wfsystems\/getdraft$/)).reply((config: any) => {
return [status, {}];
});
// CheckKey
mock.onPost(new RegExp(/^\/wfsystems\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:wfsystem 方法: CheckKey");
// Save
mock.onPost(new RegExp(/^\/wfsystems\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:wfsystem 方法: Save");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['pssystemid'];
const matchArray:any = new RegExp(/^\/wfsystems\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
const matchArray:any = new RegExp(/^\/wfsystems\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -233,16 +205,16 @@ mock.onPost(new RegExp(/^\/wfsystems\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).rep
return [status, data];
});
// Save
mock.onPost(new RegExp(/^\/wfsystems\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:wfsystem 方法: Save");
// Update
mock.onPut(new RegExp(/^\/wfsystems\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfsystem 方法: 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> = ['pssystemid'];
const matchArray:any = new RegExp(/^\/wfsystems\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
const matchArray:any = new RegExp(/^\/wfsystems\/([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) => {
......@@ -322,10 +294,38 @@ mock.onGet(new RegExp(/^\/wfsystems\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((c
// URI参数传递情况未实现
// URI参数传递情况未实现
// Select
mock.onGet(new RegExp(/^\/wfsystems\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:wfsystem 方法: 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> = ['pssystemid'];
const matchArray:any = new RegExp(/^\/wfsystems\/([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.pssystemid, tempValue.pssystemid));
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(_items);
console.groupEnd();
console.groupEnd();
return [status, _items];
});
// Remove
mock.onDelete(new RegExp(/^\/wfsystems\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfsystem 方法: Remove");
// Get
mock.onGet(new RegExp(/^\/wfsystems\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfsystem 方法: Get");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......@@ -351,9 +351,9 @@ mock.onDelete(new RegExp(/^\/wfsystems\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((confi
return [status, _items?_items:{}];
});
// Get
mock.onGet(new RegExp(/^\/wfsystems\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfsystem 方法: Get");
// Remove
mock.onDelete(new RegExp(/^\/wfsystems\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfsystem 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......
......@@ -86,17 +86,17 @@ mock.onDelete(new RegExp(/^\/wfusers\/batch$/)).reply((config: any) => {
return [status, {}];
});
// Select
mock.onGet(new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:wfuser 方法: Select");
// CheckKey
mock.onPost(new RegExp(/^\/wfusers\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:wfuser 方法: CheckKey");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/select$/).exec(config.url);
const matchArray:any = new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -106,13 +106,23 @@ mock.onGet(new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((co
});
});
}
let items = mockDatas ? mockDatas : [];
let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
//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(_items);
console.table(data);
console.groupEnd();
console.groupEnd();
return [status, _items];
return [status, data];
});
// Create
......@@ -140,44 +150,6 @@ mock.onPost(new RegExp(/^\/wfusers\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config:
console.groupEnd();
return [status, mockDatas[0]];
});
// Update
mock.onPut(new RegExp(/^\/wfusers\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfuser 方法: 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(/^\/wfusers\/([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
mock.onGet(new RegExp(/^\/wfusers\/getdraft$/)).reply((config: any) => {
......@@ -195,16 +167,16 @@ mock.onGet(new RegExp(/^\/wfusers\/getdraft$/)).reply((config: any) => {
return [status, {}];
});
// CheckKey
mock.onPost(new RegExp(/^\/wfusers\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:wfuser 方法: CheckKey");
// Save
mock.onPost(new RegExp(/^\/wfusers\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:wfuser 方法: Save");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
const matchArray:any = new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {};
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
......@@ -233,16 +205,16 @@ mock.onPost(new RegExp(/^\/wfusers\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply
return [status, data];
});
// Save
mock.onPost(new RegExp(/^\/wfusers\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:wfuser 方法: Save");
// Update
mock.onPut(new RegExp(/^\/wfusers\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfuser 方法: 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(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
const matchArray:any = new RegExp(/^\/wfusers\/([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) => {
......@@ -322,10 +294,38 @@ mock.onGet(new RegExp(/^\/wfusers\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((con
// URI参数传递情况未实现
// URI参数传递情况未实现
// Select
mock.onGet(new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((config: any) => {
console.groupCollapsed("实体:wfuser 方法: 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(/^\/wfusers\/([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
mock.onDelete(new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfuser 方法: Remove");
// Get
mock.onGet(new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfuser 方法: Get");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......@@ -351,9 +351,9 @@ mock.onDelete(new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config:
return [status, _items?_items:{}];
});
// Get
mock.onGet(new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfuser 方法: Get");
// Remove
mock.onDelete(new RegExp(/^\/wfusers\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:wfuser 方法: Remove");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
......
......@@ -843,7 +843,7 @@ export default class WFGroupMPickupViewBase extends Vue {
}
if(model.datas.length>0){
model.datas.forEach((data:any,index:any)=>{
Object.assign(data,{srfmajortext: data['name']});
Object.assign(data,{srfmajortext: data.hasOwnProperty('srfmajortext') ? data['srfmajortext'] : data['name']});
})
}
model.datas.forEach((item: any) => {
......
......@@ -1260,6 +1260,8 @@ export default class WFMemberGridViewBase extends Vue {
public newdata(args: any[],fullargs?:any[], params?: any, $event?: any, xData?: any) {
let localContext: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>=[];
batchAddPSAppViews=[
{view:{viewname:'wfgroup-mpickup-view',height: 0,width: 0,title: '角色/用户组数据多项选择视图'},
......@@ -1279,7 +1281,7 @@ export default class WFMemberGridViewBase extends Vue {
let otherViewModel:any = batchAddPSAppViews.find((item:any) =>{
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) => {
if (!result || !Object.is(result.ret, 'OK')) {
return;
......
......@@ -843,7 +843,7 @@ export default class WFUserMPickupViewBase extends Vue {
}
if(model.datas.length>0){
model.datas.forEach((data:any,index:any)=>{
Object.assign(data,{srfmajortext: data['displayname']});
Object.assign(data,{srfmajortext: data.hasOwnProperty('srfmajortext') ? data['srfmajortext'] : data['displayname']});
})
}
model.datas.forEach((item: any) => {
......
......@@ -39,7 +39,7 @@ export default class WFGroupServiceBase extends EntityService {
// 实体接口
/**
* Select接口方法
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -47,9 +47,8 @@ export default class WFGroupServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof WFGroupServiceBase
*/
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().get(`/wfgroups/${context.wfgroup}/select`,isloading);
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().post(`/wfgroups/${context.wfgroup}/checkkey`,data,isloading);
return res;
}
......@@ -78,37 +77,6 @@ export default class WFGroupServiceBase extends EntityService {
return res;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFGroupServiceBase
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/wfgroups/${context.wfgroup}`,data,isloading);
return res;
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFGroupServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().delete(`/wfgroups/${context.wfgroup}`,isloading);
return res;
}
/**
* Get接口方法
*
......@@ -141,7 +109,7 @@ export default class WFGroupServiceBase extends EntityService {
}
/**
* CheckKey接口方法
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -149,8 +117,8 @@ export default class WFGroupServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof WFGroupServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().post(`/wfgroups/${context.wfgroup}/checkkey`,data,isloading);
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().delete(`/wfgroups/${context.wfgroup}`,isloading);
return res;
}
......@@ -171,6 +139,23 @@ export default class WFGroupServiceBase extends EntityService {
return res;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFGroupServiceBase
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/wfgroups/${context.wfgroup}`,data,isloading);
return res;
}
/**
* FetchDefault接口方法
*
......@@ -199,4 +184,19 @@ export default class WFGroupServiceBase extends EntityService {
let tempData:any = JSON.parse(JSON.stringify(data));
return await Http.getInstance().post(`/wfgroups/searchdefault`,tempData,isloading);
}
/**
* Select接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFGroupServiceBase
*/
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().get(`/wfgroups/${context.wfgroup}/select`,isloading);
return res;
}
}
\ No newline at end of file
......@@ -39,7 +39,7 @@ export default class WFMemberServiceBase extends EntityService {
// 实体接口
/**
* Select接口方法
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -47,19 +47,22 @@ export default class WFMemberServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof WFMemberServiceBase
*/
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.wfuser && context.wfmember){
let res:any = Http.getInstance().get(`/wfusers/${context.wfuser}/wfmembers/${context.wfmember}/select`,isloading);
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/wfusers/${context.wfuser}/wfmembers/${context.wfmember}/checkkey`,data,isloading);
return res;
}
if(context.wfgroup && context.wfmember){
let res:any = Http.getInstance().get(`/wfgroups/${context.wfgroup}/wfmembers/${context.wfmember}/select`,isloading);
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/wfgroups/${context.wfgroup}/wfmembers/${context.wfmember}/checkkey`,data,isloading);
return res;
}
let res:any = Http.getInstance().get(`/wfmembers/${context.wfmember}/select`,isloading);
let res:any = Http.getInstance().post(`/wfmembers/${context.wfmember}/checkkey`,data,isloading);
return res;
}
......@@ -115,59 +118,6 @@ export default class WFMemberServiceBase extends EntityService {
return res;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFMemberServiceBase
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.wfuser && context.wfmember){
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/wfusers/${context.wfuser}/wfmembers/${context.wfmember}`,data,isloading);
return res;
}
if(context.wfgroup && context.wfmember){
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/wfgroups/${context.wfgroup}/wfmembers/${context.wfmember}`,data,isloading);
return res;
}
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/wfmembers/${context.wfmember}`,data,isloading);
return res;
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFMemberServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.wfuser && context.wfmember){
let res:any = Http.getInstance().delete(`/wfusers/${context.wfuser}/wfmembers/${context.wfmember}`,isloading);
return res;
}
if(context.wfgroup && context.wfmember){
let res:any = Http.getInstance().delete(`/wfgroups/${context.wfgroup}/wfmembers/${context.wfmember}`,isloading);
return res;
}
let res:any = Http.getInstance().delete(`/wfmembers/${context.wfmember}`,isloading);
return res;
}
/**
* Get接口方法
*
......@@ -222,7 +172,7 @@ export default class WFMemberServiceBase extends EntityService {
}
/**
* CheckKey接口方法
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -230,27 +180,52 @@ export default class WFMemberServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof WFMemberServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.wfuser && context.wfmember){
let res:any = Http.getInstance().delete(`/wfusers/${context.wfuser}/wfmembers/${context.wfmember}`,isloading);
return res;
}
if(context.wfgroup && context.wfmember){
let res:any = Http.getInstance().delete(`/wfgroups/${context.wfgroup}/wfmembers/${context.wfmember}`,isloading);
return res;
}
let res:any = Http.getInstance().delete(`/wfmembers/${context.wfmember}`,isloading);
return res;
}
/**
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFMemberServiceBase
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.wfuser && context.wfmember){
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/wfusers/${context.wfuser}/wfmembers/${context.wfmember}/checkkey`,data,isloading);
let res:any = await Http.getInstance().post(`/wfusers/${context.wfuser}/wfmembers/${context.wfmember}/save`,data,isloading);
return res;
}
if(context.wfgroup && context.wfmember){
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/wfgroups/${context.wfgroup}/wfmembers/${context.wfmember}/checkkey`,data,isloading);
let res:any = await Http.getInstance().post(`/wfgroups/${context.wfgroup}/wfmembers/${context.wfmember}/save`,data,isloading);
return res;
}
let res:any = Http.getInstance().post(`/wfmembers/${context.wfmember}/checkkey`,data,isloading);
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/wfmembers/${context.wfmember}/save`,data,isloading);
return res;
}
/**
* Save接口方法
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -258,24 +233,24 @@ export default class WFMemberServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof WFMemberServiceBase
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.wfuser && context.wfmember){
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/wfusers/${context.wfuser}/wfmembers/${context.wfmember}/save`,data,isloading);
let res:any = await Http.getInstance().put(`/wfusers/${context.wfuser}/wfmembers/${context.wfmember}`,data,isloading);
return res;
}
if(context.wfgroup && context.wfmember){
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/wfgroups/${context.wfgroup}/wfmembers/${context.wfmember}/save`,data,isloading);
let res:any = await Http.getInstance().put(`/wfgroups/${context.wfgroup}/wfmembers/${context.wfmember}`,data,isloading);
return res;
}
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/wfmembers/${context.wfmember}/save`,data,isloading);
let res:any = await Http.getInstance().put(`/wfmembers/${context.wfmember}`,data,isloading);
return res;
}
......@@ -326,4 +301,29 @@ export default class WFMemberServiceBase extends EntityService {
let tempData:any = JSON.parse(JSON.stringify(data));
return await Http.getInstance().post(`/wfmembers/searchdefault`,tempData,isloading);
}
/**
* Select接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFMemberServiceBase
*/
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.wfuser && context.wfmember){
let res:any = Http.getInstance().get(`/wfusers/${context.wfuser}/wfmembers/${context.wfmember}/select`,isloading);
return res;
}
if(context.wfgroup && context.wfmember){
let res:any = Http.getInstance().get(`/wfgroups/${context.wfgroup}/wfmembers/${context.wfmember}/select`,isloading);
return res;
}
let res:any = Http.getInstance().get(`/wfmembers/${context.wfmember}/select`,isloading);
return res;
}
}
\ No newline at end of file
......@@ -39,7 +39,7 @@ export default class WFProcessDefinitionServiceBase extends EntityService {
// 实体接口
/**
* Select接口方法
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -47,9 +47,8 @@ export default class WFProcessDefinitionServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof WFProcessDefinitionServiceBase
*/
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().get(`/wfprocessdefinitions/${context.wfprocessdefinition}/select`,isloading);
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().post(`/wfprocessdefinitions/${context.wfprocessdefinition}/checkkey`,data,isloading);
return res;
}
......@@ -77,37 +76,6 @@ export default class WFProcessDefinitionServiceBase extends EntityService {
return res;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFProcessDefinitionServiceBase
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/wfprocessdefinitions/${context.wfprocessdefinition}`,data,isloading);
return res;
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFProcessDefinitionServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().delete(`/wfprocessdefinitions/${context.wfprocessdefinition}`,isloading);
return res;
}
/**
* Get接口方法
*
......@@ -140,7 +108,7 @@ export default class WFProcessDefinitionServiceBase extends EntityService {
}
/**
* CheckKey接口方法
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -148,8 +116,8 @@ export default class WFProcessDefinitionServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof WFProcessDefinitionServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().post(`/wfprocessdefinitions/${context.wfprocessdefinition}/checkkey`,data,isloading);
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().delete(`/wfprocessdefinitions/${context.wfprocessdefinition}`,isloading);
return res;
}
......@@ -170,6 +138,23 @@ export default class WFProcessDefinitionServiceBase extends EntityService {
return res;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFProcessDefinitionServiceBase
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/wfprocessdefinitions/${context.wfprocessdefinition}`,data,isloading);
return res;
}
/**
* FetchDefault接口方法
*
......@@ -198,4 +183,19 @@ export default class WFProcessDefinitionServiceBase extends EntityService {
let tempData:any = JSON.parse(JSON.stringify(data));
return await Http.getInstance().post(`/wfprocessdefinitions/searchdefault`,tempData,isloading);
}
/**
* Select接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFProcessDefinitionServiceBase
*/
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().get(`/wfprocessdefinitions/${context.wfprocessdefinition}/select`,isloading);
return res;
}
}
\ No newline at end of file
......@@ -39,7 +39,7 @@ export default class WFREModelServiceBase extends EntityService {
// 实体接口
/**
* Select接口方法
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -47,9 +47,8 @@ export default class WFREModelServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof WFREModelServiceBase
*/
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().get(`/wfremodels/${context.wfremodel}/select`,isloading);
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().post(`/wfremodels/${context.wfremodel}/checkkey`,data,isloading);
return res;
}
......@@ -77,37 +76,6 @@ export default class WFREModelServiceBase extends EntityService {
return res;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFREModelServiceBase
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/wfremodels/${context.wfremodel}`,data,isloading);
return res;
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFREModelServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().delete(`/wfremodels/${context.wfremodel}`,isloading);
return res;
}
/**
* Get接口方法
*
......@@ -140,7 +108,7 @@ export default class WFREModelServiceBase extends EntityService {
}
/**
* CheckKey接口方法
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -148,8 +116,8 @@ export default class WFREModelServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof WFREModelServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().post(`/wfremodels/${context.wfremodel}/checkkey`,data,isloading);
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().delete(`/wfremodels/${context.wfremodel}`,isloading);
return res;
}
......@@ -170,6 +138,23 @@ export default class WFREModelServiceBase extends EntityService {
return res;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFREModelServiceBase
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/wfremodels/${context.wfremodel}`,data,isloading);
return res;
}
/**
* FetchDefault接口方法
*
......@@ -198,4 +183,19 @@ export default class WFREModelServiceBase extends EntityService {
let tempData:any = JSON.parse(JSON.stringify(data));
return await Http.getInstance().post(`/wfremodels/searchdefault`,tempData,isloading);
}
/**
* Select接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFREModelServiceBase
*/
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().get(`/wfremodels/${context.wfremodel}/select`,isloading);
return res;
}
}
\ No newline at end of file
......@@ -39,7 +39,7 @@ export default class WFSystemServiceBase extends EntityService {
// 实体接口
/**
* Select接口方法
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -47,9 +47,8 @@ export default class WFSystemServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof WFSystemServiceBase
*/
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().get(`/wfsystems/${context.wfsystem}/select`,isloading);
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().post(`/wfsystems/${context.wfsystem}/checkkey`,data,isloading);
return res;
}
......@@ -77,37 +76,6 @@ export default class WFSystemServiceBase extends EntityService {
return res;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFSystemServiceBase
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/wfsystems/${context.wfsystem}`,data,isloading);
return res;
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFSystemServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().delete(`/wfsystems/${context.wfsystem}`,isloading);
return res;
}
/**
* Get接口方法
*
......@@ -140,7 +108,7 @@ export default class WFSystemServiceBase extends EntityService {
}
/**
* CheckKey接口方法
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -148,8 +116,8 @@ export default class WFSystemServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof WFSystemServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().post(`/wfsystems/${context.wfsystem}/checkkey`,data,isloading);
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().delete(`/wfsystems/${context.wfsystem}`,isloading);
return res;
}
......@@ -170,6 +138,23 @@ export default class WFSystemServiceBase extends EntityService {
return res;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFSystemServiceBase
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/wfsystems/${context.wfsystem}`,data,isloading);
return res;
}
/**
* FetchDefault接口方法
*
......@@ -198,4 +183,19 @@ export default class WFSystemServiceBase extends EntityService {
let tempData:any = JSON.parse(JSON.stringify(data));
return await Http.getInstance().post(`/wfsystems/searchdefault`,tempData,isloading);
}
/**
* Select接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFSystemServiceBase
*/
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().get(`/wfsystems/${context.wfsystem}/select`,isloading);
return res;
}
}
\ No newline at end of file
......@@ -39,7 +39,7 @@ export default class WFUserServiceBase extends EntityService {
// 实体接口
/**
* Select接口方法
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -47,9 +47,8 @@ export default class WFUserServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof WFUserServiceBase
*/
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().get(`/wfusers/${context.wfuser}/select`,isloading);
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().post(`/wfusers/${context.wfuser}/checkkey`,data,isloading);
return res;
}
......@@ -78,37 +77,6 @@ export default class WFUserServiceBase extends EntityService {
return res;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFUserServiceBase
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/wfusers/${context.wfuser}`,data,isloading);
return res;
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFUserServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().delete(`/wfusers/${context.wfuser}`,isloading);
return res;
}
/**
* Get接口方法
*
......@@ -141,7 +109,7 @@ export default class WFUserServiceBase extends EntityService {
}
/**
* CheckKey接口方法
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
......@@ -149,8 +117,8 @@ export default class WFUserServiceBase extends EntityService {
* @returns {Promise<any>}
* @memberof WFUserServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().post(`/wfusers/${context.wfuser}/checkkey`,data,isloading);
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().delete(`/wfusers/${context.wfuser}`,isloading);
return res;
}
......@@ -171,6 +139,23 @@ export default class WFUserServiceBase extends EntityService {
return res;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFUserServiceBase
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/wfusers/${context.wfuser}`,data,isloading);
return res;
}
/**
* FetchDefault接口方法
*
......@@ -199,4 +184,19 @@ export default class WFUserServiceBase extends EntityService {
let tempData:any = JSON.parse(JSON.stringify(data));
return await Http.getInstance().post(`/wfusers/searchdefault`,tempData,isloading);
}
/**
* Select接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFUserServiceBase
*/
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().get(`/wfusers/${context.wfuser}/select`,isloading);
return res;
}
}
\ No newline at end of file
......@@ -23,7 +23,7 @@
<template v-else>
<i class='fa fa-cogs app-menu-icon'></i>
</template>
<span class='text' :title="$t('app.menus.wfindexview.' + item0.name)">{{$t('app.menus.wfindexview.' + item0.name)}}</span>
<span class='text' :title="$t('app.menus.wfindexview.' + item0.name.toLowerCase())">{{$t('app.menus.wfindexview.' + item0.name.toLowerCase())}}</span>
</template>
<template v-for="item1 in item0.items">
<template v-if="item1.items && Array.isArray(item1.items) && item1.items.length > 0">
......@@ -35,7 +35,7 @@
<template v-else-if="item1.iconcls && item1.iconcls != ''">
<i :class="[item1.iconcls, 'app-menu-icon']"></i>
</template>
<span class='text' :title="$t('app.menus.wfindexview.' + item1.name)">{{$t('app.menus.wfindexview.' + item1.name)}}</span>
<span class='text' :title="$t('app.menus.wfindexview.' + item1.name.toLowerCase())">{{$t('app.menus.wfindexview.' + item1.name.toLowerCase())}}</span>
</template>
<template v-for="item2 in item1.items">
<template v-if="item2.type =='MENUITEM'">
......@@ -47,7 +47,7 @@
<i :class="[item2.iconcls, 'app-menu-icon']"></i>
</template>
<template slot="title">
<span class="text" :title="$t('app.menus.wfindexview.' + item2.name)">{{$t('app.menus.wfindexview.' + item2.name)}}</span>
<span class="text" :title="$t('app.menus.wfindexview.' + item2.name.toLowerCase())">{{$t('app.menus.wfindexview.' + item2.name.toLowerCase())}}</span>
<template v-if="counterdata && counterdata[item2.counterid] && counterdata[item2.counterid] > 0">
<span class="pull-right">
<badge :count="counterdata[item2.counterid]" :overflow-count="9999"></badge>
......@@ -69,7 +69,7 @@
<i :class="[item1.iconcls, 'app-menu-icon']"></i>
</template>
<template slot="title">
<span class="text" :title="$t('app.menus.wfindexview.' + item1.name)">{{$t('app.menus.wfindexview.' + item1.name)}} </span>
<span class="text" :title="$t('app.menus.wfindexview.' + item1.name.toLowerCase())">{{$t('app.menus.wfindexview.' + item1.name.toLowerCase())}} </span>
<template v-if="counterdata && counterdata[item1.counterid] && counterdata[item1.counterid] > 0">
<span class="pull-right">
<badge :count="counterdata[item1.counterid]" :overflow-count="9999"></badge>
......@@ -95,7 +95,7 @@
<i class='fa fa-cogs app-menu-icon'></i>
</template>
<template slot="title">
<span class="text" :title="$t('app.menus.wfindexview.' + item0.name)">{{$t('app.menus.wfindexview.' + item0.name)}}</span>
<span class="text" :title="$t('app.menus.wfindexview.' + item0.name.toLowerCase())">{{$t('app.menus.wfindexview.' + item0.name.toLowerCase())}}</span>
<template v-if="counterdata && counterdata[item0.counterid] && counterdata[item0.counterid] > 0">
<span class="pull-right">
<badge :count="counterdata[item0.counterid]" :overflow-count="9999"></badge>
......
......@@ -670,8 +670,8 @@ export default class DefaultBase extends Vue implements ControlInterface {
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return;
}
......
......@@ -845,8 +845,8 @@ export default class MainBase extends Vue implements ControlInterface {
const post: Promise<any> = this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return;
}
......@@ -896,7 +896,7 @@ export default class MainBase extends Vue implements ControlInterface {
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data && response.data.message ? response.data.message : "" });
});
}
......@@ -981,7 +981,7 @@ export default class MainBase extends Vue implements ControlInterface {
resolve(response);
}).catch((response: any) => {
if (response && response.status != 200) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.message});
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data && response.data.message ? response.data.message : "" });
return;
}
if (!response || !response.status || !response.data) {
......@@ -1102,6 +1102,9 @@ export default class MainBase extends Vue implements ControlInterface {
const parentdata: any = {};
this.$emit('beforeload', parentdata);
Object.assign(arg, parentdata);
let tempViewParams:any = parentdata.viewparams?parentdata.viewparams:{};
Object.assign(tempViewParams,JSON.parse(JSON.stringify(this.viewparams)));
Object.assign(arg,{viewparams:tempViewParams});
const post: Promise<any> = this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response || response.status !== 200) {
......@@ -1969,8 +1972,8 @@ export default class MainBase extends Vue implements ControlInterface {
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction, JSON.parse(JSON.stringify(this.context)), args[0], this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return;
}
......
......@@ -670,8 +670,8 @@ export default class DefaultBase extends Vue implements ControlInterface {
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return;
}
......
......@@ -866,8 +866,8 @@ export default class MainBase extends Vue implements ControlInterface {
const post: Promise<any> = this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return;
}
......@@ -917,7 +917,7 @@ export default class MainBase extends Vue implements ControlInterface {
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data && response.data.message ? response.data.message : "" });
});
}
......@@ -1002,7 +1002,7 @@ export default class MainBase extends Vue implements ControlInterface {
resolve(response);
}).catch((response: any) => {
if (response && response.status != 200) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.message});
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data && response.data.message ? response.data.message : "" });
return;
}
if (!response || !response.status || !response.data) {
......@@ -1123,6 +1123,9 @@ export default class MainBase extends Vue implements ControlInterface {
const parentdata: any = {};
this.$emit('beforeload', parentdata);
Object.assign(arg, parentdata);
let tempViewParams:any = parentdata.viewparams?parentdata.viewparams:{};
Object.assign(tempViewParams,JSON.parse(JSON.stringify(this.viewparams)));
Object.assign(arg,{viewparams:tempViewParams});
const post: Promise<any> = this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response || response.status !== 200) {
......@@ -1987,8 +1990,8 @@ export default class MainBase extends Vue implements ControlInterface {
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction, JSON.parse(JSON.stringify(this.context)), args[0], this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return;
}
......
......@@ -706,8 +706,8 @@ export default class DefaultBase extends Vue implements ControlInterface {
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return;
}
......
......@@ -889,8 +889,8 @@ export default class MainBase extends Vue implements ControlInterface {
const post: Promise<any> = this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return;
}
......@@ -940,7 +940,7 @@ export default class MainBase extends Vue implements ControlInterface {
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data && response.data.message ? response.data.message : "" });
});
}
......@@ -1025,7 +1025,7 @@ export default class MainBase extends Vue implements ControlInterface {
resolve(response);
}).catch((response: any) => {
if (response && response.status != 200) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.message});
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data && response.data.message ? response.data.message : "" });
return;
}
if (!response || !response.status || !response.data) {
......@@ -1146,6 +1146,9 @@ export default class MainBase extends Vue implements ControlInterface {
const parentdata: any = {};
this.$emit('beforeload', parentdata);
Object.assign(arg, parentdata);
let tempViewParams:any = parentdata.viewparams?parentdata.viewparams:{};
Object.assign(tempViewParams,JSON.parse(JSON.stringify(this.viewparams)));
Object.assign(arg,{viewparams:tempViewParams});
const post: Promise<any> = this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response || response.status !== 200) {
......@@ -2027,8 +2030,8 @@ export default class MainBase extends Vue implements ControlInterface {
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction, JSON.parse(JSON.stringify(this.context)), args[0], this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return;
}
......
......@@ -785,8 +785,8 @@ export default class DefaultBase extends Vue implements ControlInterface {
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return;
}
......
......@@ -985,8 +985,8 @@ export default class MainBase extends Vue implements ControlInterface {
const post: Promise<any> = this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return;
}
......@@ -1036,7 +1036,7 @@ export default class MainBase extends Vue implements ControlInterface {
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data && response.data.message ? response.data.message : "" });
});
}
......@@ -1121,7 +1121,7 @@ export default class MainBase extends Vue implements ControlInterface {
resolve(response);
}).catch((response: any) => {
if (response && response.status != 200) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.message});
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data && response.data.message ? response.data.message : "" });
return;
}
if (!response || !response.status || !response.data) {
......@@ -1242,6 +1242,9 @@ export default class MainBase extends Vue implements ControlInterface {
const parentdata: any = {};
this.$emit('beforeload', parentdata);
Object.assign(arg, parentdata);
let tempViewParams:any = parentdata.viewparams?parentdata.viewparams:{};
Object.assign(tempViewParams,JSON.parse(JSON.stringify(this.viewparams)));
Object.assign(arg,{viewparams:tempViewParams});
const post: Promise<any> = this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response || response.status !== 200) {
......@@ -2130,8 +2133,8 @@ export default class MainBase extends Vue implements ControlInterface {
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction, JSON.parse(JSON.stringify(this.context)), args[0], this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return;
}
......
......@@ -670,8 +670,8 @@ export default class DefaultBase extends Vue implements ControlInterface {
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return;
}
......
......@@ -887,8 +887,8 @@ export default class MainBase extends Vue implements ControlInterface {
const post: Promise<any> = this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return;
}
......@@ -938,7 +938,7 @@ export default class MainBase extends Vue implements ControlInterface {
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data && response.data.message ? response.data.message : "" });
});
}
......@@ -1023,7 +1023,7 @@ export default class MainBase extends Vue implements ControlInterface {
resolve(response);
}).catch((response: any) => {
if (response && response.status != 200) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.message});
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data && response.data.message ? response.data.message : "" });
return;
}
if (!response || !response.status || !response.data) {
......@@ -1144,6 +1144,9 @@ export default class MainBase extends Vue implements ControlInterface {
const parentdata: any = {};
this.$emit('beforeload', parentdata);
Object.assign(arg, parentdata);
let tempViewParams:any = parentdata.viewparams?parentdata.viewparams:{};
Object.assign(tempViewParams,JSON.parse(JSON.stringify(this.viewparams)));
Object.assign(arg,{viewparams:tempViewParams});
const post: Promise<any> = this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response || response.status !== 200) {
......@@ -2017,8 +2020,8 @@ export default class MainBase extends Vue implements ControlInterface {
let post: Promise<any> = this.service.loadDraft(this.loaddraftAction, JSON.parse(JSON.stringify(this.context)), args[0], this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
return;
}
......
......@@ -77,6 +77,32 @@
<workingDirectory>../../app_web</workingDirectory>
</configuration>
</execution>
<execution>
<id>prepare</id>
<configuration>
<executable>cp</executable>
<arguments>
<argument>../../${project.artifactId}.jar</argument>
<argument>${project.basedir}/src/main/docker/</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>buildpush</id>
<configuration>
<executable>docker</executable>
<arguments>
<argument>buildx</argument>
<argument>build</argument>
<argument>--platform</argument>
<argument>linux/amd64,linux/arm64</argument>
<argument>-t</argument>
<argument>${docker.image.prefix}/${project.artifactId}:latest</argument>
<argument>${project.basedir}/src/main/docker</argument>
<argument>--push</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
......@@ -114,7 +140,7 @@
</resource>
</resources>
</configuration>
</plugin>
</plugin>
</plugins>
</build>
</profile>
......
FROM openjdk:8-jre-alpine
FROM adoptopenjdk/openjdk8:jdk8u242-b08-centos
ENV TZ=Asia/Shanghai \
SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
......
......@@ -7,34 +7,6 @@ logging:
#zuul网关路由设置
zuul:
routes:
wf_task:
path: /wftasks/**
serviceId: ${ibiz.ref.service.ibzwf-api:ibzwf-api}
stripPrefix: false
wf_group_member:
path: /wfmembers/**
serviceId: ${ibiz.ref.service.ibzwf-api:ibzwf-api}
stripPrefix: false
wf_user:
path: /wfusers/**
serviceId: ${ibiz.ref.service.ibzwf-api:ibzwf-api}
stripPrefix: false
wf_group:
path: /wfgroups/**
serviceId: ${ibiz.ref.service.ibzwf-api:ibzwf-api}
stripPrefix: false
wf_model:
path: /wfremodels/**
serviceId: ${ibiz.ref.service.ibzwf-api:ibzwf-api}
stripPrefix: false
wf_pssystem:
path: /wfsystems/**
serviceId: ${ibiz.ref.service.ibzwf-api:ibzwf-api}
stripPrefix: false
wf_definition:
path: /wfprocessdefinitions/**
serviceId: ${ibiz.ref.service.ibzwf-api:ibzwf-api}
stripPrefix: false
loginv7:
path: /v7/login
serviceId: ${ibiz.ref.service.uaa:ibzuaa-api}
......@@ -91,5 +63,33 @@ zuul:
path: /sysauthlogs
serviceId: ${ibiz.ref.service.uaa:ibzuaa-api}
stripPrefix: false
wf_task:
path: /wftasks/**
serviceId: ${ibiz.ref.service.ibzwf-api:ibzwf-api}
stripPrefix: false
wf_group_member:
path: /wfmembers/**
serviceId: ${ibiz.ref.service.ibzwf-api:ibzwf-api}
stripPrefix: false
wf_user:
path: /wfusers/**
serviceId: ${ibiz.ref.service.ibzwf-api:ibzwf-api}
stripPrefix: false
wf_group:
path: /wfgroups/**
serviceId: ${ibiz.ref.service.ibzwf-api:ibzwf-api}
stripPrefix: false
wf_model:
path: /wfremodels/**
serviceId: ${ibiz.ref.service.ibzwf-api:ibzwf-api}
stripPrefix: false
wf_pssystem:
path: /wfsystems/**
serviceId: ${ibiz.ref.service.ibzwf-api:ibzwf-api}
stripPrefix: false
wf_definition:
path: /wfprocessdefinitions/**
serviceId: ${ibiz.ref.service.ibzwf-api:ibzwf-api}
stripPrefix: false
sensitive-headers:
- Cookie,Set-Cookie,Authorization
package cn.ibizlab.core.util.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
/**
* 通用配置类
*/
@Configuration
public class CommonAutoConfig {
@Value("${jbpm.enable.multi.con:true}")
private String flag;
/**
* 处理逻辑节点支持多来源配置
*/
@Component
public class InstallSystemParamsCommandLineRunner implements CommandLineRunner {
@Override
public void run(String... var1){
System.setProperty("jbpm.enable.multi.con", flag);
}
}
}
......@@ -30,7 +30,7 @@ public interface WFProcessDefinitionMapper extends BaseMapper<WFProcessDefinitio
@CacheEvict(value ="wfprocessdefinition", key = "'row:'+#p0.definitionkey")
int updateById(@Param(Constants.ENTITY) WFProcessDefinition entity);
@Override
@CacheEvict(value ="wfprocessdefinition", key = "'row:'+#p0.definitionkey")
@CacheEvict(value ="wfprocessdefinition", key = "'row:'+#p0.definitionkey" ,condition ="#p0 != null")
int update(@Param(Constants.ENTITY) WFProcessDefinition entity, @Param("ew") Wrapper<WFProcessDefinition> updateWrapper);
@Override
@CacheEvict(value ="wfprocessdefinition", key = "'row:'+#p0")
......
......@@ -36,6 +36,10 @@ public interface IWFTaskService {
boolean save(WFTask et);
void saveBatch(List<WFTask> list);
Page<WFTask> searchDefault(WFTaskSearchContext context);
Page<WFTask> searchDoneTask(WFTaskSearchContext context);
Page<WFTask> searchFinishTask(WFTaskSearchContext context);
Page<WFTask> searchTodoTask(WFTaskSearchContext context);
Page<WFTask> searchToreadTask(WFTaskSearchContext context);
}
......
......@@ -4,7 +4,7 @@
<!--输出实体[WF_GROUP]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-wf_group-9-1">
<changeSet author="root" id="tab-wf_group-9-1">
<createTable tableName="IBZWFGROUP">
<column name="GROUPID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_WF_GROUP_GROUPID"/>
......@@ -20,7 +20,7 @@
<!--输出实体[WF_GROUP_MEMBER]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-wf_group_member-13-2">
<changeSet author="root" id="tab-wf_group_member-13-2">
<createTable tableName="IBZWFMEMBER">
<column name="MEMBERID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_WF_GROUP_MEMBER_MEMBERID"/>
......@@ -36,7 +36,7 @@
<!--输出实体[WF_DEFINITION]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-wf_definition-1-3">
<changeSet author="root" id="tab-wf_definition-1-3">
<createTable tableName="IBZWFDEFINITION">
<column name="DEFINITIONKEY" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_WF_DEFINITION_DEFINITIONKEY"/>
......@@ -79,7 +79,7 @@
<!--输出实体[WF_GROUP]外键关系 -->
<!--输出实体[WF_GROUP_MEMBER]外键关系 -->
<changeSet author="a_A_5d9d78509" id="fk-wf_group_member-13-5">
<changeSet author="root" id="fk-wf_group_member-13-5">
<addForeignKeyConstraint baseColumnNames="GROUPID" baseTableName="IBZWFMEMBER" constraintName="DER1N_WF_GROUP_MEMBER_WF_GROUP" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="GROUPID" referencedTableName="IBZWFGROUP" validate="true"/>
</changeSet>
<!--输出实体[WF_DEFINITION]外键关系 -->
......
......@@ -47,7 +47,7 @@
"dename":"WFTask",
"delogicname":"工作流任务",
"sysmoudle":{"id":"WORKFLOW","name":"workflow"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"dedataset":[{"id":"Default" , "name":"DEFAULT"},{"id":"DoneTask" , "name":"已办任务"},{"id":"FinishTask" , "name":"办结任务"},{"id":"TodoTask" , "name":"待办任务"},{"id":"ToreadTask" , "name":"待阅任务"}],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}]
}
......
......@@ -73,7 +73,41 @@
</resource>
</resources>
</configuration>
</plugin>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>prepare</id>
<configuration>
<executable>cp</executable>
<arguments>
<argument>../../${project.artifactId}.jar</argument>
<argument>${project.basedir}/src/main/docker/</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>buildpush</id>
<configuration>
<executable>docker</executable>
<arguments>
<argument>buildx</argument>
<argument>build</argument>
<argument>--platform</argument>
<argument>linux/amd64,linux/arm64</argument>
<argument>-t</argument>
<argument>${docker.image.prefix}/${project.artifactId}:latest</argument>
<argument>${project.basedir}/src/main/docker</argument>
<argument>--push</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
......
......@@ -65,25 +65,15 @@ public class WFGroupResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-Update-all')")
@ApiOperation(value = "更新角色/用户组", tags = {"角色/用户组" }, notes = "更新角色/用户组")
@RequestMapping(method = RequestMethod.PUT, value = "/wfgroups/{wfgroup_id}")
public ResponseEntity<WFGroupDTO> update(@PathVariable("wfgroup_id") String wfgroup_id, @RequestBody WFGroupDTO wfgroupdto) {
WFGroup domain = wfgroupMapping.toDomain(wfgroupdto);
domain .setId(wfgroup_id);
wfgroupService.update(domain );
WFGroupDTO dto = wfgroupMapping.toDto(domain);
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-Get-all')")
@ApiOperation(value = "获取角色/用户组", tags = {"角色/用户组" }, notes = "获取角色/用户组")
@RequestMapping(method = RequestMethod.GET, value = "/wfgroups/{wfgroup_id}")
public ResponseEntity<WFGroupDTO> get(@PathVariable("wfgroup_id") String wfgroup_id) {
WFGroup domain = wfgroupService.get(wfgroup_id);
WFGroupDTO dto = wfgroupMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-Update-all')")
@ApiOperation(value = "批量更新角色/用户组", tags = {"角色/用户组" }, notes = "批量更新角色/用户组")
@RequestMapping(method = RequestMethod.PUT, value = "/wfgroups/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<WFGroupDTO> wfgroupdtos) {
wfgroupService.updateBatch(wfgroupMapping.toDomain(wfgroupdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-Remove-all')")
@ApiOperation(value = "删除角色/用户组", tags = {"角色/用户组" }, notes = "删除角色/用户组")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfgroups/{wfgroup_id}")
......@@ -99,20 +89,23 @@ public class WFGroupResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-Get-all')")
@ApiOperation(value = "获取角色/用户组", tags = {"角色/用户组" }, notes = "获取角色/用户组")
@RequestMapping(method = RequestMethod.GET, value = "/wfgroups/{wfgroup_id}")
public ResponseEntity<WFGroupDTO> get(@PathVariable("wfgroup_id") String wfgroup_id) {
WFGroup domain = wfgroupService.get(wfgroup_id);
WFGroupDTO dto = wfgroupMapping.toDto(domain);
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-Update-all')")
@ApiOperation(value = "更新角色/用户组", tags = {"角色/用户组" }, notes = "更新角色/用户组")
@RequestMapping(method = RequestMethod.PUT, value = "/wfgroups/{wfgroup_id}")
public ResponseEntity<WFGroupDTO> update(@PathVariable("wfgroup_id") String wfgroup_id, @RequestBody WFGroupDTO wfgroupdto) {
WFGroup domain = wfgroupMapping.toDomain(wfgroupdto);
domain .setId(wfgroup_id);
wfgroupService.update(domain );
WFGroupDTO dto = wfgroupMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取角色/用户组草稿", tags = {"角色/用户组" }, notes = "获取角色/用户组草稿")
@RequestMapping(method = RequestMethod.GET, value = "/wfgroups/getdraft")
public ResponseEntity<WFGroupDTO> getDraft(WFGroupDTO dto) {
WFGroup domain = wfgroupMapping.toDomain(dto);
return ResponseEntity.status(HttpStatus.OK).body(wfgroupMapping.toDto(wfgroupService.getDraft(domain)));
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-Update-all')")
@ApiOperation(value = "批量更新角色/用户组", tags = {"角色/用户组" }, notes = "批量更新角色/用户组")
@RequestMapping(method = RequestMethod.PUT, value = "/wfgroups/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<WFGroupDTO> wfgroupdtos) {
wfgroupService.updateBatch(wfgroupMapping.toDomain(wfgroupdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "检查角色/用户组", tags = {"角色/用户组" }, notes = "检查角色/用户组")
......@@ -121,6 +114,13 @@ public class WFGroupResource {
return ResponseEntity.status(HttpStatus.OK).body(wfgroupService.checkKey(wfgroupMapping.toDomain(wfgroupdto)));
}
@ApiOperation(value = "获取角色/用户组草稿", tags = {"角色/用户组" }, notes = "获取角色/用户组草稿")
@RequestMapping(method = RequestMethod.GET, value = "/wfgroups/getdraft")
public ResponseEntity<WFGroupDTO> getDraft(WFGroupDTO dto) {
WFGroup domain = wfgroupMapping.toDomain(dto);
return ResponseEntity.status(HttpStatus.OK).body(wfgroupMapping.toDto(wfgroupService.getDraft(domain)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFGroup-Save-all')")
@ApiOperation(value = "保存角色/用户组", tags = {"角色/用户组" }, notes = "保存角色/用户组")
@RequestMapping(method = RequestMethod.POST, value = "/wfgroups/save")
......
......@@ -65,25 +65,15 @@ public class WFProcessDefinitionResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-Update-all')")
@ApiOperation(value = "更新流程定义", tags = {"流程定义" }, notes = "更新流程定义")
@RequestMapping(method = RequestMethod.PUT, value = "/wfprocessdefinitions/{wfprocessdefinition_id}")
public ResponseEntity<WFProcessDefinitionDTO> update(@PathVariable("wfprocessdefinition_id") String wfprocessdefinition_id, @RequestBody WFProcessDefinitionDTO wfprocessdefinitiondto) {
WFProcessDefinition domain = wfprocessdefinitionMapping.toDomain(wfprocessdefinitiondto);
domain .setDefinitionkey(wfprocessdefinition_id);
wfprocessdefinitionService.update(domain );
WFProcessDefinitionDTO dto = wfprocessdefinitionMapping.toDto(domain);
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-Get-all')")
@ApiOperation(value = "获取流程定义", tags = {"流程定义" }, notes = "获取流程定义")
@RequestMapping(method = RequestMethod.GET, value = "/wfprocessdefinitions/{wfprocessdefinition_id}")
public ResponseEntity<WFProcessDefinitionDTO> get(@PathVariable("wfprocessdefinition_id") String wfprocessdefinition_id) {
WFProcessDefinition domain = wfprocessdefinitionService.get(wfprocessdefinition_id);
WFProcessDefinitionDTO dto = wfprocessdefinitionMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-Update-all')")
@ApiOperation(value = "批量更新流程定义", tags = {"流程定义" }, notes = "批量更新流程定义")
@RequestMapping(method = RequestMethod.PUT, value = "/wfprocessdefinitions/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<WFProcessDefinitionDTO> wfprocessdefinitiondtos) {
wfprocessdefinitionService.updateBatch(wfprocessdefinitionMapping.toDomain(wfprocessdefinitiondtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-Remove-all')")
@ApiOperation(value = "删除流程定义", tags = {"流程定义" }, notes = "删除流程定义")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfprocessdefinitions/{wfprocessdefinition_id}")
......@@ -99,20 +89,23 @@ public class WFProcessDefinitionResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-Get-all')")
@ApiOperation(value = "获取流程定义", tags = {"流程定义" }, notes = "获取流程定义")
@RequestMapping(method = RequestMethod.GET, value = "/wfprocessdefinitions/{wfprocessdefinition_id}")
public ResponseEntity<WFProcessDefinitionDTO> get(@PathVariable("wfprocessdefinition_id") String wfprocessdefinition_id) {
WFProcessDefinition domain = wfprocessdefinitionService.get(wfprocessdefinition_id);
WFProcessDefinitionDTO dto = wfprocessdefinitionMapping.toDto(domain);
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-Update-all')")
@ApiOperation(value = "更新流程定义", tags = {"流程定义" }, notes = "更新流程定义")
@RequestMapping(method = RequestMethod.PUT, value = "/wfprocessdefinitions/{wfprocessdefinition_id}")
public ResponseEntity<WFProcessDefinitionDTO> update(@PathVariable("wfprocessdefinition_id") String wfprocessdefinition_id, @RequestBody WFProcessDefinitionDTO wfprocessdefinitiondto) {
WFProcessDefinition domain = wfprocessdefinitionMapping.toDomain(wfprocessdefinitiondto);
domain .setDefinitionkey(wfprocessdefinition_id);
wfprocessdefinitionService.update(domain );
WFProcessDefinitionDTO dto = wfprocessdefinitionMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取流程定义草稿", tags = {"流程定义" }, notes = "获取流程定义草稿")
@RequestMapping(method = RequestMethod.GET, value = "/wfprocessdefinitions/getdraft")
public ResponseEntity<WFProcessDefinitionDTO> getDraft(WFProcessDefinitionDTO dto) {
WFProcessDefinition domain = wfprocessdefinitionMapping.toDomain(dto);
return ResponseEntity.status(HttpStatus.OK).body(wfprocessdefinitionMapping.toDto(wfprocessdefinitionService.getDraft(domain)));
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-Update-all')")
@ApiOperation(value = "批量更新流程定义", tags = {"流程定义" }, notes = "批量更新流程定义")
@RequestMapping(method = RequestMethod.PUT, value = "/wfprocessdefinitions/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<WFProcessDefinitionDTO> wfprocessdefinitiondtos) {
wfprocessdefinitionService.updateBatch(wfprocessdefinitionMapping.toDomain(wfprocessdefinitiondtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "检查流程定义", tags = {"流程定义" }, notes = "检查流程定义")
......@@ -121,6 +114,13 @@ public class WFProcessDefinitionResource {
return ResponseEntity.status(HttpStatus.OK).body(wfprocessdefinitionService.checkKey(wfprocessdefinitionMapping.toDomain(wfprocessdefinitiondto)));
}
@ApiOperation(value = "获取流程定义草稿", tags = {"流程定义" }, notes = "获取流程定义草稿")
@RequestMapping(method = RequestMethod.GET, value = "/wfprocessdefinitions/getdraft")
public ResponseEntity<WFProcessDefinitionDTO> getDraft(WFProcessDefinitionDTO dto) {
WFProcessDefinition domain = wfprocessdefinitionMapping.toDomain(dto);
return ResponseEntity.status(HttpStatus.OK).body(wfprocessdefinitionMapping.toDto(wfprocessdefinitionService.getDraft(domain)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFProcessDefinition-Save-all')")
@ApiOperation(value = "保存流程定义", tags = {"流程定义" }, notes = "保存流程定义")
@RequestMapping(method = RequestMethod.POST, value = "/wfprocessdefinitions/save")
......
......@@ -63,23 +63,14 @@ public class WFREModelResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "更新流程模型", tags = {"流程模型" }, notes = "更新流程模型")
@RequestMapping(method = RequestMethod.PUT, value = "/wfremodels/{wfremodel_id}")
public ResponseEntity<WFREModelDTO> update(@PathVariable("wfremodel_id") String wfremodel_id, @RequestBody WFREModelDTO wfremodeldto) {
WFREModel domain = wfremodelMapping.toDomain(wfremodeldto);
domain .setId(wfremodel_id);
wfremodelService.update(domain );
WFREModelDTO dto = wfremodelMapping.toDto(domain);
@ApiOperation(value = "获取流程模型", tags = {"流程模型" }, notes = "获取流程模型")
@RequestMapping(method = RequestMethod.GET, value = "/wfremodels/{wfremodel_id}")
public ResponseEntity<WFREModelDTO> get(@PathVariable("wfremodel_id") String wfremodel_id) {
WFREModel domain = wfremodelService.get(wfremodel_id);
WFREModelDTO dto = wfremodelMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "批量更新流程模型", tags = {"流程模型" }, notes = "批量更新流程模型")
@RequestMapping(method = RequestMethod.PUT, value = "/wfremodels/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<WFREModelDTO> wfremodeldtos) {
wfremodelService.updateBatch(wfremodelMapping.toDomain(wfremodeldtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "删除流程模型", tags = {"流程模型" }, notes = "删除流程模型")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfremodels/{wfremodel_id}")
public ResponseEntity<Boolean> remove(@PathVariable("wfremodel_id") String wfremodel_id) {
......@@ -93,19 +84,21 @@ public class WFREModelResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "获取流程模型", tags = {"流程模型" }, notes = "获取流程模型")
@RequestMapping(method = RequestMethod.GET, value = "/wfremodels/{wfremodel_id}")
public ResponseEntity<WFREModelDTO> get(@PathVariable("wfremodel_id") String wfremodel_id) {
WFREModel domain = wfremodelService.get(wfremodel_id);
WFREModelDTO dto = wfremodelMapping.toDto(domain);
@ApiOperation(value = "更新流程模型", tags = {"流程模型" }, notes = "更新流程模型")
@RequestMapping(method = RequestMethod.PUT, value = "/wfremodels/{wfremodel_id}")
public ResponseEntity<WFREModelDTO> update(@PathVariable("wfremodel_id") String wfremodel_id, @RequestBody WFREModelDTO wfremodeldto) {
WFREModel domain = wfremodelMapping.toDomain(wfremodeldto);
domain .setId(wfremodel_id);
wfremodelService.update(domain );
WFREModelDTO dto = wfremodelMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取流程模型草稿", tags = {"流程模型" }, notes = "获取流程模型草稿")
@RequestMapping(method = RequestMethod.GET, value = "/wfremodels/getdraft")
public ResponseEntity<WFREModelDTO> getDraft(WFREModelDTO dto) {
WFREModel domain = wfremodelMapping.toDomain(dto);
return ResponseEntity.status(HttpStatus.OK).body(wfremodelMapping.toDto(wfremodelService.getDraft(domain)));
@ApiOperation(value = "批量更新流程模型", tags = {"流程模型" }, notes = "批量更新流程模型")
@RequestMapping(method = RequestMethod.PUT, value = "/wfremodels/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<WFREModelDTO> wfremodeldtos) {
wfremodelService.updateBatch(wfremodelMapping.toDomain(wfremodeldtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "检查流程模型", tags = {"流程模型" }, notes = "检查流程模型")
......@@ -114,6 +107,13 @@ public class WFREModelResource {
return ResponseEntity.status(HttpStatus.OK).body(wfremodelService.checkKey(wfremodelMapping.toDomain(wfremodeldto)));
}
@ApiOperation(value = "获取流程模型草稿", tags = {"流程模型" }, notes = "获取流程模型草稿")
@RequestMapping(method = RequestMethod.GET, value = "/wfremodels/getdraft")
public ResponseEntity<WFREModelDTO> getDraft(WFREModelDTO dto) {
WFREModel domain = wfremodelMapping.toDomain(dto);
return ResponseEntity.status(HttpStatus.OK).body(wfremodelMapping.toDto(wfremodelService.getDraft(domain)));
}
@ApiOperation(value = "保存流程模型", tags = {"流程模型" }, notes = "保存流程模型")
@RequestMapping(method = RequestMethod.POST, value = "/wfremodels/save")
public ResponseEntity<WFREModelDTO> save(@RequestBody WFREModelDTO wfremodeldto) {
......
......@@ -65,25 +65,15 @@ public class WFSystemResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Update-all')")
@ApiOperation(value = "更新系统", tags = {"系统" }, notes = "更新系统")
@RequestMapping(method = RequestMethod.PUT, value = "/wfsystems/{wfsystem_id}")
public ResponseEntity<WFSystemDTO> update(@PathVariable("wfsystem_id") String wfsystem_id, @RequestBody WFSystemDTO wfsystemdto) {
WFSystem domain = wfsystemMapping.toDomain(wfsystemdto);
domain .setPssystemid(wfsystem_id);
wfsystemService.update(domain );
WFSystemDTO dto = wfsystemMapping.toDto(domain);
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Get-all')")
@ApiOperation(value = "获取系统", tags = {"系统" }, notes = "获取系统")
@RequestMapping(method = RequestMethod.GET, value = "/wfsystems/{wfsystem_id}")
public ResponseEntity<WFSystemDTO> get(@PathVariable("wfsystem_id") String wfsystem_id) {
WFSystem domain = wfsystemService.get(wfsystem_id);
WFSystemDTO dto = wfsystemMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Update-all')")
@ApiOperation(value = "批量更新系统", tags = {"系统" }, notes = "批量更新系统")
@RequestMapping(method = RequestMethod.PUT, value = "/wfsystems/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<WFSystemDTO> wfsystemdtos) {
wfsystemService.updateBatch(wfsystemMapping.toDomain(wfsystemdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Remove-all')")
@ApiOperation(value = "删除系统", tags = {"系统" }, notes = "删除系统")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfsystems/{wfsystem_id}")
......@@ -99,20 +89,23 @@ public class WFSystemResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Get-all')")
@ApiOperation(value = "获取系统", tags = {"系统" }, notes = "获取系统")
@RequestMapping(method = RequestMethod.GET, value = "/wfsystems/{wfsystem_id}")
public ResponseEntity<WFSystemDTO> get(@PathVariable("wfsystem_id") String wfsystem_id) {
WFSystem domain = wfsystemService.get(wfsystem_id);
WFSystemDTO dto = wfsystemMapping.toDto(domain);
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Update-all')")
@ApiOperation(value = "更新系统", tags = {"系统" }, notes = "更新系统")
@RequestMapping(method = RequestMethod.PUT, value = "/wfsystems/{wfsystem_id}")
public ResponseEntity<WFSystemDTO> update(@PathVariable("wfsystem_id") String wfsystem_id, @RequestBody WFSystemDTO wfsystemdto) {
WFSystem domain = wfsystemMapping.toDomain(wfsystemdto);
domain .setPssystemid(wfsystem_id);
wfsystemService.update(domain );
WFSystemDTO dto = wfsystemMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取系统草稿", tags = {"系统" }, notes = "获取系统草稿")
@RequestMapping(method = RequestMethod.GET, value = "/wfsystems/getdraft")
public ResponseEntity<WFSystemDTO> getDraft(WFSystemDTO dto) {
WFSystem domain = wfsystemMapping.toDomain(dto);
return ResponseEntity.status(HttpStatus.OK).body(wfsystemMapping.toDto(wfsystemService.getDraft(domain)));
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Update-all')")
@ApiOperation(value = "批量更新系统", tags = {"系统" }, notes = "批量更新系统")
@RequestMapping(method = RequestMethod.PUT, value = "/wfsystems/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<WFSystemDTO> wfsystemdtos) {
wfsystemService.updateBatch(wfsystemMapping.toDomain(wfsystemdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "检查系统", tags = {"系统" }, notes = "检查系统")
......@@ -121,6 +114,13 @@ public class WFSystemResource {
return ResponseEntity.status(HttpStatus.OK).body(wfsystemService.checkKey(wfsystemMapping.toDomain(wfsystemdto)));
}
@ApiOperation(value = "获取系统草稿", tags = {"系统" }, notes = "获取系统草稿")
@RequestMapping(method = RequestMethod.GET, value = "/wfsystems/getdraft")
public ResponseEntity<WFSystemDTO> getDraft(WFSystemDTO dto) {
WFSystem domain = wfsystemMapping.toDomain(dto);
return ResponseEntity.status(HttpStatus.OK).body(wfsystemMapping.toDto(wfsystemService.getDraft(domain)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzwf-WFSystem-Save-all')")
@ApiOperation(value = "保存系统", tags = {"系统" }, notes = "保存系统")
@RequestMapping(method = RequestMethod.POST, value = "/wfsystems/save")
......
......@@ -65,25 +65,15 @@ public class WFUserResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.wfuserService.get(#wfuser_id),'ibzwf-WFUser-Update')")
@ApiOperation(value = "更新用户", tags = {"用户" }, notes = "更新用户")
@RequestMapping(method = RequestMethod.PUT, value = "/wfusers/{wfuser_id}")
public ResponseEntity<WFUserDTO> update(@PathVariable("wfuser_id") String wfuser_id, @RequestBody WFUserDTO wfuserdto) {
WFUser domain = wfuserMapping.toDomain(wfuserdto);
domain .setId(wfuser_id);
wfuserService.update(domain );
WFUserDTO dto = wfuserMapping.toDto(domain);
@PostAuthorize("hasPermission(this.wfuserMapping.toDomain(returnObject.body),'ibzwf-WFUser-Get')")
@ApiOperation(value = "获取用户", tags = {"用户" }, notes = "获取用户")
@RequestMapping(method = RequestMethod.GET, value = "/wfusers/{wfuser_id}")
public ResponseEntity<WFUserDTO> get(@PathVariable("wfuser_id") String wfuser_id) {
WFUser domain = wfuserService.get(wfuser_id);
WFUserDTO dto = wfuserMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.wfuserService.getWfuserByEntities(this.wfuserMapping.toDomain(#wfuserdtos)),'ibzwf-WFUser-Update')")
@ApiOperation(value = "批量更新用户", tags = {"用户" }, notes = "批量更新用户")
@RequestMapping(method = RequestMethod.PUT, value = "/wfusers/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<WFUserDTO> wfuserdtos) {
wfuserService.updateBatch(wfuserMapping.toDomain(wfuserdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.wfuserService.get(#wfuser_id),'ibzwf-WFUser-Remove')")
@ApiOperation(value = "删除用户", tags = {"用户" }, notes = "删除用户")
@RequestMapping(method = RequestMethod.DELETE, value = "/wfusers/{wfuser_id}")
......@@ -99,20 +89,23 @@ public class WFUserResource {
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.wfuserMapping.toDomain(returnObject.body),'ibzwf-WFUser-Get')")
@ApiOperation(value = "获取用户", tags = {"用户" }, notes = "获取用户")
@RequestMapping(method = RequestMethod.GET, value = "/wfusers/{wfuser_id}")
public ResponseEntity<WFUserDTO> get(@PathVariable("wfuser_id") String wfuser_id) {
WFUser domain = wfuserService.get(wfuser_id);
WFUserDTO dto = wfuserMapping.toDto(domain);
@PreAuthorize("hasPermission(this.wfuserService.get(#wfuser_id),'ibzwf-WFUser-Update')")
@ApiOperation(value = "更新用户", tags = {"用户" }, notes = "更新用户")
@RequestMapping(method = RequestMethod.PUT, value = "/wfusers/{wfuser_id}")
public ResponseEntity<WFUserDTO> update(@PathVariable("wfuser_id") String wfuser_id, @RequestBody WFUserDTO wfuserdto) {
WFUser domain = wfuserMapping.toDomain(wfuserdto);
domain .setId(wfuser_id);
wfuserService.update(domain );
WFUserDTO dto = wfuserMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取用户草稿", tags = {"用户" }, notes = "获取用户草稿")
@RequestMapping(method = RequestMethod.GET, value = "/wfusers/getdraft")
public ResponseEntity<WFUserDTO> getDraft(WFUserDTO dto) {
WFUser domain = wfuserMapping.toDomain(dto);
return ResponseEntity.status(HttpStatus.OK).body(wfuserMapping.toDto(wfuserService.getDraft(domain)));
@PreAuthorize("hasPermission(this.wfuserService.getWfuserByEntities(this.wfuserMapping.toDomain(#wfuserdtos)),'ibzwf-WFUser-Update')")
@ApiOperation(value = "批量更新用户", tags = {"用户" }, notes = "批量更新用户")
@RequestMapping(method = RequestMethod.PUT, value = "/wfusers/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<WFUserDTO> wfuserdtos) {
wfuserService.updateBatch(wfuserMapping.toDomain(wfuserdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "检查用户", tags = {"用户" }, notes = "检查用户")
......@@ -121,6 +114,13 @@ public class WFUserResource {
return ResponseEntity.status(HttpStatus.OK).body(wfuserService.checkKey(wfuserMapping.toDomain(wfuserdto)));
}
@ApiOperation(value = "获取用户草稿", tags = {"用户" }, notes = "获取用户草稿")
@RequestMapping(method = RequestMethod.GET, value = "/wfusers/getdraft")
public ResponseEntity<WFUserDTO> getDraft(WFUserDTO dto) {
WFUser domain = wfuserMapping.toDomain(dto);
return ResponseEntity.status(HttpStatus.OK).body(wfuserMapping.toDto(wfuserService.getDraft(domain)));
}
@PreAuthorize("hasPermission(this.wfuserMapping.toDomain(#wfuserdto),'ibzwf-WFUser-Save')")
@ApiOperation(value = "保存用户", tags = {"用户" }, notes = "保存用户")
@RequestMapping(method = RequestMethod.POST, value = "/wfusers/save")
......
......@@ -28,6 +28,7 @@ import org.springframework.expression.ExpressionParser;
import org.springframework.expression.spel.standard.SpelExpressionParser;
import org.springframework.expression.spel.support.StandardEvaluationContext;
import org.springframework.stereotype.Component;
import org.springframework.util.ClassUtils;
import org.springframework.util.DigestUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
......@@ -80,7 +81,7 @@ public class DELogicAspect {
if(!ObjectUtils.isEmpty(entity)) {
String id = DEFieldCacheMap.getDEKeyField(entity.getClass());
if(StringUtils.isEmpty(id)) {
log.debug("无法获取实体主键属性[{}]",entity.getClass().getSimpleName());
log.debug("无法获取实体主键属性[{}]",getEntityName(entity));
return point.proceed();
}
entity.set(id, arg);
......@@ -101,6 +102,17 @@ public class DELogicAspect {
return point.proceed();
}
/**
* 判断类是否被代理类代理
*/
private String getEntityName(Object entity){
String entityName = entity.getClass().getSimpleName();
if(entityName.contains("$$")){
entityName = ClassUtils.getUserClass(entity.getClass()).getSimpleName();
}
return entityName;
}
/**
* 前附加逻辑
*
......@@ -108,7 +120,7 @@ public class DELogicAspect {
* @param action
*/
private void executeBeforeLogic(EntityBase entity, String action) {
Resource bpmnFile = getLocalModel(entity.getClass().getSimpleName(), action, LogicExecMode.BEFORE);
Resource bpmnFile = getLocalModel(getEntityName(entity), action, LogicExecMode.BEFORE);
if (bpmnFile != null && bpmnFile.exists() && isValid(bpmnFile, entity, action)) {
executeLogic(bpmnFile, entity, action);
}
......@@ -121,7 +133,7 @@ public class DELogicAspect {
* @param action
*/
private void executeAfterLogic(EntityBase entity, String action) {
Resource bpmnFile = getLocalModel(entity.getClass().getSimpleName(), action, LogicExecMode.AFTER);
Resource bpmnFile = getLocalModel(getEntityName(entity), action, LogicExecMode.AFTER);
if (bpmnFile != null && bpmnFile.exists() && isValid(bpmnFile, entity, action)) {
executeLogic(bpmnFile, entity, action);
}
......@@ -134,7 +146,7 @@ public class DELogicAspect {
* @param action
*/
private void executeLogic(EntityBase entity, String action) {
Resource bpmnFile = getLocalModel(entity.getClass().getSimpleName(), action, LogicExecMode.EXEC);
Resource bpmnFile = getLocalModel(getEntityName(entity), action, LogicExecMode.EXEC);
if (bpmnFile != null && bpmnFile.exists() && isValid(bpmnFile, entity, action)) {
executeLogic(bpmnFile, entity, action);
}
......@@ -148,7 +160,7 @@ public class DELogicAspect {
*/
private void executeLogic(Resource bpmnFile, Object entity, String action) {
try {
log.debug("开始执行实体处理逻辑[{}:{}:{}:本地模式]", entity.getClass().getSimpleName(), action, bpmnFile.getFilename());
log.debug("开始执行实体处理逻辑[{}:{}:{}:本地模式]", getEntityName(entity), action, bpmnFile.getFilename());
String bpmnId = DigestUtils.md5DigestAsHex(bpmnFile.getURL().getPath().getBytes());
DELogic logic = getDELogic(bpmnFile);
if (logic == null) {
......@@ -172,9 +184,9 @@ public class DELogicAspect {
}
}
kieSession.startProcess(mainProcess.getId());
log.debug("实体处理逻辑[{}:{}:{}:本地模式]执行结束", entity.getClass().getSimpleName(), action, bpmnFile.getFilename());
} catch (IOException e) {
log.error("实体处理逻辑[{}:{}:{}:本地模式]发生异常", entity.getClass().getSimpleName(), action, bpmnFile.getFilename());
log.debug("实体处理逻辑[{}:{}:{}:本地模式]执行结束", getEntityName(entity), action, bpmnFile.getFilename());
} catch (Exception e) {
log.error("实体处理逻辑[{}:{}:{}:本地模式]发生异常", getEntityName(entity), action, bpmnFile.getFilename());
throw new BadRequestAlertException("执行实体处理逻辑发生异常" + e.getMessage(), "DELogicAspect", "executeLogic");
}
}
......@@ -414,7 +426,7 @@ public class DELogicAspect {
* @return
*/
private boolean isValid(Resource bpmn, Object entity, Object action) {
String logicId = String.format("%s%s%s", entity.getClass().getSimpleName(), action, bpmn.getFilename()).toLowerCase();
String logicId = String.format("%s%s%s", getEntityName(entity), action, bpmn.getFilename()).toLowerCase();
if (validLogic.containsKey(logicId)) {
return true;
} else {
......
package cn.ibizlab.util.cache.cache;
import cn.ibizlab.util.helper.Globs;
import org.springframework.cache.caffeine.CaffeineCache;
import com.github.benmanes.caffeine.cache.Cache;
import javax.validation.constraints.NotNull;
import java.util.Set;
import java.util.stream.Collectors;
/**
* 自定义的Caffeine缓存
*/
public class CusCaffeineCache extends CaffeineCache{
public CusCaffeineCache(String name, Cache<Object, Object> cache) {
super(name,cache);
}
public CusCaffeineCache(String name, Cache<Object, Object> cache, boolean allowNullValues) {
super(name,cache,allowNullValues);
}
@Override
public void evict(@NotNull Object key) {
if (key instanceof String && ((String) key).startsWith("glob:")) {
String globPattern = ((String)key).split("glob:")[1];
// 将Glob匹配转换成正则匹配
String regexPattern = Globs.toUnixRegexPattern(globPattern);
// String regexPattern = Globs.toWindowsRegexPattern(globPattern);
Cache<Object,Object> cache = super.getNativeCache();
Set<Object> keySet = cache.asMap().keySet();
keySet = keySet.stream().filter(o->o.toString().matches(regexPattern)).collect(Collectors.toSet());
cache.invalidateAll(keySet);
}else{
super.evict(key);
}
}
}
......@@ -4,6 +4,8 @@ import org.springframework.data.redis.cache.RedisCache;
import org.springframework.data.redis.cache.RedisCacheConfiguration;
import org.springframework.data.redis.cache.RedisCacheWriter;
import javax.validation.constraints.NotNull;
/**
* 自定义的redis缓存
*/
......@@ -12,4 +14,18 @@ public class CusRedisCache extends RedisCache {
public CusRedisCache(String name, RedisCacheWriter redisCacheWriter, RedisCacheConfiguration configuration) {
super(name, redisCacheWriter, configuration);
}
@Override
public void evict(@NotNull Object key) {
if (key instanceof String && ((String) key).startsWith("glob:")) {
String globPattern = ((String)key).split("glob:")[1];
byte[] globPatternBytes = super.getCacheConfiguration().getConversionService().convert(globPattern,byte[].class);
if(globPatternBytes!=null){
super.getNativeCache().clean(super.getName(),globPatternBytes);
}
}else{
super.evict(key);
}
}
}
......@@ -15,6 +15,7 @@ import java.util.Collections;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.TimeUnit;
import cn.ibizlab.util.cache.cache.CusCaffeineCache;
import cn.ibizlab.util.cache.cache.CusRedisCache;
import cn.ibizlab.util.cache.cache.LayeringCache;
......@@ -80,7 +81,7 @@ public class LayeringCacheManager implements CacheManager {
* @return
*/
protected Cache createCache(String cacheName) {
return new LayeringCache(cacheName,new CaffeineCache(cacheName, this.cacheBuilder.build(), true),new CusRedisCache(cacheName, redisCacheWriter, redisConfiguration),redisTemplate);
return new LayeringCache(cacheName,new CusCaffeineCache(cacheName, this.cacheBuilder.build(), true),new CusRedisCache(cacheName, redisCacheWriter, redisConfiguration),redisTemplate);
}
/**
......
......@@ -3,6 +3,7 @@ package cn.ibizlab.util.client;
import org.springframework.stereotype.Component;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import java.io.Serializable;
@Component
public class IBZWFFallback implements IBZWFFeignClient {
......@@ -26,4 +27,20 @@ public class IBZWFFallback implements IBZWFFeignClient {
public JSONObject wfstart(String system, String appname, String entity, String businessKey, JSONObject instance) {
return null;
}
@Override
public Map<String, Map<String, Object>> getTask(String system, String userId, String entity, String instTag, String instTag2 ,String taskType) {
return null;
}
@Override
public Map<String, Map<String, Object>> getTaskByStep(String system, String userId, String entity, String instTag, String instTag2 , String taskType, String srfwfstep) {
return null;
}
@Override
public Integer getDataAccessMode(String system, String entity, Serializable businessKey) {
return null;
}
}
......@@ -4,6 +4,7 @@ import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import java.io.Serializable;
@FeignClient(value = "${ibiz.ref.service.wf:ibzwf-api}",contextId = "wf",fallback = IBZWFFallback.class)
public interface IBZWFFeignClient
......@@ -25,4 +26,15 @@ public interface IBZWFFeignClient
@PathVariable("entity") String entity,
@PathVariable("businessKey") String businessKey, @RequestBody JSONObject instance);
@RequestMapping(method = RequestMethod.POST, value = "/{system}-user-{userId}/{insttag}/{insttag2}/{entity}/tasks")
Map<String, Map<String, Object>> getTask(@PathVariable("system") String system, @PathVariable("userId") String userId,
@PathVariable("entity") String entity, @PathVariable("insttag") String instTag, @PathVariable("insttag2") String instTag2, @RequestParam("srfwf") String taskType);
@RequestMapping(method = RequestMethod.POST, value = "/{system}-user-{userId}/{insttag}/{insttag2}/{entity}/tasks")
Map<String, Map<String, Object>> getTaskByStep(@PathVariable("system") String system, @PathVariable("userId") String userId,
@PathVariable("entity") String entity, @PathVariable("insttag") String instTag, @PathVariable("insttag2") String instTag2 , @RequestParam("srfwf") String taskType, @RequestParam("n_taskdefinitionkey_eq") String srfwfstep);
@RequestMapping(method = RequestMethod.GET, value = "/{system}/{entity}/{businessKey}/dataaccessmode")
Integer getDataAccessMode(@PathVariable("system") String system, @PathVariable("entity") String entity, @PathVariable("businessKey") Serializable businessKey);
}
......@@ -17,4 +17,6 @@ public class DELogic implements Serializable {
List<DELogic> refLogic;
List<Resource> refRuleFiles;
String md5;
int logicMode;
long loadedTime;
}
......@@ -43,5 +43,21 @@ public enum DEFieldDefaultValueType {
/**
* 默认值
*/
NONE
NONE,
/**
* 用户自定义
*/
USER,
/**
* 用户自定义2
*/
USER2,
/**
* 用户自定义3
*/
USER3,
/**
* 用户自定义4
*/
USER4
}
......@@ -55,5 +55,17 @@ public enum DEPredefinedFieldType {
/**
* 不处理
*/
NONE
NONE,
/**
* 动态父类型
*/
PARENTTYPE,
/**
* 动态父标识
*/
PARENTID,
/**
* 动态父名称
*/
PARENTNAME
}
package cn.ibizlab.util.helper;
import java.util.regex.PatternSyntaxException;
/**
* Copy from class sun.nio.fs.Globs
*/
public class Globs {
private Globs() { }
private static final String regexMetaChars = ".^$+{[]|()";
private static final String globMetaChars = "\\*?[{";
private static boolean isRegexMeta(char c) {
return regexMetaChars.indexOf(c) != -1;
}
private static boolean isGlobMeta(char c) {
return globMetaChars.indexOf(c) != -1;
}
private static char EOL = 0; //TBD
private static char next(String glob, int i) {
if (i < glob.length()) {
return glob.charAt(i);
}
return EOL;
}
/**
* Creates a regex pattern from the given glob expression.
*
* @throws PatternSyntaxException
*/
private static String toRegexPattern(String globPattern, boolean isDos) {
boolean inGroup = false;
StringBuilder regex = new StringBuilder("^");
int i = 0;
while (i < globPattern.length()) {
char c = globPattern.charAt(i++);
switch (c) {
case '\\':
// escape special characters
if (i == globPattern.length()) {
throw new PatternSyntaxException("No character to escape",
globPattern, i - 1);
}
char next = globPattern.charAt(i++);
if (isGlobMeta(next) || isRegexMeta(next)) {
regex.append('\\');
}
regex.append(next);
break;
case '/':
if (isDos) {
regex.append("\\\\");
} else {
regex.append(c);
}
break;
case '[':
// don't match name separator in class
if (isDos) {
regex.append("[[^\\\\]&&[");
} else {
regex.append("[[^/]&&[");
}
if (next(globPattern, i) == '^') {
// escape the regex negation char if it appears
regex.append("\\^");
i++;
} else {
// negation
if (next(globPattern, i) == '!') {
regex.append('^');
i++;
}
// hyphen allowed at start
if (next(globPattern, i) == '-') {
regex.append('-');
i++;
}
}
boolean hasRangeStart = false;
char last = 0;
while (i < globPattern.length()) {
c = globPattern.charAt(i++);
if (c == ']') {
break;
}
if (c == '/' || (isDos && c == '\\')) {
throw new PatternSyntaxException("Explicit 'name separator' in class",
globPattern, i - 1);
}
// TBD: how to specify ']' in a class?
if (c == '\\' || c == '[' ||
c == '&' && next(globPattern, i) == '&') {
// escape '\', '[' or "&&" for regex class
regex.append('\\');
}
regex.append(c);
if (c == '-') {
if (!hasRangeStart) {
throw new PatternSyntaxException("Invalid range",
globPattern, i - 1);
}
if ((c = next(globPattern, i++)) == EOL || c == ']') {
break;
}
if (c < last) {
throw new PatternSyntaxException("Invalid range",
globPattern, i - 3);
}
regex.append(c);
hasRangeStart = false;
} else {
hasRangeStart = true;
last = c;
}
}
if (c != ']') {
throw new PatternSyntaxException("Missing ']", globPattern, i - 1);
}
regex.append("]]");
break;
case '{':
if (inGroup) {
throw new PatternSyntaxException("Cannot nest groups",
globPattern, i - 1);
}
regex.append("(?:(?:");
inGroup = true;
break;
case '}':
if (inGroup) {
regex.append("))");
inGroup = false;
} else {
regex.append('}');
}
break;
case ',':
if (inGroup) {
regex.append(")|(?:");
} else {
regex.append(',');
}
break;
case '*':
if (next(globPattern, i) == '*') {
// crosses directory boundaries
regex.append(".*");
i++;
} else {
// within directory boundary
if (isDos) {
regex.append("[^\\\\]*");
} else {
regex.append("[^/]*");
}
}
break;
case '?':
if (isDos) {
regex.append("[^\\\\]");
} else {
regex.append("[^/]");
}
break;
default:
if (isRegexMeta(c)) {
regex.append('\\');
}
regex.append(c);
}
}
if (inGroup) {
throw new PatternSyntaxException("Missing '}", globPattern, i - 1);
}
return regex.append('$').toString();
}
public static String toUnixRegexPattern(String globPattern) {
return toRegexPattern(globPattern, false);
}
public static String toWindowsRegexPattern(String globPattern) {
return toRegexPattern(globPattern, true);
}
}
......@@ -280,22 +280,26 @@ public class RuleUtils
}
return finalTime.getTime()<tm.getTime();
}
else if (finalObject instanceof Integer)
{
return (((Integer) finalObject).intValue() < ((Integer)exp).intValue());
}
else if (finalObject instanceof Double)
{
return (((Double) finalObject).doubleValue() < ((Double)exp).doubleValue());
}
else if (finalObject instanceof Float)
{
return (((Float) finalObject).floatValue() < ((Float)exp).floatValue());
}
else if (finalObject instanceof String)
{
return finalObject.toString().compareToIgnoreCase(exp.toString())<0;
}
else if (finalObject instanceof Integer)
{
return Integer.parseInt(finalObject.toString()) < Integer.parseInt(exp.toString());
}
else if (finalObject instanceof Double)
{
return Double.parseDouble(finalObject.toString()) < Double.parseDouble(exp.toString());
}
else if (finalObject instanceof Float)
{
return Float.parseFloat(finalObject.toString()) < Float.parseFloat(exp.toString());
}
else if (finalObject instanceof String)
{
return finalObject.toString().compareToIgnoreCase(exp.toString())<0;
}
else if (finalObject instanceof Long)
{
return Long.parseLong(finalObject.toString()) < Long.parseLong(exp.toString());
}
else
return false;
}
......
......@@ -12,6 +12,7 @@ import org.springframework.http.ResponseEntity;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import java.util.*;
@RestController
......@@ -95,6 +96,26 @@ public class AppController {
return ResponseEntity.ok(ibzConfigService.getConfig(configType,targetType,userId));
}
@RequestMapping(method = RequestMethod.GET, value = "/configs/share/{id}")
public ResponseEntity<JSONObject> getShareConfig(@PathVariable("id") String id) {
JSONObject jo = ibzConfigService.getShareConfig(id);
if (jo == null) {
throw new BadRequestAlertException("无效的共享配置数据", "IBZConfig", id);
}
return ResponseEntity.ok(jo);
}
@RequestMapping(method = RequestMethod.GET, value = "/configs/share/{configType}/{targetType}")
public ResponseEntity<String> shareConfig(@PathVariable("configType") String configType, @PathVariable("targetType") String targetType) {
String userId = AuthenticationUser.getAuthenticationUser().getUserid();
if (StringUtils.isEmpty(userId)) {
throw new BadRequestAlertException("分享配置失败,参数缺失", "IBZConfig", configType);
}
String id = IdWorker.get32UUID();
ibzConfigService.saveShareConfig(id, configType, targetType, userId);
return ResponseEntity.ok(id);
}
/**
* 应用参数扩展
* @param appData
......
......@@ -9,6 +9,10 @@ import java.io.Serializable;
@AllArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true)
public class AuthenticationInfo implements Serializable {
private final String token;
private final AuthenticationUser user;
private String token;
private AuthenticationUser user;
public AuthenticationInfo() {
}
}
......@@ -260,7 +260,6 @@ public class AuthenticationUser implements UserDetails
{
sessionParams = getUserSessionParam();
sessionParams.put("srfsystemid",this.getSrfsystemid());
sessionParams.put("srfdynainstid",this.getSrfdynainstid());
sessionParams.put("srfpersonid", this.getUserid());
sessionParams.put("srfpersonname", this.getPersonname());
sessionParams.put("srforgsectorid", this.getMdeptid());
......
......@@ -24,7 +24,7 @@ public interface AuthenticationUserService extends UserDetailsService {
@Cacheable( value="ibzuaa_users", key = "'getByUsername:'+#p0")
AuthenticationUser loadUserByLogin(String username,String password);
@CacheEvict( value="ibzuaa_users", key = "'getByUsername:'+#p0")
@CacheEvict( value="ibzuaa_users", key = "'glob:*getByUsername:'+#p0")
default void resetByUsername(String username){}
......
......@@ -64,4 +64,14 @@ public class IBZConfigService extends ServiceImpl<IBZConfigMapper, IBZConfig> im
this.remove(Wrappers.query(IBZConfig.builder().systemId(systemId).cfgType(cfgType).targetType(targetType).userId(userId).build()));
}
@Cacheable(value="ibzrt_shareconfigs",key = "'cfgid:'+#p0")
public JSONObject saveShareConfig(String id, String cfgType,String targetType,String userId){
return this.getConfig(cfgType, targetType, userId);
}
@Cacheable(value="ibzrt_shareconfigs",key = "'cfgid:'+#p0")
public JSONObject getShareConfig(String id){
return null;
}
}
\ No newline at end of file
package cn.ibizlab.util.web;
import cn.ibizlab.util.filter.SearchContextBase;
import cn.ibizlab.util.domain.DTOBase;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.core.MethodParameter;
......@@ -24,7 +25,7 @@ public class SearchContextHandlerMethodArgumentResolver implements HandlerMethod
@Override
public boolean supportsParameter(MethodParameter parameter) {
return SearchContextBase.class.isAssignableFrom(parameter.getParameterType());
return SearchContextBase.class.isAssignableFrom(parameter.getParameterType()) || DTOBase.class.isAssignableFrom(parameter.getParameterType());
}
@Override
......@@ -35,7 +36,7 @@ public class SearchContextHandlerMethodArgumentResolver implements HandlerMethod
for (String key : params.keySet()) {
set.put(key,params.get(key)[0]);
}
if((!set.containsKey("size")) ){
if(SearchContextBase.class.isAssignableFrom(parameter.getParameterType()) && (!set.containsKey("size"))){
set.put("size", pageLimit);
}
String json = objectMapper.writeValueAsString(set);
......
......@@ -23,7 +23,7 @@ spring:
datasource:
username: a_A_5d9d78509
password: '@6dEfb3@'
url: jdbc:mysql://172.16.180.232:3306/a_A_5d9d78509?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true
url: jdbc:mysql://172.16.180.232:3306/a_A_5d9d78509?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true&serverTimezone=GMT%2B8
driver-class-name: com.mysql.jdbc.Driver
isSyncDBSchema: false
defaultSchema: a_A_5d9d78509
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册