bri-components 1.6.6 → 1.6.8
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 +1 -1
- package/src/components/controls/base/BriUpload/BriUpload.vue +293 -206
- package/src/components/controls/base/BriUpload/BriUploadImage.vue +2 -2
- package/src/components/controls/base/BriUpload/uploadList.vue +388 -413
- package/src/components/controls/mixins/cascaderMixin.js +1 -1
- package/src/components/controls/mixins/controlMixin.js +1 -1
- package/src/components/controls/mixins/dateMixin.js +1 -1
- package/src/components/controls/mixins/selectMixin.js +1 -1
- package/src/components/list/DshPage.vue +14 -13
- package/src/components/list/mixins/treeTableBaseMixin.js +1 -1
- package/src/components/other/DshVideoPlayer.vue +267 -4
- package/src/components/small/DshDropdown.vue +4 -3
- package/src/components/unit/DshFormUnit.vue +31 -6
- package/src/data/index.js +4 -2
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Page
|
|
3
|
-
:class="['DshPage',`DshPage-${mode}`,
|
|
3
|
+
:class="['DshPage',`DshPage-${mode}`, selfPropsObj.class]"
|
|
4
4
|
:total="total"
|
|
5
|
-
:current="
|
|
6
|
-
:page-size="
|
|
7
|
-
:page-size-opts="
|
|
8
|
-
:placement="
|
|
5
|
+
:current="selfPropsObj.page"
|
|
6
|
+
:page-size="selfPropsObj.pagesize"
|
|
7
|
+
:page-size-opts="selfPropsObj.pagesizeOpts"
|
|
8
|
+
:placement="selfPropsObj.placement"
|
|
9
9
|
:size="size"
|
|
10
10
|
:simple="simple"
|
|
11
|
-
:show-total="
|
|
12
|
-
:show-elevator="
|
|
13
|
-
:show-sizer="
|
|
14
|
-
:transfer="
|
|
15
|
-
:prev-text="
|
|
16
|
-
:next-text="
|
|
17
|
-
:disabled="
|
|
11
|
+
:show-total="selfPropsObj.showTotal"
|
|
12
|
+
:show-elevator="selfPropsObj.showElevator"
|
|
13
|
+
:show-sizer="selfPropsObj.showSizer"
|
|
14
|
+
:transfer="selfPropsObj.transfer"
|
|
15
|
+
:prev-text="selfPropsObj.prevText"
|
|
16
|
+
:next-text="selfPropsObj.nextText"
|
|
17
|
+
:disabled="selfPropsObj.disabled"
|
|
18
18
|
@on-change="changePage"
|
|
19
19
|
@on-page-size-change="changePageSize"
|
|
20
20
|
>
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
return {};
|
|
49
49
|
},
|
|
50
50
|
computed: {
|
|
51
|
-
|
|
51
|
+
selfPropsObj () {
|
|
52
52
|
const modeMap = {
|
|
53
53
|
default: {
|
|
54
54
|
showTotal: true,
|
|
@@ -75,6 +75,7 @@
|
|
|
75
75
|
transfer: false,
|
|
76
76
|
placement: "bottom",
|
|
77
77
|
...(modeMap[this.mode] || {}),
|
|
78
|
+
|
|
78
79
|
...this.propsObj
|
|
79
80
|
};
|
|
80
81
|
},
|
|
@@ -54,6 +54,241 @@
|
|
|
54
54
|
import "video.js/dist/video-js.css";
|
|
55
55
|
import "videojs-contrib-hls"; // 播放hls流插件
|
|
56
56
|
|
|
57
|
+
// 在插件中添加
|
|
58
|
+
videojs.addLanguage("zh", {
|
|
59
|
+
// 播放控制
|
|
60
|
+
"Play": "播放",
|
|
61
|
+
"Pause": "暂停",
|
|
62
|
+
"Replay": "重新播放",
|
|
63
|
+
"Play Video": "播放视频",
|
|
64
|
+
"Play Previous Video": "播放上一个视频",
|
|
65
|
+
"Play Next Video": "播放下一个视频",
|
|
66
|
+
|
|
67
|
+
// 音量控制
|
|
68
|
+
"Mute": "静音",
|
|
69
|
+
"Unmute": "取消静音",
|
|
70
|
+
"Volume Level": "音量级别",
|
|
71
|
+
"Mute Volume": "静音",
|
|
72
|
+
"Unmute Volume": "取消静音",
|
|
73
|
+
|
|
74
|
+
// 全屏控制
|
|
75
|
+
"Fullscreen": "全屏",
|
|
76
|
+
"Exit Fullscreen": "退出全屏",
|
|
77
|
+
"Non-Fullscreen": "非全屏模式",
|
|
78
|
+
"Toggle Fullscreen": "切换全屏",
|
|
79
|
+
|
|
80
|
+
// 播放速度
|
|
81
|
+
"Playback Rate": "播放速度",
|
|
82
|
+
"Slow Motion": "慢动作",
|
|
83
|
+
"Normal": "正常速度",
|
|
84
|
+
|
|
85
|
+
// 字幕/字幕
|
|
86
|
+
"Subtitles": "字幕",
|
|
87
|
+
"Captions": "字幕",
|
|
88
|
+
"Descriptions": "描述",
|
|
89
|
+
"Chapters": "章节",
|
|
90
|
+
"Subtitles off": "关闭字幕",
|
|
91
|
+
"Captions off": "关闭字幕",
|
|
92
|
+
"Descriptions off": "关闭描述",
|
|
93
|
+
"Chapters off": "关闭章节",
|
|
94
|
+
|
|
95
|
+
// 质量设置
|
|
96
|
+
"Quality": "画质",
|
|
97
|
+
"Quality Levels": "质量级别",
|
|
98
|
+
"Auto": "自动",
|
|
99
|
+
"High Definition": "高清",
|
|
100
|
+
"Standard Definition": "标清",
|
|
101
|
+
"Low Definition": "低清",
|
|
102
|
+
|
|
103
|
+
// 音频轨道
|
|
104
|
+
"Audio Track": "音轨",
|
|
105
|
+
"Audio Player": "音频播放器",
|
|
106
|
+
"Video Player": "视频播放器",
|
|
107
|
+
|
|
108
|
+
// 时间显示
|
|
109
|
+
"Current Time": "当前时间",
|
|
110
|
+
"Duration Time": "总时长",
|
|
111
|
+
"Remaining Time": "剩余时间",
|
|
112
|
+
"Stream Type": "流类型",
|
|
113
|
+
"LIVE": "直播",
|
|
114
|
+
"Seek to live, currently behind live": "跳转到直播点,当前落后于直播",
|
|
115
|
+
"Seek to live, currently playing live": "跳转到直播点,当前正在直播",
|
|
116
|
+
|
|
117
|
+
// 进度相关
|
|
118
|
+
"Progress": "进度",
|
|
119
|
+
"Progress Bar": "进度条",
|
|
120
|
+
"Loaded": "已加载",
|
|
121
|
+
"Progress:": "进度:",
|
|
122
|
+
|
|
123
|
+
// 播放列表
|
|
124
|
+
"Playlist": "播放列表",
|
|
125
|
+
"Playlist Menu": "播放列表菜单",
|
|
126
|
+
"Playlist Player": "播放列表播放器",
|
|
127
|
+
|
|
128
|
+
// 其他控件
|
|
129
|
+
"Picture-in-Picture": "画中画",
|
|
130
|
+
"Exit Picture-in-Picture": "退出画中画",
|
|
131
|
+
"Disabled": "已禁用",
|
|
132
|
+
"Enabled": "已启用",
|
|
133
|
+
"Reset": "重置",
|
|
134
|
+
"Restore all player settings": "恢复所有播放器设置",
|
|
135
|
+
|
|
136
|
+
// 图标描述
|
|
137
|
+
"Audio Description": "音频描述",
|
|
138
|
+
"Background": "背景",
|
|
139
|
+
"Described Video": "描述性视频",
|
|
140
|
+
|
|
141
|
+
// MEDIA_ERR_ABORTED (1) - 播放被中止
|
|
142
|
+
"You aborted the media playback": "您中止了媒体播放",
|
|
143
|
+
"The video playback was aborted.": "视频播放被中止。",
|
|
144
|
+
"The media playback was aborted.": "媒体播放被中止。",
|
|
145
|
+
"The operation was aborted by the user.": "操作被用户中止。",
|
|
146
|
+
|
|
147
|
+
// MEDIA_ERR_NETWORK (2) - 网络错误
|
|
148
|
+
"A network error caused the media download to fail part-way.": "网络错误导致媒体下载中途失败。",
|
|
149
|
+
"A network error caused the video download to fail part-way.": "网络错误导致视频下载中途失败。",
|
|
150
|
+
"A network error occurred.": "发生网络错误。",
|
|
151
|
+
"Network error.": "网络错误。",
|
|
152
|
+
"The network connection was lost.": "网络连接已丢失。",
|
|
153
|
+
"A network error caused the download to fail.": "网络错误导致下载失败。",
|
|
154
|
+
|
|
155
|
+
// MEDIA_ERR_DECODE (3) - 解码错误
|
|
156
|
+
"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":
|
|
157
|
+
"媒体播放因数据损坏问题或浏览器不支持的特性而中止。",
|
|
158
|
+
"The video playback was aborted due to a corruption problem or because the video used features your browser did not support.":
|
|
159
|
+
"视频播放因数据损坏问题或浏览器不支持的特性而中止。",
|
|
160
|
+
"Error decoding media.": "媒体解码错误。",
|
|
161
|
+
"The media could not be decoded.": "媒体无法解码。",
|
|
162
|
+
"Decoding error.": "解码错误。",
|
|
163
|
+
"The video format is not supported by your browser.": "浏览器不支持该视频格式。",
|
|
164
|
+
"Unsupported codec.": "不支持的编解码器。",
|
|
165
|
+
|
|
166
|
+
// MEDIA_ERR_SRC_NOT_SUPPORTED (4) - 源不支持
|
|
167
|
+
"The media could not be loaded, either because the server or network failed or because the format is not supported.":
|
|
168
|
+
"媒体无法加载,可能是因为服务器或网络故障,或者格式不受支持。",
|
|
169
|
+
"The video could not be loaded, either because the server or network failed or because the format is not supported.":
|
|
170
|
+
"视频无法加载,可能是因为服务器或网络故障,或者格式不受支持。",
|
|
171
|
+
"No compatible source was found for this media.": "找不到兼容的媒体源。",
|
|
172
|
+
"No compatible source was found for this video.": "找不到兼容的视频源。",
|
|
173
|
+
"The media format is not supported.": "媒体格式不受支持。",
|
|
174
|
+
"Unsupported media type.": "不支持的媒体类型。",
|
|
175
|
+
|
|
176
|
+
// ==================== 自定义和扩展错误 ====================
|
|
177
|
+
// 源文件相关错误
|
|
178
|
+
"The video could not be found.": "找不到视频文件。",
|
|
179
|
+
"The media could not be found.": "找不到媒体文件。",
|
|
180
|
+
"The video is not available.": "视频不可用。",
|
|
181
|
+
"The media is not available.": "媒体不可用。",
|
|
182
|
+
"The video has been removed or deleted.": "视频已被移除或删除。",
|
|
183
|
+
"The media has been removed or deleted.": "媒体已被移除或删除。",
|
|
184
|
+
"The video file is corrupted.": "视频文件已损坏。",
|
|
185
|
+
"The media file is corrupted.": "媒体文件已损坏。",
|
|
186
|
+
|
|
187
|
+
// 加密和DRM错误
|
|
188
|
+
"The video is encrypted and we do not have the keys to decrypt it.": "视频已加密,没有解密密钥。",
|
|
189
|
+
"The media is encrypted and we do not have the keys to decrypt it.": "媒体已加密,没有解密密钥。",
|
|
190
|
+
"The decryption key for this video is not available.": "视频的解密密钥不可用。",
|
|
191
|
+
"The decryption key for this media is not available.": "媒体的解密密钥不可用。",
|
|
192
|
+
"DRM protection error.": "DRM保护错误。",
|
|
193
|
+
"Content decryption failed.": "内容解密失败。",
|
|
194
|
+
"License acquisition failed.": "许可证获取失败。",
|
|
195
|
+
|
|
196
|
+
// 权限和访问错误
|
|
197
|
+
"You may not have permissions to view this video.": "您可能没有权限查看此视频。",
|
|
198
|
+
"You may not have permissions to view this media.": "您可能没有权限查看此媒体。",
|
|
199
|
+
"Access to the video was denied.": "访问视频被拒绝。",
|
|
200
|
+
"Access to the media was denied.": "访问媒体被拒绝。",
|
|
201
|
+
"Cross-origin resource sharing (CORS) error.": "跨域资源共享(CORS)错误。",
|
|
202
|
+
"CORS policy prevented access to the resource.": "CORS策略阻止了资源访问。",
|
|
203
|
+
|
|
204
|
+
// 流媒体相关错误
|
|
205
|
+
"The live stream is not available.": "直播流不可用。",
|
|
206
|
+
"The live stream has ended.": "直播流已结束。",
|
|
207
|
+
"Failed to load the live stream.": "加载直播流失败。",
|
|
208
|
+
"The stream could not be processed.": "流无法处理。",
|
|
209
|
+
"HLS stream error.": "HLS流错误。",
|
|
210
|
+
"DASH stream error.": "DASH流错误。",
|
|
211
|
+
|
|
212
|
+
// 浏览器和环境错误
|
|
213
|
+
"Your browser does not support HTML5 video.": "您的浏览器不支持HTML5视频。",
|
|
214
|
+
"Your browser does not support the video codec.": "您的浏览器不支持视频编解码器。",
|
|
215
|
+
"Insufficient system resources.": "系统资源不足。",
|
|
216
|
+
"Hardware acceleration is not available.": "硬件加速不可用。",
|
|
217
|
+
|
|
218
|
+
// 超时错误
|
|
219
|
+
"The request timed out.": "请求超时。",
|
|
220
|
+
"The media load timed out.": "媒体加载超时。",
|
|
221
|
+
"Connection timed out.": "连接超时。",
|
|
222
|
+
|
|
223
|
+
// 通用错误
|
|
224
|
+
"An unknown error occurred.": "发生未知错误。",
|
|
225
|
+
"An error occurred while trying to play the media.": "尝试播放媒体时发生错误。",
|
|
226
|
+
"An error occurred while trying to play the video.": "尝试播放视频时发生错误。",
|
|
227
|
+
"The video failed to load.": "视频加载失败。",
|
|
228
|
+
"The media failed to load.": "媒体加载失败。",
|
|
229
|
+
"Playback failed.": "播放失败。",
|
|
230
|
+
"Could not initialize the player.": "无法初始化播放器。",
|
|
231
|
+
|
|
232
|
+
// 状态相关错误
|
|
233
|
+
"The player is not ready.": "播放器未就绪。",
|
|
234
|
+
"The media is not ready for playback.": "媒体未准备好播放。",
|
|
235
|
+
"Invalid player state.": "无效的播放器状态。",
|
|
236
|
+
|
|
237
|
+
// 网络错误
|
|
238
|
+
"The video is not accessible.": "视频无法访问。",
|
|
239
|
+
|
|
240
|
+
// 格式错误
|
|
241
|
+
"The video format is not supported.": "视频格式不支持。",
|
|
242
|
+
"The video is encoded in a way that is not supported.": "视频编码方式不支持。",
|
|
243
|
+
|
|
244
|
+
// 播放错误
|
|
245
|
+
"A network error caused the video download to fail.": "网络错误导致视频下载失败。",
|
|
246
|
+
"The video playback was aborted due to a corruption problem.": "视频播放因数据损坏问题而中止。",
|
|
247
|
+
"The video used features your browser did not support.": "视频使用了浏览器不支持的特性。",
|
|
248
|
+
|
|
249
|
+
// 源错误
|
|
250
|
+
"This video is either unavailable or not supported in this browser.": "视频不可用或在此浏览器中不受支持。",
|
|
251
|
+
|
|
252
|
+
// 通用错误
|
|
253
|
+
"An error occurred. Please try again later.": "发生错误,请稍后重试。",
|
|
254
|
+
"The video could not be processed.": "视频无法处理。"
|
|
255
|
+
});
|
|
256
|
+
// const registerPlugin = function () {
|
|
257
|
+
// const ChineseTipsPlugin = function (options) {
|
|
258
|
+
// // 自定义控制栏提示文本(中英文对照)
|
|
259
|
+
// const controlTextMap = {
|
|
260
|
+
// };
|
|
261
|
+
|
|
262
|
+
// // 自定义错误消息(中英文对照)
|
|
263
|
+
// const errorMessageMap = {
|
|
264
|
+
// };
|
|
265
|
+
|
|
266
|
+
// // 修改控制栏文本
|
|
267
|
+
// this.ready(() => {
|
|
268
|
+
// const controlBar = this.controlBar;
|
|
269
|
+
// Object.keys(controlTextMap).forEach(key => {
|
|
270
|
+
// const component = controlBar.getChild(key);
|
|
271
|
+
// if (component) {
|
|
272
|
+
// component.controlText(controlTextMap[key]);
|
|
273
|
+
// }
|
|
274
|
+
// });
|
|
275
|
+
// });
|
|
276
|
+
|
|
277
|
+
// // 覆盖错误处理器
|
|
278
|
+
// const originalError = this.error;
|
|
279
|
+
// this.error = function (err) {
|
|
280
|
+
// if (err && err.message && errorMessageMap[err.message]) {
|
|
281
|
+
// err.message = errorMessageMap[err.message];
|
|
282
|
+
// }
|
|
283
|
+
// return originalError.call(this, err);
|
|
284
|
+
// };
|
|
285
|
+
// };
|
|
286
|
+
|
|
287
|
+
// // 注册插件
|
|
288
|
+
// videojs.registerPlugin("chineseTips", ChineseTipsPlugin);
|
|
289
|
+
// };
|
|
290
|
+
// registerPlugin();
|
|
291
|
+
|
|
57
292
|
export default {
|
|
58
293
|
name: "DshVideoPlayer",
|
|
59
294
|
props: {
|
|
@@ -89,17 +324,23 @@
|
|
|
89
324
|
},
|
|
90
325
|
finalOptions () {
|
|
91
326
|
return {
|
|
327
|
+
language: "zh",
|
|
92
328
|
autoplay: false, // 设置自动播放
|
|
93
|
-
|
|
329
|
+
controls: true, // 显示播放的控件
|
|
330
|
+
fluid: true,
|
|
331
|
+
liveui: true,
|
|
94
332
|
sources: [
|
|
95
333
|
{
|
|
96
334
|
// src: this.src || this.attachmentLink, // 地址
|
|
97
|
-
src: this.src, // 地址
|
|
335
|
+
src: this.src.replace("21", "0"), // 地址
|
|
98
336
|
type: this.sourceType
|
|
99
337
|
}
|
|
100
338
|
],
|
|
101
|
-
|
|
102
|
-
|
|
339
|
+
controlBar: {
|
|
340
|
+
volumePanel: {
|
|
341
|
+
inline: false
|
|
342
|
+
}
|
|
343
|
+
},
|
|
103
344
|
html5: {
|
|
104
345
|
hls: {
|
|
105
346
|
overrideNative: true,
|
|
@@ -150,6 +391,28 @@
|
|
|
150
391
|
initPlayer () {
|
|
151
392
|
this.player = videojs(this.$refs.videoPlayer, this.finalOptions, this.onPlayerReady);
|
|
152
393
|
// this.player = videojs("videoPlayer", this.finalOptions, this.onPlayerReady);
|
|
394
|
+
|
|
395
|
+
// this.player.language("zh"); // 切换到中文
|
|
396
|
+
// this.player.language("en"); // 切换回英文
|
|
397
|
+
|
|
398
|
+
// // 应用汉字提示插件
|
|
399
|
+
// this.player.chineseTips();
|
|
400
|
+
|
|
401
|
+
// this.player.addTextTrack({
|
|
402
|
+
// kind: "subtitles",
|
|
403
|
+
// srclang: "en",
|
|
404
|
+
// src: "", // 实际使用时需要提供有效的字幕文件URL
|
|
405
|
+
// label: "English",
|
|
406
|
+
// mode: "disabled"
|
|
407
|
+
// });
|
|
408
|
+
|
|
409
|
+
// // 添加字幕轨道(示例)
|
|
410
|
+
// this.player.addTextTrack({
|
|
411
|
+
// kind: "subtitles",
|
|
412
|
+
// srclang: "zh",
|
|
413
|
+
// label: "中文",
|
|
414
|
+
// src: "/path/to/subtitles.vtt" // 替换为实际字幕文件路径
|
|
415
|
+
// });
|
|
153
416
|
},
|
|
154
417
|
onPlayerReady () {
|
|
155
418
|
// console.log("Player ready", this.finalOptions);
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
<!-- 下拉面板 -->
|
|
20
20
|
<div
|
|
21
21
|
v-if="list.length"
|
|
22
|
+
ref="listPanelDom"
|
|
22
23
|
slot="list"
|
|
23
24
|
:class="['DshDropdown-list', menuClass]"
|
|
24
25
|
>
|
|
@@ -51,9 +52,9 @@
|
|
|
51
52
|
v-for="(dropdownItem, dropdownIndex) in showList"
|
|
52
53
|
:key="dropdownItem._id || dropdownItem._key || dropdownItem.type"
|
|
53
54
|
:class="{
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
'list-item': true,
|
|
56
|
+
'list-item-disabled': dropdownItem.disabled
|
|
57
|
+
}"
|
|
57
58
|
:name="dropdownItem.name"
|
|
58
59
|
:disabled="dropdownItem.disabled"
|
|
59
60
|
:divided="dropdownItem.divided"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
+
ref="formUnit"
|
|
3
4
|
:class="[
|
|
4
5
|
{
|
|
5
6
|
'DshFormUnit': true,
|
|
@@ -62,17 +63,20 @@
|
|
|
62
63
|
</div>
|
|
63
64
|
|
|
64
65
|
<!-- 控件 -->
|
|
65
|
-
<div class="
|
|
66
|
+
<div :class="{
|
|
67
|
+
'DshFormUnit-control': true,
|
|
68
|
+
'DshFormUnit-control-full': !!formItem._aspectRatio
|
|
69
|
+
}">
|
|
66
70
|
<!-- 控件位置放置的dom -->
|
|
67
71
|
<slot name="control"></slot>
|
|
68
72
|
|
|
69
73
|
<slot>
|
|
70
74
|
<component
|
|
75
|
+
ref="control"
|
|
71
76
|
class="DshFormUnit-control-component"
|
|
72
77
|
:style="{
|
|
73
78
|
'text-align': formItem._lineAlign
|
|
74
79
|
}"
|
|
75
|
-
ref="control"
|
|
76
80
|
:is="curComponentName"
|
|
77
81
|
:canEdit="canEdit"
|
|
78
82
|
:value="formData"
|
|
@@ -125,6 +129,7 @@
|
|
|
125
129
|
},
|
|
126
130
|
data () {
|
|
127
131
|
return {
|
|
132
|
+
unitWidth: 20,
|
|
128
133
|
showTipModal: false // tipsRender使用,不可删除
|
|
129
134
|
};
|
|
130
135
|
},
|
|
@@ -134,10 +139,12 @@
|
|
|
134
139
|
width: `calc(${(this.formItem._br && this.formItem._span ? this.formItem._span / 24 : 1) * 100}% - 12px)`,
|
|
135
140
|
height: this.formItem._formHeight
|
|
136
141
|
? `${this.formItem._formHeight}px`
|
|
137
|
-
:
|
|
138
|
-
?
|
|
139
|
-
:
|
|
140
|
-
|
|
142
|
+
: this.formItem._aspectRatio // 高宽比
|
|
143
|
+
? `${(this.unitWidth - 20) * this.formItem._aspectRatio / 100 + 30 + 10}px`
|
|
144
|
+
: (this.formItem._br || [undefined, 0, 24].includes(this.formItem._span)
|
|
145
|
+
? undefined
|
|
146
|
+
: `${this.height - (this.canEdit ? 0 : 10)}px`// 去掉下padding
|
|
147
|
+
),
|
|
141
148
|
minHeight: "42px",
|
|
142
149
|
paddingBottom: this.canEdit ? undefined : "0px", // 详情查看页时,不要上下的padding,为了美观
|
|
143
150
|
|
|
@@ -146,12 +153,26 @@
|
|
|
146
153
|
}
|
|
147
154
|
},
|
|
148
155
|
created () {},
|
|
156
|
+
mounted () {
|
|
157
|
+
this.formItem._aspectRatio && this.getUnitWidth();
|
|
158
|
+
this.formItem._aspectRatio && window.addEventListener("resize", this.getUnitWidth, true);
|
|
159
|
+
},
|
|
160
|
+
destroyed () {
|
|
161
|
+
this.formItem._aspectRatio && window.removeEventListener("resize", this.getUnitWidth, true);
|
|
162
|
+
},
|
|
149
163
|
methods: {
|
|
150
164
|
// 校验方法 -供外部使用
|
|
151
165
|
validate () {
|
|
152
166
|
return !this.$refs.control.validate || this.$refs.control.validate();
|
|
153
167
|
},
|
|
154
168
|
|
|
169
|
+
// 获取本组件的width
|
|
170
|
+
getUnitWidth () {
|
|
171
|
+
this.unitWidth = this.$el.offsetWidth;
|
|
172
|
+
// this.unitWidth = this.$el.clientWidth;
|
|
173
|
+
// this.unitWidth = this.$refs.formUnit.offsetWidth;
|
|
174
|
+
// this.unitWidth = this.$refs.formUnit.clientWidth;
|
|
175
|
+
},
|
|
155
176
|
changeField (...params) {
|
|
156
177
|
this.$emit("changeField", ...params);
|
|
157
178
|
},
|
|
@@ -304,6 +325,10 @@
|
|
|
304
325
|
&-component {
|
|
305
326
|
|
|
306
327
|
}
|
|
328
|
+
|
|
329
|
+
&-full {
|
|
330
|
+
height: calc(100% - 30px);
|
|
331
|
+
}
|
|
307
332
|
}
|
|
308
333
|
|
|
309
334
|
&-type {
|