index.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768
  1. <template>
  2. <div id="sand-edit-container" class="sand-edit-container">
  3. <div class="sand-toolbar">
  4. <el-tabs v-model="activeToolTabName" stretch class="sand-toolbar-tabs">
  5. <el-tab-pane label="元素库" name="元素库">
  6. <div class="sand-elements-tab">
  7. <div class="sand-elements sand-elements-line">
  8. <span>线条</span>
  9. <div class="elements-row" >
  10. <img src="~@/assets/icons/arrow.svg" :draggable="true" @dragstart="edgeDragStart('noArrowStraight',$event)" />
  11. <img src="~@/assets/img/chart_m/change.png" :draggable="true" @dragstart="edgeDragStart('singleArrowStraight',$event)" />
  12. <img src="~@/assets/img/chart_m/Group.png" :draggable="true" @dragstart="edgeDragStart('doubleArrowStraight',$event)"/>
  13. <img src="~@/assets/img/chart_m/Group_act.png" :draggable="true" @dragstart="edgeDragStart('noArrowBend',$event)"/>
  14. <img src="~@/assets/img/chart_m/User.png" :draggable="true" @dragstart="edgeDragStart('singleArrowBend',$event)"/>
  15. <img src="~@/assets/img/chart_m/User_act.png" :draggable="true" @dragstart="edgeDragStart('doubleArrowBend',$event)"/>
  16. <img src="~@/assets/img/chart_m/View.png" :draggable="true" @dragstart="edgeDragStart('noArrowBoundBend',$event)"/>
  17. <img src="~@/assets/img/chart_m/View_act.png" :draggable="true" @dragstart="edgeDragStart('singleArrowBoundBend',$event)"/>
  18. <img src="~@/assets/img/chart_m/View_act.png" :draggable="true" @dragstart="edgeDragStart('doubleArrowBoundBend',$event)"/>
  19. </div>
  20. </div>
  21. <div class="sand-elements sand-elements-shape">
  22. <span>基本形状</span>
  23. <div class="elements-row">
  24. <div
  25. class="elements-shape-item"
  26. v-for="shape in myNodes"
  27. :key="shape.key"
  28. :style="shape.styles"
  29. @mousedown="dragStart(shape,$event)"
  30. >
  31. {{shape.label}}
  32. </div>
  33. </div>
  34. </div>
  35. <div class="sand-elements sand-elements-mind">
  36. <span>思维导图</span>
  37. <div class="elements-row-mind">
  38. <img src="~@/assets/img/totaladdgoodcount.png" :draggable="true" @dragstart="edgeDragStart('singleMindmap',$event)"/>
  39. <img src="~@/assets/img/totalfavoritecount.png" :draggable="true" @dragstart="edgeDragStart('doubleMindmap',$event)"/>
  40. </div>
  41. </div>
  42. </div>
  43. </el-tab-pane>
  44. <el-tab-pane label="风格" name="风格">
  45. <div class="sand-style-tab">
  46. <img src="~@/assets/img/totalfavoritecount.png" :class="styleActive==1?'active':''"
  47. @click="changeStyle(1)"/>
  48. <img src="~@/assets/img/totaladdgoodcount.png" :class="styleActive==2?'active':''" @click="changeStyle(2)" />
  49. <img src="~@/assets/img/fanscount.png" :class="styleActive==3?'active':''" @click="changeStyle(3)"/>
  50. <img src="~@/assets/img/workscount.png" :class="styleActive==4?'active':''" @click="changeStyle(4)"/>
  51. </div>
  52. </el-tab-pane>
  53. </el-tabs>
  54. </div>
  55. <div class="sand-main">
  56. <div class="sand-main-top">
  57. <div class="sand-mainTop-form">
  58. <el-input
  59. v-model="search_txt"
  60. style="width: 240px; margin-right: 20px"
  61. placeholder="沙盘名称">
  62. <i slot="prefix" class="el-input__icon el-icon-search"></i>
  63. </el-input>
  64. <el-cascader
  65. v-permission="permissionBtn.sandboxPermission.sandbox_variety"
  66. :options="classifyArr"
  67. :props="classifyProps"
  68. v-model="classify"
  69. clearable
  70. placeholder="品种筛选"/>
  71. </div>
  72. <div class="sand-mainTop-option">
  73. <div class="sand-option-linkShow">
  74. <img src="~@/assets/img/sand_new/eye-show-black.png" />
  75. <span>链接展示</span>
  76. </div>
  77. <el-button size="large" type="primary" plain @click="copySandHandle" style="margin-right: 20px;min-width: 120px;">复制图片</el-button>
  78. <el-button type="primary" size="large" @click="saveChart(null)" style="min-width: 120px;">保存</el-button>
  79. </div>
  80. </div>
  81. <div class="sand-main-body">
  82. <div class="sand-mainBody-tool" id="sand-mainBody-tool">
  83. <div class="sand-tool-item" :style="{'color':canUndo?'#000000':'#999999'}" @click="toolClickOptions('undo')">撤销</div>
  84. <div class="sand-tool-item" :style="{'color':canRedo?'#000000':'#999999'}" @click="toolClickOptions('redo')">恢复</div>
  85. <div class="sand-tool-item" id="sand-tool-fontSize">
  86. <el-select v-model="styleOptions.fontF" placeholder="字体" @change="(e)=>toolClickOptions('changeFamily',e)">
  87. <el-option :label="f.name" :value="f.value" v-for="f in familyOptions" :key="f.name"></el-option>
  88. </el-select>
  89. </div>
  90. <div class="sand-tool-item">
  91. <el-select v-model="styleOptions.fontS" placeholder="字号">
  92. <el-option :label="s.name" :value="s.value" v-for="s in fontSizeOptions" :key="s.name"></el-option>
  93. </el-select>
  94. </div>
  95. <div class="sand-tool-item">B</div>
  96. <div class="sand-tool-item">I</div>
  97. <div class="sand-tool-item">下划线</div>
  98. <div class="sand-tool-item">
  99. <el-color-picker
  100. v-model="styleOptions.color"
  101. size="mini"
  102. :predefine="colorsOptions"
  103. />
  104. </div>
  105. <div class="sand-tool-item">
  106. <el-select v-model="styleOptions.lineHeight" placeholder="行高">
  107. <el-option :label="lh.name" :value="lh.value" v-for="lh in lineHeightOptions" :key="lh.name"></el-option>
  108. </el-select>
  109. </div>
  110. <div class="sand-tool-item">
  111. <el-dropdown trigger="click" @command="setGraphStyle">
  112. <div class="el-dropdown-link">
  113. <img src="~@/assets/icons/line.svg" width="20" height="20" style="vertical-align: middle;">
  114. <i class="el-icon-arrow-down" style="font-size:12px;"></i>
  115. </div>
  116. <el-dropdown-menu slot="dropdown">
  117. <el-dropdown-item :command="{attr:'line/strokeDasharray',val: '4 4'}" :class="styleOptions.textAlign=='center'?'style-acitve':''">
  118. <!-- <i class="iconfont icon--xuxian" style="color:'#000';fontSize:30px"></i> -->
  119. 居中
  120. </el-dropdown-item>
  121. <el-dropdown-item :command="{attr:'line/strokeDasharray',val: null}">
  122. 居左
  123. <!-- <i class="iconfont icon--shixian" style="color:'#000';fontSize:30px"></i> -->
  124. </el-dropdown-item>
  125. <el-dropdown-item :command="{attr:'line/strokeDasharray',val: null}">
  126. 居右
  127. <!-- <i class="iconfont icon--shixian" style="color:'#000';fontSize:30px"></i> -->
  128. </el-dropdown-item>
  129. </el-dropdown-menu>
  130. </el-dropdown>
  131. </div>
  132. <div class="sand-tool-item">填充色</div>
  133. <div class="sand-tool-item">线条颜色</div>
  134. <div class="sand-tool-item">
  135. <el-dropdown trigger="click" @command="setGraphStyle">
  136. <div class="el-dropdown-link">
  137. <img src="~@/assets/icons/line.svg" width="20" height="20" style="vertical-align: middle;">
  138. <i class="el-icon-arrow-down" style="font-size:12px;"></i>
  139. </div>
  140. <el-dropdown-menu slot="dropdown">
  141. <el-dropdown-item :command="{attr:'line/strokeDasharray',val: '4 4'}" :class="styleOptions.lineWidth=='cu'?'style-acitve':''">
  142. <!-- <i class="iconfont icon--xuxian" style="color:'#000';fontSize:30px"></i> -->
  143. </el-dropdown-item>
  144. <el-dropdown-item :command="{attr:'line/strokeDasharray',val: null}">
  145. <!-- <i class="iconfont icon--shixian" style="color:'#000';fontSize:30px"></i> -->
  146. </el-dropdown-item>
  147. <el-dropdown-item :command="{attr:'line/strokeDasharray',val: null}">
  148. 很细
  149. <!-- <i class="iconfont icon--shixian" style="color:'#000';fontSize:30px"></i> -->
  150. </el-dropdown-item>
  151. </el-dropdown-menu>
  152. </el-dropdown>
  153. </div>
  154. <div class="sand-tool-item">
  155. <el-dropdown trigger="click" @command="setGraphStyle">
  156. <div class="el-dropdown-link">
  157. <img src="~@/assets/icons/line.svg" width="20" height="20" style="vertical-align: middle;">
  158. <i class="el-icon-arrow-down" style="font-size:12px;"></i>
  159. </div>
  160. <el-dropdown-menu slot="dropdown">
  161. <el-dropdown-item :command="{attr:'line/strokeDasharray',val: '4 4'}" :class="styleOptions.lineStyle=='xu'?'style-acitve':''">
  162. <!-- <i class="iconfont icon--xuxian" style="color:'#000';fontSize:30px"></i> -->
  163. 虚线
  164. </el-dropdown-item>
  165. <el-dropdown-item :command="{attr:'line/strokeDasharray',val: null}">
  166. 实线
  167. <!-- <i class="iconfont icon--shixian" style="color:'#000';fontSize:30px"></i> -->
  168. </el-dropdown-item>
  169. </el-dropdown-menu>
  170. </el-dropdown>
  171. </div>
  172. <div class="sand-tool-item">
  173. <el-dropdown trigger="click" @command="setGraphStyle">
  174. <div class="el-dropdown-link">
  175. <img src="~@/assets/icons/line.svg" width="20" height="20" style="vertical-align: middle;">
  176. <i class="el-icon-arrow-down" style="font-size:12px;"></i>
  177. </div>
  178. <el-dropdown-menu slot="dropdown">
  179. <el-dropdown-item :command="{attr:'line/strokeDasharray',val: '4 4'}" :class="styleOptions.connectStyle=='1'?'style-acitve':''">
  180. <!-- <i class="iconfont icon--xuxian" style="color:'#000';fontSize:30px"></i> -->
  181. 直线
  182. </el-dropdown-item>
  183. <el-dropdown-item :command="{attr:'line/strokeDasharray',val: null}">
  184. 弯折线
  185. <!-- <i class="iconfont icon--shixian" style="color:'#000';fontSize:30px"></i> -->
  186. </el-dropdown-item>
  187. <el-dropdown-item :command="{attr:'line/strokeDasharray',val: null}">
  188. 圆角弯折线
  189. <!-- <i class="iconfont icon--shixian" style="color:'#000';fontSize:30px"></i> -->
  190. </el-dropdown-item>
  191. </el-dropdown-menu>
  192. </el-dropdown>
  193. </div>
  194. <div class="sand-tool-item">
  195. <el-dropdown trigger="click" @command="setGraphStyle">
  196. <div class="el-dropdown-link">
  197. <img src="~@/assets/icons/line.svg" width="20" height="20" style="vertical-align: middle;">
  198. <i class="el-icon-arrow-down" style="font-size:12px;"></i>
  199. </div>
  200. <el-dropdown-menu slot="dropdown">
  201. <el-dropdown-item :command="{attr:'line/strokeDasharray',val: '4 4'}" :class="styleOptions.startArrow=='1'?'style-acitve':''">
  202. <!-- <i class="iconfont icon--xuxian" style="color:'#000';fontSize:30px"></i> -->
  203. </el-dropdown-item>
  204. <el-dropdown-item :command="{attr:'line/strokeDasharray',val: null}">
  205. <!-- <i class="iconfont icon--shixian" style="color:'#000';fontSize:30px"></i> -->
  206. </el-dropdown-item>
  207. </el-dropdown-menu>
  208. </el-dropdown>
  209. </div>
  210. <div class="sand-tool-item">
  211. <el-dropdown trigger="click" @command="setGraphStyle">
  212. <div class="el-dropdown-link">
  213. <img src="~@/assets/icons/line.svg" width="20" height="20" style="vertical-align: middle;">
  214. <i class="el-icon-arrow-down" style="font-size:12px;"></i>
  215. </div>
  216. <el-dropdown-menu slot="dropdown">
  217. <el-dropdown-item :command="{attr:'line/strokeDasharray',val: '4 4'}" :class="styleOptions.endArrow=='1'?'style-acitve':''">
  218. <!-- <i class="iconfont icon--xuxian" style="color:'#000';fontSize:30px"></i> -->
  219. </el-dropdown-item>
  220. <el-dropdown-item :command="{attr:'line/strokeDasharray',val: null}">
  221. <!-- <i class="iconfont icon--shixian" style="color:'#000';fontSize:30px"></i> -->
  222. </el-dropdown-item>
  223. </el-dropdown-menu>
  224. </el-dropdown>
  225. </div>
  226. </div>
  227. <div class="sand-mainBody-chart" id="sand-mainBody-chart">
  228. <div id="sand-chart-container" ></div>
  229. <!-- 缩略图 -->
  230. <div id="minimap" class="minimap"></div>
  231. <div class="contextMenu-wrapper" id="contextMenu-wrapper" @mouseleave="hideContextMenu">
  232. <dropdown-menu size="medium">
  233. <el-dropdown-item v-for="menu in contextMenuOption" :key="menu.key" @click.native="handleContext(menu.key)">
  234. <i :class="menu.icon" v-if="menu.icon" />
  235. {{menu.label}}
  236. </el-dropdown-item>
  237. </dropdown-menu>
  238. </div>
  239. </div>
  240. </div>
  241. </div>
  242. <!-- 添加链接 -->
  243. <el-dialog :modal-append-to-body='false' title="添加链接" :visible.sync="addLinkShow" :close-on-click-modal="false" :center="true" width="700px">
  244. <div slot="footer" class="dialog-footer" style="text-align:right;">
  245. <el-button type="primary" plain size="small" @click.native="addLinkShow=false">取 消</el-button>
  246. <el-button type="primary" size="small" @click.native="saveLink">保 存</el-button>
  247. </div>
  248. </el-dialog>
  249. </div>
  250. </template>
  251. <script>
  252. import { myGraph } from '../common/gragh';
  253. import { myNodes,myNodeOption } from '../common/node';
  254. import { myEdgeOption } from '../common/edge';
  255. import { Addon } from '@antv/x6'
  256. import { configOpt } from '../common/toolConfig';
  257. // import {setGraph,render} from "../common/mindmap"
  258. import mindmap from "../common/mindmap"
  259. import {styleSettings,familyOptions,fontSizeOptions,colorsOptions,lineHeightOptions} from "../common/toolConfig"
  260. import { ElDropdownMenu as DropdownMenu } from 'element-ui';
  261. import { contextMenuOption } from '../common/options';
  262. import { contextEvent } from '../common/events';
  263. const { line} = configOpt;
  264. export default {
  265. name:"sandFlowIndex",
  266. components:{
  267. DropdownMenu
  268. },
  269. data() {
  270. return {
  271. graph: null,
  272. dnd:null,
  273. initData: {},
  274. activeToolTabName:"元素库",
  275. addEdgeType:"",
  276. styleActive:1,
  277. // 当前的样式配置
  278. styleOptions:{
  279. fontF:"微软雅黑",
  280. fontS:14,
  281. color:'#000000',
  282. lineHeight:1,
  283. textAlign:'center',
  284. lineStyle:"xu",
  285. lineWidth:'cu',
  286. connectStyle:'1',
  287. startArrow:'1',
  288. endArrow:'1'
  289. },
  290. canUndo:false,
  291. canRedo:false,
  292. mindMapData:{
  293. id: "1",
  294. type: 'topic',
  295. label: '中心主题',
  296. width: 160,
  297. height: 50,
  298. children: [
  299. {
  300. id: '1-1',
  301. type: 'topic-branch',
  302. label: '分支主题1',
  303. width: 100,
  304. height: 40,
  305. children: [
  306. {
  307. id: '1-1-1',
  308. type: 'topic-child',
  309. label: '子主题1',
  310. width: 60,
  311. height: 30,
  312. },
  313. {
  314. id: '1-1-2',
  315. type: 'topic-child',
  316. label: '子主题2',
  317. width: 60,
  318. height: 30,
  319. },
  320. ],
  321. },
  322. {
  323. id: '1-2',
  324. type: 'topic-branch',
  325. label: '分支主题2',
  326. width: 100,
  327. height: 40,
  328. },
  329. ],
  330. },
  331. mindmapPosition:{},
  332. // 添加链接弹窗
  333. addLinkShow:false
  334. }
  335. },
  336. mixins:[mindmap],
  337. watch: {
  338. initData(newval) {
  339. console.log(newval)
  340. this.graph.fromJSON(newval);
  341. },
  342. },
  343. computed:{
  344. myNodes(){
  345. return myNodes
  346. },
  347. myEdgeOption(){
  348. return myEdgeOption
  349. },
  350. contextMenuOption(){
  351. return contextMenuOption
  352. },
  353. familyOptions(){
  354. return familyOptions
  355. },
  356. fontSizeOptions(){
  357. return fontSizeOptions
  358. },
  359. colorsOptions(){
  360. return colorsOptions
  361. },
  362. lineHeightOptions(){
  363. return lineHeightOptions
  364. }
  365. },
  366. mounted(){
  367. this.init()
  368. document.getElementById('sand-mainBody-chart').addEventListener("dragover",this.edgeDragover)
  369. document.getElementById('sand-mainBody-chart').addEventListener("drop",this.edgeDrop)
  370. },
  371. beforeDestroy(){
  372. document.getElementById('sand-mainBody-chart').removeEventListener("dragover",this.edgeDragover)
  373. document.getElementById('sand-mainBody-chart').removeEventListener("drop",this.edgeDrop)
  374. },
  375. methods: {
  376. // 初始化画布
  377. init() {
  378. const graph = new myGraph('sand-chart-container',this.mindMapData);
  379. graph.history.on('change', (args) => {
  380. console.log(args);
  381. this.canUndo = graph.canUndo()
  382. this.canRedo = graph.canRedo()
  383. console.log(this.canUndo,this.canRedo);
  384. })
  385. this.graph = graph;
  386. this.dnd = new Addon.Dnd({
  387. target: this.graph,
  388. animation: true,
  389. validateNode() {
  390. return true;
  391. },
  392. });
  393. this.setGraph()
  394. },
  395. dragStart(data,e) {
  396. // console.log(data,e,"触发了")
  397. const { key,shape } = data;
  398. const node = this.graph.createNode({
  399. shape,
  400. ...myNodeOption(key),
  401. });
  402. this.dnd.start(node,e);
  403. },
  404. edgeDragStart(type,e){
  405. console.log(e);
  406. this.addEdgeType = type
  407. console.log(type,"触发了边")
  408. },
  409. edgeDragover(e){
  410. e.preventDefault()
  411. },
  412. edgeDrop(e){
  413. if(!this.addEdgeType){
  414. return
  415. }
  416. console.log(this.addEdgeType,e);
  417. console.log(this.graph);
  418. let position = this.graph.clientToLocal({x:e.clientX,y:e.clientY})
  419. if(this.addEdgeType.indexOf("Mindmap")!==-1){
  420. //插入思维导图
  421. console.log("插入思维导图");
  422. this.mindmapPosition=position
  423. this.mindMapRender()
  424. }else{
  425. this.graph.addEdge({
  426. shape:'edge',
  427. ...this.myEdgeOption(this.addEdgeType,position.x,position.y)
  428. });
  429. }
  430. },
  431. changeStyle(activeNum){
  432. this.$store.commit("sand/SET_CELL_STYLE",activeNum)
  433. let styleData=styleSettings[activeNum-1]
  434. let cells = this.graph.getCells()
  435. // console.log(cells);
  436. for (let i = 0; i < cells.length; i++) {
  437. const element = cells[i];
  438. console.log(element);
  439. if(element.shape=="edge") continue
  440. if(element.data.key == 'text'){
  441. // element.attrs.text.fill=styleData.backgroundColor
  442. element.setAttrs({
  443. text:{
  444. fill:styleData.backgroundColor
  445. }
  446. })
  447. }else{
  448. element.setAttrs({
  449. body:{
  450. fill:styleData.backgroundColor
  451. }
  452. })
  453. }
  454. }
  455. this.styleActive = activeNum
  456. },
  457. /* 右键事件 */
  458. handleContext(key) {
  459. if(key=="addLink"){
  460. this.addLinkDialogOpen()
  461. }else{
  462. contextEvent(this.graph, key);
  463. }
  464. this.hideContextMenu();
  465. },
  466. /* 隐藏右键menu */
  467. hideContextMenu() {
  468. const dom = $('#contextMenu-wrapper')[0];
  469. dom.style.left = '-9999px';
  470. dom.style.top = '-9999px';
  471. },
  472. addLinkDialogOpen(){
  473. this.addLinkShow=true
  474. },
  475. saveLink(){
  476. console.log("保存链接");
  477. const select_cell = this.graph.getSelectedCells()[0]
  478. if(select_cell.data.linkData){
  479. select_cell.data.linkData = [{id:11,ids:21}]
  480. }else{
  481. select_cell.setData({linkData:[{id:1},{id:2}]})
  482. }
  483. console.log(select_cell,'select_cell');
  484. this.addLinkShow=false
  485. },
  486. copySandHandle(){
  487. },
  488. saveChart(){
  489. console.log(this.mindMapData,'this.mindMapData');
  490. },
  491. setGraphStyle(){
  492. console.log("修改样式")
  493. },
  494. toolClickOptions(type){
  495. console.log(arguments);
  496. switch (type) {
  497. case 'undo':
  498. this.graph.undo()
  499. break;
  500. case 'redo':
  501. this.graph.redo()
  502. break;
  503. default:
  504. break;
  505. }
  506. }
  507. },
  508. }
  509. </script>
  510. <style lang="scss" scoped>
  511. #sand-edit-container{
  512. height: calc(100vh - 120px);
  513. min-height: 600px;
  514. display: flex;
  515. flex-wrap: nowrap;
  516. .sand-toolbar{
  517. min-width: 400px;
  518. width: 400px;
  519. background-color: white;
  520. border-radius: 4px;
  521. border: 1px solid #DCDFE6;
  522. height: 100%;
  523. box-sizing: border-box;
  524. margin-right: 20px;
  525. padding-bottom: 20px;
  526. .sand-elements-tab{
  527. padding: 0 30px;
  528. overflow: auto;
  529. height: calc(100vh - 220px);
  530. .sand-elements{
  531. padding: 30px 0 20px;
  532. border-bottom: 1px solid #C8CDD9 ;
  533. span{
  534. display: inline-block;
  535. margin-bottom: 10px;
  536. font-size: 16px;
  537. color: #999999;
  538. }
  539. .elements-row{
  540. display: flex;
  541. flex-wrap: wrap;
  542. align-items: center;
  543. margin-right: -10px;
  544. .elements-shape-item,img{
  545. margin-right: 10px;
  546. margin-bottom: 10px;
  547. cursor: pointer;
  548. }
  549. img{
  550. height: 26px;
  551. width: 26px;
  552. }
  553. }
  554. }
  555. .sand-elements-mind{
  556. border-bottom: none;
  557. padding-bottom: 0;
  558. }
  559. }
  560. .elements-row-mind,.sand-style-tab{
  561. display: flex;
  562. flex-wrap: wrap;
  563. align-items: center;
  564. justify-content: space-between;
  565. img{
  566. width: calc(50% - 10px);
  567. }
  568. }
  569. .sand-style-tab{
  570. padding: 20px 30px;
  571. img{
  572. border: 1px solid #C8CDD9;
  573. margin-bottom: 20px;
  574. cursor: pointer;
  575. }
  576. .active{
  577. border: 1px solid #0052D9;
  578. }
  579. }
  580. }
  581. .sand-main{
  582. flex: 1;
  583. display: flex;
  584. flex-direction: column;
  585. .sand-main-top{
  586. padding: 20px 20px 10px;
  587. display: flex;
  588. flex-wrap: wrap;
  589. align-items: center;
  590. justify-content: space-between;
  591. background-color: white;
  592. box-shadow: 0px 2px 12px 0px rgba($color: #000000, $alpha: 0.08);
  593. border: 1px solid #DCDFE6;
  594. border-radius: 4px;
  595. margin-bottom: 20px;
  596. .sand-mainTop-form{
  597. margin-bottom: 10px;
  598. margin-right: 20px;
  599. white-space: nowrap;
  600. }
  601. .sand-mainTop-option{
  602. display: flex;
  603. align-items: center;
  604. margin-bottom: 10px;
  605. .sand-option-linkShow{
  606. display: flex;
  607. align-items: center;
  608. margin-right: 30px;
  609. cursor: pointer;
  610. img{
  611. height: 16px;
  612. margin-right: 4px;
  613. }
  614. }
  615. }
  616. }
  617. .sand-main-body{
  618. display: flex;
  619. flex-direction: column;
  620. flex: 1;
  621. background-color: white;
  622. border: 1px solid #DCDFE6;
  623. border-radius: 4px;
  624. .sand-mainBody-tool{
  625. height: 50px;
  626. width: 100%;
  627. background-color: #F5F6F7;
  628. box-sizing: border-box;
  629. border-radius: 4px;
  630. display: flex;
  631. align-items: center;
  632. padding-right: 10px;
  633. .sand-tool-item{
  634. margin-left: 10px;
  635. cursor: pointer;
  636. }
  637. }
  638. .sand-mainBody-chart{
  639. height: calc(100% - 50px);
  640. // flex: 1;
  641. position: relative;
  642. display: flex;
  643. .contextMenu-wrapper {
  644. position: fixed;
  645. z-index: 99;
  646. top: -9999px;
  647. left: -9999px;
  648. background: #fff;
  649. padding: 10px 0;
  650. /* border: 1px solid #999; */
  651. box-shadow: 0 1px 4px #999;
  652. }
  653. .minimap{
  654. position:absolute;
  655. right:6px;
  656. bottom:6px;
  657. box-sizing: border-box;
  658. }
  659. }
  660. }
  661. }
  662. }
  663. @media screen and (max-width:1680px) {
  664. #sand-edit-container{
  665. .sand-toolbar{
  666. min-width: 330px;
  667. width: 330px;
  668. }
  669. }
  670. }
  671. </style>
  672. <style lang="scss">
  673. .sand-toolbar-tabs{
  674. .el-tabs__header{
  675. padding-top: 16px;
  676. box-shadow: 0px 2px 12px 0px rgba($color: #000000, $alpha: 0.08);
  677. }
  678. }
  679. .el-cascader{
  680. .el-input{
  681. width: 240px;
  682. }
  683. }
  684. .sand-mainBody-chart{
  685. #sand-chart-container{
  686. flex: 1;
  687. }
  688. .x6-graph-scroller {
  689. flex: 1;
  690. }
  691. .x6-port-body {
  692. display: none;
  693. }
  694. /* reseize 框样式 */
  695. .x6-widget-transform {
  696. .x6-widget-transform-resize {
  697. border-radius: 0;
  698. }
  699. }
  700. .x6-widget-minimap-viewport{
  701. border-color: red;
  702. .x6-widget-minimap-viewport-zoom{
  703. border-color: red;
  704. }
  705. }
  706. .x6-widget-minimap{
  707. width: auto !important;
  708. height: auto !important;
  709. }
  710. }
  711. .topic-image {
  712. visibility: hidden;
  713. cursor: pointer;
  714. }
  715. .x6-node:hover .topic-image {
  716. visibility: visible;
  717. }
  718. .x6-node-selected rect {
  719. stroke-width: 2px;
  720. }
  721. #sand-mainBody-tool{
  722. .el-select{
  723. .el-input{
  724. .el-input__inner{
  725. border: none;
  726. background-color: #F5F6F7;
  727. padding-left: 0;
  728. padding-right: 30px;
  729. }
  730. }
  731. }
  732. }
  733. #sand-tool-fontSize{
  734. .el-select{
  735. width: 100px;
  736. }
  737. }
  738. .style-acitve{
  739. color: red;
  740. }
  741. </style>