您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

1201 行
34 KiB

  1. <template>
  2. <div class="box-center">
  3. <!-- 头 -->
  4. <div class="app-top">
  5. <div class="app-titel">
  6. <div style="text-indent: 30px;">接待时间:</div>
  7. <div class="toptimeqhuan">
  8. <div :class="{ tophove: timeType == 4 }" @click="tabtimetap(4)">
  9. 近7天
  10. </div>
  11. <div :class="{ tophove: timeType == 5 }" @click="tabtimetap(5)">
  12. 近15天
  13. </div>
  14. <div :class="{ tophove: timeType == 6 }" @click="tabtimetap(6)">
  15. 近30天
  16. </div>
  17. </div>
  18. <div style="margin-left: 20px">
  19. <el-date-picker
  20. @change="confirmtime"
  21. v-model="customtime"
  22. :clearable='false'
  23. type="daterange"
  24. range-separator="-"
  25. format="yyyy-MM-dd"
  26. value-format="yyyy-MM-dd"
  27. start-placeholder="开始日期"
  28. end-placeholder="结束日期"
  29. :picker-options="pickerOptions"
  30. >
  31. </el-date-picker>
  32. </div>
  33. <div style="margin-left: 20px">
  34. <el-checkbox v-model="checked" @change="radioChange"
  35. >对比时间段</el-checkbox
  36. >
  37. </div>
  38. <div v-if="checked" style="margin-left: 20px;border:1px solid #DCDFE6;min-width: 220px;height: 30px;border-radius: 4px;max-width:250px;
  39. font-size: 13px; line-height: 30px; text-indent: 8px;" @click="show">
  40. {{ selectTime1 ? "时段二: " : "请选择: "}}
  41. <span v-if="selectTime1">{{ selectTime + "-" + selectTime1}}</span>
  42. <el-date-picker
  43. style="opacity: 0"
  44. v-model="time"
  45. @change="timeChange"
  46. ref="time"
  47. type="date"
  48. :clearable='false'
  49. placeholder="选择日期"
  50. format="yyyy-MM-dd"
  51. value-format="yyyy-MM-dd"
  52. :picker-options="pickerOptions"
  53. >
  54. </el-date-picker>
  55. </div>
  56. </div>
  57. </div>
  58. <!-- //卡片 -->
  59. <div class="kapian-box">
  60. <div class="kayi">
  61. <div class="shang">
  62. <div class="zuo">
  63. <div class="text1">有效接待</div>
  64. <div class="text2">{{cardobj.startSumCustomer||0}}个</div>
  65. </div>
  66. <div class="you">
  67. <img class="youimg" src="/img/waves1.png" alt="" />
  68. </div>
  69. </div>
  70. <div v-if="Confirmthecontrast" class="xia">
  71. <span class="span1">对比:{{cardobj.endSumCustomer ||0}}个</span>
  72. <span class="span2">{{cardobj.contrastSumCustomer ||0}}%</span>
  73. </div>
  74. </div>
  75. <div class="kayi">
  76. <div class="shang">
  77. <div class="zuo">
  78. <div class="text1">平均执行率</div>
  79. <div class="text2">{{cardobj.startFraction||0}}%</div>
  80. </div>
  81. <div class="you">
  82. <img class="youimg" src="/img/waves2.png" alt="" />
  83. </div>
  84. </div>
  85. <div v-if="Confirmthecontrast" class="xia">
  86. <span class="span1">对比:{{cardobj.endFraction ||0}}%</span>
  87. <span class="span2">{{cardobj.contrastFraction ||0}}%</span>
  88. </div>
  89. </div>
  90. <div class="kayi" style="margin: 0px">
  91. <div class="shang">
  92. <div class="zuo">
  93. <div class="text1">平均接待时长/min</div>
  94. <div class="text2">{{Math.floor(cardobj.startSumDuration/60)||0}}</div>
  95. </div>
  96. <div class="you">
  97. <img class="youimg" src="/img/waves3.png" alt="" />
  98. </div>
  99. </div>
  100. <div v-if="Confirmthecontrast" class="xia">
  101. <span class="span1">对比:{{Math.floor(cardobj.endSumDuration/60) ||0}}</span>
  102. <span class="span2">{{cardobj.contrastSumDuration ||0}}%</span>
  103. </div>
  104. </div>
  105. </div>
  106. <!-- 图表 -->
  107. <div class="app-box-er">
  108. <div class="titletab" style="cursor: pointer;">
  109. <div :class="{ claindex: aliasclass == 1 }" @click="tapChange(1)">项目</div>
  110. <div :class="{ claindex: aliasclass == 2 }" @click="tapChange(2)">团队</div>
  111. <div :class="{ claindex: aliasclass == 3 }" @click="tapChange(3)">顾问</div>
  112. <div :class="{ claindex: aliasclass == 4 }" @click="tapChange(4)">销讲一级</div>
  113. <div :class="{ claindex: aliasclass == 5 }" @click="tapChange(5)">销讲二级</div>
  114. </div>
  115. <!-- 团队选部门 -->
  116. <div v-if="aliasclass==2" style="display: flex;align-items: center;margin-top: 26px;">
  117. 部门:
  118. <el-select @change="departmenttap()" v-model="departmentid" placeholder="请选择">
  119. <el-option
  120. v-for="item in departmentlist"
  121. :key="item.deptId"
  122. :label="item.name"
  123. :value="item.deptId"
  124. >
  125. </el-option>
  126. </el-select>
  127. </div>
  128. <!-- 选择顾问 -->
  129. <div v-if="aliasclass==3" style="display: flex;align-items: center;margin-top: 26px;">
  130. 顾问:
  131. <el-select @change="consultanttap()" v-model="consultantid" placeholder="请选择">
  132. <el-option
  133. v-for="item in consultantlist"
  134. :key="item.accountId"
  135. :label="item.accountName"
  136. :value="item.accountId"
  137. >
  138. </el-option>
  139. </el-select>
  140. </div>
  141. <!-- 一二级 -->
  142. <div v-if="aliasclass==5" style="display: flex;align-items: center;margin-top: 26px;">
  143. 一级:
  144. <el-select @change="Level1tap()" v-model="Level1id" placeholder="请选择">
  145. <el-option
  146. v-for="item in Level1"
  147. :key="item.marketingId"
  148. :label="item.name"
  149. :value="item.marketingId"
  150. >
  151. </el-option>
  152. </el-select>
  153. &nbsp; &nbsp; 二级:
  154. <el-select @change="Level2tap()" v-model="Level2id" placeholder="请选择">
  155. <el-option
  156. v-for="item in Level2"
  157. :key="item.marketingId"
  158. :label="item.name"
  159. :value="item.marketingId"
  160. >
  161. </el-option>
  162. </el-select>
  163. </div>
  164. <div v-if="echartsisshow" id="main"></div>
  165. <div v-else style="display:flex;justify-content: center; align-items: center;height: 350px;">
  166. <div>暂无数据</div>
  167. </div>
  168. </div>
  169. <!-- 表格 -->
  170. <div class="app-box-san" v-if="Confirmthecontrast && aliasclass!=3 && aliasclass!=4">
  171. <div class="santitle">对比报表</div>
  172. <div class="santab">
  173. <el-table :data="tableData" height="400" border style="width: 100%">
  174. <el-table-column prop="name" label="时间" align="center">
  175. </el-table-column>
  176. <el-table-column prop="shiduan1" label="时段1" align="center">
  177. <template slot-scope="scope">
  178. <span>{{scope.row.shiduan1}}%</span>
  179. </template>
  180. </el-table-column>
  181. <el-table-column prop="shiduan2" label="时段2" align="center">
  182. <template slot-scope="scope">
  183. <span>{{scope.row.shiduan2}}%</span>
  184. </template>
  185. </el-table-column>
  186. <el-table-column prop="heji" label="变化" align="center">
  187. <template slot-scope="scope">
  188. <span v-if="scope.row.heji>0"> <i class="el-icon-top" style="color: red;"></i>{{scope.row.heji}}%</span>
  189. <span v-if="scope.row.heji==0">{{scope.row.heji}}%</span>
  190. <span v-if="scope.row.heji<0"> <i class="el-icon-bottom" style="color: 25CEBA;"></i>{{scope.row.heji}}%</span>
  191. </template>
  192. </el-table-column>
  193. </el-table>
  194. </div>
  195. </div>
  196. <div v-if="aliasclass==3 || aliasclass==4" class="app-box-san" style="padding:12px;" >
  197. <div style="overflow: auto;">
  198. <table class="table">
  199. <tbody class="tbody">
  200. <tr v-if="tablelist1.length!=0">
  201. <td class="theadtd" v-for="(item,index) in tablelist1" :key='index'>{{item.name}}</td>
  202. </tr>
  203. <tr v-if="tablelist2.length!=0">
  204. <td class="theadtd" v-for="(item,index) in tablelist2" :key='index'>{{item.name}}</td>
  205. </tr>
  206. <tr v-if="tablelist3.length!=0">
  207. <td class="theadtd" v-for="(item,index) in tablelist3" :key='index'>{{item.name}}</td>
  208. </tr>
  209. <tr v-if="tablelist4.length!=0">
  210. <td class="theadtd" v-for="(item,index) in tablelist4" :key='index'>
  211. <span v-if="item.name=='变化'">{{item.name}}</span>
  212. <span v-else-if="item.name==0">{{item.name}}%</span>
  213. <span v-else-if="item.name>0" style="color: red;">{{item.name}}%</span>
  214. <span v-else-if="item.name<0" style="color: #25CEBA;">{{item.name}}%</span>
  215. </td>
  216. </tr>
  217. </tbody>
  218. </table>
  219. </div>
  220. </div>
  221. </div>
  222. </template>
  223. <script>
  224. import * as echarts from "echarts";
  225. export default {
  226. data() {
  227. return {
  228. timeType: 4,
  229. pickerOptions: {
  230. disabledDate(time) {
  231. return time.getTime() > Date.now();
  232. },
  233. },
  234. time: "",//对比时间的数组
  235. page: {
  236. openTime: "",
  237. closeTime: "",
  238. },
  239. customtime: [],//自定义时间
  240. selectTime1: "",//对比时间
  241. selectTime: "",//对比时间
  242. aliasclass: 1,//tab下标
  243. houseId: "",//楼盘id
  244. options: [],
  245. value: "",
  246. checked: false,//是否对比
  247. Confirmthecontrast:false,
  248. tableData: [],//表格数据
  249. cardobj:{},
  250. departmentlist:[],
  251. departmentid:'',
  252. echartsisshow:true,
  253. consultantlist:[],
  254. consultantid:'',
  255. tablelist1:[],
  256. tablelist2:[],
  257. tablelist3:[],
  258. tablelist4:[],
  259. Level1:[],
  260. Level2:[],
  261. Level1id:'',
  262. Level2id:''
  263. };
  264. },
  265. mounted() {
  266. this.houseId = localStorage.getItem("houseId");
  267. this.tabtimetap(4);
  268. this.overviewfindList()
  269. },
  270. methods: {
  271. //销讲二级
  272. trendAnalysisLevel2(){
  273. let pamaet={
  274. showStatus:'',
  275. houseId:this.houseId,
  276. timeType:0,
  277. firstStartDate:this.page.openTime,
  278. firstEndDate:this.page.closeTime,
  279. lastStartDate:this.selectTime,
  280. lastEndDate:this.selectTime1,
  281. marketingId:this.Level2id
  282. }
  283. if(this.timeType==-1){
  284. pamaet.timeType=null
  285. }else{
  286. pamaet.timeType=this.timeType
  287. }
  288. if(this.checked==true){
  289. pamaet.showStatus=1;
  290. pamaet.timeType=null
  291. }else{
  292. pamaet.showStatus=0
  293. }
  294. this.$api.http.trendAnalysisLevel2(pamaet).then((res) => {
  295. if(this.Confirmthecontrast==false){
  296. let newlist=res.data.startList || [];
  297. var newline=[];
  298. var newline2=[];
  299. newlist.map(item=>{
  300. newline.push(item.zxl)
  301. newline2.push(item.statDate.slice(5,10))
  302. })
  303. this.SwitchCARDS(newline,newline2)
  304. }else{
  305. let newlist=res.data.startList || [];
  306. let newlist2=res.data.endList || [];
  307. let hejilist=res.data.comparedList || [];
  308. var newline=[];//起始数据
  309. var newline2=[];//对比数据
  310. var newline1=[];//时间
  311. let arr=[];
  312. newlist.map(item=>{
  313. newline.push(item.zxl)
  314. })
  315. newlist2.map(item=>{
  316. newline1.push(item.zxl)
  317. })
  318. newlist.forEach((item, sdf) => {
  319. newlist2.forEach((child, zxc) => {
  320. if (sdf == zxc) {
  321. newline2.push(item.statDate.substring(5,10) + 'vs' + child.statDate.substring(5, 10))
  322. arr.push({
  323. name:item.statDate.substring(5,10) + 'vs' + child.statDate.substring(5, 10),
  324. shiduan1:item.zxl,
  325. shiduan2:child.zxl,
  326. });
  327. }
  328. })
  329. })
  330. hejilist.forEach((acd,xdx)=>{
  331. arr.forEach((che,ind)=>{
  332. if(xdx==ind){
  333. che.heji=acd.zxl;
  334. }
  335. })
  336. })
  337. arr.unshift({
  338. name:'项目合计',
  339. shiduan1:res.data.startSum,
  340. shiduan2:res.data.endSum,
  341. heji:res.data.comparedSum,
  342. })
  343. this.SwitchCARDS2(newline,newline1,newline2)
  344. this.tableData=arr;
  345. console.log( this.tableData)
  346. }
  347. })
  348. },
  349. //切换一级
  350. Level1tap(){
  351. this.Level1.forEach((item,index)=>{
  352. if(this.Level1id==item.marketingId){
  353. this.Level2=item.children || [];
  354. this.Level2id=item.children[0].marketingId || '';
  355. }
  356. })
  357. this.trendAnalysisLevel2()
  358. },
  359. //切换er级
  360. Level2tap(){
  361. this.trendAnalysisLevel2()
  362. },
  363. //一二级
  364. trendAnalysisAllLevel(){
  365. let pamaet={
  366. showStatus:'',
  367. houseId:this.houseId,
  368. timeType:0,
  369. firstStartDate:this.page.openTime,
  370. firstEndDate:this.page.closeTime,
  371. lastStartDate:this.selectTime,
  372. lastEndDate:this.selectTime1,
  373. }
  374. if(this.timeType==-1){
  375. pamaet.timeType=null
  376. }else{
  377. pamaet.timeType=this.timeType
  378. }
  379. if(this.checked==true){
  380. pamaet.showStatus=1;
  381. pamaet.timeType=null
  382. }else{
  383. pamaet.showStatus=0
  384. }
  385. this.$api.http.trendAnalysisAllLevel(pamaet).then((res) => {
  386. this.Level1=res.data || [];
  387. this.Level1id=res.data[0].marketingId || '';
  388. this.Level2=res.data[0].children || [];
  389. this.Level2id=res.data[0].children[0].marketingId || '';
  390. this.trendAnalysisLevel2()
  391. })
  392. },
  393. //切换顾问
  394. consultanttap(){
  395. this.trendAnalysisAccount()
  396. },
  397. // 获取顾问
  398. trendAnalysisAllAccount(pamaet){
  399. this.$api.http.trendAnalysisAllAccount(pamaet).then((res) => {
  400. this.consultantlist=res.data || [];
  401. if( this.consultantlist.length!=0){
  402. this.consultantid=res.data[0].accountId;
  403. this.trendAnalysisAccount()
  404. }else{
  405. echarts.init(document.getElementById("main")).dispose();
  406. this.echartsisshow=false;
  407. this.tableData=[];
  408. }
  409. })
  410. },
  411. trendAnalysisAccount(){
  412. var that=this;
  413. let pamaet={
  414. showStatus:'',
  415. houseId:this.houseId,
  416. timeType:0,
  417. firstStartDate:this.page.openTime,
  418. firstEndDate:this.page.closeTime,
  419. lastStartDate:this.selectTime,
  420. lastEndDate:this.selectTime1,
  421. }
  422. if(this.aliasclass==3){
  423. pamaet.accountId=this.consultantid
  424. }
  425. if(this.timeType==-1){
  426. pamaet.timeType=null
  427. }else{
  428. pamaet.timeType=this.timeType
  429. }
  430. if(this.checked==true){
  431. pamaet.showStatus=1;
  432. pamaet.timeType=null
  433. }else{
  434. pamaet.showStatus=0
  435. }
  436. this.$api.http.trendAnalysisAccount(pamaet).then((res) => {
  437. if(this.Confirmthecontrast==false){
  438. let newlist=res.data.firstList || [];
  439. var newline=[];//起始数据
  440. var newlinename=[];
  441. let tablist=[
  442. {name:'时间',}
  443. ]
  444. let tablist2=[
  445. {name:that.customtime[0].substring(5,10)+'/'+that.customtime[1].substring(5,10),}
  446. ]
  447. newlist.map(item=>{
  448. newline.push(item.zxl)
  449. newlinename.push({name:item.name,max:100})
  450. tablist.push({name:item.name})
  451. tablist2.push({name:item.zxl+'%',})
  452. })
  453. this.tablelist1=tablist;
  454. this.tablelist2=tablist2;
  455. this.tablelist3=[];
  456. this.tablelist4=[];
  457. this.piechart(newline,newlinename)
  458. }else{
  459. let newlist=res.data.firstList || [];
  460. let newlist2=res.data.secondList|| [];
  461. let newlist4=res.data.thirdList|| [];
  462. var newline=[];//起始数据
  463. let newline2=[];//对比数据
  464. var newlinename=[];
  465. let tablist1=[
  466. {name:'时间',}
  467. ]
  468. let tablist2=[
  469. {name:that.customtime[0].substring(5,10)+'/'+that.customtime[1].substring(5,10),}
  470. ]
  471. let tablist3=[
  472. {name:that.selectTime.substring(5,10)+'/'+that.selectTime1.substring(5,10),}
  473. ]
  474. let tablist4=[
  475. {name:'变化',}
  476. ]
  477. newlist.map(item=>{
  478. newline.push(item.zxl)
  479. newlinename.push({name:item.name,max:100})
  480. tablist1.push({name:item.name})
  481. tablist2.push({name:item.zxl+'%',})
  482. })
  483. newlist2.map(item=>{
  484. newline2.push(item.zxl)
  485. tablist3.push({name:item.zxl+'%',})
  486. })
  487. newlist4.map(item=>{
  488. tablist4.push({name:item.zxl,})
  489. })
  490. this.tablelist1=tablist1;
  491. this.tablelist2=tablist2;
  492. this.tablelist3=tablist3;
  493. this.tablelist4=tablist4;
  494. this.piechart2(newline,newlinename,newline2)
  495. }
  496. })
  497. },
  498. //获取卡片
  499. trendtrendAnalysis(){
  500. let pamaet={
  501. showStatus:'',
  502. houseId:this.houseId,
  503. timeType:0,
  504. firstStartDate:this.page.openTime,
  505. firstEndDate:this.page.closeTime,
  506. lastStartDate:this.selectTime,
  507. lastEndDate:this.selectTime1
  508. }
  509. if(this.timeType==-1){
  510. pamaet.timeType=null
  511. }else{
  512. pamaet.timeType=this.timeType
  513. }
  514. if(this.checked==true){
  515. pamaet.showStatus=1;
  516. pamaet.timeType=null
  517. }else{
  518. pamaet.showStatus=0
  519. }
  520. this.$api.http.trendtrendAnalysis(pamaet).then((res) => {
  521. this.cardobj=res.data;
  522. if(this.aliasclass==1){
  523. this.echartsisshow=true;
  524. this.trendtrendAnalysisProject(pamaet)
  525. }else if(this.aliasclass==2){
  526. if(this.departmentid!=''){
  527. pamaet.deptId=this.departmentid
  528. this.trendtrendAnalysisProject(pamaet)
  529. }else{
  530. echarts.init(document.getElementById("main")).dispose();
  531. this.echartsisshow=false;
  532. this.tableData=[];
  533. }
  534. }else if(this.aliasclass==3){
  535. if(this.consultantid.length==0){
  536. this.trendAnalysisAllAccount(pamaet)
  537. }else{
  538. this.trendAnalysisAccount()
  539. }
  540. }else if(this.aliasclass==4){
  541. this.trendAnalysisAccount()
  542. }else{
  543. this.trendAnalysisAllLevel()
  544. }
  545. })
  546. },
  547. //项目
  548. trendtrendAnalysisProject(pamaet){
  549. this.$api.http.trendtrendAnalysisProject(pamaet).then((res) => {
  550. if(this.Confirmthecontrast==false){
  551. let newlist=res.data.startList || [];
  552. var newline=[];
  553. var newline2=[];
  554. newlist.map(item=>{
  555. newline.push(item.fraction)
  556. newline2.push(item.statDate.slice(5,10))
  557. })
  558. this.SwitchCARDS(newline,newline2)
  559. }else{
  560. let newlist=res.data.startList || [];
  561. let newlist2=res.data.endList || [];
  562. let hejilist=res.data.comparedList || [];
  563. var newline=[];//起始数据
  564. var newline2=[];//对比数据
  565. var newline1=[];//时间
  566. let arr=[];
  567. newlist.map(item=>{
  568. newline.push(item.fraction)
  569. })
  570. newlist2.map(item=>{
  571. newline1.push(item.fraction)
  572. })
  573. newlist.forEach((item, sdf) => {
  574. newlist2.forEach((child, zxc) => {
  575. if (sdf == zxc) {
  576. newline2.push(item.statDate.substring(5,10) + 'vs' + child.statDate.substring(5, 10))
  577. arr.push({
  578. name:item.statDate.substring(5,10) + 'vs' + child.statDate.substring(5, 10),
  579. shiduan1:item.fraction,
  580. shiduan2:child.fraction,
  581. });
  582. }
  583. })
  584. })
  585. hejilist.forEach((acd,xdx)=>{
  586. arr.forEach((che,ind)=>{
  587. if(xdx==ind){
  588. che.heji=acd.fraction;
  589. }
  590. })
  591. })
  592. arr.unshift({
  593. name:'项目合计',
  594. shiduan1:res.data.startSum,
  595. shiduan2:res.data.endSum,
  596. heji:res.data.comparedSum,
  597. })
  598. this.SwitchCARDS2(newline,newline1,newline2)
  599. this.tableData=arr;
  600. console.log( this.tableData)
  601. }
  602. })
  603. },
  604. //获取部门下拉菜单
  605. overviewfindList(){
  606. this.$api.http.overviewfindList({
  607. houseId:this.houseId,
  608. }).then((res) => {
  609. this.departmentlist=res.data || [];
  610. if(this.departmentlist.length!=0){
  611. this.departmentid=res.data[0].deptId
  612. }else{
  613. this.departmentid=''
  614. }
  615. })
  616. },
  617. //切换部门
  618. departmenttap(){
  619. this.trendtrendAnalysis()
  620. },
  621. //选项卡切换
  622. tapChange(idx){
  623. this.aliasclass=idx;
  624. this.trendtrendAnalysis()
  625. },
  626. //时间tab切换
  627. tabtimetap(i) {
  628. this.timeType = i;
  629. this.checked = false;
  630. this.selectTime = "";
  631. this.selectTime1 = "";
  632. //给时间选择器赋值
  633. let num = 24 * 3600 * 1000;
  634. // 获取当前时间戳转换为日期格式
  635. if (this.timeType == 4) {
  636. num = 24 * 3600 * 1000 * 6;
  637. }
  638. if (this.timeType == 5) {
  639. num = 24 * 3600 * 1000 * 14;
  640. }
  641. if (this.timeType == 6) {
  642. num = 24 * 3600 * 1000 * 29;
  643. }
  644. this.customtime = [
  645. this.timestampToTime(new Date().getTime() - num),
  646. this.timestampToTime(new Date().getTime()),
  647. ];
  648. this.$set(this, "time", null);
  649. this.Confirmthecontrast=false;
  650. this.trendtrendAnalysis()
  651. },
  652. // 对比时间选择弹框显示
  653. show() {
  654. this.$refs.time.pickerVisible = true;
  655. },
  656. //选择对比时间
  657. timeChange(e) {
  658. // 对数据进行处理
  659. // 当当前选择的为自定义时间时
  660. this.selectTime = "";
  661. this.selectTime1 = "";
  662. this.timeSelect(e);
  663. },
  664. timeSelect(e) {
  665. if (this.timeType == -1) {
  666. this.selectTime = e;
  667. this.selectTime1 = this.timestampToTime(new Date(e).getTime()+new Date(this.page.closeTime).getTime()-new Date(this.page.openTime).getTime());
  668. } else {
  669. // 获取今天昨天近一周
  670. // 获取一天的时间戳
  671. let num = 24 * 3600 * 1000;
  672. // 获取当前时间戳转换为日期格式
  673. if (this.timeType == 4) {
  674. num = 24 * 3600 * 1000 * 6;
  675. }
  676. if (this.timeType == 5) {
  677. num = 24 * 3600 * 1000 * 14;
  678. }
  679. if (this.timeType == 6) {
  680. num = 24 * 3600 * 1000 * 29;
  681. }
  682. this.selectTime = e;
  683. this.selectTime1 = this.timestampToTime(new Date(e).getTime() + num);
  684. }
  685. this.Confirmthecontrast=true;
  686. this.page.openTime=this.customtime[0]
  687. this.page.closeTime=this.customtime[1]
  688. this.trendtrendAnalysis()
  689. },
  690. radioChange() {
  691. this.selectTime = "";
  692. this.selectTime1 = "";
  693. this.$set(this, "time", null);
  694. },
  695. //选择自定义时间
  696. confirmtime(e) {
  697. this.timeType = "-1";
  698. this.checked = false;
  699. this.selectTime = "";
  700. this.selectTime1 = "";
  701. this.$set(this, "time", null);
  702. if (!e) return;
  703. this.page.openTime = this.customtime[0];
  704. this.page.closeTime = this.customtime[1];
  705. this.Confirmthecontrast=false;
  706. this.trendtrendAnalysis()
  707. },
  708. timestampToTime(timestamp) {
  709. var date = new Date(timestamp); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
  710. var yyyy = date.getFullYear() + "-";
  711. var MM =(date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1): date.getMonth() + 1) + "-";
  712. var dd =(date.getDate() < 10 ? "0" + date.getDate() : date.getDate());
  713. return yyyy + MM + dd;
  714. },
  715. SwitchCARDS(newline,newline2) {
  716. echarts.init(document.getElementById("main")).dispose();
  717. var chartDom = document.getElementById("main");
  718. var myChart = echarts.init(chartDom);
  719. var option;
  720. option = {
  721. tooltip: {
  722. trigger: "axis",
  723. },
  724. legend: {
  725. data: ["起始时间"],
  726. bottom: "10",
  727. },
  728. grid: {
  729. left: 10,
  730. right: 10,
  731. containLabel: true,
  732. },
  733. xAxis: {
  734. type: "category",
  735. data: newline2,
  736. axisLabel: {
  737. //重点在这一块,其余可以忽略
  738. textStyle: {
  739. color: "#212121", //更改坐标轴文字颜色
  740. },
  741. },
  742. axisLine: {
  743. lineStyle: {
  744. type: "solid",
  745. color: "#DDE1EE", //x线的颜色
  746. width: "1", //坐标线的宽度
  747. },
  748. },
  749. },
  750. yAxis: {
  751. type: "value",
  752. splitNumber: 4,
  753. axisLabel: {
  754. //重点在这一块,其余可以忽略
  755. textStyle: {
  756. color: "#212121", //更改坐标轴文字颜色
  757. },
  758. },
  759. axisLine: {
  760. lineStyle: {
  761. ype: "solid",
  762. color: "#DDE1EE", //x线的颜色
  763. width: "1", //坐标线的宽度
  764. },
  765. },
  766. splitLine: {
  767. lineStyle: {
  768. type: "dashed", // y轴分割线类型
  769. },
  770. },
  771. axisTick: {
  772. //y轴刻度线
  773. show: false,
  774. },
  775. },
  776. series: [
  777. {
  778. name: "起始时间",
  779. data:newline,
  780. type: "line",
  781. smooth: true,
  782. },
  783. ],
  784. };
  785. option && myChart.setOption(option);
  786. window.addEventListener("resize", () => {
  787. myChart.resize();
  788. });
  789. },
  790. SwitchCARDS2(newline,newline1,newline2) {
  791. echarts.init(document.getElementById("main")).dispose();
  792. var chartDom = document.getElementById("main");
  793. var myChart = echarts.init(chartDom);
  794. var option;
  795. option = {
  796. tooltip: {
  797. trigger: "axis",
  798. },
  799. legend: {
  800. data: ["起始时间","对比时间"],
  801. bottom: "10",
  802. },
  803. grid: {
  804. left: 10,
  805. right: 10,
  806. containLabel: true,
  807. },
  808. xAxis: {
  809. type: "category",
  810. data: newline2,
  811. axisLabel: {
  812. //重点在这一块,其余可以忽略
  813. textStyle: {
  814. color: "#212121", //更改坐标轴文字颜色
  815. },
  816. },
  817. axisLine: {
  818. lineStyle: {
  819. type: "solid",
  820. color: "#DDE1EE", //x线的颜色
  821. width: "1", //坐标线的宽度
  822. },
  823. },
  824. },
  825. yAxis: {
  826. type: "value",
  827. splitNumber: 4,
  828. axisLabel: {
  829. //重点在这一块,其余可以忽略
  830. textStyle: {
  831. color: "#212121", //更改坐标轴文字颜色
  832. },
  833. },
  834. axisLine: {
  835. lineStyle: {
  836. ype: "solid",
  837. color: "#DDE1EE", //x线的颜色
  838. width: "1", //坐标线的宽度
  839. },
  840. },
  841. splitLine: {
  842. lineStyle: {
  843. type: "dashed", // y轴分割线类型
  844. },
  845. },
  846. axisTick: {
  847. //y轴刻度线
  848. show: false,
  849. },
  850. },
  851. series: [
  852. {
  853. name: "起始时间",
  854. data:newline,
  855. type: "line",
  856. smooth: true,
  857. },
  858. {
  859. name: "对比时间",
  860. data:newline1,
  861. type: "line",
  862. smooth: true,
  863. }
  864. ],
  865. };
  866. option && myChart.setOption(option);
  867. window.addEventListener("resize", () => {
  868. myChart.resize();
  869. });
  870. },
  871. piechart2(newline,newlinename,newline2){
  872. echarts.init(document.getElementById("main")).dispose();
  873. var chartDom = document.getElementById("main");
  874. var myChart = echarts.init(chartDom);
  875. var option;
  876. option = {
  877. tooltip: {
  878. trigger: 'axis'
  879. },
  880. legend: {
  881. data: ['起始时间','对比时间'],
  882. bottom: "10",
  883. },
  884. color:[
  885. '#2671E2',
  886. '#F3787B',
  887. ],
  888. radar: {
  889. // shape: 'circle',
  890. indicator: newlinename
  891. },
  892. series: [
  893. {
  894. type: 'radar',
  895. tooltip: {
  896. trigger: 'item'
  897. },
  898. data: [
  899. {
  900. value:newline,
  901. name: '起始时间'
  902. },
  903. {
  904. value:newline2,
  905. name: '对比时间'
  906. },
  907. ]
  908. }
  909. ]
  910. };
  911. option && myChart.setOption(option);
  912. window.addEventListener("resize", () => {
  913. myChart.resize();
  914. });
  915. },
  916. piechart(newline,newlinename){
  917. echarts.init(document.getElementById("main")).dispose();
  918. var chartDom = document.getElementById("main");
  919. var myChart = echarts.init(chartDom);
  920. var option;
  921. option = {
  922. tooltip: {
  923. trigger: 'axis'
  924. },
  925. legend: {
  926. data: ['起始时间'],
  927. bottom: "10",
  928. },
  929. color:[
  930. '#2671E2',
  931. '#F3787B',
  932. ],
  933. radar: {
  934. // shape: 'circle',
  935. indicator: newlinename
  936. },
  937. series: [
  938. {
  939. type: 'radar',
  940. tooltip: {
  941. trigger: 'item'
  942. },
  943. data: [
  944. {
  945. value:newline,
  946. name: '起始时间'
  947. },
  948. ]
  949. }
  950. ]
  951. };
  952. option && myChart.setOption(option);
  953. window.addEventListener("resize", () => {
  954. myChart.resize();
  955. });
  956. }
  957. },
  958. };
  959. </script>
  960. <style scoped="scoped" lang="scss" >
  961. .box-center {
  962. width: 100%;
  963. padding: 15px;
  964. min-width: 1200px;
  965. padding-bottom: 100px;
  966. }
  967. .table {
  968. border-collapse: collapse;
  969. width: 100%;
  970. }
  971. .tbody {
  972. display: block;
  973. // width: 100%;
  974. // overflow-x: auto;
  975. // overflow-y: auto;
  976. height: 220px;
  977. }
  978. .tbody tr {
  979. display: table;
  980. width: 100%;
  981. table-layout: fixed;
  982. // word-break: break-all;
  983. }
  984. #main {
  985. width: 100%;
  986. height: 380px;
  987. }
  988. .app-box-san {
  989. width: 100%;
  990. background: #ffffff;
  991. box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.04);
  992. border-radius: 4px;
  993. margin-top: 15px;
  994. padding-bottom: 15px;
  995. .santitle {
  996. width: 100%;
  997. height: 50px;
  998. line-height: 50px;
  999. border-bottom: 1px solid #e0e0e0;
  1000. font-size: 16px;
  1001. color: #333333;
  1002. font-weight: 500;
  1003. text-indent: 15px;
  1004. }
  1005. .santab {
  1006. width: 100%;
  1007. height: 400px;
  1008. padding: 15px;
  1009. }
  1010. }
  1011. .app-box-er {
  1012. width: 100%;
  1013. background: #ffffff;
  1014. box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.04);
  1015. border-radius: 4px;
  1016. margin-top: 15px;
  1017. padding: 15px;
  1018. .titletab {
  1019. width: 100%;
  1020. height: 42px;
  1021. display: flex;
  1022. // border: 1px solid red;
  1023. }
  1024. .titletab div {
  1025. width: 130px;
  1026. height: 42px;
  1027. line-height: 42px;
  1028. text-align: center;
  1029. border: 1px solid #e0e0e0;
  1030. font-size: 14px;
  1031. }
  1032. .claindex {
  1033. background: #2671e2;
  1034. color: #ffffff;
  1035. border: none;
  1036. }
  1037. }
  1038. .kapian-box {
  1039. width: 100%;
  1040. height: 144px;
  1041. margin-top: 15px;
  1042. display: flex;
  1043. .kayi {
  1044. flex: 1;
  1045. margin-right: 15px;
  1046. height: 144px;
  1047. background: #ffffff;
  1048. border-radius: 4px;
  1049. .shang {
  1050. width: 100%;
  1051. display: flex;
  1052. .zuo {
  1053. width: 50%;
  1054. .text1 {
  1055. font-size: 16px;
  1056. font-weight: 400;
  1057. color: #666666;
  1058. margin-left: 30px;
  1059. margin-top: 24px;
  1060. }
  1061. .text2 {
  1062. font-size: 32px;
  1063. font-weight: normal;
  1064. color: #32363d;
  1065. margin-left: 30px;
  1066. margin-top: 18px;
  1067. }
  1068. }
  1069. .you {
  1070. width:50%;
  1071. display: flex;
  1072. align-items: center;
  1073. .youimg {
  1074. width: 90%;
  1075. height: 60px;
  1076. }
  1077. }
  1078. }
  1079. .xia {
  1080. width: 100%;
  1081. font-size: 14px;
  1082. text-indent: 30px;
  1083. margin-top: 10px;
  1084. .span1 {
  1085. color: #333333;
  1086. font-weight: 400;
  1087. }
  1088. .span2 {
  1089. color: #e6273a;
  1090. font-weight: 400;
  1091. margin-left: 16px;
  1092. }
  1093. }
  1094. }
  1095. }
  1096. .tophove {
  1097. color: #ffffff;
  1098. background: #2671e2;
  1099. }
  1100. .app-top {
  1101. width: 100%;
  1102. background: #ffffff;
  1103. box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.04);
  1104. border-radius: 4px;
  1105. padding-top: 15px;
  1106. padding-bottom: 15px;
  1107. }
  1108. .app-titel {
  1109. width: 100%;
  1110. display: flex;
  1111. align-items: center;
  1112. .titel-text {
  1113. height: 100%;
  1114. font-size: 16px;
  1115. font-weight: 600;
  1116. color: #32363d;
  1117. text-indent: 30px;
  1118. }
  1119. .toptimeqhuan {
  1120. width: 190px;
  1121. height: 32px;
  1122. background: #ffffff;
  1123. border-radius: 4px;
  1124. border: 1px solid #e0e0e0;
  1125. display: flex;
  1126. align-items: center;
  1127. overflow: hidden;
  1128. margin-left: 20px;
  1129. cursor: pointer;
  1130. }
  1131. .toptimeqhuan div {
  1132. flex: 1;
  1133. text-align: center;
  1134. line-height: 32px;
  1135. font-size: 14px;
  1136. }
  1137. }
  1138. .timeSel {
  1139. margin-top: 8px;
  1140. margin-left: 20px;
  1141. border: 1px solid #ccc;
  1142. padding: 0 5px;
  1143. cursor: pointer;
  1144. color: #606266;
  1145. }
  1146. .theadtd{
  1147. width: 140px;
  1148. height: 48px;
  1149. border: 1px solid #E0E0E0;
  1150. text-align: center;
  1151. line-height: 48px;
  1152. font-size: 16px;
  1153. color: #32363D;
  1154. }
  1155. </style>