liuxiaona 2 yıl önce
ebeveyn
işleme
997a5f3403

+ 30 - 0
project/src/components/smartRadar/dataAnalyse.vue

@@ -58,18 +58,22 @@ export default {
58 58
         {
59 59
           bigTitle:'总访问人数',
60 60
           bigNum:0,
61
+          bigKey:'total_uv_count',
61 62
         },
62 63
         {
63 64
           bigTitle:'今日访问人数',
64 65
           bigNum:0,
66
+          bigKey:'today_uv_count',
65 67
         },
66 68
         {
67 69
           bigTitle:'总访问次数',
68 70
           bigNum:0,
71
+          bigKey:'total_pv_count',
69 72
         },
70 73
         {
71 74
           bigTitle:'今日访问次数',
72 75
           bigNum:0,
76
+          bigKey:'today_pv_count',
73 77
         }
74 78
       ],
75 79
       default_time: [this.$getDay(-30, false), this.$getDay(0, false)],
@@ -86,7 +90,33 @@ export default {
86 90
       ]
87 91
     }
88 92
   },
93
+  created(){
94
+    this.init()
95
+  },
89 96
   methods:{
97
+    init(){//数据概览
98
+      this.loading = true
99
+      this.$axios.get(this.URL.BASEURL + this.URL.radar_dataView, {
100
+        params:{
101
+          radar_id:this.$route.params.id
102
+        }
103
+      }).then((res) => {
104
+        var res = res.data
105
+        this.loading = false
106
+        if (res && res.errno == 0) {
107
+          this.dataPreview.forEach(item=>{
108
+            item.bigNum = res.rst[item.bigKey]
109
+          })
110
+        } else if (res.errno != 4002) {
111
+          this.$message({
112
+            message: res.err,
113
+            type: "warning"
114
+          })
115
+        }
116
+      }).catch((err) => {
117
+        this.loading = false
118
+      });
119
+    },
90 120
     changeTime (time) {//筛选时间变化
91 121
       if (!time || time && time.length == 0) {
92 122
         this.time = []

+ 1 - 1
project/src/components/smartRadar/index.vue

@@ -2,7 +2,7 @@
2 2
   <div class="con">
3 3
     <div class="searchBox">
4 4
       <el-button type="primary" size="mini" @click="created_radar">新建智能雷达</el-button>
5
-      <self-input label_name="搜索雷达" @inputChange='(val)=>{radar_val = val;initFlag=!initFlag}'></self-input>
5
+      <self-input :reset="reset" label_name="搜索雷达" @inputChange='(val)=>{radar_val = val;initFlag=!initFlag}'></self-input>
6 6
       <div class="reset" @click="resetEvent">重置</div>
7 7
     </div>
8 8
     <div class="mainBox">

+ 34 - 6
project/src/components/smartRadar/publicTable.vue

@@ -20,11 +20,19 @@
20 20
           </template>
21 21
           <template slot-scope="scope">
22 22
             <div v-if="item.prop=='type'">
23
-              
23
+              <span v-if="scope.row.type==1">链接</span>
24
+              <span v-else-if="scope.row.type==2">PDF</span>
25
+              <span v-else-if="scope.row.type==3">图片</span>
26
+              <span v-else-if="scope.row.type==4">视频</span>
27
+              <span v-else="scope.row.type==1">-</span>
24 28
             </div>
25
-
26
-
27
-            <div>{{scope.row[item.prop] ||scope.row[item.prop]==0 ? scope.row[item.prop] : '-'}}</div>
29
+            <div v-else-if="item.prop=='tag_list'">
30
+              <template v-if="scope.row.tag_list&&scope.row.tag_list.length==0 || !scope.row.tag_list">-</template>
31
+              <div class="customerServiceTagBox biaoqian" v-else>
32
+                <div class="customerServiceTag" v-for="(item,index) in scope.row.tag_list" :key="index+'biaoqian'">{{item}}</div>
33
+              </div>
34
+            </div>
35
+            <div v-else>{{scope.row[item.prop] ||scope.row[item.prop]==0 ? scope.row[item.prop] : '-'}}</div>
28 36
           </template>
29 37
         </el-table-column>
30 38
       </template>
@@ -34,8 +42,10 @@
34 42
           <template slot-scope="scope">
35 43
               <div class="flex">
36 44
                 <div class="c-00B38A pointer">编辑</div>
37
-                <div class="c-00B38A pointer lMar8">删除</div>
38
-                <div class="c-00B38A pointer lMar8" @click="goDataAanlyse(scope.row.id)">分析数据</div>
45
+                <el-popconfirm @confirm="deleRadar(scope.row.radar_id)" :title="`确定删除【${scope.row.name}】渠道活码?`">
46
+                  <div slot="reference" class="c-00B38A pointer lMar8">删除</div>
47
+                </el-popconfirm>
48
+                <div class="c-00B38A pointer lMar8" @click="goDataAanlyse(scope.row.radar_id)">分析数据</div>
39 49
               </div>
40 50
           </template>
41 51
         </el-table-column>
@@ -86,6 +96,24 @@ export default {
86 96
     goDataAanlyse(id){
87 97
       this.$router.push('/radar_dataAnalyse/'+id)
88 98
     },
99
+    deleRadar(id){
100
+      this.loading = true
101
+      this.$axios.post(this.URL.BASEURL + this.URL.radar_radarDele, {
102
+        radar_id:id
103
+      }).then((res) => {
104
+        var res = res.data
105
+        this.loading = false
106
+        this.$message({
107
+          message: res.err,
108
+          type: "warning"
109
+        })
110
+        if (res && res.errno == 0) {
111
+          this.init(1)
112
+        }
113
+      }).catch((err) => {
114
+        this.loading = false
115
+      });
116
+    },
89 117
     init (page) {
90 118
       this.page = page ? page : this.page;
91 119
       this.loading = true