Files
Yep_Q 67f5dfbe50 feat: 实现多订单班支持系统
主要功能:
- 修改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>
2025-09-29 10:02:15 +08:00

98 lines
2.3 KiB
JavaScript

/**
* @import {Schema} from 'property-information'
*/
import {DefinedInfo} from './util/defined-info.js'
import {Info} from './util/info.js'
import {normalize} from './normalize.js'
const cap = /[A-Z]/g
const dash = /-[a-z]/g
const valid = /^data[-\w.:]+$/i
/**
* Look up info on a property.
*
* In most cases the given `schema` contains info on the property.
* All standard,
* most legacy,
* and some non-standard properties are supported.
* For these cases,
* the returned `Info` has hints about the value of the property.
*
* `name` can also be a valid data attribute or property,
* in which case an `Info` object with the correctly cased `attribute` and
* `property` is returned.
*
* `name` can be an unknown attribute,
* in which case an `Info` object with `attribute` and `property` set to the
* given name is returned.
* It is not recommended to provide unsupported legacy or recently specced
* properties.
*
*
* @param {Schema} schema
* Schema;
* either the `html` or `svg` export.
* @param {string} value
* An attribute-like or property-like name;
* it will be passed through `normalize` to hopefully find the correct info.
* @returns {Info}
* Info.
*/
export function find(schema, value) {
const normal = normalize(value)
let property = value
let Type = Info
if (normal in schema.normal) {
return schema.property[schema.normal[normal]]
}
if (normal.length > 4 && normal.slice(0, 4) === 'data' && valid.test(value)) {
// Attribute or property.
if (value.charAt(4) === '-') {
// Turn it into a property.
const rest = value.slice(5).replace(dash, camelcase)
property = 'data' + rest.charAt(0).toUpperCase() + rest.slice(1)
} else {
// Turn it into an attribute.
const rest = value.slice(4)
if (!dash.test(rest)) {
let dashes = rest.replace(cap, kebab)
if (dashes.charAt(0) !== '-') {
dashes = '-' + dashes
}
value = 'data' + dashes
}
}
Type = DefinedInfo
}
return new Type(property, value)
}
/**
* @param {string} $0
* Value.
* @returns {string}
* Kebab.
*/
function kebab($0) {
return '-' + $0.toLowerCase()
}
/**
* @param {string} $0
* Value.
* @returns {string}
* Camel.
*/
function camelcase($0) {
return $0.charAt(1).toUpperCase()
}