config.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904
  1. /**
  2. * ppt 设置
  3. */
  4. //pageList数据结构
  5. const pageList = [{
  6. id: 1, //pageId
  7. title: '我是版式一', //pageTitle
  8. modelId: 4, //版式id
  9. key: 0, //用于重新渲染
  10. layers:[//page图层元素
  11. {//形状元素
  12. id:'xvSIDSN',//图层元素id
  13. type:'shape',//图层类型:shape line text
  14. shapeType:'Rect',//用于指定BaseShape
  15. left:0,top:0,//位置信息,单位px
  16. width:100,height:100,//大小信息,单位px
  17. fill:'#FF0000',//填充颜色,支持透明度
  18. opacity:1,//元素整体的透明度
  19. outline:{//边框信息:对应rect的stroke属性
  20. style:'solid',//实线solid虚线dashed
  21. width:1,//边框的宽度
  22. color:'#008000',//边框颜色,也支持透明度
  23. }
  24. },
  25. {//线条元素
  26. id:'AxsdUE',
  27. type:'line',
  28. left:0,top:0,width:100,height:100,
  29. start:[0,0],//线条起点位置,对应line的x1,y1
  30. end:[100,100],//线条的终点位置,对应line的x2,y2
  31. color:'#008000',//线条颜色
  32. points:['','arrow'],//线条的端点样式:([起点样式, 终点样式];'':无;'arrow':箭头
  33. style:'solid',//线条样式:实现虚线
  34. },
  35. ],
  36. elements: [{ //page元素
  37. type: 'chart', //元素类型:chart image text sheet
  38. position: 1, //元素所在位置
  39. chartId: '31161cf31e33bd262dca99e161308064', //动态图标对应的UniqueCode
  40. }, {
  41. type: 'image',
  42. position: 2,
  43. src: 'http://xxx.png', //图片对应的线上地址
  44. }, {
  45. type: 'text',
  46. position: 4,
  47. content: 'aaa', //纯文本信息
  48. richContent: '<p>aaa</p>' //富文本信息
  49. }, {
  50. type:'sheet',
  51. position:3,
  52. sheetId:'ajhskdakd',//表格id
  53. sheetHeight:'100px',//表格iframe所占的高度,转报告会用到 表格iframe加载完毕才会有
  54. }]
  55. }, ]
  56. //版式预览配置
  57. export const formatPre = [{
  58. modelId: 1, //版式id
  59. text: '一张图', //描述文字
  60. },
  61. {
  62. modelId: 2,
  63. text: '左图+文字'
  64. },
  65. {
  66. modelId: 3,
  67. text: '左2图+文字'
  68. }, {
  69. modelId: 4,
  70. text: '3图+文字'
  71. },{
  72. modelId:7,
  73. text:'两张图'
  74. },{
  75. modelId: 5,
  76. text: '四张图'
  77. }, {
  78. modelId: 6,
  79. text: '全文字'
  80. },{
  81. modelId:8,
  82. text:'上图+文字'
  83. },{
  84. modelId:9,
  85. text:'上2图+文字'
  86. },{
  87. modelId:10,
  88. text:'上6图+文字'
  89. },
  90. {
  91. modelId:11,
  92. text:'上4图+文字'
  93. },{
  94. modelId:12,
  95. text:'上6图'
  96. },{
  97. modelId:13,
  98. text:'xxx'
  99. },
  100. {
  101. modelId:14,
  102. text:'左上图左下右文本框'
  103. }
  104. ]
  105. //版式id对应组件名
  106. export const modelMap = {
  107. 1: 'One',
  108. 2: 'Two',
  109. 3: 'Three',
  110. 4: 'Four',
  111. 5: 'Five',
  112. 6: 'Six',
  113. 7: 'Seven',
  114. 8: 'Eight',
  115. 9: 'Nine',
  116. 10:'Ten',
  117. 11:'Ele',
  118. 12:'Twelve',
  119. 13:'Thirteen',
  120. 14:'Fourteen',
  121. }
  122. //版式信息,用于判断图表/文字插入哪个位置
  123. export const modelInfo = {
  124. 1: {
  125. elNum: 1, //可容纳元素的个数
  126. elType: ['chart'], //可容纳元素的类型,index+1与positions对应
  127. positions: [1], //元素的位置索引
  128. elChartNum: 1,
  129. elTextNum: 0
  130. },
  131. 2: {
  132. elNum: 2,
  133. elType: ['chart', 'text'],
  134. positions: [1, 2],
  135. elChartNum: 1,
  136. elTextNum: 1,
  137. elTextPosition: 2
  138. },
  139. 3: {
  140. elNum: 3,
  141. elType: ['chart', 'chart', 'text'],
  142. positions: [1, 2, 3],
  143. elChartNum: 2,
  144. elTextNum: 1,
  145. elTextPosition: 3
  146. },
  147. 4: {
  148. elNum: 4,
  149. elType: ['chart', 'chart', 'chart', 'text'],
  150. positions: [1, 2, 3, 4],
  151. elChartNum: 3,
  152. elTextNum: 1,
  153. elTextPosition: 4
  154. },
  155. 5: {
  156. elNum: 4,
  157. elType: ['chart', 'chart', 'chart', 'chart'],
  158. positions: [1, 2, 3, 4],
  159. elChartNum: 4,
  160. elTextNum: 0
  161. },
  162. 6: {
  163. elNum: 1, //可容纳元素的个数
  164. elType: ['text'], //可容纳元素的类型,index+1与positions对应
  165. positions: [1], //元素的位置索引
  166. elChartNum: 0,
  167. elTextNum: 1,
  168. elTextPosition: 1
  169. },
  170. 7:{
  171. elNum:2,
  172. elType:['chart','chart'],
  173. positions:[1,2],
  174. elChartNum:2,
  175. elTextNum:0
  176. },
  177. 8:{
  178. elNum:2,
  179. elType:['chart','text'],
  180. positions:[1,2],
  181. elChartNum:1,
  182. elTextNum:1,
  183. elTextPosition: 2
  184. },
  185. 9:{
  186. elNum:3,
  187. elType:['chart','chart','text'],
  188. positions:[1,2,3],
  189. elChartNum:2,
  190. elTextNum:1,
  191. elTextPosition: 3
  192. },
  193. 12:{
  194. elNum:6,
  195. elType:['chart','chart','chart','chart','chart','chart'],
  196. positions:[1,2,3,4,5,6],
  197. elChartNum:6,
  198. elTextNum:0,
  199. /* elTextPosition: 7 */
  200. },
  201. 11:{
  202. elNum:5,
  203. elType:['chart','chart','chart','chart','text'],
  204. positions:[1,2,3,4,5],
  205. elChartNum:4,
  206. elTextNum:1,
  207. elTextPosition: 5
  208. },
  209. 10:{
  210. elNum:7,
  211. elType:['chart','chart','chart','chart','chart','chart','text'],
  212. positions:[1,2,3,4,5,6],
  213. elChartNum:6,
  214. elTextNum:1,
  215. elTextPosition: 7
  216. },
  217. 13:{
  218. elNum:2,
  219. elType:['chart','chart'],
  220. positions:[1,2],
  221. elChartNum:2,
  222. elTextNum:0
  223. },
  224. 14: {
  225. elNum: 3,
  226. elType: ['chart', 'text', 'text'],
  227. positions: [1, 2, 3],
  228. elChartNum: 1,
  229. elTextNum: 2,
  230. elTextPosition: 3
  231. },
  232. }
  233. //给标题预留的位置,单位%
  234. export const marginTop = 14
  235. const titleHeight = 7
  236. const restHeight = 100 - marginTop
  237. //版式位置宽高设置,x,y,width,height都是基于整张ppt的百分比
  238. //百分比的值来自./css/format.scss ->.chart-wrap,.editor-wrap
  239. //用于发布页生成PPT
  240. export const modelConfig = [{
  241. modelId: 1,
  242. elements: [{
  243. position: 1,
  244. width: 100*0.9, //单位%
  245. height: (restHeight)*0.9,
  246. x: (100-100*0.9)/2, //单位%,left
  247. /* y: ((restHeight)-(restHeight)*0.9)/2, //top */
  248. y:1.5
  249. }]
  250. }, {
  251. modelId: 2,
  252. elements: [{
  253. position: 1,
  254. width: 100*0.6,
  255. height:(restHeight)*0.8 ,
  256. x: 0,
  257. y: ((restHeight)-(restHeight)*0.8)/2
  258. }, {
  259. position: 2,
  260. width: 100*0.4,
  261. height: (restHeight)*0.8,
  262. x: 60,// or 60
  263. y: ((restHeight)-(restHeight)*0.8)/2
  264. }]
  265. },
  266. {
  267. modelId: 3,
  268. elements: [{
  269. position: 1,
  270. width: 100*0.5,
  271. height: (restHeight)*0.5*0.84,
  272. x: 0,
  273. y: ((restHeight)*0.5-(restHeight)*0.5*0.84)/2
  274. }, {
  275. position: 2,
  276. width: 100*0.5,
  277. height: (restHeight)*0.5*0.84,
  278. x: 0,
  279. //这个位置的图表布局是align-items: flex-start,所以紧接着上一个图表
  280. y: 50-7/* +((restHeight)*0.5-(restHeight)*0.5*0.84)/2 */,//or 50
  281. }, {
  282. position: 3,
  283. width: 100*0.5,
  284. height: (restHeight)*0.84,
  285. x: 50,
  286. y: ((restHeight)-(restHeight)*0.84)/2
  287. }]
  288. },
  289. {
  290. modelId: 4,
  291. elements: [{
  292. position: 1,
  293. width: 100*0.5,
  294. height: (restHeight)*0.4*0.84,
  295. x: 0,
  296. y: ((restHeight)*0.4-(restHeight)*0.4*0.84)/2
  297. }, {
  298. position: 2,
  299. width: 100*0.5,
  300. height: (restHeight)*0.6*0.84,
  301. x: 0,
  302. y: 50-17/* +((restHeight)*0.5-(restHeight)*0.5*0.84)/2 */,//or 50
  303. }, {
  304. position: 3,
  305. width: 100*0.5,
  306. height: (restHeight)*0.4*0.84,
  307. x: 50,//or 50
  308. y: ((restHeight)*0.5-(restHeight)*0.5*0.84)/2
  309. }, {
  310. position: 4,
  311. width: 100*0.5,
  312. height: (restHeight)*0.6*0.9,
  313. x: 50,
  314. y: 50-17/* +((restHeight)*0.5-(restHeight)*0.5*0.84)/2 */,//or 50
  315. }]
  316. },
  317. {
  318. modelId: 5,
  319. elements: [{
  320. position: 1,
  321. width: 100*0.5,
  322. height: (restHeight)*0.5*0.84,
  323. x: 0,
  324. y: ((restHeight)*0.5-(restHeight)*0.5*0.84)/2
  325. }, {
  326. position: 2,
  327. width: 100*0.5,
  328. height: (restHeight)*0.5*0.84,
  329. x: 0,
  330. y: 50-7/* +((restHeight)*0.5-(restHeight)*0.5*0.84)/2 */,//or 50
  331. }, {
  332. position: 3,
  333. width: 100*0.5,
  334. height: (restHeight)*0.5*0.84,
  335. x: 50,//or 50
  336. y: ((restHeight)*0.5-(restHeight)*0.5*0.84)/2
  337. }, {
  338. position: 4,
  339. width: 100*0.5,
  340. height: (restHeight)*0.5*0.84,
  341. x: 50,
  342. y: 50-7/* +((restHeight)*0.5-(restHeight)*0.5*0.84)/2 */,//or 50
  343. }]
  344. },
  345. {
  346. modelId: 6,
  347. elements: [{
  348. position: 1,
  349. width: 100*0.9,
  350. height: (100-marginTop)*0.9,
  351. x: (100-100*0.9)/2,
  352. y: ((100-marginTop)-(100-marginTop)*0.9)/2,
  353. }]
  354. },
  355. {
  356. modelId:7,
  357. elements:[{
  358. position:1,
  359. width:100*0.5,
  360. height:(restHeight)*0.8,
  361. x:0,
  362. y:((restHeight)-(restHeight)*0.8)/2
  363. },{
  364. position:2,
  365. width:100*0.5,
  366. height:(restHeight)*0.8,
  367. x:50,
  368. y:((restHeight)-(restHeight)*0.8)/2
  369. }]
  370. },
  371. {
  372. modelId:8,
  373. elements:[{
  374. position:1,
  375. width:100,
  376. height:(restHeight)*0.7*0.9,
  377. x:0,
  378. y:(restHeight*0.7-restHeight*0.7*0.9)/2
  379. },
  380. {
  381. position:2,
  382. width:100,
  383. height:(restHeight)*0.3*0.8,
  384. x:0,
  385. y:60
  386. }]
  387. },
  388. {
  389. modelId:9,
  390. elements:[{
  391. position:1,
  392. width:100*0.5,
  393. height:(restHeight)*0.7*0.9,
  394. x:0,
  395. y:(restHeight*0.7-restHeight*0.7*0.9)/2
  396. },
  397. {
  398. position:2,
  399. width:100*0.5,
  400. height:(restHeight)*0.7*0.9,
  401. x:50,
  402. y:(restHeight*0.7-restHeight*0.7*0.9)/2
  403. },
  404. {
  405. position:3,
  406. width:100*0.9,
  407. height:(restHeight)*0.3*0.8,
  408. x:0,
  409. y:60
  410. }
  411. ]
  412. },{
  413. modelId:12,
  414. elements:[{
  415. position:1,
  416. width:33,
  417. height:(restHeight)*0.48*0.9,
  418. x:0,
  419. y:(restHeight*0.48*0.1)/2
  420. },{
  421. position:2,
  422. width:33,
  423. height:(restHeight)*0.48*0.9,
  424. x:33,
  425. y:(restHeight*0.48*0.1)/2
  426. },
  427. {
  428. position:3,
  429. width:33,
  430. height:(restHeight)*0.48*0.9,
  431. x:33*2,
  432. y:(restHeight*0.48*0.1)/2
  433. },
  434. {
  435. position:4,
  436. width:33,
  437. height:(restHeight)*0.48*0.9,
  438. x:0,
  439. y:(restHeight)*0.48+(restHeight*0.48*0.1)/2
  440. },
  441. {
  442. position:5,
  443. width:33,
  444. height:(restHeight)*0.48*0.9,
  445. x:33,
  446. y:(restHeight)*0.48+(restHeight*0.48*0.1)/2
  447. },
  448. {
  449. position:6,
  450. width:33,
  451. height:(restHeight)*0.48*0.9,
  452. x:33*2,
  453. y:(restHeight)*0.48+(restHeight*0.48*0.1)/2
  454. }]
  455. },{
  456. modelId:11,
  457. elements:[{
  458. position:1,
  459. width:50,
  460. height:(restHeight)*0.35*0.9,
  461. x:0,
  462. y:(restHeight*0.35*0.1)/2
  463. },{
  464. position:2,
  465. width:50,
  466. height:(restHeight)*0.35*0.9,
  467. x:50,
  468. y:(restHeight*0.35*0.1)/2
  469. },{
  470. position:3,
  471. width:50,
  472. height:(restHeight)*0.35*0.9,
  473. x:0,
  474. y:34
  475. },{
  476. position:4,
  477. width:50,
  478. height:(restHeight)*0.35*0.9,
  479. x:50,
  480. y:34
  481. },{
  482. position:5,
  483. width:100*0.95,
  484. height:(restHeight)*0.28*0.8,
  485. x:0,
  486. y:64
  487. }]
  488. },{
  489. modelId:10,
  490. elements:[{
  491. position:1,
  492. width:33,
  493. height:(restHeight)*0.4*0.9,
  494. x:0,
  495. y:(restHeight*0.4*0.1)/2
  496. },{
  497. position:2,
  498. width:33,
  499. height:(restHeight)*0.4*0.9,
  500. x:33,
  501. y:(restHeight*0.4*0.1)/2
  502. },
  503. {
  504. position:3,
  505. width:33,
  506. height:(restHeight)*0.4*0.9,
  507. x:33*2,
  508. y:(restHeight*0.4*0.1)/2
  509. },
  510. {
  511. position:4,
  512. width:33,
  513. height:(restHeight)*0.4*0.9,
  514. x:0,
  515. y:38
  516. },
  517. {
  518. position:5,
  519. width:33,
  520. height:(restHeight)*0.4*0.9,
  521. x:33,
  522. y:38
  523. },
  524. {
  525. position:6,
  526. width:33,
  527. height:(restHeight)*0.4*0.9,
  528. x:33*2,
  529. y:38
  530. },
  531. {
  532. position:7,
  533. width:100,
  534. height:(restHeight)*0.18*0.8,
  535. x:0,
  536. y:74
  537. }]
  538. },{
  539. modelId:13,
  540. elements:[{
  541. position:1,
  542. width:100,
  543. height:(restHeight)*0.5*0.9,
  544. x:0,
  545. y:(restHeight*0.5-restHeight*0.5*0.9)/2
  546. },
  547. {
  548. position:2,
  549. width:100,
  550. height:(restHeight)*0.5*0.9,
  551. x:0,
  552. y:(restHeight)*0.5
  553. }]
  554. },
  555. {
  556. modelId: 14,
  557. elements: [{
  558. position: 1,
  559. width: 100*0.4,
  560. height: (restHeight)*0.65*0.84,
  561. x: 0,
  562. y: ((restHeight)*0.5-(restHeight)*0.5*0.84)/2
  563. }, {
  564. position: 2,
  565. width: 100*0.4,
  566. height: (restHeight)*0.35*0.84,
  567. x: 0,
  568. y: 52/* +((restHeight)*0.5-(restHeight)*0.5*0.84)/2 */,//or 50
  569. }, {
  570. position: 3,
  571. width: 100*0.6,
  572. height: (restHeight)*0.9,
  573. x: 40,
  574. y: ((restHeight)-(restHeight)*0.9)/2
  575. }]
  576. },
  577. ]
  578. //ppt母版
  579. export const pptSlideMaster = {
  580. title: "幻灯片母版",
  581. objects: [
  582. {
  583. /* placeholder: {
  584. options: {
  585. name: "slideTitle",
  586. type: "title",
  587. x: "10%",
  588. y: "5%",
  589. w: "68%",
  590. h: titleHeight + "%",
  591. color: "333333",
  592. align:'left',
  593. valign:'middle',
  594. fontSize:24*0.75,
  595. },
  596. }, */
  597. },
  598. {
  599. image: {
  600. x: 0,
  601. y: 0,
  602. w: 10,
  603. h: 7,
  604. path: "/static/pptnextimg.png", //会发送http请求,static or 线上地址
  605. },
  606. },
  607. ],
  608. slideNumber:{x:"95%",y:"94%",fontSize:12}
  609. }
  610. //ppt母版英文
  611. export const pptSlideMasterEn = {
  612. title: "幻灯片母版",
  613. objects: [
  614. {
  615. },
  616. {
  617. image: {
  618. x: 0,
  619. y: 0,
  620. w: 10,
  621. h: 7,
  622. path: "/static/ppt_en_bg.png",
  623. },
  624. },
  625. ],
  626. slideNumber:{x:"95%",y:"94%",fontSize:12}
  627. }
  628. //ppt宽高比
  629. export const pptLayout = { name: "myppt", width: 10, height: 7 }
  630. //ppt封面图
  631. export const pptCover = [
  632. require('@/assets/img/ppt_m/bg3.jpg'),
  633. require('@/assets/img/ppt_m/bg4.jpg'),
  634. require('@/assets/img/ppt_m/bg5.jpg'),
  635. ]
  636. //ppt封面图英文
  637. export const pptCoverEn = [
  638. require('@/assets/img/ppt_m/bg_en1.png'),
  639. require('@/assets/img/ppt_m/bg_en2.png'),
  640. require('@/assets/img/ppt_m/bg_en3.png'),
  641. ]
  642. //ppt-item的base宽高:默认比例是10:7,单位px;也是编辑页ppt-item的固定宽高
  643. export const pptBaseSize = {width:906,height:906*0.7}
  644. //ppt列表操作项
  645. export const toolList = [
  646. // {
  647. // label:'撤销',
  648. // key:'cancel'
  649. // },
  650. {
  651. label:'提交',
  652. key:'submit'
  653. },
  654. {
  655. label:'预览发布',
  656. key:'publish'
  657. },
  658. {
  659. label:'演示',
  660. key:'present'
  661. },
  662. {
  663. label:'下载',
  664. key:'download'
  665. },
  666. // {
  667. // label:'',
  668. // key:'transform'
  669. // },
  670. // {
  671. // label:'转英文PPT',
  672. // key:'transEn'
  673. // },
  674. {
  675. label:'编辑',
  676. key:'edit'
  677. },
  678. // {
  679. // label:'复制',
  680. // key:'copy'
  681. // },
  682. {
  683. label:'删除',
  684. key:'delete'
  685. }
  686. ]
  687. //图层元素预览信息
  688. export const layerElments = [
  689. {
  690. type:'line',
  691. name:"直线",
  692. path:'M 0 0 L 200 200 z',
  693. viewBox:[200,200]
  694. },
  695. {
  696. type:'line',
  697. name:"箭头",
  698. path:'M 0 0 L 200 200 z',
  699. viewBox:[200,200],
  700. points:['','arrow'],
  701. lineType:'arrow'
  702. },
  703. {
  704. type:'shape',
  705. name:'矩形',
  706. shapeType:'Rect',
  707. path:'M 0 0 L 200 0 L 200 200 L 0 200 Z',
  708. viewBox:[200,200]
  709. },{
  710. type:'text',
  711. name:'文本',
  712. path:'M 0 50 L 200 50 M 100 50 L 100 180 ',
  713. viewBox:[200,200]
  714. },
  715. {
  716. type:'shape',
  717. name:'圆形',
  718. shapeType:'Circle',
  719. path:'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z',
  720. viewBox:[200,200]
  721. }
  722. ]
  723. //图层元素编辑配置
  724. export const layerEditOptions = {
  725. stokeSize:[1,2,3,4,5],//边框粗细
  726. stokeStyle:'solid',//边框样式:实线solid,虚线:dashed
  727. colorsOptions:['#333','#5B9BD5','#f00','#fff','#00f','#000','#00FFFF','#70DB93','#9F5F9F','#A67D3D','#5F9F9F'],
  728. strokeColor:'black',
  729. fillColor:'transparent'
  730. }
  731. //图层元素resize时,操作的按钮
  732. //8个方向:左上,左,左下;上,下,右上,右,右下
  733. export const layerElOperate = ['LEFT_TOP','TOP','RIGHT_TOP','LEFT','RIGHT','LEFT_BOTTOM','BOTTOM','RIGHT_BOTTOM']
  734. //图层元素预设值
  735. //矩形
  736. export const BaseRectShape = {
  737. id:'xvSIDSN',//图层元素id
  738. type:'shape',//图层类型
  739. shapeType:'Rect',//用于指定组件名
  740. left:0,top:0,//位置信息,单位px
  741. width:100,height:100,//大小信息,单位px
  742. percentageLeft:0,percentageTop:0,percentageWidth:0,percentageHeight:0,//百分比化的位置信息和大小信息
  743. realWidth:100,realHeight:100,//元素在dom内的真实宽高,单位px;在ppt-item宽不为pptBaseSize.width的时候与width,height不相等
  744. fill:'rgba(255, 255, 255, 0)',//填充颜色
  745. opacity:1,//元素整体的透明度
  746. path:'M 0 0 L 200 0 L 200 200 L 0 200 Z',//矩形的svg路径
  747. viewBox:[200,200],//视口,对应path,求比例用的
  748. outline:{//边框信息:对应rect的stroke属性
  749. style:'solid',//实线solid虚线dashed
  750. width:3,//边框的宽度
  751. color:'rgba(75, 75, 75, 1)',//边框颜色,也支持透明度
  752. }
  753. }
  754. //圆 除了path跟rect的不一样,其他都一样
  755. export const BaseCircleShape = {
  756. id:'abUOPic',
  757. type:'shape',
  758. shapeType:'Circle',
  759. left:0,top:0,
  760. width:100,height:100,
  761. percentageLeft:0,percentageTop:0,percentageWidth:0,percentageHeight:0,
  762. realWidth:100,realHeight:100,
  763. fill:'rgba(255, 255, 255, 0)',
  764. opacity:1,
  765. path:'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z',//圆形的svg路径
  766. viewBox:[200,200],
  767. outline:{
  768. style:'solid',
  769. width:3,
  770. color:'rgba(75, 75, 75, 1)'
  771. }
  772. }
  773. //直线
  774. export const BaseLineShape = {
  775. id:'AxsdUE',
  776. type:'line',
  777. left:0,top:0,width:100,height:100,
  778. start:[0,0],//线条起点位置,对应line的x1,y1
  779. end:[100,100],//线条的终点位置,对应line的x2,y2
  780. viewBox:[200,200],
  781. color:'rgba(75, 75, 75, 1)',//线条颜色
  782. points:['',''],//线条的端点样式:([起点样式, 终点样式];'':无;'arrow':箭头
  783. style:'solid',//线条样式:实现虚线
  784. strokeWidth:3,//线条的粗细
  785. fill:'transparent',//填充颜色:线条所占区域是一个矩形,一般是透明色
  786. }
  787. //文本框
  788. export const BaseTextShape = {
  789. id:'eRxFirB',
  790. type:'text',
  791. left:0,top:0,width:200,height:100,
  792. fontSize:12,
  793. content:'请输入内容',
  794. richContent:''
  795. }
  796. //默认情况下,版式内部位置对应的组件元素
  797. //用于版式渲染,版式内切换元素位置
  798. export const defaultPosition = {
  799. 1:{//modelId
  800. 1:{type:'chart'},//position
  801. },
  802. 2:{
  803. 1:{type:'chart'},
  804. 2:{type:'text'}
  805. },
  806. 3:{
  807. 1:{type:'chart'},
  808. 2:{type:'chart'},
  809. 3:{type:'text'}
  810. },
  811. 4:{
  812. 1:{type:'chart'},
  813. 2:{type:'chart'},
  814. 3:{type:'chart'},
  815. 4:{type:'text'}
  816. },
  817. 5:{
  818. 1:{type:'chart'},
  819. 2:{type:'chart'},
  820. 3:{type:'chart'},
  821. 4:{type:'chart'}
  822. },
  823. 6:{
  824. 1:{type:'text'},
  825. },
  826. 7:{
  827. 1:{type:'chart'},
  828. 2:{type:'chart'}
  829. },
  830. 8:{
  831. 1:{type:'chart'},
  832. 2:{type:'text'}
  833. },
  834. 9:{
  835. 1:{type:'chart'},
  836. 2:{type:'chart'},
  837. 3:{type:'text'}
  838. },
  839. 12:{
  840. 1:{type:'chart'},
  841. 2:{type:'chart'},
  842. 3:{type:'chart'},
  843. 4:{type:'chart'},
  844. 5:{type:'chart'},
  845. 6:{type:'chart'},
  846. },
  847. 11:{
  848. 1:{type:'chart'},
  849. 2:{type:'chart'},
  850. 3:{type:'chart'},
  851. 4:{type:'chart'},
  852. 5:{type:'text'},
  853. },
  854. 10:{
  855. 1:{type:'chart'},
  856. 2:{type:'chart'},
  857. 3:{type:'chart'},
  858. 4:{type:'chart'},
  859. 5:{type:'chart'},
  860. 6:{type:'chart'},
  861. 7:{type:'text'}
  862. },
  863. 13:{
  864. 1:{type:'chart'},
  865. 2:{type:'chart'}
  866. },
  867. 14:{
  868. 1:{type:'chart'},
  869. 2:{type:'text'},
  870. 3:{type:'text'}
  871. },
  872. }
  873. //画笔工具栏
  874. export const boardTool = [
  875. {
  876. iconName:'brush',
  877. hintName:'画笔',
  878. },
  879. {
  880. iconName:'palette',
  881. hintName:'颜色',
  882. },
  883. {
  884. iconName:'eraser',
  885. hintName:'橡皮',
  886. },
  887. {
  888. iconName:'broom',
  889. hintName:'擦除',
  890. }
  891. ]
  892. //画笔工具栏-颜色选择
  893. export const colorList = [
  894. '#FFFFFF',
  895. '#000000',
  896. '#FF0000',
  897. '#FDB863',
  898. '#FFF849',
  899. '#8CD67A',
  900. '#409EFF',
  901. '#9D42D6'
  902. ]