[update] 修改操作列只显示一个按钮,其他显示在更多

This commit is contained in:
lideqin
2023-08-23 18:28:36 +08:00
parent 083bcaf0a2
commit a8f350e6d7
7 changed files with 227 additions and 62 deletions
+8 -1
View File
@@ -2,6 +2,7 @@
* 表头通过标签管理配置的模块的表格数据的混入
*/
import { getAction, postAction } from '@api/manage'
import { isHasPermission } from '../utils/hasPermission'
// 模拟接口返回的表头数据
const TempApiReturnColumns = [
@@ -49,6 +50,7 @@ export const ConfigurableTableMixin = {
orderBy: '1',
orderByField: '',
getTableHeaderData: null, // 获取表头数据的方法
operateMaxNum: 1,
// 操作列的column
operateColumn: {
title: this.$t('operation'),
@@ -57,12 +59,17 @@ export const ConfigurableTableMixin = {
scopedSlots: { customRender: 'operation' }
},
type: '', // 这个字段不知道什么含义
filters: {} // 固定的搜索条件
filters: {}, // 固定的搜索条件
needFilterTableBtn: true // 是否需要过滤没有权限的按钮
}
},
mounted () {
this.getTableHeader()
this.loadData()
// 过滤没有权限的按钮
if (this.needFilterTableBtn) {
this.operationList = this.operationList.filter(item => isHasPermission(item.has))
}
},
methods: {
/**
+10 -1
View File
@@ -8,6 +8,7 @@ import { downFile, getAction, getFileAccessHttpUrl, postAction } from '@/api/man
import Vue from 'vue'
import { ACCESS_TOKEN, TENANT_ID } from '@/store/mutation-types'
import store from '@/store'
import { isHasPermission } from '../utils/hasPermission'
// 导入的加载提示
let importModalLoading
@@ -51,7 +52,9 @@ export const JeroListMixin = {
/* 高级查询条件 */
superQueryParams: '',
/** 高级查询拼接方式 */
superQueryMatchType: 'and'
superQueryMatchType: 'and',
operateMaxNum: 1, // 表格操作列最多显示的按钮,其他显示在更多中
needFilterTableBtn: true // 是否需要过滤表格操作列没有权限的按钮
}
},
created () {
@@ -61,6 +64,12 @@ export const JeroListMixin = {
this.initDictConfig()
}
},
mounted () {
// 过滤表格操作列没有权限的按钮
if (this.needFilterTableBtn) {
this.operationList = this.operationList.filter(item => isHasPermission(item.has))
}
},
computed: {
// token header
tokenHeader () {