qidian-vue-ui 1.2.98 → 1.2.100

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.
@@ -39,4 +39,5 @@ export declare const qdCrudTableProps: {
39
39
  readonly pagination: undefined;
40
40
  readonly headerBg: true;
41
41
  readonly loadingWithData: true;
42
+ readonly activeRowType: "single";
42
43
  };
@@ -40,4 +40,5 @@ export declare const qdCrudTabsTableProps: {
40
40
  readonly pagination: undefined;
41
41
  readonly headerBg: true;
42
42
  readonly loadingWithData: true;
43
+ readonly activeRowType: "single";
43
44
  };
@@ -5,10 +5,12 @@ type __VLS_Slots = {} & {
5
5
  };
6
6
  declare const __VLS_component: import("vue").DefineComponent<QdDictSelectProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
7
  "update:modelValue": (args_0: import("tdesign-vue-next").SelectValue<import("tdesign-vue-next").SelectOption> | undefined) => any;
8
+ "update:valueLabel": (args_0: string | string[] | undefined) => any;
8
9
  "update:inputValue": (args_0: string | undefined) => any;
9
10
  "update:popupVisible": (args_0: boolean | undefined) => any;
10
11
  }, string, import("vue").PublicProps, Readonly<QdDictSelectProps> & Readonly<{
11
12
  "onUpdate:modelValue"?: ((args_0: import("tdesign-vue-next").SelectValue<import("tdesign-vue-next").SelectOption> | undefined) => any) | undefined;
13
+ "onUpdate:valueLabel"?: ((args_0: string | string[] | undefined) => any) | undefined;
12
14
  "onUpdate:inputValue"?: ((args_0: string | undefined) => any) | undefined;
13
15
  "onUpdate:popupVisible"?: ((args_0: boolean | undefined) => any) | undefined;
14
16
  }>, {
@@ -15,6 +15,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
15
15
  defaultSelectFirst: { type: Boolean },
16
16
  onDefaultSelectFirst: { type: Function },
17
17
  convStr: { type: [Boolean, String] },
18
+ valueLabel: {},
18
19
  dedupe: { type: Boolean },
19
20
  strict: { type: Boolean },
20
21
  autoWidth: { type: Boolean },
@@ -73,11 +74,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
73
74
  onRemove: { type: Function },
74
75
  onSearch: { type: Function }
75
76
  }, qdDictSelectProps),
76
- emits: ["update:modelValue", "update:inputValue", "update:popupVisible"],
77
+ emits: ["update:modelValue", "update:valueLabel", "update:inputValue", "update:popupVisible"],
77
78
  setup(__props, { emit: __emit }) {
78
79
  const props = __props;
79
80
  const emit = __emit;
80
- const { modelValue, inputValue, popupVisible } = useVModels(props, emit, { passive: true });
81
+ const { modelValue, valueLabel, inputValue, popupVisible } = useVModels(props, emit, {
82
+ passive: true
83
+ });
81
84
  const reModelValue = computed({
82
85
  get: () => {
83
86
  const { convStr, strict, selectOptions } = reProps.value;
@@ -118,6 +121,35 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
118
121
  }
119
122
  }
120
123
  });
124
+ const reValueLabel = computed({
125
+ get: () => {
126
+ const { convStr, selectOptions } = reProps.value;
127
+ const { multiple, valueType } = selectOptions;
128
+ if (!multiple || valueType === "object") return valueLabel.value;
129
+ if (isEmpty(valueLabel.value)) return [];
130
+ if (typeof valueLabel.value === "string") {
131
+ return valueLabel.value.split(
132
+ (typeof convStr === "string" ? convStr : "") || qdDictConvStrSeparator
133
+ );
134
+ }
135
+ return valueLabel.value;
136
+ },
137
+ set: (val) => {
138
+ const { convStr, selectOptions } = reProps.value;
139
+ const { multiple, valueType } = selectOptions;
140
+ if (!multiple || valueType === "object") {
141
+ valueLabel.value = val;
142
+ return;
143
+ }
144
+ if (convStr && Array.isArray(val)) {
145
+ valueLabel.value = val.join(
146
+ (typeof convStr === "string" ? convStr : "") || qdDictConvStrSeparator
147
+ );
148
+ } else {
149
+ valueLabel.value = val;
150
+ }
151
+ }
152
+ });
121
153
  const dictType = toRef(props, "dictType");
122
154
  let hasAutoSelected = false;
123
155
  let unWatchAutoSelected;
@@ -128,14 +160,27 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
128
160
  modelValue: modelValue2,
129
161
  inputValue: inputValue2,
130
162
  popupVisible: popupVisible2,
163
+ valueLabel: valueLabel2,
131
164
  dictType: dictType2,
132
165
  loading,
133
166
  defaultSelectFirst,
134
167
  onDefaultSelectFirst,
135
168
  dedupe,
136
169
  options,
170
+ onChange,
137
171
  ...selectOptions
138
172
  } = props;
173
+ const labelKey = selectOptions.keys?.label || "label";
174
+ const reOnChange = (value, context) => {
175
+ onChange?.(value, context);
176
+ const { multiple } = selectOptions;
177
+ if (multiple) {
178
+ const selectedLabels = context.selectedOptions?.map((option) => option[labelKey]).filter(Boolean) || [];
179
+ reValueLabel.value = selectedLabels;
180
+ } else {
181
+ reValueLabel.value = context.option?.[labelKey] || "";
182
+ }
183
+ };
139
184
  return {
140
185
  convStr,
141
186
  strict,
@@ -145,7 +190,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
145
190
  onDefaultSelectFirst,
146
191
  dedupe,
147
192
  options,
148
- selectOptions,
193
+ selectOptions: {
194
+ ...selectOptions,
195
+ onChange: reOnChange
196
+ },
149
197
  models: {
150
198
  modelValue: modelValue2,
151
199
  inputValue: inputValue2,
@@ -10,6 +10,7 @@ export interface QdDictSelectProps extends TdSelectProps<QdDictItem> {
10
10
  e?: MouseEvent | KeyboardEvent;
11
11
  }) => void;
12
12
  convStr?: boolean | string;
13
+ valueLabel?: string | string[];
13
14
  dedupe?: boolean;
14
15
  strict?: boolean;
15
16
  }
@@ -29,6 +29,7 @@ export declare const qdServiceTableProps: {
29
29
  readonly pagination: undefined;
30
30
  readonly headerBg: true;
31
31
  readonly loadingWithData: true;
32
+ readonly activeRowType: "single";
32
33
  };
33
34
  export declare const qdServiceTableTreeConfig: {
34
35
  readonly checkStrictly: true;
@@ -27,7 +27,8 @@ const qdServiceTableProps = {
27
27
  paginationAffixedBottom: void 0,
28
28
  pagination: void 0,
29
29
  headerBg: true,
30
- loadingWithData: true
30
+ loadingWithData: true,
31
+ activeRowType: "single"
31
32
  };
32
33
  const qdServiceTableTreeConfig = {
33
34
  checkStrictly: true,
@@ -55,4 +55,5 @@ export declare const qdServiceDialogTableSelectProps: {
55
55
  readonly pagination: undefined;
56
56
  readonly headerBg: true;
57
57
  readonly loadingWithData: true;
58
+ readonly activeRowType: "single";
58
59
  };
@@ -29,6 +29,7 @@ export declare const qdServicePopupTableSelectProps: {
29
29
  readonly pagination: undefined;
30
30
  readonly headerBg: true;
31
31
  readonly loadingWithData: true;
32
+ readonly activeRowType: "single";
32
33
  };
33
34
  export declare const qdServicePopupProps: {
34
35
  readonly placement: "bottom-left";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qidian-vue-ui",
3
- "version": "1.2.98",
3
+ "version": "1.2.100",
4
4
  "description": "基于 TDesign 的 QiDian Vue UI 组件库",
5
5
  "author": "qidian",
6
6
  "license": "MIT",
@@ -128,7 +128,7 @@
128
128
  "vue-echarts": "^8.0.1",
129
129
  "vue-stream-markdown": "^0.6.5",
130
130
  "@flyfish-group/file-viewer3": "^1.0.18",
131
- "qidian-shared": "1.0.73"
131
+ "qidian-shared": "1.0.74"
132
132
  },
133
133
  "scripts": {
134
134
  "clean": "rm -rf dist",