editBtn.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <div class="templateEditBtnBox" @click="openEditWindow" v-if="this.$store.state.template.previewStatus==false">
  3. <i class="el-icon-setting"></i>
  4. </div>
  5. </template>
  6. <script>
  7. export default {
  8. props: {
  9. id: {
  10. type:Number,
  11. default:0
  12. },
  13. dataSort: {
  14. type:Number,
  15. default:0
  16. },
  17. sort:{
  18. type:Number,
  19. default:0
  20. },
  21. type:{//组件类型 1=新闻(单个) 2=新闻(多个) 3=广告 4=友情链接 5=底部导航 6=静态html组件 7=文字 8=评论
  22. type:Number,
  23. default:0
  24. },
  25. size:{
  26. type:Number,
  27. default:0
  28. },
  29. y: {
  30. type:Number,
  31. default:0
  32. }
  33. },
  34. data() {
  35. return {
  36. };
  37. },
  38. methods: {
  39. openEditWindow(){
  40. let data = {
  41. id:this.id,
  42. dataSort:this.dataSort,
  43. sort:this.sort,
  44. type:this.type,
  45. size:this.size,
  46. y:this.y
  47. }
  48. console.log(data);
  49. //小助手
  50. this.$store.commit('template/setEditWindowStatus',data);
  51. //设置组件回显数据
  52. this.$store.commit('template/setComponentViewData',data);
  53. //获取全部导航
  54. this.$store.dispatch('template/getWebsiteCategory',{pageSize:1000});
  55. }
  56. },
  57. mounted() {
  58. },
  59. };
  60. </script>
  61. <style scoped lang="less">
  62. .templateEditBtnBox {
  63. position: absolute;
  64. top: 0;
  65. left: 0;
  66. display: flex;
  67. align-items: center;
  68. justify-content: center;
  69. cursor: pointer;
  70. margin: 5px;
  71. color: #666;
  72. //border: 1px solid #000;
  73. border-radius: 5px;
  74. width: 30px;
  75. height: 30px;
  76. line-height: 30px;
  77. text-align: center;
  78. font-size: 30px;
  79. transition: all 0.3s;
  80. z-index: 999;
  81. background: rgba(255,255,255,0.5);
  82. &:hover {
  83. color: #333;
  84. }
  85. }
  86. </style>