defaults.ts 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001
  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-pc',
  1353. data: {
  1354. width: 200,
  1355. height: 200,
  1356. },
  1357. },
  1358. {
  1359. name: '滚动播放',
  1360. icon: 'l-pc',
  1361. data: {
  1362. width: 200,
  1363. height: 200,
  1364. },
  1365. },
  1366. {
  1367. name: '跑马灯',
  1368. icon: 'l-pc',
  1369. data: {
  1370. width: 200,
  1371. height: 200,
  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:'horizontal',
  1591. selectKey:'0',
  1592. data:[
  1593. {text:'场景一',key:'0',isForbidden:true},
  1594. {text:'场景二',key:'1'},
  1595. {text:'场景三',key:'2'},
  1596. {text:'场景四',key:'3'}
  1597. ]
  1598. },
  1599. },
  1600. {
  1601. name: '多选选项卡',
  1602. icon: 'l-pc',
  1603. data: {
  1604. name:'leTabs',
  1605. width: 500,
  1606. height: 50,
  1607. direction:'horizontal',
  1608. selectedKeys:['0'],
  1609. data:[
  1610. {text:'场景一',key:'0'},
  1611. {text:'场景二',key:'1',isForbidden:true},
  1612. {text:'场景三',key:'2'},
  1613. {text:'场景四',key:'3'}
  1614. ]
  1615. },
  1616. },
  1617. ],
  1618. },
  1619. {
  1620. name: '输入',
  1621. show: true,
  1622. list: [
  1623. {
  1624. name: '按钮',
  1625. icon: 'l-anniu',
  1626. data: {
  1627. name: 'rectangle',
  1628. x: 300,
  1629. y: 200,
  1630. width: 80,
  1631. height: 30,
  1632. disableAnchor: true,
  1633. borderRadius: 2,
  1634. text: '按钮',
  1635. activeBackground: '#40a9ff',
  1636. activeColor: '#40a9ff',
  1637. background: '#1890ff',
  1638. color: '#1890ff',
  1639. hoverBackground: '#40a9ff',
  1640. hoverColor: '#40a9ff',
  1641. textColor: '#ffffff',
  1642. hoverTextColor: '#ffffff',
  1643. activeTextColor: '#ffffff',
  1644. },
  1645. },
  1646. {
  1647. name: '文本输入框',
  1648. icon: 'l-shurukuang',
  1649. data: {
  1650. x: 100,
  1651. y: 100,
  1652. height: 40,
  1653. width: 200,
  1654. disableAnchor: true,
  1655. name: 'rectangle',
  1656. borderRadius: 0.05,
  1657. input: true,
  1658. ellipsis: true,
  1659. text: '输入数据',
  1660. textAlign: 'left',
  1661. color: '#D9D9D9FF',
  1662. textColor: '#000000FF',
  1663. hoverTextColor: '#000000FF',
  1664. activeTextColor: '#000000FF',
  1665. textLeft: 10,
  1666. },
  1667. },
  1668. {
  1669. name: '数字输入框',
  1670. icon: 'l-shurukuang',
  1671. data: {},
  1672. },
  1673. {
  1674. name: '单选框',
  1675. icon: 'l-danxuankuang',
  1676. data: {
  1677. name: 'radio',
  1678. width: 150,
  1679. height: 30,
  1680. disableAnchor: true,
  1681. direction: 'horizontal', // 'vertical', //'horizontal',
  1682. options: [
  1683. { text: '选项一', isForbidden: true },
  1684. { text: '选项二' },
  1685. { text: '选项三' },
  1686. ],
  1687. checked: '选项二',
  1688. },
  1689. },
  1690. {
  1691. name: '多选框',
  1692. icon: 'l-xuanzeqi',
  1693. data: {
  1694. name: 'checkbox',
  1695. width: 100,
  1696. height: 30,
  1697. fontSize: 16,
  1698. disableAnchor: true,
  1699. direction: 'vertical',
  1700. checked: true,
  1701. // isForbidden: true,
  1702. value: '选项一',
  1703. },
  1704. },
  1705. {
  1706. name: '下拉选择器',
  1707. icon: 'l-xuanzeqi',
  1708. data: {
  1709. x: 100,
  1710. y: 100,
  1711. height: 40,
  1712. width: 200,
  1713. disableAnchor: true,
  1714. name: 'rectangle',
  1715. borderRadius: 0.05,
  1716. ellipsis: true,
  1717. text: '选项1',
  1718. textAlign: 'left',
  1719. input: true,
  1720. color: '#D9D9D9FF',
  1721. textColor: '#000000FF',
  1722. hoverTextColor: '#000000FF',
  1723. activeTextColor: '#000000FF',
  1724. textLeft: 10,
  1725. dropdownList: [
  1726. {
  1727. text: '选项1',
  1728. },
  1729. {
  1730. text: '选项2',
  1731. },
  1732. {
  1733. text: '选项3',
  1734. },
  1735. ],
  1736. },
  1737. },
  1738. {
  1739. name: '时间选择器',
  1740. icon: 'l-riqixuanzekuang',
  1741. data: {
  1742. name: 'leInput',
  1743. width: 200,
  1744. height: 32,
  1745. externElement: true,
  1746. prefix: false,
  1747. suffix: false,
  1748. inputType: 'time',
  1749. hiddenText: true,
  1750. },
  1751. },
  1752. {
  1753. name: '日期选择器',
  1754. icon: 'l-riqixuanzekuang',
  1755. data: {
  1756. name: 'leInput',
  1757. width: 200,
  1758. height: 32,
  1759. externElement: true,
  1760. prefix: false,
  1761. suffix: false,
  1762. inputType: 'date',
  1763. hiddenText: true,
  1764. },
  1765. },
  1766. {
  1767. name: '颜色选择器',
  1768. icon: 'l-maodian',
  1769. data: {
  1770. name: 'leInput',
  1771. width: 200,
  1772. height: 32,
  1773. externElement: true,
  1774. prefix: false,
  1775. suffix: false,
  1776. inputType: 'color',
  1777. hiddenText: true,
  1778. },
  1779. },
  1780. {
  1781. name: '开关',
  1782. icon: 'l-kaiguan',
  1783. data: {
  1784. name: 'switch',
  1785. disableAnchor: true,
  1786. height: 30,
  1787. width: 60,
  1788. checked: true,
  1789. offColor: '#BFBFBF',
  1790. onColor: '#1890ff',
  1791. disableOffColor: '#E5E5E5',
  1792. disableOnColor: '#A3D3FF',
  1793. hoverBackground: '#40a9ff',
  1794. },
  1795. },
  1796. {
  1797. name: '滑块',
  1798. icon: 'l-kaiguan',
  1799. data: {},
  1800. },
  1801. ],
  1802. },
  1803. {
  1804. name: '工控',
  1805. show: true,
  1806. list: [
  1807. {
  1808. name: '圆柱水位',
  1809. icon: 'l-db',
  1810. data: {
  1811. name: 'waterTank',
  1812. width: 100,
  1813. height: 100,
  1814. disableAnchor: true,
  1815. color: '#FFFFFF00',
  1816. progress: 0.5,
  1817. progressColor: '#00a9e6',
  1818. },
  1819. },
  1820. {
  1821. name: '球形水位',
  1822. icon: 'l-shuiliujianceqi',
  1823. data: {
  1824. name: 'watermeter',
  1825. width: 100,
  1826. height: 100,
  1827. disableAnchor: true,
  1828. background: '#faad14',
  1829. value: 50,
  1830. max: 70,
  1831. min: 20,
  1832. maxBackground: '#f5222d',
  1833. minBackground: '#52c41a',
  1834. // maxText: 'max',
  1835. // minText: 'min',
  1836. scaleShow: false,
  1837. },
  1838. },
  1839. {
  1840. name: '指示灯',
  1841. icon: 'l-tuxingzhishideng1',
  1842. data: {
  1843. name: 'indicatorLight',
  1844. width: 100,
  1845. height: 100,
  1846. displayStatus: 0, //显示状态 默认 方形 圆形
  1847. background: '#5ac8f7',
  1848. color: '#5ac8f7',
  1849. hiddenText: true,
  1850. frames: [
  1851. {
  1852. background: '#f53e6c',
  1853. color: '#f53e6c',
  1854. bkType: 0,
  1855. duration: 200,
  1856. strokeType: 0,
  1857. visible: true,
  1858. },
  1859. {
  1860. background: '#5ac8f7',
  1861. color: '#5ac8f7',
  1862. bkType: 0,
  1863. duration: 200,
  1864. strokeType: 0,
  1865. visible: true,
  1866. },
  1867. ],
  1868. animateType: 'custom',
  1869. },
  1870. },
  1871. {
  1872. name: '圆形按钮',
  1873. icon: 'l-tuxingzhishideng1',
  1874. data: {},
  1875. },
  1876. {
  1877. name: '船型开关',
  1878. icon: 'l-tuxingzhishideng1',
  1879. data: {},
  1880. },
  1881. {
  1882. name: '转换开关',
  1883. icon: 'l-tuxingzhishideng1',
  1884. data: {},
  1885. },
  1886. {
  1887. name: '闸刀',
  1888. icon: 'l-zhadao',
  1889. data: {
  1890. name: 'knifeSwitch',
  1891. width: 100,
  1892. height: 100,
  1893. switch: false,
  1894. color: '#0AECA140',
  1895. background: '#748E9140',
  1896. events: [
  1897. {
  1898. action: 5,
  1899. name: 'click',
  1900. value: 'window.meta2d.setValue({id:pen.id,switch:!pen.switch});',
  1901. },
  1902. ],
  1903. },
  1904. },
  1905. {
  1906. name: '拨动开关',
  1907. icon: 'l-bodongkaiguan',
  1908. data: {
  1909. name: 'toggleSwitch',
  1910. width: 100,
  1911. height: 100,
  1912. switch: false,
  1913. color: '#0AECA140',
  1914. background: '#748E9140',
  1915. events: [
  1916. {
  1917. action: 5,
  1918. name: 'click',
  1919. value:
  1920. 'window.meta2d.setValue({id:pen.id,switch:!pen.switch});window.meta2d.render()',
  1921. },
  1922. ],
  1923. },
  1924. },
  1925. {
  1926. name: '空气开关',
  1927. icon: 'l-bodongkaiguan',
  1928. data: {
  1929. name: 'airSwitch',
  1930. width: 180,
  1931. height: 240,
  1932. switch: true,
  1933. color: '#748E9173',
  1934. background: '#748E9140',
  1935. },
  1936. },
  1937. {
  1938. name: '水柱温度计',
  1939. icon: 'l-wenduji',
  1940. data: {
  1941. name: 'thermometer',
  1942. width: 100,
  1943. height: 300,
  1944. disableAnchor: true,
  1945. background: '#F40',
  1946. value: 10,
  1947. min: -20,
  1948. max: 20,
  1949. },
  1950. },
  1951. {
  1952. name: '扁平温度计',
  1953. icon: 'l-wenduji',
  1954. data: {
  1955. name: 'thermometer1',
  1956. width: 200,
  1957. height: 300,
  1958. disableAnchor: true,
  1959. backgroundColor: '#666',
  1960. value: 0,
  1961. min: -20,
  1962. max: 20,
  1963. markColor: '#fff',
  1964. barrelColor: '#624',
  1965. barrelShowColor: '#d26',
  1966. fontColor: '#fff',
  1967. sub: 5,
  1968. barrel: {
  1969. x: 0.3,
  1970. y: 0.2,
  1971. width: 0.2,
  1972. height: 7 / 9,
  1973. },
  1974. },
  1975. },
  1976. ],
  1977. },
  1978. ];
  1979. export const cases: any[] = [
  1980. { name: '智慧物联' },
  1981. { name: '电力能源' },
  1982. { name: '智慧水务' },
  1983. { name: '智慧工厂' },
  1984. { name: '智慧校园' },
  1985. { name: '智慧园区' },
  1986. { name: '智慧交通' },
  1987. { name: '智慧城市' },
  1988. { name: '智慧农业' },
  1989. { name: '电信机房' },
  1990. { name: '航天航空' },
  1991. { name: '智能家居' },
  1992. ];