fix: 修复管理端类型检查错误
- 为分页数据列表补充明确行类型 - 修正插件数组默认值解析的类型转换 - 删除 tinyflow 未使用辅助函数
This commit is contained in:
@@ -16,6 +16,8 @@ interface PageDataProps {
|
|||||||
requestClient?: any;
|
requestClient?: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type PageDataRow = Record<string, any>;
|
||||||
|
|
||||||
const props = withDefaults(defineProps<PageDataProps>(), {
|
const props = withDefaults(defineProps<PageDataProps>(), {
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
pageSizes: () => [10, 20, 50, 100],
|
pageSizes: () => [10, 20, 50, 100],
|
||||||
@@ -24,7 +26,7 @@ const props = withDefaults(defineProps<PageDataProps>(), {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 响应式数据
|
// 响应式数据
|
||||||
const pageList = ref([]);
|
const pageList = ref<PageDataRow[]>([]);
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const queryParams = ref<Record<string, any>>({});
|
const queryParams = ref<Record<string, any>>({});
|
||||||
|
|
||||||
@@ -83,7 +85,7 @@ const patchRowById = (
|
|||||||
patch: Record<string, any>,
|
patch: Record<string, any>,
|
||||||
): boolean => {
|
): boolean => {
|
||||||
const rowIndex = pageList.value.findIndex(
|
const rowIndex = pageList.value.findIndex(
|
||||||
(item: Record<string, any>) => String(item?.id ?? '') === String(id ?? ''),
|
(item) => String(item?.id ?? '') === String(id ?? ''),
|
||||||
);
|
);
|
||||||
if (rowIndex === -1) {
|
if (rowIndex === -1) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -162,10 +162,11 @@ const parseWorkflowNodeValue = (node: TreeTableNode): any => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const parseArrayValue = (node: TreeTableNode): any[] => {
|
const parseArrayValue = (node: TreeTableNode): any[] => {
|
||||||
if (Array.isArray(node.defaultValue as any)) {
|
const defaultValue = node.defaultValue as unknown;
|
||||||
return node.defaultValue as any[];
|
if (Array.isArray(defaultValue)) {
|
||||||
|
return defaultValue;
|
||||||
}
|
}
|
||||||
const raw = String(node.defaultValue || '').trim();
|
const raw = String(defaultValue || '').trim();
|
||||||
if (!raw) {
|
if (!raw) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -171,10 +171,6 @@ function isCollectionOutputParameter(parameter?: Parameter | null) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCollectionDisplayName(label: string) {
|
|
||||||
return label.endsWith('.[]') ? label : `${label}.[]`;
|
|
||||||
}
|
|
||||||
|
|
||||||
function buildCollectionAwareLabel(
|
function buildCollectionAwareLabel(
|
||||||
referenceLabel: string,
|
referenceLabel: string,
|
||||||
parentLabel: string,
|
parentLabel: string,
|
||||||
|
|||||||
Reference in New Issue
Block a user