widget.qw 1.0.35 → 1.0.37

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.
package/build/style.css CHANGED
@@ -99,31 +99,31 @@
99
99
  opacity: 1;
100
100
  -webkit-text-fill-color: #000;
101
101
  }
102
- .popup-style[data-v-57cfd397] {
102
+ .popup-style[data-v-3f1c4b3e] {
103
103
  height: 21.25rem;
104
104
  }
105
- .showMultipleButton[data-v-57cfd397] {
105
+ .showMultipleButton[data-v-3f1c4b3e] {
106
106
  padding-bottom: 0;
107
107
  }
108
- .showMultipleButton .van-button[data-v-57cfd397] {
108
+ .showMultipleButton .van-button[data-v-3f1c4b3e] {
109
109
  border: 0;
110
110
  }
111
- .flex-between[data-v-57cfd397] {
111
+ .flex-between[data-v-3f1c4b3e] {
112
112
  padding: 10px;
113
113
  display: flex;
114
114
  justify-content: space-between;
115
115
  align-items: center;
116
116
  }
117
- .bold[data-v-57cfd397] {
117
+ .bold[data-v-3f1c4b3e] {
118
118
  font-weight: bold;
119
119
  color: #444;
120
120
  }
121
- .checkbox-style[data-v-57cfd397] {
121
+ .checkbox-style[data-v-3f1c4b3e] {
122
122
  /* height: 220px; */
123
123
  height: calc(220px - 30px);
124
124
  overflow-y: auto;
125
125
  }
126
- .select-all-container[data-v-57cfd397] {
126
+ .select-all-container[data-v-3f1c4b3e] {
127
127
  font-size: 14px;
128
128
  padding: 0 16px;
129
129
  margin: 10px 0;
@@ -131,12 +131,12 @@
131
131
  justify-content: flex-end;
132
132
  align-items: center;
133
133
  }
134
- .select-all-container .van-checkbox[data-v-57cfd397] {
134
+ .select-all-container .van-checkbox[data-v-3f1c4b3e] {
135
135
  margin-left: auto;
136
136
  }
137
137
 
138
138
  /* 新增:调整方形复选框的边距 */
139
- .van-checkbox--square[data-v-57cfd397] {
139
+ .van-checkbox--square[data-v-3f1c4b3e] {
140
140
  margin-left: 8px;
141
141
  }
142
142
 
@@ -17107,7 +17107,7 @@ const _sfc_main$n = {
17107
17107
  };
17108
17108
  }
17109
17109
  };
17110
- var data_selector_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => "\n.popup-style[data-v-57cfd397] {\r\n height: 21.25rem;\n}\n.showMultipleButton[data-v-57cfd397] {\r\n padding-bottom: 0;\n}\n.showMultipleButton .van-button[data-v-57cfd397] {\r\n border: 0;\n}\n.flex-between[data-v-57cfd397] {\r\n padding: 10px;\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\n}\n.bold[data-v-57cfd397] {\r\n font-weight: bold;\r\n color: #444;\n}\n.checkbox-style[data-v-57cfd397] {\r\n /* height: 220px; */\r\n height: calc(220px - 30px); \r\n overflow-y: auto;\n}\n.select-all-container[data-v-57cfd397] {\r\n font-size: 14px;\r\n padding: 0 16px;\r\n margin: 10px 0;\r\n display: flex;\r\n justify-content: flex-end;\r\n align-items: center;\n}\n.select-all-container .van-checkbox[data-v-57cfd397] {\r\n margin-left: auto;\n}\r\n\r\n/* \u65B0\u589E\uFF1A\u8C03\u6574\u65B9\u5F62\u590D\u9009\u6846\u7684\u8FB9\u8DDD */\n.van-checkbox--square[data-v-57cfd397] {\r\n margin-left: 8px;\n}\r\n \r\n")();
17110
+ var data_selector_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => "\n.popup-style[data-v-3f1c4b3e] {\r\n height: 21.25rem;\n}\n.showMultipleButton[data-v-3f1c4b3e] {\r\n padding-bottom: 0;\n}\n.showMultipleButton .van-button[data-v-3f1c4b3e] {\r\n border: 0;\n}\n.flex-between[data-v-3f1c4b3e] {\r\n padding: 10px;\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\n}\n.bold[data-v-3f1c4b3e] {\r\n font-weight: bold;\r\n color: #444;\n}\n.checkbox-style[data-v-3f1c4b3e] {\r\n /* height: 220px; */\r\n height: calc(220px - 30px); \r\n overflow-y: auto;\n}\n.select-all-container[data-v-3f1c4b3e] {\r\n font-size: 14px;\r\n padding: 0 16px;\r\n margin: 10px 0;\r\n display: flex;\r\n justify-content: flex-end;\r\n align-items: center;\n}\n.select-all-container .van-checkbox[data-v-3f1c4b3e] {\r\n margin-left: auto;\n}\r\n\r\n/* \u65B0\u589E\uFF1A\u8C03\u6574\u65B9\u5F62\u590D\u9009\u6846\u7684\u8FB9\u8DDD */\n.van-checkbox--square[data-v-3f1c4b3e] {\r\n margin-left: 8px;\n}\r\n \r\n")();
17111
17111
  const _hoisted_1$f = {
17112
17112
  class: "pad10 flex-between showMultipleButton"
17113
17113
  };
@@ -17127,18 +17127,16 @@ const _hoisted_7$6 = {
17127
17127
  const _sfc_main$m = {
17128
17128
  __name: "data_selector",
17129
17129
  props: {
17130
- mode: {
17131
- type: String,
17132
- default: "multiple",
17133
- validator: (v) => ["single", "multiple"].includes(v)
17130
+ multiple: {
17131
+ type: Boolean,
17132
+ default: false
17134
17133
  },
17135
17134
  options: {
17136
17135
  type: Array,
17137
17136
  required: true
17138
17137
  },
17139
17138
  modelValue: {
17140
- type: [Array, String, Number],
17141
- default: () => []
17139
+ type: [Array, String, Number]
17142
17140
  },
17143
17141
  rules: {
17144
17142
  type: Array,
@@ -17171,6 +17169,11 @@ const _sfc_main$m = {
17171
17169
  isDisabled
17172
17170
  } = util.props2auth(props);
17173
17171
  const selectedItems = ref([]);
17172
+ const selectdItemsLabel = computed(() => {
17173
+ if (!selectedItems.value)
17174
+ return "";
17175
+ return selectedItems.value.join(",");
17176
+ });
17174
17177
  const popupVisible = ref(false);
17175
17178
  const searchKeyword = ref(null);
17176
17179
  const checkboxRefs = ref([]);
@@ -17191,7 +17194,7 @@ const _sfc_main$m = {
17191
17194
  const reShow = () => {
17192
17195
  if (props.modelValue) {
17193
17196
  if (Array.isArray(props.options)) {
17194
- if (props.mode === "multiple") {
17197
+ if (props.multiple) {
17195
17198
  selectedItems.value = findTextsByValues(props.modelValue, props.options);
17196
17199
  } else {
17197
17200
  const foundItem = props.options.find((item) => item.value === props.modelValue);
@@ -17215,7 +17218,7 @@ const _sfc_main$m = {
17215
17218
  if (isReadonly.value) {
17216
17219
  return;
17217
17220
  }
17218
- if (props.mode === "multiple") {
17221
+ if (props.multiple) {
17219
17222
  checkedValue.value = Array.isArray(props.modelValue) ? props.modelValue : [];
17220
17223
  } else {
17221
17224
  checkedValue.value = props.modelValue;
@@ -17226,7 +17229,7 @@ const _sfc_main$m = {
17226
17229
  popupVisible.value = false;
17227
17230
  };
17228
17231
  const confirmSelection = () => {
17229
- if (props.mode === "multiple") {
17232
+ if (props.multiple) {
17230
17233
  selectedItems.value = findTextsByValues(checkedValue.value, props.options);
17231
17234
  emit("update:modelValue", checkedValue.value);
17232
17235
  emit("select", values2items(checkedValue.value));
@@ -17254,7 +17257,7 @@ const _sfc_main$m = {
17254
17257
  });
17255
17258
  });
17256
17259
  watch(checkedValue, () => {
17257
- if (props.mode === "multiple") {
17260
+ if (props.multiple) {
17258
17261
  if (filteredColumns.value.length === 0) {
17259
17262
  isAllChecked.value = false;
17260
17263
  } else {
@@ -17292,7 +17295,7 @@ const _sfc_main$m = {
17292
17295
  type: "textarea",
17293
17296
  rows: "1",
17294
17297
  autosize: "",
17295
- modelValue: selectedItems.value,
17298
+ modelValue: unref(selectdItemsLabel),
17296
17299
  readonly: "",
17297
17300
  clearable: "",
17298
17301
  required: unref(isRequired),
@@ -17335,7 +17338,7 @@ const _sfc_main$m = {
17335
17338
  },
17336
17339
  clearable: "",
17337
17340
  placeholder: "\u8BF7\u8F93\u5165\u641C\u7D22\u5173\u952E\u5B57"
17338
- }, null, 8, ["modelValue"]), __props.mode === "multiple" ? (openBlock(), createElementBlock("div", _hoisted_5$7, [createVNode(_component_van_checkbox, {
17341
+ }, null, 8, ["modelValue"]), props.multiple ? (openBlock(), createElementBlock("div", _hoisted_5$7, [createVNode(_component_van_checkbox, {
17339
17342
  shape: "square",
17340
17343
  modelValue: isAllChecked.value,
17341
17344
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isAllChecked.value = $event),
@@ -17344,7 +17347,7 @@ const _sfc_main$m = {
17344
17347
  }, {
17345
17348
  default: withCtx(() => [_hoisted_6$6]),
17346
17349
  _: 1
17347
- }, 8, ["modelValue"])])) : createCommentVNode("", true), createElementVNode("div", _hoisted_7$6, [__props.mode === "multiple" ? (openBlock(), createBlock(_component_van_checkbox_group, {
17350
+ }, 8, ["modelValue"])])) : createCommentVNode("", true), createElementVNode("div", _hoisted_7$6, [props.multiple ? (openBlock(), createBlock(_component_van_checkbox_group, {
17348
17351
  key: 0,
17349
17352
  modelValue: checkedValue.value,
17350
17353
  "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => checkedValue.value = $event)
@@ -17399,7 +17402,7 @@ const _sfc_main$m = {
17399
17402
  };
17400
17403
  }
17401
17404
  };
17402
- var DataSelector = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-57cfd397"]]);
17405
+ var DataSelector = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-3f1c4b3e"]]);
17403
17406
  var mult_list_selector_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => "\r\n/* // \u4FEE\u6539 confirmation-group \u548C confirmation-item \u7684\u6837\u5F0F */\n.confirmation-group[data-v-40a09897] {\r\n padding: 0 16px;\r\n --van-checkbox-disabled-icon-color: black;\n}\n.confirmation-item[data-v-40a09897] {\r\n padding: 12px 16px;\r\n margin: 0 -16px;\r\n border-bottom: 1px solid #f5f5f5;\r\n /* \u7981\u7528\u72B6\u6001\u6837\u5F0F */\n}\r\n\r\n/* // \u5728\u4E0B\u65B9\u6DFB\u52A0\u5A92\u4F53\u67E5\u8BE2\u9002\u914D\u5C0F\u5C4F\u5E55 */\n@media (max-width: 320px) {\n.confirmation-item[data-v-40a09897] {\r\n padding: 12px 8px;\r\n margin: 0 -8px;\n}\n}\n.confirmation-item[data-v-40a09897]:last-child {\r\n border-bottom: none;\n}\r\n\r\n/* \u65B0\u589E\u6837\u5F0F */\n.confirmation-tips[data-v-40a09897] {\r\n padding: 12px 16px;\r\n background: #f0faff;\r\n border-radius: 8px;\r\n margin: 10px 16px;\r\n display: flex;\r\n align-items: center;\r\n color: #1989fa;\r\n font-size: 13px;\r\n border: 1px solid #d9efff;\n}\n.confirmation-tips .van-icon[data-v-40a09897] {\r\n margin-right: 8px;\n}\r\n\r\n/* \u65B0\u589E\u5B57\u4F53\u7EE7\u627F\u6837\u5F0F */\n.confirmation-group[data-v-40a09897] {\r\n font-size: inherit; /* \u7EE7\u627F\u7236\u7EA7\u5B57\u4F53\u5927\u5C0F */\n}\n.option-text[data-v-40a09897] {\r\n font-size: 14px; /* \u660E\u786E\u6307\u5B9A\u5B57\u4F53\u5927\u5C0F */\r\n line-height: 1.5; /* \u4FDD\u6301\u884C\u9AD8\u4E00\u81F4 */\r\n /* color:black; */\n}\r\n\r\n/* \u9002\u914D\u79FB\u52A8\u7AEF\u7684\u5B57\u4F53\u8C03\u6574 */\n@media (max-width: 375px) {\n.option-text[data-v-40a09897] {\r\n font-size: 13px;\n}\n}\r\n\r\n/* \u65B0\u589E\u7981\u7528\u72B6\u6001\u6837\u5F0F */\n.custom-checkbox[data-v-40a09897]:disabled .--van-checkbox__icon {\r\n background-color: #f5f5f5;\r\n border-color: #ebedf0;\r\n transition: all 0.3s;\n}\n.custom-checkbox[data-v-40a09897]:disabled .van-checkbox__icon--checked {\r\n background-color: #1989fa;\r\n border-color: #1989fa;\r\n opacity: 0.7;\n}\n.van-checkbox--disabled[data-v-40a09897] .option-text {\r\n color: #969799;\n}\n.van-checkbox--disabled.van-checkbox--checked[data-v-40a09897] .option-text {\r\n color: #1989fa;\r\n opacity: 0.8;\n}\r\n")();
17404
17407
  const _hoisted_1$e = {
17405
17408
  key: 0,
@@ -17110,7 +17110,7 @@ var __async = (__this, __arguments, generator) => {
17110
17110
  };
17111
17111
  }
17112
17112
  };
17113
- var data_selector_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => "\n.popup-style[data-v-57cfd397] {\r\n height: 21.25rem;\n}\n.showMultipleButton[data-v-57cfd397] {\r\n padding-bottom: 0;\n}\n.showMultipleButton .van-button[data-v-57cfd397] {\r\n border: 0;\n}\n.flex-between[data-v-57cfd397] {\r\n padding: 10px;\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\n}\n.bold[data-v-57cfd397] {\r\n font-weight: bold;\r\n color: #444;\n}\n.checkbox-style[data-v-57cfd397] {\r\n /* height: 220px; */\r\n height: calc(220px - 30px); \r\n overflow-y: auto;\n}\n.select-all-container[data-v-57cfd397] {\r\n font-size: 14px;\r\n padding: 0 16px;\r\n margin: 10px 0;\r\n display: flex;\r\n justify-content: flex-end;\r\n align-items: center;\n}\n.select-all-container .van-checkbox[data-v-57cfd397] {\r\n margin-left: auto;\n}\r\n\r\n/* \u65B0\u589E\uFF1A\u8C03\u6574\u65B9\u5F62\u590D\u9009\u6846\u7684\u8FB9\u8DDD */\n.van-checkbox--square[data-v-57cfd397] {\r\n margin-left: 8px;\n}\r\n \r\n")();
17113
+ var data_selector_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => "\n.popup-style[data-v-3f1c4b3e] {\r\n height: 21.25rem;\n}\n.showMultipleButton[data-v-3f1c4b3e] {\r\n padding-bottom: 0;\n}\n.showMultipleButton .van-button[data-v-3f1c4b3e] {\r\n border: 0;\n}\n.flex-between[data-v-3f1c4b3e] {\r\n padding: 10px;\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\n}\n.bold[data-v-3f1c4b3e] {\r\n font-weight: bold;\r\n color: #444;\n}\n.checkbox-style[data-v-3f1c4b3e] {\r\n /* height: 220px; */\r\n height: calc(220px - 30px); \r\n overflow-y: auto;\n}\n.select-all-container[data-v-3f1c4b3e] {\r\n font-size: 14px;\r\n padding: 0 16px;\r\n margin: 10px 0;\r\n display: flex;\r\n justify-content: flex-end;\r\n align-items: center;\n}\n.select-all-container .van-checkbox[data-v-3f1c4b3e] {\r\n margin-left: auto;\n}\r\n\r\n/* \u65B0\u589E\uFF1A\u8C03\u6574\u65B9\u5F62\u590D\u9009\u6846\u7684\u8FB9\u8DDD */\n.van-checkbox--square[data-v-3f1c4b3e] {\r\n margin-left: 8px;\n}\r\n \r\n")();
17114
17114
  const _hoisted_1$f = {
17115
17115
  class: "pad10 flex-between showMultipleButton"
17116
17116
  };
@@ -17130,18 +17130,16 @@ var __async = (__this, __arguments, generator) => {
17130
17130
  const _sfc_main$m = {
17131
17131
  __name: "data_selector",
17132
17132
  props: {
17133
- mode: {
17134
- type: String,
17135
- default: "multiple",
17136
- validator: (v) => ["single", "multiple"].includes(v)
17133
+ multiple: {
17134
+ type: Boolean,
17135
+ default: false
17137
17136
  },
17138
17137
  options: {
17139
17138
  type: Array,
17140
17139
  required: true
17141
17140
  },
17142
17141
  modelValue: {
17143
- type: [Array, String, Number],
17144
- default: () => []
17142
+ type: [Array, String, Number]
17145
17143
  },
17146
17144
  rules: {
17147
17145
  type: Array,
@@ -17174,6 +17172,11 @@ var __async = (__this, __arguments, generator) => {
17174
17172
  isDisabled
17175
17173
  } = util.props2auth(props);
17176
17174
  const selectedItems = vue.ref([]);
17175
+ const selectdItemsLabel = vue.computed(() => {
17176
+ if (!selectedItems.value)
17177
+ return "";
17178
+ return selectedItems.value.join(",");
17179
+ });
17177
17180
  const popupVisible = vue.ref(false);
17178
17181
  const searchKeyword = vue.ref(null);
17179
17182
  const checkboxRefs = vue.ref([]);
@@ -17194,7 +17197,7 @@ var __async = (__this, __arguments, generator) => {
17194
17197
  const reShow = () => {
17195
17198
  if (props.modelValue) {
17196
17199
  if (Array.isArray(props.options)) {
17197
- if (props.mode === "multiple") {
17200
+ if (props.multiple) {
17198
17201
  selectedItems.value = findTextsByValues(props.modelValue, props.options);
17199
17202
  } else {
17200
17203
  const foundItem = props.options.find((item) => item.value === props.modelValue);
@@ -17218,7 +17221,7 @@ var __async = (__this, __arguments, generator) => {
17218
17221
  if (isReadonly.value) {
17219
17222
  return;
17220
17223
  }
17221
- if (props.mode === "multiple") {
17224
+ if (props.multiple) {
17222
17225
  checkedValue.value = Array.isArray(props.modelValue) ? props.modelValue : [];
17223
17226
  } else {
17224
17227
  checkedValue.value = props.modelValue;
@@ -17229,7 +17232,7 @@ var __async = (__this, __arguments, generator) => {
17229
17232
  popupVisible.value = false;
17230
17233
  };
17231
17234
  const confirmSelection = () => {
17232
- if (props.mode === "multiple") {
17235
+ if (props.multiple) {
17233
17236
  selectedItems.value = findTextsByValues(checkedValue.value, props.options);
17234
17237
  emit("update:modelValue", checkedValue.value);
17235
17238
  emit("select", values2items(checkedValue.value));
@@ -17257,7 +17260,7 @@ var __async = (__this, __arguments, generator) => {
17257
17260
  });
17258
17261
  });
17259
17262
  vue.watch(checkedValue, () => {
17260
- if (props.mode === "multiple") {
17263
+ if (props.multiple) {
17261
17264
  if (filteredColumns.value.length === 0) {
17262
17265
  isAllChecked.value = false;
17263
17266
  } else {
@@ -17295,7 +17298,7 @@ var __async = (__this, __arguments, generator) => {
17295
17298
  type: "textarea",
17296
17299
  rows: "1",
17297
17300
  autosize: "",
17298
- modelValue: selectedItems.value,
17301
+ modelValue: vue.unref(selectdItemsLabel),
17299
17302
  readonly: "",
17300
17303
  clearable: "",
17301
17304
  required: vue.unref(isRequired),
@@ -17338,7 +17341,7 @@ var __async = (__this, __arguments, generator) => {
17338
17341
  },
17339
17342
  clearable: "",
17340
17343
  placeholder: "\u8BF7\u8F93\u5165\u641C\u7D22\u5173\u952E\u5B57"
17341
- }, null, 8, ["modelValue"]), __props.mode === "multiple" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$7, [vue.createVNode(_component_van_checkbox, {
17344
+ }, null, 8, ["modelValue"]), props.multiple ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$7, [vue.createVNode(_component_van_checkbox, {
17342
17345
  shape: "square",
17343
17346
  modelValue: isAllChecked.value,
17344
17347
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isAllChecked.value = $event),
@@ -17347,7 +17350,7 @@ var __async = (__this, __arguments, generator) => {
17347
17350
  }, {
17348
17351
  default: vue.withCtx(() => [_hoisted_6$6]),
17349
17352
  _: 1
17350
- }, 8, ["modelValue"])])) : vue.createCommentVNode("", true), vue.createElementVNode("div", _hoisted_7$6, [__props.mode === "multiple" ? (vue.openBlock(), vue.createBlock(_component_van_checkbox_group, {
17353
+ }, 8, ["modelValue"])])) : vue.createCommentVNode("", true), vue.createElementVNode("div", _hoisted_7$6, [props.multiple ? (vue.openBlock(), vue.createBlock(_component_van_checkbox_group, {
17351
17354
  key: 0,
17352
17355
  modelValue: checkedValue.value,
17353
17356
  "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => checkedValue.value = $event)
@@ -17402,7 +17405,7 @@ var __async = (__this, __arguments, generator) => {
17402
17405
  };
17403
17406
  }
17404
17407
  };
17405
- var DataSelector = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-57cfd397"]]);
17408
+ var DataSelector = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-3f1c4b3e"]]);
17406
17409
  var mult_list_selector_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => "\r\n/* // \u4FEE\u6539 confirmation-group \u548C confirmation-item \u7684\u6837\u5F0F */\n.confirmation-group[data-v-40a09897] {\r\n padding: 0 16px;\r\n --van-checkbox-disabled-icon-color: black;\n}\n.confirmation-item[data-v-40a09897] {\r\n padding: 12px 16px;\r\n margin: 0 -16px;\r\n border-bottom: 1px solid #f5f5f5;\r\n /* \u7981\u7528\u72B6\u6001\u6837\u5F0F */\n}\r\n\r\n/* // \u5728\u4E0B\u65B9\u6DFB\u52A0\u5A92\u4F53\u67E5\u8BE2\u9002\u914D\u5C0F\u5C4F\u5E55 */\n@media (max-width: 320px) {\n.confirmation-item[data-v-40a09897] {\r\n padding: 12px 8px;\r\n margin: 0 -8px;\n}\n}\n.confirmation-item[data-v-40a09897]:last-child {\r\n border-bottom: none;\n}\r\n\r\n/* \u65B0\u589E\u6837\u5F0F */\n.confirmation-tips[data-v-40a09897] {\r\n padding: 12px 16px;\r\n background: #f0faff;\r\n border-radius: 8px;\r\n margin: 10px 16px;\r\n display: flex;\r\n align-items: center;\r\n color: #1989fa;\r\n font-size: 13px;\r\n border: 1px solid #d9efff;\n}\n.confirmation-tips .van-icon[data-v-40a09897] {\r\n margin-right: 8px;\n}\r\n\r\n/* \u65B0\u589E\u5B57\u4F53\u7EE7\u627F\u6837\u5F0F */\n.confirmation-group[data-v-40a09897] {\r\n font-size: inherit; /* \u7EE7\u627F\u7236\u7EA7\u5B57\u4F53\u5927\u5C0F */\n}\n.option-text[data-v-40a09897] {\r\n font-size: 14px; /* \u660E\u786E\u6307\u5B9A\u5B57\u4F53\u5927\u5C0F */\r\n line-height: 1.5; /* \u4FDD\u6301\u884C\u9AD8\u4E00\u81F4 */\r\n /* color:black; */\n}\r\n\r\n/* \u9002\u914D\u79FB\u52A8\u7AEF\u7684\u5B57\u4F53\u8C03\u6574 */\n@media (max-width: 375px) {\n.option-text[data-v-40a09897] {\r\n font-size: 13px;\n}\n}\r\n\r\n/* \u65B0\u589E\u7981\u7528\u72B6\u6001\u6837\u5F0F */\n.custom-checkbox[data-v-40a09897]:disabled .--van-checkbox__icon {\r\n background-color: #f5f5f5;\r\n border-color: #ebedf0;\r\n transition: all 0.3s;\n}\n.custom-checkbox[data-v-40a09897]:disabled .van-checkbox__icon--checked {\r\n background-color: #1989fa;\r\n border-color: #1989fa;\r\n opacity: 0.7;\n}\n.van-checkbox--disabled[data-v-40a09897] .option-text {\r\n color: #969799;\n}\n.van-checkbox--disabled.van-checkbox--checked[data-v-40a09897] .option-text {\r\n color: #1989fa;\r\n opacity: 0.8;\n}\r\n")();
17407
17410
  const _hoisted_1$e = {
17408
17411
  key: 0,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "widget.qw",
3
3
  "private": false,
4
- "version": "1.0.35",
4
+ "version": "1.0.37",
5
5
  "description": "marqstree Vue3组件库",
6
6
  "main": "build/widget.qw.es.js",
7
7
  "keywords": [
@@ -6,7 +6,7 @@
6
6
  type="textarea"
7
7
  rows="1"
8
8
  autosize
9
- :modelValue="selectedItems"
9
+ :modelValue="selectdItemsLabel"
10
10
  readonly
11
11
  clearable
12
12
  :required="isRequired"
@@ -29,12 +29,12 @@
29
29
  <!-- 搜索框 -->
30
30
  <van-field left-icon="search" v-model.trim="searchKeyword" clearable placeholder="请输入搜索关键字" />
31
31
  <!-- 全选 -->
32
- <div v-if="mode === 'multiple'" class="select-all-container">
32
+ <div v-if="props.multiple" class="select-all-container">
33
33
  <van-checkbox shape="square" v-model="isAllChecked" @click="toggleAllSelect" label-position="left">全选</van-checkbox>
34
34
  </div>
35
35
  <!-- 数据列表 -->
36
36
  <div class="checkbox-style">
37
- <van-checkbox-group v-model="checkedValue" v-if="mode === 'multiple'">
37
+ <van-checkbox-group v-model="checkedValue" v-if="props.multiple">
38
38
  <van-cell-group>
39
39
  <van-cell v-for="(item, index) in filteredColumns" :key="index" :title="item.text" clickable
40
40
  @click="toggle(index)">
@@ -72,18 +72,16 @@ import { onMounted, ref, onBeforeUpdate, computed, nextTick, watch } from "vue"
72
72
  import util from '../util'
73
73
 
74
74
  const props = defineProps({
75
- mode: {
76
- type: String,
77
- default: 'multiple', // 'single' | 'multiple'
78
- validator: (v) => ['single', 'multiple'].includes(v)
75
+ multiple:{
76
+ type:Boolean,
77
+ default:false
79
78
  },
80
79
  options: {
81
80
  type: Array,
82
81
  required: true,
83
82
  },
84
83
  modelValue: {
85
- type: [Array, String, Number],
86
- default: () => [],
84
+ type: [Array, String, Number]
87
85
  },
88
86
  rules: {
89
87
  type: Array,
@@ -109,6 +107,12 @@ const {isRequired, isReadonly, isGone,isDisabled} = util.props2auth(props)
109
107
  const emit = defineEmits(["update:modelValue","select"]);
110
108
 
111
109
  const selectedItems = ref([]);
110
+ const selectdItemsLabel = computed(()=>{
111
+ if(!selectedItems.value)
112
+ return ''
113
+
114
+ return selectedItems.value.join(',')
115
+ })
112
116
  const popupVisible = ref(false);
113
117
  const searchKeyword = ref(null);
114
118
  const checkboxRefs = ref([]);
@@ -133,7 +137,7 @@ const values2items = (values)=>{
133
137
  const reShow = () => {
134
138
  if (props.modelValue) {
135
139
  if (Array.isArray(props.options)) {
136
- if (props.mode === 'multiple') {
140
+ if (props.multiple) {
137
141
  selectedItems.value = findTextsByValues(props.modelValue, props.options);
138
142
  } else {
139
143
  const foundItem = props.options.find((item) => item.value === props.modelValue);
@@ -162,7 +166,7 @@ const showPopup = () => {
162
166
  if (isReadonly.value) {
163
167
  return;
164
168
  }
165
- if (props.mode === 'multiple') {
169
+ if (props.multiple) {
166
170
  checkedValue.value = Array.isArray(props.modelValue) ? props.modelValue : [];
167
171
  } else {
168
172
  checkedValue.value = props.modelValue;
@@ -175,7 +179,7 @@ const cancelSelection = () => {
175
179
  };
176
180
 
177
181
  const confirmSelection = () => {
178
- if (props.mode === 'multiple') {
182
+ if (props.multiple) {
179
183
  selectedItems.value = findTextsByValues(checkedValue.value, props.options);
180
184
  emit("update:modelValue", checkedValue.value);
181
185
  emit("select",values2items(checkedValue.value))
@@ -207,7 +211,7 @@ const filteredColumns = computed(() => {
207
211
  });
208
212
 
209
213
  watch(checkedValue, () => {
210
- if (props.mode === 'multiple') {
214
+ if (props.multiple) {
211
215
  if (filteredColumns.value.length === 0) {
212
216
  isAllChecked.value = false;
213
217
  } else {
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <div class="page">
3
- <widget-qw-data-selector :options="options" v-model="formData.singleSelect" mode="single" label="单选数据"
3
+ <widget-qw-data-selector :options="options" v-model="formData.singleSelect" label="单选数据"
4
4
  placeholder="单选数据" :auth="formData.auth" />
5
- <widget-qw-data-selector :options="options" v-model="formData.multSelect" mode="multiple" label="多选数据"
5
+ <widget-qw-data-selector :options="options" v-model="formData.multSelect" multiple label="多选数据"
6
6
  placeholder="多选数据" :required="true" :readonly="false" />
7
7
  </div>
8
8
  </template>