You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1237 lines
32 KiB

  1. <template>
  2. <div class="box-center">
  3. <!-- 头 -->
  4. <div class="app-top">
  5. <div class="app-titel" style="margin-left: 15px">
  6. <el-select
  7. v-model="houseTypes"
  8. @change="sysChange"
  9. style="width: 100px; margin-right: 10px"
  10. placeholder="请选择"
  11. >
  12. <el-option
  13. v-for="item in options2"
  14. :key="item.value"
  15. :label="item.label"
  16. :value="item.value"
  17. >
  18. </el-option>
  19. </el-select>
  20. <el-select
  21. v-model="selValue"
  22. @change="selChange"
  23. style="width: 100px"
  24. placeholder="请选择"
  25. >
  26. <el-option label="代理商" v-if="orgType == 0" value="0"></el-option>
  27. <el-option label="公司" v-if="orgType != 2" value="1"></el-option>
  28. <el-option label="楼盘" value="2"></el-option>
  29. </el-select>
  30. <!-- -->
  31. <div style="margin-left: 26px" v-if="selValue == 1">
  32. <el-select
  33. v-model="choicValue"
  34. @change="valuechange"
  35. placeholder="默认为全部"
  36. clearable
  37. filterable
  38. >
  39. <el-option
  40. v-for="item in houseList"
  41. :key="item.orgCode"
  42. :label="item.name"
  43. :value="item.orgCode"
  44. >
  45. </el-option>
  46. </el-select>
  47. </div>
  48. <!-- 楼盘 -->
  49. <div style="margin-left: 26px" v-else-if="selValue == 2">
  50. <el-select
  51. v-model="choicValue"
  52. @change="valuechange"
  53. placeholder="默认为全部"
  54. clearable
  55. filterable
  56. >
  57. <el-option
  58. v-for="item in houseList"
  59. :key="item.id"
  60. :label="item.propertyName"
  61. :value="item.id"
  62. >
  63. </el-option>
  64. </el-select>
  65. </div>
  66. <div style="margin-left: 26px" v-else>
  67. <el-select
  68. v-model="choicValue"
  69. @change="valuechange"
  70. clearable
  71. filterable
  72. placeholder="默认为全部"
  73. >
  74. <el-option
  75. v-for="item in houseList"
  76. :key="item.id"
  77. :label="item.agentName"
  78. :value="item.id"
  79. >
  80. </el-option>
  81. </el-select>
  82. </div>
  83. </div>
  84. </div>
  85. <div class="app-box-er" >
  86. <div class="app-titel" style="margin-bottom: 10px">
  87. <div class="titel-text" style="text-indent: 0; min-width: 64px">
  88. 楼盘趋势
  89. </div>
  90. <div class="toptimeqhuan">
  91. <div :class="{ tophove: dateType == 4 }" @click="tabtimetap(4)">
  92. 近7天
  93. </div>
  94. <div :class="{ tophove: dateType == 5 }" @click="tabtimetap(5)">
  95. 近15天
  96. </div>
  97. <div :class="{ tophove: dateType == 6 }" @click="tabtimetap(6)">
  98. 近30天
  99. </div>
  100. </div>
  101. <div style="margin-left: 20px">
  102. <el-date-picker
  103. @change="confirmtime"
  104. v-model="customtime"
  105. :clearable="false"
  106. type="daterange"
  107. range-separator="-"
  108. format="yyyy-MM-dd"
  109. value-format="yyyy-MM-dd"
  110. start-placeholder="开始日期"
  111. end-placeholder="结束日期"
  112. :picker-options="pickerOptions"
  113. >
  114. </el-date-picker>
  115. </div>
  116. <div style="margin-left: 20px">
  117. <el-checkbox v-model="checked" @change="radioChange"
  118. >对比时间段</el-checkbox
  119. >
  120. </div>
  121. <div
  122. v-if="checked"
  123. style="
  124. margin-left: 20px;
  125. border: 1px solid #dcdfe6;
  126. min-width: 220px;
  127. height: 30px;
  128. border-radius: 4px;
  129. max-width: 360px;
  130. font-size: 13px;
  131. line-height: 30px;
  132. text-indent: 8px;
  133. cursor: pointer;
  134. "
  135. @click="show"
  136. >
  137. <!-- {{ selectTime1 ? "时段二: " : "请选择: " }}
  138. <span v-if="selectTime1">{{ selectTime + "-" + selectTime1 }}</span> -->
  139. <div style="display: flex">
  140. <div style="min-width: 60px">
  141. {{ selectTime1 ? "时段二: " : "请选择: " }}
  142. </div>
  143. <div v-if="selectTime1" style="display: flex">
  144. <!-- {{ selectTime+ "-" + selectTime1}} -->
  145. <div style="min-width: 120px; text-align: center">
  146. {{ selectTime }}
  147. </div>
  148. <span>-</span>
  149. <div
  150. style="min-width: 120px; text-align: center; margin-right: 32px"
  151. >
  152. {{ selectTime1 }}
  153. </div>
  154. </div>
  155. </div>
  156. <el-date-picker
  157. style="opacity: 0"
  158. v-model="time"
  159. @change="timeChange"
  160. ref="time"
  161. type="date"
  162. placeholder="选择日期"
  163. format="yyyy-MM-dd"
  164. value-format="yyyy-MM-dd"
  165. :picker-options="pickerOptions"
  166. >
  167. </el-date-picker>
  168. </div>
  169. </div>
  170. <div class="container">
  171. <div
  172. class="grid-content"
  173. @click="secondChange('receptionCount', '接待客户/个')"
  174. style="height: auto; padding-bottom: 10px"
  175. >
  176. <div
  177. class="text1"
  178. :class="{ tophovese: secindex == 'receptionCount' }"
  179. >
  180. 接待量
  181. </div>
  182. <div
  183. class="text2"
  184. :class="{ tophovese: secindex == 'receptionCount' }"
  185. >
  186. {{ compare.receptionCount || 0 }}
  187. </div>
  188. <div class="text33" v-if="selectTime1">
  189. <div>
  190. 对比时段:
  191. <span style="text-indent: 20px">{{
  192. compare1.receptionCount || 0
  193. }}</span>
  194. </div>
  195. <div
  196. :style="
  197. compare2.receptionCount >= 0 ? 'color:green;' : 'color:red;'
  198. "
  199. >
  200. {{ compare2.receptionCount || 0 }}
  201. </div>
  202. </div>
  203. </div>
  204. <div
  205. class="grid-content"
  206. @click="secondChange('avgDuration', '平均接待时长/分钟')"
  207. style="height: auto"
  208. >
  209. <div class="text1" :class="{ tophovese: secindex == 'avgDuration' }">
  210. 平均接待时长(分钟)
  211. </div>
  212. <div class="text2" :class="{ tophovese: secindex == 'avgDuration' }">
  213. {{ compare.avgDuration || 0 }}
  214. </div>
  215. <div class="text33" v-if="selectTime1">
  216. <div>
  217. 对比时段:
  218. <span style="text-indent: 20px">{{
  219. compare1.avgDuration || 0
  220. }}</span>
  221. </div>
  222. <div
  223. :style="compare2.avgDuration >= 0 ? 'color:green;' : 'color:red;'"
  224. >
  225. {{ compare2.avgDuration || 0 }}
  226. </div>
  227. </div>
  228. </div>
  229. <div
  230. class="grid-content"
  231. @click="secondChange('prohibitedCustomer', '违禁接待次数/次')"
  232. style="height: auto; padding-bottom: 10px"
  233. >
  234. <div
  235. class="text1"
  236. :class="{ tophovese: secindex == 'prohibitedCustomer' }"
  237. >
  238. 违禁接待次数
  239. </div>
  240. <div
  241. class="text2"
  242. :class="{ tophovese: secindex == 'prohibitedCustomer' }"
  243. >
  244. {{ compare.prohibitedCustomer || 0 }}
  245. </div>
  246. <div class="text33" v-if="selectTime1">
  247. <div>
  248. 对比时段:
  249. <span style="text-indent: 20px">{{
  250. compare1.prohibitedCustomer || 0
  251. }}</span>
  252. </div>
  253. <div
  254. :style="
  255. compare2.prohibitedCustomer >= 0 ? 'color:green;' : 'color:red;'
  256. "
  257. >
  258. {{ compare2.prohibitedCustomer || 0 }}
  259. </div>
  260. </div>
  261. </div>
  262. <div
  263. class="grid-content"
  264. @click="secondChange('activeCustomer', '有效接待/次')"
  265. style="height: auto; padding-bottom: 10px"
  266. >
  267. <div
  268. class="text1"
  269. :class="{ tophovese: secindex == 'activeCustomer' }"
  270. >
  271. 有效接待
  272. </div>
  273. <div
  274. class="text2"
  275. :class="{ tophovese: secindex == 'activeCustomer' }"
  276. >
  277. {{ compare.activeCustomer || 0 }}
  278. </div>
  279. <div class="text33" v-if="selectTime1">
  280. <div>
  281. 对比时段:
  282. <span style="text-indent: 20px">{{
  283. compare1.activeCustomer || 0
  284. }}</span>
  285. </div>
  286. <div
  287. :style="
  288. compare2.activeCustomer >= 0 ? 'color:green;' : 'color:red;'
  289. "
  290. >
  291. {{ compare2.activeCustomer || 0 }}
  292. </div>
  293. </div>
  294. </div>
  295. <div
  296. class="grid-content"
  297. @click="secondChange('activeCustomerRate', '有效接待占比/%')"
  298. style="height: auto; padding-bottom: 10px"
  299. >
  300. <div
  301. class="text1"
  302. :class="{ tophovese: secindex == 'activeCustomerRate' }"
  303. >
  304. 有效接待占比/%
  305. </div>
  306. <div
  307. class="text2"
  308. :class="{ tophovese: secindex == 'activeCustomerRate' }"
  309. >
  310. {{ compare.activeCustomerRate || 0 }}
  311. </div>
  312. <div class="text33" v-if="selectTime1">
  313. <div>
  314. 对比时段:
  315. <span style="text-indent: 20px">{{
  316. compare1.activeCustomerRate || 0
  317. }}</span>
  318. </div>
  319. <div
  320. :style="
  321. compare2.activeCustomerRate >= 0 ? 'color:green;' : 'color:red;'
  322. "
  323. >
  324. {{ compare2.activeCustomerRate || 0 }}%
  325. </div>
  326. </div>
  327. </div>
  328. <div
  329. class="grid-content"
  330. @click="secondChange('fraction', '平均执行率/%')"
  331. style="height: auto; padding-bottom: 10px"
  332. >
  333. <div class="text1" :class="{ tophovese: secindex == 'fraction' }">
  334. 平均执行率/%
  335. </div>
  336. <div class="text2" :class="{ tophovese: secindex == 'fraction' }">
  337. {{ compare.fraction || 0 }}
  338. </div>
  339. <div class="text33" v-if="selectTime1">
  340. <div>
  341. 对比时段:
  342. <span style="text-indent: 20px">{{
  343. compare1.fraction || 0
  344. }}</span>
  345. </div>
  346. <div
  347. :style="compare2.fraction >= 0 ? 'color:green;' : 'color:red;'"
  348. >
  349. {{ compare2.fraction || 0 }}%
  350. </div>
  351. </div>
  352. </div>
  353. </div>
  354. <div id="main"></div>
  355. </div>
  356. <div class="app-box-er" v-if="selectTime1">
  357. <template>
  358. <el-table :data="tableData" style="width: 100%" height="320">
  359. <el-table-column prop="time" label="时间" align="center">
  360. </el-table-column>
  361. <el-table-column prop="data1" label="时段一" align="center">
  362. <template slot-scope="{ row }">
  363. <span
  364. v-if="
  365. secindex == 'fraction' || secindex == 'activeCustomerRate'
  366. "
  367. >
  368. {{ row.data1 }}%</span
  369. >
  370. <span v-else> {{ row.data1 }}</span>
  371. </template>
  372. </el-table-column>
  373. <el-table-column prop="data2" label="时段二" align="center">
  374. <template slot-scope="{ row }">
  375. <span
  376. v-if="
  377. secindex == 'fraction' || secindex == 'activeCustomerRate'
  378. "
  379. >
  380. {{ row.data2 }}%</span
  381. >
  382. <span v-else> {{ row.data2 }}</span>
  383. </template>
  384. </el-table-column>
  385. <el-table-column prop="data3" label="变化" align="center">
  386. <template slot-scope="scope">
  387. <span
  388. v-if="
  389. secindex == 'fraction' || secindex == 'activeCustomerRate'
  390. "
  391. :style="scope.row.data3 >= 0 ? 'color:green;' : 'color:red;'"
  392. >{{ scope.row.data3 }}%</span
  393. >
  394. <span
  395. v-else
  396. :style="scope.row.data3 >= 0 ? 'color:green;' : 'color:red;'"
  397. >{{ scope.row.data3 }}</span
  398. >
  399. </template>
  400. </el-table-column>
  401. </el-table>
  402. </template>
  403. </div>
  404. </div>
  405. </template>
  406. <script>
  407. import * as echarts from "echarts";
  408. import topLogsVue from "../../page/index/top/top-logs.vue";
  409. export default {
  410. data() {
  411. return {
  412. pickerOptions: {
  413. disabledDate(time) {
  414. //根据当前日期 --- 禁止选中之后的日期
  415. // return time.getTime() > Date.now();
  416. },
  417. },
  418. firstTab: {},
  419. tableData: [],
  420. secondTab: {},
  421. thirdTab: {},
  422. selValue:
  423. localStorage.getItem("orgType") == 0
  424. ? "0"
  425. : localStorage.getItem("orgType") == 1
  426. ? "1"
  427. : "2",
  428. checked: false,
  429. selectTime1: "", //对比时间
  430. selectTime: "", //对比时间
  431. choicValue: "",
  432. orgType: localStorage.getItem("orgType"),
  433. houseList: [],
  434. secindex: "receptionCount",
  435. dateType: 4,
  436. compare: {},
  437. compare1: {},
  438. compare2: {},
  439. time: [],
  440. customtime: [],
  441. Confirmthecontrast: false,
  442. cardindex: "1",
  443. options: [
  444. {
  445. label: "代理商",
  446. value: "0",
  447. },
  448. {
  449. label: "公司",
  450. value: "1",
  451. },
  452. {
  453. label: "楼盘",
  454. value: "2",
  455. },
  456. ],
  457. options2: [
  458. {
  459. label: "正式数据",
  460. value: "0,1",
  461. },
  462. {
  463. label: "测试数据",
  464. value: "2,3",
  465. },
  466. ],
  467. houseTypes:'0,1'
  468. };
  469. },
  470. mounted() {
  471. this.getList();
  472. this.tabtimetap(4);
  473. },
  474. methods: {
  475. sysChange(){
  476. this.choicValue=''
  477. this.selValue='0'
  478. this.getList()
  479. },
  480. // 获取tab2
  481. receptionOverviewOfSystem() {
  482. let obj = {
  483. startDate: this.dateType ? "" : this.customtime[0],
  484. endDate: this.dateType ? "" : this.customtime[1],
  485. contrastStartDate: this.selectTime,
  486. contrastEndDate: this.selectTime1,
  487. dateType: this.dateType,
  488. agentId: this.selValue == 0 ? this.choicValue : null,
  489. orgCode: this.selValue == 1 ? this.choicValue : null,
  490. houseId: this.selValue == 2 ? this.choicValue : null,
  491. orgType: localStorage.getItem("orgType"),
  492. queryOrgType:this.selValue/1+1,
  493. houseTypes: this.houseTypes,
  494. };
  495. if (obj.orgType == 1) {
  496. obj.agentId = localStorage.getItem("agentId");
  497. }
  498. if (obj.orgType == 2) {
  499. obj.orgCode = localStorage.getItem("orgCode");
  500. }
  501. this.$api.api.receptionOverviewOfSystem(obj).then((res) => {
  502. this.compare = res.data.firstData;
  503. if (this.selectTime1) {
  504. // 有对比
  505. this.compare1 = res.data.secondData;
  506. // 将得到的三者的数据进行组装为一个数组
  507. this.compare2 = res.data.thirdData;
  508. }
  509. this.getChars("receptionCount", "接待客户/个");
  510. });
  511. },
  512. async getChars(str, str1) {
  513. let obj = {
  514. startDate: this.dateType ? "" : this.customtime[0],
  515. endDate: this.dateType ? "" : this.customtime[1],
  516. contrastStartDate: this.selectTime,
  517. contrastEndDate: this.selectTime1,
  518. dateType: this.dateType,
  519. agentId: this.selValue == 0 ? this.choicValue : null,
  520. orgCode: this.selValue == 1 ? this.choicValue : null,
  521. houseId: this.selValue == 2 ? this.choicValue : null,
  522. orgType: localStorage.getItem("orgType"),
  523. queryOrgType:this.selValue/1+1,
  524. houseTypes: this.houseTypes,
  525. };
  526. if (obj.orgType == 1) {
  527. obj.agentId = localStorage.getItem("agentId");
  528. }
  529. if (obj.orgType == 2) {
  530. obj.orgCode = localStorage.getItem("orgCode");
  531. }
  532. if (!this.selectTime1) {
  533. let res = await this.$api.api.receptionDataOfSystem(obj);
  534. // console.log(res, str);
  535. // return
  536. // console.log(idx);
  537. let Strname = [str1];
  538. let timeDate = [];
  539. let arr1 = [];
  540. // 判断是第几个然后对数据进行渲染
  541. // 先处理时间
  542. // console.log(timeDate);
  543. res.data.firstValue.map((item) => {
  544. timeDate.push(item.statDate.substring(5, 10));
  545. arr1.push(item[str] || 0);
  546. });
  547. let arr = [
  548. {
  549. name: Strname[0],
  550. data: arr1,
  551. type: "line",
  552. smooth: true,
  553. },
  554. ];
  555. this.SwitchCARDS(arr, "main", timeDate, Strname);
  556. } else {
  557. let res = await this.$api.api.receptionDataOfSystem(obj);
  558. // console.log(res, str);
  559. // return
  560. let Strname = ["时段一", "时段二"];
  561. let timeDate = [];
  562. // 判断是第几个然后对数据进行渲染
  563. // 先处理时间
  564. let arr1 = [];
  565. let arr2 = [];
  566. let arr3 = [];
  567. res.data.firstValue.map((item, idx) => {
  568. timeDate.push(
  569. item.statDate.substring(5, 10) +
  570. "VS" +
  571. res.data.secondValue[idx].statDate.substring(5, 10)
  572. );
  573. arr1.push(item[str]);
  574. arr2.push(res.data.secondValue[idx][str]);
  575. arr3.push(res.data.thirdData[idx][str]);
  576. });
  577. let arr = [
  578. {
  579. name: Strname[0],
  580. data: arr1,
  581. type: "line",
  582. smooth: true,
  583. },
  584. {
  585. name: Strname[1],
  586. data: arr2,
  587. type: "line",
  588. smooth: true,
  589. },
  590. ];
  591. this.SwitchCARDS(arr, "main", timeDate, Strname);
  592. let tableData = [];
  593. timeDate.map((item, idx) => {
  594. let obj = {
  595. time: item,
  596. data1: arr1[idx],
  597. data2: arr2[idx],
  598. data3: arr3[idx],
  599. };
  600. tableData.push(obj);
  601. });
  602. this.tableData = tableData;
  603. // console.log(tableData);
  604. }
  605. },
  606. //时间tab切换
  607. tabtimetap(i) {
  608. this.dateType = i;
  609. this.checked = false;
  610. this.selectTime = "";
  611. this.selectTime1 = "";
  612. //给时间选择器赋值
  613. let num = 24 * 3600 * 1000;
  614. // 获取当前时间戳转换为日期格式
  615. if (this.dateType == 4) {
  616. num = 24 * 3600 * 1000 * 6;
  617. }
  618. if (this.dateType == 5) {
  619. num = 24 * 3600 * 1000 * 14;
  620. }
  621. if (this.dateType == 6) {
  622. num = 24 * 3600 * 1000 * 29;
  623. }
  624. this.customtime = [
  625. this.timestampToTime(new Date().getTime() - num),
  626. this.timestampToTime(new Date().getTime()),
  627. ];
  628. this.$set(this, "time", null);
  629. this.Confirmthecontrast = false;
  630. this.receptionOverviewOfSystem();
  631. },
  632. show() {
  633. this.$refs.time.pickerVisible = true;
  634. },
  635. timeChange(e) {
  636. // 对数据进行处理
  637. // 当当前选择的为自定义时间时
  638. this.selectTime = "";
  639. this.selectTime1 = "";
  640. this.timeSelect(e);
  641. },
  642. timeSelect(e) {
  643. if (this.dateType == null) {
  644. this.selectTime = e;
  645. this.selectTime1 = this.timestampToTime(
  646. new Date(e).getTime() +
  647. new Date(this.customtime[1]).getTime() -
  648. new Date(this.customtime[0]).getTime()
  649. );
  650. } else {
  651. let num = 24 * 3600 * 1000;
  652. if (this.dateType == 4) {
  653. num = 24 * 3600 * 1000 * 6;
  654. }
  655. if (this.dateType == 5) {
  656. num = 24 * 3600 * 1000 * 14;
  657. }
  658. if (this.dateType == 6) {
  659. num = 24 * 3600 * 1000 * 29;
  660. }
  661. this.selectTime = e;
  662. this.selectTime1 = this.timestampToTime(new Date(e).getTime() + num);
  663. }
  664. console.log(this.selectTime, this.selectTime1);
  665. this.Confirmthecontrast = true;
  666. this.receptionOverviewOfSystem();
  667. },
  668. getList() {
  669. console.log(this.selValue);
  670. // 当为楼盘选择时
  671. if (this.selValue == 1) {
  672. this.$api.api
  673. .findMyOrg({
  674. orgType: localStorage.getItem("orgType"),
  675. agentId: localStorage.getItem("agentId"),
  676. })
  677. .then((res) => {
  678. this.houseList = res.data;
  679. this.receptionOverviewOfSystem();
  680. });
  681. } else if (this.selValue == 2) {
  682. this.$api.api
  683. .findHouseByUser({
  684. orgType: localStorage.getItem("orgType"),
  685. houseId: localStorage.getItem("houseId"),
  686. houseTypes: this.houseTypes,
  687. })
  688. .then((res) => {
  689. this.houseList = res.data;
  690. this.receptionOverviewOfSystem();
  691. });
  692. } else {
  693. this.$api.api
  694. .findMyAgent({
  695. orgType: localStorage.getItem("orgType"),
  696. })
  697. .then((res) => {
  698. this.houseList = res.data;
  699. this.receptionOverviewOfSystem();
  700. });
  701. }
  702. },
  703. secondChange(i, str) {
  704. this.secindex = i;
  705. this.getChars(i, str);
  706. },
  707. confirmtime(e) {
  708. this.dateType = null;
  709. this.checked = false;
  710. this.selectTime = "";
  711. this.selectTime1 = "";
  712. this.$set(this, "time", null);
  713. if (!e) return;
  714. this.Confirmthecontrast = false;
  715. this.receptionOverviewOfSystem();
  716. },
  717. selChange() {
  718. this.choicValue = "";
  719. this.dateType = 4;
  720. this.getList();
  721. },
  722. valuechange() {
  723. this.receptionOverviewOfSystem();
  724. },
  725. radioChange() {
  726. this.selectTime = "";
  727. this.selectTime1 = "";
  728. this.$set(this, "time", null);
  729. if (!this.checked) {
  730. this.receptionOverviewOfSystem();
  731. }
  732. },
  733. timestampToTime(timestamp) {
  734. var date = new Date(timestamp); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
  735. // var date = new Date(timestamp * 1000);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
  736. var yyyy = date.getFullYear() + "-";
  737. var MM =
  738. (date.getMonth() + 1 < 10
  739. ? "0" + (date.getMonth() + 1)
  740. : date.getMonth() + 1) + "-";
  741. // var dd = date.getDate() + ' ';
  742. var dd =
  743. (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " ";
  744. return yyyy + MM + dd;
  745. },
  746. //卡片下折线图
  747. SwitchCARDS(arr, str, timeDate, Strname) {
  748. echarts.init(document.getElementById(str)).dispose(); // 销毁实例
  749. var chartDom = document.getElementById(str);
  750. var myChart = echarts.init(chartDom);
  751. var option;
  752. option = {
  753. color: [
  754. "#6F8EDC",
  755. "#EE6666",
  756. "#F98120",
  757. "#1CC99E",
  758. "#9474FB",
  759. "#66AFF5",
  760. "#FABD2B",
  761. "#FFCF8F",
  762. "#657292",
  763. "#7A6A99",
  764. "#BF5D52",
  765. "#77B7E4",
  766. "#E6A065",
  767. "#9D5139",
  768. "#C1AA88",
  769. "#F87F7A",
  770. "#F6CF74",
  771. "#7F5506",
  772. "#88BB9B",
  773. "#6E99AA",
  774. "#5789D0",
  775. ],
  776. legend: {
  777. data: Strname,
  778. bottom: "10",
  779. },
  780. grid: {
  781. left: 10,
  782. right: 10,
  783. containLabel: true,
  784. },
  785. xAxis: {
  786. type: "category",
  787. data: timeDate,
  788. axisLabel: {
  789. //重点在这一块,其余可以忽略
  790. textStyle: {
  791. color: "#212121", //更改坐标轴文字颜色
  792. },
  793. },
  794. axisLine: {
  795. lineStyle: {
  796. type: "solid",
  797. color: "#DDE1EE", //x线的颜色
  798. width: "1", //坐标线的宽度
  799. },
  800. },
  801. },
  802. series: arr,
  803. };
  804. if (
  805. this.secindex == "fraction" ||
  806. this.secindex == "activeCustomerRate"
  807. ) {
  808. if (this.selectTime1) {
  809. option.tooltip = {
  810. trigger: "axis",
  811. formatter: function (params) {
  812. let src =
  813. "<p>" +
  814. params[0].seriesName +
  815. ":" +
  816. params[0].data +
  817. "%" +
  818. "</p>" +
  819. "<p>" +
  820. params[1].seriesName +
  821. ":" +
  822. params[1].data +
  823. "%" +
  824. "</p>";
  825. return src;
  826. },
  827. };
  828. } else {
  829. option.tooltip = {
  830. trigger: "axis",
  831. formatter: "{b0}:{c0}" + "%",
  832. };
  833. }
  834. option.yAxis = {
  835. type: "value",
  836. splitNumber: 5,
  837. max: 100,
  838. min: 0,
  839. axisLabel: {
  840. //重点在这一块,其余可以忽略
  841. textStyle: {
  842. color: "#212121", //更改坐标轴文字颜色
  843. },
  844. },
  845. axisLine: {
  846. lineStyle: {
  847. ype: "solid",
  848. color: "#DDE1EE", //x线的颜色
  849. width: "1", //坐标线的宽度
  850. },
  851. },
  852. splitLine: {
  853. lineStyle: {
  854. type: "dashed", // y轴分割线类型
  855. },
  856. },
  857. axisTick: {
  858. //y轴刻度线
  859. show: false,
  860. },
  861. };
  862. } else if (this.secindex == "avgDuration") {
  863. if (this.selectTime1) {
  864. option.tooltip = {
  865. trigger: "axis",
  866. formatter: function (params) {
  867. let src =
  868. "<p>" +
  869. params[0].seriesName +
  870. ":" +
  871. params[0].data +
  872. "分钟" +
  873. "</p>" +
  874. "<p>" +
  875. params[1].seriesName +
  876. ":" +
  877. params[1].data +
  878. "分钟" +
  879. "</p>";
  880. return src;
  881. },
  882. };
  883. } else {
  884. option.tooltip = {
  885. trigger: "axis",
  886. formatter: "{b0}:{c0}" + "分钟",
  887. };
  888. }
  889. option.yAxis = {
  890. type: "value",
  891. splitNumber: 4,
  892. axisLabel: {
  893. //重点在这一块,其余可以忽略
  894. textStyle: {
  895. color: "#212121", //更改坐标轴文字颜色
  896. },
  897. },
  898. axisLine: {
  899. lineStyle: {
  900. ype: "solid",
  901. color: "#DDE1EE", //x线的颜色
  902. width: "1", //坐标线的宽度
  903. },
  904. },
  905. splitLine: {
  906. lineStyle: {
  907. type: "dashed", // y轴分割线类型
  908. },
  909. },
  910. axisTick: {
  911. //y轴刻度线
  912. show: false,
  913. },
  914. };
  915. } else {
  916. if (this.selectTime1) {
  917. option.tooltip = {
  918. trigger: "axis",
  919. formatter: function (params) {
  920. let src =
  921. "<p>" +
  922. params[0].seriesName +
  923. ":" +
  924. params[0].data +
  925. "次" +
  926. "</p>" +
  927. "<p>" +
  928. params[1].seriesName +
  929. ":" +
  930. params[1].data +
  931. "次" +
  932. "</p>";
  933. return src;
  934. },
  935. };
  936. } else {
  937. option.tooltip = {
  938. trigger: "axis",
  939. formatter: "{b0}:{c0}" + "次",
  940. };
  941. }
  942. option.yAxis = {
  943. type: "value",
  944. splitNumber: 4,
  945. axisLabel: {
  946. //重点在这一块,其余可以忽略
  947. textStyle: {
  948. color: "#212121", //更改坐标轴文字颜色
  949. },
  950. },
  951. axisLine: {
  952. lineStyle: {
  953. ype: "solid",
  954. color: "#DDE1EE", //x线的颜色
  955. width: "1", //坐标线的宽度
  956. },
  957. },
  958. splitLine: {
  959. lineStyle: {
  960. type: "dashed", // y轴分割线类型
  961. },
  962. },
  963. axisTick: {
  964. //y轴刻度线
  965. show: false,
  966. },
  967. };
  968. }
  969. option && myChart.setOption(option);
  970. window.addEventListener("resize", () => {
  971. myChart.resize();
  972. });
  973. },
  974. },
  975. };
  976. </script>
  977. <style scoped="scoped" lang="scss" >
  978. .box-center {
  979. width: 100%;
  980. padding: 15px;
  981. min-width: 1000px;
  982. padding-bottom: 100px;
  983. }
  984. .container {
  985. display: grid;
  986. grid-template-columns: repeat(6, 16%);
  987. grid-column-gap: 8px;
  988. grid-row-gap: 18px;
  989. }
  990. .container1 {
  991. display: grid;
  992. grid-template-columns: repeat(3, 30%);
  993. grid-column-gap: 66px;
  994. grid-row-gap: 18px;
  995. }
  996. // 进度条
  997. .jinbox {
  998. width: 100%;
  999. height: 18px;
  1000. line-height: 18px;
  1001. display: flex;
  1002. font-size: 16px;
  1003. color: #2c3542;
  1004. margin-top: 20px;
  1005. .jinboxtit {
  1006. width: 14%;
  1007. height: 18px;
  1008. padding-right: 6px;
  1009. white-space: nowrap;
  1010. text-overflow: ellipsis;
  1011. overflow: hidden;
  1012. }
  1013. .jinbox-box {
  1014. width: 75%;
  1015. height: 100%;
  1016. border-radius: 8px;
  1017. background: #f2f2f2;
  1018. }
  1019. .boxbaifenbi {
  1020. height: 100%;
  1021. background: #60d7a0;
  1022. border-radius: 8px;
  1023. }
  1024. .boxbaifenbi2 {
  1025. height: 100%;
  1026. background: #5b8ff9;
  1027. }
  1028. .jinboxbott {
  1029. width: 16%;
  1030. text-indent: 20px;
  1031. }
  1032. }
  1033. #main {
  1034. width: 100%;
  1035. height: 380px;
  1036. }
  1037. #echar2 {
  1038. width: 100%;
  1039. height: 380px;
  1040. }
  1041. #Brokenline1 {
  1042. width: 100%;
  1043. height: 350px;
  1044. }
  1045. #Brokenline2 {
  1046. width: 100%;
  1047. height: 350px;
  1048. }
  1049. #Pinspeak1 {
  1050. width: 100%;
  1051. height: 350px;
  1052. }
  1053. #Pinspeak2 {
  1054. width: 100%;
  1055. height: 350px;
  1056. }
  1057. .app-box-san {
  1058. width: 100%;
  1059. // height: 400px;
  1060. display: flex;
  1061. margin-top: 15px;
  1062. .zuo {
  1063. flex: 1;
  1064. height: 100%;
  1065. margin-right: 15px;
  1066. background: #ffffff;
  1067. border-radius: 4px;
  1068. .title {
  1069. width: 100%;
  1070. height: 55px;
  1071. border-bottom: 1px solid #e0e0e0;
  1072. display: flex;
  1073. align-content: center;
  1074. .text1 {
  1075. flex: 2;
  1076. line-height: 55px;
  1077. text-indent: 20px;
  1078. font-weight: 500;
  1079. font-size: 16px;
  1080. color: #333333;
  1081. }
  1082. .text2 {
  1083. flex: 1;
  1084. height: 55px;
  1085. display: flex;
  1086. align-items: center;
  1087. }
  1088. }
  1089. }
  1090. .you {
  1091. height: 100%;
  1092. flex: 1;
  1093. background: #ffffff;
  1094. border-radius: 4px;
  1095. .title {
  1096. width: 100%;
  1097. height: 55px;
  1098. border-bottom: 1px solid #e0e0e0;
  1099. display: flex;
  1100. align-content: center;
  1101. .text1 {
  1102. flex: 2;
  1103. line-height: 55px;
  1104. text-indent: 20px;
  1105. font-weight: 500;
  1106. font-size: 16px;
  1107. color: #333333;
  1108. }
  1109. .text2 {
  1110. flex: 1;
  1111. height: 55px;
  1112. display: flex;
  1113. align-items: center;
  1114. }
  1115. }
  1116. }
  1117. }
  1118. .app-box-er {
  1119. width: 100%;
  1120. background: #ffffff;
  1121. box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.04);
  1122. border-radius: 4px;
  1123. margin-top: 15px;
  1124. padding: 15px;
  1125. }
  1126. .grid-content {
  1127. background: #ffffff;
  1128. height: 90px;
  1129. border: 1px solid #e0e0e0;
  1130. cursor: pointer;
  1131. .text1 {
  1132. height: 16px;
  1133. font-size: 16px;
  1134. font-weight: 400;
  1135. line-height: 16px;
  1136. text-indent: 20px;
  1137. margin-top: 20px;
  1138. }
  1139. .text2 {
  1140. height: 32px;
  1141. font-size: 32px;
  1142. font-weight: normal;
  1143. line-height: 32px;
  1144. text-indent: 20px;
  1145. margin-top: 10px;
  1146. }
  1147. }
  1148. .tophove {
  1149. color: #ffffff;
  1150. background: #2671e2;
  1151. }
  1152. .tophovese {
  1153. color: #2671e2;
  1154. }
  1155. .app-top {
  1156. width: 100%;
  1157. background: #ffffff;
  1158. box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.04);
  1159. border-radius: 4px;
  1160. padding-top: 15px;
  1161. padding-bottom: 15px;
  1162. }
  1163. .app-titel {
  1164. width: 100%;
  1165. display: flex;
  1166. align-items: center;
  1167. .titel-text {
  1168. height: 100%;
  1169. font-size: 16px;
  1170. font-weight: 600;
  1171. color: #32363d;
  1172. text-indent: 30px;
  1173. }
  1174. .toptimeqhuan {
  1175. width: 190px;
  1176. height: 32px;
  1177. background: #ffffff;
  1178. border-radius: 4px;
  1179. border: 1px solid #e0e0e0;
  1180. display: flex;
  1181. align-items: center;
  1182. overflow: hidden;
  1183. margin-left: 20px;
  1184. cursor: pointer;
  1185. }
  1186. .toptimeqhuan div {
  1187. flex: 1;
  1188. text-align: center;
  1189. line-height: 32px;
  1190. font-size: 14px;
  1191. }
  1192. }
  1193. .hejisan {
  1194. width: 92%;
  1195. margin: 0 auto;
  1196. display: flex;
  1197. margin-top: 15px;
  1198. .text1-1 {
  1199. color: #666666;
  1200. }
  1201. .text1-2 {
  1202. color: #333333;
  1203. margin-top: 10px;
  1204. }
  1205. }
  1206. .app_titile {
  1207. display: flex;
  1208. justify-content: space-between;
  1209. }
  1210. .text33 {
  1211. font-size: 12px;
  1212. text-indent: 20px;
  1213. line-height: 20px;
  1214. display: flex;
  1215. justify-content: space-between;
  1216. margin-right: 20px;
  1217. }
  1218. </style>