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

ibiz4j 发布系统代码

上级 3a68ad3f
......@@ -95,12 +95,12 @@
"viewname": "SYS_ROLE_PERMISSIONRedirectView",
"viewtag": "47fb02384b5797f4b095e247619515f4"
},
"sys_role_permissiongridview": {
"sysrolepermissiongridview": {
"title": "角色权限关系表表格视图",
"caption": "角色权限关系",
"viewtype": "DEGRIDVIEW",
"viewmodule": "uaa",
"viewname": "SYS_ROLE_PERMISSIONGridView",
"viewname": "SysRolePermissionGridView",
"viewtag": "61a949e3c23ebdda724888662ded1478"
},
"sys_role_permissionpickupgridview": {
......
......@@ -120,7 +120,6 @@ export default class AppDepartmentSelect extends Vue {
return;
}
this.$http.get(_url).then((response: any) => {
console.log(response)
this.Nodesdata = response.data;
this.$store.commit('addDepData', { srfkey: this.filter, orgData: response.data });
}).catch((response: any) => {
......
......@@ -236,7 +236,7 @@ export default class AppOrgSelect extends Vue {
* @memberof AppOrgSelect
*/
public emitValue(name:string,value:any){
this.$emit('formitemvaluechange',{name:name,value:value});
this.$emit('select-change',{name:name,value:value});
}
}
......
......@@ -6,6 +6,8 @@ export default {
rolename: '角色名称',
permissionid: '权限表标识',
permissionname: '权限名称',
permissiontype: '权限类型',
permissionenable: '权限类型',
createdate: '建立时间',
updatedate: '更新时间',
},
......
......@@ -5,6 +5,8 @@ export default {
rolename: '角色名称',
permissionid: '权限表标识',
permissionname: '权限名称',
permissiontype: '权限类型',
permissionenable: '权限类型',
createdate: '建立时间',
updatedate: '更新时间',
},
......
......@@ -717,140 +717,6 @@ mock.onGet(new RegExp(/^\/sysrolepermissions\/fetchdefault(\?[\w-./?%&=,]*)*$/))
return [status, records ? records : []];
});
// FetchPermissionenable1
mock.onGet(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/fetchpermissionenable1$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrolepermission 方法: FetchPermissionenable1");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['roleid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/fetchpermissionenable1$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
if (items.length > 0 && paramArray.length > 0) {
paramArray.forEach((paramkey: any) => {
if (tempValue[paramkey] && tempValue[paramkey].indexOf(";") > 0) {
let keysGrounp: Array<any> = tempValue[paramkey].split(new RegExp(/[\;]/));
let tempArray: Array<any> = [];
keysGrounp.forEach((singlekey: any) => {
let _items = items.filter((item: any) => { return item[paramkey] == singlekey });
if(_items.length >0){
tempArray.push(..._items);
}
})
items = tempArray;
} else {
items = items.filter((item: any) => { return item[paramkey] == tempValue[paramkey] });
}
})
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(items);
console.groupEnd();
console.groupEnd();
return [status, items];
});
// FetchPermissionenable1
mock.onGet(new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/fetchpermissionenable1$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrolepermission 方法: FetchPermissionenable1");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
const paramArray:Array<any> = ['permissionid'];
let tempValue: any = {};
const matchArray:any = new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/fetchpermissionenable1$/).exec(config.url);
if(matchArray && matchArray.length >1 && paramArray && paramArray.length >0){
paramArray.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item, {
enumerable: true,
value: matchArray[index + 1]
});
});
}
let items = mockDatas ? mockDatas : [];
if (items.length > 0 && paramArray.length > 0) {
paramArray.forEach((paramkey: any) => {
if (tempValue[paramkey] && tempValue[paramkey].indexOf(";") > 0) {
let keysGrounp: Array<any> = tempValue[paramkey].split(new RegExp(/[\;]/));
let tempArray: Array<any> = [];
keysGrounp.forEach((singlekey: any) => {
let _items = items.filter((item: any) => { return item[paramkey] == singlekey });
if(_items.length >0){
tempArray.push(..._items);
}
})
items = tempArray;
} else {
items = items.filter((item: any) => { return item[paramkey] == tempValue[paramkey] });
}
})
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(items);
console.groupEnd();
console.groupEnd();
return [status, items];
});
// FetchPermissionenable1
mock.onGet(new RegExp(/^\/sysrolepermissions\/fetchpermissionenable1$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrolepermission 方法: FetchPermissionenable1");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas);
console.groupEnd();
console.groupEnd();
return [status, mockDatas ? mockDatas : []];
});
// FetchPermissionenable1
mock.onGet(new RegExp(/^\/sysrolepermissions\/fetchpermissionenable1(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrolepermission 方法: FetchPermissionenable1");
console.table({url:config.url, method: config.method, data:config.data});
if(config.url.includes('page')){
let url = config.url.split('?')[1];
let params = qs.parse(url);
Object.assign(config, params);
}
let status = MockAdapter.mockStatus(config);
if (status !== 200) {
return [status, null];
}
let total = mockDatas.length;
let records: Array<any> = [];
if(!config.page || !config.size){
records = mockDatas;
}else{
if((config.page-1)*config.size < total){
records = mockDatas.slice(config.page,config.size);
}
}
console.groupCollapsed("response数据 status: "+status+" data: ");
console.table(records ? records : []);
console.groupEnd();
console.groupEnd();
return [status, records ? records : []];
});
// URI参数传递情况未实现
// URI参数传递情况未实现
......
......@@ -103,12 +103,12 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => {
"viewname": "SYS_ROLE_PERMISSIONRedirectView",
"viewtag": "47fb02384b5797f4b095e247619515f4"
},
"sys_role_permissiongridview": {
"sysrolepermissiongridview": {
"title": "角色权限关系表表格视图",
"caption": "角色权限关系",
"viewtype": "DEGRIDVIEW",
"viewmodule": "uaa",
"viewname": "SYS_ROLE_PERMISSIONGridView",
"viewname": "SysRolePermissionGridView",
"viewtag": "61a949e3c23ebdda724888662ded1478"
},
"sys_role_permissionpickupgridview": {
......
<template>
<div class='view-container degridview sys-role-permission-grid-view'>
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="sysrolepermissiongridview"></app-studioaction>
<card class='view-card view-no-caption' :dis-hover="true" :bordered="false">
<div class='content-container'>
<div class='view-top-messages'>
</div>
<div style='margin-bottom: 6px;'>
<i-input v-show="!isExpandSearchForm" v-model="query" search enter-button @on-search="onSearch($event)" class='quick-search-input' style='max-width: 400px;' placeholder="权限表标识" />
<div class='pull-right'>
<div class='toolbar-container'>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem3.visabled" :disabled="toolBarModels.tbitem3.disabled" class='' @click="toolbar_click({ tag: 'tbitem3' }, $event)">
<i class='fa fa-file-text-o'></i>
<span class='caption'>{{$t('entities.sysrolepermission.gridviewtoolbar_toolbar.tbitem3.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.sysrolepermission.gridviewtoolbar_toolbar.tbitem3.tip')}}</div>
</tooltip>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem4.visabled" :disabled="toolBarModels.tbitem4.disabled" class='' @click="toolbar_click({ tag: 'tbitem4' }, $event)">
<i class='fa fa-edit'></i>
<span class='caption'>{{$t('entities.sysrolepermission.gridviewtoolbar_toolbar.tbitem4.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.sysrolepermission.gridviewtoolbar_toolbar.tbitem4.tip')}}</div>
</tooltip>
<tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem6.visabled" :disabled="toolBarModels.tbitem6.disabled" class='' @click="toolbar_click({ tag: 'tbitem6' }, $event)">
<i class='fa fa-copy'></i>
<span class='caption'>{{$t('entities.sysrolepermission.gridviewtoolbar_toolbar.tbitem6.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.sysrolepermission.gridviewtoolbar_toolbar.tbitem6.tip')}}</div>
</tooltip>
<span class='seperator'>|</span> <tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem8.visabled" :disabled="toolBarModels.tbitem8.disabled" class='' @click="toolbar_click({ tag: 'tbitem8' }, $event)">
<i class='fa fa-remove'></i>
<span class='caption'>{{$t('entities.sysrolepermission.gridviewtoolbar_toolbar.tbitem8.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.sysrolepermission.gridviewtoolbar_toolbar.tbitem8.tip')}}</div>
</tooltip>
<span class='seperator'>|</span> <tooltip :transfer="true" :max-width="600">
<app-export-excel :item="toolBarModels.tbitem13" :caption="$t('entities.sysrolepermission.gridviewtoolbar_toolbar.tbitem13.caption')" @exportexcel="toolbar_click({ tag: 'tbitem13' }, $event)"></app-export-excel>
<div slot='content'>{{$t('entities.sysrolepermission.gridviewtoolbar_toolbar.tbitem13.tip')}}</div>
</tooltip>
<span class='seperator'>|</span> <tooltip :transfer="true" :max-width="600">
<i-button v-show="toolBarModels.tbitem19.visabled" :disabled="toolBarModels.tbitem19.disabled" class='' @click="toolbar_click({ tag: 'tbitem19' }, $event)">
<i class='fa fa-filter'></i>
<span class='caption'>{{$t('entities.sysrolepermission.gridviewtoolbar_toolbar.tbitem19.caption')}}</span>
</i-button>
<div slot='content'>{{$t('entities.sysrolepermission.gridviewtoolbar_toolbar.tbitem19.tip')}}</div>
</tooltip>
</div>
</div>
</div>
<view_searchform
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:showBusyIndicator="true"
v-show="isExpandSearchForm"
loaddraftAction="FilterGetDraft"
loadAction="FilterGet"
name="searchform"
ref='searchform'
@save="searchform_save($event)"
@search="searchform_search($event)"
@load="searchform_load($event)"
@closeview="closeView($event)">
</view_searchform>
<view_grid
:viewState="viewState"
:viewparams="viewparams"
:context="context"
:isSingleSelect="isSingleSelect"
:showBusyIndicator="true"
:isOpenEdit="false"
:gridRowActiveMode="gridRowActiveMode"
@save="onSave"
updateAction=""
removeAction="Remove"
loaddraftAction=""
loadAction=""
createAction=""
fetchAction="FetchDefault"
:newdata="newdata"
:opendata="opendata"
name="grid"
ref='grid'
@selectionchange="grid_selectionchange($event)"
@beforeload="grid_beforeload($event)"
@rowdblclick="grid_rowdblclick($event)"
@remove="grid_remove($event)"
@load="grid_load($event)"
@closeview="closeView($event)">
</view_grid>
<div class='view-bottom-messages'>
</div>
</div>
</card>
</div>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';
import { UIActionTool,Util } from '@/utils';
import { Subject } from 'rxjs';
import SysRolePermissionService from '@/service/sys-role-permission/sys-role-permission-service';
import GridViewEngine from '@engine/view/grid-view-engine';
import CodeListService from "@service/app/codelist-service";
@Component({
components: {
},
})
export default class SysRolePermissionGridViewBase extends Vue {
/**
* 实体服务对象
*
* @type {SysRolePermissionService}
* @memberof SysRolePermissionGridViewBase
*/
public appEntityService: SysRolePermissionService = new SysRolePermissionService;
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof SysRolePermissionGridViewBase
*/
public counterServiceArray:Array<any> = [];
/**
* 数据变化
*
* @param {*} val
* @returns {*}
* @memberof SysRolePermissionGridViewBase
*/
@Emit()
public viewDatasChange(val: any):any {
return val;
}
/**
* 传入视图上下文
*
* @type {string}
* @memberof SysRolePermissionGridViewBase
*/
@Prop() public viewdata!: string;
/**
* 传入视图参数
*
* @type {string}
* @memberof SysRolePermissionGridViewBase
*/
@Prop() public viewparam!: string;
/**
* 视图默认使用
*
* @type {boolean}
* @memberof SysRolePermissionGridViewBase
*/
@Prop({ default: true }) public viewDefaultUsage!: boolean;
/**
* 视图标识
*
* @type {string}
* @memberof SysRolePermissionGridViewBase
*/
public viewtag: string = '61a949e3c23ebdda724888662ded1478';
/**
* 自定义视图导航上下文集合
*
* @type {*}
* @memberof SysRolePermissionGridViewBase
*/
public customViewNavContexts:any ={
};
/**
* 自定义视图导航参数集合
*
* @type {*}
* @memberof SysRolePermissionGridViewBase
*/
public customViewParams:any ={
};
/**
* 视图模型数据
*
* @type {*}
* @memberof SysRolePermissionGridViewBase
*/
public model: any = {
srfCaption: 'entities.sysrolepermission.views.gridview.caption',
srfTitle: 'entities.sysrolepermission.views.gridview.title',
srfSubTitle: 'entities.sysrolepermission.views.gridview.subtitle',
dataInfo: ''
}
/**
* 视图参数变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof SysRolePermissionGridViewBase
*/
@Watch('viewparam',{immediate: true, deep: true})
onParamData(newVal: any, oldVal: any) {
if(newVal){
for(let key in this.viewparams){
delete this.viewparams[key];
}
Object.assign(this.viewparams, JSON.parse(this.viewparam));
}
}
/**
* 处理应用上下文变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof SysRolePermissionGridViewBase
*/
@Watch('viewdata')
onViewData(newVal: any, oldVal: any) {
const _this: any = this;
if (!Object.is(newVal, oldVal) && _this.engine) {
_this.parseViewParam();
_this.engine.load();
}
}
/**
* 容器模型
*
* @type {*}
* @memberof SysRolePermissionGridViewBase
*/
public containerModel: any = {
view_toolbar: { name: 'toolbar', type: 'TOOLBAR' },
view_grid: { name: 'grid', type: 'GRID' },
view_searchform: { name: 'searchform', type: 'SEARCHFORM' },
};
/**
* 计数器刷新
*
* @memberof SysRolePermissionGridViewBase
*/
public counterRefresh(){
const _this:any =this;
if(_this.counterServiceArray && _this.counterServiceArray.length >0){
_this.counterServiceArray.forEach((item:any) =>{
if(item.refreshData && item.refreshData instanceof Function){
item.refreshData();
}
})
}
}
/**
* 视图状态订阅对象
*
* @public
* @type {Subject<{action: string, data: any}>}
* @memberof SysRolePermissionGridViewBase
*/
public viewState: Subject<ViewState> = new Subject();
/**
* 工具栏模型
*
* @type {*}
* @memberof SysRolePermissionGridView
*/
public toolBarModels: any = {
tbitem3: { name: 'tbitem3', caption: '新建', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'New', target: '' } },
tbitem4: { name: 'tbitem4', caption: '编辑', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'Edit', target: 'SINGLEKEY' } },
tbitem6: { name: 'tbitem6', caption: '拷贝', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'Copy', target: 'SINGLEKEY' } },
tbitem7: { name: 'tbitem7', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem8: { name: 'tbitem8', caption: '删除', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'Remove', target: 'MULTIKEY' } },
tbitem9: { name: 'tbitem9', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem13: { name: 'tbitem13', caption: '导出', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'ExportExcel', target: '' }, MaxRowCount: 1000 },
tbitem10: { name: 'tbitem10', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem19: { name: 'tbitem19', caption: '过滤', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'ToggleFilter', target: '' } },
};
/**
* 视图引擎
*
* @public
* @type {Engine}
* @memberof SysRolePermissionGridViewBase
*/
public engine: GridViewEngine = new GridViewEngine();
/**
* 引擎初始化
*
* @public
* @memberof SysRolePermissionGridViewBase
*/
public engineInit(): void {
this.engine.init({
view: this,
opendata: (args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any) => {
this.opendata(args,fullargs, params, $event, xData);
},
newdata: (args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any) => {
this.newdata(args,fullargs, params, $event, xData);
},
grid: this.$refs.grid,
searchform: this.$refs.searchform,
keyPSDEField: 'sysrolepermission',
majorPSDEField: 'permissionid',
isLoadDefault: true,
});
}
/**
* 应用上下文
*
* @type {*}
* @memberof SysRolePermissionGridViewBase
*/
public context:any = {};
/**
* 视图参数
*
* @type {*}
* @memberof SysRolePermissionGridViewBase
*/
public viewparams:any = {};
/**
* 解析视图参数
*
* @public
* @memberof SysRolePermissionGridViewBase
*/
public parseViewParam(): void {
for(let key in this.context){
delete this.context[key];
}
if (!this.viewDefaultUsage && this.viewdata && !Object.is(this.viewdata, '')) {
Object.assign(this.context, JSON.parse(this.viewdata));
if(this.context && this.context.srfparentdename){
Object.assign(this.viewparams,{srfparentdename:this.context.srfparentdename});
}
if(this.context && this.context.srfparentkey){
Object.assign(this.viewparams,{srfparentkey:this.context.srfparentkey});
}
this.handleCustomViewData();
return;
}
const path = (this.$route.matched[this.$route.matched.length - 1]).path;
const keys: Array<any> = [];
const curReg = this.$pathToRegExp.pathToRegexp(path, keys);
const matchArray = curReg.exec(this.$route.path);
let tempValue: Object = {};
keys.forEach((item: any, index: number) => {
Object.defineProperty(tempValue, item.name, {
enumerable: true,
value: matchArray[index + 1]
});
});
this.$viewTool.formatRouteParams(tempValue,this.$route,this.context,this.viewparams);
if(this.$store.getters.getAppData() && this.$store.getters.getAppData().context){
Object.assign(this.context,this.$store.getters.getAppData().context);
}
//初始化视图唯一标识
Object.assign(this.context,{srfsessionid:this.$util.createUUID()});
this.handleCustomViewData();
}
/**
* 处理自定义视图数据
*
* @memberof SysRolePermissionGridViewBase
*/
public handleCustomViewData(){
if(Object.keys(this.customViewNavContexts).length > 0){
Object.keys(this.customViewNavContexts).forEach((item:any) =>{
let tempContext:any = {};
let curNavContext:any = this.customViewNavContexts[item];
this.handleCustomDataLogic(curNavContext,tempContext,item);
Object.assign(this.context,tempContext);
})
}
if(Object.keys(this.customViewParams).length > 0){
Object.keys(this.customViewParams).forEach((item:any) =>{
let tempParam:any = {};
let curNavParam:any = this.customViewParams[item];
this.handleCustomDataLogic(curNavParam,tempParam,item);
Object.assign(this.viewparams,tempParam);
})
}
}
/**
* 处理自定义视图数据逻辑
*
* @memberof SysRolePermissionGridViewBase
*/
public handleCustomDataLogic(curNavData:any,tempData:any,item:string){
// 直接值直接赋值
if(curNavData.isRawValue){
if(Object.is(curNavData.value,"null") || Object.is(curNavData.value,"")){
Object.defineProperty(tempData, item.toLowerCase(), {
value: null,
writable : true,
enumerable : true,
configurable : true
});
}else{
Object.defineProperty(tempData, item.toLowerCase(), {
value: curNavData.value,
writable : true,
enumerable : true,
configurable : true
});
}
}else{
// 先从导航上下文取数,没有再从导航参数(URL)取数,如果导航上下文和导航参数都没有则为null
if(this.context[(curNavData.value).toLowerCase()]){
Object.defineProperty(tempData, item.toLowerCase(), {
value: this.context[(curNavData.value).toLowerCase()],
writable : true,
enumerable : true,
configurable : true
});
}else{
if(this.viewparams[(curNavData.value).toLowerCase()]){
Object.defineProperty(tempData, item.toLowerCase(), {
value: this.viewparams[(curNavData.value).toLowerCase()],
writable : true,
enumerable : true,
configurable : true
});
}else{
Object.defineProperty(tempData, item.toLowerCase(), {
value: null,
writable : true,
enumerable : true,
configurable : true
});
}
}
}
}
/**
* Vue声明周期
*
* @memberof SysRolePermissionGridViewBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof SysRolePermissionGridViewBase
*/
public afterCreated(){
const secondtag = this.$util.createUUID();
this.$store.commit('viewaction/createdView', { viewtag: this.viewtag, secondtag: secondtag });
this.viewtag = secondtag;
this.parseViewParam();
if(this.formDruipart){
this.formDruipart.subscribe((res:any) =>{
if(Object.is(res.action,'save')){
this.viewState.next({ tag:'grid', action: 'save', data: this.viewparams });
}
if(Object.is(res.action,'load')){
const _this: any = this;
_this.engine.load(res.data,true);
}
});
}
}
/**
* 销毁之前
*
* @memberof SysRolePermissionGridViewBase
*/
public beforeDestroy() {
this.$store.commit('viewaction/removeView', this.viewtag);
}
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof SysRolePermissionGridViewBase
*/
public mounted() {
this.afterMounted();
}
/**
* 执行mounted后的逻辑
*
* @memberof SysRolePermissionGridViewBase
*/
public afterMounted(){
const _this: any = this;
_this.engineInit();
if (_this.loadModel && _this.loadModel instanceof Function) {
_this.loadModel();
}
}
/**
* toolbar 部件 click 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof SysRolePermissionGridViewBase
*/
public toolbar_click($event: any, $event2?: any) {
if (Object.is($event.tag, 'tbitem3')) {
this.toolbar_tbitem3_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem4')) {
this.toolbar_tbitem4_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem5')) {
this.toolbar_tbitem5_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem6')) {
this.toolbar_tbitem6_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem24')) {
this.toolbar_tbitem24_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem25')) {
this.toolbar_tbitem25_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem8')) {
this.toolbar_tbitem8_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem13')) {
this.toolbar_tbitem13_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem11')) {
this.toolbar_tbitem11_click(null, '', $event2);
}
if (Object.is($event.tag, 'tbitem19')) {
this.toolbar_tbitem19_click(null, '', $event2);
}
}
/**
* grid 部件 selectionchange 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof SysRolePermissionGridViewBase
*/
public grid_selectionchange($event: any, $event2?: any) {
this.engine.onCtrlEvent('grid', 'selectionchange', $event);
}
/**
* grid 部件 beforeload 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof SysRolePermissionGridViewBase
*/
public grid_beforeload($event: any, $event2?: any) {
this.engine.onCtrlEvent('grid', 'beforeload', $event);
}
/**
* grid 部件 rowdblclick 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof SysRolePermissionGridViewBase
*/
public grid_rowdblclick($event: any, $event2?: any) {
this.engine.onCtrlEvent('grid', 'rowdblclick', $event);
}
/**
* grid 部件 remove 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof SysRolePermissionGridViewBase
*/
public grid_remove($event: any, $event2?: any) {
this.engine.onCtrlEvent('grid', 'remove', $event);
}
/**
* grid 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof SysRolePermissionGridViewBase
*/
public grid_load($event: any, $event2?: any) {
this.engine.onCtrlEvent('grid', 'load', $event);
}
/**
* searchform 部件 save 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof SysRolePermissionGridViewBase
*/
public searchform_save($event: any, $event2?: any) {
this.engine.onCtrlEvent('searchform', 'save', $event);
}
/**
* searchform 部件 search 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof SysRolePermissionGridViewBase
*/
public searchform_search($event: any, $event2?: any) {
this.engine.onCtrlEvent('searchform', 'search', $event);
}
/**
* searchform 部件 load 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof SysRolePermissionGridViewBase
*/
public searchform_load($event: any, $event2?: any) {
this.engine.onCtrlEvent('searchform', 'load', $event);
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem3_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.New(datas, contextJO,paramJO, $event, xData,this,"SysRolePermission");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem4_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.Edit(datas, contextJO,paramJO, $event, xData,this,"SysRolePermission");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem5_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.View(datas, contextJO,paramJO, $event, xData,this,"SysRolePermission");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem6_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.Copy(datas, contextJO,paramJO, $event, xData,this,"SysRolePermission");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem24_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.ToggleRowEdit(datas, contextJO,paramJO, $event, xData,this,"SysRolePermission");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem25_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.NewRow(datas, contextJO,paramJO, $event, xData,this,"SysRolePermission");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem8_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.Remove(datas, contextJO,paramJO, $event, xData,this,"SysRolePermission");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem13_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.ExportExcel(datas, contextJO,paramJO, $event, xData,this,"SysRolePermission");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem11_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.Print(datas, contextJO,paramJO, $event, xData,this,"SysRolePermission");
}
/**
* 逻辑事件
*
* @param {*} [params={}]
* @param {*} [tag]
* @param {*} [$event]
* @memberof
*/
public toolbar_tbitem19_click(params: any = {}, tag?: any, $event?: any) {
// 参数
// 取数
let datas: any[] = [];
let xData: any = null;
// _this 指向容器对象
const _this: any = this;
let paramJO:any = {};
let contextJO:any = {};
xData = this.$refs.grid;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
if(params){
datas = [params];
}
// 界面行为
this.ToggleFilter(datas, contextJO,paramJO, $event, xData,this,"SysRolePermission");
}
/**
* 打开新建数据视图
*
* @param {any[]} args
* @param {*} [params]
* @param {*} [fullargs]
* @param {*} [$event]
* @param {*} [xData]
* @memberof SysRolePermissionGridView
*/
public newdata(args: any[],fullargs?:any[], params?: any, $event?: any, xData?: any) {
const batchAddPSAppViews=[
{view:{viewname:'sys-permissionmpickup-view',height: 0,width: 0,title: '权限表数据多项选择视图'},
res:['SysPermission'],
'resAppKey':'permissionid'},
{view:{viewname:'sys-rolempickup-view',height: 0,width: 0,title: '角色数据多项选择视图'},
res:['SysRole'],
'resAppKey':'roleid'}
];
if(batchAddPSAppViews.length == 0 || !this.context.srfparentdename){
this.$Notice.warning({ title: '错误', desc: '批量添加需添加N:N关系' });
return;
}
let openViewModel:any = batchAddPSAppViews.find((item:any) =>{
return (item.res && (item.res[0] !== this.context.srfparentdename));
})
let otherViewModel:any = batchAddPSAppViews.find((item:any) =>{
return (item.res && (item.res[0] == this.context.srfparentdename));
})
let container: Subject<any> = this.$appmodal.openModal(openViewModel.view, JSON.parse(JSON.stringify(this.context)), args[0]);
container.subscribe((result: any) => {
if (!result || !Object.is(result.ret, 'OK')) {
return;
}
if(result.datas && result.datas.length == 0){
return;
}
let requestParam:Array<any> = [];
result.datas.forEach((record:any) => {
let tempParam:any = {};
tempParam[otherViewModel.resAppKey] = this.context['srfparentkey'];
tempParam[openViewModel.resAppKey] = record.srfkey;
requestParam.push(tempParam);
});
this.appEntityService.createBatch(JSON.parse(JSON.stringify(this.context)),requestParam,true).then((response:any) =>{
if (!response || response.status !== 200) {
this.$Notice.error({ title: '错误', desc: '批处理操作失败' });
return;
}
if (!xData || !(xData.refresh instanceof Function)) {
return;
}
xData.refresh(result.datas);
});
});
}
/**
* 打开编辑数据视图
*
* @param {any[]} args
* @param {*} [params]
* @param {*} [fullargs]
* @param {*} [$event]
* @param {*} [xData]
* @memberof SysRolePermissionGridView
*/
public opendata(args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any) {
const data: any = {};
let curViewParam = JSON.parse(JSON.stringify(this.context));
if(args.length >0){
Object.assign(curViewParam,args[0]);
}
let deResParameters: any[] = [];
if(curViewParam.syspermission && true){
deResParameters = [
{ pathName: 'syspermissions', parameterName: 'syspermission' },
]
}
const parameters: any[] = [
{ pathName: 'sysrolepermissions', parameterName: 'sysrolepermission' },
{ pathName: 'editview', parameterName: 'editview' },
];
const _this: any = this;
const openIndexViewTab = (data: any) => {
const routePath = this.$viewTool.buildUpRoutePath(this.$route, curViewParam, deResParameters, parameters, args, data);
this.$router.push(routePath);
}
openIndexViewTab(data);
}
/**
* 新建
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof SysRolePermissionGridViewBase
*/
public New(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (_this.newdata && _this.newdata instanceof Function) {
const data: any = {};
_this.newdata([{ ...data }],[{ ...data }], params, $event, xData);
} else {
_this.$Notice.error({ title: '错误', desc: 'newdata 视图处理逻辑不存在,请添加!' });
}
}
/**
* 编辑
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof SysRolePermissionGridViewBase
*/
public Edit(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
if (args.length === 0) {
return;
}
const _this: any = this;
if (_this.opendata && _this.opendata instanceof Function) {
const data: any = { };
if (args.length > 0) {
Object.assign(data, { sysrolepermission: args[0].sysrolepermission })
}
_this.opendata([{ ...data }], params, $event, xData);
} else {
_this.$Notice.error({ title: '错误', desc: 'opendata 视图处理逻辑不存在,请添加!' });
}
}
/**
* 查看
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof SysRolePermissionGridViewBase
*/
public View(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
if (args.length === 0) {
return;
}
const _this: any = this;
if (_this.opendata && _this.opendata instanceof Function) {
const data: any = { };
if (args.length > 0) {
Object.assign(data, { sysrolepermission: args[0].sysrolepermission })
}
_this.opendata([{ ...data }], params, $event, xData);
} else {
_this.$Notice.error({ title: '错误', desc: 'opendata 视图处理逻辑不存在,请添加!' });
}
}
/**
* 拷贝
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof SysRolePermissionGridViewBase
*/
public Copy(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
if (args.length === 0) {
return;
}
const _this: any = this;
if (_this.newdata && _this.newdata instanceof Function) {
const data: any = {};
if (args.length > 0) {
Object.assign(data, { srfsourcekey: args[0].srfkey })
actionContext.$store.commit('addCopyData', { srfkey: args[0].srfkey, copyData: args[0] });
}
_this.newdata([{ ...data }],[{ ...data }],params, $event, xData);
} else if (xData && xData.copy instanceof Function) {
if (args.length > 0) {
actionContext.$store.commit('addCopyData', { srfkey: args[0].srfkey, copyData: args[0] });
}
xData.copy(args[0].srfkey);
} else {
_this.$Notice.error({ title: '错误', desc: 'opendata 视图处理逻辑不存在,请添加!' });
}
}
/**
* 行编辑
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof SysRolePermissionGridViewBase
*/
public ToggleRowEdit(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
xData.actualIsOpenEdit = !xData.actualIsOpenEdit;
}
/**
* 新建行
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof SysRolePermissionGridViewBase
*/
public NewRow(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
const data: any = {};
if (_this.newRow && _this.newRow instanceof Function) {
_this.newRow([{ ...data }], params, $event, xData);
} else if(xData.newRow && xData.newRow instanceof Function) {
xData.newRow([{ ...data }], params, $event, xData);
}else{
_this.$Notice.error({ title: '错误', desc: 'newRow 视图处理逻辑不存在,请添加!' });
}
}
/**
* 删除
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof SysRolePermissionGridViewBase
*/
public Remove(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (!xData || !(xData.remove instanceof Function)) {
return ;
}
xData.remove(args);
}
/**
* 导出
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof SysRolePermissionGridViewBase
*/
public ExportExcel(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (!xData || !(xData.exportExcel instanceof Function) || !$event) {
return ;
}
xData.exportExcel($event.exportparms);
}
/**
* 打印
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof SysRolePermissionGridViewBase
*/
public Print(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
let _this:any = this;
if (!xData || !(xData.print instanceof Function) || !$event) {
return ;
}
xData.print();
}
/**
* 过滤
*
* @param {any[]} args 当前数据
* @param {any} contextJO 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @memberof SysRolePermissionGridViewBase
*/
public ToggleFilter(args: any[],contextJO?:any, params?: any, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
const _this: any = this;
if (_this.hasOwnProperty('isExpandSearchForm')) {
_this.isExpandSearchForm = !_this.isExpandSearchForm;
}
}
/**
* 关闭视图
*
* @param {any[]} args
* @memberof SysRolePermissionGridViewBase
*/
public closeView(args: any[]): void {
let _view: any = this;
if (_view.viewdata) {
_view.$emit('viewdataschange', [args]);
_view.$emit('close', [args]);
} else if (_view.$tabPageExp) {
_view.$tabPageExp.onClose(_view.$route.fullPath);
}
}
/**
* 销毁视图回调
*
* @memberof SysRolePermissionGridViewBase
*/
public destroyed(){
this.afterDestroyed();
}
/**
* 执行destroyed后的逻辑
*
* @memberof SysRolePermissionGridViewBase
*/
public afterDestroyed(){
if(this.viewDefaultUsage){
let localStoreLength = Object.keys(localStorage);
if(localStoreLength.length > 0){
localStoreLength.forEach((item:string) =>{
if(item.startsWith(this.context.srfsessionid)){
localStorage.removeItem(item);
}
})
}
}
}
/**
* 是否单选
*
* @type {boolean}
* @memberof SysRolePermissionGridViewBase
*/
public isSingleSelect: boolean = false;
/**
* 是否嵌入关系界面
*
* @type {boolean}
* @memberof SysRolePermissionGridViewBase
*/
@Prop({default:false}) public isformDruipart?: boolean;
/**
* 界面关系通讯对象
*
* @type {Subject<ViewState>}
* @memberof SysRolePermissionGridViewBase
*/
@Prop() public formDruipart?: Subject<ViewState>;
/**
* 搜索值
*
* @type {string}
* @memberof SysRolePermissionGridViewBase
*/
public query: string = '';
/**
* 是否展开搜索表单
*
* @type {boolean}
* @memberof SysRolePermissionGridViewBase
*/
public isExpandSearchForm: boolean = false;
/**
* 表格行数据默认激活模式
* 0 不激活
* 1 单击激活
* 2 双击激活
*
* @type {(number | 0 | 1 | 2)}
* @memberof SysRolePermissionGridViewBase
*/
public gridRowActiveMode: number | 0 | 1 | 2 = 2;
/**
* 快速搜索
*
* @param {*} $event
* @memberof SysRolePermissionGridViewBase
*/
public onSearch($event: any): void {
const grid: any = this.$refs.grid;
if (grid) {
grid.load(this.context, true);
}
}
/**
* grid 部件 save 事件
*
* @param {*} [args={}]
* @param {*} $event
* @memberof ENTITYTEST1Usr2GridViewBase
*/
public onSave($event: any) {
this.$emit('drdatasaved', $event);
}
/**
* 刷新数据
*
* @readonly
* @type {(number | null)}
* @memberof SysRolePermissionGridViewBase
*/
get refreshdata(): number | null {
return this.$store.getters['viewaction/getRefreshData'](this.viewtag);
}
/**
* 监控数据变化
*
* @param {*} newVal
* @param {*} oldVal
* @returns
* @memberof SysRolePermissionGridViewBase
*/
@Watch('refreshdata')
onRefreshData(newVal: any, oldVal: any) {
if (newVal === null || newVal === undefined) {
return;
}
if (newVal === 0) {
return;
}
const grid: any = this.$refs.grid;
if (grid) {
grid.load({});
}
}
}
</script>
<style lang='less'>
@import './sys-role-permission-grid-view.less';
</style>
\ No newline at end of file
.sys-role-permission-grid-view{
position: relative;
}
.toolbar-container {
button {
margin: 6px 0px 4px 4px;
.caption {
margin-left: 4px;
}
}
.seperator {
color: #dcdee2;
margin: 0 0px 0 4px;
}
}
// this is less
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import SysRolePermissionGridViewBase from './sys-role-permission-grid-view-base.vue';
import view_grid from '@widgets/sys-role-permission/main-grid/main-grid.vue';
import view_searchform from '@widgets/sys-role-permission/default-searchform/default-searchform.vue';
@Component({
components: {
view_grid,
view_searchform,
},
beforeRouteEnter: (to: any, from: any, next: any) => {
next((vm: any) => {
vm.$store.commit('addCurPageViewtag', { fullPath: to.fullPath, viewtag: vm.viewtag });
});
},
})
export default class SysRolePermissionGridView extends SysRolePermissionGridViewBase {
}
</script>
\ No newline at end of file
......@@ -244,26 +244,4 @@ export default class SysRolePermissionServiceBase extends EntityService {
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/sysrolepermissions/fetchdefault`,tempData,isloading);
}
/**
* FetchPermissionenable1接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SysRolePermissionServiceBase
*/
public async FetchPermissionenable1(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.sysrole && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/sysroles/${context.sysrole}/sysrolepermissions/fetchpermissionenable1`,tempData,isloading);
}
if(context.syspermission && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/syspermissions/${context.syspermission}/sysrolepermissions/fetchpermissionenable1`,tempData,isloading);
}
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/sysrolepermissions/fetchpermissionenable1`,tempData,isloading);
}
}
\ No newline at end of file
......@@ -127,7 +127,7 @@ export const viewstate: any = {
{
viewtag: '61a949e3c23ebdda724888662ded1478',
viewmodule: 'uaa',
viewname: 'SYS_ROLE_PERMISSIONGridView',
viewname: 'SysRolePermissionGridView',
viewaction: '',
viewdatachange: false,
refviews: [
......
......@@ -30,6 +30,12 @@ export default class DefaultModel {
{
name: 'permissionname',
},
{
name: 'permissiontype',
},
{
name: 'permissionenable',
},
{
name: 'createdate',
},
......
......@@ -30,6 +30,12 @@ export default class MPickupViewpickupviewpanelModel {
{
name: 'permissionname',
},
{
name: 'permissiontype',
},
{
name: 'permissionenable',
},
{
name: 'createdate',
},
......
......@@ -30,6 +30,12 @@ export default class PickupViewpickupviewpanelModel {
{
name: 'permissionname',
},
{
name: 'permissiontype',
},
{
name: 'permissionenable',
},
{
name: 'createdate',
},
......
......@@ -68,6 +68,8 @@ public class SysPermission extends EntityMP implements Serializable {
/**
* 逻辑有效
*/
@DEField(preType = DEPredefinedFieldType.LOGICVALID, logicval = "1" , logicdelval="0")
@TableLogic(value= "1",delval="0")
@TableField(value = "enable")
@JSONField(name = "enable")
@JsonProperty("enable")
......@@ -122,13 +124,6 @@ public class SysPermission extends EntityMP implements Serializable {
this.pssystemid = pssystemid ;
this.modify("pssystemid",pssystemid);
}
/**
* 设置 [逻辑有效]
*/
public void setEnable(Integer enable){
this.enable = enable ;
this.modify("enable",enable);
}
}
......
......@@ -73,6 +73,20 @@ public class SysRolePermission extends EntityMP implements Serializable {
@JSONField(name = "permissionname")
@JsonProperty("permissionname")
private String permissionname;
/**
* 权限类型
*/
@TableField(exist = false)
@JSONField(name = "permissiontype")
@JsonProperty("permissiontype")
private String permissiontype;
/**
* 权限类型
*/
@TableField(exist = false)
@JSONField(name = "permissionenable")
@JsonProperty("permissionenable")
private Integer permissionenable;
/**
* 建立时间
*/
......
......@@ -20,7 +20,6 @@ import com.alibaba.fastjson.JSONObject;
public interface SysRolePermissionMapper extends BaseMapper<SysRolePermission>{
Page<SysRolePermission> searchDefault(IPage page, @Param("srf") SysRolePermissionSearchContext context, @Param("ew") Wrapper<SysRolePermission> wrapper) ;
Page<SysRolePermission> searchPermissionenable1(IPage page, @Param("srf") SysRolePermissionSearchContext context, @Param("ew") Wrapper<SysRolePermission> wrapper) ;
@Override
SysRolePermission selectById(Serializable id);
@Override
......
......@@ -37,7 +37,6 @@ public interface ISysRolePermissionService extends IService<SysRolePermission>{
boolean update(SysRolePermission et) ;
void updateBatch(List<SysRolePermission> list) ;
Page<SysRolePermission> searchDefault(SysRolePermissionSearchContext context) ;
Page<SysRolePermission> searchPermissionenable1(SysRolePermissionSearchContext context) ;
List<SysRolePermission> selectByPermissionid(String permissionid) ;
void removeByPermissionid(String permissionid) ;
void saveByPermissionid(String permissionid,List<SysRolePermission> list) ;
......
......@@ -236,15 +236,6 @@ public class SysRolePermissionServiceImpl extends ServiceImpl<SysRolePermissionM
return new PageImpl<SysRolePermission>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 查询集合 permissionenable1
*/
@Override
public Page<SysRolePermission> searchPermissionenable1(SysRolePermissionSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<SysRolePermission> pages=baseMapper.searchPermissionenable1(context.getPages(),context,context.getSelectCond());
return new PageImpl<SysRolePermission>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
......@@ -261,6 +252,8 @@ public class SysRolePermissionServiceImpl extends ServiceImpl<SysRolePermissionM
permission=majorEntity;
}
et.setPermissionname(permission.getPermissionname());
et.setPermissiontype(permission.getPermissiontype());
et.setPermissionenable(permission.getEnable());
}
//实体关系[DER1N_SYS_ROLE_PERMISSION_SYS_ROLE_SYS_ROLEID]
if(!ObjectUtils.isEmpty(et.getRoleid())){
......
......@@ -66,7 +66,7 @@
<!--输出实体[SYS_ROLE_PERMISSION]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-sys_role_permission-86-3">
<changeSet author="a_A_5d9d78509" id="tab-sys_role_permission-91-3">
<createTable tableName="IBZROLE_PERMISSION">
<column name="SYS_ROLE_PERMISSIONID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_ROLE_PERMISSION_SYS_ROL"/>
......@@ -124,7 +124,7 @@
<!--输出实体[SYS_PERMISSION]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-sys_permission-209-6">
<changeSet author="a_A_5d9d78509" id="tab-sys_permission-212-6">
<createTable tableName="IBZPERMISSION">
<column name="SYS_PERMISSIONID" remarks="" type="VARCHAR(200)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_PERMISSION_SYS_PERMISSI"/>
......@@ -209,7 +209,7 @@
<!--输出实体[SYS_AUTHLOG]外键关系 -->
<!--输出实体[SYS_PSDEOPPRIV]外键关系 -->
<!--输出实体[SYS_ROLE_PERMISSION]外键关系 -->
<changeSet author="a_A_5d9d78509" id="fk-sys_role_permission-86-10">
<changeSet author="a_A_5d9d78509" id="fk-sys_role_permission-91-10">
<addForeignKeyConstraint baseColumnNames="SYS_PERMISSIONID" baseTableName="IBZROLE_PERMISSION" constraintName="DER1N_SYS_ROLE_PERMISSION_SYS_" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SYS_PERMISSIONID" referencedTableName="IBZPERMISSION" validate="true"/>
</changeSet>
<!--输出实体[SYS_PSSYSUNIRES]外键关系 -->
......
......@@ -5,7 +5,7 @@
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="SysRolePermissionResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`SYS_PERMISSIONID`, t21.`SYS_PERMISSIONNAME`, t1.`SYS_ROLEID`, t11.`SYS_ROLENAME`, t1.`SYS_ROLE_PERMISSIONID`, t1.`UPDATEDATE` FROM `IBZROLE_PERMISSION` t1 LEFT JOIN IBZROLE t11 ON t1.SYS_ROLEID = t11.SYS_ROLEID LEFT JOIN IBZPERMISSION t21 ON t1.SYS_PERMISSIONID = t21.SYS_PERMISSIONID ) t1 where sys_role_permissionid=#{id}]]>
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t21.`ENABLE` AS `PERMISSIONENABLE`, t21.`PERMISSIONTYPE`, t1.`SYS_PERMISSIONID`, t21.`SYS_PERMISSIONNAME`, t1.`SYS_ROLEID`, t11.`SYS_ROLENAME`, t1.`SYS_ROLE_PERMISSIONID`, t1.`UPDATEDATE` FROM `IBZROLE_PERMISSION` t1 LEFT JOIN IBZROLE t11 ON t1.SYS_ROLEID = t11.SYS_ROLEID LEFT JOIN IBZPERMISSION t21 ON t1.SYS_PERMISSIONID = t21.SYS_PERMISSIONID ) t1 where sys_role_permissionid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
......@@ -47,31 +47,15 @@
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据集合[Permissionenable1]-->
<select id="searchPermissionenable1" parameterType="cn.ibizlab.core.uaa.filter.SysRolePermissionSearchContext" resultMap="SysRolePermissionResultMap">
select t1.* from (
<include refid="Permissionenable1" />
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">${ew.sqlSegment}</if>
</select>
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`SYS_PERMISSIONID`, t21.`SYS_PERMISSIONNAME`, t1.`SYS_ROLEID`, t11.`SYS_ROLENAME`, t1.`SYS_ROLE_PERMISSIONID`, t1.`UPDATEDATE` FROM `IBZROLE_PERMISSION` t1 LEFT JOIN IBZROLE t11 ON t1.SYS_ROLEID = t11.SYS_ROLEID LEFT JOIN IBZPERMISSION t21 ON t1.SYS_PERMISSIONID = t21.SYS_PERMISSIONID
]]>
</sql>
<!--数据查询[Permissionenable1]-->
<sql id="Permissionenable1" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`SYS_PERMISSIONID`, t21.`SYS_PERMISSIONNAME`, t1.`SYS_ROLEID`, t11.`SYS_ROLENAME`, t1.`SYS_ROLE_PERMISSIONID`, t1.`UPDATEDATE` FROM `IBZROLE_PERMISSION` t1 LEFT JOIN IBZROLE t11 ON t1.SYS_ROLEID = t11.SYS_ROLEID LEFT JOIN IBZPERMISSION t21 ON t1.SYS_PERMISSIONID = t21.SYS_PERMISSIONID
WHERE ( t11.enable=1 )
<![CDATA[ SELECT t1.`CREATEDATE`, t21.`ENABLE` AS `PERMISSIONENABLE`, t21.`PERMISSIONTYPE`, t1.`SYS_PERMISSIONID`, t21.`SYS_PERMISSIONNAME`, t1.`SYS_ROLEID`, t11.`SYS_ROLENAME`, t1.`SYS_ROLE_PERMISSIONID`, t1.`UPDATEDATE` FROM `IBZROLE_PERMISSION` t1 LEFT JOIN IBZROLE t11 ON t1.SYS_ROLEID = t11.SYS_ROLEID LEFT JOIN IBZPERMISSION t21 ON t1.SYS_PERMISSIONID = t21.SYS_PERMISSIONID
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`SYS_PERMISSIONID`, t21.`SYS_PERMISSIONNAME`, t1.`SYS_ROLEID`, t11.`SYS_ROLENAME`, t1.`SYS_ROLE_PERMISSIONID`, t1.`UPDATEDATE` FROM `IBZROLE_PERMISSION` t1 LEFT JOIN IBZROLE t11 ON t1.SYS_ROLEID = t11.SYS_ROLEID LEFT JOIN IBZPERMISSION t21 ON t1.SYS_PERMISSIONID = t21.SYS_PERMISSIONID
<![CDATA[ SELECT t1.`CREATEDATE`, t21.`ENABLE` AS `PERMISSIONENABLE`, t21.`PERMISSIONTYPE`, t1.`SYS_PERMISSIONID`, t21.`SYS_PERMISSIONNAME`, t1.`SYS_ROLEID`, t11.`SYS_ROLENAME`, t1.`SYS_ROLE_PERMISSIONID`, t1.`UPDATEDATE` FROM `IBZROLE_PERMISSION` t1 LEFT JOIN IBZROLE t11 ON t1.SYS_ROLEID = t11.SYS_ROLEID LEFT JOIN IBZPERMISSION t21 ON t1.SYS_PERMISSIONID = t21.SYS_PERMISSIONID
]]>
</sql>
......
......@@ -14,7 +14,7 @@
"dename":"SysRolePermission",
"delogicname":"角色权限关系",
"sysmoudle":{"id":"UAA","name":"uaa"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"},{"id":"Permissionenable1" , "name":"permissionenable1"}],
"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" }],
"datascope":[{"id":"all","name":"全部数据"}]
}
......
......@@ -106,14 +106,6 @@ public class SysPermissionDTO extends DTOBase implements Serializable {
this.modify("pssystemid",pssystemid);
}
/**
* 设置 [ENABLE]
*/
public void setEnable(Integer enable){
this.enable = enable ;
this.modify("enable",enable);
}
}
......@@ -63,6 +63,22 @@ public class SysRolePermissionDTO extends DTOBase implements Serializable {
@JsonProperty("permissionname")
private String permissionname;
/**
* 属性 [PERMISSIONTYPE]
*
*/
@JSONField(name = "permissiontype")
@JsonProperty("permissiontype")
private String permissiontype;
/**
* 属性 [PERMISSIONENABLE]
*
*/
@JSONField(name = "permissionenable")
@JsonProperty("permissionenable")
private Integer permissionenable;
/**
* 属性 [CREATEDATE]
*
......
......@@ -161,27 +161,6 @@ public class SysRolePermissionResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(sysrolepermissionMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Permissionenable1-all')")
@ApiOperation(value = "fetchpermissionenable1", tags = {"SysRolePermission" } ,notes = "fetchpermissionenable1")
@RequestMapping(method= RequestMethod.GET , value="/sysrolepermissions/fetchpermissionenable1")
public ResponseEntity<List<SysRolePermissionDTO>> fetchPermissionenable1(SysRolePermissionSearchContext context) {
Page<SysRolePermission> domains = sysrolepermissionService.searchPermissionenable1(context) ;
List<SysRolePermissionDTO> list = sysrolepermissionMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Permissionenable1-all')")
@ApiOperation(value = "searchpermissionenable1", tags = {"SysRolePermission" } ,notes = "searchpermissionenable1")
@RequestMapping(method= RequestMethod.POST , value="/sysrolepermissions/searchpermissionenable1")
public ResponseEntity<Page<SysRolePermissionDTO>> searchPermissionenable1(@RequestBody SysRolePermissionSearchContext context) {
Page<SysRolePermission> domains = sysrolepermissionService.searchPermissionenable1(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(sysrolepermissionMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Get-all')")
@ApiOperation(value = "GetBySysPermission", tags = {"SysRolePermission" }, notes = "GetBySysPermission")
@RequestMapping(method = RequestMethod.GET, value = "/syspermissions/{syspermission_id}/sysrolepermissions/{sysrolepermission_id}")
......@@ -316,29 +295,6 @@ public class SysRolePermissionResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(sysrolepermissionMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Permissionenable1-all')")
@ApiOperation(value = "fetchpermissionenable1BySysPermission", tags = {"SysRolePermission" } ,notes = "fetchpermissionenable1BySysPermission")
@RequestMapping(method= RequestMethod.GET , value="/syspermissions/{syspermission_id}/sysrolepermissions/fetchpermissionenable1")
public ResponseEntity<List<SysRolePermissionDTO>> fetchSysRolePermissionPermissionenable1BySysPermission(@PathVariable("syspermission_id") String syspermission_id,SysRolePermissionSearchContext context) {
context.setN_sys_permissionid_eq(syspermission_id);
Page<SysRolePermission> domains = sysrolepermissionService.searchPermissionenable1(context) ;
List<SysRolePermissionDTO> list = sysrolepermissionMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Permissionenable1-all')")
@ApiOperation(value = "searchpermissionenable1BySysPermission", tags = {"SysRolePermission" } ,notes = "searchpermissionenable1BySysPermission")
@RequestMapping(method= RequestMethod.POST , value="/syspermissions/{syspermission_id}/sysrolepermissions/searchpermissionenable1")
public ResponseEntity<Page<SysRolePermissionDTO>> searchSysRolePermissionPermissionenable1BySysPermission(@PathVariable("syspermission_id") String syspermission_id, @RequestBody SysRolePermissionSearchContext context) {
context.setN_sys_permissionid_eq(syspermission_id);
Page<SysRolePermission> domains = sysrolepermissionService.searchPermissionenable1(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(sysrolepermissionMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Get-all')")
@ApiOperation(value = "GetBySysRole", tags = {"SysRolePermission" }, notes = "GetBySysRole")
@RequestMapping(method = RequestMethod.GET, value = "/sysroles/{sysrole_id}/sysrolepermissions/{sysrolepermission_id}")
......@@ -473,27 +429,4 @@ public class SysRolePermissionResource {
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(sysrolepermissionMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Permissionenable1-all')")
@ApiOperation(value = "fetchpermissionenable1BySysRole", tags = {"SysRolePermission" } ,notes = "fetchpermissionenable1BySysRole")
@RequestMapping(method= RequestMethod.GET , value="/sysroles/{sysrole_id}/sysrolepermissions/fetchpermissionenable1")
public ResponseEntity<List<SysRolePermissionDTO>> fetchSysRolePermissionPermissionenable1BySysRole(@PathVariable("sysrole_id") String sysrole_id,SysRolePermissionSearchContext context) {
context.setN_sys_roleid_eq(sysrole_id);
Page<SysRolePermission> domains = sysrolepermissionService.searchPermissionenable1(context) ;
List<SysRolePermissionDTO> list = sysrolepermissionMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Permissionenable1-all')")
@ApiOperation(value = "searchpermissionenable1BySysRole", tags = {"SysRolePermission" } ,notes = "searchpermissionenable1BySysRole")
@RequestMapping(method= RequestMethod.POST , value="/sysroles/{sysrole_id}/sysrolepermissions/searchpermissionenable1")
public ResponseEntity<Page<SysRolePermissionDTO>> searchSysRolePermissionPermissionenable1BySysRole(@PathVariable("sysrole_id") String sysrole_id, @RequestBody SysRolePermissionSearchContext context) {
context.setN_sys_roleid_eq(sysrole_id);
Page<SysRolePermission> domains = sysrolepermissionService.searchPermissionenable1(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(sysrolepermissionMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册