tongjiSchool.vue 27 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012
  1. <template>
  2. <div>
  3. <basic-container>
  4. <div class="container" style="height: 400px;">
  5. <div class="container-items">
  6. <but-card
  7. iconName="el-icon-edit-outline"
  8. name="小学部工资"
  9. @click.native="inPage(1)"
  10. />
  11. <but-card
  12. iconName="el-icon-edit-outline"
  13. name="初中部工资"
  14. @click.native="inPage(2)"
  15. />
  16. <but-card
  17. iconName="el-icon-edit-outline"
  18. name="高中部工资"
  19. @click.native="inPage(3)"
  20. />
  21. <but-card
  22. iconName="el-icon-edit-outline"
  23. name="后勤部工资"
  24. @click.native="inPage(4)"
  25. />
  26. <but-card
  27. iconName="el-icon-edit-outline"
  28. name="添加教师"
  29. @click.native="inPage(5)"
  30. />
  31. <but-card
  32. iconName="el-icon-edit-outline"
  33. name="添加后勤"
  34. @click.native="inPage(6)"
  35. />
  36. </div>
  37. <index-card title="教师工资总体数据" iconName="el-icon-view">
  38. <div slot="select">
  39. <el-date-picker
  40. v-model="annual2"
  41. type="year"
  42. size="mini"
  43. placeholder="选择年"
  44. value-format="yyyy"
  45. style="margin-right:10px"
  46. @change="getsalaryData"
  47. >
  48. </el-date-picker>
  49. <el-select
  50. slot="content"
  51. size="mini"
  52. v-model="salaryType2"
  53. placeholder="请选择"
  54. @change="getsalaryData"
  55. >
  56. <el-option
  57. v-for="item in options"
  58. :key="item.value"
  59. :label="item.label"
  60. :value="item.value"
  61. >
  62. </el-option>
  63. </el-select>
  64. </div>
  65. <div slot="content" style="height:290px">
  66. <avue-data-icons :option="option"></avue-data-icons>
  67. </div>
  68. </index-card>
  69. </div>
  70. </basic-container>
  71. <basic-container>
  72. <index-card
  73. title="工资总额环比走势图"
  74. iconName="el-icon-s-fold"
  75. style="height:500px;margin-bottom: 30px"
  76. >
  77. <div slot="select">
  78. <el-date-picker
  79. v-model="annual"
  80. type="year"
  81. size="mini"
  82. placeholder="选择年"
  83. value-format="yyyy"
  84. style="margin-right:10px"
  85. @change="getsalaryStatistics"
  86. >
  87. </el-date-picker>
  88. <el-select
  89. slot="content"
  90. size="mini"
  91. v-model="salaryType"
  92. placeholder="请选择"
  93. @change="getsalaryStatistics"
  94. >
  95. <el-option
  96. v-for="item in options"
  97. :key="item.value"
  98. :label="item.label"
  99. :value="item.value"
  100. >
  101. </el-option>
  102. </el-select>
  103. </div>
  104. <div slot="content" style="height:450px" id="commoDity"></div>
  105. </index-card>
  106. <br />
  107. </basic-container>
  108. <basic-container>
  109. <index-card
  110. title="工资总额同比走势图"
  111. iconName="el-icon-s-fold"
  112. style="height:500px;margin-bottom: 30px"
  113. >
  114. <div slot="select">
  115. <el-date-picker
  116. v-model="annual3"
  117. type="year"
  118. size="mini"
  119. placeholder="选择年"
  120. value-format="yyyy"
  121. style="margin-right:10px"
  122. @change="getsalaryDataChain"
  123. >
  124. </el-date-picker>
  125. <el-select
  126. slot="content"
  127. size="mini"
  128. v-model="salaryType3"
  129. placeholder="请选择"
  130. style="margin-right:10px"
  131. @change="getsalaryDataChain"
  132. >
  133. <el-option
  134. v-for="item in options"
  135. :key="item.value"
  136. :label="item.label"
  137. :value="item.value"
  138. >
  139. </el-option>
  140. </el-select>
  141. <el-select
  142. slot="content"
  143. size="mini"
  144. v-model="moon"
  145. placeholder="请选择月份"
  146. @change="moonChange"
  147. clearable
  148. style="margin-right:10px"
  149. >
  150. <el-option
  151. v-for="item in moonList"
  152. :key="item.value"
  153. :label="item.dictValue"
  154. :value="item.dictKey"
  155. >
  156. </el-option>
  157. </el-select>
  158. <el-select
  159. slot="content"
  160. size="mini"
  161. v-model="semester"
  162. placeholder="请选择学期"
  163. clearable
  164. @change="semesterChange"
  165. >
  166. <el-option
  167. v-for="item in options2"
  168. :key="item.value"
  169. :label="item.label"
  170. :value="item.value"
  171. >
  172. </el-option>
  173. </el-select>
  174. </div>
  175. <div slot="content" style="height:450px" id="commoDity2"></div>
  176. </index-card>
  177. <br />
  178. </basic-container>
  179. <basic-container>
  180. <index-card
  181. title="人均月工资对比走势图"
  182. iconName="el-icon-s-fold"
  183. style="height:500px;margin-bottom: 30px"
  184. >
  185. <div slot="select">
  186. <el-date-picker
  187. v-model="annual4"
  188. type="year"
  189. size="mini"
  190. placeholder="选择年"
  191. value-format="yyyy"
  192. style="margin-right:10px"
  193. @change="getsalaryAverage"
  194. >
  195. </el-date-picker>
  196. </div>
  197. <div slot="content" style="height:450px" id="commoDity3"></div>
  198. </index-card>
  199. <br />
  200. </basic-container>
  201. </div>
  202. </template>
  203. <script>
  204. import { getYearDate } from "@/util/date";
  205. import {
  206. salaryStatistics,
  207. salaryData,
  208. salaryDataChain,
  209. salaryAverage
  210. } from "@/api/wel";
  211. import { mapGetters } from "vuex";
  212. import indexCard from "../components/card.vue";
  213. import butCard from "../components/butCard.vue";
  214. export default {
  215. name: "wel",
  216. data() {
  217. return {
  218. tradeType: null,
  219. moon: null,
  220. semester: null,
  221. moonList: [],
  222. fsalaryList2: [],
  223. studentNumberList2: [],
  224. fsalaryContrastList2: [],
  225. studentNumberContrastList2: [],
  226. fsalaryList: [],
  227. studentNumberList: [],
  228. fsalaryContrastList: [],
  229. studentNumberContrastList: [],
  230. activeNames: ["1", "2", "3", "5"],
  231. logActiveNames: ["24"],
  232. annual: "",
  233. annual2: "",
  234. annual3: "",
  235. annual4: "",
  236. salaryType: "",
  237. salaryType2: "",
  238. salaryType3: "",
  239. salaryType4: "",
  240. xxList: [],
  241. czList: [],
  242. gzList: [],
  243. isHeight: {},
  244. options: [
  245. {
  246. value: "",
  247. label: "全部"
  248. },
  249. {
  250. value: "小学部",
  251. label: "小学部"
  252. },
  253. {
  254. value: "初中部",
  255. label: "初中部"
  256. },
  257. {
  258. value: "高中部",
  259. label: "高中部"
  260. },
  261. {
  262. value: "后勤部",
  263. label: "后勤部"
  264. }
  265. ],
  266. options2: [
  267. {
  268. value: "上学期",
  269. label: "上学期"
  270. },
  271. {
  272. value: "下学期",
  273. label: "下学期"
  274. }
  275. ],
  276. option: {
  277. span: 6,
  278. data: [
  279. {
  280. // click: function(item) {
  281. // // alert(JSON.stringify(item));
  282. // },
  283. title: "年工资总额",
  284. count: 0,
  285. decimals: 2,
  286. icon: "el-icon-tickets"
  287. // href:'https://avuejs.com',
  288. // target: "_blank"
  289. },
  290. {
  291. // click: function(item) {
  292. // // alert(JSON.stringify(item));
  293. // },
  294. title: "年工资额增长率(%)",
  295. count: 0,
  296. decimals: 2,
  297. icon: "el-icon-s-marketing"
  298. // href:'https://avuejs.com',
  299. // target: "_blank"
  300. },
  301. {
  302. // click: function(item) {
  303. // // alert(JSON.stringify(item));
  304. // },
  305. title: "年人均工资",
  306. count: 0,
  307. decimals: 2,
  308. icon: "el-icon-s-finance"
  309. // href:'https://avuejs.com',
  310. // target: "_blank"
  311. },
  312. {
  313. // click: function(item) {
  314. // // alert(JSON.stringify(item));
  315. // },
  316. title: "年人均工资增长率(%)",
  317. count: 0,
  318. decimals: 2,
  319. icon: "el-icon-s-claim"
  320. // href:'https://avuejs.com',
  321. // target: "_blank"
  322. },
  323. {
  324. // click: function(item) {
  325. // // alert(JSON.stringify(item));
  326. // },
  327. title: "年保险总额",
  328. count: 0,
  329. decimals: 2,
  330. icon: "el-icon-s-cooperation"
  331. // href:'https://avuejs.com',
  332. // target: "_blank"
  333. },
  334. {
  335. // click: function(item) {
  336. // // alert(JSON.stringify(item));
  337. // },
  338. title: "年保险总额同比(%)",
  339. count: 0,
  340. decimals: 2,
  341. icon: "el-icon-notebook-1"
  342. // href:'https://avuejs.com',
  343. // target: "_blank"
  344. },
  345. {
  346. // click: function(item) {
  347. // // alert(JSON.stringify(item));
  348. // },
  349. title: "年人均保险",
  350. count: 0,
  351. decimals: 2,
  352. icon: "el-icon-s-custom"
  353. // href:'https://avuejs.com',
  354. // target: "_blank"
  355. },
  356. {
  357. // click: function(item) {
  358. // // alert(JSON.stringify(item));
  359. // },
  360. title: "年人均保险同比(%)",
  361. count: 0,
  362. icon: "el-icon-notebook-2"
  363. // href:'https://avuejs.com',
  364. // target: "_blank"
  365. }
  366. ]
  367. }
  368. };
  369. },
  370. created() {
  371. this.annual = getYearDate().toString();
  372. this.annual2 = getYearDate().toString();
  373. this.annual3 = getYearDate().toString();
  374. this.annual4 = getYearDate().toString();
  375. this.isHeight.height = window.innerHeight - 165 + "px";
  376. this.getWorkDicts("month").then(res => {
  377. this.moonList = res.data.data;
  378. });
  379. },
  380. mounted() {
  381. this.getsalaryStatistics();
  382. this.getsalaryData();
  383. this.getsalaryDataChain();
  384. this.getsalaryAverage();
  385. },
  386. components: {
  387. indexCard,
  388. butCard
  389. },
  390. computed: {
  391. ...mapGetters(["userInfo"])
  392. },
  393. methods: {
  394. inPage(type) {
  395. switch (type) {
  396. case 1:
  397. this.$router.push("/salaryManagement/primarySchool/index");
  398. break;
  399. case 2:
  400. this.$router.push("/salaryManagement/juniorhighSchool/index");
  401. break;
  402. case 3:
  403. this.$router.push("/salaryManagement/highSchool/index");
  404. break;
  405. case 4:
  406. this.$router.push("/salaryManagement/logisticsDepartment/index");
  407. break;
  408. case 5:
  409. this.$router.push("/basicData/facultyManagement/index");
  410. break;
  411. case 6:
  412. this.$message.error("暂无此页面");
  413. break;
  414. }
  415. },
  416. getsalaryStatistics() {
  417. this.fsalaryList = [];
  418. this.studentNumberList = [];
  419. this.fsalaryContrastList = [];
  420. this.studentNumberContrastList = [];
  421. salaryStatistics({
  422. annual: this.annual,
  423. salaryType: this.salaryType
  424. })
  425. .then(res => {
  426. res.data.data.forEach(e => {
  427. this.fsalaryList.push(Number(e.fsalary).toFixed(6));
  428. this.studentNumberList.push(Number(e.studentNumber).toFixed(2));
  429. this.fsalaryContrastList.push(Number(e.fsalaryContrast).toFixed(2));
  430. this.studentNumberContrastList.push(
  431. Number(e.studentNumberContrast).toFixed(2)
  432. );
  433. });
  434. })
  435. .finally(() => {
  436. this.commoDity();
  437. });
  438. },
  439. moonChange() {
  440. this.semester = null;
  441. this.getsalaryDataChain();
  442. },
  443. semesterChange() {
  444. this.moon = null;
  445. this.getsalaryDataChain();
  446. },
  447. getsalaryAverage() {
  448. this.xxList = [];
  449. this.czList = [];
  450. this.gzList = [];
  451. salaryAverage({ annual: this.annual4 })
  452. .then(res => {
  453. res.data.data.forEach(e => {
  454. if (e.salaryType == "小学部") {
  455. this.xxList.push(Number(e.fsalary));
  456. }
  457. if (e.salaryType == "初中部") {
  458. this.czList.push(Number(e.fsalary));
  459. }
  460. if (e.salaryType == "高中部") {
  461. this.gzList.push(Number(e.fsalary));
  462. }
  463. });
  464. })
  465. .finally(() => {
  466. this.commoDity3();
  467. });
  468. },
  469. getsalaryDataChain() {
  470. this.yearList = [];
  471. this.fsalaryList2 = [];
  472. this.studentNumberList2 = [];
  473. this.fsalaryContrastList2 = [];
  474. this.studentNumberContrastList2 = [];
  475. salaryDataChain({
  476. annual: this.annual3,
  477. moon: this.moon,
  478. semester: this.semester,
  479. salaryType: this.salaryType3
  480. })
  481. .then(res => {
  482. let data = res.data.data;
  483. for (let i = 5; i >= 0; i--) {
  484. this.yearList.push(Number(this.annual3) - i + "年");
  485. }
  486. this.fsalaryList2.push(Number(data.fsalary));
  487. this.fsalaryList2.push(Number(data.fsalaryOne).toFixed(2));
  488. this.fsalaryList2.push(Number(data.fsalaryTwo).toFixed(2));
  489. this.fsalaryList2.push(Number(data.fsalaryThree).toFixed(2));
  490. this.fsalaryList2.push(Number(data.fsalaryFour).toFixed(2));
  491. this.fsalaryList2.push(Number(data.fsalaryFive).toFixed(2));
  492. this.studentNumberList2.push(Number(data.studentNumber).toFixed(2));
  493. this.studentNumberList2.push(
  494. Number(data.studentNumberOne).toFixed(2)
  495. );
  496. this.studentNumberList2.push(
  497. Number(data.studentNumberTwo).toFixed(2)
  498. );
  499. this.studentNumberList2.push(
  500. Number(data.studentNumberThree).toFixed(2)
  501. );
  502. this.studentNumberList2.push(
  503. Number(data.studentNumberFour).toFixed(2)
  504. );
  505. this.studentNumberList2.push(
  506. Number(data.studentNumberFive).toFixed(2)
  507. );
  508. this.fsalaryContrastList2.push(
  509. Number(data.fsalaryContrast).toFixed(2)
  510. );
  511. this.fsalaryContrastList2.push(
  512. Number(data.fsalaryOneContrast).toFixed(2)
  513. );
  514. this.fsalaryContrastList2.push(
  515. Number(data.fsalaryTwoContrast).toFixed(2)
  516. );
  517. this.fsalaryContrastList2.push(
  518. Number(data.fsalaryThreeContrast).toFixed(2)
  519. );
  520. this.fsalaryContrastList2.push(
  521. Number(data.fsalaryFourContrast).toFixed(2)
  522. );
  523. this.fsalaryContrastList2.push(
  524. Number(data.fsalaryFiveContrast).toFixed(2)
  525. );
  526. this.studentNumberContrastList2.push(
  527. Number(data.studentNumberContrast).toFixed(2)
  528. );
  529. this.studentNumberContrastList2.push(
  530. Number(data.studentNumberOneContrast).toFixed(2)
  531. );
  532. this.studentNumberContrastList2.push(
  533. Number(data.studentNumberTwoContrast).toFixed(2)
  534. );
  535. this.studentNumberContrastList2.push(
  536. Number(data.studentNumberThreeContrast).toFixed(2)
  537. );
  538. this.studentNumberContrastList2.push(
  539. Number(data.studentNumberFourContrast).toFixed(2)
  540. );
  541. this.studentNumberContrastList2.push(
  542. Number(data.studentNumberFiveContrast).toFixed(2)
  543. );
  544. })
  545. .finally(() => {
  546. this.commoDity2();
  547. });
  548. },
  549. getsalaryData() {
  550. salaryData({
  551. annual: this.annual2,
  552. salaryType: this.salaryType2
  553. }).then(res => {
  554. let data = res.data.data;
  555. this.option.data.forEach(e => {
  556. if (e.title == "年工资总额") {
  557. e.count = data.salaryRental;
  558. } else if (e.title == "年工资额增长率(%)") {
  559. e.count = data.annualWageGrowth;
  560. } else if (e.title == "年人均工资") {
  561. e.count = data.averageWage;
  562. } else if (e.title == "年人均工资增长率(%)") {
  563. e.count = data.averageWageGrowthRate;
  564. } else if (e.title == "年保险总额") {
  565. e.count = data.insuredSum;
  566. } else if (e.title == "年保险总额同比(%)") {
  567. e.count = data.insuredSumYear;
  568. } else if (e.title == "年人均保险") {
  569. e.count = data.insuredMean;
  570. } else if (e.title == "年人均保险同比(%)") {
  571. e.count = data.insuredMeanYear;
  572. }
  573. });
  574. });
  575. },
  576. handleChange(val) {
  577. window.console.log(val);
  578. },
  579. commoDity() {
  580. // 基于准备好的dom,初始化echarts实例,所以只能在mounted中调用
  581. let myChart = this.$echarts.init(document.getElementById("commoDity"));
  582. const colors = ["#5470C6", "#91CC75", "#EE6666", "#00008b"];
  583. // 绘制图表
  584. myChart.setOption({
  585. tooltip: {
  586. trigger: "axis",
  587. axisPointer: {
  588. type: "shadow"
  589. },
  590. formatter: function(param) {
  591. let obj = param[0].name + "<br/>";
  592. param.forEach(el => {
  593. if (
  594. el.seriesName == "工资增加率" ||
  595. el.seriesName == "人数增长率"
  596. ) {
  597. obj +=
  598. el.marker +
  599. el.seriesName +
  600. ":" +
  601. Number(el.data).toFixed(2) +
  602. "%<br/>";
  603. } else {
  604. obj +=
  605. el.marker +
  606. el.seriesName +
  607. ":" +
  608. Number(el.data).toFixed(2) +
  609. "<br/>";
  610. }
  611. });
  612. return obj;
  613. }
  614. },
  615. legend: {
  616. data: ["工资", "人数", "工资增加率", "人数增长率"],
  617. selected: {
  618. 工资: true,
  619. 人数: true,
  620. 工资增加率: false,
  621. 人数增长率: false
  622. }
  623. },
  624. xAxis: {
  625. type: "category",
  626. data: [
  627. "一月",
  628. "二月",
  629. "三月",
  630. "四月",
  631. "五月",
  632. "六月",
  633. "七月",
  634. "八月",
  635. "九月",
  636. "十月",
  637. "十一月",
  638. "十二月"
  639. ]
  640. },
  641. grid: {
  642. left: "3%",
  643. right: "4%",
  644. bottom: "3%",
  645. containLabel: true
  646. },
  647. yAxis: [
  648. {
  649. type: "value",
  650. name: "人民币",
  651. position: "left",
  652. offset: 80,
  653. alignTicks: true,
  654. axisLine: {
  655. show: true,
  656. lineStyle: {
  657. color: colors[0]
  658. },
  659. onZero: false
  660. },
  661. axisLabel: {
  662. formatter: "{value} 元"
  663. }
  664. },
  665. {
  666. type: "value",
  667. name: "人数",
  668. position: "right",
  669. alignTicks: true,
  670. axisLine: {
  671. show: true,
  672. lineStyle: {
  673. color: colors[1]
  674. },
  675. onZero: false
  676. },
  677. axisLabel: {
  678. formatter: "{value} 人"
  679. }
  680. },
  681. {
  682. type: "value",
  683. name: "工资增加率",
  684. position: "left",
  685. alignTicks: true,
  686. axisLine: {
  687. show: true,
  688. lineStyle: {
  689. color: colors[2]
  690. },
  691. onZero: false
  692. },
  693. axisLabel: {
  694. formatter: "{value} %"
  695. }
  696. },
  697. {
  698. type: "value",
  699. name: "工资增加率",
  700. position: "right",
  701. alignTicks: true,
  702. offset: 80,
  703. axisLine: {
  704. show: true,
  705. lineStyle: {
  706. color: colors[3]
  707. },
  708. onZero: false
  709. },
  710. axisLabel: {
  711. formatter: "{value} %"
  712. }
  713. }
  714. ],
  715. series: [
  716. {
  717. data: this.fsalaryList,
  718. name: "工资",
  719. type: "bar"
  720. },
  721. {
  722. data: this.studentNumberList,
  723. name: "人数",
  724. yAxisIndex: 1,
  725. type: "bar"
  726. },
  727. {
  728. data: this.fsalaryContrastList,
  729. name: "工资增加率",
  730. yAxisIndex: 2,
  731. type: "line"
  732. },
  733. {
  734. data: this.studentNumberContrastList,
  735. name: "人数增长率",
  736. yAxisIndex: 3,
  737. type: "line"
  738. }
  739. ]
  740. });
  741. },
  742. commoDity2() {
  743. // 基于准备好的dom,初始化echarts实例,所以只能在mounted中调用
  744. let myChart = this.$echarts.init(document.getElementById("commoDity2"));
  745. const colors = ["#5470C6", "#91CC75", "#EE6666", "#00008b"];
  746. // 绘制图表
  747. myChart.setOption({
  748. tooltip: {
  749. trigger: "axis",
  750. axisPointer: {
  751. type: "shadow"
  752. },
  753. formatter: function(param) {
  754. let obj = param[0].name + "<br/>";
  755. param.forEach(el => {
  756. if (
  757. el.seriesName == "工资增加率" ||
  758. el.seriesName == "人数增长率"
  759. ) {
  760. obj +=
  761. el.marker +
  762. el.seriesName +
  763. ":" +
  764. Number(el.data).toFixed(2) +
  765. "%<br/>";
  766. } else {
  767. obj +=
  768. el.marker +
  769. el.seriesName +
  770. ":" +
  771. Number(el.data).toFixed(2) +
  772. "<br/>";
  773. }
  774. });
  775. return obj;
  776. }
  777. },
  778. legend: {
  779. data: ["工资", "人数", "工资增加率", "人数增长率"],
  780. selected: {
  781. 工资: true,
  782. 人数: true,
  783. 工资增加率: false,
  784. 人数增长率: false
  785. }
  786. },
  787. xAxis: {
  788. type: "category",
  789. data: this.yearList
  790. },
  791. grid: {
  792. left: "3%",
  793. right: "4%",
  794. bottom: "3%",
  795. containLabel: true
  796. },
  797. yAxis: [
  798. {
  799. type: "value",
  800. name: "人民币",
  801. position: "left",
  802. offset: 80,
  803. alignTicks: true,
  804. axisLine: {
  805. show: true,
  806. lineStyle: {
  807. color: colors[0]
  808. },
  809. onZero: false
  810. },
  811. axisLabel: {
  812. formatter: "{value} 元"
  813. }
  814. },
  815. {
  816. type: "value",
  817. name: "人数",
  818. position: "right",
  819. alignTicks: true,
  820. axisLine: {
  821. show: true,
  822. lineStyle: {
  823. color: colors[1]
  824. },
  825. onZero: false
  826. },
  827. axisLabel: {
  828. formatter: "{value} 人"
  829. }
  830. },
  831. {
  832. type: "value",
  833. name: "工资增加率",
  834. position: "left",
  835. alignTicks: true,
  836. axisLine: {
  837. show: true,
  838. lineStyle: {
  839. color: colors[2]
  840. },
  841. onZero: false
  842. },
  843. axisLabel: {
  844. formatter: "{value} %"
  845. }
  846. },
  847. {
  848. type: "value",
  849. name: "工资增加率",
  850. position: "right",
  851. alignTicks: true,
  852. offset: 80,
  853. axisLine: {
  854. show: true,
  855. lineStyle: {
  856. color: colors[3]
  857. },
  858. onZero: false
  859. },
  860. axisLabel: {
  861. formatter: "{value} %"
  862. }
  863. }
  864. ],
  865. series: [
  866. {
  867. data: this.fsalaryList2,
  868. name: "工资",
  869. type: "bar"
  870. },
  871. {
  872. data: this.studentNumberList2,
  873. name: "人数",
  874. yAxisIndex: 1,
  875. type: "bar"
  876. },
  877. {
  878. data: this.fsalaryContrastList2,
  879. name: "工资增加率",
  880. yAxisIndex: 2,
  881. type: "line"
  882. },
  883. {
  884. data: this.studentNumberContrastList2,
  885. name: "人数增长率",
  886. yAxisIndex: 3,
  887. type: "line"
  888. }
  889. ]
  890. });
  891. },
  892. commoDity3() {
  893. // 基于准备好的dom,初始化echarts实例,所以只能在mounted中调用
  894. let myChart = this.$echarts.init(document.getElementById("commoDity3"));
  895. const colors = ["#5470C6", "#91CC75", "#EE6666", "#00008b"];
  896. // 绘制图表
  897. myChart.setOption({
  898. tooltip: {
  899. trigger: "axis",
  900. axisPointer: {
  901. type: "shadow"
  902. }
  903. },
  904. legend: {
  905. data: ["小学部", "初中部", "高中部"]
  906. },
  907. xAxis: {
  908. type: "category",
  909. data: [
  910. "一月",
  911. "二月",
  912. "三月",
  913. "四月",
  914. "五月",
  915. "六月",
  916. "七月",
  917. "八月",
  918. "九月",
  919. "十月",
  920. "十一月",
  921. "十二月"
  922. ]
  923. },
  924. grid: {
  925. left: "3%",
  926. right: "4%",
  927. bottom: "3%",
  928. containLabel: true
  929. },
  930. yAxis: [
  931. {
  932. type: "value",
  933. name: "人民币",
  934. alignTicks: true,
  935. axisLine: {
  936. show: true,
  937. lineStyle: {
  938. color: colors[0]
  939. },
  940. onZero: false
  941. },
  942. axisLabel: {
  943. formatter: "{value} 元"
  944. }
  945. }
  946. ],
  947. series: [
  948. {
  949. data: this.xxList,
  950. name: "小学部",
  951. type: "bar"
  952. },
  953. {
  954. data: this.czList,
  955. name: "初中部",
  956. type: "bar"
  957. },
  958. {
  959. data: this.gzList,
  960. name: "高中部",
  961. type: "bar"
  962. }
  963. ]
  964. });
  965. }
  966. }
  967. };
  968. </script>
  969. <style lang="scss" scoped>
  970. .container {
  971. display: grid;
  972. grid-template-columns: repeat(auto-fill, 50%);
  973. grid-template-rows: 40% 30% 30%;
  974. .container-items {
  975. display: grid;
  976. grid-template-columns: repeat(auto-fill, 33.33%);
  977. grid-template-rows: repeat(auto-fill, 140%);
  978. align-items: center;
  979. }
  980. }
  981. //今日营业
  982. .operate {
  983. display: grid;
  984. grid-template-rows: repeat(auto-fill, 33.33%);
  985. .operate-item {
  986. display: flex;
  987. align-items: center;
  988. .item-text {
  989. display: flex;
  990. align-items: end;
  991. font-size: 14px;
  992. .item-point {
  993. line-height: 14px;
  994. width: 14px;
  995. height: 14px;
  996. border-radius: 2px;
  997. background: #ff7d13;
  998. margin-right: 4px;
  999. margin-bottom: 1px;
  1000. }
  1001. }
  1002. p {
  1003. font-size: 24px;
  1004. line-height: 24px;
  1005. margin: 0 4px !important;
  1006. }
  1007. }
  1008. }
  1009. </style>