index.vue 59 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515
  1. <template>
  2. <div class="editor">
  3. <!-- 头部 -->
  4. <HeaderMain></HeaderMain>
  5. <HeaderEdit :title="title" :shareModel="shareModel" :goback="dialogSave" :save="save"
  6. @saveThemeSuccess="showPreView=true"/>
  7. <!-- 内容区域 -->
  8. <section class="section">
  9. <!-- 左侧图层 -->
  10. <Overview ref='overview' class="overview" :testcaseId="testcaseId" :resultCount="resultPageCount"
  11. :questions="questions"/>
  12. <!-- 编辑区域 -->
  13. <div class="container" id="h5editor">
  14. <elab-canvas v-show="animatedNameGlobal!=''" :width="750" :height="1334"
  15. :cstyle="`height:1334px;width:750px;position: absolute;z-index:99999; pointer-events:none`"
  16. :background="'transparent'" :type="animatedNameGlobal"></elab-canvas>
  17. <elab-background-canvas v-if="animatedNameBackgroundGlobal!=''" :width="canvasWidth" :height="(canvasHeight)"
  18. :cstyle="`position: absolute;z-index:1; pointer-events:none`"
  19. :background="'transparent'"
  20. :type="animatedNameBackgroundGlobal"></elab-background-canvas>
  21. <Page :isOverView="false" ref="page" id="canvasPage" :hideFoot="hideFoot" class="canvas"
  22. :elements="editorPage.elements" :editorElement="element" :animatedNameGlobal="animatedNameGlobal"
  23. :selectedElement="selectedElement"
  24. :style="{ width: 750 + 'px', height: 1334 + 'px',backgroundColor: bodyBackgroundColor }"/>
  25. <div v-if="this.gridTempField" :style="{'background-image':'linear-gradient(90deg,rgba(204,204,204,0.3) 10%,transparent 0), linear-gradient(rgba(204,204,204,0.3) 10%,transparent 0)',
  26. 'background-size':'15px 15px', 'z-index':100000,width: '750px', height: '1334px'}"
  27. style="position: absolute;left: 0;top: 0;z-index: 9999;pointer-events: none"></div>
  28. </div>
  29. <!-- 属性设置 -->
  30. <div class="control-panel">
  31. <div class="funcs">
  32. <div class="tagPage">
  33. <div style="width:44px;height: 44px; margin-top: 20px;display: flex;justify-content: center"
  34. @click="togglePanel(1)" :class="{ active: panelState === 1 }">
  35. <div class="page-create-txt" :class="{ active: panelState === 1 }"></div>
  36. </div>
  37. <div class="page-tag-btn-tip">创建文本</div>
  38. </div>
  39. <div class="tagPage">
  40. <div style="width:44px;height: 44px;display: flex;justify-content: center" @click="togglePanel(2)"
  41. :class="{ active: panelState === 2 }">
  42. <div class="page-create-btn" :class="{ active: panelState === 2 }"></div>
  43. </div>
  44. <div class="page-tag-btn-tip">装饰元素</div>
  45. </div>
  46. <div class="tagPage">
  47. <div style="width:44px;height: 44px;display: flex;justify-content: center" @click="togglePanel(3)"
  48. :class="{ active: panelState === 3 }">
  49. <div class="page-create-lunbo" :class="{ active: panelState === 3 }"></div>
  50. </div>
  51. <div class="page-tag-btn-tip">新建轮播</div>
  52. </div>
  53. <div class="tagPage">
  54. <div style="width:44px;height: 44px;display: flex;justify-content: center" @click="togglePanel(4)"
  55. :class="{ active: panelState === 4 }">
  56. <div class="page-create-jiaohuanniu" :class="{ active: panelState === 4 }"></div>
  57. </div>
  58. <div class="page-tag-btn-tip">交互按钮</div>
  59. </div>
  60. <el-tooltip v-show="false" effect="dark" content="保存" placement="left">
  61. <div style="width:44px;height: 44px;display: flex;justify-content: center" @click="save">
  62. <img style="width:34px;height: 34px;" src="http://yun-image.elab-plus.com/images/dyb/new-jiaohuanniu.png"
  63. alt="">
  64. </div>
  65. </el-tooltip>
  66. </div>
  67. <div class="wrapper custom-scrollbar">
  68. <!-- 设置背景 0 -->
  69. <div class="panel panel-bg">
  70. <div class="clearfix" v-if="panelTabState !== 1 && panelTabState !== 3">
  71. <div
  72. style="display: flex;flex-direction: row;justify-content: space-between; padding:23px;border-bottom: #E2E4EE solid 1px;">
  73. <div style="width:45%;
  74. height:28px;
  75. text-align: center;
  76. background:rgba(78,93,255,1);
  77. border-radius:14px;font-size:14px;
  78. font-family:MicrosoftYaHei;
  79. color:rgba(255,255,255,1);
  80. line-height:28px;" @click="cleanBG">移除背景
  81. </div>
  82. <div style="width:45%;height:28px;text-align: center;background:rgba(78,93,255,1);border-radius:14px;font-size:14px;
  83. font-family:MicrosoftYaHei;color:rgba(255,255,255,1);line-height:28px;"
  84. @click="panelTabState = 1">
  85. 更换背景
  86. </div>
  87. </div>
  88. <div
  89. style="display: flex;flex-direction: row;align-items: center;padding-left: 23px;border-bottom: #E2E4EE solid 1px;padding-top: 11px;padding-bottom: 11px;">
  90. <label style="font-size:12px;
  91. font-family:MicrosoftYaHei;
  92. color:rgba(51,51,51,1);
  93. margin-right: 10px;
  94. ">画布背景色</label>
  95. <el-color-picker v-model="bodyBackgroundColor" @change="bodyBackgroundColorChange" size="mini">
  96. </el-color-picker>
  97. </div>
  98. <div
  99. style="display: flex;flex-direction: row ;padding-left: 23px;padding-top: 12px;padding-bottom: 12px;border-bottom: #E2E4EE solid 1px;">
  100. <div style="display: flex;flex-direction: column;">
  101. <label style="font-size:12px;
  102. font-family:MicrosoftYaHei;
  103. color:rgba(51,51,51,1); margin-bottom: 6px;">画布宽度</label>
  104. <el-input-number v-model="canvasWidth" :disabled="true" size="small" style="width:110px;">
  105. </el-input-number>
  106. </div>
  107. <div style="display: flex;flex-direction: column; margin-left:45px">
  108. <label style="font-size:12px;
  109. font-family:MicrosoftYaHei;
  110. color:rgba(51,51,51,1); margin-bottom: 6px;">画布高度</label>
  111. <el-input-number v-model="canvasHeight" size="small" style="width:110px;">
  112. </el-input-number>
  113. </div>
  114. </div>
  115. <div class="clearfix" v-if="panelTabState !== 1 && panelTabState !== 3" style="border-bottom: #E2E4EE solid 1px; padding-top:010px;padding-bottom:2px;
  116. padding-left:23px;
  117. ">
  118. <label style="font-size:12px;
  119. font-family:MicrosoftYaHei; display:block;
  120. color:rgba(51,51,51,1);margin-bottom:10px;">屏飘动效</label>
  121. <div class="content" :xxx="`animatedNameGlobal`">
  122. <div
  123. style="display: inline-flex;overflow: hidden;text-align: center; cursor: pointer; margin-right:12px;"
  124. v-for="(item,index) in animateGlobalList">
  125. <div v-model="animatedNameGlobal" @click="checkGlobalAnimation(item)" :title="item.name" :style="{'background':'rgba(238,242,250,1)',
  126. 'border-radius':'12px', 'margin-bottom':'10px',
  127. 'border':'1px solid rgba(205,209,221,1)','font-size': '12px',
  128. color: animatedNameGlobal==item.id? 'white':'#999999','letter-spacing': 0,
  129. 'word-break':'keep-all',padding: '4px 13px','background': animatedNameGlobal===item.id? '#4E5DFF':'rgba(238,242,250,1)',
  130. 'border': animatedNameGlobal===item.id? '1px solid #4E5DFF':'1px solid rgba(205,209,221,1)',
  131. }">{{item.name}}
  132. </div>
  133. </div>
  134. </div>
  135. </div>
  136. <div class="clearfix" v-if="panelTabState !== 1 && panelTabState !== 3" style="border-bottom: #E2E4EE solid 1px; padding-top:010px;padding-bottom:2px;
  137. padding-left:23px;">
  138. <label style="font-size:12px;
  139. font-family:MicrosoftYaHei; display:block;
  140. color:rgba(51,51,51,1);margin-bottom:10px;">背景动效</label>
  141. <div class="content" :xxx="`animatedNameBackgroundGlobal`">
  142. <div style="display: inline-flex;overflow: hidden;text-align: center; cursor: pointer"
  143. v-for="(item,index) in animateBackgroundGlobalList">
  144. <div v-model="animatedNameBackgroundGlobal" @click="checkBackgroundGlobalAnimation(item)"
  145. :title="item.name"
  146. :style="{'background':'rgba(238,242,250,1)', 'margin-right':'12px',
  147. 'border-radius':'12px', 'margin-bottom':'10px',
  148. 'border':'1px solid rgba(205,209,221,1)','font-size': '12px',
  149. color: animatedNameBackgroundGlobal==item.id? 'white':'#999999','letter-spacing': 0,
  150. 'word-break':'keep-all',padding: '4px 13px','background': animatedNameBackgroundGlobal===item.id? '#4E5DFF':'rgba(238,242,250,1)',
  151. 'border': animatedNameBackgroundGlobal===item.id? '1px solid #4E5DFF':'1px solid rgba(205,209,221,1)'}">
  152. {{item.name}}
  153. </div>
  154. </div>
  155. </div>
  156. </div>
  157. <div class="item" style="padding:10px 23px;">
  158. <label style="font-size:12px;
  159. font-family:MicrosoftYaHei;
  160. color:rgba(51,51,51,1);">背景音乐</label>
  161. <div class="content">
  162. <AudioPanel class="ele"></AudioPanel>
  163. </div>
  164. </div>
  165. </div>
  166. <!--<div class="clearfix">
  167. <label>设置作品信息</label>
  168. <div class="content">
  169. <el-input
  170. placeholder="请输入标题"
  171. v-model="title"
  172. clearable>
  173. </el-input>
  174. </div>
  175. <div class="content">
  176. <el-input
  177. placeholder="请输入描述"
  178. v-model="description"
  179. clearable>
  180. </el-input>
  181. </div>
  182. </div>-->
  183. <div class="clearfix" v-if="panelTabState === 1">
  184. <ImgPanel :selectedImg="addBG"/>
  185. </div>
  186. <div class="clearfix" v-if="panelTabState === 3">
  187. <div style="margin-top: 5px; height:100%;vertical-align: middle;padding-right:10px">
  188. <div style="display: inline-flex; overflow: hidden;">
  189. <div style="font-size: 14px;color: #999999;letter-spacing: 0; word-break:keep-all;width:100%">
  190. 组合对齐布局
  191. </div>
  192. </div>
  193. <div style="margin-top: 10px">
  194. <div style="display: inline-flex; overflow: hidden;width: 14%; cursor: pointer; text-align: center">
  195. <div @click="toLeft" title="左对齐"
  196. :style="{'font-size': '12px','letter-spacing': 0, 'word-break':'keep-all','text-align':'center','width':'100%'}">
  197. <img src="http://yun-image.elab-plus.com/images/tfb/icon_left2.png" width="20" height="20"/>
  198. </div>
  199. </div>
  200. <div title="水平居中对齐"
  201. style="display: inline-flex; overflow: hidden;width: 14%; cursor: pointer;text-align: center"
  202. @click="toCenter">
  203. <div
  204. :style="{'font-size': '12px','letter-spacing': 0, 'word-break':'keep-all','text-align':'center','width':'100%'}">
  205. <img src="http://yun-image.elab-plus.com/images/tfb/horizontal_center.png" width="20"
  206. height="20"/>
  207. </div>
  208. </div>
  209. <div title="右对齐" style="display: inline-flex;cursor: pointer;width: 14%; text-align: center"
  210. @click="toRight">
  211. <div
  212. :style="{'font-size': '12px','letter-spacing': 0, 'word-break':'keep-all','text-align':'center','width':'100%'}">
  213. <img src="http://yun-image.elab-plus.com/images/tfb/icon_right2.png" width="20" height="20"/>
  214. </div>
  215. </div>
  216. <div style="display: inline-flex; overflow: hidden;width: 14%; cursor: pointer; text-align: center">
  217. <div @click="toTop" title="上对齐"
  218. :style="{'font-size': '12px','letter-spacing': 0, 'word-break':'keep-all','text-align':'center','width':'100%'}">
  219. <img src="http://yun-image.elab-plus.com/images/tfb/icon_top.png" width="20" height="20"/>
  220. </div>
  221. </div>
  222. <div title="垂直居中对齐"
  223. style="display: inline-flex; overflow: hidden;width: 14%; cursor: pointer;text-align: center"
  224. @click="toVertialCenter">
  225. <div
  226. :style="{'font-size': '12px','letter-spacing': 0, 'word-break':'keep-all','text-align':'center','width':'100%'}">
  227. <img src="http://yun-image.elab-plus.com/images/tfb/vertical_center.png" width="20" height="20"/>
  228. </div>
  229. </div>
  230. <div title="下对齐" style="display: inline-flex;cursor: pointer;width: 14%; text-align: center"
  231. @click="toBottom">
  232. <div
  233. :style="{'font-size': '12px','letter-spacing': 0, 'word-break':'keep-all','text-align':'center','width':'100%'}">
  234. <img src="http://yun-image.elab-plus.com/images/tfb/icon_down.png" width="20" height="20"/>
  235. </div>
  236. </div>
  237. </div>
  238. </div>
  239. </div>
  240. </div>
  241. <!-- 添加文字 1 -->
  242. <div class="panel panel-text" v-show="panelState === 1">
  243. <div class="btn" @click="addTextElement('title')" style="font-size: 32px; font-weight: bold;">插入标题</div>
  244. <div class="btn" @click="addTextElement('plain')">插入文本</div>
  245. <div class="btn" @click="addTextElement('frame')">插入方框</div>
  246. </div>
  247. <!-- 添加元素 2 -->
  248. <div class="panel panel-element clearfix" v-show="panelState === 2">
  249. <ImgPanel :selectedImg="addPicElement" :themeId="itemId" :isButton="false"/>
  250. </div>
  251. <!-- 添加多图上元素 3 -->
  252. <div class="panel panel-element clearfix" v-if="panelState === 3">
  253. <ImgPanel :selectedImg="addMorePicElement" :ismultiple="true"/>
  254. </div>
  255. <!-- 添加按钮 4 -->
  256. <div class="panel panel-element clearfix" v-if="panelState === 4">
  257. <ImgPanel :selectedImg="addButtonElement" :themeId="itemId" :isButton="true"
  258. :showSelectedPicOrUnSelectedPic="uploadSelectedPicOrUnSelectedPic"/>
  259. </div>
  260. <!-- 图层编辑面板 -->
  261. <EditPanel :element="element" :panelState="panelState" v-if="panelState > 10"
  262. :showSelectedPicOrUnSelectedPic="changeSelectedPicOrUnSelectedPic"/>
  263. </div>
  264. </div>
  265. </section>
  266. <PreView :itemId="itemId" @hideView="showPreView=false" v-if="showPreView"/>
  267. <div v-show="dialogVisible" class="dialog">
  268. <div style="width:560px;height: 353px;background:rgba(255,255,255,1);
  269. box-shadow:0px 5px 11px 0px rgba(78,93,255,0.42); margin:0 auto; margin-top:10%;
  270. border-radius:6px;">
  271. <div style="width:560px;
  272. height:34px;
  273. display: flex;
  274. flex-direction: row;
  275. justify-content: space-between;
  276. align-items: center;
  277. background:rgba(78,93,255,1);
  278. border-radius:6px 6px 0px 0px;">
  279. <span style="font-size:16px;
  280. font-family:PingFangSC;
  281. font-weight:400;
  282. color:rgba(255,255,255,1); margin-left:20px;
  283. line-height:34px;">上传按钮样式</span>
  284. <img src="../../assets/images/close-icon.png"
  285. style="width: 16px; height: 16px; margin-right: 10px; cursor: pointer;" @click="closeUploadButton"></img>
  286. </div>
  287. <div style="display: flex;flex-direction: row; justify-content: center;margin-top:42px;margin-bottom:40px;">
  288. <div style="width:130px; display: flex;
  289. flex-direction: column; align-items: center;
  290. ">
  291. <span style="font-size:14px;
  292. font-family:MicrosoftYaHei;display:block;
  293. color:rgba(51,51,51,1); margin-bottom:14px;
  294. line-height:19px;">默认状态</span>
  295. <div v-if="unSelectedButtom" :style="{ backgroundImage: 'url(' + buttonData.backgroundUnselectedImg + ')','width':'130px', 'height':'130px','background-repeat': 'no-repeat',
  296. 'background-position': 'center',
  297. 'background-size': 'contain'}" style="position: relative">
  298. <div style="font-size:12px;width: 100%; height: 20px;
  299. font-family:MicrosoftYaHei;
  300. color:rgba(255,255,255,1);
  301. background:rgba(0,0,0,0.8);
  302. display: flex; position: absolute;
  303. bottom: 0;
  304. justify-content: center;
  305. line-height:20px;">更换素材</div>
  306. <label class="lable">
  307. <input style="display: none;" type="file" @change="upload($event, false)">
  308. </label>
  309. </div>
  310. <label class="lable" v-else>
  311. <div style="width:100%;
  312. display: flex;
  313. flex-direction: column;
  314. justify-content: center;
  315. align-items: center;
  316. height:100%;
  317. border:1px dashed rgba(100,107,129,1);">
  318. <img style="width:16px;
  319. height:16px;" src="../../assets/images/add-ele.png"/>
  320. <span style="font-size:12px;
  321. font-family:PingFangSC-Regular;
  322. font-weight:400;
  323. margin-top: 6px;
  324. color:rgba(51,51,51,1);
  325. line-height:17px;">上传素材</span>
  326. </div>
  327. <input style="display: none;" type="file" @change="upload($event, false)">
  328. </label>
  329. </div>
  330. <div style="width:130px; display: flex;
  331. flex-direction: column; align-items: center;
  332. margin-left:70px;">
  333. <span style="font-size:14px;
  334. font-family:MicrosoftYaHei;display:block;
  335. color:rgba(51,51,51,1);margin-bottom:14px;
  336. line-height:19px;">选中状态</span>
  337. <div v-if="selectedButtom" :style="{ backgroundImage: 'url(' + buttonData.backgroundSelectedImg + ')','width':'130px', 'height':'130px','background-repeat': 'no-repeat',
  338. 'background-position': 'center',
  339. 'background-size': 'contain'}" style="position: relative">
  340. <div style="font-size:12px;width: 100%; height: 20px;
  341. font-family:MicrosoftYaHei;
  342. color:rgba(255,255,255,1);
  343. background:rgba(0,0,0,0.8);
  344. display: flex; position: absolute;
  345. bottom: 0;
  346. justify-content: center;
  347. line-height:20px;">更换素材</div>
  348. <label class="lable">
  349. <input style="display: none;" type="file" @change="upload($event, true)">
  350. </label>
  351. </div>
  352. <label class="lable" v-else>
  353. <div style="width:100%;
  354. display: flex;
  355. flex-direction: column;
  356. justify-content: center;
  357. align-items: center;
  358. height:100%;
  359. border:1px dashed rgba(100,107,129,1);">
  360. <img style="width:16px;
  361. height:16px;" src="../../assets/images/add-ele.png"/>
  362. <span style="font-size:12px;
  363. font-family:PingFangSC-Regular;
  364. font-weight:400;
  365. margin-top: 6px;
  366. color:rgba(51,51,51,1);
  367. line-height:17px;">上传素材</span>
  368. </div>
  369. <input style="display: none;" type="file" @change="upload($event, true)">
  370. </label>
  371. </div>
  372. </div>
  373. <div style="width:105px;
  374. height:34px;margin:0 auto;
  375. background:rgba(78,93,255,1);
  376. border-radius:19px;font-size:14px;
  377. font-family:PingFangSC;
  378. font-weight:500; text-align: center;
  379. color:rgba(255,255,255,1);
  380. line-height:34px;cursor: pointer;" @click="uploadButton">确定
  381. </div>
  382. <span v-if="canSave" style="font-size:12px;
  383. font-family:MicrosoftYaHei;display: inline-block;margin-top: 10px;
  384. color:rgba(255,0,0,1); width: 100%; text-align: center;
  385. line-height:16px;">*两种状态都上传素材后才能保存</span>
  386. </div>
  387. </div>
  388. </div>
  389. </template>
  390. <script>
  391. import tools from "../../util/tools";
  392. import Overview from "./overview";
  393. import Page from "../../components/Page";
  394. import PicPicker from "../../components/PicturePicker";
  395. import PreView from "../../components/PreView";
  396. import HeaderEdit from "../../components/HeaderEdit";
  397. import EditPanel from "../../components/EditPanel";
  398. import SvgPanel from "../../components/SvgPanel";
  399. import ImgPanel from "../../components/ImgPanel";
  400. import appConst from "../../util/appConst";
  401. import html2canvas from "html2canvas";
  402. import {uploadBase64} from "../../util/http";
  403. import elabCanvas from "../../util/canvas/elabCanvas.vue";
  404. import elabBackgroundCanvas from "../../util/canvas/elabBackgroundCanvas";
  405. import AudioPanel from "../../components/AudioPanel";
  406. import HeaderMain from "../../components/HeaderMain";
  407. import * as http from '../../util/http';
  408. const $ = require("jquery");
  409. export default {
  410. data() {
  411. return {
  412. itemId: null,
  413. testcaseId: null,
  414. questions: [],
  415. panelState: 0,
  416. canvasWidth: 750,
  417. canvasHeight: 504,
  418. bodyBackgroundColor: "rgba(255,255,255,0)",
  419. bgc: "#B1C096",
  420. btnColor: "#5f8a61",
  421. title: "标题",
  422. description: "描述",
  423. dialogSaveBeforeBack: false,
  424. picBase64: "",
  425. http: appConst.BACKEND_DOMAIN,
  426. releaseUrl: "",
  427. showPreView: false,
  428. isLoadingPreview: false,
  429. panelTabState: 0,
  430. animatedNameGlobal: "",
  431. shareModel: null,
  432. resultPageCount: 0,
  433. animateGlobalList: [
  434. {id: "Snow", name: "下雪", type: 0},
  435. {id: "Bubble", name: "冒泡", type: 0},
  436. {id: "Flower", name: "樱花", type: 0},
  437. {id: "Rain", name: "下雨", type: 0},
  438. {id: "Bubble2", name: "飞沙", type: 0},
  439. {id: "Particles", name: "粒子", type: "0"},
  440. {id: "Circle", name: "圆圈", type: "0"},
  441. {id: "FlowField", name: "流场", type: "0"},
  442. {id: "cloud", name: "云飘", type: "0"},
  443. {id: "nephelo", name: "雾霾", type: "0"}
  444. ],
  445. animateBackgroundGlobalList: [
  446. {id: "Smoke", name: "烟雾", type: 1},
  447. {id: "Wave", name: "波浪", type: 2},
  448. // {id: 'WaterRipple', name: '水波', type: 3},
  449. {id: "Bubble2", name: "飞沙", type: 0},
  450. {id: "Particles", name: "粒子", type: "0"},
  451. {id: "Circle", name: "圆圈", type: "0"},
  452. {id: "FlowField", name: "流场", type: "0"},
  453. {id: "ColorRandom", name: "渐变色", type: "0"}
  454. ],
  455. animatedNameBackgroundGlobal: "",
  456. animatedBackgroundCustom: false,
  457. globalAnimatedBackgroundTag: false,
  458. dialogVisible: false,
  459. buttonData: {},
  460. unSelectedButtom: false,
  461. selectedButtom: false,
  462. isChangeStatus: false,
  463. canSave:false,
  464. };
  465. },
  466. watch: {
  467. element() {
  468. let ele = this.$store.state.editor.editorElement;
  469. let type = ele ? ele.type : "null";
  470. this.panelTabState = 0;
  471. var length = this.$store.state.editor.complexEditorElement.length;
  472. if (length > 1) {
  473. type = "group";
  474. this.panelTabState = 3;
  475. }
  476. switch (type) {
  477. case "text":
  478. this.panelState = 11;
  479. break;
  480. case "icon":
  481. case "pic":
  482. this.panelState = 12;
  483. break;
  484. case "audio":
  485. this.panelState = 12;
  486. break;
  487. case "morePic":
  488. this.panelState = 13;
  489. break;
  490. case "frame":
  491. this.panelState = 14;
  492. break;
  493. case "button":
  494. this.panelState = 15;
  495. break;
  496. case "group":
  497. this.panelState = 0;
  498. default:
  499. this.panelState = 0;
  500. }
  501. },
  502. "$store.state.editor.complexEditorElement": function () {
  503. var complexEditorElement = this.$store.state.editor.complexEditorElement;
  504. if (complexEditorElement.length == 0 && this.panelTabState == 3) {
  505. this.panelTabState = 0;
  506. }
  507. },
  508. },
  509. computed: {
  510. themeId() {
  511. return this.$store.state.editor.editorTheme._id;
  512. },
  513. editorPage() {
  514. this.shareModel = {
  515. id: this.itemId,
  516. shareTitle: this.$store.state.editor.editorTheme.shareTitle,
  517. shareContent: this.$store.state.editor.editorTheme.shareContent,
  518. shareImg: this.$store.state.editor.editorTheme.shareImg,
  519. shareUrl: this.$store.state.editor.editorTheme.shareUrl
  520. };
  521. this.resultPageCount = this.$store.state.editor.editorTheme.resultPageCount;
  522. this.bgc = this.$store.state.editor.editorTheme.bgc || "#B1C096";
  523. this.btnColor =
  524. this.$store.state.editor.editorTheme.btnColor || "#5f8a61";
  525. this.bodyBackgroundColor =
  526. this.$store.state.editor.editorTheme.bodyBackgroundColor ||
  527. "rgba(255,255,255,0)";
  528. this.canvasWidth =
  529. this.$store.state.editor.editorTheme.canvasWidth || 750;
  530. this.canvasHeight = this.$store.state.editor.editorTheme.canvasHeight;
  531. this.description = this.$store.state.editor.editorTheme.description;
  532. this.animatedNameGlobal =
  533. this.$store.state.editor.editorTheme.animatedNameGlobal || "";
  534. this.animatedNameBackgroundGlobal =
  535. this.$store.state.editor.editorTheme.animatedNameBackgroundGlobal || "";
  536. this.title = this.$store.state.editor.editorTheme.title;
  537. this.gridTempField = this.$store.state.editor.gridTempField;
  538. var pages = this.$store.state.editor.editorTheme.pages || [];
  539. console.log("每页数据", pages);
  540. this.questions = [];
  541. for (var i = 1; i < pages.length; i++) {
  542. if (pages[i].questions) {
  543. console.log("每页数据", pages[i].questions);
  544. var result = pages[i].questions.map(function (a) {
  545. return a.questionId;
  546. });
  547. this.questions.push(result);
  548. } else {
  549. this.questions.push([]);
  550. }
  551. }
  552. console.log("拼接数据", this.questions);
  553. return this.$store.state.editor.editorPage;
  554. },
  555. element() {
  556. let ele = this.$store.state.editor.editorElement;
  557. return ele || {};
  558. },
  559. hideFoot() {
  560. let pages = this.$store.state.editor.editorTheme.pages || [];
  561. let index = pages.indexOf(this.editorPage);
  562. return index == pages.length - 1 ? false : true;
  563. },
  564. complexEditorElement() {
  565. return this.$store.state.editor.complexEditorElement;
  566. }
  567. },
  568. methods: {
  569. dialogSave() {
  570. // return Promise.resolve().then(() => this.save()).then(() => this.$router.replace('themeList'))
  571. if (!window.hasSaveFlag) {
  572. this.$confirm(
  573. "请确保已经将修改的内容保存,否则页面将丢失。是否确认退出编辑?",
  574. "提示",
  575. {
  576. confirmButtonText: "确定",
  577. cancelButtonText: "取消",
  578. type: "warning"
  579. }
  580. )
  581. .then(() => {
  582. window.hasSaveFlag = true;
  583. return Promise.resolve().then(() =>
  584. this.$router.replace("myHistoryTest")
  585. );
  586. })
  587. .catch(() => {
  588. });
  589. } else {
  590. return Promise.resolve().then(() =>
  591. this.$router.replace("myHistoryTest")
  592. );
  593. }
  594. },
  595. getPicList(_id) {
  596. this.$store.dispatch("getPicListByThemeId", _id);
  597. },
  598. addPicElement(ele) {
  599. // if (ele) {
  600. let obj = {};
  601. obj.type = "pic";
  602. obj.top = document.getElementById("h5editor").scrollTop;
  603. obj.left = 0;
  604. obj.width = ele.width;
  605. obj.height = ele.height;
  606. obj.imgSrc = ele.filePath;
  607. obj.loop = ele.loop;
  608. this.$store.dispatch("addElement", obj);
  609. // } else {
  610. // this.$store.dispatch('addElement', this.element)
  611. // }
  612. this.element.type = "pic";
  613. },
  614. addMorePicElement(ele) {
  615. // if (ele) {
  616. let obj = {};
  617. obj.type = "morePic";
  618. obj.top = document.getElementById("h5editor").scrollTop;
  619. obj.left = 0;
  620. obj.width = ele.morePic[0].width;
  621. obj.height = ele.morePic[0].height;
  622. obj.imgSrc = ele.filePath;
  623. obj.morePic = ele.morePic;
  624. obj.loop = ele.loop;
  625. this.$store.dispatch("addElement", obj);
  626. this.element.type = "morePic";
  627. },
  628. //添加按钮
  629. addButtonElement(ele) {
  630. // if (ele) {
  631. let obj = {};
  632. obj.type = "button";
  633. obj.top = document.getElementById("h5editor").scrollTop;
  634. obj["text"] = "请输入文本";
  635. obj["lineHeight"] = 1.5;
  636. obj.left = 0;
  637. obj.width = ele.width;
  638. obj.height = ele.height;
  639. obj.backgroundUnselectedImg = ele.backgroundUnselectedImg;
  640. obj.backgroundSelectedImg = ele.backgroundSelectedImg;
  641. obj.loop = ele.loop;
  642. this.$store.dispatch("addElement", obj);
  643. // } else {
  644. // this.$store.dispatch('addElement', this.element)
  645. // }
  646. this.element.type = "button";
  647. },
  648. addBG(file) {
  649. this.$store.dispatch("addBGElement", {
  650. type: "bg",
  651. imgSrc: file.filePath
  652. });
  653. },
  654. cleanBG() {
  655. this.$store.dispatch("cleanBG");
  656. },
  657. cleanEle() {
  658. this.$store.dispatch("cleanEle", this.element);
  659. },
  660. addTextElement(type) {
  661. let param = {};
  662. param.top = document.getElementById("h5editor").scrollTop;
  663. param["type"] = "text";
  664. param["text"] = "请输入文本";
  665. param["width"] = 300;
  666. param["lineHeight"] = 1.5;
  667. param["backgroundColor"] = "";
  668. param["verticalAlign"] = "top";
  669. param["display"] = "block";
  670. param["textIndent"] = "0.0";
  671. param["letterSpacing"] = "0.0";
  672. param["allTransparent"] = "";
  673. param["nodeId"] = "Id" + Math.random();
  674. switch (type) {
  675. case "plain":
  676. break;
  677. case "title":
  678. param["fontSize"] = 32;
  679. param["fontWeight"] = "bold";
  680. param["textAlign"] = "center";
  681. break;
  682. case "frame":
  683. param["type"] = "frame";
  684. param["text"] = "";
  685. param["width"] = this.canvasWidth;
  686. param["border"] = "1px solid #000";
  687. param["height"] = 500;
  688. break;
  689. default:
  690. }
  691. this.$store.dispatch("addElement", param);
  692. },
  693. playAnimate() {
  694. this.$store.dispatch("playAnimate");
  695. },
  696. async save() {
  697. var loading = this.$loading({
  698. lock: true,
  699. text: "模板保存中...",
  700. spinner: "el-icon-loading",
  701. background: "rgba(0, 0, 0, 0.7)"
  702. });
  703. if (!hasSaveFlag) {
  704. $(".animated").css("animation-name", "null");
  705. $(".animated>div").css("animation-name", "null");
  706. $(".animated span").css({
  707. animationDelay: "0s",
  708. animationDuration: "0s"
  709. });
  710. await html2canvas(document.querySelector("#canvasPage"), {
  711. useCORS: true,
  712. scale: 0.5,
  713. height: 1334,
  714. logging: false //日志开关,便于查看html2canvas的内部执行流程
  715. }).then(async canvas => {
  716. var result = await uploadBase64({base64Str: canvas.toDataURL()});
  717. if (result.data.success) {
  718. this.$store.state.editor.editorTheme.cover =
  719. result.data.single.filePath;
  720. } else {
  721. this.$message.error("封面图片上传失败!");
  722. }
  723. });
  724. }
  725. this.$store.state.editor.editorTheme.bgc = this.bgc;
  726. this.$store.state.editor.editorTheme.btnColor = this.btnColor;
  727. this.$store.state.editor.editorTheme.bodyBackgroundColor =
  728. this.bodyBackgroundColor || "rgba(255,255,255,0)";
  729. this.$store.state.editor.editorTheme.canvasWidth =
  730. this.canvasWidth || 750;
  731. this.$store.state.editor.editorTheme.canvasHeight = this.canvasHeight;
  732. this.$store.state.editor.editorTheme.title = this.title;
  733. this.$store.state.editor.editorTheme.description = this.description;
  734. this.$store.state.editor.editorTheme.animatedNameGlobal =
  735. this.animatedNameGlobal || "";
  736. this.$store.state.editor.editorTheme.animatedNameBackgroundGlobal =
  737. this.animatedNameBackgroundGlobal || "";
  738. this.editorPage.elements.forEach(function (element) {
  739. if (element.type == "text") {
  740. var height = window
  741. .getComputedStyle(document.getElementById(element.nodeId))
  742. .height.replace("px", "");
  743. element.height = height;
  744. } else if (element.type == "frame") {
  745. element.children.forEach(function (_element) {
  746. if (_element.type == "text") {
  747. var height = window
  748. .getComputedStyle(document.getElementById(_element.nodeId))
  749. .height.replace("px", "");
  750. _element.height = height;
  751. }
  752. });
  753. }
  754. });
  755. let chil = this.$refs.overview;
  756. console.log("子组件结果页的值:", chil.resultPageCount);
  757. let param = {
  758. id: this.itemId,
  759. jsonString: JSON.stringify(this.$store.state.editor.editorTheme),
  760. resultPageCount: chil.resultPageCount,
  761. updator: "admin"
  762. };
  763. console.log("参数", param);
  764. return this.$store
  765. .dispatch("saveTheme", param)
  766. .then(() => {
  767. loading.close();
  768. this.$message({
  769. message: "保存成功",
  770. type: "success"
  771. });
  772. })
  773. .catch(() => {
  774. loading.close();
  775. this.$message({
  776. message: "保存失败",
  777. type: "error"
  778. });
  779. });
  780. },
  781. deploy() {
  782. this.isLoadingPreview = true;
  783. this.$store
  784. .dispatch(
  785. "saveTheme",
  786. tools.vue2json(this.$store.state.editor.editorTheme)
  787. )
  788. .then(() => {
  789. setTimeout(() => {
  790. this.showPreView = true;
  791. this.isLoadingPreview = false;
  792. }, 1000);
  793. });
  794. },
  795. selectedElement(element) {
  796. this.$store.dispatch("setEditorElement", element);
  797. },
  798. deleteListener(event) {
  799. if (
  800. event.keyCode === 8 &&
  801. event.target.nodeName !== "INPUT" &&
  802. event.target.nodeName !== "TEXTAREA"
  803. ) {
  804. this.deleteElement();
  805. }
  806. },
  807. deleteElement() {
  808. this.$store.dispatch("deleteSelectedElement");
  809. },
  810. togglePanel(code) {
  811. this.panelState = code;
  812. if (code === 0) {
  813. this.panelTabState = 0;
  814. this.$store.dispatch("setEditorElement", null);
  815. }
  816. },
  817. checkGlobalAnimation(item) {
  818. if (this.animatedNameGlobal != item.id) {
  819. this.animatedNameGlobal = item.id;
  820. this.$store.state.editor.editorTheme.animatedNameGlobal = this.animatedNameGlobal;
  821. } else {
  822. this.animatedNameGlobal = "";
  823. this.$store.state.editor.editorTheme.animatedNameGlobal = "";
  824. }
  825. },
  826. checkBackgroundGlobalAnimation(item) {
  827. if (this.animatedNameBackgroundGlobal != item.id) {
  828. this.animatedNameBackgroundGlobal = item.id;
  829. this.animatedBackgroundCustom = item.type == 0 ? false : true;
  830. this.$store.state.editor.editorTheme.animatedNameBackgroundGlobal = this.animatedNameBackgroundGlobal;
  831. } else {
  832. this.animatedNameBackgroundGlobal = "";
  833. this.$store.state.editor.editorTheme.animatedNameBackgroundGlobal = "";
  834. }
  835. },
  836. bodyBackgroundColorChange() {
  837. this.$store.state.editor.editorTheme.bodyBackgroundColor =
  838. this.bodyBackgroundColor || "rgba(255,255,255,0)";
  839. },
  840. IMChange() {
  841. this.$store.state.editor.editorTheme.bgc = this.bgc;
  842. this.$store.state.editor.editorTheme.btnColor = this.btnColor;
  843. },
  844. toLeft() {
  845. let complexEditorElement = this.complexEditorElement;
  846. let arr = complexEditorElement.map(item => {
  847. return item.left;
  848. });
  849. let min = Math.min.apply(null, arr);
  850. complexEditorElement.forEach(ele => {
  851. ele.left = min;
  852. });
  853. },
  854. toCenter() {
  855. let complexEditorElement = this.complexEditorElement;
  856. let arr = complexEditorElement.map(item => {
  857. return item.left;
  858. });
  859. let total = 0;
  860. for (let i = 0; i < arr.length; i++) {
  861. total += arr[i];
  862. }
  863. let p = total / arr.length;
  864. complexEditorElement.forEach(ele => {
  865. ele.left = p;
  866. });
  867. },
  868. toRight() {
  869. let complexEditorElement = this.complexEditorElement;
  870. let arr = complexEditorElement.map(item => {
  871. return item.width + item.left;
  872. });
  873. let max = Math.max.apply(null, arr);
  874. complexEditorElement.forEach(ele => {
  875. ele.left = max - ele.width;
  876. });
  877. },
  878. toTop() {
  879. let complexEditorElement = this.complexEditorElement;
  880. let arr = complexEditorElement.map(item => {
  881. return item.top;
  882. });
  883. let min = Math.min.apply(null, arr);
  884. complexEditorElement.forEach(ele => {
  885. ele.top = min;
  886. });
  887. },
  888. toVertialCenter() {
  889. let complexEditorElement = this.complexEditorElement;
  890. let arr = complexEditorElement.map(item => {
  891. return item.top;
  892. });
  893. let total = 0;
  894. for (let i = 0; i < arr.length; i++) {
  895. total += arr[i];
  896. }
  897. let p = total / arr.length;
  898. complexEditorElement.forEach(ele => {
  899. ele.top = p;
  900. });
  901. },
  902. toBottom() {
  903. let complexEditorElement = this.complexEditorElement;
  904. let arr = complexEditorElement.map(item => {
  905. return item.height + item.top;
  906. });
  907. let max = Math.max.apply(null, arr);
  908. complexEditorElement.forEach(ele => {
  909. ele.top = max - ele.height;
  910. });
  911. },
  912. handleClose(done) {
  913. this.$confirm("确认关闭?")
  914. .then(_ => {
  915. done();
  916. })
  917. .catch(_ => {
  918. });
  919. },
  920. uploadSelectedPicOrUnSelectedPic() {
  921. this.dialogVisible = true;
  922. },
  923. changeSelectedPicOrUnSelectedPic() {
  924. this.dialogVisible = true;
  925. this.isChangeStatus = true;
  926. },
  927. closeUploadButton() {
  928. this.buttonData = {};
  929. this.dialogVisible = false;
  930. this.selectedButtom = false;
  931. this.unSelectedButtom = false;
  932. this.isChangeStatus = false;
  933. this.canSave = false;
  934. },
  935. async upload(event, isSelected) {
  936. var that = this;
  937. let files = event.target.files
  938. if (!files.length) {
  939. return false
  940. }
  941. const loading = this.$loading({
  942. lock: true,
  943. text: 'Loading',
  944. spinner: 'el-icon-loading',
  945. background: 'rgba(0, 0, 0, 0.7)'
  946. });
  947. for (var i = 0; i < files.length; i++) {
  948. var file = files[i]
  949. if (file) {
  950. http.uploadMaterielFile(file, function (res) {
  951. loading.close();
  952. let img = document.createElement('img')
  953. img.onload = () => {
  954. if (isSelected) {
  955. that.buttonData.backgroundSelectedImg = res;
  956. that.selectedButtom = false;
  957. setTimeout(()=>{
  958. that.selectedButtom = true;
  959. },1);
  960. } else {
  961. that.buttonData.backgroundUnselectedImg = res;
  962. that.unSelectedButtom = false;
  963. setTimeout(()=>{
  964. that.unSelectedButtom = true;
  965. },1);
  966. }
  967. that.buttonData.itemId = that.itemId;
  968. that.buttonData.width = img.width;
  969. that.buttonData.height = img.height;
  970. that.buttonData.isButton = true;
  971. }
  972. img.src = res
  973. }, function (res) {
  974. if (res.total.percent == 100 && (files.length == i + 1)) {
  975. loading.close();
  976. }
  977. })
  978. }
  979. }
  980. },
  981. uploadButton() {
  982. let that = this;
  983. if (that.buttonData.backgroundUnselectedImg&&that.buttonData.backgroundSelectedImg){
  984. this.canSave = false;
  985. }else {
  986. this.canSave = true;
  987. return false
  988. }
  989. if (this.isChangeStatus) {
  990. this.element.backgroundUnselectedImg = that.buttonData.backgroundUnselectedImg;
  991. this.element.backgroundSelectedImg = that.buttonData.backgroundSelectedImg;
  992. this.element.width = that.buttonData.width;
  993. this.element.height = that.buttonData.height;
  994. } else {
  995. that.$store.dispatch('savePic', {
  996. 'backgroundUnselectedImg': that.buttonData.backgroundUnselectedImg,
  997. 'backgroundSelectedImg': that.buttonData.backgroundSelectedImg,
  998. 'themeId': that.buttonData.itemId,
  999. 'width': that.buttonData.width,
  1000. 'height': that.buttonData.height,
  1001. 'isButton': that.buttonData.isButton,
  1002. })
  1003. }
  1004. this.buttonData = {};
  1005. this.dialogVisible = false;
  1006. this.selectedButtom = false;
  1007. this.unSelectedButtom = false;
  1008. this.isChangeStatus = false;
  1009. this.canSave = false;
  1010. }
  1011. },
  1012. components: {
  1013. Overview,
  1014. Page,
  1015. PicPicker,
  1016. appConst,
  1017. PreView,
  1018. HeaderEdit,
  1019. EditPanel,
  1020. SvgPanel,
  1021. ImgPanel,
  1022. AudioPanel,
  1023. elabCanvas,
  1024. elabBackgroundCanvas,
  1025. HeaderMain
  1026. },
  1027. created() {
  1028. // new SnowCanvas(curWinWidth, curWinHeight);
  1029. // new Snow().process()
  1030. this.testcaseId = this.$route.query.testcaseId;
  1031. this.itemId = this.$route.query.itemId;
  1032. if (this.itemId) {
  1033. if (!this.pages) {
  1034. this.$store.dispatch("getPageByThemeId", this.itemId);
  1035. }
  1036. // this.getPicList(this.itemId);
  1037. } else {
  1038. this.$store.dispatch("createTheme");
  1039. this.$store.dispatch("addPage");
  1040. this.$store.dispatch("cleanPicList");
  1041. }
  1042. document.addEventListener("keyup", this.deleteListener);
  1043. window.onbeforeunload = () => false;
  1044. },
  1045. destroyed() {
  1046. document.removeEventListener("keyup", this.deleteListener);
  1047. window.onbeforeunload = null;
  1048. }
  1049. };
  1050. </script>
  1051. <style lang="less" scoped>
  1052. .lable {
  1053. display: block;
  1054. cursor: pointer;
  1055. width: 130px;
  1056. height: 130px;
  1057. }
  1058. .dialog {
  1059. width: 100%;
  1060. height: 100%;
  1061. background: rgba(255, 255, 255, 0.6);
  1062. position: absolute;
  1063. top: 0;
  1064. z-index: 100;
  1065. }
  1066. .tagPage {
  1067. position: relative;
  1068. }
  1069. .tagPage:hover div {
  1070. display: block;
  1071. }
  1072. .page-create-txt {
  1073. width: 34px;
  1074. height: 34px;
  1075. background: url("http://yun-image.elab-plus.com/images/dyb/new-text.png") center no-repeat;
  1076. background-size: 34px 34px;
  1077. &:hover {
  1078. background: url("http://yun-image.elab-plus.com/images/dyb/new-text-hover.png") center no-repeat;
  1079. background-size: 34px 34px;
  1080. }
  1081. &.active {
  1082. background: url("http://yun-image.elab-plus.com/images/dyb/new-text-active.png") center no-repeat;
  1083. background-size: 34px 34px;
  1084. }
  1085. }
  1086. .page-create-btn {
  1087. width: 34px;
  1088. height: 34px;
  1089. background: url("http://yun-image.elab-plus.com/images/dyb/new-zhuangshi.png") center no-repeat;
  1090. background-size: 34px 34px;
  1091. &:hover {
  1092. background: url("http://yun-image.elab-plus.com/images/dyb/new-zhuangshi-hover.png") center no-repeat;
  1093. background-size: 34px 34px;
  1094. }
  1095. &.active {
  1096. background: url("http://yun-image.elab-plus.com/images/dyb/new-zhuangshi-active.png") center no-repeat;
  1097. background-size: 34px 34px;
  1098. }
  1099. }
  1100. .page-create-lunbo {
  1101. width: 34px;
  1102. height: 34px;
  1103. background: url("http://yun-image.elab-plus.com/images/dyb/new-lunbo.png") center no-repeat;
  1104. background-size: 34px 34px;
  1105. &:hover {
  1106. background: url("http://yun-image.elab-plus.com/images/dyb/new-lunbo-hover.png") center no-repeat;
  1107. background-size: 34px 34px;
  1108. }
  1109. &.active {
  1110. background: url("http://yun-image.elab-plus.com/images/dyb/new-lunbo-active.png") center no-repeat;
  1111. background-size: 34px 34px;
  1112. }
  1113. }
  1114. .page-create-jiaohuanniu {
  1115. width: 34px;
  1116. height: 34px;
  1117. background: url("http://yun-image.elab-plus.com/images/dyb/new-jiaohuanniu.png") center no-repeat;
  1118. background-size: 34px 34px;
  1119. &:hover {
  1120. background: url("http://yun-image.elab-plus.com/images/dyb/new-jiaohuanniu-hover.png") center no-repeat;
  1121. background-size: 34px 34px;
  1122. }
  1123. &.active {
  1124. background: url("http://yun-image.elab-plus.com/images/dyb/new-jiaohuanniu-active.png") center no-repeat;
  1125. background-size: 34px 34px;
  1126. }
  1127. }
  1128. .page-tag-btn-tip {
  1129. width: 80px;
  1130. height: 26px;
  1131. position: absolute;
  1132. left: -85px;
  1133. top: 50%;
  1134. transform: translateY(-50%);
  1135. display: none;
  1136. text-align: center;
  1137. line-height: 26px;
  1138. font-size: 14px;
  1139. color: #fff;
  1140. background: url(../../assets/images/page_tag_btn_tip.png) center no-repeat;
  1141. background-size: cover;
  1142. }
  1143. .editor {
  1144. background-color: rgb(237, 239, 247);
  1145. position: relative;
  1146. height: 100%;
  1147. overflow: hidden;
  1148. user-select: none;
  1149. }
  1150. .section {
  1151. position: absolute;
  1152. left: 0;
  1153. right: 0;
  1154. top: 120px;
  1155. bottom: 0;
  1156. overflow: hidden;
  1157. }
  1158. .overview {
  1159. position: absolute;
  1160. left: 0;
  1161. width: 225px;
  1162. height: 100%;
  1163. z-index: 10;
  1164. }
  1165. .canvas {
  1166. /*position: absolute !important;*/
  1167. /*top: 50%;*/
  1168. /*left: 50%;*/
  1169. /*transform: translate(-75%, -50%);*/
  1170. border: 2px solid #373f42;
  1171. box-shadow: 0px 2px 30px 5px rgba(0, 0, 0, 0.2);
  1172. box-sizing: content-box;
  1173. margin-bottom: 200px;
  1174. }
  1175. .container {
  1176. /*width: 800px;
  1177. height: 860px;
  1178. padding: 20px;
  1179. position: absolute !important;
  1180. top: 50%;
  1181. left: 50%;
  1182. transform: translate(-75%, -50%);
  1183. overflow-y: scroll;
  1184. overflow-x: hidden;*/
  1185. position: absolute !important;
  1186. height: 100%;
  1187. width: 770px;
  1188. left: 56%;
  1189. transform: translate(-55%, -94%);
  1190. overflow: scroll;
  1191. overflow-x: hidden;
  1192. }
  1193. .control-panel {
  1194. position: absolute;
  1195. width: 324px;
  1196. height: 100%;
  1197. right: 0;
  1198. top: 0;
  1199. border-left: 1px solid #d6d6d6;
  1200. background-color: white;
  1201. z-index: 10;
  1202. .funcs {
  1203. position: absolute;
  1204. left: -44px;
  1205. top: 0;
  1206. height: 100%;
  1207. width: 44px;
  1208. background-color: white;
  1209. border-right: 2px solid #e2e4ee;
  1210. box-shadow: 0px 1px 15px 1px rgba(0, 0, 0, 0.2);
  1211. .func {
  1212. color: white;
  1213. background: transparent;
  1214. cursor: pointer;
  1215. margin-top: 20px;
  1216. display: block;
  1217. width: 50px;
  1218. height: 50px;
  1219. &:hover {
  1220. color: #000;
  1221. }
  1222. &.active {
  1223. border-right: 1px solid #ececec;
  1224. background-color: #ececec;
  1225. color: #000;
  1226. }
  1227. }
  1228. }
  1229. .wrapper {
  1230. height: 100%;
  1231. overflow-y: auto;
  1232. overflow-x: hidden;
  1233. position: relative;
  1234. }
  1235. .panel {
  1236. position: absolute;
  1237. left: 0;
  1238. top: 0;
  1239. height: 100%;
  1240. width: 100%;
  1241. z-index: 2;
  1242. background-color: white;
  1243. overflow-y: auto;
  1244. overflow-x: hidden;
  1245. }
  1246. .panel-bg {
  1247. .btn {
  1248. float: left;
  1249. width: 48%;
  1250. margin-left: 1%;
  1251. margin-right: 1%;
  1252. }
  1253. .bgs {
  1254. float: left;
  1255. width: 80px;
  1256. height: 80px;
  1257. background-repeat: no-repeat;
  1258. background-position: center;
  1259. background-size: contain;
  1260. margin: 5px 5px;
  1261. &:hover {
  1262. border: 2px solid #18ccc0;
  1263. cursor: pointer;
  1264. }
  1265. }
  1266. }
  1267. .panel-text {
  1268. .btn {
  1269. height: 50px;
  1270. line-height: 50px;
  1271. text-align: center;
  1272. border: 2px solid transparent;
  1273. &:hover {
  1274. cursor: pointer;
  1275. border-color: #4e5dff;
  1276. }
  1277. }
  1278. }
  1279. }
  1280. /* 2018/07/23 所有前台自定义字体,需要放七牛云服务器上,暂时放这个样式文件里面 */
  1281. @font-face {
  1282. font-family: "PenCrane";
  1283. src: url("http://yun-image.elab-plus.com/PenCrane.ttf") format("truetype");
  1284. font-weight: normal;
  1285. font-style: normal;
  1286. }
  1287. @font-face {
  1288. font-family: 手书体;
  1289. src: url("http://yun-image.elab-plus.com/new/手书体.ttf") format("truetype");
  1290. font-weight: normal;
  1291. font-style: normal;
  1292. }
  1293. @font-face {
  1294. font-family: 汉仪粗仿宋简;
  1295. src: url("http://yun-image.elab-plus.com/汉仪粗仿宋简.ttf") format("truetype");
  1296. font-weight: normal;
  1297. font-style: normal;
  1298. }
  1299. @font-face {
  1300. font-family: 华康黑体W3;
  1301. src: url("http://yun-image.elab-plus.com/华康黑体W3.ttf") format("truetype");
  1302. font-weight: normal;
  1303. font-style: normal;
  1304. }
  1305. @font-face {
  1306. font-family: 华康黑体W7;
  1307. src: url("http://yun-image.elab-plus.com/华康黑体W7.ttf") format("truetype");
  1308. font-weight: normal;
  1309. font-style: normal;
  1310. }
  1311. @font-face {
  1312. font-family: 华康黑体W9;
  1313. src: url("http://yun-image.elab-plus.com/华康黑体W9.ttf") format("truetype");
  1314. font-weight: normal;
  1315. font-style: normal;
  1316. }
  1317. @font-face {
  1318. font-family: 华康黑体W12;
  1319. src: url("http://yun-image.elab-plus.com/华康黑体W12.ttf") format("truetype");
  1320. font-weight: normal;
  1321. font-style: normal;
  1322. }
  1323. @font-face {
  1324. font-family: 华康楷体W5;
  1325. src: url("http://yun-image.elab-plus.com/华康楷体W5.ttf") format("truetype");
  1326. font-weight: normal;
  1327. font-style: normal;
  1328. }
  1329. @font-face {
  1330. font-family: 华康勘亭流W9;
  1331. src: url("http://yun-image.elab-plus.com/华康勘亭流W9.ttf") format("truetype");
  1332. font-weight: normal;
  1333. font-style: normal;
  1334. }
  1335. @font-face {
  1336. font-family: 华康瘦金体W3;
  1337. src: url("http://yun-image.elab-plus.com/华康瘦金体W3.ttf") format("truetype");
  1338. font-weight: normal;
  1339. font-style: normal;
  1340. }
  1341. @font-face {
  1342. font-family: 华康宋体W3;
  1343. src: url("http://yun-image.elab-plus.com/华康宋体W3.ttf") format("truetype");
  1344. font-weight: normal;
  1345. font-style: normal;
  1346. }
  1347. @font-face {
  1348. font-family: 华康宋体W7;
  1349. src: url("http://yun-image.elab-plus.com/华康宋体W7.ttf") format("truetype");
  1350. font-weight: normal;
  1351. font-style: normal;
  1352. }
  1353. @font-face {
  1354. font-family: 华康宋体W12;
  1355. src: url("http://yun-image.elab-plus.com/华康宋体W12.ttf") format("truetype");
  1356. font-weight: normal;
  1357. font-style: normal;
  1358. }
  1359. @font-face {
  1360. font-family: 华康魏碑W7;
  1361. src: url("http://yun-image.elab-plus.com/华康魏碑W7.ttf") format("truetype");
  1362. font-weight: normal;
  1363. font-style: normal;
  1364. }
  1365. @font-face {
  1366. font-family: 华康新综艺W7;
  1367. src: url("http://yun-image.elab-plus.com/华康新综艺W7.ttf") format("truetype");
  1368. font-weight: normal;
  1369. font-style: normal;
  1370. }
  1371. @font-face {
  1372. font-family: 华康雅宋体W9;
  1373. src: url("http://yun-image.elab-plus.com/华康雅宋体W9.ttf") format("truetype");
  1374. font-weight: normal;
  1375. font-style: normal;
  1376. }
  1377. @font-face {
  1378. font-family: 华康圆体W3;
  1379. src: url("http://yun-image.elab-plus.com/华康圆体W3.ttf") format("truetype");
  1380. font-weight: normal;
  1381. font-style: normal;
  1382. }
  1383. @font-face {
  1384. font-family: 华康圆体W5;
  1385. src: url("http://yun-image.elab-plus.com/华康圆体W5.ttf") format("truetype");
  1386. font-weight: normal;
  1387. font-style: normal;
  1388. }
  1389. @font-face {
  1390. font-family: 华康圆体W9;
  1391. src: url("http://yun-image.elab-plus.com/华康圆体W9.ttf") format("truetype");
  1392. font-weight: normal;
  1393. font-style: normal;
  1394. }
  1395. @font-face {
  1396. font-family: 庞门正道标题体增强版;
  1397. src: url("http://yun-image.elab-plus.com/庞门正道标题体增强版.ttf") format("truetype");
  1398. font-weight: normal;
  1399. font-style: normal;
  1400. }
  1401. @font-face {
  1402. font-family: 站酷高端黑修订版;
  1403. src: url("http://yun-image.elab-plus.com/站酷高端黑修订版.ttf") format("truetype");
  1404. font-weight: normal;
  1405. font-style: normal;
  1406. }
  1407. @font-face {
  1408. font-family: 站酷酷黑;
  1409. src: url("http://yun-image.elab-plus.com/站酷酷黑.ttf") format("truetype");
  1410. font-weight: normal;
  1411. font-style: normal;
  1412. }
  1413. </style>