berths_revenue.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. <template>
  2. <div class="body-wrapper">
  3. <el-form class="form-wrapper" :inline="true" :model="formInline">
  4. <el-form-item label="行政区">
  5. <el-select clearable v-model="formInline.regionCode" placeholder="请选择" popper-class="cur-select">
  6. <el-option v-for="item in districtOptions" :key="item.label" :label="item.label" :value="item.value"></el-option>
  7. </el-select>
  8. </el-form-item>
  9. <el-form-item clearable label="重点区域">
  10. <el-select clearable v-model="formInline.keyAreas" placeholder="请选择" popper-class="cur-select">
  11. <el-option v-for="item in keyAreaOptions" :key="item.label" :label="item.label" :value="item.value"></el-option>
  12. </el-select>
  13. </el-form-item>
  14. <el-form-item clearable label="具体道路">
  15. <el-input v-model="formInline.streetName" placeholder="请输入"></el-input>
  16. </el-form-item>
  17. <el-form-item label="停车场">
  18. <el-select clearable filterable v-model="formInline.parkId" placeholder="请选择" popper-class="cur-select">
  19. <el-option v-for="item in carOptions" :key="item.parkId" :label="item.carParkName" :value="item.parkId"></el-option>
  20. </el-select>
  21. </el-form-item>
  22. <el-form-item label="查询日期">
  23. <el-date-picker
  24. clearable
  25. v-model="formInline.time"
  26. type="daterange"
  27. range-separator="至"
  28. start-placeholder="开始日期"
  29. value-format="yyyy-MM-dd"
  30. :picker-options="{disabledDate: (time) => time.getTime() > Date.now()}"
  31. end-placeholder="结束日期">
  32. </el-date-picker>
  33. </el-form-item>
  34. <el-form-item>
  35. <el-button type="primary" @click="queryAll">查询</el-button>
  36. </el-form-item>
  37. </el-form>
  38. <div style="width: 100%; display: flex; flex-wrap: wrap;">
  39. <div style="width: 50%;height: 220px;">
  40. <h5 style="color: white">按小时统计</h5>
  41. <div style="width: 100%;height: 200px;">
  42. <linechart
  43. :autoStop="false"
  44. :top="30"
  45. :bottom="30"
  46. :left="40"
  47. :legendTop="0"
  48. yAxisName="(元)"
  49. :dataset="linedata"
  50. :tooltipFormat="lineTooltipFormat"
  51. :encode="[
  52. { x: 'mouth', y: 'lastAmount', seriesName: '',bool:'true' },
  53. ]"
  54. id="axstj"
  55. />
  56. </div>
  57. </div>
  58. <div style="width: 50%;height: 220px;">
  59. <h5 style="color: white">按日统计</h5>
  60. <div style="width: 100%;height: 200px;">
  61. <linechart
  62. :autoStop="false"
  63. :top="30"
  64. :bottom="30"
  65. :left="40"
  66. :legendTop="0"
  67. yAxisName="(元)"
  68. :dataset="linedata2"
  69. :tooltipFormat="lineTooltipFormat"
  70. :encode="[
  71. { x: 'mouth', y: 'lastAmount', seriesName: '',bool:'true' },
  72. ]"
  73. id="artj"
  74. />
  75. </div>
  76. </div>
  77. <div style="width: 50%;height: 220px;">
  78. <h5 style="color: white">按周统计</h5>
  79. <div style="width: 100%;height: 200px;">
  80. <linechart
  81. :autoStop="false"
  82. :top="30"
  83. :bottom="30"
  84. :left="40"
  85. :legendTop="0"
  86. yAxisName="(元)"
  87. :dataset="linedata3"
  88. :tooltipFormat="lineTooltipFormat"
  89. :encode="[
  90. { x: 'mouth', y: 'lastAmount', seriesName: '',bool:'true' },
  91. ]"
  92. id="aztj"
  93. />
  94. </div>
  95. </div>
  96. <div style="width: 50%;height: 220px;">
  97. <h5 style="color: white">按月统计</h5>
  98. <div style="width: 100%;height: 200px;">
  99. <linechart
  100. :autoStop="false"
  101. :top="30"
  102. :bottom="30"
  103. :left="40"
  104. :legendTop="0"
  105. yAxisName="(元)"
  106. :dataset="linedata4"
  107. :tooltipFormat="lineTooltipFormat"
  108. :encode="[
  109. { x: 'mouth', y: 'lastAmount', seriesName: '',bool:'true' },
  110. ]"
  111. id="aytj"
  112. />
  113. </div>
  114. </div>
  115. <br>
  116. <div style="width: 100%;height: 220px;">
  117. <h5 style="color: white">按年统计</h5>
  118. <div style="width: 100%;height: 220px;">
  119. <linechart
  120. :autoStop="false"
  121. :top="30"
  122. :bottom="30"
  123. :left="40"
  124. :legendTop="0"
  125. yAxisName="(元)"
  126. :dataset="linedata5"
  127. :tooltipFormat="lineTooltipFormat"
  128. :encode="[
  129. { x: 'mouth', y: 'lastAmount', seriesName: '',bool:'true' },
  130. ]"
  131. id="antj"
  132. />
  133. </div>
  134. </div>
  135. <br>
  136. </div>
  137. </div>
  138. </template>
  139. <script>
  140. import api from "@/api/article_liao";
  141. import linechart from "@/components/lineChart";
  142. import options from '@/util/options'
  143. export default {
  144. components: {
  145. linechart
  146. },
  147. data() {
  148. return {
  149. districtOptions: options.districtOptions,
  150. keyAreaOptions: options.keyAreaOptions,
  151. carOptions: [],
  152. linedata: [],
  153. linedata2: [],
  154. linedata3: [],
  155. linedata4: [],
  156. linedata5: [],
  157. tableData: [],
  158. total: 0,
  159. pageSize: 10,
  160. pageNum: 1,
  161. radio: '2',
  162. dialogVisible: false,
  163. selRow: {},
  164. formInline: {
  165. regionCode: '',
  166. keyAreas: '',
  167. streetName: '',
  168. parkId: '',
  169. time: [],
  170. }
  171. }
  172. },
  173. mounted() {
  174. this.getParkDic()
  175. this.queryAll()
  176. },
  177. watch: {
  178. },
  179. methods: {
  180. getParkDic() {
  181. api.parkDic().then(res => {
  182. this.carOptions = res.data || [];
  183. })
  184. },
  185. queryAll() {
  186. let params = {...this.formInline}
  187. if (
  188. this.formInline.time && this.formInline.time.length === 2 &&
  189. this.formInline.time[1] !== ""
  190. ) {
  191. this.formInline.time[0] = this.formInline.time[0].substring(0, 10) + " 00:00:00";
  192. this.formInline.time[1] = this.formInline.time[1].substring(0, 10) + " 23:59:59";
  193. params.begin= this.formInline.time[0]
  194. params.end = this.formInline.time[1]
  195. }
  196. delete params.time
  197. this.dashBerthsRevenueStat1(params)
  198. this.dashBerthsRevenueStat2(params)
  199. this.dashBerthsRevenueStat3(params)
  200. this.dashBerthsRevenueStat4(params)
  201. this.dashBerthsRevenueStat5(params)
  202. },
  203. lineTooltipFormat(params) {
  204. return `<div class="line-tooltip">
  205. <div style="color: ${params[0].color}">${params[0].data.mouth} : ${
  206. params[0].data.lastAmount || "--"
  207. }元</div>`;
  208. },
  209. dashBerthsRevenueStat1(params){
  210. api.dashBerthsRevenueStat1(params).then(res =>{
  211. this.linedata = res.data
  212. })
  213. },
  214. dashBerthsRevenueStat2(params){
  215. api.dashBerthsRevenueStat2(params).then(res =>{
  216. this.linedata2 = res.data
  217. })
  218. },
  219. dashBerthsRevenueStat3(params){
  220. api.dashBerthsRevenueStat3(params).then(res =>{
  221. this.linedata3 = res.data
  222. })
  223. },
  224. dashBerthsRevenueStat4(params){
  225. api.dashBerthsRevenueStat4(params).then(res =>{
  226. this.linedata4 = res.data
  227. })
  228. },
  229. dashBerthsRevenueStat5(params){
  230. api.dashBerthsRevenueStat5(params).then(res =>{
  231. this.linedata5 = res.data
  232. })
  233. },
  234. }
  235. }
  236. </script>
  237. <style lang="scss" scoped>
  238. /deep/ .el-input__inner {
  239. background: #2d3744;
  240. border: none;
  241. border-radius: 0;
  242. }
  243. /deep/ .el-select {
  244. /* 下面设置右侧按钮居中 */
  245. .el-input__suffix {
  246. top: 0px;
  247. display: flex;
  248. justify-content: center;
  249. align-items: center;
  250. flex-wrap: nowrap;
  251. flex-direction: row;
  252. align-content: flex-start;
  253. }
  254. /* 输入框加上上下边是 32px + 2px =34px */
  255. .el-input__icon {
  256. line-height: 0px;
  257. }
  258. }
  259. /deep/ .form-wrapper .el-button {
  260. background: linear-gradient(90deg,#0158d9,#3c97e4);
  261. width: 100px;
  262. }
  263. .body-wrapper {
  264. .button-block{
  265. text-align: right;
  266. margin-bottom: 20px;
  267. }
  268. }
  269. .audit-dialog{
  270. .mg-bt{
  271. margin-bottom: 24px;
  272. }
  273. .label{
  274. text-align: right;
  275. }
  276. }
  277. /deep/ .el-textarea.is-disabled .el-textarea__inner {
  278. background: #2a2a2a;
  279. color: #fff;
  280. }
  281. </style>