主要功能: - 修改RequirementModal支持12个订单班选择 - 添加OrderClassIconMap图标映射组件 - Store中添加selectedOrderClass状态管理 - WorkflowPage支持传递orderClass参数 - web_result添加URL参数切换功能 - 创建order-class-handler.js动态处理页面主题 技术改进: - 创建软链接关联订单班数据目录 - 生成wenlu.json和food.json数据结构 - 删除重复的web_result目录 - 添加测试页面test-order-class.html 影响范围: - 展会策划系统现支持12个订单班 - 结果展示页面自动适配不同订单班主题 - 用户可选择不同行业生成对应方案 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
35 lines
984 B
JavaScript
35 lines
984 B
JavaScript
let random = async bytes => crypto.getRandomValues(new Uint8Array(bytes))
|
|
let customAlphabet = (alphabet, defaultSize = 21) => {
|
|
let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1
|
|
let step = -~((1.6 * mask * defaultSize) / alphabet.length)
|
|
return async (size = defaultSize) => {
|
|
let id = ''
|
|
while (true) {
|
|
let bytes = crypto.getRandomValues(new Uint8Array(step))
|
|
let i = step | 0
|
|
while (i--) {
|
|
id += alphabet[bytes[i] & mask] || ''
|
|
if (id.length === size) return id
|
|
}
|
|
}
|
|
}
|
|
}
|
|
let nanoid = async (size = 21) => {
|
|
let id = ''
|
|
let bytes = crypto.getRandomValues(new Uint8Array((size |= 0)))
|
|
while (size--) {
|
|
let byte = bytes[size] & 63
|
|
if (byte < 36) {
|
|
id += byte.toString(36)
|
|
} else if (byte < 62) {
|
|
id += (byte - 26).toString(36).toUpperCase()
|
|
} else if (byte < 63) {
|
|
id += '_'
|
|
} else {
|
|
id += '-'
|
|
}
|
|
}
|
|
return id
|
|
}
|
|
export { nanoid, customAlphabet, random }
|