EditPanel.vue 50 KB

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