EditPanel.vue 52 KB

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