Detail.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. <template>
  2. <view class="content">
  3. <view class="top">
  4. <view class="threeLine" @tap="openDrawer">
  5. <image src="../../static/picture/fourLine.png" style="width: 30px;height: 30px;margin-top: 10px;margin-left: 10px;"></image>
  6. </view>
  7. <view class="text">
  8. <view class="notice">
  9. <view class="icon cuIcon-notice text-white" v-if="badge != 0">
  10. <view class="cu-tag looknumber">
  11. <block v-if="badge != 1">{{ badge > 99 ? '99+' : badge }}</block>
  12. </view>
  13. </view>
  14. </view>
  15. 宁夏新能源公司
  16. </view>
  17. <view class="plus">+</view>
  18. </view>
  19. <!-- 抽屉组件 -->
  20. <div>
  21. <drawer ref="drawer"></drawer>
  22. </div>
  23. <view class="cu-card case">
  24. <view class="cu-list menu-avatar">
  25. <view class="operationBar">
  26. <view class="operationBarTextLeft">盘面异动</view>
  27. <view class="operationBarTextRight">更多 ></view>
  28. </view>
  29. <view class="qiun-columns">
  30. <view class="qiun-bg-white qiun-title-bar qiun-common-mt">
  31. <view class="qiun-title-dot-light">基本区域图</view>
  32. </view>
  33. <view class="qiun-charts">
  34. <canvas canvas-id="canvasArea" id="canvasArea" class="charts" @touchstart="touchArea"></canvas>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. </template>
  41. </template>
  42. <script>
  43. import uCharts from '../../components/tools/u-charts/u-charts.js';
  44. var _self;
  45. var canvaArea = null;
  46. import drawer from '../../components/drawer/threeLineDrawer.vue';
  47. export default {
  48. components: {
  49. "drawer": drawer
  50. },
  51. data: function() {
  52. return {
  53. badge: 22,
  54. drawerList: ["状态监视", "矩阵监视", "风场监视", "人员监视"],
  55. inconList: ["form", "favor", "question", "edit"],
  56. cWidth: '',
  57. cHeight: '',
  58. pixelRatio: 1,
  59. }
  60. },
  61. methods: {
  62. openDrawer: function() {
  63. this.$refs.drawer.openDrawer(250, this.drawerList, this.inconList);
  64. },
  65. closeDrawer: function() {
  66. this.drawerIsShow = false;
  67. },
  68. getServerData() {
  69. let chartData = {
  70. categories: ['2012', '2013', '2014', '2015', '2016', '2017'],
  71. series: [{
  72. name: '成交量A',
  73. data: [100, 80, 95, 150, 112, 132],
  74. color: '#B9D1EC'
  75. }]
  76. };
  77. // chartData.categories=[];
  78. // chartData.series[0].data=[];
  79. this.showArea("canvasArea",chartData);
  80. },
  81. showArea(canvasId, chartData) {
  82. canvaArea = new uCharts({
  83. $this: _self,
  84. canvasId: canvasId,
  85. type: 'area',
  86. fontSize: 11,
  87. legend: true,
  88. dataLabel: false,
  89. dataPointShape: true,
  90. background: '#FFFFFF',
  91. pixelRatio: _self.pixelRatio,
  92. categories: chartData.categories,
  93. series: chartData.series,
  94. animation: true,
  95. xAxis: {
  96. type: 'grid',
  97. gridColor: '#CCCCCC',
  98. gridType: 'dash',
  99. dashLength: 8,
  100. axisLine:true,//x轴轴线
  101. },
  102. yAxis: {
  103. gridType: 'dash',
  104. gridColor: '#CCCCCC',
  105. dashLength: 8,
  106. splitNumber: 5,
  107. min: 10,
  108. max: 180,
  109. },
  110. width: _self.cWidth * _self.pixelRatio,
  111. height: _self.cHeight * _self.pixelRatio,
  112. extra: {
  113. area: {
  114. type: 'straight',
  115. opacity: 0.2,
  116. addLine: true,
  117. width: 2
  118. }
  119. }
  120. });
  121. },
  122. touchArea(e) {
  123. canvaArea.showToolTip(e, {
  124. format: function (item, category) {
  125. return category + ' ' + item.name + ':' + item.data
  126. }
  127. });
  128. }
  129. },
  130. onLoad() {
  131. _self = this;
  132. this.cWidth = uni.upx2px(750);
  133. this.cHeight = uni.upx2px(500);
  134. this.getServerData();
  135. }
  136. }
  137. </script>
  138. <style>
  139. page {
  140. /* background: -webkit-gradient(linear, 0% 100%, 0% 0%, from(#2F698E), color-stop(0.15, #5C757C), to(#004C90)); */
  141. /* background-color: #108ADA; */
  142. }
  143. .top {
  144. width: 100%;
  145. height: 105upx;
  146. padding-top: 5upx;
  147. background-color: #3D6C8A;
  148. }
  149. .threeLine {
  150. width: 50px;
  151. height: 50px;
  152. float: left;
  153. }
  154. .text {
  155. width: calc(100% - 100px);
  156. height: 50px;
  157. float: left;
  158. color: white;
  159. line-height: 50px;
  160. text-align: center;
  161. font-size: 18px;
  162. }
  163. .notice {
  164. width: 50px;
  165. height: 50px;
  166. float: left;
  167. }
  168. .plus {
  169. width: 50px;
  170. height: 50px;
  171. float: right;
  172. color: white;
  173. font-size: 35px;
  174. line-height: 50px;
  175. text-align: center;
  176. }
  177. .operationBar {
  178. width: 100%;
  179. height: 50px;
  180. background-color: white;
  181. }
  182. .operationBarTextLeft {
  183. margin-left: 20px;
  184. line-height: 50px;
  185. font-size: 15px;
  186. float: left;
  187. }
  188. .operationBarTextRight {
  189. margin-right: 20px;
  190. line-height: 50px;
  191. font-size: 12px;
  192. float: right;
  193. color: #AAAAAA;
  194. }
  195. .qiun-charts {
  196. width: 750upx;
  197. height: 500upx;
  198. background-color: #FFFFFF;
  199. }
  200. .charts {
  201. width: 750upx;
  202. height: 500upx;
  203. background-color: #FFFFFF;
  204. }
  205. </style>