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

zhouweidong@lab.ibiz5.com 发布系统代码

上级 52adace1
<template> <template>
<el-select size="small" class="filter-mode" placeholder="条件逻辑" clearable v-model="curVal" @change="onChange"> <el-select size="small" class="filter-mode" placeholder="条件逻辑" v-model="curVal" @change="onChange">
<el-option <el-option
v-for="mode in filterMode" v-for="mode in filterMode"
:key="mode.value" :key="mode.value"
:label="mode.en" :label="getLabel(mode)"
:value="mode.value" :value="mode.value"
> >
</el-option> </el-option>
...@@ -43,23 +43,36 @@ export default class FilterMode extends Vue { ...@@ -43,23 +43,36 @@ export default class FilterMode extends Vue {
public filterMode: any[] = [ public filterMode: any[] = [
// { name: 'AND', value: '$and' }, // { name: 'AND', value: '$and' },
// { name: 'OR', value: '$or' }, // { name: 'OR', value: '$or' },
{ zh: '等于(=)', en: 'EQ', value: '$eq' }, { 'zh-CN': '等于(=)', 'en-US': 'EQ', value: '$eq' },
{ zh: '', en: 'NE', value: '$ne' }, { 'zh-CN': '不等于(<>)', 'en-US': 'NE', value: '$ne' },
{ zh: '', en: 'GT', value: '$gt' }, { 'zh-CN': '大于(>)', 'en-US': 'GT', value: '$gt' },
{ zh: '', en: 'GE', value: '$gte' }, { 'zh-CN': '大于等于(>=)', 'en-US': 'GE', value: '$gte' },
{ zh: '', en: 'LT', value: '$lt' }, { 'zh-CN': '小于(<)', 'en-US': 'LT', value: '$lt' },
{ zh: '', en: 'LE', value: '$lte' }, { 'zh-CN': '小于(<=)', 'en-US': 'LE', value: '$lte' },
{ zh: '', en: 'IS_NULL', value: '$null' }, { 'zh-CN': '值为空(Nil)', 'en-US': 'IS_NULL', value: '$null' },
{ zh: '', en: 'IS_NOT_NULL', value: '$notNull' }, { 'zh-CN': '值不为空(NotNil)', 'en-US': 'IS_NOT_NULL', value: '$notNull' },
{ zh: '', en: 'IN', value: '$in' }, { 'zh-CN': '值在范围中(In)', 'en-US': 'IN', value: '$in' },
{ zh: '', en: 'NOTIN', value: '$notIn' }, { 'zh-CN': '值不在范围中(NotIn)', 'en-US': 'NOTIN', value: '$notIn' },
{ zh: '', en: 'LIKE', value: '$like' }, { 'zh-CN': '文本包含(%)', 'en-US': 'LIKE', value: '$like' },
{ zh: '', en: 'LIFTLIKE', value: '$startsWith' }, { 'zh-CN': '文本左包含(%#)', 'en-US': 'LIFTLIKE', value: '$startsWith' },
{ zh: '', en: 'RIGHTLIKE', value: '$endsWith' }, { 'zh-CN': '文本右包含(#%)', 'en-US': 'RIGHTLIKE', value: '$endsWith' },
{ zh: '', en: 'EXISTS', value: '$exists' }, // { 'zh-CN': '', en: 'EXISTS', value: '$exists' },
{ zh: '', en: 'NOTEXISTS', value: '$notExists' } // { 'zh-CN': '', en: 'NOTEXISTS', value: '$notExists' }
]; ];
/**
* 获取语言文本
*
* @return {string}
* @memberof FilterMode
*/
getLabel(mode: any): string {
if(this.$i18n.locale) {
return mode[this.$i18n.locale];
}
return mode['zh-CN'];
}
/** /**
* 值改变 * 值改变
* *
......
.filter-item {
display: flex;
// margin-top: 10px;
.fa-trash-o {
color: red;
}
.filter-item-group {
width: 100px;
margin-left: 5px;
}
.filter-item-field {
width: 200px;
margin-left: 5px;
}
.filter-item-mode {
width: 200px;
margin-left: 5px;
}
.filter-item-value {
margin-left: 5px;
flex-grow: 1;
}
}
.filter-tree { .filter-tree {
.el-tree-node__content { .el-tree-node__content {
height: 40px; height: 40px;
.filter-tree-item { .filter-tree-item {
display: flex; display: flex;
width: 100%;
>div { >div {
margin-right: 10px; margin-right: 10px;
} }
...@@ -33,10 +11,20 @@ ...@@ -33,10 +11,20 @@
margin-right: 0; margin-right: 0;
} }
.filter-tree-action { .filter-tree-action {
margin-left: 20px; display: none;
align-items: center;
.ivu-btn { .ivu-btn {
margin-right: 5px; margin-right: 5px;
} }
.ivu-icon-md-close {
color: red;
font-size: 24px;
}
}
}
.filter-tree-item:hover {
.filter-tree-action {
display: flex;
} }
} }
} }
......
<template> <template>
<el-tree class="filter-tree" :data="treeItems" :props="defaultProps" :expand-on-click-node="false" default-expand-all> <el-tree class="filter-tree" :data="treeItems" :expand-on-click-node="false" default-expand-all>
<template slot-scope="{ node, data }"> <template slot-scope="{ node, data }">
<template v-if="Object.is(data.name, '$and') || Object.is(data.name, '$or')"> <template v-if="Object.is(data.label, '$and') || Object.is(data.label, '$or')">
<div class="filter-tree-item"> <div class="filter-tree-item">
<el-select size="small" v-model="data.name"> <el-select size="small" v-model="data.label" :disabled="data.isroot">
<el-option v-for="mode in relationModes" :key="mode.value" :label="mode.zh" :value="mode.value"></el-option> <el-option v-for="mode in relationModes" :key="mode.value" :label="getLabel(mode)" :value="mode.value"></el-option>
</el-select> </el-select>
<div class="filter-tree-action"> <div class="filter-tree-action">
<i-button title="添加条件" @click="onAddItem(data)"><i class="fa fa-plus" aria-hidden="true"></i> 添加条件</i-button> <i-button title="添加条件" @click="onAddItem(data)"><i class="fa fa-plus" aria-hidden="true"></i> 添加条件</i-button>
<i-button title="添加组" @click="onAddGroup(data)"><i class="fa fa-plus" aria-hidden="true"></i> 添加组</i-button> <i-button title="添加组" @click="onAddGroup(data)"><i class="fa fa-plus" aria-hidden="true"></i> 添加组</i-button>
<icon v-if="!data.isroot" type="md-close" @click="onRemoveItem(node, data)"/>
</div> </div>
</div> </div>
</template> </template>
...@@ -28,7 +29,7 @@ ...@@ -28,7 +29,7 @@
<slot v-else :data="data"></slot> <slot v-else :data="data"></slot>
</div> </div>
<div class="filter-tree-action"> <div class="filter-tree-action">
<i-button @click="onRemoveItem(node, data)" title="删除"><i class="fa fa-trash-o" aria-hidden="true"></i></i-button> <icon type="md-close" @click="onRemoveItem(node, data)"/>
</div> </div>
</div> </div>
</template> </template>
...@@ -47,24 +48,44 @@ import FilterMode from './filter-mode.vue'; ...@@ -47,24 +48,44 @@ import FilterMode from './filter-mode.vue';
}) })
export default class FilterTree extends Vue { export default class FilterTree extends Vue {
/**
* 数据集
*
* @type {*}
* @memberof FilterTree
*/
@Prop() datas: any; @Prop() datas: any;
/**
* 过滤项集合
*
* @type {*}
* @memberof FilterTree
*/
@Prop() fields: any; @Prop() fields: any;
protected defaultProps: any = { /**
children: 'items', * 组条件集合
label: 'name' *
}; * @type {*}
* @memberof FilterTree
*/
protected relationModes: any[] = [ protected relationModes: any[] = [
{ zh: '并且', en: 'AND', value: '$and' }, { 'zh-CN': '并且', 'en-US': 'AND', value: '$and' },
{ zh: '或', en: 'OR', value: '$or' } { 'zh-CN': '或', 'en-US': 'OR', value: '$or' }
]; ];
/**
* 树数据集合
*
* @type {*}
* @memberof FilterTree
*/
get treeItems() { get treeItems() {
let root: any = { let root: any = {
name: '$and', label: '$and',
items: this.datas isroot: true,
children: this.datas
}; };
if(this.datas.length == 0) { if(this.datas.length == 0) {
this.onAddItem(root); this.onAddItem(root);
...@@ -73,35 +94,72 @@ export default class FilterTree extends Vue { ...@@ -73,35 +94,72 @@ export default class FilterTree extends Vue {
return [root]; return [root];
} }
/**
* 获取语言文本
*
* @return {string}
* @memberof FilterTree
*/
getLabel(mode: any): string {
if(this.$i18n.locale) {
return mode[this.$i18n.locale];
}
return mode['zh-CN'];
}
/**
* 属性变化
*
* @return {*}
* @memberof FilterTree
*/
public onFieldChange(data: any) { public onFieldChange(data: any) {
if(!data.mode) { if(!data.mode) {
data.mode = '$eq'; data.mode = '$eq';
} }
} }
/**
* 添加条件
*
* @return {*}
* @memberof FilterTree
*/
public onAddItem(data: any) { public onAddItem(data: any) {
if(data && data.items) { if(data && data.children) {
data.items.push({ data.children.push({
field: null, field: null,
mode: null mode: null
}); });
} }
} }
/**
* 添加组
*
* @return {*}
* @memberof FilterTree
*/
public onAddGroup(data: any) { public onAddGroup(data: any) {
if(data && data.items) { if(data && data.children) {
data.items.push({ data.children.push({
name: '$and', label: '$and',
items: [] children: []
}) })
} }
} }
/**
* 删除条件/组
*
* @return {*}
* @memberof FilterTree
*/
public onRemoveItem(node: any, data: any) { public onRemoveItem(node: any, data: any) {
if(node && node.parent) { if(node && node.parent) {
let pData: any = node.parent.data; let pData: any = node.parent.data;
if(pData.items.indexOf(data) >= 0) { if(pData.children.indexOf(data) >= 0) {
pData.items.splice(pData.items.indexOf(data), 1) pData.children.splice(pData.children.indexOf(data), 1)
} }
} }
} }
......
...@@ -49,10 +49,9 @@ export default class IBZDepartmentServiceBase extends EntityService { ...@@ -49,10 +49,9 @@ export default class IBZDepartmentServiceBase extends EntityService {
*/ */
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.ibzorganization && context.ibzdepartment){ if(context.ibzorganization && context.ibzdepartment){
let res:any = await Http.getInstance().get(`/ibzorganizations/${context.ibzorganization}/ibzdepartments/${context.ibzdepartment}/select`,isloading); return Http.getInstance().get(`/ibzorganizations/${context.ibzorganization}/ibzdepartments/${context.ibzdepartment}/select`,isloading);
} }
let res:any = await Http.getInstance().get(`/ibzdepartments/${context.ibzdepartment}/select`,isloading); return Http.getInstance().get(`/ibzdepartments/${context.ibzdepartment}/select`,isloading);
return res;
} }
/** /**
...@@ -108,6 +107,7 @@ export default class IBZDepartmentServiceBase extends EntityService { ...@@ -108,6 +107,7 @@ export default class IBZDepartmentServiceBase extends EntityService {
let res:any = await Http.getInstance().post(`/ibzorganizations/${context.ibzorganization}/ibzdepartments`,data,isloading); let res:any = await Http.getInstance().post(`/ibzorganizations/${context.ibzorganization}/ibzdepartments`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_ibzemployees',JSON.stringify(res.data.ibzemployees)); this.tempStorage.setItem(tempContext.srfsessionkey+'_ibzemployees',JSON.stringify(res.data.ibzemployees));
this.tempStorage.setItem(tempContext.srfsessionkey+'_ibzdeptmembers',JSON.stringify(res.data.ibzdeptmembers)); this.tempStorage.setItem(tempContext.srfsessionkey+'_ibzdeptmembers',JSON.stringify(res.data.ibzdeptmembers));
return res;
} }
let masterData:any = {}; let masterData:any = {};
let ibzemployeesData:any = []; let ibzemployeesData:any = [];
...@@ -200,6 +200,7 @@ export default class IBZDepartmentServiceBase extends EntityService { ...@@ -200,6 +200,7 @@ export default class IBZDepartmentServiceBase extends EntityService {
let res:any = await Http.getInstance().put(`/ibzorganizations/${context.ibzorganization}/ibzdepartments/${context.ibzdepartment}`,data,isloading); let res:any = await Http.getInstance().put(`/ibzorganizations/${context.ibzorganization}/ibzdepartments/${context.ibzdepartment}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_ibzemployees',JSON.stringify(res.data.ibzemployees)); this.tempStorage.setItem(context.srfsessionkey+'_ibzemployees',JSON.stringify(res.data.ibzemployees));
this.tempStorage.setItem(context.srfsessionkey+'_ibzdeptmembers',JSON.stringify(res.data.ibzdeptmembers)); this.tempStorage.setItem(context.srfsessionkey+'_ibzdeptmembers',JSON.stringify(res.data.ibzdeptmembers));
return res;
} }
let masterData:any = {}; let masterData:any = {};
let ibzemployeesData:any = []; let ibzemployeesData:any = [];
...@@ -236,7 +237,7 @@ export default class IBZDepartmentServiceBase extends EntityService { ...@@ -236,7 +237,7 @@ export default class IBZDepartmentServiceBase extends EntityService {
let res:any = await Http.getInstance().put(`/ibzdepartments/${context.ibzdepartment}`,data,isloading); let res:any = await Http.getInstance().put(`/ibzdepartments/${context.ibzdepartment}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_ibzemployees',JSON.stringify(res.data.ibzemployees)); this.tempStorage.setItem(context.srfsessionkey+'_ibzemployees',JSON.stringify(res.data.ibzemployees));
this.tempStorage.setItem(context.srfsessionkey+'_ibzdeptmembers',JSON.stringify(res.data.ibzdeptmembers)); this.tempStorage.setItem(context.srfsessionkey+'_ibzdeptmembers',JSON.stringify(res.data.ibzdeptmembers));
return res; return res;
} }
/** /**
...@@ -250,10 +251,9 @@ export default class IBZDepartmentServiceBase extends EntityService { ...@@ -250,10 +251,9 @@ export default class IBZDepartmentServiceBase extends EntityService {
*/ */
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.ibzorganization && context.ibzdepartment){ if(context.ibzorganization && context.ibzdepartment){
let res:any = await Http.getInstance().delete(`/ibzorganizations/${context.ibzorganization}/ibzdepartments/${context.ibzdepartment}`,isloading); return Http.getInstance().delete(`/ibzorganizations/${context.ibzorganization}/ibzdepartments/${context.ibzdepartment}`,isloading);
} }
let res:any = await Http.getInstance().delete(`/ibzdepartments/${context.ibzdepartment}`,isloading); return Http.getInstance().delete(`/ibzdepartments/${context.ibzdepartment}`,isloading);
return res;
} }
/** /**
...@@ -270,11 +270,12 @@ export default class IBZDepartmentServiceBase extends EntityService { ...@@ -270,11 +270,12 @@ export default class IBZDepartmentServiceBase extends EntityService {
let res:any = await Http.getInstance().get(`/ibzorganizations/${context.ibzorganization}/ibzdepartments/${context.ibzdepartment}`,isloading); let res:any = await Http.getInstance().get(`/ibzorganizations/${context.ibzorganization}/ibzdepartments/${context.ibzdepartment}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_ibzemployees',JSON.stringify(res.data.ibzemployees)); this.tempStorage.setItem(context.srfsessionkey+'_ibzemployees',JSON.stringify(res.data.ibzemployees));
this.tempStorage.setItem(context.srfsessionkey+'_ibzdeptmembers',JSON.stringify(res.data.ibzdeptmembers)); this.tempStorage.setItem(context.srfsessionkey+'_ibzdeptmembers',JSON.stringify(res.data.ibzdeptmembers));
return res;
} }
let res:any = await Http.getInstance().get(`/ibzdepartments/${context.ibzdepartment}`,isloading); let res:any = await Http.getInstance().get(`/ibzdepartments/${context.ibzdepartment}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_ibzemployees',JSON.stringify(res.data.ibzemployees)); this.tempStorage.setItem(context.srfsessionkey+'_ibzemployees',JSON.stringify(res.data.ibzemployees));
this.tempStorage.setItem(context.srfsessionkey+'_ibzdeptmembers',JSON.stringify(res.data.ibzdeptmembers)); this.tempStorage.setItem(context.srfsessionkey+'_ibzdeptmembers',JSON.stringify(res.data.ibzdeptmembers));
return res; return res;
} }
/** /**
...@@ -292,6 +293,7 @@ export default class IBZDepartmentServiceBase extends EntityService { ...@@ -292,6 +293,7 @@ export default class IBZDepartmentServiceBase extends EntityService {
res.data.ibzdepartment = data.ibzdepartment; res.data.ibzdepartment = data.ibzdepartment;
this.tempStorage.setItem(context.srfsessionkey+'_ibzemployees',JSON.stringify(res.data.ibzemployees)); this.tempStorage.setItem(context.srfsessionkey+'_ibzemployees',JSON.stringify(res.data.ibzemployees));
this.tempStorage.setItem(context.srfsessionkey+'_ibzdeptmembers',JSON.stringify(res.data.ibzdeptmembers)); this.tempStorage.setItem(context.srfsessionkey+'_ibzdeptmembers',JSON.stringify(res.data.ibzdeptmembers));
return res;
} }
let res:any = await Http.getInstance().get(`/ibzdepartments/getdraft`,isloading); let res:any = await Http.getInstance().get(`/ibzdepartments/getdraft`,isloading);
res.data.ibzdepartment = data.ibzdepartment; res.data.ibzdepartment = data.ibzdepartment;
...@@ -346,9 +348,9 @@ export default class IBZDepartmentServiceBase extends EntityService { ...@@ -346,9 +348,9 @@ export default class IBZDepartmentServiceBase extends EntityService {
let res:any = await Http.getInstance().post(`/ibzorganizations/${context.ibzorganization}/ibzdepartments/${context.ibzdepartment}/checkkey`,data,isloading); let res:any = await Http.getInstance().post(`/ibzorganizations/${context.ibzorganization}/ibzdepartments/${context.ibzdepartment}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_ibzemployees',JSON.stringify(res.data.ibzemployees)); this.tempStorage.setItem(context.srfsessionkey+'_ibzemployees',JSON.stringify(res.data.ibzemployees));
this.tempStorage.setItem(context.srfsessionkey+'_ibzdeptmembers',JSON.stringify(res.data.ibzdeptmembers)); this.tempStorage.setItem(context.srfsessionkey+'_ibzdeptmembers',JSON.stringify(res.data.ibzdeptmembers));
return res;
} }
let res:any = await Http.getInstance().post(`/ibzdepartments/${context.ibzdepartment}/checkkey`,data,isloading); return Http.getInstance().post(`/ibzdepartments/${context.ibzdepartment}/checkkey`,data,isloading);
return res;
} }
/** /**
...@@ -397,6 +399,7 @@ export default class IBZDepartmentServiceBase extends EntityService { ...@@ -397,6 +399,7 @@ export default class IBZDepartmentServiceBase extends EntityService {
let res:any = await Http.getInstance().post(`/ibzorganizations/${context.ibzorganization}/ibzdepartments/${context.ibzdepartment}/save`,data,isloading); let res:any = await Http.getInstance().post(`/ibzorganizations/${context.ibzorganization}/ibzdepartments/${context.ibzdepartment}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_ibzemployees',JSON.stringify(res.data.ibzemployees)); this.tempStorage.setItem(context.srfsessionkey+'_ibzemployees',JSON.stringify(res.data.ibzemployees));
this.tempStorage.setItem(context.srfsessionkey+'_ibzdeptmembers',JSON.stringify(res.data.ibzdeptmembers)); this.tempStorage.setItem(context.srfsessionkey+'_ibzdeptmembers',JSON.stringify(res.data.ibzdeptmembers));
return res;
} }
let masterData:any = {}; let masterData:any = {};
let ibzemployeesData:any = []; let ibzemployeesData:any = [];
...@@ -433,7 +436,7 @@ export default class IBZDepartmentServiceBase extends EntityService { ...@@ -433,7 +436,7 @@ export default class IBZDepartmentServiceBase extends EntityService {
let res:any = await Http.getInstance().post(`/ibzdepartments/${context.ibzdepartment}/save`,data,isloading); let res:any = await Http.getInstance().post(`/ibzdepartments/${context.ibzdepartment}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_ibzemployees',JSON.stringify(res.data.ibzemployees)); this.tempStorage.setItem(context.srfsessionkey+'_ibzemployees',JSON.stringify(res.data.ibzemployees));
this.tempStorage.setItem(context.srfsessionkey+'_ibzdeptmembers',JSON.stringify(res.data.ibzdeptmembers)); this.tempStorage.setItem(context.srfsessionkey+'_ibzdeptmembers',JSON.stringify(res.data.ibzdeptmembers));
return res; return res;
} }
/** /**
...@@ -448,10 +451,9 @@ export default class IBZDepartmentServiceBase extends EntityService { ...@@ -448,10 +451,9 @@ export default class IBZDepartmentServiceBase extends EntityService {
public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.ibzorganization && true){ if(context.ibzorganization && true){
let tempData:any = JSON.parse(JSON.stringify(data)); let tempData:any = JSON.parse(JSON.stringify(data));
let res:any = await Http.getInstance().get(`/ibzorganizations/${context.ibzorganization}/ibzdepartments/fetchdefault`,tempData,isloading); return Http.getInstance().get(`/ibzorganizations/${context.ibzorganization}/ibzdepartments/fetchdefault`,tempData,isloading);
} }
let tempData:any = JSON.parse(JSON.stringify(data)); let tempData:any = JSON.parse(JSON.stringify(data));
let res:any = await Http.getInstance().get(`/ibzdepartments/fetchdefault`,tempData,isloading); return Http.getInstance().get(`/ibzdepartments/fetchdefault`,tempData,isloading);
return res;
} }
} }
\ No newline at end of file
...@@ -48,8 +48,7 @@ export default class IBZOrganizationServiceBase extends EntityService { ...@@ -48,8 +48,7 @@ export default class IBZOrganizationServiceBase extends EntityService {
* @memberof IBZOrganizationServiceBase * @memberof IBZOrganizationServiceBase
*/ */
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/ibzorganizations/${context.ibzorganization}/select`,isloading); return Http.getInstance().get(`/ibzorganizations/${context.ibzorganization}/select`,isloading);
return res;
} }
/** /**
...@@ -152,7 +151,7 @@ export default class IBZOrganizationServiceBase extends EntityService { ...@@ -152,7 +151,7 @@ export default class IBZOrganizationServiceBase extends EntityService {
let res:any = await Http.getInstance().put(`/ibzorganizations/${context.ibzorganization}`,data,isloading); let res:any = await Http.getInstance().put(`/ibzorganizations/${context.ibzorganization}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_ibzemployees',JSON.stringify(res.data.ibzemployees)); this.tempStorage.setItem(context.srfsessionkey+'_ibzemployees',JSON.stringify(res.data.ibzemployees));
this.tempStorage.setItem(context.srfsessionkey+'_ibzdepartments',JSON.stringify(res.data.ibzdepartments)); this.tempStorage.setItem(context.srfsessionkey+'_ibzdepartments',JSON.stringify(res.data.ibzdepartments));
return res; return res;
} }
/** /**
...@@ -165,8 +164,7 @@ export default class IBZOrganizationServiceBase extends EntityService { ...@@ -165,8 +164,7 @@ export default class IBZOrganizationServiceBase extends EntityService {
* @memberof IBZOrganizationServiceBase * @memberof IBZOrganizationServiceBase
*/ */
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().delete(`/ibzorganizations/${context.ibzorganization}`,isloading); return Http.getInstance().delete(`/ibzorganizations/${context.ibzorganization}`,isloading);
return res;
} }
/** /**
...@@ -179,10 +177,10 @@ export default class IBZOrganizationServiceBase extends EntityService { ...@@ -179,10 +177,10 @@ export default class IBZOrganizationServiceBase extends EntityService {
* @memberof IBZOrganizationServiceBase * @memberof IBZOrganizationServiceBase
*/ */
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/ibzorganizations/${context.ibzorganization}`,isloading); let res:any = await Http.getInstance().get(`/ibzorganizations/${context.ibzorganization}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_ibzemployees',JSON.stringify(res.data.ibzemployees)); this.tempStorage.setItem(context.srfsessionkey+'_ibzemployees',JSON.stringify(res.data.ibzemployees));
this.tempStorage.setItem(context.srfsessionkey+'_ibzdepartments',JSON.stringify(res.data.ibzdepartments)); this.tempStorage.setItem(context.srfsessionkey+'_ibzdepartments',JSON.stringify(res.data.ibzdepartments));
return res; return res;
} }
/** /**
...@@ -212,8 +210,7 @@ export default class IBZOrganizationServiceBase extends EntityService { ...@@ -212,8 +210,7 @@ export default class IBZOrganizationServiceBase extends EntityService {
* @memberof IBZOrganizationServiceBase * @memberof IBZOrganizationServiceBase
*/ */
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().post(`/ibzorganizations/${context.ibzorganization}/checkkey`,data,isloading); return Http.getInstance().post(`/ibzorganizations/${context.ibzorganization}/checkkey`,data,isloading);
return res;
} }
/** /**
...@@ -261,7 +258,7 @@ export default class IBZOrganizationServiceBase extends EntityService { ...@@ -261,7 +258,7 @@ export default class IBZOrganizationServiceBase extends EntityService {
let res:any = await Http.getInstance().post(`/ibzorganizations/${context.ibzorganization}/save`,data,isloading); let res:any = await Http.getInstance().post(`/ibzorganizations/${context.ibzorganization}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_ibzemployees',JSON.stringify(res.data.ibzemployees)); this.tempStorage.setItem(context.srfsessionkey+'_ibzemployees',JSON.stringify(res.data.ibzemployees));
this.tempStorage.setItem(context.srfsessionkey+'_ibzdepartments',JSON.stringify(res.data.ibzdepartments)); this.tempStorage.setItem(context.srfsessionkey+'_ibzdepartments',JSON.stringify(res.data.ibzdepartments));
return res; return res;
} }
/** /**
...@@ -275,7 +272,6 @@ export default class IBZOrganizationServiceBase extends EntityService { ...@@ -275,7 +272,6 @@ export default class IBZOrganizationServiceBase extends EntityService {
*/ */
public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data)); let tempData:any = JSON.parse(JSON.stringify(data));
let res:any = await Http.getInstance().get(`/ibzorganizations/fetchdefault`,tempData,isloading); return Http.getInstance().get(`/ibzorganizations/fetchdefault`,tempData,isloading);
return res;
} }
} }
\ No newline at end of file
...@@ -48,8 +48,7 @@ export default class IBZPostServiceBase extends EntityService { ...@@ -48,8 +48,7 @@ export default class IBZPostServiceBase extends EntityService {
* @memberof IBZPostServiceBase * @memberof IBZPostServiceBase
*/ */
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/ibzposts/${context.ibzpost}/select`,isloading); return Http.getInstance().get(`/ibzposts/${context.ibzpost}/select`,isloading);
return res;
} }
/** /**
...@@ -88,7 +87,7 @@ export default class IBZPostServiceBase extends EntityService { ...@@ -88,7 +87,7 @@ export default class IBZPostServiceBase extends EntityService {
let masterData:any = {}; let masterData:any = {};
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/ibzposts/${context.ibzpost}`,data,isloading); let res:any = await Http.getInstance().put(`/ibzposts/${context.ibzpost}`,data,isloading);
return res; return res;
} }
/** /**
...@@ -101,8 +100,7 @@ export default class IBZPostServiceBase extends EntityService { ...@@ -101,8 +100,7 @@ export default class IBZPostServiceBase extends EntityService {
* @memberof IBZPostServiceBase * @memberof IBZPostServiceBase
*/ */
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().delete(`/ibzposts/${context.ibzpost}`,isloading); return Http.getInstance().delete(`/ibzposts/${context.ibzpost}`,isloading);
return res;
} }
/** /**
...@@ -115,8 +113,8 @@ export default class IBZPostServiceBase extends EntityService { ...@@ -115,8 +113,8 @@ export default class IBZPostServiceBase extends EntityService {
* @memberof IBZPostServiceBase * @memberof IBZPostServiceBase
*/ */
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/ibzposts/${context.ibzpost}`,isloading); let res:any = await Http.getInstance().get(`/ibzposts/${context.ibzpost}`,isloading);
return res; return res;
} }
/** /**
...@@ -144,8 +142,7 @@ export default class IBZPostServiceBase extends EntityService { ...@@ -144,8 +142,7 @@ export default class IBZPostServiceBase extends EntityService {
* @memberof IBZPostServiceBase * @memberof IBZPostServiceBase
*/ */
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().post(`/ibzposts/${context.ibzpost}/checkkey`,data,isloading); return Http.getInstance().post(`/ibzposts/${context.ibzpost}/checkkey`,data,isloading);
return res;
} }
/** /**
...@@ -161,7 +158,7 @@ export default class IBZPostServiceBase extends EntityService { ...@@ -161,7 +158,7 @@ export default class IBZPostServiceBase extends EntityService {
let masterData:any = {}; let masterData:any = {};
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/ibzposts/${context.ibzpost}/save`,data,isloading); let res:any = await Http.getInstance().post(`/ibzposts/${context.ibzpost}/save`,data,isloading);
return res; return res;
} }
/** /**
...@@ -175,7 +172,6 @@ export default class IBZPostServiceBase extends EntityService { ...@@ -175,7 +172,6 @@ export default class IBZPostServiceBase extends EntityService {
*/ */
public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data)); let tempData:any = JSON.parse(JSON.stringify(data));
let res:any = await Http.getInstance().get(`/ibzposts/fetchdefault`,tempData,isloading); return Http.getInstance().get(`/ibzposts/fetchdefault`,tempData,isloading);
return res;
} }
} }
\ No newline at end of file
...@@ -48,8 +48,7 @@ export default class IBZTeamServiceBase extends EntityService { ...@@ -48,8 +48,7 @@ export default class IBZTeamServiceBase extends EntityService {
* @memberof IBZTeamServiceBase * @memberof IBZTeamServiceBase
*/ */
public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/ibzteams/${context.ibzteam}/select`,isloading); return Http.getInstance().get(`/ibzteams/${context.ibzteam}/select`,isloading);
return res;
} }
/** /**
...@@ -120,7 +119,7 @@ export default class IBZTeamServiceBase extends EntityService { ...@@ -120,7 +119,7 @@ export default class IBZTeamServiceBase extends EntityService {
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/ibzteams/${context.ibzteam}`,data,isloading); let res:any = await Http.getInstance().put(`/ibzteams/${context.ibzteam}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_ibzteammembers',JSON.stringify(res.data.ibzteammembers)); this.tempStorage.setItem(context.srfsessionkey+'_ibzteammembers',JSON.stringify(res.data.ibzteammembers));
return res; return res;
} }
/** /**
...@@ -133,8 +132,7 @@ export default class IBZTeamServiceBase extends EntityService { ...@@ -133,8 +132,7 @@ export default class IBZTeamServiceBase extends EntityService {
* @memberof IBZTeamServiceBase * @memberof IBZTeamServiceBase
*/ */
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().delete(`/ibzteams/${context.ibzteam}`,isloading); return Http.getInstance().delete(`/ibzteams/${context.ibzteam}`,isloading);
return res;
} }
/** /**
...@@ -147,9 +145,9 @@ export default class IBZTeamServiceBase extends EntityService { ...@@ -147,9 +145,9 @@ export default class IBZTeamServiceBase extends EntityService {
* @memberof IBZTeamServiceBase * @memberof IBZTeamServiceBase
*/ */
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/ibzteams/${context.ibzteam}`,isloading); let res:any = await Http.getInstance().get(`/ibzteams/${context.ibzteam}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_ibzteammembers',JSON.stringify(res.data.ibzteammembers)); this.tempStorage.setItem(context.srfsessionkey+'_ibzteammembers',JSON.stringify(res.data.ibzteammembers));
return res; return res;
} }
/** /**
...@@ -178,8 +176,7 @@ export default class IBZTeamServiceBase extends EntityService { ...@@ -178,8 +176,7 @@ export default class IBZTeamServiceBase extends EntityService {
* @memberof IBZTeamServiceBase * @memberof IBZTeamServiceBase
*/ */
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().post(`/ibzteams/${context.ibzteam}/checkkey`,data,isloading); return Http.getInstance().post(`/ibzteams/${context.ibzteam}/checkkey`,data,isloading);
return res;
} }
/** /**
...@@ -211,7 +208,7 @@ export default class IBZTeamServiceBase extends EntityService { ...@@ -211,7 +208,7 @@ export default class IBZTeamServiceBase extends EntityService {
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/ibzteams/${context.ibzteam}/save`,data,isloading); let res:any = await Http.getInstance().post(`/ibzteams/${context.ibzteam}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_ibzteammembers',JSON.stringify(res.data.ibzteammembers)); this.tempStorage.setItem(context.srfsessionkey+'_ibzteammembers',JSON.stringify(res.data.ibzteammembers));
return res; return res;
} }
/** /**
...@@ -225,7 +222,6 @@ export default class IBZTeamServiceBase extends EntityService { ...@@ -225,7 +222,6 @@ export default class IBZTeamServiceBase extends EntityService {
*/ */
public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data)); let tempData:any = JSON.parse(JSON.stringify(data));
let res:any = await Http.getInstance().get(`/ibzteams/fetchdefault`,tempData,isloading); return Http.getInstance().get(`/ibzteams/fetchdefault`,tempData,isloading);
return res;
} }
} }
\ No newline at end of file
package cn.ibizlab.core.extensions.service; package cn.ibizlab.core.extensions.service;
import cn.ibizlab.core.ou.service.impl.IBZEmployeeServiceImpl;
import lombok.extern.slf4j.Slf4j;
import cn.ibizlab.core.ou.domain.IBZEmployee;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Primary;
import java.util.*;
/** /**
* 实体[人员] 自定义服务对象 * 扩展目录已变更,请到[cn.ibizlab.core.extensions.service.xxExService]中来进行扩展
* 若您之前有在当前目录下扩展过其它的service对象,请将扩展的代码移到新的扩展类中,并注释掉老的扩展类,防止Bean重复
*/ */
@Slf4j @Deprecated
@Primary public class IBZEmployeeServiceEx{
@Service("IBZEmployeeServiceEx")
public class IBZEmployeeServiceEx extends IBZEmployeeServiceImpl {
@Override
protected Class currentModelClass() {
return com.baomidou.mybatisplus.core.toolkit.ReflectionKit.getSuperClassGenericType(this.getClass().getSuperclass(), 1);
}
/**
* 自定义行为[InitPwd]用户扩展
* @param et
* @return
*/
@Override
@Transactional
public IBZEmployee initPwd(IBZEmployee et) {
return super.initPwd(et);
}
} }
package cn.ibizlab.core.extensions.service;
import cn.ibizlab.core.ou.service.impl.IBZEmployeeServiceImpl;
import lombok.extern.slf4j.Slf4j;
import cn.ibizlab.core.ou.domain.IBZEmployee;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Primary;
import java.util.*;
/**
* 实体[人员] 自定义服务对象
*/
@Slf4j
@Primary
@Service("IBZEmployeeExService")
public class IBZEmployeeExService extends IBZEmployeeServiceImpl {
@Override
protected Class currentModelClass() {
return com.baomidou.mybatisplus.core.toolkit.ReflectionKit.getSuperClassGenericType(this.getClass().getSuperclass(), 1);
}
/**
* 自定义行为[InitPwd]用户扩展
* @param et
* @return
*/
@Override
@Transactional
public IBZEmployee initPwd(IBZEmployee et) {
return super.initPwd(et);
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册