index.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643
  1. <template>
  2. <div>
  3. <div class="data-display">
  4. <ul class="list">
  5. <li>
  6. <p class="list-num">
  7. <i class='el-icon-s-order'></i>
  8. {{lederDelObjectCount}}
  9. </p>
  10. <p class="list-text">台账中待删除的对象</p>
  11. </li>
  12. <li>
  13. <p class="list-num">
  14. <i class="el-icon-s-help"></i>
  15. {{22}}
  16. </p>
  17. <p class="list-text">不能同步到物理世界的对象</p>
  18. </li>
  19. <li>
  20. <p class="list-num">
  21. <i class="el-icon-s-marketing"></i>
  22. {{notSyncDataCount}}
  23. </p>
  24. <p class="list-text">不能同步到物理世界的关系数据</p>
  25. </li>
  26. <li>
  27. <p class="list-num">
  28. <i class="el-icon-s-release"></i>
  29. {{postRelationInforCount}}
  30. </p>
  31. <p class="list-text">岗位和关联的资产信息点值不一致</p>
  32. </li>
  33. </ul>
  34. </div>
  35. <div class="progress">
  36. <p class="basic-statistics">基本统计</p>
  37. <div class="data equipment">
  38. <!-- 设备:本期只做前三个 -->
  39. <span class="contain-title">设备<i>{{`(${equipCount?equipCount:"0"})`}}</i></span>
  40. <div class="data-show" v-loading="isLoading" v-if="equipment.length">
  41. <div class="show-content" v-for="(item,index) in equipment" :key="index">
  42. <data-origin :id="'origin' + index" :renderData="item"></data-origin>
  43. </div>
  44. </div>
  45. <div v-if="!equipment.length" class="center" style="height: 60%;transform: translateY(30%);">
  46. <i class="icon-wushuju iconfont"></i>
  47. 暂无数据
  48. </div>
  49. </div>
  50. <div class="data assets">
  51. <span class="contain-title">资产<i>{{`(${assetsCount?assetsCount:"0"})`}}</i></span>
  52. <div class="data-show" v-loading="isLoading" v-if="assets.length">
  53. <div class="show-content" v-for="(item,index) in assets" :key="index">
  54. <data-origin :id="'origin' + index" :renderData="item"></data-origin>
  55. </div>
  56. </div>
  57. <div v-if="!assets.length" class="center" style="height: 60%;transform: translateY(30%);">
  58. <i class="icon-wushuju iconfont"></i>
  59. 暂无数据
  60. </div>
  61. </div>
  62. <div class="data parts">
  63. <span class="contain-title">部件<i>{{`(${partsCount?partsCount:'0'})`}}</i></span>
  64. <div v-if="!parts.length" class="center" style="height: 60%;transform: translateY(30%);">
  65. <i class="icon-wushuju iconfont"></i>
  66. 暂无数据
  67. </div>
  68. </div>
  69. <div class="data business-space">
  70. <span class="contain-title">业务空间<i>{{`(${zoneSpaceCount?zoneSpaceCount:'0'})`}}</i></span>
  71. <div class="data-show" v-if="business.length">
  72. <div v-for="(item,index) in business" :key="index" class="show-content">
  73. <datafan :id="'datafan' + index" :renderData="item"></datafan>
  74. </div>
  75. </div>
  76. <div v-if="!business.length" class="center" style="height: 60%;transform: translateY(30%);">
  77. <i class="icon-wushuju iconfont"></i>
  78. 暂无数据
  79. </div>
  80. </div>
  81. <div class="data system">
  82. <!-- 系统:本期只查询总数 -->
  83. <span class="contain-title">系统<i>{{`(${systemCount?systemCount:'0'})`}}</i></span>
  84. <div v-if="!system.length" class="center" style="height: 60%;transform: translateY(30%);">
  85. <i class="icon-wushuju iconfont"></i>
  86. 暂无数据
  87. </div>
  88. </div>
  89. <div class="data tenant">
  90. <span class="contain-title">租户<i>{{`(${rentantCount?rentantCount:'0'})`}}</i></span>
  91. <div class="data-show" v-loading="isLoading" v-if="tenant.length">
  92. <div class="show-content" v-for="(item,index) in tenant" :key="index">
  93. <data-origin :id="'origin' + item + index" :renderData="item"></data-origin>
  94. </div>
  95. </div>
  96. <div v-if="!tenant.length" class="center" style="height: 60%;transform: translateY(30%);">
  97. <i class="icon-wushuju iconfont"></i>
  98. 暂无数据
  99. </div>
  100. </div>
  101. <div class="data shaft">
  102. <span class="contain-title">竖井<i>{{`(${shaftCount?shaftCount:'0'})`}}</i></span>
  103. <div class="data-show" v-loading="isLoading" v-if="shaft.length">
  104. <div class="show-content" v-for="(item,index) in shaft" :key="index">
  105. <datafan :id="'origin' + shaft" :renderData="item" v-if="!item.needCountT"></datafan>
  106. <data-origin :id="'origin' + item + index" :renderData="item" v-else></data-origin>
  107. </div>
  108. </div>
  109. <div v-if="!shaft.length" class="center" style="height: 60%;transform: translateY(30%);">
  110. <i class="icon-wushuju iconfont"></i>
  111. 暂无数据
  112. </div>
  113. </div>
  114. </div>
  115. </div>
  116. </template>
  117. <script>
  118. import { mapGetters } from "vuex";
  119. import {
  120. getCenoteType,
  121. queryLederDelObject,
  122. notSyncRelationData,
  123. postRelationInforAtpism,
  124. countEquip,
  125. countProperty,
  126. queryPart,
  127. queryZoneCount,
  128. queryPartitionRatio,
  129. queryDefaultFunTypes,
  130. countGeneralSys,
  131. queryRentCount,
  132. queryTenantCompletion,
  133. queryCenoteCount,
  134. queryShaftFunctionType,
  135. ShaftRelationBusinessSpace,
  136. getDataDictionary
  137. } from "@/api/scan/request";
  138. import dataOrigin from "@/components/ledger/report/dataorigin";
  139. import datafan from "@/components/ledger/report/datafan";
  140. import { queryDataSourceCount, synchronizeProj } from "@/fetch/point_http";
  141. export default {
  142. data() {
  143. return {
  144. lederDelObjectCount: null,// 台账中待删除的对象
  145. notSyncDataCount: null,// 不能同步到物理世界的关系数据
  146. postRelationInforCount: null,// 岗位和关联的资产信息点值不一致
  147. equipCount: null,// 设备总数
  148. equipment: [],// 设备数据
  149. assetsCount: null,// 资产总数
  150. assets: [],// 资产数据
  151. parts: [],// 部件数据
  152. partsCount: null,// 部件总数
  153. zoneSpaceCount: null,// 业务空间总数
  154. zoneType: [// 分区类型
  155. {
  156. "Code": "GeneralZone",
  157. "Name": "默认分区",
  158. "Rel_type": "99"
  159. },
  160. {
  161. "Name": "供电分区",
  162. "Rel_type": "1",
  163. "Code": "PowerSupplyZone"
  164. },
  165. {
  166. "Name": "照明分区",
  167. "Rel_type": "2",
  168. "Code": "LightingZone"
  169. },
  170. {
  171. "Name": "网络分区",
  172. "Rel_type": "3",
  173. "Code": "NetworkZone"
  174. },
  175. {
  176. "Code": "AirConditioningZone",
  177. "Name": "空调分区",
  178. "Rel_type": "4"
  179. },
  180. {
  181. "Name": "采暖分区",
  182. "Rel_type": "5",
  183. "Code": "HeatingZone"
  184. },
  185. {
  186. "Name": "洁净分区",
  187. "Rel_type": "6",
  188. "Code": "CleanZone"
  189. },
  190. {
  191. "Name": "生活给水分区",
  192. "Rel_type": "7",
  193. "Code": "DomesticWaterSupplyZone"
  194. },
  195. {
  196. "Code": "FireZone",
  197. "Name": "防火分区",
  198. "Rel_type": "8"
  199. },
  200. {
  201. "Name": "安防分区",
  202. "Rel_type": "9",
  203. "Code": "SecurityZone"
  204. },
  205. {
  206. "Name": "租户分区",
  207. "Rel_type": "10",
  208. "Code": "TenantZone"
  209. },
  210. {
  211. "Name": '功能分区',
  212. 'Rel_type': '11',
  213. "Code": 'FunctionZone'
  214. }
  215. ],
  216. partProtion: [],// 业务空间-各分区占比数据
  217. defaultPart: [],// 业务空间-默认分区功能类型占比数据
  218. business: [],// 业务空间数据
  219. systemCount: null,// 系统总数
  220. system: [],// 系统数据
  221. rentantCount: null,// 租户总数
  222. tenant: [],// 租户数据
  223. shaftCount: null,// 竖井总数
  224. shaft: [],// 竖井数据
  225. ShaftFunType: null,// 竖井功能类型
  226. shaftPartProtion: [],// 竖井-按功能类型占比数据
  227. params: null,
  228. isLoading: false,
  229. color: ["#3485d6", "#a384fc", "#4caf50", "#ff6316", "#fd8bbe", "#03a9f3", "#ea615b"]
  230. }
  231. },
  232. components: {
  233. dataOrigin,
  234. datafan
  235. },
  236. mounted() { },
  237. created() {
  238. this.params = {
  239. ProjectId: this.projectId
  240. }
  241. this.getFunctionType();
  242. this.getStatisticsCount();
  243. this.getEquipCount();
  244. this.getAssetsCount();
  245. this.getPartsCount();
  246. this.getSystemCount();
  247. this.getTenantCount();
  248. // this.getShaftCount();
  249. this.getShaftFunType();
  250. },
  251. computed: {
  252. ...mapGetters('layout', ['projectId'])
  253. },
  254. methods: {
  255. zoneTypeConversion(item) {// 分区类型转换
  256. this.zoneType.map(it => {
  257. if (item.Name === it.Code) {
  258. item.Name = it.Name;
  259. }
  260. })
  261. },
  262. functionTypeTranstion(item, type) {// 默认分区功能类型转换
  263. type.map(it => {
  264. if (item.Name === it.Code) {
  265. item.Name = it.Name;
  266. this.defaultPart.push({
  267. name: item.Name,
  268. value: item.Count
  269. });
  270. // this.defaultPart.map((item, index) => {
  271. // item.itemStyle = {color:this.color}
  272. // })
  273. }
  274. if (it.Content) {
  275. this.functionTypeTranstion(item, it.Content)
  276. }
  277. })
  278. },
  279. getFunctionType() {// 获取默认分区功能类型
  280. let params = {
  281. ProjectId: this.projectId,
  282. type: "GeneralZone",
  283. data: {
  284. Filters: "InfoPointCode='RoomFuncType'",
  285. Projection: ["DataSource", "InfoPointCode"]
  286. }
  287. }
  288. getDataDictionary(params, res => {
  289. this.functionType = JSON.parse(res.Content[0].DataSource)
  290. this.getZoneSpaceCount();
  291. })
  292. },
  293. toPercent(point) {// 小数转换成百分比
  294. if (point == 0) {
  295. return 0;
  296. }
  297. var str = Number(point * 100).toFixed(2);
  298. str += "%";
  299. return str;
  300. },
  301. getShaftFunType() {// 获取数据功能类型
  302. getCenoteType(this.param, res => {
  303. this.ShaftFunType = res.Content;
  304. this.getShaftCount();
  305. })
  306. },
  307. shaftFunTypeTranstion(item) {// 竖井功能类型转换
  308. this.ShaftFunType.map((it, index) => {
  309. if (item.Name === it.Id) {
  310. item.Name = it.Name;
  311. }
  312. })
  313. },
  314. getStatisticsCount() {// 获取顶部统计数据
  315. let params = {
  316. ProjectId: this.projectId,
  317. Filters: "taskState = -1"
  318. }
  319. // 台账中待删除的对象
  320. queryLederDelObject(params, res => {
  321. this.lederDelObjectCount = res.Count;
  322. })
  323. // 不能同步到物理世界的对象
  324. // 不能同步到物理世界的关系数据
  325. notSyncRelationData(this.params, res => {
  326. this.notSyncDataCount = res.Count;
  327. })
  328. // 岗位和关联的资产信息点值不一致
  329. postRelationInforAtpism(this.params, res => {
  330. this.postRelationInforCount = res.Count;
  331. })
  332. },
  333. getEquipCount() {// 获取设备总数
  334. countEquip(this.params, res => {
  335. this.equipCount = res.Count;
  336. this.getEquipOtherCount();
  337. })
  338. },
  339. getEquipOtherCount() {// 获取设备数据
  340. // 未关联资产
  341. let param = {
  342. ProjectId: this.projectId,
  343. Filters: "PropertyId isNull"
  344. }
  345. countEquip(param, res => {
  346. this.equipment.push({
  347. title: '未关联资产',
  348. tips: '设备未关联资产数量',
  349. contentValueO: '未关联',
  350. contentValueT: '已关联',
  351. text: '',
  352. needCountO: res.Count,
  353. needCountT: this.equipCount - res.Count,
  354. text: `总数${this.equipCount}`
  355. })
  356. })
  357. // 现场验证状态占比
  358. let par = {
  359. ProjectId: this.projectId,
  360. Filters: "taskState = 0 or taskState = 1"
  361. }
  362. countEquip(par, res => {
  363. let text = this.toPercent(res.Count / this.equipCount)
  364. this.equipment.push({
  365. title: '现场验证状态占比',
  366. tips: '设备状态为未找到、已找到的数量与设备总数占比',
  367. contentValueO: '已验证',
  368. contentValueT: '未验证',
  369. text: '',
  370. needCountO: res.Count,
  371. needCountT: this.equipCount - res.Count,
  372. text: text
  373. })
  374. this.getEquipBIMIDCount();
  375. })
  376. },
  377. getEquipBIMIDCount() {// 设备-与模型对应占比
  378. let pa = {
  379. ProjectId: this.projectId,
  380. Filters: "not BimID isNull"
  381. }
  382. countEquip(pa, res => {
  383. let text = this.toPercent(res.Count / this.equipCount)
  384. this.equipment.push({
  385. title: '与模型对应占比',
  386. tips: '"BIM模型中编码"有值的设备数量与设备总数占比',
  387. contentValueO: '有BIMID',
  388. contentValueT: '无BIMID',
  389. text: '',
  390. needCountO: res.Count,
  391. needCountT: this.equipCount - res.Count,
  392. text: text
  393. })
  394. this.isLoading = false;
  395. })
  396. },
  397. getAssetsCount() {// 获取资产数据
  398. countProperty(this.params, res => {
  399. // 获取资产总数
  400. this.assetsCount = res.Count;
  401. })
  402. // 未关联资产
  403. let param = {
  404. ProjectId: this.projectId,
  405. Filters: " EquipmentId isnull"
  406. }
  407. countProperty(param, res => {
  408. this.assets.push({
  409. title: '未关联资产',
  410. tips: '资产未关联设备数量',
  411. contentValueO: '未关联',
  412. contentValueT: '已关联',
  413. text: `总数${this.assetsCount}`,
  414. needCountO: res.Count,
  415. needCountT: this.assetsCount - res.Count
  416. })
  417. })
  418. // 现场验证状态占比
  419. let par = {
  420. ProjectId: this.projectId,
  421. Filters: " taskState = 0 or taskState = 1"
  422. }
  423. countProperty(par, res => {
  424. let text = res.Count / this.assetsCount;
  425. text = this.toPercent(text);
  426. this.assets.push({
  427. title: '现场验证状态占比',
  428. tips: '资产状态为未找到、已找到的数量与资产总数占比',
  429. contentValueO: '已验证',
  430. contentValueT: '未验证',
  431. text: text,
  432. needCountO: res.Count,
  433. needCountT: this.assetsCount - res.Count
  434. })
  435. })
  436. // 有无坐标占比
  437. let pa = {
  438. ProjectId: this.projectId,
  439. Filters: " not BIMLocation isnull"
  440. }
  441. countProperty(pa, res => {
  442. let text = res.Count / this.assetsCount;
  443. text = this.toPercent(text);
  444. this.assets.push({
  445. title: '有无坐标占比',
  446. tips: '有坐标的资产数量百分比',
  447. contentValueO: '有坐标',
  448. contentValueT: '无坐标',
  449. text: text,
  450. needCountO: res.Count,
  451. needCountT: this.assetsCount - res.Count
  452. })
  453. })
  454. },
  455. getPartsCount() {// 获取部件数据
  456. queryPart(this.params, res => {
  457. this.partsCount = res.Count;
  458. })
  459. },
  460. getZoneSpaceCount() {// 获取业务空间数据
  461. // 获取业务空间总数
  462. queryZoneCount(this.params, res => {
  463. this.zoneSpaceCount = res.Count;
  464. })
  465. // 获取业务空间的各分区占比
  466. queryPartitionRatio(this.params, res => {
  467. res.Content.map(item => {
  468. this.zoneTypeConversion(item);
  469. this.partProtion.push({
  470. name: item.Name,
  471. value: item.Count
  472. })
  473. })
  474. this.business.push({
  475. title: '各分区占比',
  476. tips: '各类型分区实例数量与实例总数占比',
  477. needCountO: this.partProtion,
  478. })
  479. })
  480. // 获取业务空间默认分区功能类型占比
  481. queryDefaultFunTypes(this.params, res => {
  482. res.Content.map(item => {
  483. this.functionTypeTranstion(item, this.functionType);
  484. })
  485. this.business.push({
  486. title: '默认分区功能类型占比',
  487. tips: '默认分区实例的功能区类型占比',
  488. needCountO: this.defaultPart,
  489. })
  490. })
  491. },
  492. getSystemCount() {// 获取系统数据
  493. countGeneralSys(this.params, res => {
  494. this.systemCount = res.Count;
  495. })
  496. },
  497. getTenantCount() {// 获取租户数据
  498. // 获取租户总数
  499. queryRentCount(this.params, res => {
  500. this.rentantCount = res.Count;
  501. })
  502. // 租户-关联业务空间完成度
  503. queryTenantCompletion(this.params, res => {
  504. let text = res.Count / this.rentantCount;
  505. text = this.toPercent(text);
  506. this.tenant.push({
  507. title: '关联业务空间完成度',
  508. tips: '已关联业务空间的租户数量百分比',
  509. contentValueO: '已关联',
  510. contentValueT: '未关联',
  511. text: '',
  512. needCountO: res.Count,
  513. needCountT: this.rentantCount - res.Count,
  514. text: text
  515. })
  516. })
  517. },
  518. getShaftCount() {// 获取竖井数据
  519. // 获取竖井总数
  520. queryCenoteCount(this.params, res => {
  521. this.shaftCount = res.Count;
  522. })
  523. // 获取竖井按功能类型占比
  524. queryShaftFunctionType(this.params, res => {
  525. res.Content.map(item => {
  526. this.shaftFunTypeTranstion(item);
  527. this.shaftPartProtion.push({
  528. name: item.Name,
  529. value: item.Count
  530. })
  531. })
  532. this.shaft.push({
  533. title: '按功能类型占比',
  534. tips: '竖井实例的竖井功能占比',
  535. needCountO: this.shaftPartProtion,
  536. })
  537. })
  538. // 获取竖井关联业务空间完成度
  539. ShaftRelationBusinessSpace(this.params, res => {
  540. let text = this.toPercent(res.Count / this.shaftCount);
  541. this.shaft.push({
  542. title: '关联业务空间完成度',
  543. tips: '已关联业务空间的竖井数量百分比',
  544. contentValueO: '已关联',
  545. contentValueT: '未关联',
  546. needCountO: res.Count,
  547. needCountT: this.shaftCount - res.Count,
  548. text: text
  549. })
  550. })
  551. }
  552. },
  553. }
  554. </script>
  555. <style lang="scss" scoped>
  556. .data-display {
  557. width: 100%;
  558. margin-bottom: 10px;
  559. ul {
  560. display: flex;
  561. li {
  562. flex: 1;
  563. background: white;
  564. border: 1px solid #c9c9c9;
  565. text-align: center;
  566. padding: 20px;
  567. box-sizing: border-box;
  568. p {
  569. color: #333;
  570. i {
  571. margin-right: 20px;
  572. }
  573. }
  574. p:nth-child(1) {
  575. font-size: 24px;
  576. }
  577. + li {
  578. margin-left: 10px;
  579. }
  580. }
  581. }
  582. }
  583. .progress {
  584. width: 100%;
  585. .basic-statistics {
  586. border-bottom: 1px dashed #c9c9c9;
  587. padding-bottom: 10px;
  588. margin-bottom: 10px;
  589. }
  590. .data {
  591. // background: white;
  592. margin-bottom: 20px;
  593. height: 280px;
  594. .contain-title {
  595. height: 30px;
  596. line-height: 30px;
  597. border-left: 8px solid black;
  598. display: inline-block;
  599. margin: 8px 8px;
  600. font-weight: 600;
  601. padding-left: 8px;
  602. cursor: default;
  603. i {
  604. margin-left: 6px;
  605. font-weight: normal;
  606. }
  607. }
  608. }
  609. }
  610. .data-show {
  611. width: 100%;
  612. display: flex;
  613. flex-wrap: wrap;
  614. .show-content {
  615. background: white;
  616. overflow: hidden;
  617. margin-right: 10px;
  618. margin-bottom: 10px;
  619. border: 1px solid #c9c9c9;
  620. border-radius: 5px;
  621. }
  622. }
  623. </style>