|
@@ -7,7 +7,8 @@
|
|
|
<el-table-column type="expand">
|
|
|
<template slot-scope="props">
|
|
|
<p v-if="props.row.ComponentCount && props.row.ComponentCount.length" style="color:#99a9bf;line-height:32px;font-size:14px;">包含的部件:</p>
|
|
|
- <el-form label-position="left" label-width="auto" inline class="demo-table-expand" v-if="props.row.ComponentCount && props.row.ComponentCount.length">
|
|
|
+ <el-form label-position="left" label-width="auto" inline class="demo-table-expand"
|
|
|
+ v-if="props.row.ComponentCount && props.row.ComponentCount.length">
|
|
|
<el-form-item v-for="item in props.row.ComponentCount?props.row.ComponentCount:[]" :key="item.code" :label="`${item.name}:`">
|
|
|
<span>{{ item.count }}</span>
|
|
|
</el-form-item>
|
|
@@ -48,11 +49,10 @@
|
|
|
|
|
|
<script>
|
|
|
import { queryEquip } from "@/api/scan/request"
|
|
|
-import { createModelTask } from "@/api/data_admin/buildTaskApi"
|
|
|
+import { createModelTask, queryModelDiglog } from "@/api/data_admin/buildTaskApi"
|
|
|
import { mapGetters } from "vuex"
|
|
|
export default {
|
|
|
components: {
|
|
|
-
|
|
|
},
|
|
|
computed: {
|
|
|
...mapGetters("layout", ["projectId"])
|
|
@@ -85,83 +85,87 @@ export default {
|
|
|
params: Object, //模型和设备的信息
|
|
|
newTaskTypes: Array
|
|
|
},
|
|
|
- created() { },
|
|
|
+ created() {
|
|
|
+
|
|
|
+ },
|
|
|
methods: {
|
|
|
getTableData() {
|
|
|
let params = {
|
|
|
Cascade: [
|
|
|
- {
|
|
|
- Name: "equipCategory",
|
|
|
- Projection: ["EquipCode", "EquipName"]
|
|
|
- },
|
|
|
- {
|
|
|
- Name: "component",
|
|
|
- Cascade: [{Name: "equipCategory"}]
|
|
|
- },
|
|
|
- {
|
|
|
- Name: "building",
|
|
|
- Projection: [ "BuildLocalName", "BuildName", "BuildID" ]
|
|
|
- },
|
|
|
- {
|
|
|
- Name: "floor",
|
|
|
- Projection: [ "FloorLocalName", "FloorName", "FloorID" ]
|
|
|
- }
|
|
|
- ],
|
|
|
- Filters: `ProjectId='${this.projectId}'`,
|
|
|
- Orders: "CreateTime desc, EquipID asc",
|
|
|
- PageNumber: this.page.pageNumber,
|
|
|
- PageSize: this.page.pageSize
|
|
|
+ {
|
|
|
+ Name: "equipCategory",
|
|
|
+ Projection: ["EquipCode", "EquipName"]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ Name: "component",
|
|
|
+ Cascade: [{ Name: "equipCategory" }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ Name: "building",
|
|
|
+ Projection: ["BuildLocalName", "BuildName", "BuildID"]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ Name: "floor",
|
|
|
+ Projection: ["FloorLocalName", "FloorName", "FloorID"]
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ Filters: `ProjectId='${this.projectId}'`,
|
|
|
+ Orders: "CreateTime desc, EquipID asc",
|
|
|
+ PageNumber: this.page.pageNumber,
|
|
|
+ PageSize: this.page.pageSize
|
|
|
}
|
|
|
|
|
|
- if(this.params.isVerification){
|
|
|
+ if (this.params.isVerification) {
|
|
|
params.Filters += `;TaskState isNull`
|
|
|
}
|
|
|
|
|
|
- if(this.params.device){
|
|
|
+ if (this.params.device) {
|
|
|
params.Filters += `;Category='${this.params.category}'`
|
|
|
}
|
|
|
|
|
|
- if(this.params.spaceList && this.params.spaceList.length){
|
|
|
+ if (this.params.spaceList && this.params.spaceList.length) {
|
|
|
//通过平面图区域查询(接口未支持)paramsQuery:{listId:[]}
|
|
|
+ let IdList = this.params.spaceList
|
|
|
+ queryModelDiglog(IdList, res => {})
|
|
|
} else {
|
|
|
params.Filters += `;ModelId='${this.params.CurrentModelId}'`
|
|
|
- }
|
|
|
-
|
|
|
- queryEquip(params, res => {
|
|
|
- this.tableData = res.Content.map(item => {
|
|
|
- if(item.Component && item.Component.length){
|
|
|
- item.ComponentCount = []
|
|
|
- item.Component.map(parts => {
|
|
|
- if(parts.EquipCategory && parts.EquipCategory.EquipCode && parts.EquipCategory.EquipName){
|
|
|
- let index = item.ComponentCount.findIndex(c => {return c.code == parts.EquipCategory.EquipCode})
|
|
|
- if(index != -1){
|
|
|
- item.ComponentCount[index].count++
|
|
|
- } else {
|
|
|
- item.ComponentCount.push({
|
|
|
- name: parts.EquipCategory.EquipName,
|
|
|
- code: parts.EquipCategory.EquipCode,
|
|
|
- count: 1
|
|
|
- })
|
|
|
+ queryEquip(params, res => {
|
|
|
+ this.tableData = res.Content.map(item => {
|
|
|
+ if (item.Component && item.Component.length) {
|
|
|
+ item.ComponentCount = []
|
|
|
+ item.Component.map(parts => {
|
|
|
+ if (parts.EquipCategory && parts.EquipCategory.EquipCode && parts.EquipCategory.EquipName) {
|
|
|
+ let index = item.ComponentCount.findIndex(c => { return c.code == parts.EquipCategory.EquipCode })
|
|
|
+ if (index != -1) {
|
|
|
+ item.ComponentCount[index].count++
|
|
|
+ } else {
|
|
|
+ item.ComponentCount.push({
|
|
|
+ name: parts.EquipCategory.EquipName,
|
|
|
+ code: parts.EquipCategory.EquipCode,
|
|
|
+ count: 1
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- item.FolderName = this.params.modelFolderName
|
|
|
- item.FolderId = this.params.modelFolderId
|
|
|
- item.FileName = this.params.modelFileName
|
|
|
- item.FileId = this.params.CurrentModelId
|
|
|
- item.SchemeId = "1"
|
|
|
- return item
|
|
|
+ })
|
|
|
+ }
|
|
|
+ item.FolderName = this.params.modelFolderName
|
|
|
+ item.FolderId = this.params.modelFolderId
|
|
|
+ item.FileName = this.params.modelFileName
|
|
|
+ item.FileId = this.params.CurrentModelId
|
|
|
+ item.SchemeId = "1"
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ this.page.total = res.Total
|
|
|
})
|
|
|
- this.page.total = res.Total
|
|
|
- })
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
//选中项修改
|
|
|
handleSelectionChange(val) {
|
|
|
this.selections = val;
|
|
|
},
|
|
|
savaRelation() {
|
|
|
- if(this.selections.length){
|
|
|
+ if (this.selections.length) {
|
|
|
let list = this.selections.map((item) => {
|
|
|
return {
|
|
|
EquipId: item.EquipID,
|
|
@@ -175,11 +179,11 @@ export default {
|
|
|
Content: list
|
|
|
}
|
|
|
createModelTask(params, res => {
|
|
|
- this.$emit('update:dialogVisible',false)
|
|
|
+ this.$emit('update:dialogVisible', false)
|
|
|
this.$message.success('创建成功!')
|
|
|
- this.$router.push({name:'buildTask',query:{ newTaskTypes:this.newTaskTypes } })//跳转回首页
|
|
|
+ this.$router.push({ name: 'buildTask', query: { newTaskTypes: this.newTaskTypes } })//跳转回首页
|
|
|
})
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
this.$message('请选择要创建的任务!')
|
|
|
}
|
|
|
},
|
|
@@ -194,13 +198,13 @@ export default {
|
|
|
this.page.pageNumber = pageNo;
|
|
|
this.getTableData();
|
|
|
},
|
|
|
- handleClose(){//关闭弹窗
|
|
|
- this.$emit('update:dialogVisible',false);
|
|
|
+ handleClose() {//关闭弹窗
|
|
|
+ this.$emit('update:dialogVisible', false);
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
- dialogVisible(newData,oldData){
|
|
|
- if(newData){
|
|
|
+ dialogVisible(newData, oldData) {
|
|
|
+ if (newData) {
|
|
|
this.tableData = []
|
|
|
this.page.pageNumber = 1
|
|
|
this.getTableData()
|
|
@@ -219,7 +223,7 @@ export default {
|
|
|
}
|
|
|
.table-box {
|
|
|
height: 370px;
|
|
|
- .fr{
|
|
|
+ .fr {
|
|
|
margin-top: 10px;
|
|
|
}
|
|
|
}
|
|
@@ -227,17 +231,17 @@ export default {
|
|
|
</style>
|
|
|
|
|
|
<style>
|
|
|
- .demo-table-expand {
|
|
|
- font-size: 0;
|
|
|
- }
|
|
|
- .demo-table-expand label {
|
|
|
- width: 90px;
|
|
|
- color: #99a9bf;
|
|
|
- }
|
|
|
- .demo-table-expand .el-form-item {
|
|
|
- margin-right: 0;
|
|
|
- margin-bottom: 0;
|
|
|
- margin-left: 120px;
|
|
|
- width: 100%;
|
|
|
- }
|
|
|
+.demo-table-expand {
|
|
|
+ font-size: 0;
|
|
|
+}
|
|
|
+.demo-table-expand label {
|
|
|
+ width: 90px;
|
|
|
+ color: #99a9bf;
|
|
|
+}
|
|
|
+.demo-table-expand .el-form-item {
|
|
|
+ margin-right: 0;
|
|
|
+ margin-bottom: 0;
|
|
|
+ margin-left: 120px;
|
|
|
+ width: 100%;
|
|
|
+}
|
|
|
</style>
|