@cmstops/pro-compo 0.1.89 → 0.1.91

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.
@@ -139,13 +139,13 @@ const _sfc_main = defineComponent({
139
139
  isOver.value = false;
140
140
  const API = activeMediaType.value === "all" ? api.value.getAttachmentsAll : api.value.getAttachmentsMy;
141
141
  let query = { ...getFilesQueryParam.value };
142
- if (activeMediaType.value === "my") {
143
- query.upload_by = defaultUploadBy.value;
144
- }
145
142
  if (filter.value) {
146
143
  query = Object.assign(query, filter.value);
147
144
  folderList.value = [];
148
145
  }
146
+ if (activeMediaType.value === "my") {
147
+ query.upload_by = defaultUploadBy.value;
148
+ }
149
149
  const promise = filter.value ? [API(baseApi, query)] : [
150
150
  API(baseApi, query),
151
151
  getDirectories(baseApi, { parent_id: query.directory_id })
@@ -33,7 +33,9 @@ const _sfc_main = defineComponent({
33
33
  return item.uid ? item.alias : `\u89D2\u8272\uFF1A${item.alias}`;
34
34
  };
35
35
  const getUserAlias = (user) => {
36
- const alias2 = user.alias || user.title || user.name;
36
+ if (!user)
37
+ return "--";
38
+ const alias2 = user.alias || user.title || user.name || "\u672A\u77E5";
37
39
  return alias2.length > 1 ? `${alias2.slice(0, 1)}` : alias2;
38
40
  };
39
41
  const addUser = () => {
@@ -76,6 +76,7 @@ const _sfc_main = defineComponent({
76
76
  topImageTitleValid: {},
77
77
  showTitle: { type: Boolean },
78
78
  cropper: { type: Boolean },
79
+ cropperRatios: {},
79
80
  aiImages: {},
80
81
  series: {},
81
82
  thumbsMax: {},
@@ -241,9 +242,9 @@ const _sfc_main = defineComponent({
241
242
  ].includes(series);
242
243
  });
243
244
  const submitCallback = (data) => {
244
- var _a;
245
+ var _a, _b, _c, _d;
245
246
  const isPcBaner = props.mode === "doc" && thumbBannerModel.value === "pcBanner" && !docSeriesShowTopThemeColor.value;
246
- const _useCropper = props.mode === "doc" ? true : useCropper.value;
247
+ const _useCropper = ["thumb", "doc"].includes(props.mode) ? true : useCropper.value;
247
248
  if (["smiple", "thumbs"].includes(props.mode)) {
248
249
  dialogMediaSelectionShow.value = false;
249
250
  const media = data[0];
@@ -262,15 +263,18 @@ const _sfc_main = defineComponent({
262
263
  });
263
264
  } else {
264
265
  cropperData.value = [].concat(data);
265
- if (thumbBannerModel.value === "banner" || docSeriesShowTopThemeColor.value) {
266
- aspectRatioProp.value = docThumbRatioMap()[2];
266
+ if (thumbBannerModel.value === "banner") {
267
+ aspectRatioProp.value = ((_a = props.cropperRatios) == null ? void 0 : _a[1]) || docThumbRatioMap()[2];
268
+ }
269
+ if (thumbBannerModel.value === "pcBanner" && docSeriesShowTopThemeColor.value) {
270
+ aspectRatioProp.value = ((_b = props.cropperRatios) == null ? void 0 : _b[2]) || docThumbRatioMap()[2];
267
271
  }
268
272
  if (thumbBannerModel.value === "thumb") {
269
- aspectRatioProp.value = docThumbRatioMap()[model.value];
273
+ aspectRatioProp.value = ((_c = props.cropperRatios) == null ? void 0 : _c[0]) || docThumbRatioMap()[model.value];
270
274
  if (data.length) {
271
275
  const media = data[0];
272
276
  const wh = [];
273
- (_a = media.metas) == null ? void 0 : _a.map((item) => {
277
+ (_d = media.metas) == null ? void 0 : _d.map((item) => {
274
278
  if (item.key === "width")
275
279
  wh.unshift(parseInt(item.value, 10));
276
280
  if (item.key === "height")
@@ -140,13 +140,13 @@ const _sfc_main = vue.defineComponent({
140
140
  isOver.value = false;
141
141
  const API = activeMediaType.value === "all" ? api$2.value.getAttachmentsAll : api$2.value.getAttachmentsMy;
142
142
  let query = { ...getFilesQueryParam.value };
143
- if (activeMediaType.value === "my") {
144
- query.upload_by = defaultUploadBy.value;
145
- }
146
143
  if (filter.value) {
147
144
  query = Object.assign(query, filter.value);
148
145
  folderList.value = [];
149
146
  }
147
+ if (activeMediaType.value === "my") {
148
+ query.upload_by = defaultUploadBy.value;
149
+ }
150
150
  const promise = filter.value ? [API(baseApi, query)] : [
151
151
  API(baseApi, query),
152
152
  api.getDirectories(baseApi, { parent_id: query.directory_id })
@@ -34,7 +34,9 @@ const _sfc_main = vue.defineComponent({
34
34
  return item.uid ? item.alias : `\u89D2\u8272\uFF1A${item.alias}`;
35
35
  };
36
36
  const getUserAlias = (user) => {
37
- const alias2 = user.alias || user.title || user.name;
37
+ if (!user)
38
+ return "--";
39
+ const alias2 = user.alias || user.title || user.name || "\u672A\u77E5";
38
40
  return alias2.length > 1 ? `${alias2.slice(0, 1)}` : alias2;
39
41
  };
40
42
  const addUser = () => {
@@ -77,6 +77,7 @@ const _sfc_main = vue.defineComponent({
77
77
  topImageTitleValid: {},
78
78
  showTitle: { type: Boolean },
79
79
  cropper: { type: Boolean },
80
+ cropperRatios: {},
80
81
  aiImages: {},
81
82
  series: {},
82
83
  thumbsMax: {},
@@ -242,9 +243,9 @@ const _sfc_main = vue.defineComponent({
242
243
  ].includes(series);
243
244
  });
244
245
  const submitCallback = (data) => {
245
- var _a;
246
+ var _a, _b, _c, _d;
246
247
  const isPcBaner = props.mode === "doc" && thumbBannerModel.value === "pcBanner" && !docSeriesShowTopThemeColor.value;
247
- const _useCropper = props.mode === "doc" ? true : useCropper.value;
248
+ const _useCropper = ["thumb", "doc"].includes(props.mode) ? true : useCropper.value;
248
249
  if (["smiple", "thumbs"].includes(props.mode)) {
249
250
  dialogMediaSelectionShow.value = false;
250
251
  const media = data[0];
@@ -263,15 +264,18 @@ const _sfc_main = vue.defineComponent({
263
264
  });
264
265
  } else {
265
266
  cropperData.value = [].concat(data);
266
- if (thumbBannerModel.value === "banner" || docSeriesShowTopThemeColor.value) {
267
- aspectRatioProp.value = doc.docThumbRatioMap()[2];
267
+ if (thumbBannerModel.value === "banner") {
268
+ aspectRatioProp.value = ((_a = props.cropperRatios) == null ? void 0 : _a[1]) || doc.docThumbRatioMap()[2];
269
+ }
270
+ if (thumbBannerModel.value === "pcBanner" && docSeriesShowTopThemeColor.value) {
271
+ aspectRatioProp.value = ((_b = props.cropperRatios) == null ? void 0 : _b[2]) || doc.docThumbRatioMap()[2];
268
272
  }
269
273
  if (thumbBannerModel.value === "thumb") {
270
- aspectRatioProp.value = doc.docThumbRatioMap()[model.value];
274
+ aspectRatioProp.value = ((_c = props.cropperRatios) == null ? void 0 : _c[0]) || doc.docThumbRatioMap()[model.value];
271
275
  if (data.length) {
272
276
  const media = data[0];
273
277
  const wh = [];
274
- (_a = media.metas) == null ? void 0 : _a.map((item) => {
278
+ (_d = media.metas) == null ? void 0 : _d.map((item) => {
275
279
  if (item.key === "width")
276
280
  wh.unshift(parseInt(item.value, 10));
277
281
  if (item.key === "height")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmstops/pro-compo",
3
- "version": "0.1.89",
3
+ "version": "0.1.91",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "vue",