index.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892
  1. <template>
  2. <div>
  3. <div class="data-display">
  4. <ul class="list">
  5. <li @click="detailPage">
  6. <p class="list-num">
  7. <i class='el-icon-s-order'></i>
  8. {{ lederDelObjectCount ? lederDelObjectCount : '0' }}
  9. </p>
  10. <p class="list-text">台账中待删除的对象</p>
  11. </li>
  12. <li @click="detailPage">
  13. <p class="list-num">
  14. <i class="el-icon-s-help"></i>
  15. {{ notSyncObjectCount ? notSyncObjectCount : '0' }}
  16. </p>
  17. <p class="list-text">不能同步到物理世界的对象</p>
  18. </li>
  19. <li @click="detailPage">
  20. <p class="list-num">
  21. <i class="el-icon-s-marketing"></i>
  22. {{ notSyncDataCount ? notSyncDataCount : '0' }}
  23. </p>
  24. <p class="list-text">不能同步到物理世界的关系数据</p>
  25. </li>
  26. <li @click="detailPage">
  27. <p class="list-num">
  28. <i class="el-icon-s-release"></i>
  29. {{ postRelationInforCount ? postRelationInforCount : '0' }}
  30. </p>
  31. <p class="list-text">岗位和关联的资产信息点值不一致</p>
  32. </li>
  33. </ul>
  34. </div>
  35. <div class="progress">
  36. <p class="basic-statistics">
  37. 基本统计
  38. <data-export style="float:right"></data-export>
  39. </p>
  40. <div class="data equipment" v-if="equipCount">
  41. <span class="contain-title">
  42. <span class="iconfont icon-juxing"></span>
  43. 设备<i>{{ `(${equipCount ? equipCount : "0"})` }}</i></span>
  44. <div class="data-show" v-loading="isLoading" v-if="equipment.length">
  45. <div class="show-content" v-for="(item,index) in equipment" :key="index">
  46. <data-origin :id="'equipment' + index" :renderData="item"></data-origin>
  47. </div>
  48. </div>
  49. <div class="data-show" v-loading="isLoading" v-if="deviceMessageTotal.length">
  50. <div class="device-content" v-for="(item,index) in deviceMessageTotal" :key="index">
  51. <data-origin :id="'origin-device' + index" :renderData="item" :filterClass="'yes'"></data-origin>
  52. </div>
  53. </div>
  54. <div class="data-show" v-loading="isLoading" v-if="deviceMessageData.length">
  55. <div class="device-content" v-for="(item,index) in deviceMessageData" :key="index">
  56. <data-origin :id="'origin-deviceTotal' + index" :renderData="item" :filterClass="'yes'"></data-origin>
  57. </div>
  58. </div>
  59. </div>
  60. <div class="data assets" v-if="assetsCount">
  61. <span class="contain-title">
  62. <span class="iconfont icon-juxing"></span>
  63. 资产<i>{{ `(${assetsCount ? assetsCount : "0"})` }}</i></span>
  64. <div class="data-show" v-loading="isLoading" v-if="assets.length">
  65. <div class="show-content" v-for="(item,index) in assets" :key="index">
  66. <data-origin :id="'assets' + index" :renderData="item"></data-origin>
  67. </div>
  68. </div>
  69. </div>
  70. <div class="data parts" v-if="partsCount">
  71. <span class="contain-title">
  72. <span class="iconfont icon-juxing"></span>
  73. 部件<i>{{ `(${partsCount ? partsCount : '0'})` }}</i></span>
  74. </div>
  75. <div class="data business-space" v-if="zoneSpaceCount">
  76. <span class="contain-title">
  77. <span class="iconfont icon-juxing"></span>
  78. 业务空间<i>{{ `(${zoneSpaceCount ? zoneSpaceCount : '0'})` }}</i></span>
  79. <div class="data-show" v-if="business.length">
  80. <div v-for="(item,index) in business" :key="index" class="show-content">
  81. <datafan :id="'datafan' + index" :renderData="item"></datafan>
  82. </div>
  83. </div>
  84. </div>
  85. <div class="data " v-if="systemCount">
  86. <span class="contain-title">
  87. <span class="iconfont icon-juxing"></span>
  88. 系统<i>{{ `(${systemCount ? systemCount : '0'})` }}</i></span>
  89. <div class="data-show" v-loading="isLoading" v-if="sysMessageData.length">
  90. <div class="device-content" v-for="(item,index) in sysMessageData" :key="index">
  91. <data-origin :id="'origin-sys' + index" :renderData="item" :filterClass="'yes'"></data-origin>
  92. </div>
  93. </div>
  94. </div>
  95. <div class="data " v-if="rentantCount">
  96. <span class="contain-title">
  97. <span class="iconfont icon-juxing"></span>
  98. 租户<i>{{ `(${rentantCount ? rentantCount : '0'})` }}</i></span>
  99. <div class="data-show" v-loading="isLoading" v-if="tenant.length">
  100. <div class="show-content" v-for="(item,index) in tenant" :key="index">
  101. <data-origin :id="'origin-tenant' + index" :renderData="item"></data-origin>
  102. </div>
  103. </div>
  104. </div>
  105. <div class="data " v-if="shaftCount">
  106. <span class="contain-title">
  107. <span class="iconfont icon-juxing"></span>
  108. 竖井<i>{{ `(${shaftCount ? shaftCount : '0'})` }}</i></span>
  109. <div class="data-show" v-loading="isLoading" v-if="shaft.length">
  110. <div class="show-content" v-for="(item,index) in shaft" :key="index">
  111. <datafan :id="'origin-datafan' + index" :renderData="item" v-if="!item.needCountT"></datafan>
  112. <data-origin :id="'origin-shaft' + index" :renderData="item" v-else></data-origin>
  113. </div>
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. </template>
  119. <script>
  120. import { mapGetters } from "vuex";
  121. import {
  122. countEquip,
  123. countGeneralSys,
  124. countProperty,
  125. getCenoteType,
  126. infoPoint,
  127. notSyncObject,
  128. notSyncRelationData,
  129. postRelationInforAtpism,
  130. queryCenoteCount,
  131. queryDefaultFunTypes,
  132. queryLederDelObject,
  133. queryPart,
  134. queryPartitionRatio,
  135. queryRentCount,
  136. queryShaftFunctionType,
  137. queryTenantCompletion,
  138. queryZoneCount,
  139. ShaftRelationBusinessSpace,
  140. systemInfoPoint
  141. } from "@/api/scan/request";
  142. import { getDataDictionary } from "@/api/dict";
  143. import dataOrigin from "@/components/ledger/report/dataorigin";
  144. import datafan from "@/components/ledger/report/datafan";
  145. import dataExport from "@/components/ledger/report/dataexport";
  146. export default {
  147. data() {
  148. return {
  149. lederDelObjectCount: null,// 台账中待删除的对象
  150. notSyncObjectCount: null,// 不能同步到物理世界的对象
  151. notSyncDataCount: null,// 不能同步到物理世界的关系数据
  152. postRelationInforCount: null,// 岗位和关联的资产信息点值不一致
  153. equipCount: null,// 设备总数
  154. equipment: [],// 设备数据
  155. assetsCount: null,// 资产总数
  156. assets: [],// 资产数据
  157. parts: [],// 部件数据
  158. partsCount: null,// 部件总数
  159. zoneSpaceCount: null,// 业务空间总数
  160. zoneType: [// 分区类型
  161. {
  162. "code": "GeneralZone",
  163. "name": "默认分区",
  164. "Rel_type": "99"
  165. },
  166. {
  167. "name": "供电分区",
  168. "Rel_type": "1",
  169. "code": "PowerSupplyZone"
  170. },
  171. {
  172. "name": "照明分区",
  173. "Rel_type": "2",
  174. "code": "LightingZone"
  175. },
  176. {
  177. "name": "网络分区",
  178. "Rel_type": "3",
  179. "code": "NetworkZone"
  180. },
  181. {
  182. "code": "AirConditioningZone",
  183. "name": "空调分区",
  184. "Rel_type": "4"
  185. },
  186. {
  187. "name": "采暖分区",
  188. "Rel_type": "5",
  189. "code": "HeatingZone"
  190. },
  191. {
  192. "name": "洁净分区",
  193. "Rel_type": "6",
  194. "code": "CleanZone"
  195. },
  196. {
  197. "name": "生活给水分区",
  198. "Rel_type": "7",
  199. "code": "DomesticWaterSupplyZone"
  200. },
  201. {
  202. "code": "FireZone",
  203. "name": "防火分区",
  204. "Rel_type": "8"
  205. },
  206. {
  207. "name": "安防分区",
  208. "Rel_type": "9",
  209. "code": "SecurityZone"
  210. },
  211. {
  212. "name": "租户分区",
  213. "Rel_type": "10",
  214. "code": "TenantZone"
  215. },
  216. {
  217. "name": '功能分区',
  218. 'Rel_type': '11',
  219. "code": 'FunctionZone'
  220. }
  221. ],
  222. partProtion: [],// 业务空间-各分区占比数据
  223. defaultPart: [],// 业务空间-默认分区功能类型占比数据
  224. business: [],// 业务空间数据
  225. systemCount: null,// 系统总数
  226. system: [],// 系统数据
  227. rentantCount: null,// 租户总数
  228. tenant: [],// 租户数据
  229. shaftCount: null,// 竖井总数
  230. shaft: [],// 竖井数据
  231. ShaftFunType: null,// 竖井功能类型
  232. shaftPartProtion: null,// 竖井-按功能类型占比数据
  233. params: null,
  234. isLoading: false,
  235. deviceMessageData: [],//统计设备信息点与需采集数据占比
  236. deviceMessageTotal: [],//统计设备信息点与总数据占比
  237. sysMessageData: [],//统计系统信息点与需采集数据占比
  238. static: '标准静态',
  239. dynamic: '标准动态',
  240. custom: '自定义',
  241. functionType: []
  242. }
  243. },
  244. components: {
  245. dataOrigin,
  246. datafan,
  247. dataExport,
  248. },
  249. mounted() {
  250. },
  251. created() {
  252. this.params = {
  253. projectId: this.projectId
  254. }
  255. this.getFunctionType();
  256. this.getStatisticsCount();
  257. this.getEquipCount();
  258. // this.gatherInfoPoints();
  259. this.systemInfoPoints();
  260. this.infoPoints();
  261. this.getAssetsCount();
  262. this.getPartsCount();
  263. this.getSystemCount();
  264. this.getTenantCount();
  265. this.getShaftFunType();
  266. },
  267. computed: {
  268. ...mapGetters('layout', ['projectId'])
  269. },
  270. methods: {
  271. detailPage() {
  272. this.$message({
  273. message: '待开发',
  274. type: 'warning'
  275. });
  276. },
  277. zoneTypeConversion(item) {// 分区类型转换
  278. this.zoneType.forEach(it => {
  279. if (item.name === it.code) {
  280. item.name = it.name;
  281. }
  282. })
  283. },
  284. functionTypeTranstion(item, type) {// 默认分区功能类型转换
  285. type && type.forEach(it => {
  286. if (item.name === it.code) {
  287. item.name = it.name;
  288. this.defaultPart.push({
  289. name: item.name + item.count,
  290. value: item.count
  291. });
  292. }
  293. if (it.content) {
  294. this.functionTypeTranstion(item, it.content)
  295. }
  296. })
  297. },
  298. getFunctionType() {// 获取默认分区功能类型
  299. let params = {
  300. type: "GeneralZone",
  301. filters: "code='roomFuncType'",
  302. projection: ["dataSource", "code"],
  303. orders: "sort asc, name desc",
  304. }
  305. getDataDictionary(params, res => {
  306. if (res.content.length) {
  307. // this.functionType = JSON.parse(res.content[0].dataSource)
  308. this.functionType = res.content[0].dataSource
  309. }
  310. this.getZoneSpaceCount();
  311. })
  312. },
  313. toPercent(point) {// 小数转换成百分比
  314. return (isNaN(point) || Number(point) === 0) ? '0%' : Number(point * 100).toFixed(2) + '%'
  315. },
  316. getShaftFunType() {// 获取数据功能类型
  317. getCenoteType(this.param, res => {
  318. this.ShaftFunType = res.Content;
  319. this.getShaftCount();
  320. })
  321. },
  322. shaftFunTypeTranstion(item) {// 竖井功能类型转换
  323. this.ShaftFunType.forEach((it, index) => {
  324. if (item.Name === it.Id) {
  325. item.Name = it.Name;
  326. }
  327. })
  328. },
  329. getStatisticsCount() {// 获取顶部统计数据
  330. let params = {
  331. projectId: this.projectId,
  332. filters: "taskState = -1"
  333. }
  334. // 台账中待删除的对象
  335. queryLederDelObject(params, res => {
  336. this.lederDelObjectCount = res.count;
  337. })
  338. // 不能同步到物理世界的对象
  339. notSyncObject({}, res => {
  340. this.notSyncObjectCount = res.count;
  341. })
  342. // 不能同步到物理世界的关系数据
  343. notSyncRelationData({}, res => {
  344. this.notSyncDataCount = res.count;
  345. })
  346. // 岗位和关联的资产信息点值不一致
  347. postRelationInforAtpism({}, res => {
  348. this.postRelationInforCount = res.count;
  349. })
  350. },
  351. // 统计设备信息点与需采集数据占比
  352. // gatherInfoPoints() {
  353. // gatherInfoPoint(this.params, res => {
  354. // let arr = JSON.parse(JSON.stringify(res.Content))
  355. // arr.forEach(i => {
  356. // this.$set(this.deviceMessageData, 0, {
  357. // title: '统计设备信息点与需采集数据占比',
  358. // tips: '统计设备信息点与需采集数据占比',
  359. // contentValueO: '总数:',
  360. // contentValueT: '标准静态:',
  361. // needCountO: i.gatherInfoPointCounts,
  362. // needCountT: i.gatherStaticInfoPointCounts,
  363. // text: this.toPercent(i.gatherStaticInfoPointCounts / i.gatherInfoPointCounts),
  364. // val: this.static
  365. // })
  366. // this.$set(this.deviceMessageData, 1, {
  367. // contentValueO: '总数:',
  368. // contentValueT: '标准动态:',
  369. // needCountO: i.gatherInfoPointCounts,
  370. // needCountT: i.gatherDynamicInfoPointCounts,
  371. // text: this.toPercent(i.gatherDynamicInfoPointCounts / i.gatherInfoPointCounts),
  372. // val: this.dynamic
  373. // })
  374. //
  375. // this.$set(this.deviceMessageData, 2, {
  376. // contentValueO: '总数:',
  377. // contentValueT: '自定义:',
  378. // needCountO: i.gatherInfoPointCounts,
  379. // needCountT: i.gatherCustomInfoPointCounts,
  380. // text: this.toPercent(i.gatherCustomInfoPointCounts / i.gatherInfoPointCounts),
  381. // val: this.custom
  382. // })
  383. // })
  384. // })
  385. // },
  386. // 统计系统信息点与需采集数据占比
  387. systemInfoPoints() {
  388. systemInfoPoint(this.params, res => {
  389. let arr = JSON.parse(JSON.stringify(res.content))
  390. arr.forEach(i => {
  391. this.$set(this.sysMessageData, 0, {
  392. title: '统计系统信息点与需采集数据占比',
  393. tips: '统计系统信息点与需采集数据占比',
  394. contentValueO: '总数:',
  395. contentValueT: '标准静态:',
  396. needCountO: i.gatherInfoPointCounts,
  397. needCountT: i.gatherStaticInfoPointCounts,
  398. text: this.toPercent(i.gatherStaticInfoPointCounts / i.gatherInfoPointCounts),
  399. val: this.static
  400. })
  401. this.$set(this.sysMessageData, 1, {
  402. contentValueO: '总数:',
  403. contentValueT: '标准动态:',
  404. needCountO: i.gatherInfoPointCounts,
  405. needCountT: i.gatherDynamicInfoPointCounts,
  406. text: this.toPercent(i.gatherDynamicInfoPointCounts / i.gatherInfoPointCounts),
  407. val: this.dynamic
  408. })
  409. this.$set(this.sysMessageData, 2, {
  410. contentValueO: '总数:',
  411. contentValueT: '自定义:',
  412. needCountO: i.gatherInfoPointCounts,
  413. needCountT: i.gatherCustomInfoPointCounts,
  414. text: this.toPercent(i.gatherCustomInfoPointCounts / i.gatherInfoPointCounts),
  415. val: this.custom
  416. })
  417. })
  418. })
  419. },
  420. //统计设备信息点与总数据占比
  421. infoPoints() {
  422. infoPoint(this.params, res => {
  423. let arr = JSON.parse(JSON.stringify(res.content))
  424. arr.forEach(i => {
  425. this.$set(this.deviceMessageTotal, 0, {
  426. title: '统计设备信息点与总数据占比',
  427. tips: '统计设备信息点与总数据占比',
  428. contentValueO: '总数:',
  429. contentValueT: '标准静态:',
  430. needCountO: i.staticInfoPointCounts,
  431. needCountT: i.staticInfoPoint,
  432. text: this.toPercent(i.staticInfoPoint / i.staticInfoPointCounts),
  433. val: this.static
  434. })
  435. this.$set(this.deviceMessageTotal, 1, {
  436. contentValueO: '总数:',
  437. contentValueT: '标准动态:',
  438. needCountO: i.dynamicInfoPointCounts,
  439. needCountT: i.dynamicInfoPoint,
  440. text: this.toPercent(i.dynamicInfoPoint / i.dynamicInfoPointCounts),
  441. val: this.dynamic
  442. })
  443. let obj = i.customInfoPointCounts ? {} : ''
  444. if (obj) {
  445. obj = {
  446. contentValueO: '总数:',
  447. contentValueT: '自定义:',
  448. needCountO: i.customInfoPointCounts,
  449. needCountT: i.customInfoPoint,
  450. text: this.toPercent(i.customInfoPoint / i.customInfoPointCounts),
  451. val: this.custom
  452. }
  453. }
  454. this.$set(this.deviceMessageTotal, 2, {
  455. ...obj
  456. })
  457. })
  458. })
  459. },
  460. getEquipCount() {// 获取设备总数
  461. countEquip(this.params, res => {
  462. this.equipCount = res.count;
  463. this.getEquipOtherCount();
  464. })
  465. },
  466. getEquipOtherCount() {// 获取设备数据
  467. // 未关联资产
  468. let param = {
  469. projectId: this.projectId,
  470. filters: "propertyId isNull"
  471. }
  472. let promise1 = new Promise(resolve => {
  473. countEquip(param, res => {
  474. resolve(res);
  475. })
  476. })
  477. // 现场验证状态占比
  478. let par = {
  479. projectId: this.projectId,
  480. filters: "taskState = 0 or taskState = 1"
  481. }
  482. let promise2 = new Promise(resolve => {
  483. countEquip(par, res => {
  484. resolve(res);
  485. })
  486. })
  487. let pa = {
  488. projectId: this.projectId,
  489. filters: "not bimId isNull"
  490. }
  491. let promise3 = new Promise(resolve => {
  492. countEquip(pa, res => {
  493. resolve(res);
  494. })
  495. })
  496. Promise.all([promise1, promise2, promise3]).then(response => {
  497. this.equipment = [];
  498. let res = response[0];
  499. let res1 = response[1];
  500. let res2 = response[2];
  501. this.equipment.push({
  502. title: '未关联设备',
  503. tips: '设备未关联资产数量',
  504. contentValueO: '已关联:',
  505. contentValueT: '未关联:',
  506. needCountO: this.equipCount - res.count,
  507. needCountT: res.count,
  508. text: `${res.count}`
  509. })
  510. let text = this.toPercent(res1.count / this.equipCount)
  511. this.equipment.push({
  512. title: '现场验证状态占比',
  513. tips: '设备状态为未找到、已找到的数量与设备总数占比',
  514. contentValueO: '已验证:',
  515. contentValueT: '未验证:',
  516. needCountO: res1.count,
  517. needCountT: this.equipCount - res1.count,
  518. text: text
  519. })
  520. let text1 = this.toPercent(res2.count / this.equipCount)
  521. this.equipment.push({
  522. title: '与模型对应占比',
  523. tips: '"BIM模型中编码"有值的设备数量与设备总数占比',
  524. contentValueO: '已对应:',
  525. contentValueT: '未对应:',
  526. needCountO: res2.count,
  527. needCountT: this.equipCount - res2.count,
  528. text: text1
  529. })
  530. this.isLoading = false;
  531. })
  532. },
  533. getAssetsCount() {// 获取资产数据
  534. // countProperty(this.params, res => {
  535. countProperty({}, res => {
  536. // 获取资产总数
  537. this.assetsCount = res.count;
  538. })
  539. // 未关联资产
  540. let param = {
  541. filters: " equipId isnull"
  542. }
  543. let promise1 = new Promise((resolve) => {
  544. countProperty(param, res => {
  545. resolve(res)
  546. })
  547. })
  548. // 现场验证状态占比
  549. let par = {
  550. filters: " taskState = 0 or taskState = 1"
  551. }
  552. let promise2 = new Promise((resolve) => {
  553. countProperty(par, res => {
  554. resolve(res);
  555. })
  556. })
  557. // 有无坐标占比
  558. let pa = {
  559. Filters: " not BIMLocation isnull"
  560. }
  561. let promise3 = new Promise((resolve) => {
  562. countProperty(pa, res => {
  563. resolve(res);
  564. })
  565. })
  566. Promise.all([promise1, promise2, promise3]).then(response => {
  567. this.assets = [];
  568. let res0 = response[0];
  569. let res1 = response[1];
  570. let res2 = response[2];
  571. this.assets.push({
  572. title: '未关联资产',
  573. tips: '资产未关联设备数量',
  574. contentValueO: '已关联:',
  575. contentValueT: '未关联:',
  576. text: `${res0.count}`,
  577. needCountO: this.assetsCount - res0.count,
  578. needCountT: res0.count
  579. })
  580. let text = res1.count / this.assetsCount;
  581. text = this.toPercent(text);
  582. this.assets.push({
  583. title: '现场验证状态占比',
  584. tips: '资产状态为未找到、已找到的数量与资产总数占比',
  585. contentValueO: '已验证:',
  586. contentValueT: '未验证:',
  587. text: text,
  588. needCountO: res1.count,
  589. needCountT: this.assetsCount - res1.count
  590. })
  591. let text1 = res2.count / this.assetsCount;
  592. text1 = this.toPercent(text1);
  593. this.assets.push({
  594. title: '有无坐标占比',
  595. tips: '有坐标的资产数量百分比',
  596. contentValueO: '有坐标:',
  597. contentValueT: '无坐标:',
  598. text: text1,
  599. needCountO: res2.count,
  600. needCountT: this.assetsCount - res2.count
  601. })
  602. })
  603. },
  604. getPartsCount() {// 获取部件数据
  605. queryPart(this.params, res => {
  606. this.partsCount = res.count;
  607. })
  608. },
  609. getZoneSpaceCount() {// 获取业务空间数据
  610. // 获取业务空间总数
  611. queryZoneCount(this.params, res => {
  612. this.zoneSpaceCount = res.count;
  613. })
  614. let promise1 = new Promise((resolve) => {
  615. queryPartitionRatio(this.params, res => {
  616. resolve(res)
  617. })
  618. })
  619. let promise2 = new Promise((resolve) => {
  620. queryDefaultFunTypes(this.params, res => {
  621. resolve(res)
  622. })
  623. })
  624. Promise.all([promise1, promise2]).then(response => {
  625. this.business = [];
  626. this.partProtion = [];
  627. this.defaultPart = [];
  628. let res1 = response[0]
  629. let res2 = response[1]
  630. if (res1.content.length) {
  631. res1.content.forEach(item => {
  632. this.zoneTypeConversion(item);
  633. })
  634. let arr = res1.content.filter(i => i.count).forEach(j => {
  635. this.partProtion.push({
  636. name: j.name + j.count,
  637. value: j.count
  638. })
  639. })
  640. this.business.push({
  641. title: '各分区占比',
  642. tips: '各类型分区实例数量与实例总数占比',
  643. needCountO: this.partProtion,
  644. })
  645. }
  646. if (res2.content.length) {
  647. res2.content.forEach(item => {
  648. this.functionTypeTranstion(item, this.functionType);
  649. })
  650. this.business.push({
  651. title: '默认分区功能类型占比',
  652. tips: '默认分区实例的功能区类型占比',
  653. needCountO: this.defaultPart,
  654. })
  655. }
  656. })
  657. },
  658. getSystemCount() {// 获取系统数据
  659. countGeneralSys(this.params, res => {
  660. this.systemCount = res.count;
  661. })
  662. },
  663. getTenantCount() {// 获取租户数据
  664. // 获取租户总数
  665. queryRentCount(this.params, res => {
  666. this.rentantCount = res.count;
  667. })
  668. // 租户-关联业务空间完成度
  669. let promise = new Promise((resolve) => {
  670. queryTenantCompletion(this.params, res => {
  671. resolve(res);
  672. })
  673. })
  674. Promise.all([promise]).then(response => {
  675. this.tenant = [];
  676. let res = response[0];
  677. this.tenant = [];
  678. let text = res.count / this.rentantCount;
  679. text = this.toPercent(text);
  680. this.tenant.push({
  681. title: '关联业务空间完成度',
  682. tips: '已关联业务空间的租户数量百分比',
  683. contentValueO: '已关联:',
  684. contentValueT: '未关联:',
  685. needCountO: res.count,
  686. needCountT: this.rentantCount - res.count,
  687. text: text
  688. })
  689. })
  690. },
  691. getShaftCount() {// 获取竖井数据
  692. this.shaft = [];
  693. // 获取竖井总数
  694. queryCenoteCount(this.params, res => {
  695. this.shaftCount = res.Count;
  696. })
  697. let promise1 = new Promise((resolve) => {
  698. queryShaftFunctionType(this.params, res => {
  699. resolve(res);
  700. })
  701. })
  702. let promise2 = new Promise((resolve) => {
  703. ShaftRelationBusinessSpace(this.params, res => {
  704. resolve(res);
  705. })
  706. })
  707. Promise.all([promise1, promise2]).then(response => {
  708. this.shaft = [];
  709. let res = response[0];
  710. let res1 = response[1];
  711. this.shaftPartProtion = [];
  712. if (res.content.length) {
  713. res.content.forEach(item => {
  714. this.shaftFunTypeTranstion(item);
  715. this.shaftPartProtion.push({
  716. name: item.name + item.count,
  717. value: item.count
  718. })
  719. })
  720. this.shaft.push({
  721. title: '按功能类型占比',
  722. tips: '竖井实例的竖井功能占比',
  723. needCountO: this.shaftPartProtion,
  724. })
  725. }
  726. let text = this.toPercent(res1.count / this.shaftCount);
  727. this.shaft.push({
  728. title: '关联业务空间完成度',
  729. tips: '已关联业务空间的竖井数量百分比',
  730. contentValueO: '已关联:',
  731. contentValueT: '未关联:',
  732. needCountO: res1.count,
  733. needCountT: this.shaftCount - res1.count,
  734. text: text
  735. })
  736. })
  737. }
  738. },
  739. watch: {
  740. projectId(n, o) {
  741. this.params = {
  742. ProjectId: this.projectId
  743. }
  744. this.getFunctionType();
  745. this.getStatisticsCount();
  746. this.getEquipCount();
  747. this.getAssetsCount();
  748. this.getPartsCount();
  749. this.getSystemCount();
  750. this.getTenantCount();
  751. this.getShaftFunType();
  752. // this.gatherInfoPoints();
  753. this.systemInfoPoints();
  754. this.infoPoints();
  755. }
  756. }
  757. }
  758. </script>
  759. <style lang="scss" scoped>
  760. .data-display {
  761. width: 100%;
  762. margin-bottom: 10px;
  763. ul {
  764. display: flex;
  765. li {
  766. flex: 1;
  767. background: white;
  768. border: 1px solid #c9c9c9;
  769. text-align: center;
  770. padding: 20px;
  771. box-sizing: border-box;
  772. p {
  773. color: #333;
  774. i {
  775. margin-right: 20px;
  776. }
  777. }
  778. p:nth-child(1) {
  779. font-size: 24px;
  780. }
  781. + li {
  782. margin-left: 10px;
  783. }
  784. }
  785. li:hover {
  786. box-shadow: 0px 2px 4px #c9c9c9;
  787. }
  788. }
  789. }
  790. .progress {
  791. width: 100%;
  792. .basic-statistics {
  793. border-bottom: 1px dashed #c9c9c9;
  794. padding-bottom: 10px;
  795. margin-bottom: 10px;
  796. }
  797. .data {
  798. margin-bottom: 20px;
  799. .contain-title {
  800. height: 30px;
  801. line-height: 30px;
  802. /*border-left: 8px solid black;*/
  803. display: inline-block;
  804. margin: 8px 0;
  805. font-weight: 600;
  806. /*padding-left: 8px;*/
  807. cursor: default;
  808. i {
  809. margin-left: 6px;
  810. font-weight: normal;
  811. }
  812. }
  813. }
  814. }
  815. .data-show {
  816. width: 100%;
  817. display: flex;
  818. flex-wrap: wrap;
  819. .show-content {
  820. background: white;
  821. overflow: hidden;
  822. margin-right: 10px;
  823. margin-bottom: 10px;
  824. border: 1px solid #c9c9c9;
  825. }
  826. .device-content {
  827. border-top: 1px solid #c9c9c9;
  828. border-bottom: 1px solid #c9c9c9;
  829. margin: 10px 0;
  830. &:first-child {
  831. border-left: 1px solid #c9c9c9;
  832. }
  833. &:last-child {
  834. border-right: 1px solid #c9c9c9;
  835. }
  836. }
  837. }
  838. /*.system,*/
  839. /*.parts {*/
  840. /* height: 50px !important;*/
  841. /*}*/
  842. </style>