diff --git a/front/src/views/capacityOnTheShelf/components/PutOnTheShelf.vue b/front/src/views/capacityOnTheShelf/components/PutOnTheShelf.vue
index d7a45ddb..d6830f7a 100644
--- a/front/src/views/capacityOnTheShelf/components/PutOnTheShelf.vue
+++ b/front/src/views/capacityOnTheShelf/components/PutOnTheShelf.vue
@@ -138,10 +138,18 @@
>
{{ item.name }}
+
+
+
+
@@ -622,11 +653,13 @@
// 来源应用
const visibleAssociatedApplication = ref(false)
const mockData = ref([])
+ const mockData2 = ref([])
const titles = ref(['未关联的应用名称', '已关联的应用名称'])
const titleName = ref('来源应用')
const targetKeys = ref([])
+ const targetKeys2 = ref([])
// 上一步关联数据
- const targetKeysBack = ref([])
+ // const targetKeysBack = ref([])
const sourceClick = () => {
mockData.value = []
@@ -671,7 +704,7 @@
const componentsClick = () => {
titles.value = ['未关联的组件名称', '已关联的组件名称']
titleName.value = '关联组件'
- mockData.value = []
+ mockData2.value = []
visibleAssociatedApplication.value = true
props.dataFrom.infoList.forEach((val) => {
if (val.attrType === '关联组件信息' && val.attrValue != '') {
@@ -682,18 +715,18 @@
}).then((res) => {
// console.log(res.data.data.notLinked)
res.data.data.notLinked.forEach((val, index) => {
- mockData.value.push({
+ mockData2.value.push({
key: val.id,
title: val.name,
description: val.id,
})
})
})
- targetKeys.value = []
+ targetKeys2.value = []
val.attrValue.split(',').forEach((item) => {
- targetKeys.value.push(item)
+ targetKeys2.value.push(item)
})
- console.log(targetKeys.value)
+ console.log(targetKeys2.value)
// console.log('wowowo')
} else if (val.attrType === '关联组件信息' && val.attrValue == '') {
queryResourceRelByKeyId({
@@ -703,7 +736,7 @@
}).then((res) => {
// console.log(res.data.data.notLinked)
res.data.data.notLinked.forEach((val, index) => {
- mockData.value.push({
+ mockData2.value.push({
key: val.id,
title: val.name,
description: val.id,
@@ -714,6 +747,7 @@
})
}
const selectedKeys = ref([])
+ const selectedKeys2 = ref([])
const handleChange = (nextTargetKeys, direction, moveKeys) => {
console.log('targetKeys: ', nextTargetKeys)
@@ -723,9 +757,22 @@
targetKeys.value = moveKeys.filter((item, index) => index === 0)
}
}
+ const handleChange1 = (nextTargetKeys1, direction1, moveKeys1) => {
+ console.log('targetKeys: ', nextTargetKeys1)
+ console.log('direction: ', direction1)
+ console.log('moveKeys: ', moveKeys1)
+ }
const handleSelectChange = (sourceSelectedKeys, targetSelectedKeys) => {
console.log('targetSelectedKeys: ', targetSelectedKeys, sourceSelectedKeys)
+ console.log('after', sourceSelectedKeys)
+ }
+ const handleSelectChange1 = (sourceSelectedKeys1, targetSelectedKeys1) => {
+ console.log(
+ 'targetSelectedKeys: ',
+ targetSelectedKeys1,
+ sourceSelectedKeys1
+ )
}
const handleOk = (e) => {
@@ -733,8 +780,10 @@
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 = targetKeys2.value + ''
}
})
}
diff --git a/front/src/views/detailsAll/components/Algorithm/AlgorithmTopDetails.vue b/front/src/views/detailsAll/components/Algorithm/AlgorithmTopDetails.vue
index 64311f72..3a1dc63b 100644
--- a/front/src/views/detailsAll/components/Algorithm/AlgorithmTopDetails.vue
+++ b/front/src/views/detailsAll/components/Algorithm/AlgorithmTopDetails.vue
@@ -2,7 +2,7 @@
* @Author: hisense.liangjunhua
* @Date: 2022-06-08 11:56:28
* @LastEditors: hisense.liangjunhua
- * @LastEditTime: 2022-07-15 17:30:19
+ * @LastEditTime: 2022-07-19 11:07:46
* @Description: 算法详情页头部
-->
@@ -62,7 +62,7 @@
加入申购车
- {{ scFlag ? '已' : '' }}收藏
+ {{ props.dataList.isCollect == 'true' ? '已' : '' }}收藏
@@ -127,40 +127,6 @@
})
}
const componentType = ref('')
- // 收藏
- const scFlag = ref(props.dataList.isCollect)
- const scFlag2 = ref(true)
- const goTOCollection = () => {
- console.log('收藏===================》', props.dataList)
- if (scFlag2.value) {
- scFlag2.value = false
- if (scFlag.value) {
- scDel([props.dataList.id]).then((res) => {
- if (res.data.msg === 'success') {
- message.success('取消成功')
- scFlag.value = false
- scFlag2.value = true
- }
- })
- } else {
- scInsert([
- {
- resourceId: props.dataList.id,
- },
- ]).then((res) => {
- if (res.data.msg === 'success') {
- message.success('添加收藏成功!')
- scFlag.value = true
- scFlag2.value = true
- }
- })
- }
- }
- // scInsert([{ resourceId: props.dataList.id }]).then((res) => {
- // console.log(res)
- // message.success('收藏成功')
- // })
- }
if (props.dataList.infoList) {
applicationArea.value = props.dataList.infoList.filter(
(val) => val.attrType === '应用领域'
@@ -217,12 +183,44 @@
if (obj) {
componentType.value = obj.attrValue
}
- if (val.isCollect) {
- scFlag.value = true
- }
}
}
)
+ // 收藏
+ const scFlag2 = ref(true)
+ const goTOCollection = () => {
+ console.log('收藏===================》', props.dataList)
+ if (scFlag2.value) {
+ scFlag2.value = false
+ if (props.dataList.isCollect == 'true') {
+ scDel([props.dataList.id]).then((res) => {
+ if (res.data.msg === 'success') {
+ message.success('取消成功')
+ // eslint-disable-next-line vue/no-mutating-props
+ props.dataList.isCollect = 'false'
+ scFlag2.value = true
+ }
+ })
+ } else {
+ scInsert([
+ {
+ resourceId: props.dataList.id,
+ },
+ ]).then((res) => {
+ if (res.data.msg === 'success') {
+ message.success('添加收藏成功!')
+ // eslint-disable-next-line vue/no-mutating-props
+ props.dataList.isCollect = 'true'
+ scFlag2.value = true
+ }
+ })
+ }
+ }
+ // scInsert([{ resourceId: props.dataList.id }]).then((res) => {
+ // console.log(res)
+ // message.success('收藏成功')
+ // })
+ }