jobdone-shared-files 1.1.13 → 1.1.14
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/ModalFileRepositorySelector.vue +9 -11
- package/README.md +25 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div id="ModalFileRepository" class="modal fade" :class="subModal ? 'sub-modal' : ''" ref="modalDom"
|
|
2
|
+
<div id="ModalFileRepository" class="modal fade" :class="optionsAdjust.subModal ? 'sub-modal' : ''" ref="modalDom"
|
|
3
3
|
data-bs-backdrop="static" tabindex="-1" role="dialog" aria-hidden="true">
|
|
4
4
|
<div class="modal-dialog modal-dialog-scrollable" :class="classManager.modalSize" role="document">
|
|
5
5
|
<div class="modal-content">
|
|
@@ -82,11 +82,6 @@ import Loading from "./vueLoadingOverlay.vue";
|
|
|
82
82
|
import VueEasyLightbox from 'vue-easy-lightbox';
|
|
83
83
|
|
|
84
84
|
const props = defineProps({
|
|
85
|
-
subModal: {
|
|
86
|
-
// 是否為子視窗(預設 false),子視窗會取消 backdrop-filter 效果,且高度略低於一般Modal
|
|
87
|
-
type: Boolean,
|
|
88
|
-
default: false
|
|
89
|
-
},
|
|
90
85
|
projectId: {
|
|
91
86
|
// 專案ID
|
|
92
87
|
type: String,
|
|
@@ -105,7 +100,8 @@ const props = defineProps({
|
|
|
105
100
|
options: {
|
|
106
101
|
// 額外參數設定
|
|
107
102
|
// {
|
|
108
|
-
//
|
|
103
|
+
// subModal: false, // 是否為子視窗(預設 false),子視窗會取消 backdrop-filter 效果,且高度略低於一般Modal
|
|
104
|
+
// modalSize: 'lg' // Modal的尺寸。可選值:sm, md, lg, xl。預設 'lg',
|
|
109
105
|
// modalTitle: '暫存媒體選擇器' // Modal的標題。預設 '暫存媒體選擇器'
|
|
110
106
|
// modalIcon: 'inventory_2', // Modal的圖示。預設 'inventory_2'
|
|
111
107
|
// onlyMyFileCanSwitch: true, // 是否顯示「僅顯示我的檔案」切換選項。預設 true
|
|
@@ -145,9 +141,13 @@ const optionConfigs = {
|
|
|
145
141
|
validate: (value) => typeof value === 'string' && value.length > 0,
|
|
146
142
|
defaultValue: 'thumbnailUrl'
|
|
147
143
|
},
|
|
144
|
+
subModal: {
|
|
145
|
+
validate: (value) => typeof value === 'boolean',
|
|
146
|
+
defaultValue: false // 是否為子視窗(預設 false),子視窗會取消 backdrop-filter 效果,且高度略低於一般Modal
|
|
147
|
+
},
|
|
148
148
|
modalSize: {
|
|
149
149
|
validate: (value) => typeof value === 'string' && ['sm', 'md', 'lg', 'xl'].includes(value),
|
|
150
|
-
defaultValue: 'lg' // 可選值:sm,
|
|
150
|
+
defaultValue: 'lg' // 可選值:sm, md, lg, xl
|
|
151
151
|
},
|
|
152
152
|
modalTitle: {
|
|
153
153
|
validate: (value) => typeof value === 'string' && value.length > 0,
|
|
@@ -326,7 +326,6 @@ const getRepositoryFiles = async () => {
|
|
|
326
326
|
|
|
327
327
|
const pageResults = await Promise.allSettled(getPromise)
|
|
328
328
|
pageResults.forEach((result) => {
|
|
329
|
-
console.log(result)
|
|
330
329
|
if (result.status === 'rejected') {
|
|
331
330
|
throw new Error('載入檔案列表失敗')
|
|
332
331
|
}
|
|
@@ -349,7 +348,7 @@ const getRepositoryFiles = async () => {
|
|
|
349
348
|
await nextTick()
|
|
350
349
|
checkNeedLoadMore()
|
|
351
350
|
} catch (error) {
|
|
352
|
-
console.
|
|
351
|
+
console.error(error)
|
|
353
352
|
} finally {
|
|
354
353
|
isLoading.value = false
|
|
355
354
|
}
|
|
@@ -386,7 +385,6 @@ const submitSelected = () => {
|
|
|
386
385
|
acc.push(toRaw(item))
|
|
387
386
|
return acc
|
|
388
387
|
}, [])
|
|
389
|
-
// console.log(res)
|
|
390
388
|
emit('submitSelected', res)
|
|
391
389
|
modalHide(modalDom.value)
|
|
392
390
|
}
|
package/README.md
CHANGED
|
@@ -380,6 +380,31 @@ import OOXX from '../../node_modules/jobdone-shared-files/OOXX.vue';
|
|
|
380
380
|
| --------- | ------------------ |
|
|
381
381
|
| select | 選到項目要做什麼 |
|
|
382
382
|
|
|
383
|
+
## 09.ModalFileRepositorySelector
|
|
384
|
+
|
|
385
|
+
### 參數
|
|
386
|
+
|參數|型別|說明|必要|
|
|
387
|
+
|--|--|--|--|
|
|
388
|
+
| `project-id` | `String` | 專案ID | 是 |
|
|
389
|
+
| `user-id` | `String` | 使用者ID | 是 |
|
|
390
|
+
| `api-url` | `String` | 取得檔案列表的 API URL | 是 |
|
|
391
|
+
| `options` | `Object` | 額外參數設定,詳細參考下方| 否 |
|
|
392
|
+
|
|
393
|
+
### options 額外參數設定
|
|
394
|
+
|參數|型別|預設|可用選項|說明|
|
|
395
|
+
|--|--|--|--|--|
|
|
396
|
+
| `subModal` | `Boolean` | `false` | `true` `false` | 是否為子視窗。子視窗會取消 backdrop-filter 效果,且高度略低於一般Modal
|
|
397
|
+
| `modalSize` | `String` | `lg` | `sm` `md` `lg` `xl` | Modal的尺寸
|
|
398
|
+
| `modalTitle` | `String` | `暫存媒體選擇器` | | Modal的標題
|
|
399
|
+
| `modalIcon` | `String` | `inventory_2` | | Modal的圖示(MaterialIcons)
|
|
400
|
+
| `onlyMyFileCanSwitch` | `Boolean` | `true` | `true` `false` | 是否顯示「僅顯示我的檔案」切換選項
|
|
401
|
+
| `onlyMyFileDefaultValue` | `Boolean` | `true` | `true` `false` | 「僅顯示我的檔案」預設選項
|
|
402
|
+
| `bindingKey` | `String` | `uid` | | 選項唯一值的keyName
|
|
403
|
+
| `createAtKey` | `String` | `createAt` | | 檔案建立時間的keyName
|
|
404
|
+
| `fileUrlKey` | `String` | `fileUrl` | | 檔案URL的keyName
|
|
405
|
+
| `thumbnailUrlKey` | `String` | `thumbnailUrl` | | 檔案縮圖URL的keyName
|
|
406
|
+
|
|
407
|
+
|
|
383
408
|
### .
|
|
384
409
|
### .
|
|
385
410
|
### .
|