Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 新增题目优化 #443

Merged
merged 1 commit into from
Oct 31, 2024
Merged

Conversation

Liang-Yaxin
Copy link
Contributor

改动内容

未选中任何题目的前提下,点击左侧题型或者拖动题目到中间画布时,需要选中当前新增的题目

Issue

#182

@skique skique merged commit f6202d4 into didi:develop Oct 31, 2024
1 check passed
@puppet-666
Copy link

pr里有些小问题:
1、 web/src/management/pages/edit/modules/questionModule/components/TypeList.vue 这行代码设置完之后点击标题是无法变成编辑态的,和标题挂载后手动添加click事件有关,需要setTimeout
2、https://github.com/didi/xiaoju-survey/pull/443/files#diff-2c8466657d28006efc4467165bb632c7d82edd6c359417b7bc6c0f1822de5cdaR75 使用 event.newIndex 在多页的情况下就会失效且存在问题(阻止题目分页器的页数删除)
@Liang-Yaxin

@puppet-666
Copy link

puppet-666 commented Nov 1, 2024

const { getSorter} = editStore;
const onQuestionType = ({ type }) => {
  const newQuestion = createNewQuestion({ type });
  addQuestion({ question: newQuestion, index: newQuestionIndex.value });
  const { endIndex } = getSorter();
  console.log(endIndex);
  setTimeout(() => {
    setCurrentEditOne(endIndex - 1);
  });
};

const onDragEnd = (event) => {
  const { startIndex } = getSorter();
  setCurrentEditOne(schema.pageEditOne === 1 ? event.newIndex : startIndex + event.newIndex);
};

使用 getSorter 进行当前下标取值会更稳妥

@Liang-Yaxin
Copy link
Contributor Author

了解我马上修改一下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants