fix:open triggerForm from attributeCard (#322)

This commit is contained in:
wang-liang0615 2023-12-21 14:18:00 +08:00 committed by GitHub
parent 920295d955
commit 4beece5a6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 14 deletions

View File

@ -104,6 +104,10 @@ export default {
type: Boolean,
default: false,
},
attributes: {
type: Array,
default: () => []
}
},
data() {
const propertyList = [
@ -160,7 +164,7 @@ export default {
})
},
openTrigger() {
this.$refs.triggerForm.open(this.property)
this.$refs.triggerForm.open(this.property, this.attributes)
},
handleCalcComputed() {
const that = this

View File

@ -98,6 +98,7 @@
:property="item"
@ok="handleOk"
:CITypeId="CITypeId"
:attributes="attributes"
/>
<i></i> <i></i> <i></i> <i></i> <i></i>
</draggable>
@ -137,6 +138,7 @@
:property="item"
@ok="handleOk"
:CITypeId="CITypeId"
:attributes="attributes"
/>
<i></i> <i></i> <i></i> <i></i> <i></i>
</draggable>

View File

@ -293,6 +293,7 @@ import SplitPane from '@/components/SplitPane'
import CMDBGrant from '../../components/cmdbGrant'
import { ops_move_icon as OpsMoveIcon } from '@/core/icons'
import AttributeStore from './attributeStore.vue'
import { getAllDepAndEmployee } from '@/api/company'
export default {
name: 'CITypes',
@ -342,6 +343,8 @@ export default {
orderSelectionOptions: [],
default_order_asc: '1',
allTreeDepAndEmp: [],
}
},
computed: {
@ -405,9 +408,13 @@ export default {
resource_type: () => {
return this.resource_type
},
provide_allTreeDepAndEmp: () => {
return this.allTreeDepAndEmp
},
}
},
mounted() {
this.getAllDepAndEmployee()
const _currentId = localStorage.getItem('ops_cityps_currentId')
if (_currentId) {
this.currentId = _currentId
@ -419,6 +426,11 @@ export default {
this.getAttributes()
},
methods: {
getAllDepAndEmployee() {
getAllDepAndEmployee({ block: 0 }).then((res) => {
this.allTreeDepAndEmp = res
})
},
async loadCITypes(isResetCurrentId = false) {
const groups = await getCITypeGroupsConfig({ need_other: true })
let alreadyReset = false

View File

@ -71,7 +71,6 @@ import _ from 'lodash'
import { getTriggerList, deleteTrigger, updateTrigger } from '../../api/CIType'
import { getCITypeAttributesById } from '../../api/CITypeAttr'
import TriggerForm from './triggerForm.vue'
import { getAllDepAndEmployee } from '@/api/company'
export default {
name: 'TriggerTable',
@ -86,7 +85,6 @@ export default {
return {
tableData: [],
attrList: [],
allTreeDepAndEmp: [],
}
},
computed: {
@ -97,20 +95,9 @@ export default {
provide() {
return {
refresh: this.getTableData,
provide_allTreeDepAndEmp: () => {
return this.allTreeDepAndEmp
},
}
},
mounted() {
this.getAllDepAndEmployee()
},
methods: {
getAllDepAndEmployee() {
getAllDepAndEmployee({ block: 0 }).then((res) => {
this.allTreeDepAndEmp = res
})
},
async getTableData() {
const [triggerList, attrList] = await Promise.all([
getTriggerList(this.CITypeId),