Browse Source

Merge remote-tracking branch 'origin/mergeBranch' into mergeBranch

qymljy 2 năm trước cách đây
mục cha
commit
d0a37c2b27
1 tập tin đã thay đổi với 17 bổ sung6 xóa
  1. 17 6
      src/views/mediaStatistics/modules/salesfunnel.vue

+ 17 - 6
src/views/mediaStatistics/modules/salesfunnel.vue

@@ -45,16 +45,18 @@ export default {
   data () {
     return {
       chartPie:null,
-      tableData:[]
+      tableData:[],
+      data:[{ stagename: '简历筛选', sequence1: 253 },]
     }
   },
   methods:{
     renderPie() {
       this.chartPie = new Funnel('containerFunnel', {
-        data: [],
-        width:500,
+        data: this.data,
+        width:800,
         xField: 'stagename',
         yField: 'sequence1',
+        dynamicHeight: false,
         legend: false,
         label: {
           formatter: (datum) => {
@@ -65,8 +67,12 @@ export default {
           customContent: (title, items) => {
             // 构建自定义内容
             const content = `<div>
-              <ul style="padding:20px">
-                ${items.map((item) => `<li>${title}: ${item.data.projectqty}</li>`).join('')}
+              <ul style="padding:10px">
+                ${items.map((item) => `
+                <li>
+                <p style="margin-bottom:10px">${title}</p>
+                <p>项目数:${item.data.projectqty}</p>
+                </li>`).join('')}
               </ul>
             </div>`;
 
@@ -75,7 +81,8 @@ export default {
         },
         conversionTag: {
           formatter: (datum) => {
-            return `${((datum[Funnel.CONVERSATION_FIELD][1] / datum[Funnel.CONVERSATION_FIELD][0]) * 100).toFixed(2)}%`;
+            console.log(datum,'conversionTag')
+            return `${datum.stagename} 项目数:${datum.projectqty} 转化率:${((datum[Funnel.CONVERSATION_FIELD][1] / datum[Funnel.CONVERSATION_FIELD][0]) * 100).toFixed(2)}%`;
           },
         },
         // 关闭 conversionTag 转化率 展示
@@ -109,6 +116,10 @@ export default {
 <style>
 </style>
 <style scoped>
+#containerFunnel{
+  width:1000px;
+  margin: 0 auto;
+}
 .title{
   height: 20px;
   line-height: 20px;