befly-admin 3.12.6 → 3.12.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "befly-admin",
3
- "version": "3.12.6",
4
- "gitHead": "607fe5ea9c06653ec6da8a9e4175d1f9c7b98c13",
3
+ "version": "3.12.7",
4
+ "gitHead": "1fb5271f37e552345c9531248d4e3fef32175352",
5
5
  "private": false,
6
6
  "description": "Befly Admin - 基于 Vue3 + TDesign Vue Next 的后台管理系统",
7
7
  "files": [
@@ -23,16 +23,16 @@
23
23
  "registry": "https://registry.npmjs.org"
24
24
  },
25
25
  "scripts": {
26
- "dev": "vite",
27
- "build": "vite build",
28
- "preview": "vite preview"
26
+ "dev": "bunx --bun vite",
27
+ "build": "bunx --bun vite build",
28
+ "preview": "bunx --bun vite preview"
29
29
  },
30
30
  "dependencies": {
31
31
  "@befly-addon/admin": "^1.8.5",
32
32
  "@iconify-json/lucide": "^1.2.86",
33
33
  "axios": "^1.13.2",
34
34
  "befly-shared": "^1.4.5",
35
- "befly-vite": "^1.4.8",
35
+ "befly-vite": "^1.4.9",
36
36
  "pinia": "^3.0.4",
37
37
  "tdesign-vue-next": "^1.18.0",
38
38
  "vite": "^8.0.0-beta.8",
@@ -30,7 +30,7 @@
30
30
  </div>
31
31
 
32
32
  <div class="main-page">
33
- <TPagination :current-page="$Data.pager.currentPage" :page-size="$Data.pager.limit" :total="$Data.pager.total" :align="paginationAlign" :layout="paginationLayout" @current-change="onPageChange" @page-size-change="onPageSizeChange" />
33
+ <TPagination :current-page="$Data.pager.currentPage" :page-size="$Data.pager.limit" :total="$Data.pager.total" align="right" :layout="paginationLayout" @current-change="onPageChange" @page-size-change="onPageSizeChange" />
34
34
  </div>
35
35
 
36
36
  <slot name="dialogs" :reload="reload" :current-row="$Data.currentRow"></slot>
@@ -100,25 +100,19 @@ type LoadListOptions = {
100
100
  const props = withDefaults(
101
101
  defineProps<{
102
102
  columns: PagedTableCol[];
103
- detailFields?: PrimaryTableCol[];
104
- detailColumns?: PrimaryTableCol[];
105
103
  rowKey?: string;
106
104
  tableHeight?: string;
107
105
  pageSize?: number;
108
106
  endpoints?: Endpoints<TableRowData>;
109
- paginationAlign?: "left" | "center" | "right";
110
107
  paginationLayout?: string;
111
108
  autoLoad?: boolean;
112
109
  tableSlotNames?: string[];
113
110
  }>(),
114
111
  {
115
- detailFields: undefined,
116
- detailColumns: undefined,
117
112
  rowKey: "id",
118
113
  tableHeight: "calc(100vh - var(--search-height) - var(--pagination-height) - var(--layout-gap) * 4)",
119
114
  pageSize: 30,
120
115
  endpoints: undefined,
121
- paginationAlign: "right",
122
116
  paginationLayout: "total, prev, pager, next, jumper",
123
117
  autoLoad: true,
124
118
  tableSlotNames: undefined
@@ -219,18 +213,9 @@ const tableColumns = computed(() => {
219
213
  });
220
214
 
221
215
  const detailFields = computed(() => {
222
- // A:完全自定义(兼容存量)
223
- if (props.detailFields && Array.isArray(props.detailFields)) {
224
- return filterValidColumns(props.detailFields);
225
- }
226
-
227
- // B:表格列只展示关键字段,详情列 = columns(关键字段) + detailColumns(其他字段)
228
- if (props.detailColumns && Array.isArray(props.detailColumns)) {
229
- const extras = filterValidColumns(props.detailColumns);
230
- return mergeDetailColumns(tableColumns.value, extras);
231
- }
232
-
233
- // C:单列定义:只维护一个 columns:detail 字段为详情专属列,详情 = 表格列(在前) + 详情列(在后)
216
+ // 只维护一个 columns:
217
+ // - detail: false(默认)=> 表格展示(同时也会出现在详情里,且顺序靠前)
218
+ // - detail: true => 仅在详情展示(顺序靠后)
234
219
  const extras: PagedTableCol[] = [];
235
220
  const cols = filterValidColumns(props.columns) as PagedTableCol[];
236
221
  for (const col of cols) {
@@ -242,7 +227,7 @@ const detailFields = computed(() => {
242
227
  return mergeDetailColumns(tableColumns.value, extras);
243
228
  }
244
229
 
245
- // D:默认复用表格列
230
+ // 默认复用表格列
246
231
  return tableColumns.value;
247
232
  });
248
233
 
package/src/main.ts CHANGED
@@ -3,7 +3,7 @@ import "tdesign-vue-next/es/style/index.css";
3
3
  // 引入 addonAdmin 的 CSS 变量
4
4
  import "@befly-addon/admin/styles/variables.scss";
5
5
  // 引入全局基础样式(reset、通用类、滚动条等)
6
- import "./styles/global.scss";
6
+ import "@/styles/global.scss";
7
7
  import App from "./App.vue";
8
8
 
9
9
  const app = createApp(App);
@@ -142,14 +142,7 @@
142
142
  </div>
143
143
  </template>
144
144
 
145
- <script setup lang="ts">
146
- definePage({
147
- meta: {
148
- title: "数据面板",
149
- layout: "default"
150
- }
151
- });
152
- </script>
145
+ <script setup lang="ts"></script>
153
146
 
154
147
  <style lang="scss" scoped>
155
148
  .dashboard {
@@ -1,3 +0,0 @@
1
- // 让 TypeScript 识别 unplugin-vue-router 的 definePage 宏
2
- // 注意:这不会在运行时引入任何代码,仅用于类型声明
3
- import "unplugin-vue-router/client";