defaults.ts 44 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012
  1. import { Pen, FormItem } from '@meta2d/core';
  2. import { cdn } from './api';
  3. export const lineDashObj = [
  4. undefined,
  5. [5, 5],
  6. [10, 10],
  7. [10, 10, 2, 10],
  8. [1, 16],
  9. ];
  10. /**
  11. * 默认动画
  12. */
  13. export const normalAnimate: any = {
  14. upDown: [
  15. {
  16. y: -10,
  17. duration: 100,
  18. },
  19. { y: 0, duration: 100 },
  20. { y: -10, duration: 200 },
  21. ],
  22. leftRight: [
  23. {
  24. x: -10,
  25. duration: 100,
  26. },
  27. {
  28. x: 10,
  29. duration: 80,
  30. },
  31. {
  32. x: -10,
  33. duration: 50,
  34. },
  35. {
  36. x: 10,
  37. duration: 30,
  38. },
  39. {
  40. x: 0,
  41. duration: 300,
  42. },
  43. ],
  44. heart: [
  45. {
  46. // 通过 scale 来替代原版心跳
  47. scale: 1.1,
  48. duration: 100,
  49. },
  50. {
  51. scale: 1,
  52. duration: 400,
  53. },
  54. ],
  55. success: [{ background: '#389e0d22', color: '#237804', duration: 500 }],
  56. warning: [
  57. {
  58. color: '#fa8c16',
  59. lineDash: [10, 10],
  60. duration: 300,
  61. },
  62. {
  63. color: '#fa8c16',
  64. lineDash: undefined,
  65. duration: 500,
  66. },
  67. {
  68. color: '#fa8c16',
  69. lineDash: [10, 10],
  70. duration: 300,
  71. },
  72. ],
  73. error: [{ color: '#cf1322', background: '#cf132222', duration: 100 }],
  74. show: [
  75. {
  76. color: '#fa541c',
  77. rotate: -10,
  78. duration: 100,
  79. },
  80. {
  81. color: '#fa541c',
  82. rotate: 10,
  83. duration: 100,
  84. },
  85. {
  86. color: '#fa541c',
  87. rotate: 0,
  88. duration: 100,
  89. },
  90. ],
  91. rotate: [
  92. {
  93. rotate: 360,
  94. duration: 1000,
  95. },
  96. ],
  97. };
  98. export const defaultFormat: Pen = {
  99. borderRadius: 0,
  100. rotate: 0,
  101. paddingLeft: 0,
  102. paddingRight: 0,
  103. paddingTop: 0,
  104. paddingBottom: 0,
  105. progress: 0,
  106. progressColor: '#fff0',
  107. verticalProgress: false,
  108. flipX: false,
  109. flipY: false,
  110. input: false,
  111. lineDash: [],
  112. lineCap: 'round',
  113. lineJoin: 'round',
  114. strokeType: 0,
  115. lineGradientFromColor: undefined,
  116. lineGradientToColor: undefined,
  117. lineGradientAngle: 0,
  118. // color: "#222",
  119. hoverColor: undefined,
  120. activeColor: undefined,
  121. lineWidth: 0,
  122. bkType: 0,
  123. gradientFromColor: undefined,
  124. gradientToColor: undefined,
  125. gradientAngle: 0,
  126. gradientRadius: 0,
  127. hoverBackground: undefined,
  128. activeBackground: undefined,
  129. globalAlpha: 1,
  130. anchorColor: undefined,
  131. anchorRadius: 0,
  132. shadowColor: undefined,
  133. shadowBlur: 0,
  134. shadowOffsetX: 0,
  135. shadowOffsetY: 0,
  136. textHasShadow: undefined,
  137. fontFamily: undefined,
  138. fontSize: 0,
  139. textColor: undefined,
  140. hoverTextColor: undefined,
  141. activeTextColor: undefined,
  142. textBackground: undefined,
  143. fontStyle: undefined,
  144. fontWeight: undefined,
  145. textAlign: undefined,
  146. textBaseline: undefined,
  147. lineHeight: 0,
  148. whiteSpace: undefined,
  149. textWidth: 0,
  150. textHeight: 0,
  151. textLeft: 0,
  152. textTop: 0,
  153. ellipsis: false,
  154. hiddenText: false,
  155. keepDecimal: 0,
  156. borderWidth: 0,
  157. borderColor: undefined,
  158. animateLineWidth: 0,
  159. lineAnimateType: 0,
  160. frames: [],
  161. animateColor: undefined,
  162. // animateType: undefined,
  163. animateReverse: false,
  164. background: '#fff0',
  165. gradientColors: undefined,
  166. lineGradientColors: undefined,
  167. gradientSmooth: 0,
  168. };
  169. export interface FormItemType extends FormItem {
  170. key: string; // 属性标识,绑定变量时使用
  171. key2?: string; // 有些属性存在嵌套
  172. name: string; // 标题
  173. tips?: string; // 提示
  174. placeholder?: string; // input placeholder
  175. type:
  176. | 'text' // string 类型输入框
  177. | 'number'
  178. | 'color'
  179. | 'textarea'
  180. | 'select'
  181. | 'switch'
  182. | 'code'
  183. | 'image'
  184. | 'icon'
  185. | 'slider'
  186. | 'autoComplete'
  187. | 'label'; // 文字,不含输入框;
  188. options?: {
  189. // 选项
  190. label: string; // 选项的标题,可以使用 html
  191. value: any; // 选项的值
  192. disabled?: boolean;
  193. }[];
  194. min?: number; // 最小值
  195. max?: number; // 最大值
  196. step?: number; // 步长
  197. rows?: number; // textarea 所需要的行数
  198. iconFamily?: string; // icon 类型节点需要
  199. title?: string; // code 类型编辑器需要
  200. language?: 'javascript' | 'json' | 'markdown'; // code 编辑器需要
  201. readonly?: boolean; // 是否只读
  202. mode?: 'multiple' | 'tags'; // select 选项
  203. isNotString?: boolean; // monaco 需要 string 类型的 code ,不是 string 协助转换
  204. multiple?: boolean; // 绑定多个属性
  205. isTime?: boolean; // 是否是时序的, undefined 不会出现 历史趋势 的 checkbox
  206. isYCategory?: boolean; // y 轴是否是分类,true y 轴分类,false x 轴分类,undefined 不会出现 y轴分类轴 的 checkbox
  207. // 绑定单个属性是对象, 多个数组
  208. // dataIds?: BindId | BindId[]; // 关联业务数据
  209. precision?: number; //精度
  210. gradient?: boolean; //是否为渐变色
  211. hidden?: boolean; //是否隐藏
  212. }
  213. export const shapes = [
  214. {
  215. name: '基本形状',
  216. show: true,
  217. list: [
  218. {
  219. name: '正方形',
  220. icon: 'l-rect',
  221. id: 1,
  222. data: {
  223. width: 100,
  224. height: 100,
  225. name: 'square',
  226. },
  227. },
  228. {
  229. name: '矩形',
  230. icon: 'l-rectangle',
  231. id: 2,
  232. data: {
  233. width: 200,
  234. height: 50,
  235. borderRadius: 0.1,
  236. name: 'rectangle',
  237. },
  238. },
  239. {
  240. name: '圆',
  241. icon: 'l-circle',
  242. id: 3,
  243. data: {
  244. width: 100,
  245. height: 100,
  246. name: 'circle',
  247. },
  248. },
  249. {
  250. name: '三角形',
  251. icon: 'l-triangle',
  252. id: 4,
  253. data: {
  254. width: 100,
  255. height: 100,
  256. name: 'triangle',
  257. },
  258. },
  259. {
  260. name: '菱形',
  261. icon: 'l-diamond',
  262. id: 5,
  263. data: {
  264. width: 100,
  265. height: 100,
  266. name: 'diamond',
  267. },
  268. },
  269. {
  270. name: '五边形',
  271. icon: 'l-pentagon',
  272. id: 6,
  273. data: {
  274. width: 100,
  275. height: 100,
  276. name: 'pentagon',
  277. },
  278. },
  279. {
  280. name: '六边形',
  281. icon: 'l-hexagon',
  282. id: 7,
  283. data: {
  284. width: 100,
  285. height: 100,
  286. name: 'hexagon',
  287. },
  288. },
  289. {
  290. name: '五角星',
  291. icon: 'l-pentagram',
  292. id: 8,
  293. data: {
  294. width: 100,
  295. height: 100,
  296. name: 'pentagram',
  297. },
  298. },
  299. {
  300. name: '左箭头',
  301. icon: 'l-arrow-left',
  302. id: 9,
  303. data: {
  304. width: 120,
  305. height: 60,
  306. name: 'leftArrow',
  307. },
  308. },
  309. {
  310. name: '右箭头',
  311. icon: 'l-arrow-right',
  312. id: 10,
  313. data: {
  314. width: 120,
  315. height: 60,
  316. name: 'rightArrow',
  317. },
  318. },
  319. {
  320. name: '双向箭头',
  321. icon: 'l-twoway-arrow',
  322. id: 11,
  323. data: {
  324. width: 150,
  325. height: 60,
  326. name: 'twowayArrow',
  327. },
  328. },
  329. {
  330. name: '云',
  331. icon: 'l-cloud',
  332. id: 13,
  333. data: {
  334. width: 100,
  335. height: 100,
  336. name: 'cloud',
  337. },
  338. },
  339. {
  340. name: '消息框',
  341. icon: 'l-msg',
  342. id: 14,
  343. data: {
  344. textTop: -0.1,
  345. width: 100,
  346. height: 100,
  347. name: 'message',
  348. },
  349. },
  350. {
  351. name: '文件',
  352. icon: 'l-file',
  353. id: 15,
  354. data: {
  355. width: 80,
  356. height: 100,
  357. name: 'file',
  358. },
  359. },
  360. {
  361. name: '立方体',
  362. icon: 'l-cube',
  363. id: 18,
  364. data: {
  365. width: 60,
  366. height: 100,
  367. name: 'cube',
  368. z: 0.25,
  369. props: {
  370. custom: [
  371. {
  372. key: 'z',
  373. label: 'Z',
  374. type: 'number',
  375. min: 0,
  376. placeholder: '<= 1 即宽度的比例',
  377. },
  378. {
  379. key: 'backgroundFront',
  380. label: '前背景色',
  381. type: 'color',
  382. },
  383. {
  384. key: 'backgroundUp',
  385. label: '顶背景色',
  386. type: 'color',
  387. },
  388. {
  389. key: 'backgroundRight',
  390. label: '右背景色',
  391. type: 'color',
  392. },
  393. ],
  394. },
  395. },
  396. },
  397. {
  398. name: '人',
  399. icon: 'l-people',
  400. id: 19,
  401. data: {
  402. width: 70,
  403. height: 100,
  404. name: 'people',
  405. },
  406. },
  407. ],
  408. },
  409. {
  410. name: '脑图',
  411. show: true,
  412. list: [
  413. {
  414. name: '主题',
  415. icon: 'l-zhuti',
  416. data: {
  417. text: '主题',
  418. width: 200,
  419. height: 50,
  420. name: 'mindNode',
  421. borderRadius: 0.5,
  422. },
  423. },
  424. {
  425. name: '子主题',
  426. icon: 'l-zizhuti',
  427. data: {
  428. text: '子主题',
  429. width: 160,
  430. height: 40,
  431. name: 'mindLine',
  432. },
  433. },
  434. ],
  435. },
  436. {
  437. name: '流程图',
  438. show: true,
  439. list: [
  440. {
  441. name: '开始/结束',
  442. icon: 'l-flow-start',
  443. id: 21,
  444. data: {
  445. text: '开始/结束',
  446. width: 120,
  447. height: 40,
  448. borderRadius: 0.5,
  449. name: 'rectangle',
  450. },
  451. },
  452. {
  453. name: '流程',
  454. icon: 'l-rectangle',
  455. id: 22,
  456. data: {
  457. text: '流程',
  458. width: 120,
  459. height: 40,
  460. name: 'rectangle',
  461. },
  462. },
  463. {
  464. name: '判定',
  465. icon: 'l-diamond',
  466. id: 23,
  467. data: {
  468. text: '判定',
  469. width: 120,
  470. height: 60,
  471. name: 'diamond',
  472. },
  473. },
  474. {
  475. name: '数据',
  476. icon: 'l-flow-data',
  477. id: 24,
  478. data: {
  479. text: '数据',
  480. width: 120,
  481. height: 50,
  482. name: 'flowData',
  483. offsetX: 0.14,
  484. form: [
  485. {
  486. key: 'offsetX',
  487. name: '斜率',
  488. type: 'number',
  489. min: 0,
  490. step: 0.1,
  491. placeholder: '<= 1 即宽度的比例',
  492. },
  493. ] as FormItemType[],
  494. },
  495. },
  496. {
  497. name: '准备',
  498. icon: 'l-flow-ready',
  499. id: 25,
  500. data: {
  501. text: '准备',
  502. width: 120,
  503. height: 50,
  504. name: 'hexagon',
  505. },
  506. },
  507. {
  508. name: '子流程',
  509. icon: 'l-flow-subprocess',
  510. id: 26,
  511. data: {
  512. text: '子流程',
  513. width: 120,
  514. height: 50,
  515. name: 'flowSubprocess',
  516. },
  517. },
  518. {
  519. name: '数据库',
  520. icon: 'l-db',
  521. id: 27,
  522. data: {
  523. text: '数据库',
  524. width: 80,
  525. height: 120,
  526. name: 'flowDb',
  527. },
  528. },
  529. {
  530. name: '文档',
  531. icon: 'l-flow-document',
  532. id: 28,
  533. data: {
  534. text: '文档',
  535. width: 120,
  536. height: 100,
  537. name: 'flowDocument',
  538. },
  539. },
  540. {
  541. name: '内部存储',
  542. icon: 'l-internal-storage',
  543. id: 29,
  544. data: {
  545. text: '内部存储',
  546. width: 120,
  547. height: 80,
  548. name: 'flowInternalStorage',
  549. },
  550. },
  551. {
  552. name: '外部存储',
  553. icon: 'l-extern-storage',
  554. id: 30,
  555. data: {
  556. text: '外部存储',
  557. width: 120,
  558. height: 80,
  559. name: 'flowExternStorage',
  560. },
  561. },
  562. {
  563. name: '队列',
  564. icon: 'l-flow-queue',
  565. id: 31,
  566. data: {
  567. text: '队列',
  568. width: 100,
  569. height: 100,
  570. name: 'flowQueue',
  571. },
  572. },
  573. {
  574. name: '手动输入',
  575. icon: 'l-flow-manually',
  576. id: 32,
  577. data: {
  578. text: '手动输入',
  579. width: 120,
  580. height: 80,
  581. name: 'flowManually',
  582. },
  583. },
  584. {
  585. name: '展示',
  586. icon: 'l-flow-display',
  587. id: 33,
  588. data: {
  589. text: '展示',
  590. width: 120,
  591. height: 80,
  592. name: 'flowDisplay',
  593. },
  594. },
  595. {
  596. name: '并行模式',
  597. icon: 'l-flow-parallel',
  598. id: 34,
  599. data: {
  600. text: '并行模式',
  601. width: 120,
  602. height: 50,
  603. name: 'flowParallel',
  604. },
  605. },
  606. {
  607. name: '注释',
  608. icon: 'l-flow-comment',
  609. id: 35,
  610. data: {
  611. text: '注释',
  612. width: 100,
  613. height: 100,
  614. name: 'flowComment',
  615. },
  616. },
  617. ],
  618. },
  619. {
  620. name: '活动图',
  621. show: true,
  622. list: [
  623. {
  624. name: '开始',
  625. icon: 'l-inital',
  626. id: 36,
  627. data: {
  628. text: '',
  629. width: 30,
  630. height: 30,
  631. name: 'circle',
  632. background: '#555',
  633. lineWidth: 0,
  634. },
  635. },
  636. {
  637. name: '结束',
  638. icon: 'l-final',
  639. id: 37,
  640. data: {
  641. width: 30,
  642. height: 30,
  643. name: 'activityFinal',
  644. },
  645. },
  646. {
  647. name: '活动',
  648. icon: 'l-action',
  649. id: 38,
  650. data: {
  651. text: '活动',
  652. width: 120,
  653. height: 50,
  654. borderRadius: 0.25,
  655. name: 'rectangle',
  656. },
  657. },
  658. {
  659. name: '决策/合并',
  660. icon: 'l-diamond',
  661. id: 39,
  662. data: {
  663. text: '决策/合并',
  664. width: 120,
  665. height: 50,
  666. name: 'diamond',
  667. },
  668. },
  669. {
  670. name: '垂直泳道',
  671. icon: 'l-swimlane-v',
  672. id: 40,
  673. data: {
  674. text: '垂直泳道',
  675. width: 200,
  676. height: 500,
  677. name: 'swimlaneV',
  678. textBaseline: 'top',
  679. textTop: 20,
  680. // textHeight: ,
  681. lineTop: 0.08,
  682. },
  683. },
  684. {
  685. name: '水平泳道',
  686. icon: 'l-swimlane-h',
  687. id: 41,
  688. data: {
  689. text: '水平泳道',
  690. width: 500,
  691. height: 200,
  692. name: 'swimlaneH',
  693. textWidth: 0.01,
  694. textLeft: 0.04,
  695. textAlign: 'left',
  696. lineLeft: 0.08,
  697. },
  698. },
  699. {
  700. name: '垂直分岔/汇合',
  701. icon: 'l-fork-v',
  702. id: 42,
  703. data: {
  704. text: '垂直分岔/汇合',
  705. width: 10,
  706. height: 150,
  707. name: 'forkV',
  708. fillStyle: '#555',
  709. strokeStyle: 'transparent',
  710. },
  711. },
  712. {
  713. name: '水平分岔/汇合',
  714. icon: 'l-fork',
  715. id: 43,
  716. data: {
  717. text: '水平分岔/汇合',
  718. width: 150,
  719. height: 10,
  720. name: 'forkH',
  721. fillStyle: '#555',
  722. strokeStyle: 'transparent',
  723. },
  724. },
  725. ],
  726. },
  727. {
  728. name: '时序图和类图',
  729. show: true,
  730. list: [
  731. {
  732. name: '生命线',
  733. icon: 'l-lifeline',
  734. id: 44,
  735. data: {
  736. text: '生命线',
  737. width: 150,
  738. height: 400,
  739. textHeight: 50,
  740. name: 'lifeline',
  741. },
  742. },
  743. {
  744. name: '激活',
  745. icon: 'l-focus',
  746. id: 45,
  747. data: {
  748. text: '激活',
  749. width: 12,
  750. height: 200,
  751. name: 'sequenceFocus',
  752. },
  753. },
  754. {
  755. name: '简单类',
  756. icon: 'l-simple-class',
  757. id: 46,
  758. data: {
  759. text: 'Topolgoy',
  760. width: 270,
  761. height: 200,
  762. textHeight: 200,
  763. name: 'simpleClass',
  764. textAlign: 'center',
  765. textBaseline: 'top',
  766. textTop: 10,
  767. list: [
  768. {
  769. text: '- name: string\n+ setName(name: string): void',
  770. },
  771. ],
  772. },
  773. },
  774. {
  775. name: '类',
  776. icon: 'l-class',
  777. id: 47,
  778. data: {
  779. text: 'Topolgoy',
  780. width: 270,
  781. height: 200,
  782. textHeight: 200,
  783. name: 'interfaceClass',
  784. textAlign: 'center',
  785. textBaseline: 'top',
  786. textTop: 10,
  787. list: [
  788. {
  789. text: '- name: string',
  790. },
  791. {
  792. text: '+ setName(name: string): void',
  793. },
  794. ],
  795. },
  796. },
  797. ],
  798. },
  799. {
  800. name: '故障树',
  801. show: true,
  802. list: [
  803. {
  804. name: '与门',
  805. icon: 'l-ANDmen',
  806. data: {
  807. name: 'andGate',
  808. width: 100,
  809. height: 150,
  810. },
  811. },
  812. {
  813. name: '基本事件',
  814. icon: 'l-jibenshijian',
  815. data: {
  816. name: 'basicEvent',
  817. width: 100,
  818. height: 150,
  819. },
  820. },
  821. {
  822. name: '未展开事件',
  823. icon: 'l-weizhankaishijian',
  824. data: {
  825. name: 'unexpandedEvent',
  826. width: 100,
  827. height: 150,
  828. },
  829. },
  830. {
  831. name: '优先AND门',
  832. icon: 'l-youxianANDmen',
  833. data: {
  834. name: 'priorityAndGate',
  835. width: 100,
  836. height: 150,
  837. },
  838. },
  839. {
  840. name: '禁止门',
  841. icon: 'l-jinzhimen',
  842. data: {
  843. name: 'forbiddenGate',
  844. width: 100,
  845. height: 150,
  846. },
  847. },
  848. {
  849. name: '事件',
  850. icon: 'l-shijian',
  851. data: {
  852. name: 'event',
  853. width: 100,
  854. height: 150,
  855. },
  856. },
  857. {
  858. name: '开关事件',
  859. icon: 'l-kaiguanshijian',
  860. data: {
  861. name: 'switchEvent',
  862. width: 100,
  863. height: 150,
  864. },
  865. },
  866. {
  867. name: '条件事件',
  868. icon: 'l-tiaojianshijian',
  869. data: {
  870. name: 'conditionalEvent',
  871. width: 150,
  872. height: 100,
  873. },
  874. },
  875. {
  876. name: '转移符号',
  877. icon: 'l-zhuanyifuhao',
  878. data: {
  879. name: 'transferSymbol',
  880. width: 100,
  881. height: 150,
  882. },
  883. },
  884. {
  885. name: '或门',
  886. icon: 'l-ORmen',
  887. data: {
  888. name: 'orGate',
  889. width: 100,
  890. height: 150,
  891. },
  892. },
  893. {
  894. name: '异或门',
  895. icon: 'l-yihuomen',
  896. data: {
  897. name: 'xorGate',
  898. width: 100,
  899. height: 150,
  900. },
  901. },
  902. {
  903. name: '表决门',
  904. icon: 'l-biaojuemen',
  905. data: {
  906. name: 'votingGate',
  907. width: 100,
  908. height: 150,
  909. },
  910. },
  911. ],
  912. },
  913. ];
  914. export const formComponents = [
  915. {
  916. name: '基础',
  917. show: true,
  918. list: [
  919. {
  920. name: '文本',
  921. icon: 'l-text',
  922. data: {
  923. width: 160,
  924. height: 30,
  925. name: 'text',
  926. text: 'le5le-meta2d',
  927. },
  928. },
  929. {
  930. name: '数字',
  931. icon: 'l-text',
  932. data: {
  933. width: 160,
  934. height: 30,
  935. name: 'text',
  936. text: '3.1415926',
  937. keepDecimal: 2,
  938. },
  939. },
  940. {
  941. name: '进度条',
  942. icon: 'l-jindutiao',
  943. data: {
  944. anchors: [],
  945. disableAnchor: true,
  946. name: 'slider',
  947. width: 300,
  948. height: 20,
  949. value: 10,
  950. textWidth: 50,
  951. barHeight: 4,
  952. min: 0,
  953. max: 100,
  954. color: '#1890ff',
  955. background: '#D4D6D9',
  956. textColor: '#222222',
  957. unit: '%',
  958. },
  959. },
  960. {
  961. name: '图标',
  962. icon: 'l-tubiao',
  963. data: {
  964. width: 100,
  965. height: 100,
  966. name: 'image',
  967. icon: '\uea35',
  968. iconFamily: 'l-icon',
  969. },
  970. },
  971. {
  972. name: '图片',
  973. icon: 'l-image',
  974. data: {
  975. width: 100,
  976. height: 100,
  977. name: 'image',
  978. image: cdn + '/img/logo.png',
  979. },
  980. },
  981. {
  982. name: 'GIF',
  983. icon: 'l-image',
  984. data: {
  985. width: 100,
  986. height: 100,
  987. name: 'gif',
  988. image: cdn + '/png/电信机房/防火墙.gif',
  989. },
  990. },
  991. {
  992. name: '视频',
  993. icon: 'l-pc',
  994. data: {
  995. width: 200,
  996. height: 200,
  997. externElement: true,
  998. name: 'video',
  999. video:
  1000. 'https://video.699pic.com/videos/17/69/11/a_aa3jeKZ0D63g1556176911_10s.mp4',
  1001. },
  1002. },
  1003. {
  1004. name: '音频',
  1005. icon: 'l-pc',
  1006. data: {
  1007. width: 200,
  1008. height: 200,
  1009. externElement: true,
  1010. name: 'video',
  1011. audio: 'https://www.xzmp3.com/down/597caee79849.mp3',
  1012. },
  1013. },
  1014. {
  1015. name: '头像',
  1016. icon: 'l-pc',
  1017. data: {
  1018. width: 30,
  1019. height: 30,
  1020. disableAnchor: true,
  1021. name: 'square',
  1022. lineWidth: 0,
  1023. image: '/img/avatar.png',
  1024. imageRadius: 0.5,
  1025. background: '#689f38',
  1026. borderRadius: 0.5,
  1027. ratio: true,
  1028. },
  1029. },
  1030. {
  1031. name: '徽标',
  1032. icon: 'l-pc',
  1033. data: {
  1034. width: 35,
  1035. height: 20,
  1036. name: 'square',
  1037. borderRadius: 0.5,
  1038. lineWidth: 0,
  1039. background: '#d54941',
  1040. color: '#fff',
  1041. text: '99+',
  1042. },
  1043. },
  1044. {
  1045. name: '标签',
  1046. icon: 'l-pc',
  1047. data: {
  1048. text: 'success',
  1049. width: 80,
  1050. height: 24,
  1051. borderRadius: 0.1,
  1052. name: 'rectangle',
  1053. lineWidth: 1,
  1054. fontSize: 12,
  1055. icon: '\uea10',
  1056. iconFamily: 'l-icon',
  1057. iconColor: '#52c41a',
  1058. iconSize: 12,
  1059. iconAlign: 'left',
  1060. iconLeft: 8,
  1061. textAlign: 'right',
  1062. color: '#52c41a',
  1063. background: '#f6ffed',
  1064. textLeft: -6,
  1065. },
  1066. },
  1067. ],
  1068. },
  1069. {
  1070. name: '时间',
  1071. show: true,
  1072. list: [
  1073. {
  1074. name: '时间',
  1075. icon: 'l-shijianxuanzekuang',
  1076. data: {
  1077. name: 'leTime',
  1078. width: 300,
  1079. height: 40,
  1080. text: '当前时间',
  1081. timeFormat:
  1082. '`${year}年${month}月${day}日 ${hours}时${minutes}分${seconds}秒 星期${week}`',
  1083. },
  1084. },
  1085. {
  1086. name: '倒计时',
  1087. icon: 'l-shijianxuanzekuang',
  1088. data: {
  1089. name: 'countdown',
  1090. width: 300,
  1091. height: 40,
  1092. text: '倒计时',
  1093. calculativeTime: '2023/9/23 00:00:00', //配置未来的时间
  1094. timeFormat:
  1095. '`距离杭州亚运会还有:${day}天${hours}时${minutes}分${seconds}秒`',
  1096. },
  1097. },
  1098. {
  1099. name: '水平时间轴',
  1100. icon: 'l-shijianzhou',
  1101. data: {
  1102. name: 'leTimeline',
  1103. width: 500,
  1104. height: 40,
  1105. hiddenText: true,
  1106. direction: 'horizontal',
  1107. labelAlign: '', //left/right/alternate/top/bottom
  1108. mode: 'alternate', //alternate
  1109. data: [
  1110. {
  1111. label: '2022-01-01',
  1112. content: '事件一',
  1113. // path: 'M71.3,61.9v2.21L56.66,66V63.82l3.27-.43.25-1-2.39.31V60.84l2.84-.37.21-.87-3.4.44V57.85l13.08-1.73v2.2l-6.85.9-.21.88,6-.79-.15,2.85ZM58.11,66.56,69.86,65v5.63L58.11,72.19Zm2.59,3.09,6.44-.84V67.52l-6.44.85ZM62.78,63l3.87-.51.07-.95L63,62.05Z',
  1114. },
  1115. {
  1116. label: '2022-01-01',
  1117. content: '事件一',
  1118. },
  1119. {
  1120. label: '2022-02-01',
  1121. content: '事件二',
  1122. },
  1123. {
  1124. label: '2022-03-01',
  1125. content: '事件三',
  1126. },
  1127. {
  1128. label: '2022-04-01',
  1129. content: '事件四',
  1130. },
  1131. ],
  1132. text: '时间轴',
  1133. },
  1134. },
  1135. {
  1136. name: '垂直时间轴',
  1137. icon: 'l-shijianzhou',
  1138. data: {
  1139. name: 'leTimeline',
  1140. width: 40,
  1141. height: 500,
  1142. text: '时间轴',
  1143. hiddenText: true,
  1144. direction: 'vertical',
  1145. labelAlign: 'left', //left/right/alternate/top/bottom
  1146. // mode: 'alternate', //alternate
  1147. data: [
  1148. {
  1149. label: '2022-01-01',
  1150. content: '事件一',
  1151. // path: 'M71.3,61.9v2.21L56.66,66V63.82l3.27-.43.25-1-2.39.31V60.84l2.84-.37.21-.87-3.4.44V57.85l13.08-1.73v2.2l-6.85.9-.21.88,6-.79-.15,2.85ZM58.11,66.56,69.86,65v5.63L58.11,72.19Zm2.59,3.09,6.44-.84V67.52l-6.44.85ZM62.78,63l3.87-.51.07-.95L63,62.05Z',
  1152. },
  1153. {
  1154. label: '2022-01-01',
  1155. content: '事件一',
  1156. },
  1157. {
  1158. label: '2022-02-01',
  1159. content: '事件二',
  1160. },
  1161. {
  1162. label: '2022-03-01',
  1163. content: '事件三',
  1164. },
  1165. {
  1166. label: '2022-04-01',
  1167. content: '事件四',
  1168. },
  1169. ],
  1170. },
  1171. },
  1172. {
  1173. name: '日历',
  1174. icon: 'l-pc',
  1175. data: {
  1176. width: 200,
  1177. height: 200,
  1178. name: 'calendar',
  1179. },
  1180. },
  1181. ],
  1182. },
  1183. {
  1184. name: '面板',
  1185. show: true,
  1186. list: [
  1187. {
  1188. name: '列表',
  1189. icon: 'l-pc',
  1190. data: {
  1191. width: 200,
  1192. height: 200,
  1193. },
  1194. },
  1195. {
  1196. name: '表格',
  1197. icon: 'l-biaoge',
  1198. data: {
  1199. name: 'table2',
  1200. width: 0,
  1201. height: 0,
  1202. disableAnchor: true,
  1203. colWidth: 150,
  1204. rowHeight: 40,
  1205. data: [
  1206. ['设备 ID', '设备名称', '数据协议', '状态', '操作'],
  1207. ['1', '200', 'MQTT', '正在运行', {}],
  1208. ['2', '湿度传感器', 'MQTT', '正在运行', {}],
  1209. ['3', '物联网设备', 'MQTT', '正在运行', {}],
  1210. ['4', '物联网设备/智能家居/智慧城市', 'MQTT', '正在运行', {}],
  1211. ],
  1212. styles: [
  1213. {
  1214. row: 1,
  1215. col: 1,
  1216. color: '#ff0000',
  1217. background: '#ffff00',
  1218. wheres: [
  1219. //触发条件 成立后才允许配置样式
  1220. {
  1221. comparison: '<=',
  1222. value: '123',
  1223. },
  1224. ],
  1225. },
  1226. {
  1227. row: 0,
  1228. height: 60,
  1229. },
  1230. {
  1231. col: 4,
  1232. width: 200, //为该列设置额外的节点
  1233. pens: [
  1234. {
  1235. name: 'rectangle',
  1236. width: 50,
  1237. height: 20,
  1238. text: '编辑',
  1239. fontSize: 0.6,
  1240. disableAnchor: true,
  1241. activeBackground: '#40a9ff',
  1242. activeColor: '#40a9ff',
  1243. background: '#1890ff',
  1244. color: '#1890ff',
  1245. hoverBackground: '#40a9ff',
  1246. hoverColor: '#40a9ff',
  1247. textColor: '#ffffff',
  1248. hoverTextColor: '#ffffff',
  1249. activeTextColor: '#ffffff',
  1250. events: [
  1251. {
  1252. action: 5,
  1253. name: 'click',
  1254. value: 'alert("点击了编辑")',
  1255. },
  1256. ],
  1257. },
  1258. {
  1259. name: 'rectangle',
  1260. width: 80,
  1261. height: 20,
  1262. text: '实时数据',
  1263. fontSize: 0.6,
  1264. disableAnchor: true,
  1265. activeBackground: '#40a9ff',
  1266. activeColor: '#40a9ff',
  1267. background: '#1890ff',
  1268. color: '#1890ff',
  1269. hoverBackground: '#40a9ff',
  1270. hoverColor: '#40a9ff',
  1271. textColor: '#ffffff',
  1272. hoverTextColor: '#ffffff',
  1273. activeTextColor: '#ffffff',
  1274. events: [
  1275. {
  1276. action: 5,
  1277. name: 'click',
  1278. value: 'alert("点击了实时数据")',
  1279. },
  1280. ],
  1281. },
  1282. ],
  1283. },
  1284. ],
  1285. },
  1286. },
  1287. {
  1288. name: '树',
  1289. icon: 'l-pc',
  1290. data: {
  1291. width: 200,
  1292. height: 200,
  1293. },
  1294. },
  1295. {
  1296. name: '网页',
  1297. icon: 'l-02',
  1298. data: {
  1299. name: 'iframe',
  1300. width: 100,
  1301. height: 100,
  1302. externElement: true,
  1303. iframe: 'https://le5le.com',
  1304. },
  1305. },
  1306. ],
  1307. },
  1308. {
  1309. name: '提醒',
  1310. show: true,
  1311. list: [
  1312. {
  1313. name: '业务指标',
  1314. icon: 'l-pc',
  1315. data: {
  1316. width: 200,
  1317. height: 200,
  1318. },
  1319. },
  1320. {
  1321. name: '全局消息',
  1322. icon: 'l-pc',
  1323. data: {
  1324. width: 200,
  1325. height: 200,
  1326. },
  1327. },
  1328. {
  1329. name: '通知',
  1330. icon: 'l-pc',
  1331. data: {
  1332. width: 200,
  1333. height: 200,
  1334. },
  1335. },
  1336. {
  1337. name: '对话框',
  1338. icon: 'l-pc',
  1339. data: {
  1340. width: 200,
  1341. height: 200,
  1342. },
  1343. },
  1344. ],
  1345. },
  1346. {
  1347. name: '轮播',
  1348. show: true,
  1349. list: [
  1350. {
  1351. name: '水平轮播',
  1352. icon: 'l-shijianzhou',
  1353. data: {
  1354. name: 'leSwiperline',
  1355. width: 200,
  1356. height: 40,
  1357. data: ['轮播第一次数据', '轮播第二次数据', '轮播第三次数据'],
  1358. hiddenText: true,
  1359. },
  1360. },
  1361. {
  1362. name: '垂直轮播',
  1363. icon: 'l-shijianzhou',
  1364. data: {
  1365. name: 'leSwiperline',
  1366. width: 200,
  1367. height: 24,
  1368. direction: 'vertical',
  1369. lineHeight: 2,
  1370. data: ['轮播第一次数据', '轮播第二次数据', '轮播第三次数据'],
  1371. hiddenText: true,
  1372. },
  1373. },
  1374. {
  1375. name: '轮播图',
  1376. icon: 'l-pc',
  1377. data: {
  1378. name: 'leSwiper',
  1379. width: 400,
  1380. height: 300,
  1381. // swiperType: 'iframe',
  1382. // data: [
  1383. // {
  1384. // src: 'https://2d.le5le.com/preview?id=6357a9e2d44b9402de84d2e8',
  1385. // },
  1386. // {
  1387. // src: 'https://2d.le5le.com/preview?id=6357aec8d44b9402de84d2f1',
  1388. // },
  1389. // {
  1390. // src: 'https://2d.le5le.com/preview?id=641d524a8df2c654ea652d7e',
  1391. // },
  1392. // ],
  1393. data: [
  1394. {
  1395. src: 'https://2ds.le5le.com/img/banner1.bc890350.png',
  1396. },
  1397. {
  1398. src: 'https://2ds.le5le.com/img/banner2.adab6a6e.png',
  1399. },
  1400. {
  1401. src: 'https://2ds.le5le.com/img/banner3.86b53aed.png',
  1402. },
  1403. ],
  1404. hiddenText: true,
  1405. },
  1406. },
  1407. ],
  1408. },
  1409. {
  1410. name: '导航',
  1411. show: true,
  1412. list: [
  1413. {
  1414. name: '链接',
  1415. icon: 'l-pc',
  1416. data: {
  1417. width: 200,
  1418. height: 200,
  1419. },
  1420. },
  1421. {
  1422. name: '返回',
  1423. icon: 'l-pc',
  1424. data: {
  1425. width: 200,
  1426. height: 200,
  1427. },
  1428. },
  1429. {
  1430. name: '锚点',
  1431. icon: 'l-pc',
  1432. data: {
  1433. width: 200,
  1434. height: 200,
  1435. },
  1436. },
  1437. {
  1438. name: '回到顶部',
  1439. icon: 'l-pc',
  1440. data: {
  1441. width: 200,
  1442. height: 200,
  1443. },
  1444. },
  1445. {
  1446. name: '面包屑',
  1447. icon: 'l-pc',
  1448. data: {
  1449. width: 200,
  1450. height: 200,
  1451. },
  1452. },
  1453. {
  1454. name: '下拉菜单',
  1455. icon: 'l-daohangcaidan',
  1456. data: {
  1457. name: 'leHeadMenu',
  1458. width: 650,
  1459. height: 60,
  1460. externElement: true,
  1461. selectedKeys: ['1'],
  1462. activeColor: '#4E85E5',
  1463. data: [
  1464. {
  1465. key: '1',
  1466. icon: 't-icon t-align-top',
  1467. title: '平台中心',
  1468. children: [
  1469. {
  1470. key: '1-1',
  1471. icon: 't-icon t-align-top',
  1472. title: '测试测试',
  1473. },
  1474. ],
  1475. },
  1476. {
  1477. key: '2',
  1478. icon: 't-icon t-04',
  1479. title: '安全运行',
  1480. },
  1481. {
  1482. key: '3',
  1483. icon: 't-icon t-warn',
  1484. title: '智慧能源',
  1485. },
  1486. {
  1487. key: '4',
  1488. icon: 't-icon t-line-chart',
  1489. title: '数据分析',
  1490. },
  1491. {
  1492. key: '5',
  1493. icon: 't-icon t-pie-chart',
  1494. title: '运维管理',
  1495. },
  1496. {
  1497. key: '6',
  1498. icon: 't-icon t-dashboard-chart',
  1499. title: '资产设置',
  1500. },
  1501. ],
  1502. },
  1503. },
  1504. {
  1505. name: '导航菜单',
  1506. icon: 'l-zhediemianban',
  1507. data: {
  1508. name: 'leMenu',
  1509. width: 200,
  1510. height: 400,
  1511. externElement: true,
  1512. data: [
  1513. {
  1514. title: '实时监测',
  1515. key: '0',
  1516. show: true,
  1517. icon: 't-icon t-10',
  1518. children: [
  1519. {
  1520. title: '站点看板',
  1521. key: '',
  1522. show: true,
  1523. children: [
  1524. {
  1525. title: '三级标题',
  1526. key: '',
  1527. show: true,
  1528. },
  1529. {
  1530. title: '三级标题',
  1531. key: '',
  1532. show: true,
  1533. },
  1534. ],
  1535. },
  1536. {
  1537. title: '监控画面',
  1538. key: '',
  1539. show: true,
  1540. },
  1541. {
  1542. title: '设备监控',
  1543. key: '',
  1544. show: true,
  1545. },
  1546. {
  1547. title: '变压器监测',
  1548. key: '',
  1549. show: true,
  1550. },
  1551. ],
  1552. },
  1553. {
  1554. title: '控制中心',
  1555. key: '',
  1556. show: true,
  1557. },
  1558. {
  1559. title: '告警管理',
  1560. key: '',
  1561. show: true,
  1562. },
  1563. ],
  1564. expand: true,
  1565. },
  1566. },
  1567. {
  1568. name: '分页',
  1569. icon: 'l-pc',
  1570. data: {
  1571. width: 200,
  1572. height: 200,
  1573. },
  1574. },
  1575. {
  1576. name: '步骤条',
  1577. icon: 'l-pc',
  1578. data: {
  1579. width: 200,
  1580. height: 200,
  1581. },
  1582. },
  1583. {
  1584. name: '选项卡',
  1585. icon: 'l-pc',
  1586. data: {
  1587. name:'leTab',
  1588. width: 500,
  1589. height: 50,
  1590. direction:'vertical',
  1591. selectKey:'1',
  1592. selectedKeys:[],
  1593. them:'',
  1594. data:[
  1595. {text:'场景一',key:'0',isForbidden:true},
  1596. {text:'场景二',key:'1'},
  1597. {text:'场景三',key:'2'},
  1598. {text:'场景四',key:'3'}
  1599. ]
  1600. },
  1601. },
  1602. // {
  1603. // name: '多选选项卡',
  1604. // icon: 'l-pc',
  1605. // data: {
  1606. // name:'leTabs',
  1607. // width: 500,
  1608. // height: 50,
  1609. // direction:'horizontal',
  1610. // selectedKeys:['0'],
  1611. // data:[
  1612. // {text:'场景一',key:'0'},
  1613. // {text:'场景二',key:'1',isForbidden:true},
  1614. // {text:'场景三',key:'2'},
  1615. // {text:'场景四',key:'3'}
  1616. // ]
  1617. // },
  1618. // },
  1619. ],
  1620. },
  1621. {
  1622. name: '输入',
  1623. show: true,
  1624. list: [
  1625. {
  1626. name: '按钮',
  1627. icon: 'l-anniu',
  1628. data: {
  1629. name: 'rectangle',
  1630. x: 300,
  1631. y: 200,
  1632. width: 80,
  1633. height: 30,
  1634. disableAnchor: true,
  1635. borderRadius: 2,
  1636. text: '按钮',
  1637. activeBackground: '#40a9ff',
  1638. activeColor: '#40a9ff',
  1639. background: '#1890ff',
  1640. color: '#1890ff',
  1641. hoverBackground: '#40a9ff',
  1642. hoverColor: '#40a9ff',
  1643. textColor: '#ffffff',
  1644. hoverTextColor: '#ffffff',
  1645. activeTextColor: '#ffffff',
  1646. },
  1647. },
  1648. {
  1649. name: '文本输入框',
  1650. icon: 'l-shurukuang',
  1651. data: {
  1652. x: 100,
  1653. y: 100,
  1654. height: 40,
  1655. width: 200,
  1656. disableAnchor: true,
  1657. name: 'rectangle',
  1658. borderRadius: 0.05,
  1659. input: true,
  1660. ellipsis: true,
  1661. text: '输入数据',
  1662. textAlign: 'left',
  1663. color: '#D9D9D9FF',
  1664. textColor: '#000000FF',
  1665. hoverTextColor: '#000000FF',
  1666. activeTextColor: '#000000FF',
  1667. textLeft: 10,
  1668. },
  1669. },
  1670. {
  1671. name: '数字输入框',
  1672. icon: 'l-shurukuang',
  1673. data: {},
  1674. },
  1675. {
  1676. name: '单选框',
  1677. icon: 'l-danxuankuang',
  1678. data: {
  1679. name: 'leRadio',
  1680. width: 150,
  1681. height: 30,
  1682. disableAnchor: true,
  1683. direction: 'horizontal', // 'vertical', //'horizontal',
  1684. them:'button',
  1685. itemPosition:[],
  1686. data: [
  1687. {key:'1', text: '选项一', isForbidden: true },
  1688. {key:'2', text: '选项二徐昂选' },
  1689. {key:'3', text: '选项三' },
  1690. ],
  1691. selectKey: '2',
  1692. },
  1693. },
  1694. {
  1695. name: '多选框',
  1696. icon: 'l-xuanzeqi',
  1697. data: {
  1698. name: 'leCheckBox',
  1699. width: 100,
  1700. height: 30,
  1701. direction: 'horizontal', // 'vertical', //'horizontal',
  1702. them:'',
  1703. data: [
  1704. {key:'1', text: '选项一', isForbidden: true },
  1705. {key:'2', text: '选项二徐昂选' },
  1706. {key:'3', text: '选项三' },
  1707. ],
  1708. selectedKeys:['2','3']
  1709. },
  1710. },
  1711. {
  1712. name: '下拉选择器',
  1713. icon: 'l-xuanzeqi',
  1714. data: {
  1715. x: 100,
  1716. y: 100,
  1717. height: 40,
  1718. width: 200,
  1719. disableAnchor: true,
  1720. name: 'rectangle',
  1721. borderRadius: 0.05,
  1722. ellipsis: true,
  1723. text: '选项1',
  1724. textAlign: 'left',
  1725. input: true,
  1726. color: '#D9D9D9FF',
  1727. textColor: '#000000FF',
  1728. hoverTextColor: '#000000FF',
  1729. activeTextColor: '#000000FF',
  1730. textLeft: 10,
  1731. dropdownList: [
  1732. {
  1733. text: '选项1',
  1734. },
  1735. {
  1736. text: '选项2',
  1737. },
  1738. {
  1739. text: '选项3',
  1740. },
  1741. ],
  1742. },
  1743. },
  1744. {
  1745. name: '时间选择器',
  1746. icon: 'l-riqixuanzekuang',
  1747. data: {
  1748. name: 'leInput',
  1749. width: 200,
  1750. height: 32,
  1751. externElement: true,
  1752. prefix: false,
  1753. suffix: false,
  1754. inputType: 'time',
  1755. hiddenText: true,
  1756. },
  1757. },
  1758. {
  1759. name: '日期选择器',
  1760. icon: 'l-riqixuanzekuang',
  1761. data: {
  1762. name: 'leInput',
  1763. width: 200,
  1764. height: 32,
  1765. externElement: true,
  1766. prefix: false,
  1767. suffix: false,
  1768. inputType: 'date',
  1769. hiddenText: true,
  1770. },
  1771. },
  1772. {
  1773. name: '颜色选择器',
  1774. icon: 'l-maodian',
  1775. data: {
  1776. name: 'leInput',
  1777. width: 200,
  1778. height: 32,
  1779. externElement: true,
  1780. prefix: false,
  1781. suffix: false,
  1782. inputType: 'color',
  1783. hiddenText: true,
  1784. },
  1785. },
  1786. {
  1787. name: '开关',
  1788. icon: 'l-kaiguan',
  1789. data: {
  1790. name: 'switch',
  1791. disableAnchor: true,
  1792. height: 30,
  1793. width: 60,
  1794. checked: true,
  1795. offColor: '#BFBFBF',
  1796. onColor: '#1890ff',
  1797. disableOffColor: '#E5E5E5',
  1798. disableOnColor: '#A3D3FF',
  1799. hoverBackground: '#40a9ff',
  1800. },
  1801. },
  1802. {
  1803. name: '滑块',
  1804. icon: 'l-kaiguan',
  1805. data: {},
  1806. },
  1807. ],
  1808. },
  1809. {
  1810. name: '工控',
  1811. show: true,
  1812. list: [
  1813. {
  1814. name: '圆柱水位',
  1815. icon: 'l-db',
  1816. data: {
  1817. name: 'waterTank',
  1818. width: 100,
  1819. height: 100,
  1820. disableAnchor: true,
  1821. color: '#FFFFFF00',
  1822. progress: 0.5,
  1823. progressColor: '#00a9e6',
  1824. },
  1825. },
  1826. {
  1827. name: '球形水位',
  1828. icon: 'l-shuiliujianceqi',
  1829. data: {
  1830. name: 'watermeter',
  1831. width: 100,
  1832. height: 100,
  1833. disableAnchor: true,
  1834. background: '#faad14',
  1835. value: 50,
  1836. max: 70,
  1837. min: 20,
  1838. maxBackground: '#f5222d',
  1839. minBackground: '#52c41a',
  1840. // maxText: 'max',
  1841. // minText: 'min',
  1842. scaleShow: false,
  1843. },
  1844. },
  1845. {
  1846. name: '指示灯',
  1847. icon: 'l-tuxingzhishideng1',
  1848. data: {
  1849. name: 'indicatorLight',
  1850. width: 100,
  1851. height: 100,
  1852. displayStatus: 0, //显示状态 默认 方形 圆形
  1853. background: '#5ac8f7',
  1854. color: '#5ac8f7',
  1855. hiddenText: true,
  1856. frames: [
  1857. {
  1858. background: '#f53e6c',
  1859. color: '#f53e6c',
  1860. bkType: 0,
  1861. duration: 200,
  1862. strokeType: 0,
  1863. visible: true,
  1864. },
  1865. {
  1866. background: '#5ac8f7',
  1867. color: '#5ac8f7',
  1868. bkType: 0,
  1869. duration: 200,
  1870. strokeType: 0,
  1871. visible: true,
  1872. },
  1873. ],
  1874. animateType: 'custom',
  1875. },
  1876. },
  1877. {
  1878. name: '圆形按钮',
  1879. icon: 'l-tuxingzhishideng1',
  1880. data: {},
  1881. },
  1882. {
  1883. name: '船型开关',
  1884. icon: 'l-tuxingzhishideng1',
  1885. data: {},
  1886. },
  1887. {
  1888. name: '转换开关',
  1889. icon: 'l-tuxingzhishideng1',
  1890. data: {},
  1891. },
  1892. {
  1893. name: '闸刀',
  1894. icon: 'l-zhadao',
  1895. data: {
  1896. name: 'knifeSwitch',
  1897. width: 100,
  1898. height: 100,
  1899. switch: false,
  1900. color: '#0AECA140',
  1901. background: '#748E9140',
  1902. events: [
  1903. {
  1904. action: 5,
  1905. name: 'click',
  1906. value: 'window.meta2d.setValue({id:pen.id,switch:!pen.switch});',
  1907. },
  1908. ],
  1909. },
  1910. },
  1911. {
  1912. name: '拨动开关',
  1913. icon: 'l-bodongkaiguan',
  1914. data: {
  1915. name: 'toggleSwitch',
  1916. width: 100,
  1917. height: 100,
  1918. switch: false,
  1919. color: '#0AECA140',
  1920. background: '#748E9140',
  1921. events: [
  1922. {
  1923. action: 5,
  1924. name: 'click',
  1925. value:
  1926. 'window.meta2d.setValue({id:pen.id,switch:!pen.switch});window.meta2d.render()',
  1927. },
  1928. ],
  1929. },
  1930. },
  1931. {
  1932. name: '空气开关',
  1933. icon: 'l-bodongkaiguan',
  1934. data: {
  1935. name: 'airSwitch',
  1936. width: 180,
  1937. height: 240,
  1938. switch: true,
  1939. color: '#748E9173',
  1940. background: '#748E9140',
  1941. },
  1942. },
  1943. {
  1944. name: '水柱温度计',
  1945. icon: 'l-wenduji',
  1946. data: {
  1947. name: 'thermometer',
  1948. width: 100,
  1949. height: 300,
  1950. disableAnchor: true,
  1951. background: '#F40',
  1952. value: 10,
  1953. min: -20,
  1954. max: 20,
  1955. },
  1956. },
  1957. {
  1958. name: '扁平温度计',
  1959. icon: 'l-wenduji',
  1960. data: {
  1961. name: 'thermometer1',
  1962. width: 200,
  1963. height: 300,
  1964. disableAnchor: true,
  1965. backgroundColor: '#666',
  1966. value: 0,
  1967. min: -20,
  1968. max: 20,
  1969. markColor: '#fff',
  1970. barrelColor: '#624',
  1971. barrelShowColor: '#d26',
  1972. fontColor: '#fff',
  1973. sub: 5,
  1974. barrel: {
  1975. x: 0.3,
  1976. y: 0.2,
  1977. width: 0.2,
  1978. height: 7 / 9,
  1979. },
  1980. },
  1981. },
  1982. ],
  1983. },
  1984. ];
  1985. export const cases: any[] = [
  1986. { name: '智慧物联' },
  1987. { name: '电力能源' },
  1988. { name: '智慧水务' },
  1989. { name: '智慧工厂' },
  1990. { name: '智慧校园' },
  1991. { name: '智慧园区' },
  1992. { name: '智慧交通' },
  1993. { name: '智慧城市' },
  1994. { name: '智慧农业' },
  1995. { name: '电信机房' },
  1996. { name: '航天航空' },
  1997. { name: '智能家居' },
  1998. ];
  1999. export const templates: any[] = [
  2000. { name: '科技蓝', list: [] },
  2001. { name: '简约', list: [] },
  2002. ];