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

ibizdev提交

上级 3d8fb398
......@@ -9,6 +9,7 @@
"label": "数据对象能力",
"text": "数据对象能力",
"data":"",
"codename":"Oppriv",
"value": "OPPRIV",
"disabled": false
......@@ -18,6 +19,7 @@
"label": "统一资源",
"text": "统一资源",
"data":"",
"codename":"Unires",
"value": "UNIRES",
"disabled": false
......@@ -34,6 +36,7 @@
"label": "实体行为",
"text": "实体行为",
"data":"",
"codename":"Deaction",
"value": "DEACTION",
"disabled": false
......@@ -43,6 +46,7 @@
"label": "数据集合",
"text": "数据集合",
"data":"",
"codename":"Dataset",
"value": "DATASET",
"disabled": false
......
......@@ -70,6 +70,7 @@ import AppFormatData from './components/app-format-data/app-format-data.vue'
import AppUploadFileInfo from './components/app-upload-file-info/app-upload-file-info.vue'
import ContextMenu from './components/context-menu/context-menu'
import AppColumnFormat from './components/app-column-format/app-column-format.vue'
import AppQuickGroup from './components/app-quick-group/app-quick-group.vue'
// 全局挂载UI实体服务注册中心
window['uiServiceRegister'] = uiServiceRegister;
......@@ -149,5 +150,6 @@ export const AppComponents = {
v.component('app-upload-file-info', AppUploadFileInfo);
v.component('context-menu',ContextMenu);
v.component('app-column-format',AppColumnFormat);
v.component('app-quick-group',AppQuickGroup);
},
};
\ No newline at end of file
.app-quick-group{
padding: 4px;
background-color: #F1F1F1;
.app-quick-item{
margin-right: 8px;
padding: 8px;
cursor: pointer;
.app-quick-item-label{
margin-left:4px;
}
.app-seleted-item{
display: inline-block;
font-weight: 700;
color: #0c64eb !important;
padding: 4px;
border-bottom: 2px solid;
}
.app-seleted-item:focus {
outline: none;
}
.app-quick-item-counter{
border-radius: 12px;
padding-left: 4px;
font-size: 12px;
font-weight: 400;
vertical-align: middle;
display: inline-block;
width: 18px;
height: 18px;
margin-left: 4px;
background-color: #ddd;
}
}
.app-quick-item :hover{
color: #0c64eb !important;
}
}
\ No newline at end of file
<template>
<div class="app-quick-group">
<span class="app-quick-item" v-for="item in renderArray" :key="item.id" @click="handleClick(item)">
<span v-if="!item.children" :style="{color:item.color}" :class="{'app-seleted-item':isSelectedItem(item)}">
<i v-if=" item.iconcls && !Object.is(item.iconcls, '')" :class="item.iconcls"></i>
<img v-else-if="item.icon && !Object.is(item.icon, '')" :src="item.icon" />
<span class="app-quick-item-label">{{item.label}}</span>
<span v-show="isSelectedItem(item)" class="app-quick-item-counter">0</span>
</span>
<el-dropdown v-if="item.children" style="outline: none !important;" trigger="click" @command="handleCommand($event,item)">
<span :style="{color:item.color}" :class="{'app-seleted-item':isSelectedItem(item)}">
<i v-if=" item.iconcls && !Object.is(item.iconcls, '')" :class="item.iconcls"></i>
<img v-else-if="item.icon && !Object.is(item.icon, '')" :src="item.icon" />
<span class="app-quick-item-label">{{item.label}}</span>
<span v-show="isSelectedItem(item)" class="app-quick-item-counter">0</span>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-for="childitem in item.children" :command="childitem" :key="childitem.id">
<span :style="{color:childitem.color}">
<i v-if=" childitem.iconcls && !Object.is(childitem.iconcls, '')" :class="childitem.iconcls"></i>
<img v-else-if="childitem.icon && !Object.is(childitem.icon, '')" :src="childitem.icon" />
<span :style="{color:(childitem.label == item.label)?'#0c64eb':''}">{{childitem.label}}</span>
</span>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</span>
</div>
</template>
<script lang="ts">
import { Vue, Component, Prop, Model, Emit } from "vue-property-decorator";
import CounterService from "@/counter/counter-service";
@Component({})
export default class AppQuickGroup extends Vue {
/**
* 传入渲染项
*
* @type {Array<any>}
* @memberof AppQuickGroup
*/
@Prop() public items!:Array<any>;
/**
* 计数器服务名
*
* @type {string}
* @memberof AppQuickGroup
*/
@Prop() public counterName?:string;
/**
* 计数器服务基类
*
* @type {any}
* @memberof AppQuickGroup
*/
public counterService:any = new CounterService();
/**
* 当前计数器服务
*
* @type {any}
* @memberof AppQuickGroup
*/
public curCounterService:any;
/**
* UI选中项
*
* @type {*}
* @memberof AppQuickGroup
*/
public selectedUiItem:any;
/**
* 传入渲染项
*
* @type {Array<any>}
* @memberof AppQuickGroup
*/
get renderArray(){
if(this.items && this.items.length >0){
this.selectedUiItem = this.items[0];
this.handleClick(this.items[0]);
return this.handleDataSet(this.items)
}else{
return [];
}
}
/**
* 是否选中当前项
*
* @param item 传入当前项
* @memberof AppQuickGroup
*/
public isSelectedItem(item:any){
if(this.selectedUiItem && (this.selectedUiItem.id === item.id)){
return true;
}else{
return false;
}
}
/**
* 处理代码表返回数据(树状结构)
*
* @param result 返回数组
* @memberof AppQuickGroup
*/
public handleDataSet(result:Array<any>){
let list:Array<any> = [];
if(result.length === 0){
return list;
}
result.forEach((codeItem:any) =>{
if(!codeItem.pvalue){
let valueField:string = codeItem.value;
this.setChildCodeItems(valueField,result,codeItem);
list.push(codeItem);
}
})
return list;
}
/**
* 处理非根节点数据
*
* @param pValue 父值
* @param result 返回数组
* @param codeItem 代码项
* @memberof AppQuickGroup
*/
public setChildCodeItems(pValue:string,result:Array<any>,codeItem:any){
result.forEach((item:any) =>{
if(item.pvalue == pValue){
let valueField:string = item.value;
this.setChildCodeItems(valueField,result,item);
if(!codeItem.children){
codeItem.children = [];
}
codeItem.children.push(item);
}
})
}
/**
* 处理点击事件
*
* @param $event 值
* @param isswitch 是否切换UI选中项
* @memberof AppQuickGroup
*/
public handleClick($event:any,isswitch:boolean = true){
if($event && $event.data){
this.$emit('valuechange',$event.data);
}
if(isswitch){
this.selectedUiItem = $event;
}
this.$forceUpdate();
}
/**
* 处理子项点击事件
*
* @param $event 值
* @param item 父值
* @memberof AppQuickGroup
*/
public handleCommand($event:any,item:any){
item.label = $event.label;
this.handleClick($event,false);
}
}
</script>
<style lang='less'>
@import "./app-quick-group.less";
</style>
\ No newline at end of file
......@@ -372,6 +372,15 @@ export default class MDViewEngine extends ViewEngine {
if (this.view && !this.view.isExpandSearchForm) {
Object.assign(arg, { query: this.view.query });
}
// 快速分组和快速搜索栏
let otherQueryParam:any = {};
if(this.view && this.view.qucikGroupData){
Object.assign(otherQueryParam,this.view.qucikGroupData);
}
if(this.view && this.view.qucikFormData){
Object.assign(otherQueryParam,this.view.qucikFormData);
}
Object.assign(arg,{viewparams:otherQueryParam});
}
/**
......
......@@ -17,6 +17,7 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
label: '数据对象能力',
text: '数据对象能力',
"data":"",
"codename":"Oppriv",
value: 'OPPRIV',
disabled: false,
......@@ -26,6 +27,7 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
label: '统一资源',
text: '统一资源',
"data":"",
"codename":"Unires",
value: 'UNIRES',
disabled: false,
......@@ -42,6 +44,7 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
label: '实体行为',
text: '实体行为',
"data":"",
"codename":"Deaction",
value: 'DEACTION',
disabled: false,
......@@ -51,6 +54,7 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
label: '数据集合',
text: '数据集合',
"data":"",
"codename":"Dataset",
value: 'DATASET',
disabled: false,
......
......@@ -62,6 +62,7 @@
v-show="isExpandSearchForm"
loaddraftAction="FilterGetDraft"
loadAction="FilterGet"
name="searchform"
ref='searchform'
@save="searchform_save($event)"
......@@ -102,6 +103,7 @@
</div>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
import { UIActionTool,Util } from '@/utils';
......@@ -111,6 +113,8 @@ import SYS_PERMISSIONService from '@/service/sys-permission/sys-permission-servi
import GridViewEngine from '@engine/view/grid-view-engine';
import CodeListService from "@service/app/codelist-service";
@Component({
components: {
......
......@@ -11,6 +11,7 @@
v-show="isExpandSearchForm"
loaddraftAction="FilterGetDraft"
loadAction="FilterGet"
name="searchform"
ref='searchform'
@save="searchform_save($event)"
......
......@@ -59,6 +59,7 @@
v-show="isExpandSearchForm"
loaddraftAction="FilterGetDraft"
loadAction="FilterGet"
name="searchform"
ref='searchform'
@save="searchform_save($event)"
......@@ -99,6 +100,7 @@
</div>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
import { UIActionTool,Util } from '@/utils';
......@@ -108,6 +110,8 @@ import SYS_ROLE_PERMISSIONService from '@/service/sys-role-permission/sys-role-p
import GridViewEngine from '@engine/view/grid-view-engine';
import CodeListService from "@service/app/codelist-service";
@Component({
components: {
......
......@@ -11,6 +11,7 @@
v-show="isExpandSearchForm"
loaddraftAction="FilterGetDraft"
loadAction="FilterGet"
name="searchform"
ref='searchform'
@save="searchform_save($event)"
......
......@@ -62,6 +62,7 @@
v-show="isExpandSearchForm"
loaddraftAction="FilterGetDraft"
loadAction="FilterGet"
name="searchform"
ref='searchform'
@save="searchform_save($event)"
......@@ -102,6 +103,7 @@
</div>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
import { UIActionTool,Util } from '@/utils';
......@@ -111,6 +113,8 @@ import SYS_ROLEService from '@/service/sys-role/sys-role-service';
import GridViewEngine from '@engine/view/grid-view-engine';
import CodeListService from "@service/app/codelist-service";
@Component({
components: {
......
......@@ -11,6 +11,7 @@
v-show="isExpandSearchForm"
loaddraftAction="FilterGetDraft"
loadAction="FilterGet"
name="searchform"
ref='searchform'
@save="searchform_save($event)"
......
......@@ -59,6 +59,7 @@
v-show="isExpandSearchForm"
loaddraftAction="FilterGetDraft"
loadAction="FilterGet"
name="searchform"
ref='searchform'
@save="searchform_save($event)"
......@@ -99,6 +100,7 @@
</div>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
import { UIActionTool,Util } from '@/utils';
......@@ -108,6 +110,8 @@ import SYS_USER_ROLEService from '@/service/sys-user-role/sys-user-role-service'
import GridViewEngine from '@engine/view/grid-view-engine';
import CodeListService from "@service/app/codelist-service";
@Component({
components: {
......
......@@ -11,6 +11,7 @@
v-show="isExpandSearchForm"
loaddraftAction="FilterGetDraft"
loadAction="FilterGet"
name="searchform"
ref='searchform'
@save="searchform_save($event)"
......
......@@ -62,6 +62,7 @@
v-show="isExpandSearchForm"
loaddraftAction="FilterGetDraft"
loadAction="FilterGet"
name="searchform"
ref='searchform'
@save="searchform_save($event)"
......@@ -102,6 +103,7 @@
</div>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
import { UIActionTool,Util } from '@/utils';
......@@ -111,6 +113,8 @@ import SYS_USERService from '@/service/sys-user/sys-user-service';
import GridViewEngine from '@engine/view/grid-view-engine';
import CodeListService from "@service/app/codelist-service";
@Component({
components: {
......
......@@ -11,6 +11,7 @@
v-show="isExpandSearchForm"
loaddraftAction="FilterGetDraft"
loadAction="FilterGet"
name="searchform"
ref='searchform'
@save="searchform_save($event)"
......
......@@ -216,11 +216,16 @@
>.view-card{
>.ivu-card-body{
>.content-container{
.quick-group-container,.quick-search-container,.quick-search-input{
.quick-group-container,.quick-search-input{
float: left;
margin-top: 6px;
margin-bottom: 6px;
}
.quick-search-container{
float: left;
margin-top: -2px;
margin-bottom: 6px;
}
}
}
}
......
......@@ -583,7 +583,9 @@ export default class MainBase extends Vue implements ControlInterface {
const parentdata: any = {};
this.$emit('beforeload', parentdata);
Object.assign(arg, parentdata);
Object.assign(arg,{viewparams:this.viewparams});
let tempViewParams:any = parentdata.viewparams?parentdata.viewparams:{};
Object.assign(tempViewParams,JSON.parse(JSON.stringify(this.viewparams)));
Object.assign(arg,{viewparams:tempViewParams});
const post: Promise<any> = this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
......
......@@ -31,6 +31,11 @@
.el-table {
.quick-toolbar{
display: inline-block;
button{
background: #ebf3fb;
color: #2575ca;
border: 0;
}
}
.el-tooltip{
.ivu-form-item{
......@@ -72,9 +77,6 @@
.el-table__body-wrapper{
height: calc(100% - 45px) !important;
}
.el-table__empty-block{
height: auto !important;
}
}
.ivu-modal-content{
.footer{
......@@ -85,4 +87,5 @@
}
// this is less
......@@ -581,7 +581,9 @@ export default class MainBase extends Vue implements ControlInterface {
const parentdata: any = {};
this.$emit('beforeload', parentdata);
Object.assign(arg, parentdata);
Object.assign(arg,{viewparams:this.viewparams});
let tempViewParams:any = parentdata.viewparams?parentdata.viewparams:{};
Object.assign(tempViewParams,JSON.parse(JSON.stringify(this.viewparams)));
Object.assign(arg,{viewparams:tempViewParams});
const post: Promise<any> = this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
......
......@@ -31,6 +31,11 @@
.el-table {
.quick-toolbar{
display: inline-block;
button{
background: #ebf3fb;
color: #2575ca;
border: 0;
}
}
.el-tooltip{
.ivu-form-item{
......@@ -72,9 +77,6 @@
.el-table__body-wrapper{
height: calc(100% - 45px) !important;
}
.el-table__empty-block{
height: auto !important;
}
}
.ivu-modal-content{
.footer{
......@@ -85,4 +87,5 @@
}
// this is less
......@@ -595,7 +595,9 @@ export default class MainBase extends Vue implements ControlInterface {
const parentdata: any = {};
this.$emit('beforeload', parentdata);
Object.assign(arg, parentdata);
Object.assign(arg,{viewparams:this.viewparams});
let tempViewParams:any = parentdata.viewparams?parentdata.viewparams:{};
Object.assign(tempViewParams,JSON.parse(JSON.stringify(this.viewparams)));
Object.assign(arg,{viewparams:tempViewParams});
const post: Promise<any> = this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
......
......@@ -31,6 +31,11 @@
.el-table {
.quick-toolbar{
display: inline-block;
button{
background: #ebf3fb;
color: #2575ca;
border: 0;
}
}
.el-tooltip{
.ivu-form-item{
......@@ -72,9 +77,6 @@
.el-table__body-wrapper{
height: calc(100% - 45px) !important;
}
.el-table__empty-block{
height: auto !important;
}
}
.ivu-modal-content{
.footer{
......@@ -85,4 +87,5 @@
}
// this is less
......@@ -595,7 +595,9 @@ export default class MainBase extends Vue implements ControlInterface {
const parentdata: any = {};
this.$emit('beforeload', parentdata);
Object.assign(arg, parentdata);
Object.assign(arg,{viewparams:this.viewparams});
let tempViewParams:any = parentdata.viewparams?parentdata.viewparams:{};
Object.assign(tempViewParams,JSON.parse(JSON.stringify(this.viewparams)));
Object.assign(arg,{viewparams:tempViewParams});
const post: Promise<any> = this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
......
......@@ -31,6 +31,11 @@
.el-table {
.quick-toolbar{
display: inline-block;
button{
background: #ebf3fb;
color: #2575ca;
border: 0;
}
}
.el-tooltip{
.ivu-form-item{
......@@ -72,9 +77,6 @@
.el-table__body-wrapper{
height: calc(100% - 45px) !important;
}
.el-table__empty-block{
height: auto !important;
}
}
.ivu-modal-content{
.footer{
......@@ -85,4 +87,5 @@
}
// this is less
......@@ -581,7 +581,9 @@ export default class MainBase extends Vue implements ControlInterface {
const parentdata: any = {};
this.$emit('beforeload', parentdata);
Object.assign(arg, parentdata);
Object.assign(arg,{viewparams:this.viewparams});
let tempViewParams:any = parentdata.viewparams?parentdata.viewparams:{};
Object.assign(tempViewParams,JSON.parse(JSON.stringify(this.viewparams)));
Object.assign(arg,{viewparams:tempViewParams});
const post: Promise<any> = this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
......
......@@ -31,6 +31,11 @@
.el-table {
.quick-toolbar{
display: inline-block;
button{
background: #ebf3fb;
color: #2575ca;
border: 0;
}
}
.el-tooltip{
.ivu-form-item{
......@@ -72,9 +77,6 @@
.el-table__body-wrapper{
height: calc(100% - 45px) !important;
}
.el-table__empty-block{
height: auto !important;
}
}
.ivu-modal-content{
.footer{
......@@ -85,4 +87,5 @@
}
// this is less
......@@ -37,11 +37,6 @@
git clone -b master $para2 ibzuaa/
export NODE_OPTIONS=--max-old-space-size=4096
cd ibzuaa/
mvn clean package -Pweb
cd ibzuaa-app/ibzuaa-app-web
mvn -Pweb docker:build
mvn -Pweb docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/ibzuaa-app-web.yaml ibzlab-rt --with-registry-auth
</command>
</hudson.tasks.Shell>
</builders>
......
......@@ -9,6 +9,6 @@ CMD echo "The application will start in ${IBZ_SLEEP}s..." && \
sleep ${IBZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ibzuaa-app-web.jar
EXPOSE 30002
EXPOSE 8080
ADD ibzuaa-app-web.jar /ibzuaa-app-web.jar
......@@ -3,11 +3,9 @@ services:
ibzuaa-app-web:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/ibzuaa-app-web:latest
ports:
- "30002:30002"
- "8080:8080"
networks:
- agent_network
environment:
SPRING_CLOUD_NACOS_DISCOVERY_IP: 172.16.180.237
deploy:
mode: replicated
replicas: 1
......
server:
port: 30002
\ No newline at end of file
port: 8080
\ No newline at end of file
server:
port: 30002
port: 8080
#zuul网关路由设置
zuul:
......
......@@ -3,55 +3,6 @@
],
"predefineddatarange":[{"id":"ALL","name":"全部数据"},{"id":"CURORG","name":"当前单位"},{"id":"PORG","name":"上级单位"},{"id":"SORG","name":"下级单位"},{"id":"CURORGDEPT","name":"当前部门"},{"id":"PORGDEPT","name":"上级部门"},{"id":"SORGDEPT","name":"下级部门"}],
"entities":[
{
"dename":"SYS_ROLE_PERMISSION",
"delogicname":"角色权限关系",
"sysmoudle":{"id":"UAA","name":"uaa"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" }]
}
, {
"dename":"SYS_PERMISSION",
"delogicname":"权限/资源",
"sysmoudle":{"id":"UAA","name":"uaa"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" }]
}
, {
"dename":"SYS_USER_ROLE",
"delogicname":"用户角色关系",
"sysmoudle":{"id":"UAA","name":"uaa"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }]
}
, {
"dename":"SYS_USER",
"delogicname":"系统用户",
"sysmoudle":{"id":"UAA","name":"uaa"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" }]
}
, {
"dename":"SYS_ROLE",
"delogicname":"系统角色",
"sysmoudle":{"id":"UAA","name":"uaa"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" }]
}
, {
"dename":"SYS_PSAPPMENUITEM",
"delogicname":"系统菜单项",
"sysmoudle":{"id":"UAA","name":"uaa"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" }]
}
, {
"dename":"SYS_PSDEOPPRIV",
"delogicname":"实体数据能力",
"sysmoudle":{"id":"UAA","name":"uaa"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }]
}
]
}
......@@ -112,7 +112,7 @@
</createTable>
</changeSet>
<!--输出实体[SYS_PERMISSION]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-sys_permission-175-6">
<changeSet author="a_A_5d9d78509" id="tab-sys_permission-179-6">
<createTable tableName="IBZPERMISSION">
<column name="SYS_PERMISSIONID" remarks="" type="VARCHAR(200)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_PERMISSION_SYS_PERMISSI"/>
......
......@@ -26,7 +26,7 @@
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.CREATEDATE, t1.ENABLE, t1.SYSTEMID, t1.SYS_PERMISSIONID, t1.SYS_PERMISSIONNAME, t1.PERMISSIONTYPE, t1.UPDATEDATE, t2.PSSOURCETYPE, t2.PSSOURCENAME FROM IBZPERMISSION t1 LEFT JOIN ibzpsdeoppriv t2 on t1.SYS_PERMISSIONID=t2.SYS_PSDEOPPRIVID LEFT JOIN ibzpsappmenuitem t3 on t1.SYS_PERMISSIONID =t3.PSAPPMENUID
<![CDATA[ SELECT t1.* FROM ( SELECT t1.CREATEDATE, t1.ENABLE, t1.SYSTEMID, t1.SYS_PERMISSIONID, t1.SYS_PERMISSIONNAME, t1.PERMISSIONTYPE, t1.UPDATEDATE, t2.PSSOURCETYPE, t2.PSSOURCENAME FROM IBZPERMISSION t1 LEFT JOIN ibzpsdeoppriv t2 on t1.SYS_PERMISSIONID=t2.SYS_PSDEOPPRIVID LEFT JOIN ibzpsappmenuitem t3 on t1.SYS_PERMISSIONID =t3.PSAPPMENUID WHERE T1.ENABLE=1 ) t1
]]>
</sql>
......
......@@ -32,7 +32,7 @@ public class PermissionSyncJob implements ApplicationRunner {
@Value("${ibiz.enablePermissionValid:false}")
boolean enablePermissionValid; //是否开启权限校验
@Value("${ibiz.systemid:EB948A46-DF8C-4BE3-8020-0ADA23440D31}")
@Value("${ibiz.systemid:ibzuaa}")
private String systemId;
@Override
......
......@@ -115,8 +115,6 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
if(!validDataSetHasPermission(permissionList,entityName,dataSetName)){
return false;
}
//拼接权限条件
deDataSetFillPermissionSQLRouter(deStorageMode, searchContext, entity , dataSetName , permissionList);
}
return true;
}
......@@ -344,80 +342,6 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
}
}
/**
* 根据实体存储类型,拼接权限条件
* @param deStorageMode
* @param searchContext
* @param entity
* @param dataSetName
* @param permissionList
*/
private void deDataSetFillPermissionSQLRouter(String deStorageMode , Object searchContext, EntityBase entity ,String dataSetName ,JSONObject permissionList){
//检查是否有数据权限[单行删除]
if(deStorageMode.equalsIgnoreCase("sql")){
sqlPermissionBuilder(searchContext, entity , dataSetName, permissionList);
}
else if(deStorageMode.equalsIgnoreCase("nosql")){
noSqlPermissionBuilder(searchContext, entity , dataSetName, permissionList);
}
else if(deStorageMode.equalsIgnoreCase("serviceapi")){
}
else {
throw new RuntimeException(String.format("未能识别[%s]实体对应存储模式[%s]",entity.getClass().getSimpleName(),deStorageMode));
}
}
/**
* 为NoSQL存储模式的表格查询填充权限条件
* @param searchContext
* @param entity
* @param dataSetName
* @param permissionList
*/
private void noSqlPermissionBuilder(Object searchContext, EntityBase entity, String dataSetName, JSONObject permissionList) {
if(searchContext instanceof QueryBuildContext){
//获取权限表达式[全部数据、本单位、本部门等]
String entityName=entity.getClass().getSimpleName();
JSONObject entityObj=permissionList.getJSONObject(entityName);
JSONObject permissionType=entityObj.getJSONObject(DataSetTag);
JSONArray dataRange=permissionType.getJSONArray(dataSetName);
if(dataRange.size()==0)
return ;
//根据权限表达式生成查询条件,并将查询条件设置到SearchContext中
fillNoSqlPermissionCond(dataRange,entity,((QueryBuildContext) searchContext).getSelectCond());
}
}
/**
* 为SQL存储模式的表格查询填充权限条件
* @param searchContext
* @param entity
* @param dataSetName
* @param permissionList
*/
private void sqlPermissionBuilder(Object searchContext, EntityBase entity, String dataSetName, JSONObject permissionList){
//获取权限表达式[全部数据、本单位、本部门等]
String entityName=entity.getClass().getSimpleName();
JSONObject entityObj=permissionList.getJSONObject(entityName);//获取实体
JSONObject permissionType=entityObj.getJSONObject(DataSetTag);
JSONArray dataRange=permissionType.getJSONArray(dataSetName);//获取实体数据集
if(dataRange.size()==0)
return ;
//根据权限条件获取SQL
String permissionSQL=getPermissionSQL(entity,dataRange);
//将SQL拼接到SearchContext中
if(searchContext instanceof QueryWrapperContext){
QueryWrapperContext queryWrapperContext = (QueryWrapperContext) searchContext;
QueryWrapper queryWrapper = queryWrapperContext.getSelectCond();
queryWrapper.apply(permissionSQL);
}
}
/**
* 为NoSQL存储模式的表格查询填充权限条件
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册