Browse Source

资源成果服务统计

lipengtao 6 years ago
parent
commit
6892ee6c18

+ 3 - 0
src/api/statistics.js

@ -8,3 +8,6 @@ export const pqCompanyFilterList = '/ajax/log/company/pq'
8 8
export const pqProductFilterList = '/ajax/log/product/pq'
9 9
export const pqOrgFilterList = '/ajax/log/org/ql'
10 10
export const pqExpertFilterList = '/ajax/log/professor/ql'
11
export const pqWareList = '/ajax/log/ware/pq' // 筛选服务列表
12
export const pqResourceList = '/ajax/log/resource/pq' // 筛选资源列表
13
export const pqPpatentList = '/ajax/log/ppatent/pq' // 筛选专利列表

+ 18 - 0
src/router/index.js

@ -368,6 +368,24 @@ export const asyncRouterMap = [
368 368
          component: () => import('@/views/statistics/productCount'),
369 369
          name: 'productCount',
370 370
          meta: { title: '企业产品数据统计' }
371
        },
372
        {
373
          path: 'serviceCount',
374
          component: () => import('@/views/statistics/service'),
375
          name: 'serviceCount',
376
          meta: { title: '服务数据统计' }
377
        },
378
        {
379
          path: 'resultsCount',
380
          component: () => import('@/views/statistics/results'),
381
          name: 'resultsCount',
382
          meta: { title: '成果数据统计' }
383
        },
384
        {
385
          path: 'resourceCount',
386
          component: () => import('@/views/statistics/resources'),
387
          name: 'resourceCount',
388
          meta: { title: '资源数据统计' }
371 389
        }
372 390
      ]
373 391
    }

+ 253 - 0
src/views/statistics/resources.vue

@ -0,0 +1,253 @@
1
<template>
2
  <div class="app-container">
3
    <div class="box-container">
4
      <div class="contain-title">资源数据统计</div>
5
    </div>
6
    <div class="content-container">
7
      <div class="content-item" style="padding-top:0">
8
        <div class="content-item-tit">资源总浏览量统计</div>
9
        <div class="line-chart-box">
10
          <LineChart :chartData="chartData"></LineChart>
11
        </div>
12
      </div>
13
      <div class="content-item">
14
        <div class="content-item-tit">资源浏览量查询</div>
15
        <div class="contain-search" style="margin-top:20px; width:95%">
16
          <el-form :model="formFilter" class="demo-form" label-width="100px">
17
            <el-row :gutter="10">
18
              <el-col :span="12">
19
                <el-form-item label="资源名称:">
20
                  <el-input v-model="formFilter.title" placeholder="搜索资源名称"></el-input>
21
                </el-form-item>
22
              </el-col>
23
              <el-col :span="12">
24
                <el-form-item label="发布者:">
25
                  <el-input v-model="formFilter.creator" placeholder="搜索发布者"></el-input>
26
                </el-form-item>
27
              </el-col>
28
              <el-col :span="12">
29
                <el-form-item label="发布时间:">
30
                  <el-date-picker v-model="formFilter.dateRange" type="daterange" range-separator="至" start-placeholder="开始日期"
31
                    end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyyMMdd" @change="changeRangerDate">
32
                  </el-date-picker>
33
                </el-form-item>
34
              </el-col>
35
              <el-col :span="12">
36
                <el-form-item label="排序方式:">
37
                  <el-select v-model="formFilter.orderBy" placeholder="选择排序方式" @change="sortChanged">
38
                    <el-option label="按创建时间由新到旧排序" value="1"></el-option>
39
                    <el-option label="按浏览量由高到底排序" value="2"></el-option>
40
                  </el-select>
41
                </el-form-item>
42
              </el-col>
43
              <el-col :span="24">
44
                <el-form-item label-width="30px" align="right">
45
                  <el-button type="primary" @click="filterSearch">查询</el-button>
46
                </el-form-item>
47
              </el-col>
48
            </el-row>
49
          </el-form>
50
        </div>
51
        <complex-table :tableData="tableData" :tableItem="tableItem" :total="total" :jump="'resource'" v-on:current="current"
52
          :chartLine=true @showChart="showChart"></complex-table>
53
      </div>
54
    </div>
55
    <el-dialog title="资源流量分析" :visible.sync="ChartItemDialogVisible" width="860px">
56
      <LineChart :chartData="chartOneData"></LineChart>
57
    </el-dialog>
58
  </div>
59
</template>
60
61
<script>
62
  import { pqResourceList, queryTotalView, queryOneView } from '@/api/statistics'
63
  import { parseTime, kexiuUrl } from '@/utils/index'
64
  import complexTable from '@/components/complexTable'
65
  import ret from '@/utils/comTable'
66
  import cacheModule from '@/utils/CrossDomain'
67
  import LineChart from './lineChart/LineChart'
68
  import { dayListFn, chartModel } from './lineChart/chart'
69
70
  export default {
71
    data() {
72
      return {
73
        ChartItemDialogVisible: false,
74
        platform: process.env.PLAT_ID,
75
        formFilter: {
76
          title: '',
77
          creator: '',
78
          dateRange: '',
79
          orderBy: '1'
80
        },
81
        pageSize: 10,
82
        pageNo: 1,
83
        total: 0,
84
        tableData: [],
85
        tableLoading: true,
86
        tableItem: [
87
          {
88
            tit: '图表',
89
            chart: true,
90
            width: 80
91
          },
92
          {
93
            prop: 'resourceName',
94
            tit: '服务名称',
95
            active: 'active'
96
          },
97
          {
98
            prop: 'owner',
99
            tit: '发布者',
100
            width: '160'
101
          },
102
          {
103
            prop: 'createTime',
104
            tit: '发布时间',
105
            width: '160'
106
          },
107
          {
108
            prop: 'sum',
109
            tit: '浏览数量',
110
            width: '160'
111
          }
112
        ],
113
        chartData: [],
114
        chartOneData: [],
115
        beginDate: dayListFn(true)
116
      }
117
    },
118
    components: {
119
      complexTable,
120
      LineChart
121
    },
122
    created() {
123
      this.publishList()
124
      this.getContentTotal()
125
    },
126
    methods: {
127
      getContentTotal() {
128
        this.$http.get(kexiuUrl + queryTotalView, {
129
          tn: 'resource',
130
          platform: this.platform,
131
          bt: this.beginDate
132
        }, (res) => {
133
          var obj = res.data
134
          this.chartData = chartModel(obj)
135
        })
136
      },
137
      filterSearch() {
138
        this.pageNo = 1
139
        this.total = 0
140
        this.tableData = []
141
        this.publishList()
142
      },
143
      publishList() {
144
        var that = this
145
        const form = this.formFilter
146
        let st = ''
147
        let et = ''
148
        if (form.dateRange) {
149
          st = form.dateRange[0]
150
          et = form.dateRange[1]
151
        }
152
        var obj = {
153
          name: form.title,
154
          author: form.creator,
155
          bt: st,
156
          et: et,
157
          orderBy: form.orderBy,
158
          pageSize: this.pageSize,
159
          pageNo: this.pageNo,
160
          platform: this.platform
161
        }
162
        this.$http.get(kexiuUrl + pqResourceList, obj, (response) => {
163
          if (response.success && response.data) {
164
            const res = response.data
165
            const epData = res.data
166
            let j = 0
167
            for (let i = 0; i < epData.length; i++) {
168
              epData[i].createTime = parseTime(epData[i].createTime).substr(0, 16)
169
              epData[i].id = epData[i].resourceId
170
              j++
171
              if (epData[i].resourceType === '1') {
172
                cacheModule.getUserInfo(epData[i].professorId, info => {
173
                  j--
174
                  epData[i].owner = info.name
175
                  if (j === 0) {
176
                    this.total = res.total
177
                    if (epData.length === that.pageSize) {
178
                      this.tableData = epData
179
                    } else {
180
                      const array = epData
181
                      ret.gapFilling(array)
182
                      this.tableData = array
183
                    }
184
                  }
185
                })
186
              } else {
187
                cacheModule.getAgencyInfo(epData[i].orgId, info => {
188
                  j--
189
                  epData[i].owner = info.forShort || info.name
190
                  if (j === 0) {
191
                    this.total = res.total
192
                    if (epData.length === that.pageSize) {
193
                      this.tableData = epData
194
                    } else {
195
                      const array = epData
196
                      ret.gapFilling(array)
197
                      this.tableData = array
198
                    }
199
                  }
200
                })
201
              }
202
            }
203
            if (epData.length === 0) {
204
              this.total = 0
205
              this.tableData = []
206
            }
207
          } else {
208
            this.total = 0
209
            this.tableData = []
210
          }
211
        })
212
      },
213
      current(val) {
214
        this.pageNo = val
215
        this.publishList()
216
      },
217
      changeRangerDate(val) {
218
        this.formFilter.dateRange = val
219
      },
220
      sortChanged(val) {
221
        this.formFilter.orderBy = val
222
      },
223
      showChart(val) {
224
        this.chartOneData = []
225
        this.$http.get(kexiuUrl + queryOneView, {
226
          platform: this.platform,
227
          tn: 'resource',
228
          id: val,
229
          bt: this.beginDate
230
        }, (res) => {
231
          if (res.success) {
232
            this.chartOneData = chartModel(res.data)
233
            this.ChartItemDialogVisible = true
234
          }
235
        })
236
      }
237
    }
238
  }
239
</script>
240
241
<style>
242
  .content-item {
243
    padding: 10px;
244
  }
245
246
  .content-item+.content-item {
247
    border-top: 1px solid #ccc;
248
  }
249
250
  .content-item-tit {
251
    line-height: 30px;
252
  }
253
</style>

+ 227 - 0
src/views/statistics/results.vue

@ -0,0 +1,227 @@
1
<template>
2
  <div class="app-container">
3
    <div class="box-container">
4
      <div class="contain-title">成果数据统计</div>
5
    </div>
6
    <div class="content-container">
7
      <div class="content-item" style="padding-top:0">
8
        <div class="content-item-tit">成果总浏览量统计</div>
9
        <div class="line-chart-box">
10
          <LineChart :chartData="chartData"></LineChart>
11
        </div>
12
      </div>
13
      <div class="content-item">
14
        <div class="content-item-tit">成果浏览量查询</div>
15
        <div class="contain-search" style="margin-top:20px; width:95%">
16
          <el-form :model="formFilter" class="demo-form" label-width="100px">
17
            <el-row :gutter="10">
18
              <el-col :span="12">
19
                <el-form-item label="成果名称:">
20
                  <el-input v-model="formFilter.title" placeholder="搜索成果名称"></el-input>
21
                </el-form-item>
22
              </el-col>
23
              <el-col :span="12">
24
                <el-form-item label="发明人:">
25
                  <el-input v-model="formFilter.creator" placeholder="搜索发明人"></el-input>
26
                </el-form-item>
27
              </el-col>
28
              <el-col :span="12">
29
                <el-form-item label="发布时间:">
30
                  <el-date-picker v-model="formFilter.dateRange" type="daterange" range-separator="至" start-placeholder="开始日期"
31
                    end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyyMMdd" @change="changeRangerDate">
32
                  </el-date-picker>
33
                </el-form-item>
34
              </el-col>
35
              <el-col :span="12">
36
                <el-form-item label="排序方式:">
37
                  <el-select v-model="formFilter.orderBy" placeholder="选择排序方式" @change="sortChanged">
38
                    <el-option label="按创建时间由新到旧排序" value="1"></el-option>
39
                    <el-option label="按浏览量由高到底排序" value="2"></el-option>
40
                  </el-select>
41
                </el-form-item>
42
              </el-col>
43
              <el-col :span="24">
44
                <el-form-item label-width="30px" align="right">
45
                  <el-button type="primary" @click="filterSearch">查询</el-button>
46
                </el-form-item>
47
              </el-col>
48
            </el-row>
49
          </el-form>
50
        </div>
51
        <complex-table :tableData="tableData" :tableItem="tableItem" :total="total" :jump="'result'" v-on:current="current"
52
          :chartLine=true @showChart="showChart"></complex-table>
53
      </div>
54
    </div>
55
    <el-dialog title="成果流量分析" :visible.sync="ChartItemDialogVisible" width="860px">
56
      <LineChart :chartData="chartOneData"></LineChart>
57
    </el-dialog>
58
  </div>
59
</template>
60
61
<script>
62
  import { pqPpatentList, queryTotalView, queryOneView } from '@/api/statistics'
63
  import { parseTime, kexiuUrl } from '@/utils/index'
64
  import complexTable from '@/components/complexTable'
65
  import ret from '@/utils/comTable'
66
  import LineChart from './lineChart/LineChart'
67
  import { dayListFn, chartModel } from './lineChart/chart'
68
69
  export default {
70
    data() {
71
      return {
72
        ChartItemDialogVisible: false,
73
        platform: process.env.PLAT_ID,
74
        formFilter: {
75
          title: '',
76
          creator: '',
77
          dateRange: '',
78
          orderBy: '1'
79
        },
80
        pageSize: 10,
81
        pageNo: 1,
82
        total: 0,
83
        tableData: [],
84
        tableLoading: true,
85
        tableItem: [
86
          {
87
            tit: '图表',
88
            chart: true,
89
            width: 80
90
          },
91
          {
92
            prop: 'name',
93
            tit: '成果名称',
94
            active: 'active'
95
          },
96
          {
97
            prop: 'authors',
98
            tit: '发布者',
99
            width: '160'
100
          },
101
          {
102
            prop: 'createTime',
103
            tit: '发布时间',
104
            width: '160'
105
          },
106
          {
107
            prop: 'sum',
108
            tit: '浏览数量',
109
            width: '160'
110
          }
111
        ],
112
        chartData: [],
113
        chartOneData: [],
114
        beginDate: dayListFn(true)
115
      }
116
    },
117
    components: {
118
      complexTable,
119
      LineChart
120
    },
121
    created() {
122
      this.publishList()
123
      this.getContentTotal()
124
    },
125
    methods: {
126
      getContentTotal() {
127
        this.$http.get(kexiuUrl + queryTotalView, {
128
          tn: 'ppatent',
129
          platform: this.platform,
130
          bt: this.beginDate
131
        }, (res) => {
132
          var obj = res.data
133
          this.chartData = chartModel(obj)
134
        })
135
      },
136
      filterSearch() {
137
        this.pageNo = 1
138
        this.total = 0
139
        this.tableData = []
140
        this.publishList()
141
      },
142
      publishList() {
143
        var that = this
144
        const form = this.formFilter
145
        let st = ''
146
        let et = ''
147
        if (form.dateRange) {
148
          st = form.dateRange[0]
149
          et = form.dateRange[1]
150
        }
151
        var obj = {
152
          name: form.title,
153
          author: form.creator,
154
          bt: st,
155
          et: et,
156
          orderBy: form.orderBy,
157
          pageSize: this.pageSize,
158
          pageNo: this.pageNo,
159
          platform: this.platform
160
        }
161
        this.$http.get(kexiuUrl + pqPpatentList, obj, (response) => {
162
          if (response.success && response.data) {
163
            const res = response.data
164
            const epData = res.data
165
            for (let i = 0; i < epData.length; i++) {
166
              epData[i].createTime = parseTime(epData[i].createTime).substr(0, 16)
167
              epData[i].authors = epData[i].authors.substr(0, epData[i].authors.length - 1)
168
            }
169
            this.total = res.total
170
            if (epData.length === that.pageSize) {
171
              this.tableData = epData
172
            } else {
173
              const array = epData
174
              ret.gapFilling(array)
175
              this.tableData = array
176
            }
177
            if (epData.length === 0) {
178
              this.total = 0
179
              this.tableData = []
180
            }
181
          } else {
182
            this.total = 0
183
            this.tableData = []
184
          }
185
        })
186
      },
187
      current(val) {
188
        this.pageNo = val
189
        this.publishList()
190
      },
191
      changeRangerDate(val) {
192
        this.formFilter.dateRange = val
193
      },
194
      sortChanged(val) {
195
        this.formFilter.orderBy = val
196
      },
197
      showChart(val) {
198
        this.chartOneData = []
199
        this.$http.get(kexiuUrl + queryOneView, {
200
          platform: this.platform,
201
          tn: 'ppatent',
202
          id: val,
203
          bt: this.beginDate
204
        }, (res) => {
205
          if (res.success) {
206
            this.chartOneData = chartModel(res.data)
207
            this.ChartItemDialogVisible = true
208
          }
209
        })
210
      }
211
    }
212
  }
213
</script>
214
215
<style>
216
  .content-item {
217
    padding: 10px;
218
  }
219
220
  .content-item+.content-item {
221
    border-top: 1px solid #ccc;
222
  }
223
224
  .content-item-tit {
225
    line-height: 30px;
226
  }
227
</style>

+ 252 - 0
src/views/statistics/service.vue

@ -0,0 +1,252 @@
1
<template>
2
  <div class="app-container">
3
    <div class="box-container">
4
      <div class="contain-title">服务数据统计</div>
5
    </div>
6
    <div class="content-container">
7
      <div class="content-item" style="padding-top:0">
8
        <div class="content-item-tit">服务总浏览量统计</div>
9
        <div class="line-chart-box">
10
          <LineChart :chartData="chartData"></LineChart>
11
        </div>
12
      </div>
13
      <div class="content-item">
14
        <div class="content-item-tit">服务浏览量查询</div>
15
        <div class="contain-search" style="margin-top:20px; width:95%">
16
          <el-form :model="formFilter" class="demo-form" label-width="100px">
17
            <el-row :gutter="10">
18
              <el-col :span="12">
19
                <el-form-item label="服务名称:">
20
                  <el-input v-model="formFilter.title" placeholder="搜索服务名称"></el-input>
21
                </el-form-item>
22
              </el-col>
23
              <el-col :span="12">
24
                <el-form-item label="发布者:">
25
                  <el-input v-model="formFilter.creator" placeholder="搜索发布者"></el-input>
26
                </el-form-item>
27
              </el-col>
28
              <el-col :span="12">
29
                <el-form-item label="发布时间:">
30
                  <el-date-picker v-model="formFilter.dateRange" type="daterange" range-separator="至" start-placeholder="开始日期"
31
                    end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyyMMdd" @change="changeRangerDate">
32
                  </el-date-picker>
33
                </el-form-item>
34
              </el-col>
35
              <el-col :span="12">
36
                <el-form-item label="排序方式:">
37
                  <el-select v-model="formFilter.orderBy" placeholder="选择排序方式" @change="sortChanged">
38
                    <el-option label="按创建时间由新到旧排序" value="1"></el-option>
39
                    <el-option label="按浏览量由高到底排序" value="2"></el-option>
40
                  </el-select>
41
                </el-form-item>
42
              </el-col>
43
              <el-col :span="24">
44
                <el-form-item label-width="30px" align="right">
45
                  <el-button type="primary" @click="filterSearch">查询</el-button>
46
                </el-form-item>
47
              </el-col>
48
            </el-row>
49
          </el-form>
50
        </div>
51
        <complex-table :tableData="tableData" :tableItem="tableItem" :total="total" :jump="'serve'" v-on:current="current"
52
          :chartLine=true @showChart="showChart"></complex-table>
53
      </div>
54
    </div>
55
    <el-dialog title="服务流量分析" :visible.sync="ChartItemDialogVisible" width="860px">
56
      <LineChart :chartData="chartOneData"></LineChart>
57
    </el-dialog>
58
  </div>
59
</template>
60
61
<script>
62
  import { pqWareList, queryTotalView, queryOneView } from '@/api/statistics'
63
  import { parseTime, kexiuUrl } from '@/utils/index'
64
  import complexTable from '@/components/complexTable'
65
  import ret from '@/utils/comTable'
66
  import cacheModule from '@/utils/CrossDomain'
67
  import LineChart from './lineChart/LineChart'
68
  import { dayListFn, chartModel } from './lineChart/chart'
69
70
  export default {
71
    data() {
72
      return {
73
        ChartItemDialogVisible: false,
74
        platform: process.env.PLAT_ID,
75
        formFilter: {
76
          title: '',
77
          creator: '',
78
          dateRange: '',
79
          orderBy: '1'
80
        },
81
        pageSize: 10,
82
        pageNo: 1,
83
        total: 0,
84
        tableData: [],
85
        tableLoading: true,
86
        tableItem: [
87
          {
88
            tit: '图表',
89
            chart: true,
90
            width: 80
91
          },
92
          {
93
            prop: 'name',
94
            tit: '服务名称',
95
            active: 'active'
96
          },
97
          {
98
            prop: 'owner',
99
            tit: '发布者',
100
            width: '160'
101
          },
102
          {
103
            prop: 'createTime',
104
            tit: '发布时间',
105
            width: '160'
106
          },
107
          {
108
            prop: 'sum',
109
            tit: '浏览数量',
110
            width: '160'
111
          }
112
        ],
113
        chartData: [],
114
        chartOneData: [],
115
        beginDate: dayListFn(true)
116
      }
117
    },
118
    components: {
119
      complexTable,
120
      LineChart
121
    },
122
    created() {
123
      this.publishList()
124
      this.getContentTotal()
125
    },
126
    methods: {
127
      getContentTotal() {
128
        this.$http.get(kexiuUrl + queryTotalView, {
129
          tn: 'ware',
130
          platform: this.platform,
131
          bt: this.beginDate
132
        }, (res) => {
133
          var obj = res.data
134
          this.chartData = chartModel(obj)
135
        })
136
      },
137
      filterSearch() {
138
        this.pageNo = 1
139
        this.total = 0
140
        this.tableData = []
141
        this.publishList()
142
      },
143
      publishList() {
144
        var that = this
145
        const form = this.formFilter
146
        let st = ''
147
        let et = ''
148
        if (form.dateRange) {
149
          st = form.dateRange[0]
150
          et = form.dateRange[1]
151
        }
152
        var obj = {
153
          name: form.title,
154
          author: form.creator,
155
          bt: st,
156
          et: et,
157
          orderBy: form.orderBy,
158
          pageSize: this.pageSize,
159
          pageNo: this.pageNo,
160
          platform: this.platform
161
        }
162
        this.$http.get(kexiuUrl + pqWareList, obj, (response) => {
163
          if (response.success && response.data) {
164
            const res = response.data
165
            const epData = res.data
166
            let j = 0
167
            for (let i = 0; i < epData.length; i++) {
168
              epData[i].createTime = parseTime(epData[i].createTime).substr(0, 16)
169
              j++
170
              if (epData[i].category === '1') {
171
                cacheModule.getUserInfo(epData[i].owner, info => {
172
                  j--
173
                  epData[i].owner = info.name
174
                  if (j === 0) {
175
                    this.total = res.total
176
                    if (epData.length === that.pageSize) {
177
                      this.tableData = epData
178
                    } else {
179
                      const array = epData
180
                      ret.gapFilling(array)
181
                      this.tableData = array
182
                    }
183
                  }
184
                })
185
              } else {
186
                cacheModule.getAgencyInfo(epData[i].owner, info => {
187
                  j--
188
                  epData[i].owner = info.name
189
                  if (j === 0) {
190
                    this.total = res.total
191
                    if (epData.length === that.pageSize) {
192
                      this.tableData = epData
193
                    } else {
194
                      const array = epData
195
                      ret.gapFilling(array)
196
                      this.tableData = array
197
                    }
198
                  }
199
                })
200
              }
201
            }
202
            if (epData.length === 0) {
203
              this.total = 0
204
              this.tableData = []
205
            }
206
          } else {
207
            this.total = 0
208
            this.tableData = []
209
          }
210
        })
211
      },
212
      current(val) {
213
        this.pageNo = val
214
        this.publishList()
215
      },
216
      changeRangerDate(val) {
217
        this.formFilter.dateRange = val
218
      },
219
      sortChanged(val) {
220
        this.formFilter.orderBy = val
221
      },
222
      showChart(val) {
223
        this.chartOneData = []
224
        this.$http.get(kexiuUrl + queryOneView, {
225
          platform: this.platform,
226
          tn: 'ware',
227
          id: val,
228
          bt: this.beginDate
229
        }, (res) => {
230
          if (res.success) {
231
            this.chartOneData = chartModel(res.data)
232
            this.ChartItemDialogVisible = true
233
          }
234
        })
235
      }
236
    }
237
  }
238
</script>
239
240
<style>
241
  .content-item {
242
    padding: 10px;
243
  }
244
245
  .content-item+.content-item {
246
    border-top: 1px solid #ccc;
247
  }
248
249
  .content-item-tit {
250
    line-height: 30px;
251
  }
252
</style>