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>
This commit is contained in:
Yep_Q
2025-09-29 10:02:15 +08:00
parent beb1ba38fa
commit 67f5dfbe50
16617 changed files with 2330301 additions and 1128 deletions

View File

@@ -0,0 +1,82 @@
import { supportsScrollTimeline } from '../../utils/supports/scroll-timeline.mjs';
class BaseGroupPlaybackControls {
constructor(animations) {
// Bound to accomodate common `return animation.stop` pattern
this.stop = () => this.runAll("stop");
this.animations = animations.filter(Boolean);
}
get finished() {
// Support for new finished Promise and legacy thennable API
return Promise.all(this.animations.map((animation) => "finished" in animation ? animation.finished : animation));
}
/**
* TODO: Filter out cancelled or stopped animations before returning
*/
getAll(propName) {
return this.animations[0][propName];
}
setAll(propName, newValue) {
for (let i = 0; i < this.animations.length; i++) {
this.animations[i][propName] = newValue;
}
}
attachTimeline(timeline, fallback) {
const subscriptions = this.animations.map((animation) => {
if (supportsScrollTimeline() && animation.attachTimeline) {
return animation.attachTimeline(timeline);
}
else if (typeof fallback === "function") {
return fallback(animation);
}
});
return () => {
subscriptions.forEach((cancel, i) => {
cancel && cancel();
this.animations[i].stop();
});
};
}
get time() {
return this.getAll("time");
}
set time(time) {
this.setAll("time", time);
}
get speed() {
return this.getAll("speed");
}
set speed(speed) {
this.setAll("speed", speed);
}
get startTime() {
return this.getAll("startTime");
}
get duration() {
let max = 0;
for (let i = 0; i < this.animations.length; i++) {
max = Math.max(max, this.animations[i].duration);
}
return max;
}
runAll(methodName) {
this.animations.forEach((controls) => controls[methodName]());
}
flatten() {
this.runAll("flatten");
}
play() {
this.runAll("play");
}
pause() {
this.runAll("pause");
}
cancel() {
this.runAll("cancel");
}
complete() {
this.runAll("complete");
}
}
export { BaseGroupPlaybackControls };

View File

@@ -0,0 +1,13 @@
import { BaseGroupPlaybackControls } from './BaseGroup.mjs';
/**
* TODO: This is a temporary class to support the legacy
* thennable API
*/
class GroupPlaybackControls extends BaseGroupPlaybackControls {
then(onResolve, onReject) {
return Promise.all(this.animations).then(onResolve).catch(onReject);
}
}
export { GroupPlaybackControls };

View File

@@ -0,0 +1,17 @@
/**
* Implement a practical max duration for keyframe generation
* to prevent infinite loops
*/
const maxGeneratorDuration = 20000;
function calcGeneratorDuration(generator) {
let duration = 0;
const timeStep = 50;
let state = generator.next(duration);
while (!state.done && duration < maxGeneratorDuration) {
duration += timeStep;
state = generator.next(duration);
}
return duration >= maxGeneratorDuration ? Infinity : duration;
}
export { calcGeneratorDuration, maxGeneratorDuration };

View File

@@ -0,0 +1,19 @@
import { millisecondsToSeconds } from 'motion-utils';
import { calcGeneratorDuration, maxGeneratorDuration } from './calc-duration.mjs';
/**
* Create a progress => progress easing function from a generator.
*/
function createGeneratorEasing(options, scale = 100, createGenerator) {
const generator = createGenerator({ ...options, keyframes: [0, scale] });
const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);
return {
type: "keyframes",
ease: (progress) => {
return generator.next(duration * progress).value / scale;
},
duration: millisecondsToSeconds(duration),
};
}
export { createGeneratorEasing };

View File

@@ -0,0 +1,5 @@
function isGenerator(type) {
return typeof type === "function";
}
export { isGenerator };

View File

@@ -0,0 +1,9 @@
function getValueTransition(transition, key) {
return transition
? transition[key] ||
transition["default"] ||
transition
: undefined;
}
export { getValueTransition };

View File

@@ -0,0 +1,83 @@
import { millisecondsToSeconds, secondsToMilliseconds, noop } from 'motion-utils';
import { attachTimeline } from './utils/attach-timeline.mjs';
class NativeAnimationControls {
constructor(animation) {
this.animation = animation;
}
get duration() {
var _a, _b, _c;
const durationInMs = ((_b = (_a = this.animation) === null || _a === void 0 ? void 0 : _a.effect) === null || _b === void 0 ? void 0 : _b.getComputedTiming().duration) ||
((_c = this.options) === null || _c === void 0 ? void 0 : _c.duration) ||
300;
return millisecondsToSeconds(Number(durationInMs));
}
get time() {
var _a;
if (this.animation) {
return millisecondsToSeconds(((_a = this.animation) === null || _a === void 0 ? void 0 : _a.currentTime) || 0);
}
return 0;
}
set time(newTime) {
if (this.animation) {
this.animation.currentTime = secondsToMilliseconds(newTime);
}
}
get speed() {
return this.animation ? this.animation.playbackRate : 1;
}
set speed(newSpeed) {
if (this.animation) {
this.animation.playbackRate = newSpeed;
}
}
get state() {
return this.animation ? this.animation.playState : "finished";
}
get startTime() {
return this.animation ? this.animation.startTime : null;
}
get finished() {
return this.animation ? this.animation.finished : Promise.resolve();
}
play() {
this.animation && this.animation.play();
}
pause() {
this.animation && this.animation.pause();
}
stop() {
if (!this.animation ||
this.state === "idle" ||
this.state === "finished") {
return;
}
if (this.animation.commitStyles) {
this.animation.commitStyles();
}
this.cancel();
}
flatten() {
var _a;
if (!this.animation)
return;
(_a = this.animation.effect) === null || _a === void 0 ? void 0 : _a.updateTiming({ easing: "linear" });
}
attachTimeline(timeline) {
if (this.animation)
attachTimeline(this.animation, timeline);
return noop;
}
complete() {
this.animation && this.animation.finish();
}
cancel() {
try {
this.animation && this.animation.cancel();
}
catch (e) { }
}
}
export { NativeAnimationControls };

View File

@@ -0,0 +1,15 @@
import { NativeAnimationControls } from './NativeAnimationControls.mjs';
import { convertMotionOptionsToNative } from './utils/convert-options.mjs';
class PseudoAnimation extends NativeAnimationControls {
constructor(target, pseudoElement, valueName, keyframes, options) {
const animationOptions = convertMotionOptionsToNative(valueName, keyframes, options);
const animation = target.animate(animationOptions.keyframes, {
pseudoElement,
...animationOptions.options,
});
super(animation);
}
}
export { PseudoAnimation };

View File

@@ -0,0 +1,6 @@
function attachTimeline(animation, timeline) {
animation.timeline = timeline;
animation.onfinish = null;
}
export { attachTimeline };

View File

@@ -0,0 +1,55 @@
import { secondsToMilliseconds } from 'motion-utils';
import { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';
import { createGeneratorEasing } from '../../generators/utils/create-generator-easing.mjs';
import { isGenerator } from '../../generators/utils/is-generator.mjs';
import { mapEasingToNativeEasing } from './easing.mjs';
const defaultEasing = "easeOut";
function applyGeneratorOptions(options) {
var _a;
if (isGenerator(options.type)) {
const generatorOptions = createGeneratorEasing(options, 100, options.type);
options.ease = supportsLinearEasing()
? generatorOptions.ease
: defaultEasing;
options.duration = secondsToMilliseconds(generatorOptions.duration);
options.type = "keyframes";
}
else {
options.duration = secondsToMilliseconds((_a = options.duration) !== null && _a !== void 0 ? _a : 0.3);
options.ease = options.ease || defaultEasing;
}
}
// TODO: Reuse for NativeAnimation
function convertMotionOptionsToNative(valueName, keyframes, options) {
var _a;
const nativeKeyframes = {};
const nativeOptions = {
fill: "both",
easing: "linear",
composite: "replace",
};
nativeOptions.delay = secondsToMilliseconds((_a = options.delay) !== null && _a !== void 0 ? _a : 0);
applyGeneratorOptions(options);
nativeOptions.duration = options.duration;
const { ease, times } = options;
if (times)
nativeKeyframes.offset = times;
nativeKeyframes[valueName] = keyframes;
const easing = mapEasingToNativeEasing(ease, options.duration);
/**
* If this is an easing array, apply to keyframes, not animation as a whole
*/
if (Array.isArray(easing)) {
nativeKeyframes.easing = easing;
}
else {
nativeOptions.easing = easing;
}
return {
keyframes: nativeKeyframes,
options: nativeOptions,
};
}
export { applyGeneratorOptions, convertMotionOptionsToNative };

View File

@@ -0,0 +1,44 @@
import { isBezierDefinition } from '../../../utils/is-bezier-definition.mjs';
import { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';
import { generateLinearEasing } from './linear.mjs';
function isWaapiSupportedEasing(easing) {
return Boolean((typeof easing === "function" && supportsLinearEasing()) ||
!easing ||
(typeof easing === "string" &&
(easing in supportedWaapiEasing || supportsLinearEasing())) ||
isBezierDefinition(easing) ||
(Array.isArray(easing) && easing.every(isWaapiSupportedEasing)));
}
const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`;
const supportedWaapiEasing = {
linear: "linear",
ease: "ease",
easeIn: "ease-in",
easeOut: "ease-out",
easeInOut: "ease-in-out",
circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]),
circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]),
backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]),
backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]),
};
function mapEasingToNativeEasing(easing, duration) {
if (!easing) {
return undefined;
}
else if (typeof easing === "function" && supportsLinearEasing()) {
return generateLinearEasing(easing, duration);
}
else if (isBezierDefinition(easing)) {
return cubicBezierAsString(easing);
}
else if (Array.isArray(easing)) {
return easing.map((segmentEasing) => mapEasingToNativeEasing(segmentEasing, duration) ||
supportedWaapiEasing.easeOut);
}
else {
return supportedWaapiEasing[easing];
}
}
export { cubicBezierAsString, isWaapiSupportedEasing, mapEasingToNativeEasing, supportedWaapiEasing };

View File

@@ -0,0 +1,14 @@
import { progress } from 'motion-utils';
const generateLinearEasing = (easing, duration, // as milliseconds
resolution = 10 // as milliseconds
) => {
let points = "";
const numPoints = Math.max(Math.round(duration / resolution), 2);
for (let i = 0; i < numPoints; i++) {
points += easing(progress(0, numPoints - 1, i)) + ", ";
}
return `linear(${points.substring(0, points.length - 2)})`;
};
export { generateLinearEasing };