|
@@ -7,6 +7,7 @@
|
|
|
@calcSpecial="calcSpecial"
|
|
|
@openComputed="openComputed"
|
|
|
@RelationType="RelationType"
|
|
|
+ @calcSpecialUpdate="calcSpecialUpdate"
|
|
|
/>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -27,58 +28,8 @@ 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: '项目→建筑体',//连接对象
|
|
|
- // source: true,//是否需要配置源末端
|
|
|
- // automatic: 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"
|
|
|
- // },
|
|
|
- // ]
|
|
|
- // }
|
|
|
- ],
|
|
|
+ content: [],
|
|
|
+ countNumber: [],
|
|
|
loading: false,
|
|
|
source: [], //源端数据
|
|
|
currentRelationTypeName: "", //当前点击卡片的RelationTypeName
|
|
@@ -102,30 +53,41 @@ export default {
|
|
|
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;
|
|
|
- });
|
|
|
- });
|
|
|
+ const promise1 = new Promise((resolve, reject) => {
|
|
|
+ graphic(dataNumber, res => {
|
|
|
+ resolve(res)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ const promise2 = new Promise((resolve, reject) => {
|
|
|
+ graphicNumber(dataNumber, res => {
|
|
|
+ resolve(res)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ Promise.all([promise1, promise2]).then(values => {
|
|
|
+ this.countNumber = values[1].content;
|
|
|
+ this.content = values[0].content;
|
|
|
+ this.transform(this.content, this.countNumber);
|
|
|
+ this.loading = false;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ updateState() {
|
|
|
+ this.loading = true;
|
|
|
+ let dataNumber = {
|
|
|
+ projectId: this.projectId
|
|
|
+ };
|
|
|
+ graphic(dataNumber, res => {
|
|
|
+ if (res.result === "success") {
|
|
|
+ this.content = res.content;
|
|
|
+ this.transform(this.content, this.countNumber);
|
|
|
+ this.loading = false;
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.message);
|
|
|
+ this.loading = false;
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
transform(list1, list2) {
|
|
|
let countInfo = {}; // { graphTypeName: { Id: count } }
|
|
@@ -173,34 +135,29 @@ export default {
|
|
|
// todo
|
|
|
obj.computationalState = 3
|
|
|
setTimeout(() => {
|
|
|
- this.init()
|
|
|
+ this.updateState();
|
|
|
})
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 计算需更新的关系
|
|
|
+ */
|
|
|
+ calcSpecialUpdate(params, obj) {
|
|
|
+ calcSpecial(params, res => {
|
|
|
+ if (res.result === "failure") {
|
|
|
+ this.$message.success('计算失败')
|
|
|
+ }
|
|
|
+ this.init();
|
|
|
+ })
|
|
|
+ obj.computationalState = 3
|
|
|
+ setTimeout(() => {
|
|
|
+ this.updateState();
|
|
|
+ })
|
|
|
+ },
|
|
|
statusCard() {
|
|
|
|
|
|
},
|
|
|
calcSpecial(relation) {
|
|
|
this.currentRelationTypeName = relation.RelationTypeName;
|
|
|
- if (relation.source) {
|
|
|
- //配置云末端
|
|
|
- // this.TableVisibleMoreLoading = true//会很慢,加loading
|
|
|
- // 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
|
|
|
- // })
|
|
|
- // })
|
|
|
- }
|
|
|
},
|
|
|
|
|
|
openComputed(result) {
|