zhytech-ui 1.1.39 → 1.2.0

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/README.md CHANGED
@@ -70,6 +70,11 @@ setTheme("dark");
70
70
 
71
71
  > #### 版本更新清单:
72
72
 
73
+ **V 1.1.40**
74
+ ```html
75
+ 1.文件预览组件中视频更换为西瓜视频播放组件,解决视频全屏 无法显示弹窗的问题
76
+ ```
77
+
73
78
  **V 1.1.39**
74
79
  ```html
75
80
  1.优化文件预览组件,修复左侧列表名称过长时,超出外层宽度
@@ -1,5 +1,5 @@
1
1
  import { videoConfigType } from '../types/filePreviewType';
2
- declare const _default: import('vue').DefineComponent<globalThis.ExtractPropTypes<{
2
+ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<globalThis.ExtractPropTypes<{
3
3
  src: {
4
4
  type: StringConstructor;
5
5
  required: true;
@@ -8,28 +8,7 @@ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropType
8
8
  type: globalThis.PropType<videoConfigType>;
9
9
  default: () => {};
10
10
  };
11
- }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
12
- canplay: (...args: any[]) => void;
13
- canplaythrough: (...args: any[]) => void;
14
- durationchange: (...args: any[]) => void;
15
- ended: (...args: any[]) => void;
16
- error: (...args: any[]) => void;
17
- loadeddata: (...args: any[]) => void;
18
- loadedmetadata: (...args: any[]) => void;
19
- loadstart: (...args: any[]) => void;
20
- pause: (...args: any[]) => void;
21
- play: (...args: any[]) => void;
22
- playing: (...args: any[]) => void;
23
- progress: (...args: any[]) => void;
24
- ratechange: (...args: any[]) => void;
25
- stalled: (...args: any[]) => void;
26
- timeupdate: (...args: any[]) => void;
27
- volumechange: (...args: any[]) => void;
28
- waiting: (...args: any[]) => void;
29
- mirrorChange: (...args: any[]) => void;
30
- loopChange: (...args: any[]) => void;
31
- lightOffChange: (...args: any[]) => void;
32
- }, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
11
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
33
12
  src: {
34
13
  type: StringConstructor;
35
14
  required: true;
@@ -38,30 +17,14 @@ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropType
38
17
  type: globalThis.PropType<videoConfigType>;
39
18
  default: () => {};
40
19
  };
41
- }>> & Readonly<{
42
- onCanplay?: ((...args: any[]) => any) | undefined;
43
- onCanplaythrough?: ((...args: any[]) => any) | undefined;
44
- onDurationchange?: ((...args: any[]) => any) | undefined;
45
- onEnded?: ((...args: any[]) => any) | undefined;
46
- onError?: ((...args: any[]) => any) | undefined;
47
- onLoadeddata?: ((...args: any[]) => any) | undefined;
48
- onLoadedmetadata?: ((...args: any[]) => any) | undefined;
49
- onLoadstart?: ((...args: any[]) => any) | undefined;
50
- onPause?: ((...args: any[]) => any) | undefined;
51
- onPlay?: ((...args: any[]) => any) | undefined;
52
- onPlaying?: ((...args: any[]) => any) | undefined;
53
- onProgress?: ((...args: any[]) => any) | undefined;
54
- onRatechange?: ((...args: any[]) => any) | undefined;
55
- onStalled?: ((...args: any[]) => any) | undefined;
56
- onTimeupdate?: ((...args: any[]) => any) | undefined;
57
- onVolumechange?: ((...args: any[]) => any) | undefined;
58
- onWaiting?: ((...args: any[]) => any) | undefined;
59
- onMirrorChange?: ((...args: any[]) => any) | undefined;
60
- onLoopChange?: ((...args: any[]) => any) | undefined;
61
- onLightOffChange?: ((...args: any[]) => any) | undefined;
62
- }>, {
20
+ }>> & Readonly<{}>, {
63
21
  options: videoConfigType;
64
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
65
- videoPlayer: unknown;
66
- }, HTMLDivElement>;
22
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>, {
23
+ default?(_: {}): any;
24
+ }>;
67
25
  export default _default;
26
+ type __VLS_WithTemplateSlots<T, S> = T & {
27
+ new (): {
28
+ $slots: S;
29
+ };
30
+ };
@@ -1,5 +1,5 @@
1
1
  import { fileView, previewOption } from './types/filePreviewType';
2
- declare const _default: import('vue').DefineComponent<globalThis.ExtractPropTypes<{
2
+ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<globalThis.ExtractPropTypes<{
3
3
  fileList: {
4
4
  type: globalThis.PropType<fileView[]>;
5
5
  required: true;
@@ -19,5 +19,12 @@ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropType
19
19
  };
20
20
  }>> & Readonly<{}>, {
21
21
  option: previewOption;
22
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
22
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>, {
23
+ videoSlot?(_: {}): any;
24
+ }>;
23
25
  export default _default;
26
+ type __VLS_WithTemplateSlots<T, S> = T & {
27
+ new (): {
28
+ $slots: S;
29
+ };
30
+ };
@@ -15,160 +15,172 @@ export interface fileView {
15
15
  */
16
16
  extensionName: string;
17
17
  }
18
- export interface videoConfigType {
18
+ type videoSlotConfig = {
19
19
  /**
20
- * 播放器宽度,默认800px
20
+ * 是否显示视频插槽,默认false
21
21
  */
22
- width?: string;
22
+ show?: boolean;
23
23
  /**
24
- * 播放器高度,默认450px
24
+ * 视频插槽宽度,默认auto
25
25
  */
26
- height?: string;
26
+ width?: string;
27
27
  /**
28
- * 主题色,默认#409eff
28
+ * 视频插槽高度,默认auto
29
29
  */
30
- color?: string;
30
+ height?: string;
31
+ };
32
+ export type videoConfigType = {
31
33
  /**
32
34
  * 视频名称,默认空
33
35
  */
34
36
  title?: string;
35
37
  /**
36
- * 视频类型,默认video/mp4
37
- */
38
- type?: string;
39
- /**
40
- * 视频封面,默认空
41
- */
42
- poster?: string;
43
- /**
44
- * 静音,默认false
38
+ * 是否禁止快进,默认false
45
39
  */
46
- muted?: boolean;
40
+ notAllowedSeek?: boolean;
47
41
  /**
48
- * 跳转到固定播放时间(s),默认0
42
+ * 视频插槽配置
49
43
  */
50
- currentTime?: number;
44
+ videoSlot?: videoSlotConfig;
51
45
  /**
52
- * 是否支持快进快退,默认true
46
+ * 视频组件实例化完成事件
53
47
  */
54
- speed?: boolean;
55
- /**
56
- * 播放倍速,默认['0.5','0.75','1','1.25','1.5','2']
57
- */
58
- speedRate?: string[];
59
- /**
60
- * 自动播放,默认false
61
- */
62
- autoPlay?: boolean;
63
- /**
64
- * 循环播放,默认false
65
- */
66
- loop?: boolean;
48
+ onReady?: Function;
67
49
  /**
68
- * 预加载,默认auto
50
+ * 播放器创建video完成,可以开始播放
69
51
  */
70
- preload?: "none" | "meta" | "auto";
52
+ onComplete?: Function;
71
53
  /**
72
- * 镜像画面,默认false
54
+ * 播放事件,默认空
73
55
  */
74
- mirror?: boolean;
56
+ onPlay?: Function;
75
57
  /**
76
- * 关灯模式,默认false
58
+ * 暂停事件,默认空
77
59
  */
78
- ligthOff?: boolean;
60
+ onPause?: Function;
79
61
  /**
80
- * 视频音量大小,默认1
62
+ * 播放结束事件,默认空
81
63
  */
82
- volume?: number;
64
+ onEnd?: Function;
83
65
  /**
84
- * 是否显示控制条,默认true
66
+ * 错误事件,默认空
85
67
  */
86
- control?: boolean;
68
+ onError?: Function;
87
69
  /**
88
- * 控制条显示的按钮,默认['speedRate', 'volume', 'setting', 'pip', 'fullScreen']
70
+ * 时间更新事件,默认空
89
71
  */
90
- controlBtns?: ("speedRate" | "volume" | "setting" | "pip" | "fullScreen")[];
72
+ onTimeupdate?: Function;
91
73
  /**
92
- * 镜像翻转事件
74
+ * 视频封面,默认空
93
75
  */
94
- onMirrorChange?: Function;
76
+ poster?: string;
95
77
  /**
96
- * 循环播放开关事件
78
+ * 自动播放,默认false
97
79
  */
98
- onLoopChange?: Function;
80
+ autoPlay?: boolean;
99
81
  /**
100
- * 关灯模式事件
82
+ * 是否自动静音自动播放,如果autoplay为false,则该属性的作用为默认静音播放
101
83
  */
102
- onLightOffChange?: Function;
84
+ autoplayMuted?: boolean;
103
85
  /**
104
- * 客户端开始请求数据
86
+ * 是否默认初始化video,当autoplay为true时,该配置为false无效
105
87
  */
106
- onLoadstart?: Function;
88
+ videoInit?: boolean;
107
89
  /**
108
- * 客户端正在请求数据
90
+ * 初始起播时间,仅点播,默认值: 0
109
91
  */
110
- onProgress?: Function;
92
+ startTime?: number;
111
93
  /**
112
- * 请求数据时遇到错误
94
+ * seek操作结束之后播放器的状态,如果取值为auto,则维持原播放状态, 默认是seek之后直接播放
95
+ * 默认值: play; play 播放;pause 暂停; auto 保持操作前的状态
113
96
  */
114
- onError?: Function;
97
+ seekedStatus?: "pause" | "play" | "auto" | undefined;
115
98
  /**
116
- * 网速失速
99
+ * 默认起播倍速,参考值0.5/0.75/1/1.5/2
117
100
  */
118
- onStalled?: Function;
101
+ defaultPlaybackRate?: number;
119
102
  /**
120
- * 开始播放时触发
103
+ * 倍速插件显示列表,当该配置为false的时候,相当于禁用倍速切换插件,也可以传入一组配置项
104
+ * 播放倍速,默认值: [0.5, 0.75, 1, 1.5, 2]
121
105
  */
122
- onPlay?: Function;
106
+ playbackRate?: boolean | Array<number> | {};
123
107
  /**
124
- * 暂停时触发
108
+ * 是否开启快捷键,该配置项用于快捷键功能的开关
125
109
  */
126
- onPause?: Function;
110
+ keyShortcut?: boolean;
127
111
  /**
128
- * 成功获取资源长度
112
+ * 是否启用流式布局,启用流式布局时根据width、height计算播放器宽高比,若width和height不是Number类型,默认使用16:9比例
129
113
  */
130
- onLoadedmetadata?: Function;
114
+ fluid?: boolean;
131
115
  /**
132
- * 缓冲中
116
+ * 播放器容器尺寸适配方式,在视频资源初始化之后,根据获取到的videoWidth和videoHeight的比例对播放器容器宽高进行调整
117
+ * 默认值: fixed
118
+ * fixed 保持容器宽/高,不做适配
119
+ * fixWidth 保持容器宽度,适配高度
120
+ * fixHeight 保持容器高度,适配宽度
121
+ * auto 根据视频溢出宽/高,适配容器宽/高
133
122
  */
134
- onLoadeddata?: Function;
123
+ fitVideoSize?: "fixWidth" | "fixHeight" | "fixed" | undefined;
135
124
  /**
136
- * 等待数据,并非错误
125
+ * video画面填充模式
126
+ * 默认值: auto
127
+ * fillWidth 填充宽度,高度溢出则裁剪高度
128
+ * fillHeight 填充高度,宽度溢出则裁剪宽度
129
+ * fill 拉伸填充
130
+ * contain 保持宽高比,缩放至一边填满容器,另一边将添加“黑边”
131
+ * auto 默认值,同浏览器默认
137
132
  */
138
- onWaiting?: Function;
133
+ videoFillMode?: "auto" | "fill" | "fillHeight" | "fillWidth" | "cover" | "contain" | undefined;
139
134
  /**
140
- * 开始回放
135
+ * 是否启用内联播放模式,该配置项只在移动端生效,当设置了该属性为true的时候,将会在初始化video/audio的时候,设置playsinline、webkit-playsinline、x5-playsinline三个属性为true,
136
+ * iOS10以下系统safari不支持playsinline,默认播放即进入系统全屏
141
137
  */
142
- onPlaying?: Function;
138
+ playsInline?: boolean;
143
139
  /**
144
- * 暂停状态下可以播放
140
+ * 是否循环播放,默认false
145
141
  */
146
- onCanplay?: Function;
142
+ loop?: boolean;
147
143
  /**
148
- * 可以持续播放
144
+ * 播放器进度条故事点信息,具体数据结构如下
145
+ * const progressDot = [
146
+ * {
147
+ * id: 0, // 唯一标识,用于删除的时候索引
148
+ * time: 10, // 展示的时间点,例子为在播放到10s钟的时候展示
149
+ * text: 'Demo', // hover的时候展示文案,可以为空
150
+ * duration: 5, // 展示时间跨度,单位为s
151
+ * style: { // 指定样式
152
+ * backgroundColor: 'red'
153
+ * }
154
+ * },
155
+ * ...
156
+ * ]
149
157
  */
150
- onCanplaythrough?: Function;
158
+ progressDot?: Array<Record<string, any>>;
151
159
  /**
152
- * 更新播放时间
160
+ * 是否开启画面和控制栏分离模式,设置为false,控制栏将会常驻,与视频画面不重叠
153
161
  */
154
- onTimeupdate?: Function;
162
+ marginControls?: boolean;
155
163
  /**
156
- * 播放结束
164
+ * pc端: 是否单击播放器区域切换播放/暂停
165
+ * mobile端: closeVideoDblclick 为是否通关闭video的click/touchend行为切换播放暂停
166
+ * 默认值: false
157
167
  */
158
- onEnded?: Function;
168
+ closeVideoClick?: boolean;
159
169
  /**
160
- * 播放速率改变
170
+ * 视频音量大小,默认1
161
171
  */
162
- onRatechange?: Function;
172
+ volume?: number;
163
173
  /**
164
- * 资源长度改变
174
+ * pc端: 是否关闭双击播放器进入全屏的能力
175
+ * mobile端: 是否关闭双击切换暂停/播放的能力
165
176
  */
166
- onDurationchange?: Function;
177
+ closeVideoDblclick?: boolean;
167
178
  /**
168
- * 音量改变
179
+ * 用户鼠标离开播放器区域之后,控制栏隐藏延时时间,如果想要鼠标移出播放器区域就隐藏,则配置为0(只在pc端生效)
180
+ * 单位ms,默认值: 3000
169
181
  */
170
- onVolumechange?: Function;
171
- }
182
+ leavePlayerTime?: number;
183
+ };
172
184
  /**
173
185
  * @description: 文档管理中文件上传参数类型
174
186
  */
@@ -182,7 +194,7 @@ export interface previewOption {
182
194
  */
183
195
  openList?: boolean;
184
196
  /**
185
- * 自动播放视频
197
+ * 视频配置
186
198
  */
187
199
  videoConfig?: videoConfigType;
188
200
  /**
@@ -190,3 +202,4 @@ export interface previewOption {
190
202
  */
191
203
  autoplayAudio?: boolean;
192
204
  }
205
+ export {};
@@ -51,6 +51,12 @@ export declare function useUtils(): {
51
51
  * @return
52
52
  */
53
53
  checkFile(file: any, files: [], size: number, unit: string, isImage: boolean): boolean;
54
+ /**
55
+ * @description: 获取文件类型
56
+ * @param fileName
57
+ * @return
58
+ */
59
+ getFileType(fileName: string): "" | "radio" | "image" | "video" | "word" | "excel" | "ppt" | "pdf" | "txt" | "zip" | "other";
54
60
  /**
55
61
  * @description: 根据传入值获取:①对应节点所在的各级菜单的值所组成的数组(多选为二维数组)②对应节点的对象(多选为对象数组)
56
62
  * @param selectVale 级联选择器选择的值