feat: 完善 Prompt 管理与生成流程配置

This commit is contained in:
王鹏
2026-07-15 17:31:13 +08:00
parent 84d3c8fc05
commit de98ea59b1
93 changed files with 3474 additions and 980 deletions

View File

@@ -0,0 +1,32 @@
const dictData = {}
const emptyDict = []
function normalizeOptions(options) {
if (!Array.isArray(options)) {
return emptyDict
}
return options.map((option) => {
const label = option.label || option.name || option.value
const value = option.value || label
return {
...option,
label,
name: option.name || label,
value
}
})
}
export default {
getDictDataByType(type) {
return normalizeOptions(dictData[type])
},
getDictLabel(type, value) {
if (value === undefined || value === null || value === "") {
return "-"
}
const matched = normalizeOptions(dictData[type]).find((option) => String(option.value) === String(value))
return matched ? matched.label : value
}
}

View File

@@ -0,0 +1,6 @@
const page = { data: { records: [], total: 0 } }
export default {
get() { return Promise.resolve(page) },
post(path) { return Promise.resolve(path === '/auth/login' ? { code: '200', data: { token: 'preview-token', user: { displayName: 'Preview User' } } } : { code: '200' }) },
delete() { return Promise.resolve({ code: '200' }) }
}