EditPanel.vue 53 KB

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