|
@@ -125,41 +125,47 @@ export default {
|
|
|
|
|
|
if (this.params.spaceList && this.params.spaceList.length) {
|
|
|
//通过平面图区域查询(接口未支持)paramsQuery:{listId:[]}
|
|
|
- let IdList = this.params.spaceList
|
|
|
- queryModelDiglog(IdList, res => {})
|
|
|
+ params.IdList = this.params.spaceList
|
|
|
+ queryModelDiglog(params, res => {
|
|
|
+ this.dataFormatter(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
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- 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.dataFormatter(res)
|
|
|
})
|
|
|
}
|
|
|
|
|
|
},
|
|
|
+ // 表格数据格式化
|
|
|
+ dataFormatter(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
|
|
|
+ })
|
|
|
+ this.page.total = res.Total
|
|
|
+ },
|
|
|
//选中项修改
|
|
|
handleSelectionChange(val) {
|
|
|
this.selections = val;
|