@cmstops/pro-compo 0.3.52 → 0.3.54

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.
@@ -126,7 +126,7 @@ const _sfc_main = defineComponent({
126
126
  brief: item.name,
127
127
  key: "appSlotBtn",
128
128
  icon: item.app_icon,
129
- real: item.permission,
129
+ ...item.permission ? { real: item.permission } : {},
130
130
  params: item,
131
131
  target_url: "",
132
132
  type: 3
@@ -57,17 +57,11 @@ const _sfc_main = defineComponent({
57
57
  return "";
58
58
  if (props.item.series === "category_list")
59
59
  return _payload.rootAlias;
60
- if (props.item.series === "service")
61
- return _payload.label;
62
60
  if (props.item.series === "document")
63
61
  return _payload.title;
64
62
  if (props.item.series === "url")
65
63
  return _payload.relation_url;
66
- if (props.item.series === "app")
67
- return _payload.label;
68
- if (props.item.series === "political")
69
- return _payload.label;
70
- return "";
64
+ return _payload.label || "";
71
65
  });
72
66
  const mouseEnterFun = (event, row) => {
73
67
  emit("cellMouseEnter", { row, event });
@@ -55,7 +55,7 @@ const _sfc_main = defineComponent({
55
55
  class: "icon",
56
56
  doc: ""
57
57
  }, null, 8, ["type"]),
58
- createElementVNode("span", _hoisted_4, toDisplayString(item.alias || item.title), 1)
58
+ createElementVNode("span", _hoisted_4, toDisplayString(item.alias || item.title || item.name), 1)
59
59
  ]),
60
60
  createVNode(unref(Button), {
61
61
  class: "close-btn",
@@ -1,4 +1,4 @@
1
- import { defineComponent, ref, computed, watch, onMounted, openBlock, createBlock, unref, withCtx, createVNode, withDirectives, vShow, createElementBlock, Fragment, renderList, createCommentVNode, createTextVNode, toDisplayString, toRaw } from "vue";
1
+ import { defineComponent, ref, computed, watch, onMounted, openBlock, createBlock, unref, withCtx, createVNode, withDirectives, vShow, createElementBlock, Fragment, renderList, createCommentVNode, createTextVNode, toDisplayString } from "vue";
2
2
  import { Form, FormItem, Input, InputTag, Select, Option, Switch, DatePicker, InputNumber, RadioGroup, Radio, Message } from "@arco-design/web-vue";
3
3
  import { IconInfoCircle } from "@arco-design/web-vue/es/icon";
4
4
  import { docSeries } from "../../utils/doc.js";
@@ -180,7 +180,7 @@ const _sfc_main = defineComponent({
180
180
  return false;
181
181
  }
182
182
  }
183
- const data = toRaw(form.value);
183
+ const data = JSON.parse(JSON.stringify(form.value));
184
184
  data.self_publish_time = data.self_publish_time && Math.floor(data.self_publish_time / 1e3);
185
185
  data.online_time = data.online_time && Math.floor(data.online_time / 1e3);
186
186
  data.offline_time = data.offline_time && Math.floor(data.offline_time / 1e3);
@@ -192,7 +192,7 @@ const _sfc_main = defineComponent({
192
192
  data.comment_available = !!data.comment_available;
193
193
  data.statement = !!data.statement;
194
194
  data.is_recommend = !!data.is_recommend;
195
- data.album_status = !!data.album_status;
195
+ data.album_status = data.album_status ? "1" : "0";
196
196
  delete data.line_time;
197
197
  delete data.ori_count;
198
198
  delete data.aiRelated;
@@ -226,7 +226,7 @@ const _sfc_main = defineComponent({
226
226
  data.comment_available = data.comment_available !== "false";
227
227
  data.statement = data.statement !== "false";
228
228
  data.is_recommend = data.is_recommend !== "false";
229
- data.album_status = data.album_status !== "0";
229
+ data.album_status = Number(data.album_status);
230
230
  Object.assign(form.value, data);
231
231
  };
232
232
  watch(silenceOptions, (newVal, oldVal) => {
@@ -8,9 +8,11 @@ export declare type TypeAddMediaParam = {
8
8
  size: number;
9
9
  };
10
10
  export declare function addMedia(BASE_API: string, params: TypeAddMediaParam): import("axios").AxiosPromise<any>;
11
+ export declare function reTranscodeMedia(BASE_API: string, media_id: number): import("axios").AxiosPromise<any>;
11
12
  export default function useUpload(): {
12
13
  list: import("vue").Ref<any[]>;
13
14
  uploadFile: (BASE_API: string, file: any, dir: number | undefined, repoId: number, callback?: CallbackFunc | undefined) => void;
15
+ reTranscode: (BASE_API: string, file: any) => Promise<boolean>;
14
16
  transcodingFile: (BASE_API: string, file: any) => void;
15
17
  recordTaskStatusChange: (file: any, progress: number, isTrans?: boolean | undefined) => void;
16
18
  removeRecord: (file: any) => void;
@@ -11,6 +11,13 @@ function addMedia(BASE_API, params) {
11
11
  data: params
12
12
  });
13
13
  }
14
+ function reTranscodeMedia(BASE_API, media_id) {
15
+ return request(BASE_API, {
16
+ url: "/poplar/v3/attachment/re_transcoding",
17
+ method: "post",
18
+ data: { media_id }
19
+ });
20
+ }
14
21
  function useUpload() {
15
22
  const { get, set, remove } = useLocalstorage("LOCAL_RESOURCES");
16
23
  const list = ref(get() || []);
@@ -31,6 +38,7 @@ function useUpload() {
31
38
  progress !== -1 && (originList[taskIndex].progress = progress.toFixed(2));
32
39
  file.status != null && (originList[taskIndex].status = file.status);
33
40
  file.msg != null && (originList[taskIndex].msg = file.msg);
41
+ file.mediaFile && (originList[taskIndex].mediaFile = file.mediaFile);
34
42
  if (isTrans)
35
43
  originList[taskIndex].isTrans = true;
36
44
  originList[taskIndex].url = file.url;
@@ -123,21 +131,33 @@ function useUpload() {
123
131
  );
124
132
  }
125
133
  }).catch((e) => {
126
- console.log("\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525} \u8F6C\u7801\u5931\u8D25", e);
134
+ console.log("\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525} \u8F6C\u7801\u5931\u8D25", e, file);
127
135
  recordTaskStatusChange(
128
136
  { ...item, mediaFile: file, status: 3, msg: "\u8F6C\u7801\u5931\u8D25" },
129
137
  -1
130
138
  );
131
139
  });
132
140
  };
141
+ const reTranscode = async (BASE_API, file) => {
142
+ try {
143
+ const { code } = await reTranscodeMedia(BASE_API, file.id);
144
+ if (code !== 0)
145
+ return false;
146
+ return true;
147
+ } catch (e) {
148
+ console.log(e);
149
+ return false;
150
+ }
151
+ };
133
152
  watch(() => list.value, set, { deep: true });
134
153
  window.onbeforeunload = remove;
135
154
  return {
136
155
  list,
137
156
  uploadFile,
157
+ reTranscode,
138
158
  transcodingFile,
139
159
  recordTaskStatusChange,
140
160
  removeRecord
141
161
  };
142
162
  }
143
- export { addMedia, useUpload as default };
163
+ export { addMedia, useUpload as default, reTranscodeMedia };
@@ -25,7 +25,7 @@ const _sfc_main = defineComponent({
25
25
  var _a;
26
26
  return (_a = userInfo == null ? void 0 : userInfo.value) == null ? void 0 : _a.repository_id;
27
27
  });
28
- const { list, uploadFile, transcodingFile, removeRecord } = useUpload();
28
+ const { list, uploadFile, reTranscode, transcodingFile, removeRecord } = useUpload();
29
29
  function handleChange(file) {
30
30
  if (!baseAPI || !repoId.value)
31
31
  return;
@@ -37,7 +37,7 @@ const _sfc_main = defineComponent({
37
37
  (media) => transcodingFile(baseAPI, media)
38
38
  );
39
39
  }
40
- function handleOptions(e) {
40
+ async function handleOptions(e) {
41
41
  var _a, _b;
42
42
  if (e.key === "reupload") {
43
43
  if (!e.item || !((_a = e.item) == null ? void 0 : _a.originFile))
@@ -50,6 +50,8 @@ const _sfc_main = defineComponent({
50
50
  if (e.key === "retranscode") {
51
51
  if (!baseAPI || !((_b = e.item) == null ? void 0 : _b.mediaFile))
52
52
  return;
53
+ if (!await reTranscode(baseAPI, e.item.mediaFile))
54
+ return;
53
55
  transcodingFile(baseAPI, e.item.mediaFile);
54
56
  return;
55
57
  }
@@ -32,7 +32,7 @@ const _sfc_main = defineComponent({
32
32
  createVNode(unref(IconZhuanti))
33
33
  ], 2112)) : props.doc && props.type === "audio_album" ? (openBlock(), createElementBlock(Fragment, { key: 6 }, [
34
34
  createCommentVNode(" \u97F3\u9891\u96C6 "),
35
- createVNode(unref(IconYinpinji))
35
+ createVNode(unref(IconYinpinji), { style: { "color": "#1fb7c2" } })
36
36
  ], 2112)) : props.doc && props.type === "video_album" ? (openBlock(), createElementBlock(Fragment, { key: 7 }, [
37
37
  createCommentVNode(" \u89C6\u9891\u96C6 "),
38
38
  createVNode(unref(IconShipinji))
@@ -127,7 +127,7 @@ const _sfc_main = vue.defineComponent({
127
127
  brief: item.name,
128
128
  key: "appSlotBtn",
129
129
  icon: item.app_icon,
130
- real: item.permission,
130
+ ...item.permission ? { real: item.permission } : {},
131
131
  params: item,
132
132
  target_url: "",
133
133
  type: 3
@@ -58,17 +58,11 @@ const _sfc_main = vue.defineComponent({
58
58
  return "";
59
59
  if (props.item.series === "category_list")
60
60
  return _payload.rootAlias;
61
- if (props.item.series === "service")
62
- return _payload.label;
63
61
  if (props.item.series === "document")
64
62
  return _payload.title;
65
63
  if (props.item.series === "url")
66
64
  return _payload.relation_url;
67
- if (props.item.series === "app")
68
- return _payload.label;
69
- if (props.item.series === "political")
70
- return _payload.label;
71
- return "";
65
+ return _payload.label || "";
72
66
  });
73
67
  const mouseEnterFun = (event, row) => {
74
68
  emit("cellMouseEnter", { row, event });
@@ -56,7 +56,7 @@ const _sfc_main = vue.defineComponent({
56
56
  class: "icon",
57
57
  doc: ""
58
58
  }, null, 8, ["type"]),
59
- vue.createElementVNode("span", _hoisted_4, vue.toDisplayString(item.alias || item.title), 1)
59
+ vue.createElementVNode("span", _hoisted_4, vue.toDisplayString(item.alias || item.title || item.name), 1)
60
60
  ]),
61
61
  vue.createVNode(vue.unref(webVue.Button), {
62
62
  class: "close-btn",
@@ -181,7 +181,7 @@ const _sfc_main = vue.defineComponent({
181
181
  return false;
182
182
  }
183
183
  }
184
- const data = vue.toRaw(form.value);
184
+ const data = JSON.parse(JSON.stringify(form.value));
185
185
  data.self_publish_time = data.self_publish_time && Math.floor(data.self_publish_time / 1e3);
186
186
  data.online_time = data.online_time && Math.floor(data.online_time / 1e3);
187
187
  data.offline_time = data.offline_time && Math.floor(data.offline_time / 1e3);
@@ -193,7 +193,7 @@ const _sfc_main = vue.defineComponent({
193
193
  data.comment_available = !!data.comment_available;
194
194
  data.statement = !!data.statement;
195
195
  data.is_recommend = !!data.is_recommend;
196
- data.album_status = !!data.album_status;
196
+ data.album_status = data.album_status ? "1" : "0";
197
197
  delete data.line_time;
198
198
  delete data.ori_count;
199
199
  delete data.aiRelated;
@@ -227,7 +227,7 @@ const _sfc_main = vue.defineComponent({
227
227
  data.comment_available = data.comment_available !== "false";
228
228
  data.statement = data.statement !== "false";
229
229
  data.is_recommend = data.is_recommend !== "false";
230
- data.album_status = data.album_status !== "0";
230
+ data.album_status = Number(data.album_status);
231
231
  Object.assign(form.value, data);
232
232
  };
233
233
  vue.watch(silenceOptions, (newVal, oldVal) => {
@@ -13,6 +13,13 @@ function addMedia(BASE_API, params) {
13
13
  data: params
14
14
  });
15
15
  }
16
+ function reTranscodeMedia(BASE_API, media_id) {
17
+ return request(BASE_API, {
18
+ url: "/poplar/v3/attachment/re_transcoding",
19
+ method: "post",
20
+ data: { media_id }
21
+ });
22
+ }
16
23
  function useUpload() {
17
24
  const { get, set, remove } = useLocalStorage["default"]("LOCAL_RESOURCES");
18
25
  const list = vue.ref(get() || []);
@@ -33,6 +40,7 @@ function useUpload() {
33
40
  progress !== -1 && (originList[taskIndex].progress = progress.toFixed(2));
34
41
  file.status != null && (originList[taskIndex].status = file.status);
35
42
  file.msg != null && (originList[taskIndex].msg = file.msg);
43
+ file.mediaFile && (originList[taskIndex].mediaFile = file.mediaFile);
36
44
  if (isTrans)
37
45
  originList[taskIndex].isTrans = true;
38
46
  originList[taskIndex].url = file.url;
@@ -125,18 +133,30 @@ function useUpload() {
125
133
  );
126
134
  }
127
135
  }).catch((e) => {
128
- console.log("\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525} \u8F6C\u7801\u5931\u8D25", e);
136
+ console.log("\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525} \u8F6C\u7801\u5931\u8D25", e, file);
129
137
  recordTaskStatusChange(
130
138
  { ...item, mediaFile: file, status: 3, msg: "\u8F6C\u7801\u5931\u8D25" },
131
139
  -1
132
140
  );
133
141
  });
134
142
  };
143
+ const reTranscode = async (BASE_API, file) => {
144
+ try {
145
+ const { code } = await reTranscodeMedia(BASE_API, file.id);
146
+ if (code !== 0)
147
+ return false;
148
+ return true;
149
+ } catch (e) {
150
+ console.log(e);
151
+ return false;
152
+ }
153
+ };
135
154
  vue.watch(() => list.value, set, { deep: true });
136
155
  window.onbeforeunload = remove;
137
156
  return {
138
157
  list,
139
158
  uploadFile,
159
+ reTranscode,
140
160
  transcodingFile,
141
161
  recordTaskStatusChange,
142
162
  removeRecord
@@ -144,3 +164,4 @@ function useUpload() {
144
164
  }
145
165
  exports.addMedia = addMedia;
146
166
  exports["default"] = useUpload;
167
+ exports.reTranscodeMedia = reTranscodeMedia;
@@ -26,7 +26,7 @@ const _sfc_main = vue.defineComponent({
26
26
  var _a;
27
27
  return (_a = userInfo == null ? void 0 : userInfo.value) == null ? void 0 : _a.repository_id;
28
28
  });
29
- const { list, uploadFile, transcodingFile, removeRecord } = useUpload["default"]();
29
+ const { list, uploadFile, reTranscode, transcodingFile, removeRecord } = useUpload["default"]();
30
30
  function handleChange(file) {
31
31
  if (!baseAPI || !repoId.value)
32
32
  return;
@@ -38,7 +38,7 @@ const _sfc_main = vue.defineComponent({
38
38
  (media) => transcodingFile(baseAPI, media)
39
39
  );
40
40
  }
41
- function handleOptions(e) {
41
+ async function handleOptions(e) {
42
42
  var _a, _b;
43
43
  if (e.key === "reupload") {
44
44
  if (!e.item || !((_a = e.item) == null ? void 0 : _a.originFile))
@@ -51,6 +51,8 @@ const _sfc_main = vue.defineComponent({
51
51
  if (e.key === "retranscode") {
52
52
  if (!baseAPI || !((_b = e.item) == null ? void 0 : _b.mediaFile))
53
53
  return;
54
+ if (!await reTranscode(baseAPI, e.item.mediaFile))
55
+ return;
54
56
  transcodingFile(baseAPI, e.item.mediaFile);
55
57
  return;
56
58
  }
@@ -33,7 +33,7 @@ const _sfc_main = vue.defineComponent({
33
33
  vue.createVNode(vue.unref(vueCmstopIcons.IconZhuanti))
34
34
  ], 2112)) : props.doc && props.type === "audio_album" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 6 }, [
35
35
  vue.createCommentVNode(" \u97F3\u9891\u96C6 "),
36
- vue.createVNode(vue.unref(vueCmstopIcons.IconYinpinji))
36
+ vue.createVNode(vue.unref(vueCmstopIcons.IconYinpinji), { style: { "color": "#1fb7c2" } })
37
37
  ], 2112)) : props.doc && props.type === "video_album" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 7 }, [
38
38
  vue.createCommentVNode(" \u89C6\u9891\u96C6 "),
39
39
  vue.createVNode(vue.unref(vueCmstopIcons.IconShipinji))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmstops/pro-compo",
3
- "version": "0.3.52",
3
+ "version": "0.3.54",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "vue",