主要功能: - 修改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>
122 lines
2.4 KiB
JavaScript
122 lines
2.4 KiB
JavaScript
/**
|
|
* @param {string} value
|
|
* @returns {RegExp}
|
|
* */
|
|
|
|
/**
|
|
* @param {RegExp | string } re
|
|
* @returns {string}
|
|
*/
|
|
function source(re) {
|
|
if (!re) return null;
|
|
if (typeof re === "string") return re;
|
|
|
|
return re.source;
|
|
}
|
|
|
|
/**
|
|
* @param {...(RegExp | string) } args
|
|
* @returns {string}
|
|
*/
|
|
function concat(...args) {
|
|
const joined = args.map((x) => source(x)).join("");
|
|
return joined;
|
|
}
|
|
|
|
/*
|
|
Language: HTTP
|
|
Description: HTTP request and response headers with automatic body highlighting
|
|
Author: Ivan Sagalaev <maniac@softwaremaniacs.org>
|
|
Category: common, protocols
|
|
Website: https://developer.mozilla.org/en-US/docs/Web/HTTP/Overview
|
|
*/
|
|
|
|
function http(hljs) {
|
|
const VERSION = 'HTTP/(2|1\\.[01])';
|
|
const HEADER_NAME = /[A-Za-z][A-Za-z0-9-]*/;
|
|
const HEADER = {
|
|
className: 'attribute',
|
|
begin: concat('^', HEADER_NAME, '(?=\\:\\s)'),
|
|
starts: {
|
|
contains: [
|
|
{
|
|
className: "punctuation",
|
|
begin: /: /,
|
|
relevance: 0,
|
|
starts: {
|
|
end: '$',
|
|
relevance: 0
|
|
}
|
|
}
|
|
]
|
|
}
|
|
};
|
|
const HEADERS_AND_BODY = [
|
|
HEADER,
|
|
{
|
|
begin: '\\n\\n',
|
|
starts: { subLanguage: [], endsWithParent: true }
|
|
}
|
|
];
|
|
|
|
return {
|
|
name: 'HTTP',
|
|
aliases: ['https'],
|
|
illegal: /\S/,
|
|
contains: [
|
|
// response
|
|
{
|
|
begin: '^(?=' + VERSION + " \\d{3})",
|
|
end: /$/,
|
|
contains: [
|
|
{
|
|
className: "meta",
|
|
begin: VERSION
|
|
},
|
|
{
|
|
className: 'number', begin: '\\b\\d{3}\\b'
|
|
}
|
|
],
|
|
starts: {
|
|
end: /\b\B/,
|
|
illegal: /\S/,
|
|
contains: HEADERS_AND_BODY
|
|
}
|
|
},
|
|
// request
|
|
{
|
|
begin: '(?=^[A-Z]+ (.*?) ' + VERSION + '$)',
|
|
end: /$/,
|
|
contains: [
|
|
{
|
|
className: 'string',
|
|
begin: ' ',
|
|
end: ' ',
|
|
excludeBegin: true,
|
|
excludeEnd: true
|
|
},
|
|
{
|
|
className: "meta",
|
|
begin: VERSION
|
|
},
|
|
{
|
|
className: 'keyword',
|
|
begin: '[A-Z]+'
|
|
}
|
|
],
|
|
starts: {
|
|
end: /\b\B/,
|
|
illegal: /\S/,
|
|
contains: HEADERS_AND_BODY
|
|
}
|
|
},
|
|
// to allow headers to work even without a preamble
|
|
hljs.inherit(HEADER, {
|
|
relevance: 0
|
|
})
|
|
]
|
|
};
|
|
}
|
|
|
|
module.exports = http;
|