@jnrs/vue-core 1.2.32 → 1.2.34

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 CHANGED
@@ -623,13 +623,16 @@ import { downloadTemplate, importData, exportData } from '@/api/data'
623
623
 
624
624
  **Props:**
625
625
 
626
- | 属性名 | 类型 | 默认值 | 说明 |
627
- | -------------- | ------------- | --------- | ---------------- |
628
- | src | `string` | `''` | 图片源地址 |
629
- | previewSrcList | `IFileItem[]` | `[]` | 开启图片预览功能 |
630
- | preview | `boolean` | `false` | 是否开启预览功能 |
631
- | height | `string` | — | 图片高度 |
632
- | maxHeight | `string` | `'200px'` | 图片最大高度 |
626
+ | 属性名 | 类型 | 默认值 | 说明 |
627
+ | -------------- | ------------- | ------- | ------------------------------------------------------------------------------- |
628
+ | src | `string` | `''` | 图片源地址 |
629
+ | previewSrcList | `IFileItem[]` | `[]` | 开启图片预览功能 |
630
+ | preview | `boolean` | `false` | 是否开启预览功能 |
631
+ | height | `string` | — | 图片高度 |
632
+ | maxHeight | `string` | | 图片最大高度 |
633
+ | width | `string` | — | 图片宽度 |
634
+ | maxWidth | `string` | — | 图片最大宽度 |
635
+ | showAll | `boolean` | `false` | 是否展示所有图片(flex 排列,gap 4px,可换行,点击时 initial-index 为该图索引) |
633
636
 
634
637
  **使用示例:**
635
638
 
@@ -647,21 +650,23 @@ import { downloadTemplate, importData, exportData } from '@/api/data'
647
650
 
648
651
  **Props:**
649
652
 
650
- | 属性名 | 类型 | 默认值 | 说明 |
651
- | ----------------- | --------------------------------------- | --------- | ------------------------------- |
652
- | modelValue | `MixedUploadFile[]` | — | 绑定的模型值(文件列表) |
653
- | uploadName | `string` | `'file'` | 上传的文件字段名 |
654
- | drag | `boolean` | `false` | 是否启用拖拽上传 |
655
- | disabled | `boolean` | `false` | 是否禁用 |
656
- | showFileList | `boolean` | `true` | 是否显示已上传文件列表 |
657
- | accept | `string` | `''` | 接受的文件类型(如 .xls,.xlsx) |
658
- | fileSizeMb | `number` | `100` | 单个文件大小限制(单位:MB) |
659
- | limit | `number` | `0` | 最大上传文件数量,0 表示不限制 |
660
- | size | `'' \| 'small' \| 'default' \| 'large'` | `'small'` | Element Plus 组件的尺寸 |
661
- | formRef | `FormInstance` | — | 父级组件的表单引用 |
662
- | validateFieldName | `string` | `''` | 父级表单中用于校验的字段名 |
663
- | downloadFileFn | `(data: IAttachment) => void` | — | 文件下载的函数 |
664
- | autoUploadApi | `(data: File) => void` | — | 自动上传文件的 api 函数 |
653
+ | 属性名 | 类型 | 默认值 | 说明 |
654
+ | ----------------- | --------------------------------------- | --------- | ---------------------------------------------------------------- |
655
+ | modelValue | `MixedUploadFile[]` | — | 绑定的模型值(文件列表) |
656
+ | uploadName | `string` | `'file'` | 上传的文件字段名 |
657
+ | drag | `boolean` | `false` | 是否启用拖拽上传 |
658
+ | disabled | `boolean` | `false` | 是否禁用 |
659
+ | showFileList | `boolean` | `true` | 是否显示已上传文件列表 |
660
+ | accept | `string` | `''` | 接受的文件类型(如 .xls,.xlsx) |
661
+ | fileSizeMb | `number` | `100` | 单个文件大小限制(单位:MB) |
662
+ | limit | `number` | `0` | 最大上传文件数量,0 表示不限制 |
663
+ | size | `'' \| 'small' \| 'default' \| 'large'` | `'small'` | Element Plus 组件的尺寸 |
664
+ | formRef | `FormInstance` | — | 父级组件的表单引用 |
665
+ | validateFieldName | `string` | `''` | 父级表单中用于校验的字段名 |
666
+ | downloadFileFn | `(data: IAttachment) => void` | — | 文件下载的函数 |
667
+ | autoUploadApi | `(data: File) => void` | — | 自动上传文件的 api 函数 |
668
+ | previewFileFn | `(data: IAttachment) => void` | — | 文件预览函数(仅对 pdf 文件显示预览按钮) |
669
+ | readonly | `boolean` | `false` | 是否只读模式(仅展示文件列表,隐藏上传按钮、上传提示与删除按钮) |
665
670
 
666
671
  **使用示例:**
667
672
 
@@ -744,25 +749,25 @@ const dialogVisible = ref(false)
744
749
 
745
750
  #### JnDateQuery
746
751
 
747
- 通用时间查询组件,支持日/周/月/年/任意区间五种时间类型切换,配合快捷按钮实现前后时间段快速导航。推荐使用 `showTypeSwitcher` 模式(时间查询),可覆盖所有时间类型的查询需求。
752
+ 通用时间查询组件,支持日/周/月/年/日期时间/任意区间/时间区间七种类型切换,配合快捷按钮实现前后时间段快速导航。组件初始化时若未设置值,自动根据 `type` 配置设置当前时间为默认值。推荐使用 `showTypeSwitcher` 模式(时间查询),可覆盖所有时间类型的查询需求。
748
753
 
749
754
  **Props:**
750
755
 
751
- | 属性名 | 类型 | 默认值 | 说明 |
752
- | ---------------- | ------------------------------------------------------ | -------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
753
- | modelValue | `string \| [string, string]` | — | v-model 绑定值(`type='date'/'month'/'year'` 为 string,`type='week'/'daterange'` 为 [string, string]) |
754
- | type | `'date' \| 'week' \| 'month' \| 'year' \| 'daterange'` | `'date'` | 日期类型;`showTypeSwitcher=true` 时作为初始类型 |
755
- | showTypeSwitcher | `boolean` | `false` | 是否显示类型切换器(推荐开启,可覆盖所有时间类型) |
756
- | switcherStyle | `'select' \| 'button-group'` | `'select'` | 切换器风格(下拉选择 or 按钮组) |
757
- | typeOptions | `DateType[]` | `['date','week','month','year','daterange']` | 可切换的类型选项 |
758
- | quickButtons | `'none' \| 'arrows' \| 'group'` | `'none'` | 快捷按钮风格(无 / 左右箭头 / 按钮组);`arrows` 模式支持 date/week/month/year(不含 daterange) |
759
- | valueFormat | `string` | `'YYYY-MM-DD'` | 日期格式 |
760
- | clearable | `boolean` | `false` | 是否可清除 |
761
- | size | `'' \| 'small' \| 'default' \| 'large'` | `'default'` | 尺寸 |
762
- | placeholder | `string` | `'选择日期'` | 单值 placeholder |
763
- | startPlaceholder | `string` | `'开始日期'` | 范围开始 placeholder |
764
- | endPlaceholder | `string` | `'结束日期'` | 范围结束 placeholder |
765
- | rangeSeparator | `string` | `''` | 范围分隔符 |
756
+ | 属性名 | 类型 | 默认值 | 说明 |
757
+ | ---------------- | --------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
758
+ | modelValue | `string \| [string, string]` | — | v-model 绑定值(`type='date'/'month'/'year'/'datetime'` 为 string,`type='week'/'daterange'/'datetimerange'` 为 [string, string]) |
759
+ | type | `'date' \| 'week' \| 'month' \| 'year' \| 'datetime' \| 'daterange' \| 'datetimerange'` | `'date'` | 日期类型;`showTypeSwitcher=true` 时作为初始类型;组件会根据 type 自动设置当前时间为默认值 |
760
+ | showTypeSwitcher | `boolean` | `false` | 是否显示类型切换器(推荐开启,可覆盖所有时间类型) |
761
+ | switcherStyle | `'select' \| 'button-group'` | `'select'` | 切换器风格(下拉选择 or 按钮组) |
762
+ | typeOptions | `DateType[]` | `['date','week','month','year','datetime','daterange','datetimerange']` | 可切换的类型选项 |
763
+ | quickButtons | `'none' \| 'arrows' \| 'group'` | `'none'` | 快捷按钮风格(无 / 左右箭头 / 按钮组);`arrows` 模式支持 date/datetime/week/month/year(不含 daterange/datetimerange |
764
+ | valueFormat | `string` | `'YYYY-MM-DD'` | 日期格式 |
765
+ | clearable | `boolean` | `false` | 是否可清除 |
766
+ | size | `'' \| 'small' \| 'default' \| 'large'` | `'default'` | 尺寸 |
767
+ | placeholder | `string` | `''`(i18n 提供) | 单值 placeholder |
768
+ | startPlaceholder | `string` | `''`(i18n 提供) | 范围开始 placeholder |
769
+ | endPlaceholder | `string` | `''`(i18n 提供) | 范围结束 placeholder |
770
+ | rangeSeparator | `string` | `''`(i18n 提供) | 范围分隔符 |
766
771
 
767
772
  **Events:**
768
773
 
@@ -770,7 +775,7 @@ const dialogVisible = ref(false)
770
775
  - `change` - 值变化时触发,参数为 `(value, type)`
771
776
  - `type-change` - 类型切换时触发,参数为 `(type)`
772
777
 
773
- **使用示例:时间查询(推荐,覆盖日/周/月/年/区间)**
778
+ **使用示例:时间查询(推荐,覆盖所有时间类型)**
774
779
 
775
780
  ```vue
776
781
  <template>
@@ -779,12 +784,12 @@ const dialogVisible = ref(false)
779
784
  type="date"
780
785
  show-type-switcher
781
786
  switcher-style="button-group"
782
- :type-options="['date', 'week', 'month', 'year', 'daterange']"
787
+ :type-options="['date', 'week', 'month', 'year', 'datetime', 'daterange', 'datetimerange']"
783
788
  quick-buttons="arrows"
784
- value-format="YYYY-MM-DD"
785
- placeholder="选择日期"
786
- start-placeholder="开始日期"
787
- end-placeholder="结束日期"
789
+ value-format="YYYY-MM-DD HH:mm:ss"
790
+ placeholder="选择日期时间"
791
+ start-placeholder="开始时间"
792
+ end-placeholder="结束时间"
788
793
  />
789
794
  </template>
790
795
 
package/CHANGELOG.md CHANGED
@@ -1,6 +1,31 @@
1
1
  # 发版日志
2
2
 
3
- ## [1.2.32] - 2026-07-27 【latest】
3
+ ## [1.2.34] - 2026-07-28 【latest】
4
+
5
+ ### Features
6
+
7
+ - 组件国际化适配:`GlobalSetting`、`JnDateQuery`、`JnFileUpload`、`JnImageView`、`JnImportAndExport`、`JnPdfView`、`JnSelectTemplate`、`JnTable` 新增 zhCn/en 语言包配置,支持多语言切换
8
+ - `JnFileUpload`:新增 `readonly` prop,只读模式下仅展示文件列表并隐藏上传按钮、上传提示与删除按钮
9
+ - `JnFileUpload`:新增 `previewFileFn` prop,仅对 pdf 文件显示预览按钮,点击后调用预览函数
10
+ - `JnImageView`:新增 `showAll` prop,为 true 时所有 `previewSrcList` 从左到右排列展示(gap 4px,可换行),点击某张图片时 `initial-index` 为该图片索引
11
+ - `JnImageView`:当 `previewSrcList` 长度大于 1 时,在图片右上角显示总数角标(如 `x3`)
12
+
13
+ ### Fixed
14
+
15
+ - `JnDateQuery`:`pickerFormat` 计算属性改用 i18n 动态获取格式字符串,修复切换英文环境时日期格式仍显示中文"年""月"的问题
16
+
17
+ ## [1.2.33] - 2026-07-27
18
+
19
+ ### Features
20
+
21
+ - `JnDateQuery`:拓展 `type` 配置支持 `'datetime'` 和 `'datetimerange'` 类型,可选择日期和时间
22
+ - `JnDateQuery`:组件初始化时自动根据 `type` 配置设置当前时间为默认值(year=当年1月1日,month=当月1日,date=今日,datetime=当前时间,week=本周范围,daterange=今日范围,datetimerange=当前时间范围)
23
+
24
+ ### Documentation
25
+
26
+ - `AGENTS.md`:更新 JnDateQuery 文档,新增 datetime/datetimerange 类型说明,补充默认值行为说明
27
+
28
+ ## [1.2.32] - 2026-07-27
4
29
 
5
30
  ### Fixed
6
31
 
@@ -1,4 +1,4 @@
1
- type DateType = 'date' | 'week' | 'month' | 'year' | 'daterange';
1
+ type DateType = 'date' | 'week' | 'month' | 'year' | 'datetime' | 'daterange' | 'datetimerange';
2
2
  type QuickButtonStyle = 'none' | 'arrows' | 'group';
3
3
  type SwitcherStyle = 'select' | 'button-group';
4
4
  interface Props {
@@ -1,6 +1,10 @@
1
1
  export interface Props {
2
2
  value: string;
3
3
  color?: string;
4
+ /**
5
+ * 是否内联显示时间
6
+ */
7
+ inline?: boolean;
4
8
  }
5
9
  declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
6
10
  export default _default;
@@ -55,6 +55,15 @@ export interface Props {
55
55
  * 自动上传文件的 api 函数
56
56
  */
57
57
  autoUploadApi?: (data: File) => void;
58
+ /**
59
+ * 文件预览的函数(仅对 pdf 文件显示预览按钮)
60
+ */
61
+ previewFileFn?: (data: IAttachment) => void;
62
+ /**
63
+ * 是否只读模式,默认为 false
64
+ * 只读模式下仅展示文件列表,隐藏上传按钮、上传提示与删除按钮
65
+ */
66
+ readonly?: boolean;
58
67
  }
59
68
  declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
60
69
  "update:modelValue": (...args: any[]) => void;
@@ -231,7 +240,9 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
231
240
  }>>, {
232
241
  abort: (file?: import('element-plus/es/components/upload/src/upload.mjs').UploadFile) => void;
233
242
  submit: () => void;
234
- clearFiles: (states?: import('element-plus').UploadStatus[]) => void;
243
+ clearFiles: (states? /**
244
+ * 上传的文件字段名,默认为 'file'
245
+ */: import('element-plus').UploadStatus[]) => void;
235
246
  handleStart: (rawFile: import('element-plus/es/components/upload/src/upload.mjs').UploadRawFile) => void;
236
247
  handleRemove: (file: import('element-plus/es/components/upload/src/upload.mjs').UploadFile | import('element-plus/es/components/upload/src/upload.mjs').UploadRawFile) => void;
237
248
  }, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
@@ -398,7 +409,9 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
398
409
  }>>, "name" | "disabled" | "onChange" | "data" | "onError" | "onProgress" | "fileList" | "showFileList" | "accept" | "beforeUpload" | "onRemove" | "onPreview" | "onSuccess" | "onExceed" | "action" | "method" | "autoUpload" | "listType" | "httpRequest" | "abort" | "submit" | "clearFiles" | "handleStart" | "handleRemove"> & import('vue').ShallowUnwrapRef<{
399
410
  abort: (file?: import('element-plus/es/components/upload/src/upload.mjs').UploadFile) => void;
400
411
  submit: () => void;
401
- clearFiles: (states?: import('element-plus').UploadStatus[]) => void;
412
+ clearFiles: (states? /**
413
+ * 上传的文件字段名,默认为 'file'
414
+ */: import('element-plus').UploadStatus[]) => void;
402
415
  handleStart: (rawFile: import('element-plus/es/components/upload/src/upload.mjs').UploadRawFile) => void;
403
416
  handleRemove: (file: import('element-plus/es/components/upload/src/upload.mjs').UploadFile | import('element-plus/es/components/upload/src/upload.mjs').UploadRawFile) => void;
404
417
  }> & {} & import('vue').ComponentCustomProperties & {} & {
@@ -20,6 +20,20 @@ interface JnImageViewProps {
20
20
  * 图片最大高度
21
21
  */
22
22
  maxHeight?: string;
23
+ /**
24
+ * 图片宽度
25
+ */
26
+ width?: string;
27
+ /**
28
+ * 图片最大宽度
29
+ */
30
+ maxWidth?: string;
31
+ /**
32
+ * 是否展示所有图片,默认为 false
33
+ * 为 true 时所有 previewSrcList 从左到右排列展示,gap 为 4px,可换行
34
+ * 点击某张图片时,预览的初始索引为该图片的索引
35
+ */
36
+ showAll?: boolean;
23
37
  }
24
38
  declare const _default: import('vue').DefineComponent<JnImageViewProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<JnImageViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
25
39
  export default _default;