EditPanel.vue 53 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223
  1. <template>
  2. <div class="panel panel-edit" style="background:rgba(255,255,255,1)">
  3. <div class="panel-tab clearfix">
  4. <div class="tab" @click="function () { panelTabState = 0 }">
  5. <div v-show="panelState === 11 || panelState === 14" class="selected-tab"
  6. :class="{ active: panelTabState === 0 }">
  7. <img style="width:12px; height:15px; vertical-align: middle"
  8. :src="panelTabState === 0?'http://yun-image.elab-plus.com/images/dyb/tab-selected-txt.png':'http://yun-image.elab-plus.com/images/dyb/tab-unselected-txt.png'"
  9. alt="">
  10. <span class="tab-text">文本</span>
  11. </div>
  12. <div v-show="panelState === 12 || panelState === 13" class="selected-tab"
  13. :class="{ active: panelTabState === 0 }">
  14. <img style="width:12px; height:15px; vertical-align: middle"
  15. :src="panelTabState === 0?'http://yun-image.elab-plus.com/images/dyb/tab-selected-element.png':'http://yun-image.elab-plus.com/images/dyb/tab-unselected-element.png'"
  16. alt="">
  17. <span class="tab-text">元素</span>
  18. </div>
  19. <div v-show="panelState === 15" class="selected-tab" :class="{ active: panelTabState === 0 }">
  20. <img style="width:12px; height:15px; vertical-align: middle"
  21. :src="panelTabState === 0?'http://yun-image.elab-plus.com/images/dyb/tab-selected-txt.png':'http://yun-image.elab-plus.com/images/dyb/tab-unselected-txt.png'"
  22. alt="">
  23. <span class="tab-text">按钮</span>
  24. </div>
  25. </div>
  26. <div class="tab" @click="function () { panelTabState = 1 }">
  27. <div class="selected-tab" :class="{ active: panelTabState === 1 }">
  28. <img style="width:14px; height:14px; vertical-align: middle"
  29. :src="panelTabState === 1?'http://yun-image.elab-plus.com/images/dyb/tab-selected-property.png':'http://yun-image.elab-plus.com/images/dyb/tab-unselected-property.png'"
  30. alt="">
  31. <span class="tab-text">属性动作</span>
  32. </div>
  33. </div>
  34. </div>
  35. <div v-show="panelTabState === 0">
  36. <div v-show="panelState === 11||panelState===15">
  37. <div
  38. style="vertical-align: middle;display: flex; flex-direction: column; padding: 12px 0; border-bottom: #E2E4EE solid 1px; align-items: center"
  39. v-show="panelState == 15">
  40. <div style="display: flex;flex-direction: row;background:rgba(244,246,255,1);
  41. border-radius:8px; padding: 12px;">
  42. <div style="display: flex; flex-direction: column; align-items: center">
  43. <div :style="{ backgroundImage: 'url(' + element.imgSrc + ')','width':'100px', 'height':'100px','background-repeat': 'no-repeat',
  44. 'background-position': 'center',
  45. 'background-size': 'contain'}"></div>
  46. <span style="font-size:12px;
  47. font-family:MicrosoftYaHei;
  48. color:rgba(51,51,51,1);
  49. display: block;
  50. line-height:16px;">未选中状态</span>
  51. </div>
  52. <div style="margin-left: 14px; display: flex; flex-direction: column; align-items: center">
  53. <div :style="{ backgroundImage: 'url(' + element.imgSrc + ')','width':'100px', 'height':'100px','background-repeat': 'no-repeat',
  54. 'background-position': 'center',
  55. 'background-size': 'contain'}"></div>
  56. <span style="font-size:12px;
  57. font-family:MicrosoftYaHei;
  58. color:rgba(51,51,51,1);
  59. line-height:16px;">选中状态</span>
  60. </div>
  61. </div>
  62. <label style="display: block;
  63. cursor: pointer; width:166px; position: relative;
  64. margin-bottom: 12px;
  65. height:28px;">
  66. <div @click="showSelectedPicOrUnSelectedPic" style="width:166px;
  67. height:28px;
  68. background:rgba(78,93,255,1);
  69. border-radius:14px;font-size:14px;
  70. font-family:MicrosoftYaHei;
  71. color:rgba(255,255,255,1);
  72. display: flex;
  73. justify-content: center;
  74. line-height:28px;">替换按钮样式
  75. </div>
  76. <!-- <input style="display: none;position: absolute;top: 0px;" type="file" @change="fileChange"
  77. multiple="false"> -->
  78. </label>
  79. </div>
  80. <div style="vertical-align: middle;display: flex;flex-direction: column;border-bottom: #E2E4EE solid 1px">
  81. <div style="font-size: 12px; font-family:MicrosoftYaHei;
  82. color:rgba(51,51,51,1);
  83. margin-left: 23px;
  84. margin-top: 12px;
  85. line-height:16px;letter-spacing: 0;text-align: left;float:left;padding-bottom: 6px;">
  86. 文本内容</div>
  87. <textarea class="input" style="height:50px;border-radius: inherit; resize: none; padding: 6px 12px;font-size:13px;
  88. font-family:MicrosoftYaHei;
  89. color:rgba(100,107,129,1);
  90. box-sizing: border-box;
  91. margin-left: 18px;
  92. margin-right: 18px;
  93. line-height:17px; background:rgba(241,241,241,1);
  94. margin-bottom: 12px;
  95. border:1px solid rgba(227,227,227,1);" v-model="element.text" placeholder="请输入内容"></textarea>
  96. </div>
  97. <div style="vertical-align: middle;border-bottom: #E2E4EE solid 1px">
  98. <div style="font-size: 12px; font-family:MicrosoftYaHei;
  99. color:rgba(51,51,51,1);
  100. margin-left: 23px;
  101. margin-top: 11px;
  102. line-height:16px;letter-spacing: 0;text-align: left;padding-bottom: 6px;">字体</div>
  103. <el-select placeholder="请选择字体" v-model="element.fontFamily" clearable style="margin-left: 18px; width: calc(100% - 36px); margin-bottom: 12px;
  104. font-size: 12px;color:rgba(51,51,51,1);
  105. margin-right: 18px;">
  106. <el-option class="fontSelect" v-for="item in fontFamily" :label="item" :value="item"></el-option>
  107. </el-select>
  108. </div>
  109. <div
  110. style="vertical-align: middle;border-bottom: #E2E4EE solid 1px;display: flex;flex-direction: row;padding-top: 12px ;justify-content: space-between">
  111. <div style="margin-left: 20px">
  112. <div>
  113. <div style="font-size:12px;
  114. font-family:MicrosoftYaHei;
  115. color:rgba(51,51,51,1);
  116. line-height:16px;letter-spacing: 0;text-align: left;padding-bottom: 5px;">
  117. 字号</div>
  118. <div style="font-size: 12px; color: #999999;letter-spacing: 0;text-align: left;padding-bottom: 5px;">
  119. <el-input-number :min="12" v-model="element.fontSize" style="width: 110px;" size='small'>
  120. </el-input-number>
  121. </div>
  122. </div>
  123. <div>
  124. <div style="font-size:12px;
  125. font-family:MicrosoftYaHei;
  126. color:rgba(51,51,51,1);
  127. line-height:16px;letter-spacing: 0;text-align: left;padding-bottom: 5px;">
  128. 缩进</div>
  129. <div style="font-size: 14px; color: #999999;letter-spacing: 0;text-align: left;padding-bottom: 11px;">
  130. <el-input-number v-model="element.textIndent" :step="0.5" style="width: 110px;" size='small'>
  131. </el-input-number>
  132. </div>
  133. </div>
  134. </div>
  135. <div style="margin-right: 10px">
  136. <div>
  137. <div style="font-size:12px;
  138. font-family:MicrosoftYaHei;
  139. color:rgba(51,51,51,1);
  140. line-height:16px;letter-spacing: 0;text-align: left;padding-bottom: 5px;">
  141. 行距</div>
  142. <div style="font-size: 12px; color: #999999;letter-spacing: 0;text-align: left;padding-bottom: 5px;">
  143. <el-input-number v-model="element.lineHeight" style="width: 110px;" size='small'></el-input-number>
  144. </div>
  145. </div>
  146. <div>
  147. <div style="font-size:12px;
  148. font-family:MicrosoftYaHei;
  149. color:rgba(51,51,51,1);
  150. line-height:16px;letter-spacing: 0;text-align: left;padding-bottom: 5px;">
  151. 字距</div>
  152. <div style="font-size: 14px; color: #999999;letter-spacing: 0;text-align: left;padding-bottom: 11px;">
  153. <el-input-number v-model="element.letterSpacing" :step="0.1" style="width: 110px;" size='small'>
  154. </el-input-number>
  155. </div>
  156. </div>
  157. </div>
  158. </div>
  159. <div style="vertical-align: middle;border-bottom: #E2E4EE solid 1px;padding-bottom: 12px; padding-top: 11px;">
  160. <div style="display: inline-flex; width:24%;text-align: left; margin-bottom: 10px;">
  161. <div style="font-size:12px;
  162. font-family:MicrosoftYaHei;
  163. color:rgba(51,51,51,1);
  164. margin-left: 20px;
  165. line-height:16px;letter-spacing: 0; word-break:keep-all;">
  166. 文字对齐
  167. </div>
  168. </div>
  169. <div style="text-align: center">
  170. <div style="display: inline-flex; overflow: hidden;width: 30%; cursor: pointer;" title="左对齐"
  171. @click="element.textAlign = 'left'">
  172. <div
  173. :style="{'font-size': '12px','letter-spacing': 0, 'word-break':'keep-all','width':'100%', 'background': element.textAlign=='left'? 'white':''}">
  174. <img style="width:62px;height:24px;"
  175. :src="element.textAlign=='left'?'http://yun-image.elab-plus.com/images/dyb/icon_text_left_active.png':'http://yun-image.elab-plus.com/images/dyb/icon_text_left.png'" />
  176. </div>
  177. </div>
  178. <div style="display: inline-flex; overflow: hidden;width: 30%; cursor: pointer;" title="居中"
  179. @click="element.textAlign = 'center'">
  180. <div
  181. :style="{'font-size': '12px','letter-spacing': 0, 'word-break':'keep-all','width':'100%', 'background': element.textAlign=='center'? 'white':''}">
  182. <img style="width:62px;height:24px;"
  183. :src="element.textAlign=='center'? 'http://yun-image.elab-plus.com/images/dyb/icon_text_centered_active.png':'http://yun-image.elab-plus.com/images/dyb/icon_text_centered.png'" />
  184. </div>
  185. </div>
  186. <div style="display: inline-flex; overflow: hidden;width: 30%; cursor: pointer;"
  187. @click="element.textAlign = 'right'" title="右对齐">
  188. <div
  189. :style="{'font-size': '12px','letter-spacing': 0, 'word-break':'keep-all','width':'100%', 'background': element.textAlign=='right'? 'white':''}">
  190. <img style="width:62px;height:24px;"
  191. :src="element.textAlign=='right'?'http://yun-image.elab-plus.com/images/dyb/icon_text_right_active.png':'http://yun-image.elab-plus.com/images/dyb/icon_text_right.png'" />
  192. </div>
  193. </div>
  194. </div>
  195. <div style="margin-top: 3px;text-align: center" id="topCenterDown">
  196. <div style="display: inline-flex; overflow: hidden;width: 30%; cursor: pointer;" title="上对齐">
  197. <div
  198. :style="{'font-size': '12px','letter-spacing': 0, 'word-break':'keep-all','width':'100%', 'background': element.verticalAlign=='top'? 'white':''}"
  199. @click="element.verticalAlign = 'top';element.display = 'table-cell'">
  200. <img style="width:62px;height:24px;"
  201. :src="element.verticalAlign=='top'?'http://yun-image.elab-plus.com/images/dyb/icon_text_top_active.png':'http://yun-image.elab-plus.com/images/dyb/icon_text_top.png'" />
  202. </div>
  203. </div>
  204. <div style="display: inline-flex; overflow: hidden;width: 30%; cursor: pointer;" title="居中">
  205. <div
  206. :style="{'font-size': '12px','letter-spacing': 0, 'word-break':'keep-all','width':'100%', 'background': element.verticalAlign=='middle'? 'white':''}"
  207. @click="element.verticalAlign = 'middle';element.display = 'table-cell'">
  208. <img style="width:62px;height:24px;"
  209. :src="element.verticalAlign=='middle'?'http://yun-image.elab-plus.com/images/dyb/icon_text_centered_active.png':'http://yun-image.elab-plus.com/images/dyb/icon_text_centered.png'" />
  210. </div>
  211. </div>
  212. <div style="display: inline-flex; overflow: hidden;width: 30%; cursor: pointer;"
  213. @click="element.verticalAlign = 'bottom';element.display = 'table-cell'" title="下对齐">
  214. <div
  215. :style="{'font-size': '12px','letter-spacing': 0, 'word-break':'keep-all','width':'100%', 'background': element.verticalAlign=='bottom'? 'white':''}">
  216. <img style="width:62px;height:24px;"
  217. :src="element.verticalAlign=='bottom'?'http://yun-image.elab-plus.com/images/dyb/icon_text_bottom_active.png':'http://yun-image.elab-plus.com/images/dyb/icon_text_bottom.png'" />
  218. </div>
  219. </div>
  220. </div>
  221. </div>
  222. <div style="text-align: center;border-bottom: #E2E4EE solid 1px;padding-top: 12px;padding-bottom: 12px;">
  223. <div style="width:100%; display: flex;flex-direction: row">
  224. <div
  225. style="display: inline-flex; overflow: hidden;cursor: pointer;width:50%;justify-content: left; margin-left: 20px;">
  226. <div style="font-size:12px;
  227. font-family:MicrosoftYaHei;
  228. color:rgba(51,51,51,1);
  229. display: flex;
  230. align-items: center;
  231. letter-spacing: 0; word-break:keep-all;">文字颜色</div>
  232. <div style="font-size: 14px;color: #999999;letter-spacing: 0; word-break:keep-all; margin-left: 5px;">
  233. <el-color-picker v-model="element.color" show-alpha style="width: 100%;" size='small'></el-color-picker>
  234. </div>
  235. </div>
  236. <div
  237. style="display: inline-flex; overflow: hidden;cursor: pointer;width:50%;justify-content: left; margin-left: 20px;">
  238. <div style="font-size:12px;
  239. font-family:MicrosoftYaHei;
  240. color:rgba(51,51,51,1);
  241. align-items: center;
  242. display: flex;
  243. letter-spacing: 0; word-break:keep-all;">底色填充</div>
  244. <div style="font-size: 14px;color: #999999;letter-spacing: 0; word-break:keep-all;margin-left: 5px;">
  245. <el-color-picker v-model="element.backgroundColor" show-alpha style="width: 100%" size='small'>
  246. </el-color-picker>
  247. </div>
  248. </div>
  249. </div>
  250. </div>
  251. </div>
  252. <div style="margin-top: 1px;">
  253. <div style="width: 100%;display: inline-flex; align-items: center;border-bottom: #E2E4EE solid 1px;
  254. padding-top: 12px;padding-bottom: 12px;
  255. " v-show="panelState == 13">
  256. <div style="font-size:12px;
  257. font-family:MicrosoftYaHei;
  258. margin-left: 20px;
  259. margin-right: 10px;
  260. color:rgba(51,51,51,1);letter-spacing: 0; word-break:keep-all;line-height: 40px">轮播特效
  261. </div>
  262. <div style="font-size:12px;
  263. font-family:MicrosoftYaHei;
  264. color:rgba(51,51,51,1);letter-spacing: 0; word-break:keep-all;">
  265. <el-select v-model="element.swiperType" placeholder="请选择" size="mini">
  266. <el-option v-for="(item,index) in carouselTypes" :key="item.value" :label="item.label"
  267. :value="item.value">
  268. </el-option>
  269. </el-select>
  270. </div>
  271. </div>
  272. <div style="text-align: left;border-bottom: #E2E4EE solid 1px; width: 100%;padding-left: 20px;">
  273. <div style="display: inline-flex; margin-left: -6px" v-show="panelState == 11">
  274. <el-checkbox v-model="element.fontWeight" true-label="bold" false-label="normal">加粗</el-checkbox>
  275. </div>
  276. <div style="display: inline-flex" v-show="panelState == 11">
  277. <el-checkbox v-model="element.allTransparent" true-label="rgba(0,0,0,0)" false-label="">透明</el-checkbox>
  278. </div>
  279. <div style="display: inline-flex" v-show="panelState == 11">
  280. <el-checkbox v-model="element.verticalFont" true-label="vertical-rl" false-label="" @change="verticalRow">竖排
  281. </el-checkbox>
  282. </div>
  283. <div
  284. style="width: 100%;display: inline-flex; padding: 12px 0 ;border-bottom: #E2E4EE solid 1px; margin-left:-20px; padding-left: 20px;"
  285. v-show="panelState == 12">
  286. <div>
  287. <div :style="{ backgroundImage: 'url(' + element.imgSrc + ')','width':'100px', 'height':'100px','background-repeat': 'no-repeat',
  288. 'background-position': 'center',
  289. 'background-size': 'contain'}"></div>
  290. </div>
  291. <div style="display:flex; flex-direction: column;margin-left: 16px;">
  292. <span style="font-size:14px;
  293. font-family:MicrosoftYaHei;
  294. margin-bottom: 4px;
  295. color:rgba(100,107,129,1);
  296. line-height:19px;">当前图片</span>
  297. <span style="font-size:14px;
  298. font-family:MicrosoftYaHei;
  299. color:rgba(100,107,129,1);
  300. line-height:19px;">
  301. {{element.imgSrc|currentImageName}}
  302. </span>
  303. <label style="display: block;margin-bottom: 12px;
  304. cursor: pointer; width:108px;position: relative;
  305. height:28px;">
  306. <div style="width:108px;
  307. height:28px;
  308. background:rgba(78,93,255,1);
  309. border-radius:14px;font-size:14px;
  310. font-family:MicrosoftYaHei;
  311. color:rgba(255,255,255,1);
  312. display: flex;
  313. justify-content: center;
  314. line-height:28px;">替换元素
  315. </div>
  316. <input style="display: none;position: absolute;top: 0px;" type="file" @change="fileChange"
  317. multiple="false">
  318. </label>
  319. </div>
  320. </div>
  321. <div style="display: inline-flex;margin-right: 10px;" v-show="panelState != 14 && panelState != 16">
  322. <el-checkbox v-model="element.elabEditable">可编辑</el-checkbox>
  323. </div>
  324. <div style="width: 70px;height:41px;line-height: 41px; display: inline-block;" v-show="panelState != 16">
  325. <div style="width:44px;
  326. height:24px;
  327. background:rgba(78,93,255,1);
  328. border-radius:12px;font-size:12px;
  329. font-family:MicrosoftYaHei;
  330. display: inline-block;
  331. text-align: center;
  332. justify-content: center;
  333. line-height: 24px;
  334. color:rgba(255,255,255,1);" @click="setGroup(element)">
  335. {{element.children!=null?(element.children.length>0?'解组':'组合'):'组合'}}</div>
  336. </div>
  337. </div>
  338. </div>
  339. <div style="border-bottom: #E2E4EE solid 1px; width: 100%;padding-left: 20px; padding-bottom: 11px;">
  340. <div>
  341. <div style="font-size:12px;
  342. font-family:MicrosoftYaHei;
  343. color:rgba(51,51,51,1);
  344. margin-top: 11px;
  345. line-height:16px;;letter-spacing: 0; word-break:keep-all;width:100%">
  346. 元素设置
  347. </div>
  348. </div>
  349. <div style="display: flex; overflow: hidden; cursor: pointer; margin-top: 4px;">
  350. <div
  351. :style="{'font-size': '12px','letter-spacing': 0, 'word-break':'keep-all','text-align':'left','width':'23%'}"
  352. @click="copyElement">
  353. <div style="width:44px;
  354. height:24px;
  355. background:rgba(78,93,255,1);
  356. border-radius:12px;font-size:12px;
  357. font-family:MicrosoftYaHei;
  358. display: inline-block;
  359. text-align: center;
  360. line-height: 24px;
  361. color:rgba(255,255,255,1);">复制</div>
  362. </div>
  363. <div style="display: inline-flex; overflow: hidden; cursor: pointer; text-align: left;width: 23%">
  364. <div title="左对齐"
  365. :style="{'font-size': '12px','letter-spacing': 0, 'word-break':'keep-all','text-align':'center','width':'100%', 'background': element.left=='0'? 'white':''}"
  366. @click="element.left = '0';">
  367. <img style="width: 44px; height:24px;"
  368. :src="element.left=='0'?'http://yun-image.elab-plus.com/images/dyb/icon_left_active.png':'http://yun-image.elab-plus.com/images/dyb/icon_left.png'" />
  369. </div>
  370. </div>
  371. <div title="居中对齐" style="display: inline-flex; overflow: hidden;cursor: pointer;text-align: left;width: 23%"
  372. @click="element.left = 375-element.width/2;">
  373. <div
  374. :style="{'font-size': '12px','letter-spacing': 0, 'word-break':'keep-all','text-align':'center','width':'100%', 'background': element.left==375-element.width/2? 'white':''}">
  375. <img style="width: 44px; height:24px;"
  376. :src="element.left==375-element.width/2?'http://yun-image.elab-plus.com/images/dyb/icon_center_active.png':'http://yun-image.elab-plus.com/images/dyb/icon_center.png'" />
  377. </div>
  378. </div>
  379. <div title="右对齐" style="display: inline-flex;cursor: pointer;text-align: left;width: 23%"
  380. @click="element.left = 750-element.width;">
  381. <div
  382. :style="{'font-size': '12px','letter-spacing': 0, 'word-break':'keep-all','text-align':'center','width':'100%', 'background': element.left==750-element.width? 'white':''}">
  383. <img style="width: 44px; height:24px;"
  384. :src="element.left==750-element.width?'http://yun-image.elab-plus.com/images/dyb/icon_left_active.png':'http://yun-image.elab-plus.com/images/dyb/icon_left.png'" />
  385. </div>
  386. </div>
  387. </div>
  388. </div>
  389. <div class="item"></div>
  390. <div style="border-bottom: #E2E4EE solid 1px; padding-bottom: 11px;" v-show="panelState!=14">
  391. <div style="display:flex; flex-direction: row;margin-left: 18px;">
  392. <div style="font-size:12px;
  393. font-family:MicrosoftYaHei;
  394. color:rgba(51,51,51,1);
  395. display: inline-block;
  396. line-height:38px;">
  397. 透明度</div>
  398. <el-slider v-model="element.opacity" show-input input-size="mini" style="width: 80%;margin-left: 10px;">
  399. </el-slider>
  400. </div>
  401. <div style="display:flex; flex-direction: row;margin-left: 18px;">
  402. <span style="font-size:12px;
  403. font-family:MicrosoftYaHei;
  404. color:rgba(51,51,51,1); display: inline-block;
  405. line-height:38px;
  406. letter-spacing: 0;">&nbsp&nbsp&nbsp旋转</span>
  407. <el-slider v-model="element.transform" show-input input-size="mini" :max="359"
  408. style="width: 80%;margin-left: 10px;">
  409. </el-slider>
  410. </div>
  411. <div v-show="panelState == 12||panelState == 15" style="display: flex; flex-direction: row;margin-left: 5px;">
  412. <div style="font-size:12px;
  413. font-family:MicrosoftYaHei;
  414. color:rgba(51,51,51,1);
  415. line-height:38px;
  416. letter-spacing: 0;">
  417. 圆形比例</div>
  418. <el-slider v-model="element.circular" show-input input-size="mini" :max="100"
  419. style="width: 76.5%;margin-left: 10px;"></el-slider>
  420. </div>
  421. </div>
  422. <div v-show="panelState == 12 || panelState == 13||panelState == 15" style="border-bottom: #E2E4EE solid 1px;">
  423. <div
  424. style="vertical-align: middle;padding-top: 15px;border: 1px solid transparent; padding-left: 20px; padding-right: 20px;">
  425. <div style="font-size:12px;
  426. font-family:MicrosoftYaHei;
  427. color:rgba(51,51,51,1);
  428. line-height:16px;letter-spacing: 0;text-align: left;padding-bottom: 5px;float:left;">
  429. 阴影颜色</div>
  430. <div style="font-size:12px;
  431. font-family:MicrosoftYaHei;
  432. color:rgba(51,51,51,1);
  433. line-height:16px;letter-spacing: 0;text-align: left;padding-bottom: 5px;float:right;margin-right: 30px;">
  434. 阴影模糊大小</div>
  435. </div>
  436. <div
  437. style="vertical-align: middle;padding-top: 20px;border: 1px solid transparent;padding-left: 20px; padding-right: 20px;">
  438. <div style="font-size:12px;
  439. font-family:MicrosoftYaHei;
  440. color:rgba(51,51,51,1);letter-spacing: 0;text-align: left;padding-bottom: 5px;float:left;">
  441. <el-color-picker v-model="element.shadowColor" show-alpha size="mini"></el-color-picker>
  442. </div>
  443. <div
  444. style="font-size:12px;
  445. font-family:MicrosoftYaHei;
  446. color:rgba(51,51,51,1);letter-spacing: 0;text-align: left;padding-bottom: 5px;float:right;margin-left:10px">
  447. <el-input-number v-model="element.shadowVague" :value="0" style="width: 100px;" size='small'>
  448. </el-input-number>
  449. </div>
  450. </div>
  451. <div class="item"> </div>
  452. <div style="font-size:12px;
  453. font-family:MicrosoftYaHei;
  454. color:rgba(51,51,51,1);letter-spacing: 0;text-align: left;float:left;padding-bottom: 5px; padding-left: 20px;">
  455. 阴影偏移距离</div>
  456. <div
  457. style="vertical-align: middle;padding-top: 20px;border: 1px solid transparent;padding-left: 20px; padding-right: 20px;">
  458. <div style="font-size:12px;
  459. font-family:MicrosoftYaHei;
  460. color:rgba(51,51,51,1);letter-spacing: 0;text-align: left;padding-bottom: 5px;float:left;">
  461. X <el-input-number v-model="element.shadowX" controls-position="right"
  462. style="width: 100px;margin-left: 5px;" size='small'></el-input-number>
  463. </div>
  464. <div
  465. style="font-size:12px;
  466. font-family:MicrosoftYaHei;
  467. color:rgba(51,51,51,1);letter-spacing: 0;text-align: right;padding-bottom: 5px;float:right;margin-left:10px">
  468. Y <el-input-number v-model="element.shadowY" controls-position="right"
  469. style="width: 100px;margin-left: 5px;" size='small'></el-input-number>
  470. </div>
  471. </div>
  472. <div class="item"> </div>
  473. </div>
  474. <div style="border-bottom: #E2E4EE solid 1px; ">
  475. <div style="font-size:12px;
  476. font-family:MicrosoftYaHei;
  477. color:rgba(51,51,51,1);
  478. margin-left: 20px;
  479. margin-top: 11px;
  480. line-height:16px;letter-spacing: 0;text-align: left;padding-bottom: 5px;">位置
  481. </div>
  482. <div
  483. style="vertical-align: middle; display: flex;flex-direction: row;justify-content: space-between;margin-bottom: 5px;">
  484. <div style="font-size:12px;
  485. font-family:MicrosoftYaHei;
  486. color:rgba(51,51,51,1);
  487. margin-left: 20px;
  488. line-height:16px;letter-spacing: 0;">
  489. X <el-input-number v-model="element.left" :disabled="panelState==14" controls-position="right" size='small'
  490. style="width: 100px;margin-left: 8px;"></el-input-number>
  491. </div>
  492. <div style="font-size:12px;
  493. font-family:MicrosoftYaHei;
  494. color:rgba(51,51,51,1);
  495. margin-right: 20px;
  496. line-height:16px;letter-spacing: 0;padding-bottom: 5px;">
  497. Y <el-input-number v-model="element.top" controls-position="right" style="width: 100px;margin-left: 8px;"
  498. size='small'>
  499. </el-input-number>
  500. </div>
  501. </div>
  502. <div
  503. style="vertical-align: middle;vertical-align: middle; display: flex;flex-direction: row;justify-content: space-between;margin-bottom: 11px;">
  504. <div style="font-size:12px;
  505. font-family:MicrosoftYaHei;
  506. color:rgba(51,51,51,1);
  507. margin-left: 20px;
  508. line-height:16px;letter-spacing: 0;">
  509. <el-input-number v-model="element.height" controls-position="right" style="width: 100px;margin-left: 7px;"
  510. size='small'>
  511. </el-input-number>
  512. </div>
  513. <div style="font-size:12px;
  514. font-family:MicrosoftYaHei;
  515. color:rgba(51,51,51,1);
  516. margin-right: 20px;
  517. line-height:16px;letter-spacing: 0;">
  518. <el-input-number v-model="element.width" :disabled="panelState==14" controls-position="right"
  519. style="width: 100px;margin-left: 7px;" size='small'></el-input-number>
  520. </div>
  521. </div>
  522. <div style="margin-bottom: 12px;">
  523. <span
  524. style="font-size:12px;font-family:MicrosoftYaHei;color:rgba(51,51,51,1);line-height:16px; margin-left: 20px;">相对固定</span>
  525. <el-switch v-model="element.isFixed" active-color="#4E5DFF" inactive-color="#D7E2FF">
  526. </el-switch>
  527. </div>
  528. </div>
  529. <div style="width: 100%; margin-bottom: 20px">
  530. <div style="font-size:12px;
  531. font-family:MicrosoftYaHei;
  532. color:rgba(51,51,51,1);
  533. margin-top: 11px;
  534. line-height:16px;text-align: left;margin-left: 20px" v-show="panelState!=14">跳转链接</div>
  535. <input v-show="panelState!=14" v-model="element.href"
  536. style="background:rgba(241,241,241,1);
  537. border:1px solid rgba(78,93,255,1);width:calc(100% - 40px);height:30px; margin-top: 7px; margin-left: 20px;"></input>
  538. </div>
  539. </div>
  540. <div v-if="panelTabState === 1">
  541. <div style="width: 100%;border-bottom: #E2E4EE solid 1px; padding-bottom: 12px; padding-top: 12px;">
  542. <div style="display:flex; flex-direction: row;width: 100%;justify-content: space-between;align-items: center">
  543. <span style="font-size:12px;
  544. font-family:MicrosoftYaHei;
  545. margin-left: 20px;
  546. color:rgba(51,51,51,1);">
  547. 速度</span>
  548. <el-slider v-model="element.duration" :step="0.1" :min="0" :max="10" show-input input-size="mini"
  549. style="width:80%;margin-right: 10px"></el-slider>
  550. </div>
  551. <div style="display:flex; flex-direction: row;width: 100%;justify-content: space-between;align-items: center">
  552. <span style="font-size:12px;
  553. font-family:MicrosoftYaHei;
  554. margin-left: 20px;
  555. color:rgba(51,51,51,1)">延迟</span>
  556. <el-slider v-model="element.delay" :step="0.1" :min="0" :max="10" show-input input-size="mini"
  557. style="width:80%;margin-right: 10px"></el-slider>
  558. </div>
  559. </div>
  560. <div
  561. style="vertical-align: middle; width: 100%; padding-top: 12px; padding-bottom: 12px;border-bottom: #E2E4EE solid 1px; display: flex; flex-direction: row;align-items: center">
  562. <div style="font-size:12px;
  563. font-family:MicrosoftYaHei;
  564. margin-left: 20px;
  565. color:rgba(51,51,51,1);
  566. line-height:16px;letter-spacing: 0;">是否循环</div>
  567. <el-switch v-model="element.loop" style="margin-left: 6px;" active-color="#4E5DFF" inactive-color="#D7E2FF">
  568. </el-switch>
  569. </div>
  570. <div style="width: 100%;">
  571. <div style="font-size:12px;
  572. font-family:MicrosoftYaHei;
  573. margin-left: 20px;
  574. margin-top: 12px;
  575. color:rgba(51,51,51,1);">选择动画</div>
  576. </div>
  577. <div style="margin-top: 10px; ">
  578. <div v-show="panelState === 11" style="width: 100%; padding-left:20px;padding-right: 8px;">
  579. <div
  580. style="display: inline-flex;margin-right: 12px;margin-bottom: 10px; overflow: hidden;text-align: center; cursor: pointer"
  581. v-for="(font,index) in animateFontList">
  582. <div v-model="element.animatedFont" @click="checkAnimationFont(font)" :title="font.name" :type="font.type"
  583. :style="{'background':'rgba(238,242,250,1)',
  584. 'border-radius':'12px',
  585. 'border':'1px solid rgba(205,209,221,1)','font-size': '12px',color: element.animatedFont==font.id? 'white':'#999999','letter-spacing': 0,'word-break':'keep-all',padding: '4px 13px',
  586. 'background': element.animatedFont==font.id? '#4E5DFF':'rgba(238,242,250,1)',
  587. 'border': element.animatedFont==font.id? '1px solid #4E5DFF':'1px solid rgba(205,209,221,1)',
  588. }" :hxFont="element.animatedFont" :hxid="font.id">{{font.name}}</div>
  589. </div>
  590. </div>
  591. <div style="width: 100%; padding-left:20px;padding-right: 8px;">
  592. <div
  593. style="display: inline-flex;margin-right: 12px;margin-bottom: 10px; overflow: hidden;text-align: center; cursor: pointer"
  594. v-for="(item,index) in animateList">
  595. <div v-model="element.animatedName" @click="checkAnimation(item)" :title="item.name" :type="item.type"
  596. :style="{'background':'rgba(238,242,250,1)',
  597. 'border-radius':'12px',
  598. 'border':'1px solid rgba(205,209,221,1)','font-size': '12px',color: element.animatedName==item.id? 'white':'#999999','letter-spacing': 0,'word-break':'keep-all',padding: '4px 13px',
  599. 'background': element.animatedName==item.id? '#4E5DFF':'rgba(238,242,250,1)',
  600. 'border': element.animatedName==item.id? '1px solid #4E5DFF':'1px solid rgba(205,209,221,1)'
  601. }">{{item.name}}</div>
  602. </div>
  603. </div>
  604. </div>
  605. </div>
  606. </div>
  607. </template>
  608. <style lang="less" scoped>
  609. .panel-edit {
  610. z-index: 1;
  611. .item {
  612. padding: 5px 0;
  613. clear: both;
  614. .content {
  615. margin-left: 70px;
  616. }
  617. div {
  618. display: flex;
  619. justify-content: flex-end;
  620. }
  621. }
  622. label {
  623. text-align: right;
  624. vertical-align: middle;
  625. font-size: 14px;
  626. color: #48576a;
  627. line-height: 1;
  628. width: 70px;
  629. float: left;
  630. padding: 11px 12px 11px 0;
  631. }
  632. }
  633. .panel-tab {
  634. height: 50px;
  635. line-height: 50px;
  636. background: rgba(230, 237, 255, 1);
  637. .tab {
  638. float: left;
  639. width: 50%;
  640. line-height: 45px;
  641. text-align: center;
  642. cursor: pointer;
  643. .selected-tab {
  644. width: 70%;
  645. margin: 0 auto;
  646. height: 45px;
  647. line-height: 45px;
  648. background: transparent;
  649. border-radius: 8px 8px 0px 0px;
  650. margin-top: 5px;
  651. &.active {
  652. background: rgba(255, 255, 255, 1);
  653. }
  654. .tab-text {
  655. font-size: 14px;
  656. font-family: PingFangSC-Medium;
  657. font-weight: 500;
  658. color: rgba(51, 51, 51, 1);
  659. line-height: 20px;
  660. }
  661. }
  662. }
  663. }
  664. </style>
  665. <script>
  666. import * as http from '../util/http'
  667. var positionFlag = false
  668. export default {
  669. props: {
  670. element: {
  671. type: Object
  672. },
  673. panelState: {
  674. type: Number
  675. },
  676. showSelectedPicOrUnSelectedPic: {
  677. type: Function
  678. }
  679. },
  680. data() {
  681. return {
  682. panelTabState: 0,
  683. animateList: [
  684. { id: 'fadeIn', name: '淡入', type: 0 },
  685. { id: 'zoomIn', name: '放大', type: 0 },
  686. { id: 'bounceInDown', name: '向下飞入', type: 0 },
  687. { id: 'bounceInLeft', name: '向右飞入', type: 0 },
  688. { id: 'bounceInRight', name: '向左飞入', type: 0 },
  689. { id: 'bounceInUp', name: '向上飞入', type: 0 },
  690. { id: 'bounce', name: '弹跳', type: 0 },
  691. { id: 'flash', name: '一闪而过', type: 0 },
  692. { id: 'pulse', name: '脉动', type: 0 },
  693. { id: 'rubberBand', name: '橡皮筋弹跳', type: 0 },
  694. { id: 'shake', name: '发抖', type: 0 },
  695. { id: 'swing', name: '摇摆', type: 0 },
  696. { id: 'tada', name: '颤抖', type: 0 },
  697. { id: 'wobble', name: '摇摆不定', type: 0 },
  698. { id: 'jello', name: '果冻', type: 0 },
  699. { id: 'bounceIn', name: '上下晃动', type: 0 },
  700. { id: 'bounceOut', name: '弹性放大', type: 0 },
  701. // {id: 'bounceOutDown', name: '向下弹跳', type:0},
  702. // {id: 'bounceOutLeft', name: '向左弹跳', type:0},
  703. // {id: 'bounceOutRight', name: '向右弹跳', type:0},
  704. // {id: 'bounceOutUp', name: '向上弹跳', type:0},
  705. { id: 'fadeInDown', name: '向下淡入', type: 0 },
  706. { id: 'fadeInDownBig', name: '向下渐变淡入', type: 0 },
  707. { id: 'fadeInLeft', name: '向左淡入', type: 0 },
  708. { id: 'fadeInLeftBig', name: '向左渐变淡入', type: 0 },
  709. { id: 'fadeInRight', name: '向右淡入', type: 0 },
  710. { id: 'fadeInRightBig', name: '向右渐变淡入', type: 0 },
  711. { id: 'fadeInUp', name: '向上淡入', type: 0 },
  712. { id: 'fadeInUpBig', name: '向上渐变淡入', type: 0 },
  713. // {id: 'fadeOut', name: '淡出', type:0},
  714. // {id: 'fadeOutDown', name: '向下淡出', type:0},
  715. // {id: 'fadeOutDownBig', name: '向下渐变淡出', type:0},
  716. // {id: 'fadeOutLeft', name: '向左淡出', type:0},
  717. // {id: 'fadeOutLeftBig', name: '向左渐变淡出', type:0},
  718. // {id: 'fadeOutRight', name: '向右淡出', type:0},
  719. // {id: 'fadeOutRightBig', name: '向右渐变淡出', type:0},
  720. // {id: 'fadeOutUp', name: '向上淡出', type:0},
  721. // {id: 'fadeOutUpBig', name: '向上渐变淡出', type:0},
  722. { id: 'flip', name: '快速翻动', type: 0 },
  723. { id: 'flipInX', name: '上下翻滚', type: 0 },
  724. { id: 'flipInY', name: '左右翻滚', type: 0 },
  725. // {id: 'flipOutX', name: 'X轴翻出', type:0},
  726. // {id: 'flipOutY', name: 'Y轴翻出', type:0},
  727. { id: 'lightSpeedIn', name: '飘入', type: 0 },
  728. // {id: 'lightSpeedOut', name: '飘出', type:0},
  729. { id: 'rotateIn', name: '翻转进入', type: 0 },
  730. { id: 'rotateInDownLeft', name: '左下翻转进入', type: 0 },
  731. { id: 'rotateInDownRight', name: '右下翻转进入', type: 0 },
  732. { id: 'rotateInUpLeft', name: '左上下翻转进入', type: 0 },
  733. { id: 'rotateInUpRight', name: '右上翻转进入', type: 0 },
  734. // {id: 'rotateOut', name: '翻转退出', type:0},
  735. // {id: 'rotateOutDownLeft', name: '左下翻转退出', type:0},
  736. // {id: 'rotateOutDownRight', name: '右下翻转退出', type:0},
  737. // {id: 'rotateOutUpLeft', name: '左上下翻转退出', type:0},
  738. // {id: 'rotateOutUpRight', name: '右上翻转退出', type:0},
  739. // {id: 'slideInUp', name: '向上滑入', type:0},
  740. // {id: 'slideInDown', name: '向下滑入', type:0},
  741. // {id: 'slideInLeft', name: '向左滑入', type:0},
  742. // {id: 'slideInRight', name: '向右滑入', type:0},
  743. // {id: 'slideOutUp', name: '向上滑出', type:0},
  744. // {id: 'slideOutDown', name: '向下滑出', type:0},
  745. // {id: 'slideOutLeft', name: '向左滑出', type:0},
  746. // {id: 'slideOutRight', name: '向右滑出', type:0},
  747. // {id: 'zoomInDown', name: '向下渐大进入', type:0},
  748. // {id: 'zoomInLeft', name: '向左渐大进入', type:0},
  749. // {id: 'zoomInRight', name: '向右渐大进入', type:0},
  750. { id: 'zoomInUp', name: '向上渐大进入', type: 0 },
  751. // {id: 'zoomOut', name: '渐小淡出', type:0},
  752. // {id: 'zoomOutDown', name: '向下渐小淡出', type:0},
  753. // {id: 'zoomOutLeft', name: '向左渐小淡出', type:0},
  754. // {id: 'zoomOutRight', name: '向右渐小淡出', type:0},
  755. // {id: 'zoomOutUp', name: '向上渐小淡出', type:0},
  756. // {id: 'hinge', name: '随风飘摇', type:0},
  757. { id: 'rollIn', name: '滚入', type: 0 },
  758. // {id: 'rollOut', name: '滚出', type:0}
  759. // {id: 'particleScroll', name: '粒子滚动', type:1},
  760. // {id: 'shakesScroll', name: '抖动', type:2},
  761. ],
  762. fontFamily: ['默认字体', '思源黑体细', '思源黑体常规', '思源黑体中', '思源黑体粗', '思源宋体细', '思源宋体常规', '思源宋体中', '思源宋体粗', '思源宋体极粗',
  763. '手写体', '站酷高端黑', '站酷酷黑', '站酷文艺体', '酷站小黑LOGO体', 'ZCOOL_Italic', '旁门正道标题体', '杨任东竹石体细', '杨任东竹石体常规',
  764. '杨任东竹石体粗'],
  765. carouselTypes: [
  766. {
  767. value: 'mtswiper',
  768. label: '默认'
  769. }, {
  770. value: 'FourBoxesSlideshow',
  771. label: 'four boxes slide show'
  772. }, {
  773. value: 'transition-opacity',
  774. label: 'opacity fade'
  775. }, {
  776. value: 'transition-left',
  777. label: 'left slide'
  778. }, {
  779. value: 'transition-top',
  780. label: 'top slide'
  781. }, {
  782. value: 'transition-dezoom',
  783. label: 'de-zoom'
  784. }, {
  785. value: 'fragment',
  786. label: '碎片'
  787. }
  788. ],
  789. picTypes: [
  790. {
  791. value: '',
  792. label: "请选择"
  793. },
  794. {
  795. value: 'WaterRipple',
  796. label: "水波"
  797. },
  798. // {
  799. // value:'GlassBeads',
  800. // label:"水珠"
  801. // }
  802. ],
  803. animateFontList: [
  804. // {id: 'highLightDelimit', name: '高光', type:0},
  805. // {id: 'wordByWord', name: '摇摆', type:1},
  806. // {id: 'reverse', name: '反向', type:2},
  807. // {id: 'wordByWord1', name: '逐字', type:3},
  808. // {id: 'wordByWord2', name: '逐字', type:4},
  809. // {id: 'wordByWord3', name: '逐字', type:5},
  810. { id: "flyInto", name: '逐字飞入' },
  811. { id: "bounce", name: '文字飘落' },
  812. { id: "bounceInUp", name: '向上弹入' },
  813. { id: "bounceInDown", name: '向下弹入' },
  814. { id: "cross", name: '交叉弹入' },
  815. { id: "flipInY", name: '转入' },
  816. { id: "hinge1", name: '摇摆' },
  817. { id: "colors", name: '彩色文字' },
  818. { id: "marquee", name: '跑马灯' },
  819. { id: "typer", name: '打字机' },
  820. { id: "random", name: '随机' },
  821. ],
  822. otime: null,
  823. loopNum: -300,
  824. textValue: ''
  825. }
  826. },
  827. methods: {
  828. copyElement() {
  829. if (this.element.type == 'audio') {
  830. return false;
  831. }
  832. var ele = {};
  833. for (var i in this.element) {
  834. if (i == 'children') {//如果有子元素需要深拷贝
  835. var children = [];
  836. this.element[i].forEach(function (child, index) {
  837. var obj = {}
  838. for (var k in child) {
  839. obj[k] = child[k]
  840. }
  841. children.push(obj)
  842. })
  843. } else {
  844. ele[i] = this.element[i];
  845. }
  846. }
  847. ele.children = children || [];
  848. ele.nodeId = 'Id' + Math.random();
  849. if (this.element.children) {
  850. ele.children.forEach(function (child) {
  851. child.nodeId = 'Id' + Math.random();
  852. })
  853. }
  854. ele.top = ele.top + 20
  855. ele.left = ele.left + 20
  856. this.$store.dispatch('addElement', ele)
  857. },
  858. checkAnimation(item) {
  859. this.element.animatedFont = '';
  860. if (this.element.animatedName == item.id) {
  861. this.element.animatedName = '';
  862. this.element.animatedType = '';
  863. } else {
  864. this.element.animatedName = item.id;
  865. this.element.animatedType = item.type;
  866. }
  867. },
  868. isEnabled(flag) {
  869. this.element.animatedEnabled = flag;
  870. if (!this.element.animatedEnabled) {
  871. this.element.animatedName = '';
  872. }
  873. flag = flag == true ? false : true;
  874. },
  875. verticalRow() {
  876. var topCenterDown = document.getElementById('topCenterDown')
  877. if (this.element.verticalFont != '') {
  878. topCenterDown.style.display = 'none'
  879. this.element.verticalAlign = ''
  880. this.element.display = ''
  881. } else {
  882. this.element.verticalAlign = ''
  883. topCenterDown.style.display = 'block'
  884. this.element.display = ''
  885. }
  886. },
  887. checkAnimationFont(item) {
  888. this.element.animatedName = '';
  889. this.element.animatedType = '';
  890. if (this.element.animatedFont != item.id) {
  891. this.element.animatedFont = item.id;
  892. // this.textValue = this.element.text
  893. // var that = this
  894. // var obj = $("[highlightdelimitid='"+that.element.nodeId+"']")
  895. // if (item.type == 1) {
  896. // obj.animatext({
  897. // speed: 1500,
  898. // mode: "words",
  899. // effect: 'swing',
  900. // infinite: true,
  901. // timeToRelaunch:150,
  902. // onBegin:function() {
  903. // // obj.html(that.textValue)
  904. // },
  905. // });
  906. // } else if (item.type == 2) {
  907. // obj.animatext({
  908. // speed: 1500,
  909. // effect: 'bounceIn',
  910. // reverse: true,
  911. // infinite: false,
  912. // onBegin:function() {
  913. // obj.html(that.textValue)
  914. // },
  915. // onSuccess:function() {
  916. // obj.html(that.textValue)
  917. // }
  918. // });
  919. // }
  920. } else {
  921. this.element.animatedFont = "";
  922. // this.textValue = ""
  923. }
  924. },
  925. setGroup(element) {
  926. var that = this;
  927. let messageTag = 0;
  928. var p_ele = null
  929. if (element.type == 'frame' && element.children.length > 0) {
  930. element.children.forEach(function (item) {
  931. item.left = item.left + element.left;
  932. item.top = item.top + element.top;
  933. that.$store.dispatch('addElement', item)
  934. })
  935. element.children.splice(0, element.children.length);
  936. messageTag = 1//解组成功
  937. } else if (element.type == 'frame') {
  938. let item_ = element;
  939. for (var k = 0; k < that.elements.length; k++) {
  940. var item = that.elements[k], index = k;
  941. let left = item.left;
  942. let top = item.top;
  943. let width = item.width;
  944. let height = item.type == 'text' ? window.getComputedStyle(document.getElementById(item.nodeId)).height.replace("px", '') / 1 : item.height;
  945. let zindex = item.zindex;
  946. if ((left + width) > item_.left && left < (item_.left + item_.width) && (top + height - 2) > item_.top && top < (item_.top + item_.height - 2) && item.type != 'frame' && item.type != 'audio') {
  947. // if (zindex >= item_.zindex && (left + width) > item_.left && left < (item_.left + item_.width) && (top + height) > item_.top && top < (item_.top + item_.height) && item.type != 'frame') {
  948. that.elements.splice(index, 1)
  949. k--
  950. item.left = item.left - item_.left;
  951. item.top = item.top - item_.top;
  952. item_.children.push(item)
  953. p_ele = item_
  954. messageTag = 2//组合成功
  955. }
  956. }
  957. } else {
  958. let left = element.left;
  959. let top = element.top;
  960. let width = element.width;
  961. let height = element.type == 'text' ? window.getComputedStyle(document.getElementById(element.nodeId)).height.replace("px", '') / 1 : element.height;
  962. let zindex = element.zindex;
  963. that.elements.forEach((item) => {
  964. // if(item.type=='frame'&&item.zindex<zindex){
  965. if (item.type == 'frame') {
  966. let groupL = item.left + item.width;
  967. let groupT = item.top + item.height;
  968. let item_ = item;
  969. // if(left>item.left&&left<groupL&&top>item.top&&top<groupT){
  970. if ((left + width) > item.left && left < (item.left + item.width) && (top + height - 2) > item.top && top < (item.top + item.height + 2)) {
  971. for (var i = 0; i < that.elements.length; i++) {
  972. var item = that.elements[i];
  973. var index = i;
  974. let left = item.left;
  975. let top = item.top;
  976. let width = item.width;
  977. let height = item.type == 'text' ? window.getComputedStyle(document.getElementById(item.nodeId)).height.replace("px", '') / 1 : item.height;
  978. let zindex = item.zindex;
  979. if ((left + width) > item_.left && left < (item_.left + item_.width) && (top + height - 2) > item_.top && top < (item_.top + item_.height - 2) && item.type != 'frame' && item.type != 'audio') {
  980. // if(zindex>=item_.zindex&&(left+width)>item_.left&&left<(item_.left+item_.width)&&(top+height)>item_.top&&top<(item_.top+item_.height)&&item.type!='frame'){
  981. that.elements.splice(index, 1)
  982. i--
  983. item.left = item.left - item_.left;
  984. item.top = item.top - item_.top;
  985. item_.children.push(item)
  986. p_ele = item_
  987. messageTag = 2//组合成功
  988. }
  989. }
  990. }
  991. }
  992. })
  993. }
  994. if (messageTag == 1) {
  995. that.$message.success("解组成功!")
  996. } else if (messageTag == 2) {
  997. that.$message.success("组合成功!")
  998. this.$store.dispatch('setEditorElement', p_ele)
  999. } else {
  1000. that.$message.error("组合失败!")
  1001. }
  1002. },
  1003. fileChange(event) {
  1004. console.log("当前元素", this.element);
  1005. this.upload(event)
  1006. },
  1007. async upload(event) {
  1008. var that = this;
  1009. let files = event.target.files
  1010. if (!files.length) {
  1011. return false
  1012. }
  1013. const loading = this.$loading({
  1014. lock: true,
  1015. text: 'Loading',
  1016. spinner: 'el-icon-loading',
  1017. background: 'rgba(0, 0, 0, 0.7)'
  1018. });
  1019. for (var i = 0; i < files.length; i++) {
  1020. var file = files[i]
  1021. if (file) {
  1022. http.uploadMaterielFile(file, function (res) {
  1023. loading.close();
  1024. let img = document.createElement('img')
  1025. img.onload = () => {
  1026. that.$emit('uploaded', {
  1027. 'filePath': res,
  1028. 'width': img.width,
  1029. 'height': img.height,
  1030. 'isButton': that.isButton,
  1031. });
  1032. that.element.imgSrc = res;
  1033. that.element.width = img.width;
  1034. that.element.height = img.height;
  1035. }
  1036. img.src = res;
  1037. }, function (res) {
  1038. if (res.total.percent == 100 && (files.length == i + 1)) {
  1039. loading.close();
  1040. }
  1041. })
  1042. }
  1043. }
  1044. },
  1045. },
  1046. computed: {
  1047. elements() {
  1048. return this.$store.state.editor.editorPage.elements
  1049. },
  1050. },
  1051. filters: {
  1052. currentImageName(imageName) {
  1053. console.log(imageName);
  1054. return imageName.split("-").pop()
  1055. }
  1056. }
  1057. }
  1058. </script>
  1059. <style>
  1060. .fontSelect:nth-child(1) span {
  1061. color: #000;
  1062. }
  1063. .fontSelect:nth-child(1) {
  1064. text-align: center;
  1065. }
  1066. .fontSelect span {
  1067. color: transparent;
  1068. }
  1069. .fontSelect:nth-child(2) {
  1070. background: url("../../static/font/noto_light.png") no-repeat center center/50% 50%;
  1071. -moz-background-origin: content-box;
  1072. }
  1073. .fontSelect:nth-child(3) {
  1074. background: url("../../static/font/noto_regular.png") no-repeat center center/50% 50%;
  1075. -moz-background-origin: content-box;
  1076. }
  1077. .fontSelect:nth-child(4) {
  1078. background: url("../../static/font/noto_medium.png") no-repeat center center/50% 50%;
  1079. -moz-background-origin: content-box;
  1080. }
  1081. .fontSelect:nth-child(5) {
  1082. background: url("../../static/font/noto_bold.png") no-repeat center center/50% 50%;
  1083. -moz-background-origin: content-box;
  1084. }
  1085. .fontSelect:nth-child(6) {
  1086. background: url("../../static/font/source_light.png") no-repeat center center/50% 50%;
  1087. -moz-background-origin: content-box;
  1088. }
  1089. .fontSelect:nth-child(7) {
  1090. background: url("../../static/font/source_regular.png") no-repeat center center/50% 50%;
  1091. -moz-background-origin: content-box;
  1092. }
  1093. .fontSelect:nth-child(8) {
  1094. background: url("../../static/font/source_medium.png") no-repeat center center/50% 50%;
  1095. -moz-background-origin: content-box;
  1096. }
  1097. .fontSelect:nth-child(9) {
  1098. background: url("../../static/font/source_bold.png") no-repeat center center/50% 50%;
  1099. -moz-background-origin: content-box;
  1100. }
  1101. .fontSelect:nth-child(10) {
  1102. background: url("../../static/font/source_heavy.png") no-repeat center center/50% 50%;
  1103. -moz-background-origin: content-box;
  1104. }
  1105. .fontSelect:nth-child(11) {
  1106. background: url("../../static/font/shouxieti.png") no-repeat center center/50% 50%;
  1107. -moz-background-origin: content-box;
  1108. }
  1109. .fontSelect:nth-child(12) {
  1110. background: url("../../static/font/zkgdh.png") no-repeat center center/50% 50%;
  1111. -moz-background-origin: content-box;
  1112. }
  1113. .fontSelect:nth-child(13) {
  1114. background: url("../../static/font/zkkh.png") no-repeat center center/50% 50%;
  1115. -moz-background-origin: content-box;
  1116. }
  1117. .fontSelect:nth-child(14) {
  1118. background: url("../../static/font/wenyi.png") no-repeat center center/50% 50%;
  1119. -moz-background-origin: content-box;
  1120. }
  1121. .fontSelect:nth-child(15) {
  1122. background: url("../../static/font/logoti.png") no-repeat center center/50% 50%;
  1123. -moz-background-origin: content-box;
  1124. }
  1125. .fontSelect:nth-child(16) {
  1126. background: url("../../static/font/ZCOOL_Italic.png") no-repeat center center/50% 50%;
  1127. -moz-background-origin: content-box;
  1128. }
  1129. .fontSelect:nth-child(17) {
  1130. background: url("../../static/font/pmzd.png") no-repeat center center/50% 50%;
  1131. -moz-background-origin: content-box;
  1132. }
  1133. .fontSelect:nth-child(18) {
  1134. background: url("../../static/font/yzd_light.png") no-repeat center center/50% 50%;
  1135. -moz-background-origin: content-box;
  1136. }
  1137. .fontSelect:nth-child(19) {
  1138. background: url("../../static/font/yzd_regular.png") no-repeat center center/50% 50%;
  1139. -moz-background-origin: content-box;
  1140. }
  1141. .fontSelect:nth-child(20) {
  1142. background: url("../../static/font/yzd_heavy.png") no-repeat center center/50% 50%;
  1143. -moz-background-origin: content-box;
  1144. }
  1145. </style>