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

ibiz4j 发布系统代码

上级 36ebe824
......@@ -4,6 +4,7 @@
:is="viewname"
class="viewcontainer2"
:viewdata ="viewdata"
:viewparam="viewparam"
:viewDefaultUsage="false"
:formDruipart="formDruipart"
:isformDruipart="true"
......@@ -119,6 +120,22 @@ export default class AppFormDRUIPart extends Vue {
*/
@Prop() public viewparams!: any;
/**
* 局部上下文
*
* @type {*}
* @memberof AppFormDRUIPart
*/
@Prop() public localContext!:any;
/**
* 局部参数
*
* @type {*}
* @memberof AppFormDRUIPart
*/
@Prop() public localParam!:any;
/**
* 应用实体参数名称
*
......@@ -240,21 +257,32 @@ export default class AppFormDRUIPart extends Vue {
}
const formData: any = data?data:JSON.parse(this.data);
const _paramitem = formData[this.paramItem];
let viewdata = {};
Object.assign(viewdata, this.$viewTool.getIndexViewParam());
let tempContext:any = {};
let tempParam:any = {};
Object.assign(tempContext, this.$viewTool.getIndexViewParam());
const _parameters: any[] = [...this.$viewTool.getIndexParameters(), ...this.parameters];
_parameters.forEach((parameter: any) => {
const { pathName, parameterName }: { pathName: string, parameterName: string } = parameter;
if (formData[parameterName] && !Object.is(formData[parameterName], '')) {
Object.assign(viewdata, { [parameterName]: formData[parameterName] });
Object.assign(tempContext, { [parameterName]: formData[parameterName] });
}
});
Object.assign(viewdata, { [this.paramItem]: _paramitem });
Object.assign(tempContext, { [this.paramItem]: _paramitem });
//设置顶层视图唯一标识
Object.assign(viewdata,this.context);
Object.assign(viewdata,{srfparentdename:this.parentName,srfparentkey:_paramitem});
this.viewdata = JSON.stringify(viewdata);
this.viewparam = JSON.stringify(this.viewparams);
Object.assign(tempContext,this.context);
Object.assign(tempContext,{srfparentdename:this.parentName,srfparentkey:_paramitem});
// 设置局部上下文
if(this.localContext && Object.keys(this.localContext).length >0){
let _context:any = this.$util.computedNavData(formData,tempContext,this.viewparams,this.localContext);
Object.assign(tempContext,_context);
}
this.viewdata = JSON.stringify(tempContext);
// 设置局部参数
if(this.localParam && Object.keys(this.localParam).length >0){
let _param:any = this.$util.computedNavData(formData,tempContext,this.viewparams,this.localParam);
Object.assign(tempParam,_param);
}
this.viewparam = JSON.stringify(tempParam);
if (this.isRelationalData) {
if (!_paramitem || _paramitem == null || Object.is(_paramitem, '')) {
this.blockUIStart();
......
<template>
<div class="app-picker-select-view">
<Dropdown :visible="visible" trigger="custom" style="left:0px;width: 100%" @on-clickoutside="() => {triggerMenu(false);}" >
<Input v-if="isSingleSelect" v-model="queryValue" class="tree-input" type="text" :placeholder="placeholder ? placeholder : $t('components.AppPickerSelectViewSelectView.placeholder')" :disabled="disabled" @on-change="OnInputChange" @on-focus="()=>{triggerMenu(true);}" >
<Input v-if="isSingleSelect" v-model="queryValue" class="tree-input" type="text" :placeholder="placeholder ? placeholder : $t('components.appPickerSelectView.placeholder')" :disabled="disabled" @on-change="OnInputChange" @on-focus="()=>{triggerMenu(true);}" >
<template v-slot:suffix>
<i v-if="queryValue && !disabled" class='el-icon-circle-close' @click="onClear"></i>
<Icon :type="visible ? 'ios-arrow-up' : 'ios-arrow-down'" class="icon-arrow" @click="() => {triggerMenu();}"></Icon>
......@@ -34,7 +34,7 @@ import { ViewTool } from '@/utils/view-tool/view-tool';
@Component({
})
export default class AppPickerSelectViewSelectView extends Vue {
export default class AppPickerSelectView extends Vue {
/**
* 视图上下文
*
......@@ -256,7 +256,7 @@ export default class AppPickerSelectViewSelectView extends Vue {
*/
public handlePublicParams(arg: any): boolean {
if (!this.data) {
this.$Notice.error({ title: (this.$t('components.AppPickerSelectViewSelectView.error') as any), desc: (this.$t('components.AppPickerSelectViewSelectView.formdataException') as any) });
this.$Notice.error({ title: (this.$t('components.appPickerSelectView.error') as any), desc: (this.$t('components.appPickerSelectView.formdataException') as any) });
return false;
}
// 合并表单参数
......@@ -306,7 +306,7 @@ export default class AppPickerSelectViewSelectView extends Vue {
if(this.isSingleSelect){
this.queryValue = newVal;
if (!this.data || !this.valueitem || !this.data[this.valueitem]) {
this.$Notice.error({ title: (this.$t('components.AppPickerSelectViewSelectView.error') as any), desc: (this.$t('components.AppPickerSelectViewSelectView.editor') as any)+this.name+(this.$t('components.AppPickerSelectViewSelectView.valueitemException') as any) });
this.$Notice.error({ title: (this.$t('components.appPickerSelectView.error') as any), desc: (this.$t('components.appPickerSelectView.editor') as any)+this.name+(this.$t('components.appPickerSelectView.valueitemException') as any) });
}else{
let _viewparam = JSON.parse(this.viewparam);
_viewparam.selectedData = [{srfkey: this.data[this.valueitem], srfmajortext: this.value }];
......@@ -418,7 +418,7 @@ export default class AppPickerSelectViewSelectView extends Vue {
*/
public openLinkView($event: any): void {
if (!this.data || !this.valueitem || !this.data[this.valueitem]) {
console.error({ title: (this.$t('components.AppPickerSelectViewSelectView.error') as any), desc: (this.$t('components.AppPickerSelectViewSelectView.editor') as any)+this.name+(this.$t('components.AppPickerSelectViewSelectView.valueitemException') as any) });
console.error({ title: (this.$t('components.appPickerSelectView.error') as any), desc: (this.$t('components.appPickerSelectView.editor') as any)+this.name+(this.$t('components.appPickerSelectView.valueitemException') as any) });
return;
}
// 公共参数处理
......
<template>
<codelist v-if="tag" :tag="tag" :value="value" :codelistType="codelistType" :renderMode="renderMode" :valueSeparator="valueSeparator" :textSeparator="textSeparator" :data="data" :itemParam="itemParam" :context="context" :viewparams="viewparams"></codelist>
<codelist v-if="tag" :tag="tag" :value="value" :codelistType="codelistType" :renderMode="renderMode" :valueSeparator="valueSeparator" :textSeparator="textSeparator" :data="data" :localContext="localContext" :localParam="localParam" :context="context" :viewparams="viewparams"></codelist>
<app-upload-file-info v-else-if="Object.is(this.editorType,'PICTURE') || Object.is(this.editorType,'PICTURE_ONE') || Object.is(this.editorType,'FILEUPLOADER')" :value="value" :name="name"></app-upload-file-info>
<span class="app-span" v-else >{{text}}</span>
</template>
......@@ -145,9 +145,8 @@ export default class AppSpan extends Vue {
* @memberof AppSpan
*/
public load(){
if(!this.value || this.tag){
if(this.tag){
return; //代码表走codelist组件
}else if(this.editorType === "ADDRESSPICKUP"){
JSON.parse(this.value).forEach((item:any,index:number) => {
this.text += index === 0 ? item.srfmajortext : ","+item.srfmajortext;
......
......@@ -6,7 +6,7 @@
v-for="(item,i) in dataRight"
:key="i"
>{{dataLeft[item-1].label}}</Option>
<el-transfer v-model="dataRight" :data="dataLeft" @change=dataChange></el-transfer>
<el-transfer v-model="dataRight" :data="dataLeft" @change="dataChange" :titles="['未选择', '已选择']"></el-transfer>
</Select>
</template>
<script lang="ts">
......@@ -14,11 +14,11 @@ import { Vue, Component, Watch, Prop, Model } from "vue-property-decorator";
import CodeListService from "@service/app/codelist-service";
@Component({})
export default class FromTransfer extends Vue {
export default class AppTransfer extends Vue {
/**
* 表单传递右侧框中的数据
*/
@Prop() public data: any;
@Prop() public data?: any;
/**
* 左侧框数据
*/
......@@ -31,7 +31,7 @@ export default class FromTransfer extends Vue {
* 代码表服务对象
*
* @type {CodeListService}
* @memberof FromTransfer
* @memberof AppTransfer
*/
public codeListService: CodeListService = new CodeListService({
......@@ -42,21 +42,21 @@ export default class FromTransfer extends Vue {
* 额外参数
*
* @type {*}
* @memberof FromTransfer
* @memberof AppTransfer
*/
public otherParam: any;
/**
* 查询参数
* @type {*}
* @memberof FromTransfer
* @memberof AppTransfer
*/
public queryParam: any;
/**
* 当前选中值
* @type {any}
* @memberof Drop
* @memberof AppTransfer
*/
@Model("change") readonly itemValue!: any;
......@@ -64,7 +64,7 @@ export default class FromTransfer extends Vue {
* 代码表标识
*
* @type {string}
* @memberof FromTransfer
* @memberof AppTransfer
*/
@Prop() public tag?: string;
......@@ -72,15 +72,14 @@ export default class FromTransfer extends Vue {
* 代码表类型
*
* @type {string}
* @memberof FromTransfer
* @memberof AppTransfer
*/
@Prop() public codelistType?: string;
/**
* 监听表单数据
*
* @memberof FromTransfer
* @memberof AppTransfer
*/
@Watch("data", { deep: true })
......@@ -90,27 +89,27 @@ export default class FromTransfer extends Vue {
}
/**
* 组件change事件,右侧框数据变化时
* @memberof FromTransfer
* @memberof AppTransfer
*/
dataChange(e:any){
dataChange(e: any) {
console.log(e);
let val:any[]=[];
let newVal:any;
let val: any[] = [];
let newVal: any;
this.dataLeft.forEach((elem: any) => {
e.forEach((item: any) => {
if (elem.key === item) val.push(elem.value);
});
});
newVal=val.join(',');
console.log(newVal);
this.$emit("change", newVal);
newVal = val.join(",");
console.log(newVal, typeof newVal);
if (newVal) this.$emit("change", newVal);
}
/**
* 传入额外参数
*
* @type {*}
* @memberof FromTransfer
* @memberof AppTransfer
*/
@Prop() public itemParam?: any;
......@@ -133,7 +132,7 @@ export default class FromTransfer extends Vue {
/**
* 是否禁用
* @type {any}
* @memberof FromTransfer
* @memberof AppTransfer
*
*/
@Prop() public disabled?: any;
......@@ -141,43 +140,22 @@ export default class FromTransfer extends Vue {
/**
* 是否支持过滤
* @type {boolean}
* @memberof FromTransfer
* @memberof AppTransfer
*/
@Prop() public filterable?: boolean;
/**
* 下拉选提示内容
* @type {string}
* @memberof FromTransfer
* @memberof AppTransfer
*/
@Prop() public placeholder?: string;
/**
* 计算属性(当前值)
* @type {any}
* @memberof FromTransfer
*/
set currentVal(val: any) {
// const type: string = this.$util.typeOf(val);
// val =
// Object.is(type, "null") || Object.is(type, "undefined") ? undefined : val;
// this.dataLeft.forEach((elem: any) => {
// this.dataRight.forEach((item: any) => {
// if (elem.key === item) val.push(elem.value);
// });
// });
// val=val.join(',');
// this.$emit("change", val);
}
/**
* 获取值对象
*
* @memberof FromTransfer
* @memberof AppTransfer
*/
// get currentVal() {
// return this.itemValue;
// }
get currentVal() {
return this.itemValue;
}
......@@ -186,7 +164,7 @@ export default class FromTransfer extends Vue {
* 代码表
*
* @type {any[]}
* @memberof FromTransfer
* @memberof AppTransfer
*/
// public items: any[] = [];
......@@ -195,7 +173,7 @@ export default class FromTransfer extends Vue {
*
* @param {*} arg
* @returns
* @memberof FromTransfer
* @memberof AppTransfer
*/
public handlePublicParams(arg: any) {
// 合并表单参数
......@@ -225,11 +203,10 @@ export default class FromTransfer extends Vue {
/**
* vue 生命周期
*
* @memberof FromTransfer
* @memberof AppTransfer
*/
public created() {
this.dataHandle();
this.initRight();
}
/**
......@@ -241,7 +218,9 @@ export default class FromTransfer extends Vue {
if (codelist) {
this.dataLeft = [...JSON.parse(JSON.stringify(codelist.items))];
this.initLeft();
this.initRight();
console.log(this.dataLeft);
console.log(this.dataRight);
} else {
console.log(`----${this.tag}----代码表不存在`);
}
......@@ -257,8 +236,8 @@ export default class FromTransfer extends Vue {
.then((res: any) => {
this.dataLeft = res;
console.log(this.dataLeft);
this.initLeft();
this.initRight();
})
.catch((error: any) => {
console.log(`----${this.tag}----代码表不存在`);
......@@ -286,9 +265,16 @@ export default class FromTransfer extends Vue {
* 初始化右侧框数据
*/
public initRight() {
if (this.data) {
this.data.forEach((elem: any) => {
this.dataRight.push(elem);
let _data: string = this.data;
console.log(_data);
if (_data) {
let newData: any[] = _data.split(",");
this.dataLeft.forEach((elem: any) => {
newData.forEach((item: any) => {
if (item === elem.value) {
this.dataRight.push(elem.key);
}
});
});
}
}
......
......@@ -249,7 +249,9 @@ export default class EditViewEngine extends ViewEngine {
let viewdata: any = this.view.model;
if (viewdata && info && !Object.is(info, '') && this.view.$tabPageExp && (viewdata.srfTitle.indexOf(" - ") === -1)) {
this.view.$tabPageExp.setCurPageCaption(viewdata.srfTitle, viewdata.srfTitle, info);
if(this.view.$route){
this.view.$route.meta.info = info;
}
this.view.model.srfTitle = `${this.view.$t(viewdata.srfTitle)} - ${viewdata.dataInfo}`;
}
}
......
......@@ -668,7 +668,6 @@ export default class IBZDepartmentEditGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -697,7 +696,6 @@ export default class IBZDepartmentEditGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -726,7 +724,6 @@ export default class IBZDepartmentEditGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -755,7 +752,6 @@ export default class IBZDepartmentEditGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -779,17 +775,19 @@ export default class IBZDepartmentEditGridViewBase extends Vue {
* @memberof IBZDepartmentEditGridView
*/
public newdata(args: any[],fullargs?:any[], params?: any, $event?: any, xData?: any) {
let localContext:any = null;
let localViewParam:any =null;
const data: any = {};
if(args[0].srfsourcekey){
data.srfsourcekey = args[0].srfsourcekey;
}
let curViewParam = JSON.parse(JSON.stringify(this.context));
delete curViewParam.ibzdepartment;
let tempContext = JSON.parse(JSON.stringify(this.context));
delete tempContext.ibzdepartment;
if(args.length >0){
Object.assign(curViewParam,args[0]);
Object.assign(tempContext,args[0]);
}
let deResParameters: any[] = [];
if(curViewParam.ibzorganization && true){
if(tempContext.ibzorganization && true){
deResParameters = [
{ pathName: 'ibzorganizations', parameterName: 'ibzorganization' },
]
......@@ -799,7 +797,7 @@ export default class IBZDepartmentEditGridViewBase extends Vue {
];
const _this: any = this;
const openDrawer = (view: any, data: any) => {
let container: Subject<any> = this.$appdrawer.openDrawer(view, curViewParam, data);
let container: Subject<any> = this.$appdrawer.openDrawer(view, tempContext, data);
container.subscribe((result: any) => {
if (!result || !Object.is(result.ret, 'OK')) {
return;
......@@ -832,13 +830,15 @@ export default class IBZDepartmentEditGridViewBase extends Vue {
* @memberof IBZDepartmentEditGridView
*/
public opendata(args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any) {
let localContext:any = null;
let localViewParam:any =null;
const data: any = {};
let curViewParam = JSON.parse(JSON.stringify(this.context));
let tempContext = JSON.parse(JSON.stringify(this.context));
if(args.length >0){
Object.assign(curViewParam,args[0]);
Object.assign(tempContext,args[0]);
}
let deResParameters: any[] = [];
if(curViewParam.ibzorganization && true){
if(tempContext.ibzorganization && true){
deResParameters = [
{ pathName: 'ibzorganizations', parameterName: 'ibzorganization' },
]
......@@ -848,7 +848,7 @@ export default class IBZDepartmentEditGridViewBase extends Vue {
];
const _this: any = this;
const openDrawer = (view: any, data: any) => {
let container: Subject<any> = this.$appdrawer.openDrawer(view, curViewParam, data);
let container: Subject<any> = this.$appdrawer.openDrawer(view, tempContext, data);
container.subscribe((result: any) => {
if (!result || !Object.is(result.ret, 'OK')) {
return;
......
......@@ -562,7 +562,6 @@ export default class IBZDepartmentEditViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -591,7 +590,6 @@ export default class IBZDepartmentEditViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -620,7 +618,6 @@ export default class IBZDepartmentEditViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -649,7 +646,6 @@ export default class IBZDepartmentEditViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -678,7 +674,6 @@ export default class IBZDepartmentEditViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
......
......@@ -704,7 +704,6 @@ export default class IBZDepartmentGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -734,7 +733,6 @@ export default class IBZDepartmentGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -763,7 +761,6 @@ export default class IBZDepartmentGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -792,7 +789,6 @@ export default class IBZDepartmentGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -821,7 +817,6 @@ export default class IBZDepartmentGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -850,7 +845,6 @@ export default class IBZDepartmentGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -879,7 +873,6 @@ export default class IBZDepartmentGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -908,7 +901,6 @@ export default class IBZDepartmentGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -937,7 +929,6 @@ export default class IBZDepartmentGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -966,7 +957,6 @@ export default class IBZDepartmentGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -990,17 +980,19 @@ export default class IBZDepartmentGridViewBase extends Vue {
* @memberof IBZDepartmentGridView
*/
public newdata(args: any[],fullargs?:any[], params?: any, $event?: any, xData?: any) {
let localContext:any = null;
let localViewParam:any =null;
const data: any = {};
if(args[0].srfsourcekey){
data.srfsourcekey = args[0].srfsourcekey;
}
let curViewParam = JSON.parse(JSON.stringify(this.context));
delete curViewParam.ibzdepartment;
let tempContext = JSON.parse(JSON.stringify(this.context));
delete tempContext.ibzdepartment;
if(args.length >0){
Object.assign(curViewParam,args[0]);
Object.assign(tempContext,args[0]);
}
let deResParameters: any[] = [];
if(curViewParam.ibzorganization && true){
if(tempContext.ibzorganization && true){
deResParameters = [
{ pathName: 'ibzorganizations', parameterName: 'ibzorganization' },
]
......@@ -1010,7 +1002,7 @@ export default class IBZDepartmentGridViewBase extends Vue {
];
const _this: any = this;
const openDrawer = (view: any, data: any) => {
let container: Subject<any> = this.$appdrawer.openDrawer(view, curViewParam, data);
let container: Subject<any> = this.$appdrawer.openDrawer(view, tempContext, data);
container.subscribe((result: any) => {
if (!result || !Object.is(result.ret, 'OK')) {
return;
......@@ -1043,13 +1035,15 @@ export default class IBZDepartmentGridViewBase extends Vue {
* @memberof IBZDepartmentGridView
*/
public opendata(args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any) {
let localContext:any = null;
let localViewParam:any =null;
const data: any = {};
let curViewParam = JSON.parse(JSON.stringify(this.context));
let tempContext = JSON.parse(JSON.stringify(this.context));
if(args.length >0){
Object.assign(curViewParam,args[0]);
Object.assign(tempContext,args[0]);
}
let deResParameters: any[] = [];
if(curViewParam.ibzorganization && true){
if(tempContext.ibzorganization && true){
deResParameters = [
{ pathName: 'ibzorganizations', parameterName: 'ibzorganization' },
]
......@@ -1059,7 +1053,7 @@ export default class IBZDepartmentGridViewBase extends Vue {
];
const _this: any = this;
const openDrawer = (view: any, data: any) => {
let container: Subject<any> = this.$appdrawer.openDrawer(view, curViewParam, data);
let container: Subject<any> = this.$appdrawer.openDrawer(view, tempContext, data);
container.subscribe((result: any) => {
if (!result || !Object.is(result.ret, 'OK')) {
return;
......
......@@ -473,6 +473,8 @@ export default class IBZDepartmentTreeExpViewBase extends Vue {
* @memberof IBZDepartmentTreeExpView
*/
public newdata(args: any[],fullargs?:any[], params?: any, $event?: any, xData?: any) {
let localContext:any = null;
let localViewParam:any =null;
this.$Notice.warning({ title: '错误', desc: '未指定关系视图' });
}
......@@ -488,6 +490,8 @@ export default class IBZDepartmentTreeExpViewBase extends Vue {
* @memberof IBZDepartmentTreeExpView
*/
public opendata(args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any) {
let localContext:any = null;
let localViewParam:any =null;
this.$Notice.warning({ title: '错误', desc: '未指定关系视图' });
}
......
......@@ -562,7 +562,6 @@ export default class IBZDeptMemberEditViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -591,7 +590,6 @@ export default class IBZDeptMemberEditViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -620,7 +618,6 @@ export default class IBZDeptMemberEditViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -649,7 +646,6 @@ export default class IBZDeptMemberEditViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -678,7 +674,6 @@ export default class IBZDeptMemberEditViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
......
......@@ -625,7 +625,6 @@ export default class IBZDeptMemberGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -654,7 +653,6 @@ export default class IBZDeptMemberGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -683,7 +681,6 @@ export default class IBZDeptMemberGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -712,7 +709,6 @@ export default class IBZDeptMemberGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -741,7 +737,6 @@ export default class IBZDeptMemberGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -770,7 +765,6 @@ export default class IBZDeptMemberGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -799,7 +793,6 @@ export default class IBZDeptMemberGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -828,7 +821,6 @@ export default class IBZDeptMemberGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -857,7 +849,6 @@ export default class IBZDeptMemberGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -881,6 +872,8 @@ export default class IBZDeptMemberGridViewBase extends Vue {
* @memberof IBZDeptMemberGridView
*/
public newdata(args: any[],fullargs?:any[], params?: any, $event?: any, xData?: any) {
let localContext:any = null;
let localViewParam:any =null;
const batchAddPSAppViews=[
{view:{viewname:'ibzemployee-mpickup-view',height: 0,width: 0,title: '人员数据多项选择视图'},
res:['IBZEmployee'],
......@@ -939,13 +932,15 @@ export default class IBZDeptMemberGridViewBase extends Vue {
* @memberof IBZDeptMemberGridView
*/
public opendata(args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any) {
let localContext:any = null;
let localViewParam:any =null;
const data: any = {};
let curViewParam = JSON.parse(JSON.stringify(this.context));
let tempContext = JSON.parse(JSON.stringify(this.context));
if(args.length >0){
Object.assign(curViewParam,args[0]);
Object.assign(tempContext,args[0]);
}
let deResParameters: any[] = [];
if(curViewParam.ibzdepartment && true){
if(tempContext.ibzdepartment && true){
deResParameters = [
{ pathName: 'ibzdepartments', parameterName: 'ibzdepartment' },
]
......@@ -955,7 +950,7 @@ export default class IBZDeptMemberGridViewBase extends Vue {
];
const _this: any = this;
const openPopupModal = (view: any, data: any) => {
let container: Subject<any> = this.$appmodal.openModal(view, curViewParam, data);
let container: Subject<any> = this.$appmodal.openModal(view, tempContext, data);
container.subscribe((result: any) => {
if (!result || !Object.is(result.ret, 'OK')) {
return;
......
......@@ -530,7 +530,6 @@ export default class IBZEmployeeChangePwdViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
......
......@@ -671,7 +671,6 @@ export default class IBZEmployeeEditGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -700,7 +699,6 @@ export default class IBZEmployeeEditGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -729,7 +727,6 @@ export default class IBZEmployeeEditGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -758,7 +755,6 @@ export default class IBZEmployeeEditGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -782,17 +778,19 @@ export default class IBZEmployeeEditGridViewBase extends Vue {
* @memberof IBZEmployeeEditGridView
*/
public newdata(args: any[],fullargs?:any[], params?: any, $event?: any, xData?: any) {
let localContext:any = null;
let localViewParam:any =null;
const data: any = {};
if(args[0].srfsourcekey){
data.srfsourcekey = args[0].srfsourcekey;
}
let curViewParam = JSON.parse(JSON.stringify(this.context));
delete curViewParam.ibzemployee;
let tempContext = JSON.parse(JSON.stringify(this.context));
delete tempContext.ibzemployee;
if(args.length >0){
Object.assign(curViewParam,args[0]);
Object.assign(tempContext,args[0]);
}
let deResParameters: any[] = [];
if(curViewParam.ibzdepartment && true){
if(tempContext.ibzdepartment && true){
deResParameters = [
{ pathName: 'ibzdepartments', parameterName: 'ibzdepartment' },
]
......@@ -802,7 +800,7 @@ export default class IBZEmployeeEditGridViewBase extends Vue {
];
const _this: any = this;
const openDrawer = (view: any, data: any) => {
let container: Subject<any> = this.$appdrawer.openDrawer(view, curViewParam, data);
let container: Subject<any> = this.$appdrawer.openDrawer(view, tempContext, data);
container.subscribe((result: any) => {
if (!result || !Object.is(result.ret, 'OK')) {
return;
......@@ -835,13 +833,15 @@ export default class IBZEmployeeEditGridViewBase extends Vue {
* @memberof IBZEmployeeEditGridView
*/
public opendata(args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any) {
let localContext:any = null;
let localViewParam:any =null;
const data: any = {};
let curViewParam = JSON.parse(JSON.stringify(this.context));
let tempContext = JSON.parse(JSON.stringify(this.context));
if(args.length >0){
Object.assign(curViewParam,args[0]);
Object.assign(tempContext,args[0]);
}
let deResParameters: any[] = [];
if(curViewParam.ibzdepartment && true){
if(tempContext.ibzdepartment && true){
deResParameters = [
{ pathName: 'ibzdepartments', parameterName: 'ibzdepartment' },
]
......@@ -851,7 +851,7 @@ export default class IBZEmployeeEditGridViewBase extends Vue {
];
const _this: any = this;
const openDrawer = (view: any, data: any) => {
let container: Subject<any> = this.$appdrawer.openDrawer(view, curViewParam, data);
let container: Subject<any> = this.$appdrawer.openDrawer(view, tempContext, data);
container.subscribe((result: any) => {
if (!result || !Object.is(result.ret, 'OK')) {
return;
......
......@@ -562,7 +562,6 @@ export default class IBZEmployeeEditViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -591,7 +590,6 @@ export default class IBZEmployeeEditViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -620,7 +618,6 @@ export default class IBZEmployeeEditViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -649,7 +646,6 @@ export default class IBZEmployeeEditViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -678,7 +674,6 @@ export default class IBZEmployeeEditViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
......
......@@ -717,7 +717,6 @@ export default class IBZEmployeeGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -747,7 +746,6 @@ export default class IBZEmployeeGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -776,7 +774,6 @@ export default class IBZEmployeeGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -805,7 +802,6 @@ export default class IBZEmployeeGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -834,7 +830,6 @@ export default class IBZEmployeeGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -863,7 +858,6 @@ export default class IBZEmployeeGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -892,7 +886,6 @@ export default class IBZEmployeeGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -921,7 +914,6 @@ export default class IBZEmployeeGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -950,7 +942,6 @@ export default class IBZEmployeeGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -979,7 +970,6 @@ export default class IBZEmployeeGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -1009,7 +999,6 @@ export default class IBZEmployeeGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -1033,17 +1022,19 @@ export default class IBZEmployeeGridViewBase extends Vue {
* @memberof IBZEmployeeGridView
*/
public newdata(args: any[],fullargs?:any[], params?: any, $event?: any, xData?: any) {
let localContext:any = null;
let localViewParam:any =null;
const data: any = {};
if(args[0].srfsourcekey){
data.srfsourcekey = args[0].srfsourcekey;
}
let curViewParam = JSON.parse(JSON.stringify(this.context));
delete curViewParam.ibzemployee;
let tempContext = JSON.parse(JSON.stringify(this.context));
delete tempContext.ibzemployee;
if(args.length >0){
Object.assign(curViewParam,args[0]);
Object.assign(tempContext,args[0]);
}
let deResParameters: any[] = [];
if(curViewParam.ibzdepartment && true){
if(tempContext.ibzdepartment && true){
deResParameters = [
{ pathName: 'ibzdepartments', parameterName: 'ibzdepartment' },
]
......@@ -1053,7 +1044,7 @@ export default class IBZEmployeeGridViewBase extends Vue {
];
const _this: any = this;
const openDrawer = (view: any, data: any) => {
let container: Subject<any> = this.$appdrawer.openDrawer(view, curViewParam, data);
let container: Subject<any> = this.$appdrawer.openDrawer(view, tempContext, data);
container.subscribe((result: any) => {
if (!result || !Object.is(result.ret, 'OK')) {
return;
......@@ -1086,13 +1077,15 @@ export default class IBZEmployeeGridViewBase extends Vue {
* @memberof IBZEmployeeGridView
*/
public opendata(args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any) {
let localContext:any = null;
let localViewParam:any =null;
const data: any = {};
let curViewParam = JSON.parse(JSON.stringify(this.context));
let tempContext = JSON.parse(JSON.stringify(this.context));
if(args.length >0){
Object.assign(curViewParam,args[0]);
Object.assign(tempContext,args[0]);
}
let deResParameters: any[] = [];
if(curViewParam.ibzdepartment && true){
if(tempContext.ibzdepartment && true){
deResParameters = [
{ pathName: 'ibzdepartments', parameterName: 'ibzdepartment' },
]
......@@ -1102,7 +1095,7 @@ export default class IBZEmployeeGridViewBase extends Vue {
];
const _this: any = this;
const openDrawer = (view: any, data: any) => {
let container: Subject<any> = this.$appdrawer.openDrawer(view, curViewParam, data);
let container: Subject<any> = this.$appdrawer.openDrawer(view, tempContext, data);
container.subscribe((result: any) => {
if (!result || !Object.is(result.ret, 'OK')) {
return;
......
......@@ -562,7 +562,6 @@ export default class IBZOrganizationEditViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -591,7 +590,6 @@ export default class IBZOrganizationEditViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -620,7 +618,6 @@ export default class IBZOrganizationEditViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -649,7 +646,6 @@ export default class IBZOrganizationEditViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -678,7 +674,6 @@ export default class IBZOrganizationEditViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
......
......@@ -707,7 +707,6 @@ export default class IBZOrganizationGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -737,7 +736,6 @@ export default class IBZOrganizationGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -766,7 +764,6 @@ export default class IBZOrganizationGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -795,7 +792,6 @@ export default class IBZOrganizationGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -824,7 +820,6 @@ export default class IBZOrganizationGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -853,7 +848,6 @@ export default class IBZOrganizationGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -882,7 +876,6 @@ export default class IBZOrganizationGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -911,7 +904,6 @@ export default class IBZOrganizationGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -940,7 +932,6 @@ export default class IBZOrganizationGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -969,7 +960,6 @@ export default class IBZOrganizationGridViewBase extends Vue {
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
......@@ -993,14 +983,16 @@ export default class IBZOrganizationGridViewBase extends Vue {
* @memberof IBZOrganizationGridView
*/
public newdata(args: any[],fullargs?:any[], params?: any, $event?: any, xData?: any) {
let localContext:any = null;
let localViewParam:any =null;
const data: any = {};
if(args[0].srfsourcekey){
data.srfsourcekey = args[0].srfsourcekey;
}
let curViewParam = JSON.parse(JSON.stringify(this.context));
delete curViewParam.ibzorganization;
let tempContext = JSON.parse(JSON.stringify(this.context));
delete tempContext.ibzorganization;
if(args.length >0){
Object.assign(curViewParam,args[0]);
Object.assign(tempContext,args[0]);
}
const deResParameters: any[] = [];
const parameters: any[] = [
......@@ -1008,7 +1000,7 @@ export default class IBZOrganizationGridViewBase extends Vue {
];
const _this: any = this;
const openDrawer = (view: any, data: any) => {
let container: Subject<any> = this.$appdrawer.openDrawer(view, curViewParam, data);
let container: Subject<any> = this.$appdrawer.openDrawer(view, tempContext, data);
container.subscribe((result: any) => {
if (!result || !Object.is(result.ret, 'OK')) {
return;
......@@ -1041,10 +1033,12 @@ export default class IBZOrganizationGridViewBase extends Vue {
* @memberof IBZOrganizationGridView
*/
public opendata(args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any) {
let localContext:any = null;
let localViewParam:any =null;
const data: any = {};
let curViewParam = JSON.parse(JSON.stringify(this.context));
let tempContext = JSON.parse(JSON.stringify(this.context));
if(args.length >0){
Object.assign(curViewParam,args[0]);
Object.assign(tempContext,args[0]);
}
const deResParameters: any[] = [];
const parameters: any[] = [
......@@ -1052,7 +1046,7 @@ export default class IBZOrganizationGridViewBase extends Vue {
];
const _this: any = this;
const openDrawer = (view: any, data: any) => {
let container: Subject<any> = this.$appdrawer.openDrawer(view, curViewParam, data);
let container: Subject<any> = this.$appdrawer.openDrawer(view, tempContext, data);
container.subscribe((result: any) => {
if (!result || !Object.is(result.ret, 'OK')) {
return;
......
......@@ -473,6 +473,8 @@ export default class IBZOrganizationTreeExpViewBase extends Vue {
* @memberof IBZOrganizationTreeExpView
*/
public newdata(args: any[],fullargs?:any[], params?: any, $event?: any, xData?: any) {
let localContext:any = null;
let localViewParam:any =null;
this.$Notice.warning({ title: '错误', desc: '未指定关系视图' });
}
......@@ -488,6 +490,8 @@ export default class IBZOrganizationTreeExpViewBase extends Vue {
* @memberof IBZOrganizationTreeExpView
*/
public opendata(args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any) {
let localContext:any = null;
let localViewParam:any =null;
this.$Notice.warning({ title: '错误', desc: '未指定关系视图' });
}
......
......@@ -109,16 +109,25 @@ export default class IBZDepartmentUIServiceBase extends UIService {
* @param {*} [srfParentDeName] 父实体名称
* @returns {Promise<any>}
*/
public async IBZDepartment_OpenMainView(args: any[], context:any = {} ,params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
public async IBZDepartment_OpenMainView(args: any[], context:any = {} ,params: any={}, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
let data: any = {};
const _args: any[] = Util.deepCopy(args);
let parentContext:any = {};
let parentViewParam:any = {};
const _this: any = actionContext;
const _args: any[] = Util.deepCopy(args);
const actionTarget: string | null = 'SINGLEKEY';
Object.assign(context, { ibzdepartment: '%ibzdepartment%' });
Object.assign(params, { deptid: '%ibzdepartment%' });
Object.assign(params, { deptname: '%deptname%' });
context = UIActionTool.handleContextParam(actionTarget,_args,context);
data = UIActionTool.handleActionParam(actionTarget,_args,params);
if(_this.context){
parentContext = _this.context;
}
if(_this.viewparams){
parentViewParam = _this.viewparams;
}
context = UIActionTool.handleContextParam(actionTarget,_args,parentContext,parentViewParam,context);
data = UIActionTool.handleActionParam(actionTarget,_args,parentContext,parentViewParam,params);
context = Object.assign({},actionContext.context,context);
let parentObj:any = {srfparentdename:srfParentDeName?srfParentDeName:null,srfparentkey:srfParentDeName?context[srfParentDeName.toLowerCase()]:null};
Object.assign(data,parentObj);
......@@ -168,13 +177,22 @@ export default class IBZDepartmentUIServiceBase extends UIService {
* @param {*} [srfParentDeName] 父实体名称
* @returns {Promise<any>}
*/
public async IBZDepartment_OpenNewCreateView(args: any[], context:any = {} ,params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
public async IBZDepartment_OpenNewCreateView(args: any[], context:any = {} ,params: any={}, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
let data: any = {};
const _args: any[] = Util.deepCopy(args);
let parentContext:any = {};
let parentViewParam:any = {};
const _this: any = actionContext;
const _args: any[] = Util.deepCopy(args);
const actionTarget: string | null = 'NONE';
context = UIActionTool.handleContextParam(actionTarget,_args,context);
data = UIActionTool.handleActionParam(actionTarget,_args,params);
if(_this.context){
parentContext = _this.context;
}
if(_this.viewparams){
parentViewParam = _this.viewparams;
}
context = UIActionTool.handleContextParam(actionTarget,_args,parentContext,parentViewParam,context);
data = UIActionTool.handleActionParam(actionTarget,_args,parentContext,parentViewParam,params);
context = Object.assign({},actionContext.context,context);
let parentObj:any = {srfparentdename:srfParentDeName?srfParentDeName:null,srfparentkey:srfParentDeName?context[srfParentDeName.toLowerCase()]:null};
Object.assign(data,parentObj);
......
......@@ -109,16 +109,25 @@ export default class IBZEmployeeUIServiceBase extends UIService {
* @param {*} [srfParentDeName] 父实体名称
* @returns {Promise<any>}
*/
public async IBZEmployee_OpenMainView(args: any[], context:any = {} ,params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
public async IBZEmployee_OpenMainView(args: any[], context:any = {} ,params: any={}, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
let data: any = {};
const _args: any[] = Util.deepCopy(args);
let parentContext:any = {};
let parentViewParam:any = {};
const _this: any = actionContext;
const _args: any[] = Util.deepCopy(args);
const actionTarget: string | null = 'SINGLEKEY';
Object.assign(context, { ibzemployee: '%ibzemployee%' });
Object.assign(params, { userid: '%ibzemployee%' });
Object.assign(params, { personname: '%personname%' });
context = UIActionTool.handleContextParam(actionTarget,_args,context);
data = UIActionTool.handleActionParam(actionTarget,_args,params);
if(_this.context){
parentContext = _this.context;
}
if(_this.viewparams){
parentViewParam = _this.viewparams;
}
context = UIActionTool.handleContextParam(actionTarget,_args,parentContext,parentViewParam,context);
data = UIActionTool.handleActionParam(actionTarget,_args,parentContext,parentViewParam,params);
context = Object.assign({},actionContext.context,context);
let parentObj:any = {srfparentdename:srfParentDeName?srfParentDeName:null,srfparentkey:srfParentDeName?context[srfParentDeName.toLowerCase()]:null};
Object.assign(data,parentObj);
......@@ -168,16 +177,24 @@ export default class IBZEmployeeUIServiceBase extends UIService {
* @param {*} [srfParentDeName] 父实体名称
* @returns {Promise<any>}
*/
public async IBZEmployee_InitPwd(args: any[],context:any = {}, params?: any, $event?: any, xData?: any,actionContext?: any,srfParentDeName?:string){
public async IBZEmployee_InitPwd(args: any[],context:any = {}, params:any = {}, $event?: any, xData?: any,actionContext?: any,srfParentDeName?:string){
let data: any = {};
const _args: any[] = Util.deepCopy(args);
let parentContext:any = {};
let parentViewParam:any = {};
const _this: any = actionContext;
const _args: any[] = Util.deepCopy(args);
const actionTarget: string | null = 'MULTIKEY';
Object.assign(context, { ibzemployee: '%ibzemployee%' });
Object.assign(params, { userid: '%ibzemployee%' });
Object.assign(params, { personname: '%personname%' });
context = UIActionTool.handleContextParam(actionTarget,_args,context);
data = UIActionTool.handleActionParam(actionTarget,_args,params);
if(_this.context){
parentContext = _this.context;
}
if(_this.viewparams){
parentViewParam = _this.viewparams;
}
context = UIActionTool.handleContextParam(actionTarget,_args,parentContext,parentViewParam,context);
data = UIActionTool.handleActionParam(actionTarget,_args,parentContext,parentViewParam,params);
context = Object.assign({},actionContext.context,context);
let parentObj:any = {srfparentdename:srfParentDeName?srfParentDeName:null,srfparentkey:srfParentDeName?context[srfParentDeName.toLowerCase()]:null};
Object.assign(data,parentObj);
......@@ -224,13 +241,22 @@ export default class IBZEmployeeUIServiceBase extends UIService {
* @param {*} [srfParentDeName] 父实体名称
* @returns {Promise<any>}
*/
public async IBZEmployee_OpenNewCreateView(args: any[], context:any = {} ,params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
public async IBZEmployee_OpenNewCreateView(args: any[], context:any = {} ,params: any={}, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
let data: any = {};
const _args: any[] = Util.deepCopy(args);
let parentContext:any = {};
let parentViewParam:any = {};
const _this: any = actionContext;
const _args: any[] = Util.deepCopy(args);
const actionTarget: string | null = 'NONE';
context = UIActionTool.handleContextParam(actionTarget,_args,context);
data = UIActionTool.handleActionParam(actionTarget,_args,params);
if(_this.context){
parentContext = _this.context;
}
if(_this.viewparams){
parentViewParam = _this.viewparams;
}
context = UIActionTool.handleContextParam(actionTarget,_args,parentContext,parentViewParam,context);
data = UIActionTool.handleActionParam(actionTarget,_args,parentContext,parentViewParam,params);
context = Object.assign({},actionContext.context,context);
let parentObj:any = {srfparentdename:srfParentDeName?srfParentDeName:null,srfparentkey:srfParentDeName?context[srfParentDeName.toLowerCase()]:null};
Object.assign(data,parentObj);
......
......@@ -107,13 +107,22 @@ export default class IBZOrganizationUIServiceBase extends UIService {
* @param {*} [srfParentDeName] 父实体名称
* @returns {Promise<any>}
*/
public async IBZOrganization_OpenNewCreateView(args: any[], context:any = {} ,params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
public async IBZOrganization_OpenNewCreateView(args: any[], context:any = {} ,params: any={}, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
let data: any = {};
const _args: any[] = Util.deepCopy(args);
let parentContext:any = {};
let parentViewParam:any = {};
const _this: any = actionContext;
const _args: any[] = Util.deepCopy(args);
const actionTarget: string | null = 'NONE';
context = UIActionTool.handleContextParam(actionTarget,_args,context);
data = UIActionTool.handleActionParam(actionTarget,_args,params);
if(_this.context){
parentContext = _this.context;
}
if(_this.viewparams){
parentViewParam = _this.viewparams;
}
context = UIActionTool.handleContextParam(actionTarget,_args,parentContext,parentViewParam,context);
data = UIActionTool.handleActionParam(actionTarget,_args,parentContext,parentViewParam,params);
context = Object.assign({},actionContext.context,context);
let parentObj:any = {srfparentdename:srfParentDeName?srfParentDeName:null,srfparentkey:srfParentDeName?context[srfParentDeName.toLowerCase()]:null};
Object.assign(data,parentObj);
......@@ -163,16 +172,25 @@ export default class IBZOrganizationUIServiceBase extends UIService {
* @param {*} [srfParentDeName] 父实体名称
* @returns {Promise<any>}
*/
public async IBZOrganization_OpenMainView(args: any[], context:any = {} ,params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
public async IBZOrganization_OpenMainView(args: any[], context:any = {} ,params: any={}, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
let data: any = {};
const _args: any[] = Util.deepCopy(args);
let parentContext:any = {};
let parentViewParam:any = {};
const _this: any = actionContext;
const _args: any[] = Util.deepCopy(args);
const actionTarget: string | null = 'SINGLEKEY';
Object.assign(context, { ibzorganization: '%ibzorganization%' });
Object.assign(params, { orgid: '%ibzorganization%' });
Object.assign(params, { orgname: '%orgname%' });
context = UIActionTool.handleContextParam(actionTarget,_args,context);
data = UIActionTool.handleActionParam(actionTarget,_args,params);
if(_this.context){
parentContext = _this.context;
}
if(_this.viewparams){
parentViewParam = _this.viewparams;
}
context = UIActionTool.handleContextParam(actionTarget,_args,parentContext,parentViewParam,context);
data = UIActionTool.handleActionParam(actionTarget,_args,parentContext,parentViewParam,params);
context = Object.assign({},actionContext.context,context);
let parentObj:any = {srfparentdename:srfParentDeName?srfParentDeName:null,srfparentkey:srfParentDeName?context[srfParentDeName.toLowerCase()]:null};
Object.assign(data,parentObj);
......
......@@ -13,18 +13,22 @@ export declare interface UIActionTool {
*
* @param actionTarget 数据目标
* @param args 传入数据对象
* @param parentContext 父上下文
* @param parentParams 父参数
* @param param 传入应用上下数据参数
*/
handleContextParam(actionTarget:any,args:any,context:any):any;
handleContextParam(actionTarget: any, args: any,parentContext:any,parentParams:any, context: any):any;
/**
* 处理界面行为参数
*
* @param actionTarget 数据目标
* @param args 传入数据对象
* @param parentContext 父上下文
* @param parentParams 父参数
* @param param 传入界面行为附加参数
*/
handleActionParam(actionTarget:any,args:any,params:any):any;
handleActionParam(actionTarget: any, args: any,parentContext:any,parentParams:any, params: any):any;
}
declare module "vue/types/vue" {
......
......@@ -8,10 +8,12 @@ export class UIActionTool {
*
* @param actionTarget 数据目标
* @param args 传入数据对象
* @param parentContext 父上下文
* @param parentParams 父参数
* @param param 传入应用上下数据参数
*/
public static handleContextParam(actionTarget: any, args: any, context: any) {
return this.formatData(actionTarget, args, context);
public static handleContextParam(actionTarget: any, args: any,parentContext:any,parentParams:any, context: any) {
return this.formatData(actionTarget, args,parentContext,parentParams,context);
}
/**
......@@ -19,10 +21,12 @@ export class UIActionTool {
*
* @param actionTarget 数据目标
* @param args 传入数据对象
* @param parentContext 父上下文
* @param parentParams 父参数
* @param param 传入界面行为附加参数
*/
public static handleActionParam(actionTarget: any, args: any, params: any) {
return this.formatData(actionTarget, args, params);
public static handleActionParam(actionTarget: any, args: any,parentContext:any,parentParams:any, params: any) {
return this.formatData(actionTarget, args,parentContext,parentParams,params);
}
/**
......@@ -32,11 +36,13 @@ export class UIActionTool {
* @static
* @param {*} actionTarget
* @param {*} args
* @param parentContext
* @param parentParams
* @param {*} _params
* @returns {*}
* @memberof UIActionTool
*/
private static formatData(actionTarget: any, args: any, _params: any): any {
private static formatData(actionTarget: any, args: any,parentContext:any,parentParams:any, _params: any): any {
let _data: any = {};
if (Object.is(actionTarget, 'SINGLEKEY')) {
let [arg] = args;
......@@ -50,12 +56,16 @@ export class UIActionTool {
const key = value.substring(1, value.length - 1);
if (arg && arg.hasOwnProperty(key)) {
value = (arg[key] !== null && arg[key] !== undefined) ? arg[key] : null;
} else {
} else if(parentContext && parentContext.hasOwnProperty(key)){
value = (parentContext[key] !== null && parentContext[key] !== undefined) ? parentContext[key] : null;
}else if(parentParams && parentParams.hasOwnProperty(key)){
value = (parentParams[key] !== null && parentParams[key] !== undefined) ? parentParams[key] : null;
}else {
hasProperty = false;
}
}
if(hasProperty){
Object.assign(_data, { [name]: value });
Object.assign(_data, { [name.toLowerCase()]: value });
}
});
} else if (Object.is(actionTarget, 'MULTIKEY')) {
......@@ -71,7 +81,11 @@ export class UIActionTool {
args.forEach((arg: any) => {
if (arg && arg.hasOwnProperty(key)) {
value = (arg[key] !== null && arg[key] !== undefined) ? arg[key] : null;
} else {
}else if(parentContext && parentContext.hasOwnProperty(key)){
value = (parentContext[key] !== null && parentContext[key] !== undefined) ? parentContext[key] : null;
}else if(parentParams && parentParams.hasOwnProperty(key)){
value = (parentParams[key] !== null && parentParams[key] !== undefined) ? parentParams[key] : null;
}else {
value = null;
noPropertyNum++;
}
......@@ -79,7 +93,7 @@ export class UIActionTool {
});
}
if(values.length !== noPropertyNum){
Object.assign(_data, { [name]: values.length > 0 ? values.join(',') : value });
Object.assign(_data, { [name.toLowerCase()]: values.length > 0 ? values.join(',') : value });
}
});
}
......
......@@ -1799,6 +1799,7 @@ export default class EditGridBase extends Vue implements ControlInterface {
return;
}
const data = response.data;
this.createDefault(data);
data.rowDataState = "create";
_this.items.push(data);
_this.gridItemsModel.push(_this.getGridRowModel());
......@@ -1903,6 +1904,14 @@ export default class EditGridBase extends Vue implements ControlInterface {
});
return isSelected ? "grid-selected-row" : "";
}
/**
* 新建默认值
* @param {*} row 行数据
* @memberof EditGrid
*/
public createDefault(row: any){
}
}
</script>
......
......@@ -1617,6 +1617,14 @@ export default class MainBase extends Vue implements ControlInterface {
});
return isSelected ? "grid-selected-row" : "";
}
/**
* 新建默认值
* @param {*} row 行数据
* @memberof Main
*/
public createDefault(row: any){
}
}
</script>
......
......@@ -1408,6 +1408,14 @@ export default class MainBase extends Vue implements ControlInterface {
});
return isSelected ? "grid-selected-row" : "";
}
/**
* 新建默认值
* @param {*} row 行数据
* @memberof Main
*/
public createDefault(row: any){
}
}
</script>
......
......@@ -1799,6 +1799,7 @@ export default class EditGridBase extends Vue implements ControlInterface {
return;
}
const data = response.data;
this.createDefault(data);
data.rowDataState = "create";
_this.items.push(data);
_this.gridItemsModel.push(_this.getGridRowModel());
......@@ -1903,6 +1904,14 @@ export default class EditGridBase extends Vue implements ControlInterface {
});
return isSelected ? "grid-selected-row" : "";
}
/**
* 新建默认值
* @param {*} row 行数据
* @memberof EditGrid
*/
public createDefault(row: any){
}
}
</script>
......
......@@ -178,6 +178,8 @@
]"
:context="context"
:viewparams="viewparams"
:localContext ='{}'
:localParam ='{}'
parameterName='ibzemployee'
parentName="IBZEmployee"
refviewtype='DEGRIDVIEW'
......
......@@ -1556,6 +1556,14 @@ export default class MainBase extends Vue implements ControlInterface {
});
return isSelected ? "grid-selected-row" : "";
}
/**
* 新建默认值
* @param {*} row 行数据
* @memberof Main
*/
public createDefault(row: any){
}
}
</script>
......
......@@ -1541,6 +1541,14 @@ export default class MainBase extends Vue implements ControlInterface {
});
return isSelected ? "grid-selected-row" : "";
}
/**
* 新建默认值
* @param {*} row 行数据
* @memberof Main
*/
public createDefault(row: any){
}
}
</script>
......
......@@ -37,11 +37,6 @@
git clone -b master $para2 ibzou/
export NODE_OPTIONS=--max-old-space-size=4096
cd ibzou/
mvn clean package -Papi
cd ibzou-provider/ibzou-provider-api
mvn -Papi docker:build
mvn -Papi docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/ibzou-provider-api.yaml ibzlab-rt --with-registry-auth
</command>
</hudson.tasks.Shell>
</builders>
......
......@@ -14,6 +14,16 @@ services:
memory: 400M
mode: replicated
replicas: 1
volumes:
- "nfs:/app/file"
volumes:
nfs:
driver: local
driver_opts:
type: "nfs"
o: "addr=172.16.240.109,rw"
device: ":/nfs"
networks:
agent_network:
......
......@@ -31,63 +31,63 @@ public class IBZDepartmentSearchContext extends QueryWrapperContext<IBZDepartmen
public void setN_deptcode_like(String n_deptcode_like) {
this.n_deptcode_like = n_deptcode_like;
if(!ObjectUtils.isEmpty(this.n_deptcode_like)){
this.getSelectCond().like("deptcode", n_deptcode_like);
this.getSearchCond().like("deptcode", n_deptcode_like);
}
}
private String n_deptname_like;//[部门名称]
public void setN_deptname_like(String n_deptname_like) {
this.n_deptname_like = n_deptname_like;
if(!ObjectUtils.isEmpty(this.n_deptname_like)){
this.getSelectCond().like("deptname", n_deptname_like);
this.getSearchCond().like("deptname", n_deptname_like);
}
}
private String n_orgid_eq;//[单位]
public void setN_orgid_eq(String n_orgid_eq) {
this.n_orgid_eq = n_orgid_eq;
if(!ObjectUtils.isEmpty(this.n_orgid_eq)){
this.getSelectCond().eq("orgid", n_orgid_eq);
this.getSearchCond().eq("orgid", n_orgid_eq);
}
}
private String n_pdeptid_eq;//[上级部门]
public void setN_pdeptid_eq(String n_pdeptid_eq) {
this.n_pdeptid_eq = n_pdeptid_eq;
if(!ObjectUtils.isEmpty(this.n_pdeptid_eq)){
this.getSelectCond().eq("pdeptid", n_pdeptid_eq);
this.getSearchCond().eq("pdeptid", n_pdeptid_eq);
}
}
private String n_bcode_like;//[业务编码]
public void setN_bcode_like(String n_bcode_like) {
this.n_bcode_like = n_bcode_like;
if(!ObjectUtils.isEmpty(this.n_bcode_like)){
this.getSelectCond().like("bcode", n_bcode_like);
this.getSearchCond().like("bcode", n_bcode_like);
}
}
private String n_orgname_eq;//[单位]
public void setN_orgname_eq(String n_orgname_eq) {
this.n_orgname_eq = n_orgname_eq;
if(!ObjectUtils.isEmpty(this.n_orgname_eq)){
this.getSelectCond().eq("orgname", n_orgname_eq);
this.getSearchCond().eq("orgname", n_orgname_eq);
}
}
private String n_orgname_like;//[单位]
public void setN_orgname_like(String n_orgname_like) {
this.n_orgname_like = n_orgname_like;
if(!ObjectUtils.isEmpty(this.n_orgname_like)){
this.getSelectCond().like("orgname", n_orgname_like);
this.getSearchCond().like("orgname", n_orgname_like);
}
}
private String n_pdeptname_eq;//[上级部门]
public void setN_pdeptname_eq(String n_pdeptname_eq) {
this.n_pdeptname_eq = n_pdeptname_eq;
if(!ObjectUtils.isEmpty(this.n_pdeptname_eq)){
this.getSelectCond().eq("pdeptname", n_pdeptname_eq);
this.getSearchCond().eq("pdeptname", n_pdeptname_eq);
}
}
private String n_pdeptname_like;//[上级部门]
public void setN_pdeptname_like(String n_pdeptname_like) {
this.n_pdeptname_like = n_pdeptname_like;
if(!ObjectUtils.isEmpty(this.n_pdeptname_like)){
this.getSelectCond().like("pdeptname", n_pdeptname_like);
this.getSearchCond().like("pdeptname", n_pdeptname_like);
}
}
......@@ -98,7 +98,7 @@ public class IBZDepartmentSearchContext extends QueryWrapperContext<IBZDepartmen
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSelectCond().and( wrapper ->
this.getSearchCond().and( wrapper ->
wrapper.like("deptname", query)
);
}
......
......@@ -31,63 +31,63 @@ public class IBZDeptMemberSearchContext extends QueryWrapperContext<IBZDeptMembe
public void setN_deptid_eq(String n_deptid_eq) {
this.n_deptid_eq = n_deptid_eq;
if(!ObjectUtils.isEmpty(this.n_deptid_eq)){
this.getSelectCond().eq("deptid", n_deptid_eq);
this.getSearchCond().eq("deptid", n_deptid_eq);
}
}
private String n_deptname_eq;//[部门名称]
public void setN_deptname_eq(String n_deptname_eq) {
this.n_deptname_eq = n_deptname_eq;
if(!ObjectUtils.isEmpty(this.n_deptname_eq)){
this.getSelectCond().eq("deptname", n_deptname_eq);
this.getSearchCond().eq("deptname", n_deptname_eq);
}
}
private String n_deptname_like;//[部门名称]
public void setN_deptname_like(String n_deptname_like) {
this.n_deptname_like = n_deptname_like;
if(!ObjectUtils.isEmpty(this.n_deptname_like)){
this.getSelectCond().like("deptname", n_deptname_like);
this.getSearchCond().like("deptname", n_deptname_like);
}
}
private String n_userid_eq;//[用户标识]
public void setN_userid_eq(String n_userid_eq) {
this.n_userid_eq = n_userid_eq;
if(!ObjectUtils.isEmpty(this.n_userid_eq)){
this.getSelectCond().eq("userid", n_userid_eq);
this.getSearchCond().eq("userid", n_userid_eq);
}
}
private String n_personname_eq;//[成员]
public void setN_personname_eq(String n_personname_eq) {
this.n_personname_eq = n_personname_eq;
if(!ObjectUtils.isEmpty(this.n_personname_eq)){
this.getSelectCond().eq("personname", n_personname_eq);
this.getSearchCond().eq("personname", n_personname_eq);
}
}
private String n_personname_like;//[成员]
public void setN_personname_like(String n_personname_like) {
this.n_personname_like = n_personname_like;
if(!ObjectUtils.isEmpty(this.n_personname_like)){
this.getSelectCond().like("personname", n_personname_like);
this.getSearchCond().like("personname", n_personname_like);
}
}
private String n_postid_eq;//[岗位标识]
public void setN_postid_eq(String n_postid_eq) {
this.n_postid_eq = n_postid_eq;
if(!ObjectUtils.isEmpty(this.n_postid_eq)){
this.getSelectCond().eq("postid", n_postid_eq);
this.getSearchCond().eq("postid", n_postid_eq);
}
}
private String n_postname_eq;//[岗位名称]
public void setN_postname_eq(String n_postname_eq) {
this.n_postname_eq = n_postname_eq;
if(!ObjectUtils.isEmpty(this.n_postname_eq)){
this.getSelectCond().eq("postname", n_postname_eq);
this.getSearchCond().eq("postname", n_postname_eq);
}
}
private String n_postname_like;//[岗位名称]
public void setN_postname_like(String n_postname_like) {
this.n_postname_like = n_postname_like;
if(!ObjectUtils.isEmpty(this.n_postname_like)){
this.getSelectCond().like("postname", n_postname_like);
this.getSearchCond().like("postname", n_postname_like);
}
}
......@@ -98,7 +98,7 @@ public class IBZDeptMemberSearchContext extends QueryWrapperContext<IBZDeptMembe
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSelectCond().and( wrapper ->
this.getSearchCond().and( wrapper ->
wrapper.like("personname", query)
);
}
......
......@@ -31,77 +31,77 @@ public class IBZEmployeeSearchContext extends QueryWrapperContext<IBZEmployee> {
public void setN_personname_like(String n_personname_like) {
this.n_personname_like = n_personname_like;
if(!ObjectUtils.isEmpty(this.n_personname_like)){
this.getSelectCond().like("personname", n_personname_like);
this.getSearchCond().like("personname", n_personname_like);
}
}
private String n_usercode_like;//[用户工号]
public void setN_usercode_like(String n_usercode_like) {
this.n_usercode_like = n_usercode_like;
if(!ObjectUtils.isEmpty(this.n_usercode_like)){
this.getSelectCond().like("usercode", n_usercode_like);
this.getSearchCond().like("usercode", n_usercode_like);
}
}
private String n_mdeptid_eq;//[主部门]
public void setN_mdeptid_eq(String n_mdeptid_eq) {
this.n_mdeptid_eq = n_mdeptid_eq;
if(!ObjectUtils.isEmpty(this.n_mdeptid_eq)){
this.getSelectCond().eq("mdeptid", n_mdeptid_eq);
this.getSearchCond().eq("mdeptid", n_mdeptid_eq);
}
}
private String n_mdeptname_like;//[主部门名称]
public void setN_mdeptname_like(String n_mdeptname_like) {
this.n_mdeptname_like = n_mdeptname_like;
if(!ObjectUtils.isEmpty(this.n_mdeptname_like)){
this.getSelectCond().like("mdeptname", n_mdeptname_like);
this.getSearchCond().like("mdeptname", n_mdeptname_like);
}
}
private String n_bcode_like;//[业务编码]
public void setN_bcode_like(String n_bcode_like) {
this.n_bcode_like = n_bcode_like;
if(!ObjectUtils.isEmpty(this.n_bcode_like)){
this.getSelectCond().like("bcode", n_bcode_like);
this.getSearchCond().like("bcode", n_bcode_like);
}
}
private String n_postid_eq;//[岗位标识]
public void setN_postid_eq(String n_postid_eq) {
this.n_postid_eq = n_postid_eq;
if(!ObjectUtils.isEmpty(this.n_postid_eq)){
this.getSelectCond().eq("postid", n_postid_eq);
this.getSearchCond().eq("postid", n_postid_eq);
}
}
private String n_postname_eq;//[岗位名称]
public void setN_postname_eq(String n_postname_eq) {
this.n_postname_eq = n_postname_eq;
if(!ObjectUtils.isEmpty(this.n_postname_eq)){
this.getSelectCond().eq("postname", n_postname_eq);
this.getSearchCond().eq("postname", n_postname_eq);
}
}
private String n_postname_like;//[岗位名称]
public void setN_postname_like(String n_postname_like) {
this.n_postname_like = n_postname_like;
if(!ObjectUtils.isEmpty(this.n_postname_like)){
this.getSelectCond().like("postname", n_postname_like);
this.getSearchCond().like("postname", n_postname_like);
}
}
private String n_orgid_eq;//[单位]
public void setN_orgid_eq(String n_orgid_eq) {
this.n_orgid_eq = n_orgid_eq;
if(!ObjectUtils.isEmpty(this.n_orgid_eq)){
this.getSelectCond().eq("orgid", n_orgid_eq);
this.getSearchCond().eq("orgid", n_orgid_eq);
}
}
private String n_orgcode_leftlike;//[单位代码]
public void setN_orgcode_leftlike(String n_orgcode_leftlike) {
this.n_orgcode_leftlike = n_orgcode_leftlike;
if(!ObjectUtils.isEmpty(this.n_orgcode_leftlike)){
this.getSelectCond().likeRight("orgcode", n_orgcode_leftlike);
this.getSearchCond().likeRight("orgcode", n_orgcode_leftlike);
}
}
private String n_sex_eq;//[性别]
public void setN_sex_eq(String n_sex_eq) {
this.n_sex_eq = n_sex_eq;
if(!ObjectUtils.isEmpty(this.n_sex_eq)){
this.getSelectCond().eq("sex", n_sex_eq);
this.getSearchCond().eq("sex", n_sex_eq);
}
}
......@@ -112,7 +112,7 @@ public class IBZEmployeeSearchContext extends QueryWrapperContext<IBZEmployee> {
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSelectCond().and( wrapper ->
this.getSearchCond().and( wrapper ->
wrapper.like("personname", query)
);
}
......
......@@ -31,63 +31,63 @@ public class IBZOrganizationSearchContext extends QueryWrapperContext<IBZOrganiz
public void setN_orgid_like(String n_orgid_like) {
this.n_orgid_like = n_orgid_like;
if(!ObjectUtils.isEmpty(this.n_orgid_like)){
this.getSelectCond().like("orgid", n_orgid_like);
this.getSearchCond().like("orgid", n_orgid_like);
}
}
private String n_orgcode_leftlike;//[单位代码]
public void setN_orgcode_leftlike(String n_orgcode_leftlike) {
this.n_orgcode_leftlike = n_orgcode_leftlike;
if(!ObjectUtils.isEmpty(this.n_orgcode_leftlike)){
this.getSelectCond().likeRight("orgcode", n_orgcode_leftlike);
this.getSearchCond().likeRight("orgcode", n_orgcode_leftlike);
}
}
private String n_orgname_like;//[名称]
public void setN_orgname_like(String n_orgname_like) {
this.n_orgname_like = n_orgname_like;
if(!ObjectUtils.isEmpty(this.n_orgname_like)){
this.getSelectCond().like("orgname", n_orgname_like);
this.getSearchCond().like("orgname", n_orgname_like);
}
}
private String n_porgid_eq;//[上级单位]
public void setN_porgid_eq(String n_porgid_eq) {
this.n_porgid_eq = n_porgid_eq;
if(!ObjectUtils.isEmpty(this.n_porgid_eq)){
this.getSelectCond().eq("porgid", n_porgid_eq);
this.getSearchCond().eq("porgid", n_porgid_eq);
}
}
private String n_shortname_like;//[单位简称]
public void setN_shortname_like(String n_shortname_like) {
this.n_shortname_like = n_shortname_like;
if(!ObjectUtils.isEmpty(this.n_shortname_like)){
this.getSelectCond().like("shortname", n_shortname_like);
this.getSearchCond().like("shortname", n_shortname_like);
}
}
private Integer n_orglevel_gtandeq;//[单位级别]
public void setN_orglevel_gtandeq(Integer n_orglevel_gtandeq) {
this.n_orglevel_gtandeq = n_orglevel_gtandeq;
if(!ObjectUtils.isEmpty(this.n_orglevel_gtandeq)){
this.getSelectCond().ge("orglevel", n_orglevel_gtandeq);
this.getSearchCond().ge("orglevel", n_orglevel_gtandeq);
}
}
private Integer n_orglevel_ltandeq;//[单位级别]
public void setN_orglevel_ltandeq(Integer n_orglevel_ltandeq) {
this.n_orglevel_ltandeq = n_orglevel_ltandeq;
if(!ObjectUtils.isEmpty(this.n_orglevel_ltandeq)){
this.getSelectCond().le("orglevel", n_orglevel_ltandeq);
this.getSearchCond().le("orglevel", n_orglevel_ltandeq);
}
}
private String n_porgname_eq;//[上级单位]
public void setN_porgname_eq(String n_porgname_eq) {
this.n_porgname_eq = n_porgname_eq;
if(!ObjectUtils.isEmpty(this.n_porgname_eq)){
this.getSelectCond().eq("porgname", n_porgname_eq);
this.getSearchCond().eq("porgname", n_porgname_eq);
}
}
private String n_porgname_like;//[上级单位]
public void setN_porgname_like(String n_porgname_like) {
this.n_porgname_like = n_porgname_like;
if(!ObjectUtils.isEmpty(this.n_porgname_like)){
this.getSelectCond().like("porgname", n_porgname_like);
this.getSearchCond().like("porgname", n_porgname_like);
}
}
......@@ -98,7 +98,7 @@ public class IBZOrganizationSearchContext extends QueryWrapperContext<IBZOrganiz
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSelectCond().and( wrapper ->
this.getSearchCond().and( wrapper ->
wrapper.like("orgname", query)
);
}
......
......@@ -31,7 +31,7 @@ public class IBZPostSearchContext extends QueryWrapperContext<IBZPost> {
public void setN_postcode_like(String n_postcode_like) {
this.n_postcode_like = n_postcode_like;
if(!ObjectUtils.isEmpty(this.n_postcode_like)){
this.getSelectCond().like("postcode", n_postcode_like);
this.getSearchCond().like("postcode", n_postcode_like);
}
}
......@@ -42,7 +42,7 @@ public class IBZPostSearchContext extends QueryWrapperContext<IBZPost> {
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSelectCond().and( wrapper ->
this.getSearchCond().and( wrapper ->
wrapper.like("postname", query)
);
}
......
......@@ -31,70 +31,70 @@ public class IBZTeamMemberSearchContext extends QueryWrapperContext<IBZTeamMembe
public void setN_teammemberid_like(String n_teammemberid_like) {
this.n_teammemberid_like = n_teammemberid_like;
if(!ObjectUtils.isEmpty(this.n_teammemberid_like)){
this.getSelectCond().like("teammemberid", n_teammemberid_like);
this.getSearchCond().like("teammemberid", n_teammemberid_like);
}
}
private String n_teamid_eq;//[组标识]
public void setN_teamid_eq(String n_teamid_eq) {
this.n_teamid_eq = n_teamid_eq;
if(!ObjectUtils.isEmpty(this.n_teamid_eq)){
this.getSelectCond().eq("teamid", n_teamid_eq);
this.getSearchCond().eq("teamid", n_teamid_eq);
}
}
private String n_teamname_eq;//[组名称]
public void setN_teamname_eq(String n_teamname_eq) {
this.n_teamname_eq = n_teamname_eq;
if(!ObjectUtils.isEmpty(this.n_teamname_eq)){
this.getSelectCond().eq("teamname", n_teamname_eq);
this.getSearchCond().eq("teamname", n_teamname_eq);
}
}
private String n_teamname_like;//[组名称]
public void setN_teamname_like(String n_teamname_like) {
this.n_teamname_like = n_teamname_like;
if(!ObjectUtils.isEmpty(this.n_teamname_like)){
this.getSelectCond().like("teamname", n_teamname_like);
this.getSearchCond().like("teamname", n_teamname_like);
}
}
private String n_userid_eq;//[用户标识]
public void setN_userid_eq(String n_userid_eq) {
this.n_userid_eq = n_userid_eq;
if(!ObjectUtils.isEmpty(this.n_userid_eq)){
this.getSelectCond().eq("userid", n_userid_eq);
this.getSearchCond().eq("userid", n_userid_eq);
}
}
private String n_personname_eq;//[姓名]
public void setN_personname_eq(String n_personname_eq) {
this.n_personname_eq = n_personname_eq;
if(!ObjectUtils.isEmpty(this.n_personname_eq)){
this.getSelectCond().eq("personname", n_personname_eq);
this.getSearchCond().eq("personname", n_personname_eq);
}
}
private String n_personname_like;//[姓名]
public void setN_personname_like(String n_personname_like) {
this.n_personname_like = n_personname_like;
if(!ObjectUtils.isEmpty(this.n_personname_like)){
this.getSelectCond().like("personname", n_personname_like);
this.getSearchCond().like("personname", n_personname_like);
}
}
private String n_postid_eq;//[岗位标识]
public void setN_postid_eq(String n_postid_eq) {
this.n_postid_eq = n_postid_eq;
if(!ObjectUtils.isEmpty(this.n_postid_eq)){
this.getSelectCond().eq("postid", n_postid_eq);
this.getSearchCond().eq("postid", n_postid_eq);
}
}
private String n_postname_eq;//[岗位标识]
public void setN_postname_eq(String n_postname_eq) {
this.n_postname_eq = n_postname_eq;
if(!ObjectUtils.isEmpty(this.n_postname_eq)){
this.getSelectCond().eq("postname", n_postname_eq);
this.getSearchCond().eq("postname", n_postname_eq);
}
}
private String n_postname_like;//[岗位标识]
public void setN_postname_like(String n_postname_like) {
this.n_postname_like = n_postname_like;
if(!ObjectUtils.isEmpty(this.n_postname_like)){
this.getSelectCond().like("postname", n_postname_like);
this.getSearchCond().like("postname", n_postname_like);
}
}
......@@ -105,7 +105,7 @@ public class IBZTeamMemberSearchContext extends QueryWrapperContext<IBZTeamMembe
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSelectCond().and( wrapper ->
this.getSearchCond().and( wrapper ->
wrapper.like("personname", query)
);
}
......
......@@ -31,7 +31,7 @@ public class IBZTeamSearchContext extends QueryWrapperContext<IBZTeam> {
public void setN_teamid_like(String n_teamid_like) {
this.n_teamid_like = n_teamid_like;
if(!ObjectUtils.isEmpty(this.n_teamid_like)){
this.getSelectCond().like("teamid", n_teamid_like);
this.getSearchCond().like("teamid", n_teamid_like);
}
}
......@@ -42,7 +42,7 @@ public class IBZTeamSearchContext extends QueryWrapperContext<IBZTeam> {
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSelectCond().and( wrapper ->
this.getSearchCond().and( wrapper ->
wrapper.like("teamname", query)
);
}
......
......@@ -9,6 +9,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \
sleep ${IBIZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ibzou-provider-api.jar
EXPOSE 40001
EXPOSE 8081
ADD ibzou-provider-api.jar /ibzou-provider-api.jar
......@@ -3,21 +3,9 @@ services:
ibzou-provider-api:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/ibzou-provider-api:latest
ports:
- "40001:40001"
- "8081:8081"
networks:
- agent_network
environment:
- SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.180.237
- SERVER_PORT=40001
- SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=172.16.102.211:8848
- SPRING_REDIS_HOST=172.16.100.243
- SPRING_REDIS_PORT=6379
- SPRING_REDIS_DATABASE=0
- SPRING_DATASOURCE_USERNAME=a_A_5d9d78509
- SPRING_DATASOURCE_PASSWORD=@6dEfb3@
- SPRING_DATASOURCE_URL=jdbc:mysql://172.16.180.232:3306/a_A_5d9d78509?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true
- SPRING_DATASOURCE_DRIVER-CLASS-NAME=com.mysql.jdbc.Driver
- SPRING_DATASOURCE_DEFAULTSCHEMA=a_A_5d9d78509
deploy:
resources:
limits:
......@@ -26,6 +14,16 @@ services:
memory: 400M
mode: replicated
replicas: 1
volumes:
- "nfs:/app/file"
volumes:
nfs:
driver: local
driver_opts:
type: "nfs"
o: "addr=172.16.240.109,rw"
device: ":/nfs"
networks:
agent_network:
......
......@@ -17,6 +17,7 @@ import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.spring.web.readers.operation.OperationParameterReader;
import springfox.documentation.spring.web.readers.parameter.ModelAttributeParameterExpander;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import java.lang.reflect.Field;
import java.util.ArrayList;
......@@ -24,6 +25,7 @@ import java.util.List;
@Configuration
@EnableSwagger2
@ConditionalOnExpression("${swagger.enable:false}")
public class SwaggerConfiguration {
@Bean
......
......@@ -5,6 +5,10 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
import com.mongodb.QueryBuilder;
import lombok.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.ObjectUtils;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
@Slf4j
@Data
......@@ -14,4 +18,163 @@ public class QueryBuildContext extends SearchContextBase implements ISearchConte
@JSONField(serialize = false)
private QueryBuilder selectCond=new QueryBuilder();
public QueryBuilder getSearchCond(){
return this.selectCond;
}
/**
* 填充自定义查询条件
* @return
*/
public QueryBuilder getSelectCond() {
if(!ObjectUtils.isEmpty(filter)){
QueryBuilder queryBuilder=parseQueryFilter(filter);
if(!ObjectUtils.isEmpty(queryBuilder)){
selectCond.and(queryBuilder.get());
}
}
return selectCond;
}
/**
* 解析自定义查询条件
* @param queryFilter
* @return
*/
private QueryBuilder parseQueryFilter(QueryFilter queryFilter){
if( ObjectUtils.isEmpty(queryFilter.get$and()) && ObjectUtils.isEmpty(queryFilter.get$or()) && ObjectUtils.isEmpty(queryFilter.any()))
return null;
QueryBuilder rsBuilder=QueryBuilder.start();
QueryBuilder fieldBuilder=parseFieldMap(queryFilter.any());
QueryBuilder orBuilder=parseOrQueryFilter(queryFilter.get$or());
QueryBuilder andBuilder=parseAndQueryFilter(queryFilter.get$and());
if(!ObjectUtils.isEmpty(fieldBuilder)){
rsBuilder.and(fieldBuilder.get());
}
if(!ObjectUtils.isEmpty(orBuilder)){
rsBuilder.and(orBuilder.get());
}
if(!ObjectUtils.isEmpty(andBuilder)){
rsBuilder.and(andBuilder.get());
}
return rsBuilder;
}
/**
* 解析自定义条件[or]
* @param queryFilters
* @return
*/
private QueryBuilder parseOrQueryFilter(List<QueryFilter> queryFilters) {
QueryBuilder orBuilder =new QueryBuilder();
if(queryFilters==null || queryFilters.size()==0){
return null;
}
for(QueryFilter queryFilter: queryFilters){
QueryBuilder queryBuilder=parseQueryFilter(queryFilter);
if(!ObjectUtils.isEmpty(queryBuilder)){
orBuilder.or(queryBuilder.get());
}
}
return orBuilder;
}
/**
* 解析自定义条件[and]
* @param queryFilters
* @return
*/
private QueryBuilder parseAndQueryFilter(List<QueryFilter> queryFilters) {
QueryBuilder orBuilder =new QueryBuilder();
if(queryFilters==null || queryFilters.size()==0){
return null;
}
for(QueryFilter queryFilter: queryFilters){
QueryBuilder queryBuilder=parseQueryFilter(queryFilter);
if(!ObjectUtils.isEmpty(queryBuilder)){
orBuilder.and(queryBuilder.get());
}
}
return orBuilder;
}
/**
* 解析自定义条件[字段条件]
* @param fieldMap
* @return
*/
private QueryBuilder parseFieldMap(Map<String , QueryFilter.SegmentCond> fieldMap) {
if(fieldMap.size()==0)
return null;
QueryBuilder fieldBuilders=QueryBuilder.start();
for(Map.Entry<String, QueryFilter.SegmentCond> entry: fieldMap.entrySet()){
getSegmentCondSql(entry.getKey(),entry.getValue(),fieldBuilders);
}
return fieldBuilders;
}
/**
* 解析自定义条件[字段条件]
* @param fieldName
* @param segmentCond
* @param fieldBuilder
*/
private void getSegmentCondSql(String fieldName, QueryFilter.SegmentCond segmentCond,QueryBuilder fieldBuilder) {
Map<String , Object> segmentCondMap = segmentCond.any();
for(Map.Entry<String , Object> entry: segmentCondMap.entrySet()){
Object value=entry.getValue();
switch (entry.getKey()){
case "$eq":
fieldBuilder.and(QueryBuilder.start().and(fieldName).is(value).get());
break;
case "$ne":
fieldBuilder.and(QueryBuilder.start().not().and(fieldName).is(value).get());
break;
case "$gt":
fieldBuilder.and(QueryBuilder.start().and(fieldName).greaterThan(value).get());
break;
case "$gte":
fieldBuilder.and(QueryBuilder.start().and(fieldName).greaterThanEquals(value).get());
break;
case "$lt":
fieldBuilder.and(QueryBuilder.start().and(fieldName).lessThan(value).get());
break;
case "$lte":
fieldBuilder.and(QueryBuilder.start().and(fieldName).lessThanEquals(value).get());
break;
case "$null":
fieldBuilder.and(QueryBuilder.start().and(fieldName).exists(null).get());
break;
case "$notNull":
fieldBuilder.and(QueryBuilder.start().and(fieldName).exists(true).and(fieldName).notEquals("").and(fieldName).notEquals(null).get());
break;
case "$in":
fieldBuilder.and(QueryBuilder.start().and(fieldName).in(value).get());
break;
case "$notIn":
fieldBuilder.and(QueryBuilder.start().and(fieldName).not().in(value).get());
break;
case "$like":
Pattern likePattern = Pattern.compile("^.*" + value + ".*$", Pattern.CASE_INSENSITIVE);
fieldBuilder.and(QueryBuilder.start().and(fieldName).regex(likePattern).get());
break;
case "$startsWith":
Pattern startsWithPattern = Pattern.compile(value + ".*$", Pattern.CASE_INSENSITIVE);
fieldBuilder.and(QueryBuilder.start().and(fieldName).regex(startsWithPattern).get());
break;
case "$endsWith":
Pattern endsWithPattern = Pattern.compile("^.*" + value + "$", Pattern.CASE_INSENSITIVE);
fieldBuilder.and(QueryBuilder.start().and(fieldName).regex(endsWithPattern).get());
break;
case "$exists":
break;
case "$notExists":
break;
}
}
}
}
package cn.ibizlab.util.filter;
import com.fasterxml.jackson.annotation.*;
import org.springframework.data.annotation.Transient;
import java.util.*;
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class QueryFilter {
public static QueryFilter createQuery()
{
QueryFilter queryFilter=new QueryFilter();
return queryFilter;
}
public QueryFilter eq(String column,Object value) {
return op(column,SegmentCond.eq(value));
}
public QueryFilter ne(String column,Object value) {
return op(column,SegmentCond.ne(value));
}
public QueryFilter gt(String column,Object value) {
return op(column,SegmentCond.gt(value));
}
public QueryFilter ge(String column,Object value) {
return op(column,SegmentCond.ge(value));
}
public QueryFilter lt(String column,Object value) {
return op(column,SegmentCond.lt(value));
}
public QueryFilter le(String column,Object value) {
return op(column,SegmentCond.le(value));
}
public QueryFilter isnull(String column) {
return op(column,SegmentCond.isnull());
}
public QueryFilter isnotnull(String column) {
return op(column,SegmentCond.isnotnull());
}
public QueryFilter in(String column,Collection value) {
return op(column,SegmentCond.in(value));
}
public QueryFilter notin(String column,Collection value) {
return op(column,SegmentCond.notin(value));
}
public QueryFilter like(String column,String value) {
return op(column,SegmentCond.like(value));
}
public QueryFilter startsWith(String column,String value) {
return op(column,SegmentCond.startsWith(value));
}
public QueryFilter endsWith(String column,String value) {
return op(column,SegmentCond.endsWith(value));
}
public QueryFilter between(String column,Object from,Object to) {
return op(column,SegmentCond.between(from,to));
}
@JsonIgnore
@Transient
private Map<String,SegmentCond> map;
private Map<String,SegmentCond> getMap()
{
if(map==null)
map=new LinkedHashMap<>();
return map;
}
@JsonAnyGetter
public Map<String , SegmentCond> any() {
return getMap();
}
@JsonAnySetter
public void set(String column, SegmentCond value) {
getMap().put(column,value);
}
@JsonProperty(index = 999)
private List<QueryFilter> $or;
public List<QueryFilter> get$or() {
return $or;
}
public void set$or(List<QueryFilter> $or) {
this.$or = $or;
}
public QueryFilter or(QueryFilter... ors)
{
if ($or == null) {
$or = new ArrayList();
}
Collections.addAll($or, ors);
return this;
}
@JsonProperty(index = 999)
private List<QueryFilter> $and;
public List<QueryFilter> get$and() {
return $and;
}
public void set$and(List<QueryFilter> $and) {
this.$and = $and;
}
public QueryFilter and(QueryFilter... ands)
{
if ($and == null) {
$and = new ArrayList();
}
Collections.addAll($and, ands);
return this;
}
@Override
public String toString() {
return "QueryFilter{" +
"map=" + map +
", $or=" + $or +
'}';
}
private QueryFilter op(String column, SegmentCond segmentCond) {
if(this.getMap().containsKey(column))
((SegmentCond)this.getMap().get(column)).getMap().putAll(segmentCond.getMap());
else
this.getMap().put(column,segmentCond);
return this;
}
public static class SegmentCond {
@JsonIgnore
@Transient
private Map<String,Object> map;
@Override
public String toString() {
return "SegmentCond{" +
"map=" + map +
'}';
}
private Map<String,Object> getMap()
{
if(map==null)
map=new LinkedHashMap<>();
return map;
}
@JsonAnyGetter
public Map<String , Object> any() {
return getMap();
}
@JsonAnySetter
public void set(String column, Object value) {
getMap().put(column,value);
}
public static SegmentCond eq(Object value) {
return op(Segment.EQ,value);
}
public static SegmentCond ne(Object value) {
return op(Segment.NE,value);
}
public static SegmentCond gt(Object value) {
return op(Segment.GT,value);
}
public static SegmentCond ge(Object value) {
return op(Segment.GE,value);
}
public static SegmentCond lt(Object value) {
return op(Segment.LT,value);
}
public static SegmentCond le(Object value) {
return op(Segment.LE,value);
}
public static SegmentCond isnull() {
return op(Segment.IS_NULL,true);
}
public static SegmentCond isnotnull() {
return op(Segment.IS_NOT_NULL,true);
}
public static SegmentCond in(Collection value) {
return op(Segment.IN,value);
}
public static SegmentCond notin(Collection value) {
return op(Segment.NOTIN,value);
}
public static SegmentCond like(String value) {
return op(Segment.LIKE,value);
}
public static SegmentCond startsWith(String value) {
return op(Segment.LEFTLIKE,value);
}
public static SegmentCond endsWith(String value) {
return op(Segment.RIGHTLIKE,value);
}
public static SegmentCond between(Object from,Object to) {
return op(Segment.GE,from).op(Segment.LT,to);
}
private static SegmentCond op(Segment segment,Object value) {
SegmentCond segmentCond=new SegmentCond();
segmentCond.getMap().put(segment.keyword,value);
return segmentCond;
}
}
public enum Segment {
AND("$and"),
OR("$or"),
EQ("$eq"),
NE("$ne"),
GT("$gt"),
GE("$gte"),
LT("$lt"),
LE("$lte"),
IS_NULL("$null"),
IS_NOT_NULL("$notNull"),
IN("$in"),
NOTIN("$notIn"),
LIKE("$like"),
LEFTLIKE("$startsWith"),
RIGHTLIKE("$endsWith"),
EXISTS("$exists"),
NOTEXISTS("$notExists");
private final String keyword;
Segment(final String keyword) {
this.keyword = keyword;
}
}
/*
SQL: (field1>1 and field2='3' and (field3 like "a" or (field4 is not null and field5 in ['11','12']) )
JAVA: QueryFilter filter=QueryFilter.createQuery()
.gt("field1",1)
.eq("field2",'3')
.or(QueryFilter.createQuery().like("field3","a")
,QueryFilter.createQuery().isnotnull("field4").in("field5",Arrays.asList("11","12")));
JSON: {
"$or":[
{
"field3":{"$like":"a"}
},
{
"field4":{ "$notNull":true},
"field5":{"$in":["11","12"]}
}],
"field1":{"$gt":1},
"field2":{"$eq":"3" }
}
*/
}
......@@ -10,11 +10,9 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.data.domain.Sort;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import java.lang.reflect.ParameterizedType;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.*;
import java.util.function.Consumer;
@Slf4j
@Data
......@@ -73,4 +71,150 @@ public class QueryWrapperContext<T> extends SearchContextBase implements ISearch
return page;
}
public QueryWrapper<T> getSearchCond(){
return this.selectCond;
}
/**
* 填充自定义查询条件
* @return
*/
public QueryWrapper<T> getSelectCond() {
if(!ObjectUtils.isEmpty(filter)){
Consumer queryWrapper = parseQueryFilter(filter);
if(!ObjectUtils.isEmpty(queryWrapper)){
selectCond.and(queryWrapper);
}
}
return selectCond;
}
/**
* 解析自定义查询条件
* @param queryFilter
* @return
*/
private Consumer<QueryWrapper<T>> parseQueryFilter(QueryFilter queryFilter){
if(queryFilter.any().size()==0 && queryFilter.get$or()==null && queryFilter.get$and()==null)
return null;
Consumer<QueryWrapper<T>> consumer = queryWrapper -> {
Consumer fieldConsumer=parseFieldMap(queryFilter.any());
Consumer orConsumer=parseOrQueryFilter(queryFilter.get$or());
Consumer andConsumer=parseAndQueryFilter(queryFilter.get$and());
if(!ObjectUtils.isEmpty(fieldConsumer)){
queryWrapper.and(fieldConsumer);
}
if(!ObjectUtils.isEmpty(orConsumer)){
queryWrapper.and(orConsumer);
}
if(!ObjectUtils.isEmpty(andConsumer)){
queryWrapper.and(andConsumer);
}
};
return consumer;
}
/**
* 解析自定义条件[or]
* @param queryFilters
* @return
*/
private Consumer<QueryWrapper<T>> parseOrQueryFilter(List<QueryFilter> queryFilters) {
if(queryFilters==null || queryFilters.size()==0)
return null;
Consumer<QueryWrapper<T>> consumer = queryWrapper -> {
for(QueryFilter queryFilter: queryFilters){
Consumer tempQueryWrapper=parseQueryFilter(queryFilter);
queryWrapper.or(tempQueryWrapper);
}
};
return consumer;
}
/**
* 解析自定义条件[and]
* @param queryFilters
* @return
*/
private Consumer<QueryWrapper<T>> parseAndQueryFilter(List<QueryFilter> queryFilters) {
if(queryFilters==null || queryFilters.size()==0)
return null;
Consumer<QueryWrapper<T>> consumer = queryWrapper -> {
for(QueryFilter queryFilter: queryFilters){
Consumer tempQueryWrapper=parseQueryFilter(queryFilter);
queryWrapper.and(tempQueryWrapper);
}
};
return consumer;
}
/**
* 解析自定义条件[字段条件]
* @param fieldMap
* @return
*/
private Consumer<QueryWrapper<T>> parseFieldMap(Map<String , QueryFilter.SegmentCond> fieldMap) {
if(fieldMap.size()==0)
return null;
Consumer<QueryWrapper<T>> consumer = queryWrapper -> {
for(Map.Entry<String, QueryFilter.SegmentCond> field: fieldMap.entrySet()){
String fieldName=field.getKey();
QueryFilter.SegmentCond segmentCond=field.getValue();
Map<String , Object> segmentCondMap = segmentCond.any();
for(Map.Entry<String , Object> fieldCond: segmentCondMap.entrySet()){
Object value=fieldCond.getValue();
switch (fieldCond.getKey()){
case "$eq":
queryWrapper.eq(fieldName,value);
break;
case "$ne":
queryWrapper.ne(fieldName,value);
break;
case "$gt":
queryWrapper.gt(fieldName,value);
break;
case "$gte":
queryWrapper.ge(fieldName,value);
break;
case "$lt":
queryWrapper.lt(fieldName,value);
break;
case "$lte":
queryWrapper.le(fieldName,value);
break;
case "$null":
queryWrapper.isNull(fieldName);
break;
case "$notNull":
queryWrapper.isNotNull(fieldName);
break;
case "$in":
queryWrapper.in(fieldName,(Collection)value);
break;
case "$notIn":
queryWrapper.notIn(fieldName,(Collection)value);
break;
case "$like":
queryWrapper.like(fieldName,value);
break;
case "$startsWith":
queryWrapper.likeRight(fieldName,value);
break;
case "$endsWith":
queryWrapper.likeLeft(fieldName,value);
break;
case "$exists":
break;
case "$notExists":
break;
}
}
}
};
return consumer;
}
}
......@@ -12,9 +12,7 @@ import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.util.StringUtils;
import org.springframework.util.ObjectUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
@Slf4j
@Data
......@@ -35,7 +33,11 @@ public class SearchContextBase implements ISearchContext{
*/
@JsonProperty("query")
public String query;
/**
* 条件表达式
*/
@JsonProperty("filter")
public QueryFilter filter;
/**
* 数据查询
*/
......
......@@ -12,10 +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 java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import java.util.*;
@RestController
@RequestMapping(value = "")
......@@ -38,8 +35,9 @@ public class AppController {
Set<String> appMenu = new HashSet();
Set<String> uniRes = new HashSet();
AuthenticationUser curUser = AuthenticationUser.getAuthenticationUser();
if(enablePermissionValid){
Collection<GrantedAuthority> authorities=AuthenticationUser.getAuthenticationUser().getAuthorities();
Collection<GrantedAuthority> authorities=curUser.getAuthorities();
Iterator it = authorities.iterator();
while(it.hasNext()) {
GrantedAuthority authority = (GrantedAuthority)it.next();
......@@ -50,6 +48,10 @@ public class AppController {
appMenu.add(strAuthority.substring(systemId.length()+9));
}
}
Map<String,Object> context = new HashMap<>();
context.putAll(curUser.getSessionParams());
context.put("srfusername",curUser.getPersonname());
appData.put("context",context);
appData.put("unires",uniRes);
appData.put("appmenu",appMenu);
appData.put("enablepermissionvalid",enablePermissionValid);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册