@fengzhongwen/kukan-ui 1.0.14 → 1.0.16
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/dist/kukan-ui.common.js
CHANGED
|
@@ -99,6 +99,17 @@ module.exports =
|
|
|
99
99
|
|
|
100
100
|
// extracted by mini-css-extract-plugin
|
|
101
101
|
|
|
102
|
+
/***/ }),
|
|
103
|
+
|
|
104
|
+
/***/ "5d9e":
|
|
105
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
106
|
+
|
|
107
|
+
"use strict";
|
|
108
|
+
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_419a04c7_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("9136");
|
|
109
|
+
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_419a04c7_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_419a04c7_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
|
|
110
|
+
/* unused harmony reexport * */
|
|
111
|
+
|
|
112
|
+
|
|
102
113
|
/***/ }),
|
|
103
114
|
|
|
104
115
|
/***/ "69a0":
|
|
@@ -865,6 +876,13 @@ module.exports =
|
|
|
865
876
|
/* unused harmony reexport * */
|
|
866
877
|
|
|
867
878
|
|
|
879
|
+
/***/ }),
|
|
880
|
+
|
|
881
|
+
/***/ "9136":
|
|
882
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
883
|
+
|
|
884
|
+
// extracted by mini-css-extract-plugin
|
|
885
|
+
|
|
868
886
|
/***/ }),
|
|
869
887
|
|
|
870
888
|
/***/ "fb15":
|
|
@@ -1050,7 +1068,7 @@ function addNewFileOfSubTitle(data, url) {
|
|
|
1050
1068
|
});
|
|
1051
1069
|
}
|
|
1052
1070
|
|
|
1053
|
-
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"
|
|
1071
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"0c625dac-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/FileUpload/index.vue?vue&type=template&id=7674a44a&scoped=true
|
|
1054
1072
|
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"upload-multiple"},[_c('input',{ref:"multiplePloadInput",staticStyle:{"display":"none"},attrs:{"type":"file","multiple":_vm.multiple,"accept":_vm.limitFileType},on:{"change":_vm.handleSelectedMultipleFiles}}),_c('div',{staticClass:"upload-multiple-box"},[_c('div',{ref:"upLoded_box",staticClass:"multiple_upload_area",class:_vm.multipleUploadAreaClass(),on:{"click":_vm.reviewUploadMultipleFiles,"dragover":function($event){$event.preventDefault();return _vm.onDragOver($event)},"dragleave":function($event){$event.preventDefault();return _vm.onDragLeave($event)},"drop":function($event){$event.preventDefault();return _vm.onDrop($event)}}},[(_vm.isUploading)?_c('div',{staticClass:"upload-loading-mask",style:(_vm.setUploadingLoadingMaskStyle())}):_vm._e(),(_vm.showIconTip)?_c('div',[_c('i',{staticClass:"el-icon-upload"})]):_vm._e(),_c('div',[_vm._v(_vm._s(_vm.startButtonText))]),_vm._t("tips")],2),(_vm.pictureConfig.show && _vm.showSuccessPicture)?_c('div',{staticClass:"upload-multiple-box-right"},[_c('div',{staticClass:"upload-multiple-box-close",on:{"click":function($event){$event.stopPropagation();return _vm.clearPicture($event)}}},[_c('i',{staticClass:"el-icon-close"})]),_c('img',{attrs:{"src":_vm.pictureConfig.url,"alt":_vm.pictureConfig.altText}})]):_vm._e()]),(_vm.isShowAllUploadButton)?_c('el-button',{staticClass:"upload_button",attrs:{"type":"primary","disabled":_vm.isUploading || _vm.needUploadFilesArr.length === 0},on:{"click":_vm.startUploadMultipleFiles}},[_vm._v(" 全部文件开始上传 ")]):_vm._e(),(_vm.model === 'info')?_c('div',{staticClass:"multiple_upload_list"},[_c('span',{staticClass:"tip_title"},[_c('span',{staticClass:"title"},[_c('div',[_vm._v("文件列表")]),_c('transition',{attrs:{"name":"totalProgress","mode":"out-in"}},[(_vm.needUploadFilesArr.length > 0)?_c('div',{staticClass:"total_progress"},[_c('div',{staticClass:"logo"}),_c('span',[_vm._v("总进度:")]),(_vm.fileConfig.uploadController)?_c('div',[_c('el-tag',{attrs:{"size":"mini","type":_vm.isDanger}},[_vm._v("上传错误:"+_vm._s(_vm.fileConfig.skipError_num))]),_c('el-tag',{attrs:{"size":"mini","type":""}},[_vm._v("上传成功:"+_vm._s(_vm.fileConfig.completed_num))]),_c('el-tag',{attrs:{"size":"mini","type":""}},[_vm._v("文件总数:"+_vm._s(_vm.fileConfig.filetotal_num))])],1):_vm._e()]):_vm._e()])],1),_c('span',[_c('el-button',{attrs:{"size":"mini","type":"","disabled":_vm.isUploading || _vm.needUploadFilesArr.length === 0},on:{"click":_vm.handleSelectAllFile}},[_vm._v("全选所有文件")]),_c('el-button',{attrs:{"size":"mini","type":"danger","disabled":_vm.isUploading || _vm.needUploadFilesArr.length === 0},on:{"click":_vm.delteSelectedFile}},[_vm._v("移除所选文件")])],1)]),_c('div',{staticClass:"selected_list_area"},[(_vm.needUploadFilesArr.length > 0)?_c('div',{staticClass:"selected_list"},_vm._l((_vm.needUploadFilesArr),function(item,index){return _c('Card_2',{key:index,attrs:{"index":index,"file-config":item},on:{"cancelFileUpload":_vm.cancelFileUpload,"resetFileUpload":_vm.resetFileUpload,"handleClickOnlyFile":_vm.handleClickOnlyFile}})}),1):_c('div',{staticClass:"no_file"},[_c('i',{staticClass:"el-icon-document"}),_c('div',[_vm._v("暂无文件,请点击或拖拽文件到上传区域")])])])]):_vm._e()],1)}
|
|
1055
1073
|
var staticRenderFns = []
|
|
1056
1074
|
|
|
@@ -1130,7 +1148,7 @@ const fileTypeValidators = {
|
|
|
1130
1148
|
// return /^(presentation))|text\/(plain|html|csv|xml|css|javascript|markdown))$/i.test(mime);
|
|
1131
1149
|
},
|
|
1132
1150
|
};
|
|
1133
|
-
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"
|
|
1151
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"0c625dac-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/FileUpload/components/UploadCard_Ver_Second/index.vue?vue&type=template&id=cdec1cec&scoped=true
|
|
1134
1152
|
var UploadCard_Ver_Secondvue_type_template_id_cdec1cec_scoped_true_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{key:_vm.fileConfig.name + '_' + _vm.index,staticClass:"only_file_area",class:{
|
|
1135
1153
|
only_file_area_isActive: _vm.fileConfig.isSelected,
|
|
1136
1154
|
'fade-in-element': true,
|
|
@@ -3414,27 +3432,331 @@ FileUpload.install = function(Vue) {
|
|
|
3414
3432
|
};
|
|
3415
3433
|
|
|
3416
3434
|
/* harmony default export */ var components_FileUpload = (FileUpload);
|
|
3435
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"0c625dac-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/VideoPreviewDialog/index.vue?vue&type=template&id=419a04c7&scoped=true
|
|
3436
|
+
var VideoPreviewDialogvue_type_template_id_419a04c7_scoped_true_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('el-dialog',{attrs:{"visible":_vm.dialogVisible,"show-close":false,"modal":true,"width":_vm.width,"top":_vm.topMargin,"custom-class":"modern-video-review-dialog","append-to-body":"","before-close":_vm.closePreview},on:{"update:visible":function($event){_vm.dialogVisible=$event},"opened":_vm.onOpened}},[_c('div',{staticClass:"video-review-container",style:({ height: _vm.height }),on:{"mousemove":_vm.onDrag,"mouseup":_vm.stopDrag,"mouseleave":_vm.stopDrag}},[_c('div',{staticClass:"video-review-header"},[_c('div',{staticClass:"file-info"},[_c('span',{staticClass:"file-name",attrs:{"title":_vm.fileName}},[_vm._v(_vm._s(_vm.fileName || "视频预览"))]),(!_vm.loading && !_vm.loadError && _vm.videoWidth)?_c('span',{staticClass:"file-size"},[_vm._v(" "+_vm._s(_vm.videoWidth)+" × "+_vm._s(_vm.videoHeight)+" px | "+_vm._s(_vm.duration)+" ")]):_vm._e()]),_c('div',{staticClass:"video-review-controls"},[_c('button',{staticClass:"control-icon-btn",attrs:{"disabled":_vm.scale <= _vm.minScale},on:{"click":_vm.zoomOut}},[_c('i',{staticClass:"el-icon-zoom-out"})]),_c('span',{staticClass:"zoom-display"},[_vm._v(_vm._s(Math.round(_vm.scale * 100))+"%")]),_c('button',{staticClass:"control-icon-btn",attrs:{"disabled":_vm.scale >= _vm.maxScale},on:{"click":_vm.zoomIn}},[_c('i',{staticClass:"el-icon-zoom-in"})]),_c('div',{staticClass:"control-divider"}),_c('button',{staticClass:"control-icon-btn",attrs:{"title":"原始尺寸/重置位置"},on:{"click":_vm.resetZoom}},[_c('i',{staticClass:"el-icon-refresh-right"})]),_c('button',{staticClass:"control-icon-btn close-btn",on:{"click":_vm.closePreview}},[_c('i',{staticClass:"el-icon-close"})])])]),_c('div',{staticClass:"video-review-content",on:{"wheel":function($event){$event.preventDefault();return _vm.handleWheel($event)},"mousedown":function($event){if($event.target !== $event.currentTarget){ return null; }return _vm.startDrag($event)},"!click":function($event){return _vm.handleCaptureClick($event)}}},[_c('transition',{attrs:{"name":"fade"}},[(_vm.loading && !_vm.loadError)?_c('div',{staticClass:"status-overlay"},[_c('i',{staticClass:"el-icon-loading"}),_c('p',[_vm._v("视频加载中...")])]):_vm._e()]),(_vm.loadError)?_c('div',{staticClass:"status-overlay error"},[_c('i',{staticClass:"el-icon-video-camera"}),_c('p',[_vm._v("视频加载失败")])]):_vm._e(),_c('div',{directives:[{name:"show",rawName:"v-show",value:(!_vm.loading && !_vm.loadError),expression:"!loading && !loadError"}],staticClass:"video-transform-wrapper",style:(_vm.videoStyle),on:{"mousedown":_vm.startDrag}},[(_vm.videoUrl)?_c('video',{key:_vm.videoUrl,ref:"videoPlayer",staticClass:"main-preview-video",attrs:{"src":_vm.videoUrl,"autoplay":"","muted":"","loop":"","playsinline":"","controls":""},domProps:{"muted":true},on:{"loadedmetadata":_vm.onMetadataLoad,"error":_vm.onVideoError,"canplay":_vm.onCanPlay}}):_vm._e()])],1),_c('div',{staticClass:"video-review-hint"},[_c('span',[_vm._v("鼠标拖拽背景移动,滚轮缩放查看细节")])])])])}
|
|
3437
|
+
var VideoPreviewDialogvue_type_template_id_419a04c7_scoped_true_staticRenderFns = []
|
|
3438
|
+
|
|
3439
|
+
|
|
3440
|
+
// CONCATENATED MODULE: ./src/components/VideoPreviewDialog/index.vue?vue&type=template&id=419a04c7&scoped=true
|
|
3441
|
+
|
|
3442
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/VideoPreviewDialog/index.vue?vue&type=script&lang=js
|
|
3443
|
+
//
|
|
3444
|
+
//
|
|
3445
|
+
//
|
|
3446
|
+
//
|
|
3447
|
+
//
|
|
3448
|
+
//
|
|
3449
|
+
//
|
|
3450
|
+
//
|
|
3451
|
+
//
|
|
3452
|
+
//
|
|
3453
|
+
//
|
|
3454
|
+
//
|
|
3455
|
+
//
|
|
3456
|
+
//
|
|
3457
|
+
//
|
|
3458
|
+
//
|
|
3459
|
+
//
|
|
3460
|
+
//
|
|
3461
|
+
//
|
|
3462
|
+
//
|
|
3463
|
+
//
|
|
3464
|
+
//
|
|
3465
|
+
//
|
|
3466
|
+
//
|
|
3467
|
+
//
|
|
3468
|
+
//
|
|
3469
|
+
//
|
|
3470
|
+
//
|
|
3471
|
+
//
|
|
3472
|
+
//
|
|
3473
|
+
//
|
|
3474
|
+
//
|
|
3475
|
+
//
|
|
3476
|
+
//
|
|
3477
|
+
//
|
|
3478
|
+
//
|
|
3479
|
+
//
|
|
3480
|
+
//
|
|
3481
|
+
//
|
|
3482
|
+
//
|
|
3483
|
+
//
|
|
3484
|
+
//
|
|
3485
|
+
//
|
|
3486
|
+
//
|
|
3487
|
+
//
|
|
3488
|
+
//
|
|
3489
|
+
//
|
|
3490
|
+
//
|
|
3491
|
+
//
|
|
3492
|
+
//
|
|
3493
|
+
//
|
|
3494
|
+
//
|
|
3495
|
+
//
|
|
3496
|
+
//
|
|
3497
|
+
//
|
|
3498
|
+
//
|
|
3499
|
+
//
|
|
3500
|
+
//
|
|
3501
|
+
//
|
|
3502
|
+
//
|
|
3503
|
+
//
|
|
3504
|
+
//
|
|
3505
|
+
//
|
|
3506
|
+
//
|
|
3507
|
+
//
|
|
3508
|
+
//
|
|
3509
|
+
//
|
|
3510
|
+
//
|
|
3511
|
+
//
|
|
3512
|
+
//
|
|
3513
|
+
//
|
|
3514
|
+
//
|
|
3515
|
+
//
|
|
3516
|
+
//
|
|
3517
|
+
//
|
|
3518
|
+
//
|
|
3519
|
+
//
|
|
3520
|
+
//
|
|
3521
|
+
//
|
|
3522
|
+
//
|
|
3523
|
+
//
|
|
3524
|
+
//
|
|
3525
|
+
//
|
|
3526
|
+
//
|
|
3527
|
+
//
|
|
3528
|
+
//
|
|
3529
|
+
//
|
|
3530
|
+
//
|
|
3531
|
+
//
|
|
3532
|
+
//
|
|
3533
|
+
//
|
|
3534
|
+
//
|
|
3535
|
+
//
|
|
3536
|
+
//
|
|
3537
|
+
//
|
|
3538
|
+
//
|
|
3539
|
+
//
|
|
3540
|
+
//
|
|
3541
|
+
//
|
|
3542
|
+
//
|
|
3543
|
+
//
|
|
3544
|
+
//
|
|
3545
|
+
//
|
|
3546
|
+
//
|
|
3547
|
+
//
|
|
3548
|
+
|
|
3549
|
+
/* harmony default export */ var VideoPreviewDialogvue_type_script_lang_js = ({
|
|
3550
|
+
name: "KukanDialogVideoReview",
|
|
3551
|
+
props: {
|
|
3552
|
+
visible: { type: Boolean, default: false },
|
|
3553
|
+
videoUrl: { type: String, required: true },
|
|
3554
|
+
fileName: { type: String, default: "" },
|
|
3555
|
+
width: { type: String, default: "40%" },
|
|
3556
|
+
height: { type: String, default: "80vh" },
|
|
3557
|
+
topMargin: { type: String, default: "7vh" },
|
|
3558
|
+
initialScale: { type: Number, default: 1 },
|
|
3559
|
+
},
|
|
3560
|
+
data() {
|
|
3561
|
+
return {
|
|
3562
|
+
scale: 1,
|
|
3563
|
+
minScale: 0.5,
|
|
3564
|
+
maxScale: 3,
|
|
3565
|
+
loading: true,
|
|
3566
|
+
loadError: false, // 错误标记
|
|
3567
|
+
videoWidth: 0,
|
|
3568
|
+
videoHeight: 0,
|
|
3569
|
+
duration: "00:00",
|
|
3570
|
+
translateX: 0,
|
|
3571
|
+
translateY: 0,
|
|
3572
|
+
isDragging: false,
|
|
3573
|
+
hasMoved: false,
|
|
3574
|
+
startMousePos: { x: 0, y: 0 },
|
|
3575
|
+
mouseStartPos: { x: 0, y: 0 },
|
|
3576
|
+
};
|
|
3577
|
+
},
|
|
3578
|
+
computed: {
|
|
3579
|
+
dialogVisible: {
|
|
3580
|
+
get() { return this.visible; },
|
|
3581
|
+
set(val) { this.$emit("update:visible", val); },
|
|
3582
|
+
},
|
|
3583
|
+
videoStyle() {
|
|
3584
|
+
return {
|
|
3585
|
+
transform: `translate(${this.translateX}px, ${this.translateY}px) scale(${this.scale})`,
|
|
3586
|
+
transition: this.isDragging ? "none" : "transform 0.25s cubic-bezier(0.2, 0, 0, 1)",
|
|
3587
|
+
};
|
|
3588
|
+
},
|
|
3589
|
+
},
|
|
3590
|
+
watch: {
|
|
3591
|
+
visible(val) {
|
|
3592
|
+
if (val) {
|
|
3593
|
+
this.initStates(); // 每次打开弹窗,初始化状态
|
|
3594
|
+
window.addEventListener("keydown", this.handleKeyDown);
|
|
3595
|
+
} else {
|
|
3596
|
+
this.pauseVideo();
|
|
3597
|
+
window.removeEventListener("keydown", this.handleKeyDown);
|
|
3598
|
+
}
|
|
3599
|
+
},
|
|
3600
|
+
// 监听 URL 变化:如果弹窗没关闭但切换了视频源,也要重置状态
|
|
3601
|
+
videoUrl() {
|
|
3602
|
+
if (this.visible) {
|
|
3603
|
+
this.initStates();
|
|
3604
|
+
}
|
|
3605
|
+
}
|
|
3606
|
+
},
|
|
3607
|
+
methods: {
|
|
3608
|
+
// 初始化/重置状态的方法
|
|
3609
|
+
initStates() {
|
|
3610
|
+
this.loading = true;
|
|
3611
|
+
this.loadError = false; // 【核心修复】重置错误状态
|
|
3612
|
+
this.videoWidth = 0;
|
|
3613
|
+
this.videoHeight = 0;
|
|
3614
|
+
this.duration = "00:00";
|
|
3615
|
+
this.resetZoom();
|
|
3616
|
+
},
|
|
3617
|
+
onOpened() {
|
|
3618
|
+
this.resetZoom();
|
|
3619
|
+
},
|
|
3620
|
+
onMetadataLoad(e) {
|
|
3621
|
+
const video = e.target;
|
|
3622
|
+
this.videoWidth = video.videoWidth;
|
|
3623
|
+
this.videoHeight = video.videoHeight;
|
|
3624
|
+
this.duration = this.formatDuration(video.duration);
|
|
3625
|
+
},
|
|
3626
|
+
onCanPlay() {
|
|
3627
|
+
this.loading = false;
|
|
3628
|
+
this.loadError = false; // 成功能播放时确保错误关闭
|
|
3629
|
+
},
|
|
3630
|
+
onVideoError() {
|
|
3631
|
+
console.error("Video preview failed to load.");
|
|
3632
|
+
this.loading = false;
|
|
3633
|
+
this.loadError = true; // 触发错误展示
|
|
3634
|
+
},
|
|
3635
|
+
formatDuration(seconds) {
|
|
3636
|
+
if (!seconds) return "00:00";
|
|
3637
|
+
const min = Math.floor(seconds / 60);
|
|
3638
|
+
const sec = Math.floor(seconds % 60);
|
|
3639
|
+
return `${min.toString().padStart(2, "0")}:${sec.toString().padStart(2, "0")}`;
|
|
3640
|
+
},
|
|
3641
|
+
// ... 其他方法 (zoomIn, zoomOut, handleWheel, startDrag 等保持不变) ...
|
|
3642
|
+
zoomIn() {
|
|
3643
|
+
if (this.scale < this.maxScale)
|
|
3644
|
+
this.scale = parseFloat((this.scale + 0.2).toFixed(1));
|
|
3645
|
+
},
|
|
3646
|
+
zoomOut() {
|
|
3647
|
+
if (this.scale > this.minScale)
|
|
3648
|
+
this.scale = parseFloat((this.scale - 0.2).toFixed(1));
|
|
3649
|
+
},
|
|
3650
|
+
resetZoom() {
|
|
3651
|
+
this.scale = this.initialScale;
|
|
3652
|
+
this.translateX = 0;
|
|
3653
|
+
this.translateY = 0;
|
|
3654
|
+
},
|
|
3655
|
+
handleWheel(e) {
|
|
3656
|
+
const delta = e.deltaY > 0 ? -0.1 : 0.1;
|
|
3657
|
+
const newScale = parseFloat((this.scale + delta).toFixed(1));
|
|
3658
|
+
if (newScale >= this.minScale && newScale <= this.maxScale) {
|
|
3659
|
+
this.scale = newScale;
|
|
3660
|
+
}
|
|
3661
|
+
},
|
|
3662
|
+
startDrag(e) {
|
|
3663
|
+
if (e.target.tagName === "VIDEO" && e.offsetY > e.target.offsetHeight - 50) return;
|
|
3664
|
+
if (e.button !== 0 || this.loading) return;
|
|
3665
|
+
this.isDragging = true;
|
|
3666
|
+
this.hasMoved = false;
|
|
3667
|
+
this.startMousePos = { x: e.clientX, y: e.clientY };
|
|
3668
|
+
this.mouseStartPos = {
|
|
3669
|
+
x: e.clientX - this.translateX,
|
|
3670
|
+
y: e.clientY - this.translateY,
|
|
3671
|
+
};
|
|
3672
|
+
},
|
|
3673
|
+
onDrag(e) {
|
|
3674
|
+
if (!this.isDragging) return;
|
|
3675
|
+
const dx = Math.abs(e.clientX - this.startMousePos.x);
|
|
3676
|
+
const dy = Math.abs(e.clientY - this.startMousePos.y);
|
|
3677
|
+
if (dx > 5 || dy > 5) this.hasMoved = true;
|
|
3678
|
+
this.translateX = e.clientX - this.mouseStartPos.x;
|
|
3679
|
+
this.translateY = e.clientY - this.mouseStartPos.y;
|
|
3680
|
+
},
|
|
3681
|
+
stopDrag() {
|
|
3682
|
+
this.isDragging = false;
|
|
3683
|
+
},
|
|
3684
|
+
handleCaptureClick(e) {
|
|
3685
|
+
if (this.hasMoved) {
|
|
3686
|
+
e.preventDefault();
|
|
3687
|
+
e.stopPropagation();
|
|
3688
|
+
this.hasMoved = false;
|
|
3689
|
+
}
|
|
3690
|
+
},
|
|
3691
|
+
pauseVideo() {
|
|
3692
|
+
if (this.$refs.videoPlayer) {
|
|
3693
|
+
this.$refs.videoPlayer.pause();
|
|
3694
|
+
}
|
|
3695
|
+
},
|
|
3696
|
+
handleKeyDown(e) {
|
|
3697
|
+
if (e.key === "Escape") this.closePreview();
|
|
3698
|
+
if (e.key === " ") {
|
|
3699
|
+
e.preventDefault();
|
|
3700
|
+
const v = this.$refs.videoPlayer;
|
|
3701
|
+
if (v) v.paused ? v.play() : v.pause();
|
|
3702
|
+
}
|
|
3703
|
+
},
|
|
3704
|
+
closePreview() {
|
|
3705
|
+
this.pauseVideo();
|
|
3706
|
+
this.dialogVisible = false;
|
|
3707
|
+
this.$emit("close");
|
|
3708
|
+
},
|
|
3709
|
+
},
|
|
3710
|
+
});
|
|
3711
|
+
|
|
3712
|
+
// CONCATENATED MODULE: ./src/components/VideoPreviewDialog/index.vue?vue&type=script&lang=js
|
|
3713
|
+
/* harmony default export */ var components_VideoPreviewDialogvue_type_script_lang_js = (VideoPreviewDialogvue_type_script_lang_js);
|
|
3714
|
+
// EXTERNAL MODULE: ./src/components/VideoPreviewDialog/index.vue?vue&type=style&index=0&id=419a04c7&prod&lang=scss&scoped=true
|
|
3715
|
+
var VideoPreviewDialogvue_type_style_index_0_id_419a04c7_prod_lang_scss_scoped_true = __webpack_require__("5d9e");
|
|
3716
|
+
|
|
3717
|
+
// CONCATENATED MODULE: ./src/components/VideoPreviewDialog/index.vue
|
|
3718
|
+
|
|
3719
|
+
|
|
3720
|
+
|
|
3721
|
+
|
|
3722
|
+
|
|
3723
|
+
|
|
3724
|
+
/* normalize component */
|
|
3725
|
+
|
|
3726
|
+
var VideoPreviewDialog_component = normalizeComponent(
|
|
3727
|
+
components_VideoPreviewDialogvue_type_script_lang_js,
|
|
3728
|
+
VideoPreviewDialogvue_type_template_id_419a04c7_scoped_true_render,
|
|
3729
|
+
VideoPreviewDialogvue_type_template_id_419a04c7_scoped_true_staticRenderFns,
|
|
3730
|
+
false,
|
|
3731
|
+
null,
|
|
3732
|
+
"419a04c7",
|
|
3733
|
+
null
|
|
3734
|
+
|
|
3735
|
+
)
|
|
3736
|
+
|
|
3737
|
+
/* harmony default export */ var VideoPreviewDialog = (VideoPreviewDialog_component.exports);
|
|
3417
3738
|
// CONCATENATED MODULE: ./src/index.js
|
|
3418
3739
|
|
|
3419
3740
|
|
|
3420
3741
|
|
|
3421
3742
|
|
|
3743
|
+
|
|
3422
3744
|
// import MyButton from './components/Button';
|
|
3423
3745
|
|
|
3424
3746
|
const components = [
|
|
3425
3747
|
components_FileUpload,
|
|
3426
|
-
|
|
3748
|
+
VideoPreviewDialog
|
|
3427
3749
|
];
|
|
3428
3750
|
|
|
3429
3751
|
// 整个库的 install
|
|
3430
|
-
const install = function(Vue, options= {}) {
|
|
3752
|
+
const install = function (Vue, options = {}) {
|
|
3431
3753
|
components.forEach(component => {
|
|
3432
3754
|
// 自动读取组件里的 name 属性作为组件名
|
|
3433
3755
|
Vue.component(component.name, component);
|
|
3434
3756
|
});
|
|
3435
3757
|
|
|
3436
3758
|
// 将 axios 实例传入 api 模块
|
|
3437
|
-
|
|
3759
|
+
setAxiosInstance(options.axios);
|
|
3438
3760
|
};
|
|
3439
3761
|
|
|
3440
3762
|
// 支持用 <script> 引入
|