diff --git a/front/src/views/capacityOnTheShelf/components/PutOnTheShelf.vue b/front/src/views/capacityOnTheShelf/components/PutOnTheShelf.vue index 7beec4b7..4b5912b2 100644 --- a/front/src/views/capacityOnTheShelf/components/PutOnTheShelf.vue +++ b/front/src/views/capacityOnTheShelf/components/PutOnTheShelf.vue @@ -392,6 +392,7 @@ +
+ +
+ +
+ +
+
+
@@ -712,12 +735,15 @@ } // 来源应用 const visibleAssociatedApplication = ref(false) + const visibleAssociatedApplicationOther = ref(false) const mockData = ref([]) + const mockDataOther = ref([]) const titles = ref(['未关联的应用名称', '已关联的应用名称']) const titleName = ref('来源应用') const targetKeys = ref([]) + const targetKeysOther = ref([]) // 上一步关联数据 - const targetKeysBack = ref([]) + // const targetKeysBack = ref([]) const sourceClick = () => { mockData.value = [] @@ -762,8 +788,8 @@ const componentsClick = () => { titles.value = ['未关联的组件名称', '已关联的组件名称'] titleName.value = '关联组件' - mockData.value = [] - visibleAssociatedApplication.value = true + visibleAssociatedApplicationOther.value = true + mockDataOther.value = [] props.dataFrom.infoList.forEach((val) => { if (val.attrType === '关联组件信息' && val.attrValue != '') { queryResourceRelByKeyId({ @@ -773,18 +799,18 @@ }).then((res) => { // console.log(res.data.data.notLinked) res.data.data.notLinked.forEach((val, index) => { - mockData.value.push({ + mockDataOther.value.push({ key: val.id, title: val.name, description: val.id, }) }) }) - targetKeys.value = [] + targetKeysOther.value = [] val.attrValue.split(',').forEach((item) => { - targetKeys.value.push(item) + targetKeysOther.value.push(item) }) - console.log(targetKeys.value) + console.log(targetKeysOther.value) // console.log('wowowo') } else if (val.attrType === '关联组件信息' && val.attrValue == '') { queryResourceRelByKeyId({ @@ -794,7 +820,7 @@ }).then((res) => { // console.log(res.data.data.notLinked) res.data.data.notLinked.forEach((val, index) => { - mockData.value.push({ + mockDataOther.value.push({ key: val.id, title: val.name, description: val.id, @@ -805,6 +831,7 @@ }) } const selectedKeys = ref([]) + const selectedKeysOther = ref([]) const handleChange = (nextTargetKeys, direction, moveKeys) => { console.log('targetKeys: ', nextTargetKeys) @@ -814,26 +841,34 @@ targetKeys.value = moveKeys.filter((item, index) => index === 0) } } - const handleSelectChange = (sourceSelectedKeys, targetSelectedKeys) => { console.log('targetSelectedKeys: ', targetSelectedKeys, sourceSelectedKeys) - // 左侧单选 - selectedKeys.value = [sourceSelectedKeys[sourceSelectedKeys.length - 1]] - console.log('after', sourceSelectedKeys) + } + const handleChangeOther = (nextTargetKeys, direction, moveKeys) => { + console.log('targetKeys: ', nextTargetKeys) + console.log('direction: ', direction) + console.log('moveKeys: ', moveKeys) + } + const handleSelectChangeOther = (sourceSelectedKeys, targetSelectedKeys) => { + console.log('targetSelectedKeys: ', targetSelectedKeys, sourceSelectedKeys) } const handleOk = (e) => { console.log(e) + visibleAssociatedApplicationOther.value = false visibleAssociatedApplication.value = false // console.log('2222222222222', props.refData) data.value.list.map((item) => { - if (item.name === '来源应用' || item.name === '关联组件信息') { + if (item.name === '来源应用') { item.note1 = targetKeys.value + '' + } else if (item.name === '关联组件信息') { + item.note1 = targetKeysOther.value + '' } }) } const handleCancel = (e) => { console.log(e) + visibleAssociatedApplicationOther.value = false visibleAssociatedApplication.value = false }