@cmstops/pro-compo 0.1.9 → 0.1.11

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 (268) hide show
  1. package/dist/index.css +949 -0
  2. package/dist/index.min.css +1 -1
  3. package/es/_virtual/plugin-vue_export-helper.js +7 -0
  4. package/es/config.d.ts +2 -0
  5. package/es/config.js +5 -3
  6. package/es/contentDetailList/component.d.ts +0 -0
  7. package/es/contentDetailList/component.js +89 -0
  8. package/es/contentDetailList/components/Content/CompoItem/index.d.ts +0 -0
  9. package/es/contentDetailList/components/Content/CompoItem/index.js +76 -0
  10. package/es/contentDetailList/components/Content/ContentListItem/index.d.ts +0 -0
  11. package/es/contentDetailList/components/Content/ContentListItem/index.js +99 -0
  12. package/es/contentDetailList/components/Content/DocItem/ApprovalStateMap/index.d.ts +0 -0
  13. package/es/contentDetailList/components/Content/DocItem/ApprovalStateMap/index.js +71 -0
  14. package/es/contentDetailList/components/Content/DocItem/index.d.ts +0 -0
  15. package/es/contentDetailList/components/Content/DocItem/index.js +199 -0
  16. package/es/contentDetailList/components/Content/KongoNavItem/DocTags/index.d.ts +0 -0
  17. package/es/contentDetailList/components/Content/KongoNavItem/DocTags/index.js +184 -0
  18. package/es/contentDetailList/components/Content/KongoNavItem/index.d.ts +0 -0
  19. package/es/contentDetailList/components/Content/KongoNavItem/index.js +131 -0
  20. package/es/contentDetailList/components/Content/LiveItem/index.d.ts +0 -0
  21. package/es/contentDetailList/components/Content/LiveItem/index.js +82 -0
  22. package/es/contentDetailList/components/Content/MaccountItem/index.d.ts +0 -0
  23. package/es/contentDetailList/components/Content/MaccountItem/index.js +84 -0
  24. package/es/contentDetailList/components/Content/MaccountItem/temp/user.js +2 -0
  25. package/es/contentDetailList/components/Content/index.d.ts +0 -0
  26. package/es/contentDetailList/components/Content/index.js +308 -0
  27. package/es/contentDetailList/components/Doc/index.d.ts +0 -0
  28. package/es/contentDetailList/components/Doc/index.js +58 -0
  29. package/es/contentDetailList/index.d.ts +2 -0
  30. package/es/contentDetailList/index.js +7 -0
  31. package/es/contentDetailList/scripts/data.d.ts +254 -0
  32. package/es/contentDetailList/scripts/index.d.ts +58 -0
  33. package/es/contentDetailList/scripts/index.js +137 -0
  34. package/es/contentDetailList/style/ComoItem.less +106 -0
  35. package/es/contentDetailList/style/Content.less +49 -0
  36. package/es/contentDetailList/style/ContentListItem.less +131 -0
  37. package/es/contentDetailList/style/Doc.less +8 -0
  38. package/es/contentDetailList/style/DocItem.less +145 -0
  39. package/es/contentDetailList/style/DocTags.less +63 -0
  40. package/es/contentDetailList/style/KongoNavItem.less +110 -0
  41. package/es/contentDetailList/style/LiveItem.less +115 -0
  42. package/es/contentDetailList/style/MaccountItem.less +114 -0
  43. package/es/contentDetailList/style/css.js +1 -0
  44. package/es/contentDetailList/style/index.css +683 -0
  45. package/es/contentDetailList/style/index.d.ts +1 -0
  46. package/es/contentDetailList/style/index.js +1 -0
  47. package/es/contentDetailList/style/index.less +9 -0
  48. package/es/contentModal/component.js +2 -1
  49. package/es/contentModal/components/CompoList/CompoFilter/index.js +3 -2
  50. package/es/contentModal/components/CompoList/index.js +3 -2
  51. package/es/contentModal/components/ViewAllColumn/MediaFilter/index.js +2 -1
  52. package/es/contentModal/components/ViewAllColumn/columnTree/index.js +2 -1
  53. package/es/contentModal/components/ViewAllColumn/index.js +2 -1
  54. package/es/contentModal/components/storeBox/index.js +2 -1
  55. package/es/emptyData/component.d.ts +0 -0
  56. package/es/emptyData/component.js +48 -0
  57. package/es/emptyData/index.d.ts +2 -0
  58. package/es/emptyData/index.js +7 -0
  59. package/es/emptyData/style/css.js +1 -0
  60. package/es/emptyData/style/index.css +26 -0
  61. package/es/emptyData/style/index.d.ts +1 -0
  62. package/es/emptyData/style/index.js +1 -0
  63. package/es/emptyData/style/index.less +30 -0
  64. package/es/hooks/toggle.d.ts +6 -0
  65. package/es/hooks/toggle.js +9 -0
  66. package/es/hooks/user.js +2 -0
  67. package/es/index.css +949 -0
  68. package/es/index.d.ts +6 -0
  69. package/es/index.js +6 -0
  70. package/es/index.less +6 -0
  71. package/es/mediaFilter/component.d.ts +0 -0
  72. package/es/mediaFilter/component.js +41 -0
  73. package/es/mediaFilter/components/DocFilter.d.ts +0 -0
  74. package/es/mediaFilter/components/DocFilter.js +251 -0
  75. package/es/mediaFilter/components/DocFilter.vue_vue_type_style_index_0_scoped_true_lang.js +2 -0
  76. package/es/mediaFilter/components/FilterGroup.d.ts +0 -0
  77. package/es/mediaFilter/components/FilterGroup.js +187 -0
  78. package/es/mediaFilter/components/FilterGroup.vue_vue_type_style_index_0_scoped_true_lang.js +2 -0
  79. package/es/mediaFilter/components/FilterItem.d.ts +0 -0
  80. package/es/mediaFilter/components/FilterItem.js +116 -0
  81. package/es/mediaFilter/components/FilterItem.vue_vue_type_style_index_0_scoped_true_lang.js +2 -0
  82. package/es/mediaFilter/components/MediaFilter.js +8 -0
  83. package/es/mediaFilter/components/MpAccountFilter.js +8 -0
  84. package/es/mediaFilter/components/MpContentFilter.js +8 -0
  85. package/es/mediaFilter/index.d.ts +2 -0
  86. package/es/mediaFilter/index.js +7 -0
  87. package/es/mediaFilter/script/optionsGetter.d.ts +26 -0
  88. package/es/mediaFilter/script/optionsGetter.js +82 -0
  89. package/es/mediaFilter/style/css.js +1 -0
  90. package/es/mediaFilter/style/index.css +4 -0
  91. package/es/mediaFilter/style/index.d.ts +1 -0
  92. package/es/mediaFilter/style/index.js +1 -0
  93. package/es/mediaFilter/style/index.less +4 -0
  94. package/es/messageBox/list.js +2 -1
  95. package/es/previousVersion/component.js +2 -1
  96. package/es/previousVersion/style/index.less +1 -0
  97. package/es/resourceModal/component.js +2 -1
  98. package/es/resourceModal/components/MediaPreviewer/index.js +2 -1
  99. package/es/resourceModal/components/MediaSelection/DocAiMediaSelected/index.js +2 -1
  100. package/es/resourceModal/components/MediaSelection/MainContent/FileTypeThumb/index.js +5 -3
  101. package/es/resourceModal/components/MediaSelection/MainContent/index.js +4 -2
  102. package/es/resourceModal/components/MediaSelection/ToolbarSearch/index.js +2 -1
  103. package/es/resourceModal/components/MediaSelection/index.js +3 -2
  104. package/es/resourceModal/script/filter.d.ts +1 -0
  105. package/es/resourceModal/script/filter.js +15 -2
  106. package/es/selectAvatarList/component.d.ts +0 -0
  107. package/es/selectAvatarList/component.js +77 -0
  108. package/es/selectAvatarList/index.d.ts +2 -0
  109. package/es/selectAvatarList/index.js +7 -0
  110. package/es/selectAvatarList/style/css.js +1 -0
  111. package/es/selectAvatarList/style/index.css +4 -0
  112. package/es/selectAvatarList/style/index.d.ts +1 -0
  113. package/es/selectAvatarList/style/index.js +1 -0
  114. package/es/selectAvatarList/style/index.less +4 -0
  115. package/es/selectGategory/component.js +5 -12
  116. package/es/selectGategory/components/ColumnSelection/index.js +5 -1
  117. package/es/style.css +89 -0
  118. package/es/uploadBefore/component.d.ts +0 -0
  119. package/es/uploadBefore/component.js +81 -0
  120. package/es/uploadBefore/components/UploadBefore.d.ts +0 -0
  121. package/es/uploadBefore/components/UploadBefore.js +228 -0
  122. package/es/uploadBefore/components/UploadForClick.d.ts +0 -0
  123. package/es/uploadBefore/components/UploadForClick.js +28 -0
  124. package/es/uploadBefore/index.d.ts +2 -0
  125. package/es/uploadBefore/index.js +7 -0
  126. package/es/uploadBefore/script/api.d.ts +16 -0
  127. package/es/uploadBefore/script/api.js +27 -0
  128. package/es/uploadBefore/script/fileTypeAdapter.d.ts +39 -0
  129. package/es/uploadBefore/script/fileTypeAdapter.js +48 -0
  130. package/es/uploadBefore/script/fileUpload.d.ts +7 -0
  131. package/es/uploadBefore/script/fileUpload.js +39 -0
  132. package/es/uploadBefore/script/uploadHooks.d.ts +55 -0
  133. package/es/uploadBefore/script/uploadHooks.js +33 -0
  134. package/es/uploadBefore/style/css.js +1 -0
  135. package/es/uploadBefore/style/index.css +111 -0
  136. package/es/uploadBefore/style/index.d.ts +1 -0
  137. package/es/uploadBefore/style/index.js +1 -0
  138. package/es/uploadBefore/style/index.less +144 -0
  139. package/es/uploadBefore/utils/dragUploadEvent.d.ts +0 -0
  140. package/es/uploadStep/component.js +139 -4
  141. package/es/uploadStep/script/fileTypeAdapter.d.ts +20 -0
  142. package/es/uploadStep/style/index.css +113 -0
  143. package/es/uploadStep/style/index.less +148 -0
  144. package/es/userDirector/component.d.ts +0 -0
  145. package/es/userDirector/component.js +200 -0
  146. package/es/userDirector/index.d.ts +2 -0
  147. package/es/userDirector/index.js +7 -0
  148. package/es/userDirector/script/api.d.ts +9 -0
  149. package/es/userDirector/script/api.js +32 -0
  150. package/es/userDirector/style/css.js +1 -0
  151. package/es/userDirector/style/index.css +8 -0
  152. package/es/userDirector/style/index.d.ts +1 -0
  153. package/es/userDirector/style/index.js +1 -0
  154. package/es/userDirector/style/index.less +8 -0
  155. package/es/utils/doc.d.ts +18 -16
  156. package/es/utils/doc.js +52 -0
  157. package/es/utils/index.d.ts +8 -0
  158. package/es/utils/index.js +22 -1
  159. package/es/utils/tusUpload.d.ts +8 -0
  160. package/es/utils/tusUpload.js +52 -0
  161. package/lib/_virtual/plugin-vue_export-helper.js +8 -0
  162. package/lib/config.js +6 -2
  163. package/lib/contentDetailList/component.js +90 -0
  164. package/lib/contentDetailList/components/Content/CompoItem/index.js +77 -0
  165. package/lib/contentDetailList/components/Content/ContentListItem/index.js +100 -0
  166. package/lib/contentDetailList/components/Content/DocItem/ApprovalStateMap/index.js +72 -0
  167. package/lib/contentDetailList/components/Content/DocItem/index.js +200 -0
  168. package/lib/contentDetailList/components/Content/KongoNavItem/DocTags/index.js +185 -0
  169. package/lib/contentDetailList/components/Content/KongoNavItem/index.js +132 -0
  170. package/lib/contentDetailList/components/Content/LiveItem/index.js +83 -0
  171. package/lib/contentDetailList/components/Content/MaccountItem/index.js +85 -0
  172. package/lib/contentDetailList/components/Content/MaccountItem/temp/user.js +3 -0
  173. package/lib/contentDetailList/components/Content/index.js +313 -0
  174. package/lib/contentDetailList/components/Doc/index.js +59 -0
  175. package/lib/contentDetailList/index.js +8 -0
  176. package/lib/contentDetailList/scripts/index.js +153 -0
  177. package/lib/contentDetailList/style/ComoItem.less +106 -0
  178. package/lib/contentDetailList/style/Content.less +49 -0
  179. package/lib/contentDetailList/style/ContentListItem.less +131 -0
  180. package/lib/contentDetailList/style/Doc.less +8 -0
  181. package/lib/contentDetailList/style/DocItem.less +145 -0
  182. package/lib/contentDetailList/style/DocTags.less +63 -0
  183. package/lib/contentDetailList/style/KongoNavItem.less +110 -0
  184. package/lib/contentDetailList/style/LiveItem.less +115 -0
  185. package/lib/contentDetailList/style/MaccountItem.less +114 -0
  186. package/lib/contentDetailList/style/css.js +2 -0
  187. package/lib/contentDetailList/style/index.css +683 -0
  188. package/lib/contentDetailList/style/index.js +2 -0
  189. package/lib/contentDetailList/style/index.less +9 -0
  190. package/lib/contentModal/component.js +2 -1
  191. package/lib/contentModal/components/CompoList/CompoFilter/index.js +3 -2
  192. package/lib/contentModal/components/CompoList/index.js +3 -2
  193. package/lib/contentModal/components/ViewAllColumn/MediaFilter/index.js +2 -1
  194. package/lib/contentModal/components/ViewAllColumn/columnTree/index.js +2 -1
  195. package/lib/contentModal/components/ViewAllColumn/index.js +2 -1
  196. package/lib/contentModal/components/storeBox/index.js +2 -1
  197. package/lib/emptyData/component.js +49 -0
  198. package/lib/emptyData/index.js +8 -0
  199. package/lib/emptyData/style/css.js +2 -0
  200. package/lib/emptyData/style/index.css +26 -0
  201. package/lib/emptyData/style/index.js +2 -0
  202. package/lib/emptyData/style/index.less +30 -0
  203. package/lib/hooks/toggle.js +11 -0
  204. package/lib/hooks/user.js +2 -0
  205. package/lib/index.css +949 -0
  206. package/lib/index.js +12 -0
  207. package/lib/index.less +6 -0
  208. package/lib/mediaFilter/component.js +42 -0
  209. package/lib/mediaFilter/components/DocFilter.js +252 -0
  210. package/lib/mediaFilter/components/DocFilter.vue_vue_type_style_index_0_scoped_true_lang.js +3 -0
  211. package/lib/mediaFilter/components/FilterGroup.js +188 -0
  212. package/lib/mediaFilter/components/FilterGroup.vue_vue_type_style_index_0_scoped_true_lang.js +3 -0
  213. package/lib/mediaFilter/components/FilterItem.js +117 -0
  214. package/lib/mediaFilter/components/FilterItem.vue_vue_type_style_index_0_scoped_true_lang.js +3 -0
  215. package/lib/mediaFilter/components/MediaFilter.js +9 -0
  216. package/lib/mediaFilter/components/MpAccountFilter.js +9 -0
  217. package/lib/mediaFilter/components/MpContentFilter.js +9 -0
  218. package/lib/mediaFilter/index.js +8 -0
  219. package/lib/mediaFilter/script/optionsGetter.js +88 -0
  220. package/lib/mediaFilter/style/css.js +2 -0
  221. package/lib/mediaFilter/style/index.css +4 -0
  222. package/lib/mediaFilter/style/index.js +2 -0
  223. package/lib/mediaFilter/style/index.less +4 -0
  224. package/lib/messageBox/list.js +2 -1
  225. package/lib/previousVersion/component.js +2 -1
  226. package/lib/previousVersion/style/index.less +1 -0
  227. package/lib/resourceModal/component.js +2 -1
  228. package/lib/resourceModal/components/MediaPreviewer/index.js +2 -1
  229. package/lib/resourceModal/components/MediaSelection/DocAiMediaSelected/index.js +2 -1
  230. package/lib/resourceModal/components/MediaSelection/MainContent/FileTypeThumb/index.js +5 -3
  231. package/lib/resourceModal/components/MediaSelection/MainContent/index.js +4 -2
  232. package/lib/resourceModal/components/MediaSelection/ToolbarSearch/index.js +2 -1
  233. package/lib/resourceModal/components/MediaSelection/index.js +3 -2
  234. package/lib/resourceModal/script/filter.js +14 -0
  235. package/lib/selectAvatarList/component.js +78 -0
  236. package/lib/selectAvatarList/index.js +8 -0
  237. package/lib/selectAvatarList/style/css.js +2 -0
  238. package/lib/selectAvatarList/style/index.css +4 -0
  239. package/lib/selectAvatarList/style/index.js +2 -0
  240. package/lib/selectAvatarList/style/index.less +4 -0
  241. package/lib/selectGategory/component.js +4 -11
  242. package/lib/selectGategory/components/ColumnSelection/index.js +5 -1
  243. package/lib/uploadBefore/component.js +82 -0
  244. package/lib/uploadBefore/components/UploadBefore.js +229 -0
  245. package/lib/uploadBefore/components/UploadForClick.js +29 -0
  246. package/lib/uploadBefore/index.js +8 -0
  247. package/lib/uploadBefore/script/api.js +32 -0
  248. package/lib/uploadBefore/script/fileTypeAdapter.js +53 -0
  249. package/lib/uploadBefore/script/fileUpload.js +42 -0
  250. package/lib/uploadBefore/script/uploadHooks.js +36 -0
  251. package/lib/uploadBefore/style/css.js +2 -0
  252. package/lib/uploadBefore/style/index.css +111 -0
  253. package/lib/uploadBefore/style/index.js +2 -0
  254. package/lib/uploadBefore/style/index.less +144 -0
  255. package/lib/uploadStep/component.js +138 -3
  256. package/lib/uploadStep/style/index.css +113 -0
  257. package/lib/uploadStep/style/index.less +148 -0
  258. package/lib/userDirector/component.js +201 -0
  259. package/lib/userDirector/index.js +8 -0
  260. package/lib/userDirector/script/api.js +38 -0
  261. package/lib/userDirector/style/css.js +2 -0
  262. package/lib/userDirector/style/index.css +8 -0
  263. package/lib/userDirector/style/index.js +2 -0
  264. package/lib/userDirector/style/index.less +8 -0
  265. package/lib/utils/doc.js +59 -0
  266. package/lib/utils/index.js +23 -0
  267. package/lib/utils/tusUpload.js +75 -0
  268. package/package.json +8 -1
@@ -0,0 +1,81 @@
1
+ import { defineComponent, ref, openBlock, createElementBlock, Fragment, createVNode, unref, isRef } from "vue";
2
+ import { fileAdapter } from "./script/fileTypeAdapter.js";
3
+ import { uploadFile, uploadAddRequest } from "./script/fileUpload.js";
4
+ import _sfc_main$1 from "./components/UploadForClick.js";
5
+ import _sfc_main$2 from "./components/UploadBefore.js";
6
+ import { DEFAULT_BASE_API } from "../config.js";
7
+ import { useToggle } from "../hooks/toggle.js";
8
+ import { to } from "../utils/index.js";
9
+ import { usePreUploadOptions, useUplaodList } from "./script/uploadHooks.js";
10
+ const _sfc_main = defineComponent({
11
+ ...{ name: "uploadBefore" },
12
+ __name: "component",
13
+ props: {
14
+ BASE_API: {},
15
+ uploadMethod: {}
16
+ },
17
+ emits: ["onProgress", "onListReady"],
18
+ setup(__props, { emit: __emit }) {
19
+ const { state: visBeforeUpload, open: openBeforePannel } = useToggle();
20
+ const { state: visUploadList, open: openListPannel } = useToggle();
21
+ const props = __props;
22
+ const emits = __emit;
23
+ const baseApi = ref(props.BASE_API || DEFAULT_BASE_API);
24
+ const { preOptionsList, uploadFileToShowFileTrans } = usePreUploadOptions();
25
+ const { fileList, uploadFileAdd } = useUplaodList();
26
+ const afterChoose = (file) => {
27
+ const retFile = fileAdapter(file);
28
+ if (!retFile)
29
+ return;
30
+ uploadFileAdd(retFile);
31
+ uploadFileToShowFileTrans(retFile);
32
+ !visBeforeUpload.value && openBeforePannel();
33
+ };
34
+ const afterPayload = (fl) => {
35
+ emits("onListReady", fl);
36
+ !visUploadList.value && openListPannel();
37
+ for (const file of fileList.value) {
38
+ handleProcess(file, fl);
39
+ }
40
+ };
41
+ async function handleProcess(file, fl) {
42
+ file.id;
43
+ const sId = file.dirId || file.id;
44
+ const [err, uploadRet] = await to(
45
+ uploadFile(file.file, (p) => emits("onProgress", sId, p, 0))
46
+ );
47
+ if (err || !uploadRet || !uploadRet.url)
48
+ return emits("onProgress", sId, 0, -1);
49
+ emits("onProgress", sId, 100, 2);
50
+ const showFileData = fl.find((item) => item.id === sId);
51
+ if (!showFileData)
52
+ return false;
53
+ uploadAddRequest(
54
+ showFileData,
55
+ { rid: 4, dirId: 0, url: uploadRet.url },
56
+ baseApi.value,
57
+ (data) => {
58
+ console.log(data);
59
+ }
60
+ );
61
+ return true;
62
+ }
63
+ return (_ctx, _cache) => {
64
+ return openBlock(), createElementBlock(Fragment, null, [
65
+ createVNode(_sfc_main$1, {
66
+ "upload-method": _ctx.uploadMethod,
67
+ onAfterChoose: afterChoose
68
+ }, null, 8, ["upload-method"]),
69
+ createVNode(_sfc_main$2, {
70
+ visable: unref(visBeforeUpload),
71
+ "onUpdate:visable": _cache[0] || (_cache[0] = ($event) => isRef(visBeforeUpload) ? visBeforeUpload.value = $event : null),
72
+ "file-list": unref(preOptionsList),
73
+ "onUpdate:fileList": _cache[1] || (_cache[1] = ($event) => isRef(preOptionsList) ? preOptionsList.value = $event : null),
74
+ "b-a-s-e-a-p-i": baseApi.value,
75
+ onConfirm: afterPayload
76
+ }, null, 8, ["visable", "file-list", "b-a-s-e-a-p-i"])
77
+ ], 64);
78
+ };
79
+ }
80
+ });
81
+ export { _sfc_main as default };
File without changes
@@ -0,0 +1,228 @@
1
+ import { defineComponent, toRef, ref, watch, onMounted, openBlock, createBlock, unref, withCtx, createTextVNode, createElementVNode, createVNode, createElementBlock, Fragment, renderList, toDisplayString } from "vue";
2
+ import { Modal, Table, Switch, Select, Option } from "@arco-design/web-vue";
3
+ import { getWaterMark, getVideoTransTemplate, getAudioTransTrempalte } from "../script/api.js";
4
+ const _hoisted_1 = { class: "table_wrp" };
5
+ const _hoisted_2 = { key: 1 };
6
+ const _hoisted_3 = { key: 1 };
7
+ const _hoisted_4 = { key: 1 };
8
+ const _sfc_main = defineComponent({
9
+ __name: "UploadBefore",
10
+ props: {
11
+ visable: { type: Boolean },
12
+ fileList: {},
13
+ BASE_API: {}
14
+ },
15
+ emits: ["confirm", "update:visable", "update:file-list"],
16
+ setup(__props, { emit: __emit }) {
17
+ const props = __props;
18
+ const emits = __emit;
19
+ const modalVis = toRef(props, "visable");
20
+ const fileList = toRef(props, "fileList");
21
+ const column = [
22
+ {
23
+ title: "\u6587\u4EF6\u540D\u79F0",
24
+ dataIndex: "name",
25
+ ellipsis: true,
26
+ tooltip: true,
27
+ width: 200
28
+ },
29
+ { title: "\u6587\u4EF6\u7C7B\u578B", dataIndex: "typeCN", width: 100 },
30
+ { title: "\u6587\u4EF6\u5927\u5C0F", dataIndex: "sizeCN", width: 120 },
31
+ { title: "\u667A\u80FD\u7F16\u76EE", slotName: "analize", width: 100 },
32
+ { title: "\u6C34\u5370\u9009\u62E9", slotName: "watermark", width: 180 },
33
+ { title: "\u89C6\u9891\u8F6C\u7801\u6A21\u7248\u7EC4\u9009\u62E9", slotName: "vTransTemp", width: 180 },
34
+ { title: "\u97F3\u9891\u8F6C\u7801\u6A21\u7248\u7EC4\u9009\u62E9", slotName: "aTransTemp", width: 180 }
35
+ ];
36
+ const scroll = { y: "100%" };
37
+ const switched = ref([]);
38
+ const curChoseWm = ref([]);
39
+ const curVideoW = ref([]);
40
+ const curAudioW = ref([]);
41
+ const waterMarkList = ref([]);
42
+ const videoTempList = ref([]);
43
+ const audioTempList = ref([]);
44
+ const templateDict = /* @__PURE__ */ new Map();
45
+ const defaultWm = ref();
46
+ const defaultVm = ref();
47
+ const defaultAm = ref();
48
+ watch(
49
+ () => fileList.value,
50
+ (n) => {
51
+ n.forEach((item) => {
52
+ switched.value.push(false);
53
+ curChoseWm.value.push(
54
+ ["dir", "image"].includes(item.type) ? defaultWm.value : ""
55
+ );
56
+ curVideoW.value.push(
57
+ ["dir", "video"].includes(item.type) ? defaultVm.value : ""
58
+ );
59
+ curAudioW.value.push(
60
+ ["dir", "audio"].includes(item.type) ? defaultAm.value : ""
61
+ );
62
+ });
63
+ },
64
+ { deep: true }
65
+ );
66
+ const templateDataInit = async () => {
67
+ try {
68
+ let allTemp = [];
69
+ const wM = await getWaterMark(props.BASE_API);
70
+ if (wM.code === 0) {
71
+ waterMarkList.value = wM.message.images;
72
+ defaultWm.value = wM.message.default;
73
+ allTemp = allTemp.concat(wM.message.images);
74
+ }
75
+ const vM = await getVideoTransTemplate(props.BASE_API);
76
+ if (vM.code === 0) {
77
+ videoTempList.value = vM.message.templates;
78
+ defaultVm.value = vM.message.default;
79
+ allTemp = allTemp.concat(vM.message.templates);
80
+ }
81
+ const aM = await getAudioTransTrempalte(props.BASE_API);
82
+ if (aM.code === 0) {
83
+ audioTempList.value = aM.message.templates;
84
+ defaultAm.value = aM.message.default;
85
+ allTemp = allTemp.concat(aM.message.templates);
86
+ }
87
+ allTemp.forEach((item) => {
88
+ templateDict.set(item.id, item);
89
+ });
90
+ } catch (e) {
91
+ console.log(e);
92
+ }
93
+ };
94
+ const handleClose = () => {
95
+ emits("update:visable", false);
96
+ emits("update:file-list", []);
97
+ };
98
+ const handleOk = () => {
99
+ const ret = JSON.parse(JSON.stringify(fileList.value));
100
+ emits(
101
+ "confirm",
102
+ ret.map((item, idx) => {
103
+ return {
104
+ ...item,
105
+ isAnalize: switched.value[idx] ? 1 : 0,
106
+ watermark: templateDict.get(curChoseWm.value[idx]),
107
+ videotemp: templateDict.get(curVideoW.value[idx]),
108
+ audiotemp: templateDict.get(curAudioW.value[idx])
109
+ };
110
+ })
111
+ );
112
+ handleClose();
113
+ };
114
+ onMounted(() => {
115
+ templateDataInit();
116
+ });
117
+ return (_ctx, _cache) => {
118
+ return openBlock(), createBlock(unref(Modal), {
119
+ visible: modalVis.value,
120
+ "onUpdate:visible": _cache[0] || (_cache[0] = ($event) => modalVis.value = $event),
121
+ width: "80%",
122
+ onOk: handleOk,
123
+ onCancel: handleClose
124
+ }, {
125
+ title: withCtx(() => [
126
+ createTextVNode("\u4E0A\u4F20\u914D\u7F6E")
127
+ ]),
128
+ default: withCtx(() => [
129
+ createElementVNode("div", _hoisted_1, [
130
+ createVNode(unref(Table), {
131
+ columns: column,
132
+ data: fileList.value,
133
+ hoverable: false,
134
+ bordered: false,
135
+ pagination: false,
136
+ scroll
137
+ }, {
138
+ analize: withCtx(({ rowIndex }) => [
139
+ createVNode(unref(Switch), {
140
+ modelValue: switched.value[rowIndex],
141
+ "onUpdate:modelValue": ($event) => switched.value[rowIndex] = $event
142
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])
143
+ ]),
144
+ watermark: withCtx(({ rowIndex, record }) => [
145
+ ["dir", "image"].includes(record.type) ? (openBlock(), createBlock(unref(Select), {
146
+ key: 0,
147
+ modelValue: curChoseWm.value[rowIndex],
148
+ "onUpdate:modelValue": ($event) => curChoseWm.value[rowIndex] = $event,
149
+ placeholder: "\u8BF7\u9009\u62E9\u6C34\u5370",
150
+ "value-key": "id",
151
+ "allow-clear": ""
152
+ }, {
153
+ default: withCtx(() => [
154
+ (openBlock(true), createElementBlock(Fragment, null, renderList(waterMarkList.value, (item) => {
155
+ return openBlock(), createBlock(unref(Option), {
156
+ key: item.id,
157
+ value: item.id
158
+ }, {
159
+ default: withCtx(() => [
160
+ createTextVNode(toDisplayString(item.title), 1)
161
+ ]),
162
+ _: 2
163
+ }, 1032, ["value"]);
164
+ }), 128))
165
+ ]),
166
+ _: 2
167
+ }, 1032, ["modelValue", "onUpdate:modelValue"])) : (openBlock(), createElementBlock("div", _hoisted_2, "\u2014 \u2014"))
168
+ ]),
169
+ vTransTemp: withCtx(({ rowIndex, record }) => [
170
+ ["dir", "video"].includes(record.type) ? (openBlock(), createBlock(unref(Select), {
171
+ key: 0,
172
+ modelValue: curVideoW.value[rowIndex],
173
+ "onUpdate:modelValue": ($event) => curVideoW.value[rowIndex] = $event,
174
+ placeholder: "\u8BF7\u9009\u62E9\u8F6C\u7801\u6A21\u7248",
175
+ "value-key": "id",
176
+ "allow-clear": ""
177
+ }, {
178
+ default: withCtx(() => [
179
+ (openBlock(true), createElementBlock(Fragment, null, renderList(videoTempList.value, (item) => {
180
+ return openBlock(), createBlock(unref(Option), {
181
+ key: item.id,
182
+ value: item.id
183
+ }, {
184
+ default: withCtx(() => [
185
+ createTextVNode(toDisplayString(item.title), 1)
186
+ ]),
187
+ _: 2
188
+ }, 1032, ["value"]);
189
+ }), 128))
190
+ ]),
191
+ _: 2
192
+ }, 1032, ["modelValue", "onUpdate:modelValue"])) : (openBlock(), createElementBlock("div", _hoisted_3, "\u2014 \u2014"))
193
+ ]),
194
+ aTransTemp: withCtx(({ record, rowIndex }) => [
195
+ ["dir", "audio"].includes(record.type) ? (openBlock(), createBlock(unref(Select), {
196
+ key: 0,
197
+ modelValue: curAudioW.value[rowIndex],
198
+ "onUpdate:modelValue": ($event) => curAudioW.value[rowIndex] = $event,
199
+ placeholder: "\u8BF7\u9009\u62E9\u8F6C\u7801\u6A21\u7248",
200
+ "value-key": "id",
201
+ "allow-clear": ""
202
+ }, {
203
+ default: withCtx(() => [
204
+ (openBlock(true), createElementBlock(Fragment, null, renderList(audioTempList.value, (item) => {
205
+ return openBlock(), createBlock(unref(Option), {
206
+ key: item.id,
207
+ value: item.id
208
+ }, {
209
+ default: withCtx(() => [
210
+ createTextVNode(toDisplayString(item.title), 1)
211
+ ]),
212
+ _: 2
213
+ }, 1032, ["value"]);
214
+ }), 128))
215
+ ]),
216
+ _: 2
217
+ }, 1032, ["modelValue", "onUpdate:modelValue"])) : (openBlock(), createElementBlock("div", _hoisted_4, "\u2014 \u2014"))
218
+ ]),
219
+ _: 1
220
+ }, 8, ["data"])
221
+ ])
222
+ ]),
223
+ _: 1
224
+ }, 8, ["visible"]);
225
+ };
226
+ }
227
+ });
228
+ export { _sfc_main as default };
File without changes
@@ -0,0 +1,28 @@
1
+ import { defineComponent, openBlock, createBlock, unref } from "vue";
2
+ import { Upload } from "@arco-design/web-vue";
3
+ const _sfc_main = defineComponent({
4
+ __name: "UploadForClick",
5
+ props: {
6
+ uploadMethod: {}
7
+ },
8
+ emits: ["after-choose"],
9
+ setup(__props, { emit: __emit }) {
10
+ const emits = __emit;
11
+ const tusUpload = (option) => {
12
+ const { fileItem } = option;
13
+ emits("after-choose", fileItem);
14
+ return {
15
+ abort() {
16
+ }
17
+ };
18
+ };
19
+ return (_ctx, _cache) => {
20
+ return openBlock(), createBlock(unref(Upload), {
21
+ multiple: "",
22
+ "show-file-list": false,
23
+ "custom-request": tusUpload
24
+ });
25
+ };
26
+ }
27
+ });
28
+ export { _sfc_main as default };
@@ -0,0 +1,2 @@
1
+ declare const uploadBefore: any;
2
+ export default uploadBefore;
@@ -0,0 +1,7 @@
1
+ import _sfc_main from "./component.js";
2
+ const uploadBefore = Object.assign(_sfc_main, {
3
+ install: (app) => {
4
+ app.component(_sfc_main.name, _sfc_main);
5
+ }
6
+ });
7
+ export { uploadBefore as default };
@@ -0,0 +1,16 @@
1
+ export declare function getWaterMark(BASE_API: string): import("axios").AxiosPromise<any>;
2
+ export declare function getVideoTransTemplate(BASE_API: string): import("axios").AxiosPromise<any>;
3
+ export declare function getAudioTransTrempalte(BASE_API: string): import("axios").AxiosPromise<any>;
4
+ export declare type TypeAddMediaParam = {
5
+ url: string;
6
+ alias: string;
7
+ catalog: string;
8
+ repository_id: number;
9
+ directory_id: number;
10
+ size: number;
11
+ enable_ai_catalog?: 0 | 1;
12
+ watermark?: any;
13
+ video_transcode_template?: any;
14
+ audio_transcode_template?: any;
15
+ };
16
+ export declare function addMedia(BASE_API: string, params: TypeAddMediaParam): import("axios").AxiosPromise<any>;
@@ -0,0 +1,27 @@
1
+ import request from "../../utils/request.js";
2
+ function getWaterMark(BASE_API) {
3
+ return request(BASE_API, {
4
+ url: `/poplar/v2/material/image/watermark`,
5
+ method: "get"
6
+ });
7
+ }
8
+ function getVideoTransTemplate(BASE_API) {
9
+ return request(BASE_API, {
10
+ url: "/poplar/v2/material/video/templates",
11
+ method: "get"
12
+ });
13
+ }
14
+ function getAudioTransTrempalte(BASE_API) {
15
+ return request(BASE_API, {
16
+ url: "/poplar/v2/material/audio/templates",
17
+ method: "get"
18
+ });
19
+ }
20
+ function addMedia(BASE_API, params) {
21
+ return request(BASE_API, {
22
+ url: "/poplar/v2/media/add",
23
+ method: "post",
24
+ data: params
25
+ });
26
+ }
27
+ export { addMedia, getAudioTransTrempalte, getVideoTransTemplate, getWaterMark };
@@ -0,0 +1,39 @@
1
+ /** @description 文件类型适配器 @author LilMartin */
2
+ import type { FileItem } from '@arco-design/web-vue';
3
+ export interface CFileItem {
4
+ file: File;
5
+ id: string;
6
+ url?: string;
7
+ dirId?: string;
8
+ }
9
+ export interface SFileItem {
10
+ name: string;
11
+ size: number;
12
+ sizeCN: string;
13
+ type: string;
14
+ typeCN?: string;
15
+ id: string;
16
+ dirId?: string;
17
+ }
18
+ export interface BFileItem extends SFileItem {
19
+ isAnalize?: 0 | 1;
20
+ watermark?: any;
21
+ videotemp?: any;
22
+ audiotemp?: any;
23
+ }
24
+ export interface LFileItem extends BFileItem {
25
+ percent: number;
26
+ state: number;
27
+ count?: number;
28
+ }
29
+ declare type FileMaybeType = File | FileItem;
30
+ export declare function fileAdapter(fileMeta: FileMaybeType): {
31
+ url: string;
32
+ file: File;
33
+ id: string;
34
+ dirId?: string | undefined;
35
+ } | undefined;
36
+ export declare function checkType(type: string): "其他" | "图片" | "目录";
37
+ export declare function getMediaType(type: string): string;
38
+ export declare function getSize(value: number): string;
39
+ export {};
@@ -0,0 +1,48 @@
1
+ import { generateUUID } from "../../utils/index.js";
2
+ function fileAdapter(fileMeta) {
3
+ let coreInfo = null;
4
+ if (fileMeta instanceof File) {
5
+ coreInfo = { file: fileMeta, id: generateUUID() };
6
+ } else if (isFileType(fileMeta, "uid")) {
7
+ if (!fileMeta.file)
8
+ return void 0;
9
+ coreInfo = { file: fileMeta.file, id: fileMeta.uid };
10
+ } else
11
+ ;
12
+ if (!coreInfo)
13
+ return void 0;
14
+ return { ...coreInfo, url: "" };
15
+ }
16
+ function isFileType(fileType, key) {
17
+ return fileType[key] !== void 0;
18
+ }
19
+ function checkType(type) {
20
+ const t = getMediaType(type);
21
+ if (t === "image")
22
+ return "\u56FE\u7247";
23
+ if (t === "video")
24
+ return "\u56FE\u7247";
25
+ if (t === "audio")
26
+ return "\u56FE\u7247";
27
+ if (t === "dir")
28
+ return "\u76EE\u5F55";
29
+ return "\u5176\u4ED6";
30
+ }
31
+ function getMediaType(type) {
32
+ if (!type)
33
+ return "";
34
+ const t = type.split("/");
35
+ return t[0];
36
+ }
37
+ function getSize(value) {
38
+ if (!value)
39
+ return "";
40
+ let i = -1;
41
+ const byteUnits = [" KB", " MB", " GB", " TB", " PB", " EB", " ZB", " YB"];
42
+ do {
43
+ value /= 1024;
44
+ i++;
45
+ } while (value > 1024);
46
+ return value.toFixed(2) + byteUnits[i];
47
+ }
48
+ export { checkType, fileAdapter, getMediaType, getSize };
@@ -0,0 +1,7 @@
1
+ import { BFileItem } from './fileTypeAdapter';
2
+ export declare function uploadFile(file: File, cb: (p: number) => void): Promise<false | import("tus-js-client").Upload>;
3
+ export declare function uploadAddRequest(file: BFileItem, metaData: {
4
+ rid: number;
5
+ dirId: number;
6
+ url: string;
7
+ }, BASE_API: string, cb?: (cbData: any) => void): Promise<void>;
@@ -0,0 +1,39 @@
1
+ import { uploadByTUS } from "../../utils/tusUpload.js";
2
+ import { addMedia } from "./api.js";
3
+ async function uploadFile(file, cb) {
4
+ try {
5
+ const uploadRet = await uploadByTUS(file, (b, t) => {
6
+ cb(parseFloat((b / t * 100).toFixed(2)));
7
+ });
8
+ return uploadRet;
9
+ } catch (e) {
10
+ return false;
11
+ }
12
+ }
13
+ async function uploadAddRequest(file, metaData, BASE_API, cb) {
14
+ const params = {
15
+ url: metaData.url,
16
+ alias: file.name,
17
+ catalog: file.type,
18
+ repository_id: metaData.rid,
19
+ directory_id: metaData.dirId,
20
+ size: file.size
21
+ };
22
+ if (file.isAnalize !== void 0)
23
+ params.enable_ai_catalog = file.isAnalize;
24
+ if (file.watermark)
25
+ params.watermark = file.watermark;
26
+ if (file.videotemp)
27
+ params.video_transcode_template = file.videotemp;
28
+ if (file.audiotemp)
29
+ params.audio_transcode_template = file.audiotemp;
30
+ try {
31
+ const { code, message } = await addMedia(BASE_API, params);
32
+ if (code !== 0)
33
+ return;
34
+ cb && cb(message);
35
+ } catch (e) {
36
+ console.log(e);
37
+ }
38
+ }
39
+ export { uploadAddRequest, uploadFile };
@@ -0,0 +1,55 @@
1
+ import { CFileItem, LFileItem } from './fileTypeAdapter';
2
+ export declare function usePannelList(): {
3
+ panelList: import("vue").Ref<{
4
+ percent: number;
5
+ state: number;
6
+ count?: number | undefined;
7
+ isAnalize?: 0 | 1 | undefined;
8
+ watermark?: any;
9
+ videotemp?: any;
10
+ audiotemp?: any;
11
+ name: string;
12
+ size: number;
13
+ sizeCN: string;
14
+ type: string;
15
+ typeCN?: string | undefined;
16
+ id: string;
17
+ dirId?: string | undefined;
18
+ }[]>;
19
+ panelFIleAdd: (fileMetaData: LFileItem) => void;
20
+ panelFileStatusChange: (id: string, p: number, s: number) => void;
21
+ };
22
+ export declare function usePreUploadOptions(): {
23
+ preOptionsList: import("vue").Ref<{
24
+ isAnalize?: 0 | 1 | undefined;
25
+ watermark?: any;
26
+ videotemp?: any;
27
+ audiotemp?: any;
28
+ name: string;
29
+ size: number;
30
+ sizeCN: string;
31
+ type: string;
32
+ typeCN?: string | undefined;
33
+ id: string;
34
+ dirId?: string | undefined;
35
+ }[]>;
36
+ uploadFileToShowFileTrans: (file: CFileItem) => void;
37
+ };
38
+ export declare function useUplaodList(): {
39
+ fileList: import("vue").Ref<{
40
+ file: {
41
+ readonly lastModified: number;
42
+ readonly name: string;
43
+ readonly size: number;
44
+ readonly type: string;
45
+ arrayBuffer: () => Promise<ArrayBuffer>;
46
+ slice: (start?: number | undefined, end?: number | undefined, contentType?: string | undefined) => Blob;
47
+ stream: () => ReadableStream<any>;
48
+ text: () => Promise<string>;
49
+ };
50
+ id: string;
51
+ url?: string | undefined;
52
+ dirId?: string | undefined;
53
+ }[]>;
54
+ uploadFileAdd: (file: CFileItem) => void;
55
+ };
@@ -0,0 +1,33 @@
1
+ import { ref } from "vue";
2
+ import { getSize, getMediaType, checkType } from "./fileTypeAdapter.js";
3
+ function usePreUploadOptions() {
4
+ const preOptionsList = ref([]);
5
+ function uploadFileToShowFileTrans(file) {
6
+ if (file.dirId) {
7
+ return;
8
+ }
9
+ preOptionsList.value.push({
10
+ id: file.id,
11
+ name: file.file.name,
12
+ size: file.file.size,
13
+ sizeCN: getSize(file.file.size),
14
+ type: getMediaType(file.file.type),
15
+ typeCN: checkType(file.file.type)
16
+ });
17
+ }
18
+ return {
19
+ preOptionsList,
20
+ uploadFileToShowFileTrans
21
+ };
22
+ }
23
+ function useUplaodList() {
24
+ const fileList = ref([]);
25
+ function uploadFileAdd(file) {
26
+ fileList.value.push(file);
27
+ }
28
+ return {
29
+ fileList,
30
+ uploadFileAdd
31
+ };
32
+ }
33
+ export { usePreUploadOptions, useUplaodList };
@@ -0,0 +1 @@
1
+ import "./index.css";