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

ibizdev提交

上级 180035cf
## v7.0.0-alpha.4 [2020-5-14]
### Bug修复
修复代码表代码项图标和数据
修复数据多项选择视图UI逻辑不匹配
修复列表高度异常
修复树节点上下文
修复表格(视图)高度,滚动条问题
修复表单loaddraft服务仿真主键丢失修复
修复user显示名称逻辑
修复issue地址为正式环境地址
### 功能新增及优化
#### 模板
模态时视图样式调整
增加菜单权限
增加快速分组搜索或快速搜索表单功能
增加表格内置工具栏
代码表多选控件分割符从分号转化为逗号
#### 基础文件
增加数据选择类插件表格呈现插件
## v7.0.0-alpha.3 [2020-5-10]
### Bug修复
......@@ -65,3 +106,5 @@
## v7.0.0-alpha.1 [2020-4-29]
初始化文件
......@@ -47,6 +47,14 @@ export default class AppFormDRUIPart extends Vue {
*/
@Prop({ default: '' }) public refreshitems!: string;
/**
* 禁止加载
*
* @type {string}
* @memberof AppFormDRUIPart
*/
@Prop({ default: false }) public isForbidLoad!: boolean;
/**
* 关系视图类型
*
......@@ -254,7 +262,11 @@ export default class AppFormDRUIPart extends Vue {
this.blockUIStop();
}
}
this.formDruipart.next({action:'load',data:{srfparentdename:this.parentName,srfparentkey:_paramitem}});
if(!this.isForbidLoad){
this.$nextTick(() => {
this.formDruipart.next({action:'load',data:{srfparentdename:this.parentName,srfparentkey:_paramitem}});
});
}
}
/**
......
......@@ -22,7 +22,7 @@ export const Environment = {
// 是否为开发模式
devMode: true,
// 项目模板地址
ProjectUrl: "http://demo.ibizlab.cn/groups/ibizr7pfstdtempl",
ProjectUrl: "http://demo.ibizlab.cn/ibizr7pfstdtempl/ibizvuer7",
// 配置平台地址
StudioUrl: "http://172.16.170.145/slnstudio/",
// 中心标识
......
......@@ -25,7 +25,7 @@ mock.onGet('v7/wfindex-viewappmenu').reply((config: any) => {
iconcls: 'fa fa-random',
icon: '',
textcls: '',
appfunctag: '_2',
appfunctag: 'Auto1',
resourcetag: '',
},
{
......@@ -43,7 +43,7 @@ mock.onGet('v7/wfindex-viewappmenu').reply((config: any) => {
iconcls: 'fa fa-arrow-circle-o-up',
icon: '',
textcls: '',
appfunctag: '_4',
appfunctag: 'Auto3',
resourcetag: '',
},
{
......@@ -61,7 +61,7 @@ mock.onGet('v7/wfindex-viewappmenu').reply((config: any) => {
iconcls: 'fa fa-users',
icon: '',
textcls: '',
appfunctag: '_3',
appfunctag: 'Auto2',
resourcetag: '',
},
],
......
......@@ -1228,14 +1228,14 @@ export default class WFGroupEditViewBase extends Vue {
const data: any = {};
if (args.length > 0) {
Object.assign(data, { srfsourcekey: args[0].srfkey })
actionContext.$store.commit('addCopyData', { srfkey: args[0].srfkey, copyData: args[0] });
}
_this.newdata([{ ...data }],[{ ...data }],params, $event, xData);
} else if (xData && xData.copy instanceof Function) {
const data2: any = {};
if (args.length > 0) {
Object.assign(data2, { srfsourcekey: args[0].srfkey })
actionContext.$store.commit('addCopyData', { srfkey: args[0].srfkey, copyData: args[0] });
}
xData.copy(data2);
xData.copy(args[0].srfkey);
} else {
_this.$Notice.error({ title: '错误', desc: 'opendata 视图处理逻辑不存在,请添加!' });
}
......
......@@ -1093,6 +1093,9 @@ export default class WFGroupGridViewBase extends Vue {
*/
public newdata(args: any[],fullargs?:any[], params?: any, $event?: any, xData?: any) {
const data: any = {};
if(args[0].srfsourcekey){
data.srfsourcekey = args[0].srfsourcekey;
}
let curViewParam = JSON.parse(JSON.stringify(this.context));
if(args.length >0){
Object.assign(curViewParam,args[0]);
......@@ -1235,14 +1238,14 @@ export default class WFGroupGridViewBase extends Vue {
const data: any = {};
if (args.length > 0) {
Object.assign(data, { srfsourcekey: args[0].srfkey })
actionContext.$store.commit('addCopyData', { srfkey: args[0].srfkey, copyData: args[0] });
}
_this.newdata([{ ...data }],[{ ...data }],params, $event, xData);
} else if (xData && xData.copy instanceof Function) {
const data2: any = {};
if (args.length > 0) {
Object.assign(data2, { srfsourcekey: args[0].srfkey })
actionContext.$store.commit('addCopyData', { srfkey: args[0].srfkey, copyData: args[0] });
}
xData.copy(data2);
xData.copy(args[0].srfkey);
} else {
_this.$Notice.error({ title: '错误', desc: 'opendata 视图处理逻辑不存在,请添加!' });
}
......
......@@ -1228,14 +1228,14 @@ export default class WFMemberEditViewBase extends Vue {
const data: any = {};
if (args.length > 0) {
Object.assign(data, { srfsourcekey: args[0].srfkey })
actionContext.$store.commit('addCopyData', { srfkey: args[0].srfkey, copyData: args[0] });
}
_this.newdata([{ ...data }],[{ ...data }],params, $event, xData);
} else if (xData && xData.copy instanceof Function) {
const data2: any = {};
if (args.length > 0) {
Object.assign(data2, { srfsourcekey: args[0].srfkey })
actionContext.$store.commit('addCopyData', { srfkey: args[0].srfkey, copyData: args[0] });
}
xData.copy(data2);
xData.copy(args[0].srfkey);
} else {
_this.$Notice.error({ title: '错误', desc: 'opendata 视图处理逻辑不存在,请添加!' });
}
......
......@@ -1266,14 +1266,14 @@ export default class WFMemberGridViewBase extends Vue {
const data: any = {};
if (args.length > 0) {
Object.assign(data, { srfsourcekey: args[0].srfkey })
actionContext.$store.commit('addCopyData', { srfkey: args[0].srfkey, copyData: args[0] });
}
_this.newdata([{ ...data }],[{ ...data }],params, $event, xData);
} else if (xData && xData.copy instanceof Function) {
const data2: any = {};
if (args.length > 0) {
Object.assign(data2, { srfsourcekey: args[0].srfkey })
actionContext.$store.commit('addCopyData', { srfkey: args[0].srfkey, copyData: args[0] });
}
xData.copy(data2);
xData.copy(args[0].srfkey);
} else {
_this.$Notice.error({ title: '错误', desc: 'opendata 视图处理逻辑不存在,请添加!' });
}
......
......@@ -1228,14 +1228,14 @@ export default class WFProcessDefinitionEditViewBase extends Vue {
const data: any = {};
if (args.length > 0) {
Object.assign(data, { srfsourcekey: args[0].srfkey })
actionContext.$store.commit('addCopyData', { srfkey: args[0].srfkey, copyData: args[0] });
}
_this.newdata([{ ...data }],[{ ...data }],params, $event, xData);
} else if (xData && xData.copy instanceof Function) {
const data2: any = {};
if (args.length > 0) {
Object.assign(data2, { srfsourcekey: args[0].srfkey })
actionContext.$store.commit('addCopyData', { srfkey: args[0].srfkey, copyData: args[0] });
}
xData.copy(data2);
xData.copy(args[0].srfkey);
} else {
_this.$Notice.error({ title: '错误', desc: 'opendata 视图处理逻辑不存在,请添加!' });
}
......
......@@ -1093,6 +1093,9 @@ export default class WFProcessDefinitionGridViewBase extends Vue {
*/
public newdata(args: any[],fullargs?:any[], params?: any, $event?: any, xData?: any) {
const data: any = {};
if(args[0].srfsourcekey){
data.srfsourcekey = args[0].srfsourcekey;
}
let curViewParam = JSON.parse(JSON.stringify(this.context));
if(args.length >0){
Object.assign(curViewParam,args[0]);
......@@ -1235,14 +1238,14 @@ export default class WFProcessDefinitionGridViewBase extends Vue {
const data: any = {};
if (args.length > 0) {
Object.assign(data, { srfsourcekey: args[0].srfkey })
actionContext.$store.commit('addCopyData', { srfkey: args[0].srfkey, copyData: args[0] });
}
_this.newdata([{ ...data }],[{ ...data }],params, $event, xData);
} else if (xData && xData.copy instanceof Function) {
const data2: any = {};
if (args.length > 0) {
Object.assign(data2, { srfsourcekey: args[0].srfkey })
actionContext.$store.commit('addCopyData', { srfkey: args[0].srfkey, copyData: args[0] });
}
xData.copy(data2);
xData.copy(args[0].srfkey);
} else {
_this.$Notice.error({ title: '错误', desc: 'opendata 视图处理逻辑不存在,请添加!' });
}
......
......@@ -1228,14 +1228,14 @@ export default class WFUserEditViewBase extends Vue {
const data: any = {};
if (args.length > 0) {
Object.assign(data, { srfsourcekey: args[0].srfkey })
actionContext.$store.commit('addCopyData', { srfkey: args[0].srfkey, copyData: args[0] });
}
_this.newdata([{ ...data }],[{ ...data }],params, $event, xData);
} else if (xData && xData.copy instanceof Function) {
const data2: any = {};
if (args.length > 0) {
Object.assign(data2, { srfsourcekey: args[0].srfkey })
actionContext.$store.commit('addCopyData', { srfkey: args[0].srfkey, copyData: args[0] });
}
xData.copy(data2);
xData.copy(args[0].srfkey);
} else {
_this.$Notice.error({ title: '错误', desc: 'opendata 视图处理逻辑不存在,请添加!' });
}
......
......@@ -1093,6 +1093,9 @@ export default class WFUserGridViewBase extends Vue {
*/
public newdata(args: any[],fullargs?:any[], params?: any, $event?: any, xData?: any) {
const data: any = {};
if(args[0].srfsourcekey){
data.srfsourcekey = args[0].srfsourcekey;
}
let curViewParam = JSON.parse(JSON.stringify(this.context));
if(args.length >0){
Object.assign(curViewParam,args[0]);
......@@ -1235,14 +1238,14 @@ export default class WFUserGridViewBase extends Vue {
const data: any = {};
if (args.length > 0) {
Object.assign(data, { srfsourcekey: args[0].srfkey })
actionContext.$store.commit('addCopyData', { srfkey: args[0].srfkey, copyData: args[0] });
}
_this.newdata([{ ...data }],[{ ...data }],params, $event, xData);
} else if (xData && xData.copy instanceof Function) {
const data2: any = {};
if (args.length > 0) {
Object.assign(data2, { srfsourcekey: args[0].srfkey })
actionContext.$store.commit('addCopyData', { srfkey: args[0].srfkey, copyData: args[0] });
}
xData.copy(data2);
xData.copy(args[0].srfkey);
} else {
_this.$Notice.error({ title: '错误', desc: 'opendata 视图处理逻辑不存在,请添加!' });
}
......
......@@ -75,4 +75,17 @@ export const getZIndex = (state: any) => () => {
*/
export const getViewSplit = (state: any) => (viewUID: string) => {
return state.viewSplit[viewUID];
}
/**
* 获取拷贝数据
*
* @param state
*/
export const getCopyData = (state: any) => (srfkey: string) => {
let copyData = state.copyDataMap[srfkey];
if(copyData){
delete state.copyDataMap[srfkey];
}
return copyData;
}
\ No newline at end of file
......@@ -253,4 +253,16 @@ export const updateZIndex = (state: any, zIndex: number) => {
*/
export const setViewSplit = (state: any, args: {viewSplit: number,viewUID:string}) => {
state.viewSplit[args.viewUID] = args.viewSplit;
}
/**
* 添加拷贝数据
*
* @param state
* @param localdata
*/
export const addCopyData = (state: any, args: {srfkey: string,copyData: any}) => {
if(args && args.srfkey && args.copyData){
state.copyDataMap[args.srfkey] = JSON.parse(JSON.stringify(args.copyData));
}
}
\ No newline at end of file
......@@ -13,4 +13,5 @@ export const rootstate: any = {
localdata: {},
zIndex: 300,
viewSplit: {},
copyDataMap:{},
}
\ No newline at end of file
......@@ -92,7 +92,7 @@ export class StudioActionUtil {
const config: any = await this.getConfig(viewName);
if (config) {
const context: string = `视图模块:${config.viewmodule}\n视图标识:${config.viewname}\n视图类型:${config.viewtype}\n`;
window.open(`${Environment.ProjectUrl}/issues/`, '_blank');
window.open(`${Environment.ProjectUrl}/issues/new?issue[title]=${encodeURIComponent('问题')}&issue[description]=${encodeURIComponent(context)}`, '_blank');
}
}
......
......@@ -558,14 +558,14 @@ export default class WFIndexViewBase extends Vue implements ControlInterface {
public click(item: any) {
if (item) {
switch (item.appfunctag) {
case '_4':
this.click_4(item);
case 'Auto3':
this.clickAuto3(item);
return;
case '_2':
this.click_2(item);
case 'Auto1':
this.clickAuto1(item);
return;
case '_3':
this.click_3(item);
case 'Auto2':
this.clickAuto2(item);
return;
default:
console.warn('未指定应用功能');
......@@ -580,7 +580,7 @@ export default class WFIndexViewBase extends Vue implements ControlInterface {
* @param {*} [item={}]
* @memberof WFIndexView
*/
public click_4(item: any = {}) {
public clickAuto3(item: any = {}) {
const viewparam: any = {};
Object.assign(viewparam, {});
const deResParameters: any[] = [];
......@@ -598,7 +598,7 @@ export default class WFIndexViewBase extends Vue implements ControlInterface {
* @param {*} [item={}]
* @memberof WFIndexView
*/
public click_2(item: any = {}) {
public clickAuto1(item: any = {}) {
const viewparam: any = {};
Object.assign(viewparam, {});
const deResParameters: any[] = [];
......@@ -616,7 +616,7 @@ export default class WFIndexViewBase extends Vue implements ControlInterface {
* @param {*} [item={}]
* @memberof WFIndexView
*/
public click_3(item: any = {}) {
public clickAuto2(item: any = {}) {
const viewparam: any = {};
Object.assign(viewparam, {});
const deResParameters: any[] = [];
......
......@@ -29,7 +29,7 @@ export default class WFIndexViewModel {
iconcls: 'fa fa-random',
icon: '',
textcls: '',
appfunctag: '_2',
appfunctag: 'Auto1',
resourcetag: '',
},
{
......@@ -47,7 +47,7 @@ export default class WFIndexViewModel {
iconcls: 'fa fa-arrow-circle-o-up',
icon: '',
textcls: '',
appfunctag: '_4',
appfunctag: 'Auto3',
resourcetag: '',
},
{
......@@ -65,7 +65,7 @@ export default class WFIndexViewModel {
iconcls: 'fa fa-users',
icon: '',
textcls: '',
appfunctag: '_3',
appfunctag: 'Auto2',
resourcetag: '',
},
];
......@@ -79,7 +79,7 @@ export default class WFIndexViewModel {
*/
public funcs: any[] = [
{
appfunctag: '_4',
appfunctag: 'Auto3',
appfuncyype: 'APPVIEW',
openmode: '',
codename: 'wfremodeleditview',
......@@ -91,7 +91,7 @@ export default class WFIndexViewModel {
],
},
{
appfunctag: '_2',
appfunctag: 'Auto1',
appfuncyype: 'APPVIEW',
openmode: '',
codename: 'wfprocessdefinitiongridview',
......@@ -103,7 +103,7 @@ export default class WFIndexViewModel {
],
},
{
appfunctag: '_3',
appfunctag: 'Auto2',
appfuncyype: 'APPVIEW',
openmode: '',
codename: 'wfgroupgridview',
......
......@@ -282,8 +282,9 @@ export default class DefaultService extends ControlService {
public loadDraft(action: string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
//仿真主键数据
Data.id = Util.createUUID();
Data.wfgroup = Data.id;
const PrimaryKey = Util.createUUID();
Data.id = PrimaryKey;
Data.wfgroup = PrimaryKey;
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
......@@ -293,6 +294,7 @@ export default class DefaultService extends ControlService {
result = this.appEntityService.GetDraft(Context,Data, isloading);
}
result.then((response) => {
response.data.id = PrimaryKey;
this.handleResponse(action, response, true);
resolve(response);
}).catch(response => {
......
......@@ -22,6 +22,7 @@
<app-form-druipart
:formState="formState"
:isForbidLoad="this.data.srfuf === '0'"
paramItem='wfgroup'
:parentdata='{"srfparentdefname":"GROUPID","srfparentdename":"WF_GROUP","SRFPARENTTYPE":"DER1N","srfparentmode":"DER1N_WF_GROUP_MEMBER_WF_GROUP_GROUPID","SRFDER1NID":"DER1N_WF_GROUP_MEMBER_WF_GROUP_GROUPID"}'
:parameters="[
......@@ -887,7 +888,11 @@ export default class MainBase extends Vue implements ControlInterface {
this.load(data);
}
if (Object.is('loaddraft', action)) {
this.loadDraft(data);
if(this.context.srfsourcekey){
this.copy(this.context.srfsourcekey);
}else{
this.loadDraft(data);
}
}
if (Object.is('save', action)) {
this.save(data,data.showResultInfo);
......@@ -951,8 +956,18 @@ export default class MainBase extends Vue implements ControlInterface {
* @param {*} [arg={}]
* @memberof @memberof Main
*/
public copy(arg: any = {}): void {
this.loadDraft(arg);
public copy(srfkey: string): void {
let copyData = this.$store.getters.getCopyData(srfkey);
copyData.srfkey = Util.createUUID();
copyData.wfgroup = copyData.srfkey;
copyData.id = copyData.srfkey;
Object.assign(this.context,{wfgroup:copyData.wfgroup})
this.data = copyData;
this.$nextTick(() => {
this.formState.next({ type: 'load', data: copyData });
this.data.srfuf = '0';
this.setFormEnableCond(this.data);
});
}
/**
......
......@@ -282,8 +282,9 @@ export default class MainService extends ControlService {
public loadDraft(action: string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
//仿真主键数据
Data.id = Util.createUUID();
Data.wfgroup = Data.id;
const PrimaryKey = Util.createUUID();
Data.id = PrimaryKey;
Data.wfgroup = PrimaryKey;
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
......@@ -293,6 +294,7 @@ export default class MainService extends ControlService {
result = this.appEntityService.GetDraft(Context,Data, isloading);
}
result.then((response) => {
response.data.id = PrimaryKey;
this.handleResponse(action, response, true);
resolve(response);
}).catch(response => {
......
......@@ -264,7 +264,7 @@ export default class MainService extends ControlService {
if(response.data){
Object.assign(response.data,{srfuf:'0'});
//仿真主键数据
response.data.wfgroup = Util.createUUID();
response.data.id = Util.createUUID();
}
this.handleResponse(action, response, true);
this.mergeDefaults(response);
......
......@@ -282,8 +282,9 @@ export default class DefaultService extends ControlService {
public loadDraft(action: string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
//仿真主键数据
Data.memberid = Util.createUUID();
Data.wfmember = Data.memberid;
const PrimaryKey = Util.createUUID();
Data.memberid = PrimaryKey;
Data.wfmember = PrimaryKey;
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
......@@ -293,6 +294,7 @@ export default class DefaultService extends ControlService {
result = this.appEntityService.GetDraft(Context,Data, isloading);
}
result.then((response) => {
response.data.memberid = PrimaryKey;
this.handleResponse(action, response, true);
resolve(response);
}).catch(response => {
......
......@@ -896,7 +896,11 @@ export default class MainBase extends Vue implements ControlInterface {
this.load(data);
}
if (Object.is('loaddraft', action)) {
this.loadDraft(data);
if(this.context.srfsourcekey){
this.copy(this.context.srfsourcekey);
}else{
this.loadDraft(data);
}
}
if (Object.is('save', action)) {
this.save(data,data.showResultInfo);
......@@ -960,8 +964,18 @@ export default class MainBase extends Vue implements ControlInterface {
* @param {*} [arg={}]
* @memberof @memberof Main
*/
public copy(arg: any = {}): void {
this.loadDraft(arg);
public copy(srfkey: string): void {
let copyData = this.$store.getters.getCopyData(srfkey);
copyData.srfkey = Util.createUUID();
copyData.wfmember = copyData.srfkey;
copyData.memberid = copyData.srfkey;
Object.assign(this.context,{wfmember:copyData.wfmember})
this.data = copyData;
this.$nextTick(() => {
this.formState.next({ type: 'load', data: copyData });
this.data.srfuf = '0';
this.setFormEnableCond(this.data);
});
}
/**
......
......@@ -294,8 +294,9 @@ export default class MainService extends ControlService {
public loadDraft(action: string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
//仿真主键数据
Data.memberid = Util.createUUID();
Data.wfmember = Data.memberid;
const PrimaryKey = Util.createUUID();
Data.memberid = PrimaryKey;
Data.wfmember = PrimaryKey;
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
......@@ -305,6 +306,7 @@ export default class MainService extends ControlService {
result = this.appEntityService.GetDraft(Context,Data, isloading);
}
result.then((response) => {
response.data.memberid = PrimaryKey;
this.handleResponse(action, response, true);
resolve(response);
}).catch(response => {
......
......@@ -264,7 +264,7 @@ export default class MainService extends ControlService {
if(response.data){
Object.assign(response.data,{srfuf:'0'});
//仿真主键数据
response.data.wfmember = Util.createUUID();
response.data.memberid = Util.createUUID();
}
this.handleResponse(action, response, true);
this.mergeDefaults(response);
......
......@@ -282,8 +282,9 @@ export default class DefaultService extends ControlService {
public loadDraft(action: string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
//仿真主键数据
Data.definitionkey = Util.createUUID();
Data.wfprocessdefinition = Data.definitionkey;
const PrimaryKey = Util.createUUID();
Data.definitionkey = PrimaryKey;
Data.wfprocessdefinition = PrimaryKey;
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
......@@ -293,6 +294,7 @@ export default class DefaultService extends ControlService {
result = this.appEntityService.GetDraft(Context,Data, isloading);
}
result.then((response) => {
response.data.definitionkey = PrimaryKey;
this.handleResponse(action, response, true);
resolve(response);
}).catch(response => {
......
......@@ -1001,7 +1001,11 @@ export default class MainBase extends Vue implements ControlInterface {
this.load(data);
}
if (Object.is('loaddraft', action)) {
this.loadDraft(data);
if(this.context.srfsourcekey){
this.copy(this.context.srfsourcekey);
}else{
this.loadDraft(data);
}
}
if (Object.is('save', action)) {
this.save(data,data.showResultInfo);
......@@ -1065,8 +1069,18 @@ export default class MainBase extends Vue implements ControlInterface {
* @param {*} [arg={}]
* @memberof @memberof Main
*/
public copy(arg: any = {}): void {
this.loadDraft(arg);
public copy(srfkey: string): void {
let copyData = this.$store.getters.getCopyData(srfkey);
copyData.srfkey = Util.createUUID();
copyData.wfprocessdefinition = copyData.srfkey;
copyData.definitionkey = copyData.srfkey;
Object.assign(this.context,{wfprocessdefinition:copyData.wfprocessdefinition})
this.data = copyData;
this.$nextTick(() => {
this.formState.next({ type: 'load', data: copyData });
this.data.srfuf = '0';
this.setFormEnableCond(this.data);
});
}
/**
......
......@@ -282,8 +282,9 @@ export default class MainService extends ControlService {
public loadDraft(action: string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
//仿真主键数据
Data.definitionkey = Util.createUUID();
Data.wfprocessdefinition = Data.definitionkey;
const PrimaryKey = Util.createUUID();
Data.definitionkey = PrimaryKey;
Data.wfprocessdefinition = PrimaryKey;
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
......@@ -293,6 +294,7 @@ export default class MainService extends ControlService {
result = this.appEntityService.GetDraft(Context,Data, isloading);
}
result.then((response) => {
response.data.definitionkey = PrimaryKey;
this.handleResponse(action, response, true);
resolve(response);
}).catch(response => {
......
......@@ -264,7 +264,7 @@ export default class MainService extends ControlService {
if(response.data){
Object.assign(response.data,{srfuf:'0'});
//仿真主键数据
response.data.wfprocessdefinition = Util.createUUID();
response.data.definitionkey = Util.createUUID();
}
this.handleResponse(action, response, true);
this.mergeDefaults(response);
......
......@@ -833,7 +833,11 @@ export default class MainBase extends Vue implements ControlInterface {
this.load(data);
}
if (Object.is('loaddraft', action)) {
this.loadDraft(data);
if(this.context.srfsourcekey){
this.copy(this.context.srfsourcekey);
}else{
this.loadDraft(data);
}
}
if (Object.is('save', action)) {
this.save(data,data.showResultInfo);
......@@ -897,8 +901,18 @@ export default class MainBase extends Vue implements ControlInterface {
* @param {*} [arg={}]
* @memberof @memberof Main
*/
public copy(arg: any = {}): void {
this.loadDraft(arg);
public copy(srfkey: string): void {
let copyData = this.$store.getters.getCopyData(srfkey);
copyData.srfkey = Util.createUUID();
copyData.wfremodel = copyData.srfkey;
copyData.id = copyData.srfkey;
Object.assign(this.context,{wfremodel:copyData.wfremodel})
this.data = copyData;
this.$nextTick(() => {
this.formState.next({ type: 'load', data: copyData });
this.data.srfuf = '0';
this.setFormEnableCond(this.data);
});
}
/**
......
......@@ -282,8 +282,9 @@ export default class MainService extends ControlService {
public loadDraft(action: string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
//仿真主键数据
Data.id = Util.createUUID();
Data.wfremodel = Data.id;
const PrimaryKey = Util.createUUID();
Data.id = PrimaryKey;
Data.wfremodel = PrimaryKey;
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
......@@ -293,6 +294,7 @@ export default class MainService extends ControlService {
result = this.appEntityService.GetDraft(Context,Data, isloading);
}
result.then((response) => {
response.data.id = PrimaryKey;
this.handleResponse(action, response, true);
resolve(response);
}).catch(response => {
......
......@@ -282,8 +282,9 @@ export default class DefaultService extends ControlService {
public loadDraft(action: string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
//仿真主键数据
Data.id = Util.createUUID();
Data.wfuser = Data.id;
const PrimaryKey = Util.createUUID();
Data.id = PrimaryKey;
Data.wfuser = PrimaryKey;
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
......@@ -293,6 +294,7 @@ export default class DefaultService extends ControlService {
result = this.appEntityService.GetDraft(Context,Data, isloading);
}
result.then((response) => {
response.data.id = PrimaryKey;
this.handleResponse(action, response, true);
resolve(response);
}).catch(response => {
......
......@@ -861,7 +861,11 @@ export default class MainBase extends Vue implements ControlInterface {
this.load(data);
}
if (Object.is('loaddraft', action)) {
this.loadDraft(data);
if(this.context.srfsourcekey){
this.copy(this.context.srfsourcekey);
}else{
this.loadDraft(data);
}
}
if (Object.is('save', action)) {
this.save(data,data.showResultInfo);
......@@ -925,8 +929,18 @@ export default class MainBase extends Vue implements ControlInterface {
* @param {*} [arg={}]
* @memberof @memberof Main
*/
public copy(arg: any = {}): void {
this.loadDraft(arg);
public copy(srfkey: string): void {
let copyData = this.$store.getters.getCopyData(srfkey);
copyData.srfkey = Util.createUUID();
copyData.wfuser = copyData.srfkey;
copyData.id = copyData.srfkey;
Object.assign(this.context,{wfuser:copyData.wfuser})
this.data = copyData;
this.$nextTick(() => {
this.formState.next({ type: 'load', data: copyData });
this.data.srfuf = '0';
this.setFormEnableCond(this.data);
});
}
/**
......
......@@ -282,8 +282,9 @@ export default class MainService extends ControlService {
public loadDraft(action: string,context: any = {}, data: any = {}, isloading?: boolean): Promise<any> {
const {data:Data,context:Context} = this.handleRequestData(action,context,data);
//仿真主键数据
Data.id = Util.createUUID();
Data.wfuser = Data.id;
const PrimaryKey = Util.createUUID();
Data.id = PrimaryKey;
Data.wfuser = PrimaryKey;
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.appEntityService;
......@@ -293,6 +294,7 @@ export default class MainService extends ControlService {
result = this.appEntityService.GetDraft(Context,Data, isloading);
}
result.then((response) => {
response.data.id = PrimaryKey;
this.handleResponse(action, response, true);
resolve(response);
}).catch(response => {
......
......@@ -264,7 +264,7 @@ export default class MainService extends ControlService {
if(response.data){
Object.assign(response.data,{srfuf:'0'});
//仿真主键数据
response.data.wfuser = Util.createUUID();
response.data.id = Util.createUUID();
}
this.handleResponse(action, response, true);
this.mergeDefaults(response);
......
......@@ -13,4 +13,5 @@ services:
networks:
agent_network:
driver: overlay
attachable: true
\ No newline at end of file
attachable: true
......@@ -42,6 +42,9 @@ public class webSecurityConfig extends WebSecurityConfigurerAdapter {
@Value("${ibiz.auth.path:v7/login}")
private String loginPath;
@Value("${ibiz.auth.logoutpath:v7/logout}")
private String logoutPath;
@Value("${ibiz.file.uploadpath:ibizutil/upload}")
private String uploadpath;
......@@ -107,6 +110,8 @@ public class webSecurityConfig extends WebSecurityConfigurerAdapter {
).permitAll()
//放行登录请求
.antMatchers( HttpMethod.POST,"/"+loginPath).permitAll()
//放行注销请求
.antMatchers( HttpMethod.GET,"/"+logoutPath).permitAll()
// 文件操作
.antMatchers("/"+downloadpath+"/**").permitAll()
.antMatchers("/"+uploadpath).permitAll()
......
server:
port: 8080
port: 30003
#zuul网关路由设置
zuul:
routes:
......
......@@ -41,6 +41,9 @@ public class DevBootSecurityConfig extends WebSecurityConfigurerAdapter {
@Value("${ibiz.auth.path:v7/login}")
private String loginPath;
@Value("${ibiz.auth.logoutpath:v7/logout}")
private String logoutPath;
@Value("${ibiz.file.uploadpath:ibizutil/upload}")
private String uploadpath;
......@@ -102,6 +105,8 @@ public class DevBootSecurityConfig extends WebSecurityConfigurerAdapter {
).permitAll()
//放行登录请求
.antMatchers( HttpMethod.POST,"/"+loginPath).permitAll()
//放行注销请求
.antMatchers( HttpMethod.GET,"/"+logoutPath).permitAll()
// 文件操作
.antMatchers("/"+downloadpath+"/**").permitAll()
.antMatchers("/"+uploadpath).permitAll()
......
server:
port: 8080
#zuul网关路由设置
zuul:
routes:
......
{
"unires":[
],
"predefineddatarange":[{"id":"ALL","name":"全部数据"},{"id":"CURORG","name":"当前单位"},{"id":"PORG","name":"上级单位"},{"id":"SORG","name":"下级单位"},{"id":"CURORGDEPT","name":"当前部门"},{"id":"PORGDEPT","name":"上级部门"},{"id":"SORGDEPT","name":"下级部门"}],
"entities":[
],
"appmenus":[
{
"appid":"web",
"appname":"统一工作流",
"appmenu":[{"menuid":"WFIndexView", "menuname":"WFIndexView", "menuitem":[{ "id":"menuitem1" , "name":"流程定义" },{ "id":"menuitem3" , "name":"发布新流程" },{ "id":"menuitem2" , "name":"用户组" }] }]
}
]
}
此差异已折叠。
......@@ -13,4 +13,5 @@ services:
networks:
agent_network:
driver: overlay
attachable: true
\ No newline at end of file
attachable: true
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>ibzwf</artifactId>
<groupId>cn.ibizlab</groupId>
<version>1.0.0.0</version>
</parent>
<artifactId>ibzwf-util</artifactId>
<name>Ibzwf Util</name>
<description>Ibzwf Util</description>
<dependencies>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
</dependency>
<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-security</artifactId>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
</dependency>
<dependency>
<groupId>org.zalando</groupId>
<artifactId>problem-spring-web</artifactId>
</dependency>
<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<dependency>
<groupId>com.esotericsoftware</groupId>
<artifactId>kryo-shaded</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
</dependency>
<!-- Swagger2 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
</dependency>
</dependencies>
</project>
......@@ -4,7 +4,7 @@ import com.github.benmanes.caffeine.cache.CaffeineSpec;
import cn.ibizlab.util.cache.cacheManager.CaffeineCacheManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.cache.CacheProperties;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.EnableCaching;
......@@ -19,7 +19,7 @@ import org.springframework.util.StringUtils;
@EnableCaching
@Configuration
@EnableConfigurationProperties(CacheProperties.class)
@ConditionalOnProperty("ibiz.enableCaffeineCache")
@ConditionalOnExpression("'${ibiz.cacheLevel:None}'.equals('L1')")
public class CaffeineCacheConfig {
@Autowired
......
......@@ -11,7 +11,7 @@ import cn.ibizlab.util.cache.redis.StringRedisSerializer;
import cn.ibizlab.util.enums.RedisChannelTopic;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.cache.CacheProperties;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.EnableCaching;
......@@ -36,7 +36,7 @@ import org.springframework.util.StringUtils;
@EnableCaching
@Configuration
@EnableConfigurationProperties(CacheProperties.class)
@ConditionalOnProperty("ibiz.enableRedisCache")
@ConditionalOnExpression("'${ibiz.cacheLevel:None}'.equals('L2')")
public class RedisCacheConfig {
@Autowired
......
......@@ -3,7 +3,7 @@ package cn.ibizlab.util.cache.cacheManager;
import com.github.benmanes.caffeine.cache.Caffeine;
import com.github.benmanes.caffeine.cache.CaffeineSpec;
import lombok.Data;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
import org.springframework.cache.caffeine.CaffeineCache;
......@@ -22,7 +22,7 @@ import java.util.concurrent.TimeUnit;
*/
@Data
@Component
@ConditionalOnProperty("ibiz.enableCaffeineCache")
@ConditionalOnExpression("'${ibiz.cacheLevel:None}'.equals('L1')")
public class CaffeineCacheManager implements CacheManager {
private static final int DEFAULT_EXPIRE_AFTER_WRITE = 1;
......
......@@ -5,7 +5,7 @@ import com.github.benmanes.caffeine.cache.CaffeineSpec;
import lombok.Data;
import cn.ibizlab.util.cache.cache.LayeringCache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
import org.springframework.data.redis.cache.RedisCacheConfiguration;
......@@ -27,7 +27,7 @@ import java.util.concurrent.TimeUnit;
*/
@Data
@Component
@ConditionalOnProperty("ibiz.enableRedisCache")
@ConditionalOnExpression("'${ibiz.cacheLevel:None}'.equals('L2')")
public class LayeringCacheManager implements CacheManager {
private static final int DEFAULT_EXPIRE_AFTER_WRITE = 1;
......
......@@ -5,7 +5,7 @@ import cn.ibizlab.util.enums.RedisChannelTopic;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
import org.springframework.data.redis.connection.Message;
......@@ -22,7 +22,7 @@ import java.util.Map;
*/
@Component
@ConditionalOnProperty("ibiz.enableRedisCache")
@ConditionalOnExpression("'${ibiz.cacheLevel:None}'.equals('L2')")
public class RedisMessageListener extends MessageListenerAdapter {
private static final Logger logger = LoggerFactory.getLogger(RedisPublisher.class);
@Autowired
......
......@@ -3,13 +3,14 @@ package cn.ibizlab.util.client;
import cn.ibizlab.util.security.AuthenticationUser;
import cn.ibizlab.util.security.AuthorizationLogin;
import org.springframework.stereotype.Component;
import com.alibaba.fastjson.JSONObject;
import java.util.Map;
@Component
public class IBZUAAFallback implements IBZUAAFeignClient {
@Override
public Map<String, Object> pushSystemPermissionData(Map<String, Object> systemPermissionData, String systemId) {
public JSONObject pushSystemPermissionData(Map<String, Object> systemPermissionData, String systemId) {
return null;
}
......
......@@ -4,6 +4,7 @@ import cn.ibizlab.util.security.AuthenticationUser;
import cn.ibizlab.util.security.AuthorizationLogin;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import com.alibaba.fastjson.JSONObject;
import java.util.Map;
@FeignClient(value = "ibzuaa-api",fallback = IBZUAAFallback.class)
......@@ -16,7 +17,7 @@ public interface IBZUAAFeignClient
* @return
*/
@PostMapping("/uaa/permission/save")
Map<String,Object> pushSystemPermissionData(@RequestBody Map<String, Object> systemPermissionData, @RequestParam("systemid") String systemId);
JSONObject pushSystemPermissionData(@RequestBody Map<String, Object> systemPermissionData, @RequestParam("systemid") String systemId);
/**
* 用户登录
......
......@@ -39,15 +39,20 @@ public class PermissionSyncJob implements ApplicationRunner {
public void run(ApplicationArguments args) {
if(enablePermissionValid){
try {
InputStream permission= this.getClass().getResourceAsStream("/deprivs/DEPrivs.json"); //获取当前系统所有实体资源能力
InputStream permission= this.getClass().getResourceAsStream("/permission/systemResource.json"); //获取当前系统所有实体资源能力
String permissionResult = IOUtils.toString(permission,"UTF-8");
JSONObject jsonNodePermission = JSONObject.parseObject(permissionResult);
Map<String,Object> map=new HashMap<>();
map.put("permission",jsonNodePermission);
client.pushSystemPermissionData(map,systemId);
JSONObject syncResult=client.pushSystemPermissionData(map,systemId);
if(syncResult.getInteger("code")==1){
log.info("向[UAA]同步系统资源成功");
}else{
log.info(String.format("向[UAA]同步系统资源失败,失败原因为[%s]",syncResult.getString("msg")));
}
}
catch (Exception ex) {
log.error(String.format("向UAA同步数据发生错误,请检查UAA服务是否正常! [%s]",ex));
log.error(String.format("向[UAA]同步系统资源失败,请检查[UAA]服务是否正常! [%s]",ex));
}
}
}
......
......@@ -9,7 +9,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.annotation.Autowired;
import cn.ibizlab.util.security.AuthenticationUser;
import cn.ibizlab.util.service.AuthenticationUserService;
@RestController
@RequestMapping(value = "")
......@@ -18,19 +20,32 @@ public class AppController {
@Value("${ibiz.enablePermissionValid:false}")
boolean enablePermissionValid; //是否开启权限校验
@Autowired
private AuthenticationUserService userDetailsService;
@RequestMapping(method = RequestMethod.GET, value = "/appdata")
public ResponseEntity<JSONObject> getAppData() {
JSONObject appData = new JSONObject() ;
JSONArray uniRes=new JSONArray();
JSONArray appMenu=new JSONArray();
if(enablePermissionValid){
JSONObject userPermission=AuthenticationUser.getAuthenticationUser().getPermissionList();
if(!ObjectUtils.isEmpty(userPermission)){
uniRes = userPermission.getJSONArray("unires");
appMenu = userPermission.getJSONArray("appmenu");
}
}
appData.put("unires",uniRes);
appData.put("appmenu",appMenu);
appData.put("enablepermissionvalid",enablePermissionValid);
return ResponseEntity.status(HttpStatus.OK).body(appData);
}
@RequestMapping(method = RequestMethod.GET, value = "${ibiz.auth.logoutpath:v7/logout}")
public void logout() {
if(AuthenticationUser.getAuthenticationUser()!=null){
userDetailsService.resetByUsername(AuthenticationUser.getAuthenticationUser().getUsername());
}
}
}
......@@ -78,9 +78,9 @@ ribbon:
ConnectTimeout: 60000
#系统是否开启权限验证、是否开启缓存
#缓存模式:关闭缓存(无配置项)、本地缓存(enableCaffeineCache=true-默认)、caffeine+redis两级缓存(enableRedisCache=true)
#缓存级别:无缓存(无配置项)、一级缓存(L1)、二级缓存(L2)
ibiz:
enablePermissionValid: true
enableCaffeineCache: true
#enableRedisCache: true
cacheLevel: L1 #一级缓存,本地caffeine缓存
#cacheLevel: L2 #二级缓存,本地caffeine缓存+Redis缓存
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册