IndexChart2.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580
  1. <template>
  2. <div class="page-header-index-wide">
  3. <a-row :gutter="24">
  4. <a-col :sm="24" :md="24" :xl="24" :style="{ marginBottom: '12px' }">
  5. <a-card :loading="loading" :bordered="false">
  6. <template v-slot:title><a-icon type="tags" theme="twoTone"/>系统公告</template>
  7. <a slot="extra" @click="showMoreMsg">更多>></a>
  8. <a-table :dataSource="announcementList" size="small" rowKey="id" :columns="columns" :pagination="false">
  9. </a-table>
  10. </a-card>
  11. </a-col>
  12. <!-- <a-col :sm="24" :md="12" :xl="12" :style="{ marginBottom: '24px' }">-->
  13. <!-- <a-card :loading="loading" :bordered="false">-->
  14. <!-- <template v-slot:title><a-icon type="tags" theme="twoTone"/>部门公告</template>-->
  15. <!-- <a slot="extra" @click="showMoreMsg">更多>></a>-->
  16. <!-- <a-table :dataSource="announcementList" size="small" rowKey="id" :columns="columns" :pagination="false">-->
  17. <!-- </a-table>-->
  18. <!-- </a-card>-->
  19. <!-- </a-col>-->
  20. </a-row>
  21. <a-card :loading="loading" :bordered="false" :body-style="{padding: '0'}">
  22. <template v-if="isManager">
  23. <a-col :sm="24" :md="12" :xl="8" :style="{ marginBottom: '12px' }">
  24. <a-card :loading="loading" :bordered="true" :style="{ margin: '12px' }">
  25. <template v-slot:title><a-icon type="tags" theme="twoTone"/>最新动态</template>
  26. <a slot="extra" @click="showMoreTaskLeader">更多>></a>
  27. <template v-if="recentWorkList && recentWorkList.length === 0">
  28. <a-empty />
  29. </template>
  30. <template v-else>
  31. <a-timeline>
  32. <a-timeline-item v-for="recent in recentWorkList">{{recent.createTime}} {{recent.realname}}提交了【{{recent.customerName}}】的资料</a-timeline-item>
  33. </a-timeline>
  34. </template>
  35. </a-card>
  36. </a-col>
  37. <a-col :sm="24" :md="12" :xl="8" :style="{ marginBottom: '24px' }">
  38. <a-card :loading="loading" :bordered="true" :style="{ margin: '12px' }">
  39. <template v-slot:title><a-icon type="tags" theme="twoTone"/>我的任务</template>
  40. <a slot="extra" @click="showMoreTaskLeader">更多>></a>
  41. <template v-if="subTaskWorkList && subTaskWorkList.length === 0">
  42. <a-empty />
  43. </template>
  44. <template v-else>
  45. <a-table :dataSource="subTaskWorkList" size="small" rowKey="id" :columns="subTaskWorkColumns" :pagination="false">
  46. <template v-slot:taskCheck="text, record">
  47. <a @click="taskCheckLeader(record)">稽核</a>
  48. </template>
  49. </a-table>
  50. </template>
  51. </a-card>
  52. </a-col>
  53. <a-col :sm="24" :md="12" :xl="8" :style="{ marginBottom: '24px' }">
  54. <a-card :loading="loading" :bordered="true" :style="{ margin: '12px' }">
  55. <template v-slot:title><a-icon type="tags" theme="twoTone"/>本月目标</template>
  56. <a slot="extra" @click="showMoreTaskLeader">更多>></a>
  57. <template v-if="targetWorkObj.allCount > 0">
  58. <a-descriptions size="small" bordered :column="1">
  59. <a-descriptions-item label="总数">{{ targetWorkObj.allCount }}</a-descriptions-item>
  60. <a-descriptions-item label="未完善">{{ targetWorkObj.undoCount }}</a-descriptions-item>
  61. <a-descriptions-item label="待稽核">{{ targetWorkObj.uncheckCount }}</a-descriptions-item>
  62. <a-descriptions-item label="待整改">{{ targetWorkObj.checkedCount }}</a-descriptions-item>
  63. <a-descriptions-item label="通过">{{ targetWorkObj.doneCount }}</a-descriptions-item>
  64. </a-descriptions>
  65. </template>
  66. <template v-else>
  67. <a-empty />
  68. </template>
  69. </a-card>
  70. </a-col>
  71. <a-col :sm="24" :md="24" :xl="24" :style="{ marginBottom: '24px' }">
  72. <a-table size="small" :style="{ margin: '0px 12px 0px 12px' }"
  73. :dataSource="mainTaskList"
  74. rowKey="id"
  75. :columns="taskColumns"
  76. :customRow="customRow"
  77. :rowSelection="{type:'checkbox',selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  78. :pagination="false">
  79. </a-table>
  80. </a-col>
  81. </template>
  82. <template v-else>
  83. <a-col :sm="24" :md="12" :xl="8" :style="{ marginBottom: '12px' }">
  84. <a-card :loading="loading" :bordered="true" :style="{ margin: '12px' }">
  85. <template v-slot:title><a-icon type="tags" theme="twoTone"/>最新动态</template>
  86. <a slot="extra" @click="showMoreTaskManager">更多>></a>
  87. <template v-if="recentInfoList && recentInfoList.length === 0">
  88. <a-empty />
  89. </template>
  90. <template v-else>
  91. <a-timeline>
  92. <a-timeline-item v-for="(recent,index) in recentInfoList" :key="index">{{recent.createTime}} {{recent.realname}}稽核了【{{recent.customerName}}】的资料</a-timeline-item>
  93. </a-timeline>
  94. </template>
  95. </a-card>
  96. </a-col>
  97. <a-col :sm="24" :md="12" :xl="8" :style="{ marginBottom: '24px' }">
  98. <a-card :loading="loading" :bordered="true" :style="{ margin: '12px' }">
  99. <template v-slot:title><a-icon type="tags" theme="twoTone"/>我的任务</template>
  100. <a slot="extra" @click="showMoreTaskManager">更多>></a>
  101. <template v-if="subTaskInfoList && subTaskInfoList.length === 0">
  102. <a-empty />
  103. </template>
  104. <template v-else>
  105. <a-table :dataSource="subTaskInfoList" size="small" rowKey="id" :columns="subTaskInfoColumns" :pagination="false">
  106. <template v-slot:taskCheck="text, record">
  107. <a @click="taskCheckManager(record)">完善</a>
  108. </template>
  109. </a-table>
  110. </template>
  111. </a-card>
  112. </a-col>
  113. <a-col :sm="24" :md="12" :xl="8" :style="{ marginBottom: '24px' }">
  114. <a-card :loading="loading" :bordered="true" :style="{ margin: '12px' }">
  115. <template v-slot:title><a-icon type="tags" theme="twoTone"/>本月目标</template>
  116. <a slot="extra" @click="showMoreTaskManager">更多>></a>
  117. <template v-if="targetInfoObj.allCount > 0">
  118. <a-descriptions size="small" bordered :column="1">
  119. <a-descriptions-item label="总数">{{targetInfoObj.allCount}}</a-descriptions-item>
  120. <a-descriptions-item label="未完善">{{targetInfoObj.undoCount}}</a-descriptions-item>
  121. <a-descriptions-item label="待稽核">{{targetInfoObj.uncheckCount}}</a-descriptions-item>
  122. <a-descriptions-item label="待整改">{{targetInfoObj.checkedCount}}</a-descriptions-item>
  123. <a-descriptions-item label="通过">{{targetInfoObj.doneCount}}</a-descriptions-item>
  124. </a-descriptions>
  125. </template>
  126. <template v-else>
  127. <a-empty />
  128. </template>
  129. </a-card>
  130. </a-col>
  131. <a-col :sm="24" :md="24" :xl="24" :style="{ marginBottom: '24px' }">
  132. <a-table size="small" :style="{ margin: '0px 12px 0px 12px' }"
  133. :dataSource="mainTaskList"
  134. rowKey="id"
  135. :columns="taskColumns"
  136. :customRow="customRow"
  137. :rowSelection="{type:'checkbox',selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  138. :pagination="false">
  139. </a-table>
  140. </a-col>
  141. </template>
  142. </a-card>
  143. <a-row>
  144. <a-col :span="24">
  145. <a-card :loading="loading" :bordered="false" title="最近一周访问量统计" :style="{ marginTop: '24px' }">
  146. <a-row>
  147. <a-col :span="6">
  148. <head-info title="今日IP" :content="loginfo.todayIp"></head-info>
  149. </a-col>
  150. <a-col :span="2">
  151. <a-spin class='circle-cust'>
  152. <a-icon slot="indicator" type="environment" style="font-size: 24px" />
  153. </a-spin>
  154. </a-col>
  155. <a-col :span="6">
  156. <head-info title="今日访问" :content="loginfo.todayVisitCount"></head-info>
  157. </a-col>
  158. <a-col :span="2">
  159. <a-spin class='circle-cust'>
  160. <a-icon slot="indicator" type="team" style="font-size: 24px" />
  161. </a-spin>
  162. </a-col>
  163. <a-col :span="6">
  164. <head-info title="总访问量" :content="loginfo.totalVisitCount"></head-info>
  165. </a-col>
  166. <a-col :span="2">
  167. <a-spin class='circle-cust'>
  168. <a-icon slot="indicator" type="rise" style="font-size: 24px" />
  169. </a-spin>
  170. </a-col>
  171. </a-row>
  172. <line-chart-multid :fields="visitFields" :dataSource="visitInfo"></line-chart-multid>
  173. </a-card>
  174. </a-col>
  175. </a-row>
  176. </div>
  177. </template>
  178. <script>
  179. import ChartCard from '@/components/ChartCard'
  180. import ACol from "ant-design-vue/es/grid/Col"
  181. import ATooltip from "ant-design-vue/es/tooltip/Tooltip"
  182. import MiniArea from '@/components/chart/MiniArea'
  183. import MiniBar from '@/components/chart/MiniBar'
  184. import MiniProgress from '@/components/chart/MiniProgress'
  185. import RankList from '@/components/chart/RankList'
  186. import Bar from '@/components/chart/Bar'
  187. import LineChartMultid from '@/components/chart/LineChartMultid'
  188. import HeadInfo from '@/components/tools/HeadInfo.vue'
  189. import Trend from '@/components/Trend'
  190. import { getLoginfo,getVisitInfo } from '@/api/api'
  191. import { httpAction, getAction, postAction } from '@api/manage'
  192. const rankList = []
  193. for (let i = 0; i < 7; i++) {
  194. rankList.push({
  195. name: '白鹭岛 ' + (i+1) + ' 号店',
  196. total: 1234.56 - i * 100
  197. })
  198. }
  199. const barData = []
  200. for (let i = 0; i < 12; i += 1) {
  201. barData.push({
  202. x: `${i + 1}月`,
  203. y: Math.floor(Math.random() * 1000) + 200
  204. })
  205. }
  206. export default {
  207. name: "IndexChart2",
  208. components: {
  209. ATooltip,
  210. ACol,
  211. ChartCard,
  212. MiniArea,
  213. MiniBar,
  214. MiniProgress,
  215. RankList,
  216. Bar,
  217. Trend,
  218. LineChartMultid,
  219. HeadInfo
  220. },
  221. data() {
  222. return {
  223. loading: true,
  224. center: null,
  225. rankList,
  226. barData,
  227. loginfo:{},
  228. visitFields:['ip','visit'],
  229. visitInfo:[],
  230. indicator: <a-icon type="loading" style="font-size: 24px" spin />,
  231. url: {
  232. taskList: '/smsCheck/index/taskList',
  233. typeWork: '/smsCheck/index/typeWork',
  234. typeInfo: '/smsCheck/index/typeInfo',
  235. },
  236. announcementList: [],
  237. taskId: '',
  238. infoLogList: [],
  239. isManager: false,
  240. recentWorkList: [],
  241. subTaskWorkList: [],
  242. targetWorkObj: [],
  243. recentInfoList: [],
  244. subTaskInfoList: [],
  245. isFirst: true,
  246. targetInfoObj: [],
  247. mainTaskList: [],
  248. selectedRowKeys: [],
  249. columns:[
  250. {
  251. title: '标题',
  252. align:"left",
  253. dataIndex: 'titile'
  254. },{
  255. title: '消息类型',
  256. align:"center",
  257. dataIndex: 'msgCategory',
  258. customRender: function (text) {
  259. if (text == '1') {
  260. return "通知公告";
  261. } else if (text == "2") {
  262. return "系统消息";
  263. } else {
  264. return text;
  265. }
  266. }
  267. },{
  268. title: '发布人',
  269. align:"center",
  270. dataIndex: 'sender'
  271. },{
  272. title: '发布时间',
  273. align:"center",
  274. dataIndex: 'sendTime'
  275. },{
  276. title: '优先级',
  277. align:"center",
  278. dataIndex: 'priority',
  279. customRender:function (text) {
  280. if(text=='L'){
  281. return "低";
  282. }else if(text=="M"){
  283. return "中";
  284. }else if(text=="H"){
  285. return "高";
  286. } else {
  287. return text;
  288. }
  289. }
  290. }],
  291. subTaskWorkColumns:[
  292. {
  293. title: '客户名称',
  294. align:"left",
  295. dataIndex: 'customerName'
  296. },{
  297. title: '服务号码',
  298. align:"left",
  299. dataIndex: 'smsNumber'
  300. },{
  301. title: '操作',
  302. align:"left",
  303. dataIndex: 'op',
  304. scopedSlots: { customRender: 'taskCheck' }
  305. }
  306. ],
  307. subTaskInfoColumns:[
  308. {
  309. title: '客户名称',
  310. align:"left",
  311. dataIndex: 'customerName'
  312. },{
  313. title: '服务号码',
  314. align:"left",
  315. dataIndex: 'smsNumber'
  316. },{
  317. title: '操作',
  318. align:"left",
  319. dataIndex: 'op',
  320. scopedSlots: { customRender: 'taskCheck' }
  321. }
  322. ],
  323. taskColumns:[
  324. {
  325. title: '任务名称',
  326. align:"left",
  327. dataIndex: 'taskName'
  328. },{
  329. title: '任务状态',
  330. align:"left",
  331. dataIndex: 'taskStateText'
  332. },{
  333. title: '任务开始时间',
  334. align:"left",
  335. dataIndex: 'taskStartTime'
  336. },{
  337. title: '任务结束时间',
  338. align:"left",
  339. dataIndex: 'taskEndTime'
  340. },
  341. // {
  342. // title: '描述',
  343. // align:"left",
  344. // dataIndex: 'description'
  345. // }
  346. ],
  347. }
  348. },
  349. created() {
  350. setTimeout(() => {
  351. this.loading = !this.loading
  352. }, 1000)
  353. this.initLogInfo();
  354. //this.getMesFirst();
  355. },
  356. methods: {
  357. initLogInfo () {
  358. getLoginfo(null).then((res)=>{
  359. if(res.success){
  360. Object.keys(res.result).forEach(key=>{
  361. res.result[key] =res.result[key]+""
  362. })
  363. this.loginfo = res.result;
  364. }
  365. })
  366. getVisitInfo().then(res=>{
  367. if(res.success){
  368. this.visitInfo = res.result;
  369. }
  370. })
  371. this.getMsgList();
  372. this.getMainTaskList();
  373. },
  374. getMsgList() {
  375. let httpUrl = '/sys/sysAnnouncementSend/getMyAnnouncementSend?pageNo=1&pageSize=5';
  376. let params = {};
  377. let that = this;
  378. // 发送请求
  379. getAction(httpUrl, params)
  380. .then((res) => {
  381. if(res.success){
  382. that.announcementList = res.result.records;
  383. }else{
  384. that.announcementList = [];
  385. }
  386. }).finally(() => {
  387. })
  388. },
  389. getMainTaskList() {
  390. let httpUrl = this.url.taskList + '?&column=createTime&order=desc';
  391. let params = {};
  392. let that = this;
  393. // 发送请求
  394. getAction(httpUrl, params)
  395. .then((res) => {
  396. if(res.success){
  397. that.mainTaskList = res.result.records;
  398. that.isManager = res.result.isManager;
  399. if(that.mainTaskList && that.mainTaskList.length > 0) {
  400. that.taskId = that.mainTaskList[0].id;
  401. if (that.selectedRowKeys.length === 0) {
  402. that.getWorkOrInfoList();
  403. } else {
  404. that.getWorkOrInfoList(that.taskId);
  405. }
  406. }
  407. }else{
  408. that.mainTaskList = [];
  409. }
  410. }).finally(() => {
  411. })
  412. },
  413. getWorkList(taskIds) {
  414. let httpUrl = this.url.typeWork;
  415. httpUrl += '?pageNo=1&pageSize=5&column=createTime&order=desc';
  416. if (taskIds) {
  417. httpUrl += '&taskIds=' + taskIds
  418. }
  419. let params = {};
  420. let that = this;
  421. // 发送请求
  422. getAction(httpUrl, params)
  423. .then((res) => {
  424. if(res.success){
  425. that.recentWorkList = res.result.recentList;
  426. that.subTaskWorkList = res.result.subTaskList;
  427. that.targetWorkObj = res.result.targetObj;
  428. }else{
  429. that.infoLogList = [];
  430. }
  431. }).finally(() => {
  432. })
  433. },
  434. getInfoList(taskIds) {
  435. let httpUrl = this.url.typeInfo;
  436. httpUrl += '?pageNo=1&pageSize=5&column=createTime&order=desc';
  437. if (taskIds) {
  438. httpUrl += '&taskIds=' + taskIds
  439. }
  440. let params = {};
  441. let that = this;
  442. // 发送请求
  443. getAction(httpUrl, params)
  444. .then((res) => {
  445. if(res.success){
  446. that.recentInfoList = res.result.recentList;
  447. that.subTaskInfoList = res.result.subTaskList;
  448. that.targetInfoObj = res.result.targetObj;
  449. }else{
  450. that.recentInfoList = [];
  451. that.subTaskInfoList = [];
  452. that.targetInfoObj = {};
  453. }
  454. }).finally(() => {
  455. })
  456. },
  457. showMoreMsg() {
  458. this.$router.push({ path: '/isps/userAnnouncement' })
  459. },
  460. showMoreTaskLeader() {
  461. this.$router.push({ path: '/sms/check/task'})
  462. },
  463. taskCheckLeader(record) {
  464. this.$router.push({ path: '/sms/check/task/check/check', query: { id: record.id} })
  465. },
  466. showMoreTaskManager() {
  467. this.$router.push({ path: '/dataupload/data/main'})
  468. },
  469. taskCheckManager(record) {
  470. this.$router.push({ path: '/sms/check/data/edit', query: { id: record.id} })
  471. },
  472. onSelectChange(selectedRowKeys, selectionRows) {
  473. this.selectedRowKeys = selectedRowKeys;
  474. this.selectionRows = selectionRows;
  475. this.taskId = selectedRowKeys;
  476. this.getWorkOrInfoList(this.taskId);
  477. },
  478. customRow(record, index) {
  479. let that = this;
  480. return {
  481. on: {
  482. // 鼠标单击行
  483. click: (event) => {
  484. // 查询是否已经选中 索引大于 -1
  485. let index = that.selectedRowKeys.findIndex((item,index)=>{
  486. return item === record.id
  487. });
  488. // 存在则移除,不存在则添加
  489. if (index > -1) {
  490. that.selectedRowKeys.splice(index, 1);
  491. } else {
  492. that.selectedRowKeys.push(record.id);
  493. }
  494. let taskIds = that.selectedRowKeys;
  495. that.getWorkOrInfoList(taskIds);
  496. },
  497. }
  498. }
  499. },
  500. // 根据用户的角色获取对应的数据
  501. getWorkOrInfoList(taskIds) {
  502. if (this.isManager) {
  503. this.getWorkList(taskIds);
  504. } else {
  505. this.getInfoList(taskIds);
  506. }
  507. }
  508. }
  509. }
  510. </script>
  511. <style lang="less" scoped>
  512. .circle-cust{
  513. position: relative;
  514. top: 28px;
  515. left: -100%;
  516. }
  517. .extra-wrapper {
  518. line-height: 55px;
  519. padding-right: 24px;
  520. .extra-item {
  521. display: inline-block;
  522. margin-right: 24px;
  523. a {
  524. margin-left: 24px;
  525. }
  526. }
  527. }
  528. /* 首页访问量统计 */
  529. .head-info {
  530. position: relative;
  531. text-align: left;
  532. padding: 0 32px 0 0;
  533. min-width: 125px;
  534. &.center {
  535. text-align: center;
  536. padding: 0 32px;
  537. }
  538. span {
  539. color: rgba(0, 0, 0, .45);
  540. display: inline-block;
  541. font-size: .95rem;
  542. line-height: 42px;
  543. margin-bottom: 4px;
  544. }
  545. p {
  546. line-height: 42px;
  547. margin: 0;
  548. a {
  549. font-weight: 600;
  550. font-size: 1rem;
  551. }
  552. }
  553. }
  554. </style>