overview.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810
  1. <template>
  2. <div class="overview">
  3. <!-- 顶部tag -->
  4. <div class="preview-tag">
  5. <div class="page-tag-btn tagPage" :class="{ active: viewState === 0 }" @click="function () { viewState = 0 }">
  6. <div class="page-tag-btn-tip">页面</div>
  7. </div>
  8. <div class="page-tag-btn tagElement" :class="{ active: viewState === 1 }" @click="function () { viewState = 1 }">
  9. <div class="page-tag-btn-tip">元素</div>
  10. </div>
  11. </div>
  12. <!-- 页面 -->
  13. <div class="page-preview" style="z-index: 1;">
  14. <ul class="list custom-scrollbar">
  15. <li class="cover">
  16. <img class="page_preview_tag" src="../../assets/images/page_preview_tag.png" alt="">
  17. <div class="page_preview_tag_title">封面</div>
  18. <div class="item-page">
  19. <span>1</span>
  20. <div class="page" :class="{ active: pages[0] === editingPage }"
  21. :style="{ width: 70 + 4 + 'px', height: (70 / canvasWidth) * canvasHeight + 4 + 'px' }"
  22. @click="setEditingPage(pages[0],0)" @click.right="rightEvent()">
  23. <Page :isOverView="true" class="content" :hideFoot="true"
  24. :style="{ width: canvasWidth + 'px', height: canvasHeight + 'px', transform: 'scale(' + 70 / canvasWidth +')',backgroundColor: bodyBackgroundColor }"
  25. :elements="pages[0].elements" type="see" />
  26. </div>
  27. </div>
  28. </li>
  29. <li class="cover">
  30. <img class="page_preview_tag" src="../../assets/images/page_preview_tag.png" alt="">
  31. <div class="page_preview_tag_title">题目</div>
  32. <div class="item-page" v-for="(page,index) in pages" v-show="isShow(index)">
  33. <span>{{index + 1 }}</span>
  34. <div class="page" :class="{ active: page === editingPage }"
  35. :style="{ width: 70 + 4 + 'px', height: (70 / canvasWidth) * canvasHeight + 4 + 'px' }"
  36. @click="setEditingPage(page,index)">
  37. <Page :isOverView="true" class="content" :hideFoot="true"
  38. :style="{ width: canvasWidth + 'px', height: canvasHeight + 'px', transform: 'scale(' + 70 / canvasWidth +')',backgroundColor: bodyBackgroundColor }"
  39. :elements="page.elements" type="see" />
  40. </div>
  41. <el-dropdown placement="bottom" trigger="click" class="operation"
  42. @command="command=>operationCommand(command, page, index)">
  43. <div class="operation_img"></div>
  44. <el-dropdown-menu slot="dropdown">
  45. <el-dropdown-item command="del">删除</el-dropdown-item>
  46. </el-dropdown-menu>
  47. </el-dropdown>
  48. </div>
  49. <div class="item-page-add" @click="addPage">添加题目页</div>
  50. </li>
  51. <li class="cover">
  52. <img class="page_preview_tag" src="../../assets/images/page_preview_tag.png" alt="">
  53. <div class="page_preview_tag_title">结论</div>
  54. <div class="item-page" v-for="(page,index) in pages" v-show="isShowResult(index)">
  55. <span>{{index + 1}}</span>
  56. <div class="page" :class="{ active: page === editingPage }"
  57. :style="{ width: 70 + 4 + 'px', height: (70 / canvasWidth) * canvasHeight + 4 + 'px' }"
  58. @click="setEditingPage(page,index)">
  59. <Page :isOverView="true" class="content" :hideFoot="true"
  60. :style="{ width: canvasWidth + 'px', height: canvasHeight + 'px', transform: 'scale(' + 70 / canvasWidth +')',backgroundColor: bodyBackgroundColor }"
  61. :elements="page.elements" type="see" />
  62. </div>
  63. <el-dropdown placement="bottom" trigger="click" class="operation"
  64. @command="command=>operationCommand(command, page, index)">
  65. <div class="operation_img"></div>
  66. <el-dropdown-menu slot="dropdown">
  67. <el-dropdown-item command="del">删除</el-dropdown-item>
  68. </el-dropdown-menu>
  69. </el-dropdown>
  70. </div>
  71. <div class="item-page-add" @click="addResultPage">添加结论页</div>
  72. </li>
  73. </ul>
  74. </div>
  75. <!-- 图层 -->
  76. <div class="list custom-scrollbar" style="z-index: 2;" v-show="viewState === 1"
  77. :class="{ dragging: dragState === 1 }">
  78. <ul>
  79. <li v-for="layer in layersNoBg">
  80. <div class="layer" :class="{ active: editingLayer === layer}" @click="setEditingLayer($event, layer)"
  81. @mousedown="moveLayer">
  82. <span class="thumb" :style="{ backgroundImage: 'url(' + layer.imgSrc + ')' }"></span>{{ layer.type }}
  83. </div>
  84. </li>
  85. </ul>
  86. <div v-for="layer in layersBg" class="layer" :class="{ active: editingLayer === layer}"
  87. @click="setEditingLayer($event, layer)">
  88. <span class="thumb" :style="{ backgroundImage: 'url(' + layer.imgSrc + ')' }"></span>{{ layer.type }}
  89. </div>
  90. </div>
  91. <!-- 题目 -->
  92. <div class="topic-list" v-if="isShowQuestion">
  93. <div class="topic-top" @click="showTopic = !showTopic">
  94. <span>题目列表</span>
  95. <img class="topic-top-arrow" :src="topicIcon" alt="">
  96. </div>
  97. <el-collapse-transition>
  98. <div v-show="showTopic">
  99. <div class="topic-group">
  100. <el-checkbox v-model="item.isChecked" v-for="(item, index) in questionList" :label="item.name"
  101. :key="item.name" @change="checked=>selectCheckbox(checked,item,index)" :disabled="isDisabled(index)">
  102. </el-checkbox>
  103. </div>
  104. </div>
  105. </el-collapse-transition>
  106. </div>
  107. </div>
  108. </template>
  109. <script>
  110. import Page from "./../../components/Page";
  111. import AppConst from "../../util/appConst";
  112. import editorApi from "../../api/editor";
  113. export default {
  114. props: {
  115. testcaseId: "",
  116. resultCount: 0,
  117. questions: []
  118. },
  119. data() {
  120. return {
  121. viewState: 0,
  122. dragState: 0,
  123. http: AppConst.BACKEND_DOMAIN,
  124. canvasWidth: 750,
  125. canvasHeight: 1334,
  126. bodyBackgroundColor: "rgba(255,255,255,0)",
  127. questionPages: [],
  128. resultPageCount: this.resultCount,
  129. resultPages: [],
  130. showTopic: true,
  131. topicIcon: "../../static/img/up-arrow.png",
  132. questionList: [],
  133. isShowQuestion: false,
  134. currentPage: 0,
  135. selectQuestions: this.questions
  136. };
  137. },
  138. mounted() {
  139. let data = {
  140. testcaseId: this.testcaseId
  141. };
  142. console.log("testcaseId:", this.testcaseId);
  143. editorApi.cncTestDetail(data).then(res => {
  144. if (res.success) {
  145. this.questionList = res.single.questionList;
  146. for (var i = 0; i < this.questionList.length; i++) {
  147. this.questionList[i].isChecked = this.isChecked(i);
  148. }
  149. console.log("success", this.questionList);
  150. } else {
  151. console.log("error");
  152. }
  153. });
  154. },
  155. computed: {
  156. vxEditor() {
  157. return this.$store.state["editor"];
  158. },
  159. pages() {
  160. this.bodyBackgroundColor =
  161. this.$store.state.editor.editorTheme.bodyBackgroundColor ||
  162. "rgba(255,255,255,0)";
  163. return this.vxEditor["editorTheme"]["pages"];
  164. },
  165. editingPage() {
  166. return this.vxEditor["editorPage"];
  167. },
  168. layers() {
  169. return this.editingPage["elements"];
  170. },
  171. layersNoBg() {
  172. return (
  173. this.layers && this.layers.filter(v => v["type"] !== "bg").reverse()
  174. );
  175. },
  176. layersBg() {
  177. return this.layers && this.layers.filter(v => v["type"] === "bg");
  178. },
  179. editingLayer() {
  180. return this.vxEditor["editorElement"];
  181. }
  182. },
  183. methods: {
  184. operationCommand(command, page, index) {
  185. if (command == "del") {
  186. console.log("删除", index);
  187. this.deletePage(page, index);
  188. }
  189. },
  190. isChecked(index) {
  191. var question = this.questionList[index].questionId;
  192. var arrTemp = [];
  193. this.selectQuestions.forEach(function(value, key, arr) {
  194. arrTemp.push(...value);
  195. });
  196. console.log("isChecked", index, arrTemp.indexOf(question) != -1);
  197. return arrTemp.indexOf(question) != -1;
  198. },
  199. isDisabled(index) {
  200. var question = this.questionList[index].questionId;
  201. var arrTemp = [];
  202. this.selectQuestions.forEach(function(value, key, arr) {
  203. arrTemp.push(...value);
  204. });
  205. let questions = this.selectQuestions[this.currentPage - 1] || [];
  206. if (questions.indexOf(question) == -1) {
  207. if (questions.length == 2) {
  208. return true;
  209. } else {
  210. return arrTemp.indexOf(question) != -1;
  211. }
  212. } else {
  213. return false;
  214. }
  215. },
  216. selectCheckbox(checked, item, index) {
  217. console.log("选中", checked, item, index);
  218. let questions = this.selectQuestions[this.currentPage - 1] || [];
  219. if (checked) {
  220. questions.push(item.questionId);
  221. console.log("AAAAAAAAA", questions);
  222. this.addQuestion(item);
  223. } else {
  224. questions.splice(
  225. questions.findIndex(itemTemp => itemTemp === item.questionId),
  226. 1
  227. );
  228. console.log("DDDDDDDDDD", questions);
  229. this.deleteQuestion(item);
  230. }
  231. var selecteQuestionList = [];
  232. for (var i = 0; i < questions.length; i++) {
  233. var selectQID = questions[i];
  234. for (var n = 0; n < this.questionList.length; n++) {
  235. if (this.questionList[n].questionId == selectQID) {
  236. selecteQuestionList.push(this.questionList[n]);
  237. }
  238. }
  239. }
  240. console.log("RRRRRRRRRR", selecteQuestionList);
  241. this.$store.dispatch("addQuestion", selecteQuestionList);
  242. },
  243. addQuestion(item) {
  244. let questions = this.selectQuestions[this.currentPage - 1] || [];
  245. var top = 170;
  246. if (questions.length > 1) {
  247. var question = this.questionList.filter(
  248. item => item.questionId == questions[0]
  249. );
  250. top = question[0].optionList.length * 90 + 300;
  251. }
  252. // 添加题目
  253. let param = {};
  254. param.top = top;
  255. param.left = 100;
  256. param.questionId = item.questionId;
  257. param["type"] = "text";
  258. param["text"] = item.name;
  259. param["width"] = 300;
  260. param["lineHeight"] = 1.5;
  261. param["backgroundColor"] = "";
  262. param["verticalAlign"] = "top";
  263. param["display"] = "block";
  264. param["textIndent"] = "0.0";
  265. param["letterSpacing"] = "0.0";
  266. param["allTransparent"] = "";
  267. param["nodeId"] = "Id" + Math.random();
  268. this.$store.dispatch("addElement", param);
  269. // 添加选项
  270. var itemTop = top + 50;
  271. for (var i = 0; i < item.optionList.length; i++) {
  272. console.log("选项", item.optionList[i].content);
  273. let obj = {};
  274. obj.questionId = item.questionId;
  275. obj.optionId = item.optionList[i].optionId;
  276. obj.type = "button";
  277. obj.top = itemTop + i * 40 + (i + 1) * 50;
  278. obj.left = 100;
  279. obj["text"] = item.optionList[i].content;
  280. obj["lineHeight"] = 1.5;
  281. obj.width = 300;
  282. obj.height = 40;
  283. obj.backgroundUnselectedImg =
  284. "https://dm.static.elab-plus.com/diaoyanbao/option_default.png";
  285. obj.backgroundSelectedImg =
  286. "https://dm.static.elab-plus.com/diaoyanbao/option_select.png";
  287. obj.loop = false;
  288. this.$store.dispatch("addElement", obj);
  289. }
  290. },
  291. deleteQuestion(item) {
  292. this.$store.dispatch("deleteElementQID", item.questionId);
  293. // var elements = this.pages[this.currentPage].elements;
  294. // for (var i = 0; i < elements.length; i++) {
  295. // if (elements[i].questionId == item.questionId) {
  296. // this.$store.dispatch("deleteElement", elements[i]);
  297. // }
  298. // }
  299. },
  300. isShow: function(index) {
  301. var result = false;
  302. if (index > 0) {
  303. console.log(this.pages.length, index, this.resultPageCount);
  304. if (this.pages.length - index > this.resultPageCount) {
  305. result = true;
  306. }
  307. }
  308. return result;
  309. },
  310. isShowResult(index) {
  311. var result = false;
  312. console.log(this.pages.length, index, this.resultPageCount);
  313. if (
  314. this.pages.length - index <= this.resultPageCount &&
  315. this.resultPageCount > 0
  316. ) {
  317. result = true;
  318. }
  319. return result;
  320. },
  321. moveLayer(downEvent) {
  322. let height = 30;
  323. let timer = null;
  324. let layer = downEvent.target;
  325. let li = layer.parentNode;
  326. let parent = li.parentNode;
  327. let liLen = parent.childNodes.length;
  328. let startTop = li.offsetTop;
  329. let startIndex = Math.round(startTop / height);
  330. let targetIndex = null;
  331. let placeholder = document.createElement("li");
  332. placeholder.style = "height: " + height + "px; background-color: #d6d6d6";
  333. let move = moveEvent => {
  334. if (!timer) {
  335. // 被拖动的层
  336. let top = moveEvent.clientY - downEvent.clientY + startTop;
  337. layer.setAttribute("data-moving", true);
  338. layer.style.top = top + "px";
  339. this.dragState = 1;
  340. // 占位层
  341. let nowIndex = Math.round(top / height);
  342. nowIndex =
  343. nowIndex <= 0 ? 0 : nowIndex > liLen - 1 ? liLen - 1 : nowIndex;
  344. if (targetIndex !== nowIndex) {
  345. (targetIndex || targetIndex === 0) &&
  346. parent.removeChild(placeholder);
  347. targetIndex = nowIndex;
  348. parent.insertBefore(
  349. placeholder,
  350. parent.childNodes[nowIndex + (startIndex >= targetIndex ? 0 : 1)]
  351. );
  352. }
  353. // timer负责减少onmousemove对客户端的负担
  354. timer = setTimeout(() => {
  355. timer = null;
  356. }, 20);
  357. }
  358. };
  359. let up = upEvent => {
  360. if (layer.getAttribute("data-moving")) {
  361. layer.removeAttribute("data-moving");
  362. layer.style.top = "";
  363. parent.removeChild(placeholder);
  364. this.layersNoBg[startIndex]["zindex"] =
  365. this.layersNoBg[targetIndex]["zindex"] +
  366. (targetIndex > startIndex ? -0.5 : 0.5);
  367. this.updateLayersSort();
  368. }
  369. document.removeEventListener("mousemove", move);
  370. document.removeEventListener("mouseup", up);
  371. this.dragState = 0;
  372. };
  373. if (liLen > 1) {
  374. document.addEventListener("mousemove", move);
  375. document.addEventListener("mouseup", up);
  376. }
  377. },
  378. copyPage(page) {
  379. this.bodyBackgroundColor =
  380. this.$store.state.editor.editorTheme.bodyBackgroundColor ||
  381. "rgba(255,255,255,0)";
  382. this.$store.dispatch("copyPage", page);
  383. },
  384. deletePage(page, index) {
  385. this.$msgbox({
  386. title: "删除",
  387. message: "删除后不可撤回,确定删除?",
  388. showCancelButton: true,
  389. confirmButtonText: "确定",
  390. cancelButtonText: "取消",
  391. beforeClose: (action, instance, done) => {
  392. if (action === "confirm") {
  393. var qusetionCount = this.pages.length - this.resultPageCount;
  394. if (qusetionCount <= index) {
  395. console.log("删除结论页", index, qusetionCount);
  396. this.$store.dispatch("delPage", page);
  397. this.resultPageCount -= 1;
  398. } else {
  399. console.log("删除题目", index, qusetionCount);
  400. var pageSlelctQ = this.selectQuestions[index - 1] || [];
  401. var deleteList = [];
  402. for (var i = 0; i < pageSlelctQ.length; i++) {
  403. var question = this.questionList.filter(
  404. item => item.questionId == pageSlelctQ[i]
  405. );
  406. if (question.length > 0) {
  407. var selectIndex = this.questionList.findIndex(
  408. itemTemp => itemTemp.questionId == question[0].questionId
  409. );
  410. this.questionList[selectIndex].isChecked = false;
  411. deleteList.push({ index: selectIndex, item: question[0] });
  412. }
  413. }
  414. for (var i = 0; i < deleteList.length; i++) {
  415. console.log("WWWWWWWWW", deleteList[i]);
  416. this.selectCheckbox(
  417. false,
  418. deleteList[i].item,
  419. deleteList[i].index
  420. );
  421. }
  422. this.questions.splice(index, 1);
  423. this.$store.dispatch("delPage", page);
  424. var editingPage = this.pages[index - 1];
  425. this.setEditingPage(editingPage, index - 1);
  426. }
  427. this.$message.success("删除成功");
  428. done();
  429. } else {
  430. done();
  431. }
  432. }
  433. })
  434. .then(() => {})
  435. .catch(() => {});
  436. },
  437. addPage() {
  438. this.bodyBackgroundColor =
  439. this.$store.state.editor.editorTheme.bodyBackgroundColor ||
  440. "rgba(255,255,255,0)";
  441. var position = this.pages.length - this.resultPageCount;
  442. this.$store.dispatch("addPagePosition", position);
  443. this.isShowQuestion = true;
  444. this.selectQuestions.push([]);
  445. this.currentPage += 1;
  446. },
  447. addResultPage() {
  448. this.bodyBackgroundColor =
  449. this.$store.state.editor.editorTheme.bodyBackgroundColor ||
  450. "rgba(255,255,255,0)";
  451. this.$store.dispatch("addPage");
  452. this.resultPageCount += 1;
  453. this.isShowQuestion = false;
  454. },
  455. setEditingPage(page, index) {
  456. this.currentPage = index;
  457. if (index == 0 || this.isShowResult(index)) {
  458. this.isShowQuestion = false;
  459. } else {
  460. this.isShowQuestion = true;
  461. }
  462. this.bodyBackgroundColor =
  463. this.$store.state.editor.editorTheme.bodyBackgroundColor ||
  464. "rgba(255,255,255,0)";
  465. this.$store.dispatch("setEditorPage", page);
  466. },
  467. setEditingLayer(event, layer) {
  468. this.$store.dispatch("setEditorElement", layer);
  469. },
  470. updateLayersSort() {
  471. this.$store.dispatch("sortElementsByZindex");
  472. }
  473. },
  474. components: { Page },
  475. watch: {
  476. showTopic: function(val) {
  477. if (val) {
  478. this.topicIcon = "../../static/img/up-arrow.png";
  479. } else {
  480. this.topicIcon = "../../static/img/down-arrow.png";
  481. }
  482. },
  483. resultCount(val) {
  484. this.resultPageCount = val;
  485. },
  486. questions(val) {
  487. this.selectQuestions = val;
  488. },
  489. currentPage(val) {
  490. console.log("当前页数:", val);
  491. this.questionList = this.questionList;
  492. }
  493. }
  494. };
  495. </script>
  496. <style lang="less" scoped>
  497. .overview {
  498. position: relative;
  499. background-color: rgb(196, 185, 185);
  500. height: 100%;
  501. .preview-tag {
  502. width: 44px;
  503. height: 100%;
  504. background: #fff;
  505. box-shadow: 5px 0px 10px 0px rgba(62, 67, 116, 0.1);
  506. position: absolute;
  507. top: 0px;
  508. left: 226px;
  509. z-index: 3;
  510. padding-top: 10px;
  511. .page-tag-btn {
  512. margin-top: 10px;
  513. margin-left: 5px;
  514. width: 34px;
  515. height: 34px;
  516. }
  517. .tagPage {
  518. background: url(../../assets/images/page-tag.png) center no-repeat;
  519. background-size: cover;
  520. &.active {
  521. background: url(../../assets/images/page-tag-sel.png) center no-repeat;
  522. background-size: cover;
  523. }
  524. }
  525. .tagPage:hover {
  526. background: url(../../assets/images/page-tag-hover.png) center no-repeat;
  527. background-size: cover;
  528. }
  529. .tagPage:hover div {
  530. display: block;
  531. }
  532. .tagElement {
  533. background: url(../../assets/images/element-tag.png) center no-repeat;
  534. background-size: cover;
  535. &.active {
  536. background: url(../../assets/images/element-tag-sel.png) center
  537. no-repeat;
  538. background-size: cover;
  539. }
  540. }
  541. .tagElement:hover {
  542. background: url(../../assets/images/element-tag-hover.png) center
  543. no-repeat;
  544. background-size: cover;
  545. }
  546. .tagElement:hover div {
  547. display: block;
  548. }
  549. .page-tag-btn-tip {
  550. width: 80px;
  551. height: 26px;
  552. position: relative;
  553. top: 5px;
  554. left: -80px;
  555. display: none;
  556. text-align: center;
  557. line-height: 26px;
  558. font-size: 14px;
  559. color: #fff;
  560. background: url(../../assets/images/page_tag_btn_tip.png) center no-repeat;
  561. background-size: cover;
  562. }
  563. }
  564. .panel {
  565. float: left;
  566. line-height: 40px;
  567. width: 50%;
  568. text-align: center;
  569. background-color: #d6d6d6;
  570. cursor: pointer;
  571. &.active {
  572. background-color: transparent;
  573. }
  574. }
  575. .list {
  576. background-color: #fff;
  577. position: absolute;
  578. top: 0px;
  579. bottom: 0px;
  580. width: 100%;
  581. overflow-y: auto;
  582. overflow-x: hidden;
  583. padding-top: 10px;
  584. padding-bottom: 20px;
  585. .cover {
  586. margin-left: 16px;
  587. width: 180px;
  588. background: rgba(230, 237, 255, 1);
  589. border-radius: 6px;
  590. padding-top: 10px;
  591. padding-bottom: 10px;
  592. position: relative;
  593. margin-top: 16px;
  594. .page_preview_tag {
  595. position: absolute;
  596. top: 6px;
  597. left: 0px;
  598. width: 49px;
  599. height: 22px;
  600. }
  601. .page_preview_tag_title {
  602. position: absolute;
  603. top: 6px;
  604. left: 0px;
  605. line-height: 22px;
  606. margin-left: 10px;
  607. font-size: 12px;
  608. color: rgba(255, 255, 255, 1);
  609. }
  610. .item-page {
  611. position: relative;
  612. display: flex;
  613. flex-direction: row;
  614. justify-content: center;
  615. margin-top: 20px;
  616. margin-bottom: 20px;
  617. font-size: 14px;
  618. font-weight: 500;
  619. color: rgba(100, 107, 129, 1);
  620. .preview-page {
  621. margin-left: 10px;
  622. width: 70px;
  623. height: 114px;
  624. box-shadow: 0px 2px 4px 0px rgba(78, 93, 255, 1);
  625. border: 2px solid rgba(255, 255, 255, 1);
  626. background: #fff;
  627. }
  628. .operation {
  629. position: absolute;
  630. top: 30px;
  631. left: 40px;
  632. .operation_img {
  633. width: 16px;
  634. height: 16px;
  635. background: url(../../assets/images/page_operation.png) center
  636. no-repeat;
  637. background-size: cover;
  638. }
  639. .operation_img:hover {
  640. background: url(../../assets/images/page_operation_sel.png) center
  641. no-repeat;
  642. background-size: cover;
  643. }
  644. }
  645. }
  646. .item-page-add {
  647. width: 70px;
  648. height: 114px;
  649. margin-left: 64px;
  650. margin-bottom: 30px;
  651. font-size: 12px;
  652. color: rgba(100, 107, 129, 1);
  653. line-height: 154px;
  654. text-align: center;
  655. background: url(../../assets/images/item-page-add.png) center no-repeat;
  656. background-size: cover;
  657. }
  658. .item-page-add:hover {
  659. color: rgba(51, 51, 51, 1);
  660. background: url(../../assets/images/item-page-add-hover.png) center
  661. no-repeat;
  662. background-size: cover;
  663. }
  664. }
  665. }
  666. .dragging:before {
  667. content: "";
  668. position: absolute;
  669. top: 0;
  670. right: 0;
  671. bottom: 0;
  672. left: 0;
  673. z-index: 10;
  674. }
  675. .page {
  676. position: relative;
  677. margin-left: 10px;
  678. border: 2px solid rgba(255, 255, 255, 1);
  679. background: #fff;
  680. &.active {
  681. border-color: rgba(78, 93, 255, 1);
  682. box-shadow: 0px 2px 4px 0px rgba(78, 93, 255, 1);
  683. .icons {
  684. display: block;
  685. }
  686. }
  687. &:before {
  688. content: "";
  689. position: absolute;
  690. top: 0;
  691. left: 0;
  692. bottom: 0;
  693. right: 0;
  694. z-index: 2;
  695. }
  696. .content {
  697. transform-origin: left top;
  698. background-color: #fff;
  699. overflow: hidden;
  700. position: relative;
  701. }
  702. .icons {
  703. position: absolute;
  704. bottom: -1.5em;
  705. right: 0.5em;
  706. display: none;
  707. width: 100%;
  708. color: #fff;
  709. .icon {
  710. float: right;
  711. margin-left: 1em;
  712. opacity: 0.5;
  713. cursor: pointer;
  714. &:hover {
  715. opacity: 1;
  716. }
  717. }
  718. }
  719. }
  720. .layer {
  721. padding-left: 20px;
  722. height: 34px;
  723. line-height: 34px;
  724. cursor: pointer;
  725. color: rgba(51, 51, 51, 1);
  726. &[data-moving] {
  727. background-color: #d6d6d6;
  728. position: absolute;
  729. width: 100%;
  730. }
  731. &:hover {
  732. background: rgba(230, 237, 255, 1);
  733. }
  734. &.active {
  735. background: rgba(78, 93, 255, 1);
  736. color: #fff;
  737. }
  738. .thumb {
  739. display: inline-block;
  740. width: 15px;
  741. height: 15px;
  742. margin-right: 1em;
  743. background: white center no-repeat;
  744. background-size: cover;
  745. }
  746. }
  747. .add {
  748. border: none;
  749. position: absolute;
  750. bottom: 0;
  751. height: 50px;
  752. line-height: 50px;
  753. width: 100%;
  754. left: 0;
  755. background-color: #373f42;
  756. text-align: center;
  757. color: #fff;
  758. cursor: pointer;
  759. }
  760. .topic-list {
  761. position: absolute;
  762. top: 10px;
  763. left: 280px;
  764. width: 345px;
  765. background: rgba(255, 255, 255, 1);
  766. border-radius: 6px;
  767. z-index: 4;
  768. .topic-top {
  769. width: 100%;
  770. height: 34px;
  771. background: rgba(78, 93, 255, 1);
  772. color: #fff;
  773. border-radius: 6px 6px 0px 0px;
  774. line-height: 34px;
  775. display: flex;
  776. flex-direction: row;
  777. justify-content: space-between;
  778. align-items: center;
  779. padding-left: 10px;
  780. padding-right: 10px;
  781. .topic-top-arrow {
  782. width: 13px;
  783. height: 12px;
  784. }
  785. }
  786. .topic-group {
  787. display: flex;
  788. flex-direction: column;
  789. margin-left: 24px;
  790. .el-checkbox {
  791. padding-top: 10px;
  792. padding-bottom: 10px;
  793. border-bottom: 1px solid #e2e4ee;
  794. display: flex;
  795. position: relative;
  796. white-space: pre-line;
  797. align-items: center;
  798. font-size: 14px;
  799. font-weight: 400;
  800. color: rgba(51, 51, 51, 1);
  801. line-height: 19px;
  802. }
  803. }
  804. }
  805. }
  806. </style>