Merge branch 'hi-ucs-dev' of http://15.2.21.221:3000/wuhongjian/hi-ucs into hi-ucs-dev

This commit is contained in:
a0049873 2022-07-19 15:06:32 +08:00
commit 8ec4b585b6
1 changed files with 48 additions and 13 deletions

View File

@ -392,6 +392,7 @@
</div>
</div>
</div>
<!-- 来源应用 -->
<div class="AssociatedApplication">
<a-modal
v-model:visible="visibleAssociatedApplication"
@ -413,6 +414,28 @@
</div>
</a-modal>
</div>
<!-- 关联组件 -->
<div class="AssociatedApplication">
<a-modal
v-model:visible="visibleAssociatedApplicationOther"
:title="titleName"
@ok="handleOk"
@cancel="handleCancel"
style="width: 960px"
>
<div>
<a-transfer
v-model:target-keys="targetKeysOther"
v-model:selected-keys="selectedKeysOther"
:data-source="mockDataOther"
:titles="titles"
:render="(item) => item.title"
@change="handleChangeOther"
@selectChange="handleSelectChangeOther"
/>
</div>
</a-modal>
</div>
</div>
</template>
</div>
@ -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
}