pageAboutList.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. <template>
  2. <div>
  3. <!-- 1.页头板块 -->
  4. <div :class="['FixedModuleBox', { sectorBorder: this.$store.state.template.previewStatus == false }]">
  5. <headSector
  6. v-if="this.$store.state.template.editWebsiteClass > 0 && this.$store.state.template.editWebsiteClass <= 4" />
  7. <headSectorStyle5 v-if="this.$store.state.template.editWebsiteClass >= 5" />
  8. </div>
  9. <!-- 全局组件:导航 -->
  10. <div :class="['FixedModuleBox', { sectorBorder: this.$store.state.template.previewStatus == false }]">
  11. <menuSector
  12. v-if="this.$store.state.template.editWebsiteClass > 0 && this.$store.state.template.editWebsiteClass <= 4" />
  13. <menuSectorStyle5 v-if="this.$store.state.template.editWebsiteClass >= 5" />
  14. </div>
  15. <!-- 固定背景图 -->
  16. <div class="fixedBg" v-if="this.$store.state.template.editWebsiteClass == 6">
  17. <img src="https://img.bjzxtw.org.cn/master/image/png/20251218/176604033999762.png" alt="">
  18. </div>
  19. <!--使用gridKey来强制更新视图-->
  20. <div id="content" class="canvasBox">
  21. <grid-layout :auto-size="true"
  22. :class="this.$store.state.template.pageData.aloneList.length == 0 ? 'FixedMainModuleBox' : 'FixedMainModuleBoxAuto'"
  23. ref="gridlayout" :layout="this.$store.state.template.pageData.aloneList"
  24. :layout.sync="this.$store.state.template.pageData.aloneList" :col-num="12" :row-height="rowHeight"
  25. :margin="[0, 0]" :is-draggable="true" :is-resizable="true" :key="this.$store.state.template.gridKey
  26. ">
  27. <grid-item v-for="(item, index) in this.$store.state.template.pageData.aloneList" :key="item.i"
  28. :i="item.i" :x="item.x" :y="item.y" :w="item.w" :h="item.h" :is-resizable="false">
  29. <div class="grid-item-content">
  30. <div class="grid-tools-menu" v-if="$store.state.template.previewStatus == false">
  31. <span @click="deleteModule(item.i, item.dataSort)"><i class="el-icon-close"></i></span>
  32. </div>
  33. <div v-if="item.type == 'adSector'" class="moduleBox">
  34. <adSector :dataSort="item.dataSort" :id="item.i" :y="item.y" />
  35. </div>
  36. <div v-if="item.type == 'aboutListSector'" class="moduleBox">
  37. <aboutListSector :dataSort="item.dataSort" :id="item.i" :y="item.y" />
  38. </div>
  39. <div v-if="item.type == 'ListupdownSector'" class="moduleBox">
  40. <ListupdownSector :dataSort="item.dataSort" :id="item.i" :y="item.y" />
  41. </div>
  42. <!-- 皮肤7-单页列表通栏 -->
  43. <div v-if="item.type == 'pageListSector'" class="moduleBox">
  44. <pageListSector :dataSort="item.dataSort" :id="item.i" :y="item.y" />
  45. </div>
  46. </div>
  47. </grid-item>
  48. </grid-layout>
  49. </div>
  50. <!-- 全局组件:页尾 -->
  51. <div class="FixedModuleBoxBottom">
  52. <footerSector v-if="this.$store.state.template.editWebsiteClass <= 4" />
  53. <footerSectorStyle5 v-if="this.$store.state.template.editWebsiteClass >= 5" />
  54. </div>
  55. </div>
  56. </template>
  57. <script>
  58. //页面公用组件 start------------------------------------------------------------>
  59. //引入公用样式
  60. import '@/styles/global.less';
  61. import { GridLayout, GridItem } from "vue-grid-layout";
  62. //1.页面公用组件 end------------------------------------------------------------>
  63. //引入自助建站组件 start------------------------------------------------------------>
  64. //全局组件
  65. import headSector from '../style/sector/head/1200x200/1.vue';
  66. import headSectorStyle5 from '../style/sector/head/1200x250/1.vue';
  67. import menuSector from '../style/sector/menu/1200x130/1.vue';
  68. import menuSectorStyle5 from '../style/sector/menu/1200x187/1.vue';
  69. import aboutListSector from '../style/sector/body/about/1200x1290/1.vue';
  70. import ListupdownSector from '../style/sector/body/about/1200x1575/1.vue';
  71. import footerSector from '../style/sector/foot/1200x580/1.vue';
  72. import footerSectorStyle5 from '../style/sector/foot/1200x680/1.vue';
  73. import adSector from '../style/sector/body/ad/1200x90/1.vue';
  74. //2.引入自助建站组件 end------------------------------------------------------------>
  75. // 皮肤7-单页列表通栏
  76. import pageListSector from '../style/sector/body/about/1200x1710/7/1.vue';
  77. export default {
  78. components: {
  79. GridLayout,
  80. GridItem,
  81. headSector,
  82. headSectorStyle5,
  83. menuSector,
  84. menuSectorStyle5,
  85. adSector,
  86. aboutListSector,
  87. ListupdownSector,
  88. footerSector,
  89. footerSectorStyle5,
  90. pageListSector, //皮肤7-单页列表通栏
  91. },
  92. data() {
  93. return {
  94. //0.全局配置 start------------------------------------------------------------>
  95. windowStatus: false,
  96. rowHeight: 10,
  97. //0.全局配置 end------------------------------------------------------------>
  98. //1.编辑模块 start------------------------------------------------------------>
  99. formLabelWidth: '120px',
  100. editModule: "",//待编辑的模块
  101. //1.编辑模块 end------------------------------------------------------------>
  102. }
  103. },
  104. mounted() {
  105. //必备操作
  106. //1.获得vuex中的鼠标对象
  107. let mouseObj = this.$store.state.template.mouseXY;
  108. //2.获得gridlayout对象
  109. this.$store.commit('template/setGridlayoutObj', this.$refs.gridlayout);
  110. //3.监听鼠标按住以后的移动事件
  111. document.addEventListener("dragover", function (e, store) {
  112. mouseObj.x = e.clientX;
  113. mouseObj.y = e.clientY;
  114. // mouseXY.x = e.clientX;
  115. // mouseXY.y = e.clientY;
  116. }, false);
  117. },
  118. methods: {
  119. //0.全局操作 start ------------------------------------------------------------>
  120. //0.1上一步
  121. goStyle() {
  122. this.$router.push({
  123. path: '/templateStyle',
  124. query: {
  125. id: this.editId
  126. }
  127. });
  128. },
  129. //0.2下一步
  130. gotoList() {
  131. this.$router.push({
  132. path: '/templateList'
  133. });
  134. },
  135. //0.全局操作 end ------------------------------------------------------------>
  136. //1.模块操作 start ------------------------------------------------------------>
  137. //1.1 移动模块
  138. moveModule(i, moveType) {
  139. this.$store.commit('template/moveModule', { i: i, moveType: moveType });
  140. },
  141. //1.2 删除模块
  142. deleteModule(i, dataSort) {
  143. let data = {
  144. i: i,
  145. dataSort: dataSort
  146. }
  147. this.$store.commit('template/deleteModule', data);
  148. },
  149. //1.3 打开弹出框
  150. openWindow(item) {
  151. this.editModule = item.i;
  152. this.windowStatus = true;
  153. },
  154. //1.4 关闭弹出框
  155. closeWindow() {
  156. this.windowStatus = false;
  157. }
  158. //1.模块操作 end ------------------------------------------------------------>
  159. }
  160. }
  161. </script>
  162. <style scoped lang="less">
  163. //拖拽demo
  164. .droppable-element {
  165. width: 150px;
  166. text-align: center;
  167. background: #fdd;
  168. border: 1px solid black;
  169. margin: 10px 0;
  170. padding: 10px;
  171. }
  172. //模块 start------------------------------------------------------------>
  173. .sectorBorder {
  174. border: 2px dashed #eee;
  175. }
  176. .moduleBox {
  177. display: flex;
  178. width: 100%;
  179. height: 100%;
  180. position: relative;
  181. justify-content: space-between;
  182. box-sizing: border-box;
  183. background-color: transparent;
  184. //border: 2px dashed #eee;
  185. }
  186. .moduleBoxBorder {
  187. border: 2px dashed #eee;
  188. }
  189. //固定的模块
  190. .FixedModuleBox {
  191. width: 100%;
  192. //margin-bottom: 20px;
  193. //border: 2px dashed #eee;
  194. }
  195. .fixedBg {
  196. width: 100%;
  197. height: 720px;
  198. position: absolute;
  199. top: 422px;
  200. left: 0;
  201. z-index: 0;
  202. img {
  203. width: 100%;
  204. height: 100%;
  205. }
  206. }
  207. .FixedModuleBoxBottom {
  208. width: 100%;
  209. }
  210. .FixedMainModuleBox {
  211. width: 100%;
  212. font-size: 18px;
  213. color: #999;
  214. text-align: center;
  215. img {
  216. margin-bottom: 20px;
  217. }
  218. padding: 100px;
  219. //background: #F5F7FB;
  220. //margin-bottom: 20px;
  221. }
  222. .FixedMainModuleBoxBorder {
  223. border: 2px dashed #eee;
  224. }
  225. //模块 end------------------------------------------------------------>
  226. //栅格布局 start------------------------------------------------------------>
  227. .grid-item-content {
  228. display: flex;
  229. align-items: center;
  230. justify-content: center;
  231. background-color: transparent;
  232. height: 100%;
  233. overflow: hidden;
  234. position: relative;
  235. .grid-tools-menu {
  236. position: absolute;
  237. top: 0;
  238. right: 10px;
  239. z-index: 99;
  240. display: flex;
  241. align-items: center;
  242. justify-content: center;
  243. span {
  244. width: 38px;
  245. height: 38px;
  246. line-height: 38px;
  247. text-align: center;
  248. font-size: 30px;
  249. cursor: pointer;
  250. color: #999;
  251. border: 2px dashed #999;
  252. border-radius: 8px;
  253. background-color: #fff1cc;
  254. transition: all 0.3s;
  255. &:hover {
  256. color: #333;
  257. }
  258. }
  259. }
  260. }
  261. .grid-layout {
  262. grid-gap: 0;
  263. row-gap: 0;
  264. }
  265. //画布调整
  266. .canvasBox {
  267. margin-top: 20px;
  268. }
  269. .FixedMainModuleBox {
  270. min-height: 450px;
  271. background-color: #fff;
  272. background: url('../../../assets/template/creat.png') no-repeat center center;
  273. }
  274. .FixedMainModuleBoxAuto {
  275. min-height: 450px;
  276. background-color: transparent;
  277. }
  278. //占位元素颜色
  279. ::v-deep .vue-grid-placeholder {
  280. background: #ccc !important;
  281. opacity: 0.3;
  282. }
  283. //栅格布局 end------------------------------------------------------------>
  284. //执行v-deep穿透scope选择器 start------------------------------------------------------------>*/
  285. ::v-deep .custom-form-item>.el-form-item__label {
  286. line-height: 140px !important;
  287. }
  288. ::v-deep .custom-textarea .el-textarea__inner {
  289. resize: none;
  290. /* 禁止用户拖拽调整大小 */
  291. }
  292. ::v-deep .custom-align-right .el-form-item__label {
  293. text-align: right;
  294. /* 设置标签文字右对齐 */
  295. }
  296. ::v-deep .shadowBox .el-button--mini.is-circle {
  297. border-radius: 50% !important;
  298. }
  299. //执行v-deep穿透scope选择器 end------------------------------------------------------------>*/
  300. </style>