@cmstops/pro-compo 0.3.55 → 0.3.56

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.
@@ -185,7 +185,6 @@ const _sfc_main = defineComponent({
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);
187
187
  data.keywords = data.keywords && data.keywords.join(",");
188
- data.author = data.author && data.author.join(",");
189
188
  data.duty_editor = data.duty_editor && data.duty_editor.join(",");
190
189
  data.extra_attrs = data.extra_attrs && data.extra_attrs.join(",");
191
190
  data.relation_news = data.relation_news && JSON.stringify(data.relation_news);
@@ -215,7 +214,6 @@ const _sfc_main = defineComponent({
215
214
  data.online_time = data.online_time && parseInt(data.online_time, 10) * 1e3 || "";
216
215
  data.offline_time = data.offline_time && parseInt(data.offline_time, 10) * 1e3 || "";
217
216
  data.keywords = data.keywords && data.keywords.split(",");
218
- data.author = data.author && data.author.split(",");
219
217
  data.duty_editor = data.duty_editor && data.duty_editor.split(",") || "";
220
218
  data.extra_attrs = data.extra_attrs && data.extra_attrs.split(",") || "";
221
219
  data.relation_news = data.relation_news && JSON.parse(data.relation_news) || [];
@@ -226,7 +224,7 @@ const _sfc_main = defineComponent({
226
224
  data.comment_available = data.comment_available !== "false";
227
225
  data.statement = data.statement !== "false";
228
226
  data.is_recommend = data.is_recommend !== "false";
229
- data.album_status = Number(data.album_status);
227
+ data.album_status = data.album_status !== "0";
230
228
  Object.assign(form.value, data);
231
229
  };
232
230
  watch(silenceOptions, (newVal, oldVal) => {
@@ -18,7 +18,7 @@ function reTranscodeMedia(BASE_API, media_id) {
18
18
  data: { media_id }
19
19
  });
20
20
  }
21
- function useUpload() {
21
+ function useUpload(options) {
22
22
  const { get, set, remove } = useLocalstorage("LOCAL_RESOURCES");
23
23
  const list = ref(get() || []);
24
24
  function uploadSuccess(file) {
@@ -76,6 +76,11 @@ function useUpload() {
76
76
  };
77
77
  const uploading = upload.start(progress);
78
78
  uploading.then(async (url) => {
79
+ if (options == null ? void 0 : options.noAddMedia) {
80
+ recordTaskStatusChange({ ...newFile, status: 0, url }, 1);
81
+ callback && callback({ ...newFile, url }, "success");
82
+ return;
83
+ }
79
84
  const { code, message } = await addMedia(BASE_API, {
80
85
  url,
81
86
  size: newFile.size,
@@ -186,7 +186,6 @@ const _sfc_main = vue.defineComponent({
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);
188
188
  data.keywords = data.keywords && data.keywords.join(",");
189
- data.author = data.author && data.author.join(",");
190
189
  data.duty_editor = data.duty_editor && data.duty_editor.join(",");
191
190
  data.extra_attrs = data.extra_attrs && data.extra_attrs.join(",");
192
191
  data.relation_news = data.relation_news && JSON.stringify(data.relation_news);
@@ -216,7 +215,6 @@ const _sfc_main = vue.defineComponent({
216
215
  data.online_time = data.online_time && parseInt(data.online_time, 10) * 1e3 || "";
217
216
  data.offline_time = data.offline_time && parseInt(data.offline_time, 10) * 1e3 || "";
218
217
  data.keywords = data.keywords && data.keywords.split(",");
219
- data.author = data.author && data.author.split(",");
220
218
  data.duty_editor = data.duty_editor && data.duty_editor.split(",") || "";
221
219
  data.extra_attrs = data.extra_attrs && data.extra_attrs.split(",") || "";
222
220
  data.relation_news = data.relation_news && JSON.parse(data.relation_news) || [];
@@ -227,7 +225,7 @@ const _sfc_main = vue.defineComponent({
227
225
  data.comment_available = data.comment_available !== "false";
228
226
  data.statement = data.statement !== "false";
229
227
  data.is_recommend = data.is_recommend !== "false";
230
- data.album_status = Number(data.album_status);
228
+ data.album_status = data.album_status !== "0";
231
229
  Object.assign(form.value, data);
232
230
  };
233
231
  vue.watch(silenceOptions, (newVal, oldVal) => {
@@ -20,7 +20,7 @@ function reTranscodeMedia(BASE_API, media_id) {
20
20
  data: { media_id }
21
21
  });
22
22
  }
23
- function useUpload() {
23
+ function useUpload(options) {
24
24
  const { get, set, remove } = useLocalStorage["default"]("LOCAL_RESOURCES");
25
25
  const list = vue.ref(get() || []);
26
26
  function uploadSuccess(file) {
@@ -78,6 +78,11 @@ function useUpload() {
78
78
  };
79
79
  const uploading = upload.start(progress);
80
80
  uploading.then(async (url) => {
81
+ if (options == null ? void 0 : options.noAddMedia) {
82
+ recordTaskStatusChange({ ...newFile, status: 0, url }, 1);
83
+ callback && callback({ ...newFile, url }, "success");
84
+ return;
85
+ }
81
86
  const { code, message } = await addMedia(BASE_API, {
82
87
  url,
83
88
  size: newFile.size,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmstops/pro-compo",
3
- "version": "0.3.55",
3
+ "version": "0.3.56",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "vue",