@cmstops/pro-compo 0.3.37 → 0.3.39

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.
@@ -1,30 +1,8 @@
1
1
  "use strict";
2
2
  var vue = require("vue");
3
3
  var webVue = require("@arco-design/web-vue");
4
- var icon = require("@arco-design/web-vue/es/icon");
5
- var index$4 = require("../emptyData/index.js");
6
- var index = require("./components/ListFilter/index.js");
7
- var index$1 = require("./components/ListContent/index.js");
8
- var index$3 = require("./components/ListSelected/index.js");
9
- var index$2 = require("./components/ListContentLocal/index.js");
10
- var useAttachement = require("../hooks/useAttachement.js");
11
- var config = require("../config.js");
12
- const _hoisted_1 = {
13
- key: 0,
14
- class: "resource-select-container"
15
- };
16
- const _hoisted_2 = { class: "resource-select-header" };
17
- const _hoisted_3 = {
18
- key: 0,
19
- class: "resource-select-filter"
20
- };
21
- const _hoisted_4 = { class: "resource-select-content" };
22
- const _hoisted_5 = { class: "resource-select-footer" };
23
- const _hoisted_6 = { class: "footer-left" };
24
- const _hoisted_7 = {
25
- key: 0,
26
- class: "footer-right"
27
- };
4
+ var index = require("./components/Main/index.js");
5
+ const _hoisted_1 = { class: "resource-select-wrap" };
28
6
  const _sfc_main = vue.defineComponent({
29
7
  ...{ name: "selectResourceModal" },
30
8
  __name: "component",
@@ -33,193 +11,63 @@ const _sfc_main = vue.defineComponent({
33
11
  visible: { type: Boolean },
34
12
  userInfo: {},
35
13
  maxcount: {},
14
+ wrap: {},
36
15
  filterOptions: {}
37
16
  },
38
17
  emits: ["update:visible", "submit"],
39
18
  setup(__props, { emit: __emit }) {
40
19
  const props = __props;
41
20
  const emits = __emit;
42
- const BASE_API = props.BASE_API || config.DEFAULT_BASE_API;
43
- const activeKey = vue.ref("all");
44
- vue.provide("userInfo", vue.computed(() => props.userInfo));
45
- vue.provide("baseAPI", BASE_API);
46
- const {
47
- list,
48
- total,
49
- limit,
50
- loading,
51
- changeKey,
52
- changeFilter,
53
- changePage,
54
- changeSize
55
- } = useAttachement["default"]({ key: "all", BASE_API });
56
- const selected = vue.ref([]);
57
- const selectedKeys = vue.computed(() => selected.value.map((item) => item.id));
58
- const disableSelect = vue.computed(() => props.maxcount && selected.value.length >= props.maxcount);
59
- function handleSelect(params) {
60
- const { id } = params;
61
- const index2 = selected.value.findIndex((item) => item.id === id);
62
- if (index2 > -1)
63
- selected.value.splice(index2, 1);
64
- else
65
- selected.value.push(params);
66
- }
67
- function handleClear() {
68
- selected.value = [];
69
- }
70
- function handleClose() {
71
- handleClear();
21
+ const wrapMode = vue.ref(props.wrap || "modal");
22
+ const handleClose = () => {
72
23
  emits("update:visible", false);
73
- }
74
- const handleSelectOne = (params) => {
75
- if (Array.isArray(params))
76
- emits("submit", params);
77
- else
78
- emits("submit", [params]);
79
- handleClose();
80
24
  };
81
- function handleConfirm() {
82
- handleSelectOne(selected.value);
83
- }
84
- function handleToUpload() {
85
- changeKey("local");
86
- activeKey.value = "local";
87
- }
25
+ const handleSubmit = (data) => {
26
+ emits("submit", JSON.parse(JSON.stringify(data)));
27
+ };
88
28
  return (_ctx, _cache) => {
89
- return vue.openBlock(), vue.createBlock(vue.unref(webVue.Drawer), {
90
- visible: _ctx.visible,
91
- width: "1024px",
92
- header: false,
93
- footer: false,
94
- class: "resource-select-drawer"
95
- }, {
96
- default: vue.withCtx(() => [
97
- _ctx.userInfo ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
98
- vue.createCommentVNode(" \u5934\u90E8 "),
99
- vue.createElementVNode("div", _hoisted_2, [
100
- vue.createVNode(vue.unref(webVue.Tabs), {
101
- "active-key": activeKey.value,
102
- "onUpdate:activeKey": _cache[0] || (_cache[0] = ($event) => activeKey.value = $event),
103
- onChange: vue.unref(changeKey)
104
- }, {
105
- extra: vue.withCtx(() => [
106
- vue.createVNode(vue.unref(webVue.Button), {
107
- type: "secondary",
108
- shape: "round",
109
- onClick: handleClose
110
- }, {
111
- icon: vue.withCtx(() => [
112
- vue.createVNode(vue.unref(icon.IconClose))
113
- ]),
114
- _: 1
115
- })
116
- ]),
117
- default: vue.withCtx(() => [
118
- vue.createVNode(vue.unref(webVue.TabPane), {
119
- key: "all",
120
- title: "\u5168\u90E8\u7D20\u6750"
121
- }),
122
- vue.createVNode(vue.unref(webVue.TabPane), {
123
- key: "my",
124
- title: "\u6211\u7684\u7D20\u6750"
125
- }),
126
- vue.createVNode(vue.unref(webVue.TabPane), {
127
- key: "remind",
128
- title: "\u63D0\u9192\u6211\u7684"
129
- }),
130
- vue.createVNode(vue.unref(webVue.TabPane), {
131
- key: "local",
132
- title: "\u672C\u5730\u7D20\u6750"
133
- })
134
- ]),
135
- _: 1
136
- }, 8, ["active-key", "onChange"])
137
- ]),
138
- vue.createCommentVNode(" \u7B5B\u9009 "),
139
- activeKey.value !== "local" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, [
140
- vue.createVNode(index, {
141
- "disable-upload-by": activeKey.value !== "all",
142
- filterOptions: _ctx.filterOptions,
143
- onChange: vue.unref(changeFilter),
144
- onUpload: handleToUpload
145
- }, null, 8, ["disable-upload-by", "filterOptions", "onChange"])
146
- ])) : vue.createCommentVNode("v-if", true),
147
- vue.createCommentVNode(" \u5217\u8868\u90E8\u5206 "),
148
- vue.createElementVNode("div", _hoisted_4, [
149
- vue.createVNode(vue.unref(webVue.Scrollbar), {
150
- "outer-style": { height: "100%" },
151
- style: { "height": "100%", "overflow": "auto" }
152
- }, {
153
- default: vue.withCtx(() => [
154
- vue.withDirectives(vue.createVNode(index$1, {
155
- loading: vue.unref(loading),
156
- list: vue.unref(list),
157
- disable: disableSelect.value,
158
- "select-keys": selectedKeys.value,
159
- onSelect: handleSelect,
160
- onSelectOne: handleSelectOne
161
- }, null, 8, ["loading", "list", "disable", "select-keys"]), [
162
- [vue.vShow, activeKey.value !== "local"]
163
- ]),
164
- vue.withDirectives(vue.createVNode(index$2, {
165
- disable: disableSelect.value,
166
- "select-keys": selectedKeys.value,
167
- onSelect: handleSelect,
168
- onSelectOne: handleSelectOne
169
- }, null, 8, ["disable", "select-keys"]), [
170
- [vue.vShow, activeKey.value === "local"]
171
- ])
172
- ]),
173
- _: 1
174
- })
175
- ]),
176
- vue.createCommentVNode(" \u5E95\u90E8 "),
177
- vue.createElementVNode("div", _hoisted_5, [
178
- vue.createElementVNode("div", _hoisted_6, [
179
- activeKey.value !== "local" ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Pagination), {
180
- key: 0,
181
- total: vue.unref(total),
182
- "page-size": vue.unref(limit),
183
- "show-total": "",
184
- "show-page-size": "",
185
- "base-size": 3,
186
- "buffer-size": 1,
187
- onChange: _cache[1] || (_cache[1] = (e) => vue.unref(changePage)((e - 1) * vue.unref(limit))),
188
- onPageSizeChange: vue.unref(changeSize)
189
- }, null, 8, ["total", "page-size", "onPageSizeChange"])) : vue.createCommentVNode("v-if", true)
190
- ]),
191
- selected.value.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7, [
192
- vue.createVNode(index$3, {
193
- maxcount: _ctx.maxcount,
194
- selected: selected.value,
195
- onRemove: handleSelect,
196
- onClear: handleClear
197
- }, null, 8, ["maxcount", "selected"]),
198
- vue.createVNode(vue.unref(webVue.Button), { onClick: handleClose }, {
199
- default: vue.withCtx(() => [
200
- vue.createTextVNode("\u53D6\u6D88")
201
- ]),
202
- _: 1
203
- }),
204
- vue.createVNode(vue.unref(webVue.Button), {
205
- type: "primary",
206
- onClick: handleConfirm
207
- }, {
208
- default: vue.withCtx(() => [
209
- vue.createTextVNode("\u786E\u5B9A")
210
- ]),
211
- _: 1
212
- })
213
- ])) : vue.createCommentVNode("v-if", true)
214
- ])
215
- ])) : (vue.openBlock(), vue.createBlock(vue.unref(index$4), {
216
- key: 1,
217
- type: "empty",
218
- customTip: "\u6682\u65E0\u6743\u9650"
219
- }))
220
- ]),
221
- _: 1
222
- }, 8, ["visible"]);
29
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
30
+ wrapMode.value === "drawer" ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Drawer), {
31
+ key: 0,
32
+ visible: _ctx.visible,
33
+ width: "1024px",
34
+ header: false,
35
+ footer: false,
36
+ class: "resource-select-drawer"
37
+ }, {
38
+ default: vue.withCtx(() => [
39
+ vue.createVNode(index, {
40
+ BASE_API: _ctx.BASE_API,
41
+ userInfo: _ctx.userInfo,
42
+ maxcount: _ctx.maxcount,
43
+ filterOptions: _ctx.filterOptions,
44
+ onClose: handleClose,
45
+ onSubmit: handleSubmit
46
+ }, null, 8, ["BASE_API", "userInfo", "maxcount", "filterOptions"])
47
+ ]),
48
+ _: 1
49
+ }, 8, ["visible"])) : wrapMode.value === "modal" ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Modal), {
50
+ key: 1,
51
+ visible: _ctx.visible,
52
+ width: "986px",
53
+ "body-class": "resource-select-modal-body",
54
+ "hide-title": false,
55
+ closable: false,
56
+ footer: false
57
+ }, {
58
+ default: vue.withCtx(() => [
59
+ vue.createVNode(index, {
60
+ BASE_API: _ctx.BASE_API,
61
+ userInfo: _ctx.userInfo,
62
+ maxcount: _ctx.maxcount,
63
+ filterOptions: _ctx.filterOptions,
64
+ onClose: handleClose,
65
+ onSubmit: handleSubmit
66
+ }, null, 8, ["BASE_API", "userInfo", "maxcount", "filterOptions"])
67
+ ]),
68
+ _: 1
69
+ }, 8, ["visible"])) : vue.createCommentVNode("v-if", true)
70
+ ]);
223
71
  };
224
72
  }
225
73
  });
@@ -0,0 +1,216 @@
1
+ "use strict";
2
+ var vue = require("vue");
3
+ var webVue = require("@arco-design/web-vue");
4
+ var icon = require("@arco-design/web-vue/es/icon");
5
+ var index$4 = require("../../../emptyData/index.js");
6
+ var index = require("../ListFilter/index.js");
7
+ var index$1 = require("../ListContent/index.js");
8
+ var index$3 = require("../ListSelected/index.js");
9
+ var index$2 = require("../ListContentLocal/index.js");
10
+ var useAttachement = require("../../../hooks/useAttachement.js");
11
+ var config = require("../../../config.js");
12
+ const _hoisted_1 = { class: "resource-select-main" };
13
+ const _hoisted_2 = {
14
+ key: 0,
15
+ class: "resource-select-container"
16
+ };
17
+ const _hoisted_3 = { class: "resource-select-header" };
18
+ const _hoisted_4 = {
19
+ key: 0,
20
+ class: "resource-select-filter"
21
+ };
22
+ const _hoisted_5 = { class: "resource-select-content" };
23
+ const _hoisted_6 = { class: "resource-select-footer" };
24
+ const _hoisted_7 = { class: "footer-left" };
25
+ const _hoisted_8 = {
26
+ key: 0,
27
+ class: "footer-right"
28
+ };
29
+ const _sfc_main = vue.defineComponent({
30
+ __name: "index",
31
+ props: {
32
+ BASE_API: {},
33
+ userInfo: {},
34
+ maxcount: {},
35
+ filterOptions: {}
36
+ },
37
+ emits: ["close", "submit"],
38
+ setup(__props, { emit: __emit }) {
39
+ const props = __props;
40
+ const emits = __emit;
41
+ const BASE_API = props.BASE_API || config.DEFAULT_BASE_API;
42
+ const activeKey = vue.ref("all");
43
+ vue.provide("userInfo", vue.computed(() => props.userInfo));
44
+ vue.provide("baseAPI", BASE_API);
45
+ const {
46
+ list,
47
+ total,
48
+ limit,
49
+ loading,
50
+ changeKey,
51
+ changeFilter,
52
+ changePage,
53
+ changeSize
54
+ } = useAttachement["default"]({ key: "all", BASE_API });
55
+ const selected = vue.ref([]);
56
+ const selectedKeys = vue.computed(() => selected.value.map((item) => item.id));
57
+ const disableSelect = vue.computed(() => props.maxcount && selected.value.length >= props.maxcount);
58
+ function handleSelect(params) {
59
+ const { id } = params;
60
+ const index2 = selected.value.findIndex((item) => item.id === id);
61
+ if (index2 > -1)
62
+ selected.value.splice(index2, 1);
63
+ else
64
+ selected.value.push(params);
65
+ }
66
+ function handleClear() {
67
+ selected.value = [];
68
+ }
69
+ function handleClose() {
70
+ handleClear();
71
+ emits("close");
72
+ }
73
+ const handleSelectOne = (params) => {
74
+ if (Array.isArray(params))
75
+ emits("submit", params);
76
+ else
77
+ emits("submit", [params]);
78
+ handleClose();
79
+ };
80
+ function handleConfirm() {
81
+ handleSelectOne(selected.value);
82
+ }
83
+ function handleToUpload() {
84
+ changeKey("local");
85
+ activeKey.value = "local";
86
+ }
87
+ return (_ctx, _cache) => {
88
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
89
+ _ctx.userInfo ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
90
+ vue.createCommentVNode(" \u5934\u90E8 "),
91
+ vue.createElementVNode("div", _hoisted_3, [
92
+ vue.createVNode(vue.unref(webVue.Tabs), {
93
+ "active-key": activeKey.value,
94
+ "onUpdate:activeKey": _cache[0] || (_cache[0] = ($event) => activeKey.value = $event),
95
+ onChange: vue.unref(changeKey)
96
+ }, {
97
+ extra: vue.withCtx(() => [
98
+ vue.createVNode(vue.unref(webVue.Button), {
99
+ type: "secondary",
100
+ shape: "round",
101
+ onClick: handleClose
102
+ }, {
103
+ icon: vue.withCtx(() => [
104
+ vue.createVNode(vue.unref(icon.IconClose))
105
+ ]),
106
+ _: 1
107
+ })
108
+ ]),
109
+ default: vue.withCtx(() => [
110
+ vue.createVNode(vue.unref(webVue.TabPane), {
111
+ key: "all",
112
+ title: "\u5168\u90E8\u7D20\u6750"
113
+ }),
114
+ vue.createVNode(vue.unref(webVue.TabPane), {
115
+ key: "my",
116
+ title: "\u6211\u7684\u7D20\u6750"
117
+ }),
118
+ vue.createVNode(vue.unref(webVue.TabPane), {
119
+ key: "remind",
120
+ title: "\u63D0\u9192\u6211\u7684"
121
+ }),
122
+ vue.createVNode(vue.unref(webVue.TabPane), {
123
+ key: "local",
124
+ title: "\u672C\u5730\u7D20\u6750"
125
+ })
126
+ ]),
127
+ _: 1
128
+ }, 8, ["active-key", "onChange"])
129
+ ]),
130
+ vue.createCommentVNode(" \u7B5B\u9009 "),
131
+ activeKey.value !== "local" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4, [
132
+ vue.createVNode(index, {
133
+ "disable-upload-by": activeKey.value !== "all",
134
+ filterOptions: _ctx.filterOptions,
135
+ onChange: vue.unref(changeFilter),
136
+ onUpload: handleToUpload
137
+ }, null, 8, ["disable-upload-by", "filterOptions", "onChange"])
138
+ ])) : vue.createCommentVNode("v-if", true),
139
+ vue.createCommentVNode(" \u5217\u8868\u90E8\u5206 "),
140
+ vue.createElementVNode("div", _hoisted_5, [
141
+ vue.createVNode(vue.unref(webVue.Scrollbar), {
142
+ "outer-style": { height: "100%" },
143
+ style: { "height": "100%", "overflow": "auto" }
144
+ }, {
145
+ default: vue.withCtx(() => [
146
+ vue.withDirectives(vue.createVNode(index$1, {
147
+ loading: vue.unref(loading),
148
+ list: vue.unref(list),
149
+ disable: disableSelect.value,
150
+ "select-keys": selectedKeys.value,
151
+ onSelect: handleSelect,
152
+ onSelectOne: handleSelectOne
153
+ }, null, 8, ["loading", "list", "disable", "select-keys"]), [
154
+ [vue.vShow, activeKey.value !== "local"]
155
+ ]),
156
+ vue.withDirectives(vue.createVNode(index$2, {
157
+ disable: disableSelect.value,
158
+ "select-keys": selectedKeys.value,
159
+ onSelect: handleSelect,
160
+ onSelectOne: handleSelectOne
161
+ }, null, 8, ["disable", "select-keys"]), [
162
+ [vue.vShow, activeKey.value === "local"]
163
+ ])
164
+ ]),
165
+ _: 1
166
+ })
167
+ ]),
168
+ vue.createCommentVNode(" \u5E95\u90E8 "),
169
+ vue.createElementVNode("div", _hoisted_6, [
170
+ vue.createElementVNode("div", _hoisted_7, [
171
+ activeKey.value !== "local" ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Pagination), {
172
+ key: 0,
173
+ total: vue.unref(total),
174
+ "page-size": vue.unref(limit),
175
+ "show-total": "",
176
+ "show-page-size": "",
177
+ "base-size": 3,
178
+ "buffer-size": 1,
179
+ onChange: _cache[1] || (_cache[1] = (e) => vue.unref(changePage)((e - 1) * vue.unref(limit))),
180
+ onPageSizeChange: vue.unref(changeSize)
181
+ }, null, 8, ["total", "page-size", "onPageSizeChange"])) : vue.createCommentVNode("v-if", true)
182
+ ]),
183
+ selected.value.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8, [
184
+ vue.createVNode(index$3, {
185
+ maxcount: _ctx.maxcount,
186
+ selected: selected.value,
187
+ onRemove: handleSelect,
188
+ onClear: handleClear
189
+ }, null, 8, ["maxcount", "selected"]),
190
+ vue.createVNode(vue.unref(webVue.Button), { onClick: handleClose }, {
191
+ default: vue.withCtx(() => [
192
+ vue.createTextVNode("\u53D6\u6D88")
193
+ ]),
194
+ _: 1
195
+ }),
196
+ vue.createVNode(vue.unref(webVue.Button), {
197
+ type: "primary",
198
+ onClick: handleConfirm
199
+ }, {
200
+ default: vue.withCtx(() => [
201
+ vue.createTextVNode("\u786E\u5B9A")
202
+ ]),
203
+ _: 1
204
+ })
205
+ ])) : vue.createCommentVNode("v-if", true)
206
+ ])
207
+ ])) : (vue.openBlock(), vue.createBlock(vue.unref(index$4), {
208
+ key: 1,
209
+ type: "empty",
210
+ customTip: "\u6682\u65E0\u6743\u9650"
211
+ }))
212
+ ]);
213
+ };
214
+ }
215
+ });
216
+ module.exports = _sfc_main;
@@ -155,6 +155,13 @@
155
155
  background-color: #165dff;
156
156
  border-color: #165dff;
157
157
  }
158
+ .resource-select-modal-body {
159
+ height: 70vh;
160
+ padding: 0;
161
+ }
162
+ .resource-select-main {
163
+ height: 100%;
164
+ }
158
165
  .resource-select-drawer .arco-drawer-body {
159
166
  box-sizing: border-box;
160
167
  padding: 0;
@@ -4,6 +4,15 @@
4
4
  @import './listContentLocal.less';
5
5
  @import './listCardWrapper.less';
6
6
 
7
+ .resource-select-modal-body {
8
+ height: 70vh;
9
+ padding: 0;
10
+ }
11
+
12
+ .resource-select-main {
13
+ height: 100%;
14
+ }
15
+
7
16
  .resource-select-drawer {
8
17
  .arco-drawer-body {
9
18
  box-sizing: border-box;
@@ -12,7 +12,10 @@ const _hoisted_1 = {
12
12
  };
13
13
  const _hoisted_2 = { class: "thumb-handler-list" };
14
14
  const _hoisted_3 = ["onClick"];
15
- const _hoisted_4 = { class: "thumb-select-tag" };
15
+ const _hoisted_4 = {
16
+ key: 3,
17
+ class: "thumb-select-tag"
18
+ };
16
19
  const _sfc_main = vue.defineComponent({
17
20
  ...{ name: "thumbCard" },
18
21
  __name: "component",
@@ -73,7 +76,7 @@ const _sfc_main = vue.defineComponent({
73
76
  emits("edit", { key });
74
77
  }
75
78
  return (_ctx, _cache) => {
76
- var _a;
79
+ var _a, _b;
77
80
  return vue.openBlock(), vue.createElementBlock("div", {
78
81
  class: vue.normalizeClass(["thumb-select-wrapper", classList.value]),
79
82
  style: vue.normalizeStyle(styleObject.value)
@@ -134,7 +137,7 @@ const _sfc_main = vue.defineComponent({
134
137
  }), 128))
135
138
  ])
136
139
  ], 64)) : vue.createCommentVNode("v-if", true),
137
- vue.createElementVNode("div", _hoisted_4, vue.toDisplayString(vue.unref(index.mediaTime)(_ctx.meta.length)), 1)
140
+ ["video", "audio"].includes(_ctx.catalog) && _ctx.meta ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4, vue.toDisplayString(vue.unref(index.mediaTime)((_b = _ctx.meta) == null ? void 0 : _b.length)), 1)) : vue.createCommentVNode("v-if", true)
138
141
  ], 6);
139
142
  };
140
143
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmstops/pro-compo",
3
- "version": "0.3.37",
3
+ "version": "0.3.39",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "vue",