vueFlow.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887
  1. <template lang="">
  2. <div class="vueFlow">
  3. <div id="container"></div>
  4. <div id="stencil"></div>
  5. <div id="graph-container"></div>
  6. </div>
  7. <el-button @click="submitAll" type="primary">保存</el-button>
  8. <el-dialog
  9. :title="modalType == 'add' ? '新增' : '编辑'"
  10. v-model="dialogVisible"
  11. width="500"
  12. v-loading="loading"
  13. >
  14. <byForm
  15. :formConfig="formConfig"
  16. :formOption="formOption"
  17. v-model="formData.data"
  18. :rules="rules"
  19. ref="byform"
  20. >
  21. </byForm>
  22. <template #footer>
  23. <el-button @click="dialogVisible = false" size="large"
  24. >取 消</el-button
  25. >
  26. <el-button
  27. type="danger"
  28. @click="deleteFlowDefinitionNodeObj()"
  29. size="large"
  30. :loading="submitLoading"
  31. >
  32. 删 除
  33. </el-button>
  34. <el-button
  35. type="primary"
  36. @click="submitForm('byform')"
  37. size="large"
  38. :loading="submitLoading"
  39. >
  40. 确 定
  41. </el-button>
  42. </template>
  43. </el-dialog>
  44. </template>
  45. <script lang="ts" setup>
  46. import {
  47. defineComponent,
  48. ref,
  49. onMounted,
  50. onUnmounted,
  51. watch,
  52. reactive,
  53. toRefs,
  54. computed,
  55. nextTick,
  56. getCurrentInstance,
  57. } from 'vue'
  58. import byForm from '@/components/byForm/index'
  59. import { Graph, Shape } from '@antv/x6'
  60. import { Stencil } from '@antv/x6-plugin-stencil'
  61. import { Transform } from '@antv/x6-plugin-transform'
  62. import { Selection } from '@antv/x6-plugin-selection'
  63. import { Snapline } from '@antv/x6-plugin-snapline'
  64. import { Keyboard } from '@antv/x6-plugin-keyboard'
  65. import { Clipboard } from '@antv/x6-plugin-clipboard'
  66. import { History } from '@antv/x6-plugin-history'
  67. import Cookies from 'js-cookie'
  68. import { ElMessage, ElMessageBox } from "element-plus";
  69. defineProps({
  70. title: {
  71. type: Object,
  72. default: '',
  73. },
  74. });
  75. const { proxy } = getCurrentInstance()
  76. const internalInstance = getCurrentInstance()
  77. const dialogVisible = ref(false)
  78. const modalType = ref('add')
  79. const loading = ref(false)
  80. const submitLoading = ref(false)
  81. const formData = reactive({
  82. data: {
  83. userName: '',
  84. password: '',
  85. },
  86. })
  87. const byform = ref(null)
  88. const flowDefinitionNodeObj = ref({})
  89. const rules = reactive({
  90. nodeName: [
  91. {
  92. required: true,
  93. message: '请输入节点名称',
  94. trigger: 'blur',
  95. },
  96. ],
  97. handleObjectType: [
  98. {
  99. required: true,
  100. message: '办理人类型不能为空',
  101. trigger: 'blur',
  102. },
  103. ],
  104. handleObjectId: [
  105. {
  106. required: true,
  107. message: '办理人不能为空',
  108. trigger: 'blur',
  109. },
  110. ],
  111. })
  112. const formConfig = computed(() => {
  113. return [
  114. {
  115. type: 'input',
  116. prop: 'nodeName',
  117. label: '节点名称',
  118. required: true,
  119. itemType: 'text',
  120. },
  121. {
  122. type: 'select',
  123. prop: 'handleObjectType',
  124. label: '办理人',
  125. placeholder: '请选择办理人类型',
  126. required: true,
  127. itemWidth: 30,
  128. fn: (e) => {
  129. console.log(e)
  130. gethandleObjectList(e)
  131. },
  132. //1用户 2部门负责人 3部门总监 4岗位 5角色
  133. data: [
  134. {
  135. label: '用户',
  136. value: 1,
  137. },
  138. {
  139. label: '部门负责人',
  140. value: 2,
  141. },
  142. {
  143. label: '部门总监',
  144. value: 3,
  145. },
  146. {
  147. label: '岗位',
  148. value: 4,
  149. },
  150. {
  151. label: '角色',
  152. value: 5,
  153. },
  154. ],
  155. },
  156. // {
  157. // type: "treeSelect",
  158. // prop: "handleObjectId",
  159. // label: "请选择办理人",
  160. // itemWidth: 30,
  161. // data: [],
  162. // },
  163. {
  164. type: 'select',
  165. label: ' ',
  166. itemWidth: 30,
  167. prop: 'handleObjectId',
  168. placeholder: '请选择办理人',
  169. data: [],
  170. },
  171. {
  172. type: 'input',
  173. prop: 'handlingMethod',
  174. label: '节点后置执行方法',
  175. required: true,
  176. itemType: 'text',
  177. },
  178. {
  179. type: 'input',
  180. prop: 'jumpCondition',
  181. label: '条件表达式',
  182. required: true,
  183. itemType: 'text',
  184. },
  185. {
  186. type: 'checkbox',
  187. prop: 'nodeButtonSet',
  188. label: '节点按钮',
  189. //1通过 2驳回 3返回上一步 4退回到发起人
  190. data: [
  191. {
  192. label: '通过',
  193. value: 1,
  194. },
  195. {
  196. label: '驳回',
  197. value: 2,
  198. },
  199. {
  200. label: '返回上一步',
  201. value: 3,
  202. },
  203. {
  204. label: '退回到发起人',
  205. value: 4,
  206. },
  207. ],
  208. },
  209. {
  210. type: 'radio',
  211. prop: 'jobNumber11',
  212. label: '审批意见必填',
  213. data: [
  214. {
  215. label: '是',
  216. value: 1,
  217. },
  218. {
  219. label: '否',
  220. value: 0,
  221. },
  222. ],
  223. },
  224. ]
  225. })
  226. const formOption = reactive({
  227. inline: true,
  228. labelWidth: 100,
  229. itemWidth: 100,
  230. })
  231. let graph
  232. const submitForm = () => {
  233. byform.value.handleSubmit((valid) => {
  234. flowDefinitionNodeObj.value[formData.data.id] = formData.data
  235. console.log(flowDefinitionNodeObj.value)
  236. })
  237. }
  238. const submitFormData = {
  239. flowInfoId:null,
  240. titleTemplate:null,
  241. tenantId:Cookies.get('tenantId'),
  242. nodeObject:'',
  243. lineObject:'',
  244. flowDefinitionNodeList:[],
  245. }
  246. const submitAll = () => {
  247. if(proxy.title == '') {
  248. ElMessage({
  249. message: '请输入流程标题',
  250. type: 'warning',
  251. })
  252. return
  253. }
  254. submitFormData.titleTemplate = proxy.title
  255. const nodeList = graph.toJSON().cells
  256. console.log(nodeList)
  257. const isStart = false
  258. for (let i = 0; i < nodeList.length; i++) {
  259. const element = nodeList[i];
  260. //是办理节点
  261. if(element.id != 1 && element.shape != "edge") {
  262. console.log(element)
  263. if(!flowDefinitionNodeObj.value[element.id]) {
  264. ElMessage({
  265. message: '有节点未配置,请检查节点123123123',
  266. type: 'warning',
  267. })
  268. return
  269. }
  270. submitFormData.flowDefinitionNodeList.push({...flowDefinitionNodeObj.value[element.id],nodeType:2})
  271. }
  272. if(element.id == "1") {
  273. submitFormData.flowDefinitionNodeList.push({
  274. nodeName:'开始',
  275. nodeType:1,
  276. id:1,
  277. nodeButtonSet:'',
  278. parentId:0,
  279. })
  280. }
  281. //说明是线
  282. if(element.shape == "edge") {
  283. console.log(flowDefinitionNodeObj)
  284. if(!flowDefinitionNodeObj.value[element.target.cell]) {
  285. ElMessage({
  286. message: '有节点未配置,请检查节点',
  287. type: 'warning',
  288. })
  289. return
  290. }
  291. flowDefinitionNodeObj.value[element.target.cell].id = element.target.cell
  292. flowDefinitionNodeObj.value[element.target.cell].parentId = element.source.cell
  293. submitFormData.flowDefinitionNodeList = []
  294. }
  295. }
  296. addVersion()
  297. console.log(flowDefinitionNodeObj.value)
  298. }
  299. //选取一个随机不重复的正整数id
  300. const randomId = () => {
  301. const id = Math.floor(Math.random() * 100000000000000000)
  302. if(flowDefinitionNodeObj.value[id]) {
  303. randomId()
  304. } else {
  305. return id
  306. }
  307. }
  308. const addVersion = () => {
  309. const idObg = {}
  310. for (let i = 0; i < submitFormData.flowDefinitionNodeList.length; i++) {
  311. const element = submitFormData.flowDefinitionNodeList[i];
  312. if(isNaN(element.id)) {
  313. if(idObg[element.id]) {
  314. element.id = idObg[element.id]
  315. } else {
  316. const id = randomId()
  317. idObg[element.id] = id
  318. element.id = id
  319. }
  320. }
  321. if(isNaN(element.parentId) && element.nodeName != '开始') {
  322. if(idObg[element.parentId]) {
  323. element.parentId = idObg[element.parentId]
  324. } else {
  325. const id = randomId()
  326. idObg[element.parentId] = id
  327. element.parentId = id
  328. }
  329. }
  330. //nodeButtonSet转成字符串类型,用逗号隔开
  331. if(element.nodeButtonSet) {
  332. element.nodeButtonSet = element.nodeButtonSet.join(',')
  333. }
  334. }
  335. console.log(submitFormData)
  336. proxy.post('/flowDefinition/addVersion',submitFormData)
  337. .then((res) => {
  338. console.log(res)
  339. ElMessage({
  340. message: '保存成功',
  341. type: 'success',
  342. })
  343. })
  344. }
  345. //将组数里的id和parentId转换成整正整数类型
  346. const changeId = (arr) => {
  347. for (let i = 0; i < arr.length; i++) {
  348. const element = arr[i];
  349. element.id = parseInt(element.id)
  350. element.parentId = parseInt(element.parentId)
  351. }
  352. }
  353. const deleteFlowDefinitionNodeObj = (id) => {
  354. graph.removeNode(formData.data.id)
  355. delete flowDefinitionNodeObj.value[id]
  356. dialogVisible.value = false
  357. }
  358. const gethandleObjectList = (e) => {
  359. formData.data.handleObjectId = ''
  360. if(e === 1) {
  361. proxy.get('/tenantUser/list?pageNum=1&pageSize=1000&tenantId=' + Cookies.get('tenantId'),{})
  362. .then((res) => {
  363. formConfig.value[2].data = res.rows.map((item) => {
  364. return {
  365. label: item.nickName,
  366. value: item.userId,
  367. }
  368. })
  369. })
  370. }
  371. if(e === 3 || e === 2) {
  372. proxy.get('/tenantDept/list?pageNum=1&pageSize=1000&tenantId=' + Cookies.get('tenantId'),{})
  373. .then((res) => {
  374. formConfig.value[2].data =res.data.map(item=> {
  375. return {
  376. label: item.deptName,
  377. value: item.deptId,
  378. }
  379. })
  380. })
  381. }
  382. if(e === 4) {
  383. }
  384. if(e === 5) {
  385. proxy.get('/tenantRole/list?pageNum=1&pageSize=1000&tenantId=' + Cookies.get('tenantId'),{})
  386. .then((res) => {
  387. formConfig.value[2].data = res.rows.map((item) => {
  388. return {
  389. label: item.roleName,
  390. value: item.roleId,
  391. }
  392. })
  393. })
  394. }
  395. }
  396. const getTenantDept = () => {
  397. }
  398. getTenantDept()
  399. const recursive = (data) => {
  400. data.map((item) => {
  401. item.label = item.deptName;
  402. item.id = item.deptId;
  403. if (item.children) {
  404. recursive(item.children);
  405. } else {
  406. item.children = [];
  407. }
  408. });
  409. };
  410. const pushRoom = (port: any) => {
  411. console.log(port)
  412. if(port.node.label == '结束') {
  413. flowDefinitionNodeObj.value[port.node.id] = {
  414. nodeName:'结束',
  415. nodeType:99,
  416. id:port.id,
  417. nodeButtonSet:'',
  418. }
  419. }
  420. console.log(flowDefinitionNodeObj.value)
  421. }
  422. //用于存储流程定义节点数据
  423. const antvInit = () => {
  424. graph = new Graph({
  425. height: 600,
  426. container: document.getElementById('graph-container')!,
  427. grid: true,
  428. onPortRendered: pushRoom,
  429. mousewheel: {
  430. enabled: true,
  431. zoomAtMousePosition: true,
  432. modifiers: 'ctrl',
  433. minScale: 0.5,
  434. maxScale: 3,
  435. },
  436. connecting: {
  437. router: 'manhattan',
  438. connector: {
  439. name: 'rounded',
  440. args: {
  441. radius: 8,
  442. },
  443. },
  444. anchor: 'center',
  445. connectionPoint: 'anchor',
  446. allowBlank: false,
  447. snap: {
  448. radius: 20,
  449. },
  450. createEdge() {
  451. return new Shape.Edge({
  452. attrs: {
  453. line: {
  454. stroke: '#A2B1C3',
  455. strokeWidth: 2,
  456. targetMarker: {
  457. name: 'block',
  458. width: 12,
  459. height: 8,
  460. },
  461. },
  462. },
  463. zIndex: 0,
  464. })
  465. },
  466. validateConnection({ targetMagnet }) {
  467. return !!targetMagnet
  468. },
  469. },
  470. highlighting: {
  471. magnetAdsorbed: {
  472. name: 'stroke',
  473. args: {
  474. attrs: {
  475. fill: '#5F95FF',
  476. stroke: '#5F95FF',
  477. },
  478. },
  479. },
  480. },
  481. })
  482. const stencil = new Stencil({
  483. title: '流程图',
  484. target: graph,
  485. stencilGraphWidth: 200,
  486. stencilGraphHeight: 180,
  487. collapsable: true,
  488. groups: [
  489. {
  490. title: '基础流程图',
  491. name: 'group1',
  492. },
  493. ],
  494. layoutOptions: {
  495. columns: 2,
  496. columnWidth: 80,
  497. rowHeight: 55,
  498. },
  499. })
  500. document.getElementById('stencil')!.appendChild(stencil.container)
  501. // #region 使用插件
  502. graph
  503. .use(
  504. new Transform({
  505. resizing: true,
  506. rotating: true,
  507. })
  508. )
  509. .use(
  510. new Selection({
  511. enabled: true,
  512. rubberband: true,
  513. showNodeSelectionBox: true,
  514. })
  515. )
  516. .use(
  517. new Snapline({
  518. enabled: true,
  519. })
  520. )
  521. .use(
  522. new Keyboard({
  523. enabled: true,
  524. })
  525. )
  526. .use(
  527. new Clipboard({
  528. enabled: true,
  529. })
  530. )
  531. .use(
  532. new History({
  533. enabled: true,
  534. })
  535. )
  536. // 控制连接桩显示/隐藏
  537. const showPorts = (ports: NodeListOf<SVGElement>, show: boolean) => {
  538. for (let i = 0, len = ports.length; i < len; i += 1) {
  539. ports[i].style.visibility = show ? 'visible' : 'hidden'
  540. }
  541. }
  542. graph.on('node:mouseenter', () => {
  543. const container = document.getElementById('graph-container')!
  544. const ports = container.querySelectorAll(
  545. '.x6-port-body'
  546. ) as NodeListOf<SVGElement>
  547. showPorts(ports, true)
  548. })
  549. graph.on('node:mouseleave', () => {
  550. const container = document.getElementById('graph-container')!
  551. const ports = container.querySelectorAll(
  552. '.x6-port-body'
  553. ) as NodeListOf<SVGElement>
  554. showPorts(ports, false)
  555. })
  556. // #endregion
  557. graph.on('cell:click', ({ e, x, y, cell, view }) => {
  558. console.log(cell)
  559. if (cell.label === '开始' || cell.label === '结束' || cell.shape === 'edge') {
  560. return
  561. }
  562. if (flowDefinitionNodeObj.value[cell.id]) {
  563. formData.data = flowDefinitionNodeObj.value[cell.id]
  564. } else {
  565. formData.data = {
  566. id: cell.id,
  567. cell: cell,
  568. }
  569. }
  570. dialogVisible.value = true
  571. })
  572. // #region 初始化图形
  573. const ports = {
  574. groups: {
  575. top: {
  576. position: 'top',
  577. attrs: {
  578. circle: {
  579. r: 4,
  580. magnet: true,
  581. stroke: '#5F95FF',
  582. strokeWidth: 1,
  583. fill: '#fff',
  584. style: {
  585. visibility: 'hidden',
  586. },
  587. },
  588. },
  589. },
  590. right: {
  591. position: 'right',
  592. attrs: {
  593. circle: {
  594. r: 4,
  595. magnet: true,
  596. stroke: '#5F95FF',
  597. strokeWidth: 1,
  598. fill: '#fff',
  599. style: {
  600. visibility: 'hidden',
  601. },
  602. },
  603. },
  604. },
  605. bottom: {
  606. position: 'bottom',
  607. attrs: {
  608. circle: {
  609. r: 4,
  610. magnet: true,
  611. stroke: '#5F95FF',
  612. strokeWidth: 1,
  613. fill: '#fff',
  614. style: {
  615. visibility: 'hidden',
  616. },
  617. },
  618. },
  619. },
  620. left: {
  621. position: 'left',
  622. attrs: {
  623. circle: {
  624. r: 4,
  625. magnet: true,
  626. stroke: '#5F95FF',
  627. strokeWidth: 1,
  628. fill: '#fff',
  629. style: {
  630. visibility: 'hidden',
  631. },
  632. },
  633. },
  634. },
  635. },
  636. items: [
  637. {
  638. group: 'top',
  639. },
  640. {
  641. group: 'right',
  642. },
  643. {
  644. group: 'bottom',
  645. },
  646. {
  647. group: 'left',
  648. },
  649. ],
  650. }
  651. Graph.registerNode(
  652. 'custom-rect',
  653. {
  654. inherit: 'rect',
  655. width: 66,
  656. height: 36,
  657. attrs: {
  658. body: {
  659. strokeWidth: 1,
  660. stroke: '#5F95FF',
  661. fill: '#EFF4FF',
  662. },
  663. text: {
  664. fontSize: 12,
  665. fill: '#262626',
  666. },
  667. },
  668. ports: { ...ports },
  669. },
  670. true
  671. )
  672. Graph.registerNode(
  673. 'custom-polygon',
  674. {
  675. inherit: 'polygon',
  676. width: 66,
  677. height: 36,
  678. attrs: {
  679. body: {
  680. strokeWidth: 1,
  681. stroke: '#5F95FF',
  682. fill: '#EFF4FF',
  683. },
  684. text: {
  685. fontSize: 12,
  686. fill: '#262626',
  687. },
  688. },
  689. ports: {
  690. ...ports,
  691. items: [
  692. {
  693. group: 'top',
  694. },
  695. {
  696. group: 'bottom',
  697. },
  698. ],
  699. },
  700. },
  701. true
  702. )
  703. Graph.registerNode(
  704. 'custom-circle',
  705. {
  706. inherit: 'circle',
  707. width: 45,
  708. height: 45,
  709. attrs: {
  710. body: {
  711. strokeWidth: 1,
  712. stroke: '#5F95FF',
  713. fill: '#EFF4FF',
  714. },
  715. text: {
  716. fontSize: 12,
  717. fill: '#262626',
  718. },
  719. },
  720. ports: { ...ports },
  721. },
  722. true
  723. )
  724. Graph.registerNode(
  725. 'custom-image',
  726. {
  727. inherit: 'rect',
  728. width: 52,
  729. height: 52,
  730. markup: [
  731. {
  732. tagName: 'rect',
  733. selector: 'body',
  734. },
  735. {
  736. tagName: 'image',
  737. },
  738. {
  739. tagName: 'text',
  740. selector: 'label',
  741. },
  742. ],
  743. attrs: {
  744. body: {
  745. stroke: '#5F95FF',
  746. fill: '#5F95FF',
  747. },
  748. image: {
  749. width: 26,
  750. height: 26,
  751. refX: 13,
  752. refY: 16,
  753. },
  754. label: {
  755. refX: 3,
  756. refY: 2,
  757. textAnchor: 'left',
  758. textVerticalAnchor: 'top',
  759. fontSize: 12,
  760. fill: '#fff',
  761. },
  762. },
  763. ports: { ...ports },
  764. },
  765. true
  766. )
  767. let firstLi = document.createElement('li')
  768. firstLi.innerText = '指标详情'
  769. console.log(firstLi)
  770. const r1 = graph.createNode({
  771. shape: 'custom-rect',
  772. label: '开始',
  773. zIndex: 100,
  774. attrs: {
  775. body: {
  776. rx: 20,
  777. ry: 26,
  778. },
  779. },
  780. tools: [
  781. {
  782. name: 'button',
  783. args: {
  784. firstLi,
  785. },
  786. },
  787. ],
  788. })
  789. const r2 = graph.createNode({
  790. shape: 'custom-rect',
  791. label: '办理',
  792. })
  793. const r3 = graph.createNode({
  794. shape: 'custom-rect',
  795. attrs: {
  796. body: {
  797. rx: 6,
  798. ry: 6,
  799. },
  800. },
  801. label: '分支',
  802. })
  803. const r4 = graph.createNode({
  804. shape: 'custom-polygon',
  805. attrs: {
  806. body: {
  807. refPoints: '0,10 10,0 20,10 10,20',
  808. },
  809. },
  810. label: '结束',
  811. })
  812. stencil.load([ r2, r4], 'group1')
  813. graph.addNode({
  814. shape: 'custom-rect',
  815. label: '开始',
  816. id: 1,
  817. x: 500,
  818. y: 100,
  819. })
  820. }
  821. onMounted(() => {
  822. antvInit()
  823. //获取url router参数
  824. const router = useRouter();
  825. submitFormData.flowInfoId = router.currentRoute.value.query.id
  826. })
  827. </script>
  828. <style lang="scss">
  829. .x6-widget-stencil-title {
  830. display: none;
  831. }
  832. .x6-widget-stencil-content {
  833. top: 0 !important;
  834. }
  835. .vueFlow {
  836. position: relative;
  837. display: flex;
  838. justify-content: space-between;
  839. overflow: hidden;
  840. height: 600px;
  841. #stencil {
  842. position: absolute;
  843. top: 0;
  844. left: 0;
  845. z-index: 100;
  846. width: 200px;
  847. height: 500px;
  848. background: #fff;
  849. border-right: 1px solid #e8e8e8;
  850. }
  851. #container {
  852. }
  853. #graph-container {
  854. width: 100%;
  855. position: absolute;
  856. right: 0;
  857. top: 0;
  858. }
  859. }
  860. </style>