qidian-vue-ui 2.0.35 → 2.0.36

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.
@@ -93,6 +93,7 @@ export declare const QdConfigProvider: import("vue").DefineComponent<{
93
93
  downloadTplText?: string;
94
94
  successText?: string;
95
95
  failText?: string;
96
+ updateSupportText?: string;
96
97
  };
97
98
  form?: Omit<NonNullable<NonNullable<import("tdesign-vue-next").TdConfigProviderProps["globalConfig"]>["form"]>, "size"> & {
98
99
  size?: import("..").QdFormProps["size"];
@@ -240,6 +241,7 @@ export declare const QdConfigProvider: import("vue").DefineComponent<{
240
241
  downloadTplText?: string;
241
242
  successText?: string;
242
243
  failText?: string;
244
+ updateSupportText?: string;
243
245
  };
244
246
  form?: Omit<NonNullable<NonNullable<import("tdesign-vue-next").TdConfigProviderProps["globalConfig"]>["form"]>, "size"> & {
245
247
  size?: import("..").QdFormProps["size"];
@@ -372,6 +374,7 @@ export declare const QdConfigProvider: import("vue").DefineComponent<{
372
374
  downloadTplText?: string;
373
375
  successText?: string;
374
376
  failText?: string;
377
+ updateSupportText?: string;
375
378
  };
376
379
  form?: Omit<NonNullable<NonNullable<import("tdesign-vue-next").TdConfigProviderProps["globalConfig"]>["form"]>, "size"> & {
377
380
  size?: import("..").QdFormProps["size"];
@@ -110,6 +110,7 @@ export interface QdConfigProviderProps {
110
110
  downloadTplText?: string;
111
111
  successText?: string;
112
112
  failText?: string;
113
+ updateSupportText?: string;
113
114
  };
114
115
  form?: Omit<NonNullable<NonNullable<TdConfigProviderProps['globalConfig']>['form']>, 'size'> & {
115
116
  size?: QdFormProps['size'];
@@ -81,6 +81,7 @@ export declare function useConfig<T extends keyof NonNullable<QdConfigProviderPr
81
81
  downloadTplText?: string;
82
82
  successText?: string;
83
83
  failText?: string;
84
+ updateSupportText?: string;
84
85
  };
85
86
  form?: Omit<NonNullable<NonNullable<import("tdesign-vue-next").TdConfigProviderProps["globalConfig"]>["form"]>, "size"> & {
86
87
  size?: import("..").QdFormProps["size"];
@@ -211,6 +212,7 @@ export declare function useConfig<T extends keyof NonNullable<QdConfigProviderPr
211
212
  downloadTplText?: string;
212
213
  successText?: string;
213
214
  failText?: string;
215
+ updateSupportText?: string;
214
216
  };
215
217
  form?: Omit<NonNullable<NonNullable<import("tdesign-vue-next").TdConfigProviderProps["globalConfig"]>["form"]>, "size"> & {
216
218
  size?: import("..").QdFormProps["size"];
@@ -341,6 +343,7 @@ export declare function useConfig<T extends keyof NonNullable<QdConfigProviderPr
341
343
  downloadTplText?: string;
342
344
  successText?: string;
343
345
  failText?: string;
346
+ updateSupportText?: string;
344
347
  };
345
348
  form?: Omit<NonNullable<NonNullable<import("tdesign-vue-next").TdConfigProviderProps["globalConfig"]>["form"]>, "size"> & {
346
349
  size?: import("..").QdFormProps["size"];
@@ -472,6 +475,7 @@ export declare function useConfig<T extends keyof NonNullable<QdConfigProviderPr
472
475
  downloadTplText?: string;
473
476
  successText?: string;
474
477
  failText?: string;
478
+ updateSupportText?: string;
475
479
  };
476
480
  form?: Omit<NonNullable<NonNullable<import("tdesign-vue-next").TdConfigProviderProps["globalConfig"]>["form"]>, "size"> & {
477
481
  size?: import("..").QdFormProps["size"];
@@ -10,5 +10,6 @@ declare const _default: import("vue").DefineComponent<QdImportDialogProps, {
10
10
  name: string;
11
11
  accept: string[] | "*";
12
12
  method: "POST" | "GET" | "PUT" | "OPTIONS" | "PATCH" | "post" | "get" | "put" | "options" | "patch";
13
+ updateSupport: boolean | string;
13
14
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
15
  export default _default;
@@ -1,7 +1,7 @@
1
- import { defineComponent, mergeDefaults, computed, ref, createVNode, createBlock, openBlock, unref, isRef, isVNode } from "vue";
1
+ import { defineComponent, mergeDefaults, ref, computed, createVNode, createBlock, openBlock, unref, isRef, isVNode } from "vue";
2
2
  import { useVModels } from "../../node_modules/.pnpm/@vueuse_core@14.2.0_vue@3.5.26_typescript@5.9.3_/node_modules/@vueuse/core/dist/index.mjs";
3
- import { isEmpty, easyDownload, suspectedWrapperPromise } from "qidian-shared";
4
- import { Alert, Space, Button } from "tdesign-vue-next";
3
+ import { isEmpty, setUrlParam, easyDownload, suspectedWrapperPromise } from "qidian-shared";
4
+ import { Alert, Space, Button, Checkbox } from "tdesign-vue-next";
5
5
  import { useConfig } from "../config-provider/useConfig.mjs";
6
6
  import { qdImportDialogProps } from "./props.mjs";
7
7
  import QdUpload from "../upload/index.vue.mjs";
@@ -21,6 +21,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
21
21
  onSuccess: {
22
22
  type: Function
23
23
  },
24
+ updateSupport: {
25
+ type: [Boolean, String]
26
+ },
24
27
  wrapper: {},
25
28
  visible: {
26
29
  type: Boolean
@@ -54,6 +57,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
54
57
  msgSuccess,
55
58
  alertError
56
59
  } = useModal();
60
+ const formData = ref({});
61
+ const downloadTplLoad = ref(false);
57
62
  const reProps = computed(() => {
58
63
  const {
59
64
  visible: visible2,
@@ -63,17 +68,23 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
63
68
  onSuccess,
64
69
  tips,
65
70
  accept,
71
+ action,
72
+ updateSupport,
66
73
  wrapper,
67
74
  ...uploadOptions
68
75
  } = props;
69
76
  const isAcceptUnlimited = accept === "*" || isEmpty(accept);
70
77
  const reAccept = isAcceptUnlimited ? void 0 : accept;
78
+ const updateSupportKey = updateSupport === false ? void 0 : typeof updateSupport === "string" ? updateSupport : "updateSupport";
79
+ const updateSupportValue = updateSupportKey === void 0 ? false : formData.value[updateSupportKey] === true;
80
+ const reAction = updateSupportKey === void 0 || !action ? action : typeof action === "string" ? setUrlParam(updateSupportKey, updateSupportValue, action) : (bucketConfigKey) => setUrlParam(updateSupportKey, updateSupportValue, action(bucketConfigKey));
71
81
  const reUploadOptions = {
72
82
  ...uploadOptions,
73
83
  listOssByIds: {
74
84
  service: void 0
75
85
  },
76
86
  accept,
87
+ action: reAction,
77
88
  tips: tips || !reAccept ? tips : `${t("fileSupport")[0]} ${reAccept.join(",")} ${t("fileSupport")[1]}`
78
89
  };
79
90
  const qdDialogOptions = {
@@ -89,10 +100,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
89
100
  onSuccess,
90
101
  qdUploadOptions: reUploadOptions,
91
102
  qdDialogOptions,
103
+ updateSupportKey,
92
104
  models: visible2
93
105
  };
94
106
  });
95
- const downloadTplLoad = ref(false);
96
107
  const items = computed(() => [{
97
108
  ifRender: !!reProps.value.downloadTpl,
98
109
  col: 12,
@@ -143,6 +154,23 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
143
154
  },
144
155
  ...reProps.value.qdUploadOptions
145
156
  }
157
+ }, {
158
+ ifRender: reProps.value.updateSupportKey !== void 0,
159
+ col: 12,
160
+ component: {
161
+ is: () => {
162
+ let _slot2;
163
+ return createVNode(Checkbox, {
164
+ "style": {
165
+ color: "var(--td-text-color-secondary)"
166
+ }
167
+ }, _isSlot(_slot2 = t("updateSupportText")) ? _slot2 : {
168
+ default: () => [_slot2]
169
+ });
170
+ },
171
+ vModel: reProps.value.updateSupportKey ?? "updateSupport",
172
+ defaultModelValue: false
173
+ }
146
174
  }]);
147
175
  async function handleDownloadTpl() {
148
176
  const {
@@ -173,9 +201,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
173
201
  return openBlock(), createBlock(unref(_sfc_main$1), {
174
202
  visible: unref(visible),
175
203
  "onUpdate:visible": _cache[0] || (_cache[0] = ($event) => isRef(visible) ? visible.value = $event : null),
204
+ data: formData.value,
205
+ "onUpdate:data": _cache[1] || (_cache[1] = ($event) => formData.value = $event),
176
206
  wrapper: reProps.value.qdDialogOptions,
177
207
  items: items.value
178
- }, null, 8, ["visible", "wrapper", "items"]);
208
+ }, null, 8, ["visible", "data", "wrapper", "items"]);
179
209
  };
180
210
  }
181
211
  });
@@ -2,4 +2,5 @@ export declare const qdImportDialogProps: {
2
2
  readonly method: "POST";
3
3
  readonly name: "file";
4
4
  readonly accept: () => string[];
5
+ readonly updateSupport: true;
5
6
  };
@@ -1,7 +1,8 @@
1
1
  const qdImportDialogProps = {
2
2
  method: "POST",
3
3
  name: "file",
4
- accept: () => [".xlsx", ".xls"]
4
+ accept: () => [".xlsx", ".xls"],
5
+ updateSupport: true
5
6
  };
6
7
  export {
7
8
  qdImportDialogProps
@@ -5,5 +5,6 @@ export interface QdImportDialogProps extends Pick<QdDialogProps, 'visible'>, Pic
5
5
  downloadTpl?: string | (() => void) | (() => Promise<void>);
6
6
  downloadTplName?: string;
7
7
  onSuccess?: () => void;
8
+ updateSupport?: boolean | string;
8
9
  wrapper?: Pick<QdDialogProps, 'header' | 'width'>;
9
10
  }
@@ -1,97 +1,100 @@
1
- .qd-upload[data-v-122cd281] {
1
+ .qd-upload[data-v-f6d5f77e] {
2
2
  width: 100%;
3
3
  outline: none;
4
4
  }
5
- .qd-upload[data-v-122cd281] .t-image-viewer__trigger {
5
+ .qd-upload[data-v-f6d5f77e] .t-image-viewer__trigger {
6
6
  display: none;
7
7
  }
8
- .qd-upload[data-v-122cd281] .t-upload__dragger {
8
+ .qd-upload[data-v-f6d5f77e] .t-upload__dragger {
9
9
  min-width: auto;
10
10
  min-height: 144px;
11
11
  width: 100%;
12
12
  height: 100%;
13
13
  }
14
- .qd-upload[data-v-122cd281] .t-upload__flow {
14
+ .qd-upload[data-v-f6d5f77e] .t-upload__dragger-btns > .t-size-s {
15
+ display: inline-flex;
16
+ }
17
+ .qd-upload[data-v-f6d5f77e] .t-upload__flow {
15
18
  width: 100%;
16
19
  min-width: auto;
17
20
  max-width: 100%;
18
21
  }
19
- .qd-upload[data-v-122cd281] .t-upload__flow-empty {
22
+ .qd-upload[data-v-f6d5f77e] .t-upload__flow-empty {
20
23
  height: auto;
21
24
  min-height: 144px;
22
25
  }
23
- .qd-upload[data-v-122cd281] .t-upload__flow-card-area,
24
- .qd-upload[data-v-122cd281] .t-upload__flow-table {
26
+ .qd-upload[data-v-f6d5f77e] .t-upload__flow-card-area,
27
+ .qd-upload[data-v-f6d5f77e] .t-upload__flow-table {
25
28
  margin-top: var(--td-comp-margin-s);
26
29
  }
27
- .qd-upload[data-v-122cd281] .t-upload__file-name__container {
30
+ .qd-upload[data-v-f6d5f77e] .t-upload__file-name__container {
28
31
  display: flex;
29
32
  align-items: center;
30
33
  }
31
- .qd-upload[data-v-122cd281] .t-upload__file-name-text {
34
+ .qd-upload[data-v-f6d5f77e] .t-upload__file-name-text {
32
35
  cursor: pointer;
33
36
  }
34
- .qd-upload[data-v-122cd281] .t-upload__file-thumbnail {
37
+ .qd-upload[data-v-f6d5f77e] .t-upload__file-thumbnail {
35
38
  width: var(--td-comp-size-m);
36
39
  height: var(--td-comp-size-m);
37
40
  }
38
- .qd-upload[data-v-122cd281] .t-upload__card-image {
41
+ .qd-upload[data-v-f6d5f77e] .t-upload__card-image {
39
42
  width: 100%;
40
43
  height: 100%;
41
44
  }
42
- .qd-upload__popup-upload[data-v-122cd281] .t-image-viewer__trigger {
45
+ .qd-upload__popup-upload[data-v-f6d5f77e] .t-image-viewer__trigger {
43
46
  display: none;
44
47
  }
45
- .qd-upload__popup-upload[data-v-122cd281] .t-upload__flow-table {
48
+ .qd-upload__popup-upload[data-v-f6d5f77e] .t-upload__flow-table {
46
49
  margin-top: 0;
47
50
  }
48
- .qd-upload__popup-upload[data-v-122cd281] .t-upload__file-name__container {
51
+ .qd-upload__popup-upload[data-v-f6d5f77e] .t-upload__file-name__container {
49
52
  display: flex;
50
53
  align-items: center;
51
54
  }
52
- .qd-upload__popup-upload[data-v-122cd281] .t-upload__file-name-text {
55
+ .qd-upload__popup-upload[data-v-f6d5f77e] .t-upload__file-name-text {
53
56
  cursor: pointer;
54
57
  }
55
- .qd-upload__popup-upload[data-v-122cd281] .t-upload__file-thumbnail {
58
+ .qd-upload__popup-upload[data-v-f6d5f77e] .t-upload__file-thumbnail {
56
59
  width: var(--td-comp-size-m);
57
60
  height: var(--td-comp-size-m);
58
61
  }
59
- .qd-upload__popup-upload[data-v-122cd281] .t-upload__card-image {
62
+ .qd-upload__popup-upload[data-v-f6d5f77e] .t-upload__card-image {
60
63
  width: 100%;
61
64
  height: 100%;
62
65
  }
63
- .qd-upload__popup-upload--disabled[data-v-122cd281] .t-upload__flow-table th:last-child,
64
- .qd-upload__popup-upload--disabled[data-v-122cd281] .t-upload__flow-table td:last-child {
66
+ .qd-upload__popup-upload--disabled[data-v-f6d5f77e] .t-upload__flow-table th:last-child,
67
+ .qd-upload__popup-upload--disabled[data-v-f6d5f77e] .t-upload__flow-table td:last-child {
65
68
  display: none;
66
69
  }
67
- .qd-upload[data-v-122cd281]:focus .t-upload__flow-card-area,
68
- .qd-upload[data-v-122cd281]:focus .t-upload__flow-table {
70
+ .qd-upload[data-v-f6d5f77e]:focus .t-upload__flow-card-area,
71
+ .qd-upload[data-v-f6d5f77e]:focus .t-upload__flow-table {
69
72
  border-color: var(--td-brand-color);
70
73
  }
71
- .qd-upload--only-view[data-v-122cd281] .t-upload__flow-empty,
72
- .qd-upload--only-view[data-v-122cd281] .t-upload__card-mask-item-divider {
74
+ .qd-upload--only-view[data-v-f6d5f77e] .t-upload__flow-empty,
75
+ .qd-upload--only-view[data-v-f6d5f77e] .t-upload__card-mask-item-divider {
73
76
  display: none;
74
77
  }
75
- .qd-upload--only-view[data-v-122cd281] .t-upload__flow-card-area {
78
+ .qd-upload--only-view[data-v-f6d5f77e] .t-upload__flow-card-area {
76
79
  border-color: var(--td-component-border);
77
80
  }
78
- .qd-upload--only-view[data-v-122cd281]:not(.qd-upload--btn-image-popup):not(.qd-upload--btn-file-popup) .t-upload__flow-op,
79
- .qd-upload--only-view[data-v-122cd281]:not(.qd-upload--btn-image-popup):not(.qd-upload--btn-file-popup) .t-upload__trigger,
80
- .qd-upload--only-view[data-v-122cd281]:not(.qd-upload--btn-image-popup):not(.qd-upload--btn-file-popup) .t-upload__flow-bottom {
81
+ .qd-upload--only-view[data-v-f6d5f77e]:not(.qd-upload--btn-image-popup):not(.qd-upload--btn-file-popup) .t-upload__flow-op,
82
+ .qd-upload--only-view[data-v-f6d5f77e]:not(.qd-upload--btn-image-popup):not(.qd-upload--btn-file-popup) .t-upload__trigger,
83
+ .qd-upload--only-view[data-v-f6d5f77e]:not(.qd-upload--btn-image-popup):not(.qd-upload--btn-file-popup) .t-upload__flow-bottom {
81
84
  display: none;
82
85
  }
83
- .qd-upload--only-view[data-v-122cd281]:not(.qd-upload--btn-image-popup):not(.qd-upload--btn-file-popup) .t-upload__flow-table,
84
- .qd-upload--only-view[data-v-122cd281]:not(.qd-upload--btn-image-popup):not(.qd-upload--btn-file-popup) .t-upload__flow-card-area {
86
+ .qd-upload--only-view[data-v-f6d5f77e]:not(.qd-upload--btn-image-popup):not(.qd-upload--btn-file-popup) .t-upload__flow-table,
87
+ .qd-upload--only-view[data-v-f6d5f77e]:not(.qd-upload--btn-image-popup):not(.qd-upload--btn-file-popup) .t-upload__flow-card-area {
85
88
  margin-top: 0;
86
89
  }
87
- .qd-upload--hide-manual-upload[data-v-122cd281] .t-upload__flow-bottom {
90
+ .qd-upload--hide-manual-upload[data-v-f6d5f77e] .t-upload__flow-bottom {
88
91
  display: none;
89
92
  margin-top: 0;
90
93
  }
91
- .qd-upload--hide-progress[data-v-122cd281] .t-upload__flow-table th:last-child,
92
- .qd-upload--hide-progress[data-v-122cd281] .t-upload__flow-table td:last-child {
94
+ .qd-upload--hide-progress[data-v-f6d5f77e] .t-upload__flow-table th:last-child,
95
+ .qd-upload--hide-progress[data-v-f6d5f77e] .t-upload__flow-table td:last-child {
93
96
  display: none;
94
97
  }
95
- .qd-upload--disabled[data-v-122cd281] .t-upload__flow-card-area {
98
+ .qd-upload--disabled[data-v-f6d5f77e] .t-upload__flow-card-area {
96
99
  border-color: var(--td-component-border);
97
100
  }
@@ -2,7 +2,7 @@ import './index.css'
2
2
  import _sfc_main from "./index.vue2.mjs";
3
3
  /* empty css */
4
4
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
5
- const QdUpload = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-122cd281"]]);
5
+ const QdUpload = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f6d5f77e"]]);
6
6
  export {
7
7
  QdUpload as default
8
8
  };
@@ -261,7 +261,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
261
261
  response: { ...response, url: response?.url ?? response?.data?.url }
262
262
  };
263
263
  }
264
- const errorMsg = formatResult.error === "timeout" ? t("fileUploadTimeout") : t("fileUploadFailed");
264
+ const errorMsg = result.error === "timeout" ? t("fileUploadTimeout") : formatResult.error || t("fileUploadFailed");
265
265
  return { status: "fail", error: errorMsg, response: {} };
266
266
  });
267
267
  } : void 0;
@@ -342,6 +342,7 @@ declare const _default: {
342
342
  downloadTplText: string;
343
343
  successText: string;
344
344
  failText: string;
345
+ updateSupportText: string;
345
346
  };
346
347
  form: {
347
348
  submitFailed: string;
@@ -83,7 +83,8 @@ const enUS = merge(enUS$1, {
83
83
  clickDownloadTplText: "Click to download the corresponding template and complete the information.",
84
84
  downloadTplText: "Download template",
85
85
  successText: "Import Success",
86
- failText: "Import Failed"
86
+ failText: "Import Failed",
87
+ updateSupportText: "Update existing data"
87
88
  },
88
89
  form: {
89
90
  submitFailed: "Submission Failed",
@@ -342,6 +342,7 @@ declare const _default: {
342
342
  downloadTplText: string;
343
343
  successText: string;
344
344
  failText: string;
345
+ updateSupportText: string;
345
346
  };
346
347
  form: {
347
348
  submitFailed: string;
@@ -80,7 +80,8 @@ const zhCN = merge(zhCN$1, {
80
80
  clickDownloadTplText: "点击下载对应模板并完善信息",
81
81
  downloadTplText: "下载模板",
82
82
  successText: "导入成功",
83
- failText: "导入失败"
83
+ failText: "导入失败",
84
+ updateSupportText: "是否更新已存在的数据"
84
85
  },
85
86
  form: {
86
87
  submitFailed: "提交失败",
@@ -342,6 +342,7 @@ declare const _default: {
342
342
  downloadTplText: string;
343
343
  successText: string;
344
344
  failText: string;
345
+ updateSupportText: string;
345
346
  };
346
347
  form: {
347
348
  submitFailed: string;
@@ -80,7 +80,8 @@ const zhTW = merge(zhTW$1, {
80
80
  clickDownloadTplText: "點擊下載對應模板並完善訊息",
81
81
  downloadTplText: "下載模板",
82
82
  successText: "導入成功",
83
- failText: "導入失敗"
83
+ failText: "導入失敗",
84
+ updateSupportText: "是否更新已存在的資料"
84
85
  },
85
86
  form: {
86
87
  submitFailed: "提交失敗",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qidian-vue-ui",
3
- "version": "2.0.35",
3
+ "version": "2.0.36",
4
4
  "description": "基于 TDesign 的 QiDian Vue UI 组件库",
5
5
  "author": "qidian",
6
6
  "license": "MIT",