@jnrs/vue-core 1.2.24 → 1.2.25
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/AGENTS.md +41 -0
- package/CHANGELOG.md +11 -0
- package/README.md +26 -9
- package/dist/components/JnImportAndExport.vue.d.ts +1 -1
- package/dist/components/JnTable.vue.d.ts +12 -0
- package/dist/components/index.js +504 -503
- package/dist/composables/index.js +1 -1
- package/dist/composables/useReactivityTableHeight.d.ts +10 -11
- package/dist/useMouseSelection-WAwkGh9a.js +221 -0
- package/package.json +2 -2
- package/dist/useMouseSelection-BYwoK2fm.js +0 -208
package/AGENTS.md
CHANGED
|
@@ -370,6 +370,7 @@ console.log(routes)
|
|
|
370
370
|
| showMouseSelection | `boolean` | `false` | 是否开启鼠标框选 |
|
|
371
371
|
| containerClass | `string` | `'jn_table'` | 表格容器类名,用于鼠标框选功能,多个表格时需传入不同类名 |
|
|
372
372
|
| pagination | `IPagination` | `{ pageNo: 0, pageSize: 0 }` | 当前页码和每页大小(用于序号计算) |
|
|
373
|
+
| isMainTable | `boolean` | `false` | 是否为主表,启用行选中高亮样式(多栏布局中主表使用) |
|
|
373
374
|
|
|
374
375
|
**暴露方法 (Exposed):**
|
|
375
376
|
|
|
@@ -406,6 +407,46 @@ const handleClearSelection = () => {
|
|
|
406
407
|
</script>
|
|
407
408
|
```
|
|
408
409
|
|
|
410
|
+
**主表样式示例(多栏布局):**
|
|
411
|
+
|
|
412
|
+
```vue
|
|
413
|
+
<template>
|
|
414
|
+
<JnTable
|
|
415
|
+
:data="tableData"
|
|
416
|
+
:isMainTable="true"
|
|
417
|
+
:pagination="pagination"
|
|
418
|
+
:autoHeight="true"
|
|
419
|
+
:showScrollbar="true"
|
|
420
|
+
:showIndexColumn="true"
|
|
421
|
+
:rowClassName="tableRowClassName"
|
|
422
|
+
@row-click="handleRowClick"
|
|
423
|
+
>
|
|
424
|
+
<el-table-column prop="name" label="名称" min-width="180" show-overflow-tooltip />
|
|
425
|
+
<el-table-column prop="status" label="状态" />
|
|
426
|
+
</JnTable>
|
|
427
|
+
</template>
|
|
428
|
+
|
|
429
|
+
<script setup>
|
|
430
|
+
import { ref } from 'vue'
|
|
431
|
+
|
|
432
|
+
const currentId = (ref < string) | (undefined > undefined)
|
|
433
|
+
|
|
434
|
+
const handleRowClick = (row) => {
|
|
435
|
+
if (currentId.value === row.id) {
|
|
436
|
+
currentId.value = undefined
|
|
437
|
+
} else {
|
|
438
|
+
currentId.value = row.id
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
const tableRowClassName = ({ row }) => {
|
|
443
|
+
return row.id === currentId.value ? 'jn-row-selected' : ''
|
|
444
|
+
}
|
|
445
|
+
</script>
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
> `isMainTable` 启用后,会自动添加行 hover 高亮(`--jnrs-background-hover`)和选中行高亮(`--jnrs-color-primary`)样式,配合 `rowClassName` 实现主表行选中效果。
|
|
449
|
+
|
|
409
450
|
---
|
|
410
451
|
|
|
411
452
|
#### JnSelectTemplate
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# 发版日志
|
|
2
2
|
|
|
3
|
+
## [1.2.25] - 2026-07-17
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- `JnTable` 组件新增 `isMainTable` prop,启用行选中高亮样式(多栏布局主表使用)
|
|
8
|
+
- `useReactivityTableHeight` 优化:支持多表格场景,自动生成唯一类名,支持 `elementRef` 参数
|
|
9
|
+
|
|
10
|
+
### Documentation
|
|
11
|
+
|
|
12
|
+
- `AGENTS.md` 新增 `isMainTable` prop 文档和主表样式示例
|
|
13
|
+
|
|
3
14
|
## [1.2.24] - 2026-07-08
|
|
4
15
|
|
|
5
16
|
### Fixed
|
package/README.md
CHANGED
|
@@ -4,12 +4,18 @@
|
|
|
4
4
|
|
|
5
5
|
巨能前端工程化开发,Vue 专用核心功能包。
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
7
|
+
### 功能模块
|
|
8
|
+
|
|
9
|
+
| 模块 | 路径 | 说明 |
|
|
10
|
+
| ----------- | ----------------------------- | ------------------------------------------------------------ |
|
|
11
|
+
| 主模块 | `@jnrs/vue-core` | 基础类型定义(`IMenuItem`, `IPagination`, `IPageData`, `IAttachment`, `IDocument` 等) |
|
|
12
|
+
| Pinia | `@jnrs/vue-core/pinia` | `useSystemStore`(主题/全屏/菜单折叠)+ `useMenuStore`(动态菜单/路由) |
|
|
13
|
+
| Router | `@jnrs/vue-core/router` | `createVueRouter`(创建路由实例)+ `asyncGenerateRoute`(动态路由生成)+ `handleRouter`(跳转)+ `useRouter`/`useRoute` |
|
|
14
|
+
| 组件 | `@jnrs/vue-core/components` | `JnTable`(表格)、`JnPagination`(分页)、`JnDialog`(弹窗)、`JnFileUpload`(文件上传)、`JnSelectTemplate`(选择器)、`JnDatetime`(日期格式化)、`JnImportAndExport`(导入导出)等 |
|
|
15
|
+
| Composables | `@jnrs/vue-core/composables` | `useMouseSelection`(鼠标框选)、`useReactivityTableHeight`(表格高度自适应)、`useWebSocket`(WebSocket 连接) |
|
|
16
|
+
| 常量 | `@jnrs/vue-core/constants` | 主题选项配置 |
|
|
17
|
+
| 工具 | `@jnrs/vue-core/utils` / `lib` | 工具函数 / 类型守卫 |
|
|
18
|
+
| 国际化 | `@jnrs/vue-core/locales` | 组件内置文案的多语言支持 |
|
|
13
19
|
|
|
14
20
|
## 💻 技术栈
|
|
15
21
|
|
|
@@ -24,9 +30,20 @@ pnpm add @jnrs/vue-core
|
|
|
24
30
|
## 🔍 使用示例
|
|
25
31
|
|
|
26
32
|
```typescript
|
|
27
|
-
|
|
28
|
-
import {
|
|
29
|
-
|
|
33
|
+
// 类型
|
|
34
|
+
import type { IPageData, IAttachment, IMenuItem } from '@jnrs/vue-core'
|
|
35
|
+
|
|
36
|
+
// Pinia
|
|
37
|
+
import { useSystemStore, useMenuStore } from '@jnrs/vue-core/pinia'
|
|
38
|
+
|
|
39
|
+
// Router
|
|
40
|
+
import { useRouter, useRoute, handleRouter, createVueRouter } from '@jnrs/vue-core/router'
|
|
41
|
+
|
|
42
|
+
// 组件
|
|
43
|
+
import { JnTable, JnPagination, JnDialog, JnFileUpload, JnDatetime, JnImportAndExport } from '@jnrs/vue-core/components'
|
|
44
|
+
|
|
45
|
+
// Composables
|
|
46
|
+
import { useWebSocket, useMouseSelection } from '@jnrs/vue-core/composables'
|
|
30
47
|
```
|
|
31
48
|
|
|
32
49
|
## 📋 API
|
|
@@ -12,6 +12,7 @@ export interface Props {
|
|
|
12
12
|
rowKey?: string;
|
|
13
13
|
/**
|
|
14
14
|
* 总是显示横向滚动条
|
|
15
|
+
* @default false
|
|
15
16
|
*/
|
|
16
17
|
showScrollbar?: boolean;
|
|
17
18
|
/**
|
|
@@ -26,28 +27,39 @@ export interface Props {
|
|
|
26
27
|
autoHeight?: boolean;
|
|
27
28
|
/**
|
|
28
29
|
* 表格高度自动计算配置项
|
|
30
|
+
* @default {}
|
|
29
31
|
*/
|
|
30
32
|
autoHeightOptions?: UseReactivityTableHeightOptions;
|
|
31
33
|
/**
|
|
32
34
|
* 是否显示序号列
|
|
35
|
+
* @default false
|
|
33
36
|
*/
|
|
34
37
|
showIndexColumn?: boolean;
|
|
35
38
|
/**
|
|
36
39
|
* 是否显示选择列
|
|
40
|
+
* @default false
|
|
37
41
|
*/
|
|
38
42
|
showSelectionColumn?: boolean;
|
|
39
43
|
/**
|
|
40
44
|
* 是否开启鼠标框选
|
|
45
|
+
* @default false
|
|
41
46
|
*/
|
|
42
47
|
showMouseSelection?: boolean;
|
|
43
48
|
/**
|
|
44
49
|
* 表格容器类名,用于鼠标框选功能,多个表格时需传入不同类名
|
|
50
|
+
* @default 'jn_table'
|
|
45
51
|
*/
|
|
46
52
|
containerClass?: string;
|
|
47
53
|
/**
|
|
48
54
|
* 当前页码和每页大小(用于序号计算)
|
|
55
|
+
* @default { pageNo: 0, pageSize: 0 }
|
|
49
56
|
*/
|
|
50
57
|
pagination?: IPagination;
|
|
58
|
+
/**
|
|
59
|
+
* 是否为主表,启用行选中高亮样式(多栏布局中主表使用)
|
|
60
|
+
* @default false
|
|
61
|
+
*/
|
|
62
|
+
isMainTable?: boolean;
|
|
51
63
|
}
|
|
52
64
|
declare function __VLS_template(): {
|
|
53
65
|
attrs: Partial<{}>;
|