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

laizhilong 发布系统代码

上级 02bb2ad9
......@@ -255,6 +255,14 @@
"viewname": "SYS_USERPickupView",
"viewtag": "d53cb0ce933245fae5f0623bac4fbf48"
},
"sys_role_permissioncustomview": {
"title": "角色权限关系自定义视图",
"caption": "角色权限关系",
"viewtype": "DECUSTOMVIEW",
"viewmodule": "uaa",
"viewname": "SYS_ROLE_PERMISSIONCustomView",
"viewtag": "e791be173ed0f4bbe9cce942b6edde63"
},
"sys_permissioneditview": {
"title": "权限表编辑视图",
"caption": "权限/资源",
......
......@@ -40,6 +40,10 @@ export default {
},
editview2: {
caption: "角色权限关系",
title: '角色权限关系',
},
customview: {
caption: "角色权限关系",
title: '角色权限关系',
},
},
......
......@@ -39,6 +39,10 @@ export default {
},
editview2: {
caption: '角色权限关系',
title: '角色权限关系',
},
customview: {
caption: '角色权限关系',
title: '角色权限关系',
},
},
......
......@@ -263,6 +263,14 @@ mock.onGet('./assets/json/view-config.json').reply((config: any) => {
"viewname": "SYS_USERPickupView",
"viewtag": "d53cb0ce933245fae5f0623bac4fbf48"
},
"sys_role_permissioncustomview": {
"title": "角色权限关系自定义视图",
"caption": "角色权限关系",
"viewtype": "DECUSTOMVIEW",
"viewmodule": "uaa",
"viewname": "SYS_ROLE_PERMISSIONCustomView",
"viewtag": "e791be173ed0f4bbe9cce942b6edde63"
},
"sys_permissioneditview": {
"title": "权限表编辑视图",
"caption": "权限/资源",
......
......@@ -2,6 +2,7 @@ export const PageComponents = {
install(Vue: any, opt: any) {
Vue.component('sys-permissionpickup-grid-view', () => import('@pages/uaa/sys-permissionpickup-grid-view/sys-permissionpickup-grid-view.vue'));
Vue.component('sys-rolepickup-view', () => import('@pages/uaa/sys-rolepickup-view/sys-rolepickup-view.vue'));
Vue.component('sys-role-permissioncustom-view', () => import('@pages/uaa/sys-role-permissioncustom-view/sys-role-permissioncustom-view.vue'));
Vue.component('sys-usermpickup-view', () => import('@pages/uaa/sys-usermpickup-view/sys-usermpickup-view.vue'));
Vue.component('sys-userpickup-grid-view', () => import('@pages/uaa/sys-userpickup-grid-view/sys-userpickup-grid-view.vue'));
Vue.component('sys-roleedit-view', () => import('@pages/uaa/sys-roleedit-view/sys-roleedit-view.vue'));
......
......@@ -60,6 +60,47 @@ const router = new Router({
},
component: () => import('@pages/uaa/sys-rolepickup-view/sys-rolepickup-view.vue'),
},
{
path: 'sys_roles/:sys_role?/sys_role_permissions/:sys_role_permission?/customview/:customview?',
meta: {
caption: 'entities.sys_role_permission.views.customview.caption',
parameters: [
{ pathName: 'index', parameterName: 'index' },
{ pathName: 'sys_roles', parameterName: 'sys_role' },
{ pathName: 'sys_role_permissions', parameterName: 'sys_role_permission' },
{ pathName: 'customview', parameterName: 'customview' },
],
requireAuth: true,
},
component: () => import('@pages/uaa/sys-role-permissioncustom-view/sys-role-permissioncustom-view.vue'),
},
{
path: 'sys_permissions/:sys_permission?/sys_role_permissions/:sys_role_permission?/customview/:customview?',
meta: {
caption: 'entities.sys_role_permission.views.customview.caption',
parameters: [
{ pathName: 'index', parameterName: 'index' },
{ pathName: 'sys_permissions', parameterName: 'sys_permission' },
{ pathName: 'sys_role_permissions', parameterName: 'sys_role_permission' },
{ pathName: 'customview', parameterName: 'customview' },
],
requireAuth: true,
},
component: () => import('@pages/uaa/sys-role-permissioncustom-view/sys-role-permissioncustom-view.vue'),
},
{
path: 'sys_role_permissions/:sys_role_permission?/customview/:customview?',
meta: {
caption: 'entities.sys_role_permission.views.customview.caption',
parameters: [
{ pathName: 'index', parameterName: 'index' },
{ pathName: 'sys_role_permissions', parameterName: 'sys_role_permission' },
{ pathName: 'customview', parameterName: 'customview' },
],
requireAuth: true,
},
component: () => import('@pages/uaa/sys-role-permissioncustom-view/sys-role-permissioncustom-view.vue'),
},
{
path: 'sys_users/:sys_user?/mpickupview/:mpickupview?',
meta: {
......@@ -733,6 +774,44 @@ const router = new Router({
},
component: () => import('@pages/uaa/sys-userpickup-view/sys-userpickup-view.vue'),
},
{
path: '/sys_roles/:sys_role?/sys_role_permissions/:sys_role_permission?/customview/:customview?',
meta: {
caption: 'entities.sys_role_permission.views.customview.caption',
parameters: [
{ pathName: 'sys_roles', parameterName: 'sys_role' },
{ pathName: 'sys_role_permissions', parameterName: 'sys_role_permission' },
{ pathName: 'customview', parameterName: 'customview' },
],
requireAuth: true,
},
component: () => import('@pages/uaa/sys-role-permissioncustom-view/sys-role-permissioncustom-view.vue'),
},
{
path: '/sys_permissions/:sys_permission?/sys_role_permissions/:sys_role_permission?/customview/:customview?',
meta: {
caption: 'entities.sys_role_permission.views.customview.caption',
parameters: [
{ pathName: 'sys_permissions', parameterName: 'sys_permission' },
{ pathName: 'sys_role_permissions', parameterName: 'sys_role_permission' },
{ pathName: 'customview', parameterName: 'customview' },
],
requireAuth: true,
},
component: () => import('@pages/uaa/sys-role-permissioncustom-view/sys-role-permissioncustom-view.vue'),
},
{
path: '/sys_role_permissions/:sys_role_permission?/customview/:customview?',
meta: {
caption: 'entities.sys_role_permission.views.customview.caption',
parameters: [
{ pathName: 'sys_role_permissions', parameterName: 'sys_role_permission' },
{ pathName: 'customview', parameterName: 'customview' },
],
requireAuth: true,
},
component: () => import('@pages/uaa/sys-role-permissioncustom-view/sys-role-permissioncustom-view.vue'),
},
{
path: '/sys_permissions/:sys_permission?/editview/:editview?',
meta: {
......
<template>
<div class="view-container decustomview sys-role-permissioncustom-view">
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="sys_role_permissioncustomview"></app-studioaction>
<card class='view-card view-no-toolbar' :disHover="true" :padding="0" :bordered="false">
<p slot='title'>
<span class='caption-info'>{{$t(model.srfTitle)}}</span>
</p>
<div class="content-container">
</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 SYS_ROLE_PERMISSIONService from '@/service/sys-role-permission/sys-role-permission-service';
@Component({
components: {
},
})
export default class SYS_ROLE_PERMISSIONCustomViewBase extends Vue {
/**
* 实体服务对象
*
* @type {SYS_ROLE_PERMISSIONService}
* @memberof SYS_ROLE_PERMISSIONCustomViewBase
*/
public appEntityService: SYS_ROLE_PERMISSIONService = new SYS_ROLE_PERMISSIONService;
/**
* 计数器服务对象集合
*
* @type {Array<*>}
* @memberof SYS_ROLE_PERMISSIONCustomViewBase
*/
public counterServiceArray:Array<any> = [];
/**
* 数据变化
*
* @param {*} val
* @returns {*}
* @memberof SYS_ROLE_PERMISSIONCustomViewBase
*/
@Emit()
public viewDatasChange(val: any):any {
return val;
}
/**
* 传入视图上下文
*
* @type {string}
* @memberof SYS_ROLE_PERMISSIONCustomViewBase
*/
@Prop() public viewdata!: string;
/**
* 传入视图参数
*
* @type {string}
* @memberof SYS_ROLE_PERMISSIONCustomViewBase
*/
@Prop() public viewparam!: string;
/**
* 视图默认使用
*
* @type {boolean}
* @memberof SYS_ROLE_PERMISSIONCustomViewBase
*/
@Prop({ default: true }) public viewDefaultUsage!: boolean;
/**
* 视图标识
*
* @type {string}
* @memberof SYS_ROLE_PERMISSIONCustomViewBase
*/
public viewtag: string = 'e791be173ed0f4bbe9cce942b6edde63';
/**
* 自定义视图导航上下文集合
*
* @type {*}
* @memberof SYS_ROLE_PERMISSIONCustomViewBase
*/
public customViewNavContexts:any ={
};
/**
* 自定义视图导航参数集合
*
* @type {*}
* @memberof SYS_ROLE_PERMISSIONCustomViewBase
*/
public customViewParams:any ={
};
/**
* 视图模型数据
*
* @type {*}
* @memberof SYS_ROLE_PERMISSIONCustomViewBase
*/
public model: any = {
srfCaption: 'entities.sys_role_permission.views.customview.caption',
srfTitle: 'entities.sys_role_permission.views.customview.title',
srfSubTitle: 'entities.sys_role_permission.views.customview.subtitle',
dataInfo: ''
}
/**
* 视图参数变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof SYS_ROLE_PERMISSIONCustomViewBase
*/
@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 SYS_ROLE_PERMISSIONCustomViewBase
*/
@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 SYS_ROLE_PERMISSIONCustomViewBase
*/
public containerModel: any = {
};
/**
* 计数器刷新
*
* @memberof SYS_ROLE_PERMISSIONCustomViewBase
*/
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 SYS_ROLE_PERMISSIONCustomViewBase
*/
public viewState: Subject<ViewState> = new Subject();
/**
* 引擎初始化
*
* @public
* @memberof SYS_ROLE_PERMISSIONCustomViewBase
*/
public engineInit(): void {
}
/**
* 应用上下文
*
* @type {*}
* @memberof SYS_ROLE_PERMISSIONCustomViewBase
*/
public context:any = {};
/**
* 视图参数
*
* @type {*}
* @memberof SYS_ROLE_PERMISSIONCustomViewBase
*/
public viewparams:any = {};
/**
* 解析视图参数
*
* @public
* @memberof SYS_ROLE_PERMISSIONCustomViewBase
*/
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 SYS_ROLE_PERMISSIONCustomViewBase
*/
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 SYS_ROLE_PERMISSIONCustomViewBase
*/
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 SYS_ROLE_PERMISSIONCustomViewBase
*/
public created() {
this.afterCreated();
}
/**
* 执行created后的逻辑
*
* @memberof SYS_ROLE_PERMISSIONCustomViewBase
*/
public afterCreated(){
const secondtag = this.$util.createUUID();
this.$store.commit('viewaction/createdView', { viewtag: this.viewtag, secondtag: secondtag });
this.viewtag = secondtag;
this.parseViewParam();
}
/**
* 销毁之前
*
* @memberof SYS_ROLE_PERMISSIONCustomViewBase
*/
public beforeDestroy() {
this.$store.commit('viewaction/removeView', this.viewtag);
}
/**
* Vue声明周期(组件初始化完毕)
*
* @memberof SYS_ROLE_PERMISSIONCustomViewBase
*/
public mounted() {
this.afterMounted();
}
/**
* 执行mounted后的逻辑
*
* @memberof SYS_ROLE_PERMISSIONCustomViewBase
*/
public afterMounted(){
const _this: any = this;
_this.engineInit();
if (_this.loadModel && _this.loadModel instanceof Function) {
_this.loadModel();
}
}
/**
* 关闭视图
*
* @param {any[]} args
* @memberof SYS_ROLE_PERMISSIONCustomViewBase
*/
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 SYS_ROLE_PERMISSIONCustomViewBase
*/
public destroyed(){
this.afterDestroyed();
}
/**
* 执行destroyed后的逻辑
*
* @memberof SYS_ROLE_PERMISSIONCustomViewBase
*/
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);
}
})
}
}
}
}
</script>
<style lang='less'>
@import './sys-role-permissioncustom-view.less';
</style>
\ No newline at end of file
<script lang='tsx'>
import { Component } from 'vue-property-decorator';
import SYS_ROLE_PERMISSIONCustomViewBase from './sys-role-permissioncustom-view-base.vue';
@Component({
components: {
},
beforeRouteEnter: (to: any, from: any, next: any) => {
next((vm: any) => {
vm.$store.commit('addCurPageViewtag', { fullPath: to.fullPath, viewtag: vm.viewtag });
});
},
})
export default class SYS_ROLE_PERMISSIONCustomView extends SYS_ROLE_PERMISSIONCustomViewBase {
}
</script>
\ No newline at end of file
......@@ -104,7 +104,7 @@ export const viewstate: any = {
viewdatachange: false,
refviews: [
'61a949e3c23ebdda724888662ded1478',
'b8a97c1797a1b91fbb37f8c2d14b1fb6',
'e791be173ed0f4bbe9cce942b6edde63',
'fb89f9af95f2caf92ccc1249025c9a1b',
],
},
......@@ -157,7 +157,7 @@ export const viewstate: any = {
viewdatachange: false,
refviews: [
'61a949e3c23ebdda724888662ded1478',
'b8a97c1797a1b91fbb37f8c2d14b1fb6',
'e791be173ed0f4bbe9cce942b6edde63',
'fb89f9af95f2caf92ccc1249025c9a1b',
],
},
......@@ -330,6 +330,15 @@ export const viewstate: any = {
'936880f60b6ef17d39d5248b5fe390b4',
],
},
{
viewtag: 'e791be173ed0f4bbe9cce942b6edde63',
viewmodule: 'uaa',
viewname: 'SYS_ROLE_PERMISSIONCustomView',
viewaction: '',
viewdatachange: false,
refviews: [
],
},
{
viewtag: 'eb6498ba353f58d0af17bbd39702ccf7',
viewmodule: 'uaa',
......
......@@ -86,6 +86,7 @@ export default class SYS_ROLE_PERMISSIONUIServiceBase extends UIService {
this.allViewMap.set('PICKUPVIEW:',{viewname:'pickupview',srfappde:'sys_role_permissions'});
this.allViewMap.set('EDITVIEW:',{viewname:'editview',srfappde:'sys_role_permissions'});
this.allViewMap.set(':',{viewname:'editview2',srfappde:'sys_role_permissions'});
this.allViewMap.set(':',{viewname:'customview',srfappde:'sys_role_permissions'});
}
/**
......
......@@ -120,17 +120,18 @@
:formState="formState"
:isForbidLoad="this.data.srfuf === '0'"
paramItem='sys_role'
:parentdata='{"srfparentdename":"SYS_ROLE","SRFPARENTTYPE":"CUSTOM"}'
:parentdata='{"srfparentdefname":"SYS_ROLEID","srfparentdename":"SYS_ROLE","SRFPARENTTYPE":"DER1N","srfparentmode":"DER1N_SYS_ROLE_PERMISSION_SYS_ROLE_SYS_ROLEID","SRFDER1NID":"DER1N_SYS_ROLE_PERMISSION_SYS_ROLE_SYS_ROLEID"}'
:parameters="[
{ pathName: 'sys_permissions', parameterName: 'sys_permission' },
]"
:context="context"
:viewparams="viewparams"
parameterName='sys_role'
parentName="SYS_ROLE"
refviewtype='DEMPICKUPVIEW'
refviewtype='DECUSTOMVIEW'
refreshitems=''
:ignorefieldvaluechange="ignorefieldvaluechange"
viewname='sys-permissionmpickup-view'
viewname='sys-role-permissioncustom-view'
:data="JSON.stringify(this.data)"
@drdatasaved="drdatasaved($event)"
style=";overflow: auto;">
......
......@@ -36,7 +36,7 @@
</createTable>
</changeSet>
<!--输出实体[SYS_ROLE_PERMISSION]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-sys_role_permission-66-2">
<changeSet author="a_A_5d9d78509" id="tab-sys_role_permission-68-2">
<createTable tableName="IBZROLE_PERMISSION">
<column name="SYS_ROLE_PERMISSIONID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_ROLE_PERMISSION_SYS_ROL"/>
......@@ -136,7 +136,7 @@
</createTable>
</changeSet>
<!--输出实体[SYS_ROLE]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-sys_role-68-7">
<changeSet author="a_A_5d9d78509" id="tab-sys_role-71-7">
<createTable tableName="IBZROLE">
<column name="SYS_ROLEID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_ROLE_SYS_ROLEID"/>
......@@ -192,7 +192,7 @@
<!--输出实体[SYS_PSDEOPPRIV]外键关系 -->
<!--输出实体[SYS_ROLE_PERMISSION]外键关系 -->
<changeSet author="a_A_5d9d78509" id="fk-sys_role_permission-66-10">
<changeSet author="a_A_5d9d78509" id="fk-sys_role_permission-68-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_USER]外键关系 -->
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册