@cmstops/pro-compo 0.3.31 → 0.3.33
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/dist/index.css +212 -0
- package/dist/index.min.css +1 -1
- package/es/hooks/useAttachement.d.ts +20 -0
- package/es/hooks/useAttachement.js +95 -0
- package/es/hooks/useSelection.d.ts +23 -0
- package/es/hooks/useSelection.js +59 -0
- package/es/index.css +212 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +2 -0
- package/es/index.less +2 -0
- package/es/selectResourceModal/component.d.ts +0 -0
- package/es/selectResourceModal/component.js +211 -0
- package/es/selectResourceModal/components/ListContent/index.d.ts +0 -0
- package/es/selectResourceModal/components/ListContent/index.js +92 -0
- package/es/selectResourceModal/components/ListFilter/index.d.ts +0 -0
- package/es/selectResourceModal/components/ListFilter/index.js +259 -0
- package/es/selectResourceModal/components/ListFilter/scripts/api.d.ts +1 -0
- package/es/selectResourceModal/components/ListFilter/scripts/api.js +9 -0
- package/es/selectResourceModal/components/ListSelected/index.d.ts +0 -0
- package/es/selectResourceModal/components/ListSelected/index.js +91 -0
- package/es/selectResourceModal/index.d.ts +2 -0
- package/es/selectResourceModal/index.js +7 -0
- package/es/selectResourceModal/style/css.js +1 -0
- package/es/selectResourceModal/style/index.css +159 -0
- package/es/selectResourceModal/style/index.d.ts +1 -0
- package/es/selectResourceModal/style/index.js +1 -0
- package/es/selectResourceModal/style/index.less +43 -0
- package/es/selectResourceModal/style/listContent.less +67 -0
- package/es/selectResourceModal/style/listFilter.less +17 -0
- package/es/selectResourceModal/style/listSelected.less +67 -0
- package/es/thumbCard/component.d.ts +0 -0
- package/es/thumbCard/component.js +114 -0
- package/es/thumbCard/index.d.ts +2 -0
- package/es/thumbCard/index.js +7 -0
- package/es/thumbCard/style/css.js +1 -0
- package/es/thumbCard/style/index.css +53 -0
- package/es/thumbCard/style/index.d.ts +1 -0
- package/es/thumbCard/style/index.js +1 -0
- package/es/thumbCard/style/index.less +70 -0
- package/es/utils/typeMap.d.ts +19 -0
- package/es/utils/typeMap.js +17 -1
- package/lib/hooks/useAttachement.js +100 -0
- package/lib/hooks/useSelection.js +60 -0
- package/lib/index.css +212 -0
- package/lib/index.js +4 -0
- package/lib/index.less +2 -0
- package/lib/selectResourceModal/component.js +212 -0
- package/lib/selectResourceModal/components/ListContent/index.js +93 -0
- package/lib/selectResourceModal/components/ListFilter/index.js +260 -0
- package/lib/selectResourceModal/components/ListFilter/scripts/api.js +11 -0
- package/lib/selectResourceModal/components/ListSelected/index.js +92 -0
- package/lib/selectResourceModal/index.js +8 -0
- package/lib/selectResourceModal/style/css.js +2 -0
- package/lib/selectResourceModal/style/index.css +159 -0
- package/lib/selectResourceModal/style/index.js +2 -0
- package/lib/selectResourceModal/style/index.less +43 -0
- package/lib/selectResourceModal/style/listContent.less +67 -0
- package/lib/selectResourceModal/style/listFilter.less +17 -0
- package/lib/selectResourceModal/style/listSelected.less +67 -0
- package/lib/thumbCard/component.js +115 -0
- package/lib/thumbCard/index.js +8 -0
- package/lib/thumbCard/style/css.js +2 -0
- package/lib/thumbCard/style/index.css +53 -0
- package/lib/thumbCard/style/index.js +2 -0
- package/lib/thumbCard/style/index.less +70 -0
- package/lib/utils/typeMap.js +20 -0
- package/package.json +2 -2
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare function getAttachmentsAll(BASE_API: string, query?: any): import("axios").AxiosPromise<any>;
|
|
2
|
+
export declare function getAttachmentsMy(BASE_API: string, query?: any): import("axios").AxiosPromise<any>;
|
|
3
|
+
export declare function getAttachmentsMyMessage(BASE_API: string, query: any): import("axios").AxiosPromise<any>;
|
|
4
|
+
declare type OptionsType = {
|
|
5
|
+
key: string;
|
|
6
|
+
BASE_API: string;
|
|
7
|
+
};
|
|
8
|
+
export default function useAttachement(options: OptionsType): {
|
|
9
|
+
list: import("vue").Ref<any[]>;
|
|
10
|
+
total: import("vue").Ref<number>;
|
|
11
|
+
limit: import("vue").Ref<number>;
|
|
12
|
+
offset: import("vue").Ref<number>;
|
|
13
|
+
loading: import("vue").Ref<boolean>;
|
|
14
|
+
changeFilter: (f: any) => void;
|
|
15
|
+
changeKey: (k: string) => void;
|
|
16
|
+
changePage: (o: number) => void;
|
|
17
|
+
changeSize: (s: number) => void;
|
|
18
|
+
loadData: () => Promise<void>;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { ref, computed } from "vue";
|
|
2
|
+
import request from "../utils/request.js";
|
|
3
|
+
function getAttachmentsAll(BASE_API, query) {
|
|
4
|
+
return request(BASE_API, {
|
|
5
|
+
url: `/poplar/v3/attachments`,
|
|
6
|
+
method: "get",
|
|
7
|
+
params: query
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
function getAttachmentsMy(BASE_API, query) {
|
|
11
|
+
return request(BASE_API, {
|
|
12
|
+
url: `/poplar/v3/my/attachments`,
|
|
13
|
+
method: "get",
|
|
14
|
+
params: query
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function getAttachmentsMyMessage(BASE_API, query) {
|
|
18
|
+
return request(BASE_API, {
|
|
19
|
+
url: `/poplar/v3/remind/to/my/attachments`,
|
|
20
|
+
method: "get",
|
|
21
|
+
params: query
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function useAttachement(options) {
|
|
25
|
+
const key = ref(options.key);
|
|
26
|
+
const limit = ref(20);
|
|
27
|
+
const offset = ref(0);
|
|
28
|
+
const filter = ref({});
|
|
29
|
+
const params = computed(() => {
|
|
30
|
+
return {
|
|
31
|
+
limit: limit.value,
|
|
32
|
+
offset: offset.value,
|
|
33
|
+
...filter.value
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
const loading = ref(true);
|
|
37
|
+
const list = ref([]);
|
|
38
|
+
const total = ref(0);
|
|
39
|
+
async function loadData() {
|
|
40
|
+
let apiFunc;
|
|
41
|
+
if (key.value === "all")
|
|
42
|
+
apiFunc = getAttachmentsAll;
|
|
43
|
+
if (key.value === "my")
|
|
44
|
+
apiFunc = getAttachmentsMy;
|
|
45
|
+
if (key.value === "remind")
|
|
46
|
+
apiFunc = getAttachmentsMyMessage;
|
|
47
|
+
list.value = [];
|
|
48
|
+
if (!apiFunc)
|
|
49
|
+
return;
|
|
50
|
+
loading.value = true;
|
|
51
|
+
try {
|
|
52
|
+
const { code, message } = await apiFunc(options.BASE_API, params.value);
|
|
53
|
+
if (code !== 0)
|
|
54
|
+
return;
|
|
55
|
+
const { data, count } = message;
|
|
56
|
+
list.value = data || [];
|
|
57
|
+
total.value = count;
|
|
58
|
+
} catch (e) {
|
|
59
|
+
console.log("\u83B7\u53D6\u7D20\u6750\u5217\u8868\u5F02\u5E38", e);
|
|
60
|
+
} finally {
|
|
61
|
+
loading.value = false;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function changePage(o) {
|
|
65
|
+
offset.value = o;
|
|
66
|
+
loadData();
|
|
67
|
+
}
|
|
68
|
+
function changeSize(s) {
|
|
69
|
+
limit.value = s;
|
|
70
|
+
loadData();
|
|
71
|
+
}
|
|
72
|
+
function changeKey(k) {
|
|
73
|
+
if (k === key.value)
|
|
74
|
+
return;
|
|
75
|
+
key.value = k;
|
|
76
|
+
changePage(0);
|
|
77
|
+
}
|
|
78
|
+
function changeFilter(f) {
|
|
79
|
+
filter.value = f;
|
|
80
|
+
changePage(0);
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
list,
|
|
84
|
+
total,
|
|
85
|
+
limit,
|
|
86
|
+
offset,
|
|
87
|
+
loading,
|
|
88
|
+
changeFilter,
|
|
89
|
+
changeKey,
|
|
90
|
+
changePage,
|
|
91
|
+
changeSize,
|
|
92
|
+
loadData
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
export { useAttachement as default, getAttachmentsAll, getAttachmentsMy, getAttachmentsMyMessage };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare type QueryParams = {
|
|
2
|
+
limit: number;
|
|
3
|
+
offset: number;
|
|
4
|
+
keyword: string;
|
|
5
|
+
others?: any;
|
|
6
|
+
};
|
|
7
|
+
declare type HookOptionParams = {
|
|
8
|
+
labelStr: string;
|
|
9
|
+
valueStr: string;
|
|
10
|
+
func: (params: QueryParams) => any;
|
|
11
|
+
};
|
|
12
|
+
export default function useSelection(params: HookOptionParams): {
|
|
13
|
+
options: import("vue").Ref<{
|
|
14
|
+
label: string;
|
|
15
|
+
value: any;
|
|
16
|
+
}[]>;
|
|
17
|
+
loading: import("vue").Ref<boolean>;
|
|
18
|
+
keyword: import("vue").Ref<string>;
|
|
19
|
+
load: (more?: boolean | undefined) => Promise<void>;
|
|
20
|
+
handleSearch: (kw: string) => void;
|
|
21
|
+
loadMore: () => void;
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ref, computed } from "vue";
|
|
2
|
+
function getLabelValue(list, options) {
|
|
3
|
+
const { labelStr, valueStr } = options;
|
|
4
|
+
return list.map((item) => {
|
|
5
|
+
return {
|
|
6
|
+
label: item[labelStr],
|
|
7
|
+
value: item[valueStr]
|
|
8
|
+
};
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
function useSelection(params) {
|
|
12
|
+
const { func, labelStr, valueStr } = params;
|
|
13
|
+
const lVParams = { labelStr, valueStr };
|
|
14
|
+
const limit = ref(10);
|
|
15
|
+
const offset = ref(0);
|
|
16
|
+
const keyword = ref("");
|
|
17
|
+
const options = ref([]);
|
|
18
|
+
const loading = ref(false);
|
|
19
|
+
const queryParams = computed(() => {
|
|
20
|
+
return {
|
|
21
|
+
limit: limit.value,
|
|
22
|
+
offset: offset.value,
|
|
23
|
+
keyword: keyword.value
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
async function load(more) {
|
|
27
|
+
loading.value = !more;
|
|
28
|
+
try {
|
|
29
|
+
const list = await func(queryParams.value);
|
|
30
|
+
if (more) {
|
|
31
|
+
options.value = options.value.concat(getLabelValue(list, lVParams));
|
|
32
|
+
} else {
|
|
33
|
+
options.value = getLabelValue(list, lVParams);
|
|
34
|
+
}
|
|
35
|
+
} catch (e) {
|
|
36
|
+
console.log(e);
|
|
37
|
+
} finally {
|
|
38
|
+
loading.value = false;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function loadMore() {
|
|
42
|
+
offset.value += limit.value;
|
|
43
|
+
load(true);
|
|
44
|
+
}
|
|
45
|
+
function handleSearch(kw) {
|
|
46
|
+
keyword.value = kw;
|
|
47
|
+
offset.value = 0;
|
|
48
|
+
load();
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
options,
|
|
52
|
+
loading,
|
|
53
|
+
keyword,
|
|
54
|
+
load,
|
|
55
|
+
handleSearch,
|
|
56
|
+
loadMore
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export { useSelection as default };
|
package/es/index.css
CHANGED
|
@@ -4243,3 +4243,215 @@
|
|
|
4243
4243
|
color: #fff;
|
|
4244
4244
|
font-size: 18px;
|
|
4245
4245
|
}
|
|
4246
|
+
.thumb-select-wrapper {
|
|
4247
|
+
position: relative;
|
|
4248
|
+
display: flex;
|
|
4249
|
+
align-items: center;
|
|
4250
|
+
justify-content: center;
|
|
4251
|
+
width: 100%;
|
|
4252
|
+
height: 100%;
|
|
4253
|
+
overflow: hidden;
|
|
4254
|
+
border-radius: 2px;
|
|
4255
|
+
cursor: pointer;
|
|
4256
|
+
}
|
|
4257
|
+
.thumb-select-wrapper .thumb-add {
|
|
4258
|
+
color: var(--color-text-2);
|
|
4259
|
+
font-size: 16px;
|
|
4260
|
+
cursor: pointer;
|
|
4261
|
+
}
|
|
4262
|
+
.thumb-select-wrapper .thumb-image img {
|
|
4263
|
+
width: 100%;
|
|
4264
|
+
height: 100%;
|
|
4265
|
+
}
|
|
4266
|
+
.thumb-select-wrapper .thumb-handler-list {
|
|
4267
|
+
position: absolute;
|
|
4268
|
+
bottom: 0;
|
|
4269
|
+
display: flex;
|
|
4270
|
+
gap: 10px;
|
|
4271
|
+
align-items: center;
|
|
4272
|
+
justify-content: center;
|
|
4273
|
+
width: 100%;
|
|
4274
|
+
height: 40px;
|
|
4275
|
+
opacity: 0;
|
|
4276
|
+
transition: all 0.3s ease-in-out;
|
|
4277
|
+
}
|
|
4278
|
+
.thumb-select-wrapper .thumb-handler-list .handler-item {
|
|
4279
|
+
padding: 0 8px;
|
|
4280
|
+
color: #fff;
|
|
4281
|
+
font-size: 12px;
|
|
4282
|
+
line-height: 26px;
|
|
4283
|
+
background-color: #000000b3;
|
|
4284
|
+
border-radius: 2px;
|
|
4285
|
+
cursor: pointer;
|
|
4286
|
+
}
|
|
4287
|
+
.thumb-select-wrapper .thumb-handler-list .handler-item:hover {
|
|
4288
|
+
color: rgba(255, 255, 255, 0.7);
|
|
4289
|
+
}
|
|
4290
|
+
.thumb-select-wrapper:hover .thumb-handler-list {
|
|
4291
|
+
opacity: 1;
|
|
4292
|
+
}
|
|
4293
|
+
.arco-dropdown-option-content {
|
|
4294
|
+
display: flex;
|
|
4295
|
+
gap: 8px;
|
|
4296
|
+
align-items: center;
|
|
4297
|
+
font-size: 14px;
|
|
4298
|
+
}
|
|
4299
|
+
.card-list-wrapper {
|
|
4300
|
+
display: grid;
|
|
4301
|
+
grid-gap: 20px;
|
|
4302
|
+
grid-template-columns: repeat(4, 1fr);
|
|
4303
|
+
}
|
|
4304
|
+
.card-list-wrapper .card-wrapper-image {
|
|
4305
|
+
position: relative;
|
|
4306
|
+
overflow: hidden;
|
|
4307
|
+
}
|
|
4308
|
+
.card-list-wrapper .card-wrapper-image .card-wrapper {
|
|
4309
|
+
overflow: hidden;
|
|
4310
|
+
aspect-ratio: 4 / 3;
|
|
4311
|
+
}
|
|
4312
|
+
.card-list-wrapper .card-wrapper-image .card-alias {
|
|
4313
|
+
width: 100%;
|
|
4314
|
+
margin-top: 6px;
|
|
4315
|
+
overflow: hidden;
|
|
4316
|
+
color: #3d3d3d;
|
|
4317
|
+
font-size: 14px;
|
|
4318
|
+
line-height: 22px;
|
|
4319
|
+
white-space: nowrap;
|
|
4320
|
+
text-overflow: ellipsis;
|
|
4321
|
+
}
|
|
4322
|
+
.card-list-wrapper .card-wrapper-image:hover .check-box-wrapper .check-box,
|
|
4323
|
+
.card-list-wrapper .card-wrapper-image .check-box-wrapper .check-box.active {
|
|
4324
|
+
opacity: 1;
|
|
4325
|
+
}
|
|
4326
|
+
.card-list-wrapper .card-wrapper-image .check-box-wrapper {
|
|
4327
|
+
position: absolute;
|
|
4328
|
+
top: 8px;
|
|
4329
|
+
left: 8px;
|
|
4330
|
+
cursor: pointer;
|
|
4331
|
+
}
|
|
4332
|
+
.card-list-wrapper .card-wrapper-image .check-box-wrapper .check-box {
|
|
4333
|
+
box-sizing: border-box;
|
|
4334
|
+
width: 22px;
|
|
4335
|
+
height: 22px;
|
|
4336
|
+
font-size: 14px;
|
|
4337
|
+
line-height: 22px;
|
|
4338
|
+
text-align: center;
|
|
4339
|
+
background-color: rgba(0, 0, 0, 0.2);
|
|
4340
|
+
border: 1px solid white;
|
|
4341
|
+
border-radius: 50%;
|
|
4342
|
+
opacity: 0;
|
|
4343
|
+
transition: all 0.3s ease-in-out;
|
|
4344
|
+
}
|
|
4345
|
+
.card-list-wrapper .card-wrapper-image .check-box-wrapper .check-box::selection {
|
|
4346
|
+
display: none;
|
|
4347
|
+
}
|
|
4348
|
+
.card-list-wrapper .card-wrapper-image .check-box-wrapper .check-box:hover {
|
|
4349
|
+
background-color: rgba(0, 0, 0, 0.3);
|
|
4350
|
+
}
|
|
4351
|
+
.card-list-wrapper .card-wrapper-image .check-box-wrapper .check-box.active {
|
|
4352
|
+
color: white;
|
|
4353
|
+
background-color: #165dff;
|
|
4354
|
+
border-color: #165dff;
|
|
4355
|
+
}
|
|
4356
|
+
.list-filter-wrapper {
|
|
4357
|
+
display: flex;
|
|
4358
|
+
justify-content: space-between;
|
|
4359
|
+
}
|
|
4360
|
+
.list-filter-wrapper .filter-list {
|
|
4361
|
+
display: flex;
|
|
4362
|
+
gap: 10px;
|
|
4363
|
+
}
|
|
4364
|
+
.list-filter-wrapper .filter-list .filter-item {
|
|
4365
|
+
width: 100px;
|
|
4366
|
+
}
|
|
4367
|
+
.list-filter-wrapper .arco-input-prepend {
|
|
4368
|
+
padding: 0;
|
|
4369
|
+
}
|
|
4370
|
+
.list-panel-wrapper {
|
|
4371
|
+
width: 420px;
|
|
4372
|
+
max-height: 600px;
|
|
4373
|
+
padding: 0 !important;
|
|
4374
|
+
overflow: hidden;
|
|
4375
|
+
border: none;
|
|
4376
|
+
border-radius: 4px;
|
|
4377
|
+
box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.1);
|
|
4378
|
+
}
|
|
4379
|
+
.list-panel-wrapper * {
|
|
4380
|
+
user-select: none;
|
|
4381
|
+
}
|
|
4382
|
+
.list-panel-wrapper *::selection {
|
|
4383
|
+
display: none;
|
|
4384
|
+
}
|
|
4385
|
+
.list-panel-wrapper .arco-popover-content {
|
|
4386
|
+
margin-top: 0;
|
|
4387
|
+
}
|
|
4388
|
+
.list-panel-wrapper .list-panel-header {
|
|
4389
|
+
display: flex;
|
|
4390
|
+
align-items: center;
|
|
4391
|
+
justify-content: space-between;
|
|
4392
|
+
padding: 11px 15px;
|
|
4393
|
+
color: white;
|
|
4394
|
+
font-weight: 500;
|
|
4395
|
+
background-color: #165dff;
|
|
4396
|
+
}
|
|
4397
|
+
.list-panel-wrapper .list-panel-header .header-options {
|
|
4398
|
+
display: flex;
|
|
4399
|
+
gap: 12px;
|
|
4400
|
+
align-items: center;
|
|
4401
|
+
}
|
|
4402
|
+
.list-panel-wrapper .list-panel-header .header-options div {
|
|
4403
|
+
cursor: pointer;
|
|
4404
|
+
}
|
|
4405
|
+
.list-panel-wrapper .list-selected-record {
|
|
4406
|
+
display: flex;
|
|
4407
|
+
flex-direction: column;
|
|
4408
|
+
}
|
|
4409
|
+
.list-panel-wrapper .list-selected-record .list-selected-item {
|
|
4410
|
+
display: flex;
|
|
4411
|
+
gap: 12px;
|
|
4412
|
+
align-items: center;
|
|
4413
|
+
padding: 9px 16px;
|
|
4414
|
+
overflow: hidden;
|
|
4415
|
+
}
|
|
4416
|
+
.list-panel-wrapper .list-selected-record .list-selected-item .item-thumb {
|
|
4417
|
+
width: 50px;
|
|
4418
|
+
height: 38px;
|
|
4419
|
+
overflow: hidden;
|
|
4420
|
+
}
|
|
4421
|
+
.list-panel-wrapper .list-selected-record .list-selected-item .item-alias {
|
|
4422
|
+
flex: 1;
|
|
4423
|
+
overflow: hidden;
|
|
4424
|
+
white-space: nowrap;
|
|
4425
|
+
text-overflow: ellipsis;
|
|
4426
|
+
}
|
|
4427
|
+
.resource-select-container {
|
|
4428
|
+
display: flex;
|
|
4429
|
+
flex-direction: column;
|
|
4430
|
+
gap: 10px;
|
|
4431
|
+
box-sizing: border-box;
|
|
4432
|
+
height: 100%;
|
|
4433
|
+
}
|
|
4434
|
+
.resource-select-container .resource-select-filter,
|
|
4435
|
+
.resource-select-container .resource-select-content,
|
|
4436
|
+
.resource-select-container .resource-select-footer {
|
|
4437
|
+
padding: 0 16px 0;
|
|
4438
|
+
}
|
|
4439
|
+
.resource-select-container .resource-select-header .arco-tabs-nav::before {
|
|
4440
|
+
display: none;
|
|
4441
|
+
}
|
|
4442
|
+
.resource-select-container .resource-select-header .arco-tabs-content {
|
|
4443
|
+
display: none !important;
|
|
4444
|
+
}
|
|
4445
|
+
.resource-select-container .resource-select-content {
|
|
4446
|
+
flex: 1;
|
|
4447
|
+
overflow: hidden;
|
|
4448
|
+
}
|
|
4449
|
+
.resource-select-container .resource-select-footer {
|
|
4450
|
+
display: flex;
|
|
4451
|
+
justify-content: space-between;
|
|
4452
|
+
}
|
|
4453
|
+
.resource-select-container .resource-select-footer .footer-right {
|
|
4454
|
+
display: flex;
|
|
4455
|
+
gap: 10px;
|
|
4456
|
+
align-items: center;
|
|
4457
|
+
}
|
package/es/index.d.ts
CHANGED
|
@@ -22,3 +22,5 @@ export { default as dataTags } from './dataTags';
|
|
|
22
22
|
export { default as colorPalette } from './colorPalette';
|
|
23
23
|
export { default as resourceGridList } from './resourceGridList';
|
|
24
24
|
export { default as mediaView } from './mediaView';
|
|
25
|
+
export { default as thumbCard } from './thumbCard';
|
|
26
|
+
export { default as selectResourceModal } from './selectResourceModal';
|
package/es/index.js
CHANGED
|
@@ -22,3 +22,5 @@ export { default as dataTags } from "./dataTags/index.js";
|
|
|
22
22
|
export { default as colorPalette } from "./colorPalette/index.js";
|
|
23
23
|
export { default as resourceGridList } from "./resourceGridList/index.js";
|
|
24
24
|
export { default as mediaView } from "./mediaView/index.js";
|
|
25
|
+
export { default as thumbCard } from "./thumbCard/index.js";
|
|
26
|
+
export { default as selectResourceModal } from "./selectResourceModal/index.js";
|
package/es/index.less
CHANGED
|
File without changes
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { defineComponent, ref, provide, computed, onMounted, openBlock, createBlock, unref, withCtx, createElementBlock, createCommentVNode, createElementVNode, createVNode, createTextVNode } from "vue";
|
|
2
|
+
import { Drawer, Tabs, Button, TabPane, Scrollbar, Pagination } from "@arco-design/web-vue";
|
|
3
|
+
import emptyData from "../emptyData/index.js";
|
|
4
|
+
import _sfc_main$1 from "./components/ListFilter/index.js";
|
|
5
|
+
import _sfc_main$2 from "./components/ListContent/index.js";
|
|
6
|
+
import _sfc_main$3 from "./components/ListSelected/index.js";
|
|
7
|
+
import useAttachement from "../hooks/useAttachement.js";
|
|
8
|
+
import { DEFAULT_BASE_API } from "../config.js";
|
|
9
|
+
const _hoisted_1 = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "resource-select-container"
|
|
12
|
+
};
|
|
13
|
+
const _hoisted_2 = { class: "resource-select-header" };
|
|
14
|
+
const _hoisted_3 = {
|
|
15
|
+
key: 0,
|
|
16
|
+
class: "resource-select-filter"
|
|
17
|
+
};
|
|
18
|
+
const _hoisted_4 = { class: "resource-select-content" };
|
|
19
|
+
const _hoisted_5 = { class: "resource-select-footer" };
|
|
20
|
+
const _hoisted_6 = { class: "footer-left" };
|
|
21
|
+
const _hoisted_7 = {
|
|
22
|
+
key: 0,
|
|
23
|
+
class: "footer-right"
|
|
24
|
+
};
|
|
25
|
+
const _sfc_main = defineComponent({
|
|
26
|
+
...{ name: "selectResourceModal" },
|
|
27
|
+
__name: "component",
|
|
28
|
+
props: {
|
|
29
|
+
BASE_API: {},
|
|
30
|
+
visible: { type: Boolean },
|
|
31
|
+
userInfo: {},
|
|
32
|
+
maxcount: {}
|
|
33
|
+
},
|
|
34
|
+
emits: ["update:visible", "submit"],
|
|
35
|
+
setup(__props, { emit: __emit }) {
|
|
36
|
+
const props = __props;
|
|
37
|
+
const emits = __emit;
|
|
38
|
+
const BASE_API = props.BASE_API || DEFAULT_BASE_API;
|
|
39
|
+
const activeKey = ref("all");
|
|
40
|
+
provide("userInfo", computed(() => props.userInfo));
|
|
41
|
+
provide("baseAPI", BASE_API);
|
|
42
|
+
const {
|
|
43
|
+
list,
|
|
44
|
+
total,
|
|
45
|
+
limit,
|
|
46
|
+
loading,
|
|
47
|
+
changeKey,
|
|
48
|
+
changeFilter,
|
|
49
|
+
changePage,
|
|
50
|
+
changeSize,
|
|
51
|
+
loadData
|
|
52
|
+
} = useAttachement({ key: "all", BASE_API });
|
|
53
|
+
const selected = ref([]);
|
|
54
|
+
const selectedKeys = computed(() => selected.value.map((item) => item.id));
|
|
55
|
+
const disableSelect = computed(() => props.maxcount && selected.value.length >= props.maxcount);
|
|
56
|
+
function handleSelect(params) {
|
|
57
|
+
const { id } = params;
|
|
58
|
+
const index = selected.value.findIndex((item) => item.id === id);
|
|
59
|
+
if (index > -1)
|
|
60
|
+
selected.value.splice(index, 1);
|
|
61
|
+
else
|
|
62
|
+
selected.value.push(params);
|
|
63
|
+
}
|
|
64
|
+
function handleClear() {
|
|
65
|
+
selected.value = [];
|
|
66
|
+
}
|
|
67
|
+
function handleClose() {
|
|
68
|
+
handleClear();
|
|
69
|
+
emits("update:visible", false);
|
|
70
|
+
}
|
|
71
|
+
const handleSelectOne = (params) => {
|
|
72
|
+
if (Array.isArray(params))
|
|
73
|
+
emits("submit", params);
|
|
74
|
+
else
|
|
75
|
+
emits("submit", [params]);
|
|
76
|
+
handleClose();
|
|
77
|
+
};
|
|
78
|
+
function handleConfirm() {
|
|
79
|
+
handleSelectOne(selected.value);
|
|
80
|
+
}
|
|
81
|
+
function handleToUpload() {
|
|
82
|
+
changeKey("local");
|
|
83
|
+
activeKey.value = "local";
|
|
84
|
+
}
|
|
85
|
+
onMounted(() => {
|
|
86
|
+
loadData();
|
|
87
|
+
});
|
|
88
|
+
return (_ctx, _cache) => {
|
|
89
|
+
return openBlock(), createBlock(unref(Drawer), {
|
|
90
|
+
visible: _ctx.visible,
|
|
91
|
+
width: "1024px",
|
|
92
|
+
header: false,
|
|
93
|
+
footer: false
|
|
94
|
+
}, {
|
|
95
|
+
default: withCtx(() => [
|
|
96
|
+
_ctx.userInfo ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
97
|
+
createCommentVNode(" \u5934\u90E8 "),
|
|
98
|
+
createElementVNode("div", _hoisted_2, [
|
|
99
|
+
createVNode(unref(Tabs), {
|
|
100
|
+
"active-key": activeKey.value,
|
|
101
|
+
"onUpdate:activeKey": _cache[0] || (_cache[0] = ($event) => activeKey.value = $event),
|
|
102
|
+
onChange: unref(changeKey)
|
|
103
|
+
}, {
|
|
104
|
+
extra: withCtx(() => [
|
|
105
|
+
createVNode(unref(Button), {
|
|
106
|
+
type: "text",
|
|
107
|
+
onClick: handleClose
|
|
108
|
+
}, {
|
|
109
|
+
default: withCtx(() => [
|
|
110
|
+
createTextVNode("\u5173\u95ED")
|
|
111
|
+
]),
|
|
112
|
+
_: 1
|
|
113
|
+
})
|
|
114
|
+
]),
|
|
115
|
+
default: withCtx(() => [
|
|
116
|
+
createVNode(unref(TabPane), {
|
|
117
|
+
key: "all",
|
|
118
|
+
title: "\u5168\u90E8\u7D20\u6750"
|
|
119
|
+
}),
|
|
120
|
+
createVNode(unref(TabPane), {
|
|
121
|
+
key: "my",
|
|
122
|
+
title: "\u6211\u7684\u7D20\u6750"
|
|
123
|
+
}),
|
|
124
|
+
createVNode(unref(TabPane), {
|
|
125
|
+
key: "remind",
|
|
126
|
+
title: "\u63D0\u9192\u6211\u7684"
|
|
127
|
+
}),
|
|
128
|
+
createVNode(unref(TabPane), {
|
|
129
|
+
key: "local",
|
|
130
|
+
title: "\u672C\u5730\u7D20\u6750"
|
|
131
|
+
})
|
|
132
|
+
]),
|
|
133
|
+
_: 1
|
|
134
|
+
}, 8, ["active-key", "onChange"])
|
|
135
|
+
]),
|
|
136
|
+
createCommentVNode(" \u7B5B\u9009 "),
|
|
137
|
+
activeKey.value !== "local" ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
138
|
+
createVNode(_sfc_main$1, {
|
|
139
|
+
"disable-upload-by": activeKey.value !== "all",
|
|
140
|
+
onChange: unref(changeFilter),
|
|
141
|
+
onUpload: handleToUpload
|
|
142
|
+
}, null, 8, ["disable-upload-by", "onChange"])
|
|
143
|
+
])) : createCommentVNode("v-if", true),
|
|
144
|
+
createCommentVNode(" \u5217\u8868\u90E8\u5206 "),
|
|
145
|
+
createElementVNode("div", _hoisted_4, [
|
|
146
|
+
createVNode(unref(Scrollbar), {
|
|
147
|
+
"outer-style": { height: "100%" },
|
|
148
|
+
style: { "height": "100%", "overflow": "auto" }
|
|
149
|
+
}, {
|
|
150
|
+
default: withCtx(() => [
|
|
151
|
+
createVNode(_sfc_main$2, {
|
|
152
|
+
loading: unref(loading),
|
|
153
|
+
list: unref(list),
|
|
154
|
+
disable: disableSelect.value,
|
|
155
|
+
"select-keys": selectedKeys.value,
|
|
156
|
+
onSelect: handleSelect,
|
|
157
|
+
onSelectOne: handleSelectOne
|
|
158
|
+
}, null, 8, ["loading", "list", "disable", "select-keys"])
|
|
159
|
+
]),
|
|
160
|
+
_: 1
|
|
161
|
+
})
|
|
162
|
+
]),
|
|
163
|
+
createCommentVNode(" \u5E95\u90E8 "),
|
|
164
|
+
createElementVNode("div", _hoisted_5, [
|
|
165
|
+
createElementVNode("div", _hoisted_6, [
|
|
166
|
+
activeKey.value !== "local" ? (openBlock(), createBlock(unref(Pagination), {
|
|
167
|
+
key: 0,
|
|
168
|
+
total: unref(total),
|
|
169
|
+
"page-size": unref(limit),
|
|
170
|
+
"show-total": "",
|
|
171
|
+
"show-page-size": "",
|
|
172
|
+
onChange: _cache[1] || (_cache[1] = (e) => unref(changePage)((e - 1) * unref(limit))),
|
|
173
|
+
onPageSizeChange: unref(changeSize)
|
|
174
|
+
}, null, 8, ["total", "page-size", "onPageSizeChange"])) : createCommentVNode("v-if", true)
|
|
175
|
+
]),
|
|
176
|
+
selected.value.length ? (openBlock(), createElementBlock("div", _hoisted_7, [
|
|
177
|
+
createVNode(_sfc_main$3, {
|
|
178
|
+
maxcount: _ctx.maxcount,
|
|
179
|
+
selected: selected.value,
|
|
180
|
+
onRemove: handleSelect,
|
|
181
|
+
onClear: handleClear
|
|
182
|
+
}, null, 8, ["maxcount", "selected"]),
|
|
183
|
+
createVNode(unref(Button), { onClick: handleClose }, {
|
|
184
|
+
default: withCtx(() => [
|
|
185
|
+
createTextVNode("\u53D6\u6D88")
|
|
186
|
+
]),
|
|
187
|
+
_: 1
|
|
188
|
+
}),
|
|
189
|
+
createVNode(unref(Button), {
|
|
190
|
+
type: "primary",
|
|
191
|
+
onClick: handleConfirm
|
|
192
|
+
}, {
|
|
193
|
+
default: withCtx(() => [
|
|
194
|
+
createTextVNode("\u786E\u5B9A")
|
|
195
|
+
]),
|
|
196
|
+
_: 1
|
|
197
|
+
})
|
|
198
|
+
])) : createCommentVNode("v-if", true)
|
|
199
|
+
])
|
|
200
|
+
])) : (openBlock(), createBlock(unref(emptyData), {
|
|
201
|
+
key: 1,
|
|
202
|
+
type: "empty",
|
|
203
|
+
customTip: "\u6682\u65E0\u6743\u9650"
|
|
204
|
+
}))
|
|
205
|
+
]),
|
|
206
|
+
_: 1
|
|
207
|
+
}, 8, ["visible"]);
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
export { _sfc_main as default };
|
|
File without changes
|