EditPanel.vue 53 KB

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