adultInput.vue 74 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158
  1. <!-- -->
  2. <template>
  3. <div v-loading="loading" class="Big-Book-container adult-book-input-sty">
  4. <Header />
  5. <div class="Big-Book-content">
  6. <div class="content-tree">
  7. <Catelog
  8. :book-id="bookId"
  9. :book-level="bookLevel"
  10. :book-node-index="bookIndex"
  11. :change-id="changeId"
  12. :change-tree-data="changeTreeData"
  13. :current-tree-i-d="currentTreeID"
  14. :emptyQustion="emptyQustion"
  15. />
  16. </div>
  17. <div v-if="currentTreeID" class="Book-content">
  18. <div class="Big-Book-save Big-Book-input-save">
  19. <el-button type="primary" @click="onSave">保 存</el-button>
  20. <el-button type="danger" plain @click="onPreview">预 览</el-button>
  21. </div>
  22. <!-- <el-tabs
  23. v-model="editableTabsValue"
  24. type="card"
  25. editable
  26. @edit="handleTabsEdit"
  27. @tab-click="tabClick"
  28. >
  29. <el-tab-pane
  30. v-for="(item, index) in question_list"
  31. :key="item.name"
  32. :label="item.title"
  33. :name="item.name"
  34. > -->
  35. <div
  36. v-for="(fc, fcIndex) in question_list.detailList"
  37. :key="'fc' + fcIndex"
  38. style="
  39. position: relative;
  40. margin-bottom: 20px;
  41. padding-bottom: 10px;
  42. border-bottom: 1px dotted #ccc;
  43. "
  44. >
  45. <SentenceSegwordChs :cur-que="fc.detail" type="adultinput" />
  46. <img
  47. style="position: absolute; right: 20px; top: 2px"
  48. class="close"
  49. src="../assets/adult/del-close.png"
  50. alt=""
  51. @click="deleteDetail(fcIndex)"
  52. />
  53. <div class="Big-Book-top" style="margin: 10px 0">
  54. <span>英文</span>
  55. <el-input
  56. v-model="fc.en"
  57. style="width: 80%"
  58. type="textarea"
  59. autosize
  60. placeholder="请输入英文"
  61. maxlength="200"
  62. show-word-limit
  63. @blur="onBlur(fc, 'en')"
  64. />
  65. </div>
  66. </div>
  67. <div class="addoption" @click="addDetail">添加分句</div>
  68. <div
  69. v-for="(kt, ktIndex) in question_list.classTopic"
  70. :key="'kt' + ktIndex"
  71. style="
  72. position: relative;
  73. margin-bottom: 20px;
  74. padding-bottom: 10px;
  75. border-bottom: 1px dotted #ccc;
  76. "
  77. >
  78. <div class="Big-Book-top" style="margin: 10px 0">
  79. <span>课题</span>
  80. <el-input
  81. v-model="kt.con"
  82. style="width: 80%"
  83. type="textarea"
  84. autosize
  85. placeholder="请输入课题"
  86. maxlength="200"
  87. show-word-limit
  88. @blur="onBlur(kt, 'con')"
  89. />
  90. <img
  91. style="position: absolute; right: 20px; top: 2px"
  92. class="close"
  93. src="../assets/adult/del-close.png"
  94. alt=""
  95. @click="deleteClassTopic(ktIndex)"
  96. />
  97. </div>
  98. <div class="Big-Book-top" style="margin: 10px 0">
  99. <span>字体</span>
  100. <el-radio-group v-model="kt.font">
  101. <el-radio label="cn">中文字体</el-radio>
  102. <el-radio label="en">英文字体</el-radio>
  103. <el-radio label="pinyin">拼音字体</el-radio>
  104. </el-radio-group>
  105. </div>
  106. </div>
  107. <div class="addoption" @click="addClassTopic">添加课题</div>
  108. <div class="createTable">
  109. <el-input
  110. v-model="row"
  111. maxlength="2"
  112. style="width: 50px"
  113. type="text"
  114. @input="rowLine('row')"
  115. />*<el-input
  116. v-model="line"
  117. style="width: 50px"
  118. type="text"
  119. maxlength="2"
  120. @input="rowLine('line')"
  121. />
  122. <el-button
  123. style="margin-left: 10px"
  124. type="primary"
  125. @click="createTable"
  126. >增加题</el-button
  127. >
  128. </div>
  129. <div
  130. v-for="(topic, toindex) in question_list.cur_fn_data"
  131. :key="'topic' + toindex"
  132. >
  133. <div class="topTitle">
  134. <div style="display: flex; align-items: center">
  135. <p>第{{ toindex + 1 }}题</p>
  136. <el-checkbox
  137. v-model="groupIndexList"
  138. :label="toindex"
  139. style="margin: 0 10px"
  140. ><br /></el-checkbox
  141. ><span>{{ topic.group_name }}</span>
  142. </div>
  143. <span @click="handleChangeTab(topic)">
  144. {{ topic.contentShow ? "收起" : "展开" }}
  145. <img
  146. v-if="topic.contentShow"
  147. src="../assets/NPC/down-black.png"
  148. alt=""
  149. />
  150. <img v-else src="../assets/NPC/up-black.png" alt="" />
  151. </span>
  152. </div>
  153. <el-collapse-transition>
  154. <div v-show="topic.contentShow" class="collapse-box">
  155. <div class="adult-book-input-item">
  156. <span class="adult-book-lable">序号:</span>
  157. <el-input
  158. v-model="topic.number"
  159. type="textarea"
  160. :autosize="{ minRows: 2 }"
  161. placeholder="请输入序号"
  162. maxlength="200"
  163. show-word-limit
  164. @blur="onBlur(topic, 'number')"
  165. />
  166. </div>
  167. <div class="adult-book-input-item">
  168. <span class="adult-book-lable">正标题:</span>
  169. <el-input
  170. v-model="topic.z_title"
  171. type="textarea"
  172. :autosize="{ minRows: 2 }"
  173. placeholder="请输入正标题"
  174. maxlength="500"
  175. show-word-limit
  176. @blur="onBlur(topic, 'z_title')"
  177. />
  178. </div>
  179. <div class="adult-book-input-item">
  180. <span class="adult-book-lable">副标题:</span>
  181. <el-input
  182. v-model="topic.f_title"
  183. :autosize="{ minRows: 2 }"
  184. type="textarea"
  185. placeholder="请输入副标题"
  186. maxlength="500"
  187. show-word-limit
  188. @blur="onBlur(topic, 'f_title')"
  189. />
  190. </div>
  191. <div class="adult-book-input-item">
  192. <span class="adult-book-lable">标题:</span>
  193. <div style="width: 100%">
  194. <div
  195. style="
  196. display: flex;
  197. align-items: flex-start;
  198. margin-bottom: 10px;
  199. "
  200. >
  201. <el-input
  202. v-model="topic.little_title_number"
  203. style="width: 20%"
  204. type="textarea"
  205. placeholder="请输入标题题号"
  206. maxlength="200"
  207. show-word-limit
  208. @input="forupdata"
  209. @blur="onBlur(topic, 'little_title_number')"
  210. />
  211. <el-input
  212. v-model="topic.little_title"
  213. style="width: 70%; margin-left: 10px"
  214. type="textarea"
  215. placeholder="请输入标题内容"
  216. maxlength="500"
  217. show-word-limit
  218. @input="forupdata"
  219. @blur="onBlur(topic, 'little_title')"
  220. />
  221. </div>
  222. </div>
  223. </div>
  224. <div class="Big-Book-top">
  225. <span>正副标题缩进</span>
  226. <el-radio v-model="topic.is_textIndex" :label="true"
  227. >是</el-radio
  228. >
  229. <el-radio v-model="topic.is_textIndex" :label="false"
  230. >否</el-radio
  231. >
  232. </div>
  233. <div class="Big-Book-top">
  234. <span>是否有背景色</span>
  235. <el-radio v-model="topic.is_bg" :label="true">有</el-radio>
  236. <el-radio v-model="topic.is_bg" :label="false">无</el-radio>
  237. </div>
  238. <div class="Big-Book-top">
  239. <span>是否有背景图</span>
  240. <el-radio v-model="topic.is_layout" :label="true">有</el-radio>
  241. <el-radio v-model="topic.is_layout" :label="false">无</el-radio>
  242. </div>
  243. <div
  244. v-for="(rowItem, rowIndex) in topic.table_list"
  245. :key="'row' + rowIndex"
  246. >
  247. <div
  248. v-for="(topicIitem, lineIndex) in rowItem"
  249. :key="lineIndex"
  250. :style="{ 'border-bottom': '2px #999 dotted' }"
  251. >
  252. <p>{{ topicIitem.text }}</p>
  253. <div>
  254. <template
  255. v-if="
  256. topicIitem.type == 'article_chs' ||
  257. (topicIitem.data &&
  258. topicIitem.data.type == 'article_chs')
  259. "
  260. >
  261. <template v-if="topicIitem.is_edit">
  262. <ArticleTemChs
  263. :cur-que="topicIitem.data"
  264. :change-cur-que="changeCurQue"
  265. v-if="refresh"
  266. />
  267. </template>
  268. <template v-else>
  269. <!-- <ArticleView :cur-que="topicIitem.data" /> -->
  270. </template>
  271. </template>
  272. <template v-if="topicIitem.type == 'sentence_segword_chs'">
  273. <template v-if="topicIitem.is_edit">
  274. <SentenceSegwordChs
  275. :cur-que="topicIitem.data"
  276. :change-cur-que="changeCurQue"
  277. v-if="refresh"
  278. />
  279. </template>
  280. <template v-else>
  281. <!-- <ArticleView :cur-que="topicIitem.data" /> -->
  282. </template>
  283. </template>
  284. <template v-if="topicIitem.type == 'dialogue_article_chs'">
  285. <template v-if="topicIitem.is_edit">
  286. <DialogueArticleChs
  287. :cur-que="topicIitem.data"
  288. :change-cur-que="changeCurQue"
  289. v-if="refresh"
  290. />
  291. </template>
  292. <template v-else>
  293. <!-- <ArticleView :curQue="topicIitem.que" /> -->
  294. </template>
  295. </template>
  296. <template v-if="topicIitem.type == 'dialogue_answer_chs'">
  297. <template v-if="topicIitem.is_edit">
  298. <DialogueAnswerChs
  299. :cur-que="topicIitem.data"
  300. :change-cur-que="changeCurQue"
  301. v-if="refresh"
  302. />
  303. </template>
  304. <template v-else>
  305. <!-- <ArticleView :curQue="topicIitem.que" /> -->
  306. </template>
  307. </template>
  308. <template v-if="topicIitem.type == 'NewWord_chs'">
  309. <template v-if="topicIitem.is_edit">
  310. <Neword
  311. :cur-que="topicIitem.data"
  312. :change-cur-que="changeCurQue"
  313. v-if="refresh"
  314. />
  315. </template>
  316. <template v-else>
  317. <NewordPhraseview :cur-que="topicIitem.data" />
  318. </template>
  319. </template>
  320. <template v-if="topicIitem.type == 'notes_chs'">
  321. <template v-if="topicIitem.is_edit">
  322. <Notes
  323. :cur-que="topicIitem.data"
  324. :change-cur-que="changeCurQue"
  325. v-if="refresh"
  326. />
  327. </template>
  328. <template v-else>
  329. <NewordPhraseview :cur-que="topicIitem.data" />
  330. </template>
  331. </template>
  332. <template v-if="topicIitem.type == 'input_record_chs'">
  333. <template v-if="topicIitem.is_edit">
  334. <InputRecord
  335. :cur-que="topicIitem.data"
  336. :fn_data="fn_data"
  337. :change-cur-que="changeCurQue"
  338. v-if="refresh"
  339. />
  340. </template>
  341. <template v-else />
  342. </template>
  343. <template
  344. v-if="
  345. topicIitem.type == 'recordHZ_inputPY_chs' ||
  346. topicIitem.type == 'inputItem_chs' ||
  347. topicIitem.type == 'sentence_input_chs' ||
  348. topicIitem.type == 'sentence_judge_chs' ||
  349. topicIitem.type == 'sentence_record_chs' ||
  350. topicIitem.type == 'sentence_input_record_chs' ||
  351. topicIitem.type == 'sentence_listen_read_chs'
  352. "
  353. >
  354. <template v-if="topicIitem.is_edit">
  355. <Sentence
  356. :cur-que="topicIitem.data"
  357. :type="topicIitem.type"
  358. :fn_data="fn_data"
  359. :change-cur-que="changeCurQue"
  360. v-if="refresh"
  361. />
  362. </template>
  363. <template v-else />
  364. </template>
  365. <template v-if="topicIitem.type == 'sudoku_chs'">
  366. <template v-if="topicIitem.is_edit">
  367. <Sudoku
  368. :cur-que="topicIitem.data"
  369. :type="topicIitem.type"
  370. :fn_data="fn_data"
  371. :change-cur-que="changeCurQue"
  372. v-if="refresh"
  373. />
  374. </template>
  375. <template v-else />
  376. </template>
  377. <template v-if="topicIitem.type == 'NumberCombination_chs'">
  378. <template v-if="topicIitem.is_edit">
  379. <NumberCombination
  380. :cur-que="topicIitem.data"
  381. :type="topicIitem.type"
  382. :fn_data="fn_data"
  383. :change-cur-que="changeCurQue"
  384. v-if="refresh"
  385. />
  386. </template>
  387. <template v-else />
  388. </template>
  389. <template v-if="topicIitem.type == 'toneSelect_chs'">
  390. <template v-if="topicIitem.is_edit">
  391. <ToneSelect
  392. :cur-que="topicIitem.data"
  393. :type="topicIitem.type"
  394. :fn_data="fn_data"
  395. :change-cur-que="changeCurQue"
  396. v-if="refresh"
  397. />
  398. </template>
  399. <template v-else />
  400. </template>
  401. <template v-if="topicIitem.type === 'voice_matrix'">
  402. <template v-if="topicIitem.is_edit">
  403. <voice-matrix
  404. :cur-que="topicIitem.data"
  405. :change-cur-que="changeCurQue"
  406. v-if="refresh"
  407. />
  408. </template>
  409. </template>
  410. <template v-if="topicIitem.type === 'select_drag'">
  411. <select-drag
  412. :cur-que="topicIitem.data"
  413. :change-cur-que="changeCurQue"
  414. v-if="refresh"
  415. />
  416. </template>
  417. <template v-if="topicIitem.type === 'config_table'">
  418. <configurable-table
  419. :cur-que="topicIitem.data"
  420. :change-cur-que="changeCurQue"
  421. />
  422. </template>
  423. <template v-if="topicIitem.type === 'header_separate'">
  424. <header-separate
  425. :cur-que="topicIitem.data"
  426. :change-cur-que="changeCurQue"
  427. v-if="refresh"
  428. />
  429. </template>
  430. <template v-if="topicIitem.type === 'fill_drag'">
  431. <fill-drag
  432. :cur-que="topicIitem.data"
  433. :change-cur-que="changeCurQue"
  434. v-if="refresh"
  435. />
  436. </template>
  437. <template v-if="topicIitem.type == 'ligature_chs'">
  438. <template v-if="topicIitem.is_edit">
  439. <Ligature
  440. :cur-que="topicIitem.data"
  441. :fn_data="fn_data"
  442. :change-cur-que="changeCurQue"
  443. :type="topicIitem.type"
  444. v-if="refresh"
  445. />
  446. </template>
  447. <template v-else>
  448. <Ligatureview :cur-que="topicIitem.data" />
  449. </template>
  450. </template>
  451. <template
  452. v-if="topicIitem.type == 'image_question_input_record'"
  453. >
  454. <template v-if="topicIitem.is_edit">
  455. <ImageQuestion
  456. :cur-que="topicIitem.data"
  457. :type="topicIitem.type"
  458. :fn_data="fn_data"
  459. :change-cur-que="changeCurQue"
  460. v-if="refresh"
  461. />
  462. </template>
  463. <template v-else />
  464. </template>
  465. <template
  466. v-if="
  467. topicIitem.type == 'single_chs' ||
  468. topicIitem.type == 'checkbox_chs' ||
  469. topicIitem.type == 'listen_record_single_chs'
  470. "
  471. >
  472. <template v-if="topicIitem.is_edit">
  473. <Single
  474. :cur-que="topicIitem.data"
  475. :type="topicIitem.type"
  476. :fn_data="fn_data"
  477. :change-cur-que="changeCurQue"
  478. v-if="refresh"
  479. />
  480. </template>
  481. <template v-else />
  482. </template>
  483. <template
  484. v-if="
  485. topicIitem.type == 'text_problem_chs' ||
  486. topicIitem.type == 'newWord_preview_chs' ||
  487. topicIitem.type == 'listen_record_single_syllable_chs'
  488. "
  489. >
  490. <template v-if="topicIitem.is_edit">
  491. <PurePreview
  492. :cur-que="topicIitem.data"
  493. :type="topicIitem.type"
  494. :fn_data="fn_data"
  495. :change-cur-que="changeCurQue"
  496. v-if="refresh"
  497. />
  498. </template>
  499. <template v-else />
  500. </template>
  501. <template
  502. v-if="topicIitem.type == 'zi_transverse_line_chs'"
  503. >
  504. <template v-if="topicIitem.is_edit">
  505. <ZiLine
  506. :cur-que="topicIitem.data"
  507. :type="topicIitem.type"
  508. :fn_data="fn_data"
  509. :change-cur-que="changeCurQue"
  510. v-if="refresh"
  511. />
  512. </template>
  513. <template v-else />
  514. </template>
  515. <template v-if="topicIitem.type == 'select_input_chs'">
  516. <template v-if="topicIitem.is_edit">
  517. <SelectInpue
  518. :cur-que="topicIitem.data"
  519. :type="topicIitem.type"
  520. :fn_data="fn_data"
  521. :change-cur-que="changeCurQue"
  522. v-if="refresh"
  523. />
  524. </template>
  525. <template v-else />
  526. </template>
  527. <template v-if="topicIitem.type == 'play_input_record_chs'">
  528. <template v-if="topicIitem.is_edit">
  529. <PlayInputReacord
  530. :cur-que="topicIitem.data"
  531. :type="topicIitem.type"
  532. :fn_data="fn_data"
  533. :change-cur-que="changeCurQue"
  534. v-if="refresh"
  535. />
  536. </template>
  537. <template v-else />
  538. </template>
  539. <template
  540. v-if="
  541. topicIitem.type == 'imgage_image' ||
  542. topicIitem.type == 'image_checkBox' ||
  543. topicIitem.type == 'image_judge' ||
  544. topicIitem.type == 'image_single' ||
  545. topicIitem.type == 'image_dobleinput' ||
  546. topicIitem.type == 'image_gdcy' ||
  547. topicIitem.type == 'image_input'
  548. "
  549. >
  550. <template v-if="topicIitem.is_edit">
  551. <Picture
  552. :cur-que="topicIitem.data"
  553. :type="topicIitem.type"
  554. :fn_data="fn_data"
  555. :change-cur-que="changeCurQue"
  556. v-if="refresh"
  557. />
  558. </template>
  559. <template v-else />
  560. </template>
  561. <!-- <template v-if="topicIitem.type == 'drag_chs'">
  562. <template v-if="topicIitem.is_edit">
  563. <Drag
  564. :curQue="topicIitem.data"
  565. :type="topicIitem.type"
  566. :fn_data="fn_data"
  567. :changeCurQue="changeCurQue"
  568. />
  569. </template>
  570. <template v-else> </template>
  571. </template> -->
  572. <template
  573. v-if="topicIitem.type == 'checkbox_self_assessment_chs'"
  574. >
  575. <template v-if="topicIitem.is_edit">
  576. <SelfAssessment
  577. :cur-que="topicIitem.data"
  578. :type="topicIitem.type"
  579. :fn_data="fn_data"
  580. :change-cur-que="changeCurQue"
  581. v-if="refresh"
  582. />
  583. </template>
  584. <template v-else />
  585. </template>
  586. <template v-if="topicIitem.type == 'sort_chs'">
  587. <template v-if="topicIitem.is_edit">
  588. <Sort
  589. :cur-que="topicIitem.data"
  590. :type="topicIitem.type"
  591. :fn_data="fn_data"
  592. :change-cur-que="changeCurQue"
  593. v-if="refresh"
  594. />
  595. </template>
  596. <template v-else>
  597. <SentenceSortQP
  598. :cur-que="topicIitem.data"
  599. :type="topicIitem.type"
  600. :fn_data="fn_data"
  601. />
  602. </template>
  603. </template>
  604. <template v-if="topicIitem.type == 'CourseStart_chs'">
  605. <template v-if="topicIitem.is_edit">
  606. <CourseStart
  607. :cur-que="topicIitem.data"
  608. :type="topicIitem.type"
  609. :fn_data="fn_data"
  610. :change-cur-que="changeCurQue"
  611. v-if="refresh"
  612. />
  613. </template>
  614. <template v-else />
  615. </template>
  616. <template
  617. v-if="
  618. topicIitem.type == 'record_control_mini' ||
  619. topicIitem.type == 'record_control_normal' ||
  620. topicIitem.type == 'record_control_pro' ||
  621. topicIitem.type == 'record_control_promax'
  622. "
  623. >
  624. <template v-if="topicIitem.is_edit">
  625. <RecordControl
  626. :cur-que="topicIitem.data"
  627. :type="topicIitem.type"
  628. :fn_data="fn_data"
  629. :change-cur-que="changeCurQue"
  630. v-if="refresh"
  631. />
  632. </template>
  633. <template v-else />
  634. </template>
  635. <template
  636. v-if="
  637. topicIitem.type == 'upload_control_chs' ||
  638. topicIitem.type == 'upload_control_preview_chs'
  639. "
  640. >
  641. <template v-if="topicIitem.is_edit">
  642. <UploadControl
  643. :cur-que="topicIitem.data"
  644. :type="topicIitem.type"
  645. :fn_data="fn_data"
  646. :change-cur-que="changeCurQue"
  647. v-if="refresh"
  648. />
  649. </template>
  650. <template v-else>
  651. <UploadControlView
  652. :type="topicIitem.type"
  653. :cur-que="topicIitem.data"
  654. :fn_data="fn_data"
  655. />
  656. </template>
  657. </template>
  658. <template v-if="topicIitem.type == 'tinydemo_chs'">
  659. <template v-if="topicIitem.is_edit">
  660. <Tinydemo
  661. :cur-que="topicIitem.data"
  662. :type="topicIitem.type"
  663. :fn_data="fn_data"
  664. :change-cur-que="changeCurQue"
  665. :number="
  666. currentTreeID + toindex + rowIndex + lineIndex
  667. "
  668. v-if="refresh"
  669. />
  670. </template>
  671. <template v-else />
  672. </template>
  673. <template v-if="topicIitem.type == 'switch_control_chs'">
  674. <template v-if="topicIitem.is_edit">
  675. <SuitchControl
  676. :cur-que="topicIitem.data"
  677. :type="topicIitem.type"
  678. :fn_data="fn_data"
  679. :change-cur-que="changeCurQue"
  680. v-if="refresh"
  681. />
  682. </template>
  683. <template v-else />
  684. </template>
  685. <template v-if="topicIitem.type == 'video_chs'">
  686. <template v-if="topicIitem.is_edit">
  687. <VideoControl
  688. :cur-que="topicIitem.data"
  689. :type="topicIitem.type"
  690. :fn_data="fn_data"
  691. :change-cur-que="changeCurQue"
  692. v-if="refresh"
  693. />
  694. </template>
  695. <template v-else>
  696. <!-- <VideoControlView
  697. :curQue="topicIitem.data"
  698. :type="topicIitem.type"
  699. :fn_data="fn_data"
  700. /> -->
  701. </template>
  702. </template>
  703. <template v-if="topicIitem.type == 'table_chs'">
  704. <template v-if="topicIitem.is_edit">
  705. <Table
  706. :cur-que="topicIitem.data"
  707. :type="topicIitem.type"
  708. :fn_data="fn_data"
  709. :change-cur-que="changeCurQue"
  710. v-if="refresh"
  711. />
  712. </template>
  713. <template v-else>
  714. <TableView
  715. :cur-que="topicIitem.data"
  716. :type="topicIitem.type"
  717. :fn_data="fn_data"
  718. />
  719. </template>
  720. </template>
  721. <template v-if="topicIitem.type == 'play_record_chs'">
  722. <template v-if="topicIitem.is_edit">
  723. <PlayRecord
  724. :cur-que="topicIitem.data"
  725. :type="topicIitem.type"
  726. :fn_data="fn_data"
  727. :change-cur-que="changeCurQue"
  728. v-if="refresh"
  729. />
  730. </template>
  731. <template v-else>
  732. <PlayRecordView
  733. :cur-que="topicIitem.data"
  734. :type="topicIitem.type"
  735. :fn_data="fn_data"
  736. />
  737. </template>
  738. </template>
  739. <template v-if="topicIitem.type == 'upload_pdf_chs'">
  740. <template v-if="topicIitem.is_edit">
  741. <UploadPdf
  742. :cur-que="topicIitem.data"
  743. :type="topicIitem.type"
  744. :fn_data="fn_data"
  745. :change-cur-que="changeCurQue"
  746. v-if="refresh"
  747. />
  748. </template>
  749. <template v-else />
  750. </template>
  751. <template v-if="topicIitem.type == 'sentence_segtemp_chs'">
  752. <template v-if="topicIitem.is_edit">
  753. <SentenceModule
  754. :curQue="topicIitem.data"
  755. :type="topicIitem.type"
  756. :changeCurQue="changeCurQue"
  757. v-if="refresh"
  758. />
  759. </template>
  760. <template v-else> </template>
  761. </template>
  762. <template v-if="topicIitem.type == 'options_list_chs'">
  763. <template v-if="topicIitem.is_edit">
  764. <OptionsList
  765. :curQue="topicIitem.data"
  766. :type="topicIitem.type"
  767. :changeCurQue="changeCurQue"
  768. v-if="refresh"
  769. />
  770. </template>
  771. <template v-else> </template>
  772. </template>
  773. </div>
  774. <div
  775. v-if="topicIitem.data && topicIitem.is_edit"
  776. class="addoption"
  777. @click="
  778. remoeModule(toindex, rowIndex, lineIndex, topicIitem)
  779. "
  780. >
  781. 删除模板 <br />{{
  782. topicIitem.data.name + "( " + topicIitem.type + " )"
  783. }}
  784. </div>
  785. <div
  786. v-else-if="
  787. TopicIndex == toindex &&
  788. RowIndex == rowIndex &&
  789. lineIndex == LineIndex
  790. "
  791. class="addoption"
  792. >
  793. 选择模板
  794. </div>
  795. <div
  796. v-if="!topicIitem.data && topicIitem.is_add_module"
  797. class="addoption"
  798. @click="addModule(toindex, rowIndex, lineIndex, topicIitem)"
  799. >
  800. 添加模板
  801. </div>
  802. <template v-if="topicIitem.data">
  803. <div v-if="topicIitem.is_edit" class="Big-Book-save">
  804. <el-button
  805. type="success"
  806. size="small"
  807. @click="onSure(topicIitem)"
  808. >确定</el-button
  809. >
  810. </div>
  811. <div v-else class="Big-Book-save">
  812. <el-button
  813. type="primary"
  814. size="small"
  815. @click.stop="editCurQue(topicIitem)"
  816. >编辑</el-button
  817. >
  818. </div>
  819. </template>
  820. </div>
  821. <div style="display: flex">
  822. <div class="addoption" @click="removeRow(rowIndex, toindex)">
  823. 删除当前行
  824. </div>
  825. <div
  826. style="margin-left: 10px"
  827. class="addoption"
  828. @click="addRow('front', rowIndex, toindex)"
  829. >
  830. 在当前行前增加行
  831. </div>
  832. <div
  833. style="margin-left: 10px"
  834. class="addoption"
  835. @click="addRow('behind', rowIndex, toindex)"
  836. >
  837. 在当前行后增加行
  838. </div>
  839. </div>
  840. </div>
  841. </div>
  842. </el-collapse-transition>
  843. </div>
  844. <!-- </el-tab-pane> -->
  845. <!-- </el-tabs> -->
  846. </div>
  847. <div v-if="currentTreeID" class="Book-function">
  848. <el-button type="success" @click="handleSetGroup" size="medium"
  849. >设置分组</el-button
  850. >
  851. <ul class="function-list">
  852. <li
  853. v-for="(item, index) in fn_data"
  854. :key="'fn' + index"
  855. @click="selectedFnType(item, index)"
  856. >
  857. <el-dropdown v-if="item.list">
  858. <span class="fn-name">
  859. {{ item.name }}<i class="el-icon-arrow-down el-icon--right" />
  860. </span>
  861. <el-dropdown-menu slot="dropdown" trigger="click">
  862. <el-dropdown-item
  863. v-for="(child, i) in item.list"
  864. :key="i"
  865. style="color: #000000"
  866. @click.native="selectSmallModule(item, child, index, i)"
  867. >{{ child.name }}</el-dropdown-item
  868. >
  869. </el-dropdown-menu>
  870. </el-dropdown>
  871. <span v-else class="fn-name">{{ item.name }}</span>
  872. </li>
  873. </ul>
  874. <div class="yunmu">
  875. <span>点击可复制</span>
  876. <table border="1" class="yunmu-table">
  877. <tr v-for="(item, index) in tableData" :key="'tableData' + index">
  878. <td
  879. v-for="(tdItem, tdIndex) in item"
  880. :key="'td' + index + tdIndex"
  881. :id="'td' + index + tdIndex"
  882. @click="CopyToClipboard('td' + index + tdIndex)"
  883. >
  884. {{ tdItem }}
  885. </td>
  886. </tr>
  887. </table>
  888. </div>
  889. </div>
  890. </div>
  891. <el-dialog
  892. :visible.sync="previewVisible"
  893. title="预览"
  894. top="0"
  895. width="100%"
  896. @close="handleClosePre"
  897. >
  898. <div class="chooseCon">
  899. <Preview
  900. ref="preview"
  901. :context="context"
  902. :que-index="queIndex"
  903. :father-name="fatherName"
  904. :current-tree-i-d="currentTreeID"
  905. :father-tree-data="FatherTreeData"
  906. :change-id="changeId"
  907. :theme-color="themeColor"
  908. :is-show-title="true"
  909. :task-model="TaskModel"
  910. />
  911. </div>
  912. <span slot="footer" class="dialog-footer">
  913. <!-- <el-button @click="saveAnswer">保 存</el-button> -->
  914. <el-button @click="handleClosePre">关 闭</el-button>
  915. </span>
  916. </el-dialog>
  917. </div>
  918. </template>
  919. <script>
  920. import Header from "@/components/Header.vue";
  921. import Catelog from "@/components/Adult/inputModules/Catelog";
  922. import ArticleTemChs from "@/components/Adult/inputModules/ArticleTemChs/index.vue";
  923. import SentenceSegwordChs from "@/components/Adult/inputModules/SentenceSegwordChs/index.vue";
  924. import DialogueArticleChs from "@/components/Adult/inputModules/DialogueArticleChs/index.vue";
  925. import Single from "@/components/Adult/inputModules/Single.vue";
  926. import Judge from "@/components/Adult/inputModules/Judge.vue";
  927. import Dialogue from "@/components/Adult/inputModules/Dialogue.vue";
  928. import MatrixSingle from "@/components/Adult/inputModules/MatrixSingle.vue";
  929. import MultiRowInput from "@/components/Adult/inputModules/MultiRowInput.vue";
  930. import Ligature from "@/components/Adult/inputModules/Ligature.vue";
  931. import Neword from "@/components/Adult/inputModules/Neword.vue";
  932. import Notes from "@/components/Adult/inputModules/Notes.vue";
  933. import InputRecord from "@/components/Adult/inputModules/InputRecord.vue";
  934. import AudioControl from "@/components/Adult/inputModules/AudioControl.vue";
  935. import SuitchControl from "@/components/Adult/inputModules/SuitchControl.vue";
  936. import BgControl from "@/components/Adult/inputModules/BgControl.vue";
  937. import UploadControl from "@/components/Adult/inputModules/UploadControl.vue";
  938. import TextItem from "@/components/Adult/inputModules/TextItem.vue";
  939. import Sentence from "@/components/Adult/inputModules/Sentence.vue";
  940. import Sudoku from "@/components/Adult/inputModules/Sudoku.vue";
  941. import ToneSelect from "@/components/Adult/inputModules/ToneSelect.vue";
  942. import NumberCombination from "@/components/Adult/inputModules/NumberCombination.vue";
  943. import DialogueAnswerChs from "@/components/Adult/inputModules/DialogueAnswerChs";
  944. import VoiceMatrix from "@/components/Adult/inputModules/VoiceMatrix.vue";
  945. import SelectDrag from "@/components/Adult/inputModules/SelectDrag.vue";
  946. import ConfigurableTable from "@/components/Adult/inputModules/ConfigurableTable/index.vue";
  947. import HeaderSeparate from "@/components/Adult/inputModules/HeaderSeparate/index.vue";
  948. import FillDrag from "@/components/Adult/inputModules/FillDrag.vue";
  949. import ImageQuestion from "@/components/Adult/inputModules/ImageQuestion.vue";
  950. import PurePreview from "@/components/Adult/inputModules/PurePreview.vue";
  951. import ZiLine from "@/components/Adult/inputModules/ZiLine.vue";
  952. import SelectInpue from "@/components/Adult/inputModules/SelectInpue.vue";
  953. import PlayInputReacord from "@/components/Adult/inputModules/PlayInputReacord.vue";
  954. import Drag from "@/components/Adult/inputModules/Drag.vue";
  955. import SelfAssessment from "@/components/Adult/inputModules/SelfAssessment.vue";
  956. import Sort from "@/components/Adult/inputModules/Sort.vue";
  957. import CourseStart from "@/components/Adult/inputModules/CourseStart.vue";
  958. import RecordControl from "@/components/Adult/inputModules/RecordControl.vue";
  959. import Tinydemo from "@/components/Adult/inputModules/Tinydemo.vue";
  960. import VideoControl from "@/components/Adult/inputModules/VideoControl.vue";
  961. import Table from "@/components/Adult/inputModules/Table.vue";
  962. import PlayRecord from "@/components/Adult/inputModules/PlayRecord.vue";
  963. import UploadPdf from "@/components/Adult/inputModules/UploadPdf.vue";
  964. import OptionsList from "@/components/Adult/inputModules/OptionsList.vue";
  965. import Textdes from "@/components/Adult/inputModules/Textdes.vue";
  966. import Record from "@/components/Adult/inputModules/Record.vue";
  967. import Hanzi from "@/components/Adult/inputModules/Hanzi.vue";
  968. import Picture from "@/components/Adult/inputModules/Picture.vue";
  969. import SentenceModule from "@/components/Adult/inputModules/SentenceModule.vue";
  970. import Singleview from "@/components/Adult/preview/Single.vue";
  971. import Judgeview from "@/components/Adult/preview/Judge.vue";
  972. import Textdesview from "@/components/Adult/preview/Textdes.vue";
  973. import Hanziview from "@/components/Adult/preview/Hanzi.vue";
  974. import Pictureview from "@/components/Adult/preview/Picture.vue";
  975. import Dialogueview from "@/components/Adult/preview/Dialogue.vue";
  976. import MatrixSingleview from "@/components/Adult/preview/MatrixSingle.vue";
  977. import MultiRowInputview from "@/components/Adult/preview/MultiRowInput.vue";
  978. import Ligatureview from "@/components/Adult/preview/Ligature.vue";
  979. import InputRecordview from "@/components/Adult/preview/InputRecord.vue";
  980. import BgControlview from "@/components/Adult/preview/BgControl.vue";
  981. import NewordPhraseview from "@/components/Adult/preview/WordPhrase.vue";
  982. import UploadControlView from "@/components/Adult/preview/UploadControlView.vue";
  983. import VideoControlView from "@/components/Adult/preview/VideoControl.vue";
  984. import SentenceSortQP from "@/components/Adult/preview/SentenceSortQP.vue";
  985. import TableView from "@/components/Adult/preview/TableView.vue";
  986. import PlayRecordView from "@/components/Adult/preview/PlayRecordView.vue";
  987. import Preview from "@/components/Adult/Preview.vue";
  988. import fn from "@/components/Adult/common/data.js";
  989. import { getContent, getStaticContent } from "@/api/ajax";
  990. export default {
  991. components: {
  992. Header,
  993. Catelog,
  994. Single,
  995. Textdes,
  996. Record,
  997. Singleview,
  998. Textdesview,
  999. Hanziview,
  1000. Pictureview,
  1001. Preview,
  1002. Hanzi,
  1003. Picture,
  1004. Judge,
  1005. Judgeview,
  1006. Dialogue,
  1007. Dialogueview,
  1008. MatrixSingle,
  1009. MatrixSingleview,
  1010. MultiRowInput,
  1011. MultiRowInputview,
  1012. Ligature,
  1013. Ligatureview,
  1014. Neword,
  1015. Notes,
  1016. InputRecord,
  1017. ArticleTemChs,
  1018. SentenceSegwordChs,
  1019. DialogueArticleChs,
  1020. AudioControl,
  1021. SuitchControl,
  1022. BgControl,
  1023. InputRecordview,
  1024. BgControlview,
  1025. NewordPhraseview,
  1026. UploadControl,
  1027. TextItem,
  1028. Sentence,
  1029. UploadControlView,
  1030. Sudoku,
  1031. NumberCombination,
  1032. ToneSelect,
  1033. DialogueAnswerChs,
  1034. VoiceMatrix,
  1035. FillDrag,
  1036. SelectDrag,
  1037. ConfigurableTable,
  1038. HeaderSeparate,
  1039. ImageQuestion,
  1040. PurePreview,
  1041. ZiLine,
  1042. SelectInpue,
  1043. PlayInputReacord,
  1044. Drag,
  1045. SelfAssessment,
  1046. Sort,
  1047. CourseStart,
  1048. RecordControl,
  1049. Tinydemo,
  1050. VideoControl,
  1051. VideoControlView,
  1052. SentenceSortQP,
  1053. Table,
  1054. TableView,
  1055. PlayRecord,
  1056. PlayRecordView,
  1057. UploadPdf,
  1058. SentenceModule,
  1059. OptionsList,
  1060. },
  1061. data() {
  1062. return {
  1063. bookId: 1,
  1064. bookLevel: "",
  1065. bookIndex: "",
  1066. fn_data: [],
  1067. fn_type: "",
  1068. cur_fn_data: null, // 当前模块的数据结构
  1069. cur_page_queIsEdit: [], // 当前页数的某个题
  1070. org_question_list: {
  1071. detailList: [
  1072. {
  1073. detail: {
  1074. type: "detail",
  1075. pyPosition: "top", // top 拼音在上面;bottom 拼音在下面
  1076. sentence: "", // 句子
  1077. segList: [], // 分词结果
  1078. seg_words: "",
  1079. wordsList: [],
  1080. },
  1081. en: "",
  1082. },
  1083. ], // 目录分词
  1084. classTopic: [
  1085. {
  1086. con: "",
  1087. font: "",
  1088. },
  1089. ], // 课题
  1090. cur_fn_data: [],
  1091. },
  1092. // 总的数据列表
  1093. question_list: {
  1094. detailList: [
  1095. {
  1096. detail: {
  1097. type: "detail",
  1098. pyPosition: "top", // top 拼音在上面;bottom 拼音在下面
  1099. sentence: "", // 句子
  1100. segList: [], // 分词结果
  1101. seg_words: "",
  1102. wordsList: [],
  1103. },
  1104. en: "",
  1105. },
  1106. ], // 目录分词
  1107. classTopic: [
  1108. {
  1109. con: "",
  1110. font: "",
  1111. },
  1112. ], // 课题
  1113. cur_fn_data: [],
  1114. }, // 总的数据列表
  1115. cur_page_que_index: 0,
  1116. editableTabsValue: "tab1",
  1117. tabIndex: 0,
  1118. previewVisible: false,
  1119. context: [],
  1120. queIndex: 0,
  1121. currentTreeID: null,
  1122. row: null, // 行
  1123. line: null, // 列
  1124. TopicIndex: null, // 第几题的索引
  1125. RowIndex: null, // 第几行
  1126. LineIndex: null, // 第几列
  1127. bgControlX: null, // 背景图插入模板的 x
  1128. bgControlY: null, // 背景图插入模板的 y
  1129. bgControlIndex: null, // 插入第几个
  1130. DeletebgControlIndex: null, // 删除第几个
  1131. fatherName: "",
  1132. module_type: "",
  1133. tmInde: "",
  1134. FatherTreeData: null,
  1135. themeColor: "", // 主题颜色
  1136. loading: false,
  1137. NumberList: [
  1138. "①",
  1139. "②",
  1140. "③",
  1141. "④",
  1142. "⑤",
  1143. "⑥",
  1144. "⑦",
  1145. "⑧",
  1146. "⑨",
  1147. "⑩",
  1148. "⑪",
  1149. "⑫",
  1150. "⑬",
  1151. "⑭",
  1152. "⑮",
  1153. "⑯",
  1154. "⑰",
  1155. "⑱",
  1156. "⑲",
  1157. "⑳",
  1158. ],
  1159. TaskModel: "",
  1160. groupIndexList: [],
  1161. tableData: [
  1162. ["ā", "á", "ǎ", "à"],
  1163. ["ō", "ó", "ǒ", "ò"],
  1164. ["ē", "é", "ě", "è"],
  1165. ["ī", "í", "ǐ", "ì"],
  1166. ["ū", "ú", "ǔ", "ù"],
  1167. ["ǖ", "ǘ", "ǚ", "ǜ"],
  1168. ["Ā", "Á", "Â", "À"],
  1169. ["Ō", "Ó", "Ô", "Ò"],
  1170. ["Ē", "É", "Ê", "È"],
  1171. ["Ī", "Í", "Î", "Ì"],
  1172. ["Ū", "Ú", "Û", "Ù"],
  1173. ],
  1174. refresh: true,
  1175. };
  1176. },
  1177. computed: {
  1178. getCurrentQuestionView() {
  1179. const function_type = this.fn_type;
  1180. switch (function_type) {
  1181. case "single":
  1182. return Single;
  1183. case "text":
  1184. return Textdes;
  1185. case "record":
  1186. return Record;
  1187. }
  1188. },
  1189. },
  1190. watch: {},
  1191. // 生命周期 - 创建完成(可以访问当前this实例)
  1192. created() {
  1193. console.log("2022.07.04");
  1194. this.fn_data = fn.fnData;
  1195. },
  1196. // 生命周期 - 挂载完成(可以访问DOM元素)
  1197. mounted() {
  1198. console.log(this.question_list);
  1199. if (localStorage.getItem("Bookanswer")) {
  1200. this.TaskModel = "ANSWER";
  1201. }
  1202. document.getElementsByClassName("content-tree")[0].style.height =
  1203. window.innerHeight - 120 + "px";
  1204. },
  1205. beforeCreate() {}, // 生命周期 - 创建之前
  1206. beforeMount() {}, // 生命周期 - 挂载之前
  1207. beforeUpdate() {}, // 生命周期 - 更新之前
  1208. updated() {}, // 生命周期 - 更新之后
  1209. beforeDestroy() {}, // 生命周期 - 销毁之前
  1210. destroyed() {}, // 生命周期 - 销毁完成
  1211. activated() {},
  1212. // 方法集合
  1213. methods: {
  1214. handleChangeTab(item) {
  1215. item.contentShow = !item.contentShow;
  1216. },
  1217. saveAnswer() {
  1218. let answer = this.$refs.preview.saveAnswer();
  1219. console.log("保存答案:");
  1220. console.log(answer);
  1221. let answerStr = JSON.stringify(answer);
  1222. localStorage.setItem("Bookanswer", answerStr);
  1223. },
  1224. forupdata() {
  1225. this.$forceUpdate();
  1226. },
  1227. // 增加列
  1228. addCol(tyoe, rowindex, colindex, toindex) {},
  1229. // 添加行
  1230. addRow(type, rowindex, toindex) {
  1231. let arr = [
  1232. {
  1233. text: ``,
  1234. is_add_module: true,
  1235. is_edit: true,
  1236. },
  1237. ];
  1238. if (type == "front") {
  1239. // 加到当前行前面
  1240. if (rowindex == 0) {
  1241. this.question_list.cur_fn_data[toindex].table_list.splice(0, 0, arr);
  1242. } else {
  1243. this.question_list.cur_fn_data[toindex].table_list.splice(
  1244. rowindex - 1,
  1245. 0,
  1246. arr
  1247. );
  1248. }
  1249. } else {
  1250. // 加到当前行后面
  1251. this.question_list.cur_fn_data[toindex].table_list.splice(
  1252. rowindex + 1,
  1253. 0,
  1254. arr
  1255. );
  1256. }
  1257. this.question_list.cur_fn_data[toindex].table_list.forEach(
  1258. (item, rowIndex) => {
  1259. item.forEach((it, colIndex) => {
  1260. it.text = `第${rowIndex + 1}行,第${colIndex + 1}列`;
  1261. });
  1262. }
  1263. );
  1264. this.TopicIndex = null;
  1265. this.RowIndex = null;
  1266. this.LineIndex = null;
  1267. this.$forceUpdate();
  1268. },
  1269. // 删除行
  1270. removeRow(index, toindex) {
  1271. this.$confirm("确定要删除当前行吗?", "提示", {
  1272. confirmButtonText: "确定",
  1273. cancelButtonText: "取消",
  1274. type: "warning",
  1275. }).then(() => {
  1276. // 里面是不是剩下最后一行了
  1277. if (this.question_list.cur_fn_data[toindex].table_list.length == 1) {
  1278. this.question_list.cur_fn_data[toindex].table_list.splice(index, 1);
  1279. this.question_list.cur_fn_data.splice(toindex, 1);
  1280. } else {
  1281. this.question_list.cur_fn_data[toindex].table_list.splice(index, 1);
  1282. }
  1283. this.question_list.cur_fn_data[toindex].table_list.forEach(
  1284. (item, rowIndex) => {
  1285. item.forEach((it, colIndex) => {
  1286. it.text = `第${rowIndex + 1}行,第${colIndex + 1}列`;
  1287. });
  1288. }
  1289. );
  1290. this.TopicIndex = null;
  1291. this.RowIndex = null;
  1292. this.LineIndex = null;
  1293. this.$forceUpdate();
  1294. });
  1295. },
  1296. changeCurrentTreeID(val) {
  1297. this.currentTreeID = val;
  1298. },
  1299. changeTreeData(val) {
  1300. this.FatherTreeData = JSON.parse(JSON.stringify(val));
  1301. },
  1302. // 增加当前页的分词
  1303. addDetail() {
  1304. let obj = {
  1305. detail: {
  1306. type: "detail",
  1307. pyPosition: "top", // top 拼音在上面;bottom 拼音在下面
  1308. sentence: "", // 句子
  1309. segList: [], // 分词结果
  1310. seg_words: "",
  1311. wordsList: [],
  1312. },
  1313. en: "",
  1314. };
  1315. this.question_list.detailList.push(obj);
  1316. },
  1317. // 删除当前页的分词
  1318. deleteDetail(fcindex) {
  1319. this.$confirm("确定要删除此模块吗?", "提示", {
  1320. confirmButtonText: "确定",
  1321. cancelButtonText: "取消",
  1322. type: "warning",
  1323. }).then(() => {
  1324. if (this.question_list.detailList.length <= 1) {
  1325. this.$message.warning("至少要保留一一个");
  1326. return;
  1327. }
  1328. this.question_list.detailList.splice(fcindex, 1);
  1329. });
  1330. },
  1331. // 增加课题
  1332. addClassTopic() {
  1333. let obj = {
  1334. con: "",
  1335. font: "",
  1336. };
  1337. this.question_list.classTopic.push(obj);
  1338. },
  1339. // 删除课题
  1340. deleteClassTopic(ktindex) {
  1341. this.$confirm("确定要删除此课题内容吗?", "提示", {
  1342. confirmButtonText: "确定",
  1343. cancelButtonText: "取消",
  1344. type: "warning",
  1345. }).then(() => {
  1346. if (this.question_list.classTopic.length <= 1) {
  1347. this.$message.warning("至少要保留一一个");
  1348. return;
  1349. }
  1350. this.question_list.classTopic.splice(ktindex, 1);
  1351. });
  1352. },
  1353. // 随意插入模板获取位置
  1354. changeSite(x, y) {
  1355. this.bgControlX = x;
  1356. this.bgControlY = y;
  1357. },
  1358. // 插入索引
  1359. changebgControlIndex(index) {
  1360. this.bgControlIndex = index;
  1361. },
  1362. // 删除索引
  1363. changeDeletebgControlIndex(index) {
  1364. this.DeletebgControlIndex = index;
  1365. },
  1366. rowLine(value) {
  1367. this[value] = this[value].match(/^\d*(\.?\d{0,2})/g)[0] || "";
  1368. },
  1369. createTable() {
  1370. if (this.row && this.line) {
  1371. let groupid = (
  1372. new Date().toLocaleString().replace(/\s|:|\/*/g, "") +
  1373. new Date().getMilliseconds() +
  1374. Math.random().toString(36).substr(2) +
  1375. new Date().getMilliseconds() +
  1376. Math.random().toString(36).substr(2)
  1377. ).substring(0, 32);
  1378. let arr = {
  1379. z_title: "",
  1380. f_title: "",
  1381. little_title_number: "",
  1382. little_title: "",
  1383. is_bg: false, // 是否有背景色
  1384. is_layout: false, // 是不是按背景图布局
  1385. is_textIndex: false,
  1386. table_list: [],
  1387. group_name: "", // 设置分组name
  1388. group_id: [groupid], // 分组id
  1389. contentShow: true, // 是否显示这一题
  1390. };
  1391. for (let i = 0; i < this.row; i++) {
  1392. let rowArr = [];
  1393. for (let j = 0; j < this.line; j++) {
  1394. let obj = {
  1395. text: `第${i + 1}行,第${j + 1}列`,
  1396. is_add_module: true,
  1397. is_edit: true,
  1398. };
  1399. rowArr.push(obj);
  1400. }
  1401. arr.table_list.push(rowArr);
  1402. }
  1403. this.question_list.cur_fn_data.push(arr);
  1404. this.row = null;
  1405. this.line = null;
  1406. } else {
  1407. this.$message.warning("请输入行和列");
  1408. }
  1409. },
  1410. // 添加模板
  1411. addModule(topicIndex, rowindex, lineIndex, item) {
  1412. this.TopicIndex = topicIndex;
  1413. this.RowIndex = rowindex;
  1414. this.LineIndex = lineIndex;
  1415. this.question_list.cur_fn_data.forEach((pic) => {
  1416. pic.table_list.forEach((row) => {
  1417. row.forEach((col) => {
  1418. col.is_add_module = true;
  1419. });
  1420. });
  1421. });
  1422. item.is_add_module = false;
  1423. },
  1424. // 删除模板
  1425. remoeModule(topicIndex, rowindex, lineIndex, item) {
  1426. this.$confirm("确定要删除此模板吗?", "提示", {
  1427. confirmButtonText: "确定",
  1428. cancelButtonText: "取消",
  1429. type: "warning",
  1430. }).then(() => {
  1431. item.type = "";
  1432. item.data = null;
  1433. this.TopicIndex = null;
  1434. this.RowIndex = null;
  1435. this.LineIndex = null;
  1436. item.is_add_module = true;
  1437. });
  1438. },
  1439. handleClosePre() {
  1440. if (window.stopAudioVoice) window.stopAudioVoice();
  1441. if (window.stopAudioAudio) window.stopAudioAudio();
  1442. if (window.stopAudioSound) window.stopAudioSound();
  1443. this.previewVisible = false;
  1444. },
  1445. onBlur(item, field) {
  1446. item[field] = item[field] ? item[field].trim() : "";
  1447. },
  1448. // 当前目录id name 父级name/当前 name
  1449. changeId(id, name, fatherName) {
  1450. this.loading = true;
  1451. this.TopicIndex = null;
  1452. this.RowIndex = null;
  1453. this.LineIndex = null;
  1454. this.fatherName = fatherName;
  1455. this.currentTreeID = id;
  1456. this.refresh = false;
  1457. // 根据当前目录切换题
  1458. let MethodName = "book-courseware_manager-GetCoursewareContent";
  1459. let data = {
  1460. id,
  1461. };
  1462. console.log(this.question_list);
  1463. getContent(MethodName, data)
  1464. .then((res) => {
  1465. this.themeColor = res.book_theme_color ? res.book_theme_color : "";
  1466. this.question_list = res.content
  1467. ? JSON.parse(res.content)
  1468. : JSON.parse(JSON.stringify(this.org_question_list));
  1469. let data = JSON.parse(JSON.stringify(this.question_list));
  1470. data.cur_fn_data.forEach((item) => {
  1471. if (!item.group_id) {
  1472. let groupid = (
  1473. new Date().toLocaleString().replace(/\s|:|\/*/g, "") +
  1474. new Date().getMilliseconds() +
  1475. Math.random().toString(36).substr(2) +
  1476. new Date().getMilliseconds() +
  1477. Math.random().toString(36).substr(2)
  1478. ).substring(0, 32);
  1479. item.group_name = ""; // 设置分组name
  1480. item.group_id = [groupid]; // 分组id
  1481. }
  1482. if (!item.hasOwnProperty("contentShow")) {
  1483. item.contentShow = true;
  1484. }
  1485. });
  1486. data.detailList.forEach((item) => {
  1487. if (!item.detail) {
  1488. let obj = JSON.parse(JSON.stringify(item));
  1489. item.detail = obj;
  1490. }
  1491. if (!item.en) {
  1492. item.en = "";
  1493. }
  1494. });
  1495. this.question_list = JSON.parse(JSON.stringify(data));
  1496. if (this.previewVisible) {
  1497. this.onPreview();
  1498. }
  1499. this.loading = false;
  1500. document.getElementsByClassName(
  1501. "Big-Book-input-save"
  1502. )[0].style.width =
  1503. document.getElementsByClassName("Book-content")[0].clientWidth -
  1504. 20 +
  1505. "px";
  1506. document.getElementsByClassName("Book-function")[0].style.height =
  1507. window.innerHeight - 120 + "px";
  1508. // this.cur_page_que_index =
  1509. // this.question_list[this.tabIndex].cur_fn_data.length - 1;
  1510. this.$nextTick(() => {
  1511. // 重新渲染组件
  1512. this.refresh = true;
  1513. });
  1514. })
  1515. .catch((error) => {
  1516. this.loading = false;
  1517. this.$nextTick(() => {
  1518. // 重新渲染组件
  1519. this.refresh = true;
  1520. });
  1521. });
  1522. },
  1523. handleTabsEdit(targetName, action) {
  1524. if (action === "add") {
  1525. let leg = this.question_list.cur_fn_data.length;
  1526. let obj = {
  1527. name: `tab${leg + 1}`,
  1528. title: `第${leg + 1}页`,
  1529. cur_fn_data: [],
  1530. };
  1531. this.question_list.push(obj);
  1532. }
  1533. if (action === "remove") {
  1534. let tabs = JSON.parse(JSON.stringify(this.question_list));
  1535. let activeName = this.editableTabsValue;
  1536. if (activeName === targetName) {
  1537. tabs.forEach((tab, index) => {
  1538. if (tab.name === targetName) {
  1539. let nextTab = tabs[index + 1] || tabs[index - 1];
  1540. if (nextTab) {
  1541. activeName = nextTab.name;
  1542. }
  1543. }
  1544. });
  1545. }
  1546. this.editableTabsValue = activeName;
  1547. let question_list = tabs.filter((tab) => tab.name !== targetName);
  1548. question_list.map((item, index) => {
  1549. item.name = `tab${index + 1}`;
  1550. item.title = `第${index + 1}页`;
  1551. return item;
  1552. });
  1553. this.question_list = question_list;
  1554. this.TopicIndex = null;
  1555. this.RowIndex = null;
  1556. this.LineIndex = null;
  1557. }
  1558. },
  1559. tabClick(tab) {
  1560. this.tabIndex = tab.index;
  1561. },
  1562. // 大模板
  1563. selectedFnType(item, index) {
  1564. if (item.list) {
  1565. return;
  1566. }
  1567. if (
  1568. Object.prototype.toString.call(this.TopicIndex).indexOf("Number") ==
  1569. -1 &&
  1570. Object.prototype.toString.call(this.LineIndex).indexOf("Number") == -1
  1571. ) {
  1572. this.$message.warning("请先选择添加模板的位置");
  1573. return;
  1574. }
  1575. if (
  1576. this.question_list.cur_fn_data[this.TopicIndex].table_list[
  1577. this.RowIndex
  1578. ][this.LineIndex].data
  1579. ) {
  1580. this.$message.warning("每列只能添加一个模板");
  1581. } else {
  1582. console.log("不存在");
  1583. this.$set(
  1584. this.question_list.cur_fn_data[this.TopicIndex].table_list[
  1585. this.RowIndex
  1586. ][this.LineIndex],
  1587. "type",
  1588. item.type
  1589. );
  1590. this.$set(
  1591. this.question_list.cur_fn_data[this.TopicIndex].table_list[
  1592. this.RowIndex
  1593. ][this.LineIndex],
  1594. "data",
  1595. undefined
  1596. );
  1597. console.log(this.question_list);
  1598. }
  1599. },
  1600. changeCurQue(data_stru) {
  1601. console.log(this.RowIndex, this.LineIndex);
  1602. this.$set(
  1603. this.question_list.cur_fn_data[this.TopicIndex].table_list[
  1604. this.RowIndex
  1605. ][this.LineIndex],
  1606. "data",
  1607. JSON.parse(JSON.stringify(data_stru))
  1608. );
  1609. console.log(this.question_list);
  1610. },
  1611. // 小模板
  1612. selectSmallModule(item, child, itemIndex, childIndex) {
  1613. console.log("选择了小模版");
  1614. if (
  1615. Object.prototype.toString.call(this.TopicIndex).indexOf("Number") ==
  1616. -1 &&
  1617. Object.prototype.toString.call(this.LineIndex).indexOf("Number") == -1
  1618. ) {
  1619. this.$message.warning("请先选择添加模板的位置");
  1620. return;
  1621. }
  1622. if (
  1623. this.question_list.cur_fn_data[this.TopicIndex].table_list[
  1624. this.RowIndex
  1625. ][this.LineIndex].data
  1626. ) {
  1627. this.$message.warning("每列只能添加一个模板");
  1628. } else {
  1629. this.$set(
  1630. this.question_list.cur_fn_data[this.TopicIndex].table_list[
  1631. this.RowIndex
  1632. ][this.LineIndex],
  1633. "type",
  1634. child.type
  1635. );
  1636. this.$set(
  1637. this.question_list.cur_fn_data[this.TopicIndex].table_list[
  1638. this.RowIndex
  1639. ][this.LineIndex],
  1640. "data",
  1641. null
  1642. );
  1643. }
  1644. },
  1645. // 删除某页中一个部分
  1646. deleteCurQue(item, queIndex) {
  1647. item.queList.splice(queIndex, 1);
  1648. },
  1649. saveNewwordAndSentences() {
  1650. let question_list = JSON.parse(JSON.stringify(this.question_list));
  1651. let sentence_list = [];
  1652. let sentence_list_mp = [];
  1653. let new_word_list = [];
  1654. question_list.cur_fn_data.forEach((curItem) => {
  1655. curItem.table_list.forEach((tabItem) => {
  1656. tabItem.forEach((topicIitem) => {
  1657. if (
  1658. topicIitem.type == "article_chs" ||
  1659. topicIitem.type == "dialogue_article_chs"
  1660. ) {
  1661. topicIitem.data.detail.forEach((item) => {
  1662. let obj = this.handleSentences(item.sentences, item.segList);
  1663. sentence_list = sentence_list.concat(obj.sentenceArr); // 句子数组
  1664. sentence_list_mp = sentence_list_mp.concat(obj.res); // 句子+分词数组
  1665. });
  1666. } else if (topicIitem.type == "NewWord_chs") {
  1667. let audio_file_id = "";
  1668. audio_file_id =
  1669. topicIitem.data.mp3_list && topicIitem.data.mp3_list.length > 0
  1670. ? topicIitem.data.mp3_list[0].id
  1671. .replace("[FID##", "")
  1672. .replace("##FID]", "")
  1673. : "";
  1674. topicIitem.data.option.forEach((item) => {
  1675. item.map((sItem) => {
  1676. sItem.audio_file_id = audio_file_id;
  1677. sItem.audio_begin_time =
  1678. topicIitem.data.wordTime &&
  1679. topicIitem.data.wordTime[sItem.sIndex]
  1680. ? Number(topicIitem.data.wordTime[sItem.sIndex].bg)
  1681. : 0;
  1682. sItem.audio_end_time =
  1683. topicIitem.data.wordTime &&
  1684. topicIitem.data.wordTime[sItem.sIndex]
  1685. ? Number(topicIitem.data.wordTime[sItem.sIndex].ed)
  1686. : 0;
  1687. return sItem;
  1688. });
  1689. console.log(item);
  1690. new_word_list = new_word_list.concat(item);
  1691. });
  1692. }
  1693. });
  1694. });
  1695. });
  1696. return {
  1697. new_word_list,
  1698. sentence_list,
  1699. sentence_list_mp,
  1700. };
  1701. },
  1702. handleSentences(list, segList) {
  1703. let res = [];
  1704. let sentenceArr = [];
  1705. list.forEach((Litem, index) => {
  1706. Litem = Litem.replace(/#/g, "");
  1707. this.NumberList.forEach((nitem) => {
  1708. if (Litem.indexOf(nitem) > -1) {
  1709. let reg = new RegExp(nitem, "g");
  1710. Litem = Litem.replace(reg, "");
  1711. }
  1712. });
  1713. let segItem = this.handleSegItem(segList[index]);
  1714. let obj = {
  1715. sentence: Litem,
  1716. word_list: segItem,
  1717. };
  1718. res.push(obj);
  1719. sentenceArr.push(Litem);
  1720. });
  1721. return { res, sentenceArr };
  1722. },
  1723. handleSegItem(list) {
  1724. let resArr = [];
  1725. list.forEach((item) => {
  1726. if (item != "#" && this.NumberList.indexOf(item) < 0) {
  1727. let obj = {
  1728. word: item,
  1729. word_bt: "",
  1730. };
  1731. resArr.push(obj);
  1732. }
  1733. });
  1734. return resArr;
  1735. },
  1736. onSave() {
  1737. let isProof = true;
  1738. for (let j = 0; j < this.question_list.cur_fn_data.length; j++) {
  1739. for (
  1740. let l = 0;
  1741. l < this.question_list.cur_fn_data[j].table_list.length;
  1742. l++
  1743. ) {
  1744. for (
  1745. let m = 0;
  1746. m < this.question_list.cur_fn_data[j].table_list[l].length;
  1747. m++
  1748. ) {
  1749. if (
  1750. this.question_list.cur_fn_data[j].table_list[l][m].type ==
  1751. "tinydemo_chs" ||
  1752. this.question_list.cur_fn_data[j].table_list[l][m].type ==
  1753. "toneSelect_chs"
  1754. ) {
  1755. for (let i = 0; i < tinymce.editors.length; i++) {
  1756. let content = tinymce.editors[i].getContent();
  1757. let arr = content.split(/[\n]/);
  1758. let newstr = "";
  1759. arr.forEach((item) => {
  1760. newstr += item;
  1761. });
  1762. if (newstr.length > 5000) {
  1763. this.$message.warning("富文本已超出字数限制");
  1764. this.loading = false;
  1765. return false;
  1766. }
  1767. }
  1768. }
  1769. }
  1770. }
  1771. }
  1772. let question_list_str = JSON.stringify(this.question_list);
  1773. console.log(this.question_list);
  1774. localStorage.setItem("question_list", question_list_str);
  1775. let result = this.saveNewwordAndSentences();
  1776. const MethodName = "book-courseware_manager-SaveCoursewareContent";
  1777. let data = {
  1778. id: this.currentTreeID,
  1779. content: JSON.stringify(this.question_list),
  1780. is_use_manual_proofreading_word_sentence: isProof,
  1781. new_word_list: result.new_word_list,
  1782. sentence_list: result.sentence_list,
  1783. sentence_list_mp: result.sentence_list_mp,
  1784. ui_type: "NPC",
  1785. category: "NPC",
  1786. };
  1787. getContent(MethodName, data)
  1788. .then((res) => {
  1789. this.$message.success("保存成功!");
  1790. })
  1791. .catch((error) => {});
  1792. },
  1793. async onPreview() {
  1794. let _this = this;
  1795. let question_data = null;
  1796. if (_this.question_list) {
  1797. const question2 = JSON.parse(JSON.stringify(_this.question_list));
  1798. question_data = await _this.getFileUrl_preview(question2);
  1799. _this.previewVisible = true;
  1800. _this.context = question_data;
  1801. console.log("预览数据");
  1802. console.log(this.question_list);
  1803. } else {
  1804. _this.$message.warning("还没有录入数据");
  1805. }
  1806. },
  1807. getFileUrl_preview(question) {
  1808. let questionStr = JSON.stringify(question);
  1809. const reg = /\[FID##(.*?)##FID\]/g;
  1810. let regConArr = [];
  1811. if (reg.test(questionStr)) {
  1812. regConArr = questionStr.match(reg);
  1813. }
  1814. if (regConArr.length > 0) {
  1815. regConArr = regConArr.map((item) => {
  1816. item = item.replace("[FID##", "").replace("##FID]", "");
  1817. return item;
  1818. });
  1819. }
  1820. return new Promise((resolve, reject) => {
  1821. const MethodName = "file_store_manager-GetFileURLMap";
  1822. const data = {
  1823. file_id_list: regConArr,
  1824. };
  1825. getStaticContent(MethodName, data).then((res) => {
  1826. const backData = res.url_map;
  1827. for (const key in backData) {
  1828. const url = backData[key];
  1829. if (questionStr.indexOf(key) > -1) {
  1830. const d = `\\[FID##${key}##FID\\]`;
  1831. const regD = new RegExp(d, "g");
  1832. questionStr = questionStr.replace(regD, url);
  1833. }
  1834. }
  1835. const question3 = JSON.parse(questionStr);
  1836. resolve(question3);
  1837. });
  1838. });
  1839. },
  1840. onSure(curItem) {
  1841. this.TopicIndex = null;
  1842. this.RowIndex = null;
  1843. this.LineIndex = null;
  1844. curItem.is_edit = false;
  1845. },
  1846. onDel(item, curIndex) {
  1847. item.cur_fn_data.splice(curIndex, 1);
  1848. if (this.question_list.cur_fn_data.length > 0) {
  1849. this.cur_page_que_index = this.question_list.cur_fn_data.length - 1;
  1850. } else {
  1851. this.cur_page_que_index = 0;
  1852. }
  1853. // let question_list_str = JSON.stringify(this.question_list);
  1854. // localStorage.setItem("question_list", question_list_str);
  1855. },
  1856. // 编辑当前题型
  1857. editCurQue(curItem) {
  1858. curItem.is_edit = true;
  1859. // if (!curItem.isEdit) {
  1860. // let count = 0;
  1861. // let tabIndex = this.tabIndex;
  1862. // let leg = this.question_list[tabIndex].cur_fn_data.length;
  1863. // this.question_list[tabIndex].cur_fn_data.forEach((item) => {
  1864. // if (item.isEdit) {
  1865. // count++;
  1866. // }
  1867. // });
  1868. // if (count == 0) {
  1869. // if (!curItem.isEdit) {
  1870. // curItem.isEdit = true;
  1871. // }
  1872. // } else {
  1873. // this.$message.warning("有题目未保存");
  1874. // }
  1875. // }
  1876. },
  1877. emptyQustion() {
  1878. this.currentTreeID = "";
  1879. },
  1880. // 设置分组
  1881. handleSetGroup() {
  1882. let groupname = "";
  1883. let groupid = (
  1884. new Date().toLocaleString().replace(/\s|:|\/*/g, "") +
  1885. new Date().getMilliseconds() +
  1886. Math.random().toString(36).substr(2) +
  1887. new Date().getMilliseconds() +
  1888. Math.random().toString(36).substr(2)
  1889. ).substring(0, 32);
  1890. this.groupIndexList.forEach((item) => {
  1891. groupname += item + 1 + "-";
  1892. });
  1893. groupname = groupname.substring(0, groupname.length - 1);
  1894. this.question_list.cur_fn_data.forEach((curItem, indexItem) => {
  1895. if (this.groupIndexList.indexOf(indexItem) > -1) {
  1896. curItem.group_name = "打包组" + groupname;
  1897. curItem.group_id = [groupid];
  1898. }
  1899. });
  1900. this.groupIndexList = [];
  1901. this.$forceUpdate();
  1902. },
  1903. CopyToClipboard(element) {
  1904. var doc = document,
  1905. text = doc.getElementById(element),
  1906. range,
  1907. selection;
  1908. if (doc.body.createTextRange) {
  1909. range = doc.body.createTextRange();
  1910. range.moveToElementText(text);
  1911. range.select();
  1912. } else if (window.getSelection) {
  1913. selection = window.getSelection();
  1914. range = doc.createRange();
  1915. range.selectNodeContents(text);
  1916. selection.removeAllRanges();
  1917. selection.addRange(range);
  1918. }
  1919. document.execCommand("copy");
  1920. this.$message({
  1921. message: "复制成功",
  1922. type: "success",
  1923. });
  1924. window.getSelection().removeAllRanges();
  1925. },
  1926. }, // 如果页面有keep-alive缓存功能,这个函数会触发
  1927. };
  1928. </script>
  1929. <style lang="scss" scoped>
  1930. //@import url(); 引入公共css类
  1931. .topTitle {
  1932. width: 100%;
  1933. height: 48px;
  1934. display: flex;
  1935. justify-content: space-between;
  1936. padding: 0 16px;
  1937. align-items: center;
  1938. background: #f5f5f5 !important;
  1939. border: 1px rgba(0, 0, 0, 0.1) solid;
  1940. border-radius: 4px 4px 0 0;
  1941. margin-top: 10px;
  1942. > :nth-child(1) {
  1943. font-weight: 500;
  1944. font-size: 16px;
  1945. line-height: 150%;
  1946. color: rgba(0, 0, 0, 0.85);
  1947. }
  1948. > :nth-child(2) {
  1949. display: flex;
  1950. align-items: center;
  1951. font-weight: normal;
  1952. font-size: 14px;
  1953. line-height: 22px;
  1954. color: rgba(0, 0, 0, 0.85);
  1955. cursor: pointer;
  1956. }
  1957. img {
  1958. width: 16px;
  1959. height: 16px;
  1960. margin-left: 4px;
  1961. }
  1962. .rotate {
  1963. animation-name: firstrotate;
  1964. animation-direction: 2s;
  1965. animation-fill-mode: both;
  1966. animation-timing-function: linear;
  1967. }
  1968. }
  1969. .collapse-box {
  1970. padding: 10px;
  1971. border: 1px rgba(0, 0, 0, 0.1) solid;
  1972. border-top: none;
  1973. }
  1974. .Big-Book-container {
  1975. width: 100%;
  1976. min-height: 100vh;
  1977. .Big-Book-content {
  1978. padding: 26px 0;
  1979. display: flex;
  1980. justify-content: flex-start;
  1981. align-items: flex-start;
  1982. }
  1983. .content-tree {
  1984. width: 280px;
  1985. overflow: auto;
  1986. }
  1987. .Book-content {
  1988. flex: 1;
  1989. box-sizing: border-box;
  1990. padding: 90px 30px 30px;
  1991. height: 859px;
  1992. overflow-y: auto;
  1993. position: relative;
  1994. box-sizing: border-box;
  1995. &-inner {
  1996. // width: 860px;
  1997. }
  1998. .addoption {
  1999. padding: 0 20px;
  2000. width: auto;
  2001. display: inline-block;
  2002. height: 40px;
  2003. background: #f3f3f3;
  2004. border: 1px dashed rgba(0, 0, 0, 0.15);
  2005. box-sizing: border-box;
  2006. border-radius: 4px;
  2007. text-align: center;
  2008. line-height: 40px;
  2009. cursor: pointer;
  2010. font-size: 14px;
  2011. color: #000000;
  2012. margin-top: 20px;
  2013. }
  2014. .createTable {
  2015. }
  2016. }
  2017. .Big-Book-save {
  2018. width: 100%;
  2019. display: flex;
  2020. justify-content: flex-end;
  2021. padding: 0 0 20px 0;
  2022. &.Big-Book-input-save {
  2023. position: fixed;
  2024. top: 74px;
  2025. left: 280px;
  2026. z-index: 1;
  2027. background: #fff;
  2028. }
  2029. }
  2030. .Big-Book {
  2031. &-add {
  2032. position: absolute;
  2033. top: -40px;
  2034. right: 0;
  2035. z-index: 1;
  2036. width: 73px;
  2037. height: 40px;
  2038. background: #f7f7f7;
  2039. border: 1px solid #d9d9d9;
  2040. line-height: 40px;
  2041. text-align: center;
  2042. font-weight: bold;
  2043. font-size: 18px;
  2044. text-align: center;
  2045. color: #000000;
  2046. }
  2047. &-name {
  2048. display: flex;
  2049. justify-content: flex-start;
  2050. align-items: center;
  2051. margin-bottom: 10px;
  2052. > p {
  2053. font-size: 14px;
  2054. }
  2055. }
  2056. &-delete {
  2057. width: 16px;
  2058. height: 16px;
  2059. margin-left: 15px;
  2060. cursor: pointer;
  2061. }
  2062. &-curPage {
  2063. margin-bottom: 20px;
  2064. &.Big-Book-curPage-edit {
  2065. border-top: 1px solid #e0e0e0;
  2066. border-bottom: 1px solid #e0e0e0;
  2067. background-color: #fafafa;
  2068. }
  2069. &.Big-Book-curPage-preview {
  2070. border-top: 1px solid #fff;
  2071. border-bottom: 1px solid #fff;
  2072. display: flex;
  2073. justify-content: flex-start;
  2074. align-items: flex-start;
  2075. &:hover {
  2076. background-color: #fafafa;
  2077. border-top: 1px solid #e0e0e0;
  2078. border-bottom: 1px solid #e0e0e0;
  2079. }
  2080. }
  2081. }
  2082. &-queBox {
  2083. padding: 10px 0;
  2084. }
  2085. }
  2086. .Book-function {
  2087. width: 204px;
  2088. background: #f7f7f7;
  2089. box-sizing: border-box;
  2090. padding: 30px 16px;
  2091. height: 859px;
  2092. overflow-y: auto;
  2093. text-align: center;
  2094. .function-list {
  2095. width: 100%;
  2096. margin-top: 5px;
  2097. > li {
  2098. width: 100%;
  2099. width: 172px;
  2100. height: 40px;
  2101. background: #ffffff;
  2102. border: 1px solid rgba(0, 0, 0, 0.15);
  2103. box-sizing: border-box;
  2104. border-radius: 4px;
  2105. cursor: pointer;
  2106. margin-bottom: 5px;
  2107. display: flex;
  2108. justify-content: center;
  2109. align-items: center;
  2110. > span {
  2111. font-weight: normal;
  2112. font-size: 16px;
  2113. line-height: 150%;
  2114. color: #000000;
  2115. }
  2116. .el-dropdown {
  2117. color: #000000;
  2118. }
  2119. }
  2120. }
  2121. }
  2122. .Big-Book-top {
  2123. margin-top: 20px;
  2124. display: flex;
  2125. align-items: center;
  2126. span {
  2127. margin-right: 10px;
  2128. }
  2129. }
  2130. }
  2131. .yunmu {
  2132. &-table {
  2133. width: 172px;
  2134. > tr {
  2135. td {
  2136. cursor: pointer;
  2137. text-align: center;
  2138. font-size: 16px;
  2139. height: 26px;
  2140. }
  2141. }
  2142. }
  2143. }
  2144. </style>