| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082 |
- <template>
- <div class="topic-discussion-config">
- <!-- 滚动内容区域 -->
- <div class="config-scroll">
- <!-- 主配置卡片 -->
- <div class="config-card">
- <!-- 1. 讨论话题 -->
- <div class="form-group">
- <label class="form-label">{{ lang.ssDiscussionTopic }}</label>
- <input
- type="text"
- :value="store.config.topic"
- @input="store.updateTopic(($event.target as HTMLInputElement).value)"
- class="form-input"
- :placeholder="lang.ssEnterTopic as string"
- />
- </div>
- <!-- 2. 学习目标 -->
- <div class="form-group">
- <button class="section-toggle" @click="learningGoalsExpanded = !learningGoalsExpanded">
- <span class="section-toggle-label">{{ lang.ssLearningGoals }}</span>
- <svg
- class="section-toggle-arrow"
- :class="{ collapsed: !learningGoalsExpanded }"
- width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
- >
- <path d="M6 9l6 6 6-6" />
- </svg>
- </button>
- <div v-if="learningGoalsExpanded" class="learning-goals-body">
- <!-- 练习词汇 -->
- <div class="sub-section">
- <div class="sub-section-header">
- <span class="sub-label">{{ lang.ssPracticeVocabulary }}</span>
- <div v-if="!isAddingVocab" class="sub-actions">
- <button class="icon-btn" @click="isAddingVocab = true" title="添加词汇">
- <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
- <line x1="12" y1="5" x2="12" y2="19" /><line x1="5" y1="12" x2="19" y2="12" />
- </svg>
- </button>
- <button class="icon-btn" @click="showBatchPaste = true" :title="lang.ssBatchPaste as string">
- <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
- <path d="M16 4h2a2 2 0 012 2v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2h2" />
- <rect x="8" y="2" width="8" height="4" rx="1" ry="1" />
- </svg>
- </button>
- </div>
- </div>
- <div class="vocab-tags">
- <span
- v-for="(word, index) in store.config.learningGoals.vocabulary"
- :key="index"
- class="vocab-tag"
- >
- {{ word }}
- <button class="tag-remove" @click="store.removeVocabulary(index)">
- <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
- <line x1="18" y1="6" x2="6" y2="18" /><line x1="6" y1="6" x2="18" y2="18" />
- </svg>
- </button>
- </span>
- <input
- v-if="isAddingVocab"
- ref="vocabInputRef"
- v-model="newVocab"
- class="vocab-inline-input"
- :placeholder="lang.ssAddWord as string"
- @keydown.enter="handleAddVocab"
- @keydown.escape="cancelAddVocab"
- @blur="handleAddVocabBlur"
- />
- </div>
- </div>
- <!-- 练习句型 -->
- <div class="sub-section">
- <div class="sub-section-header">
- <span class="sub-label">{{ lang.ssPracticeSentences }}</span>
- <div v-if="!isAddingSentence" class="sub-actions">
- <button class="icon-btn" @click="isAddingSentence = true" title="添加句型">
- <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
- <line x1="12" y1="5" x2="12" y2="19" /><line x1="5" y1="12" x2="19" y2="12" />
- </svg>
- </button>
- <button class="icon-btn" @click="showBatchPaste = true" :title="lang.ssBatchPaste as string">
- <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
- <path d="M16 4h2a2 2 0 012 2v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2h2" />
- <rect x="8" y="2" width="8" height="4" rx="1" ry="1" />
- </svg>
- </button>
- </div>
- </div>
- <div class="sentence-list">
- <div
- v-for="(sentence, index) in store.config.learningGoals.sentences"
- :key="index"
- >
- <!-- 编辑模式 -->
- <input
- v-if="editingSentenceIndex === index"
- v-model="editingSentenceValue"
- class="sentence-edit-input"
- @keydown.enter="handleSaveEditSentence"
- @keydown.escape="cancelEditSentence"
- @blur="handleSaveEditSentenceBlur"
- />
- <!-- 展示模式 -->
- <div v-else class="sentence-item" @dblclick="handleEditSentence(index)">
- <span class="sentence-text">{{ sentence }}</span>
- <button class="sentence-remove" @click="store.removeSentence(index)">
- <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
- <line x1="18" y1="6" x2="6" y2="18" /><line x1="6" y1="6" x2="18" y2="18" />
- </svg>
- </button>
- </div>
- </div>
- <input
- v-if="isAddingSentence"
- ref="sentenceInputRef"
- v-model="newSentence"
- class="sentence-edit-input"
- :placeholder="lang.ssAddSentence as string"
- @keydown.enter="handleAddSentence"
- @keydown.escape="cancelAddSentence"
- @blur="handleAddSentenceBlur"
- />
- </div>
- </div>
- </div>
- </div>
- <!-- 分割线 -->
- <div class="config-divider"></div>
- <!-- 3. 练习方式 -->
- <div class="form-group">
- <label class="sub-label">{{ lang.ssPracticeMode }}</label>
- <div class="mode-tabs">
- <button
- class="mode-tab"
- :class="{ active: store.config.practice.mode === 'time' }"
- @click="store.updatePracticeMode('time')"
- >
- {{ lang.ssTimeLimit }}
- </button>
- <button
- class="mode-tab"
- :class="{ active: store.config.practice.mode === 'rounds' }"
- @click="store.updatePracticeMode('rounds')"
- >
- {{ lang.ssRoundLimit }}
- </button>
- </div>
- </div>
- <!-- 滑块 -->
- <div class="form-group slider-group">
- <template v-if="store.config.practice.mode === 'time'">
- <input
- type="range"
- :value="store.config.practice.duration"
- min="1" max="60" step="1"
- class="config-slider"
- @input="store.updateDuration(Number(($event.target as HTMLInputElement).value))"
- />
- <div class="slider-labels">
- <span class="slider-min">1 {{ lang.ssMinute }}</span>
- <span class="slider-value">{{ store.config.practice.duration }} {{ lang.ssMinute }}</span>
- <span class="slider-max">60 {{ lang.ssMinute }}</span>
- </div>
- </template>
- <template v-else>
- <input
- type="range"
- :value="store.config.practice.rounds"
- min="1" max="60" step="1"
- class="config-slider"
- @input="store.updateRounds(Number(($event.target as HTMLInputElement).value))"
- />
- <div class="slider-labels">
- <span class="slider-min">1 {{ lang.ssRound }}</span>
- <span class="slider-value">{{ store.config.practice.rounds }} {{ lang.ssRound }}</span>
- <span class="slider-max">60 {{ lang.ssRound }}</span>
- </div>
- </template>
- </div>
- <!-- 展示学习报告 -->
- <div class="toggle-row">
- <span class="toggle-label">{{ lang.ssShowReport }}</span>
- <button
- class="toggle-switch"
- :class="{ on: store.config.evaluation.showReport }"
- @click="store.toggleShowReport()"
- >
- <span class="toggle-knob"></span>
- </button>
- </div>
- </div>
- <!-- 分割线 -->
- <div class="section-spacer"></div>
- <!-- 4. 高级配置 -->
- <div class="advanced-section">
- <button class="section-toggle" @click="advancedExpanded = !advancedExpanded">
- <span class="section-toggle-label">{{ lang.ssAdvancedConfig }}</span>
- <svg
- class="section-toggle-arrow"
- :class="{ collapsed: !advancedExpanded }"
- width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
- >
- <path d="M6 9l6 6 6-6" />
- </svg>
- </button>
- <div v-if="advancedExpanded" class="advanced-body">
- <!-- 辅助功能 -->
- <div class="config-card sub-card">
- <div class="sub-card-title">{{ lang.ssAssistance }}</div>
- <div class="checkbox-group">
- <label class="checkbox-item">
- <input type="checkbox" :checked="store.config.practice.showEnglish" @change="store.togglePracticeSetting('showEnglish')" />
- <span>{{ lang.ssShowEnglish }}</span>
- </label>
- <label class="checkbox-item">
- <input type="checkbox" :checked="store.config.practice.taskHint" @change="store.togglePracticeSetting('taskHint')" />
- <span>{{ lang.ssTaskHint }}</span>
- </label>
- <label class="checkbox-item">
- <input type="checkbox" :checked="store.config.practice.stutterHint" @change="store.togglePracticeSetting('stutterHint')" />
- <span>{{ lang.ssStutterHint }}</span>
- </label>
- </div>
- </div>
- <!-- 评估详情 -->
- <div class="config-card sub-card">
- <div class="sub-card-title">{{ lang.ssEvalDetails }}</div>
- <!-- 评估维度 -->
- <div class="eval-group">
- <div class="sub-label">{{ lang.ssEvalDimensions }}</div>
- <div class="checkbox-group">
- <label class="checkbox-item">
- <input type="checkbox" :checked="store.config.evaluation.dimensions.accuracy" @change="store.toggleEvalDimension('accuracy')" />
- <span>{{ lang.ssAccuracy }}</span>
- </label>
- <label class="checkbox-item">
- <input type="checkbox" :checked="store.config.evaluation.dimensions.fluency" @change="store.toggleEvalDimension('fluency')" />
- <span>{{ lang.ssFluency }}</span>
- </label>
- <label class="checkbox-item">
- <input type="checkbox" :checked="store.config.evaluation.dimensions.completeness" @change="store.toggleEvalDimension('completeness')" />
- <span>{{ lang.ssCompleteness }}</span>
- </label>
- <label class="checkbox-item">
- <input type="checkbox" :checked="store.config.evaluation.dimensions.rhythm" @change="store.toggleEvalDimension('rhythm')" />
- <span>{{ lang.ssRhythm }}</span>
- </label>
- </div>
- </div>
- <!-- 评分方式 -->
- <div class="eval-group">
- <div class="sub-label">{{ lang.ssScoreMode }}</div>
- <div class="radio-group">
- <label class="radio-item" @click="store.updateScoreMode('letter')">
- <span class="radio-circle" :class="{ active: store.config.evaluation.scoreMode === 'letter' }">
- <span v-if="store.config.evaluation.scoreMode === 'letter'" class="radio-dot"></span>
- </span>
- <span>{{ lang.ssLetterScore }}</span>
- </label>
- <label class="radio-item" @click="store.updateScoreMode('numeric')">
- <span class="radio-circle" :class="{ active: store.config.evaluation.scoreMode === 'numeric' }">
- <span v-if="store.config.evaluation.scoreMode === 'numeric'" class="radio-dot"></span>
- </span>
- <span>{{ lang.ssNumericScore }}</span>
- </label>
- <label class="radio-item" @click="store.updateScoreMode('comment_only')">
- <span class="radio-circle" :class="{ active: store.config.evaluation.scoreMode === 'comment_only' }">
- <span v-if="store.config.evaluation.scoreMode === 'comment_only'" class="radio-dot"></span>
- </span>
- <span>{{ lang.ssCommentOnly }}</span>
- </label>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- 底部留白 -->
- <div class="bottom-spacer"></div>
- </div>
- <!-- 底部操作栏 -->
- <div class="config-footer">
- <button class="btn-apply" @click="handleApply">
- {{ lang.ssApplyConfig }}
- </button>
- </div>
- <!-- 批量粘贴弹窗 -->
- <div v-if="showBatchPaste" class="batch-paste-overlay" @click.self="showBatchPaste = false">
- <div class="batch-paste-dialog">
- <h3 class="dialog-title">{{ lang.ssBatchPasteTitle }}</h3>
- <div class="dialog-body">
- <div class="dialog-field">
- <label class="dialog-label">{{ lang.ssBatchPasteVocab }}</label>
- <textarea v-model="batchVocab" class="dialog-textarea" rows="4"></textarea>
- </div>
- <div class="dialog-field">
- <label class="dialog-label">{{ lang.ssBatchPasteSentences }}</label>
- <textarea v-model="batchSentences" class="dialog-textarea" rows="4"></textarea>
- </div>
- </div>
- <div class="dialog-footer">
- <button class="btn-cancel" @click="showBatchPaste = false">{{ lang.ssCancel }}</button>
- <button class="btn-confirm" @click="handleBatchPasteConfirm">{{ lang.ssConfirm }}</button>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script lang="ts" setup>
- import { ref, nextTick } from 'vue'
- import { storeToRefs } from 'pinia'
- import { lang } from '@/main'
- import { useSpeakingStore } from '@/store/speaking'
- import { useSlidesStore } from '@/store'
- import useCreateElement from '@/hooks/useCreateElement'
- import { createSpeakingConfig, updateSpeakingConfig } from '@/services/speaking'
- import message from '@/utils/message'
- const emit = defineEmits<{
- (e: 'back'): void
- }>()
- const store = useSpeakingStore()
- // UI 状态
- const learningGoalsExpanded = ref(true)
- const advancedExpanded = ref(false)
- // 词汇新增
- const isAddingVocab = ref(false)
- const newVocab = ref('')
- const vocabInputRef = ref<HTMLInputElement | null>(null)
- // 句型新增 / 编辑
- const isAddingSentence = ref(false)
- const newSentence = ref('')
- const sentenceInputRef = ref<HTMLInputElement | null>(null)
- const editingSentenceIndex = ref<number | null>(null)
- const editingSentenceValue = ref('')
- // 批量粘贴
- const showBatchPaste = ref(false)
- const batchVocab = ref('')
- const batchSentences = ref('')
- // 词汇操作
- const handleAddVocab = () => {
- if (newVocab.value.trim()) {
- store.addVocabulary(newVocab.value.trim())
- newVocab.value = ''
- }
- }
- const handleAddVocabBlur = () => {
- if (newVocab.value.trim()) {
- handleAddVocab()
- }
- isAddingVocab.value = false
- }
- const cancelAddVocab = () => {
- isAddingVocab.value = false
- newVocab.value = ''
- }
- // 句型操作
- const handleAddSentence = () => {
- if (newSentence.value.trim()) {
- store.addSentence(newSentence.value.trim())
- newSentence.value = ''
- }
- }
- const handleAddSentenceBlur = () => {
- if (newSentence.value.trim()) {
- handleAddSentence()
- }
- isAddingSentence.value = false
- }
- const cancelAddSentence = () => {
- isAddingSentence.value = false
- newSentence.value = ''
- }
- const handleEditSentence = (index: number) => {
- editingSentenceIndex.value = index
- editingSentenceValue.value = store.config.learningGoals.sentences[index]
- }
- const handleSaveEditSentence = () => {
- if (editingSentenceIndex.value !== null && editingSentenceValue.value.trim()) {
- store.updateSentence(editingSentenceIndex.value, editingSentenceValue.value.trim())
- editingSentenceIndex.value = null
- editingSentenceValue.value = ''
- }
- }
- const handleSaveEditSentenceBlur = () => {
- if (editingSentenceValue.value.trim()) {
- handleSaveEditSentence()
- } else {
- cancelEditSentence()
- }
- }
- const cancelEditSentence = () => {
- editingSentenceIndex.value = null
- editingSentenceValue.value = ''
- }
- // 批量粘贴
- const handleBatchPasteConfirm = () => {
- const vocabItems = batchVocab.value.split('\n').map(s => s.trim()).filter(Boolean)
- const sentenceItems = batchSentences.value.split('\n').map(s => s.trim()).filter(Boolean)
- vocabItems.forEach(item => store.addVocabulary(item))
- sentenceItems.forEach(item => store.addSentence(item))
- batchVocab.value = ''
- batchSentences.value = ''
- showBatchPaste.value = false
- }
- // 应用配置 → 更新画布上已有 77 型 frame 关联的配置
- // 新交互流程下,元素由 Layer2 点卡片即创建;此处"应用"只负责 PUT 更新到后端
- const { createFrameElement } = useCreateElement()
- const { currentSlide } = storeToRefs(useSlidesStore())
- const applying = ref(false)
- const handleApply = async () => {
- if (applying.value) return
- applying.value = true
- try {
- const existing = currentSlide.value?.elements?.find(
- (el: any) => el.type === 'frame' && Number(el.toolType) === 77
- ) as { url?: string } | undefined
- if (existing?.url) {
- await updateSpeakingConfig(existing.url, store.config)
- message.success('配置已更新')
- } else {
- // 兜底:画布上没有 77 型 frame(用户删了或从未创建),此时先 POST + 插入
- const { id } = await createSpeakingConfig(store.config)
- createFrameElement(id, 77)
- message.success('已创建口语工具')
- }
- } catch (err: any) {
- console.error('[speaking] apply failed:', err)
- message.error(err?.message || '保存配置失败')
- } finally {
- applying.value = false
- }
- }
- </script>
- <style lang="scss" scoped>
- .topic-discussion-config {
- display: flex;
- flex-direction: column;
- height: 100%;
- }
- .config-scroll {
- flex: 1;
- overflow-y: auto;
- padding: 16px;
- }
- // 配置卡片
- .config-card {
- background: #fff;
- border: 1px solid #e5e7eb;
- border-radius: 12px;
- padding: 16px;
- }
- .config-divider {
- height: 1px;
- background: #f3f4f6;
- margin: 16px 0;
- }
- .section-spacer {
- height: 1px;
- background: #f3f4f6;
- margin: 16px 0;
- }
- .bottom-spacer {
- height: 24px;
- }
- // 表单元素
- .form-group {
- margin-bottom: 12px;
- &:last-child {
- margin-bottom: 0;
- }
- }
- .form-label {
- display: block;
- font-size: 12px;
- font-weight: 600;
- color: #374151;
- margin-bottom: 6px;
- }
- .form-input {
- width: 100%;
- height: 36px;
- padding: 0 12px;
- border: 1px solid #e5e7eb;
- border-radius: 8px;
- font-size: 13px;
- color: #374151;
- background: #fff;
- transition: all 0.2s;
- box-sizing: border-box;
- &:focus {
- outline: none;
- border-color: #f97316;
- }
- &::placeholder {
- color: #9ca3af;
- }
- }
- // 折叠切换
- .section-toggle {
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 4px 0;
- background: none;
- border: none;
- cursor: pointer;
- transition: color 0.2s;
- &:hover {
- .section-toggle-label {
- color: #111827;
- }
- }
- }
- .section-toggle-label {
- font-size: 12px;
- font-weight: 600;
- color: #374151;
- }
- .section-toggle-arrow {
- color: #9ca3af;
- transition: transform 0.2s;
- &.collapsed {
- transform: rotate(-90deg);
- }
- }
- // 学习目标
- .learning-goals-body {
- margin-top: 12px;
- display: flex;
- flex-direction: column;
- gap: 12px;
- }
- .sub-section {
- display: flex;
- flex-direction: column;
- gap: 6px;
- }
- .sub-section-header {
- display: flex;
- align-items: center;
- justify-content: space-between;
- }
- .sub-label {
- font-size: 12px;
- color: #6b7280;
- }
- .sub-actions {
- display: flex;
- gap: 6px;
- }
- .icon-btn {
- width: 24px;
- height: 24px;
- display: flex;
- align-items: center;
- justify-content: center;
- border: 1px dashed #d1d5db;
- border-radius: 4px;
- background: none;
- color: #9ca3af;
- cursor: pointer;
- transition: all 0.2s;
- &:hover {
- border-color: #f97316;
- color: #f97316;
- background: #fff7ed;
- }
- }
- // 词汇标签
- .vocab-tags {
- display: flex;
- flex-wrap: wrap;
- gap: 6px;
- }
- .vocab-tag {
- display: inline-flex;
- align-items: center;
- gap: 4px;
- padding: 4px 10px;
- background: #f9fafb;
- border-radius: 6px;
- font-size: 12px;
- color: #374151;
- transition: background 0.2s;
- &:hover {
- background: #f3f4f6;
- .tag-remove {
- opacity: 1;
- }
- }
- }
- .tag-remove {
- display: flex;
- background: none;
- border: none;
- padding: 0;
- color: #9ca3af;
- cursor: pointer;
- opacity: 0;
- transition: all 0.2s;
- &:hover {
- color: #6b7280;
- }
- }
- .vocab-inline-input {
- padding: 4px 10px;
- border: 1px solid #d1d5db;
- border-radius: 6px;
- font-size: 12px;
- color: #374151;
- width: 96px;
- &:focus {
- outline: none;
- border-color: #9ca3af;
- }
- }
- // 句型列表
- .sentence-list {
- display: flex;
- flex-direction: column;
- gap: 6px;
- }
- .sentence-item {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 6px 10px;
- background: #f9fafb;
- border-radius: 8px;
- cursor: pointer;
- transition: background 0.2s;
- &:hover {
- background: #f3f4f6;
- .sentence-remove {
- opacity: 1;
- }
- }
- }
- .sentence-text {
- font-size: 12px;
- color: #374151;
- }
- .sentence-remove {
- display: flex;
- background: none;
- border: none;
- padding: 0;
- color: #9ca3af;
- cursor: pointer;
- opacity: 0;
- transition: all 0.2s;
- &:hover {
- color: #6b7280;
- }
- }
- .sentence-edit-input {
- width: 100%;
- padding: 6px 10px;
- border: 1px solid #d1d5db;
- border-radius: 8px;
- font-size: 12px;
- color: #374151;
- box-sizing: border-box;
- &:focus {
- outline: none;
- border-color: #9ca3af;
- }
- }
- // 练习方式 Tab
- .mode-tabs {
- display: flex;
- gap: 8px;
- }
- .mode-tab {
- flex: 1;
- height: 32px;
- border-radius: 8px;
- border: none;
- font-size: 13px;
- font-weight: 500;
- cursor: pointer;
- transition: all 0.2s;
- background: #f9fafb;
- color: #4b5563;
- &:hover:not(.active) {
- background: #f3f4f6;
- }
- &.active {
- background: #f97316;
- color: #fff;
- }
- }
- // 滑块
- .slider-group {
- margin-top: 4px;
- }
- .config-slider {
- width: 100%;
- height: 6px;
- border-radius: 3px;
- appearance: none;
- background: #e5e7eb;
- cursor: pointer;
- accent-color: #f97316;
- &::-webkit-slider-thumb {
- appearance: none;
- width: 16px;
- height: 16px;
- border-radius: 50%;
- background: #f97316;
- cursor: pointer;
- border: 2px solid #fff;
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
- }
- }
- .slider-labels {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-top: 6px;
- font-size: 12px;
- }
- .slider-min, .slider-max {
- color: #9ca3af;
- }
- .slider-value {
- font-weight: 500;
- color: #374151;
- }
- // Toggle 开关
- .toggle-row {
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-top: 12px;
- }
- .toggle-label {
- font-size: 12px;
- color: #4b5563;
- }
- .toggle-switch {
- position: relative;
- width: 44px;
- height: 24px;
- border-radius: 12px;
- border: none;
- cursor: pointer;
- transition: background 0.2s;
- background: #d1d5db;
- &.on {
- background: #f97316;
- .toggle-knob {
- left: 22px;
- }
- }
- }
- .toggle-knob {
- position: absolute;
- top: 4px;
- left: 4px;
- width: 16px;
- height: 16px;
- border-radius: 50%;
- background: #fff;
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
- transition: left 0.2s;
- }
- // 高级配置
- .advanced-section {
- // 外层无需额外样式
- }
- .advanced-body {
- margin-top: 12px;
- display: flex;
- flex-direction: column;
- gap: 12px;
- }
- .sub-card {
- padding: 12px;
- }
- .sub-card-title {
- font-size: 12px;
- font-weight: 600;
- color: #374151;
- margin-bottom: 10px;
- }
- .checkbox-group {
- display: flex;
- flex-wrap: wrap;
- gap: 12px 16px;
- }
- .checkbox-item {
- display: flex;
- align-items: center;
- gap: 6px;
- cursor: pointer;
- font-size: 12px;
- color: #4b5563;
- input[type="checkbox"] {
- width: 14px;
- height: 14px;
- accent-color: #f97316;
- }
- }
- .eval-group {
- margin-top: 10px;
- }
- .radio-group {
- display: flex;
- flex-direction: column;
- gap: 4px;
- margin-top: 4px;
- }
- .radio-item {
- display: flex;
- align-items: center;
- gap: 8px;
- cursor: pointer;
- font-size: 12px;
- color: #374151;
- padding: 2px 0;
- user-select: none;
- }
- .radio-circle {
- width: 16px;
- height: 16px;
- border-radius: 50%;
- border: 2px solid #d1d5db;
- display: flex;
- align-items: center;
- justify-content: center;
- transition: border-color 0.2s;
- &.active {
- border-color: #f97316;
- }
- }
- .radio-dot {
- width: 8px;
- height: 8px;
- border-radius: 50%;
- background: #f97316;
- }
- // 底部操作栏
- .config-footer {
- border-top: 1px solid #f3f4f6;
- padding: 12px 16px;
- background: #fff;
- flex-shrink: 0;
- }
- .btn-apply {
- width: 100%;
- height: 36px;
- border: none;
- border-radius: 8px;
- background: #f97316;
- color: #fff;
- font-size: 13px;
- font-weight: 500;
- cursor: pointer;
- transition: background 0.2s;
- &:hover {
- background: #ea580c;
- }
- }
- // 批量粘贴弹窗
- .batch-paste-overlay {
- position: fixed;
- inset: 0;
- background: rgba(0, 0, 0, 0.3);
- display: flex;
- align-items: center;
- justify-content: center;
- z-index: 1000;
- }
- .batch-paste-dialog {
- width: 360px;
- background: #fff;
- border-radius: 16px;
- box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
- overflow: hidden;
- }
- .dialog-title {
- font-size: 15px;
- font-weight: 600;
- color: #111827;
- padding: 16px 20px;
- border-bottom: 1px solid #f3f4f6;
- margin: 0;
- }
- .dialog-body {
- padding: 16px 20px;
- display: flex;
- flex-direction: column;
- gap: 12px;
- }
- .dialog-field {
- display: flex;
- flex-direction: column;
- gap: 6px;
- }
- .dialog-label {
- font-size: 12px;
- font-weight: 500;
- color: #374151;
- }
- .dialog-textarea {
- width: 100%;
- padding: 8px 12px;
- border: 1px solid #e5e7eb;
- border-radius: 8px;
- font-size: 13px;
- color: #374151;
- resize: vertical;
- font-family: inherit;
- box-sizing: border-box;
- &:focus {
- outline: none;
- border-color: #f97316;
- }
- }
- .dialog-footer {
- display: flex;
- justify-content: flex-end;
- gap: 8px;
- padding: 12px 20px;
- border-top: 1px solid #f3f4f6;
- }
- .btn-cancel {
- padding: 6px 16px;
- border: 1px solid #e5e7eb;
- border-radius: 8px;
- background: #fff;
- font-size: 13px;
- color: #4b5563;
- cursor: pointer;
- transition: all 0.2s;
- &:hover {
- background: #f9fafb;
- }
- }
- .btn-confirm {
- padding: 6px 16px;
- border: none;
- border-radius: 8px;
- background: #f97316;
- font-size: 13px;
- color: #fff;
- cursor: pointer;
- transition: all 0.2s;
- &:hover {
- background: #ea580c;
- }
- }
- </style>
|