|
|
@@ -314,7 +314,9 @@ import ActionUtils from '@/utils/action'
|
|
|
import FormUtils from '../../utils/formUtil'
|
|
|
import FormFieldUtil from '../../utils/formFieldUtil'
|
|
|
|
|
|
-import { hasPermission } from '@/business/platform/form/constants/tableButtonTypes'
|
|
|
+import BUTTON_TYPES, {
|
|
|
+ hasPermission
|
|
|
+} from '@/business/platform/form/constants/tableButtonTypes'
|
|
|
import {
|
|
|
defaultPageSize,
|
|
|
pageSizeOptions
|
|
|
@@ -822,11 +824,10 @@ export default {
|
|
|
}
|
|
|
const bs = []
|
|
|
this.buttons.forEach((button) => {
|
|
|
+ const btnPosition = this.resolveButtonPosition(button)
|
|
|
if (
|
|
|
hasPermission(button.key, position) && // 有位置权限
|
|
|
- (!button.position ||
|
|
|
- button.position === 'all' ||
|
|
|
- button.position === position) && // 有位置权限
|
|
|
+ (btnPosition === 'all' || btnPosition === position) && // 有位置权限
|
|
|
(this.$utils.isEmpty(this.buttonsRights[button.key]) ||
|
|
|
this.buttonsRights[button.key] !==
|
|
|
FormOptions.t.PERMISSIONS.HIDE) && // 有按钮权限
|
|
|
@@ -842,11 +843,10 @@ export default {
|
|
|
filterDetailButtons(position) {
|
|
|
const bs = []
|
|
|
this.buttons.forEach((button) => {
|
|
|
+ const btnPosition = this.resolveButtonPosition(button)
|
|
|
if (
|
|
|
hasPermission(button.key, position) && // 有位置权限
|
|
|
- (!button.position ||
|
|
|
- button.position === 'all' ||
|
|
|
- button.position === position) && // 有位置权限
|
|
|
+ (btnPosition === 'all' || btnPosition === position) && // 有位置权限
|
|
|
(this.$utils.isEmpty(this.buttonsRights[button.key]) ||
|
|
|
this.buttonsRights[button.key] !==
|
|
|
FormOptions.t.PERMISSIONS.HIDE) && // 有按钮权限
|
|
|
@@ -861,6 +861,16 @@ export default {
|
|
|
})
|
|
|
return bs
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 解析按钮实际位置:未配置时回退到按钮常量默认值(与设置面板一致)
|
|
|
+ */
|
|
|
+ resolveButtonPosition(button) {
|
|
|
+ if (button.position) {
|
|
|
+ return button.position
|
|
|
+ }
|
|
|
+ const defaultButton = BUTTON_TYPES[button.key]
|
|
|
+ return (defaultButton && defaultButton.position) || 'all'
|
|
|
+ },
|
|
|
handleActionEvent(button, buttonIndex) {
|
|
|
// 起始下标
|
|
|
const index = (this.currentPage - 1) * this.pageSize + buttonIndex
|