|
@@ -1,239 +1,244 @@
|
|
|
<template>
|
|
|
- <div
|
|
|
- style="overflow-x: hidden"
|
|
|
- v-loading="loading"
|
|
|
- >
|
|
|
- <cardList
|
|
|
- :content="content"
|
|
|
- :source="source"
|
|
|
- :TableVisibleMoreLoading="TableVisibleMoreLoading"
|
|
|
- @template="templateDown"
|
|
|
- @calcSpecial="calcSpecial"
|
|
|
- @openComputed="openComputed"
|
|
|
- />
|
|
|
- </div>
|
|
|
+ <div
|
|
|
+ style="overflow-x: hidden"
|
|
|
+ v-loading="loading"
|
|
|
+ >
|
|
|
+ <cardList
|
|
|
+ :content="content"
|
|
|
+ :source="source"
|
|
|
+ :TableVisibleMoreLoading="TableVisibleMoreLoading"
|
|
|
+ @template="templateDown"
|
|
|
+ @calcSpecial="calcSpecial"
|
|
|
+ @openComputed="openComputed"
|
|
|
+ @RelationType="RelationType"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import CardList from "@/components/relation/Overview/CardList"
|
|
|
- import {
|
|
|
- blockQuery,
|
|
|
- blockSource,
|
|
|
- calcSpecial,
|
|
|
- graphic,
|
|
|
- graphicNumber,
|
|
|
- sysDirection
|
|
|
- } from "../../../api/relation/api";
|
|
|
- import {mapGetters} from 'vuex'
|
|
|
-
|
|
|
- export default {
|
|
|
- data() {
|
|
|
- return {
|
|
|
- content: [
|
|
|
- // {
|
|
|
- // GraphTypeId: '3535436',//大分类id
|
|
|
- // GraphTypeName: '架构从属关系',//大分类名称
|
|
|
- // GraphTypeCode: '',//大分类编码
|
|
|
- // Note: '',//说明
|
|
|
- // ParentId: '',//父id
|
|
|
- // ChildGraphicTypeList: [
|
|
|
- // {
|
|
|
- // GraphTypeId: '234534543',//图类型id
|
|
|
- // GraphTypeName: '建筑从属关系',//图类型名称
|
|
|
- // GraphTypeCode: 'ksaajdk',//图类型编码
|
|
|
- // Note: '显示数字字典excel中的xxx',//说明
|
|
|
- // ParentId: '3535436',//父id,GraphTypeId
|
|
|
- // RelationTypeProjectList: [
|
|
|
- // {
|
|
|
- // Id: '23445433534',
|
|
|
- // RelationTypeName: '项目下的建筑体',//关系类型名称
|
|
|
- // RelationTypeCode: 'Pj2Bd',//关系类型编码
|
|
|
- // GraphicId: 'ksaajdk',//图类型编码
|
|
|
- // Note: '边类型说明(待补充)',//说明
|
|
|
- // ConneObject: '项目→建筑体',//连接对象
|
|
|
- // IsSource: true,//是否需要配置源末端
|
|
|
- // IsAutomatic: true,//是否自动计算类型
|
|
|
- // Manual: 2,//123选一个手动计算类型1禁用2提示引导3手动维护
|
|
|
- // Prompting: '【设备台账】,【系统台账】',//提示信息
|
|
|
- // ProjectId: 'Pj1245',//项目id
|
|
|
- // ComputingTime: '2019.12.12 12:00',//null不显示,最后一次自动计算时间
|
|
|
- // ComputationalState: 1,//计算状态
|
|
|
- // },
|
|
|
- // ]
|
|
|
- // },
|
|
|
- // ]
|
|
|
- // },
|
|
|
- ],
|
|
|
- countNumber: [
|
|
|
- // {
|
|
|
- // "GraphTypeId": "3243215",
|
|
|
- // "GraphTypeName": "从属关系",
|
|
|
- // "GraphTypeCode": "ksaajdk",
|
|
|
- // "RelationTypeProjectList": [
|
|
|
- // {
|
|
|
- // "Id": "f3bed766a5ba45868d3a744fb8aaa0c8",
|
|
|
- // "RelationTypeName": "项目下的建筑体",
|
|
|
- // "RelationTypeCode": "关系类型编码",
|
|
|
- // "GraphicCode": "图类型code",
|
|
|
- // "ProjectId": "Pj5432532",
|
|
|
- // "count": "123"
|
|
|
- // },
|
|
|
- // {
|
|
|
- // "Id": "6b4c9f042d344eb99dd64e8e444ad2b0",
|
|
|
- // "RelationTypeName": "项目下的建筑体",
|
|
|
- // "RelationTypeCode": "关系类型编码",
|
|
|
- // "GraphicCode": "图类型code",
|
|
|
- // "ProjectId": "Pj5432532",
|
|
|
- // "count": "456"
|
|
|
- // },
|
|
|
- // {
|
|
|
- // "Id": "305170f91eae4bf991be9284e80a9cf4",
|
|
|
- // "RelationTypeName": "项目下的建筑体",
|
|
|
- // "RelationTypeCode": "关系类型编码",
|
|
|
- // "GraphicCode": "图类型code",
|
|
|
- // "ProjectId": "Pj5432532",
|
|
|
- // "count": "789"
|
|
|
- // },
|
|
|
- // {
|
|
|
- // "Id": "cd7a30cf0f2548a99d4dc99a7948c0db",
|
|
|
- // "RelationTypeName": "项目下的建筑体",
|
|
|
- // "RelationTypeCode": "关系类型编码",
|
|
|
- // "GraphicCode": "图类型code",
|
|
|
- // "ProjectId": "Pj5432532",
|
|
|
- // "count": "321"
|
|
|
- // }
|
|
|
- // ]
|
|
|
- // }
|
|
|
- ],
|
|
|
- loading: false,
|
|
|
- source: [],//源端数据
|
|
|
- currentRelationTypeName: '',//当前点击图片的RelationTypeName
|
|
|
- TableVisibleMoreLoading: false,
|
|
|
- }
|
|
|
- },
|
|
|
- created() {
|
|
|
- this.init()
|
|
|
-
|
|
|
- },
|
|
|
- computed: {
|
|
|
- ...mapGetters('layout', ['projectId'])
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- },
|
|
|
- components: {CardList},
|
|
|
- methods: {
|
|
|
- init() {
|
|
|
- this.loading = true
|
|
|
- let data = {
|
|
|
- "Cascade": [{
|
|
|
- "Cascade": [{
|
|
|
- "Filters": `projectId = '${this.projectId}'`,
|
|
|
- "Name": "relationTypeProjectList"
|
|
|
- }],
|
|
|
- "Filters": " not parentId isnull",
|
|
|
- "Name": "childGraphicTypeList"
|
|
|
- }],
|
|
|
- "Filters": " parentId isnull ",
|
|
|
- "PageNumber": 1,
|
|
|
- "PageSize": 1000
|
|
|
- }
|
|
|
- let dataNumber = {
|
|
|
- projectId: this.projectId
|
|
|
- }
|
|
|
- graphic(data, res => {
|
|
|
-
|
|
|
- graphicNumber(dataNumber, resCount => {
|
|
|
- this.countNumber = resCount.Content
|
|
|
- this.loading = false
|
|
|
- this.transform(res.Content, this.countNumber)
|
|
|
- this.content = res.Content
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
-
|
|
|
- },
|
|
|
- transform(list1, list2) {
|
|
|
- let countInfo = {} // { GraphTypeName: { Id: count } }
|
|
|
- list2.forEach(item => {
|
|
|
- countInfo[item.GraphTypeName] = countInfo[item.GraphTypeName] || {}
|
|
|
- let rList = item.RelationTypeProjectList
|
|
|
- rList.forEach(r => {
|
|
|
- countInfo[item.GraphTypeName][r.Id] = r.Count
|
|
|
- })
|
|
|
- })
|
|
|
- let changeList = []
|
|
|
- list1.forEach(item => {
|
|
|
- // 这里保存的是引用
|
|
|
- changeList.push(...item.ChildGraphicTypeList)
|
|
|
- })
|
|
|
- changeList.forEach(item => {
|
|
|
- let name = item.GraphTypeName
|
|
|
- let rList = item.RelationTypeProjectList
|
|
|
- rList.forEach(r => {
|
|
|
- r.count = countInfo[name][r.Id]
|
|
|
- })
|
|
|
- })
|
|
|
+ import CardList from "@/components/relation/Overview/CardList"
|
|
|
+ import {
|
|
|
+ blockQuery,
|
|
|
+ blockSource,
|
|
|
+ businessSpaceAll,
|
|
|
+ calcSpecial,
|
|
|
+ graphic,
|
|
|
+ graphicNumber,
|
|
|
+ sysDirection
|
|
|
+ } from "../../../api/relation/api";
|
|
|
+ import {mapGetters} from 'vuex'
|
|
|
|
|
|
+ export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ content: [
|
|
|
+ // {
|
|
|
+ // GraphTypeId: '3535436',//大分类id
|
|
|
+ // GraphTypeName: '架构从属关系',//大分类名称
|
|
|
+ // GraphTypeCode: '',//大分类编码
|
|
|
+ // Note: '',//说明
|
|
|
+ // ParentId: '',//父id
|
|
|
+ // ChildGraphicTypeList: [
|
|
|
+ // {
|
|
|
+ // GraphTypeId: '234534543',//图类型id
|
|
|
+ // GraphTypeName: '建筑从属关系',//图类型名称
|
|
|
+ // GraphTypeCode: 'ksaajdk',//图类型编码
|
|
|
+ // Note: '显示数字字典excel中的xxx',//说明
|
|
|
+ // ParentId: '3535436',//父id,GraphTypeId
|
|
|
+ // RelationTypeProjectList: [
|
|
|
+ // {
|
|
|
+ // Id: '23445433534',
|
|
|
+ // RelationTypeName: '项目下的建筑体',//关系类型名称
|
|
|
+ // RelationTypeCode: 'Pj2Bd',//关系类型编码
|
|
|
+ // GraphicId: 'ksaajdk',//图类型编码
|
|
|
+ // Note: '边类型说明(待补充)',//说明
|
|
|
+ // ConneObject: '项目→建筑体',//连接对象
|
|
|
+ // IsSource: true,//是否需要配置源末端
|
|
|
+ // IsAutomatic: true,//是否自动计算类型
|
|
|
+ // Manual: 2,//123选一个手动计算类型1禁用2提示引导3手动维护
|
|
|
+ // Prompting: '【设备台账】,【系统台账】',//提示信息
|
|
|
+ // ProjectId: 'Pj1245',//项目id
|
|
|
+ // ComputingTime: '2019.12.12 12:00',//null不显示,最后一次自动计算时间
|
|
|
+ // ComputationalState: 1,//计算状态
|
|
|
+ // },
|
|
|
+ // ]
|
|
|
+ // },
|
|
|
+ // ]
|
|
|
+ // },
|
|
|
+ ],
|
|
|
+ countNumber: [
|
|
|
+ // {
|
|
|
+ // "GraphTypeId": "3243215",
|
|
|
+ // "GraphTypeName": "从属关系",
|
|
|
+ // "GraphTypeCode": "ksaajdk",
|
|
|
+ // "RelationTypeProjectList": [
|
|
|
+ // {
|
|
|
+ // "Id": "f3bed766a5ba45868d3a744fb8aaa0c8",
|
|
|
+ // "RelationTypeName": "项目下的建筑体",
|
|
|
+ // "RelationTypeCode": "关系类型编码",
|
|
|
+ // "GraphicCode": "图类型code",
|
|
|
+ // "ProjectId": "Pj5432532",
|
|
|
+ // "count": "123"
|
|
|
+ // },
|
|
|
+ // ]
|
|
|
+ // }
|
|
|
+ ],
|
|
|
+ loading: false,
|
|
|
+ source: [],//源端数据
|
|
|
+ currentRelationTypeName: '',//当前点击图片的RelationTypeName
|
|
|
+ TableVisibleMoreLoading: false,
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.init()
|
|
|
|
|
|
- },
|
|
|
- templateDown() { //下载模板
|
|
|
- },
|
|
|
- calcSpecial(relation) {
|
|
|
- this.TableVisibleMoreLoading = true//可能会很慢,加loading
|
|
|
- this.currentRelationTypeName = relation.RelationTypeName
|
|
|
- let param = {
|
|
|
- BuildingId: '',
|
|
|
- Domain: 'DomainPiping',
|
|
|
- ProjectId: this.projectId,
|
|
|
- SystemName: relation.RelationTypeName
|
|
|
- }
|
|
|
- calcSpecial(param, res => {
|
|
|
- let data = {
|
|
|
- projectId: this.projectId,
|
|
|
- }
|
|
|
- blockQuery(data, res => {
|
|
|
- // 获取源端数据
|
|
|
- this.TableVisibleMoreLoading = false
|
|
|
- this.source = res.Content
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ projectId() {
|
|
|
+ this.init()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapGetters('layout', ['projectId'])
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ },
|
|
|
+ components: {CardList},
|
|
|
+ methods: {
|
|
|
+ init() {
|
|
|
+ this.loading = true
|
|
|
+ // let data = {
|
|
|
+ // "Cascade": [{
|
|
|
+ // "Cascade": [{
|
|
|
+ // "Filters": `projectId = '${this.projectId}'`,
|
|
|
+ // "Name": "relationTypeProjectList"
|
|
|
+ // }],
|
|
|
+ // "Filters": " not parentId isnull",
|
|
|
+ // "Name": "childGraphicTypeList"
|
|
|
+ // }],
|
|
|
+ // "Filters": " parentId isnull ",
|
|
|
+ // "PageNumber": 1,
|
|
|
+ // "PageSize": 1000
|
|
|
+ // }
|
|
|
+ let dataNumber = {
|
|
|
+ projectId: this.projectId
|
|
|
+ }
|
|
|
+ graphic(dataNumber, res => {
|
|
|
+ graphicNumber(dataNumber, resCount => {
|
|
|
+ this.countNumber = resCount.Content
|
|
|
+ this.loading = false
|
|
|
+ this.transform(res.Content, this.countNumber)
|
|
|
+ this.content = res.Content
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ transform(list1, list2) {
|
|
|
+ let countInfo = {} // { GraphTypeName: { Id: count } }
|
|
|
+ list2.forEach(item => {
|
|
|
+ countInfo[item.GraphTypeName] = countInfo[item.GraphTypeName] || {}
|
|
|
+ let rList = item.RelationTypeProjectList
|
|
|
+ rList.forEach(r => {
|
|
|
+ countInfo[item.GraphTypeName][r.Id] = r.Count
|
|
|
+ })
|
|
|
+ })
|
|
|
+ let changeList = []
|
|
|
+ list1.forEach(item => {
|
|
|
+ // 这里保存的是引用
|
|
|
+ if (item.ChildGraphicTypeList) {
|
|
|
+ changeList.push(...item.ChildGraphicTypeList)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ changeList.length && changeList.forEach(item => {
|
|
|
+ let name = item.GraphTypeName
|
|
|
+ let rList = item.RelationTypeProjectList
|
|
|
+ rList.forEach(r => {
|
|
|
+ r.count = countInfo[name][r.Id]
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ RelationType(relation_type,zone_type) {
|
|
|
+ let param = {
|
|
|
+ relation_type,
|
|
|
+ zone_type,
|
|
|
+ proId: {
|
|
|
+ projectId: this.projectId
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // businessSpaceAll(param, res => {
|
|
|
+ //
|
|
|
+ // })
|
|
|
+ businessSpaceAll(param).then(res=> {
|
|
|
+ if(res.data.Result === 'failure') {
|
|
|
+ this.$message({
|
|
|
+ message: '计算失败',
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.init()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ templateDown() { //下载模板
|
|
|
+ },
|
|
|
+ calcSpecial(relation) {
|
|
|
+ this.currentRelationTypeName = relation.RelationTypeName
|
|
|
+ if (relation.IsSource) { //配置云末端
|
|
|
+ this.TableVisibleMoreLoading = true//可能会很慢,加loading
|
|
|
+ let param = {
|
|
|
+ BuildingId: '',
|
|
|
+ Domain: 'DomainPiping',
|
|
|
+ ProjectId: this.projectId,
|
|
|
+ SystemName: relation.RelationTypeName
|
|
|
+ }
|
|
|
+ calcSpecial(param, res => {
|
|
|
|
|
|
- openComputed(result) {
|
|
|
- let param = {
|
|
|
- // BuildingId: '',
|
|
|
- Domain: 'DomainPiping',
|
|
|
- MepSystemType: '冷冻水供水管',
|
|
|
- ProjectId: this.projectId,
|
|
|
- SourceList: result
|
|
|
- }
|
|
|
- blockSource(param, res => { //覆盖源端数据
|
|
|
- //确定流向
|
|
|
- result.forEach(i => {
|
|
|
- let {BlockId, BuildingId, Domain, Source} = i
|
|
|
- this.DataSorting(
|
|
|
- BlockId,
|
|
|
- BuildingId,
|
|
|
- Domain,
|
|
|
- Source,
|
|
|
- )
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
- DataSorting(BlockId, BuildingId, Domain, isSource) {
|
|
|
- let param = {
|
|
|
- BlockId,
|
|
|
- Domain,
|
|
|
- isSource,
|
|
|
- BuildingId,
|
|
|
- SystemName: this.currentRelationTypeName
|
|
|
- }
|
|
|
- sysDirection(param, res => {
|
|
|
- })
|
|
|
+ let data = {
|
|
|
+ projectId: this.projectId,
|
|
|
}
|
|
|
+ blockQuery(data, res => {
|
|
|
+ // 获取源端数据
|
|
|
+ this.TableVisibleMoreLoading = false
|
|
|
+ this.source = res.Content
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
+ openComputed(result) {
|
|
|
+ let param = {
|
|
|
+ // BuildingId: '',
|
|
|
+ Domain: 'DomainPiping',
|
|
|
+ MepSystemType: '冷冻水供水管',
|
|
|
+ ProjectId: this.projectId,
|
|
|
+ SourceList: result
|
|
|
}
|
|
|
+ blockSource(param, res => { //覆盖源端数据
|
|
|
+ //确定流向
|
|
|
+ result.forEach(i => {
|
|
|
+ let {BlockId, BuildingId, Domain, Source} = i
|
|
|
+ this.DataSorting(
|
|
|
+ BlockId,
|
|
|
+ BuildingId,
|
|
|
+ Domain,
|
|
|
+ Source,
|
|
|
+ )
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ DataSorting(BlockId, BuildingId, Domain, isSource) {
|
|
|
+ let param = {
|
|
|
+ BlockId,
|
|
|
+ Domain,
|
|
|
+ isSource,
|
|
|
+ BuildingId,
|
|
|
+ SystemName: this.currentRelationTypeName
|
|
|
+ }
|
|
|
+ sysDirection(param, res => {
|
|
|
+ this.init()
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
+ }
|
|
|
</script>
|
|
|
<style lang="less" scoped>
|
|
|
|