bottomCenter.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <template>
  2. <div class="txtSize">
  3. <div class="title">
  4. <span style="margin-bottom:20px;">竞价情况</span>
  5. <!-- <span style="width"></span> -->
  6. <div style="display: flex">
  7. <span style="width: 100px">
  8. <el-select v-model="region" size="mini">
  9. <el-option label="不限部门" value="1"></el-option>
  10. <el-option label="网络部" value="2"></el-option>
  11. </el-select>
  12. </span>
  13. <span style="width: 60px">
  14. <el-select v-model="region1" size="mini">
  15. <el-option label="日" value="1"></el-option>
  16. <el-option label="月" value="2"></el-option>
  17. <el-option label="年" value="3"></el-option>
  18. </el-select>
  19. </span>
  20. <span style="width: 140px">
  21. <el-date-picker
  22. style="width:100%"
  23. size="mini"
  24. :clearable="false"
  25. v-model="region2"
  26. :type="region1 == 1 ? 'date' : region1 == 2 ? 'month' : 'year'"
  27. placeholder="选择日期">
  28. </el-date-picker>
  29. </span>
  30. </div>
  31. </div>
  32. <!-- <div id="bottomCenter" style="width: auto; height: 300px"></div> -->
  33. <!-- <div id="bottomCenterCon" style="width: auto; height: 300px; top:-80px"></div> -->
  34. <!-- <bottomCenterCon></bottomCenterCon> -->
  35. <Echart
  36. :options="options"
  37. id="bottomCenter"
  38. height="300px"
  39. width="100%"
  40. ></Echart>
  41. <Echart
  42. :options="optionsPie"
  43. id="bottomCenterCon"
  44. height="300px"
  45. width="100%"
  46. ></Echart>
  47. </div>
  48. </template>
  49. <script>
  50. import Echart from "@/common/echart";
  51. export default {
  52. components: {
  53. Echart,
  54. },
  55. props: {
  56. cdata: {
  57. type: Object,
  58. default: () => ({}),
  59. },
  60. },
  61. data() {
  62. return {
  63. region: "1",
  64. region1: "1",
  65. region2: "1",
  66. options: {
  67. // title: {
  68. // text: "Funnel",
  69. // },
  70. tooltip: {
  71. trigger: "item",
  72. formatter: "{b} : {c}",
  73. },
  74. legend: {
  75. data: ["竞价单数", "已反馈单数", "生成订单"],
  76. },
  77. series: [
  78. {
  79. name: "Funnel",
  80. type: "funnel",
  81. left: "10%",
  82. top: 60,
  83. bottom: 60,
  84. width: "80%",
  85. min: 0,
  86. max: 100,
  87. minSize: "30%",
  88. maxSize: "100%",
  89. sort: "descending",
  90. gap: 2,
  91. label: {
  92. show: true,
  93. position: "inside",
  94. formatter:((params)=>{
  95. //返回值对大数额做处理
  96. return `${params.data.name} : ${this.$options.filters['getNum_noPrice'](params.data.value) }`
  97. })
  98. },
  99. labelLine: {
  100. length: 10,
  101. lineStyle: {
  102. width: 1,
  103. type: "solid",
  104. },
  105. },
  106. itemStyle: {
  107. borderColor: "#fff",
  108. borderWidth: 1,
  109. },
  110. // emphasis: {
  111. // label: {
  112. // fontSize: 20,
  113. // },
  114. // },
  115. data: [
  116. { value: 456760, name: "生成订单" },
  117. { value: 8880, name: "已反馈单数" },
  118. { value: 100, name: "竞价单数" },
  119. ],
  120. },
  121. ],
  122. },
  123. optionsPie: {
  124. tooltip: {
  125. trigger: 'item'
  126. },
  127. legend: {
  128. // top: '50%',
  129. bottom: '1%'
  130. },
  131. title: {
  132. text: `空反:\n总单数\n${1111}`,
  133. fontWeight:"normal",
  134. fontSize:14,
  135. lineHeight: 26,
  136. left:'40%',
  137. top:"40%",
  138. },
  139. series: [
  140. {
  141. name: '空反',
  142. type: 'pie',
  143. radius: ['40%', '70%'],
  144. avoidLabelOverlap: false,
  145. label: {
  146. show: true,
  147. position: 'inner',
  148. formatter:((params)=>{
  149. //返回值对大数额做处理
  150. return `${this.$options.filters['getNum_noPrice'](params.data.value) }`
  151. })
  152. },
  153. labelLine: {
  154. show: false
  155. },
  156. data: [
  157. { value: 1048, name: '进行中' },
  158. { value: 735, name: '已结束' },
  159. ]
  160. }
  161. ]
  162. }
  163. };
  164. },
  165. mounted() {
  166. // this.cinit();
  167. },
  168. methods: {
  169. cinit() {
  170. this.$echarts
  171. .init(document.getElementById("bottomCenter"))
  172. .setOption(this.options);
  173. this.$echarts
  174. .init(document.getElementById("bottomCenterCon"))
  175. .setOption(this.optionsPie);
  176. },
  177. },
  178. };
  179. </script>
  180. <style lang="scss" scoped>
  181. .txtSize {
  182. // font-size: 0px;
  183. position: relative;
  184. top: -270px;
  185. }
  186. .title {
  187. font-size: 18px;
  188. margin: 20px 0;
  189. display: flex;
  190. flex-wrap: wrap;
  191. justify-content: space-between;
  192. align-items: center;
  193. }
  194. #bottomCenterCon{
  195. position: relative;
  196. top:0px;
  197. }
  198. </style>