Analysis.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483
  1. <style lang='scss'>
  2. .only-there .ant-tabs-bar{
  3. background: white;
  4. padding: 0 24px;
  5. }
  6. .ant-card-head .ant-tabs-bar{
  7. padding: 0;
  8. }
  9. #updateInfo .ant-modal-content,#updateInfo .ant-modal-body {
  10. width: 500px;
  11. position: relative;
  12. padding-top:10px;
  13. .updateBOX{
  14. height: 600px;
  15. overflow: auto;
  16. }
  17. }
  18. .Updatecontent{
  19. padding: 0 20px 40px;
  20. position: relative;
  21. .Updateitem{
  22. margin-bottom: 30px;
  23. }
  24. }
  25. .Updatetitle{
  26. text-align: center;
  27. font-size: 22px;
  28. font-weight: 500;
  29. color: #1890ff;
  30. margin-bottom: 20px;
  31. /* margin-top: 20px; */
  32. }
  33. .Updatetime{
  34. font-size: 16px;
  35. font-weight: 700;
  36. color: #000;
  37. margin-bottom: 15px;
  38. }
  39. .updateicon{
  40. font-size: 26px;
  41. position: relative;
  42. top: 4px;;
  43. }
  44. .updateSpan{
  45. margin-left: 10px;
  46. }
  47. .textTitle{
  48. font-weight: 600;
  49. font-size: 1.17em;
  50. font-family:Helvetica,Arial,"\5b8b\4f53",sans-serif;
  51. }
  52. .okBtn{
  53. position: absolute;
  54. right: 3%;
  55. bottom: 3%;
  56. }
  57. .updatelist{
  58. .circular{
  59. display: inline-block;
  60. width: 3px;
  61. height: 3px;
  62. border-radius: 50%;
  63. color: #999;
  64. }
  65. }
  66. </style>
  67. <template>
  68. <div class="page-header-index-wide analysis">
  69. <!-- -->
  70. <div v-if="roleCode == 'operator'">
  71. <a-row :gutter="24">
  72. <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
  73. <chart-card :loading="loading" title="总销售额" total="¥126,560">
  74. <a-tooltip title="指标说明" slot="action">
  75. <a-icon type="info-circle-o" />
  76. </a-tooltip>
  77. <div>
  78. <trend flag="up" style="margin-right: 16px;">
  79. <span slot="term">周同比</span>
  80. 12%
  81. </trend>
  82. <trend flag="down">
  83. <span slot="term">日同比</span>
  84. 11%
  85. </trend>
  86. </div>
  87. <template slot="footer">
  88. 日均销售额
  89. <span>¥ 234.56</span>
  90. </template>
  91. </chart-card>
  92. </a-col>
  93. <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
  94. <chart-card :loading="loading" title="访问量" :total="8846 | NumberFormat">
  95. <a-tooltip title="指标说明" slot="action">
  96. <a-icon type="info-circle-o" />
  97. </a-tooltip>
  98. <div>
  99. <mini-area />
  100. </div>
  101. <template slot="footer">
  102. 日访问量
  103. <span>{{ '1234' | NumberFormat }}</span>
  104. </template>
  105. </chart-card>
  106. </a-col>
  107. <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
  108. <chart-card :loading="loading" title="支付笔数" :total="6560 | NumberFormat">
  109. <a-tooltip title="指标说明" slot="action">
  110. <a-icon type="info-circle-o" />
  111. </a-tooltip>
  112. <div>
  113. <mini-bar :height="40" />
  114. </div>
  115. <template slot="footer">
  116. 转化率
  117. <span>60%</span>
  118. </template>
  119. </chart-card>
  120. </a-col>
  121. <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
  122. <chart-card :loading="loading" title="运营活动效果" total="78%">
  123. <a-tooltip title="指标说明" slot="action">
  124. <a-icon type="info-circle-o" />
  125. </a-tooltip>
  126. <div>
  127. <mini-progress color="rgb(19, 194, 194)" :target="80" :percentage="78" :height="8" />
  128. </div>
  129. <template slot="footer">
  130. <trend flag="down" style="margin-right: 16px;">
  131. <span slot="term">同周比</span>
  132. 12%
  133. </trend>
  134. <trend flag="up">
  135. <span slot="term">日环比</span>
  136. 80%
  137. </trend>
  138. </template>
  139. </chart-card>
  140. </a-col>
  141. </a-row>
  142. <a-card :loading="loading" :bordered="false" :body-style="{ padding: '0' }">
  143. <div class="salesCard">
  144. <a-tabs default-active-key="1" size="large" :tab-bar-style="{ marginBottom: '24px', paddingLeft: '16px' }">
  145. <div class="extra-wrapper" slot="tabBarExtraContent">
  146. <div class="extra-item">
  147. <a>今日</a>
  148. <a>本周</a>
  149. <a>本月</a>
  150. <a>本年</a>
  151. </div>
  152. <a-range-picker :style="{ width: '256px' }" />
  153. </div>
  154. <a-tab-pane loading="true" tab="销售额" key="1">
  155. <a-row>
  156. <a-col :xl="16" :lg="12" :md="12" :sm="24" :xs="24">
  157. <bar title="销售额排行" :dataSource="barData" />
  158. </a-col>
  159. <a-col :xl="8" :lg="12" :md="12" :sm="24" :xs="24">
  160. <rank-list title="门店销售排行榜" :list="rankList" />
  161. </a-col>
  162. </a-row>
  163. </a-tab-pane>
  164. <a-tab-pane tab="访问量" key="2">
  165. <a-row>
  166. <a-col :xl="16" :lg="12" :md="12" :sm="24" :xs="24">
  167. <bar title="销售额趋势" :dataSource="barData" />
  168. </a-col>
  169. <a-col :xl="8" :lg="12" :md="12" :sm="24" :xs="24">
  170. <rank-list title="门店销售排行榜" :list="rankList" />
  171. </a-col>
  172. </a-row>
  173. </a-tab-pane>
  174. </a-tabs>
  175. </div>
  176. </a-card>
  177. <a-row>
  178. <a-col :span="24">
  179. <a-card :loading="loading" :bordered="false" title="最近一周访问次数统计" :style="{ marginTop: '24px' }">
  180. <a-row>
  181. <a-col :span="6">
  182. <head-info title="今日访问IP数" :content="loginfo.todayIp"></head-info>
  183. </a-col>
  184. <a-col :span="2">
  185. <a-spin class="circle-cust">
  186. <a-icon slot="indicator" type="environment" style="font-size: 24px" />
  187. </a-spin>
  188. </a-col>
  189. <a-col :span="6">
  190. <head-info title="今日访问次数" :content="loginfo.todayVisitCount"></head-info>
  191. </a-col>
  192. <a-col :span="2">
  193. <a-spin class="circle-cust">
  194. <a-icon slot="indicator" type="team" style="font-size: 24px" />
  195. </a-spin>
  196. </a-col>
  197. <a-col :span="6">
  198. <head-info title="访问总次数" :content="loginfo.totalVisitCount"></head-info>
  199. </a-col>
  200. <a-col :span="2">
  201. <a-spin class="circle-cust">
  202. <a-icon slot="indicator" type="rise" style="font-size: 24px" />
  203. </a-spin>
  204. </a-col>
  205. </a-row>
  206. <line-chart-multid :fields="visitFields" :dataSource="visitInfo"></line-chart-multid>
  207. </a-card>
  208. </a-col>
  209. </a-row>
  210. </div>
  211. <managerStatistics v-else-if="userInfoId || roleCode == 'CompanyManager'"/>
  212. <newHome v-else-if=" roleCode == 'touTiaoOperationManager'" />
  213. <statistics v-else-if="roleCode == 'kuaishouOperationManager'" />
  214. <statistics v-else-if="roleCode == 'sale'||roleCode=='saleDirector'" />
  215. <Workbench v-else-if="roleCode == 'clip'" />
  216. <Workbench v-else-if="roleCode == 'plane'" />
  217. <!-- <a-tabs default-active-key="1" v-else-if="roleCode == 'admin'" class="only-there">
  218. <a-tab-pane key="1" tab="快手">
  219. <statistics />
  220. </a-tab-pane>
  221. <a-tab-pane key="2" tab="头条">
  222. <newHome />
  223. </a-tab-pane>
  224. </a-tabs> -->
  225. <!-- 更新公告 -->
  226. <a-modal v-model="visible" title="" @ok="handleOk" :closable='false' :footer="null" id="updateInfo">
  227. <div class="updateBOX">
  228. <div class="Updatetitle">
  229. <a-icon type="notification" theme='twoTone'/> 更新通告
  230. </div>
  231. <div class="Updatecontent">
  232. <div class="Updateitem">
  233. <div class="Updatetime">
  234. <a-icon type="dashboard" theme='twoTone' class="updateicon" />
  235. <span class="updateSpan">{{updateTime[0]}}</span>
  236. </div>
  237. <div class="updateText">
  238. <div class="updateBox">
  239. <h3 class="textTitle">1.新功能上线</h3>
  240. <ul class="updatelist">
  241. <li><span class="circular"></span>组织架构;增加汇报上级、部门领导</li>
  242. <li><span class="circular"></span>自动投放账户配置回显问题;</li>
  243. <li><span class="circular"></span>批量创建-销售线索优化;</li>
  244. <li><span class="circular"></span>优化快手素材报表接口查询效率;</li>
  245. </ul>
  246. </div>
  247. <!-- <div class="updateBox">
  248. <h3 class="textTitle">2.功能优化:</h3>
  249. <ul>
  250. <li><span class="circular"></span>修复了相关BUG;</li>
  251. </ul>
  252. </div> -->
  253. </div>
  254. </div>
  255. </div>
  256. <a-button type='primary' class="okBtn" @click="handleOk">知道了</a-button>
  257. </div>
  258. </a-modal>
  259. </div>
  260. </template>
  261. <script>
  262. import ChartCard from '@/components/ChartCard'
  263. import ACol from 'ant-design-vue/es/grid/Col'
  264. import ATooltip from 'ant-design-vue/es/tooltip/Tooltip'
  265. import MiniArea from '@/components/chart/MiniArea'
  266. import MiniBar from '@/components/chart/MiniBar'
  267. import MiniProgress from '@/components/chart/MiniProgress'
  268. import RankList from '@/components/chart/RankList'
  269. import Bar from '@/components/chart/Bar'
  270. import LineChartMultid from '@/components/chart/LineChartMultid'
  271. import HeadInfo from '@/components/tools/HeadInfo.vue'
  272. import { getAction, postAction, downFile, downFilePost } from '@/api/manage';
  273. import { mapActions, mapGetters } from 'vuex'
  274. import Trend from '@/components/Trend'
  275. import managerStatistics from './managerStatistics'
  276. import {
  277. getLoginfo,
  278. getVisitInfo
  279. } from '@/api/api'
  280. import newHome from '@/views/modules/Statistics/newHome.vue'
  281. import Workbench from '@/views/dashboard/Workbench.vue'
  282. import Statistics from '@/views/modules/Statistics/Statistics.vue'
  283. const rankList = []
  284. for (let i = 0; i < 7; i++) {
  285. rankList.push({
  286. name: '白鹭岛 ' + (i + 1) + ' 号店',
  287. total: 1234.56 - i * 100
  288. })
  289. }
  290. const barData = []
  291. for (let i = 0; i < 12; i += 1) {
  292. barData.push({
  293. x: `${i + 1}月`,
  294. y: Math.floor(Math.random() * 1000) + 200
  295. })
  296. }
  297. export default {
  298. name: 'Analysis',
  299. components: {
  300. ATooltip,
  301. ACol,
  302. ChartCard,
  303. MiniArea,
  304. MiniBar,
  305. MiniProgress,
  306. RankList,
  307. Bar,
  308. Trend,
  309. LineChartMultid,
  310. HeadInfo,
  311. newHome,
  312. Workbench,
  313. Statistics,
  314. managerStatistics
  315. },
  316. data() {
  317. return {
  318. loading: true,
  319. center: null,
  320. rankList,
  321. barData,
  322. loginfo: {},
  323. visitFields: ['ip', 'visit'],
  324. visitInfo: [],
  325. indicator: <a-icon type="loading" style="font-size: 24px" spin />,
  326. roleCode: localStorage.getItem('roleCode'),
  327. visible:false,//更新通知消息提示框
  328. updateTime:['2021-03-03'],
  329. versionId:0,//存储版本号 判断通知什么时候显示
  330. userInfoId:false,
  331. }
  332. },
  333. created() {
  334. setTimeout(() => {
  335. this.loading = !this.loading
  336. }, 1000)
  337. this.initLogInfo()
  338. },
  339. methods: {
  340. ...mapGetters(['userInfo']),
  341. getUserId(){
  342. if (this.userInfo().id == '4aba62011120ac565c7f2b9f8f4aa96b' || this.userInfo().id == 'e9ca23d68d884d4ebb19d07889727dae' || this.userInfo().id == 'db2d59e9b4a3b18629c838fd7f5b58d8') {
  343. this.userInfoId = true;
  344. }else{
  345. this.userInfoId = false;
  346. }
  347. },
  348. // 跳转数据看板
  349. dataKanBan(){
  350. const a = document.createElement('a');
  351.                     document.body.appendChild(a);
  352.                     a.style.display = 'none';
  353.                     a.href = 'http://adsp.c-top.com.cn/boss-data-kanban';
  354. a.target = '_blank'
  355.                     a.click();
  356.                     document.body.removeChild(a);
  357. },
  358. initLogInfo() {
  359. getLoginfo(null).then(res => {
  360. if (res.success) {
  361. Object.keys(res.result).forEach(key => {
  362. res.result[key] = res.result[key] + ''
  363. })
  364. this.loginfo = res.result
  365. }
  366. })
  367. getVisitInfo().then(res => {
  368. if (res.success) {
  369. console.log('aaaaaa', res.result)
  370. this.visitInfo = res.result
  371. }
  372. })
  373. },
  374. handleOk(e) {
  375. // console.log(e);
  376. this.visible = false;
  377. postAction('/ctop/releaseViewRecord/view', {
  378. versionId:this.versionId
  379. }).then(res => {
  380. console.log(res)
  381. if(res.success){
  382. // this.visible=res.showPopup;
  383. }
  384. })
  385. },
  386. },
  387. mounted() {
  388. postAction('/ctop/releaseViewRecord/check', {}).then(res => {
  389. console.log(res)
  390. if(res.success){
  391. this.visible=res.showPopup;
  392. if(res.data){
  393. this.versionId=res.data.id;
  394. }
  395. }
  396. })
  397. this.getUserId();
  398. },
  399. }
  400. </script>
  401. <style lang="scss" scoped>
  402. .circle-cust {
  403. position: relative;
  404. top: 28px;
  405. left: -100%;
  406. }
  407. .extra-wrapper {
  408. line-height: 55px;
  409. padding-right: 24px;
  410. .extra-item {
  411. display: inline-block;
  412. margin-right: 24px;
  413. a {
  414. margin-left: 24px;
  415. }
  416. }
  417. }
  418. /* 首页访问量统计 */
  419. .head-info {
  420. position: relative;
  421. text-align: left;
  422. padding: 0 32px 0 0;
  423. min-width: 125px;
  424. &.center {
  425. text-align: center;
  426. padding: 0 32px;
  427. }
  428. span {
  429. color: rgba(0, 0, 0, 0.45);
  430. display: inline-block;
  431. font-size: 0.95rem;
  432. line-height: 42px;
  433. margin-bottom: 4px;
  434. }
  435. p {
  436. line-height: 42px;
  437. margin: 0;
  438. a {
  439. font-weight: 600;
  440. font-size: 1rem;
  441. }
  442. }
  443. }
  444. </style>
  445. <style lang="less">
  446. .analysis .ant-tabs-bar {
  447. margin: 0 0 12px 0;
  448. /* height: 55px; */
  449. border-bottom: 1px solid #e8e8e8;
  450. outline: none;
  451. -webkit-transition: padding 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
  452. transition: padding 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
  453. }
  454. </style>