@cmstops/pro-compo 0.1.7 → 0.1.9

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.
Files changed (121) hide show
  1. package/dist/index.css +858 -0
  2. package/dist/index.min.css +1 -1
  3. package/es/appCenter/script/apps.d.ts +2 -11
  4. package/es/appCenter/script/apps.js +1 -41
  5. package/es/appCenter/script/routeMap.d.ts +1 -1
  6. package/es/config.d.ts +2 -2
  7. package/es/config.js +2 -2
  8. package/es/contentModal/component.js +5 -2
  9. package/es/contentModal/components/CompoList/index.js +12 -1
  10. package/es/contentModal/components/storeBox/index.js +1 -1
  11. package/es/contentModal/style/ViewAllColumn.less +1 -0
  12. package/es/contentModal/style/index.css +1 -0
  13. package/es/index.css +858 -0
  14. package/es/index.d.ts +2 -0
  15. package/es/index.js +2 -0
  16. package/es/index.less +2 -0
  17. package/es/previousVersion/component.d.ts +0 -0
  18. package/es/previousVersion/component.js +378 -0
  19. package/es/previousVersion/index.d.ts +2 -0
  20. package/es/previousVersion/index.js +7 -0
  21. package/es/previousVersion/script/api.d.ts +15 -0
  22. package/es/previousVersion/script/api.js +39 -0
  23. package/es/previousVersion/script/tool.d.ts +6 -0
  24. package/es/previousVersion/script/tool.js +22 -0
  25. package/es/previousVersion/style/css.js +1 -0
  26. package/es/previousVersion/style/index.css +166 -0
  27. package/es/previousVersion/style/index.d.ts +1 -0
  28. package/es/previousVersion/style/index.js +1 -0
  29. package/es/previousVersion/style/index.less +208 -0
  30. package/es/resourceModal/assets/images/unknown.js +2 -0
  31. package/es/resourceModal/assets/selection/null.js +2 -0
  32. package/es/resourceModal/component.js +65 -4
  33. package/es/resourceModal/components/MediaPreviewer/index.d.ts +0 -0
  34. package/es/resourceModal/components/MediaPreviewer/index.js +69 -0
  35. package/es/resourceModal/components/MediaSelection/DocAiMediaSelected/index.d.ts +0 -0
  36. package/es/resourceModal/components/MediaSelection/DocAiMediaSelected/index.js +111 -0
  37. package/es/resourceModal/components/MediaSelection/MainContent/FileTypeThumb/index.d.ts +0 -0
  38. package/es/resourceModal/components/MediaSelection/MainContent/FileTypeThumb/index.js +85 -0
  39. package/es/resourceModal/components/MediaSelection/MainContent/index.d.ts +0 -0
  40. package/es/resourceModal/components/MediaSelection/MainContent/index.js +171 -0
  41. package/es/resourceModal/components/MediaSelection/ToolbarSearch/index.d.ts +0 -0
  42. package/es/resourceModal/components/MediaSelection/ToolbarSearch/index.js +211 -0
  43. package/es/resourceModal/components/MediaSelection/index.d.ts +0 -0
  44. package/es/resourceModal/components/MediaSelection/index.js +272 -0
  45. package/es/resourceModal/script/api.d.ts +8 -0
  46. package/es/resourceModal/script/api.js +30 -0
  47. package/es/resourceModal/script/filter.d.ts +8 -0
  48. package/es/resourceModal/script/filter.js +22 -0
  49. package/es/resourceModal/script/mediaSelection.d.ts +10 -0
  50. package/es/resourceModal/style/DocAiMediaSelected.less +56 -0
  51. package/es/resourceModal/style/FileTypeThumb.less +183 -0
  52. package/es/resourceModal/style/MainContent.less +200 -0
  53. package/es/resourceModal/style/MediaPreviewer.less +71 -0
  54. package/es/resourceModal/style/MediaSelection.less +59 -0
  55. package/es/resourceModal/style/ToolbarSearch.less +40 -0
  56. package/es/resourceModal/style/index.css +514 -3
  57. package/es/resourceModal/style/index.less +16 -3
  58. package/es/selectGategory/component.d.ts +0 -0
  59. package/es/selectGategory/component.js +95 -0
  60. package/es/selectGategory/components/ColumnSelection/index.d.ts +0 -0
  61. package/es/selectGategory/components/ColumnSelection/index.js +273 -0
  62. package/es/selectGategory/index.d.ts +2 -0
  63. package/es/selectGategory/index.js +7 -0
  64. package/es/selectGategory/script/api.d.ts +6 -0
  65. package/es/selectGategory/script/api.js +15 -0
  66. package/es/selectGategory/style/ColumnSelection.less +190 -0
  67. package/es/selectGategory/style/css.js +1 -0
  68. package/es/selectGategory/style/index.css +180 -0
  69. package/es/selectGategory/style/index.d.ts +1 -0
  70. package/es/selectGategory/style/index.js +1 -0
  71. package/es/selectGategory/style/index.less +40 -0
  72. package/es/utils/doc.d.ts +69 -0
  73. package/es/utils/typeMap.js +2 -1
  74. package/lib/appCenter/script/apps.js +1 -41
  75. package/lib/config.js +2 -2
  76. package/lib/contentModal/component.js +5 -2
  77. package/lib/contentModal/components/CompoList/index.js +11 -0
  78. package/lib/contentModal/components/storeBox/index.js +1 -1
  79. package/lib/contentModal/style/ViewAllColumn.less +1 -0
  80. package/lib/contentModal/style/index.css +1 -0
  81. package/lib/index.css +858 -0
  82. package/lib/index.js +4 -0
  83. package/lib/index.less +2 -0
  84. package/lib/previousVersion/component.js +379 -0
  85. package/lib/previousVersion/index.js +8 -0
  86. package/lib/previousVersion/script/api.js +43 -0
  87. package/lib/previousVersion/script/tool.js +24 -0
  88. package/lib/previousVersion/style/css.js +2 -0
  89. package/lib/previousVersion/style/index.css +166 -0
  90. package/lib/previousVersion/style/index.js +2 -0
  91. package/lib/previousVersion/style/index.less +208 -0
  92. package/lib/resourceModal/assets/images/unknown.js +3 -0
  93. package/lib/resourceModal/assets/selection/null.js +3 -0
  94. package/lib/resourceModal/component.js +64 -3
  95. package/lib/resourceModal/components/MediaPreviewer/index.js +70 -0
  96. package/lib/resourceModal/components/MediaSelection/DocAiMediaSelected/index.js +112 -0
  97. package/lib/resourceModal/components/MediaSelection/MainContent/FileTypeThumb/index.js +86 -0
  98. package/lib/resourceModal/components/MediaSelection/MainContent/index.js +172 -0
  99. package/lib/resourceModal/components/MediaSelection/ToolbarSearch/index.js +212 -0
  100. package/lib/resourceModal/components/MediaSelection/index.js +273 -0
  101. package/lib/resourceModal/script/api.js +35 -0
  102. package/lib/resourceModal/script/filter.js +25 -0
  103. package/lib/resourceModal/style/DocAiMediaSelected.less +56 -0
  104. package/lib/resourceModal/style/FileTypeThumb.less +183 -0
  105. package/lib/resourceModal/style/MainContent.less +200 -0
  106. package/lib/resourceModal/style/MediaPreviewer.less +71 -0
  107. package/lib/resourceModal/style/MediaSelection.less +59 -0
  108. package/lib/resourceModal/style/ToolbarSearch.less +40 -0
  109. package/lib/resourceModal/style/index.css +514 -3
  110. package/lib/resourceModal/style/index.less +16 -3
  111. package/lib/selectGategory/component.js +96 -0
  112. package/lib/selectGategory/components/ColumnSelection/index.js +274 -0
  113. package/lib/selectGategory/index.js +8 -0
  114. package/lib/selectGategory/script/api.js +18 -0
  115. package/lib/selectGategory/style/ColumnSelection.less +190 -0
  116. package/lib/selectGategory/style/css.js +2 -0
  117. package/lib/selectGategory/style/index.css +180 -0
  118. package/lib/selectGategory/style/index.js +2 -0
  119. package/lib/selectGategory/style/index.less +40 -0
  120. package/lib/utils/typeMap.js +2 -1
  121. package/package.json +2 -2
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+ var vue = require("vue");
3
+ var webVue = require("@arco-design/web-vue");
4
+ var index = require("../MainContent/FileTypeThumb/index.js");
5
+ const _hoisted_1 = { class: "doc-ai-media-selected" };
6
+ const _hoisted_2 = /* @__PURE__ */ vue.createElementVNode("div", { class: "thumb_type" }, "\u5C01\u9762\u56FE", -1);
7
+ const _hoisted_3 = { class: "thumb-list" };
8
+ const _hoisted_4 = { class: "thumb-item" };
9
+ const _hoisted_5 = {
10
+ key: 0,
11
+ class: "gif_covers"
12
+ };
13
+ const _hoisted_6 = /* @__PURE__ */ vue.createElementVNode("div", {
14
+ class: "thumb_type",
15
+ style: { "margin-top": "0px" }
16
+ }, "\u5C01\u9762\u52A8\u56FE", -1);
17
+ const _hoisted_7 = { class: "thumb-list" };
18
+ const _hoisted_8 = { class: "thumb-item" };
19
+ const _sfc_main = vue.defineComponent({
20
+ __name: "index",
21
+ props: {
22
+ selectedMax: {},
23
+ ai_static_covers: {},
24
+ ai_gif_covers: {},
25
+ preview: { type: Boolean },
26
+ addType: {}
27
+ },
28
+ emits: ["add"],
29
+ setup(__props, { emit }) {
30
+ const add = (itemData) => {
31
+ if (selectedUrl.value.includes(itemData.url)) {
32
+ selectedUrl.value = [];
33
+ emit("add", null);
34
+ } else {
35
+ selectedUrl.value = [itemData.url];
36
+ emit("add", itemData);
37
+ }
38
+ };
39
+ const selectedUrl = vue.ref([]);
40
+ return (_ctx, _cache) => {
41
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
42
+ vue.createVNode(vue.unref(webVue.Scrollbar), { class: "doc-ai-media-selected-scrollbar" }, {
43
+ default: vue.withCtx(() => {
44
+ var _a;
45
+ return [
46
+ _hoisted_2,
47
+ vue.createElementVNode("div", _hoisted_3, [
48
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.ai_static_covers, (item) => {
49
+ return vue.openBlock(), vue.createElementBlock("div", {
50
+ key: item,
51
+ class: "thumb-wrap"
52
+ }, [
53
+ vue.createElementVNode("div", _hoisted_4, [
54
+ vue.createElementVNode("div", {
55
+ class: vue.normalizeClass(["pic", { active: selectedUrl.value.includes(item) }])
56
+ }, [
57
+ vue.createVNode(index, {
58
+ preview: _ctx.preview,
59
+ "add-type": _ctx.addType,
60
+ "item-data": {
61
+ catalog: "image",
62
+ alias: item,
63
+ thumb: item,
64
+ url: item,
65
+ realUrl: item
66
+ },
67
+ onAdd: add
68
+ }, null, 8, ["preview", "add-type", "item-data"])
69
+ ], 2)
70
+ ])
71
+ ]);
72
+ }), 128))
73
+ ]),
74
+ ((_a = _ctx.ai_gif_covers) == null ? void 0 : _a.length) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, [
75
+ _hoisted_6,
76
+ vue.createElementVNode("div", _hoisted_7, [
77
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.ai_gif_covers, (item) => {
78
+ return vue.openBlock(), vue.createElementBlock("div", {
79
+ key: item,
80
+ class: "thumb-wrap"
81
+ }, [
82
+ vue.createElementVNode("div", _hoisted_8, [
83
+ vue.createElementVNode("div", {
84
+ class: vue.normalizeClass(["pic", { active: selectedUrl.value.includes(item) }])
85
+ }, [
86
+ vue.createVNode(index, {
87
+ preview: _ctx.preview,
88
+ "add-type": _ctx.addType,
89
+ "item-data": {
90
+ catalog: "image",
91
+ alias: item,
92
+ thumb: item,
93
+ url: item,
94
+ realUrl: item
95
+ },
96
+ onAdd: add
97
+ }, null, 8, ["preview", "add-type", "item-data"])
98
+ ], 2)
99
+ ])
100
+ ]);
101
+ }), 128))
102
+ ])
103
+ ])) : vue.createCommentVNode("v-if", true)
104
+ ];
105
+ }),
106
+ _: 1
107
+ })
108
+ ]);
109
+ };
110
+ }
111
+ });
112
+ module.exports = _sfc_main;
@@ -0,0 +1,86 @@
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 = require("../../../MediaPreviewer/index.js");
6
+ const _hoisted_1 = { class: "file-type-thumb" };
7
+ const _hoisted_2 = {
8
+ key: 0,
9
+ class: "mask"
10
+ };
11
+ const _hoisted_3 = ["onClick"];
12
+ const _hoisted_4 = ["onClick"];
13
+ const _hoisted_5 = ["onClick"];
14
+ const _sfc_main = vue.defineComponent({
15
+ __name: "index",
16
+ props: {
17
+ itemData: {},
18
+ preview: { type: Boolean },
19
+ addType: {}
20
+ },
21
+ emits: ["add"],
22
+ setup(__props, { emit }) {
23
+ const props = __props;
24
+ const visible = vue.ref(false);
25
+ const previewType = vue.computed(() => props.itemData.catalog);
26
+ const previewUrl = vue.computed(() => props.itemData.url || "");
27
+ const openPreview = () => visible.value = true;
28
+ const closePreviewer = (val) => visible.value = val;
29
+ const add = () => {
30
+ if (props.addType === "copper")
31
+ ;
32
+ emit("add", props.itemData);
33
+ };
34
+ return (_ctx, _cache) => {
35
+ return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
36
+ vue.createElementVNode("div", _hoisted_1, [
37
+ _ctx.itemData.thumb ? (vue.openBlock(), vue.createElementBlock("div", {
38
+ key: 0,
39
+ class: "pic",
40
+ style: vue.normalizeStyle({ "background-image": "url(" + _ctx.itemData.thumb + ")" })
41
+ }, null, 4)) : (vue.openBlock(), vue.createElementBlock("div", {
42
+ key: 1,
43
+ class: vue.normalizeClass(["pic", `${_ctx.itemData.catalog} ${_ctx.itemData.series}`])
44
+ }, null, 2)),
45
+ vue.createVNode(vue.Transition, { name: "el-fade-in" }, {
46
+ default: vue.withCtx(() => [
47
+ _ctx.preview ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
48
+ vue.createElementVNode("span", {
49
+ class: "half",
50
+ onClick: vue.withModifiers(openPreview, ["stop"])
51
+ }, [
52
+ vue.createVNode(vue.unref(icon.IconEye), {
53
+ "stroke-width": 6,
54
+ size: 20
55
+ })
56
+ ], 8, _hoisted_3),
57
+ vue.createVNode(vue.unref(webVue.Divider), { direction: "vertical" }),
58
+ vue.createElementVNode("span", {
59
+ class: "half",
60
+ onClick: vue.withModifiers(add, ["stop"])
61
+ }, [
62
+ vue.createVNode(vue.unref(icon.IconPlus), {
63
+ "stroke-width": 6,
64
+ size: 20
65
+ })
66
+ ], 8, _hoisted_4)
67
+ ])) : (vue.openBlock(), vue.createElementBlock("div", {
68
+ key: 1,
69
+ class: "transparent",
70
+ onClick: vue.withModifiers(add, ["stop"])
71
+ }, null, 8, _hoisted_5))
72
+ ]),
73
+ _: 1
74
+ })
75
+ ]),
76
+ visible.value ? (vue.openBlock(), vue.createBlock(index, {
77
+ key: 0,
78
+ type: previewType.value,
79
+ url: previewUrl.value,
80
+ onClose: closePreviewer
81
+ }, null, 8, ["type", "url"])) : vue.createCommentVNode("v-if", true)
82
+ ], 64);
83
+ };
84
+ }
85
+ });
86
+ module.exports = _sfc_main;
@@ -0,0 +1,172 @@
1
+ "use strict";
2
+ var vue = require("vue");
3
+ var _null = require("../../../assets/selection/null.js");
4
+ var webVue = require("@arco-design/web-vue");
5
+ var component = require("../../../../typeIcons/component.js");
6
+ var index = require("./FileTypeThumb/index.js");
7
+ const _hoisted_1 = { class: "file-wrap" };
8
+ const _hoisted_2 = { class: "folder-list clearfix" };
9
+ const _hoisted_3 = ["onClick"];
10
+ const _hoisted_4 = { class: "wrap" };
11
+ const _hoisted_5 = { class: "thumb" };
12
+ const _hoisted_6 = { class: "file-list clearfix" };
13
+ const _hoisted_7 = { class: "thumb-wrap" };
14
+ const _hoisted_8 = /* @__PURE__ */ vue.createElementVNode("div", { class: "transcoding-in-progress grid-mode" }, [
15
+ /* @__PURE__ */ vue.createElementVNode("div", { class: "transcoding-progress" }, "\u8F6C\u7801\u4E2D\u2026")
16
+ ], -1);
17
+ const _hoisted_9 = {
18
+ key: 0,
19
+ class: "load_more_title"
20
+ };
21
+ const _hoisted_10 = {
22
+ key: 1,
23
+ class: "nomore_tips"
24
+ };
25
+ const _hoisted_11 = {
26
+ key: 1,
27
+ class: "null-file"
28
+ };
29
+ const _hoisted_12 = /* @__PURE__ */ vue.createElementVNode("img", {
30
+ class: "null-pic",
31
+ src: _null
32
+ }, null, -1);
33
+ const _hoisted_13 = /* @__PURE__ */ vue.createElementVNode("p", null, "\u6682\u65E0\u7D20\u6750", -1);
34
+ const _hoisted_14 = [
35
+ _hoisted_12,
36
+ _hoisted_13
37
+ ];
38
+ const _sfc_main = vue.defineComponent({
39
+ __name: "index",
40
+ props: {
41
+ folderList: {},
42
+ fileList: {},
43
+ fileListCount: {},
44
+ isOver: { type: Boolean },
45
+ preview: { type: Boolean },
46
+ addType: {},
47
+ changeDirectory: { type: Function },
48
+ loadFileMore: { type: Function }
49
+ },
50
+ emits: ["add"],
51
+ setup(__props, { emit }) {
52
+ const add = (itemData) => {
53
+ if (selectedData.value.includes(itemData)) {
54
+ selectedData.value = [];
55
+ emit("add", null);
56
+ } else {
57
+ selectedData.value = [itemData];
58
+ emit("add", itemData);
59
+ }
60
+ };
61
+ const selectedData = vue.ref([]);
62
+ return (_ctx, _cache) => {
63
+ return vue.openBlock(), vue.createBlock(vue.unref(webVue.Scrollbar), { class: "dialog-media-selection-scroll" }, {
64
+ default: vue.withCtx(() => [
65
+ vue.createElementVNode("div", _hoisted_1, [
66
+ vue.createCommentVNode(" \u6587\u4EF6\u5939 "),
67
+ vue.withDirectives(vue.createElementVNode("div", _hoisted_2, [
68
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.folderList, (item, index2) => {
69
+ return vue.openBlock(), vue.createElementBlock("div", {
70
+ key: index2,
71
+ class: "item folder-item",
72
+ onClick: ($event) => _ctx.changeDirectory(item)
73
+ }, [
74
+ vue.createElementVNode("div", _hoisted_4, [
75
+ vue.createVNode(vue.unref(webVue.Tooltip), {
76
+ "open-delay": 500,
77
+ class: "item",
78
+ effect: "dark",
79
+ content: item.alias,
80
+ placement: "top"
81
+ }, {
82
+ default: vue.withCtx(() => [
83
+ vue.createElementVNode("div", _hoisted_5, [
84
+ vue.createElementVNode("h4", null, vue.toDisplayString(item.alias), 1)
85
+ ])
86
+ ]),
87
+ _: 2
88
+ }, 1032, ["content"])
89
+ ])
90
+ ], 8, _hoisted_3);
91
+ }), 128))
92
+ ], 512), [
93
+ [vue.vShow, _ctx.folderList.length !== 0]
94
+ ]),
95
+ vue.createCommentVNode(" \u6587\u4EF6 "),
96
+ vue.createElementVNode("div", _hoisted_6, [
97
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.fileList, (item, index$1) => {
98
+ return vue.openBlock(), vue.createElementBlock("div", {
99
+ key: index$1,
100
+ class: "item"
101
+ }, [
102
+ vue.createElementVNode("div", {
103
+ class: vue.normalizeClass(["shadow-wrap", { active: selectedData.value.includes(item) }])
104
+ }, [
105
+ vue.createElementVNode("div", _hoisted_7, [
106
+ vue.createVNode(index, {
107
+ preview: _ctx.preview,
108
+ "add-type": _ctx.addType,
109
+ "item-data": item,
110
+ onAdd: add
111
+ }, null, 8, ["preview", "add-type", "item-data"])
112
+ ]),
113
+ vue.createElementVNode("h4", null, [
114
+ vue.createVNode(component, {
115
+ class: "icon",
116
+ type: item.catalog,
117
+ doc: item.catalog !== "image",
118
+ resource: item.catalog === "image"
119
+ }, null, 8, ["type", "doc", "resource"]),
120
+ vue.createVNode(vue.unref(webVue.Tooltip), {
121
+ "open-delay": 500,
122
+ effect: "dark",
123
+ content: item.alias,
124
+ placement: "top"
125
+ }, {
126
+ default: vue.withCtx(() => [
127
+ vue.createElementVNode("span", null, vue.toDisplayString(item.alias), 1)
128
+ ]),
129
+ _: 2
130
+ }, 1032, ["content"])
131
+ ]),
132
+ vue.createElementVNode("p", null, vue.toDisplayString(item.updated_at), 1),
133
+ vue.createCommentVNode(" \u89C6\u9891\u8F6C\u7801\u8FDB\u5EA6 "),
134
+ item.task ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Tooltip), {
135
+ key: 0,
136
+ "open-delay": 2e3,
137
+ effect: "dark",
138
+ content: "\u8F6C\u7801\u4E2D\uFF0C\u6682\u4E0D\u53EF\u7528",
139
+ placement: "bottom"
140
+ }, {
141
+ default: vue.withCtx(() => [
142
+ _hoisted_8
143
+ ]),
144
+ _: 1
145
+ })) : vue.createCommentVNode("v-if", true)
146
+ ], 2)
147
+ ]);
148
+ }), 128))
149
+ ]),
150
+ _ctx.fileListCount ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9, [
151
+ !_ctx.isOver ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Button), {
152
+ key: 0,
153
+ type: "text",
154
+ size: "small",
155
+ class: "loadmore_tips",
156
+ onClick: _ctx.loadFileMore
157
+ }, {
158
+ default: vue.withCtx(() => [
159
+ vue.createTextVNode("\u52A0\u8F7D\u66F4\u591A\u2026")
160
+ ]),
161
+ _: 1
162
+ }, 8, ["onClick"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_10, "\u6CA1\u6709\u66F4\u591A\u4E86\u2026"))
163
+ ])) : vue.createCommentVNode("v-if", true),
164
+ !_ctx.fileList.length && !_ctx.folderList.length ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11, _hoisted_14)) : vue.createCommentVNode("v-if", true)
165
+ ])
166
+ ]),
167
+ _: 1
168
+ });
169
+ };
170
+ }
171
+ });
172
+ module.exports = _sfc_main;
@@ -0,0 +1,212 @@
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 filter = require("../../../script/filter.js");
6
+ var api = require("../../../script/api.js");
7
+ const _hoisted_1 = { class: "toolbar-search-container" };
8
+ const _hoisted_2 = { class: "top-container" };
9
+ const _hoisted_3 = { class: "filter-content" };
10
+ const _hoisted_4 = { class: "filter-left" };
11
+ const _hoisted_5 = { class: "filter-right" };
12
+ const _hoisted_6 = { class: "keywordsSelection" };
13
+ const _hoisted_7 = ["onClick"];
14
+ const _sfc_main = vue.defineComponent({
15
+ ...{ name: "ToolbarSearch" },
16
+ __name: "index",
17
+ props: {
18
+ activeMediaType: {},
19
+ base_api: {}
20
+ },
21
+ emits: ["search"],
22
+ setup(__props, { expose: __expose, emit }) {
23
+ const props = __props;
24
+ const filter$1 = vue.ref({
25
+ keyword: "",
26
+ upload_by: "",
27
+ sf: "",
28
+ uploadTime: null,
29
+ wh_rate: ""
30
+ });
31
+ const peopleOptions = vue.ref([]);
32
+ const limit = vue.ref(10);
33
+ const noMore = vue.ref(false);
34
+ const loadUploadPeopleData = async (isMore) => {
35
+ var _a, _b, _c, _d;
36
+ if (noMore.value)
37
+ return;
38
+ const query = {
39
+ limit: limit.value,
40
+ offset: peopleOptions.value.length
41
+ };
42
+ const res = await api.getAccountList(props.base_api, 1, query);
43
+ if (res && res.code !== 0)
44
+ return;
45
+ if (res && res.message) {
46
+ if (((_b = (_a = res.message) == null ? void 0 : _a.users) == null ? void 0 : _b.length) < limit.value)
47
+ noMore.value = true;
48
+ if (isMore) {
49
+ peopleOptions.value = peopleOptions.value.concat(
50
+ ((_c = res.message) == null ? void 0 : _c.users) || []
51
+ );
52
+ return;
53
+ }
54
+ peopleOptions.value = ((_d = res.message) == null ? void 0 : _d.users) || [];
55
+ }
56
+ };
57
+ vue.watch(
58
+ () => filter$1.value,
59
+ () => contentSearch(),
60
+ { deep: true }
61
+ );
62
+ const contentSearch = () => {
63
+ if (filter$1.value.keyword === "" && filter$1.value.upload_by === "" && filter$1.value.sf === "" && filter$1.value.wh_rate === "" && filter$1.value.uploadTime === null) {
64
+ emit("search", null);
65
+ } else {
66
+ const filterObj = {
67
+ ...filter$1.value,
68
+ created_begin: filter$1.value.uploadTime && filter$1.value.uploadTime.length ? filter$1.value.uploadTime[0] / 1e3 : null,
69
+ created_end: filter$1.value.uploadTime && filter$1.value.uploadTime.length ? filter$1.value.uploadTime[1] / 1e3 : null
70
+ };
71
+ delete filterObj.uploadTime;
72
+ emit("search", { ...filterObj });
73
+ }
74
+ };
75
+ const clearKeyword = () => {
76
+ filter$1.value.keyword = "";
77
+ filter$1.value.sf = "";
78
+ };
79
+ const clearDatePicker = () => {
80
+ filter$1.value.uploadTime = null;
81
+ };
82
+ const changeCurrentSelection = (item) => {
83
+ filter$1.value.sf = item;
84
+ };
85
+ const showReset = vue.computed(
86
+ () => filter$1.value.keyword || filter$1.value.upload_by || filter$1.value.sf || filter$1.value.uploadTime || filter$1.value.wh_rate
87
+ );
88
+ const reset = () => {
89
+ filter$1.value = {
90
+ keyword: "",
91
+ upload_by: "",
92
+ sf: "",
93
+ uploadTime: null,
94
+ wh_rate: ""
95
+ };
96
+ };
97
+ vue.onMounted(() => {
98
+ loadUploadPeopleData();
99
+ });
100
+ __expose({ reset });
101
+ return (_ctx, _cache) => {
102
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
103
+ vue.createElementVNode("div", _hoisted_2, [
104
+ vue.renderSlot(_ctx.$slots, "other"),
105
+ vue.createElementVNode("div", _hoisted_3, [
106
+ vue.createElementVNode("div", _hoisted_4, [
107
+ vue.createVNode(vue.unref(webVue.Input), {
108
+ modelValue: filter$1.value.keyword,
109
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => filter$1.value.keyword = $event),
110
+ class: "filter-item",
111
+ "allow-clear": "",
112
+ placeholder: "\u8F93\u5165\u7D20\u6750\u6807\u9898\u641C\u7D22",
113
+ onClear: clearKeyword
114
+ }, null, 8, ["modelValue"]),
115
+ vue.createVNode(vue.unref(webVue.RangePicker), {
116
+ modelValue: filter$1.value.uploadTime,
117
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => filter$1.value.uploadTime = $event),
118
+ class: "filter-item",
119
+ style: { "width": "240px" },
120
+ "value-format": "timestamp",
121
+ "default-value": ["00:00:00", "23:59:59"],
122
+ onClear: clearDatePicker
123
+ }, null, 8, ["modelValue"]),
124
+ vue.createVNode(vue.unref(webVue.Select), {
125
+ modelValue: filter$1.value.upload_by,
126
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => filter$1.value.upload_by = $event),
127
+ label: filter$1.value.upload_by === "\u5168\u90E8\u4EBA\u5458" ? "" : filter$1.value.upload_by,
128
+ class: "filter-item",
129
+ placeholder: "\u4E0A\u4F20\u4EBA",
130
+ "allow-search": "",
131
+ onDropdownReachBottom: _cache[3] || (_cache[3] = ($event) => loadUploadPeopleData(true))
132
+ }, {
133
+ default: vue.withCtx(() => [
134
+ vue.createVNode(vue.unref(webVue.Option), {
135
+ label: "\u5168\u90E8\u4EBA\u5458",
136
+ value: ""
137
+ }),
138
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(peopleOptions.value, (item) => {
139
+ return vue.openBlock(), vue.createBlock(vue.unref(webVue.Option), {
140
+ key: item.id,
141
+ label: item.alias,
142
+ value: item.id
143
+ }, null, 8, ["label", "value"]);
144
+ }), 128))
145
+ ]),
146
+ _: 1
147
+ }, 8, ["modelValue", "label"]),
148
+ vue.createVNode(vue.unref(webVue.Select), {
149
+ modelValue: filter$1.value.wh_rate,
150
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => filter$1.value.wh_rate = $event),
151
+ class: "filter-item",
152
+ placeholder: "\u56FE\u7247\u6BD4\u4F8B"
153
+ }, {
154
+ default: vue.withCtx(() => [
155
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(filter.rateOptions), (item) => {
156
+ return vue.openBlock(), vue.createBlock(vue.unref(webVue.Option), {
157
+ key: item.value,
158
+ label: item.label,
159
+ value: item.value
160
+ }, null, 8, ["label", "value"]);
161
+ }), 128))
162
+ ]),
163
+ _: 1
164
+ }, 8, ["modelValue"]),
165
+ vue.withDirectives(vue.createVNode(vue.unref(webVue.Button), {
166
+ type: "text",
167
+ size: "medium",
168
+ onClick: reset
169
+ }, {
170
+ icon: vue.withCtx(() => [
171
+ vue.createVNode(vue.unref(icon.IconRefresh))
172
+ ]),
173
+ default: vue.withCtx(() => [
174
+ vue.createTextVNode("\u91CD\u7F6E\u7B5B\u9009")
175
+ ]),
176
+ _: 1
177
+ }, 512), [
178
+ [vue.vShow, showReset.value]
179
+ ])
180
+ ]),
181
+ vue.createElementVNode("div", _hoisted_5, [
182
+ vue.createVNode(vue.unref(webVue.Button), {
183
+ type: "secondary",
184
+ size: "medium"
185
+ }, {
186
+ icon: vue.withCtx(() => [
187
+ vue.createVNode(vue.unref(icon.IconUpload))
188
+ ]),
189
+ _: 1
190
+ })
191
+ ])
192
+ ])
193
+ ]),
194
+ vue.createCommentVNode(" \u68C0\u7D22\u7B5B\u9009 "),
195
+ vue.withDirectives(vue.createElementVNode("div", null, [
196
+ vue.createElementVNode("div", _hoisted_6, [
197
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(filter.keywordsSelection), (item, i) => {
198
+ return vue.openBlock(), vue.createElementBlock("div", {
199
+ key: i,
200
+ class: vue.normalizeClass(["selection-item", { active: filter$1.value.sf === item.value }]),
201
+ onClick: ($event) => changeCurrentSelection(item.value)
202
+ }, vue.toDisplayString(item.name), 11, _hoisted_7);
203
+ }), 128))
204
+ ])
205
+ ], 512), [
206
+ [vue.vShow, props.activeMediaType !== "ai" && filter$1.value.keyword]
207
+ ])
208
+ ]);
209
+ };
210
+ }
211
+ });
212
+ module.exports = _sfc_main;