需求优先级
原能力
请当事人区分眼下最重要的需求、可以商量的要求和准备暂放的事项。(细化版 p.2–3)
首选项目
SurveyJS Form Library(MIT(Form Library))。 SurveyJS Form Library
匹配范围
Ranking 或排序问题采集本人优先级。
源码
SurveyJS Form Library · class QuestionRankingModel
packages/survey-core/src/question_ranking.ts · 23–36 行。 在 GitHub 查看源码 · 许可证与声明
源码片段
export class QuestionRankingModel extends QuestionCheckboxModel {
private domNode: HTMLElement = null;
private dragOrClickHelper: DragOrClickHelper;
constructor(name: string) {
super(name);
this.dragOrClickHelper = new DragOrClickHelper(this.startDrag);
}
protected onPropertyValueChanged(name: string, oldValue: any, newValue: any): void {
super.onPropertyValueChanged(name, oldValue, newValue);
if (name === "selectToRankEnabled") {
this.clearValue(true);
this.setDragDropRankingChoices();
this.updateRankingChoicesSync();
接口用法示意
{ type: 'ranking', name: 'priority', choices: availableOptions }
实现与验收要点
区分可商量和暂放状态,处理部分排序与情境变化。