Analysis.vue 14 KB

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