ActionBox.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <div class="action-box-container row items-center"
  3. :class="localOptions.className"
  4. :style="localOptions.style">
  5. <div class="contents-container col-lg-9 col-sm-8 col-xs-12">
  6. <div class="contents row items-center no-wrap">
  7. <q-img :src="localOptions.src"
  8. :width="localOptions.imageWidth"
  9. :height="localOptions.imageHeight" />
  10. <span class="text q-ml-md"
  11. v-html="localOptions.text" />
  12. </div>
  13. </div>
  14. <div class="action-btn col-lg-3 col-sm-4 col-xs-12">
  15. <action-button v-model:options="localOptions.button" />
  16. </div>
  17. </div>
  18. </template>
  19. <script>
  20. import { mixinWidget } from 'src/mixin/Mixins.js'
  21. import ActionButton from 'components/Widgets/ActionButton/ActionButton.vue'
  22. export default {
  23. name: 'ActionBox',
  24. components: { ActionButton },
  25. mixins: [mixinWidget],
  26. data() {
  27. return {
  28. defaultOptions: {
  29. src: '',
  30. imageWidth: '50px',
  31. imageHeight: '50px',
  32. text: 'متن مورد نظر را وارد کنید ...',
  33. textOptions: {
  34. fontFamily: null,
  35. color: null,
  36. fontSize: null,
  37. fontWeight: null,
  38. fontStyle: null,
  39. xs: {
  40. fontSize: null,
  41. fontWeight: null,
  42. fontStyle: null,
  43. lineHeight: null
  44. },
  45. sm: {
  46. fontSize: null,
  47. fontWeight: null,
  48. fontStyle: null,
  49. lineHeight: null
  50. },
  51. md: {
  52. fontSize: null,
  53. fontWeight: null,
  54. fontStyle: null,
  55. lineHeight: null
  56. },
  57. lg: {
  58. fontSize: null,
  59. fontWeight: null,
  60. fontStyle: null,
  61. lineHeight: null
  62. },
  63. xl: {
  64. fontSize: null,
  65. fontWeight: null,
  66. fontStyle: null,
  67. lineHeight: null
  68. }
  69. },
  70. button: {
  71. style: {
  72. background: '',
  73. color: ''
  74. },
  75. color: null,
  76. icon: null,
  77. label: 'button',
  78. flat: false,
  79. callBack: null,
  80. imageSource: null,
  81. className: null,
  82. fixed: false,
  83. fixedPosition: null,
  84. action: null,
  85. scrollTo: null,
  86. route: null,
  87. eventName: null,
  88. eventArgs: null
  89. },
  90. style: {
  91. borderRadius: '15px'
  92. }
  93. }
  94. }
  95. }
  96. }
  97. </script>
  98. <style scoped lang="scss">
  99. .action-box-container {
  100. padding: 15px 16px;
  101. .action-btn {
  102. text-align: right;
  103. @media screen and (max-width: 599px) {
  104. margin-top: 26px;
  105. margin-bottom: 4px;
  106. text-align: center !important;
  107. }
  108. }
  109. .contents-container {
  110. .contents {
  111. @media screen and (max-width: 599px) {
  112. place-content: center;
  113. }
  114. }
  115. @media screen and (max-width: 599px) {
  116. margin-top: 26px;
  117. margin-bottom: 4px;
  118. text-align: center !important;
  119. }
  120. }
  121. .text {
  122. line-height: v-bind('localOptions.textOptions.xl.lineHeight');
  123. color: v-bind('localOptions.textOptions.color');
  124. font-size: v-bind('localOptions.textOptions.xl.fontSize');
  125. font-weight: v-bind('localOptions.textOptions.xl.fontWeight');
  126. font-family: v-bind('localOptions.textOptions.fontFamily');
  127. font-style: v-bind('localOptions.textOptions.xl.fontStyle');
  128. @media screen and (max-width: 1920px) {
  129. font-size: v-bind('localOptions.textOptions.lg.fontSize');
  130. font-weight: v-bind('localOptions.textOptions.lg.fontWeight');
  131. font-style: v-bind('localOptions.textOptions.lg.fontStyle');
  132. line-height: v-bind('localOptions.textOptions.lg.lineHeight');
  133. }
  134. @media screen and (max-width: 1440px) {
  135. font-size: v-bind('localOptions.textOptions.md.fontSize');
  136. font-weight: v-bind('localOptions.textOptions.md.fontWeight');
  137. font-style: v-bind('localOptions.textOptions.md.fontStyle');
  138. line-height: v-bind('localOptions.textOptions.md.lineHeight');
  139. }
  140. @media screen and (max-width: 1024px) {
  141. font-size: v-bind('localOptions.textOptions.sm.fontSize');
  142. font-weight: v-bind('localOptions.textOptions.sm.fontWeight');
  143. font-style: v-bind('localOptions.textOptions.sm.fontStyle');
  144. line-height: v-bind('localOptions.textOptions.sm.lineHeight');
  145. }
  146. @media screen and (max-width: 600px) {
  147. font-size: v-bind('localOptions.textOptions.xs.fontSize');
  148. font-weight: v-bind('localOptions.textOptions.xs.fontWeight');
  149. font-style: v-bind('localOptions.textOptions.xs.fontStyle');
  150. line-height: v-bind('localOptions.textOptions.xs.lineHeight');
  151. }
  152. }
  153. }
  154. </style>