From e3a36267f37126eac074c1f2788441e53f93313a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=A6=99=E7=A0=81=E7=94=9F=E8=8A=B1?= <18523774412@qq.com>
Date: Tue, 5 Sep 2023 12:22:09 +0800
Subject: [PATCH] =?UTF-8?q?feat(baTable):=E7=8B=AC=E7=AB=8B=E5=87=BA?=
=?UTF-8?q?=E8=A1=A8=E6=A0=BC=E5=86=85=E9=83=A8=E7=BB=84=E4=BB=B6=E8=87=AA?=
=?UTF-8?q?=E5=8A=A8=E8=B0=83=E7=94=A8=E7=9A=84=E9=89=B4=E6=9D=83=E6=96=B9?=
=?UTF-8?q?=E6=B3=95=EF=BC=8C=E4=BE=BF=E4=BA=8E=E5=BC=80=E5=8F=91=E8=80=85?=
=?UTF-8?q?=E9=87=8D=E5=86=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/table/fieldRender/index.vue | 57 ++++---------------
web/src/components/table/header/index.vue | 8 +--
web/src/utils/baTable.ts | 11 +++-
3 files changed, 25 insertions(+), 51 deletions(-)
diff --git a/web/src/components/table/fieldRender/index.vue b/web/src/components/table/fieldRender/index.vue
index c71aba22..89883af2 100644
--- a/web/src/components/table/fieldRender/index.vue
+++ b/web/src/components/table/fieldRender/index.vue
@@ -114,9 +114,11 @@
/>
+
+
{{ btn.text }}
+
+
-
- {{ btn.text }}
-
- {{ btn.text }}
+
+
-
- {{ btn.text }}
-
-
+
+
-
- {{ btn.text }}
-
-
-
+
-
+
import { reactive, computed, inject } from 'vue'
-import { debounce, auth } from '/@/utils/common'
+import { debounce } from '/@/utils/common'
import type baTableClass from '/@/utils/baTable'
import ComSearch from '/@/components/table/comSearch/index.vue'
import { useI18n } from 'vue-i18n'
diff --git a/web/src/utils/baTable.ts b/web/src/utils/baTable.ts
index bebb3671..f83da674 100644
--- a/web/src/utils/baTable.ts
+++ b/web/src/utils/baTable.ts
@@ -1,5 +1,5 @@
import { reactive } from 'vue'
-import { getArrayKey } from '/@/utils/common'
+import { auth, getArrayKey } from '/@/utils/common'
import type { baTableApi } from '/@/api/common'
import Sortable from 'sortablejs'
import { findIndexRow } from '/@/components/table'
@@ -69,6 +69,15 @@ export default class baTable {
this.initComSearch(!isUndefined(route) ? route.query : {})
}
+ /**
+ * 表格内部鉴权方法
+ * 此方法在表头或表行组件内部自动调用,传递权限节点名,如:add、edit
+ * 若需自定义表格内部鉴权,重写此方法即可
+ */
+ auth(node: string) {
+ return auth(node)
+ }
+
/**
* 运行前置函数
* @param funName 函数名