ProjectSituationofPM.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  1. <template>
  2. <transition
  3. appear
  4. name="animate__animated animate__move"
  5. enter-active-class="animate__slideInRight"
  6. leave-active-class="animate__slideOutRight"
  7. >
  8. <div class="widget-ProjectSituationofPM">
  9. <div class="head">
  10. <div class="title">
  11. <div class="icon"></div>
  12. <span class="site-info">近期工程情况</span>
  13. <div class="dateRange">{{ endTime }}~{{ beginTime }}</div>
  14. </div>
  15. </div>
  16. <div class="content-info">
  17. <!---->
  18. <div class="percentChartContent">
  19. <div class="chart-item" v-for="item of percentChartList" :key="item.title">
  20. <PercentGaugeChart :title="item.title" :value="item.value" />
  21. </div>
  22. </div>
  23. <!---->
  24. <div class="bottom3Content">
  25. <!---->
  26. <div class="bottom2Content">
  27. <!---->
  28. <div class="overallProjectProgress">
  29. <div class="title">
  30. <div class="icon"></div>
  31. <span class="item-name">工程总体进度</span>
  32. <div class="symbol">滞后</div>
  33. </div>
  34. <div class="oppContent">
  35. <div class="oppItem">
  36. <div class="oppItem-title">报批报建情况:</div>
  37. <div class="oppItem-content">
  38. {{ situation }}
  39. </div>
  40. </div>
  41. </div>
  42. </div>
  43. <!---->
  44. <div class="scanCodeNumber">
  45. <div class="title">
  46. <div class="icon"></div>
  47. <span class="item-name">扫码次数统计</span>
  48. </div>
  49. <div class="scanCodeNumberContent">
  50. <SupAndConsNumChartVue :type="'progress'" :chartData="scanCodeNumberData" />
  51. </div>
  52. </div>
  53. </div>
  54. <!---->
  55. <div class="constructionRecords">
  56. <div class="title">
  57. <div class="icon"></div>
  58. <span class="item-name">施工记录</span>
  59. <span class="item-type">(沟槽开挖)</span>
  60. </div>
  61. <div class="constructionRecordsContent">
  62. <el-carousel ref="picCarousel" indicator-position="none" :autoplay="true" @change="changeCarousel">
  63. <el-carousel-item v-for="item in pictureList" :key="item.index">
  64. <div class="consName">白洋冲片区排水管网综合治理工程{{ item.index }}</div>
  65. <div class="consInfo">
  66. <div class="infoWrap">
  67. <div class="pipeInfo">排水管网WS01-WS03</div>
  68. <div class="timeInfo">2022-02-03 12:12:12</div>
  69. </div>
  70. </div>
  71. <img class="consImg" src="@/views/groupPage/images/项目图册/1-调蓄池施工.png" />
  72. </el-carousel-item>
  73. </el-carousel>
  74. <div class="switchWidget">
  75. <div class="leftArrow" @click="clickPrev()"><i class="el-icon-caret-left"></i></div>
  76. <div class="middleNumber">
  77. <div class="activeNum">{{ currentActive }}</div>
  78. /{{ pictureList.length }}
  79. </div>
  80. <div class="rightArrow" @click="clickNext()"><i class="el-icon-caret-right"></i></div>
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. </transition>
  88. </template>
  89. <script lang="ts">
  90. import moment from 'moment'
  91. import { Vue, Component, Prop, Watch } from 'vue-property-decorator'
  92. import PercentGaugeChart from '@/views/groupPage/components/GaugeChart/percentGaugeChart.vue'
  93. import SupAndConsNumChartVue from '@/views/groupPage/components/ComprehensiveChart/supAndConsNumChart.vue'
  94. import { getRequestResult } from '@/views/groupPage/apis'
  95. import { roundFun } from '@/views/groupPage/util'
  96. //近期工程情况-进度
  97. @Component({
  98. name: 'ProjectSituationofPM',
  99. components: { PercentGaugeChart, SupAndConsNumChartVue }
  100. })
  101. export default class ProjectSituationofPM extends Vue {
  102. percentChartList = []
  103. scanCodeNumberData = {}
  104. situation = ''
  105. beginTime = moment(new Date()).format('YYYY.MM.DD')
  106. endTime = moment(new Date().setDate(new Date().getDate() - 6)).format('YYYY.MM.DD')
  107. pictureList: Array<any> = [{ index: 1 }, { index: 2 }, { index: 3 }, { index: 4 }]
  108. currentActive = 1
  109. clickPrev() {
  110. ;(this.$refs['picCarousel'] as any).prev()
  111. }
  112. clickNext() {
  113. ;(this.$refs['picCarousel'] as any).next()
  114. }
  115. changeCarousel(active, prev) {
  116. this.currentActive = active + 1
  117. }
  118. get staticticalInfo() {
  119. return this.$store.state.bigScreen.statisticalAnalysisInfo
  120. }
  121. get projectCode() {
  122. return this.$store.state.bigScreen.currentProjectCode
  123. }
  124. @Watch('projectCode', { immediate: true })
  125. onChangMehod() {
  126. this.getPageData()
  127. }
  128. @Watch('staticticalInfo')
  129. onChangeMethod(val) {
  130. this.assembleData(val)
  131. }
  132. assembleData(result) {
  133. const { build, design } = result.recentProjectInfo
  134. console.log(build, design)
  135. let dPercent = 0,
  136. cPercent = 0
  137. build.forEach((item) => {
  138. cPercent += roundFun((item.current30data - item.current30beforedata) / item.current30beforedata, 2)
  139. })
  140. design.forEach((item) => {
  141. dPercent += roundFun((item.current30data - item.current30beforedata) / item.current30beforedata, 2)
  142. })
  143. this.percentChartList = [
  144. { title: '设计入库同比上周', value: dPercent },
  145. { title: '施工部件同比上周', value: cPercent }
  146. ]
  147. //
  148. const length = result.dailyData.length
  149. let list = result.dailyData.slice(length - 7, length),
  150. xAxis = [],
  151. spvData = [],
  152. conData = []
  153. list.forEach((item) => {
  154. xAxis.push(item.datestr.substr(4, 4).substr(0, 2) + '/' + item.datestr.substr(4, 4).substr(2, 2))
  155. spvData.push(item.con_scans)
  156. conData.push(item.spv_scans)
  157. })
  158. this.scanCodeNumberData = {
  159. xAxis,
  160. spvData,
  161. conData
  162. }
  163. }
  164. async getPageData() {
  165. let data = { blockCode: 'ycepclist' }
  166. let projectCode = this.projectCode
  167. //获取全部数据
  168. const result = await getRequestResult(data)
  169. let res = (result as any).filter((item) => item.indexCode.indexOf(projectCode + '-') != -1)
  170. res = res.map((item) => {
  171. Object.keys(item).forEach((val) => (item[val] = item[val] || ''))
  172. return { ...item }
  173. })
  174. this.situation = res.find((e) => e.indexCode == projectCode + '-' + 70).indexValue
  175. }
  176. }
  177. </script>
  178. <style lang='scss' scoped>
  179. .animate__slideInRight,
  180. .animate__slideOutRight {
  181. animation-duration: 3s; //动画持续时间
  182. animation-delay: 0s; //动画延迟时间
  183. }
  184. .widget-ProjectSituationofPM {
  185. z-index: 2;
  186. //position
  187. bottom: $size10 /* 10/192 */;
  188. margin-right: $size20 /* 20/192 */;
  189. right: 0;
  190. position: absolute;
  191. //size
  192. height: calc(100% - 0.557292rem /* 107/192 */);
  193. width: 2.083333rem /* 400/192 */;
  194. .head {
  195. height: 0.166667rem /* 32/192 */;
  196. width: 100%;
  197. background: linear-gradient(-90deg, rgba(43, 167, 255, 0.2) 0%, rgba(43, 167, 255, 0.08) 100%);
  198. font-family: Source Han Sans CN-HEAVY;
  199. .title {
  200. width: 100%;
  201. height: 100%;
  202. display: flex;
  203. font-weight: 400;
  204. align-items: center;
  205. .icon {
  206. height: 0.166667rem /* 32/192 */;
  207. width: 0.34375rem /* 66/192 */;
  208. background: url('~@/views/groupPage/images/模块图标/统计分析/工程情况.png') no-repeat center center;
  209. background-size: 100% 100%;
  210. }
  211. span {
  212. flex: 1;
  213. font-weight: bold;
  214. font-size: 0.083333rem /* 16/192 */;
  215. color: #ffffff;
  216. padding: 0.041667rem /* 8/192 */;
  217. background: linear-gradient(0deg, #9bd2fa 0%, #ffffff 100%);
  218. background-clip: text;
  219. -webkit-text-fill-color: transparent;
  220. }
  221. .dateRange {
  222. height: 0.0625rem /* 12/192 */;
  223. font-size: 0.072917rem /* 14/192 */;
  224. font-family: Source Han Sans CN;
  225. font-weight: 400;
  226. color: #ffffff;
  227. }
  228. }
  229. }
  230. .content-info {
  231. width: 100%;
  232. height: calc(100% - 0.166667rem);
  233. font-family: Source Han Sans CN;
  234. .percentChartContent {
  235. height: 0.807292rem /* 155/192 */;
  236. width: 100%;
  237. display: flex;
  238. align-items: center;
  239. justify-content: center;
  240. .chart-item {
  241. height: 100%;
  242. width: 50%;
  243. }
  244. }
  245. .title {
  246. width: 100%;
  247. display: flex;
  248. align-items: center;
  249. .icon {
  250. height: 0.072917rem /* 14/192 */;
  251. width: 0.078125rem /* 15/192 */;
  252. margin-right: 0.046875rem /* 9/192 */;
  253. background: url('~@/views/groupPage/images/三角.png') no-repeat center center;
  254. background-size: 100% 100%;
  255. }
  256. .item-name,
  257. .item-type {
  258. font-family: Source Han Sans CN;
  259. color: #0ea7ff;
  260. font-size: 0.072917rem /* 14/192 */;
  261. font-weight: 500;
  262. }
  263. .item-type {
  264. color: #89c3ec !important;
  265. }
  266. .symbol {
  267. margin-left: 0.052083rem /* 10/192 */;
  268. width: 0.208333rem /* 40/192 */;
  269. height: 0.104167rem /* 20/192 */;
  270. font-size: 0.072917rem /* 14/192 */;
  271. font-family: Source Han Sans CN;
  272. font-weight: 400;
  273. color: #ffffff;
  274. background: linear-gradient(90deg, #2188d3, #9c2bec);
  275. border-radius: 2px;
  276. display: flex;
  277. align-items: center;
  278. justify-content: center;
  279. }
  280. }
  281. .bottom3Content {
  282. height: calc(100% - 0.807292rem /* 155/192 */);
  283. width: 100%;
  284. background: linear-gradient(0deg, rgba(14, 167, 255, 0.16) 0%, rgba(14, 167, 255, 0) 100%);
  285. }
  286. .overallProjectProgress {
  287. margin-top: 0.052083rem /* 10/192 */;
  288. width: 100%;
  289. height: calc(100% - 1.380208rem /* 265/192 */);
  290. .oppContent {
  291. margin-top: 0.036458rem /* 7/192 */;
  292. width: 100%;
  293. height: calc(100% - 0.15625rem /* 30/192 */);
  294. background: #062239;
  295. overflow: auto;
  296. .oppItem {
  297. width: 100%;
  298. padding: 0.052083rem /* 10/192 */;
  299. color: #feffff;
  300. font-family: Source Han Sans CN;
  301. font-size: 0.072917rem /* 14/192 */;
  302. .oppItem-title {
  303. color: #17aaff;
  304. }
  305. .oppItem-content {
  306. padding: 0.026042rem /* 5/192 */ 0;
  307. line-height: 0.114583rem /* 22/192 */;
  308. }
  309. }
  310. }
  311. }
  312. .scanCodeNumber {
  313. margin-top: 0.052083rem /* 10/192 */;
  314. width: 100%;
  315. height: 1.25rem /* 240/192 */;
  316. .scanCodeNumberContent {
  317. height: calc(100% - 0.072917rem /* 14/192 */);
  318. width: 100%;
  319. }
  320. }
  321. .bottom2Content {
  322. width: 100%;
  323. height: calc(100% - 1.40625rem /* 270/192 */);
  324. overflow: auto;
  325. }
  326. .constructionRecords {
  327. margin-top: 0.052083rem /* 10/192 */;
  328. width: 100%;
  329. height: 1.354167rem /* 260/192 */;
  330. .constructionRecordsContent {
  331. width: 100%;
  332. height: calc(100% - 0.072917rem /* 14/192 */);
  333. display: flex;
  334. flex-flow: column;
  335. align-items: center;
  336. justify-content: flex-end;
  337. .el-carousel {
  338. width: 90%;
  339. height: 80%;
  340. /deep/ .el-carousel__container {
  341. height: 100% !important;
  342. }
  343. .consImg {
  344. height: 100%;
  345. width: 100%;
  346. }
  347. .consName,
  348. .consInfo {
  349. position: absolute;
  350. background: rgba(0, 0, 0, 0.4);
  351. width: 100%;
  352. height: 0.177083rem /* 34/192 */;
  353. line-height: 0.177083rem /* 34/192 */;
  354. font-size: 0.072917rem /* 14/192 */;
  355. font-family: Source Han Sans CN;
  356. font-weight: 500;
  357. color: #ffffff;
  358. }
  359. .consName {
  360. top: 0;
  361. }
  362. .consInfo {
  363. bottom: 0;
  364. }
  365. .infoWrap {
  366. display: flex;
  367. align-items: center;
  368. justify-content: space-between;
  369. }
  370. }
  371. .switchWidget {
  372. display: flex;
  373. align-items: center;
  374. justify-content: space-between;
  375. width: 0.557292rem /* 107/192 */;
  376. color: rgba(137, 195, 236, 1);
  377. height: 0.072917rem /* 14/192 */;
  378. margin: 0.052083rem /* 10/192 */;
  379. .leftArrow,
  380. .rightArrow {
  381. font-size: 0.072917rem /* 14/192 */;
  382. cursor: pointer;
  383. }
  384. .middleNumber {
  385. display: flex;
  386. .activeNum {
  387. color: #2ba7ff;
  388. }
  389. }
  390. }
  391. }
  392. }
  393. }
  394. }
  395. </style>