@airpower/web 1.5.8 → 1.5.9
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/dist/main.js +17 -21
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -14036,11 +14036,9 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
14036
14036
|
emits("clear");
|
|
14037
14037
|
}
|
|
14038
14038
|
const isClearButtonShow = ref(props.showClear);
|
|
14039
|
-
const placeholderRef = ref(props.placeholder);
|
|
14040
14039
|
const formConfig = ref(void 0);
|
|
14041
14040
|
const fieldConfig = ref(void 0);
|
|
14042
14041
|
const fieldName = ref("");
|
|
14043
|
-
const dictionary = ref(void 0);
|
|
14044
14042
|
function onPropsValueUpdated(newProps) {
|
|
14045
14043
|
if (newProps) {
|
|
14046
14044
|
if (newProps.disabled) {
|
|
@@ -14069,6 +14067,20 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
14069
14067
|
}
|
|
14070
14068
|
return DateTimeFormatter.FULL_DATE_TIME;
|
|
14071
14069
|
});
|
|
14070
|
+
const dictionary = computed(() => props.list ? props.list : formConfig.value && fieldConfig.value?.dictionary ? fieldConfig.value.dictionary.toArray() : void 0);
|
|
14071
|
+
const placeholderRef = computed(() => {
|
|
14072
|
+
if (props.placeholder) {
|
|
14073
|
+
return props.placeholder;
|
|
14074
|
+
}
|
|
14075
|
+
if (formConfig.value && formConfig.value.placeholder) {
|
|
14076
|
+
return formConfig.value.placeholder;
|
|
14077
|
+
}
|
|
14078
|
+
const fieldLabel = fieldConfig.value?.label || "";
|
|
14079
|
+
if (dictionary.value || fieldConfig.value?.dictionary || props.list || props.tree || formConfig.value?.dateType !== void 0) {
|
|
14080
|
+
return `${WebI18n.get().SelectPlease + fieldLabel}...`;
|
|
14081
|
+
}
|
|
14082
|
+
return `${WebI18n.get().InputPlease + fieldLabel}...`;
|
|
14083
|
+
});
|
|
14072
14084
|
function getSwitchColor(status) {
|
|
14073
14085
|
return dictionary.value?.find((item) => !!item.key === status)?.color || "";
|
|
14074
14086
|
}
|
|
@@ -14090,6 +14102,9 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
14090
14102
|
watch(props, (newProps) => {
|
|
14091
14103
|
isClearButtonShow.value = props.showClear;
|
|
14092
14104
|
onPropsValueUpdated(newProps);
|
|
14105
|
+
}, {
|
|
14106
|
+
immediate: true,
|
|
14107
|
+
deep: true
|
|
14093
14108
|
});
|
|
14094
14109
|
function checkNumberValue() {
|
|
14095
14110
|
if (formConfig.value?.number) {
|
|
@@ -14160,31 +14175,12 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
14160
14175
|
}
|
|
14161
14176
|
}
|
|
14162
14177
|
}
|
|
14163
|
-
watch([props.list, props.tree], () => {
|
|
14164
|
-
init();
|
|
14165
|
-
}, {
|
|
14166
|
-
deep: true,
|
|
14167
|
-
immediate: true
|
|
14168
|
-
});
|
|
14169
14178
|
function init() {
|
|
14170
14179
|
initFieldName();
|
|
14171
14180
|
if (props.entity && fieldName.value) {
|
|
14172
14181
|
formConfig.value = getFormConfig(props.entity, fieldName.value);
|
|
14173
14182
|
fieldConfig.value = getFieldConfig(props.entity, fieldName.value);
|
|
14174
|
-
if (!placeholderRef.value) {
|
|
14175
|
-
const field = fieldConfig.value.label || getFieldConfig(props.entity, fieldName.value).label || fieldName;
|
|
14176
|
-
placeholderRef.value = `请输入${field}...`;
|
|
14177
|
-
if (formConfig.value) {
|
|
14178
|
-
if (dictionary.value || fieldConfig.value.dictionary || props.list || props.tree || formConfig.value.dateType !== void 0) {
|
|
14179
|
-
placeholderRef.value = WebI18n.get().SelectPlease;
|
|
14180
|
-
}
|
|
14181
|
-
if (formConfig.value.placeholder) {
|
|
14182
|
-
placeholderRef.value = formConfig.value.placeholder;
|
|
14183
|
-
}
|
|
14184
|
-
}
|
|
14185
|
-
}
|
|
14186
14183
|
}
|
|
14187
|
-
dictionary.value = props.list ? props.list : formConfig.value && fieldConfig.value?.dictionary ? fieldConfig.value.dictionary.toArray() : void 0;
|
|
14188
14184
|
if (props.modelValue === void 0 && formConfig.value?.defaultValue !== void 0) {
|
|
14189
14185
|
value.value = formConfig.value.defaultValue;
|
|
14190
14186
|
emitValue();
|