EditPanel.vue 49 KB

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