matrix_components 2.0.300
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 +438 -0
- package/dist/ComponentDemo/DialogDemo.vue +208 -0
- package/dist/ComponentDemo/ExcelDemo.vue +263 -0
- package/dist/ComponentDemo/OfficeDemo.vue +189 -0
- package/dist/ComponentDemo/PdfDemo.vue +207 -0
- package/dist/ComponentDemo/Test.vue +6 -0
- package/dist/ComponentDemo/VideoDemo.vue +273 -0
- package/dist/ComponentDemo/WordDemo.vue +191 -0
- package/dist/cdn/ezuikit/ezuikit.js +27 -0
- package/dist/cdn/ezuikit/ezuikit_static/PlayCtrlWasm/playCtrl1/HasSIMD/Decoder.js +168 -0
- package/dist/cdn/ezuikit/ezuikit_static/PlayCtrlWasm/playCtrl1/NoSIMD/Decoder.js +168 -0
- package/dist/cdn/ezuikit/ezuikit_static/PlayCtrlWasm/playCtrl3/hasWorker/HasSIMD/Decoder.js +21 -0
- package/dist/cdn/ezuikit/ezuikit_static/PlayCtrlWasm/playCtrl3/hasWorker/HasSIMD/Decoder.wasm +0 -0
- package/dist/cdn/ezuikit/ezuikit_static/PlayCtrlWasm/playCtrl3/hasWorker/HasSIMD/Decoder.worker.js +1 -0
- package/dist/cdn/ezuikit/ezuikit_static/PlayCtrlWasm/playCtrl3/hasWorker/NoSIMD/Decoder.js +21 -0
- package/dist/cdn/ezuikit/ezuikit_static/PlayCtrlWasm/playCtrl3/hasWorker/NoSIMD/Decoder.wasm +0 -0
- package/dist/cdn/ezuikit/ezuikit_static/PlayCtrlWasm/playCtrl3/hasWorker/NoSIMD/Decoder.worker.js +1 -0
- package/dist/cdn/ezuikit/ezuikit_static/PlayCtrlWasm/playCtrl3/noWorker/Decoder.js +21 -0
- package/dist/cdn/ezuikit/ezuikit_static/PlayCtrlWasm/playCtrl3/noWorker/Decoder.wasm +0 -0
- package/dist/cdn/ezuikit/ezuikit_static/css/component.css +1257 -0
- package/dist/cdn/ezuikit/ezuikit_static/css/inspectTheme.css +354 -0
- package/dist/cdn/ezuikit/ezuikit_static/css/theme copy.css +126 -0
- package/dist/cdn/ezuikit/ezuikit_static/css/theme.css +140 -0
- package/dist/cdn/ezuikit/ezuikit_static/imgs/bg.png +0 -0
- package/dist/cdn/ezuikit/ezuikit_static/imgs/bg.svg +33 -0
- package/dist/cdn/ezuikit/ezuikit_static/imgs/empty.png +0 -0
- package/dist/cdn/ezuikit/ezuikit_static/imgs/end.png +0 -0
- package/dist/cdn/ezuikit/ezuikit_static/imgs/fallback.svg +52 -0
- package/dist/cdn/ezuikit/ezuikit_static/imgs/start.png +0 -0
- package/dist/cdn/ezuikit/ezuikit_static/rec/datepicker.js +1522 -0
- package/dist/cdn/ezuikit/ezuikit_static/rec/datepicker.min.css +36 -0
- package/dist/cdn/ezuikit/ezuikit_static/rec/datepicker.zh-CN.js +19 -0
- package/dist/cdn/ezuikit/ezuikit_static/rec/jquery.min.js +2 -0
- package/dist/cdn/ezuikit/ezuikit_static/speed/speed.css +145 -0
- package/dist/cdn/ezuikit/ezuikit_static/talk/adapeter.js +5497 -0
- package/dist/cdn/ezuikit/ezuikit_static/talk/janus.js +3507 -0
- package/dist/cdn/ezuikit/ezuikit_static/talk/tts-v4.js +343 -0
- package/dist/cdn/ezuikit.js +27 -0
- package/dist/cdn/h5player/h5player.min.js +313 -0
- package/dist/cdn/h5player/playctrl1/DecodeWorker.js +642 -0
- package/dist/cdn/h5player/playctrl1/Decoder.js +1 -0
- package/dist/cdn/h5player/playctrl1simd/DecodeWorker.js +642 -0
- package/dist/cdn/h5player/playctrl1simd/Decoder.js +1 -0
- package/dist/cdn/h5player/playctrl2/Decoder.js +21 -0
- package/dist/cdn/h5player/playctrl2/Decoder.wasm +0 -0
- package/dist/cdn/h5player/playctrl2/Decoder.worker.js +1 -0
- package/dist/cdn/h5player/playctrl3/Decoder.js +21 -0
- package/dist/cdn/h5player/playctrl3/Decoder.wasm +0 -0
- package/dist/cdn/h5player/playctrl3/Decoder.worker.js +1 -0
- package/dist/cdn/h5player/talk/AudioInterCom.js +21 -0
- package/dist/cdn/h5player/talk/AudioInterCom.wasm +0 -0
- package/dist/cdn/h5player/talkW/AudioInterCom.js +21 -0
- package/dist/cdn/h5player/talkW/AudioInterCom.wasm +0 -0
- package/dist/cdn/h5player/talkW/AudioInterCom.worker.js +1 -0
- package/dist/cdn/h5player/transform/libSystemTransform.js +6525 -0
- package/dist/cdn/h5player/transform/libSystemTransform.wasm +0 -0
- package/dist/cdn/h5player/transform/systemTransform-worker.js +120 -0
- package/dist/cdn/md5.js +254 -0
- package/dist/favicon.ico +0 -0
- package/dist/js/EasyPlayer-decode.js +1 -0
- package/dist/js/EasyPlayer-lib.js +1 -0
- package/dist/js/EasyPlayer-pro.js +1 -0
- package/dist/js/EasyPlayer-pro.wasm +0 -0
- package/dist/js/EasyPlayer-snap.wasm +0 -0
- package/dist/matrix_components.css +1 -0
- package/dist/matrix_components.js +60018 -0
- package/dist/matrix_components.umd.cjs +1 -0
- package/package.json +81 -0
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { nextTick, onMounted, reactive, ref } from 'vue'
|
|
3
|
+
|
|
4
|
+
const nsVideoRef = ref()
|
|
5
|
+
|
|
6
|
+
// 视频信息
|
|
7
|
+
const videoData = reactive({
|
|
8
|
+
videoModel: 'hk',
|
|
9
|
+
hkPath: '/martrix/cdn/h5player',
|
|
10
|
+
// 显示视频关闭按钮
|
|
11
|
+
showClose: true,
|
|
12
|
+
// 显示树
|
|
13
|
+
showTree: true,
|
|
14
|
+
// 树数据
|
|
15
|
+
treeData: [
|
|
16
|
+
{
|
|
17
|
+
id: '1',
|
|
18
|
+
label: '分组1',
|
|
19
|
+
children: [
|
|
20
|
+
{
|
|
21
|
+
id: '11',
|
|
22
|
+
label: '分组1-1',
|
|
23
|
+
children: [
|
|
24
|
+
{
|
|
25
|
+
videoModel: 'easyplayer',
|
|
26
|
+
id: '111',
|
|
27
|
+
label: '视频A--1视频A--1视频A--1视频A--1视频A--1视频A--1视频A--1视频A--1视频A--1视频A--1视频A--1视频A--1视频A--1视频A--1视频A--1视频A--1',
|
|
28
|
+
url: 'ws://199.10.9.192:30200/rtp/34020000001110000001_34020000001320000001.live.flv',
|
|
29
|
+
deviceId: 'a1',
|
|
30
|
+
channelId: 'a11',
|
|
31
|
+
icontype: 'on',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: '222',
|
|
35
|
+
label: '视频A--2',
|
|
36
|
+
url: 'ws://199.10.9.192:30200/rtp/34020000001110000001_34020000001320000004.live.flv',
|
|
37
|
+
deviceId: 'b1',
|
|
38
|
+
channelId: 'b11',
|
|
39
|
+
icontype: 'off',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
videoModel: 'hk',
|
|
43
|
+
hkPath: '/22222/cdn/h5player',
|
|
44
|
+
id: '3aaaaa',
|
|
45
|
+
label: '视频A--3',
|
|
46
|
+
url: 'ws://199.10.9.192:30200/rtp/34020000001110000001_34020000001320000004.live.flv',
|
|
47
|
+
deviceId: 'c1',
|
|
48
|
+
channelId: 'c11',
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
id: 'b',
|
|
54
|
+
label: '分组b',
|
|
55
|
+
children: [
|
|
56
|
+
{
|
|
57
|
+
id: 'b1',
|
|
58
|
+
label: '视频A--1视频A--1视频A--1视频A--1视频A--1视频A--1视频A--1视频A--1视频A--1视频A--1视频A--1视频A--1视频A--1视频A--1视频A--1视频A--1',
|
|
59
|
+
url: 'wss://gbs.liveqing.com:10010/sms/34020000002020000001/ws-flv/hls/34020000001320000264_34020000001320000264.flv?token=xDaY0uodE5Oj8-4YokeKWnJWDkBSKOeP96vHopkQLa8.oxNzQ3ODMzNDg3LCJwIjoiMGIwOTZlZmI1NyIsInQiOjE3NDc4MzMyMzcsInUiOiIwYjA5NmVmYjU3In0eyJlIj.GciOiJIUzI1NiIsInR5cCI6IkpXVCJ9eyJhb&raw=1',
|
|
60
|
+
deviceId: 'a1',
|
|
61
|
+
channelId: 'a11',
|
|
62
|
+
icontype: 'on',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: 'b2',
|
|
66
|
+
label: '视频A--2',
|
|
67
|
+
url: 'ws://199.10.9.192:30200/rtp/34020000001110000001_34020000001320000002.live.flv',
|
|
68
|
+
deviceId: 'b1',
|
|
69
|
+
channelId: 'b11',
|
|
70
|
+
icontype: 'off',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: 'b3',
|
|
74
|
+
label: '视频A--3',
|
|
75
|
+
url: 'ws://199.10.9.192:30200/rtp/34020000001110000001_34020000001320000004.live.flv',
|
|
76
|
+
deviceId: 'c1',
|
|
77
|
+
channelId: 'c11',
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
id: 'xxx2',
|
|
86
|
+
label: '视频Zxxxx2',
|
|
87
|
+
url: 'ws://199.10.9.192:30200/rtp/34020000001110000001_34020000001320000009.live.flv',
|
|
88
|
+
deviceId: '34020000001110000001',
|
|
89
|
+
channelId: '34020000001320000003',
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
// 树节点对应的key(!!!用于改变选中后的颜色)
|
|
93
|
+
treeNodeKey: 'id',
|
|
94
|
+
// 树节点展开的key
|
|
95
|
+
treeExpandedKeys: ['11'],
|
|
96
|
+
// 树节点属性 (videoUrlKey值要和treeData中的播放地址key一致, 默认为url)
|
|
97
|
+
treeOptions: {
|
|
98
|
+
icontype: 'icontype',
|
|
99
|
+
background: 'background',
|
|
100
|
+
videoUrlKey: 'url',
|
|
101
|
+
children: 'children',
|
|
102
|
+
label: 'label',
|
|
103
|
+
},
|
|
104
|
+
// 获取、设置打开的播放视频信息
|
|
105
|
+
videoInfos: [
|
|
106
|
+
{
|
|
107
|
+
index: 3,
|
|
108
|
+
url: 'ws://199.10.9.192:30200/rtp/34020000001110000001_34020000001320000001.live.flv',
|
|
109
|
+
info: {
|
|
110
|
+
videoModel: 'easyplayer',
|
|
111
|
+
id: 'xxx2',
|
|
112
|
+
url: 'ws://199.10.9.192:30200/rtp/34020000001110000001_34020000001320000001.live.flv',
|
|
113
|
+
deviceId: 'c1',
|
|
114
|
+
channelId: 'c11',
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
// !!! 单点播放
|
|
119
|
+
videoSingleUrl: false,
|
|
120
|
+
// !!! 已经在播放的是否关闭后再点击打开(需要单点播 videoSingleUrl:true)
|
|
121
|
+
videoSingleClose: false,
|
|
122
|
+
// 回调函数后是否继续执行默认播放操作
|
|
123
|
+
callbackContinueExecute: true,
|
|
124
|
+
// 播放模式: 1: 单击,2: 双击
|
|
125
|
+
videoPlayModel: 1,
|
|
126
|
+
// 分屏模式: 1: 单屏, 2: 四屏, 3: 九屏
|
|
127
|
+
videoSplitType: 2,
|
|
128
|
+
// 显示分屏按钮
|
|
129
|
+
showVideoSplit: true,
|
|
130
|
+
// 分屏使用图标
|
|
131
|
+
// videoSplitUseIcon: true,
|
|
132
|
+
// 显示方向控制按钮
|
|
133
|
+
showVideoCtrls: true,
|
|
134
|
+
// 禁止控制按钮默认请求行为(默认false,true则不使用组件的发送请求仅调用自定义回调函数)
|
|
135
|
+
stopVideoCtrlMethods: true,
|
|
136
|
+
// 单个视频错误最大次数
|
|
137
|
+
videoErrorMaxCount: 3,
|
|
138
|
+
// easyplayer配置 (默认一般不需要配置, 加载不出来的时候修改)
|
|
139
|
+
videoConfig: {
|
|
140
|
+
MSE: true,
|
|
141
|
+
WCS: true,
|
|
142
|
+
WASM:true,
|
|
143
|
+
WASMSIMD: true,
|
|
144
|
+
isLive: true,
|
|
145
|
+
hasAudio: false,
|
|
146
|
+
stretch: true
|
|
147
|
+
},
|
|
148
|
+
// -----------事件回调-------------
|
|
149
|
+
// 点击树节点的操作
|
|
150
|
+
treeClick: () => {
|
|
151
|
+
console.log('点击树节点回调函数')
|
|
152
|
+
},
|
|
153
|
+
// 双击树节点的操作
|
|
154
|
+
treeDBClick: () => {
|
|
155
|
+
console.log('双击树节点回调函数')
|
|
156
|
+
},
|
|
157
|
+
// 右键树展示菜单
|
|
158
|
+
treeRightMenu: () => {
|
|
159
|
+
console.log('右键树展示菜单')
|
|
160
|
+
},
|
|
161
|
+
// 展开树节点
|
|
162
|
+
treeExpand: () => {
|
|
163
|
+
console.log('展开树节点')
|
|
164
|
+
},
|
|
165
|
+
// 视频错误回调函数
|
|
166
|
+
videoError: () => {
|
|
167
|
+
console.log('视频错误回调函数')
|
|
168
|
+
},
|
|
169
|
+
})
|
|
170
|
+
|
|
171
|
+
// 视频操作事件
|
|
172
|
+
const videoEvent = {
|
|
173
|
+
up: () => {
|
|
174
|
+
console.log('视频向上移动操作')
|
|
175
|
+
},
|
|
176
|
+
down: () => {
|
|
177
|
+
console.log('视频向下移动操作')
|
|
178
|
+
},
|
|
179
|
+
left: () => {
|
|
180
|
+
console.log('视频向左移动操作')
|
|
181
|
+
},
|
|
182
|
+
right: () => {
|
|
183
|
+
console.log('视频向右移动操作')
|
|
184
|
+
},
|
|
185
|
+
zoomin: () => {
|
|
186
|
+
console.log('视频放大操作')
|
|
187
|
+
},
|
|
188
|
+
zoomout: () => {
|
|
189
|
+
console.log('视频缩小操作')
|
|
190
|
+
},
|
|
191
|
+
stop: () => {
|
|
192
|
+
console.log('视频停止操作')
|
|
193
|
+
},
|
|
194
|
+
speed: () => {
|
|
195
|
+
console.log('设置视频移动速度')
|
|
196
|
+
},
|
|
197
|
+
speak: () => {
|
|
198
|
+
console.log('视频开始说话')
|
|
199
|
+
},
|
|
200
|
+
scan: () => {
|
|
201
|
+
console.log('视频扫描')
|
|
202
|
+
},
|
|
203
|
+
cruise: () => {
|
|
204
|
+
console.log('视频巡航')
|
|
205
|
+
},
|
|
206
|
+
call: () => {
|
|
207
|
+
console.log('视频调用')
|
|
208
|
+
},
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
onMounted(() => {
|
|
212
|
+
// setTimeout(() => {
|
|
213
|
+
// // !!!暴露方法
|
|
214
|
+
// // nsVideoRef.value.[setVideoUrl / removeVideo / fouceIndex / videoInfos / treeRef]
|
|
215
|
+
// // 设置视频
|
|
216
|
+
// videoData.videoInfos = [
|
|
217
|
+
// {
|
|
218
|
+
// index: 1,
|
|
219
|
+
// url: 'ws://199.10.9.192:30200/rtp/34020000001110000001_34020000001320000004.live.flv',
|
|
220
|
+
// info: {
|
|
221
|
+
// videoModel: 'easyplayer',
|
|
222
|
+
// id: 'xxx',
|
|
223
|
+
// label: '视频A--3',
|
|
224
|
+
// url: 'ws://199.10.9.192:30200/rtp/34020000001110000001_34020000001320000004.live.flv',
|
|
225
|
+
// deviceId: 'c1',
|
|
226
|
+
// channelId: 'c11',
|
|
227
|
+
// },
|
|
228
|
+
// },
|
|
229
|
+
// ]
|
|
230
|
+
// // }, 3000)
|
|
231
|
+
// setTimeout(() => {
|
|
232
|
+
// // 关闭视频方法1:
|
|
233
|
+
// nsVideoRef.value.removeVideo(7, true)
|
|
234
|
+
// // 关闭视频方法2:
|
|
235
|
+
// // nsVideoRef.value.setVideoUrl('', false, 7)
|
|
236
|
+
// }, 5000)
|
|
237
|
+
// 播放视频
|
|
238
|
+
// nextTick(()=>{
|
|
239
|
+
// nsVideoRef.value.setVideoUrl('ws://199.10.9.192:30200/rtp/34020000001110000001_34020000001320000010.live.flv', false, 1, {
|
|
240
|
+
// videoModel: 'easyplayer',
|
|
241
|
+
// /* videoModel: 'hk',
|
|
242
|
+
// hkPath: '/xxxx', */
|
|
243
|
+
// })
|
|
244
|
+
// })
|
|
245
|
+
})
|
|
246
|
+
function changeSplitHandler(num: number) {
|
|
247
|
+
console.log('分屏模式:如1,2,3代表单屏,四屏,九屏', num)
|
|
248
|
+
}
|
|
249
|
+
</script>
|
|
250
|
+
<template>
|
|
251
|
+
<div class="video-demo">
|
|
252
|
+
<h1 class="title" style="color: #fff" v-sline>视频组件(国标28181 + 海康威视)</h1>
|
|
253
|
+
<NsVideo class="nsvideo" ref="nsVideoRef" v-bind="videoData" v-on="videoEvent" @changeSplit='changeSplitHandler'>
|
|
254
|
+
<!-- 自定义插槽
|
|
255
|
+
<template #video-tree><span>左侧树-自定义插槽</span></template>
|
|
256
|
+
<template #video-player-head><span>播放区域头部-自定义插槽</span></template>
|
|
257
|
+
<template #video-player-view><span>播放区域主体-自定义插槽</span></template>
|
|
258
|
+
<template #video-player-foot><span>播放区域底部控制按钮-自定义插槽</span></template>
|
|
259
|
+
-->
|
|
260
|
+
</NsVideo>
|
|
261
|
+
</div>
|
|
262
|
+
</template>
|
|
263
|
+
<style scoped lang="scss">
|
|
264
|
+
.video-demo {
|
|
265
|
+
display: flex;
|
|
266
|
+
flex-direction: column;
|
|
267
|
+
height: 100%;
|
|
268
|
+
background-color: #0f2a3b;
|
|
269
|
+
.title {
|
|
270
|
+
margin-bottom: 10px;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
</style>
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="demo-container">
|
|
3
|
+
<div class="control-panel">
|
|
4
|
+
<h3>Word 文档预览演示</h3>
|
|
5
|
+
|
|
6
|
+
<!-- 文件上传方式 -->
|
|
7
|
+
<div class="upload-section">
|
|
8
|
+
<h4>方式一:文件上传</h4>
|
|
9
|
+
<input
|
|
10
|
+
type="file"
|
|
11
|
+
@change="importWord(($event.target as any)?.files?.[0])"
|
|
12
|
+
accept=".docx"
|
|
13
|
+
/>
|
|
14
|
+
<button @click="clearFile" :disabled="!file">清除文件</button>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<!-- URL方式 -->
|
|
18
|
+
<div class="url-section">
|
|
19
|
+
<h4>方式二:URL地址</h4>
|
|
20
|
+
<input
|
|
21
|
+
v-model="wordUrl"
|
|
22
|
+
type="text"
|
|
23
|
+
placeholder="请输入Word文档的URL地址"
|
|
24
|
+
class="url-input"
|
|
25
|
+
/>
|
|
26
|
+
<button @click="loadFromUrl" :disabled="!wordUrl.trim()">加载URL</button>
|
|
27
|
+
<button @click="clearUrl" :disabled="!wordUrl">清除URL</button>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<!-- Word组件 -->
|
|
32
|
+
<div class="word-container">
|
|
33
|
+
<NsWord
|
|
34
|
+
v-if="counts"
|
|
35
|
+
ref="wordRef"
|
|
36
|
+
:url="currentUrl"
|
|
37
|
+
:hasTool="true"
|
|
38
|
+
:options="wordOptions">
|
|
39
|
+
</NsWord>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</template>
|
|
43
|
+
|
|
44
|
+
<script setup lang="ts">
|
|
45
|
+
import { ref, nextTick } from 'vue'
|
|
46
|
+
|
|
47
|
+
const counts = ref(true)
|
|
48
|
+
const file = ref()
|
|
49
|
+
const wordRef = ref()
|
|
50
|
+
const wordUrl = ref(
|
|
51
|
+
'https://501351981.github.io/vue-office/examples/dist/static/test-files/test.docx',
|
|
52
|
+
)
|
|
53
|
+
const currentUrl = ref(wordUrl.value)
|
|
54
|
+
|
|
55
|
+
// Word文档配置选项
|
|
56
|
+
const wordOptions = ref({
|
|
57
|
+
// 可以在这里配置@vue-office/docx的选项
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
function importWord(f: any) {
|
|
61
|
+
// 清除URL,使用文件上传
|
|
62
|
+
wordUrl.value = ''
|
|
63
|
+
file.value = f
|
|
64
|
+
|
|
65
|
+
if (f && f.name.endsWith('.docx')) {
|
|
66
|
+
// 创建文件URL
|
|
67
|
+
const fileUrl = URL.createObjectURL(f)
|
|
68
|
+
currentUrl.value = fileUrl
|
|
69
|
+
} else if (f) {
|
|
70
|
+
alert('请选择DOCX文件')
|
|
71
|
+
clearFile()
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function loadFromUrl() {
|
|
76
|
+
if (wordUrl.value.trim()) {
|
|
77
|
+
// 清除文件,使用URL
|
|
78
|
+
clearFile()
|
|
79
|
+
currentUrl.value = wordUrl.value.trim()
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function clearFile() {
|
|
84
|
+
file.value = null
|
|
85
|
+
if (currentUrl.value.startsWith('blob:')) {
|
|
86
|
+
URL.revokeObjectURL(currentUrl.value)
|
|
87
|
+
}
|
|
88
|
+
currentUrl.value = ''
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function clearUrl() {
|
|
92
|
+
wordUrl.value = ''
|
|
93
|
+
currentUrl.value = ''
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// 重新加载组件
|
|
97
|
+
function reloadComponent() {
|
|
98
|
+
counts.value = false
|
|
99
|
+
nextTick(() => {
|
|
100
|
+
counts.value = true
|
|
101
|
+
})
|
|
102
|
+
}
|
|
103
|
+
</script>
|
|
104
|
+
|
|
105
|
+
<style scoped lang="scss">
|
|
106
|
+
.demo-container {
|
|
107
|
+
padding: 20px;
|
|
108
|
+
max-width: 1400px;
|
|
109
|
+
margin: 0 auto;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.control-panel {
|
|
113
|
+
background: #f5f5f5;
|
|
114
|
+
padding: 20px;
|
|
115
|
+
border-radius: 8px;
|
|
116
|
+
margin-bottom: 20px;
|
|
117
|
+
|
|
118
|
+
h3 {
|
|
119
|
+
margin: 0 0 20px 0;
|
|
120
|
+
color: #333;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
h4 {
|
|
124
|
+
margin: 15px 0 10px 0;
|
|
125
|
+
color: #666;
|
|
126
|
+
font-size: 14px;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.upload-section,
|
|
131
|
+
.url-section {
|
|
132
|
+
margin-bottom: 20px;
|
|
133
|
+
padding: 15px;
|
|
134
|
+
background: white;
|
|
135
|
+
border-radius: 6px;
|
|
136
|
+
border: 1px solid #e0e0e0;
|
|
137
|
+
|
|
138
|
+
input[type='file'] {
|
|
139
|
+
margin-right: 10px;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.url-input {
|
|
143
|
+
width: 300px;
|
|
144
|
+
padding: 8px 12px;
|
|
145
|
+
border: 1px solid #ddd;
|
|
146
|
+
border-radius: 4px;
|
|
147
|
+
margin-right: 10px;
|
|
148
|
+
font-size: 14px;
|
|
149
|
+
|
|
150
|
+
&:focus {
|
|
151
|
+
outline: none;
|
|
152
|
+
border-color: #409eff;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
button {
|
|
157
|
+
padding: 8px 16px;
|
|
158
|
+
background: #409eff;
|
|
159
|
+
color: white;
|
|
160
|
+
border: none;
|
|
161
|
+
border-radius: 4px;
|
|
162
|
+
cursor: pointer;
|
|
163
|
+
margin-right: 10px;
|
|
164
|
+
font-size: 14px;
|
|
165
|
+
|
|
166
|
+
&:hover:not(:disabled) {
|
|
167
|
+
background: #337ecc;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
&:disabled {
|
|
171
|
+
background: #c0c4cc;
|
|
172
|
+
cursor: not-allowed;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.word-container {
|
|
178
|
+
height: 600px;
|
|
179
|
+
border: 1px solid #e0e0e0;
|
|
180
|
+
border-radius: 8px;
|
|
181
|
+
overflow: hidden;
|
|
182
|
+
margin-bottom: 20px;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
@media (max-width: 768px) {
|
|
186
|
+
.url-input {
|
|
187
|
+
width: 100% !important;
|
|
188
|
+
margin-bottom: 10px;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
</style>
|