wave1.php 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <?php
  2. use app\assets\CoreAsset;
  3. use app\assets\PluginsAsset;
  4. $asset = CoreAsset::register($this);
  5. $assetsUrl = $asset->baseUrl;
  6. $pluginsAsset = PluginsAsset::register($this);
  7. $pluginsUrl = $pluginsAsset->baseUrl;
  8. use yii\widgets\ActiveForm;
  9. ?>
  10. <div class="row ">
  11. <div class="col-12">
  12. <div class="card">
  13. <div class="card-body" style="padding:0 1.25rem;">
  14. <!-- 搜索表单 -->
  15. <div class="searchbox" style="margin-bottom: 0px;padding: 10px 0px 10px;border-bottom:none;" >
  16. <?php $form = ActiveForm::begin(['options' => ['id'=>'searchform','class' => 'row gy-2 gx-3 align-items-center'], 'enableClientValidation' => false]); ?>
  17. <div class="col-sm-auto"><label class="col-form-label">账期</label></div>
  18. <div class="col-sm-auto">
  19. <input class="form-control" type="month" name="date" value="<?php echo get_date(TIMESTAMP,'Y-m');?>" >
  20. </div>
  21. <div class="col-sm-auto"><label class="col-form-label">地市</label></div>
  22. <div class="col-sm-auto">
  23. <?php echo \app\common\widget\LinkmenuWidget::widget(['key_id'=>1,'name'=>'city','level'=>1,'emptyTxts'=>['全省'],'value'=>0,'selectClass'=>'form-select original ','blockClass'=>'row','unitStyle'=>'min-width:120px;']);?>
  24. </div>
  25. <div class="col-sm-auto">
  26. <div class="form-check">
  27. <input class="form-check-input" type="radio" name="datatype" value="1" checked>
  28. <label class="form-check-label">月度</label>
  29. </div>
  30. </div>
  31. <div class="col-sm-auto">
  32. <div class="form-check">
  33. <input class="form-check-input" type="radio" name="datatype" value="2" >
  34. <label class="form-check-label">累计</label>
  35. </div>
  36. </div>
  37. <div class="col-sm-auto">
  38. <button type="button" class="btn btn-light carbtn" onclick="doQuery()">查询</button>
  39. <button type="button" class="btn btn-light carbtn" >导出</button>
  40. <button type="button" class="btn btn-light carbtn" >口径描述</button>
  41. </div>
  42. <?php ActiveForm::end(); ?>
  43. </div>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. <div class="row">
  49. <div class="card">
  50. <div class="card-body">
  51. <div class="row">
  52. <div id="chartbox" class="apex-charts" dir="ltr"></div>
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. <div class="row">
  58. <div class="card">
  59. <div class="card-body">
  60. <div class="row">
  61. <img src="https://files.axshare.com/gsc/CT62PZ/01/5e/29/015e29c2a2ba434aa5392ca357b17a94/images/2-%E6%B3%A2%E5%8A%A8%E5%88%86%E6%9E%90/u27.png?pageId=e3eaa4f3-65f7-4430-aa6d-8e3a8758ea2f">
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. <script src="<?php echo $assetsUrl;?>/libs/apexcharts/apexcharts.min.js"></script>
  67. <script>
  68. var chart = null;
  69. function doQuery()
  70. {
  71. //月度
  72. var options1 = {
  73. chart: {
  74. height: 250,
  75. type: "line",
  76. zoom: {
  77. enabled: !1
  78. },
  79. toolbar: {
  80. show: !1
  81. }
  82. },
  83. colors: ["#556ee6", "#34c38f"],
  84. dataLabels: {
  85. enabled: !1
  86. },
  87. stroke: {
  88. width: [2, 2],
  89. curve: "straight"
  90. },
  91. series: [{
  92. name: "2023",
  93. data: [26, 24, 32, 36, 33, 31, 33, 26, 24, 32, 36, 33]
  94. }, {
  95. name: "2022",
  96. data: [14, 11, 16, 12, 17, 13, 12, 14, 11, 16, 12, 17]
  97. }],
  98. grid: {
  99. row: {
  100. colors: ["transparent", "transparent"],
  101. opacity: .2
  102. },
  103. borderColor: "#f1f1f1"
  104. },
  105. markers: {
  106. style: "inverted",
  107. size: 3
  108. },
  109. xaxis: {
  110. categories: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
  111. },
  112. yaxis: {
  113. title: {
  114. text: "单位(公里)"
  115. },
  116. }
  117. }
  118. //累计
  119. var options2 = {
  120. chart: {
  121. height:250,
  122. type: "line",
  123. stacked: !1,
  124. toolbar: {
  125. show: !1
  126. }
  127. },
  128. stroke: {
  129. width: [2, 2, 2],
  130. curve: "straight"
  131. },
  132. plotOptions: {
  133. bar: {
  134. columnWidth: "40%"
  135. }
  136. },
  137. colors:["#34c38f", "#cf5a5a", "#50a5f1"],
  138. series: [{
  139. name: "本年累计",
  140. type: "column",
  141. data: [23, 11, 22, 27, 13, 22, 37, 21, 44, 22, 30]
  142. },{
  143. name: "去年同期",
  144. type: "column",
  145. data: [23, 11, 22, 27, 13, 22, 37, 21, 44, 22, 30]
  146. }, {
  147. name: "本年占收比",
  148. type: "line",
  149. data: [44, 55, 41, 67, 22, 43, 21, 41, 56, 27, 43]
  150. }],
  151. fill: {
  152. opacity: [0.8, 0.8, 0.8],
  153. gradient: {
  154. inverseColors: !1,
  155. shade: "light",
  156. type: "vertical",
  157. opacityFrom: .85,
  158. opacityTo: .55,
  159. stops: [0, 100, 100, 100]
  160. }
  161. },
  162. labels: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
  163. markers: {
  164. size: 3
  165. },
  166. yaxis: {
  167. axisBorder: {
  168. show: !1
  169. },
  170. axisTicks: {
  171. show: !1
  172. },
  173. labels: {
  174. show: !1,
  175. },
  176. },
  177. tooltip: {
  178. shared: !0,
  179. intersect: !1,
  180. y: [{
  181. title: {
  182. formatter: function(e) {
  183. return e + '(万元)'
  184. }
  185. },
  186. }, {
  187. title: {
  188. formatter: function(e) {
  189. return e+ '(万元)'
  190. }
  191. }
  192. }, {
  193. title: {
  194. formatter: function(e) {
  195. return e+ '(%)'
  196. }
  197. }
  198. }]
  199. },
  200. grid: {
  201. borderColor: "#f1f1f1"
  202. }
  203. };
  204. if(chart!=null)
  205. {
  206. chart.updateOptions(options2);
  207. }
  208. else
  209. {
  210. chart = new ApexCharts(document.querySelector("#chartbox"), options1);
  211. chart.render();
  212. }
  213. }
  214. doQuery();
  215. </script>