@moment-design/material-library 0.0.1

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 ADDED
@@ -0,0 +1,125 @@
1
+ # 素材库组件
2
+
3
+ ## 使用组件
4
+
5
+ `安装依赖`
6
+
7
+ ```
8
+ npm install @moment-design/material-library --save
9
+ ```
10
+
11
+ `使用组件`
12
+
13
+ ```ts
14
+ import MMaterialLibrary from "@moment-design/material-library"
15
+
16
+ <MMaterialLibrary
17
+ ref="refLMaterialLibrary"
18
+ :config="config"
19
+ @choose="(v) => (chooseDatas = v)"
20
+ ></MMaterialLibrary>
21
+ ```
22
+
23
+ ## API
24
+
25
+ Props
26
+
27
+ | 参数名 | 描述 | 类型 | 默认值 |
28
+ | -------- | ---------------------------- | ------------ | ------------------------------- |
29
+ | fileType | 素材类型限制 | number | 1[图片],2[文档],3[视频],4[音乐] |
30
+ | dialog | 列表、弹窗样式 | DialogConfig | {} |
31
+ | scroll | 左侧分组、右侧内容滚动条高度 | ScrollConfig | {} |
32
+ | apis | 素材库相关接口 | ApisConfig | {} |
33
+
34
+ DialogConfig
35
+
36
+ | 参数名 | 描述 | 类型 | 默认值 |
37
+ | ------- | ---------- | ------- | -------- |
38
+ | title | 弹窗标题 | string | 选择素材 |
39
+ | visible | 显示/隐藏 | boolean | false |
40
+ | width | 弹出框宽度 | number | 1160 |
41
+
42
+ ScrollConfig
43
+
44
+ | 参数名 | 描述 | 类型 | 默认值 |
45
+ | ------ | ------------------ | ------ | ------- |
46
+ | left | 左侧分组滚动条高度 | string | '460px' |
47
+ | right | 右侧内容滚动条高度 | string | '460px' |
48
+
49
+ ApisConfig
50
+
51
+ | 参数名 | 描述 | 类型 | 默认值 |
52
+ | ------------ | ------------------ | ---- | ------ |
53
+ | getGroupList | 左侧分组滚动条高度 | api | - |
54
+ | postGroup | 右侧内容滚动条高度 | api | - |
55
+ | deleteGroup | 右侧内容滚动条高度 | api | - |
56
+ | getFileList | 右侧内容滚动条高度 | api | - |
57
+ | deleteFile | 右侧内容滚动条高度 | api | - |
58
+ | moveFile | 右侧内容滚动条高度 | api | - |
59
+ | uploadFile | 右侧内容滚动条高度 | api | - |
60
+
61
+ Events
62
+
63
+ | 事件名 | 描述 | 参数 |
64
+ | ------ | ---------- | -------------- |
65
+ | choose | 选中的素材 | (datas: any[]) |
66
+
67
+ Expose
68
+
69
+ | 事件名 | 描述 | 参数 |
70
+ | ------ | ---------------------- | ---- |
71
+ | open | 主动触发打开选择素材库 | - |
72
+
73
+ ## 示例数据
74
+
75
+ ```js
76
+ const config = {
77
+ dialog: {
78
+ visible: false,
79
+ title: '选择素材',
80
+ width: 1160,
81
+ },
82
+ scroll: {
83
+ left: '560px',
84
+ right: '560px',
85
+ },
86
+ fileType: 1,
87
+ apis: useMaterialApis(),
88
+ };
89
+
90
+ const useMaterialApis = {
91
+ getGroupList,
92
+ postGroup,
93
+ deleteGroup,
94
+ getFileList,
95
+ deleteFile,
96
+ moveFile,
97
+ uploadFile,
98
+ };
99
+ ```
100
+
101
+ ## Interface
102
+
103
+ ```js
104
+ export interface IMaterialLibrary {
105
+ dialog: {
106
+ visible: boolean,
107
+ title?: string,
108
+ width?: number,
109
+ };
110
+ scroll?: {
111
+ left?: string,
112
+ right?: string,
113
+ };
114
+ fileType?: 1 | 2 | 3 | 4;
115
+ apis: {
116
+ getGroupList: any,
117
+ postGroup: any,
118
+ deleteGroup: any,
119
+ getFileList: any,
120
+ deleteFile: any,
121
+ moveFile: any,
122
+ uploadFile: any,
123
+ };
124
+ }
125
+ ```
@@ -0,0 +1,301 @@
1
+
2
+ .l-empty img[data-v-603eb7c5] {
3
+ width: 200px;
4
+ height: 129px;
5
+ margin: 0 auto;
6
+ }
7
+ .l-empty header[data-v-603eb7c5] {
8
+ font-size: 14px;
9
+ font-family: PingFangSC-Regular, PingFang SC;
10
+ font-weight: 400;
11
+ color: #55585c;
12
+ line-height: 20px;
13
+ margin-top: 28px;
14
+ }
15
+ .l-empty p[data-v-603eb7c5] {
16
+ font-size: 14px;
17
+ font-weight: 400;
18
+ color: #55585c;
19
+ margin-bottom: 24px;
20
+ }
21
+ .l-material-library-content[data-v-5de89d1b] {
22
+ display: flex;
23
+ align-items: center;
24
+ justify-content: space-between;
25
+ }
26
+ .l-material-library-content .label span[data-v-5de89d1b] {
27
+ color: red;
28
+ position: relative;
29
+ top: 2px;
30
+ margin-right: 6px;
31
+ }
32
+ .l-material-library-content .input[data-v-5de89d1b] {
33
+ width: 390px;
34
+ }
35
+ .l-material-library-group[data-v-072fcc8d] {
36
+ width: 230px;
37
+ margin-right: 24px;
38
+ }
39
+ .l-material-library-group .header[data-v-072fcc8d] {
40
+ margin-bottom: 16px;
41
+ display: flex;
42
+ align-items: center;
43
+ justify-content: space-between;
44
+ }
45
+ .l-material-library-group .header .title[data-v-072fcc8d] {
46
+ font-size: 16px;
47
+ font-weight: 600;
48
+ color: #12141a;
49
+ }
50
+ .l-material-library-group .footer .search[data-v-072fcc8d] {
51
+ margin-bottom: 8px;
52
+ }
53
+ .l-material-library-group .footer .group-items[data-v-072fcc8d] {
54
+ margin-top: 16px;
55
+ }
56
+ .l-material-library-group .footer .group-items .group-item[data-v-072fcc8d] {
57
+ height: 46px;
58
+ display: flex;
59
+ align-items: center;
60
+ justify-content: space-between;
61
+ cursor: pointer;
62
+ }
63
+ .l-material-library-group .footer .group-items .group-item[data-v-072fcc8d]:hover {
64
+ background-color: #f2f3f5;
65
+ }
66
+ .l-material-library-group .footer .group-items .group-item.active[data-v-072fcc8d] {
67
+ background-color: #f4f7ff;
68
+ }
69
+ .l-material-library-group .footer .group-items .group-item .left[data-v-072fcc8d] {
70
+ display: flex;
71
+ align-items: center;
72
+ justify-content: space-between;
73
+ width: 30px;
74
+ padding-left: 8px;
75
+ }
76
+ .l-material-library-group .footer .group-items .group-item .left .folder[data-v-072fcc8d] {
77
+ margin-right: 6px;
78
+ width: 15px;
79
+ height: 15px;
80
+ position: relative;
81
+ top: 1px;
82
+ }
83
+ .l-material-library-group .footer .group-items .group-item .center[data-v-072fcc8d] {
84
+ flex: 1;
85
+ white-space: nowrap;
86
+ overflow: hidden;
87
+ text-overflow: ellipsis;
88
+ }
89
+ .l-material-library-group .footer .group-items .group-item .right[data-v-072fcc8d] {
90
+ width: 30px;
91
+ padding-right: 16px;
92
+ }
93
+ .checkbox-all[data-v-25f305f3] {
94
+ width: 200px;
95
+ margin-top: -38px;
96
+ background-color: #ffffff;
97
+ padding-bottom: 6px;
98
+ }
99
+ .right-apps[data-v-25f305f3] {
100
+ margin-top: 16px;
101
+ display: flex;
102
+ flex-wrap: wrap;
103
+ }
104
+ .right-apps .item[data-v-25f305f3] {
105
+ width: calc(20% - 16px);
106
+ margin-bottom: 16px;
107
+ margin-right: 20px;
108
+ }
109
+ .right-apps .item[data-v-25f305f3]:nth-child(5n) {
110
+ margin-right: 0 !important;
111
+ }
112
+ .right-apps .item .header[data-v-25f305f3] {
113
+ width: 100%;
114
+ height: 168.5px;
115
+ background-color: #f2f3f5;
116
+ background-image: url('https://preapiconsole.71360.com/w3/6p68ov/20250108/1fa412d8d9a8e7c2761d00389d75acec.png');
117
+ background-repeat: no-repeat;
118
+ background-size: 100%;
119
+ background-position: center;
120
+ cursor: pointer;
121
+ }
122
+ .right-apps .item .header img[data-v-25f305f3] {
123
+ max-width: 100%;
124
+ }
125
+ .right-apps .item .footer[data-v-25f305f3] {
126
+ padding: 12px;
127
+ display: flex;
128
+ align-items: center;
129
+ justify-content: space-between;
130
+ border: 1px solid #f2f3f5;
131
+ border-radius: 0 0 4px 4px;
132
+ }
133
+ .right-apps .item .footer .checkbox[data-v-25f305f3] {
134
+ width: 30px;
135
+ position: relative;
136
+ top: 2px;
137
+ left: -6px;
138
+ }
139
+ .right-apps .item .footer .name[data-v-25f305f3] {
140
+ flex: 1;
141
+ margin-left: -8px;
142
+ overflow: hidden;
143
+ }
144
+ .right-apps .item .footer .name .title[data-v-25f305f3] {
145
+ cursor: pointer;
146
+ white-space: nowrap;
147
+ overflow: hidden;
148
+ text-overflow: ellipsis;
149
+ }
150
+ .right-apps .item .footer .icon[data-v-25f305f3] {
151
+ width: 20px;
152
+ text-align: right;
153
+ cursor: pointer;
154
+ }
155
+ .pagination[data-v-25f305f3] {
156
+ display: flex;
157
+ justify-content: flex-end;
158
+ width: 100%;
159
+ margin-top: 16px;
160
+ }
161
+ .l-material-library-infos[data-v-25f305f3] {
162
+ background-color: #ffffff;
163
+ border-radius: 2px;
164
+ padding: 16px;
165
+ box-shadow: 0 4px 16px rgba(78, 89, 105, 0.16);
166
+ word-break: break-all;
167
+ color: #86909c;
168
+ line-height: 1.75;
169
+ }
170
+ .right-menu .l-material-library-infos[data-v-799b8d60] {
171
+ display: flex;
172
+ align-items: center;
173
+ }
174
+ .right-menu .l-material-library-infos .name[data-v-799b8d60] {
175
+ margin-left: 6px;
176
+ font-size: 14px;
177
+ flex: 1;
178
+ cursor: pointer;
179
+ white-space: nowrap;
180
+ overflow: hidden;
181
+ text-overflow: ellipsis;
182
+ }
183
+ .pagination[data-v-799b8d60] {
184
+ display: flex;
185
+ justify-content: flex-end;
186
+ width: 100%;
187
+ margin-top: 16px;
188
+ }
189
+ .l-material-library-info[data-v-799b8d60] {
190
+ background-color: #ffffff;
191
+ border-radius: 2px;
192
+ padding: 16px;
193
+ box-shadow: 0 4px 16px rgba(78, 89, 105, 0.16);
194
+ word-break: break-all;
195
+ color: #86909c;
196
+ line-height: 1.75;
197
+ }
198
+ .change-group-items[data-v-6e55a85d] {
199
+ min-height: 350px;
200
+ }
201
+ .change-group-items .item[data-v-6e55a85d] {
202
+ height: 46px;
203
+ display: flex;
204
+ align-items: center;
205
+ justify-content: space-between;
206
+ cursor: pointer;
207
+ }
208
+ .change-group-items .item[data-v-6e55a85d]:hover {
209
+ background-color: #f2f3f5;
210
+ }
211
+ .change-group-items .item.active[data-v-6e55a85d] {
212
+ background-color: #f4f7ff;
213
+ }
214
+ .change-group-items .item .img[data-v-6e55a85d] {
215
+ display: flex;
216
+ align-items: center;
217
+ justify-content: space-between;
218
+ width: 30px;
219
+ padding-left: 8px;
220
+ }
221
+ .change-group-items .item .img .folder[data-v-6e55a85d] {
222
+ margin-right: 6px;
223
+ width: 15px;
224
+ height: 15px;
225
+ position: relative;
226
+ top: 1px;
227
+ }
228
+ .change-group-items .item .name[data-v-6e55a85d] {
229
+ flex: 1;
230
+ white-space: nowrap;
231
+ overflow: hidden;
232
+ text-overflow: ellipsis;
233
+ }
234
+ .l-material-library-upload .form-item[data-v-642d3522] {
235
+ display: flex;
236
+ align-items: center;
237
+ margin-bottom: 16px;
238
+ }
239
+ .l-material-library-upload .form-item[data-v-642d3522]:not(:last-child) {
240
+ margin-bottom: 16px;
241
+ }
242
+ .l-material-library-upload .form-item .label[data-v-642d3522] {
243
+ width: 70px;
244
+ margin-right: 16px;
245
+ }
246
+ .l-material-library-upload .form-item .label span[data-v-642d3522] {
247
+ color: red;
248
+ margin-right: 4px;
249
+ position: relative;
250
+ top: 2px;
251
+ }
252
+ .l-material-library-upload .upload[data-v-642d3522] {
253
+ margin-top: 16px;
254
+ }
255
+ .l-material-library-upload .upload .tips[data-v-642d3522] {
256
+ margin-bottom: 16px;
257
+ color: #86909c;
258
+ }
259
+ .l-material-library-upload .upload[data-v-642d3522] .mo-upload-progress {
260
+ display: none;
261
+ }
262
+ .l-material-library-right-content[data-v-5294c04c] {
263
+ flex: 1;
264
+ }
265
+ .l-material-library-right-content .header[data-v-5294c04c] {
266
+ display: flex;
267
+ justify-content: space-between;
268
+ }
269
+ .l-material-library-right-content .header .left[data-v-5294c04c] {
270
+ display: flex;
271
+ justify-content: space-between;
272
+ }
273
+ .l-material-library-right-content .header .more-icon-down[data-v-5294c04c] {
274
+ position: relative;
275
+ top: -1px;
276
+ margin-left: 6px;
277
+ font-size: 15px;
278
+ stroke-width: 5;
279
+ }
280
+ .l-material-library-right-content .toolbar[data-v-5294c04c] {
281
+ margin: 16px 0;
282
+ display: flex;
283
+ align-items: center;
284
+ justify-content: space-between;
285
+ }
286
+ .l-material-library-right-content .toolbar .apps[data-v-5294c04c],
287
+ .l-material-library-right-content .toolbar .menu[data-v-5294c04c] {
288
+ margin-left: 8px;
289
+ font-size: 20px;
290
+ stroke-width: 5;
291
+ }
292
+ .l-material-library-right-content .toolbar .apps[data-v-5294c04c]:hover,
293
+ .l-material-library-right-content .toolbar .menu[data-v-5294c04c]:hover,
294
+ .l-material-library-right-content .toolbar .apps.active[data-v-5294c04c],
295
+ .l-material-library-right-content .toolbar .menu.active[data-v-5294c04c] {
296
+ color: #1966ff;
297
+ cursor: pointer;
298
+ }
299
+ .l-material-library[data-v-38949eae] {
300
+ display: flex;
301
+ }
@@ -0,0 +1 @@
1
+ import "./index.less";
File without changes