defaults.ts 92 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761
  1. import { Pen, FormItem } from '@meta2d/core';
  2. import { cdn } from './api';
  3. const getRootDomain = ()=>{
  4. const a =location.host.split('.');
  5. return `.${a[a.length-2]}.${a[a.length-1]}`
  6. };
  7. export let rootDomain = getRootDomain().indexOf('localhost')!==-1?'.le5le.com':getRootDomain();
  8. export const fromArrows = [
  9. { icon: '#l-line', value: '' },
  10. { icon: '#l-from-triangle', value: 'triangle' },
  11. { icon: '#l-from-diamond', value: 'diamond' },
  12. { icon: '#l-from-circle', value: 'circle' },
  13. { icon: '#l-from-lineDown', value: 'lineDown' },
  14. { icon: '#l-from-lineUp', value: 'lineUp' },
  15. { icon: '#l-from-triangleSolid', value: 'triangleSolid' },
  16. { icon: '#l-from-diamondSolid', value: 'diamondSolid' },
  17. { icon: '#l-from-circleSolid', value: 'circleSolid' },
  18. { icon: '#l-from-line', value: 'line' },
  19. ];
  20. export const toArrows = [
  21. { icon: '#l-line', value: '' },
  22. { icon: '#l-to-triangle', value: 'triangle' },
  23. { icon: '#l-to-diamond', value: 'diamond' },
  24. { icon: '#l-to-circle', value: 'circle' },
  25. { icon: '#l-to-lineDown', value: 'lineDown' },
  26. { icon: '#l-to-lineUp', value: 'lineUp' },
  27. { icon: '#l-to-triangleSolid', value: 'triangleSolid' },
  28. { icon: '#l-to-diamondSolid', value: 'diamondSolid' },
  29. { icon: '#l-to-circleSolid', value: 'circleSolid' },
  30. { icon: '#l-to-line', value: 'line' },
  31. ];
  32. export const lineDashObj = [
  33. undefined,
  34. [5, 5],
  35. [10, 10],
  36. [10, 10, 2, 10],
  37. [1, 16],
  38. ];
  39. /**
  40. * 默认动画
  41. */
  42. export const normalAnimate: any = {
  43. upDown: [
  44. {
  45. y: -10,
  46. duration: 100,
  47. },
  48. { y: 0, duration: 100 },
  49. { y: -10, duration: 200 },
  50. ],
  51. leftRight: [
  52. {
  53. x: -10,
  54. duration: 100,
  55. },
  56. {
  57. x: 10,
  58. duration: 80,
  59. },
  60. {
  61. x: -10,
  62. duration: 50,
  63. },
  64. {
  65. x: 10,
  66. duration: 30,
  67. },
  68. {
  69. x: 0,
  70. duration: 300,
  71. },
  72. ],
  73. heart: [
  74. {
  75. // 通过 scale 来替代原版心跳
  76. scale: 1.1,
  77. duration: 100,
  78. },
  79. {
  80. scale: 1,
  81. duration: 400,
  82. },
  83. ],
  84. success: [{ background: '#389e0d22', color: '#237804', duration: 500 }],
  85. warning: [
  86. {
  87. color: '#fa8c16',
  88. lineDash: [10, 10],
  89. duration: 300,
  90. },
  91. {
  92. color: '#fa8c16',
  93. lineDash: undefined,
  94. duration: 500,
  95. },
  96. {
  97. color: '#fa8c16',
  98. lineDash: [10, 10],
  99. duration: 300,
  100. },
  101. ],
  102. error: [{ color: '#cf1322', background: '#cf132222', duration: 100 }],
  103. show: [
  104. {
  105. color: '#fa541c',
  106. rotate: -10,
  107. duration: 100,
  108. },
  109. {
  110. color: '#fa541c',
  111. rotate: 10,
  112. duration: 100,
  113. },
  114. {
  115. color: '#fa541c',
  116. rotate: 0,
  117. duration: 100,
  118. },
  119. ],
  120. rotate: [
  121. {
  122. rotate: 360,
  123. duration: 1000,
  124. },
  125. ],
  126. };
  127. export const defaultFormat: Pen = {
  128. borderRadius: 0,
  129. rotate: 0,
  130. paddingLeft: 0,
  131. paddingRight: 0,
  132. paddingTop: 0,
  133. paddingBottom: 0,
  134. progress: 0,
  135. progressColor: '#fff0',
  136. verticalProgress: false,
  137. flipX: false,
  138. flipY: false,
  139. input: false,
  140. lineDash: [],
  141. lineCap: 'round',
  142. lineJoin: 'round',
  143. strokeType: 0,
  144. lineGradientFromColor: undefined,
  145. lineGradientToColor: undefined,
  146. lineGradientAngle: 0,
  147. // color: "#222",
  148. hoverColor: undefined,
  149. activeColor: undefined,
  150. lineWidth: 1,
  151. bkType: 0,
  152. gradientFromColor: undefined,
  153. gradientToColor: undefined,
  154. gradientAngle: 0,
  155. gradientRadius: 0,
  156. hoverBackground: undefined,
  157. activeBackground: undefined,
  158. globalAlpha: 1,
  159. anchorColor: undefined,
  160. anchorRadius: 0,
  161. shadowColor: undefined,
  162. shadowBlur: 0,
  163. shadowOffsetX: 0,
  164. shadowOffsetY: 0,
  165. textHasShadow: undefined,
  166. fontFamily: undefined,
  167. fontSize: 0,
  168. textColor: undefined,
  169. hoverTextColor: undefined,
  170. activeTextColor: undefined,
  171. textBackground: undefined,
  172. fontStyle: undefined,
  173. fontWeight: undefined,
  174. textAlign: undefined,
  175. textBaseline: undefined,
  176. lineHeight: 0,
  177. whiteSpace: undefined,
  178. textWidth: 0,
  179. textHeight: 0,
  180. textLeft: 0,
  181. textTop: 0,
  182. ellipsis: false,
  183. hiddenText: false,
  184. keepDecimal: 0,
  185. borderWidth: 0,
  186. borderColor: undefined,
  187. animateLineWidth: 0,
  188. lineAnimateType: 0,
  189. frames: [],
  190. animateColor: undefined,
  191. // animateType: undefined,
  192. animateReverse: false,
  193. background: '#fff0',
  194. gradientColors: undefined,
  195. lineGradientColors: undefined,
  196. gradientSmooth: 0,
  197. };
  198. export interface FormItemType extends FormItem {
  199. key: string; // 属性标识,绑定变量时使用
  200. key2?: string; // 有些属性存在嵌套
  201. name: string; // 标题
  202. tips?: string; // 提示
  203. placeholder?: string; // input placeholder
  204. type:
  205. | 'text' // string 类型输入框
  206. | 'number'
  207. | 'color'
  208. | 'textarea'
  209. | 'select'
  210. | 'switch'
  211. | 'code'
  212. | 'image'
  213. | 'icon'
  214. | 'slider'
  215. | 'autoComplete'
  216. | 'label'; // 文字,不含输入框;
  217. options?: {
  218. // 选项
  219. label: string; // 选项的标题,可以使用 html
  220. value: any; // 选项的值
  221. disabled?: boolean;
  222. }[];
  223. min?: number; // 最小值
  224. max?: number; // 最大值
  225. step?: number; // 步长
  226. rows?: number; // textarea 所需要的行数
  227. iconFamily?: string; // icon 类型节点需要
  228. title?: string; // code 类型编辑器需要
  229. language?: 'javascript' | 'json' | 'markdown'; // code 编辑器需要
  230. readonly?: boolean; // 是否只读
  231. mode?: 'multiple' | 'tags'; // select 选项
  232. isNotString?: boolean; // monaco 需要 string 类型的 code ,不是 string 协助转换
  233. multiple?: boolean; // 绑定多个属性
  234. isTime?: boolean; // 是否是时序的, undefined 不会出现 历史趋势 的 checkbox
  235. isYCategory?: boolean; // y 轴是否是分类,true y 轴分类,false x 轴分类,undefined 不会出现 y轴分类轴 的 checkbox
  236. // 绑定单个属性是对象, 多个数组
  237. // dataIds?: BindId | BindId[]; // 关联业务数据
  238. precision?: number; //精度
  239. gradient?: boolean; //是否为渐变色
  240. hidden?: boolean; //是否隐藏
  241. }
  242. export const iframeCustom = [
  243. {
  244. key: 'iframe',
  245. label: '网页地址',
  246. type: 'string',
  247. },
  248. {
  249. key: 'zIndex',
  250. label: 'dom层级(z-index)',
  251. type: 'number',
  252. min: 0,
  253. placeholder: '默认4',
  254. },
  255. {
  256. key: 'operationalRect.x',
  257. label: '可操作x',
  258. type: 'number',
  259. min: 0,
  260. max: 1,
  261. placeholder: '范围0-1',
  262. },
  263. {
  264. key: 'operationalRect.y',
  265. label: '可操作y',
  266. type: 'number',
  267. min: 0,
  268. max: 1,
  269. placeholder: '范围0-1',
  270. },
  271. {
  272. key: 'operationalRect.width',
  273. label: '可操作宽度',
  274. type: 'number',
  275. min: 0,
  276. max: 1,
  277. placeholder: '范围0-1',
  278. },
  279. {
  280. key: 'operationalRect.height',
  281. label: '可操作高度',
  282. type: 'number',
  283. min: 0,
  284. max: 1,
  285. placeholder: '范围0-1',
  286. },
  287. {
  288. key: 'blur',
  289. label: '背景模糊',
  290. type: 'number',
  291. min: 0,
  292. },
  293. {
  294. key: 'blurBackground',
  295. label: '毛玻璃颜色',
  296. type: 'color',
  297. },
  298. ];
  299. export const shapes = [
  300. {
  301. name: '基本形状',
  302. show: true,
  303. list: [
  304. {
  305. name: '正方形',
  306. icon: 'l-rect',
  307. id: 1,
  308. data: {
  309. width: 100,
  310. height: 100,
  311. name: 'square',
  312. },
  313. },
  314. {
  315. name: '矩形',
  316. icon: 'l-rectangle',
  317. id: 2,
  318. data: {
  319. width: 200,
  320. height: 50,
  321. borderRadius: 0.1,
  322. name: 'rectangle',
  323. },
  324. },
  325. {
  326. name: '圆',
  327. icon: 'l-circle',
  328. id: 3,
  329. data: {
  330. width: 100,
  331. height: 100,
  332. name: 'circle',
  333. },
  334. },
  335. {
  336. name: '三角形',
  337. icon: 'l-triangle',
  338. id: 4,
  339. data: {
  340. width: 100,
  341. height: 100,
  342. name: 'triangle',
  343. },
  344. },
  345. {
  346. name: '菱形',
  347. icon: 'l-diamond',
  348. id: 5,
  349. data: {
  350. width: 100,
  351. height: 100,
  352. name: 'diamond',
  353. },
  354. },
  355. {
  356. name: '五边形',
  357. icon: 'l-pentagon',
  358. id: 6,
  359. data: {
  360. width: 100,
  361. height: 100,
  362. name: 'pentagon',
  363. },
  364. },
  365. {
  366. name: '六边形',
  367. icon: 'l-hexagon',
  368. id: 7,
  369. data: {
  370. width: 100,
  371. height: 100,
  372. name: 'hexagon',
  373. },
  374. },
  375. {
  376. name: '五角星',
  377. icon: 'l-pentagram',
  378. id: 8,
  379. data: {
  380. width: 100,
  381. height: 100,
  382. name: 'pentagram',
  383. },
  384. },
  385. {
  386. name: '左箭头',
  387. icon: 'l-arrow-left',
  388. id: 9,
  389. data: {
  390. width: 120,
  391. height: 60,
  392. name: 'leftArrow',
  393. },
  394. },
  395. {
  396. name: '右箭头',
  397. icon: 'l-arrow-right',
  398. id: 10,
  399. data: {
  400. width: 120,
  401. height: 60,
  402. name: 'rightArrow',
  403. },
  404. },
  405. {
  406. name: '双向箭头',
  407. icon: 'l-twoway-arrow',
  408. id: 11,
  409. data: {
  410. width: 150,
  411. height: 60,
  412. name: 'twowayArrow',
  413. },
  414. },
  415. {
  416. name: '云',
  417. icon: 'l-cloud',
  418. id: 13,
  419. data: {
  420. width: 100,
  421. height: 100,
  422. name: 'cloud',
  423. },
  424. },
  425. {
  426. name: '消息框',
  427. icon: 'l-msg',
  428. id: 14,
  429. data: {
  430. textTop: -0.1,
  431. width: 100,
  432. height: 100,
  433. name: 'message',
  434. },
  435. },
  436. {
  437. name: '文件',
  438. icon: 'l-file',
  439. id: 15,
  440. data: {
  441. width: 80,
  442. height: 100,
  443. name: 'file',
  444. },
  445. },
  446. {
  447. name: '立方体',
  448. icon: 'l-cube',
  449. id: 18,
  450. data: {
  451. width: 60,
  452. height: 100,
  453. name: 'cube',
  454. z: 0.25,
  455. props: {
  456. custom: [
  457. {
  458. key: 'z',
  459. label: 'Z',
  460. type: 'number',
  461. min: 0,
  462. placeholder: '<= 1 即宽度的比例',
  463. },
  464. {
  465. key: 'backgroundFront',
  466. label: '前背景色',
  467. type: 'color',
  468. },
  469. {
  470. key: 'backgroundUp',
  471. label: '顶背景色',
  472. type: 'color',
  473. },
  474. {
  475. key: 'backgroundRight',
  476. label: '右背景色',
  477. type: 'color',
  478. },
  479. ],
  480. },
  481. },
  482. },
  483. {
  484. name: '人',
  485. icon: 'l-people',
  486. id: 19,
  487. data: {
  488. width: 70,
  489. height: 100,
  490. name: 'people',
  491. },
  492. },
  493. ],
  494. },
  495. {
  496. name: '脑图',
  497. show: true,
  498. list: [
  499. {
  500. name: '主题',
  501. icon: 'l-zhuti',
  502. data: {
  503. text: '主题',
  504. width: 200,
  505. height: 50,
  506. name: 'mindNode',
  507. borderRadius: 0.5,
  508. },
  509. },
  510. {
  511. name: '子主题',
  512. icon: 'l-zizhuti',
  513. data: {
  514. text: '子主题',
  515. width: 160,
  516. height: 40,
  517. name: 'mindLine',
  518. },
  519. },
  520. ],
  521. },
  522. {
  523. name: '流程图',
  524. show: true,
  525. list: [
  526. {
  527. name: '开始/结束',
  528. icon: 'l-flow-start',
  529. id: 21,
  530. data: {
  531. text: '开始/结束',
  532. width: 120,
  533. height: 40,
  534. borderRadius: 0.5,
  535. name: 'rectangle',
  536. },
  537. },
  538. {
  539. name: '流程',
  540. icon: 'l-rectangle',
  541. id: 22,
  542. data: {
  543. text: '流程',
  544. width: 120,
  545. height: 40,
  546. name: 'rectangle',
  547. },
  548. },
  549. {
  550. name: '判定',
  551. icon: 'l-diamond',
  552. id: 23,
  553. data: {
  554. text: '判定',
  555. width: 120,
  556. height: 60,
  557. name: 'diamond',
  558. },
  559. },
  560. {
  561. name: '数据',
  562. icon: 'l-flow-data',
  563. id: 24,
  564. data: {
  565. text: '数据',
  566. width: 120,
  567. height: 50,
  568. name: 'flowData',
  569. offsetX: 0.14,
  570. form: [
  571. {
  572. key: 'offsetX',
  573. name: '斜率',
  574. type: 'number',
  575. min: 0,
  576. step: 0.1,
  577. placeholder: '<= 1 即宽度的比例',
  578. },
  579. ] as FormItemType[],
  580. },
  581. },
  582. {
  583. name: '准备',
  584. icon: 'l-flow-ready',
  585. id: 25,
  586. data: {
  587. text: '准备',
  588. width: 120,
  589. height: 50,
  590. name: 'hexagon',
  591. },
  592. },
  593. {
  594. name: '子流程',
  595. icon: 'l-flow-subprocess',
  596. id: 26,
  597. data: {
  598. text: '子流程',
  599. width: 120,
  600. height: 50,
  601. name: 'flowSubprocess',
  602. },
  603. },
  604. {
  605. name: '数据库',
  606. icon: 'l-db',
  607. id: 27,
  608. data: {
  609. text: '数据库',
  610. width: 80,
  611. height: 120,
  612. name: 'flowDb',
  613. },
  614. },
  615. {
  616. name: '文档',
  617. icon: 'l-flow-document',
  618. id: 28,
  619. data: {
  620. text: '文档',
  621. width: 120,
  622. height: 100,
  623. name: 'flowDocument',
  624. },
  625. },
  626. {
  627. name: '内部存储',
  628. icon: 'l-internal-storage',
  629. id: 29,
  630. data: {
  631. text: '内部存储',
  632. width: 120,
  633. height: 80,
  634. name: 'flowInternalStorage',
  635. },
  636. },
  637. {
  638. name: '外部存储',
  639. icon: 'l-extern-storage',
  640. id: 30,
  641. data: {
  642. text: '外部存储',
  643. width: 120,
  644. height: 80,
  645. name: 'flowExternStorage',
  646. },
  647. },
  648. {
  649. name: '队列',
  650. icon: 'l-flow-queue',
  651. id: 31,
  652. data: {
  653. text: '队列',
  654. width: 100,
  655. height: 100,
  656. name: 'flowQueue',
  657. },
  658. },
  659. {
  660. name: '手动输入',
  661. icon: 'l-flow-manually',
  662. id: 32,
  663. data: {
  664. text: '手动输入',
  665. width: 120,
  666. height: 80,
  667. name: 'flowManually',
  668. },
  669. },
  670. {
  671. name: '展示',
  672. icon: 'l-flow-display',
  673. id: 33,
  674. data: {
  675. text: '展示',
  676. width: 120,
  677. height: 80,
  678. name: 'flowDisplay',
  679. },
  680. },
  681. {
  682. name: '并行模式',
  683. icon: 'l-flow-parallel',
  684. id: 34,
  685. data: {
  686. text: '并行模式',
  687. width: 120,
  688. height: 50,
  689. name: 'flowParallel',
  690. },
  691. },
  692. {
  693. name: '注释',
  694. icon: 'l-flow-comment',
  695. id: 35,
  696. data: {
  697. text: '注释',
  698. width: 100,
  699. height: 100,
  700. name: 'flowComment',
  701. },
  702. },
  703. ],
  704. },
  705. {
  706. name: '活动图',
  707. show: true,
  708. list: [
  709. {
  710. name: '开始',
  711. icon: 'l-inital',
  712. id: 36,
  713. data: {
  714. text: '',
  715. width: 30,
  716. height: 30,
  717. name: 'circle',
  718. background: '#555',
  719. lineWidth: 0,
  720. },
  721. },
  722. {
  723. name: '结束',
  724. icon: 'l-final',
  725. id: 37,
  726. data: {
  727. width: 30,
  728. height: 30,
  729. name: 'activityFinal',
  730. },
  731. },
  732. {
  733. name: '活动',
  734. icon: 'l-action',
  735. id: 38,
  736. data: {
  737. text: '活动',
  738. width: 120,
  739. height: 50,
  740. borderRadius: 0.25,
  741. name: 'rectangle',
  742. },
  743. },
  744. {
  745. name: '决策/合并',
  746. icon: 'l-diamond',
  747. id: 39,
  748. data: {
  749. text: '决策/合并',
  750. width: 120,
  751. height: 50,
  752. name: 'diamond',
  753. },
  754. },
  755. {
  756. name: '垂直泳道',
  757. icon: 'l-swimlane-v',
  758. id: 40,
  759. data: {
  760. text: '垂直泳道',
  761. width: 200,
  762. height: 500,
  763. name: 'swimlaneV',
  764. textBaseline: 'top',
  765. textTop: 20,
  766. // textHeight: ,
  767. lineTop: 0.08,
  768. },
  769. },
  770. {
  771. name: '水平泳道',
  772. icon: 'l-swimlane-h',
  773. id: 41,
  774. data: {
  775. text: '水平泳道',
  776. width: 500,
  777. height: 200,
  778. name: 'swimlaneH',
  779. textWidth: 0.01,
  780. textLeft: 0.04,
  781. textAlign: 'left',
  782. lineLeft: 0.08,
  783. },
  784. },
  785. {
  786. name: '垂直分岔/汇合',
  787. icon: 'l-fork-v',
  788. id: 42,
  789. data: {
  790. text: '垂直分岔/汇合',
  791. width: 10,
  792. height: 150,
  793. name: 'forkV',
  794. fillStyle: '#555',
  795. strokeStyle: 'transparent',
  796. },
  797. },
  798. {
  799. name: '水平分岔/汇合',
  800. icon: 'l-fork',
  801. id: 43,
  802. data: {
  803. text: '水平分岔/汇合',
  804. width: 150,
  805. height: 10,
  806. name: 'forkH',
  807. fillStyle: '#555',
  808. strokeStyle: 'transparent',
  809. },
  810. },
  811. ],
  812. },
  813. {
  814. name: '时序图和类图',
  815. show: true,
  816. list: [
  817. {
  818. name: '生命线',
  819. icon: 'l-lifeline',
  820. id: 44,
  821. data: {
  822. text: '生命线',
  823. width: 150,
  824. height: 400,
  825. textHeight: 50,
  826. name: 'lifeline',
  827. },
  828. },
  829. {
  830. name: '激活',
  831. icon: 'l-focus',
  832. id: 45,
  833. data: {
  834. text: '激活',
  835. width: 12,
  836. height: 200,
  837. name: 'sequenceFocus',
  838. },
  839. },
  840. {
  841. name: '简单类',
  842. icon: 'l-simple-class',
  843. id: 46,
  844. data: {
  845. text: 'Topolgoy',
  846. width: 270,
  847. height: 200,
  848. textHeight: 200,
  849. name: 'simpleClass',
  850. textAlign: 'center',
  851. textBaseline: 'top',
  852. textTop: 10,
  853. list: [
  854. {
  855. text: '- name: string\n+ setName(name: string): void',
  856. },
  857. ],
  858. },
  859. },
  860. {
  861. name: '类',
  862. icon: 'l-class',
  863. id: 47,
  864. data: {
  865. text: 'Topolgoy',
  866. width: 270,
  867. height: 200,
  868. textHeight: 200,
  869. name: 'interfaceClass',
  870. textAlign: 'center',
  871. textBaseline: 'top',
  872. textTop: 10,
  873. list: [
  874. {
  875. text: '- name: string',
  876. },
  877. {
  878. text: '+ setName(name: string): void',
  879. },
  880. ],
  881. },
  882. },
  883. ],
  884. },
  885. {
  886. name: '故障树',
  887. show: true,
  888. list: [
  889. {
  890. name: '与门',
  891. icon: 'l-ANDmen',
  892. data: {
  893. name: 'andGate',
  894. width: 100,
  895. height: 150,
  896. },
  897. },
  898. {
  899. name: '基本事件',
  900. icon: 'l-jibenshijian',
  901. data: {
  902. name: 'basicEvent',
  903. width: 100,
  904. height: 150,
  905. },
  906. },
  907. {
  908. name: '未展开事件',
  909. icon: 'l-weizhankaishijian',
  910. data: {
  911. name: 'unexpandedEvent',
  912. width: 100,
  913. height: 150,
  914. },
  915. },
  916. {
  917. name: '优先AND门',
  918. icon: 'l-youxianANDmen',
  919. data: {
  920. name: 'priorityAndGate',
  921. width: 100,
  922. height: 150,
  923. },
  924. },
  925. {
  926. name: '禁止门',
  927. icon: 'l-jinzhimen',
  928. data: {
  929. name: 'forbiddenGate',
  930. width: 100,
  931. height: 150,
  932. },
  933. },
  934. {
  935. name: '事件',
  936. icon: 'l-shijian',
  937. data: {
  938. name: 'event',
  939. width: 100,
  940. height: 150,
  941. },
  942. },
  943. {
  944. name: '开关事件',
  945. icon: 'l-kaiguanshijian',
  946. data: {
  947. name: 'switchEvent',
  948. width: 100,
  949. height: 150,
  950. },
  951. },
  952. {
  953. name: '条件事件',
  954. icon: 'l-tiaojianshijian',
  955. data: {
  956. name: 'conditionalEvent',
  957. width: 150,
  958. height: 100,
  959. },
  960. },
  961. {
  962. name: '转移符号',
  963. icon: 'l-zhuanyifuhao',
  964. data: {
  965. name: 'transferSymbol',
  966. width: 100,
  967. height: 150,
  968. },
  969. },
  970. {
  971. name: '或门',
  972. icon: 'l-ORmen',
  973. data: {
  974. name: 'orGate',
  975. width: 100,
  976. height: 150,
  977. },
  978. },
  979. {
  980. name: '异或门',
  981. icon: 'l-yihuomen',
  982. data: {
  983. name: 'xorGate',
  984. width: 100,
  985. height: 150,
  986. },
  987. },
  988. {
  989. name: '表决门',
  990. icon: 'l-biaojuemen',
  991. data: {
  992. name: 'votingGate',
  993. width: 100,
  994. height: 150,
  995. },
  996. },
  997. ],
  998. },
  999. ];
  1000. export const formComponents = [
  1001. {
  1002. name: '基础',
  1003. show: true,
  1004. list: [
  1005. {
  1006. name: '文本',
  1007. icon: 'l-wenben',
  1008. data: {
  1009. width: 160,
  1010. height: 30,
  1011. name: 'text',
  1012. text: '乐吾乐le5le - 大屏可视化',
  1013. textAutoAdjust: true,
  1014. props: {
  1015. custom: [
  1016. {
  1017. key: 'textAutoAdjust',
  1018. label: '文本自动大小',
  1019. type: 'bool',
  1020. },
  1021. ],
  1022. },
  1023. },
  1024. },
  1025. {
  1026. name: '数字',
  1027. icon: 'l-shuzi',
  1028. data: {
  1029. width: 160,
  1030. height: 30,
  1031. name: 'text',
  1032. text: '3.1415926',
  1033. keepDecimal: 2,
  1034. },
  1035. },
  1036. {
  1037. name: '进度条',
  1038. icon: 'l-jindutiao',
  1039. data: {
  1040. anchors: [],
  1041. disableAnchor: true,
  1042. name: 'progress',
  1043. width: 164,
  1044. height: 6,
  1045. borderRadius: 0.5,
  1046. progressColor: '#4583FF',
  1047. progress: 0.8,
  1048. background: '#303746',
  1049. disableInput: true,
  1050. lineWidth: 0,
  1051. borderWidth: 0,
  1052. props: {
  1053. custom: [
  1054. {
  1055. key: 'progress',
  1056. label: '进度',
  1057. type: 'number',
  1058. max: 1,
  1059. min: 0,
  1060. },
  1061. {
  1062. key: 'progressColor',
  1063. label: '进度颜色',
  1064. type: 'color',
  1065. },
  1066. ],
  1067. },
  1068. },
  1069. },
  1070. {
  1071. name: '图标',
  1072. icon: 'l-tubiao',
  1073. data: {
  1074. width: 100,
  1075. height: 100,
  1076. name: 'image',
  1077. icon: '\uea86',
  1078. iconFamily: 'l-icon',
  1079. },
  1080. },
  1081. {
  1082. name: '图片',
  1083. icon: 'l-tupian',
  1084. data: {
  1085. width: 100,
  1086. height: 100,
  1087. name: 'image',
  1088. image: (cdn ? cdn + '/v' : import.meta.env.BASE_URL.slice(0,-1)) + '/img/logo.png',
  1089. },
  1090. },
  1091. {
  1092. name: 'GIF',
  1093. icon: 'l-GIF',
  1094. data: {
  1095. width: 100,
  1096. height: 100,
  1097. name: 'gif',
  1098. image: (cdn ? cdn + '/v' : '') + '/png/电信机房/防火墙.gif',
  1099. },
  1100. },
  1101. {
  1102. name: '头像',
  1103. icon: 'l-touxiang',
  1104. data: {
  1105. width: 30,
  1106. height: 30,
  1107. disableAnchor: true,
  1108. name: 'square',
  1109. lineWidth: 0,
  1110. image: (cdn ? cdn + '/v' : '') + '/img/avatar.png',
  1111. imageRadius: 0.5,
  1112. background: '#689f38',
  1113. borderRadius: 0.5,
  1114. ratio: true,
  1115. props: {
  1116. custom: [
  1117. {
  1118. key: 'imageRadius',
  1119. label: '图片圆角半径',
  1120. type: 'slider',
  1121. },
  1122. ],
  1123. },
  1124. },
  1125. },
  1126. {
  1127. name: '徽标',
  1128. icon: 'l-huibiao',
  1129. data: {
  1130. width: 35,
  1131. height: 20,
  1132. name: 'square',
  1133. borderRadius: 0.5,
  1134. lineWidth: 0,
  1135. background: '#d54941',
  1136. color: '#fff',
  1137. text: '99+',
  1138. },
  1139. },
  1140. {
  1141. name: '标签',
  1142. icon: 'l-biaoqian',
  1143. data: {
  1144. text: 'success',
  1145. width: 80,
  1146. height: 24,
  1147. borderRadius: 0.1,
  1148. name: 'rectangle',
  1149. lineWidth: 1,
  1150. fontSize: 12,
  1151. icon: '\uea10',
  1152. iconFamily: 'l-icon',
  1153. iconColor: '#FFFFFF99', //#52c41a
  1154. iconSize: 12,
  1155. iconAlign: 'left',
  1156. iconLeft: 8,
  1157. textAlign: 'right',
  1158. color: '#FFFFFFAA',
  1159. background: '#282E3B', //#f6ffed
  1160. textLeft: -6,
  1161. },
  1162. },
  1163. ],
  1164. },
  1165. {
  1166. name: '音视频',
  1167. show: true,
  1168. list: [
  1169. {
  1170. name: '视频',
  1171. icon: 'l-shipin',
  1172. data: {
  1173. width: 200,
  1174. height: 200,
  1175. externElement: true,
  1176. name: 'video',
  1177. video:
  1178. 'https://video.699pic.com/videos/17/69/11/a_aa3jeKZ0D63g1556176911_10s.mp4',
  1179. props: {
  1180. custom: [
  1181. {
  1182. key: 'video',
  1183. label: '视频地址',
  1184. type: 'string',
  1185. },
  1186. ],
  1187. },
  1188. },
  1189. },
  1190. {
  1191. name: 'FLV视频流',
  1192. icon: 'l-pc',
  1193. data: {
  1194. name: 'flvPlayerDom',
  1195. width: 477,
  1196. height: 268,
  1197. externElement: true,
  1198. video:
  1199. 'https://sf1-hscdn-tos.pstatp.com/obj/media-fe/xgplayer_doc_video/flv/xgplayer-demo-360p.flv',
  1200. mediaDataSource: {},
  1201. optionalConfig: {},
  1202. props: {
  1203. custom: [
  1204. {
  1205. key: 'video',
  1206. label: '视频地址',
  1207. type: 'string',
  1208. },
  1209. {
  1210. key: 'mediaDataSource',
  1211. label: '媒体数据源',
  1212. type: 'code',
  1213. placeholder:
  1214. '具体配置参考:https://github.com/bilibili/flv.js/blob/master/docs/api.md',
  1215. },
  1216. {
  1217. key: 'optionalConfig',
  1218. label: '配置',
  1219. type: 'code',
  1220. placeholder:
  1221. '具体配置参考:https://github.com/bilibili/flv.js/blob/master/docs/api.md',
  1222. },
  1223. ],
  1224. },
  1225. },
  1226. },
  1227. {
  1228. name: '音频',
  1229. icon: 'l-yinpin',
  1230. data: {
  1231. width: 200,
  1232. height: 40,
  1233. externElement: true,
  1234. name: 'video',
  1235. audio: 'https://www.xzmp3.com/down/597caee79849.mp3',
  1236. props: {
  1237. custom: [
  1238. {
  1239. key: 'audio',
  1240. label: '视频地址',
  1241. type: 'string',
  1242. },
  1243. ],
  1244. },
  1245. },
  1246. },
  1247. {
  1248. name: '摄像头',
  1249. icon: 'l-10',
  1250. data: {
  1251. width: 400,
  1252. height: 250,
  1253. name: 'rtspPlayerDom',
  1254. externElement: true,
  1255. mse: true,
  1256. url: '',
  1257. rtspUrl: '',
  1258. props: {
  1259. custom: [
  1260. {
  1261. key: 'mse',
  1262. label: '类型',
  1263. type: 'select',
  1264. options: [
  1265. { label: 'Webrtc(低延迟,仅支持H264格式)', value: false },
  1266. { label: 'MSE(支持H265格式,需最新chrome)', value: true },
  1267. ],
  1268. },
  1269. {
  1270. key: 'url',
  1271. label: '流服务',
  1272. type: 'string',
  1273. },
  1274. {
  1275. key: 'rtspUrl',
  1276. label: 'RTSP URL',
  1277. type: 'string',
  1278. },
  1279. ],
  1280. },
  1281. },
  1282. }
  1283. ],
  1284. },
  1285. {
  1286. name: '时间',
  1287. show: true,
  1288. list: [
  1289. {
  1290. name: '时间',
  1291. icon: 'l-clock',
  1292. data: {
  1293. name: 'time',
  1294. width: 300,
  1295. height: 40,
  1296. text: '当前时间',
  1297. lineWidth: 0,
  1298. fillZero: true,
  1299. timeFormat:
  1300. '`${year}-${month}-${day} ${hours}:${minutes}:${seconds} 星期${week}`',
  1301. props: {
  1302. custom: [
  1303. {
  1304. key: 'timeFormat',
  1305. label: '显示格式',
  1306. type: 'string',
  1307. },
  1308. // {
  1309. // key: 'fillZero',
  1310. // label: '补0',
  1311. // type: 'switch',
  1312. // },
  1313. ],
  1314. },
  1315. },
  1316. },
  1317. {
  1318. name: '倒计时',
  1319. icon: 'l-daojishi',
  1320. data: {
  1321. name: 'countdown',
  1322. width: 300,
  1323. height: 40,
  1324. text: '倒计时',
  1325. // deadline: '2024/1/1 00:00:00', //配置未来的时间
  1326. borderWidth: 0,
  1327. timeFormat:
  1328. '`距离下一年还有:${day}天${hours}时${minutes}分${seconds}秒`',
  1329. props: {
  1330. custom: [
  1331. {
  1332. key: 'timeFormat',
  1333. label: '显示格式',
  1334. type: 'string',
  1335. },
  1336. {
  1337. key: 'deadline',
  1338. label: '截止时间',
  1339. type: 'string',
  1340. },
  1341. ],
  1342. },
  1343. },
  1344. },
  1345. {
  1346. name: '水平时间轴',
  1347. icon: 'l-shuipingshijianzhou',
  1348. data: {
  1349. name: 'timeline',
  1350. width: 300,
  1351. height: 40,
  1352. hiddenText: true,
  1353. direction: 'horizontal',
  1354. labelAlign: 'top', //left/right/alternate/top/bottom
  1355. mode: 'alternate', //alternate
  1356. data: [
  1357. {
  1358. label: '2022-01-01',
  1359. content: '事件一',
  1360. circleBg: '#BFDBFF',
  1361. circleShadow: '#4583FF33',
  1362. color: '#BFDBFF',
  1363. textColor: '#FFFFFF',
  1364. // 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',
  1365. },
  1366. {
  1367. label: '2022-02-01',
  1368. content: '事件二',
  1369. circleBg: '#BFDBFF',
  1370. circleShadow: '#4583FF33',
  1371. textColor: '#FFFFFF',
  1372. },
  1373. {
  1374. label: '2022-03-01',
  1375. content: '事件三',
  1376. textColor: '#FFFFFF66',
  1377. },
  1378. {
  1379. label: '2022-04-01',
  1380. content: '事件四',
  1381. textColor: '#FFFFFF66',
  1382. },
  1383. ],
  1384. text: '时间轴',
  1385. props: {
  1386. custom: [
  1387. {
  1388. key: 'mode',
  1389. label: '标签分布',
  1390. type: 'select',
  1391. options: [
  1392. { label: '同侧', value: 'same' },
  1393. { label: '交叉', value: 'alternate' },
  1394. ],
  1395. },
  1396. {
  1397. key: 'labelAlign',
  1398. label: '标签对齐',
  1399. type: 'select',
  1400. options: [
  1401. { label: '顶部', value: 'top' },
  1402. { label: '底部', value: 'bottom' },
  1403. ],
  1404. },
  1405. {
  1406. key: 'data',
  1407. label: '数据',
  1408. type: 'code',
  1409. },
  1410. ],
  1411. },
  1412. },
  1413. },
  1414. {
  1415. name: '垂直时间轴',
  1416. icon: 'l-chuizhishijianzhou',
  1417. data: {
  1418. name: 'timeline',
  1419. width: 40,
  1420. height: 300,
  1421. text: '时间轴',
  1422. hiddenText: true,
  1423. direction: 'vertical',
  1424. labelAlign: 'left', //left/right/alternate/top/bottom
  1425. mode: 'alternate', //alternate
  1426. data: [
  1427. {
  1428. label: '2022-01-01',
  1429. content: '事件一',
  1430. circleBg: '#BFDBFF',
  1431. circleShadow: '#4583FF33',
  1432. color: '#BFDBFF',
  1433. textColor: '#FFFFFF',
  1434. // 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',
  1435. },
  1436. {
  1437. label: '2022-02-01',
  1438. content: '事件二',
  1439. circleBg: '#BFDBFF',
  1440. circleShadow: '#4583FF33',
  1441. textColor: '#FFFFFF',
  1442. },
  1443. {
  1444. label: '2022-03-01',
  1445. content: '事件三',
  1446. textColor: '#FFFFFF66',
  1447. },
  1448. {
  1449. label: '2022-04-01',
  1450. content: '事件四',
  1451. textColor: '#FFFFFF66',
  1452. },
  1453. ],
  1454. props: {
  1455. custom: [
  1456. {
  1457. key: 'mode',
  1458. label: '标签分布',
  1459. type: 'select',
  1460. options: [
  1461. { label: '同侧', value: 'same' },
  1462. { label: '交叉', value: 'alternate' },
  1463. ],
  1464. },
  1465. {
  1466. key: 'labelAlign',
  1467. label: '标签对齐',
  1468. type: 'select',
  1469. options: [
  1470. { label: '靠左', value: 'left' },
  1471. { label: '靠右', value: 'right' },
  1472. ],
  1473. },
  1474. {
  1475. key: 'data',
  1476. label: '数据',
  1477. type: 'code',
  1478. },
  1479. ],
  1480. },
  1481. },
  1482. },
  1483. {
  1484. name: '日历(日期)',
  1485. icon: 'l-rili',
  1486. data: {
  1487. width: 280,
  1488. height: 326,
  1489. hiddenText: true,
  1490. name: 'calendar',
  1491. background: '#fff0',
  1492. hoverTextColor: '#fff',
  1493. dbInput: true,
  1494. // input: true,
  1495. text: '8月',
  1496. },
  1497. },
  1498. {
  1499. name: '日历(日期时间)',
  1500. icon: 'l-rili',
  1501. data: {
  1502. width: 496,
  1503. height: 326,
  1504. hiddenText: true,
  1505. name: 'calendar',
  1506. background: '#fff0',
  1507. hoverTextColor: '#fff',
  1508. dbInput: true,
  1509. // input: true,
  1510. text: '8月',
  1511. calendarType: 'time',
  1512. },
  1513. },
  1514. ],
  1515. },
  1516. {
  1517. name: '面板',
  1518. show: true,
  1519. list: [
  1520. {
  1521. name: '列表',
  1522. icon: 'l-liebiao',
  1523. data: {
  1524. width: 400,
  1525. height: 200,
  1526. name: 'list',
  1527. headingColor: '#FFFFFFE6',
  1528. headingSize: 16,
  1529. background: '#282E3B',
  1530. textColor: '#FFFFFF66',
  1531. hoverTextColor: '#FFFFFF66',
  1532. data: [
  1533. {
  1534. title: '列表标题',
  1535. description: '列表内容的描述性文字',
  1536. },
  1537. {
  1538. title: '列表标题',
  1539. description: '列表内容的描述性文字',
  1540. },
  1541. {
  1542. title: '列表标题',
  1543. description: '列表内容的描述性文字',
  1544. },
  1545. ],
  1546. props: {
  1547. custom: [
  1548. {
  1549. key: 'data',
  1550. label: '数据',
  1551. type: 'code',
  1552. },
  1553. {
  1554. key: 'background',
  1555. label: '背景颜色',
  1556. type: 'color',
  1557. },
  1558. {
  1559. key: 'headingSize',
  1560. label: '标题大小',
  1561. type: 'number',
  1562. },
  1563. {
  1564. key: 'headingColor',
  1565. label: '标题颜色',
  1566. type: 'color',
  1567. },
  1568. ],
  1569. },
  1570. },
  1571. },
  1572. {
  1573. name: '表格',
  1574. icon: 'l-biaoge',
  1575. data: {
  1576. name: 'table2',
  1577. width: 0,
  1578. height: 0,
  1579. disableAnchor: true,
  1580. // disableSize: true,
  1581. colWidth: 150,
  1582. rowHeight: 40,
  1583. data: [
  1584. ['设备 ID', '设备名称', '数据协议', '状态', '操作'],
  1585. ['1', '200', 'MQTT', '正在运行', {}],
  1586. ['2', '湿度传感器', 'MQTT', '正在运行', {}],
  1587. ['3', '物联网设备', 'MQTT', '正在运行', {}],
  1588. ['4', '物联网设备/智能家居/智慧城市', 'MQTT', '正在运行', {}],
  1589. ],
  1590. styles: [
  1591. {
  1592. row: 1,
  1593. col: 1,
  1594. color: '#ff0000',
  1595. background: '#ffff00',
  1596. wheres: [
  1597. //触发条件 成立后才允许配置样式
  1598. {
  1599. comparison: '<=',
  1600. value: '123',
  1601. },
  1602. ],
  1603. },
  1604. {
  1605. row: 0,
  1606. height: 60,
  1607. },
  1608. {
  1609. col: 4,
  1610. width: 200, //为该列设置额外的节点
  1611. pens: [
  1612. {
  1613. name: 'rectangle',
  1614. width: 50,
  1615. height: 20,
  1616. text: '编辑',
  1617. fontSize: 0.6,
  1618. disableAnchor: true,
  1619. activeBackground: '#2D71EC',
  1620. activeColor: '#40a9ff',
  1621. background: '#4583FF',
  1622. color: '#1890ff',
  1623. hoverBackground: '#7DA4FF',
  1624. hoverColor: '#40a9ff',
  1625. textColor: '#ffffff',
  1626. hoverTextColor: '#ffffff',
  1627. activeTextColor: '#ffffff',
  1628. events: [
  1629. {
  1630. action: 5,
  1631. name: 'click',
  1632. value: 'alert("点击了编辑")',
  1633. },
  1634. ],
  1635. },
  1636. {
  1637. name: 'rectangle',
  1638. width: 80,
  1639. height: 20,
  1640. text: '实时数据',
  1641. fontSize: 0.6,
  1642. disableAnchor: true,
  1643. activeBackground: '#2D71EC',
  1644. activeColor: '#40a9ff',
  1645. background: '#4583FF',
  1646. color: '#1890ff',
  1647. hoverBackground: '#7DA4FF',
  1648. hoverColor: '#40a9ff',
  1649. textColor: '#ffffff',
  1650. hoverTextColor: '#ffffff',
  1651. activeTextColor: '#ffffff',
  1652. events: [
  1653. {
  1654. action: 5,
  1655. name: 'click',
  1656. value: 'alert("点击了实时数据")',
  1657. },
  1658. ],
  1659. },
  1660. ],
  1661. },
  1662. ],
  1663. props: {
  1664. custom: [
  1665. {
  1666. key: 'data',
  1667. label: '数据',
  1668. type: 'code',
  1669. },
  1670. {
  1671. key: 'styles',
  1672. label: '样式',
  1673. type: 'code',
  1674. },
  1675. ],
  1676. },
  1677. },
  1678. },
  1679. {
  1680. name: '斑马纹表格',
  1681. icon: 'l-biaoge',
  1682. data: {
  1683. name: 'table2',
  1684. width: 0,
  1685. height: 0,
  1686. disableAnchor: true,
  1687. disableSize: true,
  1688. colWidth: 90,
  1689. rowHeight: 32,
  1690. bordered: false,
  1691. vLine: false,
  1692. hLine: false,
  1693. stripe: true,
  1694. stripeColor: '#407FFF1F', //'#15181c',
  1695. // hasHeader: false,
  1696. textColor: '#FFFFFF',
  1697. data: [
  1698. ['设备 ID', '设备名称', '数据协议', '级别'],
  1699. [
  1700. '1',
  1701. '200',
  1702. 'MQTT',
  1703. {
  1704. text: '一级告警',
  1705. // background: '#650b09',
  1706. textColor: '#FF5D3CFF',
  1707. },
  1708. ],
  1709. [
  1710. '2',
  1711. '湿度传感器',
  1712. 'MQTT',
  1713. {
  1714. text: '二级告警',
  1715. // background: '#4d2a02',
  1716. textColor: '#E6A82EFF',
  1717. },
  1718. ],
  1719. [
  1720. '3',
  1721. '物联网设备',
  1722. 'MQTT',
  1723. {
  1724. text: '一级告警',
  1725. // background: '#650b09',
  1726. textColor: '#FF5D3CFF',
  1727. },
  1728. ],
  1729. [
  1730. '4',
  1731. '物联网设备/智能家居/智慧城市',
  1732. 'MQTT',
  1733. {
  1734. text: '三级告警',
  1735. textColor: '#58CC84FF',
  1736. // background: '#042617;',
  1737. },
  1738. ],
  1739. ],
  1740. styles: [
  1741. {
  1742. row: 0,
  1743. textColor: '#ffffff66',
  1744. },
  1745. {
  1746. col: 3,
  1747. pens: [
  1748. {
  1749. name: 'rectangle',
  1750. width: 56,
  1751. height: 20,
  1752. fontSize: 0.6,
  1753. disableAnchor: true,
  1754. lineWidth: 0,
  1755. },
  1756. ],
  1757. },
  1758. ],
  1759. props: {
  1760. custom: [
  1761. {
  1762. key: 'stripe',
  1763. label: '显示斑马纹',
  1764. type: 'bool',
  1765. },
  1766. {
  1767. key: 'stripeColor',
  1768. label: '斑马纹颜色',
  1769. type: 'color',
  1770. },
  1771. {
  1772. key: 'bordered',
  1773. label: '外边框',
  1774. type: 'bool',
  1775. },
  1776. {
  1777. key: 'hLine',
  1778. label: '水平线',
  1779. type: 'bool',
  1780. },
  1781. {
  1782. key: 'vLine',
  1783. label: '垂直线',
  1784. type: 'bool',
  1785. },
  1786. {
  1787. key: 'hasHeader',
  1788. label: '有无表头',
  1789. type: 'bool',
  1790. },
  1791. {
  1792. key: 'data',
  1793. label: '数据',
  1794. type: 'code',
  1795. },
  1796. {
  1797. key: 'styles',
  1798. label: '样式',
  1799. type: 'code',
  1800. },
  1801. ],
  1802. },
  1803. realTimes: [
  1804. {
  1805. label: '自定义',
  1806. key: 'data.1.3.text',
  1807. type: 'string',
  1808. mock: '{一级告警,二级告警,三级告警}',
  1809. enableMock: true,
  1810. triggers: [
  1811. {
  1812. name: '触发器1',
  1813. conditionType: 'and',
  1814. conditions: [
  1815. {
  1816. type: '',
  1817. operator: '=',
  1818. valueType: '',
  1819. value: '一级告警',
  1820. },
  1821. ],
  1822. actions: [
  1823. {
  1824. action: 5,
  1825. value:
  1826. "meta2d.setValue({id:pen.id,'data.1.3.textColor':'#FF5D3CFF'},{doEvent:false,render:true})",
  1827. params: '',
  1828. },
  1829. ],
  1830. },
  1831. {
  1832. name: '触发器2',
  1833. conditionType: 'and',
  1834. conditions: [
  1835. {
  1836. type: '',
  1837. operator: '=',
  1838. valueType: '',
  1839. value: '二级告警',
  1840. },
  1841. ],
  1842. actions: [
  1843. {
  1844. action: 5,
  1845. value:
  1846. "meta2d.setValue({id:pen.id,'data.1.3.textColor':'#E6A82EFF'},{doEvent:false,render:true})",
  1847. params: '',
  1848. },
  1849. ],
  1850. },
  1851. {
  1852. name: '触发器3',
  1853. conditionType: 'and',
  1854. conditions: [
  1855. {
  1856. type: '',
  1857. operator: '=',
  1858. valueType: '',
  1859. value: '三级告警',
  1860. },
  1861. ],
  1862. actions: [
  1863. {
  1864. action: 5,
  1865. value:
  1866. "meta2d.setValue({id:pen.id,'data.1.3.textColor':'#58CC84FF'},{doEvent:false,render:true})",
  1867. params: '',
  1868. },
  1869. ],
  1870. },
  1871. ],
  1872. },
  1873. ],
  1874. },
  1875. },
  1876. {
  1877. name: '滚动表格',
  1878. icon: 'l-biaoge',
  1879. data: {
  1880. name: 'table2',
  1881. width: 0,
  1882. height: 0,
  1883. disableAnchor: true,
  1884. disableSize: true,
  1885. colWidth: 90,
  1886. rowHeight: 32,
  1887. bordered: false,
  1888. vLine: false,
  1889. hLine: true,
  1890. // stripe: true,
  1891. swiper:true,
  1892. // stripeColor: '#407FFF1F', //'#15181c',
  1893. hasHeader:true,
  1894. textColor: '#FFFFFF',
  1895. maxNum:5,
  1896. data: [
  1897. [
  1898. "序号",
  1899. "时间",
  1900. "事件内容",
  1901. "处理状态"
  1902. ],
  1903. [
  1904. {
  1905. "text": "1"
  1906. },
  1907. "2023-06-17 13:50",
  1908. "事件内容",
  1909. {
  1910. "text": "处理中",
  1911. "textColor": "#05CFF9FF"
  1912. }
  1913. ],
  1914. [
  1915. {
  1916. "text": "2"
  1917. },
  1918. "2023-06-17 13:51",
  1919. "事件内容",
  1920. {
  1921. "text": "已完成",
  1922. "textColor": "#B3D1FFFF"
  1923. }
  1924. ],
  1925. [
  1926. {
  1927. "text": "3"
  1928. },
  1929. "2023-06-17 13:52",
  1930. "事件内容",
  1931. {
  1932. "text": "待处理",
  1933. "textColor": "#E6A82EFF"
  1934. }
  1935. ],
  1936. [
  1937. {
  1938. "text": "4"
  1939. },
  1940. "2023-06-17 13:53",
  1941. "事件内容",
  1942. {
  1943. "text": "已完成",
  1944. "textColor": "#B3D1FFFF"
  1945. }
  1946. ],
  1947. [
  1948. {
  1949. "text": "5"
  1950. },
  1951. "2023-06-17 13:54",
  1952. "事件内容",
  1953. {
  1954. "text": "处理中",
  1955. "textColor": "#05CFF9FF"
  1956. }
  1957. ],
  1958. [
  1959. {
  1960. "text": "6"
  1961. },
  1962. "2023-06-17 13:55",
  1963. "事件内容",
  1964. {
  1965. "text": "处理中",
  1966. "textColor": "#05CFF9FF"
  1967. }
  1968. ],
  1969. [
  1970. {
  1971. "text": "7"
  1972. },
  1973. "2023-06-17 13:57",
  1974. "事件内容",
  1975. {
  1976. "text": "处理中",
  1977. "textColor": "#05CFF9FF"
  1978. }
  1979. ],
  1980. [
  1981. {
  1982. "text": "8"
  1983. },
  1984. "2023-06-17 13:58",
  1985. "事件内容",
  1986. {
  1987. "text": "处理中",
  1988. "textColor": "#05CFF9FF"
  1989. }
  1990. ],
  1991. [
  1992. {
  1993. "text": "9"
  1994. },
  1995. "2023-06-17 13:59",
  1996. "事件内容",
  1997. {
  1998. "text": "处理中",
  1999. "textColor": "#05CFF9FF"
  2000. }
  2001. ],
  2002. [
  2003. {
  2004. "text": "10"
  2005. },
  2006. "2023-06-17 14:00",
  2007. "事件内容",
  2008. {
  2009. "text": "处理中",
  2010. "textColor": "#05CFF9FF"
  2011. }
  2012. ],
  2013. [
  2014. {
  2015. "text": "11"
  2016. },
  2017. "2023-06-17 14:01",
  2018. "事件内容",
  2019. {
  2020. "text": "处理中",
  2021. "textColor": "#05CFF9FF"
  2022. }
  2023. ],
  2024. [
  2025. {
  2026. "text": "12"
  2027. },
  2028. "2023-06-17 13:02",
  2029. "事件内容",
  2030. {
  2031. "text": "处理中",
  2032. "textColor": "#05CFF9FF"
  2033. }
  2034. ]
  2035. ],
  2036. styles: [
  2037. {
  2038. "col": 1,
  2039. "width": 112
  2040. },
  2041. {
  2042. "col": 2,
  2043. "width": 112
  2044. },
  2045. {
  2046. "col": 3,
  2047. "pens": [
  2048. {
  2049. "disableAnchor": true,
  2050. "fontSize": 0.6,
  2051. "height": 20,
  2052. "lineWidth": 0,
  2053. "name": "rectangle",
  2054. "textColor": "#05CFF9FF",
  2055. "width": 56
  2056. }
  2057. ],
  2058. "width": 70
  2059. },
  2060. {
  2061. "col": 0,
  2062. "pens": [
  2063. {
  2064. "background": "#4583FF33",
  2065. "disableAnchor": true,
  2066. "height": 20,
  2067. "isBottom": false,
  2068. "lineWidth": 0,
  2069. "name": "rectangle",
  2070. "width": 20
  2071. }
  2072. ],
  2073. "width": 40
  2074. }
  2075. ],
  2076. props: {
  2077. custom: [
  2078. {
  2079. key: 'hasHeader',
  2080. label: '有无表头',
  2081. type: 'bool',
  2082. },
  2083. {
  2084. key: 'swiper',
  2085. label: '是否轮播',
  2086. type: 'bool',
  2087. },
  2088. {
  2089. key: 'maxNum',
  2090. label: '最大展示数',
  2091. type: 'number',
  2092. },
  2093. {
  2094. key: 'data',
  2095. label: '数据',
  2096. type: 'code',
  2097. },
  2098. {
  2099. key: 'styles',
  2100. label: '样式',
  2101. type: 'code',
  2102. },
  2103. ],
  2104. },
  2105. },
  2106. },
  2107. {
  2108. name: '树',
  2109. icon: 'l-shu', //l-shu
  2110. data: {
  2111. name: 'tree',
  2112. width: 150,
  2113. height: 210,
  2114. expanded: ['1', '2'],
  2115. fontSize: 20,
  2116. disableInput: true,
  2117. textColor: '#FFFFFF',
  2118. hoverTextColor: '#FFFFFF',
  2119. // iconFamily:'l-icon',
  2120. // icon:'\ue607',
  2121. data: [
  2122. {
  2123. key: '1',
  2124. label: '1',
  2125. children: [
  2126. {
  2127. key: '1-1',
  2128. label: '1-1',
  2129. },
  2130. {
  2131. key: '1-1',
  2132. label: '1-2',
  2133. },
  2134. ],
  2135. },
  2136. {
  2137. key: '2',
  2138. label: '2',
  2139. children: [
  2140. {
  2141. key: '2-1',
  2142. label: '2-1',
  2143. children: [
  2144. {
  2145. key: '2-1-1',
  2146. label: '2-1-1',
  2147. },
  2148. {
  2149. key: '2-1-2',
  2150. label: '2-2-2',
  2151. },
  2152. ],
  2153. },
  2154. {
  2155. key: '2-2',
  2156. label: '2-2',
  2157. },
  2158. ],
  2159. },
  2160. {
  2161. key: '3',
  2162. label: '3',
  2163. },
  2164. ],
  2165. props: {
  2166. custom: [
  2167. {
  2168. key: 'expandAll',
  2169. label: '展开全部节点',
  2170. type: 'bool',
  2171. },
  2172. {
  2173. key: 'data',
  2174. label: '数据',
  2175. type: 'code',
  2176. },
  2177. ],
  2178. },
  2179. },
  2180. },
  2181. {
  2182. name: '网页',
  2183. icon: 'l-iframe',
  2184. data: {
  2185. name: 'iframe',
  2186. width: 500,
  2187. height: 400,
  2188. externElement: true,
  2189. iframe: `https://${rootDomain?.slice(1)}`,
  2190. props: {
  2191. custom: iframeCustom,
  2192. },
  2193. },
  2194. },
  2195. ],
  2196. },
  2197. {
  2198. name: '提醒',
  2199. show: true,
  2200. list: [
  2201. {
  2202. name: '业务指标',
  2203. icon: 'l-yewuzhibiao',
  2204. data: {
  2205. width: 115,
  2206. height: 25,
  2207. name: 'indicator',
  2208. data: [
  2209. {
  2210. type: 'text',
  2211. color: '#FFFFFFD9',
  2212. x: 0,
  2213. text: '业务指标',
  2214. },
  2215. {
  2216. type: 'icon',
  2217. x: 0.5,
  2218. size: 0.5, //高度的倍数
  2219. color: '#ff0000',
  2220. background: '#f00',
  2221. 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',
  2222. },
  2223. {
  2224. textColor: '#f00',
  2225. type: 'text',
  2226. color: '',
  2227. x: 0.6,
  2228. text: '20%',
  2229. },
  2230. ],
  2231. props: {
  2232. custom: [
  2233. {
  2234. key: 'data',
  2235. label: '数据',
  2236. type: 'code',
  2237. },
  2238. ],
  2239. },
  2240. },
  2241. },
  2242. {
  2243. name: '全局消息',
  2244. icon: 'l-quanjuxiaoxi',
  2245. data: {
  2246. width: 200,
  2247. height: 40,
  2248. text: '用于表示普通操作信息提示',
  2249. borderRadius: 6,
  2250. name: 'rectangle',
  2251. icon: '\ue6e4',
  2252. iconFamily: 'l-icon',
  2253. iconColor: '#4583ff',
  2254. iconSize: 17.5,
  2255. iconAlign: 'left',
  2256. iconLeft: 10,
  2257. textAlign: 'left',
  2258. color: 'rgba(235, 235, 235, 1)',
  2259. background: '#282E3B',
  2260. textLeft: 30,
  2261. lineWidth: 0,
  2262. shadow: false,
  2263. textColor: '#FFFFFF',
  2264. hoverTextColor: 'rgba(0, 0, 0, 1)',
  2265. shadowColor: '#00000014',
  2266. shadowOffsetX: 6,
  2267. shadowOffsetY: 6,
  2268. shadowBlur: 20,
  2269. props: {
  2270. custom: [
  2271. {
  2272. key: 'text',
  2273. label: '文本',
  2274. type: 'text',
  2275. },
  2276. {
  2277. key: 'textColor',
  2278. label: '文本颜色',
  2279. type: 'color',
  2280. },
  2281. ],
  2282. },
  2283. },
  2284. },
  2285. {
  2286. name: '通知',
  2287. icon: 'l-tongzhi',
  2288. data: {
  2289. width: 360,
  2290. height: 178,
  2291. text: '通知具体内容;通知具体内容;通知具体内容;通知具体内容;通知具体内容;通知具体内容;通知具体内容;通知具体内容;通知具体内容;',
  2292. borderRadius: 6,
  2293. name: 'notification',
  2294. icon: '\ue6e4',
  2295. iconFamily: 'l-icon',
  2296. iconColor: '#4583ff',
  2297. iconSize: 18,
  2298. iconAlign: 'left-top',
  2299. iconLeft: 15,
  2300. iconTop: 20,
  2301. textAlign: 'left',
  2302. textBaseline: 'top',
  2303. textLeft: 40,
  2304. textTop: 50,
  2305. color: 'rgba(235, 235, 235, 1)',
  2306. background: '#282E3B',
  2307. shadow: false,
  2308. textColor: '#FFFFFF99',
  2309. hoverTextColor: '#666666',
  2310. shadowColor: '#0000000D',
  2311. shadowOffsetX: 6,
  2312. shadowOffsetY: 6,
  2313. textWidth: 300,
  2314. shadowBlur: 24,
  2315. heading: '标题名称',
  2316. headingColor: '#FFFFFFE6',
  2317. headingSize: 16,
  2318. // headingWeight: 'bold',
  2319. props: {
  2320. custom: [
  2321. {
  2322. key: 'heading',
  2323. label: '标题',
  2324. type: 'string',
  2325. },
  2326. {
  2327. key: 'headingColor',
  2328. label: '标题颜色',
  2329. type: 'color',
  2330. },
  2331. {
  2332. key: 'headingSize',
  2333. label: '标题大小',
  2334. type: 'number',
  2335. },
  2336. {
  2337. key: 'headingWeight',
  2338. label: '标题加粗',
  2339. type: 'select',
  2340. options: [
  2341. { label: '加粗', value: 'bold' },
  2342. { label: '正常', value: '' },
  2343. ],
  2344. },
  2345. ],
  2346. },
  2347. },
  2348. },
  2349. // {
  2350. // name: '对话框',
  2351. // icon: 'l-pc',
  2352. // data: {
  2353. // width: 200,
  2354. // height: 200,
  2355. // },
  2356. // },
  2357. ],
  2358. },
  2359. {
  2360. name: '轮播',
  2361. show: true,
  2362. list: [
  2363. {
  2364. name: '水平轮播',
  2365. icon: 'l-paomadeng',
  2366. data: {
  2367. name: 'swiperline',
  2368. width: 200,
  2369. height: 40,
  2370. data: ['轮播第一次数据', '轮播第二次数据', '轮播第三次数据'],
  2371. hiddenText: true,
  2372. props: {
  2373. custom: [
  2374. {
  2375. key: 'data',
  2376. label: '数据',
  2377. type: 'code',
  2378. },
  2379. {
  2380. key: 'timeout',
  2381. label: '轮播时间',
  2382. type: 'number',
  2383. },
  2384. ],
  2385. },
  2386. },
  2387. },
  2388. {
  2389. name: '垂直轮播',
  2390. icon: 'l-chuizhigundong',
  2391. data: {
  2392. name: 'swiperline',
  2393. width: 200,
  2394. height: 24,
  2395. direction: 'vertical',
  2396. lineHeight: 2,
  2397. data: ['轮播第一次数据', '轮播第二次数据', '轮播第三次数据'],
  2398. hiddenText: true,
  2399. props: {
  2400. custom: [
  2401. {
  2402. key: 'data',
  2403. label: '数据',
  2404. type: 'code',
  2405. },
  2406. {
  2407. key: 'timeout',
  2408. label: '轮播时间',
  2409. type: 'number',
  2410. },
  2411. ],
  2412. },
  2413. },
  2414. },
  2415. {
  2416. name: '轮播图',
  2417. icon: 'l-lunbotu',
  2418. data: {
  2419. name: 'swiperDom',
  2420. externElement: true,
  2421. width: 400,
  2422. height: 300,
  2423. data: [
  2424. {
  2425. src: `https://2ds${rootDomain}/img/banner1.bc890350.png`,
  2426. },
  2427. {
  2428. src: `https://2ds${rootDomain}/img/banner2.adab6a6e.png`,
  2429. },
  2430. {
  2431. src: `https://2ds${rootDomain}/img/banner3.86b53aed.png`,
  2432. },
  2433. ],
  2434. hiddenText: true,
  2435. props: {
  2436. custom: [
  2437. {
  2438. key: 'data',
  2439. label: '数据',
  2440. type: 'code',
  2441. },
  2442. ],
  2443. },
  2444. },
  2445. },
  2446. {
  2447. name: '轮播页面',
  2448. icon: 'l-lunboyemian',
  2449. data: {
  2450. name: 'swiperDom',
  2451. width: 400,
  2452. height: 300,
  2453. swiperType: 'iframe',
  2454. data: [
  2455. {
  2456. src: `https://2d${rootDomain}/preview?id=6357a9e2d44b9402de84d2e8`,
  2457. },
  2458. {
  2459. src: `https://2d${rootDomain}/preview?id=6357aec8d44b9402de84d2f1`,
  2460. },
  2461. {
  2462. src: `https://2d${rootDomain}/preview?id=641d524a8df2c654ea652d7e`,
  2463. },
  2464. ],
  2465. hiddenText: true,
  2466. props: {
  2467. custom: [
  2468. {
  2469. key: 'data',
  2470. label: '数据',
  2471. type: 'code',
  2472. },
  2473. ],
  2474. },
  2475. },
  2476. },
  2477. ],
  2478. },
  2479. {
  2480. name: '导航',
  2481. show: true,
  2482. list: [
  2483. {
  2484. name: '链接',
  2485. icon: 'l-lianjie',
  2486. data: {
  2487. text: '乐吾乐2D编辑器',
  2488. width: 100,
  2489. height: 30,
  2490. name: 'text',
  2491. textColor: '#0052d9',
  2492. events: [
  2493. {
  2494. name: 'click',
  2495. actions: [
  2496. {
  2497. action: 0,
  2498. params: '_blank',
  2499. value: `https://2d${rootDomain}`,
  2500. },
  2501. ],
  2502. },
  2503. ],
  2504. props: {
  2505. custom: [
  2506. {
  2507. key: 'events.0.actions.0.value',
  2508. label: '地址',
  2509. type: 'string',
  2510. },
  2511. ],
  2512. },
  2513. },
  2514. },
  2515. {
  2516. name: '返回',
  2517. icon: 'l-fanhui',
  2518. data: {
  2519. width: 40,
  2520. height: 40,
  2521. name: 'image',
  2522. icon: '\ue697',
  2523. iconFamily: 'l-icon',
  2524. events: [
  2525. {
  2526. name: 'click',
  2527. actions: [
  2528. {
  2529. action: 5,
  2530. value: 'window.history.go(-1);',
  2531. },
  2532. ],
  2533. },
  2534. ],
  2535. },
  2536. },
  2537. {
  2538. name: '锚点',
  2539. icon: 'l-anchor',
  2540. data: {
  2541. width: 40,
  2542. height: 40,
  2543. name: 'image',
  2544. icon: '\uea7b',
  2545. iconFamily: 'l-icon',
  2546. events: [
  2547. {
  2548. name: 'click',
  2549. actions: [
  2550. {
  2551. action: 5,
  2552. params: 'pen.id/tag',
  2553. value:
  2554. '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();',
  2555. },
  2556. ],
  2557. },
  2558. ],
  2559. props: {
  2560. custom: [
  2561. {
  2562. key: 'events.0.actions.0.params',
  2563. label: '定位图元',
  2564. type: 'string',
  2565. },
  2566. ],
  2567. },
  2568. },
  2569. },
  2570. {
  2571. name: '回到顶部',
  2572. icon: 'l-huidaodingbu',
  2573. data: {
  2574. width: 64,
  2575. height: 64,
  2576. name: 'rectangle',
  2577. activeBackground: '#282E3B',
  2578. background: '#282E3B',
  2579. borderRadius: 0.1,
  2580. color: '#eee',
  2581. hoverBackground: '#282E3B',
  2582. hoverColor: '#eee',
  2583. hoverTextColor: '#FFFFFFE6',
  2584. iconAlign: 'top',
  2585. iconColor: '#FFFFFFE6',
  2586. iconSize: 20,
  2587. iconTop: 10,
  2588. text: 'TOP',
  2589. textBaseline: 'bottom',
  2590. lineWidth: 0,
  2591. textColor: '#FFFFFFE6',
  2592. textTop: -2,
  2593. icon: '\uec57',
  2594. iconFamily: 'l-icon',
  2595. events: [
  2596. {
  2597. name: 'click',
  2598. actions: [
  2599. {
  2600. action: 5,
  2601. value: `
  2602. const { scale, origin, y: dataY } = context.meta2d.store.data;
  2603. context.meta2d.translate(
  2604. 0,
  2605. ((parseInt(params)||32) * context.meta2d.store.data.scale - origin.y) / scale - dataY / scale
  2606. );`,
  2607. },
  2608. ],
  2609. },
  2610. ],
  2611. },
  2612. },
  2613. {
  2614. name: '面包屑',
  2615. icon: 'l-mianbaoxie', //l-mianbaoxie
  2616. data: {
  2617. name: 'breadcrumb',
  2618. width: 200,
  2619. height: 20,
  2620. data: [
  2621. {
  2622. key: '1',
  2623. text: '页面1',
  2624. to: 'https://www.baidu.com',
  2625. target: '_blank',
  2626. },
  2627. {
  2628. key: '2',
  2629. text: '页面2',
  2630. to: `https://2d${rootDomain}/?id=641d524a8df2c654ea652d7e`,
  2631. target: '_blank',
  2632. },
  2633. {
  2634. key: '3',
  2635. text: '页面3',
  2636. to: `https://2d${rootDomain}/?id=6357a9e2d44b9402de84d2e8`,
  2637. target: '_self',
  2638. },
  2639. ],
  2640. props: {
  2641. custom: [
  2642. {
  2643. key: 'gap',
  2644. label: '间距',
  2645. type: 'number',
  2646. min: 0,
  2647. },
  2648. {
  2649. key: 'data',
  2650. label: '数据',
  2651. type: 'code',
  2652. },
  2653. ],
  2654. },
  2655. },
  2656. },
  2657. {
  2658. name: '下拉菜单',
  2659. icon: 'l-xialacaidan',
  2660. data: {
  2661. name: 'headMenuDom',
  2662. width: 650,
  2663. height: 60,
  2664. externElement: true,
  2665. selectedKeys: ['1'],
  2666. // activeColor: '#4E85E5',
  2667. iconPosition: 'left',
  2668. renderSubMenu:true,
  2669. data: [
  2670. {
  2671. key: '1',
  2672. icon: 'l-icon l-user',
  2673. title: '个人中心',
  2674. children: [
  2675. {
  2676. key: '1-1',
  2677. icon: 'l-icon l-fly',
  2678. title: '测试测试',
  2679. },
  2680. ],
  2681. },
  2682. {
  2683. key: '2',
  2684. icon: 'l-icon l-panel',
  2685. title: '安全运行',
  2686. },
  2687. {
  2688. key: '3',
  2689. icon: 'l-icon l-align-center',
  2690. title: '智慧能源',
  2691. },
  2692. {
  2693. key: '4',
  2694. icon: 'l-icon l-kongzhuangtai1',
  2695. title: '数据分析',
  2696. },
  2697. {
  2698. key: '5',
  2699. icon: 'l-icon l-quanjutishi',
  2700. title: '运维管理',
  2701. },
  2702. ],
  2703. props: {
  2704. custom: [
  2705. {
  2706. key: 'data',
  2707. label: '数据',
  2708. type: 'code',
  2709. },
  2710. ],
  2711. },
  2712. },
  2713. },
  2714. {
  2715. name: '导航菜单',
  2716. icon: 'l-daohangcaidan',
  2717. data: {
  2718. name: 'menuDom',
  2719. width: 200,
  2720. height: 400,
  2721. externElement: true,
  2722. data: [
  2723. {
  2724. title: '实时监测',
  2725. key: '0',
  2726. icon: 'l-icon l-suofang',
  2727. children: [
  2728. {
  2729. title: '站点看板',
  2730. key: '',
  2731. icon: 'l-icon l-fenzuzhuzhuangtu',
  2732. children: [
  2733. {
  2734. title: '三级标题',
  2735. key: '',
  2736. },
  2737. {
  2738. title: '三级标题',
  2739. key: '',
  2740. },
  2741. ],
  2742. },
  2743. {
  2744. title: '监控画面',
  2745. key: '',
  2746. icon: 'l-icon l-biaoge',
  2747. },
  2748. {
  2749. title: '设备监控',
  2750. key: '',
  2751. icon: 'l-icon l-zhexiantu',
  2752. },
  2753. ],
  2754. },
  2755. {
  2756. title: '控制中心',
  2757. key: '',
  2758. icon: 'l-icon l-tiaoxingtu',
  2759. },
  2760. {
  2761. title: '告警管理',
  2762. key: '',
  2763. icon: 'l-icon l-zhishideng',
  2764. },
  2765. ],
  2766. props: {
  2767. custom: [
  2768. {
  2769. key: 'data',
  2770. label: '数据',
  2771. type: 'code',
  2772. },
  2773. ],
  2774. },
  2775. },
  2776. },
  2777. {
  2778. name: '分页',
  2779. icon: 'l-fenye', //l-fenye
  2780. data: {
  2781. name: 'pagination',
  2782. width: 300,
  2783. height: 200,
  2784. size: 'small',
  2785. total: 25,
  2786. pageSize: 5,
  2787. current: 1,
  2788. maxPageBtn: 5,
  2789. disableInput: true,
  2790. pageSizeOptions: [5, 10, 20, 30],
  2791. props: {
  2792. custom: [
  2793. {
  2794. key: 'total',
  2795. label: '数据总条数',
  2796. type: 'number',
  2797. min: 0,
  2798. },
  2799. {
  2800. key: 'pageSize',
  2801. label: '每页数据量',
  2802. type: 'number',
  2803. },
  2804. {
  2805. key: 'pageSizeOptions',
  2806. label: '分页大小控制器',
  2807. type: 'code',
  2808. },
  2809. // {
  2810. // key: 'maxPageBtn',
  2811. // label: '最多显示页码数按钮数',
  2812. // type: 'number',
  2813. // },
  2814. ],
  2815. },
  2816. },
  2817. },
  2818. {
  2819. name: '步骤条',
  2820. icon: 'l-buzhoutiao',
  2821. data: {
  2822. name: 'steps',
  2823. width: 500,
  2824. height: 40,
  2825. hiddenText: true,
  2826. direction: 'horizontal', //horizontal/vertical
  2827. labelAlign: '', //left/right/alternate/top/bottom
  2828. // theme: 'dot', //dot
  2829. current: 2,
  2830. data: [
  2831. {
  2832. title: '已完成的步骤',
  2833. content: '这里是提示文字',
  2834. status: 'finish', //default/process/finish/error
  2835. // 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',
  2836. },
  2837. {
  2838. title: '出错的步骤',
  2839. content: '这里是提示文字',
  2840. status: 'error', //default/process/finish/error
  2841. },
  2842. {
  2843. title: '进行中的步骤',
  2844. content: '这里是提示文字',
  2845. status: 'process', //default/process/finish/error
  2846. },
  2847. {
  2848. title: '未完成的步骤',
  2849. content: '这里是提示文字',
  2850. status: 'default', //default/process/finish/error
  2851. },
  2852. ],
  2853. props: {
  2854. custom: [
  2855. {
  2856. key: 'data',
  2857. label: '数据',
  2858. type: 'code',
  2859. },
  2860. {
  2861. key: 'direction',
  2862. label: '方向',
  2863. type: 'select',
  2864. options: [
  2865. { label: '水平', value: 'horizontal' },
  2866. { label: '垂直', value: 'vertical' },
  2867. ],
  2868. },
  2869. // {
  2870. // key: 'labelAlign',
  2871. // label: '对齐',
  2872. // type: 'select',
  2873. // options: [
  2874. // { label: '上', value: 'top' },
  2875. // { label: '下', value: 'bottom' },
  2876. // { label: '左', value: 'left' },
  2877. // { label: '右', value: 'right' },
  2878. // ],
  2879. // },
  2880. ],
  2881. },
  2882. },
  2883. },
  2884. {
  2885. name: '选项卡',
  2886. icon: 'l-xuanxiangka',
  2887. data: {
  2888. name: 'tab',
  2889. width: 440,
  2890. height: 48,
  2891. direction: 'horizontal',
  2892. selectedKey: '1',
  2893. btnHeight: 32,
  2894. btnWidth: 100,
  2895. gap:8,
  2896. // selectedKeys: [],
  2897. disableInput: true,
  2898. data: [
  2899. { text: '场景一', key: '0', isForbidden: true },
  2900. { text: '场景二', key: '1' },
  2901. { text: '场景三', key: '2' },
  2902. { text: '场景四', key: '3' },
  2903. ],
  2904. props: {
  2905. custom: [
  2906. {
  2907. key: 'data',
  2908. label: '数据',
  2909. type: 'code',
  2910. },
  2911. {
  2912. key: 'direction',
  2913. label: '方向',
  2914. type: 'select',
  2915. options: [
  2916. { label: '水平', value: 'horizontal' },
  2917. { label: '垂直', value: 'vertical' },
  2918. ],
  2919. },
  2920. {
  2921. key: 'gap',
  2922. label: '间隔',
  2923. type: 'number',
  2924. min:1
  2925. },
  2926. {
  2927. key: 'btnWidth',
  2928. label: '按钮宽度',
  2929. type: 'number',
  2930. min:1
  2931. },
  2932. {
  2933. key: 'btnHeight',
  2934. label: '按钮高度',
  2935. type: 'number',
  2936. min:1
  2937. },
  2938. {
  2939. key: 'activeBackground',
  2940. label: '选中背景',
  2941. type: 'color',
  2942. },
  2943. {
  2944. key: 'activeColor',
  2945. label: '选中边框',
  2946. type: 'color',
  2947. },
  2948. {
  2949. key: 'activeTextColor',
  2950. label: '选中文字',
  2951. type: 'color',
  2952. },
  2953. {
  2954. key: 'activeBgImage',
  2955. label: '选中背景图片',
  2956. type: 'string',
  2957. },
  2958. {
  2959. key: 'background',
  2960. label: '(未选中)背景',
  2961. type: 'color',
  2962. },
  2963. {
  2964. key: 'color',
  2965. label: '(未选中)边框',
  2966. type: 'color',
  2967. },
  2968. {
  2969. key: 'textColor',
  2970. label: '(未选中)文字',
  2971. type: 'color',
  2972. },
  2973. {
  2974. key: 'bgImage',
  2975. label: '(未选中)背景图片',
  2976. type: 'string',
  2977. }
  2978. ],
  2979. },
  2980. },
  2981. },
  2982. {
  2983. name: '多选选项卡',
  2984. icon: 'l-duoxiangxuanxiangka',
  2985. data: {
  2986. name: 'tab',
  2987. width: 440,
  2988. height: 48,
  2989. direction: 'horizontal',
  2990. selectedKeys: ['0'],
  2991. multiple:true,
  2992. disableInput: true,
  2993. btnHeight: 32,
  2994. btnWidth: 100,
  2995. gap:8,
  2996. data: [
  2997. { text: '场景一', key: '0' },
  2998. { text: '场景二', key: '1', isForbidden: true },
  2999. { text: '场景三', key: '2' },
  3000. { text: '场景四', key: '3' },
  3001. ],
  3002. props: {
  3003. custom: [
  3004. {
  3005. key: 'data',
  3006. label: '数据',
  3007. type: 'code',
  3008. },
  3009. {
  3010. key: 'direction',
  3011. label: '方向',
  3012. type: 'select',
  3013. options: [
  3014. { label: '水平', value: 'horizontal' },
  3015. { label: '垂直', value: 'vertical' },
  3016. ],
  3017. },
  3018. {
  3019. key: 'gap',
  3020. label: '间隔',
  3021. type: 'number',
  3022. min:1
  3023. },
  3024. {
  3025. key: 'btnWidth',
  3026. label: '按钮宽度',
  3027. type: 'number',
  3028. min:1
  3029. },
  3030. {
  3031. key: 'btnHeight',
  3032. label: '按钮高度',
  3033. type: 'number',
  3034. min:1
  3035. },
  3036. {
  3037. key: 'activeBackground',
  3038. label: '选中背景',
  3039. type: 'color',
  3040. },
  3041. {
  3042. key: 'activeColor',
  3043. label: '选中边框',
  3044. type: 'color',
  3045. },
  3046. {
  3047. key: 'activeTextColor',
  3048. label: '选中文字',
  3049. type: 'color',
  3050. },
  3051. {
  3052. key: 'activeBgImage',
  3053. label: '选中背景图片',
  3054. type: 'string',
  3055. },
  3056. {
  3057. key: 'background',
  3058. label: '(未选中)背景',
  3059. type: 'color',
  3060. },
  3061. {
  3062. key: 'color',
  3063. label: '(未选中)边框',
  3064. type: 'color',
  3065. },
  3066. {
  3067. key: 'textColor',
  3068. label: '(未选中)文字',
  3069. type: 'color',
  3070. },
  3071. {
  3072. key: 'bgImage',
  3073. label: '(未选中)背景图片',
  3074. type: 'string',
  3075. }
  3076. ],
  3077. },
  3078. },
  3079. },
  3080. ],
  3081. },
  3082. {
  3083. name: '输入',
  3084. show: true,
  3085. list: [
  3086. {
  3087. name: '按钮',
  3088. icon: 'l-anniu',
  3089. data: {
  3090. name: 'rectangle',
  3091. x: 300,
  3092. y: 200,
  3093. width: 80,
  3094. height: 30,
  3095. disableAnchor: true,
  3096. borderRadius: 2,
  3097. text: '按钮',
  3098. activeBackground: '#2D71EC',
  3099. activeColor: '#40a9ff',
  3100. background: '#4583FF',
  3101. color: '#1890ff',
  3102. hoverBackground: '#40a9ff',
  3103. hoverColor: '#7DA4FF',
  3104. textColor: '#ffffff',
  3105. hoverTextColor: '#ffffff',
  3106. activeTextColor: '#ffffff',
  3107. },
  3108. },
  3109. {
  3110. name: '文本输入框',
  3111. icon: 'l-wenbenshurukuang',
  3112. data: {
  3113. x: 100,
  3114. y: 100,
  3115. height: 40,
  3116. width: 200,
  3117. disableAnchor: true,
  3118. name: 'rectangle',
  3119. borderRadius: 0.05,
  3120. input: true,
  3121. ellipsis: true,
  3122. text: '输入文本',
  3123. textAlign: 'left',
  3124. background: '#15181C',
  3125. color: '#424B61',
  3126. textColor: '#FFFFFFE6',
  3127. // color: '#D9D9D9FF',
  3128. // hoverTextColor: '#000000FF',
  3129. // activeTextColor: '#000000FF',
  3130. textLeft: 10,
  3131. },
  3132. },
  3133. {
  3134. name: '数字输入框',
  3135. icon: 'l-shuzishurukuang',
  3136. data: {
  3137. x: 100,
  3138. y: 100,
  3139. height: 40,
  3140. width: 200,
  3141. disableAnchor: true,
  3142. name: 'rectangle',
  3143. borderRadius: 0.05,
  3144. input: true,
  3145. ellipsis: true,
  3146. text: '输入数字',
  3147. textAlign: 'left',
  3148. background: '#15181C',
  3149. color: '#424B61',
  3150. textColor: '#FFFFFFE6',
  3151. // color: '#D9D9D9FF',
  3152. // textColor: '#000000FF',
  3153. // hoverTextColor: '#000000FF',
  3154. // activeTextColor: '#000000FF',
  3155. textLeft: 10,
  3156. events: [
  3157. {
  3158. action: 5,
  3159. name: 'inactive',
  3160. value:
  3161. 'context.meta2d.setValue({ id: pen.id, text: parseFloat(pen.text) }, { doEvent: false });',
  3162. where: { type: null },
  3163. },
  3164. ],
  3165. },
  3166. },
  3167. {
  3168. name: '单选框',
  3169. icon: 'l-danxuanxiang',
  3170. data: {
  3171. name: 'radio',
  3172. width: 300,
  3173. height: 30,
  3174. disableAnchor: true,
  3175. direction: 'horizontal', // 'vertical', //'horizontal',
  3176. theme: 'normal',
  3177. itemPosition: [],
  3178. data: [
  3179. { key: '1', text: '选项一', isForbidden: true },
  3180. { key: '2', text: '选项示例二' },
  3181. { key: '3', text: '选项三' },
  3182. ],
  3183. selectKey: '2',
  3184. props: {
  3185. custom: [
  3186. {
  3187. key: 'data',
  3188. label: '数据',
  3189. type: 'code',
  3190. },
  3191. {
  3192. key: 'direction',
  3193. label: '排列方向',
  3194. type: 'select',
  3195. options: [
  3196. { label: '横向', value: 'horizontal' },
  3197. { label: '纵向', value: 'vertical' },
  3198. ],
  3199. },
  3200. {
  3201. key: 'theme',
  3202. label: '模式',
  3203. type: 'select',
  3204. options: [
  3205. { label: '通用模式', value: 'normal' },
  3206. { label: '按钮模式', value: 'button' },
  3207. ],
  3208. },
  3209. ],
  3210. },
  3211. },
  3212. },
  3213. {
  3214. name: '多选框',
  3215. icon: 'l-duoxuanxiang',
  3216. data: {
  3217. name: 'checkbox',
  3218. width: 300,
  3219. height: 30,
  3220. direction: 'horizontal', // 'vertical', //'horizontal',
  3221. theme: 'normal', //button normal
  3222. data: [
  3223. { key: '1', text: '选项一', isForbidden: true },
  3224. { key: '2', text: '选项示例二' },
  3225. { key: '3', text: '选项三' },
  3226. ],
  3227. selectedKeys: ['2', '3'],
  3228. props: {
  3229. custom: [
  3230. {
  3231. key: 'data',
  3232. label: '数据',
  3233. type: 'code',
  3234. },
  3235. {
  3236. key: 'direction',
  3237. label: '排列方向',
  3238. type: 'select',
  3239. options: [
  3240. { label: '横向', value: 'horizontal' },
  3241. { label: '纵向', value: 'vertical' },
  3242. ],
  3243. },
  3244. {
  3245. key: 'theme',
  3246. label: '模式',
  3247. type: 'select',
  3248. options: [
  3249. { label: '通用模式', value: 'normal' },
  3250. { label: '按钮模式', value: 'button' },
  3251. ],
  3252. },
  3253. ],
  3254. },
  3255. },
  3256. },
  3257. {
  3258. name: '下拉选择器',
  3259. icon: 'l-xialaxuanzekuang',
  3260. data: {
  3261. x: 100,
  3262. y: 100,
  3263. height: 40,
  3264. width: 200,
  3265. disableAnchor: true,
  3266. name: 'rectangle',
  3267. borderRadius: 0.05,
  3268. ellipsis: true,
  3269. text: '选项1',
  3270. textAlign: 'left',
  3271. input: true,
  3272. background: '#15181C',
  3273. color: '#424B61',
  3274. textColor: '#FFFFFFE6',
  3275. hoverTextColor: '#FFFFFFE6',
  3276. activeTextColor: '#FFFFFFE6',
  3277. textLeft: 10,
  3278. dropdownList: [
  3279. {
  3280. text: '选项1',
  3281. },
  3282. {
  3283. text: '选项2',
  3284. },
  3285. {
  3286. text: '选项3',
  3287. },
  3288. ],
  3289. props: {
  3290. custom: [
  3291. {
  3292. key: 'dropdownList',
  3293. label: '下拉列表',
  3294. type: 'code',
  3295. },
  3296. ]
  3297. }
  3298. },
  3299. },
  3300. {
  3301. name: '时间选择器',
  3302. icon: 'l-shijianxuanzekuang',
  3303. data: {
  3304. name: 'inputDom',
  3305. width: 200,
  3306. height: 32,
  3307. externElement: true,
  3308. prefix: false,
  3309. suffix: false,
  3310. inputType: 'time',
  3311. hiddenText: true,
  3312. },
  3313. },
  3314. {
  3315. name: '日期选择器',
  3316. icon: 'l-riqixuanzekuang',
  3317. data: {
  3318. name: 'inputDom',
  3319. width: 200,
  3320. height: 32,
  3321. externElement: true,
  3322. prefix: false,
  3323. suffix: false,
  3324. inputType: 'date',
  3325. hiddenText: true,
  3326. },
  3327. },
  3328. {
  3329. name: '颜色选择器',
  3330. icon: 'l-yansexuanzekuang',
  3331. data: {
  3332. name: 'inputDom',
  3333. width: 32,
  3334. height: 32,
  3335. externElement: true,
  3336. prefix: false,
  3337. suffix: false,
  3338. inputType: 'color',
  3339. hiddenText: true,
  3340. },
  3341. },
  3342. {
  3343. name: '开关',
  3344. icon: 'l-kaiguan',
  3345. data: {
  3346. name: 'switch',
  3347. disableAnchor: true,
  3348. height: 30,
  3349. width: 60,
  3350. checked: true,
  3351. offColor: '#303746',
  3352. onColor: '#4583FF',
  3353. disableOffColor: '#E5E5E5',
  3354. disableOnColor: '#A3D3FF',
  3355. hoverBackground: '#40a9ff',
  3356. },
  3357. },
  3358. {
  3359. name: '滑块',
  3360. icon: 'l-huakuai',
  3361. data: {
  3362. anchors: [],
  3363. disableAnchor: true,
  3364. name: 'slider',
  3365. width: 300,
  3366. height: 20,
  3367. value: 10,
  3368. textWidth: 50,
  3369. barHeight: 4,
  3370. min: 0,
  3371. max: 100,
  3372. activeColor: '#4583FF',
  3373. background: '#303746',
  3374. textColor: '#FFFFFF66',
  3375. unit: '%',
  3376. },
  3377. },
  3378. ],
  3379. },
  3380. {
  3381. name: '工控',
  3382. show: true,
  3383. list: [
  3384. {
  3385. name: '圆柱水位',
  3386. icon: 'l-yuanzhushuiwei',
  3387. data: {
  3388. name: 'waterTank',
  3389. width: 128,
  3390. height: 128,
  3391. disableAnchor: true,
  3392. color: '#FFFFFF00',
  3393. progress: 0.5,
  3394. progressColor: '#4583FF',
  3395. },
  3396. },
  3397. {
  3398. name: '球形水位',
  3399. icon: 'l-qiuxingshuiwei',
  3400. data: {
  3401. name: 'watermeter',
  3402. width: 128,
  3403. height: 128,
  3404. disableAnchor: true,
  3405. background: '#4583FF',
  3406. value: 50,
  3407. max: 70,
  3408. min: 20,
  3409. maxBackground: '#f5222d',
  3410. minBackground: '#52c41a',
  3411. // maxText: 'max',
  3412. // minText: 'min',
  3413. scaleShow: false,
  3414. },
  3415. },
  3416. {
  3417. name: '指示灯',
  3418. icon: 'l-zhishideng',
  3419. data: {
  3420. name: 'indicatorLight',
  3421. disableAnchor: true,
  3422. width: 128,
  3423. height: 128,
  3424. displayStatus: 0, //显示状态 默认 方形 圆形
  3425. background: '#4583FF33',
  3426. color: '#4583FF',
  3427. hiddenText: true,
  3428. onColor: '#58CC84',
  3429. frames: [
  3430. {
  3431. background: '#4583FF33',
  3432. color: '#4583FF',
  3433. bkType: 0,
  3434. duration: 200,
  3435. strokeType: 0,
  3436. visible: true,
  3437. },
  3438. {
  3439. background: '#4583FF33',
  3440. color: '#4583FF',
  3441. bkType: 0,
  3442. duration: 200,
  3443. strokeType: 0,
  3444. visible: true,
  3445. },
  3446. ],
  3447. animateType: 'custom',
  3448. },
  3449. props: {
  3450. custom: [
  3451. {
  3452. key: 'state',
  3453. value: 'on',
  3454. type: 'select',
  3455. options: [
  3456. { label: '开', value: 'on' },
  3457. { label: '关', value: 'off' },
  3458. ],
  3459. },
  3460. ],
  3461. },
  3462. },
  3463. {
  3464. name: '圆形按钮',
  3465. icon: 'l-yuanxinganniu', //l-yuanxinganniu
  3466. data: {
  3467. name: 'roundSwitch',
  3468. width: 128,
  3469. height: 128,
  3470. checked: true,
  3471. disableInput: true,
  3472. offColor: '#FFA98F',
  3473. onColor: '#80D99F',
  3474. color: '#4583FF', //66 33
  3475. background: '#4583FF33',
  3476. offShadowColor: '#FF5D3C',
  3477. onShadowColor: '#58CC84',
  3478. },
  3479. },
  3480. {
  3481. name: '船型开关',
  3482. icon: 'l-chuanxingkaiguan',
  3483. data: {
  3484. name: 'rockerSwitch',
  3485. width: 72,
  3486. height: 128,
  3487. disableInput: true,
  3488. offColor: '#FFA98F',
  3489. onColor: '#80D99F',
  3490. color: '#4583FF', //66 33
  3491. background: '#4583FF33',
  3492. offShadowColor: '#FF5D3C',
  3493. onShadowColor: '#58CC84',
  3494. },
  3495. },
  3496. {
  3497. name: '转换开关',
  3498. icon: 'l-zhuanhuankaiguan', //l-zhuanhuankaiguan
  3499. data: {
  3500. name: 'transferSwitch',
  3501. width: 128,
  3502. height: 128,
  3503. checked: true,
  3504. disableInput: true,
  3505. offColor: '#FFA98F',
  3506. onColor: '#80D99F',
  3507. color: '#4583FF', //66 33
  3508. background: '#4583FF33',
  3509. offShadowColor: '#FF5D3C',
  3510. onShadowColor: '#58CC84',
  3511. },
  3512. },
  3513. {
  3514. name: '闸刀',
  3515. icon: 'l-zhadao',
  3516. data: {
  3517. name: 'knifeSwitch',
  3518. width: 64,
  3519. height: 128,
  3520. color: '#4583FF',
  3521. disableInput: true,
  3522. background: '#4583FF33',
  3523. offColor: '#FF5D3C',
  3524. onColor: '#58CC84',
  3525. // events: [
  3526. // {
  3527. // action: 5,
  3528. // name: 'click',
  3529. // value: 'window.meta2d.setValue({id:pen.id,switch:!pen.switch});',
  3530. // },
  3531. // ],
  3532. },
  3533. },
  3534. {
  3535. name: '拨动开关',
  3536. icon: 'l-bodongkaiguan',
  3537. data: {
  3538. name: 'toggleSwitch',
  3539. width: 128,
  3540. height: 128,
  3541. checked: true,
  3542. disableInput: true,
  3543. color: '#4583FF',
  3544. background: '#4583FF33',
  3545. offColor: '#FF5D3C',
  3546. onColor: '#58CC84',
  3547. // events: [
  3548. // {
  3549. // action: 5,
  3550. // name: 'click',
  3551. // value:
  3552. // 'window.meta2d.setValue({id:pen.id,switch:!pen.switch});window.meta2d.render()',
  3553. // },
  3554. // ],
  3555. },
  3556. },
  3557. {
  3558. name: '空气开关',
  3559. icon: 'l-kongqikaiguan',
  3560. data: {
  3561. name: 'airSwitch',
  3562. width: 120,
  3563. height: 128,
  3564. switch: true,
  3565. color: '#4583FF',
  3566. background: '#4583FF33',
  3567. offColor: '#FF5D3C',
  3568. onColor: '#58CC84',
  3569. disableInput: true,
  3570. },
  3571. },
  3572. {
  3573. name: '水柱温度计',
  3574. icon: 'l-shuizhuwendu',
  3575. data: {
  3576. name: 'thermometer',
  3577. width: 32,
  3578. height: 128,
  3579. disableAnchor: true,
  3580. color: '#4583FF',
  3581. textColor: '#FFFFFFB3',
  3582. background: '#FF5D3C33',
  3583. activeBacground: '#FF5D3C',
  3584. value: -10,
  3585. min: -20,
  3586. max: 20,
  3587. },
  3588. },
  3589. {
  3590. name: '扁平温度计',
  3591. icon: 'l-bianpingwendu',
  3592. data: {
  3593. name: 'thermometer1',
  3594. disableAnchor: true,
  3595. width: 48,
  3596. height: 128,
  3597. backgroundColor: '#666',
  3598. value: 0,
  3599. min: -20,
  3600. max: 20,
  3601. color: '#4583FF',
  3602. markColor: '#fff',
  3603. background: '#FF5D3C33',
  3604. activeBackground: '#FF5D3C',
  3605. textColor: '#FFFFFFB3',
  3606. sub: 5,
  3607. barrel: {
  3608. x: 0.3,
  3609. y: 0.2,
  3610. width: 0.2,
  3611. height: 7 / 9,
  3612. },
  3613. },
  3614. },
  3615. {
  3616. name: '电池',
  3617. icon: 'l-dianchi',
  3618. data: {
  3619. name: 'battery',
  3620. disableAnchor: true,
  3621. width: 40,
  3622. height: 80,
  3623. // rotate: 90,
  3624. progress:0.6,
  3625. color:'#4583FF',
  3626. background:'#4583FF33',
  3627. progressColor:'#58CC84',
  3628. props: {
  3629. custom: [
  3630. {
  3631. key: 'min',
  3632. label: '最小值',
  3633. type: 'number',
  3634. placeholder:'默认0'
  3635. },
  3636. {
  3637. key: 'max',
  3638. label: '最大值',
  3639. type: 'number',
  3640. placeholder:'默认1'
  3641. },
  3642. {
  3643. key: 'splitNumber',
  3644. label: '分段数',
  3645. type: 'number',
  3646. },
  3647. {
  3648. key: 'gap',
  3649. label: '间隔占比',
  3650. type: 'number',
  3651. min:0,
  3652. max:1,
  3653. },
  3654. ],
  3655. },
  3656. },
  3657. },
  3658. ],
  3659. },
  3660. ];
  3661. export const cases: any[] = [
  3662. { name: '智慧物联' },
  3663. { name: '电力能源' },
  3664. { name: '智慧水务' },
  3665. { name: '智慧工厂' },
  3666. { name: '智慧校园' },
  3667. { name: '智慧园区' },
  3668. { name: '智慧交通' },
  3669. { name: '智慧城市' },
  3670. { name: '智慧农业' },
  3671. { name: '电信机房' },
  3672. { name: '航天航空' },
  3673. { name: '智能家居' },
  3674. ];
  3675. export const templates: any[] = [
  3676. { name: '主题', list: [] },
  3677. { name: '布局', list: [] },
  3678. ];
  3679. export const defaultPureColor: string[] = [
  3680. '#FF5959',
  3681. '#F5693B',
  3682. '#E6B420',
  3683. '#30EE6F',
  3684. '#30EEDC',
  3685. '#31A7F5',
  3686. '#7381FF',
  3687. '#AB73FF',
  3688. '#F054B1',
  3689. '#F75781',
  3690. '#ff925c',
  3691. '#e6d950',
  3692. '#51e69b',
  3693. '#59c8ff',
  3694. '#FF7875',
  3695. '#FF9C6E',
  3696. '#FFC069',
  3697. '#FFD666',
  3698. '#FFF566',
  3699. '#D3F261',
  3700. '#95DE64',
  3701. '#5CDBD3',
  3702. '#69C0FF',
  3703. '#85A5FF',
  3704. '#B37FEB',
  3705. '#FF85C0',
  3706. '#000000',
  3707. '#FFFFFF',
  3708. '#FFFFFF00',
  3709. ];
  3710. // export const defaultGradientColor: string[] = [
  3711. // 'linear-gradient(90deg, #E52600 0%, #CC0000 12%, #FF925C 80%, #FF622E 100%)',
  3712. // 'linear-gradient(90deg, #B36800 0%, #B36800 12%, #E6D950 80%, #CCB125 100%)',
  3713. // 'linear-gradient(90deg, #00B35A 0%, #00735F 12%, #51E69B 80%, #24CC6B 100%)',
  3714. // 'linear-gradient(90deg, #0073E6 0%, #1433CC 12%, #59C8FF 80%, #2EA5FF 100%)',
  3715. // 'linear-gradient(90deg, #a3aab2 0%, #7b7f8c 12%, #e5ecf0 80%, #bac2c9 100%)',
  3716. //
  3717. // 'linear-gradient(90deg, #FF622E 0%, #FF622E 18%,#CC0000 20%,#FF622E 50%, #CC0000 80%,#FF622E 82%, #FF622E 100%)',
  3718. // 'linear-gradient(90deg, #ccb125 0%, #ccb125 18%,#B36800 20%,#CCB125 50%, #B36800 80%,#CCB125 82%, #CCB125 100%)',
  3719. // 'linear-gradient(90deg, #24CC6B 0%, #24CC6B 18%,#00735F 20%,#24CC6B 50%, #00735F 80%,#24CC6B 82%, #24CC6B 100%)',
  3720. // 'linear-gradient(90deg, #2EA5FF 0%, #2EA5FF 18%,#1433CC 20%,#2EA5FF 50%, #1433CC 80%,#2EA5FF 82%, #2EA5FF 100%)',
  3721. // 'linear-gradient(90deg, #bac2c9 0%, #bac2c9 18%,#7b7f8c 20%,#bac2c9 50%, #7b7f8c 80%,#bac2c9 82%, #bac2c9 100%)'
  3722. // ]
  3723. export const defaultGradientColor: string[] = [
  3724. '#ff925c',
  3725. '#e6d950',
  3726. '#51e69b',
  3727. '#59c8ff',
  3728. '#FF7875',
  3729. '#FF9C6E',
  3730. '#FFC069',
  3731. '#FFD666',
  3732. '#FFF566',
  3733. '#D3F261',
  3734. '#95DE64',
  3735. '#5CDBD3',
  3736. '#69C0FF',
  3737. '#85A5FF',
  3738. '#B37FEB',
  3739. '#FF85C0',
  3740. '#000000',
  3741. '#FFFFFF',
  3742. ];