Analysis.vue 15 KB

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