12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027 |
- <!-- -->
- <template>
- <div
- v-if="cur"
- class="NPC-Big-Book-preview adult-book-preview-sty"
- :class="['NPC-Big-Book-preview-' + themeColor]"
- >
- <div class="NNPE-title">
- <!-- 页眉 -->
- <div class="NNPE-title-left">
- <div
- v-for="(item, index) in cur.detailList"
- :key="index"
- class="NNPE-title-item"
- >
- <template
- v-if="
- item.detail &&
- item.detail.wordsList &&
- item.detail.wordsList.length == 0
- "
- >
- <p
- v-if="item.detail.sentence"
- :class="[
- 'content-con',
- /^[\u4e00-\u9fa5]/.test(item.detail.sentence) ? 'hasCn' : '',
- ]"
- v-html="item.detail.sentence"
- />
- </template>
- <template v-else>
- <div v-if="item.detail && item.detail.resArr" class="con-box">
- <div
- v-for="(itemCon, indexCon) in item.detail.resArr"
- v-show="itemCon.isShow"
- :key="indexCon"
- :class="['con-item', indexCon === 0 ? 'con-item-0' : '']"
- >
- <template
- v-if="
- item.detail &&
- item.detail.wordsList &&
- item.detail.wordsList[indexCon + 1] &&
- item.detail.wordsList[indexCon + 1].chs &&
- chsFhList.indexOf(item.detail.wordsList[indexCon + 1].chs) >
- -1
- "
- >
- <div class="synthesis-box">
- <div>
- <span
- class="pinyin"
- :class="[
- noFont.indexOf(itemCon.pinyin) > -1 ? 'noFont' : '',
- ]"
- v-if="itemCon.pinyin"
- >{{ itemCon.pinyin }}</span
- >
- <span class="content-con" :class="[/^[0-9]*$/.test(itemCon.chs)]?/^[\u4e00-\u9fa5]/.test(itemCon.chs)?'hanzi':'en':''">{{ itemCon.chs }}</span>
- </div>
- <div
- v-if="item.detail.wordsList[indexCon + 1]"
- style="text-align: left"
- >
- <span
- class="pinyin"
- :class="[
- noFont.indexOf(
- item.detail.wordsList[indexCon + 1].pinyin
- ) > -1
- ? 'noFont'
- : '',
- ]"
- v-if="item.detail.wordsList[indexCon + 1].pinyin"
- >{{ item.detail.wordsList[indexCon + 1].pinyin }}</span
- >
- <span class="content-con" :class="[/^[0-9]*$/.test(item.detail.wordsList[indexCon + 1].chs)]?/^[\u4e00-\u9fa5]/.test(item.detail.wordsList[indexCon + 1].chs)?'hanzi':'en':''">{{
- item.detail.wordsList[indexCon + 1].chs
- }}</span>
- </div>
- </div>
- </template>
- <template v-else>
- <span
- class="pinyin"
- :class="[
- noFont.indexOf(itemCon.pinyin) > -1 ? 'noFont' : '',
- ]"
- v-if="
- item.detail &&
- !(
- item.detail.wordsList &&
- item.detail.wordsList[indexCon - 1] &&
- item.detail.wordsList[indexCon - 1].chs &&
- chsFhList.indexOf(
- item.detail.wordsList[indexCon - 1].chs
- ) == -1 &&
- chsFhList.indexOf(itemCon.chs) > -1
- ) &&
- itemCon.pinyin
- "
- >{{ itemCon.pinyin }}</span
- >
- <span
- class="content-con"
- v-if="
- item.detail &&
- !(
- item.detail.wordsList &&
- item.detail.wordsList[indexCon - 1] &&
- item.detail.wordsList[indexCon - 1].chs &&
- chsFhList.indexOf(
- item.detail.wordsList[indexCon - 1].chs
- ) == -1 &&
- chsFhList.indexOf(itemCon.chs) > -1
- )
- "
- :class="[/^[0-9]*$/.test(itemCon.chs)]?/^[\u4e00-\u9fa5]/.test(itemCon.chs)?'hanzi':'en':''"
- >{{ itemCon.chs }}</span
- >
- </template>
- </div>
- </div>
- </template>
- <p class="NNPE-title-item-en" v-html="item.en" />
- </div>
- </div>
- <div v-if="isShowTitle" class="NNPE-operate">
- <a
- class="btn-prev"
- :class="[preClick ? '' : 'btn-prev-disabled']"
- @click="handleNNPEprev"
- />
- <a
- class="btn-next"
- :class="[nextClick ? '' : 'btn-next-disabled']"
- @click="handleNNPEnext"
- />
- </div>
- </div>
- <div
- v-if="
- cur.classTopic && cur.classTopic.length > 0 && cur.classTopic[0].con
- "
- class="classTopic-box"
- >
- <span
- v-for="(item, index) in cur.classTopic"
- :key="index"
- :class="item.font"
- >
- {{ item.con }}
- </span>
- </div>
- <el-checkbox v-if="previewType && previewType == 'previewCheck'" class="NNPE-Book-content-item-checkbox" :indeterminate="isIndeterminate" v-model="checkAllNPC" @change="handleCheckAllChangeNPC" style="margin:20px 0 0 10px">全选</el-checkbox>
- <div v-if="cur" class="NNPE-Book-content-inner">
- <div
- v-for="(item, index) in cur.cur_fn_data"
- :key="index"
- class="title-box-preview"
- :class="[
- !previewType ||
- previewType == 'previewCheck' ||
- (previewType == 'previewCheckShow' && item.previewShow) ||
- JSON.parse(previewGroupId).length == 0
- ? 'NNPE-Book-content-item'
- : '',
- ]"
- >
- <div v-for="(itemJ, indexJ) in judgeAnswersList" :key="indexJ">
- <el-checkbox
- class="NNPE-Book-content-item-checkbox"
- :label="item.group_id"
- v-if="previewType && previewType == 'previewCheck' && item.group_id"
- v-model="groupCheckList[index]"
- @change="forupdata(index)"
- ><br
- /></el-checkbox>
- <template
- v-if="
- !previewType ||
- previewType == 'previewCheck' ||
- (previewType == 'previewCheckShow' && item.previewShow) ||
- JSON.parse(previewGroupId).length == 0
- "
- >
- <template v-if="itemJ != 'standardAnswer'">
- <div
- v-if="item.number || item.z_title || item.f_title || item.z_title_detail&&item.z_title_detail.sentence || item.f_title_detail&&item.f_title_detail.sentence"
- class="title-big"
- >
- <b v-if="item.number">{{ item.number }}</b>
- <div
- class="title-box-right"
- :class="[item.is_textIndex ? 'title-box-right-index' : '']"
- >
- <template v-if="item.z_title_detail&&item.z_title_detail.sentence">
- <div class="item-intro">
- <OneSentenceTemp
- :detail="item.z_title_detail"
- :TaskModel="TaskModel"
- :Bookanswer="[]"
- :correctAnswer="[]"
- :isInput="
- false
- "
- :fn_check_list="[]"
- :pyNumber="0"
- :record_check="[]"
- :maxFontsize="'16'"
- />
- </div>
- </template>
- <h2 v-else-if="item.z_title" v-html="item.z_title" />
- <template v-if="item.hasOwnProperty('f_title_detail')">
- <div class="item-intro" v-if="item.f_title_detail.sentence">
- <OneSentenceTemp
- :detail="item.f_title_detail"
- :TaskModel="TaskModel"
- :Bookanswer="[]"
- :correctAnswer="[]"
- :isInput="
- false
- "
- :fn_check_list="[]"
- :pyNumber="0"
- :record_check="[]"
- :maxFontsize="'16'"
- :style="{ marginTop: item.z_title||item.z_title_detail&&item.z_title_detail.sentence ? '8px' : '0' }"
- />
- </div>
- </template>
- <h3
- v-else-if="item.f_title"
- :style="{ marginTop: item.z_title||item.z_title_detail&&item.z_title_detail.sentence ? '8px' : '0' }"
- v-html="item.f_title"
- />
- </div>
- </div>
- <div
- class="title-little"
- :class="[
- item.little_title_number || item.little_title || item.l_title_detail&&item.l_title_detail.sentence
- ? 'marginTop'
- : '',
- ]"
- >
- <b v-html="item.little_title_number" />
- <template v-if="item.l_title_detail&&item.l_title_detail.sentence">
- <div class="item-intro">
- <OneSentenceTemp
- :detail="item.l_title_detail"
- :TaskModel="TaskModel"
- :Bookanswer="[]"
- :correctAnswer="[]"
- :isInput="
- false
- "
- :fn_check_list="[]"
- :pyNumber="0"
- :record_check="[]"
- :maxFontsize="'16'"
- />
- </div>
- </template>
- <p v-html="item.little_title" v-else-if="item.little_title" />
- </div>
- </template>
- <div
- :class="[
- 'NNPE-tableList',
- item.is_bg ? 'NNPE-tableList-hasBg' : '',
- ]"
- >
- <h6
- v-if="itemJ == 'userAnswer' || itemJ == 'studentAnswer'"
- class="standardTitle"
- >
- {{ itemJ == "userAnswer" ? "Your answer" : "Student answers" }}
- </h6>
- <h6
- v-if="itemJ == 'standardAnswer' && item.ShowstandardAnswer"
- class="standardTitle"
- >
- Standard answer
- </h6>
- <div
- v-for="(items, indexs) in item.table_list"
- :key="indexs"
- class="NNPE-tableList-tr"
- :class="[
- indexs === item.table_list.length - 1
- ? 'NNPE-tableList-tr-last'
- : '',
- ]"
- >
- <div
- v-for="(itemss, indexss) in items"
- :key="indexss"
- :class="[
- 'NNPE-tableList-item',
- items.length == 1
- ? 'NNPE-tableList-item-noMargin'
- : 'NNPE-tableList-item' + items.length,
- ]"
- >
- <template v-if="itemss.data">
- <template v-if="itemss.type == 'ligature_chs'">
- <Ligature
- :cur-que="itemss.data"
- :theme-color="themeColor"
- :task-model="TaskModel"
- :number="
- index +
- '_' +
- indexs +
- '_' +
- indexss +
- '_' +
- currentTreeID
- "
- :judgeAnswer="itemJ"
- />
- </template>
- <template v-if="itemss.data.type == 'image'">
- <Picture
- v-if="refresh"
- :cur-que="itemss.data"
- :child-type="itemss.type"
- :theme-color="themeColor"
- :task-model="TaskModel"
- :judgeAnswer="itemJ"
- />
- </template>
- <template
- v-if="
- itemss.type == 'phrase_chs' && itemJ != 'standardAnswer'
- "
- >
- <WordPhrase
- v-if="refresh"
- :cur-que="itemss.data"
- :theme-color="themeColor"
- :task-model="TaskModel"
- :indexStr="
- index +
- '_' +
- indexs +
- '_' +
- indexss +
- '_' +
- currentTreeID
- "
- :judgeAnswer="itemJ"
- />
- </template>
- <template
- v-if="
- itemss.type == 'NewWord_chs' &&
- itemJ != 'standardAnswer'
- "
- >
- <WordPhrase
- v-if="refresh"
- :cur-que="itemss.data"
- :theme-color="themeColor"
- :current-tree-i-d="currentTreeID"
- :indexs="indexs"
- :indexss="indexss"
- :task-model="TaskModel"
- :indexStr="
- index +
- '_' +
- indexs +
- '_' +
- indexss +
- '_' +
- currentTreeID
- "
- :judgeAnswer="itemJ"
- />
- </template>
- <template
- v-if="
- itemss.type == 'annotation_chs' &&
- itemJ != 'standardAnswer'
- "
- >
- <WordPhrase
- v-if="refresh"
- :cur-que="itemss.data"
- :theme-color="themeColor"
- :task-model="TaskModel"
- :indexStr="
- index +
- '_' +
- indexs +
- '_' +
- indexss +
- '_' +
- currentTreeID
- "
- :judgeAnswer="itemJ"
- />
- </template>
- <template
- v-if="
- itemss.type == 'notes_chs' && itemJ != 'standardAnswer'
- "
- >
- <Notes
- v-if="refresh"
- :cur-que="itemss.data"
- :theme-color="themeColor"
- :task-model="TaskModel"
- :judgeAnswer="itemJ"
- />
- </template>
- <template
- v-if="
- itemss.type == 'article_chs' &&
- itemJ != 'standardAnswer'
- "
- >
- <ArticleTemChs
- v-if="refresh"
- :cur-que="itemss.data"
- :n-n-p-e-new-word-list="NNPENewWordList"
- :n-n-p-e-new-phrase-list="NNPENewPhraseList"
- :n-n-p-e-annotation-list="NNPEAnnotationList"
- :theme-color="themeColor"
- :current-tree-i-d="currentTreeID"
- :task-model="TaskModel"
- :judgeAnswer="itemJ"
- :colLength="items.length"
- />
- </template>
- <!-- <template v-if="itemss.type == 'sentence_segword_chs'">
- <SentenceSegWordViewChs
- :cur-que="itemss.data"
- :theme-color="themeColor"
- v-if="refresh"
- />
- </template> -->
- <template
- v-if="
- itemss.type == 'dialogue_article_chs' &&
- itemJ != 'standardAnswer'
- "
- >
- <DialogueArticleViewChs
- v-if="refresh"
- :cur-que="itemss.data"
- :n-n-p-e-new-word-list="NNPENewWordList"
- :n-n-p-e-new-phrase-list="NNPENewPhraseList"
- :n-n-p-e-annotation-list="NNPEAnnotationList"
- :color-box="colorBox"
- :theme-color="themeColor"
- :current-tree-i-d="currentTreeID"
- :task-model="TaskModel"
- :judgeAnswer="itemJ"
- :colLength="items.length"
- />
- </template>
- <template v-if="itemss.type == 'dialogue_answer_chs'">
- <DialogueAnswerViewChs
- v-if="refresh"
- :cur-que="itemss.data"
- :color-box="colorBox"
- :theme-color="themeColor"
- :task-model="TaskModel"
- :judgeAnswer="itemJ"
- />
- </template>
- <template v-if="itemss.type == 'input_record_chs'">
- <InputHasRecord
- v-if="refresh"
- :cur-que="itemss.data"
- :theme-color="themeColor"
- :task-model="TaskModel"
- :judgeAnswer="itemJ"
- />
- </template>
- <template v-if="itemss.type == 'recordHZ_inputPY_chs'">
- <TextInputRecord
- v-if="refresh"
- :cur-que="itemss.data"
- :theme-color="themeColor"
- :task-model="TaskModel"
- :judgeAnswer="itemJ"
- />
- </template>
- <template
- v-if="
- itemss.type == 'inputItem_chs' ||
- itemss.type == 'sentence_input_chs' ||
- itemss.type == 'sentence_judge_chs' ||
- itemss.type == 'sentence_record_chs' ||
- itemss.type == 'sentence_input_record_chs'
- "
- >
- <SentenceInput
- v-if="refresh"
- :cur-que="itemss.data"
- :theme-color="themeColor"
- :task-model="TaskModel"
- :judgeAnswer="itemJ"
- />
- </template>
- <template v-if="itemss.type == 'NumberCombination_chs'">
- <NumberSelectHasRecord
- v-if="refresh"
- :cur-que="itemss.data"
- :theme-color="themeColor"
- :task-model="TaskModel"
- :judgeAnswer="itemJ"
- />
- </template>
- <template
- v-if="
- itemss.type === 'voice_matrix' &&
- itemJ != 'standardAnswer'
- "
- >
- <voice-matrix
- v-if="refresh"
- :cur-que="itemss.data"
- :theme-color="themeColor"
- :task-model="TaskModel"
- :judgeAnswer="itemJ"
- />
- </template>
- <template v-if="itemss.type === 'select_drag'">
- <select-drag
- v-if="refresh"
- :cur-que="itemss.data"
- :theme-color="themeColor"
- :task-model="TaskModel"
- :judgeAnswer="itemJ"
- />
- </template>
- <template v-if="itemss.type === 'fill_drag'">
- <fill-drag
- v-if="refresh"
- :cur-que="itemss.data"
- :theme-color="themeColor"
- :task-model="TaskModel"
- :judgeAnswer="itemJ"
- />
- </template>
- <template v-if="itemss.type === 'config_table'">
- <configurable-table
- v-if="refresh"
- :cur-que="itemss.data"
- :theme-color="themeColor"
- :task-model="TaskModel"
- :judgeAnswer="itemJ"
- />
- </template>
- <template v-if="itemss.type === 'header_separate'">
- <header-separate
- v-if="refresh"
- :cur-que="itemss.data"
- :theme-color="themeColor"
- :task-model="TaskModel"
- :judgeAnswer="itemJ"
- />
- </template>
- <template v-if="itemss.type == 'toneSelect_chs'">
- <SelectTone
- v-if="refresh"
- :cur-que="itemss.data"
- :theme-color="themeColor"
- :task-model="TaskModel"
- :judgeAnswer="itemJ"
- />
- </template>
- <template v-if="itemss.type == 'sudoku_chs'">
- <Soduko
- v-if="refresh"
- :cur-que="itemss.data"
- :theme-color="themeColor"
- :task-model="TaskModel"
- :judgeAnswer="itemJ"
- />
- </template>
- <template v-if="itemss.type == 'single_chs'">
- <Single
- v-if="refresh"
- :cur-que="itemss.data"
- :theme-color="themeColor"
- :task-model="TaskModel"
- :judgeAnswer="itemJ"
- />
- </template>
- <template v-if="itemss.type == 'text_problem_chs'">
- <TextProblem
- v-if="refresh"
- :cur-que="itemss.data"
- :theme-color="themeColor"
- :task-model="TaskModel"
- :judgeAnswer="itemJ"
- />
- </template>
- <template
- v-if="
- itemss.type == 'newWord_preview_chs' &&
- itemJ != 'standardAnswer'
- "
- >
- <NewWordShow
- v-if="refresh"
- :cur-que="itemss.data"
- :theme-color="themeColor"
- :index-str="index + '_' + indexs + '_' + indexss"
- :task-model="TaskModel"
- :judgeAnswer="itemJ"
- />
- </template>
- <template
- v-if="itemss.type == 'listen_record_single_syllable_chs'"
- >
- <SelectYinjie
- v-if="refresh"
- :cur-que="itemss.data"
- :theme-color="themeColor"
- :task-model="TaskModel"
- :judgeAnswer="itemJ"
- />
- </template>
- <template v-if="itemss.type == 'sentence_listen_read_chs'">
- <SentenceListenRead
- v-if="refresh"
- :cur-que="itemss.data"
- :theme-color="themeColor"
- :task-model="TaskModel"
- :judgeAnswer="itemJ"
- />
- </template>
- <template v-if="itemss.type == 'sort_chs'">
- <SentenceSortQP
- v-if="refresh"
- :cur-que="itemss.data"
- :theme-color="themeColor"
- :task-model="TaskModel"
- :judgeAnswer="itemJ"
- />
- </template>
- <template
- v-if="itemss.type == 'checkbox_self_assessment_chs'"
- >
- <Checkbox
- v-if="refresh"
- :cur-que="itemss.data"
- :theme-color="themeColor"
- :task-model="TaskModel"
- :judgeAnswer="itemJ"
- />
- </template>
- <template
- v-if="
- (itemss.type == 'record_control_mini' ||
- itemss.type == 'record_control_normal' ||
- itemss.type == 'record_control_pro' ||
- itemss.type == 'record_control_promax') &&
- itemJ != 'standardAnswer'
- "
- >
- <RecordModule
- v-if="refresh"
- :cur-que="itemss.data"
- :theme-color="themeColor"
- :task-model="TaskModel"
- :judgeAnswer="itemJ"
- />
- </template>
- <template
- v-if="
- (itemss.type == 'upload_control_chs' ||
- itemss.type == 'upload_control_preview_chs') &&
- itemJ != 'standardAnswer'
- "
- >
- <UploadControlView
- v-if="refresh"
- :cur-que="itemss.data"
- :type="itemss.type"
- :theme-color="themeColor"
- :task-model="TaskModel"
- :judgeAnswer="itemJ"
- />
- </template>
- <template
- v-if="
- itemss.type == 'CourseStart_chs' &&
- itemJ != 'standardAnswer'
- "
- >
- <CourseStart
- v-if="refresh"
- :cur-que="itemss.data"
- :handle-n-n-p-enext="handleNNPEnext"
- :theme-color="themeColor"
- :task-model="TaskModel"
- :judgeAnswer="itemJ"
- />
- </template>
- <template
- v-if="
- itemss.type == 'tinydemo_chs' &&
- itemJ != 'standardAnswer'
- "
- >
- <Tinydemo
- v-if="refresh"
- :cur-que="itemss.data"
- :theme-color="themeColor"
- :task-model="TaskModel"
- :judgeAnswer="itemJ"
- />
- </template>
- <template
- v-if="
- itemss.type == 'video_chs' && itemJ != 'standardAnswer'
- "
- >
- <VideoControl
- v-if="refresh"
- :cur-que="itemss.data"
- :type="itemss.type"
- :theme-color="themeColor"
- :index-str="
- index +
- '_' +
- indexs +
- '_' +
- indexss +
- '_' +
- currentTreeID
- "
- :task-model="TaskModel"
- :judgeAnswer="itemJ"
- />
- </template>
- <template v-if="itemss.type == 'table_chs'">
- <TableView
- v-if="refresh"
- :cur-que="itemss.data"
- :type="itemss.type"
- :theme-color="themeColor"
- :task-model="TaskModel"
- :judgeAnswer="itemJ"
- />
- </template>
- <template v-if="itemss.type == 'play_record_chs'">
- <PlayRecordView
- v-if="refresh"
- :cur-que="itemss.data"
- :type="itemss.type"
- :theme-color="themeColor"
- :task-model="TaskModel"
- :judgeAnswer="itemJ"
- />
- </template>
- <template
- v-if="
- itemss.type == 'upload_pdf_chs' &&
- itemJ != 'standardAnswer'
- "
- >
- <PdfView
- v-if="refresh"
- :cur-que="itemss.data"
- :type="itemss.type"
- :theme-color="themeColor"
- :task-model="TaskModel"
- :judgeAnswer="itemJ"
- />
- </template>
- <template v-if="itemss.type == 'sentence_segtemp_chs'">
- <SentenceModule
- v-if="refresh"
- :cur-que="itemss.data"
- :type="itemss.type"
- :theme-color="themeColor"
- :task-model="TaskModel"
- :judgeAnswer="itemJ"
- />
- </template>
- <template
- v-if="
- itemss.type == 'options_list_chs' &&
- itemJ != 'standardAnswer'
- "
- >
- <OptionsList
- v-if="refresh"
- :cur-que="itemss.data"
- :theme-color="themeColor"
- :index-str="index + '_' + indexs + '_' + indexss"
- :task-model="TaskModel"
- :judgeAnswer="itemJ"
- />
- </template>
- <template v-if="itemss.type == 'sentence_single_chs'">
- <SentenceMulModule
- v-if="refresh"
- :cur-que="itemss.data"
- :type="itemss.type"
- :theme-color="themeColor"
- :task-model="TaskModel"
- :judgeAnswer="itemJ"
- />
- </template>
- </template>
- </div>
- </div>
- <div
- style="text-align: right; padding: 10px 0px 40px 0"
- v-if="isAnswerItemShow && item.showSubmit"
- >
- <a class="submitLookAnswer" @click="submitLookAnswer(index)"
- >{{submitCn?submitCn:'查看答案'}}</a
- >
- </div>
- </div>
- </template>
- </div>
- </div>
- </div>
- <div v-if="isShowSave || isShowTitle" class="NNPE-title NNPE-title-gray">
- <!-- 页眉 v-if="isShowSave"-->
- <a class="submitAnswer" v-if="isShowSave" @click="submitUserAnswerNPC">提交</a>
- <div v-if="isShowTitle" class="NNPE-operate">
- <a
- class="btn-prev"
- :class="[preClick ? '' : 'btn-prev-disabled']"
- @click="handleNNPEprev"
- />
- <a
- class="btn-next"
- :class="[nextClick ? '' : 'btn-next-disabled']"
- @click="handleNNPEnext"
- />
- </div>
- </div>
- <el-dialog
- title=""
- :close-on-click-modal="false"
- :modal-append-to-body="false"
- :show-close="false"
- append-to-body
- :visible.sync="visiblePreviewDialog"
- width="890px"
- height="80%"
- class="previewDialog"
- >
- <div class="previewDialog-title">
- <h2>Reference answer</h2>
- <a @click="visiblePreviewDialog = false"
- ><img src="../../assets/NPC/icon-close.png"
- /></a>
- </div>
- <PreviewDialogueNPC
- class="previewDialog-content"
- :context="contextData"
- :que-index="queIndex"
- :father-name="fatherName"
- :currentTreeID="currentTreeID"
- :FatherTreeData="FatherTreeData"
- :change-id="changeId"
- :themeColor="themeColor"
- :TaskModel="'ANSWER'"
- v-if="visiblePreviewDialog"
- />
- </el-dialog>
- </div>
- </template>
- <script>
- import Picture from "./preview/Picture.vue"; // 图片模板
- import Record from "./preview/Record.vue"; // 音频播放
- import Soundrecord from "./preview/Soundrecord.vue"; // 录音模板
- import ArticleTemChs from "./preview/ArticleViewChs/index.vue"; // 文章模板
- import DialogueArticleViewChs from "./preview/DialogueArticleViewChs/index.vue"; // 文章模板
- import SentenceSegWordViewChs from "./preview/SentenceSegWordViewChs.vue"; // 句子分词
- import WordPhrase from "./preview/WordPhrase.vue"; // 生词短语
- import Notes from "./preview/Notes.vue"; // 注释
- import Ligature from "./preview/Ligature.vue";
- import InputHasRecord from "./preview/InputHasRecord.vue"; // 输入加录音
- import TextInputRecord from "./preview/TextInputRecord.vue"; // 文本+输入+录音
- import SentenceInput from "./preview/SentenceInput.vue"; // 输入选项
- import NumberSelectHasRecord from "./preview/NumberSelectHasRecord.vue"; // 数字组合
- import SelectTone from "./preview/SelectTone.vue"; // 选择声调
- import Soduko from "./preview/Soduko.vue"; // 数独
- import Single from "./preview/Single.vue"; // 单选
- import TextProblem from "./preview/TextProblem.vue"; // 课文上方的问题
- import NewWordShow from "./preview/NewWordShow.vue"; // 生字展示
- import SelectYinjie from "./preview/SelectYinjie.vue"; // 选择音节
- import SentenceListenRead from "./preview/SentenceListenRead.vue"; // 听并朗读
- import SentenceSortQP from "./preview/SentenceSortQP.vue"; // 句子拖拽排序
- import Checkbox from "./preview/CheckBoxModule.vue"; // 问卷调查-多选题
- import VoiceMatrix from "./preview/VoiceMatrix.vue"; // 语音矩阵
- import SelectDrag from "./preview/SelectDrag.vue"; // 选择 -> 拖拽
- import FillDrag from "./preview/FillDrag.vue"; // 填空 -> 拖拽
- import ConfigurableTable from "./preview/ConfigurableTable.vue"; // 可配置表格
- import HeaderSeparate from "./preview/HeaderSparate/index.vue"; // 表头分离表格
- import RecordModule from "./preview/RecordModule.vue"; // 录音组件
- import UploadControlView from "./preview/UploadControlView.vue"; // 预览控件
- import DialogueAnswerViewChs from "./preview/DialogueArticleViewChs/DialogueAnswerViewChs.vue"; // 文章模板
- import CourseStart from "./preview/CourseStart.vue"; // 封面
- import Tinydemo from "./preview/TinyModule.vue"; // 富文本
- import VideoControl from "./preview/VideoControl.vue"; // 视频控件
- import TableView from "./preview/TableView.vue"; // 视频控件
- import PdfView from "./preview/PdfView.vue"; // 视频控件
- import SentenceModule from "./preview/SentenceModule.vue"; // 图片模板
- import PlayRecordView from "./preview/PlayRecordView.vue";
- import OptionsList from "./preview/OptionsList.vue"; // 选项模板
- import SentenceMulModule from "./preview/SentenceMulModule.vue" // 多题干模板
- import PreviewDialogueNPC from "./preview/PreviewDialogueNPC.vue"; // 选项模板
- import OneSentenceTemp from "./preview/components/OneSentenceTemp.vue";
- import { getToken } from "../../utils/auth";
- export default {
- name: "Booknpc",
- components: {
- Picture,
- Record,
- Soundrecord,
- ArticleTemChs,
- DialogueArticleViewChs,
- SentenceSegWordViewChs,
- WordPhrase,
- Notes,
- Ligature,
- InputHasRecord,
- TextInputRecord,
- SentenceInput,
- NumberSelectHasRecord,
- SelectTone,
- Soduko,
- Single,
- TextProblem,
- NewWordShow,
- SelectYinjie,
- SentenceListenRead,
- SentenceSortQP,
- Checkbox,
- VoiceMatrix,
- FillDrag,
- SelectDrag,
- ConfigurableTable,
- HeaderSeparate,
- RecordModule,
- UploadControlView,
- DialogueAnswerViewChs,
- CourseStart,
- Tinydemo,
- VideoControl,
- TableView,
- PdfView,
- PlayRecordView,
- SentenceModule,
- OptionsList,
- PreviewDialogueNPC,
- SentenceMulModule,
- OneSentenceTemp
- },
- props: [
- "context",
- "fatherName",
- "currentTreeID",
- "FatherTreeData",
- "changeId",
- "themeColor",
- "isShowTitle",
- "bookAnswerContent",
- "TaskModel",
- "isShowSave",
- "previewType",
- "previewGroupId",
- "isAnswerItemShow",
- "submitCn"
- ],
- data() {
- return {
- contextData: null,
- answerData: [], // 获取的答案数据
- queIndex: -1, // 题目的索引
- cur: null, // 当前的题目
- watchIndex: -1, // 监听的值
- queList: [],
- queTotal: 0, // 题目总数
- NNPENewWordList: [], // 存放文章的生词
- NNPENewPhraseList: [], // 存放文章的短语
- NNPEAnnotationList: [], // 存放文章注释
- height: "", // 总体的高度
- colorBox: [
- {
- touxiang: "#72B51D",
- bg: "#E9F0DF",
- },
- {
- touxiang: "#DE4444",
- bg: "rgba(222, 68, 68, 0.1)",
- },
- {
- touxiang: "#A7A7A7",
- bg: "#ffffff",
- },
- {
- touxiang: "#4D91F6",
- bg: "#F1F7FF",
- },
- {
- touxiang: "#FF8A00",
- bg: "rgba(255, 138, 0, 0.1)",
- },
- {
- touxiang: "#25C8B4",
- bg: "#D3F4F0",
- },
- {
- touxiang: "#AD44DE",
- bg: "#EFDAF8",
- },
- {
- touxiang: "#CD003E",
- bg: "#F5CCD8",
- },
- {
- touxiang: "#FF4980",
- bg: "#FFDBE6",
- },
- {
- touxiang: "#FAFF00",
- bg: "#FEFFCC",
- },
- ],
- chsFhList: [",", "。", "“", ":", "》", "?", "!", ";"],
- noFont: ["~", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")"], // 对应不要拼音字体
- idArr: [], // 当前的pid
- oldCurrentTreeID: "",
- refresh: true,
- preClick: false, // 上一页是否可点
- nextClick: false, // 下一页是否可点
- answerTime: 0,
- answerTimeInterval: null, // 计时器
- groupIndexList: [], // 勾选groupid数组
- groupCheckList: [], // checkbox 是否选中
- judgeAnswersList: [],
- visiblePreviewDialog: false,
- titleChsFhList:[",", "”","。",":", "》", "?", "!", ";"],
- checkAllNPC: false,
- isIndeterminate: false
- };
- },
- computed: {},
- watch: {
- context: {
- handler(val, oldVal) {
- const _this = this;
- _this.refresh = false;
- if (val) {
- _this.initContextData();
- if (_this.FatherTreeData) {
- _this.idArr = [];
- _this.FatherTreeData.forEach((item, itemIndex) => {
- this.seekCurrentTree(item);
- });
- }
- _this.handleTitleData();
- if (_this.queIndex == _this.queTotal - 1) {
- this.idArr.forEach((item, i) => {
- if (item == _this.currentTreeID) {
- if (i == 0) {
- _this.preClick = false;
- _this.nextClick = true;
- } else if (i == this.idArr.length - 1) {
- _this.nextClick = false;
- _this.preClick = true;
- } else {
- _this.nextClick = true;
- _this.preClick = true;
- }
- }
- });
- }
- _this.$nextTick(() => {
- // 重新渲染组件
- _this.refresh = true;
- });
- }
- },
- // 深度观察监听
- deep: true,
- },
- },
- // 生命周期 - 创建完成(可以访问当前this实例)
- created() {
- console.log("2023-10-20");
- },
- // 生命周期 - 挂载完成(可以访问DOM元素)
- mounted() {
- const _this = this;
- if (_this.context) {
- _this.initContextData();
- _this.handleTitleData();
- }
- if (_this.FatherTreeData) {
- _this.idArr = [];
- _this.FatherTreeData.forEach((item, itemIndex) => {
- this.seekCurrentTree(item);
- });
- if (_this.queIndex == _this.queTotal - 1) {
- this.idArr.forEach((item, i) => {
- if (item == _this.currentTreeID) {
- if (i == 0) {
- _this.preClick = false;
- _this.nextClick = true;
- } else if (i == this.idArr.length - 1) {
- _this.nextClick = false;
- _this.preClick = true;
- } else {
- _this.nextClick = true;
- _this.preClick = true;
- }
- }
- });
- }
- }
- },
- beforeCreate() {}, // 生命周期 - 创建之前
- beforeMount() {}, // 生命周期 - 挂载之前
- beforeUpdate() {}, // 生命周期 - 更新之前
- updated() {}, // 生命周期 - 更新之后
- beforeDestroy() {}, // 生命周期 - 销毁之前
- destroyed() {}, // 生命周期 - 销毁完成
- activated() {},
- // 方法集合
- methods: {
- // 处理数据
- handleTitleData() {
- let _this = this;
- let curQue = JSON.parse(JSON.stringify(this.cur));
- curQue.detailList.forEach((dItem, dIndex) => {
- let paraArr = [];
- if (dItem.detail) {
- dItem.detail.wordsList.forEach((sItem, sIndex) => {
- let obj = {
- pinyin: sItem.pinyin,
- chs: sItem.chs,
- isShow: true,
- };
- paraArr.push(obj);
- });
- this.$set(_this.cur.detailList[dIndex].detail, "resArr", paraArr);
- }
- });
- },
- initContextData() {
- const _this = this;
- // _this.$root.isRecording = false;
- _this.checkAllNPC = false
- _this.contextData = JSON.parse(JSON.stringify(_this.context));
- _this.queIndex = 0;
- _this.NNPENewWordList = [];
- _this.NNPENewPhraseList = [];
- _this.NNPEAnnotationList = [];
- _this.watchIndex = _this.queIndex + new Date().getTime();
- this.groupCheckList = [];
- let selectGropuIdList = this.previewGroupId
- ? JSON.parse(this.previewGroupId)
- : [];
- this.groupCheckList = [];
- if (_this.contextData) {
- // const list = _this.contextData;
- // if (list && list.length > 0) {
- // _this.queList = list;
- // _this.cur = list[_this.queIndex];
- _this.queTotal = 1;
- // _this.cur.cur_fn_data.forEach((item) => {
- // item.table_list.forEach((items) => {
- // items.forEach((itemss) => {
- // if (itemss.data && itemss.data.type == "NewWord_chs") {
- // _this.NNPENewWordList = _this.NNPENewWordList.concat(
- // itemss.data.option
- // );
- // } else if (itemss.data && itemss.data.type == "notes_chs") {
- // _this.NNPEAnnotationList = _this.NNPEAnnotationList.concat(
- // itemss.data.option
- // );
- // }
- // });
- // });
- // });
- // }
- _this.cur = _this.contextData;
- _this.cur.cur_fn_data.forEach((item, index) => {
- if(item.hasOwnProperty("z_title_detail")){
- if (item.z_title_detail.wordsList.length > 0) {
- item.z_title_detail.wordsList.forEach((sItem, sIndex) => {
- this.mergeWordSymbol(sItem);
- sItem.fontColor=this.themeColor==='green'?'#24b99e':this.themeColor==='brown'?'#bd8865':'#e35454'
- sItem.fontSize = '16px'
- sItem.fontWeight = 'bold'
- });
- }
- this.$set(item.z_title_detail, "config", {
- fontColor:this.themeColor==='green'?'#24b99e':this.themeColor==='brown'?'#bd8865':'#e35454',
- fontFamily: 'Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif',
- fontSize: '16px',
- fontWeight: 'bold'
- });
- }
- if(item.hasOwnProperty("f_title_detail")){
- if (item.f_title_detail.wordsList.length > 0) {
- item.f_title_detail.wordsList.forEach((sItem, sIndex) => {
- this.mergeWordSymbol(sItem);
- sItem.fontColor='#000000'
- sItem.fontSize = '16px'
- });
- }
- this.$set(item.f_title_detail, "config", {
- fontColor:'#000000',
- fontFamily: 'Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif',
- fontSize: '16px'
- });
- }
- if(item.hasOwnProperty("l_title_detail")){
- if (item.l_title_detail.wordsList.length > 0) {
- item.l_title_detail.wordsList.forEach((sItem, sIndex) => {
- this.mergeWordSymbol(sItem);
- sItem.fontColor='#000000'
- sItem.fontSize = '16px'
- });
- }
- this.$set(item.l_title_detail, "config", {
- fontColor:'#000000',
- fontFamily: 'Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif',
- fontSize: '16px'
- });
- }
- this.groupCheckList.push(false);
- selectGropuIdList.forEach((itemId) => {
- itemId.forEach((itemIds) => {
- if (item.group_id && itemIds.indexOf(item.group_id[0]) > -1) {
- item.previewShow = true;
- }
- });
- });
- item.showSubmit = false;
- item.table_list.forEach((items, indexs) => {
- items.forEach((itemss, indexss) => {
- if (itemss.data && itemss.type) {
- if (
- this.previewType &&
- this.previewType == "previewCheckShow" &&
- (JSON.parse(this.previewGroupId).length == 0 ||
- this.previewGroupId.indexOf(item.group_id[0]) > -1)||
- !this.previewType
- ) {
- if(itemss.type!='article_chs'&&itemss.type!='NewWord_chs'&&itemss.type!='dialogue_article_chs'&&itemss.type!='notes_chs'&&itemss.type!='voice_matrix'&&itemss.type!='upload_control_chs'&&itemss.type!='upload_control_preview_chs'&&itemss.type!='record_control_mini'&&itemss.type!='record_control_normal'&&itemss.type!='record_control_pro'&&itemss.type!='record_control_promax'&&itemss.type!='text_problem_chs'&&itemss.type!='newWord_preview_chs'&&itemss.type!='CourseStart_chs'&&itemss.type!='tinydemo_chs'&&itemss.type!='video_chs'&&itemss.type!='play_record_chs'&&itemss.type!='upload_pdf_chs'&&itemss.type!='options_list_chs'&&itemss.type!='sentence_listen_read_chs'&&itemss.type!='imgage_image'){
- item.showSubmit = true
- }
- }
- // else if (
- // !this.previewType ||
- // this.previewType != "previewCheckShow"
- // ) {
- // item.showSubmit = true;
- // }
- }
- if (itemss.data && itemss.data.type == "NewWord_chs") {
- _this.NNPENewWordList = _this.NNPENewWordList.concat(
- itemss.data.option
- );
- } else if (itemss.data && itemss.data.type == "notes_chs") {
- _this.NNPEAnnotationList = _this.NNPEAnnotationList.concat(
- itemss.data.option
- );
- }
- let Bookanswer = this.bookAnswerContent;
- if (Bookanswer) {
- if (this.TaskModel == "ANSWER") {
- let token = getToken();
- let roleAnswer = "studentAnswer";
- if (token) {
- let userInfor = JSON.parse(token);
- let user_type = userInfor.user_type;
- if (user_type == "TEACHER") {
- roleAnswer = "studentAnswer";
- } else {
- roleAnswer = "userAnswer";
- }
- }
- _this.judgeAnswersList = [roleAnswer, "standardAnswer"];
- } else {
- _this.judgeAnswersList = [""];
- }
- let answerData = JSON.parse(Bookanswer);
- if (answerData && itemss.data) {
- let BookanswerRes =
- answerData.length > 0 &&
- answerData[index].table_list &&
- answerData[index].table_list.length > 0 &&
- answerData[index].table_list[indexs].length > 0 &&
- answerData[index].table_list[indexs][indexss].data
- ? answerData[index].table_list[indexs][indexss].data
- .Bookanswer
- : [];
- _this.$set(itemss.data, "Bookanswer", BookanswerRes);
- }
- } else {
- _this.judgeAnswersList = [""];
- }
- });
- });
- item.ShowstandardAnswer = JSON.stringify(item.table_list).match(
- /\[JUDGE##F##JUDGE\]/g
- )
- ? true
- : false;
- });
- }
- this.$forceUpdate();
- },
- //词和标点合一起
- mergeWordSymbol(sItem) {
- if (this.titleChsFhList.indexOf(sItem.chs) > -1) {
- sItem.isShow = false;
- } else {
- sItem.isShow = true;
- }
- },
- // 上一页
- handleNNPEprev() {
- let _this = this;
- _this.puaseAudio();
- if (_this.queIndex == 0) {
- this.idArr.forEach((item, i) => {
- if (item == _this.currentTreeID) {
- if (i == 0) {
- _this.preClick = false;
- _this.nextClick = true;
- } else {
- _this.changeId(this.idArr[i - 1]);
- _this.preClick = true;
- _this.nextClick = true;
- }
- }
- });
- } else {
- _this.queIndex -= 1;
- _this.watchIndex = _this.queIndex + new Date().getTime();
- _this.cur = _this.queList[_this.queIndex];
- }
- },
- // 递归寻找相同的目录并保存目录的pid
- seekCurrentTree(item) {
- if (item.is_courseware == "true") {
- this.idArr.push(item.id);
- }
- if (item.children) {
- item.children.forEach((it, index) => {
- if (it.is_courseware == "true") {
- this.idArr.push(it.id);
- }
- if (it.children) {
- this.seekCurrentTree(it);
- }
- });
- }
- },
- puaseAudio() {
- let audio = document.getElementsByTagName("audio");
- if(audio&&audio.length>0&&window.location.href.indexOf('GCLS-Learn')==-1){
- audio.forEach((item) => {
- item.pause();
- });
- }
- let video = document.getElementsByTagName("video");
- if(video&&video.length>0&&window.location.href.indexOf('GCLS-Learn')==-1){
- video.forEach((item) => {
- item.pause();
- });
- }
- },
- // 下一页
- handleNNPEnext() {
- const _this = this;
- _this.puaseAudio();
- if (_this.queIndex == _this.queTotal - 1) {
- this.idArr.forEach((item, i) => {
- if (item == _this.currentTreeID) {
- if (i == this.idArr.length - 1) {
- _this.nextClick = false;
- _this.preClick = true;
- } else {
- _this.changeId(this.idArr[i + 1]);
- _this.nextClick = true;
- _this.preClick = true;
- }
- }
- });
- } else {
- _this.queIndex += 1;
- _this.watchIndex = _this.queIndex + new Date().getTime();
- _this.cur = _this.queList[_this.queIndex];
- }
- },
- submitUserAnswerNPC() {
- this.handleAnswerTimeEnd();
- let contextDataStr = JSON.stringify(this.contextData);
- if (!contextDataStr) {
- return;
- }
- let userErrorNumberTotal = 0;
- let userRightNumberTotal = 0;
- let errReg = /\[JUDGE##F##JUDGE\]/g,
- rightReg = /\[JUDGE##T##JUDGE\]/g;
- if (errReg.test(contextDataStr)) {
- let errorArr = contextDataStr.match(/\[JUDGE##F##JUDGE\]/g);
- userErrorNumberTotal = errorArr.length;
- }
- if (rightReg.test(contextDataStr)) {
- let rightArr = contextDataStr.match(/\[JUDGE##T##JUDGE\]/g);
- userRightNumberTotal = rightArr.length;
- }
- let contextData = JSON.parse(contextDataStr);
- let result = [];
- contextData.cur_fn_data.forEach((item, index) => {
- result[index] = {
- table_list: [],
- };
- item.table_list.forEach((items, indexs) => {
- result[index].table_list[indexs] = [];
- items.forEach((itemss, indexss) => {
- if (itemss.data) {
- let Bookanswer = itemss.data.Bookanswer;
- let obj = {
- data: {
- Bookanswer,
- },
- };
- result[index].table_list[indexs][indexss] = obj;
- } else {
- result[index].table_list[indexs][indexss] = {
- data: null,
- };
- }
- });
- });
- });
- this.$emit(
- "finishTaskMaterial",
- JSON.stringify(result),
- this.answerTime,
- userRightNumberTotal,
- userErrorNumberTotal
- );
- },
- // 开始计算答题用时
- handleAnswerTimeStart() {
- this.answerTime = 0;
- window.clearInterval(this.answerTimeInterval);
- this.answerTimeInterval = window.setInterval(() => {
- this.answerTime++;
- }, 1000);
- },
- // 结束计算答题用时
- handleAnswerTimeEnd() {
- window.clearInterval(this.answerTimeInterval);
- },
- // 提交选中groupid
- submitPreviewGroupId() {
- return JSON.stringify(this.groupIndexList);
- },
- forupdata(indexI,type) {
- if(type==='all'){
- this.groupIndexList = []
- this.cur.cur_fn_data.forEach((item,index)=>{
- this.groupIndexList.push(this.cur.cur_fn_data[index].group_id);
- })
- }else{
- if (
- this.groupIndexList
- .toString()
- .indexOf(this.cur.cur_fn_data[indexI].group_id.toString()) == -1
- ) {
- this.groupIndexList.push(this.cur.cur_fn_data[indexI].group_id);
- } else {
- this.groupIndexList.forEach((items, indexs) => {
- if (
- items.toString() == this.cur.cur_fn_data[indexI].group_id.toString()
- ) {
- this.groupIndexList.splice(indexs, 1);
- return false;
- }
- });
- }
- }
-
- this.groupCheckList.forEach((item, index) => {
- this.groupCheckList[index] = false;
- });
- if(type==='all'){
- }else{
- this.isIndeterminate = false
- }
- this.checkAllNPC = this.groupIndexList.length===this.cur.cur_fn_data.length
- this.cur.cur_fn_data.forEach((item, index) => {
- if (
- this.groupIndexList.toString().indexOf(item.group_id.toString()) > -1
- ) {
- this.groupCheckList[index] = true;
- if(type==='all'){
- }else{
- this.isIndeterminate = true
- }
- }
- });
- this.$forceUpdate();
- },
- submitLookAnswer(ItemIndex) {
- let contextData = this.contextData;
- contextData.cur_fn_data.forEach((item, index) => {
- if (index == ItemIndex) {
- item.showPreview = true;
- } else {
- item.showPreview = false;
- }
- });
- this.visiblePreviewDialog = true;
- // this.submitUserAnswerNPC();
- },
- handleCheckAllChangeNPC(val){
- if(val){
- this.forupdata('','all')
- }else{
- this.groupCheckList.forEach((item, index) => {
- this.groupCheckList[index] = false;
- });
- this.groupIndexList = []
- this.isIndeterminate = false;
- }
- }
- }, // 如果页面有keep-alive缓存功能,这个函数会触发
- };
- </script>
- <style lang="scss" scoped>
- //@import url(); 引入公共css类
- .NPC-Big-Book-preview {
- width: 860px;
- margin: 0 auto;
- position: relative;
- padding-bottom: 120px;
- .NNPE-title {
- background: #e35454;
- border-radius: 0px 0px 16px 16px;
- padding: 7px 24px;
- position: relative;
- height: 64px;
- display: flex;
- align-items: center;
- &.NNPE-title-gray {
- background: #eeeeee;
- border-radius: 0;
- margin-top: 24px;
- .NNPE-operate {
- position: absolute;
- top: 10px;
- right: 20px;
- a {
- background: #fff url("../../assets/newImage/common/btn-pre-black.png")
- center no-repeat;
- background-size: 24px;
- &.btn-next {
- background: #fff
- url("../../assets/newImage/common/btn-next-black.png") center
- no-repeat;
- background-size: 24px;
- }
- &:hover {
- background-color: #fff;
- }
- &:active {
- background-color: #fff;
- }
- &.btn-prev-disabled,
- &.btn-next-disabled {
- background-color: rgba(0, 0, 0, 0.25);
- }
- }
- }
- }
- h1 {
- color: #ffffff;
- font-weight: bold;
- font-size: 16px;
- line-height: 150%;
- margin: 0;
- }
- .NNPE-title-left {
- display: flex;
- color: #ffffff;
- font-size: 18px;
- line-height: 18px;
- align-items: center;
- .NNPE-title-item {
- margin-right: 12px;
- }
- .content-con {
- margin: 4px 0;
- font-family: "robot";
- &.hasCn,
- &.hanzi {
- font-family: "FZJCGFKTK";
- }
- &.en{
- font-family: "robot";
- }
- }
- .content-en {
- font-weight: normal;
- line-height: 18px;
- font-family: "robot";
- }
- .NNPE-title-item-en {
- font-weight: normal;
- line-height: 12px;
- font-family: "robot";
- font-size: 12px;
- margin: 0;
- }
- .con-box {
- display: flex;
- flex-flow: wrap;
- justify-content: center;
- align-items: flex-end;
- .con-item {
- text-align: center;
- padding: 0 1px;
- }
- span {
- display: block;
- }
- .pinyin {
- font-family: "GB-PINYINOK-B";
- font-size: 12px;
- line-height: 12px;
- height: 12px;
- &.noFont {
- font-family: initial;
- }
- }
- .synthesis-box {
- display: flex;
- }
- }
- }
- .NNPE-operate {
- position: absolute;
- top: 10px;
- right: 20px;
- a {
- background: #e35454 url("../../assets/newImage/common/btn-pre.png")
- center no-repeat;
- background-size: 24px;
- border-radius: 4px;
- width: 44px;
- height: 44px;
- display: inline-block;
- margin: 0 4px;
- &.btn-next {
- background: #e35454 url("../../assets/newImage/common/btn-next.png")
- center no-repeat;
- background-size: 24px;
- }
- &:hover {
- background-color: #f76565;
- }
- &:active {
- background-color: #d24444;
- }
- &.btn-prev-disabled,
- &.btn-next-disabled {
- background-color: rgba(0, 0, 0, 0.25);
- cursor: not-allowed;
- }
- }
- }
- }
- .classTopic-box {
- background: #e35454;
- border-radius: 8px;
- width: 780px;
- margin: 24px auto 0 auto;
- text-align: center;
- padding: 8px 24px;
- span {
- font-size: 16px;
- line-height: 150%;
- color: #ffffff;
- padding: 0 1px;
- &.cn {
- font-family: "FZJCGFKTK";
- }
- &.en {
- font-family: "robot";
- }
- &.pinyin {
- font-family: "GB-PINYINOK-B";
- }
- }
- }
- .NNPE-Book-content-inner {
- padding: 0 40px;
- .NNPE-Book-content-item {
- position: relative;
- }
- .NNPE-Book-content-item-checkbox {
- position: absolute;
- left: -30px;
- top: 36px;
- }
- > div.title-box-preview {
- padding-top: 32px;
- .title-big {
- display: flex;
- b {
- min-width: 39px;
- height: 24px;
- background: #e35454;
- border-radius: 8px;
- color: #ffffff;
- font-family: "robot";
- display: inline-block;
- text-align: center;
- font-size: 16px;
- line-height: 150%;
- margin-right: 12px;
- padding: 0 4px;
- }
- h2 {
- color: #e35454;
- font-size: 16px;
- line-height: 150%;
- font-weight: bold;
- white-space: pre-wrap;
- word-break: break-word;
- margin: 0;
- }
- h3 {
- color: #000000;
- font-size: 16px;
- line-height: 150%;
- font-weight: normal;
- margin: 0;
- white-space: pre-wrap;
- word-break: break-word;
- }
- .title-box-right-index {
- padding-left: 51px;
- }
- }
- .title-little {
- display: flex;
- margin-bottom: 24px;
- &.marginTop {
- margin-top: 24px;
- }
- b,
- p {
- color: #000000;
- font-size: 16px;
- line-height: 150%;
- font-weight: normal;
- margin: 0;
- white-space: pre-wrap;
- word-break: break-word;
- padding-right: 3px;
- }
- }
- }
- .NNPE-tableList {
- background: #fff;
- border-radius: 8px;
- // padding: 12px 8px;
- &.NNPE-tableList-hasBg {
- background: #f7f7f7;
- border: 1px solid rgba(0, 0, 0, 0.1);
- box-sizing: border-box;
- border-radius: 8px;
- }
- .NNPE-tableList-tr {
- display: flex;
- justify-content: space-between;
- // flex-flow: wrap;
- .NNPE-tableList-item {
- width: 100%;
- // margin: 12px 16px;
- // padding: 16px;
- // background: #FFFFFF;
- // border-radius: 4px;
- display: flex;
- flex-flow: wrap;
- justify-content: center;
- &.NNPE-tableList-item-noMargin {
- margin: 0;
- }
- &.NNPE-tableList-item2 {
- width: 378px;
- }
- &.NNPE-tableList-item3 {
- width: 244px;
- }
- &.NNPE-tableList-item4 {
- width: 195px;
- }
- }
- }
- }
- }
- .submitAnswer {
- width: 160px;
- height: 44px;
- border-radius: 4px;
- font-size: 16px;
- line-height: 44px;
- text-align: center;
- font-family: robot;
- background: #e35454;
- color: #fff;
- margin-left: 16px;
- &:hover {
- background-color: #f76565;
- }
- &:active {
- background-color: #d24444;
- }
- }
- }
- .submitLookAnswer {
- color: #fff;
- font-weight: 700;
- font-size: 16px;
- line-height: 24px;
- width: 106px;
- height: 40px;
- background: #e35454;
- border-radius: 8px;
- display: inline-block;
- line-height: 40px;
- text-align: center;
- font-family: "sourceR";
- }
- .NPC-Big-Book-preview-green {
- .submitLookAnswer {
- background: #24b99e;
- }
- .NNPE-title {
- background: #24b99e;
- .NNPE-operate {
- a {
- background: #24b99e url("../../assets/newImage/common/btn-pre.png")
- center no-repeat;
- background-size: 24px;
- &.btn-next {
- background: #24b99e url("../../assets/newImage/common/btn-next.png")
- center no-repeat;
- background-size: 24px;
- }
- &:hover {
- background-color: #3dd4b8;
- }
- &:active {
- background-color: #1fa189;
- }
- }
- }
- }
- .submitAnswer {
- background: #24b99e;
- &:hover {
- background-color: #3dd4b8;
- }
- &:active {
- background-color: #1fa189;
- }
- }
- .classTopic-box {
- background: #24b99e;
- }
- .NNPE-Book-content-inner {
- > div.title-box-preview {
- .title-big {
- b {
- background: #24b99e;
- }
- h2 {
- color: #24b99e;
- }
- }
- }
- }
- }
- .NPC-Big-Book-preview-brown {
- .submitLookAnswer {
- background: #bd8865;
- }
- .NNPE-title {
- background: #bd8865;
- .NNPE-operate {
- a {
- background: #bd8865 url("../../assets/newImage/common/btn-pre.png")
- center no-repeat;
- background-size: 24px;
- &.btn-next {
- background: #bd8865 url("../../assets/newImage/common/btn-next.png")
- center no-repeat;
- background-size: 24px;
- }
- &:hover {
- background-color: #d6a687;
- }
- &:active {
- background-color: #a37557;
- }
- }
- }
- }
- .submitAnswer {
- background: #bd8865;
- &:hover {
- background-color: #d6a687;
- }
- &:active {
- background-color: #a37557;
- }
- }
- .classTopic-box {
- background: #bd8865;
- }
- .NNPE-Book-content-inner {
- > div.title-box-preview {
- .title-big {
- b {
- background: #bd8865;
- }
- h2 {
- color: #bd8865;
- }
- }
- }
- }
- }
- </style>
- <style lang="scss">
- .NNPE-Book-content-item-checkbox {
- .el-checkbox__input.is-indeterminate .el-checkbox__inner::before{
- top: 9px;
- }
- .el-checkbox__inner {
- border: 2px solid #4a99ea;
- width: 24px;
- height: 24px;
- }
- .el-checkbox__inner::after {
- border-width: 2px;
- height: 11px;
- left: 8px;
- top: 2px;
- }
- }
- .previewDialog {
- .el-dialog {
- border-radius: 20px;
- }
- .el-dialog__body,
- .el-dialog__header {
- padding: 0;
- }
- .previewDialog-title {
- padding: 26px 40px;
- border-bottom: 1px solid rgba(51, 51, 51, 0.1);
- position: relative;
- h2 {
- font-weight: 700;
- font-size: 20px;
- line-height: 28px;
- margin: 0;
- font-family: "D-DIN";
- white-space: pre-wrap;
- word-break: break-word;
- }
- a {
- position: absolute;
- width: 32px;
- height: 32px;
- right: 40px;
- top: 26px;
- img {
- width: 100%;
- height: 100%;
- }
- }
- }
- .previewDialog-content {
- max-height: 70vh;
- overflow-y: auto;
- }
- }
- </style>
|