Browse Source

权限到按钮模拟

noToken
安虹睿 1 year ago
parent
commit
173c32ead1
  1. 9
      PC/InterFace.Dash/src/components/currenButton/index.vue
  2. 10
      PC/InterFace.Dash/src/components/currenButton/innerButton.vue
  3. 36
      PC/InterFace.Dash/src/components/tablePagination/index.vue
  4. 4
      PC/InterFace.Dash/src/layout/components/Navbar.vue
  5. 5
      PC/InterFace.Dash/src/store/modules/user.js
  6. 9
      PC/UI.WinIn.FasterZ.Job/src/components/currenButton/index.vue
  7. 10
      PC/UI.WinIn.FasterZ.Job/src/components/currenButton/innerButton.vue
  8. 36
      PC/UI.WinIn.FasterZ.Job/src/components/tablePagination/index.vue
  9. 5
      PC/UI.WinIn.FasterZ.Job/src/store/modules/user.js
  10. 9
      PC/UI.WinIn.FasterZ.Store/src/components/currenButton/index.vue
  11. 10
      PC/UI.WinIn.FasterZ.Store/src/components/currenButton/innerButton.vue
  12. 36
      PC/UI.WinIn.FasterZ.Store/src/components/tablePagination/index.vue
  13. 5
      PC/UI.WinIn.FasterZ.Store/src/store/modules/user.js

9
PC/InterFace.Dash/src/components/currenButton/index.vue

@ -2,7 +2,7 @@
<div class="tableNavBtnsContent">
<div class="tableNavLeftBtns">
<!-- 左侧按钮 -->
<innerButton :isRoutePermission="isRoutePermission" :Butttondata="buttonsLeft" @tableButtonClick="tableButtonClick"></innerButton>
<innerButton :Butttondata="buttonsLeft" @tableButtonClick="tableButtonClick"></innerButton>
</div>
<div class="tableNavRightBtns">
<!-- 快速搜索 -->
@ -14,7 +14,7 @@
@searchNormalClear="quicklySearchClear"
></searchNormal>
<!-- 右侧按钮 -->
<innerButton :isRoutePermission="isRoutePermission" :Butttondata="buttonsRight" @tableButtonClick="tableButtonClick"></innerButton>
<innerButton :Butttondata="buttonsRight" @tableButtonClick="tableButtonClick"></innerButton>
</div>
<slot></slot>
</div>
@ -30,11 +30,6 @@ export default {
searchNormal
},
props: {
//
isRoutePermission:{
type: Boolean,
default: false,
},
Butttondata: {
type: Array,
default: () => {

10
PC/InterFace.Dash/src/components/currenButton/innerButton.vue

@ -1,6 +1,6 @@
<template>
<div class="currenButton clearfix">
<el-button
<el-button
v-for="(item, index) in Butttondata" :key="index"
v-show="typeof item.hide == 'function' ? !item.hide() : !item.hide"
:type="item.type"
@ -16,8 +16,8 @@
}"
:class="item.class"
@click="tableButtonClick(item.name,item)"
v-permission="isRoutePermission ? [$route.name+'.'+item.name] : item.permission"
>{{ item.label }}</el-button>
<!-- v-permission="item.permission" -->
</div>
</template>
<script>
@ -31,14 +31,8 @@ export default {
return []
}
},
//
isRoutePermission:{
type: Boolean,
default: false,
},
},
mounted(){
console.log(36,this.$route,this.$store.getters)
window.addEventListener('setItemEvent', (item) => {
if (item.key.indexOf('tableColumns') > -1) {
this.initButtonType(item)

36
PC/InterFace.Dash/src/components/tablePagination/index.vue

@ -3,9 +3,9 @@
<!-- 头部按钮 -->
<div class="table-nav">
<curren-Button
:isRoutePermission="isRoutePermission"
v-if="headerButttondata"
ref="tablePagination_topNav"
:Butttondata="currenButtonData"
:Butttondata="headerButttondata"
@tableButtonClick="topbutton"
@quicklySearchClick="quicklySearchClick"
@quicklySearchClear="quicklySearchClear"
@ -93,6 +93,13 @@ export default {
rowDrop
},
props: {
// 使
noUsePermissionBtn:{
type: Array,
default: () => {
return ['refresh','field']
}
},
rowMaxHeight:{
type:String,
default:'calc(90vh - 280px)'
@ -117,11 +124,6 @@ export default {
type: Boolean,
default: false,
},
//
isRoutePermission:{
type: Boolean,
default: false,
},
//
quicklySearchOption:{
type: Object,
@ -234,6 +236,7 @@ export default {
},
data () {
return {
headerButttondata:null,
//
rowDropVisible: false,
// table key
@ -282,6 +285,7 @@ export default {
this.uTableTopHeight = this.appRemoveHeight
this.uTableOuterHeight = this.$refs.tablePaginationTableRef.getTableHeight()
this.uTableOuterHeight_init = Number(JSON.stringify(this.uTableOuterHeight))
this.initButttondata()
//
document.addEventListener('click',(e)=>{
@ -296,6 +300,22 @@ export default {
})
},
methods: {
initButttondata(){
let _list = []
this.currenButtonData.forEach(item=>{
if(item.permission){
_list.push(item)
}else{
if(this.noUsePermissionBtn.indexOf(item.name) < 0){
item.permission = [this.$route.name+'.'+item.name]
}else{
item.permission = []
}
_list.push(item)
}
})
this.headerButttondata = _list
},
//
doFreshTableLayout(){
if(this.$refs.tablePaginationTableRef && this.$refs.tablePaginationTableRef.doFreshLayout){
@ -410,7 +430,7 @@ export default {
//
overallSearchFormClick(options){
//
options.vm_quickly = this.$refs.tablePagination_topNav.getQuicklySearchDom()
if(this.$refs.tablePagination_topNav)options.vm_quickly = this.$refs.tablePagination_topNav.getQuicklySearchDom()
this.$emit("overallSearchFormClick", options)
},
//

4
PC/InterFace.Dash/src/layout/components/Navbar.vue

@ -16,9 +16,9 @@
<!-- <screenfull id="screenfull" class="right-menu-item hover-effect" /> -->
<!-- <el-tooltip content="Global Size" effect="dark" placement="bottom">
<el-tooltip content="Global Size" effect="dark" placement="bottom">
<size-select id="size-select" class="right-menu-item hover-effect" />
</el-tooltip> -->
</el-tooltip>
</template>
<el-dropdown

5
PC/InterFace.Dash/src/store/modules/user.js

@ -30,9 +30,10 @@ const mutations = {
// 设置权限(v-permission)
SET_ROLES: (state, roles) => {
let _roles = [
'IncomingData',
'IncomingData.filter',
'IncomingDataHistory.filter',
'IncomingData.export',
'MesProductL7PartsNote.filter',
'MesProductL7PartsNote.export'
]
state.roles = _roles
},

9
PC/UI.WinIn.FasterZ.Job/src/components/currenButton/index.vue

@ -2,7 +2,7 @@
<div class="tableNavBtnsContent">
<div class="tableNavLeftBtns">
<!-- 左侧按钮 -->
<innerButton :isRoutePermission="isRoutePermission" :Butttondata="buttonsLeft" @tableButtonClick="tableButtonClick"></innerButton>
<innerButton :Butttondata="buttonsLeft" @tableButtonClick="tableButtonClick"></innerButton>
</div>
<div class="tableNavRightBtns">
<!-- 快速搜索 -->
@ -14,7 +14,7 @@
@searchNormalClear="quicklySearchClear"
></searchNormal>
<!-- 右侧按钮 -->
<innerButton :isRoutePermission="isRoutePermission" :Butttondata="buttonsRight" @tableButtonClick="tableButtonClick"></innerButton>
<innerButton :Butttondata="buttonsRight" @tableButtonClick="tableButtonClick"></innerButton>
</div>
<slot></slot>
</div>
@ -30,11 +30,6 @@ export default {
searchNormal
},
props: {
//
isRoutePermission:{
type: Boolean,
default: false,
},
Butttondata: {
type: Array,
default: () => {

10
PC/UI.WinIn.FasterZ.Job/src/components/currenButton/innerButton.vue

@ -1,6 +1,6 @@
<template>
<div class="currenButton clearfix">
<el-button
<el-button
v-for="(item, index) in Butttondata" :key="index"
v-show="typeof item.hide == 'function' ? !item.hide() : !item.hide"
:type="item.type"
@ -16,8 +16,8 @@
}"
:class="item.class"
@click="tableButtonClick(item.name,item)"
v-permission="isRoutePermission ? [$route.name+'.'+item.name] : item.permission"
>{{ item.label }}</el-button>
<!-- v-permission="item.permission" -->
</div>
</template>
<script>
@ -31,14 +31,8 @@
return []
}
},
//
isRoutePermission:{
type: Boolean,
default: false,
},
},
mounted(){
console.log(36,this.$route,this.$store.getters)
window.addEventListener('setItemEvent', (item) => {
if (item.key.indexOf('tableColumns') > -1) {
this.initButtonType(item)

36
PC/UI.WinIn.FasterZ.Job/src/components/tablePagination/index.vue

@ -3,9 +3,9 @@
<!-- 头部按钮 -->
<div class="table-nav">
<curren-Button
:isRoutePermission="isRoutePermission"
v-if="headerButttondata"
ref="tablePagination_topNav"
:Butttondata="currenButtonData"
:Butttondata="headerButttondata"
@tableButtonClick="topbutton"
@quicklySearchClick="quicklySearchClick"
@quicklySearchClear="quicklySearchClear"
@ -93,6 +93,13 @@ export default {
rowDrop
},
props: {
// 使
noUsePermissionBtn:{
type: Array,
default: () => {
return ['refresh','field']
}
},
rowMaxHeight:{
type:String,
default:'calc(90vh - 280px)'
@ -117,11 +124,6 @@ export default {
type: Boolean,
default: false,
},
//
isRoutePermission:{
type: Boolean,
default: false,
},
//
quicklySearchOption:{
type: Object,
@ -234,6 +236,7 @@ export default {
},
data () {
return {
headerButttondata:null,
//
rowDropVisible: false,
// table key
@ -282,6 +285,7 @@ export default {
this.uTableTopHeight = this.appRemoveHeight
this.uTableOuterHeight = this.$refs.tablePaginationTableRef.getTableHeight()
this.uTableOuterHeight_init = Number(JSON.stringify(this.uTableOuterHeight))
this.initButttondata()
//
document.addEventListener('click',(e)=>{
@ -296,6 +300,22 @@ export default {
})
},
methods: {
initButttondata(){
let _list = []
this.currenButtonData.forEach(item=>{
if(item.permission){
_list.push(item)
}else{
if(this.noUsePermissionBtn.indexOf(item.name) < 0){
item.permission = [this.$route.name+'.'+item.name]
}else{
item.permission = []
}
_list.push(item)
}
})
this.headerButttondata = _list
},
//
doFreshTableLayout(){
if(this.$refs.tablePaginationTableRef && this.$refs.tablePaginationTableRef.doFreshLayout){
@ -410,7 +430,7 @@ export default {
//
overallSearchFormClick(options){
//
options.vm_quickly = this.$refs.tablePagination_topNav.getQuicklySearchDom()
if(this.$refs.tablePagination_topNav)options.vm_quickly = this.$refs.tablePagination_topNav.getQuicklySearchDom()
this.$emit("overallSearchFormClick", options)
},
//

5
PC/UI.WinIn.FasterZ.Job/src/store/modules/user.js

@ -30,9 +30,10 @@ const mutations = {
// 设置权限(v-permission)
SET_ROLES: (state, roles) => {
let _roles = [
'IncomingData',
'IncomingData.filter',
'IncomingDataHistory.filter',
'IncomingData.export',
'MesProductL7PartsNote.filter',
'MesProductL7PartsNote.export'
]
state.roles = _roles
},

9
PC/UI.WinIn.FasterZ.Store/src/components/currenButton/index.vue

@ -2,7 +2,7 @@
<div class="tableNavBtnsContent">
<div class="tableNavLeftBtns">
<!-- 左侧按钮 -->
<innerButton :isRoutePermission="isRoutePermission" :Butttondata="buttonsLeft" @tableButtonClick="tableButtonClick"></innerButton>
<innerButton :Butttondata="buttonsLeft" @tableButtonClick="tableButtonClick"></innerButton>
</div>
<div class="tableNavRightBtns">
<!-- 快速搜索 -->
@ -14,7 +14,7 @@
@searchNormalClear="quicklySearchClear"
></searchNormal>
<!-- 右侧按钮 -->
<innerButton :isRoutePermission="isRoutePermission" :Butttondata="buttonsRight" @tableButtonClick="tableButtonClick"></innerButton>
<innerButton :Butttondata="buttonsRight" @tableButtonClick="tableButtonClick"></innerButton>
</div>
<slot></slot>
</div>
@ -30,11 +30,6 @@ export default {
searchNormal
},
props: {
//
isRoutePermission:{
type: Boolean,
default: false,
},
Butttondata: {
type: Array,
default: () => {

10
PC/UI.WinIn.FasterZ.Store/src/components/currenButton/innerButton.vue

@ -1,6 +1,6 @@
<template>
<div class="currenButton clearfix">
<el-button
<el-button
v-for="(item, index) in Butttondata" :key="index"
v-show="typeof item.hide == 'function' ? !item.hide() : !item.hide"
:type="item.type"
@ -16,8 +16,8 @@
}"
:class="item.class"
@click="tableButtonClick(item.name,item)"
v-permission="isRoutePermission ? [$route.name+'.'+item.name] : item.permission"
>{{ item.label }}</el-button>
<!-- v-permission="item.permission" -->
</div>
</template>
<script>
@ -31,14 +31,8 @@
return []
}
},
//
isRoutePermission:{
type: Boolean,
default: false,
},
},
mounted(){
console.log(36,this.$route,this.$store.getters)
window.addEventListener('setItemEvent', (item) => {
if (item.key.indexOf('tableColumns') > -1) {
this.initButtonType(item)

36
PC/UI.WinIn.FasterZ.Store/src/components/tablePagination/index.vue

@ -3,9 +3,9 @@
<!-- 头部按钮 -->
<div class="table-nav">
<curren-Button
:isRoutePermission="isRoutePermission"
v-if="headerButttondata"
ref="tablePagination_topNav"
:Butttondata="currenButtonData"
:Butttondata="headerButttondata"
@tableButtonClick="topbutton"
@quicklySearchClick="quicklySearchClick"
@quicklySearchClear="quicklySearchClear"
@ -93,6 +93,13 @@ export default {
rowDrop
},
props: {
// 使
noUsePermissionBtn:{
type: Array,
default: () => {
return ['refresh','field']
}
},
rowMaxHeight:{
type:String,
default:'calc(90vh - 280px)'
@ -117,11 +124,6 @@ export default {
type: Boolean,
default: false,
},
//
isRoutePermission:{
type: Boolean,
default: false,
},
//
quicklySearchOption:{
type: Object,
@ -234,6 +236,7 @@ export default {
},
data () {
return {
headerButttondata:null,
//
rowDropVisible: false,
// table key
@ -282,6 +285,7 @@ export default {
this.uTableTopHeight = this.appRemoveHeight
this.uTableOuterHeight = this.$refs.tablePaginationTableRef.getTableHeight()
this.uTableOuterHeight_init = Number(JSON.stringify(this.uTableOuterHeight))
this.initButttondata()
//
document.addEventListener('click',(e)=>{
@ -296,6 +300,22 @@ export default {
})
},
methods: {
initButttondata(){
let _list = []
this.currenButtonData.forEach(item=>{
if(item.permission){
_list.push(item)
}else{
if(this.noUsePermissionBtn.indexOf(item.name) < 0){
item.permission = [this.$route.name+'.'+item.name]
}else{
item.permission = []
}
_list.push(item)
}
})
this.headerButttondata = _list
},
//
doFreshTableLayout(){
if(this.$refs.tablePaginationTableRef && this.$refs.tablePaginationTableRef.doFreshLayout){
@ -410,7 +430,7 @@ export default {
//
overallSearchFormClick(options){
//
options.vm_quickly = this.$refs.tablePagination_topNav.getQuicklySearchDom()
if(this.$refs.tablePagination_topNav)options.vm_quickly = this.$refs.tablePagination_topNav.getQuicklySearchDom()
this.$emit("overallSearchFormClick", options)
},
//

5
PC/UI.WinIn.FasterZ.Store/src/store/modules/user.js

@ -30,9 +30,10 @@ const mutations = {
// 设置权限(v-permission)
SET_ROLES: (state, roles) => {
let _roles = [
'IncomingData',
'IncomingData.filter',
'IncomingDataHistory.filter',
'IncomingData.export',
'MesProductL7PartsNote.filter',
'MesProductL7PartsNote.export'
]
state.roles = _roles
},

Loading…
Cancel
Save