天翼支持家庭云

This commit is contained in:
King committed 2026-07-29 18:40:45 +08:00
1 parent 85922d5c2e
commit 8bcfa7df2f
169 files changed
+568 -102

No files matched your search

+2
View File
@@ -24,6 +24,8 @@ export interface FieldSchema {
options?: FieldOption[];
full_width?: boolean;
pair_key?: string;
default_by?: string;
defaults?: Record<string, string>;
}
export interface DriverInfo {
+12 -1
View File
@@ -16,7 +16,18 @@ const browseOpen = ref(false);
const browseField = ref("");
function setField(name: string, value: unknown) {
emit("update:modelValue", { ...props.modelValue, [name]: value });
const next = { ...props.modelValue, [name]: value };
const previousKey = String(props.modelValue[name] ?? "");
const nextKey = String(value ?? "");
for (const field of props.fields) {
if (field.default_by !== name || !field.defaults || !(nextKey in field.defaults)) continue;
const current = String(props.modelValue[field.name] ?? "").trim();
const previousDefault = field.defaults[previousKey];
if (!current || current === previousDefault || current === field.default) {
next[field.name] = field.defaults[nextKey];
}
}
emit("update:modelValue", next);
}
function selectOptions(f: FieldSchema) {