index.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828
  1. <template>
  2. <div class="container">
  3. <div class="left-board">
  4. <div class="logo-wrapper">
  5. <div class="logo"><img :src="logo" alt="logo" /> Form Generator</div>
  6. </div>
  7. <el-scrollbar class="left-scrollbar">
  8. <div class="components-list">
  9. <div class="components-title">
  10. <svg-icon icon-class="component" />输入型组件
  11. </div>
  12. <draggable
  13. class="components-draggable"
  14. :list="inputComponents"
  15. :group="{ name: 'componentsGroup', pull: 'clone', put: false }"
  16. :clone="cloneComponent"
  17. draggable=".components-item"
  18. :sort="false"
  19. @end="onEnd"
  20. >
  21. <!--
  22. draggable=".components-item" 只有class 为".components-item"的元素才能拖动
  23. -->
  24. <div
  25. v-for="(element, index) in inputComponents"
  26. :key="index"
  27. class="components-item"
  28. @click="addComponent(element)"
  29. >
  30. <div class="components-body">
  31. <svg-icon :icon-class="element.tagIcon" />
  32. {{ element.label }}
  33. </div>
  34. </div>
  35. </draggable>
  36. <div class="components-title">
  37. <svg-icon icon-class="component" />选择型组件
  38. </div>
  39. <draggable
  40. class="components-draggable"
  41. :list="selectComponents"
  42. :group="{ name: 'componentsGroup', pull: 'clone', put: false }"
  43. :clone="cloneComponent"
  44. draggable=".components-item"
  45. :sort="false"
  46. @end="onEnd"
  47. >
  48. <div
  49. v-for="(element, index) in selectComponents"
  50. :key="index"
  51. class="components-item"
  52. @click="addComponent(element)"
  53. >
  54. <div class="components-body">
  55. <svg-icon :icon-class="element.tagIcon" />
  56. {{ element.label }}
  57. </div>
  58. </div>
  59. </draggable>
  60. <div class="components-title">
  61. <svg-icon icon-class="component" /> 布局型组件
  62. </div>
  63. <draggable
  64. class="components-draggable"
  65. :list="layoutComponents"
  66. :group="{ name: 'componentsGroup', pull: 'clone', put: false }"
  67. :clone="cloneComponent"
  68. draggable=".components-item"
  69. :sort="false"
  70. @end="onEnd"
  71. >
  72. <div
  73. v-for="(element, index) in layoutComponents"
  74. :key="index"
  75. class="components-item"
  76. @click="addComponent(element)"
  77. >
  78. <div class="components-body">
  79. <svg-icon :icon-class="element.tagIcon" />
  80. {{ element.label }}
  81. </div>
  82. </div>
  83. </draggable>
  84. </div>
  85. </el-scrollbar>
  86. </div>
  87. <div class="center-board">
  88. <div class="action-bar">
  89. <el-button icon="el-icon-download" type="text" @click="save">
  90. 保存vue文件到
  91. </el-button>
  92. <el-button icon="el-icon-download" type="text" @click="download">
  93. 导出vue文件
  94. </el-button>
  95. <el-button
  96. class="copy-btn-main"
  97. icon="el-icon-document-copy"
  98. type="text"
  99. @click="copy"
  100. >
  101. 复制代码
  102. </el-button>
  103. <el-button
  104. class="delete-btn"
  105. icon="el-icon-delete"
  106. type="text"
  107. @click="empty"
  108. >
  109. 清空
  110. </el-button>
  111. </div>
  112. <el-scrollbar class="center-scrollbar">
  113. <el-row class="center-board-row" :gutter="formConf.gutter">
  114. <el-form
  115. :size="formConf.size"
  116. :label-position="formConf.labelPosition"
  117. :disabled="formConf.disabled"
  118. :label-width="formConf.labelWidth + 'px'"
  119. >
  120. <draggable
  121. class="drawing-board"
  122. :list="drawingList"
  123. :animation="340"
  124. group="componentsGroup"
  125. >
  126. <draggable-item
  127. v-for="(element, index) in drawingList"
  128. :key="element.renderKey"
  129. :drawing-list="drawingList"
  130. :element="element"
  131. :index="index"
  132. :active-id="activeId"
  133. :form-conf="formConf"
  134. @activeItem="activeFormItem"
  135. @copyItem="drawingItemCopy"
  136. @deleteItem="drawingItemDelete"
  137. />
  138. </draggable>
  139. <div v-show="!drawingList.length" class="empty-info">
  140. 从左侧拖入或点选组件进行表单设计
  141. </div>
  142. </el-form>
  143. </el-row>
  144. </el-scrollbar>
  145. </div>
  146. <right-panel
  147. :active-data="activeData"
  148. :form-conf="formConf"
  149. :show-field="!!drawingList.length"
  150. @tag-change="tagChange"
  151. />
  152. <code-type-dialog
  153. :visible.sync="dialogVisible"
  154. title="选择生成类型"
  155. :show-file-name="showFileName"
  156. @confirm="generate"
  157. />
  158. <input id="copyNode" type="hidden" />
  159. </div>
  160. </template>
  161. <script>
  162. import draggable from "vuedraggable";
  163. import beautifier from "js-beautify";
  164. import ClipboardJS from "clipboard";
  165. // import render from '@/utils/generator/render'
  166. import RightPanel from "./RightPanel";
  167. import {
  168. inputComponents,
  169. selectComponents,
  170. layoutComponents,
  171. formConf,
  172. } from "@/utils/generator/config";
  173. import { beautifierConf, titleCase } from "@/utils/index";
  174. import {
  175. makeUpHtml,
  176. vueTemplate,
  177. vueScript,
  178. cssStyle,
  179. } from "@/utils/generator/html";
  180. import { makeUpJs } from "@/utils/generator/js";
  181. import { makeUpCss } from "@/utils/generator/css";
  182. import drawingDefault from "@/utils/generator/drawingDefault";
  183. import logo from "@/assets/logo/xigongda_log.png";
  184. import CodeTypeDialog from "./CodeTypeDialog";
  185. import DraggableItem from "./DraggableItem";
  186. let oldActiveId;
  187. let tempActiveData;
  188. export default {
  189. components: {
  190. draggable,
  191. // render,
  192. RightPanel,
  193. CodeTypeDialog,
  194. DraggableItem,
  195. },
  196. data() {
  197. return {
  198. logo,
  199. idGlobal: 100,
  200. formConf,
  201. inputComponents,
  202. selectComponents,
  203. layoutComponents,
  204. labelWidth: 100,
  205. drawingList: drawingDefault,
  206. drawingData: {},
  207. activeId: drawingDefault[0].formId,
  208. drawerVisible: false,
  209. formData: {},
  210. dialogVisible: false,
  211. generateConf: null,
  212. showFileName: false,
  213. activeData: drawingDefault[0],
  214. };
  215. },
  216. created() {
  217. // 防止 firefox 下 拖拽 会新打卡一个选项卡
  218. document.body.ondrop = (event) => {
  219. event.preventDefault();
  220. event.stopPropagation();
  221. };
  222. },
  223. watch: {
  224. // eslint-disable-next-line func-names
  225. "activeData.label": function (val, oldVal) {
  226. if (
  227. this.activeData.placeholder === undefined ||
  228. !this.activeData.tag ||
  229. oldActiveId !== this.activeId
  230. ) {
  231. return;
  232. }
  233. this.activeData.placeholder =
  234. this.activeData.placeholder.replace(oldVal, "") + val;
  235. },
  236. activeId: {
  237. handler(val) {
  238. oldActiveId = val;
  239. },
  240. immediate: true,
  241. },
  242. },
  243. mounted() {
  244. const clipboard = new ClipboardJS("#copyNode", {
  245. text: (trigger) => {
  246. const codeStr = this.generateCode();
  247. this.$notify({
  248. title: "成功",
  249. message: "代码已复制到剪切板,可粘贴。",
  250. type: "success",
  251. });
  252. return codeStr;
  253. },
  254. });
  255. clipboard.on("error", (e) => {
  256. this.$message.error("代码复制失败");
  257. });
  258. },
  259. methods: {
  260. activeFormItem(element) {
  261. console.log("activeFormItem", element);
  262. this.activeData = element;
  263. this.activeId = element.formId;
  264. },
  265. onEnd(obj, a) {
  266. console.log("onEnd:", this.drawingList);
  267. if (obj.from !== obj.to) {
  268. this.activeData = tempActiveData;
  269. this.activeId = this.idGlobal;
  270. }
  271. },
  272. addComponent(item) {
  273. console.log(item);
  274. const clone = this.cloneComponent(item);
  275. this.drawingList.push(clone);
  276. this.activeFormItem(clone);
  277. },
  278. cloneComponent(origin) {
  279. const clone = JSON.parse(JSON.stringify(origin));
  280. clone.formId = ++this.idGlobal;
  281. clone.span = formConf.span;
  282. clone.renderKey = +new Date(); // 改变renderKey后可以实现强制更新组件
  283. if (!clone.layout) clone.layout = "colFormItem";
  284. if (clone.layout === "colFormItem") {
  285. clone.vModel = `field${this.idGlobal}`;
  286. clone.placeholder !== undefined && (clone.placeholder += clone.label);
  287. tempActiveData = clone;
  288. } else if (clone.layout === "rowFormItem") {
  289. delete clone.label;
  290. clone.componentName = `row${this.idGlobal}`;
  291. clone.gutter = this.formConf.gutter;
  292. tempActiveData = clone;
  293. }
  294. return tempActiveData; //这里返回的是vue对象,拖动后在vuedraggable-item里面进行渲染。
  295. },
  296. AssembleFormData() {
  297. this.formData = {
  298. fields: JSON.parse(JSON.stringify(this.drawingList)),
  299. ...this.formConf,
  300. };
  301. },
  302. generate(data) {
  303. const func = this[`exec${titleCase(this.operationType)}`];
  304. this.generateConf = data;
  305. func && func(data);
  306. },
  307. execSave(data) {
  308. this.AssembleFormData();
  309. this.drawerVisible = true;
  310. },
  311. execRun(data) {
  312. this.AssembleFormData();
  313. this.drawerVisible = true;
  314. },
  315. execDownload(data) {
  316. const codeStr = this.generateCode();
  317. const blob = new Blob([codeStr], { type: "text/plain;charset=utf-8" });
  318. this.$download.saveAs(blob, data.fileName);
  319. },
  320. execCopy(data) {
  321. document.getElementById("copyNode").click();
  322. },
  323. empty() {
  324. this.$confirm("确定要清空所有组件吗?", "提示", { type: "warning" }).then(
  325. () => {
  326. this.drawingList = [];
  327. }
  328. );
  329. },
  330. drawingItemCopy(item, parent) {
  331. let clone = JSON.parse(JSON.stringify(item));
  332. clone = this.createIdAndKey(clone);
  333. parent.push(clone);
  334. this.activeFormItem(clone);
  335. },
  336. createIdAndKey(item) {
  337. item.formId = ++this.idGlobal;
  338. item.renderKey = +new Date();
  339. if (item.layout === "colFormItem") {
  340. item.vModel = `field${this.idGlobal}`;
  341. } else if (item.layout === "rowFormItem") {
  342. item.componentName = `row${this.idGlobal}`;
  343. }
  344. if (Array.isArray(item.children)) {
  345. item.children = item.children.map((childItem) =>
  346. this.createIdAndKey(childItem)
  347. );
  348. }
  349. return item;
  350. },
  351. drawingItemDelete(index, parent) {
  352. parent.splice(index, 1);
  353. this.$nextTick(() => {
  354. const len = this.drawingList.length;
  355. if (len) {
  356. this.activeFormItem(this.drawingList[len - 1]);
  357. }
  358. });
  359. },
  360. generateCode() {
  361. const { type } = this.generateConf;
  362. this.AssembleFormData();
  363. console.log(this.formData);
  364. const script = vueScript(makeUpJs(this.formData, type));
  365. const html = vueTemplate(makeUpHtml(this.formData, type));
  366. const css = cssStyle(makeUpCss(this.formData));
  367. return beautifier.html(html + script + css, beautifierConf.html);
  368. },
  369. download() {
  370. this.dialogVisible = true;
  371. this.showFileName = true;
  372. this.operationType = "download";
  373. },
  374. save() {
  375. this.dialogVisible = true;
  376. this.showFileName = false;
  377. this.operationType = "save";
  378. },
  379. run() {
  380. this.dialogVisible = true;
  381. this.showFileName = false;
  382. this.operationType = "run";
  383. },
  384. copy() {
  385. this.dialogVisible = true;
  386. this.showFileName = false;
  387. this.operationType = "copy";
  388. },
  389. tagChange(newTag) {
  390. newTag = this.cloneComponent(newTag);
  391. newTag.vModel = this.activeData.vModel;
  392. newTag.formId = this.activeId;
  393. newTag.span = this.activeData.span;
  394. delete this.activeData.tag;
  395. delete this.activeData.tagIcon;
  396. delete this.activeData.document;
  397. Object.keys(newTag).forEach((key) => {
  398. if (
  399. this.activeData[key] !== undefined &&
  400. typeof this.activeData[key] === typeof newTag[key]
  401. ) {
  402. newTag[key] = this.activeData[key];
  403. }
  404. });
  405. this.activeData = newTag;
  406. this.updateDrawingList(newTag, this.drawingList);
  407. },
  408. updateDrawingList(newTag, list) {
  409. const index = list.findIndex((item) => item.formId === this.activeId);
  410. if (index > -1) {
  411. list.splice(index, 1, newTag);
  412. } else {
  413. list.forEach((item) => {
  414. if (Array.isArray(item.children))
  415. this.updateDrawingList(newTag, item.children);
  416. });
  417. }
  418. },
  419. },
  420. };
  421. </script>
  422. <style lang="scss">
  423. .editor-tabs {
  424. background: #121315;
  425. .el-tabs__header {
  426. margin: 0;
  427. border-bottom-color: #121315;
  428. .el-tabs__nav {
  429. border-color: #121315;
  430. }
  431. }
  432. .el-tabs__item {
  433. height: 32px;
  434. line-height: 32px;
  435. color: #888a8e;
  436. border-left: 1px solid #121315 !important;
  437. background: #363636;
  438. margin-right: 5px;
  439. user-select: none;
  440. }
  441. .el-tabs__item.is-active {
  442. background: #1e1e1e;
  443. border-bottom-color: #1e1e1e !important;
  444. color: #fff;
  445. }
  446. .el-icon-edit {
  447. color: #f1fa8c;
  448. }
  449. .el-icon-document {
  450. color: #a95812;
  451. }
  452. }
  453. // home
  454. .right-scrollbar {
  455. .el-scrollbar__view {
  456. padding: 12px 18px 15px 15px;
  457. }
  458. }
  459. .left-scrollbar .el-scrollbar__wrap {
  460. box-sizing: border-box;
  461. overflow-x: hidden !important;
  462. margin-bottom: 0 !important;
  463. }
  464. .center-tabs {
  465. .el-tabs__header {
  466. margin-bottom: 0 !important;
  467. }
  468. .el-tabs__item {
  469. width: 50%;
  470. text-align: center;
  471. }
  472. .el-tabs__nav {
  473. width: 100%;
  474. }
  475. }
  476. .reg-item {
  477. padding: 12px 6px;
  478. background: #f8f8f8;
  479. position: relative;
  480. border-radius: 4px;
  481. .close-btn {
  482. position: absolute;
  483. right: -6px;
  484. top: -6px;
  485. display: block;
  486. width: 16px;
  487. height: 16px;
  488. line-height: 16px;
  489. background: rgba(0, 0, 0, 0.2);
  490. border-radius: 50%;
  491. color: #fff;
  492. text-align: center;
  493. z-index: 1;
  494. cursor: pointer;
  495. font-size: 12px;
  496. &:hover {
  497. background: rgba(210, 23, 23, 0.5);
  498. }
  499. }
  500. & + .reg-item {
  501. margin-top: 18px;
  502. }
  503. }
  504. .action-bar {
  505. & .el-button + .el-button {
  506. margin-left: 15px;
  507. }
  508. & i {
  509. font-size: 20px;
  510. vertical-align: middle;
  511. position: relative;
  512. top: -1px;
  513. }
  514. }
  515. .custom-tree-node {
  516. width: 100%;
  517. font-size: 14px;
  518. .node-operation {
  519. float: right;
  520. }
  521. i[class*="el-icon"] + i[class*="el-icon"] {
  522. margin-left: 6px;
  523. }
  524. .el-icon-plus {
  525. color: #409eff;
  526. }
  527. .el-icon-delete {
  528. color: #157a0c;
  529. }
  530. }
  531. .left-scrollbar .el-scrollbar__view {
  532. overflow-x: hidden;
  533. }
  534. .el-rate {
  535. display: inline-block;
  536. vertical-align: text-top;
  537. }
  538. .el-upload__tip {
  539. line-height: 1.2;
  540. }
  541. $selectedColor: #f6f7ff;
  542. $lighterBlue: #409eff;
  543. .container {
  544. position: relative;
  545. width: 100%;
  546. height: 100%;
  547. }
  548. .components-list {
  549. padding: 8px;
  550. box-sizing: border-box;
  551. height: 100%;
  552. .components-item {
  553. display: inline-block;
  554. width: 48%;
  555. margin: 1%;
  556. transition: transform 0ms !important;
  557. }
  558. }
  559. .components-draggable {
  560. padding-bottom: 20px;
  561. }
  562. .components-title {
  563. font-size: 14px;
  564. color: #222;
  565. margin: 6px 2px;
  566. .svg-icon {
  567. color: #666;
  568. font-size: 18px;
  569. }
  570. }
  571. .components-body {
  572. padding: 8px 10px;
  573. background: $selectedColor;
  574. font-size: 12px;
  575. cursor: move;
  576. border: 1px dashed $selectedColor;
  577. border-radius: 3px;
  578. .svg-icon {
  579. color: #777;
  580. font-size: 15px;
  581. }
  582. &:hover {
  583. border: 1px dashed #787be8;
  584. color: #787be8;
  585. .svg-icon {
  586. color: #787be8;
  587. }
  588. }
  589. }
  590. .left-board {
  591. width: 260px;
  592. position: absolute;
  593. left: 0;
  594. top: 0;
  595. height: 100vh;
  596. }
  597. .left-scrollbar {
  598. height: calc(100vh - 42px);
  599. overflow: hidden;
  600. }
  601. .center-scrollbar {
  602. height: calc(100vh - 42px);
  603. overflow: hidden;
  604. border-left: 1px solid #f1e8e8;
  605. border-right: 1px solid #f1e8e8;
  606. box-sizing: border-box;
  607. }
  608. .center-board {
  609. height: 100vh;
  610. width: auto;
  611. margin: 0 350px 0 260px;
  612. box-sizing: border-box;
  613. }
  614. .empty-info {
  615. position: absolute;
  616. top: 46%;
  617. left: 0;
  618. right: 0;
  619. text-align: center;
  620. font-size: 18px;
  621. color: #ccb1ea;
  622. letter-spacing: 4px;
  623. }
  624. .action-bar {
  625. position: relative;
  626. height: 42px;
  627. text-align: right;
  628. padding: 0 15px;
  629. box-sizing: border-box;
  630. border: 1px solid #f1e8e8;
  631. border-top: none;
  632. border-left: none;
  633. .delete-btn {
  634. color: #f56c6c;
  635. }
  636. }
  637. .logo-wrapper {
  638. position: relative;
  639. height: 42px;
  640. background: #fff;
  641. border-bottom: 1px solid #f1e8e8;
  642. box-sizing: border-box;
  643. }
  644. .logo {
  645. position: absolute;
  646. left: 12px;
  647. top: 6px;
  648. line-height: 30px;
  649. color: #00afff;
  650. font-weight: 600;
  651. font-size: 17px;
  652. white-space: nowrap;
  653. > img {
  654. width: 30px;
  655. height: 30px;
  656. vertical-align: top;
  657. }
  658. .github {
  659. display: inline-block;
  660. vertical-align: sub;
  661. margin-left: 15px;
  662. > img {
  663. height: 22px;
  664. }
  665. }
  666. }
  667. .center-board-row {
  668. padding: 12px 12px 15px 12px;
  669. box-sizing: border-box;
  670. & > .el-form {
  671. // 69 = 12+15+42
  672. height: calc(100vh - 69px);
  673. }
  674. }
  675. .drawing-board {
  676. height: 100%;
  677. position: relative;
  678. .components-body {
  679. padding: 0;
  680. margin: 0;
  681. font-size: 0;
  682. }
  683. .sortable-ghost {
  684. position: relative;
  685. display: block;
  686. overflow: hidden;
  687. &::before {
  688. content: " ";
  689. position: absolute;
  690. left: 0;
  691. right: 0;
  692. top: 0;
  693. height: 3px;
  694. background: rgb(89, 89, 223);
  695. z-index: 2;
  696. }
  697. }
  698. .components-item.sortable-ghost {
  699. width: 100%;
  700. height: 60px;
  701. background-color: $selectedColor;
  702. }
  703. .active-from-item {
  704. & > .el-form-item {
  705. background: $selectedColor;
  706. border-radius: 6px;
  707. }
  708. & > .drawing-item-copy,
  709. & > .drawing-item-delete {
  710. display: initial;
  711. }
  712. & > .component-name {
  713. color: $lighterBlue;
  714. }
  715. }
  716. .el-form-item {
  717. margin-bottom: 15px;
  718. }
  719. }
  720. .drawing-item {
  721. position: relative;
  722. cursor: move;
  723. &.unfocus-bordered:not(.activeFromItem) > div:first-child {
  724. border: 1px dashed #ccc;
  725. }
  726. .el-form-item {
  727. padding: 12px 10px;
  728. }
  729. }
  730. .drawing-row-item {
  731. position: relative;
  732. cursor: move;
  733. box-sizing: border-box;
  734. border: 1px dashed #ccc;
  735. border-radius: 3px;
  736. padding: 0 2px;
  737. margin-bottom: 15px;
  738. .drawing-row-item {
  739. margin-bottom: 2px;
  740. }
  741. .el-col {
  742. margin-top: 22px;
  743. }
  744. .el-form-item {
  745. margin-bottom: 0;
  746. }
  747. .drag-wrapper {
  748. min-height: 80px;
  749. }
  750. &.active-from-item {
  751. border: 1px dashed $lighterBlue;
  752. }
  753. .component-name {
  754. position: absolute;
  755. top: 0;
  756. left: 0;
  757. font-size: 12px;
  758. color: #bbb;
  759. display: inline-block;
  760. padding: 0 6px;
  761. }
  762. }
  763. .drawing-item,
  764. .drawing-row-item {
  765. &:hover {
  766. & > .el-form-item {
  767. background: $selectedColor;
  768. border-radius: 6px;
  769. }
  770. & > .drawing-item-copy,
  771. & > .drawing-item-delete {
  772. display: initial;
  773. }
  774. }
  775. & > .drawing-item-copy,
  776. & > .drawing-item-delete {
  777. display: none;
  778. position: absolute;
  779. top: -10px;
  780. width: 22px;
  781. height: 22px;
  782. line-height: 22px;
  783. text-align: center;
  784. border-radius: 50%;
  785. font-size: 12px;
  786. border: 1px solid;
  787. cursor: pointer;
  788. z-index: 1;
  789. }
  790. & > .drawing-item-copy {
  791. right: 56px;
  792. border-color: $lighterBlue;
  793. color: $lighterBlue;
  794. background: #fff;
  795. &:hover {
  796. background: $lighterBlue;
  797. color: #fff;
  798. }
  799. }
  800. & > .drawing-item-delete {
  801. right: 24px;
  802. border-color: #f56c6c;
  803. color: #f56c6c;
  804. background: #fff;
  805. &:hover {
  806. background: #f56c6c;
  807. color: #fff;
  808. }
  809. }
  810. }
  811. </style>