liuxiaona 2 years ago
parent
commit
997a5f3403

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

58
         {
58
         {
59
           bigTitle:'总访问人数',
59
           bigTitle:'总访问人数',
60
           bigNum:0,
60
           bigNum:0,
61
+          bigKey:'total_uv_count',
61
         },
62
         },
62
         {
63
         {
63
           bigTitle:'今日访问人数',
64
           bigTitle:'今日访问人数',
64
           bigNum:0,
65
           bigNum:0,
66
+          bigKey:'today_uv_count',
65
         },
67
         },
66
         {
68
         {
67
           bigTitle:'总访问次数',
69
           bigTitle:'总访问次数',
68
           bigNum:0,
70
           bigNum:0,
71
+          bigKey:'total_pv_count',
69
         },
72
         },
70
         {
73
         {
71
           bigTitle:'今日访问次数',
74
           bigTitle:'今日访问次数',
72
           bigNum:0,
75
           bigNum:0,
76
+          bigKey:'today_pv_count',
73
         }
77
         }
74
       ],
78
       ],
75
       default_time: [this.$getDay(-30, false), this.$getDay(0, false)],
79
       default_time: [this.$getDay(-30, false), this.$getDay(0, false)],
86
       ]
90
       ]
87
     }
91
     }
88
   },
92
   },
93
+  created(){
94
+    this.init()
95
+  },
89
   methods:{
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
     changeTime (time) {//筛选时间变化
120
     changeTime (time) {//筛选时间变化
91
       if (!time || time && time.length == 0) {
121
       if (!time || time && time.length == 0) {
92
         this.time = []
122
         this.time = []

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

2
   <div class="con">
2
   <div class="con">
3
     <div class="searchBox">
3
     <div class="searchBox">
4
       <el-button type="primary" size="mini" @click="created_radar">新建智能雷达</el-button>
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
       <div class="reset" @click="resetEvent">重置</div>
6
       <div class="reset" @click="resetEvent">重置</div>
7
     </div>
7
     </div>
8
     <div class="mainBox">
8
     <div class="mainBox">

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

20
           </template>
20
           </template>
21
           <template slot-scope="scope">
21
           <template slot-scope="scope">
22
             <div v-if="item.prop=='type'">
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
             </div>
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
           </template>
36
           </template>
29
         </el-table-column>
37
         </el-table-column>
30
       </template>
38
       </template>
34
           <template slot-scope="scope">
42
           <template slot-scope="scope">
35
               <div class="flex">
43
               <div class="flex">
36
                 <div class="c-00B38A pointer">编辑</div>
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
               </div>
49
               </div>
40
           </template>
50
           </template>
41
         </el-table-column>
51
         </el-table-column>
86
     goDataAanlyse(id){
96
     goDataAanlyse(id){
87
       this.$router.push('/radar_dataAnalyse/'+id)
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
     init (page) {
117
     init (page) {
90
       this.page = page ? page : this.page;
118
       this.page = page ? page : this.page;
91
       this.loading = true
119
       this.loading = true