overview.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811
  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" v-for="(page,index) in pages" v-show="index==0">
  19. <span>1</span>
  20. <div class="page" :class="{ active: page === editingPage }"
  21. :style="{ width: 70 + 4 + 'px', height: (70 / canvasWidth) * canvasHeight + 4 + 'px' }"
  22. @click="setEditingPage(page,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="page.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, index) in layersNoBg" :key="index">
  80. <div class="layer" :class="{ active: editingLayer === layer}" @mousedown="moveLayer($event,layer)">
  81. <span class="thumb" :style="{ backgroundImage: 'url(' + layer.imgSrc + ')' }"></span>{{ layer.type }}
  82. </div>
  83. </li>
  84. </ul>
  85. <div v-for="(layer, index) in layersBg" :key="index" class="layer" :class="{ active: editingLayer === layer}"
  86. @click="setEditingLayer(layer)">
  87. <span class="thumb" :style="{ backgroundImage: 'url(' + layer.imgSrc + ')' }"></span>{{ layer.type }}
  88. </div>
  89. </div>
  90. <!-- 题目 -->
  91. <div class="topic-list" v-if="isShowQuestion">
  92. <div class="topic-top" @click="showTopic = !showTopic">
  93. <span>题目列表</span>
  94. <img class="topic-top-arrow" :src="topicIcon" alt="">
  95. </div>
  96. <el-collapse-transition>
  97. <div v-show="showTopic">
  98. <div class="topic-group">
  99. <el-checkbox v-model="item.isChecked" v-for="(item, index) in questionList" :label="item.name" :key="index"
  100. @change="checked=>selectCheckbox(checked,item,index)" :disabled="isDisabled(index)">
  101. </el-checkbox>
  102. </div>
  103. </div>
  104. </el-collapse-transition>
  105. </div>
  106. </div>
  107. </template>
  108. <script>
  109. import Page from "./../../components/Page";
  110. import AppConst from "../../util/appConst";
  111. import editorApi from "../../api/editor";
  112. export default {
  113. props: {
  114. testcaseId: "",
  115. resultCount: 0,
  116. questions: Array
  117. },
  118. data() {
  119. return {
  120. viewState: 0,
  121. dragState: 0,
  122. http: AppConst.BACKEND_DOMAIN,
  123. canvasWidth: 750,
  124. canvasHeight: 1334,
  125. bodyBackgroundColor: "rgba(255,255,255,0)",
  126. questionPages: [],
  127. resultPageCount: this.resultCount,
  128. resultPages: [],
  129. showTopic: true,
  130. topicIcon: "../../static/img/up-arrow.png",
  131. questionList: [],
  132. isShowQuestion: false,
  133. currentPage: 0,
  134. selectQuestions: this.questions
  135. };
  136. },
  137. mounted() {
  138. let data = {
  139. testcaseId: this.testcaseId
  140. };
  141. console.log("testcaseId:", this.testcaseId);
  142. editorApi.cncTestDetail(data).then(res => {
  143. if (res.success) {
  144. this.questionList = res.single.questionList;
  145. for (var i = 0; i < this.questionList.length; i++) {
  146. this.questionList[i].isChecked = this.isChecked(i);
  147. }
  148. console.log("success", this.questionList);
  149. } else {
  150. console.log("error");
  151. }
  152. });
  153. },
  154. computed: {
  155. vxEditor() {
  156. return this.$store.state["editor"];
  157. },
  158. pages() {
  159. this.bodyBackgroundColor =
  160. this.$store.state.editor.editorTheme.bodyBackgroundColor ||
  161. "rgba(255,255,255,0)";
  162. return this.vxEditor["editorTheme"]["pages"];
  163. },
  164. editingPage() {
  165. return this.vxEditor["editorPage"];
  166. },
  167. layers() {
  168. return this.editingPage["elements"];
  169. },
  170. layersNoBg() {
  171. return (
  172. this.layers && this.layers.filter(v => v["type"] !== "bg").reverse()
  173. );
  174. },
  175. layersBg() {
  176. return this.layers && this.layers.filter(v => v["type"] === "bg");
  177. },
  178. editingLayer() {
  179. return this.vxEditor["editorElement"];
  180. },
  181. },
  182. methods: {
  183. operationCommand(command, page, index) {
  184. if (command == "del") {
  185. console.log("删除", index);
  186. this.deletePage(page, index);
  187. }
  188. },
  189. isChecked(index) {
  190. var question = this.questionList[index].questionId;
  191. var arrTemp = [];
  192. this.selectQuestions.forEach(function(value, key, arr) {
  193. arrTemp.push(...value);
  194. });
  195. console.log("isChecked", index, arrTemp.indexOf(question) != -1);
  196. return arrTemp.indexOf(question) != -1;
  197. },
  198. isDisabled(index) {
  199. var question = this.questionList[index].questionId;
  200. var arrTemp = [];
  201. this.selectQuestions.forEach(function(value, key, arr) {
  202. arrTemp.push(...value);
  203. });
  204. let questions = this.selectQuestions[this.currentPage - 1] || [];
  205. if (questions.indexOf(question) == -1) {
  206. if (questions.length == 2) {
  207. return true;
  208. } else {
  209. return arrTemp.indexOf(question) != -1;
  210. }
  211. } else {
  212. return false;
  213. }
  214. },
  215. selectCheckbox(checked, item, index) {
  216. console.log("选中", checked, item, index);
  217. let questions = this.selectQuestions[this.currentPage - 1] || [];
  218. if (checked) {
  219. questions.push(item.questionId);
  220. console.log("AAAAAAAAA", questions);
  221. this.addQuestion(item);
  222. } else {
  223. questions.splice(
  224. questions.findIndex(itemTemp => itemTemp === item.questionId),
  225. 1
  226. );
  227. console.log("DDDDDDDDDD", questions);
  228. this.deleteQuestion(item);
  229. }
  230. var selecteQuestionList = [];
  231. for (var i = 0; i < questions.length; i++) {
  232. var selectQID = questions[i];
  233. for (var n = 0; n < this.questionList.length; n++) {
  234. if (this.questionList[n].questionId == selectQID) {
  235. selecteQuestionList.push(this.questionList[n]);
  236. }
  237. }
  238. }
  239. console.log("RRRRRRRRRR", selecteQuestionList);
  240. this.$store.dispatch("addQuestion", selecteQuestionList);
  241. },
  242. addQuestion(item) {
  243. let questions = this.selectQuestions[this.currentPage - 1] || [];
  244. var top = 170;
  245. if (questions.length > 1) {
  246. var question = this.questionList.filter(
  247. item => item.questionId == questions[0]
  248. );
  249. top = question[0].optionList.length * 90 + 300;
  250. }
  251. // 添加题目
  252. let param = {};
  253. param.top = top;
  254. param.left = 100;
  255. param.questionId = item.questionId;
  256. param["type"] = "text";
  257. param["text"] = item.name;
  258. param["width"] = 300;
  259. param["lineHeight"] = 1.5;
  260. param["backgroundColor"] = "";
  261. param["verticalAlign"] = "top";
  262. param["display"] = "block";
  263. param["textIndent"] = "0.0";
  264. param["letterSpacing"] = "0.0";
  265. param["allTransparent"] = "";
  266. param["nodeId"] = "Id" + Math.random();
  267. this.$store.dispatch("addElement", param);
  268. // 添加选项
  269. var itemTop = top + 50;
  270. for (var i = 0; i < item.optionList.length; i++) {
  271. console.log("选项", item.optionList[i].content);
  272. let obj = {};
  273. obj.questionId = item.questionId;
  274. obj.optionId = item.optionList[i].optionId;
  275. obj.type = "button";
  276. obj.top = itemTop + i * 40 + (i + 1) * 50;
  277. obj.left = 100;
  278. obj["text"] = item.optionList[i].content;
  279. obj["lineHeight"] = 1.5;
  280. obj.width = 300;
  281. obj.height = 40;
  282. obj.backgroundUnselectedImg =
  283. "https://dm.static.elab-plus.com/diaoyanbao/option_default.png";
  284. obj.backgroundSelectedImg =
  285. "https://dm.static.elab-plus.com/diaoyanbao/option_select.png";
  286. obj.loop = false;
  287. this.$store.dispatch("addElement", obj);
  288. }
  289. },
  290. deleteQuestion(item) {
  291. this.$store.dispatch("deleteElementQID", item.questionId);
  292. // var elements = this.pages[this.currentPage].elements;
  293. // for (var i = 0; i < elements.length; i++) {
  294. // if (elements[i].questionId == item.questionId) {
  295. // this.$store.dispatch("deleteElement", elements[i]);
  296. // }
  297. // }
  298. },
  299. isShow: function(index) {
  300. var result = false;
  301. if (index > 0) {
  302. // console.log(this.pages.length, index, this.resultPageCount);
  303. if (this.pages.length - index > this.resultPageCount) {
  304. result = true;
  305. }
  306. }
  307. return result;
  308. },
  309. isShowResult(index) {
  310. var result = false;
  311. // console.log(this.pages.length, index, this.resultPageCount);
  312. if (
  313. this.pages.length - index <= this.resultPageCount &&
  314. this.resultPageCount > 0
  315. ) {
  316. result = true;
  317. }
  318. return result;
  319. },
  320. moveLayer(downEvent, element) {
  321. this.setEditingLayer(element);
  322. let height = 34;
  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(layer) {
  468. console.log("点击了");
  469. this.$store.state.editor.complexEditorElement = [];
  470. this.$store.dispatch("setEditorElement", null);
  471. this.$store.dispatch("setEditorElement", layer);
  472. },
  473. updateLayersSort() {
  474. this.$store.dispatch("sortElementsByZindex");
  475. }
  476. },
  477. components: { Page},
  478. watch: {
  479. showTopic: function(val) {
  480. if (val) {
  481. this.topicIcon = "../../static/img/up-arrow.png";
  482. } else {
  483. this.topicIcon = "../../static/img/down-arrow.png";
  484. }
  485. },
  486. resultCount(val) {
  487. this.resultPageCount = val;
  488. },
  489. questions(val) {
  490. this.selectQuestions = val;
  491. },
  492. currentPage(val) {
  493. console.log("当前页数:", val);
  494. this.questionList = this.questionList;
  495. }
  496. }
  497. };
  498. </script>
  499. <style lang="less" scoped>
  500. .overview {
  501. position: relative;
  502. background-color: rgb(196, 185, 185);
  503. height: 100%;
  504. .preview-tag {
  505. width: 44px;
  506. height: 100%;
  507. background: #fff;
  508. box-shadow: 5px 0px 10px 0px rgba(62, 67, 116, 0.1);
  509. position: absolute;
  510. top: 0px;
  511. left: 226px;
  512. z-index: 3;
  513. padding-top: 10px;
  514. .page-tag-btn {
  515. margin-top: 10px;
  516. margin-left: 5px;
  517. width: 34px;
  518. height: 34px;
  519. }
  520. .tagPage {
  521. background: url(../../assets/images/page-tag.png) center no-repeat;
  522. background-size: cover;
  523. &.active {
  524. background: url(../../assets/images/page-tag-sel.png) center no-repeat;
  525. background-size: cover;
  526. }
  527. }
  528. .tagPage:hover {
  529. background: url(../../assets/images/page-tag-hover.png) center no-repeat;
  530. background-size: cover;
  531. }
  532. .tagPage:hover div {
  533. display: block;
  534. }
  535. .tagElement {
  536. background: url(../../assets/images/element-tag.png) center no-repeat;
  537. background-size: cover;
  538. &.active {
  539. background: url(../../assets/images/element-tag-sel.png) center
  540. no-repeat;
  541. background-size: cover;
  542. }
  543. }
  544. .tagElement:hover {
  545. background: url(../../assets/images/element-tag-hover.png) center
  546. no-repeat;
  547. background-size: cover;
  548. }
  549. .tagElement:hover div {
  550. display: block;
  551. }
  552. .page-tag-btn-tip {
  553. width: 80px;
  554. height: 26px;
  555. position: relative;
  556. top: 5px;
  557. left: -80px;
  558. display: none;
  559. text-align: center;
  560. line-height: 26px;
  561. font-size: 14px;
  562. color: #fff;
  563. background: url(../../assets/images/page_tag_btn_tip.png) center no-repeat;
  564. background-size: cover;
  565. }
  566. }
  567. .panel {
  568. float: left;
  569. line-height: 40px;
  570. width: 50%;
  571. text-align: center;
  572. background-color: #d6d6d6;
  573. cursor: pointer;
  574. &.active {
  575. background-color: transparent;
  576. }
  577. }
  578. .list {
  579. background-color: #fff;
  580. position: absolute;
  581. top: 0px;
  582. bottom: 0px;
  583. width: 100%;
  584. overflow-y: auto;
  585. overflow-x: hidden;
  586. padding-top: 10px;
  587. padding-bottom: 20px;
  588. .cover {
  589. margin-left: 16px;
  590. width: 180px;
  591. background: rgba(230, 237, 255, 1);
  592. border-radius: 6px;
  593. padding-top: 10px;
  594. padding-bottom: 10px;
  595. position: relative;
  596. margin-top: 16px;
  597. .page_preview_tag {
  598. position: absolute;
  599. top: 6px;
  600. left: 0px;
  601. width: 49px;
  602. height: 22px;
  603. }
  604. .page_preview_tag_title {
  605. position: absolute;
  606. top: 6px;
  607. left: 0px;
  608. line-height: 22px;
  609. margin-left: 10px;
  610. font-size: 12px;
  611. color: rgba(255, 255, 255, 1);
  612. }
  613. .item-page {
  614. position: relative;
  615. display: flex;
  616. flex-direction: row;
  617. justify-content: center;
  618. margin-top: 20px;
  619. margin-bottom: 20px;
  620. font-size: 14px;
  621. font-weight: 500;
  622. color: rgba(100, 107, 129, 1);
  623. .preview-page {
  624. margin-left: 10px;
  625. width: 70px;
  626. height: 114px;
  627. box-shadow: 0px 2px 4px 0px rgba(78, 93, 255, 1);
  628. border: 2px solid rgba(255, 255, 255, 1);
  629. background: #fff;
  630. }
  631. .operation {
  632. position: absolute;
  633. top: 30px;
  634. left: 40px;
  635. .operation_img {
  636. width: 16px;
  637. height: 16px;
  638. background: url(../../assets/images/page_operation.png) center
  639. no-repeat;
  640. background-size: cover;
  641. }
  642. .operation_img:hover {
  643. background: url(../../assets/images/page_operation_sel.png) center
  644. no-repeat;
  645. background-size: cover;
  646. }
  647. }
  648. }
  649. .item-page-add {
  650. width: 70px;
  651. height: 114px;
  652. margin-left: 64px;
  653. margin-bottom: 30px;
  654. font-size: 12px;
  655. color: rgba(100, 107, 129, 1);
  656. line-height: 154px;
  657. text-align: center;
  658. background: url(../../assets/images/item-page-add.png) center no-repeat;
  659. background-size: cover;
  660. }
  661. .item-page-add:hover {
  662. color: rgba(51, 51, 51, 1);
  663. background: url(../../assets/images/item-page-add-hover.png) center
  664. no-repeat;
  665. background-size: cover;
  666. }
  667. }
  668. }
  669. .dragging:before {
  670. content: "";
  671. position: absolute;
  672. top: 0;
  673. right: 0;
  674. bottom: 0;
  675. left: 0;
  676. z-index: 10;
  677. }
  678. .page {
  679. position: relative;
  680. margin-left: 10px;
  681. border: 2px solid rgba(255, 255, 255, 1);
  682. background: #fff;
  683. &.active {
  684. border-color: rgba(78, 93, 255, 1);
  685. box-shadow: 0px 2px 4px 0px rgba(78, 93, 255, 1);
  686. .icons {
  687. display: block;
  688. }
  689. }
  690. &:before {
  691. content: "";
  692. position: absolute;
  693. top: 0;
  694. left: 0;
  695. bottom: 0;
  696. right: 0;
  697. z-index: 2;
  698. }
  699. .content {
  700. transform-origin: left top;
  701. background-color: #fff;
  702. overflow: hidden;
  703. position: relative;
  704. }
  705. .icons {
  706. position: absolute;
  707. bottom: -1.5em;
  708. right: 0.5em;
  709. display: none;
  710. width: 100%;
  711. color: #fff;
  712. .icon {
  713. float: right;
  714. margin-left: 1em;
  715. opacity: 0.5;
  716. cursor: pointer;
  717. &:hover {
  718. opacity: 1;
  719. }
  720. }
  721. }
  722. }
  723. .layer {
  724. padding-left: 20px;
  725. height: 34px;
  726. line-height: 34px;
  727. cursor: pointer;
  728. color: rgba(51, 51, 51, 1);
  729. &[data-moving] {
  730. background-color: #d6d6d6;
  731. position: absolute;
  732. width: 100%;
  733. }
  734. &:hover {
  735. background: rgba(230, 237, 255, 1);
  736. }
  737. &.active {
  738. background: rgba(78, 93, 255, 1);
  739. color: #fff;
  740. }
  741. .thumb {
  742. display: inline-block;
  743. width: 15px;
  744. height: 15px;
  745. margin-right: 1em;
  746. background: white center no-repeat;
  747. background-size: cover;
  748. }
  749. }
  750. .add {
  751. border: none;
  752. position: absolute;
  753. bottom: 0;
  754. height: 50px;
  755. line-height: 50px;
  756. width: 100%;
  757. left: 0;
  758. background-color: #373f42;
  759. text-align: center;
  760. color: #fff;
  761. cursor: pointer;
  762. }
  763. .topic-list {
  764. position: absolute;
  765. top: 10px;
  766. left: 280px;
  767. width: 345px;
  768. background: rgba(255, 255, 255, 1);
  769. border-radius: 6px;
  770. z-index: 4;
  771. .topic-top {
  772. width: 100%;
  773. height: 34px;
  774. background: rgba(78, 93, 255, 1);
  775. color: #fff;
  776. border-radius: 6px 6px 0px 0px;
  777. line-height: 34px;
  778. display: flex;
  779. flex-direction: row;
  780. justify-content: space-between;
  781. align-items: center;
  782. padding-left: 10px;
  783. padding-right: 10px;
  784. .topic-top-arrow {
  785. width: 13px;
  786. height: 12px;
  787. }
  788. }
  789. .topic-group {
  790. display: flex;
  791. flex-direction: column;
  792. margin-left: 24px;
  793. .el-checkbox {
  794. padding-top: 10px;
  795. padding-bottom: 10px;
  796. border-bottom: 1px solid #e2e4ee;
  797. display: flex;
  798. position: relative;
  799. white-space: pre-line;
  800. align-items: center;
  801. font-size: 14px;
  802. font-weight: 400;
  803. color: rgba(51, 51, 51, 1);
  804. line-height: 19px;
  805. }
  806. }
  807. }
  808. }
  809. </style>