@cmstops/pro-compo 0.1.2 → 0.1.4

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 (170) hide show
  1. package/dist/index.css +141 -5
  2. package/dist/index.min.css +1 -1
  3. package/es/appCenter/component.js +3 -2
  4. package/es/appCenter/script/routeMap.d.ts +1 -1
  5. package/es/appCenter/style/index.css +1 -1
  6. package/es/appCenter/style/index.less +1 -1
  7. package/es/config.d.ts +2 -0
  8. package/es/config.js +3 -0
  9. package/es/contentModal/component.d.ts +0 -0
  10. package/es/contentModal/component.js +175 -0
  11. package/es/contentModal/components/CompoList/CompoFilter/index.d.ts +0 -0
  12. package/es/contentModal/components/CompoList/CompoFilter/index.js +103 -0
  13. package/es/contentModal/components/CompoList/index.d.ts +0 -0
  14. package/es/contentModal/components/CompoList/index.js +234 -0
  15. package/es/contentModal/components/ViewAllColumn/MediaFilter/index.d.ts +0 -0
  16. package/es/contentModal/components/ViewAllColumn/MediaFilter/index.js +44 -0
  17. package/es/contentModal/components/ViewAllColumn/columnTree/index.d.ts +0 -0
  18. package/es/contentModal/components/ViewAllColumn/columnTree/index.js +101 -0
  19. package/es/contentModal/components/ViewAllColumn/index.d.ts +0 -0
  20. package/es/contentModal/components/ViewAllColumn/index.js +277 -0
  21. package/es/contentModal/components/storeBox/index.d.ts +0 -0
  22. package/es/contentModal/components/storeBox/index.js +107 -0
  23. package/es/contentModal/index.d.ts +2 -0
  24. package/es/contentModal/index.js +7 -0
  25. package/es/contentModal/script/api.d.ts +10 -0
  26. package/es/contentModal/script/api.js +45 -0
  27. package/es/contentModal/style/MediaFilter.less +8 -0
  28. package/es/contentModal/style/ViewAllColumn.less +33 -0
  29. package/es/contentModal/style/columnTree.less +9 -0
  30. package/es/contentModal/style/css.js +5 -0
  31. package/es/contentModal/style/index.css +13 -0
  32. package/es/contentModal/style/index.d.ts +5 -0
  33. package/es/contentModal/style/index.js +5 -0
  34. package/es/contentModal/style/index.less +16 -0
  35. package/es/contentModal/style/storeBox.less +45 -0
  36. package/es/hooks/batch.d.ts +8 -0
  37. package/es/hooks/batch.js +26 -0
  38. package/es/hooks/user.d.ts +11 -0
  39. package/es/hooks/user.js +46 -0
  40. package/es/index.css +141 -5
  41. package/es/index.d.ts +6 -1
  42. package/es/index.js +6 -1
  43. package/es/index.less +6 -1
  44. package/es/messageBox/component.d.ts +0 -0
  45. package/es/messageBox/component.js +146 -0
  46. package/es/messageBox/index.d.ts +2 -0
  47. package/es/messageBox/index.js +7 -0
  48. package/es/messageBox/list.d.ts +0 -0
  49. package/es/messageBox/list.js +116 -0
  50. package/es/messageBox/script/api.d.ts +6 -0
  51. package/es/messageBox/script/api.js +16 -0
  52. package/es/messageBox/style/index.css +64 -0
  53. package/es/messageBox/style/index.less +71 -0
  54. package/es/resourceModal/component.d.ts +0 -0
  55. package/es/resourceModal/component.js +14 -0
  56. package/es/resourceModal/index.d.ts +2 -0
  57. package/es/resourceModal/index.js +7 -0
  58. package/es/resourceModal/style/css.js +1 -0
  59. package/es/resourceModal/style/index.d.ts +1 -0
  60. package/es/resourceModal/style/index.js +1 -0
  61. package/es/style.css +5 -0
  62. package/es/typeIcons/component.d.ts +0 -0
  63. package/es/typeIcons/component.js +62 -0
  64. package/es/typeIcons/index.d.ts +2 -0
  65. package/es/typeIcons/index.js +7 -0
  66. package/es/typeIcons/style/css.js +1 -0
  67. package/es/typeIcons/style/index.css +5 -0
  68. package/es/typeIcons/style/index.d.ts +1 -0
  69. package/es/typeIcons/style/index.js +1 -0
  70. package/es/typeIcons/style/index.less +5 -0
  71. package/es/uploadStep/component.d.ts +0 -0
  72. package/es/uploadStep/component.js +14 -0
  73. package/es/uploadStep/index.d.ts +2 -0
  74. package/es/uploadStep/index.js +7 -0
  75. package/es/uploadStep/style/css.js +1 -0
  76. package/es/uploadStep/style/index.d.ts +1 -0
  77. package/es/uploadStep/style/index.js +1 -0
  78. package/es/userAvater/component.d.ts +0 -0
  79. package/es/userAvater/component.js +167 -0
  80. package/es/userAvater/index.d.ts +2 -0
  81. package/es/userAvater/index.js +7 -0
  82. package/es/userAvater/script/api.d.ts +8 -0
  83. package/es/userAvater/script/api.js +32 -0
  84. package/es/userAvater/style/css.js +1 -0
  85. package/es/userAvater/style/index.css +50 -0
  86. package/es/userAvater/style/index.d.ts +1 -0
  87. package/es/userAvater/style/index.js +1 -0
  88. package/es/userAvater/style/index.less +54 -0
  89. package/es/utils/index.d.ts +1 -0
  90. package/es/utils/index.js +7 -0
  91. package/es/utils/request.js +1 -1
  92. package/es/utils/typeMap.d.ts +116 -0
  93. package/es/utils/typeMap.js +22 -0
  94. package/lib/appCenter/component.js +3 -2
  95. package/lib/appCenter/style/index.css +1 -1
  96. package/lib/appCenter/style/index.less +1 -1
  97. package/lib/config.js +6 -0
  98. package/lib/contentModal/component.js +176 -0
  99. package/lib/contentModal/components/CompoList/CompoFilter/index.js +104 -0
  100. package/lib/contentModal/components/CompoList/index.js +235 -0
  101. package/lib/contentModal/components/ViewAllColumn/MediaFilter/index.js +45 -0
  102. package/lib/contentModal/components/ViewAllColumn/columnTree/index.js +102 -0
  103. package/lib/contentModal/components/ViewAllColumn/index.js +278 -0
  104. package/lib/contentModal/components/storeBox/index.js +108 -0
  105. package/lib/contentModal/index.js +8 -0
  106. package/lib/contentModal/script/api.js +52 -0
  107. package/lib/contentModal/style/MediaFilter.less +8 -0
  108. package/lib/contentModal/style/ViewAllColumn.less +33 -0
  109. package/lib/contentModal/style/columnTree.less +9 -0
  110. package/lib/contentModal/style/css.js +6 -0
  111. package/lib/contentModal/style/index.css +13 -0
  112. package/lib/contentModal/style/index.js +6 -0
  113. package/lib/contentModal/style/index.less +16 -0
  114. package/lib/contentModal/style/storeBox.less +45 -0
  115. package/lib/hooks/batch.js +27 -0
  116. package/lib/hooks/user.js +49 -0
  117. package/lib/index.css +141 -5
  118. package/lib/index.js +14 -4
  119. package/lib/index.less +6 -1
  120. package/lib/messageBox/component.js +147 -0
  121. package/lib/messageBox/index.js +8 -0
  122. package/lib/messageBox/list.js +117 -0
  123. package/lib/messageBox/script/api.js +19 -0
  124. package/lib/messageBox/style/index.css +64 -0
  125. package/lib/messageBox/style/index.less +71 -0
  126. package/lib/resourceModal/component.js +15 -0
  127. package/lib/resourceModal/index.js +8 -0
  128. package/lib/resourceModal/style/css.js +2 -0
  129. package/lib/resourceModal/style/index.css +4 -0
  130. package/lib/resourceModal/style/index.js +2 -0
  131. package/lib/resourceModal/style/index.less +4 -0
  132. package/lib/typeIcons/component.js +63 -0
  133. package/lib/{button → typeIcons}/index.js +2 -2
  134. package/lib/typeIcons/style/css.js +2 -0
  135. package/lib/typeIcons/style/index.css +5 -0
  136. package/lib/typeIcons/style/index.js +2 -0
  137. package/lib/typeIcons/style/index.less +5 -0
  138. package/lib/uploadStep/component.js +15 -0
  139. package/lib/uploadStep/index.js +8 -0
  140. package/lib/uploadStep/style/css.js +2 -0
  141. package/lib/uploadStep/style/index.css +4 -0
  142. package/lib/uploadStep/style/index.js +2 -0
  143. package/lib/uploadStep/style/index.less +4 -0
  144. package/lib/userAvater/component.js +168 -0
  145. package/lib/userAvater/index.js +8 -0
  146. package/lib/userAvater/script/api.js +37 -0
  147. package/lib/userAvater/style/css.js +2 -0
  148. package/lib/userAvater/style/index.css +50 -0
  149. package/lib/userAvater/style/index.js +2 -0
  150. package/lib/userAvater/style/index.less +54 -0
  151. package/lib/utils/index.js +13 -0
  152. package/lib/utils/request.js +1 -1
  153. package/lib/utils/typeMap.js +25 -0
  154. package/package.json +4 -2
  155. package/es/_virtual/plugin-vue_export-helper.js +0 -7
  156. package/es/button/component.d.ts +0 -24
  157. package/es/button/component.js +0 -43
  158. package/es/button/index.d.ts +0 -103
  159. package/es/button/index.js +0 -7
  160. package/lib/_virtual/plugin-vue_export-helper.js +0 -8
  161. package/lib/button/component.js +0 -44
  162. /package/es/{button → messageBox}/style/css.js +0 -0
  163. /package/es/{button → messageBox}/style/index.d.ts +0 -0
  164. /package/es/{button → messageBox}/style/index.js +0 -0
  165. /package/es/{button → resourceModal}/style/index.css +0 -0
  166. /package/es/{button → resourceModal}/style/index.less +0 -0
  167. /package/{lib/button → es/uploadStep}/style/index.css +0 -0
  168. /package/{lib/button → es/uploadStep}/style/index.less +0 -0
  169. /package/lib/{button → messageBox}/style/css.js +0 -0
  170. /package/lib/{button → messageBox}/style/index.js +0 -0
@@ -0,0 +1,176 @@
1
+ "use strict";
2
+ var vue = require("vue");
3
+ var webVue = require("@arco-design/web-vue");
4
+ var index = require("./components/ViewAllColumn/index.js");
5
+ var index$2 = require("./components/CompoList/index.js");
6
+ var index$1 = require("./components/storeBox/index.js");
7
+ require("../typeIcons/style/index.js");
8
+ var config = require("../config.js");
9
+ var user = require("../hooks/user.js");
10
+ const _sfc_main = vue.defineComponent({
11
+ ...{ name: "contentModal" },
12
+ __name: "component",
13
+ props: {
14
+ BASE_API: {},
15
+ visible: { type: Boolean },
16
+ title: {},
17
+ defaultSelectedData: {},
18
+ maxSelect: {},
19
+ typeData: {},
20
+ userStore: {}
21
+ },
22
+ emits: ["update:visible", "comfirm"],
23
+ setup(__props, { emit }) {
24
+ const props = __props;
25
+ const BASE_API = props.BASE_API || config.DEFAULT_BASE_API;
26
+ const visible = vue.computed({
27
+ get() {
28
+ return props.visible;
29
+ },
30
+ set(value) {
31
+ setVisible(value);
32
+ }
33
+ });
34
+ const selectedData = vue.ref([]);
35
+ const hasSelected = vue.computed(() => {
36
+ return selectedData.value.length > 0;
37
+ });
38
+ const typeDataController = vue.ref(props.typeData);
39
+ const setVisible = (bool) => {
40
+ emit("update:visible", bool);
41
+ };
42
+ const selectedDataChangeHandle = (data) => {
43
+ selectedData.value = data;
44
+ };
45
+ const handleOk = () => {
46
+ setVisible(false);
47
+ };
48
+ const handleCancel = () => {
49
+ setVisible(false);
50
+ };
51
+ const comfirm = () => {
52
+ emit("comfirm", JSON.parse(JSON.stringify(selectedData.value)));
53
+ };
54
+ const { userInfo, getUserInfoHandle } = user["default"](BASE_API);
55
+ const HandleOpen = () => {
56
+ selectedData.value = props.defaultSelectedData || [];
57
+ };
58
+ const HandleClose = () => {
59
+ selectedData.value = [];
60
+ };
61
+ vue.onMounted(() => {
62
+ if (props.userStore) {
63
+ userInfo.value = { BASE_API, ...props.userStore };
64
+ } else {
65
+ getUserInfoHandle();
66
+ }
67
+ });
68
+ return (_ctx, _cache) => {
69
+ return vue.openBlock(), vue.createBlock(vue.unref(webVue.Modal), {
70
+ visible: visible.value,
71
+ width: "986px",
72
+ "mask-closable": false,
73
+ footer: false,
74
+ "title-align": "start",
75
+ "unmount-on-close": "",
76
+ "modal-class": "add-content-modal-wrapper",
77
+ "body-class": "add-content-modal-body",
78
+ onOk: handleOk,
79
+ onOpen: HandleOpen,
80
+ onClose: HandleClose,
81
+ onCancel: handleCancel
82
+ }, {
83
+ title: vue.withCtx(() => [
84
+ vue.createTextVNode(vue.toDisplayString(props.title ? props.title : "\u6DFB\u52A0\u5185\u5BB9"), 1)
85
+ ]),
86
+ default: vue.withCtx(() => [
87
+ vue.createVNode(vue.unref(webVue.Tabs), {
88
+ class: "content-tabs",
89
+ justify: ""
90
+ }, {
91
+ default: vue.withCtx(() => [
92
+ typeDataController.value.addDoc ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.TabPane), {
93
+ key: "1",
94
+ title: "\u680F\u76EE"
95
+ }, {
96
+ default: vue.withCtx(() => [
97
+ vue.unref(userInfo) && vue.unref(userInfo).repository_id ? (vue.openBlock(), vue.createBlock(index, {
98
+ key: 0,
99
+ "max-select": _ctx.maxSelect,
100
+ "default-selected-data": selectedData.value,
101
+ "type-data": typeDataController.value,
102
+ series: typeDataController.value.docSeries,
103
+ banner: typeDataController.value.docBanner,
104
+ "user-info": vue.unref(userInfo),
105
+ onChange: selectedDataChangeHandle
106
+ }, {
107
+ store: vue.withCtx(() => [
108
+ vue.createVNode(index$1, {
109
+ selectData: selectedData.value,
110
+ "onUpdate:selectData": _cache[0] || (_cache[0] = ($event) => selectedData.value = $event)
111
+ }, null, 8, ["selectData"])
112
+ ]),
113
+ options: vue.withCtx(() => [
114
+ vue.createVNode(vue.unref(webVue.Button), {
115
+ type: "primary",
116
+ disabled: !hasSelected.value,
117
+ onClick: comfirm
118
+ }, {
119
+ default: vue.withCtx(() => [
120
+ vue.createTextVNode("\u6DFB\u52A0")
121
+ ]),
122
+ _: 1
123
+ }, 8, ["disabled"])
124
+ ]),
125
+ _: 1
126
+ }, 8, ["max-select", "default-selected-data", "type-data", "series", "banner", "user-info"])) : vue.createCommentVNode("v-if", true)
127
+ ]),
128
+ _: 1
129
+ })) : vue.createCommentVNode("v-if", true),
130
+ typeDataController.value.addCompo ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.TabPane), {
131
+ key: "2",
132
+ title: "\u7EC4\u4EF6"
133
+ }, {
134
+ default: vue.withCtx(() => [
135
+ vue.unref(userInfo) && vue.unref(userInfo).repository_id ? (vue.openBlock(), vue.createBlock(index$2, {
136
+ key: 0,
137
+ "max-select": _ctx.maxSelect,
138
+ "default-selected-data": selectedData.value,
139
+ "type-data": typeDataController.value,
140
+ columns: typeDataController.value.compoType,
141
+ "user-info": vue.unref(userInfo),
142
+ onChange: selectedDataChangeHandle
143
+ }, {
144
+ store: vue.withCtx(() => [
145
+ vue.createVNode(index$1, {
146
+ selectData: selectedData.value,
147
+ "onUpdate:selectData": _cache[1] || (_cache[1] = ($event) => selectedData.value = $event)
148
+ }, null, 8, ["selectData"])
149
+ ]),
150
+ options: vue.withCtx(() => [
151
+ vue.createVNode(vue.unref(webVue.Button), {
152
+ type: "primary",
153
+ disabled: !hasSelected.value,
154
+ onClick: comfirm
155
+ }, {
156
+ default: vue.withCtx(() => [
157
+ vue.createTextVNode("\u6DFB\u52A0")
158
+ ]),
159
+ _: 1
160
+ }, 8, ["disabled"])
161
+ ]),
162
+ _: 1
163
+ }, 8, ["max-select", "default-selected-data", "type-data", "columns", "user-info"])) : vue.createCommentVNode("v-if", true)
164
+ ]),
165
+ _: 1
166
+ })) : vue.createCommentVNode("v-if", true)
167
+ ]),
168
+ _: 1
169
+ })
170
+ ]),
171
+ _: 1
172
+ }, 8, ["visible"]);
173
+ };
174
+ }
175
+ });
176
+ module.exports = _sfc_main;
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ var vue = require("vue");
3
+ var webVue = require("@arco-design/web-vue");
4
+ var typeMap = require("../../../../utils/typeMap.js");
5
+ const _hoisted_1 = { class: "media-filter-container" };
6
+ const _sfc_main = vue.defineComponent({
7
+ ...{ name: "CompoFilter" },
8
+ __name: "index",
9
+ props: {
10
+ group_id: {},
11
+ groups: {},
12
+ userInfo: {}
13
+ },
14
+ emits: ["update:group_id", "search"],
15
+ setup(__props, { emit }) {
16
+ const props = __props;
17
+ const columnIdMap = typeMap.compoColumnsMap();
18
+ const filter = vue.ref({ keyword: "", columns: "" });
19
+ const groupId = vue.computed({
20
+ get() {
21
+ return props.group_id;
22
+ },
23
+ set(val) {
24
+ emit("update:group_id", val);
25
+ }
26
+ });
27
+ const typeOptions = vue.computed(() => {
28
+ const arr = Object.keys(columnIdMap).map((key) => {
29
+ return {
30
+ label: columnIdMap[key],
31
+ value: key
32
+ };
33
+ });
34
+ return [{ value: "", label: "\u5168\u90E8\u7C7B\u578B" }, ...arr];
35
+ });
36
+ const groupOptions = vue.computed(() => {
37
+ const arr = props.groups.map((item) => {
38
+ return {
39
+ label: item.alias || item.title,
40
+ value: item.id
41
+ };
42
+ });
43
+ return [{ value: "all", label: "\u5168\u90E8\u7EC4\u4EF6" }, ...arr];
44
+ });
45
+ const handleSearch = () => {
46
+ emit("search", filter.value);
47
+ };
48
+ vue.watch(filter.value, () => {
49
+ handleSearch();
50
+ });
51
+ return (_ctx, _cache) => {
52
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
53
+ vue.createVNode(vue.unref(webVue.Space), { size: "large" }, {
54
+ default: vue.withCtx(() => [
55
+ vue.createVNode(vue.unref(webVue.Select), {
56
+ modelValue: groupId.value,
57
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => groupId.value = $event),
58
+ class: "filter-item",
59
+ placeholder: "\u7EC4\u4EF6\u5206\u7C7B"
60
+ }, {
61
+ default: vue.withCtx(() => [
62
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(groupOptions.value, (item) => {
63
+ return vue.openBlock(), vue.createBlock(vue.unref(webVue.Option), {
64
+ key: item.value,
65
+ label: item.label,
66
+ value: item.value
67
+ }, null, 8, ["label", "value"]);
68
+ }), 128))
69
+ ]),
70
+ _: 1
71
+ }, 8, ["modelValue"]),
72
+ vue.createVNode(vue.unref(webVue.Select), {
73
+ modelValue: filter.value.columns,
74
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => filter.value.columns = $event),
75
+ class: "filter-item",
76
+ placeholder: "\u7C7B\u578B"
77
+ }, {
78
+ default: vue.withCtx(() => [
79
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(typeOptions.value, (item) => {
80
+ return vue.openBlock(), vue.createBlock(vue.unref(webVue.Option), {
81
+ key: item.value,
82
+ label: item.label,
83
+ value: item.value
84
+ }, null, 8, ["label", "value"]);
85
+ }), 128))
86
+ ]),
87
+ _: 1
88
+ }, 8, ["modelValue"]),
89
+ vue.createVNode(vue.unref(webVue.Input), {
90
+ modelValue: filter.value.keyword,
91
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => filter.value.keyword = $event),
92
+ class: "filter-item",
93
+ "allow-clear": "",
94
+ placeholder: "\u8F93\u5165\u7EC4\u4EF6\u6807\u9898\u67E5\u627E",
95
+ onPressEnter: handleSearch
96
+ }, null, 8, ["modelValue"])
97
+ ]),
98
+ _: 1
99
+ })
100
+ ]);
101
+ };
102
+ }
103
+ });
104
+ module.exports = _sfc_main;
@@ -0,0 +1,235 @@
1
+ "use strict";
2
+ var vue = require("vue");
3
+ var webVue = require("@arco-design/web-vue");
4
+ var component = require("../../../typeIcons/component.js");
5
+ var index$1 = require("./CompoFilter/index.js");
6
+ var batch = require("../../../hooks/batch.js");
7
+ var api = require("../../script/api.js");
8
+ var typeMap = require("../../../utils/typeMap.js");
9
+ var index = require("../../../utils/index.js");
10
+ const _hoisted_1 = { class: "view-all-column-container" };
11
+ const _hoisted_2 = { class: "content-table-view" };
12
+ const _hoisted_3 = { class: "title-span" };
13
+ const _hoisted_4 = ["onClick"];
14
+ const _hoisted_5 = { class: "title" };
15
+ const _hoisted_6 = { class: "bottom-view" };
16
+ const _hoisted_7 = { class: "left" };
17
+ const _sfc_main = vue.defineComponent({
18
+ ...{ name: "CompoList" },
19
+ __name: "index",
20
+ props: {
21
+ maxSelect: {},
22
+ defaultSelectedData: {},
23
+ typeData: {},
24
+ userInfo: {}
25
+ },
26
+ emits: ["change"],
27
+ setup(__props, { emit }) {
28
+ const props = __props;
29
+ const columnIdMap = typeMap.compoColumnsMap();
30
+ const _maxSelect = props.maxSelect || 100;
31
+ const selectedData = vue.ref([]);
32
+ const tempSelectedData = vue.computed(() => {
33
+ return props.defaultSelectedData || [];
34
+ });
35
+ vue.watch(
36
+ () => tempSelectedData.value,
37
+ (val) => {
38
+ selectedData.value = val;
39
+ }
40
+ );
41
+ const {
42
+ isItemChecked,
43
+ hoverBatchBox,
44
+ tableCellMouseEnter,
45
+ tableCellMouseLeave
46
+ } = batch();
47
+ const clickCheckbox = (e, record) => {
48
+ e.stopPropagation();
49
+ e.preventDefault();
50
+ selectData(record);
51
+ };
52
+ const selectTableCell = (record) => {
53
+ selectData(record);
54
+ };
55
+ const selectData = (record) => {
56
+ addDataToSelectedList(record);
57
+ };
58
+ const addDataToSelectedList = async (record) => {
59
+ const index2 = selectedData.value.findIndex((v) => v.id === record.id);
60
+ if (selectedData.value.length < _maxSelect) {
61
+ if (index2 === -1) {
62
+ selectedData.value.push(record);
63
+ } else {
64
+ selectedData.value.splice(index2, 1);
65
+ }
66
+ emitChange();
67
+ } else {
68
+ if (index2 === -1) {
69
+ selectedData.value.splice(selectedData.value.length - 1, 1);
70
+ selectedData.value.push(record);
71
+ } else {
72
+ selectedData.value.splice(index2, 1);
73
+ }
74
+ emitChange();
75
+ }
76
+ };
77
+ const emitChange = () => {
78
+ emit("change", selectedData.value);
79
+ };
80
+ const group_id = vue.ref("all");
81
+ const groupData = vue.ref([]);
82
+ const scrollPercent = { y: "100%" };
83
+ const search = (_filter) => {
84
+ if (_filter.keyword || _filter.columns) {
85
+ filter.value = { ..._filter };
86
+ } else {
87
+ filter.value = null;
88
+ }
89
+ loadData();
90
+ };
91
+ vue.watch(
92
+ () => group_id.value,
93
+ () => {
94
+ loadData();
95
+ }
96
+ );
97
+ const columns = [
98
+ {
99
+ title: "\u7EC4\u4EF6\u6807\u9898",
100
+ dataIndex: "title",
101
+ slotName: "title"
102
+ },
103
+ {
104
+ title: "\u7EC4\u4EF6\u7C7B\u578B",
105
+ dataIndex: "type",
106
+ slotName: "type"
107
+ },
108
+ {
109
+ title: "\u53D1\u5E03\u65F6\u95F4",
110
+ dataIndex: "pub_time",
111
+ slotName: "pub_time"
112
+ }
113
+ ];
114
+ const mediaFileData = vue.ref([]);
115
+ const filter = vue.ref(null);
116
+ const dataLoading = vue.ref(false);
117
+ const loadData = async () => {
118
+ const gid = group_id.value;
119
+ if (!gid)
120
+ return;
121
+ let params = {
122
+ rid: props.userInfo.repository_id,
123
+ state: 1,
124
+ group_type: 2
125
+ };
126
+ if (filter.value) {
127
+ params = { ...params, ...filter.value };
128
+ }
129
+ if (gid !== "all") {
130
+ params.gid = gid;
131
+ }
132
+ dataLoading.value = true;
133
+ const { code, message } = await api.searchMlists(props.userInfo.BASE_API, params);
134
+ dataLoading.value = false;
135
+ if (code === 0) {
136
+ mediaFileData.value = message.map((v) => {
137
+ v.catalog = "contentList";
138
+ v.channel_type = 1;
139
+ v.target_id = v.id;
140
+ v.target_type = 6;
141
+ v.pub_time = index.dateYYYYDDMMHHmm(v.publish_at);
142
+ v.update_time = v.updated_at;
143
+ v.pub_user_alias = v.publish_user_alias;
144
+ v.creator_alias = v.creator_alias || v.author_alias;
145
+ v._type = 2;
146
+ return v;
147
+ }) || [];
148
+ }
149
+ };
150
+ const getGroupData = async () => {
151
+ const params = {
152
+ rid: props.userInfo.repository_id,
153
+ cid: props.userInfo.default_wap_channel_id,
154
+ group_type: 2,
155
+ less: true,
156
+ active: true,
157
+ limit: 500,
158
+ offset: 0
159
+ };
160
+ const { code, message } = await api.getCategorylistsGroups(
161
+ props.userInfo.BASE_API,
162
+ params
163
+ );
164
+ if (code === 0 && message) {
165
+ const { groups } = message;
166
+ groupData.value = groups.map((v) => {
167
+ v._type = 1;
168
+ v.catalog = "group";
169
+ return v;
170
+ });
171
+ loadData();
172
+ }
173
+ };
174
+ vue.onMounted(() => {
175
+ getGroupData();
176
+ });
177
+ return (_ctx, _cache) => {
178
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
179
+ vue.createVNode(index$1, {
180
+ group_id: group_id.value,
181
+ "onUpdate:group_id": _cache[0] || (_cache[0] = ($event) => group_id.value = $event),
182
+ groups: groupData.value,
183
+ "user-info": props.userInfo,
184
+ onSearch: search
185
+ }, null, 8, ["group_id", "groups", "user-info"]),
186
+ vue.createElementVNode("div", _hoisted_2, [
187
+ vue.createVNode(vue.unref(webVue.Table), {
188
+ columns,
189
+ scroll: scrollPercent,
190
+ pagination: false,
191
+ bordered: false,
192
+ data: mediaFileData.value,
193
+ loading: dataLoading.value,
194
+ onCellMouseEnter: vue.unref(tableCellMouseEnter),
195
+ onCellMouseLeave: vue.unref(tableCellMouseLeave),
196
+ onRowClick: selectTableCell
197
+ }, {
198
+ title: vue.withCtx(({ record }) => [
199
+ vue.createElementVNode("span", _hoisted_3, [
200
+ vue.unref(hoverBatchBox)(selectedData.value, record) ? (vue.openBlock(), vue.createElementBlock("span", {
201
+ key: 0,
202
+ onClick: vue.withModifiers(($event) => clickCheckbox($event, record), ["stop"])
203
+ }, [
204
+ vue.createVNode(vue.unref(webVue.Checkbox), {
205
+ class: "icon",
206
+ "model-value": vue.unref(isItemChecked)(selectedData.value, record)
207
+ }, null, 8, ["model-value"])
208
+ ], 8, _hoisted_4)) : (vue.openBlock(), vue.createBlock(component, {
209
+ key: 1,
210
+ class: "icon",
211
+ type: record.series
212
+ }, null, 8, ["type"])),
213
+ vue.createElementVNode("span", _hoisted_5, vue.toDisplayString(record.title || record.alias || "--"), 1)
214
+ ])
215
+ ]),
216
+ type: vue.withCtx(({ record }) => [
217
+ vue.createElementVNode("span", null, vue.toDisplayString(vue.unref(columnIdMap)[record.columns]), 1)
218
+ ]),
219
+ pub_time: vue.withCtx(({ record }) => [
220
+ vue.createElementVNode("span", null, vue.toDisplayString(record.pub_time), 1)
221
+ ]),
222
+ _: 1
223
+ }, 8, ["data", "loading", "onCellMouseEnter", "onCellMouseLeave"])
224
+ ]),
225
+ vue.createElementVNode("div", _hoisted_6, [
226
+ vue.createElementVNode("div", _hoisted_7, [
227
+ vue.renderSlot(_ctx.$slots, "store")
228
+ ]),
229
+ vue.renderSlot(_ctx.$slots, "options")
230
+ ])
231
+ ]);
232
+ };
233
+ }
234
+ });
235
+ module.exports = _sfc_main;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var vue = require("vue");
3
+ var index = require("../columnTree/index.js");
4
+ const _hoisted_1 = { class: "media-filter-container" };
5
+ const _sfc_main = vue.defineComponent({
6
+ ...{ name: "MediaFilter" },
7
+ __name: "index",
8
+ props: {
9
+ group_id: {},
10
+ tree: {},
11
+ series: {},
12
+ banner: {},
13
+ height: {},
14
+ userInfo: {}
15
+ },
16
+ emits: ["update:group_id"],
17
+ setup(__props, { emit }) {
18
+ const props = __props;
19
+ const column_id = vue.ref(0);
20
+ vue.watch(
21
+ () => props.group_id,
22
+ (val) => {
23
+ column_id.value = val;
24
+ }
25
+ );
26
+ vue.watch(
27
+ () => column_id.value,
28
+ (val) => {
29
+ emit("update:group_id", val);
30
+ }
31
+ );
32
+ return (_ctx, _cache) => {
33
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
34
+ vue.createVNode(index, {
35
+ column_id: column_id.value,
36
+ "onUpdate:column_id": _cache[0] || (_cache[0] = ($event) => column_id.value = $event),
37
+ height: props.height,
38
+ tree: props.tree,
39
+ "user-info": props.userInfo
40
+ }, null, 8, ["column_id", "height", "tree", "user-info"])
41
+ ]);
42
+ };
43
+ }
44
+ });
45
+ module.exports = _sfc_main;
@@ -0,0 +1,102 @@
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 api = require("../../../script/api.js");
6
+ const _hoisted_1 = { class: "column-selection-container" };
7
+ const _sfc_main = vue.defineComponent({
8
+ ...{ name: "columnTree" },
9
+ __name: "index",
10
+ props: {
11
+ column_id: {},
12
+ tree: {},
13
+ height: {},
14
+ userInfo: {}
15
+ },
16
+ emits: ["update:column_id"],
17
+ setup(__props, { emit }) {
18
+ const props = __props;
19
+ const selectAlais = vue.ref("");
20
+ const treeOptions = {
21
+ title: "alias",
22
+ isLeaf: "leaf"
23
+ };
24
+ vue.watch(
25
+ () => props.column_id,
26
+ (val) => {
27
+ setSelectAlais(val);
28
+ }
29
+ );
30
+ const setSelectAlais = async (id) => {
31
+ if (id === "all") {
32
+ selectAlais.value = "\u5168\u90E8\u5185\u5BB9";
33
+ return;
34
+ }
35
+ const { code, message } = await api.getCategoryPath(props.userInfo.BASE_API, {
36
+ repo: props.userInfo.repository_id,
37
+ category: id
38
+ });
39
+ if (code === 0) {
40
+ const pathArr = [];
41
+ for (const i of message) {
42
+ pathArr.push(i.category_alias);
43
+ }
44
+ selectAlais.value = pathArr.join("/");
45
+ }
46
+ };
47
+ const AddColumnSelected = (selectedKeys, data) => {
48
+ emit("update:column_id", data.node.id);
49
+ };
50
+ return (_ctx, _cache) => {
51
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
52
+ vue.createVNode(vue.unref(webVue.Popover), {
53
+ position: "bottom",
54
+ "content-class": "column-selection-popover-content",
55
+ "content-style": { minWidth: "120px" },
56
+ trigger: "click"
57
+ }, {
58
+ content: vue.withCtx(() => [
59
+ vue.createElementVNode("div", {
60
+ class: "column-selection-main",
61
+ style: vue.normalizeStyle({ minHeight: props.height + "px" })
62
+ }, [
63
+ vue.createElementVNode("div", {
64
+ class: "column-v",
65
+ style: vue.normalizeStyle({ height: props.height + "px" })
66
+ }, [
67
+ vue.createVNode(vue.unref(webVue.Scrollbar), {
68
+ "outer-class": "column-outer-scrollbar",
69
+ style: { "height": "100%", "overflow": "auto" }
70
+ }, {
71
+ default: vue.withCtx(() => [
72
+ vue.createVNode(vue.unref(webVue.Tree), {
73
+ "block-node": "",
74
+ data: props.tree,
75
+ "check-strictly": "",
76
+ "default-expand-all": false,
77
+ "field-names": treeOptions,
78
+ onSelect: AddColumnSelected
79
+ }, null, 8, ["data"])
80
+ ]),
81
+ _: 1
82
+ })
83
+ ], 4)
84
+ ], 4)
85
+ ]),
86
+ default: vue.withCtx(() => [
87
+ vue.createVNode(vue.unref(webVue.Button), { class: "button" }, {
88
+ default: vue.withCtx(() => [
89
+ vue.createVNode(vue.unref(icon.IconDragDotVertical)),
90
+ vue.createTextVNode(vue.toDisplayString(selectAlais.value), 1),
91
+ vue.createVNode(vue.unref(icon.IconCaretRight))
92
+ ]),
93
+ _: 1
94
+ })
95
+ ]),
96
+ _: 1
97
+ })
98
+ ]);
99
+ };
100
+ }
101
+ });
102
+ module.exports = _sfc_main;