index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435
  1. <template>
  2. <div class="visitor">
  3. <div class="left_visitor">
  4. <HeadlineTag value="访客列表"></HeadlineTag>
  5. <div class="box_arch_point">
  6. <div class="point_box" style="margin-top: 10px;">
  7. <el-input v-model="input" placeholder="按访客名称搜索" />
  8. </div>
  9. <div style="height: calc(100% - 160px);">
  10. <Empty></Empty>
  11. </div>
  12. <div class="center_in">
  13. <pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
  14. layout="total, prev, pager, next" @pagination="getList" />
  15. </div>
  16. </div>
  17. </div>
  18. <div class="right_visitor">
  19. <div class="garden_box">
  20. <HeadlineTag type="right" value="园区基本信息"></HeadlineTag>
  21. <div class="card_visitor_star">
  22. <div class="item_visitor_top">
  23. <div class="circle_itor center_in">
  24. <svg class="visitor_star" aria-hidden="true">
  25. <defs>
  26. <linearGradient id="myGradient" x1="0%" y1="100%" x2="0%" y2="0%">
  27. <stop offset="0%" stop-color="rgb(20, 188, 244)" />
  28. <stop offset="100%" stop-color="#ffffff" />
  29. </linearGradient>
  30. </defs>
  31. <use xlink:href="#icon-user" fill="url('#myGradient')" />
  32. </svg>
  33. </div>
  34. <div class="title_box_itor">
  35. <div class="title_itor_13">总规划建筑面积</div>
  36. <div class="title_itor_18">142万</div>
  37. </div>
  38. </div>
  39. <div class="item_visitor_top">
  40. <div class="circle_itor center_in">
  41. <svg class="visitor_star" aria-hidden="true">
  42. <defs>
  43. <linearGradient id="myGradient" x1="0%" y1="100%" x2="0%" y2="0%">
  44. <stop offset="0%" stop-color="rgb(20, 188, 244)" />
  45. <stop offset="100%" stop-color="#ffffff" />
  46. </linearGradient>
  47. </defs>
  48. <use xlink:href="#icon-user" fill="url('#myGradient')" />
  49. </svg>
  50. </div>
  51. <div class="title_box_itor">
  52. <div class="title_itor_13">总规划建筑面积</div>
  53. <div class="title_itor_18">142万</div>
  54. </div>
  55. </div>
  56. <div class="item_visitor_top">
  57. <div class="circle_itor center_in">
  58. <svg class="visitor_star" aria-hidden="true">
  59. <defs>
  60. <linearGradient id="myGradient" x1="0%" y1="100%" x2="0%" y2="0%">
  61. <stop offset="0%" stop-color="rgb(20, 188, 244)" />
  62. <stop offset="100%" stop-color="#ffffff" />
  63. </linearGradient>
  64. </defs>
  65. <use xlink:href="#icon-user" fill="url('#myGradient')" />
  66. </svg>
  67. </div>
  68. <div class="title_box_itor">
  69. <div class="title_itor_13">总规划建筑面积</div>
  70. <div class="title_itor_18">142万</div>
  71. </div>
  72. </div>
  73. <div class="item_visitor_top">
  74. <div class="circle_itor center_in">
  75. <svg class="visitor_star" aria-hidden="true">
  76. <defs>
  77. <linearGradient id="myGradient" x1="0%" y1="100%" x2="0%" y2="0%">
  78. <stop offset="0%" stop-color="rgb(20, 188, 244)" />
  79. <stop offset="100%" stop-color="#ffffff" />
  80. </linearGradient>
  81. </defs>
  82. <use xlink:href="#icon-user" fill="url('#myGradient')" />
  83. </svg>
  84. </div>
  85. <div class="title_box_itor">
  86. <div class="title_itor_13">总规划建筑面积</div>
  87. <div class="title_itor_18">142万</div>
  88. </div>
  89. </div>
  90. </div>
  91. </div>
  92. <div class="flex_spection">
  93. <HeadlineTag type="right" value="访客统计"></HeadlineTag>
  94. <div class="box_arch">
  95. <starView></starView>
  96. </div>
  97. </div>
  98. <div class="flex_spection">
  99. <HeadlineTag type="right" value="外地人员分配"></HeadlineTag>
  100. <div class="box_arch">
  101. <div ref="chartDom" style="width: 100%;height: 100%;" />
  102. </div>
  103. </div>
  104. </div>
  105. </div>
  106. </template>
  107. <script setup>
  108. import HeadlineTag from '@/components/HeadlineTag'
  109. import Empty from '@/components/Empty'
  110. import starView from './starView'
  111. import * as echarts from 'echarts'
  112. const total = ref(0);
  113. const queryParams = ref({
  114. pageNum: 1,
  115. pageSize: 10,
  116. });
  117. const input = ref('')
  118. /** 查询列表 */
  119. function getList() {
  120. };
  121. const chartDom = ref(null);
  122. let chartInstance = null;
  123. // 初始化图表
  124. const initChart = () => {
  125. var colorList = [{
  126. type: 'linear',
  127. x: 0,
  128. y: 0,
  129. x2: 1,
  130. y2: 1,
  131. colorStops: [{
  132. offset: 0,
  133. color: 'rgba(51,192,205,0.01)' // 0% 处的颜色
  134. },
  135. {
  136. offset: 1,
  137. color: 'rgba(51,192,205,0.57)' // 100% 处的颜色
  138. }
  139. ],
  140. globalCoord: false // 缺省为 false
  141. },
  142. {
  143. type: 'linear',
  144. x: 1,
  145. y: 0,
  146. x2: 0,
  147. y2: 1,
  148. colorStops: [{
  149. offset: 0,
  150. color: 'rgba(115,172,255,0.02)' // 0% 处的颜色
  151. },
  152. {
  153. offset: 1,
  154. color: 'rgba(115,172,255,0.67)' // 100% 处的颜色
  155. }
  156. ],
  157. globalCoord: false // 缺省为 false
  158. },
  159. {
  160. type: 'linear',
  161. x: 1,
  162. y: 0,
  163. x2: 0,
  164. y2: 0,
  165. colorStops: [{
  166. offset: 0,
  167. color: 'rgba(158,135,255,0.02)' // 0% 处的颜色
  168. },
  169. {
  170. offset: 1,
  171. color: 'rgba(158,135,255,0.57)' // 100% 处的颜色
  172. }
  173. ],
  174. globalCoord: false // 缺省为 false
  175. },
  176. {
  177. type: 'linear',
  178. x: 0,
  179. y: 1,
  180. x2: 0,
  181. y2: 0,
  182. colorStops: [{
  183. offset: 0,
  184. color: 'rgba(252,75,75,0.01)' // 0% 处的颜色
  185. },
  186. {
  187. offset: 1,
  188. color: 'rgba(252,75,75,0.57)' // 100% 处的颜色
  189. }
  190. ],
  191. globalCoord: false // 缺省为 false
  192. },
  193. {
  194. type: 'linear',
  195. x: 1,
  196. y: 1,
  197. x2: 1,
  198. y2: 0,
  199. colorStops: [{
  200. offset: 0,
  201. color: 'rgba(253,138,106,0.01)' // 0% 处的颜色
  202. },
  203. {
  204. offset: 1,
  205. color: '#FDB36ac2' // 100% 处的颜色
  206. }
  207. ],
  208. globalCoord: false // 缺省为 false
  209. },
  210. {
  211. type: 'linear',
  212. x: 0,
  213. y: 0,
  214. x2: 1,
  215. y2: 0,
  216. colorStops: [{
  217. offset: 0,
  218. color: 'rgba(254,206,67,0.12)' // 0% 处的颜色
  219. },
  220. {
  221. offset: 1,
  222. color: '#FECE4391' // 100% 处的颜色
  223. }
  224. ],
  225. globalCoord: false // 缺省为 false
  226. }
  227. ]
  228. var colorLine = ['#33C0CD', '#73ACFF', '#9E87FF', '#FE6969', '#FDB36A', '#FECE43']
  229. function getRich() {
  230. let result = {}
  231. colorLine.forEach((v, i) => {
  232. result[`hr${i}`] = {
  233. backgroundColor: colorLine[i],
  234. borderRadius: 3,
  235. width: 3,
  236. height: 3,
  237. padding: [3, 3, 0, -12]
  238. }
  239. result[`a${i}`] = {
  240. padding: [-11, 6, -20, 6],
  241. color: colorLine[i],
  242. backgroundColor: 'transparent',
  243. fontSize: 12
  244. }
  245. })
  246. return result
  247. }
  248. let data = [{
  249. 'name': '北京',
  250. 'value': 25
  251. }, {
  252. 'name': '上海',
  253. 'value': 20
  254. }, {
  255. 'name': '广州',
  256. 'value': 18
  257. }, {
  258. 'name': '深圳',
  259. 'value': 15
  260. }, {
  261. 'name': '未知',
  262. 'value': 13
  263. }, {
  264. 'name': '海外',
  265. 'value': 9
  266. }].sort((a, b) => {
  267. return b.value - a.value
  268. })
  269. data.forEach((v, i) => {
  270. v.labelLine = {
  271. lineStyle: {
  272. width: 1,
  273. color: colorLine[i]
  274. }
  275. }
  276. })
  277. chartInstance = echarts.init(chartDom.value);
  278. chartInstance.setOption({
  279. series: [{
  280. type: 'pie',
  281. radius: '60%',
  282. center: ['50%', '50%'],
  283. clockwise: true,
  284. avoidLabelOverlap: true,
  285. label: {
  286. show: true,
  287. position: 'outside',
  288. formatter: function (params) {
  289. const name = params.name
  290. const percent = params.percent + '%'
  291. const index = params.dataIndex
  292. return [`{a${index}|${name}:${percent}}`, `{hr${index}|}`].join('\n')
  293. },
  294. rich: getRich()
  295. },
  296. itemStyle: {
  297. normal: {
  298. color: function (params) {
  299. return colorList[params.dataIndex]
  300. }
  301. }
  302. },
  303. data,
  304. roseType: 'radius'
  305. }]
  306. });
  307. };
  308. // 生命周期
  309. onMounted(initChart);
  310. // 窗口自适应
  311. window.addEventListener('resize', () => {
  312. chartInstance?.resize();
  313. });
  314. </script>
  315. <style scoped lang="scss">
  316. .visitor {
  317. position: relative;
  318. width: 100%;
  319. padding-top: 45px;
  320. height: 100vh;
  321. overflow: hidden;
  322. }
  323. .left_visitor {
  324. position: absolute;
  325. left: 0;
  326. width: 25%;
  327. height: calc(100% - 45px);
  328. display: flex;
  329. flex-direction: column;
  330. padding-left: 10px;
  331. }
  332. .right_visitor {
  333. position: absolute;
  334. right: 0;
  335. width: 25%;
  336. height: calc(100% - 45px);
  337. display: flex;
  338. flex-direction: column;
  339. }
  340. .box_arch_point {
  341. height: calc(100% - 40px);
  342. }
  343. .operation_spection {
  344. height: 250px;
  345. color: #fff;
  346. }
  347. .garden_box {
  348. height: 300px;
  349. }
  350. .flex_spection {
  351. flex: 1;
  352. color: #fff;
  353. }
  354. .box_arch {
  355. display: flex;
  356. align-items: center;
  357. height: calc(100% - 40px);
  358. }
  359. </style>
  360. <style lang="scss" scoped>
  361. .point_box :deep(.el-input__wrapper) {
  362. background-color: transparent !important;
  363. box-shadow: 0 0 0 1px rgb(58, 86, 117) inset !important;
  364. }
  365. .point_box :deep(.el-input__wrapper.is-focus) {
  366. box-shadow: 0 0 0 1px #409EFF inset !important;
  367. }
  368. .point_box :deep(.el-input__inner) {
  369. color: #ffffff !important;
  370. }
  371. .card_visitor_star {
  372. height: calc(100% - 40px);
  373. display: flex;
  374. flex-direction: column;
  375. }
  376. .item_visitor_top {
  377. flex: 1;
  378. margin: 5px 0px;
  379. padding-left: 20px;
  380. display: flex;
  381. align-items: center;
  382. border-left: 2px solid rgb(67, 182, 235);
  383. background-image: linear-gradient(to right, rgba(15, 73, 138, 1) 0%, rgba(13, 65, 125, 0.5) 21%, rgba(13, 65, 125, 0.5) 52%, rgba(0, 0, 0, 0) 78%, rgba(0, 0, 0, 0) 100%);
  384. }
  385. .circle_itor {
  386. width: 50px;
  387. height: 50px;
  388. border-radius: 50%;
  389. border: 2px solid rgb(103, 168, 202);
  390. }
  391. .title_box_itor {
  392. display: flex;
  393. flex-direction: column;
  394. align-items: center;
  395. padding-left: 20px;
  396. }
  397. .title_itor_13 {
  398. color: #ffffff;
  399. font-size: 13px;
  400. }
  401. .title_itor_18 {
  402. padding-top: 5px;
  403. font-weight: bold;
  404. font-size: 18px;
  405. background-image: -webkit-linear-gradient(bottom, rgb(20, 127, 228), rgb(229, 232, 236));
  406. -webkit-background-clip: text;
  407. -webkit-text-fill-color: transparent;
  408. }
  409. .visitor_star {
  410. width: 30px;
  411. height: 30px;
  412. }
  413. </style>