@airpower/web 1.5.6 → 1.5.8
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/i18n/WebI18n.d.ts +1 -0
- package/dist/main.js +23 -19
- package/package.json +1 -1
package/dist/i18n/WebI18n.d.ts
CHANGED
package/dist/main.js
CHANGED
|
@@ -2165,6 +2165,7 @@ class WebI18n extends I18n {
|
|
|
2165
2165
|
AddSuccess = "添加成功";
|
|
2166
2166
|
DeleteSuccess = "删除成功";
|
|
2167
2167
|
SelectPlease = "请选择";
|
|
2168
|
+
InputPlease = "请输入";
|
|
2168
2169
|
DisableSuccess = "禁用成功";
|
|
2169
2170
|
EnableSuccess = "启用成功";
|
|
2170
2171
|
Confirm = "确定";
|
|
@@ -14035,9 +14036,11 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
14035
14036
|
emits("clear");
|
|
14036
14037
|
}
|
|
14037
14038
|
const isClearButtonShow = ref(props.showClear);
|
|
14039
|
+
const placeholderRef = ref(props.placeholder);
|
|
14038
14040
|
const formConfig = ref(void 0);
|
|
14039
14041
|
const fieldConfig = ref(void 0);
|
|
14040
14042
|
const fieldName = ref("");
|
|
14043
|
+
const dictionary = ref(void 0);
|
|
14041
14044
|
function onPropsValueUpdated(newProps) {
|
|
14042
14045
|
if (newProps) {
|
|
14043
14046
|
if (newProps.disabled) {
|
|
@@ -14066,9 +14069,6 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
14066
14069
|
}
|
|
14067
14070
|
return DateTimeFormatter.FULL_DATE_TIME;
|
|
14068
14071
|
});
|
|
14069
|
-
const dictionary = computed(() => {
|
|
14070
|
-
return props.list ? props.list : formConfig.value && fieldConfig.value?.dictionary ? fieldConfig.value.dictionary.toArray() : void 0;
|
|
14071
|
-
});
|
|
14072
14072
|
function getSwitchColor(status) {
|
|
14073
14073
|
return dictionary.value?.find((item) => !!item.key === status)?.color || "";
|
|
14074
14074
|
}
|
|
@@ -14160,33 +14160,37 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
14160
14160
|
}
|
|
14161
14161
|
}
|
|
14162
14162
|
}
|
|
14163
|
+
watch([props.list, props.tree], () => {
|
|
14164
|
+
init();
|
|
14165
|
+
}, {
|
|
14166
|
+
deep: true,
|
|
14167
|
+
immediate: true
|
|
14168
|
+
});
|
|
14163
14169
|
function init() {
|
|
14164
14170
|
initFieldName();
|
|
14165
14171
|
if (props.entity && fieldName.value) {
|
|
14166
14172
|
formConfig.value = getFormConfig(props.entity, fieldName.value);
|
|
14167
14173
|
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
|
+
}
|
|
14168
14186
|
}
|
|
14187
|
+
dictionary.value = props.list ? props.list : formConfig.value && fieldConfig.value?.dictionary ? fieldConfig.value.dictionary.toArray() : void 0;
|
|
14169
14188
|
if (props.modelValue === void 0 && formConfig.value?.defaultValue !== void 0) {
|
|
14170
14189
|
value.value = formConfig.value.defaultValue;
|
|
14171
14190
|
emitValue();
|
|
14172
14191
|
}
|
|
14173
14192
|
onPropsValueUpdated(props);
|
|
14174
14193
|
}
|
|
14175
|
-
const placeholderRef = computed(() => {
|
|
14176
|
-
if (fieldConfig.value && props.entity) {
|
|
14177
|
-
if (formConfig.value) {
|
|
14178
|
-
if (dictionary.value || fieldConfig.value?.dictionary || props.list || props.tree || formConfig.value.dateType !== void 0) {
|
|
14179
|
-
return WebI18n.get().SelectPlease;
|
|
14180
|
-
}
|
|
14181
|
-
if (formConfig.value.placeholder) {
|
|
14182
|
-
return formConfig.value.placeholder;
|
|
14183
|
-
}
|
|
14184
|
-
}
|
|
14185
|
-
const field = fieldConfig.value.label || getFieldConfig(props.entity, fieldName.value).label || fieldName;
|
|
14186
|
-
return `请输入${field}...`;
|
|
14187
|
-
}
|
|
14188
|
-
return props.placeholder || "请输入...";
|
|
14189
|
-
});
|
|
14190
14194
|
const slots = useSlots();
|
|
14191
14195
|
init();
|
|
14192
14196
|
return (_ctx, _cache) => {
|
|
@@ -14237,7 +14241,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
14237
14241
|
onFocus: emitFocus,
|
|
14238
14242
|
onKeydown: onKeyDown
|
|
14239
14243
|
}, null, 8, ["modelValue", "clearable", "disabled", "format", "placeholder", "prefix-icon", "readonly", "suffix-icon", "value-format"]))
|
|
14240
|
-
], 64)) : dictionary.value ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
14244
|
+
], 64)) : __props.list || dictionary.value ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
14241
14245
|
formConfig.value?.switch ? (openBlock(), createBlock(_component_el_switch, {
|
|
14242
14246
|
key: 0,
|
|
14243
14247
|
modelValue: value.value,
|