chore(lint): 升级检查依赖并统一格式化与提交规范
This commit is contained in:
@@ -229,7 +229,7 @@ const aiChangedCount = computed(() => Object.keys(props.aiChanges ?? {}).length)
|
||||
const visibleFields = computed(() => {
|
||||
if (!onlyAiChanged.value) return fieldConfigs.value;
|
||||
return fieldConfigs.value.filter(
|
||||
(row) => row.columnName && props.aiChanges?.[row.columnName]?.length
|
||||
(row) => row.columnName && props.aiChanges?.[row.columnName]?.length,
|
||||
);
|
||||
});
|
||||
|
||||
@@ -269,7 +269,7 @@ async function locateField(columnName: string) {
|
||||
await nextTick();
|
||||
const cards = listRef.value?.querySelectorAll<HTMLElement>(".field-card");
|
||||
const target = Array.from(cards ?? []).find(
|
||||
(card) => card.querySelector(".field-column")?.textContent?.trim() === columnName
|
||||
(card) => card.querySelector(".field-column")?.textContent?.trim() === columnName,
|
||||
);
|
||||
if (!target) return;
|
||||
target.scrollIntoView({ behavior: "smooth", block: "center" });
|
||||
|
||||
@@ -366,7 +366,7 @@ async function handlePrev() {
|
||||
loading.value = true;
|
||||
try {
|
||||
genConfigFormData.value = applyDefaults(
|
||||
await GeneratorAPI.getGenConfig(currentTableName.value)
|
||||
await GeneratorAPI.getGenConfig(currentTableName.value),
|
||||
);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
|
||||
@@ -103,7 +103,7 @@ export function diffGenConfig(before: GenConfigForm, after: GenConfigForm): AiFi
|
||||
}
|
||||
|
||||
const beforeFields = new Map(
|
||||
(before.fieldConfigs ?? []).map((field) => [field.columnName, field])
|
||||
(before.fieldConfigs ?? []).map((field) => [field.columnName, field]),
|
||||
);
|
||||
(after.fieldConfigs ?? []).forEach((field) => {
|
||||
const origin = beforeFields.get(field.columnName);
|
||||
@@ -148,8 +148,8 @@ export function useAiFillDiff() {
|
||||
fieldChangeCount: field.changes.length,
|
||||
first: index === 0,
|
||||
...item,
|
||||
}))
|
||||
)
|
||||
})),
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
@@ -46,8 +46,8 @@ export function useCodePreview(genConfigFormData: Ref<GenConfigForm>) {
|
||||
new Set(
|
||||
previewList
|
||||
.map((item) => item.language || item.fileName.split(".").pop() || "")
|
||||
.filter(Boolean)
|
||||
)
|
||||
.filter(Boolean),
|
||||
),
|
||||
);
|
||||
previewTypeOptions.value = typeOptions;
|
||||
previewTypes.value = [...typeOptions];
|
||||
@@ -104,7 +104,7 @@ export function useCodePreview(genConfigFormData: Ref<GenConfigForm>) {
|
||||
currentFileKey.value = first.key || "";
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
{ immediate: true },
|
||||
);
|
||||
|
||||
return {
|
||||
|
||||
@@ -39,7 +39,7 @@ export function useGenConfig() {
|
||||
.map((s) => s.charAt(0).toUpperCase() + s.slice(1))
|
||||
.join("");
|
||||
genConfigFormData.value.entityName = camel;
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
// 日期类型字段默认用范围查询,比较符合直觉
|
||||
@@ -59,7 +59,7 @@ export function useGenConfig() {
|
||||
}
|
||||
});
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
{ deep: true, immediate: true },
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
@@ -19,10 +19,10 @@ export function useLocalWrite(genConfigFormData: Ref<GenConfigForm>) {
|
||||
const lastPreviewFiles = ref<GeneratorPreviewItem[]>([]);
|
||||
|
||||
const needFrontend = computed(() =>
|
||||
lastPreviewFiles.value.some((f) => resolveRootForItem(f) === "frontend")
|
||||
lastPreviewFiles.value.some((f) => resolveRootForItem(f) === "frontend"),
|
||||
);
|
||||
const needBackend = computed(() =>
|
||||
lastPreviewFiles.value.some((f) => resolveRootForItem(f) === "backend")
|
||||
lastPreviewFiles.value.some((f) => resolveRootForItem(f) === "backend"),
|
||||
);
|
||||
// 只要有预览文件就可以点写入按钮,目录在弹窗里选
|
||||
const canWriteToLocal = computed(() => lastPreviewFiles.value.length > 0);
|
||||
@@ -116,7 +116,7 @@ export function useLocalWrite(genConfigFormData: Ref<GenConfigForm>) {
|
||||
async function writeFileToDir(
|
||||
dirHandle: FileSystemDirectoryHandle,
|
||||
filePath: string,
|
||||
content: string
|
||||
content: string,
|
||||
) {
|
||||
const normalized = filePath.replace(/\\/g, "/");
|
||||
const parts = normalized.split("/").filter(Boolean);
|
||||
@@ -134,7 +134,7 @@ export function useLocalWrite(genConfigFormData: Ref<GenConfigForm>) {
|
||||
*/
|
||||
async function pathExists(
|
||||
dirHandle: FileSystemDirectoryHandle,
|
||||
filePath: string
|
||||
filePath: string,
|
||||
): Promise<boolean> {
|
||||
try {
|
||||
const normalized = filePath.replace(/\\/g, "/");
|
||||
@@ -155,7 +155,7 @@ export function useLocalWrite(genConfigFormData: Ref<GenConfigForm>) {
|
||||
async function isSameFile(
|
||||
dirHandle: FileSystemDirectoryHandle,
|
||||
filePath: string,
|
||||
content: string
|
||||
content: string,
|
||||
): Promise<boolean> {
|
||||
try {
|
||||
const normalized = filePath.replace(/\\/g, "/");
|
||||
@@ -199,7 +199,7 @@ export function useLocalWrite(genConfigFormData: Ref<GenConfigForm>) {
|
||||
const failed: string[] = [];
|
||||
|
||||
const files = lastPreviewFiles.value.filter(
|
||||
(f) => writeScope.value === "all" || resolveRootForItem(f) === writeScope.value
|
||||
(f) => writeScope.value === "all" || resolveRootForItem(f) === writeScope.value,
|
||||
);
|
||||
writeProgress.total = files.length;
|
||||
writeProgress.done = 0;
|
||||
@@ -256,7 +256,7 @@ export function useLocalWrite(genConfigFormData: Ref<GenConfigForm>) {
|
||||
|
||||
if (failed.length) {
|
||||
ElMessage.warning(
|
||||
`部分文件写入失败 ${failed.length} 个,成功 前端 ${frontCount} 个,后端 ${backCount} 个`
|
||||
`部分文件写入失败 ${failed.length} 个,成功 前端 ${frontCount} 个,后端 ${backCount} 个`,
|
||||
);
|
||||
} else {
|
||||
ElMessage.success(`写入完成:前端 ${frontCount} 个文件,后端 ${backCount} 个文件`);
|
||||
|
||||
@@ -103,7 +103,7 @@ export function getFileIcon(node: TreeNode): string {
|
||||
export function filterTree(
|
||||
nodes: TreeNode[],
|
||||
scope: "all" | "frontend" | "backend",
|
||||
types: string[]
|
||||
types: string[],
|
||||
): TreeNode[] {
|
||||
/**
|
||||
* 判断节点是否命中当前筛选
|
||||
|
||||
Reference in New Issue
Block a user