defaults.ts 64 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735
  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-wenben',
  922. data: {
  923. width: 160,
  924. height: 30,
  925. name: 'text',
  926. text: '乐吾乐le5le - 大屏可视化',
  927. },
  928. },
  929. {
  930. name: '数字',
  931. icon: 'l-shuzi',
  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: 'progress',
  947. width: 164,
  948. height: 6,
  949. borderRadius: 0.5,
  950. progressColor: '#4583ff',
  951. progress: 0.8,
  952. background: 'rgba(225, 227, 232, 1)',
  953. lineWidth: 0,
  954. props: {
  955. custom: [
  956. {
  957. key: 'progress',
  958. label: '进度',
  959. type: 'number',
  960. max: 1,
  961. min: 0,
  962. },
  963. {
  964. key: 'progressColor',
  965. label: '进度颜色',
  966. type: 'color',
  967. },
  968. ],
  969. },
  970. },
  971. },
  972. {
  973. name: '图标',
  974. icon: 'l-tubiao',
  975. data: {
  976. width: 100,
  977. height: 100,
  978. name: 'image',
  979. icon: '\uea86',
  980. iconFamily: 'l-icon',
  981. },
  982. },
  983. {
  984. name: '图片',
  985. icon: 'l-tupian',
  986. data: {
  987. width: 100,
  988. height: 100,
  989. name: 'image',
  990. image: (cdn ? cdn + '/v' : '') + '/img/logo.png',
  991. },
  992. },
  993. {
  994. name: 'GIF',
  995. icon: 'l-GIF',
  996. data: {
  997. width: 100,
  998. height: 100,
  999. name: 'gif',
  1000. image: (cdn ? cdn + '/v' : '') + '/png/电信机房/防火墙.gif',
  1001. },
  1002. },
  1003. {
  1004. name: '视频',
  1005. icon: 'l-shipin',
  1006. data: {
  1007. width: 200,
  1008. height: 200,
  1009. externElement: true,
  1010. name: 'video',
  1011. video:
  1012. 'https://video.699pic.com/videos/17/69/11/a_aa3jeKZ0D63g1556176911_10s.mp4',
  1013. props: {
  1014. custom: [
  1015. {
  1016. key: 'video',
  1017. label: '视频地址',
  1018. type: 'string',
  1019. },
  1020. ],
  1021. },
  1022. },
  1023. },
  1024. {
  1025. name: 'FLV视频流',
  1026. icon: 'l-pc',
  1027. data: {
  1028. name: 'leFlvPlayer',
  1029. width: 477,
  1030. height: 268,
  1031. externElement: true,
  1032. video:
  1033. 'https://sf1-hscdn-tos.pstatp.com/obj/media-fe/xgplayer_doc_video/flv/xgplayer-demo-360p.flv',
  1034. mediaDataSource: {},
  1035. optionalConfig: {},
  1036. props: {
  1037. custom: [
  1038. {
  1039. key: 'video',
  1040. label: '视频地址',
  1041. type: 'string',
  1042. },
  1043. {
  1044. key: 'mediaDataSource',
  1045. label: '媒体数据源',
  1046. type: 'code',
  1047. placeholder:
  1048. '具体配置参考:https://github.com/bilibili/flv.js/blob/master/docs/api.md',
  1049. },
  1050. {
  1051. key: 'optionalConfig',
  1052. label: '配置',
  1053. type: 'code',
  1054. placeholder:
  1055. '具体配置参考:https://github.com/bilibili/flv.js/blob/master/docs/api.md',
  1056. },
  1057. ],
  1058. },
  1059. },
  1060. },
  1061. {
  1062. name: '音频',
  1063. icon: 'l-yinpin',
  1064. data: {
  1065. width: 200,
  1066. height: 40,
  1067. externElement: true,
  1068. name: 'video',
  1069. audio: 'https://www.xzmp3.com/down/597caee79849.mp3',
  1070. props: {
  1071. custom: [
  1072. {
  1073. key: 'audio',
  1074. label: '视频地址',
  1075. type: 'string',
  1076. },
  1077. ],
  1078. },
  1079. },
  1080. },
  1081. {
  1082. name: '头像',
  1083. icon: 'l-touxiang',
  1084. data: {
  1085. width: 30,
  1086. height: 30,
  1087. disableAnchor: true,
  1088. name: 'square',
  1089. lineWidth: 0,
  1090. image: (cdn ? cdn + '/v' : '') + '/img/avatar.png',
  1091. imageRadius: 0.5,
  1092. background: '#689f38',
  1093. borderRadius: 0.5,
  1094. ratio: true,
  1095. },
  1096. },
  1097. {
  1098. name: '徽标',
  1099. icon: 'l-huibiao',
  1100. data: {
  1101. width: 35,
  1102. height: 20,
  1103. name: 'square',
  1104. borderRadius: 0.5,
  1105. lineWidth: 0,
  1106. background: '#d54941',
  1107. color: '#fff',
  1108. text: '99+',
  1109. },
  1110. },
  1111. {
  1112. name: '标签',
  1113. icon: 'l-biaoqian',
  1114. data: {
  1115. text: 'success',
  1116. width: 80,
  1117. height: 24,
  1118. borderRadius: 0.1,
  1119. name: 'rectangle',
  1120. lineWidth: 1,
  1121. fontSize: 12,
  1122. icon: '\uea10',
  1123. iconFamily: 'l-icon',
  1124. iconColor: '#52c41a',
  1125. iconSize: 12,
  1126. iconAlign: 'left',
  1127. iconLeft: 8,
  1128. textAlign: 'right',
  1129. color: '#52c41a',
  1130. background: '#f6ffed',
  1131. textLeft: -6,
  1132. },
  1133. },
  1134. ],
  1135. },
  1136. {
  1137. name: '时间',
  1138. show: true,
  1139. list: [
  1140. {
  1141. name: '时间',
  1142. icon: 'l-clock',
  1143. data: {
  1144. name: 'leTime',
  1145. width: 300,
  1146. height: 40,
  1147. text: '当前时间',
  1148. timeFormat:
  1149. '`${year}年${month}月${day}日 ${hours}时${minutes}分${seconds}秒 星期${week}`',
  1150. props: {
  1151. custom: [
  1152. {
  1153. key: 'timeFormat',
  1154. label: '显示格式',
  1155. type: 'string',
  1156. },
  1157. ],
  1158. },
  1159. },
  1160. },
  1161. {
  1162. name: '倒计时',
  1163. icon: 'l-daojishi',
  1164. data: {
  1165. name: 'countdown',
  1166. width: 300,
  1167. height: 40,
  1168. text: '倒计时',
  1169. calculativeTime: '2023/9/23 00:00:00', //配置未来的时间
  1170. timeFormat:
  1171. '`距离杭州亚运会还有:${day}天${hours}时${minutes}分${seconds}秒`',
  1172. props: {
  1173. custom: [
  1174. {
  1175. key: 'timeFormat',
  1176. label: '显示格式',
  1177. type: 'string',
  1178. },
  1179. {
  1180. key: 'calculativeTime',
  1181. label: '参考时间',
  1182. type: 'string',
  1183. },
  1184. ],
  1185. },
  1186. },
  1187. },
  1188. {
  1189. name: '水平时间轴',
  1190. icon: 'l-shuipingshijianzhou',
  1191. data: {
  1192. name: 'leTimeline',
  1193. width: 500,
  1194. height: 40,
  1195. hiddenText: true,
  1196. direction: 'horizontal',
  1197. labelAlign: '', //left/right/alternate/top/bottom
  1198. mode: 'alternate', //alternate
  1199. data: [
  1200. {
  1201. label: '2022-01-01',
  1202. content: '事件一',
  1203. // 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',
  1204. },
  1205. {
  1206. label: '2022-01-01',
  1207. content: '事件一',
  1208. },
  1209. {
  1210. label: '2022-02-01',
  1211. content: '事件二',
  1212. },
  1213. {
  1214. label: '2022-03-01',
  1215. content: '事件三',
  1216. },
  1217. {
  1218. label: '2022-04-01',
  1219. content: '事件四',
  1220. },
  1221. ],
  1222. text: '时间轴',
  1223. props: {
  1224. custom: [
  1225. {
  1226. key: 'mode',
  1227. label: '标签分布',
  1228. type: 'select',
  1229. options: [
  1230. { label: '同侧', value: 'same' },
  1231. { label: '交叉', value: 'alternate' },
  1232. ],
  1233. },
  1234. {
  1235. key: 'labelAlign',
  1236. label: '标签对齐',
  1237. type: 'select',
  1238. options: [
  1239. { label: '顶部', value: 'top' },
  1240. { label: '底部', value: 'bottom' },
  1241. ],
  1242. },
  1243. {
  1244. key: 'data',
  1245. label: '数据',
  1246. type: 'code',
  1247. },
  1248. ],
  1249. },
  1250. },
  1251. },
  1252. {
  1253. name: '垂直时间轴',
  1254. icon: 'l-chuizhishijianzhou',
  1255. data: {
  1256. name: 'leTimeline',
  1257. width: 40,
  1258. height: 500,
  1259. text: '时间轴',
  1260. hiddenText: true,
  1261. direction: 'vertical',
  1262. labelAlign: 'left', //left/right/alternate/top/bottom
  1263. // mode: 'alternate', //alternate
  1264. data: [
  1265. {
  1266. label: '2022-01-01',
  1267. content: '事件一',
  1268. // 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',
  1269. },
  1270. {
  1271. label: '2022-01-01',
  1272. content: '事件一',
  1273. },
  1274. {
  1275. label: '2022-02-01',
  1276. content: '事件二',
  1277. },
  1278. {
  1279. label: '2022-03-01',
  1280. content: '事件三',
  1281. },
  1282. {
  1283. label: '2022-04-01',
  1284. content: '事件四',
  1285. },
  1286. ],
  1287. props: {
  1288. custom: [
  1289. {
  1290. key: 'mode',
  1291. label: '标签分布',
  1292. type: 'select',
  1293. options: [
  1294. { label: '同侧', value: 'same' },
  1295. { label: '交叉', value: 'alternate' },
  1296. ],
  1297. },
  1298. {
  1299. key: 'labelAlign',
  1300. label: '标签对齐',
  1301. type: 'select',
  1302. options: [
  1303. { label: '靠左', value: 'left' },
  1304. { label: '靠右', value: 'right' },
  1305. ],
  1306. },
  1307. {
  1308. key: 'data',
  1309. label: '数据',
  1310. type: 'code',
  1311. },
  1312. ],
  1313. },
  1314. },
  1315. },
  1316. {
  1317. name: '日历',
  1318. icon: 'l-rili',
  1319. data: {
  1320. width: 200,
  1321. height: 200,
  1322. hiddenText: true,
  1323. name: 'calendar',
  1324. },
  1325. },
  1326. ],
  1327. },
  1328. {
  1329. name: '面板',
  1330. show: true,
  1331. list: [
  1332. {
  1333. name: '列表',
  1334. icon: 'l-liebiao',
  1335. data: {
  1336. width: 400,
  1337. height: 200,
  1338. name: 'list',
  1339. headingColor: '#000',
  1340. headingSize: 16,
  1341. background: '#fff',
  1342. data: [
  1343. {
  1344. title: '列表标题',
  1345. description: '列表内容的描述性文字',
  1346. },
  1347. {
  1348. title: '列表标题',
  1349. description: '列表内容的描述性文字',
  1350. },
  1351. {
  1352. title: '列表标题',
  1353. description: '列表内容的描述性文字',
  1354. },
  1355. ],
  1356. props: {
  1357. custom: [
  1358. {
  1359. key: 'data',
  1360. label: '数据',
  1361. type: 'code',
  1362. },
  1363. ],
  1364. },
  1365. },
  1366. },
  1367. {
  1368. name: '表格',
  1369. icon: 'l-biaoge',
  1370. data: {
  1371. name: 'table2',
  1372. width: 0,
  1373. height: 0,
  1374. disableAnchor: true,
  1375. colWidth: 150,
  1376. rowHeight: 40,
  1377. data: [
  1378. ['设备 ID', '设备名称', '数据协议', '状态', '操作'],
  1379. ['1', '200', 'MQTT', '正在运行', {}],
  1380. ['2', '湿度传感器', 'MQTT', '正在运行', {}],
  1381. ['3', '物联网设备', 'MQTT', '正在运行', {}],
  1382. ['4', '物联网设备/智能家居/智慧城市', 'MQTT', '正在运行', {}],
  1383. ],
  1384. styles: [
  1385. {
  1386. row: 1,
  1387. col: 1,
  1388. color: '#ff0000',
  1389. background: '#ffff00',
  1390. wheres: [
  1391. //触发条件 成立后才允许配置样式
  1392. {
  1393. comparison: '<=',
  1394. value: '123',
  1395. },
  1396. ],
  1397. },
  1398. {
  1399. row: 0,
  1400. height: 60,
  1401. },
  1402. {
  1403. col: 4,
  1404. width: 200, //为该列设置额外的节点
  1405. pens: [
  1406. {
  1407. name: 'rectangle',
  1408. width: 50,
  1409. height: 20,
  1410. text: '编辑',
  1411. fontSize: 0.6,
  1412. disableAnchor: true,
  1413. activeBackground: '#40a9ff',
  1414. activeColor: '#40a9ff',
  1415. background: '#1890ff',
  1416. color: '#1890ff',
  1417. hoverBackground: '#40a9ff',
  1418. hoverColor: '#40a9ff',
  1419. textColor: '#ffffff',
  1420. hoverTextColor: '#ffffff',
  1421. activeTextColor: '#ffffff',
  1422. events: [
  1423. {
  1424. action: 5,
  1425. name: 'click',
  1426. value: 'alert("点击了编辑")',
  1427. },
  1428. ],
  1429. },
  1430. {
  1431. name: 'rectangle',
  1432. width: 80,
  1433. height: 20,
  1434. text: '实时数据',
  1435. fontSize: 0.6,
  1436. disableAnchor: true,
  1437. activeBackground: '#40a9ff',
  1438. activeColor: '#40a9ff',
  1439. background: '#1890ff',
  1440. color: '#1890ff',
  1441. hoverBackground: '#40a9ff',
  1442. hoverColor: '#40a9ff',
  1443. textColor: '#ffffff',
  1444. hoverTextColor: '#ffffff',
  1445. activeTextColor: '#ffffff',
  1446. events: [
  1447. {
  1448. action: 5,
  1449. name: 'click',
  1450. value: 'alert("点击了实时数据")',
  1451. },
  1452. ],
  1453. },
  1454. ],
  1455. },
  1456. ],
  1457. props: {
  1458. custom: [
  1459. {
  1460. key: 'data',
  1461. label: '数据',
  1462. type: 'code',
  1463. },
  1464. {
  1465. key: 'styles',
  1466. label: '样式',
  1467. type: 'code',
  1468. },
  1469. ],
  1470. },
  1471. },
  1472. },
  1473. {
  1474. name: '斑马纹表格',
  1475. icon: 'l-biaoge',
  1476. data: {
  1477. name: 'table2',
  1478. width: 0,
  1479. height: 0,
  1480. disableAnchor: true,
  1481. colWidth: 90,
  1482. rowHeight: 32,
  1483. bordered: false,
  1484. vLine: false,
  1485. hLine: false,
  1486. stripe: true,
  1487. stripeColor: '#407FFF1F', //'#15181c',
  1488. // hasHeader: false,
  1489. textColor: '#FFFFFF',
  1490. data: [
  1491. ['设备 ID', '设备名称', '数据协议', '级别'],
  1492. [
  1493. '1',
  1494. '200',
  1495. 'MQTT',
  1496. {
  1497. text: '一级告警',
  1498. background: '#650b09',
  1499. textColor: '#FF5D3CFF',
  1500. },
  1501. ],
  1502. [
  1503. '2',
  1504. '湿度传感器',
  1505. 'MQTT',
  1506. {
  1507. text: '二级告警',
  1508. background: '#4d2a02',
  1509. textColor: '#E6A82EFF',
  1510. },
  1511. ],
  1512. [
  1513. '3',
  1514. '物联网设备',
  1515. 'MQTT',
  1516. {
  1517. text: '一级告警',
  1518. background: '#650b09',
  1519. textColor: '#FF5D3CFF',
  1520. },
  1521. ],
  1522. [
  1523. '4',
  1524. '物联网设备/智能家居/智慧城市',
  1525. 'MQTT',
  1526. {
  1527. text: '三级告警',
  1528. textColor: '#58CC84FF',
  1529. background: '#042617;',
  1530. },
  1531. ],
  1532. ],
  1533. styles: [
  1534. {
  1535. row: 0,
  1536. textColor: '#ffffff66',
  1537. },
  1538. {
  1539. col: 3,
  1540. pens: [
  1541. {
  1542. name: 'rectangle',
  1543. width: 56,
  1544. height: 20,
  1545. fontSize: 0.6,
  1546. disableAnchor: true,
  1547. lineWidth: 0,
  1548. },
  1549. ],
  1550. },
  1551. ],
  1552. props: {
  1553. custom: [
  1554. {
  1555. key: 'stripe',
  1556. label: '显示斑马纹',
  1557. type: 'bool',
  1558. },
  1559. {
  1560. key: 'stripeColor',
  1561. label: '斑马纹颜色',
  1562. type: 'color',
  1563. },
  1564. {
  1565. key: 'bordered',
  1566. label: '外边框',
  1567. type: 'bool',
  1568. },
  1569. {
  1570. key: 'hLine',
  1571. label: '水平线',
  1572. type: 'bool',
  1573. },
  1574. {
  1575. key: 'vLine',
  1576. label: '垂直线',
  1577. type: 'bool',
  1578. },
  1579. {
  1580. key: 'hasHeader',
  1581. label: '有无头部',
  1582. type: 'bool',
  1583. },
  1584. {
  1585. key: 'data',
  1586. label: '数据',
  1587. type: 'code',
  1588. },
  1589. {
  1590. key: 'styles',
  1591. label: '样式',
  1592. type: 'code',
  1593. },
  1594. ],
  1595. },
  1596. },
  1597. },
  1598. {
  1599. name: '树',
  1600. icon: 'l-pc', //l-shu
  1601. data: {
  1602. name:'leTree',
  1603. width: 200,
  1604. height: 200,
  1605. expanded:['1','2'],
  1606. data:[
  1607. {
  1608. label:'1',
  1609. children:[
  1610. {
  1611. label:'1-1'
  1612. },
  1613. {
  1614. label:'1-2'
  1615. }
  1616. ]
  1617. },
  1618. {
  1619. label:'2',
  1620. children:[
  1621. {
  1622. label:'2-1',
  1623. children:[
  1624. {
  1625. label:'2-1-1',
  1626. children:[
  1627. {
  1628. label:'2-1-1-1'
  1629. },
  1630. {
  1631. label:'2-2-2-2'
  1632. }
  1633. ]
  1634. },
  1635. {
  1636. label:'2-2-2'
  1637. }
  1638. ]
  1639. },
  1640. {
  1641. label:'2-2'
  1642. }
  1643. ]
  1644. },
  1645. {
  1646. label:'3'
  1647. },
  1648. {
  1649. label:'4',
  1650. children:[
  1651. {
  1652. label:'4-1'
  1653. },
  1654. {
  1655. label:'4-2'
  1656. }
  1657. ]
  1658. },
  1659. ]
  1660. },
  1661. },
  1662. {
  1663. name: '网页',
  1664. icon: 'l-iframe',
  1665. data: {
  1666. name: 'iframe',
  1667. width: 500,
  1668. height: 400,
  1669. externElement: true,
  1670. iframe: 'https://le5le.com',
  1671. props: {
  1672. custom: [
  1673. {
  1674. key: 'iframe',
  1675. label: '网页地址',
  1676. type: 'string',
  1677. },
  1678. ],
  1679. },
  1680. },
  1681. },
  1682. ],
  1683. },
  1684. {
  1685. name: '提醒',
  1686. show: true,
  1687. list: [
  1688. {
  1689. name: '业务指标',
  1690. icon: 'l-yewuzhibiao',
  1691. data: {
  1692. width: 115,
  1693. height: 25,
  1694. name: 'indicator',
  1695. data: [
  1696. {
  1697. type: 'text',
  1698. color: '',
  1699. x: 0,
  1700. text: '业务指标',
  1701. },
  1702. {
  1703. type: 'icon',
  1704. x: 0.5,
  1705. size: 0.5, //高度的倍数
  1706. color: '#ff0000',
  1707. background: '#f00',
  1708. path: 'M116.77950993 500.07050546c15.9195644 15.9195644 41.65144342 15.9195644 57.57100785 0L471.28500154 203.13602167 471.28500154 919.14998461c0 22.47467916 18.24031931 40.71499846 40.71499846 40.71499845s40.71499846-18.24031931 40.71499846-40.71499845l0-716.01396294 296.93448376 296.93448379c15.9195644 15.9195644 41.65144342 15.9195644 57.57100785 0s15.9195644-41.65144342 1e-8-57.57100783l-366.43498616-366.39427116c-3.74577985-3.78649485-8.26514469-6.75868973-13.27308951-8.83515464C522.5858996 65.19360688 517.29294978 64.13501693 512 64.13501694s-10.5858996 1.05858996-15.55312942 3.13505489c-5.00794479 2.07646491-9.48659464 5.0486598-13.27308948 8.83515464l-366.43498616 366.39427115C100.85994556 458.41906201 100.85994555 484.15094105 116.77950993 500.07050546z',
  1709. },
  1710. {
  1711. textColor: '#f00',
  1712. type: 'text',
  1713. color: '',
  1714. x: 0.6,
  1715. text: '20%',
  1716. },
  1717. ],
  1718. props: {
  1719. custom: [
  1720. {
  1721. key: 'data',
  1722. label: '数据',
  1723. type: 'code',
  1724. },
  1725. ],
  1726. },
  1727. },
  1728. },
  1729. {
  1730. name: '全局消息',
  1731. icon: 'l-quanjuxiaoxi',
  1732. data: {
  1733. width: 200,
  1734. height: 46,
  1735. text: '用于表示普通操作信息提示',
  1736. borderRadius: 6,
  1737. name: 'rectangle',
  1738. icon: '\ue6e4',
  1739. iconFamily: 'l-icon',
  1740. iconColor: '#4583ff',
  1741. iconSize: 17.5,
  1742. iconAlign: 'left',
  1743. iconLeft: 8,
  1744. textAlign: 'left',
  1745. color: 'rgba(235, 235, 235, 1)',
  1746. background: 'rgba(255, 255, 255, 1)',
  1747. textLeft: 30,
  1748. shadow: false,
  1749. textColor: 'rgba(0, 0, 0, 1)',
  1750. hoverTextColor: 'rgba(0, 0, 0, 1)',
  1751. shadowColor: 'rgba(250, 247, 247, 0.5)',
  1752. shadowOffsetX: 6,
  1753. shadowOffsetY: 6,
  1754. shadowBlur: 20,
  1755. },
  1756. },
  1757. {
  1758. name: '通知',
  1759. icon: 'l-tongzhi',
  1760. data: {
  1761. width: 360,
  1762. height: 178,
  1763. text: '通知具体内容;通知具体内容;通知具体内容;通知具体内容;通知具体内容;通知具体内容;通知具体内容;通知具体内容;通知具体内容;',
  1764. borderRadius: 6,
  1765. name: 'notification',
  1766. icon: '\ue6e4',
  1767. iconFamily: 'l-icon',
  1768. iconColor: '#4583ff',
  1769. iconSize: 17.5,
  1770. iconAlign: 'left-top',
  1771. iconLeft: 8,
  1772. iconTop: 8,
  1773. textAlign: 'left',
  1774. textBaseline: 'top',
  1775. textLeft: 30,
  1776. textTop: 30,
  1777. color: 'rgba(235, 235, 235, 1)',
  1778. background: 'rgba(255, 255, 255, 1)',
  1779. shadow: false,
  1780. textColor: '#666666',
  1781. hoverTextColor: '#666666',
  1782. shadowColor: 'rgba(250, 247, 247, 0.5)',
  1783. shadowOffsetX: 6,
  1784. shadowOffsetY: 6,
  1785. shadowBlur: 20,
  1786. heading: '标题名称',
  1787. headingColor: '#000',
  1788. headingSize: 16,
  1789. // headingWeight: 'bold',
  1790. props: {
  1791. custom: [
  1792. {
  1793. key: 'heading',
  1794. label: '标题',
  1795. type: 'string',
  1796. },
  1797. {
  1798. key: 'headingColor',
  1799. label: '标题颜色',
  1800. type: 'color',
  1801. },
  1802. {
  1803. key: 'headingSize',
  1804. label: '标题大小',
  1805. type: 'number',
  1806. },
  1807. {
  1808. key: 'headingWeight',
  1809. label: '标题加粗',
  1810. type: 'select',
  1811. options: [
  1812. { label: '加粗', value: 'bold' },
  1813. { label: '正常', value: '' },
  1814. ],
  1815. },
  1816. ],
  1817. },
  1818. },
  1819. },
  1820. // {
  1821. // name: '对话框',
  1822. // icon: 'l-pc',
  1823. // data: {
  1824. // width: 200,
  1825. // height: 200,
  1826. // },
  1827. // },
  1828. ],
  1829. },
  1830. {
  1831. name: '轮播',
  1832. show: true,
  1833. list: [
  1834. {
  1835. name: '水平轮播',
  1836. icon: 'l-paomadeng',
  1837. data: {
  1838. name: 'leSwiperline',
  1839. width: 200,
  1840. height: 40,
  1841. data: ['轮播第一次数据', '轮播第二次数据', '轮播第三次数据'],
  1842. hiddenText: true,
  1843. props: {
  1844. custom: [
  1845. {
  1846. key: 'data',
  1847. label: '数据',
  1848. type: 'code',
  1849. },
  1850. {
  1851. key: 'timeout',
  1852. label: '轮播时间',
  1853. type: 'number',
  1854. },
  1855. ],
  1856. },
  1857. },
  1858. },
  1859. {
  1860. name: '垂直轮播',
  1861. icon: 'l-chuizhigundong',
  1862. data: {
  1863. name: 'leSwiperline',
  1864. width: 200,
  1865. height: 24,
  1866. direction: 'vertical',
  1867. lineHeight: 2,
  1868. data: ['轮播第一次数据', '轮播第二次数据', '轮播第三次数据'],
  1869. hiddenText: true,
  1870. props: {
  1871. custom: [
  1872. {
  1873. key: 'data',
  1874. label: '数据',
  1875. type: 'code',
  1876. },
  1877. {
  1878. key: 'timeout',
  1879. label: '轮播时间',
  1880. type: 'number',
  1881. },
  1882. ],
  1883. },
  1884. },
  1885. },
  1886. {
  1887. name: '轮播图',
  1888. icon: 'l-lunbotu',
  1889. data: {
  1890. name: 'leSwiper',
  1891. width: 400,
  1892. height: 300,
  1893. data: [
  1894. {
  1895. src: 'https://2ds.le5le.com/img/banner1.bc890350.png',
  1896. },
  1897. {
  1898. src: 'https://2ds.le5le.com/img/banner2.adab6a6e.png',
  1899. },
  1900. {
  1901. src: 'https://2ds.le5le.com/img/banner3.86b53aed.png',
  1902. },
  1903. ],
  1904. hiddenText: true,
  1905. props: {
  1906. custom: [
  1907. {
  1908. key: 'data',
  1909. label: '数据',
  1910. type: 'code',
  1911. },
  1912. ],
  1913. },
  1914. },
  1915. },
  1916. {
  1917. name: '轮播页面',
  1918. icon: 'l-lunboyemian',
  1919. data: {
  1920. name: 'leSwiper',
  1921. width: 400,
  1922. height: 300,
  1923. swiperType: 'iframe',
  1924. data: [
  1925. {
  1926. src: 'https://2d.le5le.com/preview?id=6357a9e2d44b9402de84d2e8',
  1927. },
  1928. {
  1929. src: 'https://2d.le5le.com/preview?id=6357aec8d44b9402de84d2f1',
  1930. },
  1931. {
  1932. src: 'https://2d.le5le.com/preview?id=641d524a8df2c654ea652d7e',
  1933. },
  1934. ],
  1935. hiddenText: true,
  1936. props: {
  1937. custom: [
  1938. {
  1939. key: 'data',
  1940. label: '数据',
  1941. type: 'code',
  1942. },
  1943. ],
  1944. },
  1945. },
  1946. },
  1947. ],
  1948. },
  1949. {
  1950. name: '导航',
  1951. show: true,
  1952. list: [
  1953. {
  1954. name: '链接',
  1955. icon: 'l-lianjie',
  1956. data: {
  1957. text: '乐吾乐2D编辑器',
  1958. width: 100,
  1959. height: 30,
  1960. name: 'text',
  1961. textColor: '#0052d9',
  1962. events: [
  1963. {
  1964. where: {
  1965. type: null,
  1966. },
  1967. name: 'click',
  1968. action: 0,
  1969. params: '_blank',
  1970. value: 'https://2d.le5le.com/',
  1971. fn: null,
  1972. },
  1973. ],
  1974. },
  1975. },
  1976. {
  1977. name: '返回',
  1978. icon: 'l-fanhui',
  1979. data: {
  1980. width: 40,
  1981. height: 40,
  1982. name: 'image',
  1983. icon: '\ue697',
  1984. iconFamily: 'l-icon',
  1985. events: [
  1986. {
  1987. action: 5,
  1988. name: 'click',
  1989. value: 'window.history.go(-1);',
  1990. where: { type: null },
  1991. },
  1992. ],
  1993. },
  1994. },
  1995. {
  1996. name: '锚点',
  1997. icon: 'l-anchor',
  1998. data: {
  1999. width: 40,
  2000. height: 40,
  2001. name: 'image',
  2002. icon: '\uea7b',
  2003. iconFamily: 'l-icon',
  2004. events: [
  2005. {
  2006. action: 5,
  2007. name: 'click',
  2008. params: 'pen.id/tag',
  2009. value:
  2010. 'let pens = context.meta2d.find(params);\r\nif (!pens.length) {\r\n pens = [pen]\r\n}\r\ncontext.meta2d.active(pens, true);\r\ncontext.meta2d.gotoView(pens[0]);\r\ncontext.meta2d.resize();\r\ncontext.meta2d.render();',
  2011. where: { type: null },
  2012. },
  2013. ],
  2014. },
  2015. },
  2016. {
  2017. name: '回到顶部',
  2018. icon: 'l-huidaodingbu',
  2019. data: {
  2020. width: 64,
  2021. height: 64,
  2022. name: 'rectangle',
  2023. activeBackground: '#eee',
  2024. background: 'rgba(255, 255, 255, 1)',
  2025. borderRadius: 0.1,
  2026. color: '#eee',
  2027. hoverBackground: '#eee',
  2028. hoverColor: '#eee',
  2029. hoverTextColor: '#c5c5c5',
  2030. iconAlign: 'top',
  2031. iconColor: 'rgba(0, 0, 0, 1)',
  2032. iconSize: 20,
  2033. iconTop: 10,
  2034. text: 'TOP',
  2035. textBaseline: 'bottom',
  2036. textColor: '#c5c5c5',
  2037. textTop: -2,
  2038. icon: '\ue6a6',
  2039. iconFamily: 'l-icon',
  2040. events: [
  2041. {
  2042. action: 5,
  2043. name: 'click',
  2044. // params: 'pen.id/tag',
  2045. value: `
  2046. const { scale, origin, y: dataY } = context.meta2d.store.data;
  2047. context.meta2d.translate(
  2048. 0,
  2049. ((parseInt(params)||32) * context.meta2d.store.data.scale - origin.y) / scale - dataY / scale
  2050. );`,
  2051. where: { type: null },
  2052. },
  2053. ],
  2054. },
  2055. },
  2056. {
  2057. name: '面包屑',
  2058. icon: 'l-pc', //l-mianbaoxie
  2059. data: {
  2060. width: 200,
  2061. height: 200,
  2062. },
  2063. },
  2064. {
  2065. name: '下拉菜单',
  2066. icon: 'l-xialacaidan',
  2067. data: {
  2068. name: 'leHeadMenu',
  2069. width: 650,
  2070. height: 60,
  2071. externElement: true,
  2072. selectedKeys: ['1'],
  2073. activeColor: '#4E85E5',
  2074. data: [
  2075. {
  2076. key: '1',
  2077. icon: 't-icon t-align-top',
  2078. title: '平台中心',
  2079. children: [
  2080. {
  2081. key: '1-1',
  2082. icon: 't-icon t-align-top',
  2083. title: '测试测试',
  2084. },
  2085. ],
  2086. },
  2087. {
  2088. key: '2',
  2089. icon: 't-icon t-04',
  2090. title: '安全运行',
  2091. },
  2092. {
  2093. key: '3',
  2094. icon: 't-icon t-warn',
  2095. title: '智慧能源',
  2096. },
  2097. {
  2098. key: '4',
  2099. icon: 't-icon t-line-chart',
  2100. title: '数据分析',
  2101. },
  2102. {
  2103. key: '5',
  2104. icon: 't-icon t-pie-chart',
  2105. title: '运维管理',
  2106. },
  2107. {
  2108. key: '6',
  2109. icon: 't-icon t-dashboard-chart',
  2110. title: '资产设置',
  2111. },
  2112. ],
  2113. },
  2114. },
  2115. {
  2116. name: '导航菜单',
  2117. icon: 'l-daohangcaidan',
  2118. data: {
  2119. name: 'leMenu',
  2120. width: 200,
  2121. height: 400,
  2122. externElement: true,
  2123. data: [
  2124. {
  2125. title: '实时监测',
  2126. key: '0',
  2127. show: true,
  2128. icon: 't-icon t-10',
  2129. children: [
  2130. {
  2131. title: '站点看板',
  2132. key: '',
  2133. show: true,
  2134. children: [
  2135. {
  2136. title: '三级标题',
  2137. key: '',
  2138. show: true,
  2139. },
  2140. {
  2141. title: '三级标题',
  2142. key: '',
  2143. show: true,
  2144. },
  2145. ],
  2146. },
  2147. {
  2148. title: '监控画面',
  2149. key: '',
  2150. show: true,
  2151. },
  2152. {
  2153. title: '设备监控',
  2154. key: '',
  2155. show: true,
  2156. },
  2157. {
  2158. title: '变压器监测',
  2159. key: '',
  2160. show: true,
  2161. },
  2162. ],
  2163. },
  2164. {
  2165. title: '控制中心',
  2166. key: '',
  2167. show: true,
  2168. },
  2169. {
  2170. title: '告警管理',
  2171. key: '',
  2172. show: true,
  2173. },
  2174. ],
  2175. expand: true,
  2176. },
  2177. },
  2178. {
  2179. name: '分页',
  2180. icon: 'l-pc', //l-fenye
  2181. data: {
  2182. name: 'lePagination',
  2183. width: 300,
  2184. height: 200,
  2185. size: 'small',
  2186. total:25,
  2187. pageSize:5,
  2188. current:1,
  2189. maxPageBtn:5,
  2190. pageSizeOptions:[5,10,20,30],
  2191. props: {
  2192. custom: [
  2193. {
  2194. key: 'total',
  2195. label: '数据总条数',
  2196. type: 'number',
  2197. min: 0,
  2198. },
  2199. {
  2200. key: 'pageSize',
  2201. label: '每页数据量',
  2202. type: 'number',
  2203. },
  2204. {
  2205. key: 'pageSizeOptions',
  2206. label: '分页大小控制器',
  2207. type: 'Array',
  2208. },
  2209. {
  2210. key: 'maxPageBtn',
  2211. label: '最多显示页码按钮数',
  2212. type: 'number',
  2213. },
  2214. ],
  2215. },
  2216. },
  2217. },
  2218. {
  2219. name: '步骤条',
  2220. icon: 'l-buzhoutiao',
  2221. data: {
  2222. name: 'steps',
  2223. width: 500,
  2224. height: 40,
  2225. hiddenText: true,
  2226. direction: 'horizontal',
  2227. labelAlign: '', //left/right/alternate/top/bottom
  2228. mode: 'alternate', //alternate
  2229. current: 2,
  2230. data: [
  2231. {
  2232. label: '已完成的步骤',
  2233. content: '内容',
  2234. // 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',
  2235. },
  2236. {
  2237. label: '已完成的步骤',
  2238. content: '内容',
  2239. },
  2240. {
  2241. label: '进行中的步骤',
  2242. content: '内容',
  2243. },
  2244. {
  2245. label: '未进行中的步骤',
  2246. content: '内容',
  2247. },
  2248. {
  2249. label: '未进行中的步骤',
  2250. content: '内容',
  2251. },
  2252. ],
  2253. },
  2254. },
  2255. {
  2256. name: '选项卡',
  2257. icon: 'l-xuanxiangka',
  2258. data: {
  2259. name: 'leTab',
  2260. width: 500,
  2261. height: 50,
  2262. direction: 'horizontal',
  2263. selectKey: '1',
  2264. selectedKeys: [],
  2265. theme: '',
  2266. data: [
  2267. { text: '场景一', key: '0', isForbidden: true },
  2268. { text: '场景二', key: '1' },
  2269. { text: '场景三', key: '2' },
  2270. { text: '场景四', key: '3' },
  2271. ],
  2272. },
  2273. },
  2274. {
  2275. name: '多选选项卡',
  2276. icon: 'l-duoxiangxuanxiangka',
  2277. data: {
  2278. name: 'leTab',
  2279. width: 500,
  2280. height: 50,
  2281. direction: 'horizontal',
  2282. selectedKeys: ['0'],
  2283. theme: 'multiple',
  2284. data: [
  2285. { text: '场景一', key: '0' },
  2286. { text: '场景二', key: '1', isForbidden: true },
  2287. { text: '场景三', key: '2' },
  2288. { text: '场景四', key: '3' },
  2289. ],
  2290. },
  2291. },
  2292. ],
  2293. },
  2294. {
  2295. name: '输入',
  2296. show: true,
  2297. list: [
  2298. {
  2299. name: '按钮',
  2300. icon: 'l-anniu',
  2301. data: {
  2302. name: 'rectangle',
  2303. x: 300,
  2304. y: 200,
  2305. width: 80,
  2306. height: 30,
  2307. disableAnchor: true,
  2308. borderRadius: 2,
  2309. text: '按钮',
  2310. activeBackground: '#40a9ff',
  2311. activeColor: '#40a9ff',
  2312. background: '#1890ff',
  2313. color: '#1890ff',
  2314. hoverBackground: '#40a9ff',
  2315. hoverColor: '#40a9ff',
  2316. textColor: '#ffffff',
  2317. hoverTextColor: '#ffffff',
  2318. activeTextColor: '#ffffff',
  2319. },
  2320. },
  2321. {
  2322. name: '文本输入框',
  2323. icon: 'l-wenbenshurukuang',
  2324. data: {
  2325. x: 100,
  2326. y: 100,
  2327. height: 40,
  2328. width: 200,
  2329. disableAnchor: true,
  2330. name: 'rectangle',
  2331. borderRadius: 0.05,
  2332. input: true,
  2333. ellipsis: true,
  2334. text: '输入文本',
  2335. textAlign: 'left',
  2336. // color: '#D9D9D9FF',
  2337. // textColor: '#000000FF',
  2338. // hoverTextColor: '#000000FF',
  2339. // activeTextColor: '#000000FF',
  2340. textLeft: 10,
  2341. },
  2342. },
  2343. {
  2344. name: '数字输入框',
  2345. icon: 'l-shuzishurukuang',
  2346. data: {
  2347. x: 100,
  2348. y: 100,
  2349. height: 40,
  2350. width: 200,
  2351. disableAnchor: true,
  2352. name: 'rectangle',
  2353. borderRadius: 0.05,
  2354. input: true,
  2355. ellipsis: true,
  2356. text: '输入数字',
  2357. textAlign: 'left',
  2358. // color: '#D9D9D9FF',
  2359. // textColor: '#000000FF',
  2360. // hoverTextColor: '#000000FF',
  2361. // activeTextColor: '#000000FF',
  2362. textLeft: 10,
  2363. events: [
  2364. {
  2365. action: 5,
  2366. name: 'inactive',
  2367. value:
  2368. 'context.meta2d.setValue({ id: pen.id, text: parseFloat(pen.text) }, { doEvent: false });',
  2369. where: { type: null },
  2370. },
  2371. ],
  2372. },
  2373. },
  2374. {
  2375. name: '单选框',
  2376. icon: 'l-danxuanxiang',
  2377. data: {
  2378. name: 'leRadio',
  2379. width: 300,
  2380. height: 30,
  2381. disableAnchor: true,
  2382. direction: 'horizontal', // 'vertical', //'horizontal',
  2383. theme: '',
  2384. itemPosition: [],
  2385. data: [
  2386. { key: '1', text: '选项一', isForbidden: true },
  2387. { key: '2', text: '选项示例二' },
  2388. { key: '3', text: '选项三' },
  2389. ],
  2390. selectKey: '2',
  2391. },
  2392. },
  2393. {
  2394. name: '多选框',
  2395. icon: 'l-duoxuanxiang',
  2396. data: {
  2397. name: 'leCheckBox',
  2398. width: 300,
  2399. height: 30,
  2400. direction: 'horizontal', // 'vertical', //'horizontal',
  2401. theme: '',
  2402. data: [
  2403. { key: '1', text: '选项一', isForbidden: true },
  2404. { key: '2', text: '选项示例二' },
  2405. { key: '3', text: '选项三' },
  2406. ],
  2407. selectedKeys: ['2', '3'],
  2408. },
  2409. },
  2410. {
  2411. name: '下拉选择器',
  2412. icon: 'l-xialaxuanzekuang',
  2413. data: {
  2414. x: 100,
  2415. y: 100,
  2416. height: 40,
  2417. width: 200,
  2418. disableAnchor: true,
  2419. name: 'rectangle',
  2420. borderRadius: 0.05,
  2421. ellipsis: true,
  2422. text: '选项1',
  2423. textAlign: 'left',
  2424. input: true,
  2425. color: '#D9D9D9FF',
  2426. textColor: '#000000FF',
  2427. hoverTextColor: '#000000FF',
  2428. activeTextColor: '#000000FF',
  2429. textLeft: 10,
  2430. dropdownList: [
  2431. {
  2432. text: '选项1',
  2433. },
  2434. {
  2435. text: '选项2',
  2436. },
  2437. {
  2438. text: '选项3',
  2439. },
  2440. ],
  2441. },
  2442. },
  2443. {
  2444. name: '时间选择器',
  2445. icon: 'l-shijianxuanzekuang',
  2446. data: {
  2447. name: 'leInput',
  2448. width: 200,
  2449. height: 32,
  2450. externElement: true,
  2451. prefix: false,
  2452. suffix: false,
  2453. inputType: 'time',
  2454. hiddenText: true,
  2455. },
  2456. },
  2457. {
  2458. name: '日期选择器',
  2459. icon: 'l-riqixuanzekuang',
  2460. data: {
  2461. name: 'leInput',
  2462. width: 200,
  2463. height: 32,
  2464. externElement: true,
  2465. prefix: false,
  2466. suffix: false,
  2467. inputType: 'date',
  2468. hiddenText: true,
  2469. },
  2470. },
  2471. {
  2472. name: '颜色选择器',
  2473. icon: 'l-yansexuanzekuang',
  2474. data: {
  2475. name: 'leInput',
  2476. width: 200,
  2477. height: 32,
  2478. externElement: true,
  2479. prefix: false,
  2480. suffix: false,
  2481. inputType: 'color',
  2482. hiddenText: true,
  2483. },
  2484. },
  2485. {
  2486. name: '开关',
  2487. icon: 'l-kaiguan',
  2488. data: {
  2489. name: 'switch',
  2490. disableAnchor: true,
  2491. height: 30,
  2492. width: 60,
  2493. checked: true,
  2494. offColor: '#BFBFBF',
  2495. onColor: '#1890ff',
  2496. disableOffColor: '#E5E5E5',
  2497. disableOnColor: '#A3D3FF',
  2498. hoverBackground: '#40a9ff',
  2499. },
  2500. },
  2501. {
  2502. name: '滑块',
  2503. icon: 'l-huakuai',
  2504. data: {
  2505. anchors: [],
  2506. disableAnchor: true,
  2507. name: 'slider',
  2508. width: 300,
  2509. height: 20,
  2510. value: 10,
  2511. textWidth: 50,
  2512. barHeight: 4,
  2513. min: 0,
  2514. max: 100,
  2515. color: '#1890ff',
  2516. background: '#D4D6D9',
  2517. textColor: '#222222',
  2518. unit: '%',
  2519. },
  2520. },
  2521. ],
  2522. },
  2523. {
  2524. name: '工控',
  2525. show: true,
  2526. list: [
  2527. {
  2528. name: '圆柱水位',
  2529. icon: 'l-yuanzhushuiwei',
  2530. data: {
  2531. name: 'waterTank',
  2532. width: 100,
  2533. height: 100,
  2534. disableAnchor: true,
  2535. color: '#FFFFFF00',
  2536. progress: 0.5,
  2537. progressColor: '#00a9e6',
  2538. },
  2539. },
  2540. {
  2541. name: '球形水位',
  2542. icon: 'l-qiuxingshuiwei',
  2543. data: {
  2544. name: 'watermeter',
  2545. width: 100,
  2546. height: 100,
  2547. disableAnchor: true,
  2548. background: '#faad14',
  2549. value: 50,
  2550. max: 70,
  2551. min: 20,
  2552. maxBackground: '#f5222d',
  2553. minBackground: '#52c41a',
  2554. // maxText: 'max',
  2555. // minText: 'min',
  2556. scaleShow: false,
  2557. },
  2558. },
  2559. {
  2560. name: '指示灯',
  2561. icon: 'l-zhishideng',
  2562. data: {
  2563. name: 'indicatorLight',
  2564. width: 100,
  2565. height: 100,
  2566. displayStatus: 0, //显示状态 默认 方形 圆形
  2567. background: '#5ac8f7',
  2568. color: '#5ac8f7',
  2569. hiddenText: true,
  2570. frames: [
  2571. {
  2572. background: '#f53e6c',
  2573. color: '#f53e6c',
  2574. bkType: 0,
  2575. duration: 200,
  2576. strokeType: 0,
  2577. visible: true,
  2578. },
  2579. {
  2580. background: '#5ac8f7',
  2581. color: '#5ac8f7',
  2582. bkType: 0,
  2583. duration: 200,
  2584. strokeType: 0,
  2585. visible: true,
  2586. },
  2587. ],
  2588. animateType: 'custom',
  2589. },
  2590. },
  2591. {
  2592. name: '圆形按钮',
  2593. icon: 'l-pc', //l-yuanxinganniu
  2594. data: {},
  2595. },
  2596. {
  2597. name: '船型开关',
  2598. icon: 'l-chuanxingkaiguan',
  2599. data: {
  2600. name: 'rockerSwitch',
  2601. width: 72,
  2602. height: 128,
  2603. disableInput: true,
  2604. offColor: '#BFBFBF',
  2605. onColor: '#1890ff',
  2606. color: '#4583FF', //66 33
  2607. background: '#4583FF33',
  2608. },
  2609. },
  2610. {
  2611. name: '转换开关',
  2612. icon: 'l-pc', //l-zhuanhuankaiguan
  2613. data: {},
  2614. },
  2615. {
  2616. name: '闸刀',
  2617. icon: 'l-zhadao',
  2618. data: {
  2619. name: 'knifeSwitch',
  2620. width: 100,
  2621. height: 100,
  2622. switch: false,
  2623. color: '#0AECA140',
  2624. background: '#748E9140',
  2625. events: [
  2626. {
  2627. action: 5,
  2628. name: 'click',
  2629. value: 'window.meta2d.setValue({id:pen.id,switch:!pen.switch});',
  2630. },
  2631. ],
  2632. },
  2633. },
  2634. {
  2635. name: '拨动开关',
  2636. icon: 'l-bodongkaiguan',
  2637. data: {
  2638. name: 'toggleSwitch',
  2639. width: 100,
  2640. height: 100,
  2641. switch: false,
  2642. color: '#0AECA140',
  2643. background: '#748E9140',
  2644. events: [
  2645. {
  2646. action: 5,
  2647. name: 'click',
  2648. value:
  2649. 'window.meta2d.setValue({id:pen.id,switch:!pen.switch});window.meta2d.render()',
  2650. },
  2651. ],
  2652. },
  2653. },
  2654. {
  2655. name: '空气开关',
  2656. icon: 'l-kongqikaiguan',
  2657. data: {
  2658. name: 'airSwitch',
  2659. width: 180,
  2660. height: 240,
  2661. switch: true,
  2662. color: '#748E9173',
  2663. background: '#748E9140',
  2664. },
  2665. },
  2666. {
  2667. name: '水柱温度计',
  2668. icon: 'l-shuizhuwendu',
  2669. data: {
  2670. name: 'thermometer',
  2671. width: 100,
  2672. height: 300,
  2673. disableAnchor: true,
  2674. background: '#F40',
  2675. value: 10,
  2676. min: -20,
  2677. max: 20,
  2678. },
  2679. },
  2680. {
  2681. name: '扁平温度计',
  2682. icon: 'l-bianpingwendu',
  2683. data: {
  2684. name: 'thermometer1',
  2685. width: 200,
  2686. height: 300,
  2687. disableAnchor: true,
  2688. backgroundColor: '#666',
  2689. value: 0,
  2690. min: -20,
  2691. max: 20,
  2692. markColor: '#fff',
  2693. barrelColor: '#624',
  2694. barrelShowColor: '#d26',
  2695. fontColor: '#fff',
  2696. sub: 5,
  2697. barrel: {
  2698. x: 0.3,
  2699. y: 0.2,
  2700. width: 0.2,
  2701. height: 7 / 9,
  2702. },
  2703. },
  2704. },
  2705. ],
  2706. },
  2707. ];
  2708. export const cases: any[] = [
  2709. { name: '智慧物联' },
  2710. { name: '电力能源' },
  2711. { name: '智慧水务' },
  2712. { name: '智慧工厂' },
  2713. { name: '智慧校园' },
  2714. { name: '智慧园区' },
  2715. { name: '智慧交通' },
  2716. { name: '智慧城市' },
  2717. { name: '智慧农业' },
  2718. { name: '电信机房' },
  2719. { name: '航天航空' },
  2720. { name: '智能家居' },
  2721. ];
  2722. export const templates: any[] = [
  2723. { name: '主题', list: [] },
  2724. { name: '布局', list: [] },
  2725. ];