@netang/quasar 0.1.99 → 0.2.2
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.
|
@@ -100,9 +100,13 @@
|
|
|
100
100
|
v-for="(fileItem, fileItemIndex) in query"
|
|
101
101
|
:key="`query-item-${fileItem.id}`"
|
|
102
102
|
class="n-uploader-query__item n-uploader-query__item--image"
|
|
103
|
-
:class="
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
:class="[
|
|
104
|
+
{
|
|
105
|
+
ghost: fileItemIndex === fromIndex,
|
|
106
|
+
},
|
|
107
|
+
itemClass,
|
|
108
|
+
]"
|
|
109
|
+
:style="itemStyle"
|
|
106
110
|
:draggable="currentDrag"
|
|
107
111
|
@mousedown.self="mousedown($event, fileItemIndex)"
|
|
108
112
|
@mouseup="dragEnd"
|
|
@@ -173,6 +177,7 @@
|
|
|
173
177
|
<slot
|
|
174
178
|
name="settings"
|
|
175
179
|
:file="fileItem"
|
|
180
|
+
:index="fileItemIndex"
|
|
176
181
|
/>
|
|
177
182
|
|
|
178
183
|
<!-- 预览 -->
|
|
@@ -198,7 +203,15 @@
|
|
|
198
203
|
/>
|
|
199
204
|
|
|
200
205
|
</div>
|
|
206
|
+
|
|
207
|
+
<!-- 插槽-->
|
|
208
|
+
<slot
|
|
209
|
+
name="item-append"
|
|
210
|
+
:file="fileItem"
|
|
211
|
+
:index="fileItemIndex"
|
|
212
|
+
/>
|
|
201
213
|
</n-img>
|
|
214
|
+
|
|
202
215
|
</div>
|
|
203
216
|
|
|
204
217
|
<!-- 右边方块按钮 -->
|
|
@@ -236,12 +249,18 @@
|
|
|
236
249
|
v-for="(fileItem, fileItemIndex) in query"
|
|
237
250
|
:key="`query-item-${fileItem.id}`"
|
|
238
251
|
class="n-uploader-query__item n-uploader-query__item--file"
|
|
239
|
-
:class="
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
252
|
+
:class="[
|
|
253
|
+
{
|
|
254
|
+
ghost: fileItemIndex === fromIndex,
|
|
255
|
+
},
|
|
256
|
+
itemClass,
|
|
257
|
+
]"
|
|
258
|
+
:style="[
|
|
259
|
+
{
|
|
260
|
+
height: toPx(currentSize),
|
|
261
|
+
},
|
|
262
|
+
itemStyle,
|
|
263
|
+
]"
|
|
245
264
|
:draggable="currentDrag"
|
|
246
265
|
@mousedown.self="mousedown($event, fileItemIndex)"
|
|
247
266
|
@mouseup="dragEnd"
|
|
@@ -321,6 +340,7 @@
|
|
|
321
340
|
<slot
|
|
322
341
|
name="settings"
|
|
323
342
|
:file="fileItem"
|
|
343
|
+
:index="fileItemIndex"
|
|
324
344
|
/>
|
|
325
345
|
|
|
326
346
|
<template v-if="fileItem.status === UPLOAD_STATUS.success">
|
|
@@ -381,6 +401,14 @@
|
|
|
381
401
|
v-if="! noDelete && ! disable && ! readonly"
|
|
382
402
|
/>
|
|
383
403
|
</div>
|
|
404
|
+
|
|
405
|
+
<!-- 插槽-->
|
|
406
|
+
<slot
|
|
407
|
+
name="item-append"
|
|
408
|
+
:file="fileItem"
|
|
409
|
+
:index="fileItemIndex"
|
|
410
|
+
/>
|
|
411
|
+
|
|
384
412
|
</div>
|
|
385
413
|
</template>
|
|
386
414
|
</n-dragger>
|
|
@@ -429,6 +457,10 @@ export default {
|
|
|
429
457
|
* 声明属性
|
|
430
458
|
*/
|
|
431
459
|
props: {
|
|
460
|
+
// 单个文件类名
|
|
461
|
+
itemClass: [String, Array, Object],
|
|
462
|
+
// 单个文件样式
|
|
463
|
+
itemStyle: [String, Array, Object],
|
|
432
464
|
// 按钮类型, 可选值 square button
|
|
433
465
|
buttonType: {
|
|
434
466
|
type: String,
|
package/package.json
CHANGED
package/utils/uploader.js
CHANGED
|
@@ -33,6 +33,7 @@ import $n_previewImage from './previewImage'
|
|
|
33
33
|
import $n_getImage from './getImage'
|
|
34
34
|
import $n_getFile from './getFile'
|
|
35
35
|
import $n_config from './config'
|
|
36
|
+
import $n_timestamp from './timestamp'
|
|
36
37
|
|
|
37
38
|
import { configs } from './config'
|
|
38
39
|
|
|
@@ -538,7 +539,7 @@ function create(options) {
|
|
|
538
539
|
// 如果有后缀名
|
|
539
540
|
if (ext) {
|
|
540
541
|
// 设置文件
|
|
541
|
-
fileItem.file = new File([blob],
|
|
542
|
+
fileItem.file = new File([blob], String($n_timestamp()), { type: blob.type })
|
|
542
543
|
// 设置后缀名
|
|
543
544
|
fileItem.ext = ext
|
|
544
545
|
|
|
@@ -567,7 +568,7 @@ function create(options) {
|
|
|
567
568
|
// 设置文件 hash
|
|
568
569
|
fileItem.hash = hash
|
|
569
570
|
// 标题
|
|
570
|
-
fileItem.title =
|
|
571
|
+
fileItem.title = ''
|
|
571
572
|
// 设置文件状态
|
|
572
573
|
fileItem.status = UPLOAD_STATUS.hashChecked
|
|
573
574
|
// 设置文件检查进度
|