mirror of
				https://github.com/veops/cmdb.git
				synced 2025-11-04 13:46:17 +08:00 
			
		
		
		
	@@ -276,7 +276,7 @@ export default {
 | 
			
		||||
      } else if (_findADT.agent_id) {
 | 
			
		||||
        this.agent_type = 'agent_id'
 | 
			
		||||
      } else {
 | 
			
		||||
        this.agent_type = 'agent_id'
 | 
			
		||||
        this.agent_type = this.agentTypeRadioList[0].value
 | 
			
		||||
      }
 | 
			
		||||
      if (_findADT.interval || (!_findADT.interval && !_findADT.cron)) {
 | 
			
		||||
        this.interval = 'interval'
 | 
			
		||||
@@ -348,9 +348,17 @@ export default {
 | 
			
		||||
      }
 | 
			
		||||
      if (this.agent_type === 'agent_id' || this.agent_type === 'all') {
 | 
			
		||||
        params.query_expr = ''
 | 
			
		||||
        if (this.agent_type === 'agent_id' && !params.agent_id) {
 | 
			
		||||
          this.$message.error('请填写指定节点!')
 | 
			
		||||
          return
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      if (this.agent_type === 'query_expr' || this.agent_type === 'all') {
 | 
			
		||||
        params.agent_id = ''
 | 
			
		||||
        if (this.agent_type === 'query_expr' && !params.query_expr) {
 | 
			
		||||
          this.$message.error('请从cmdb中选择!')
 | 
			
		||||
          return
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      putCITypeDiscovery(currentAdt.id, params).then((res) => {
 | 
			
		||||
 
 | 
			
		||||
@@ -560,6 +560,7 @@ export default {
 | 
			
		||||
        } else {
 | 
			
		||||
          q = `q=_type:${this.currentTypeId[0]},` + q
 | 
			
		||||
        }
 | 
			
		||||
        if (this.currentTypeId[0]) {
 | 
			
		||||
          const res = await searchCI2(q)
 | 
			
		||||
          this.pageNo = res.page
 | 
			
		||||
          this.numfound = res.numfound
 | 
			
		||||
@@ -574,6 +575,7 @@ export default {
 | 
			
		||||
          })
 | 
			
		||||
          this.initialInstanceList = _.cloneDeep(this.instanceList)
 | 
			
		||||
          this.calcColumns()
 | 
			
		||||
        }
 | 
			
		||||
      } else {
 | 
			
		||||
        q += `&root_id=${this.treeKeys[this.treeKeys.length - 1].split('%')[0]}`
 | 
			
		||||
        const typeId = parseInt(this.treeKeys[this.treeKeys.length - 1].split('%')[1])
 | 
			
		||||
@@ -608,6 +610,7 @@ export default {
 | 
			
		||||
        } else {
 | 
			
		||||
          q = `q=_type:${this.currentTypeId[0]},` + q
 | 
			
		||||
        }
 | 
			
		||||
        if (this.currentTypeId[0]) {
 | 
			
		||||
          const res = await searchCIRelation(q)
 | 
			
		||||
 | 
			
		||||
          const _data = Object.assign([], res.result)
 | 
			
		||||
@@ -625,8 +628,10 @@ export default {
 | 
			
		||||
          this.initialInstanceList = _.cloneDeep(this.instanceList)
 | 
			
		||||
 | 
			
		||||
          this.calcColumns()
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (refreshType === 'refreshNumber') {
 | 
			
		||||
          this.treeKeys.map((key, index) => {
 | 
			
		||||
          const promises = this.treeKeys.map((key, index) => {
 | 
			
		||||
            statisticsCIRelation({
 | 
			
		||||
              root_ids: key.split('%')[0],
 | 
			
		||||
              level: this.treeKeys.length - index,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user