Demo.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828
  1. <template>
  2. <h1>组件示例</h1>
  3. <tab :data="tabData" @select="select" />
  4. <!-- 图表 -->
  5. <el-scrollbar v-if="currTab == 1" style="height:85%;">
  6. <h2>图表</h2>
  7. <h2>07-07新增</h2>
  8. <h3>柱状图:multiple-y-line-chart</h3>
  9. <multiple-y-line-chart :height="'300px'" />
  10. <h2>old</h2>
  11. <h3>柱状图:horizontal-bar-chart</h3>
  12. <horizontal-bar-chart :height="'300px'" />
  13. <h3>柱状图:horizontal-bar-chart</h3>
  14. <hover-bar-chart :list="HoverBarChart" :height="'200px'" />
  15. <h3>柱状图:list-bar-chart-2</h3>
  16. <list-bar-chart-2 :list="ListBarChart" :height="'200px'" />
  17. <h3>柱状图:multiple-bar-chart</h3>
  18. <multiple-bar-chart :list="MultipleBarChart" :height="'200px'" />
  19. <h3>柱状图:multiple-hover-bar-chart</h3>
  20. <multiple-hover-bar-chart :height="'200px'" />
  21. <h3>柱状图:percent-bar</h3>
  22. <percent-bar />
  23. <h3>柱状图:single-bar-chart</h3>
  24. <single-bar-chart />
  25. <h3>柱状图:thermometer</h3>
  26. <thermometer />
  27. <h3>组合:bar-line-chart</h3>
  28. <bar-line-chart :height="'300px'" />
  29. <h3>组合:bar-line-chart</h3>
  30. <vertival-bar-line-chart :height="'300px'" />
  31. <h3>折线图:double-line-chart</h3>
  32. <double-line-chart :height="'200px'" />
  33. <h3>折线图:multiple-line-chart</h3>
  34. <multiple-line-chart :height="'200px'" />
  35. <h3>折线图:multiple-line-chart</h3>
  36. <normal-line-chart />
  37. <h3>折线图:simple-line-chart</h3>
  38. <simple-line-chart />
  39. <h3>折线图:table-line-chart</h3>
  40. <table-line-chart />
  41. <h3>饼图:dash-pie-chart</h3>
  42. <div style="width: 350px">
  43. <dash-pie-chart />
  44. </div>
  45. <h3>饼图:dual-pie-chart</h3>
  46. <div style="width: 350px">
  47. <dual-pie-chart />
  48. </div>
  49. <h3>饼图:normal-pie-chart</h3>
  50. <div style="width: 350px">
  51. <normal-pie-chart />
  52. </div>
  53. <h3>饼图:percent-pie-chart</h3>
  54. <div style="width: 350px">
  55. <percent-pie-chart />
  56. </div>
  57. <h3>饼图:direction-radar-chart</h3>
  58. <div style="height: 500px">
  59. <direction-radar-chart :height="'500px'" />
  60. </div>
  61. <h3>饼图:normal-radar-chart</h3>
  62. <div style="height: 500px">
  63. <normal-radar-chart :height="'500px'" />
  64. </div>
  65. <h3>饼图:normal-radar-chart</h3>
  66. <div style="height: 500px">
  67. <radar-chart :height="'500px'" />
  68. </div>
  69. </el-scrollbar>
  70. <!-- 组件 -->
  71. <el-scrollbar v-if="currTab == 2" style="height:85%;">
  72. <h3>panel</h3>
  73. <panel :title="'title 标题'">
  74. 带标题title
  75. </panel>
  76. <br />
  77. <panel>
  78. 无标题title
  79. </panel>
  80. <h3>panel-2</h3>
  81. <panel-2 :title="'panel -2'">
  82. panel 2
  83. </panel-2>
  84. <h3>panel-3</h3>
  85. <panel-3>
  86. panel-3
  87. </panel-3>
  88. <h3>toolbar-panel</h3>
  89. <toolbar-panel title="toolbar-panel">
  90. <template v-slot:tools>
  91. <div class="tools">
  92. <div class="tool-block">
  93. <div class="legend bg-green"></div>
  94. <div class="legend-text">实际电量</div>
  95. </div>
  96. <div class="tool-block">
  97. <div class="legend bg-orange"></div>
  98. <div class="legend-text">计划检修损失</div>
  99. </div>
  100. <div class="tool-block">
  101. <div class="legend bg-yellow"></div>
  102. <div class="legend-text">非计划检修损失</div>
  103. </div>
  104. <div class="tool-block">
  105. <div class="legend bg-red"></div>
  106. <div class="legend-text">限电损失</div>
  107. </div>
  108. <div class="tool-block">
  109. <div class="legend bg-purple"></div>
  110. <div class="legend-text">受累损失</div>
  111. </div>
  112. <div class="tool-block">
  113. <div class="legend bg-blue"></div>
  114. <div class="legend-text">性能损失</div>
  115. </div>
  116. </div>
  117. </template>
  118. <bar-line-chart :height="'calc(100vh - 200px)'" :color="barColor" />
  119. </toolbar-panel>
  120. <h3>btn-group-double</h3>
  121. <btn-group-double :btnGroups="btnGroups" @select="btnGroupDoubleSelect" />
  122. <h3>card-1</h3>
  123. <card-1 />
  124. <h3>percent-card</h3>
  125. <percent-card :value="25" :title="'标题'" />
  126. <h3>percent-card-2</h3>
  127. <percent-card-2 />
  128. <h3>collapse-list</h3>
  129. <div style="width:200px">
  130. <collapse-list />
  131. </div>
  132. <h3>list</h3>
  133. <div style="width:200px">
  134. <list />
  135. </div>
  136. </el-scrollbar>
  137. <el-scrollbar v-if="currTab == 3" style="height:85%;">
  138. <h3>table</h3>
  139. <Table :data="tableData" :height="'200px'" :canScroll="true" :pageSize="40" :showHover="false" @onPagging="tableonPagging" />
  140. <h3>table</h3>
  141. <check-table :data="tableData" :height="'200px'" :canScroll="true" :pageSize="40" :showHover="false" @onPagging="tableonPagging" @check="CheckTableonCheck" />
  142. </el-scrollbar>
  143. <el-scrollbar v-if="currTab == 4" style="height:85%;">
  144. <i class="svg-icon svg-icon-sm mg-r-16">
  145. <svg-icon :svgid="'svg-wind-site'" />
  146. </i>
  147. <i class="svg-icon svg-icon-green mg-r-16">
  148. <svg-icon :svgid="'svg-wind-site'" />
  149. </i>
  150. <i class="svg-icon svg-icon-lg svg-icon-red mg-r-16">
  151. <svg-icon :svgid="'svg-wind-site'" />
  152. </i>
  153. </el-scrollbar>
  154. </template>
  155. <script>
  156. import horizontalBarChart from "../components/chart/bar/horizontal-bar-chart.vue";
  157. import HoverBarChart from "../components/chart/bar/hover-bar-chart.vue";
  158. import ListBarChart2 from "../components/chart/bar/list-bar-chart2.vue";
  159. import MultipleBarChart from "../components/chart/bar/multiple-bar-chart.vue";
  160. import MultipleHoverBarChart from "../components/chart/bar/multiple-hover-bar-chart.vue";
  161. import PercentBar from "../components/chart/bar/percent-bar.vue";
  162. import SingleBarChart from "../components/chart/bar/single-bar-chart.vue";
  163. import Thermometer from "../components/chart/bar/thermometer.vue";
  164. import BarLineChart from "../components/chart/combination/bar-line-chart.vue";
  165. import VertivalBarLineChart from "../components/chart/combination/vertival-bar-line-chart.vue";
  166. import DoubleLineChart from "../components/chart/line/double-line-chart.vue";
  167. import MultipleLineChart from "../components/chart/line/multiple-line-chart.vue";
  168. import MultipleYLineChart from "../components/chart/line/multiple-y-line-chart.vue";
  169. import NormalLineChart from "../components/chart/line/normal-line-chart.vue";
  170. import SimpleLineChart from "../components/chart/line/simple-line-chart.vue";
  171. import TableLineChart from "../components/chart/line/table-line-chart.vue";
  172. import DashPieChart from "../components/chart/pie/dash-pie-chart.vue";
  173. import DualPieChart from "../components/chart/pie/dual-pie-chart.vue";
  174. import NormalPieChart from "../components/chart/pie/normal-pie-chart.vue";
  175. import PercentPieChart from "../components/chart/pie/percent-pie-chart.vue";
  176. import DirectionRadarChart from "../components/chart/radar/direction-radar-chart.vue";
  177. import NormalRadarChart from "../components/chart/radar/normal-radar-chart.vue";
  178. import RadarChart from "../components/chart/radar/radar-chart.vue";
  179. import BtnGroupDouble from "../components/coms/btn/btn-group-double.vue";
  180. import Card1 from "../components/coms/cards/card-1.vue";
  181. import PercentCard2 from "../components/coms/cards/percent-card-2.vue";
  182. import PercentCard from "../components/coms/cards/percent-card.vue";
  183. import CollapseList from "../components/coms/collapse/collapse-list.vue";
  184. import SvgIcon from "../components/coms/icon/svg-icon.vue";
  185. import List from "../components/coms/list/list.vue";
  186. import Panel from "../components/coms/panel/panel.vue";
  187. import Panel2 from "../components/coms/panel/panel2.vue";
  188. import Panel3 from "../components/coms/panel/panel3.vue";
  189. import ToolbarPanel from "../components/coms/panel/toolbar-panel.vue";
  190. import CheckTable from "../components/coms/table/check-table.vue";
  191. import Table from "../components/coms/table/table.vue";
  192. import Tab from "../components/coms/tabs/tab.vue";
  193. export default {
  194. components: {
  195. horizontalBarChart,
  196. HoverBarChart,
  197. ListBarChart2,
  198. MultipleBarChart,
  199. MultipleHoverBarChart,
  200. PercentBar,
  201. SingleBarChart,
  202. Thermometer,
  203. BarLineChart,
  204. VertivalBarLineChart,
  205. DoubleLineChart,
  206. MultipleLineChart,
  207. NormalLineChart,
  208. SimpleLineChart,
  209. TableLineChart,
  210. DashPieChart,
  211. DualPieChart,
  212. NormalPieChart,
  213. PercentPieChart,
  214. DirectionRadarChart,
  215. NormalRadarChart,
  216. RadarChart,
  217. Tab,
  218. BtnGroupDouble,
  219. Card1,
  220. PercentCard,
  221. PercentCard2,
  222. CollapseList,
  223. List,
  224. Panel,
  225. Panel2,
  226. Panel3,
  227. ToolbarPanel,
  228. Table,
  229. CheckTable,
  230. SvgIcon,
  231. MultipleYLineChart,
  232. },
  233. methods: {
  234. select(data) {
  235. // console.log(data);
  236. this.currTab = parseInt(data.id);
  237. },
  238. btnGroupDoubleSelect(param) {
  239. console.log("btn-group-double");
  240. console.log(param);
  241. },
  242. tableonPagging(param) {
  243. console.log("table pagging event");
  244. console.log(param);
  245. this.tableData.data = [
  246. {
  247. index: 1,
  248. name: "MG01-01",
  249. lqf: "0.1000",
  250. yggl: "0.1000",
  251. yyy: "0.10",
  252. pcspp: "0.1000",
  253. u1: "0.1000",
  254. u2: "0.1000",
  255. v1: "0.1000",
  256. v2: "0.1000",
  257. w1: "0.1000",
  258. w2: "0.1000",
  259. zca: "0.1000",
  260. zcb: "0.1000",
  261. clx: "0.1000",
  262. clx1: "0.1000",
  263. clx2: "0.1000",
  264. jc: "0.1000",
  265. hh: "0.1000",
  266. hj: "0.1000",
  267. is_light: false,
  268. },
  269. ];
  270. let index = 0;
  271. for (let i = param.start; i < param.end; i++) {
  272. this.tableData.data.push(JSON.parse(JSON.stringify(this.tableData.data[0])));
  273. this.tableData.data[index].index = i + 1;
  274. index++;
  275. }
  276. },
  277. CheckTableonCheck(param) {
  278. console.log("table check event");
  279. console.log(param);
  280. },
  281. },
  282. data() {
  283. return {
  284. currTab: 2,
  285. tabData: [
  286. {
  287. id: "1",
  288. text: "图表",
  289. },
  290. {
  291. id: "2",
  292. text: "组件",
  293. },
  294. {
  295. id: "3",
  296. text: "表格",
  297. },
  298. {
  299. id: "4",
  300. text: "图标",
  301. },
  302. ],
  303. tableData: {
  304. column: [
  305. {
  306. name: "",
  307. field: "index",
  308. width: "50px",
  309. is_num: false,
  310. is_light: false,
  311. },
  312. {
  313. name: "名称",
  314. field: "name",
  315. is_num: false,
  316. is_light: false,
  317. },
  318. {
  319. name: "理论发电量",
  320. field: "lqf",
  321. is_num: false,
  322. is_light: false,
  323. },
  324. {
  325. name: "SCADA发电量",
  326. field: "yggl",
  327. is_num: false,
  328. is_light: false,
  329. },
  330. {
  331. name: "风速",
  332. field: "yyy",
  333. is_num: false,
  334. is_light: false,
  335. },
  336. {
  337. name: "非计划检修",
  338. field: "pcspp",
  339. is_num: false,
  340. is_light: false,
  341. },
  342. {
  343. name: "计划检修",
  344. field: "u1",
  345. is_num: false,
  346. is_light: false,
  347. },
  348. {
  349. name: "受累",
  350. field: "u2",
  351. is_num: false,
  352. is_light: true,
  353. },
  354. {
  355. name: "限电",
  356. field: "v1",
  357. is_num: false,
  358. is_light: false,
  359. },
  360. {
  361. name: "性能",
  362. field: "v2",
  363. is_num: false,
  364. is_light: false,
  365. },
  366. {
  367. name: "风能率用率%",
  368. field: "w1",
  369. is_num: false,
  370. is_light: false,
  371. },
  372. ],
  373. data: [
  374. {
  375. index: 1,
  376. name: "MG01-01",
  377. lqf: "0.1000",
  378. yggl: "0.1000",
  379. yyy: "0.10",
  380. pcspp: "0.1000",
  381. u1: "0.1000",
  382. u2: "0.1000",
  383. v1: "0.1000",
  384. v2: "0.1000",
  385. w1: "0.1000",
  386. w2: "0.1000",
  387. zca: "0.1000",
  388. zcb: "0.1000",
  389. clx: "0.1000",
  390. clx1: "0.1000",
  391. clx2: "0.1000",
  392. jc: "0.1000",
  393. hh: "0.1000",
  394. hj: "0.1000",
  395. is_light: false,
  396. },
  397. ],
  398. total: 100,
  399. },
  400. // 柱状图:horizontal-bar-chart data
  401. HorizontalBarChart: {
  402. area: ["新荣区", "平城区", "云冈区", "云州区", "阳高县", "天镇县", "广灵县", "浑源县", "左云县"],
  403. legend: ["因病", "因残", "因学", "因灾", "缺土地", "缺水"],
  404. data: [
  405. [1320, 1302, 901, 634, 1390, 1330, 1320, 1000, 500],
  406. [320, 302, 301, 334, 390, 330, 320, 100, 50],
  407. [320, 302, 301, 334, 390, 330, 320, 100, 50],
  408. [320, 302, 301, 334, 390, 330, 320, 100, 50],
  409. [320, 302, 301, 334, 390, 330, 320, 100, 50],
  410. [320, 302, 301, 334, 390, 330, 320, 100, 50],
  411. ],
  412. },
  413. // 柱状图:horizontal-bar-chart data
  414. HoverBarChart: [
  415. {
  416. text: "1",
  417. value: 1,
  418. },
  419. {
  420. text: "2",
  421. value: 2,
  422. },
  423. {
  424. text: "3",
  425. value: 1,
  426. },
  427. {
  428. text: "4",
  429. value: 3,
  430. },
  431. {
  432. text: "5",
  433. value: 3,
  434. },
  435. {
  436. text: "6",
  437. value: 3,
  438. },
  439. {
  440. text: "7",
  441. value: 3,
  442. },
  443. {
  444. text: "8",
  445. value: 3,
  446. },
  447. {
  448. text: "9",
  449. value: 3,
  450. },
  451. {
  452. text: "10",
  453. value: 3,
  454. },
  455. {
  456. text: "11",
  457. value: 3,
  458. },
  459. {
  460. text: "12",
  461. value: 3,
  462. },
  463. {
  464. text: "13",
  465. value: 3,
  466. },
  467. {
  468. text: "14",
  469. value: 3,
  470. },
  471. {
  472. text: "15",
  473. value: 3,
  474. },
  475. {
  476. text: "16",
  477. value: 3,
  478. },
  479. {
  480. text: "17",
  481. value: 3,
  482. },
  483. {
  484. text: "18",
  485. value: 3,
  486. },
  487. {
  488. text: "19",
  489. value: 3,
  490. },
  491. {
  492. text: "20",
  493. value: 3,
  494. },
  495. {
  496. text: "21",
  497. value: 3,
  498. },
  499. {
  500. text: "22",
  501. value: 3,
  502. },
  503. {
  504. text: "23",
  505. value: 3,
  506. },
  507. {
  508. text: "24",
  509. value: 3,
  510. },
  511. {
  512. text: "25",
  513. value: 3,
  514. },
  515. {
  516. text: "26",
  517. value: 3,
  518. },
  519. {
  520. text: "27",
  521. value: 3,
  522. },
  523. {
  524. text: "28",
  525. value: 3,
  526. },
  527. {
  528. text: "29",
  529. value: 3,
  530. },
  531. {
  532. text: "30",
  533. value: 3,
  534. },
  535. {
  536. text: "31",
  537. value: 3,
  538. },
  539. ],
  540. // list-bar-chart-2 data
  541. ListBarChart: [
  542. {
  543. name: "当日预测电量",
  544. value: 103.62,
  545. total: 150,
  546. },
  547. {
  548. name: "实际发电量",
  549. value: 98.62,
  550. total: 100,
  551. },
  552. {
  553. name: "当月预测电量",
  554. value: 113.27,
  555. total: 150,
  556. },
  557. {
  558. name: "实际发电量",
  559. value: 136.72,
  560. total: 150,
  561. },
  562. ],
  563. // multiple-bar-chart data
  564. MultipleBarChart: [
  565. {
  566. title: "日发电量",
  567. yAxisIndex: 0,
  568. value: [
  569. {
  570. text: "1日",
  571. value: 1,
  572. },
  573. {
  574. text: "2日",
  575. value: 2,
  576. },
  577. {
  578. text: "3日",
  579. value: 1,
  580. },
  581. {
  582. text: "4日",
  583. value: 3,
  584. },
  585. {
  586. text: "5日",
  587. value: 3,
  588. },
  589. {
  590. text: "6日",
  591. value: 3,
  592. },
  593. {
  594. text: "7日",
  595. value: 3,
  596. },
  597. ],
  598. },
  599. {
  600. title: "上网电量",
  601. yAxisIndex: 0,
  602. value: [
  603. {
  604. text: "1日",
  605. value: 1,
  606. },
  607. {
  608. text: "2日",
  609. value: 2,
  610. },
  611. {
  612. text: "3日",
  613. value: 1,
  614. },
  615. {
  616. text: "4日",
  617. value: 3,
  618. },
  619. {
  620. text: "5日",
  621. value: 3,
  622. },
  623. {
  624. text: "6日",
  625. value: 3,
  626. },
  627. {
  628. text: "7日",
  629. value: 3,
  630. },
  631. ],
  632. },
  633. {
  634. title: "购网电量",
  635. yAxisIndex: 0,
  636. value: [
  637. {
  638. text: "1日",
  639. value: 1,
  640. },
  641. {
  642. text: "2日",
  643. value: 2,
  644. },
  645. {
  646. text: "3日",
  647. value: 1,
  648. },
  649. {
  650. text: "4日",
  651. value: 3,
  652. },
  653. {
  654. text: "5日",
  655. value: 3,
  656. },
  657. {
  658. text: "6日",
  659. value: 3,
  660. },
  661. {
  662. text: "7日",
  663. value: 3,
  664. },
  665. ],
  666. },
  667. {
  668. title: "风速",
  669. yAxisIndex: 1,
  670. value: [
  671. {
  672. text: "1日",
  673. value: 1,
  674. },
  675. {
  676. text: "2日",
  677. value: 2,
  678. },
  679. {
  680. text: "3日",
  681. value: 1,
  682. },
  683. {
  684. text: "4日",
  685. value: 3,
  686. },
  687. {
  688. text: "5日",
  689. value: 3,
  690. },
  691. {
  692. text: "6日",
  693. value: 3,
  694. },
  695. {
  696. text: "7日",
  697. value: 3,
  698. },
  699. ],
  700. },
  701. ],
  702. // btnGroups
  703. btnGroups: [
  704. {
  705. icon: "fa fa-fire",
  706. btns: [
  707. {
  708. text: "某某风场",
  709. code: "mmfdc1",
  710. },
  711. {
  712. text: "某某风场",
  713. code: "mhsfc",
  714. },
  715. {
  716. text: "某某风场",
  717. code: "mmfdc2",
  718. },
  719. {
  720. text: "某某风场",
  721. code: "mmfdc3",
  722. },
  723. {
  724. text: "某某风场",
  725. code: "mmfdc4",
  726. },
  727. ],
  728. },
  729. {
  730. icon: "fa fa-fire-extinguisher",
  731. btns: [
  732. {
  733. text: "某某风场",
  734. code: "mmgf1",
  735. },
  736. {
  737. text: "某某风场",
  738. code: "mmgf2",
  739. },
  740. {
  741. text: "某某风场",
  742. code: "mmgf3",
  743. },
  744. {
  745. text: "某某风场",
  746. code: "mmgf4",
  747. },
  748. ],
  749. },
  750. ],
  751. };
  752. },
  753. created() {
  754. for (let i = 1; i < 21; i++) {
  755. this.tableData.data.push(JSON.parse(JSON.stringify(this.tableData.data[0])));
  756. this.tableData.data[i].index = i + 1;
  757. }
  758. },
  759. };
  760. </script>
  761. <style lang="less" scoped>
  762. .tools {
  763. display: flex;
  764. line-height: 3.4259vh;
  765. .tool-block {
  766. display: flex;
  767. align-items: center;
  768. margin-left: 0.741vh;
  769. .legend {
  770. flex: auto;
  771. width: 0.741vh;
  772. height: 0.741vh;
  773. margin-right: 0.741vh;
  774. &.long {
  775. width: 2.963vh;
  776. height: 0.37vh;
  777. }
  778. }
  779. .legend-text {
  780. color: @gray-l;
  781. font-size: @fontsize-s;
  782. }
  783. }
  784. }
  785. </style>