icve-urc 1.0.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.
Files changed (57) hide show
  1. package/README.en.md +36 -0
  2. package/README.md +24 -0
  3. package/dist/demo.html +10 -0
  4. package/dist/icve-urc.common.js +114103 -0
  5. package/dist/icve-urc.common.js.map +1 -0
  6. package/dist/icve-urc.css +1 -0
  7. package/dist/icve-urc.umd.js +114113 -0
  8. package/dist/icve-urc.umd.js.map +1 -0
  9. package/dist/icve-urc.umd.min.js +75 -0
  10. package/dist/icve-urc.umd.min.js.map +1 -0
  11. package/package.json +33 -0
  12. package/src/App copy.vue +116 -0
  13. package/src/App.vue +125 -0
  14. package/src/api/resourceManagement/index.js +33 -0
  15. package/src/assets/img/error.png +0 -0
  16. package/src/assets/img/file.png +0 -0
  17. package/src/assets/img/icon-pic.png +0 -0
  18. package/src/assets/img/icon_audio.png +0 -0
  19. package/src/assets/img/icon_excel.png +0 -0
  20. package/src/assets/img/icon_other.png +0 -0
  21. package/src/assets/img/icon_pdf.png +0 -0
  22. package/src/assets/img/icon_ppt.png +0 -0
  23. package/src/assets/img/icon_txt_s.png +0 -0
  24. package/src/assets/img/icon_vedio.png +0 -0
  25. package/src/assets/img/icon_word.png +0 -0
  26. package/src/assets/img/icon_zip.png +0 -0
  27. package/src/assets/img/loading.gif +0 -0
  28. package/src/assets/logo.png +0 -0
  29. package/src/assets/styles/btn.scss +99 -0
  30. package/src/assets/styles/element-ui.scss +92 -0
  31. package/src/assets/styles/element-variables.scss +31 -0
  32. package/src/assets/styles/icon/demo.css +539 -0
  33. package/src/assets/styles/icon/demo_index.html +556 -0
  34. package/src/assets/styles/icon/iconfont.css +79 -0
  35. package/src/assets/styles/icon/iconfont.js +1 -0
  36. package/src/assets/styles/icon/iconfont.json +121 -0
  37. package/src/assets/styles/icon/iconfont.ttf +0 -0
  38. package/src/assets/styles/icon/iconfont.woff +0 -0
  39. package/src/assets/styles/icon/iconfont.woff2 +0 -0
  40. package/src/assets/styles/index.scss +252 -0
  41. package/src/assets/styles/mixin.scss +66 -0
  42. package/src/assets/styles/ruoyi.scss +273 -0
  43. package/src/assets/styles/sidebar.scss +249 -0
  44. package/src/assets/styles/transition.scss +53 -0
  45. package/src/assets/styles/variables.scss +54 -0
  46. package/src/components/AliPlayer.vue +158 -0
  47. package/src/components/Pagination/index.vue +119 -0
  48. package/src/components/fileImport.vue +466 -0
  49. package/src/components/filePreview.vue +670 -0
  50. package/src/components/fileUpload.vue +752 -0
  51. package/src/components/treeCompontent.vue +277 -0
  52. package/src/main.js +26 -0
  53. package/src/router/index.js +22 -0
  54. package/src/utils/auth.js +15 -0
  55. package/src/utils/errorCode.js +6 -0
  56. package/src/utils/request.js +63 -0
  57. package/src/utils/scroll-to.js +58 -0
@@ -0,0 +1,158 @@
1
+ <template>
2
+ <!-- 播放器容器 -->
3
+ <div id="player-container"></div>
4
+ </template>
5
+
6
+ <script>
7
+ export default {
8
+ name: "AliPlayer",
9
+ props: {
10
+ source: {
11
+ // 视频源
12
+ type: Object,
13
+ required: true,
14
+ },
15
+ options: {
16
+ // 其他配置项
17
+ type: Object,
18
+ default: () => ({}),
19
+ },
20
+ savedProgress: {
21
+ // 上次播放进度
22
+ type: Number,
23
+ default: 0,
24
+ },
25
+ // 是否拖动
26
+ isDrag: {
27
+ type: Boolean,
28
+ default: false,
29
+ },
30
+ },
31
+ data() {
32
+ return {
33
+ player: null,
34
+ progress: this.savedProgress, // 当前播放进度
35
+ lastValidTime: this.savedProgress, // 新增:记录上次有效的播放时间
36
+ whetherDragAndDropIsAllowed: this.isDrag,
37
+ videoTime: 0, // 新增:记录当前播放时间
38
+ };
39
+ },
40
+ created() {},
41
+ mounted() {
42
+ this.initPlayer();
43
+ },
44
+ beforeDestroy() {
45
+ this.destroyPlayer();
46
+ },
47
+ methods: {
48
+ initPlayer() {
49
+ const config = {
50
+ id: "player-container",
51
+ muted: true, // 静音状态下更可能遵守autoplay设置
52
+ isLive: false, // 是否为直播
53
+ playsinline: true, // 内联播放(iOS)
54
+ preload: true,
55
+ controlBarVisibility: "hover",
56
+ useH5Prism: true,
57
+ ...this.options,
58
+ ...this.source,
59
+ autoplay: false, // 自动播放
60
+ };
61
+ this.player = new Aliplayer(config, (player) => {
62
+ // 设置上次播放进度
63
+ this.$emit("player", this.player); // 触发player事件,传递player实例
64
+ if (this.progress > 0) {
65
+ this.$nextTick(() => {
66
+ // 可选:显示继续播放提示
67
+ this.$confirm(
68
+ `检测到上次播放至${this.formatTime(this.progress)},是否继续?`,
69
+ "提示",
70
+ {
71
+ confirmButtonText: "继续播放",
72
+ cancelButtonText: "重新开始",
73
+ }
74
+ )
75
+ .then(() => {
76
+ this.player.seek(this.progress);
77
+ })
78
+ .catch(() => {
79
+ this.player.seek(0); // 重新开始
80
+ });
81
+ });
82
+ }
83
+ this.$nextTick(() => {
84
+ setTimeout(() => {
85
+ this.player.pause();
86
+ this.$emit("loadedmetadata", this.player.getDuration());
87
+ }, 1000);
88
+ });
89
+ });
90
+ // 监听 timeupdate 事件,禁止快进
91
+ this.player.on("timeupdate", () => {
92
+ const currentTime = this.player.getCurrentTime();
93
+ if (
94
+ currentTime > this.lastValidTime &&
95
+ this.whetherDragAndDropIsAllowed
96
+ ) {
97
+ var num =
98
+ parseFloat(this.player.getCurrentTime()) -
99
+ parseFloat(this.lastValidTime);
100
+
101
+ if (num < 1) {
102
+ //正常播放时,记录当前播放时间
103
+ this.lastValidTime = this.player.getCurrentTime();
104
+ this.videoTime = this.player.getCurrentTime();
105
+ } else {
106
+ this.videoTime = this.lastValidTime;
107
+ this.player.seek(this.lastValidTime);
108
+ }
109
+ }
110
+ });
111
+ // 监听事件
112
+ this.player.on("play", () => {
113
+ const currentTime = this.player.getCurrentTime();
114
+ this.$emit("play", currentTime);
115
+ });
116
+
117
+ this.player.on("pause", () => {
118
+ const currentTime = this.player.getCurrentTime();
119
+ this.$emit("pause", currentTime);
120
+ });
121
+
122
+ this.player.on("ended", () => {
123
+ const currentTime = this.player.getCurrentTime();
124
+ this.$emit("ended", currentTime);
125
+ });
126
+ },
127
+ formatTime(seconds) {
128
+ const mins = Math.floor(seconds / 60);
129
+ const secs = Math.floor(seconds % 60);
130
+ return `${mins}分${secs}秒`;
131
+ },
132
+ destroyPlayer() {
133
+ if (this.player) {
134
+ this.player.dispose();
135
+ this.player = null;
136
+ }
137
+ },
138
+ },
139
+ watch: {
140
+ source: {
141
+ deep: true,
142
+ handler(newVal) {
143
+ if (this.player) {
144
+ this.player.loadByUrl(newVal.source, newVal.vid, newVal.playauth);
145
+ // 视频源变更时,重置上次有效时间
146
+ this.lastValidTime = 0;
147
+ }
148
+ },
149
+ },
150
+ },
151
+ };
152
+ </script>
153
+
154
+ <style scoped>
155
+ #player-container {
156
+ width: 100%;
157
+ }
158
+ </style>
@@ -0,0 +1,119 @@
1
+ <template>
2
+ <div
3
+ :class="{ hidden: hidden }"
4
+ class="pagination-container"
5
+ >
6
+ <el-pagination
7
+ :background="background"
8
+ :current-page.sync="currentPage"
9
+ :page-size.sync="pageSize"
10
+ :layout="layout"
11
+ :page-sizes="pageSizes"
12
+ :pager-count="pagerCount"
13
+ :total="total"
14
+ v-bind="$attrs"
15
+ @size-change="handleSizeChange"
16
+ @current-change="handleCurrentChange"
17
+ />
18
+ </div>
19
+ </template>
20
+
21
+ <script>
22
+ import { scrollTo } from '@/utils/scroll-to'
23
+
24
+ export default {
25
+ name: 'Pagination',
26
+ props: {
27
+ total: {
28
+ required: true,
29
+ type: Number,
30
+ },
31
+ page: {
32
+ type: Number,
33
+ default: 1,
34
+ },
35
+ limit: {
36
+ type: Number,
37
+ default: 20,
38
+ },
39
+ pageSizes: {
40
+ type: Array,
41
+ default() {
42
+ return [10, 20, 30, 50]
43
+ },
44
+ },
45
+ // 移动端页码按钮的数量端默认值5
46
+ pagerCount: {
47
+ type: Number,
48
+ default: document.body.clientWidth < 992 ? 5 : 7,
49
+ },
50
+ layout: {
51
+ type: String,
52
+ default: 'total, sizes, prev, pager, next, jumper',
53
+ },
54
+ background: {
55
+ type: Boolean,
56
+ default: true,
57
+ },
58
+ autoScroll: {
59
+ type: Boolean,
60
+ default: true,
61
+ },
62
+ hidden: {
63
+ type: Boolean,
64
+ default: false,
65
+ },
66
+ },
67
+ data() {
68
+ return {}
69
+ },
70
+ computed: {
71
+ currentPage: {
72
+ get() {
73
+ return this.page
74
+ },
75
+ set(val) {
76
+ this.$emit('update:page', val)
77
+ },
78
+ },
79
+ pageSize: {
80
+ get() {
81
+ return this.limit
82
+ },
83
+ set(val) {
84
+ this.$emit('update:limit', val)
85
+ },
86
+ },
87
+ },
88
+ methods: {
89
+ handleSizeChange(val) {
90
+ if (this.currentPage * val > this.total) {
91
+ this.currentPage = 1
92
+ }
93
+ this.$emit('pagination', { page: this.currentPage, limit: val })
94
+ if (this.autoScroll) {
95
+ scrollTo(0, 800)
96
+ }
97
+ },
98
+ handleCurrentChange(val) {
99
+ this.$emit('pagination', { page: val, limit: this.pageSize })
100
+ if (this.autoScroll) {
101
+ scrollTo(0, 800)
102
+ }
103
+ },
104
+ },
105
+ }
106
+ </script>
107
+
108
+ <style scoped lang="scss">
109
+ .pagination-container {
110
+ background: #fff;
111
+ padding: 32px 16px;
112
+ }
113
+ .pagination-container.hidden {
114
+ display: none;
115
+ }
116
+ ::v-deep .el-pagination__jump {
117
+ display: none !important;
118
+ }
119
+ </style>