synthesize.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436
  1. <template>
  2. <rx-layout>
  3. <div slot="center" style>
  4. <rx-fit>
  5. <div slot="toolheader" border="false" foldbtn="false">
  6. <top-nav @callBack="freshData" title="综合统计" :time="timeData"></top-nav>
  7. </div>
  8. <div class="echart-style">
  9. <div style="width:58%;">
  10. <div>用户访问总量-{{barDataNum}}
  11. <span>(uv)</span>
  12. </div>
  13. <line-echart @setbarDataNum="setbarDataNum" ref="lineEchart"></line-echart>
  14. </div>
  15. <div style="width:40%;">
  16. <div style="width:90%;z-index: 10;">
  17. 各版块访问量分布
  18. <span>(pv)</span>
  19. <pieChange ref="pieChange" @typeChange="typeChange"></pieChange>
  20. </div>
  21. <rose-echart v-if="peitype!=2" :roseData="roseData"></rose-echart>
  22. <pie-echart v-else :pieData="pieData" :pieDataTitleLeft="pieDataTitleLeft" :pieDataTitleRight="pieDataTitleRight"></pie-echart>
  23. </div>
  24. </div>
  25. <div class="card-style">
  26. <little-card title="知识地图访问量(uv)" :num="dataNum.map" :picture="mapPicture"></little-card>
  27. <little-card title="知识专辑访问量(uv)" :num="dataNum.album" :picture="albumPicture"></little-card>
  28. <little-card title="知识仓库访问量(uv)" :num="dataNum.knowledge" :picture="warehousePicture"></little-card>
  29. <little-card title="搜索服务访问量(uv)" :num="dataNum.search" :picture="searchPicture"></little-card>
  30. </div>
  31. <div class="bar-style">
  32. <div>
  33. 员工访问总量统计
  34. </div>
  35. <div class="staff-style">
  36. <a-form ref="searchForm" layout="inline" class="staff-form">
  37. <a-form-item class="form-item-style" style="width:240px;" label="查询选项" name="staff">
  38. <!-- <a-input class="set-input" v-model="staffForm.staff" placeholder="请选择要查询的员工" /> -->
  39. <div @click="handleAuditShow(1)" @mouseover="mouseOver(1)" @mouseleave="mouseLeave">
  40. <div v-if="iconShowOne" style="position:absolute;z-index: 10;right:8px;cursor:pointer;" @click.stop="handleCloseClick(1)">
  41. <a-icon type="close-circle" theme="filled" style="color: rgba(0,0,0,.25)" />
  42. </div>
  43. <a-select
  44. v-model="staffName"
  45. :showArrow="false"
  46. :open="false"
  47. placeholder="请选择查询的员工"
  48. ></a-select>
  49. </div>
  50. </a-form-item>
  51. <a-form-item class="form-item-style" style="width:40%;" label="时间范围" name="staffTime">
  52. <a-range-picker
  53. v-model="staffTime"
  54. class="set-range-picker"
  55. separator="→"
  56. format="YYYY/MM/DD"
  57. valueFormat="YYYY-MM-DD"
  58. >
  59. </a-range-picker>
  60. </a-form-item>
  61. <div class="staff-button">
  62. <a-button style="margin-right: 8px;" @click="handleResetClick(1)">重置</a-button>
  63. <a-button type="primary" @click="handleSearchClick(1)">查询</a-button>
  64. </div>
  65. </a-form>
  66. </div>
  67. <bar-echart-one isOrg="1" :barXData="barXUserData" :barData="barUserDataNew" @downloadClick="downloadClick"></bar-echart-one>
  68. </div>
  69. <div class="bar-style">
  70. <div>
  71. 组织访问总量统计
  72. </div>
  73. <div class="staff-style">
  74. <a-form ref="searchForm" layout="inline" class="staff-form">
  75. <a-form-item class="form-item-style" style="width:240px;" label="查询选项" name="staff">
  76. <!-- <a-input class="set-input" v-model="staffForm.staff" placeholder="请选择要查询的员工" /> -->
  77. <div style="position:relative;" @click="handleAuditShow(2)" @mouseover="mouseOver(2)" @mouseleave="mouseLeave">
  78. <div v-if="iconShowTwo" style="position:absolute;z-index: 10;right:8px;cursor:pointer;" @click.stop="handleCloseClick(2)">
  79. <a-icon type="close-circle" theme="filled" style="color: rgba(0,0,0,.25)" />
  80. </div>
  81. <a-select
  82. v-model="orgName"
  83. :showArrow="false"
  84. :open="false"
  85. placeholder="请选择查询的组织"
  86. ></a-select>
  87. </div>
  88. </a-form-item>
  89. <a-form-item class="form-item-style" style="width:40%;" label="时间范围" name="staffTime">
  90. <a-range-picker
  91. v-model="orgTime"
  92. class="set-range-picker"
  93. separator="→"
  94. format="YYYY/MM/DD"
  95. valueFormat="YYYY-MM-DD"
  96. >
  97. </a-range-picker>
  98. </a-form-item>
  99. <div class="staff-button">
  100. <a-button style="margin-right: 8px;" @click="handleResetClick(2)">重置</a-button>
  101. <a-button type="primary" @click="handleSearchClick(2)">查询</a-button>
  102. </div>
  103. </a-form>
  104. </div>
  105. <bar-echart-one isOrg="2" :barXData="barXOrgData" :barData="barOrgDataNew" @downloadClick="downloadClick"></bar-echart-one>
  106. </div>
  107. <div class="table-style">
  108. <div>
  109. 组织访问量
  110. </div>
  111. <!--<rx-grid
  112. ref="table"
  113. style="background: #fff;min-height: 400px;"
  114. :columns="columns"
  115. :url="statistics.organizationVisits"
  116. :queryParam="queryParam"
  117. data-field="result.data"
  118. :heightAuto="true"
  119. :showPage="false"
  120. idField="pkId"
  121. >
  122. </rx-grid>-->
  123. <DataShow :type="type" interface="0"></DataShow>
  124. </div>
  125. </rx-fit>
  126. <a-modal
  127. v-model="showAuditFlag"
  128. class="chooseAuthor"
  129. width="800"
  130. :title="isOrgOrUser == 1 ? '员工选择' : '组织选择'"
  131. centered
  132. okText="保存"
  133. @ok="handleSaveOk"
  134. >
  135. <org-people
  136. ref="orgModalRef"
  137. :isOnlyOrg="isOrgOrUser == 1 ? true : false"
  138. :key="new Date().getTime()"
  139. ></org-people>
  140. </a-modal>
  141. </div>
  142. </rx-layout>
  143. </template>
  144. <script>
  145. import topNav from './components/topNav'
  146. import pieChange from './components/pieChange'
  147. import lineEchart from './components/LineEchart';
  148. import roseEchart from './components/RoseEchart';
  149. import barEchartOne from './components/BarEchartOne';
  150. import littleCard from './components/card';
  151. import mapPicture from '@/assets/img/map.png'
  152. import albumPicture from '@/assets/img/album.png'
  153. import warehousePicture from '@/assets/img/warehouse.png'
  154. import searchPicture from '@/assets/img/search.png'
  155. import statistics from '@/api/knowledge/statistics'
  156. import pieEchart from './components/PieEchart';
  157. import DataShow from './components/DataShow';
  158. import orgPeople from './components/orgPeople'
  159. import mixin from "./sMixin/statisticsMixin"
  160. const personMixin = new mixin('personVisit')
  161. export default {
  162. name: 'synthesize',
  163. components: {
  164. topNav,
  165. lineEchart,
  166. roseEchart,
  167. littleCard,
  168. barEchartOne,
  169. pieEchart,
  170. pieChange,
  171. DataShow,
  172. orgPeople
  173. },
  174. mixins:[ personMixin ],
  175. data() {
  176. return {
  177. peitype:0,
  178. barDataNum:0,
  179. dataNum:{
  180. map:0,
  181. album:0,
  182. knowledge:0,
  183. search:0
  184. },
  185. type:'month',
  186. name: 1,
  187. timeData:'',
  188. statistics,
  189. mapPicture,
  190. albumPicture,
  191. warehousePicture,
  192. searchPicture,
  193. roseData: [],
  194. queryParam: {
  195. type:'month'
  196. },
  197. columns: [
  198. {
  199. title: '公司名称',
  200. dataIndex: 'company',
  201. align: 'center',
  202. },
  203. {
  204. title: '总访问量',
  205. dataIndex: 'total',
  206. align: 'center',
  207. sorter: true,
  208. sortField: 'total'
  209. },
  210. {
  211. title: '知识仓库访问量',
  212. dataIndex: 'knowledge',
  213. align: 'center',
  214. sorter: true,
  215. sortField: 'knowledge'
  216. },
  217. {
  218. title: '知识专辑访问量',
  219. dataIndex: 'album',
  220. align: 'center',
  221. sorter: true,
  222. sortField: 'album'
  223. },
  224. {
  225. title: '知识地图访问量',
  226. dataIndex: 'map',
  227. align: 'center',
  228. sorter: true,
  229. sortField: 'map'
  230. },
  231. {
  232. title: '搜索服务访问量',
  233. dataIndex: 'search',
  234. align: 'center',
  235. sorter: true,
  236. sortField: 'search'
  237. },
  238. ]
  239. }
  240. },
  241. mounted() {
  242. document.getElementsByClassName('ant-form-item-control-wrapper')[0].style.width = '70%'
  243. document.getElementsByClassName('ant-form-item-control-wrapper')[2].style.width = '70%'
  244. this.gettotalUserVisits()
  245. this.getmoduleUserVisits();
  246. this.getmoduleUserUniqueVisits();
  247. this.timeData = statistics.getNowDate()
  248. this.$refs.pieChange.changeType(1)
  249. },
  250. methods: {
  251. typeChange(data){
  252. this.peitype=data
  253. },
  254. //刷新数据
  255. freshData(data){
  256. this.type = data
  257. this.gettotalUserVisits()
  258. this.getmoduleUserVisits();
  259. this.getmoduleUserUniqueVisits();
  260. this.handleSearchClick(1)
  261. this.handleSearchClick(2)
  262. this.queryParam.type=data
  263. this.$nextTick(()=>{
  264. this.$refs.table.loadData();
  265. })
  266. this.timeData = statistics.getNowDate()
  267. },
  268. //用户访问总量
  269. gettotalUserVisits(){
  270. this.$nextTick(()=>{
  271. this.$refs.lineEchart.gettotalUserVisits({module: 'total',type:this.type})
  272. })
  273. },
  274. setbarDataNum(data){
  275. this.barDataNum=data
  276. },
  277. //各板块访问量分布
  278. getmoduleUserVisits(){
  279. //this.$refs.pieChange.changeType(1)
  280. //this.peitype=0
  281. statistics.moduleUserVisits({type:this.type}).then(res => {
  282. this.roseData = [
  283. { value: res.data.knowledge, name: Math.floor(res.data.knowledgePercentage*100)+'% 知识仓库' },
  284. { value: res.data.map, name: Math.floor(res.data.mapPercentage*100)+'% 知识地图' },
  285. { value: res.data.album, name: Math.floor(res.data.albumPercentage*100)+'% 知识专辑' },
  286. { value: res.data.search, name: Math.floor(res.data.searchPercentage*100)+'% 搜索服务' }
  287. ]
  288. this.pieData=[
  289. { value: res.data.knowledge, name: '知识仓库' },
  290. { value: res.data.map, name: '知识地图' },
  291. { value: res.data.album, name: '知识专辑' },
  292. { value: res.data.search, name: '搜索服务' }
  293. ]
  294. this.pieDataTitleLeft=['知识仓库','知识地图','知识专辑','搜索服务']
  295. })
  296. },
  297. //各板块访问量分布(UV)
  298. getmoduleUserUniqueVisits(){
  299. statistics.moduleUserUniqueVisits({module: 'total',type:this.type}).then(res => {
  300. this.dataNum = res.data
  301. })
  302. }
  303. }
  304. }
  305. </script>
  306. <style lang="less" scoped>
  307. @gary: #f8f8f8;
  308. @white: #fff;
  309. .rx-fit {
  310. padding: 20px 40px!important;
  311. background: @gary;
  312. overflow-y: auto!important;
  313. display: block!important;
  314. .echart-style {
  315. width: 100%;
  316. height: 320px;
  317. display: flex;
  318. justify-content: space-between;
  319. margin: 10px 0 20px;
  320. >div {
  321. background-color: #fff;
  322. position: relative;
  323. display: flex;
  324. align-items: flex-end;
  325. >div:first-child {
  326. position: absolute;
  327. top: 8%;
  328. left: 4%;
  329. font-weight: bold;
  330. span {
  331. position: absolute;
  332. top: 25%;
  333. font-size: 12px;
  334. font-weight: 400;
  335. margin-left: 8px;
  336. }
  337. }
  338. }
  339. }
  340. .card-style {
  341. width: 100%;
  342. display: flex;
  343. justify-content: space-between;
  344. }
  345. .bar-style {
  346. height: 400px;
  347. background:#fff;
  348. position: relative;
  349. display: flex;
  350. align-items: flex-end;
  351. margin: 10px 0 20px;
  352. >div:first-child {
  353. position: absolute;
  354. top: 8%;
  355. left: 2.3%;
  356. font-weight: bold;
  357. }
  358. .staff-style {
  359. height: 60px;
  360. width: 75%;
  361. position: absolute;
  362. top: 4.7%;
  363. left: 15%;
  364. z-index: 100;
  365. display: flex;
  366. align-items: center;
  367. justify-content:flex-start;
  368. .staff-form {
  369. display: flex;
  370. flex-wrap: wrap;
  371. justify-content:flex-start;
  372. }
  373. .staff-button {
  374. display: flex;
  375. height: 40px;
  376. align-items:flex-start;
  377. justify-content: center;
  378. margin-top: 4px;
  379. }
  380. }
  381. }
  382. .table-style {
  383. display: inline-block;
  384. width: 100%;
  385. background-color: #fff;
  386. margin-top: 20px;
  387. padding: 20px 30px;
  388. >div:first-child {
  389. position: relative;
  390. font-weight: bold;
  391. margin-bottom: 20px;
  392. span {
  393. position: absolute;
  394. top: 25%;
  395. font-size: 12px;
  396. font-weight: 400;
  397. margin-left: 8px;
  398. }
  399. }
  400. }
  401. }
  402. </style>
  403. <style scoped>
  404. /deep/ .divdefault {
  405. position: inherit!important;
  406. overflow: inherit!important;
  407. }
  408. /deep/ .gridContent{
  409. border: none;
  410. }
  411. /deep/.ant-table-thead > tr > th {
  412. text-align: center;
  413. height: 54px;
  414. }
  415. /deep/ .ant-table-tbody > tr > td {
  416. height: 54px;
  417. }
  418. .chooseAuthor /deep/.ant-modal-body {
  419. padding: 0px;
  420. }
  421. </style>