adultInput.vue 75 KB

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