合并版本v0.8.2.4

This commit is contained in:
wuhongjian 2022-07-19 14:11:58 +08:00
commit da68d9117c
8 changed files with 167 additions and 89 deletions

View File

@ -138,10 +138,18 @@
> >
<span>{{ item.name }}</span> <span>{{ item.name }}</span>
<a-input <a-input
v-if="item.type == 'input'" v-if="item.type == 'input' && item.name.indexOf('名称') == -1"
v-model:value="item.note1" v-model:value="item.note1"
:placeholder="'请输入' + item.name" :placeholder="'请输入' + item.name"
/> />
<a-input
v-else-if="
item.type == 'input' && item.name.indexOf('名称') != -1
"
:maxLength="50"
v-model:value="item.note1"
:placeholder="'请输入' + item.name + '不超过50个字符'"
/>
<a-radio-group <a-radio-group
v-else-if="item.type == 'radio'" v-else-if="item.type == 'radio'"
v-model:value="item.note1" v-model:value="item.note1"
@ -300,6 +308,7 @@
</div> </div>
</div> </div>
</div> </div>
<!-- 来源应用 -->
<div class="AssociatedApplication"> <div class="AssociatedApplication">
<a-modal <a-modal
v-model:visible="visibleAssociatedApplication" v-model:visible="visibleAssociatedApplication"
@ -321,6 +330,28 @@
</div> </div>
</a-modal> </a-modal>
</div> </div>
<!-- 关联组件 -->
<div class="AssociatedApplication">
<a-modal
v-model:visible="visibleAssociatedApplication"
:title="titleName"
@ok="handleOk"
@cancel="handleCancel"
style="width: 960px"
>
<div>
<a-transfer
v-model:target-keys="targetKeys2"
v-model:selected-keys="selectedKeys2"
:data-source="mockData2"
:titles="titles"
:render="(item) => item.title"
@change="handleChange1"
@selectChange="handleSelectChange1"
/>
</div>
</a-modal>
</div>
</div> </div>
</template> </template>
</div> </div>
@ -622,11 +653,13 @@
// //
const visibleAssociatedApplication = ref(false) const visibleAssociatedApplication = ref(false)
const mockData = ref([]) const mockData = ref([])
const mockData2 = ref([])
const titles = ref(['未关联的应用名称', '已关联的应用名称']) const titles = ref(['未关联的应用名称', '已关联的应用名称'])
const titleName = ref('来源应用') const titleName = ref('来源应用')
const targetKeys = ref([]) const targetKeys = ref([])
const targetKeys2 = ref([])
// //
const targetKeysBack = ref([]) // const targetKeysBack = ref([])
const sourceClick = () => { const sourceClick = () => {
mockData.value = [] mockData.value = []
@ -671,7 +704,7 @@
const componentsClick = () => { const componentsClick = () => {
titles.value = ['未关联的组件名称', '已关联的组件名称'] titles.value = ['未关联的组件名称', '已关联的组件名称']
titleName.value = '关联组件' titleName.value = '关联组件'
mockData.value = [] mockData2.value = []
visibleAssociatedApplication.value = true visibleAssociatedApplication.value = true
props.dataFrom.infoList.forEach((val) => { props.dataFrom.infoList.forEach((val) => {
if (val.attrType === '关联组件信息' && val.attrValue != '') { if (val.attrType === '关联组件信息' && val.attrValue != '') {
@ -682,18 +715,18 @@
}).then((res) => { }).then((res) => {
// console.log(res.data.data.notLinked) // console.log(res.data.data.notLinked)
res.data.data.notLinked.forEach((val, index) => { res.data.data.notLinked.forEach((val, index) => {
mockData.value.push({ mockData2.value.push({
key: val.id, key: val.id,
title: val.name, title: val.name,
description: val.id, description: val.id,
}) })
}) })
}) })
targetKeys.value = [] targetKeys2.value = []
val.attrValue.split(',').forEach((item) => { val.attrValue.split(',').forEach((item) => {
targetKeys.value.push(item) targetKeys2.value.push(item)
}) })
console.log(targetKeys.value) console.log(targetKeys2.value)
// console.log('wowowo') // console.log('wowowo')
} else if (val.attrType === '关联组件信息' && val.attrValue == '') { } else if (val.attrType === '关联组件信息' && val.attrValue == '') {
queryResourceRelByKeyId({ queryResourceRelByKeyId({
@ -703,7 +736,7 @@
}).then((res) => { }).then((res) => {
// console.log(res.data.data.notLinked) // console.log(res.data.data.notLinked)
res.data.data.notLinked.forEach((val, index) => { res.data.data.notLinked.forEach((val, index) => {
mockData.value.push({ mockData2.value.push({
key: val.id, key: val.id,
title: val.name, title: val.name,
description: val.id, description: val.id,
@ -714,6 +747,7 @@
}) })
} }
const selectedKeys = ref([]) const selectedKeys = ref([])
const selectedKeys2 = ref([])
const handleChange = (nextTargetKeys, direction, moveKeys) => { const handleChange = (nextTargetKeys, direction, moveKeys) => {
console.log('targetKeys: ', nextTargetKeys) console.log('targetKeys: ', nextTargetKeys)
@ -723,9 +757,22 @@
targetKeys.value = moveKeys.filter((item, index) => index === 0) 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) => { const handleSelectChange = (sourceSelectedKeys, targetSelectedKeys) => {
console.log('targetSelectedKeys: ', targetSelectedKeys, sourceSelectedKeys) console.log('targetSelectedKeys: ', targetSelectedKeys, sourceSelectedKeys)
console.log('after', sourceSelectedKeys)
}
const handleSelectChange1 = (sourceSelectedKeys1, targetSelectedKeys1) => {
console.log(
'targetSelectedKeys: ',
targetSelectedKeys1,
sourceSelectedKeys1
)
} }
const handleOk = (e) => { const handleOk = (e) => {
@ -733,8 +780,10 @@
visibleAssociatedApplication.value = false visibleAssociatedApplication.value = false
// console.log('2222222222222', props.refData) // console.log('2222222222222', props.refData)
data.value.list.map((item) => { data.value.list.map((item) => {
if (item.name === '来源应用' || item.name === '关联组件信息') { if (item.name === '来源应用') {
item.note1 = targetKeys.value + '' item.note1 = targetKeys.value + ''
} else if (item.name === '关联组件信息') {
item.note1 = targetKeys2.value + ''
} }
}) })
} }

View File

@ -2,7 +2,7 @@
* @Author: hisense.liangjunhua * @Author: hisense.liangjunhua
* @Date: 2022-06-08 11:56:28 * @Date: 2022-06-08 11:56:28
* @LastEditors: hisense.liangjunhua * @LastEditors: hisense.liangjunhua
* @LastEditTime: 2022-07-15 17:30:19 * @LastEditTime: 2022-07-19 11:07:46
* @Description: 算法详情页头部 * @Description: 算法详情页头部
--> -->
<template> <template>
@ -62,7 +62,7 @@
加入申购车 加入申购车
</a-button> </a-button>
<a-button type="primary" @click="goTOCollection()"> <a-button type="primary" @click="goTOCollection()">
{{ scFlag ? '已' : '' }}收藏 {{ props.dataList.isCollect == 'true' ? '已' : '' }}收藏
</a-button> </a-button>
</div> </div>
</div> </div>
@ -127,40 +127,6 @@
}) })
} }
const componentType = ref('') 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) { if (props.dataList.infoList) {
applicationArea.value = props.dataList.infoList.filter( applicationArea.value = props.dataList.infoList.filter(
(val) => val.attrType === '应用领域' (val) => val.attrType === '应用领域'
@ -217,12 +183,44 @@
if (obj) { if (obj) {
componentType.value = obj.attrValue 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('')
// })
}
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.algorithm-top-details { .algorithm-top-details {

View File

@ -2,7 +2,7 @@
* @Author: hisense.liangjunhua * @Author: hisense.liangjunhua
* @Date: 2022-06-08 11:56:28 * @Date: 2022-06-08 11:56:28
* @LastEditors: hisense.wuhongjian * @LastEditors: hisense.wuhongjian
* @LastEditTime: 2022-07-16 16:43:11 * @LastEditTime: 2022-07-19 14:11:50
* @Description: 算法详情页头部 * @Description: 算法详情页头部
--> -->
<template> <template>
@ -64,7 +64,7 @@
申请使用 申请使用
</a-button> </a-button>
<a-button type="primary" @click="goTOCollection()"> <a-button type="primary" @click="goTOCollection()">
{{ scFlag ? '已' : '' }}收藏 {{ props.dataList.isCollect == 'true' ? '已' : '' }}收藏
</a-button> </a-button>
</div> </div>
</div> </div>
@ -144,17 +144,17 @@
} }
// //
const scFlag = ref(props.dataList.isCollect)
const scFlag2 = ref(true) const scFlag2 = ref(true)
const goTOCollection = () => { const goTOCollection = () => {
console.log('收藏===================》', props.dataList) console.log('收藏===================》', props.dataList)
if (scFlag2.value) { if (scFlag2.value) {
scFlag2.value = false scFlag2.value = false
if (scFlag.value) { if (props.dataList.isCollect) {
scDel([props.dataList.id]).then((res) => { scDel([props.dataList.id]).then((res) => {
if (res.data.msg === 'success') { if (res.data.msg === 'success') {
message.success('取消成功') message.success('取消成功')
scFlag.value = false // eslint-disable-next-line vue/no-mutating-props
props.dataList.isCollect = false
scFlag2.value = true scFlag2.value = true
} }
}) })
@ -166,7 +166,8 @@
]).then((res) => { ]).then((res) => {
if (res.data.msg === 'success') { if (res.data.msg === 'success') {
message.success('添加收藏成功!') message.success('添加收藏成功!')
scFlag.value = true // eslint-disable-next-line vue/no-mutating-props
props.dataList.isCollect = true
scFlag2.value = true scFlag2.value = true
} }
}) })
@ -191,9 +192,6 @@
applicationArea.value = props.dataList.infoList.filter( applicationArea.value = props.dataList.infoList.filter(
(val) => val.attrType === '应用领域' (val) => val.attrType === '应用领域'
)[0].attrValue )[0].attrValue
if (val.isCollect) {
scFlag.value = true
}
} }
} }
) )

View File

@ -2,7 +2,7 @@
* @Author: hisense.liangjunhua * @Author: hisense.liangjunhua
* @Date: 2022-06-08 11:56:28 * @Date: 2022-06-08 11:56:28
* @LastEditors: hisense.liangjunhua * @LastEditors: hisense.liangjunhua
* @LastEditTime: 2022-07-15 17:31:32 * @LastEditTime: 2022-07-19 11:09:52
* @Description: 算法详情页头部 * @Description: 算法详情页头部
--> -->
<template> <template>
@ -63,7 +63,7 @@
加入申购车 加入申购车
</a-button> </a-button>
<a-button type="primary" @click="goTOCollection()"> <a-button type="primary" @click="goTOCollection()">
{{ scFlag ? '已' : '' }}收藏 {{ props.dataList.isCollect == 'true' ? '已' : '' }}收藏
</a-button> </a-button>
</div> </div>
</div> </div>
@ -127,17 +127,17 @@
}) })
} }
// //
const scFlag = ref(props.dataList.isCollect)
const scFlag2 = ref(true) const scFlag2 = ref(true)
const goTOCollection = () => { const goTOCollection = () => {
console.log('收藏===================》', props.dataList) console.log('收藏===================》', props.dataList)
if (scFlag2.value) { if (scFlag2.value) {
scFlag2.value = false scFlag2.value = false
if (scFlag.value) { if (props.dataList.isCollect) {
scDel([props.dataList.id]).then((res) => { scDel([props.dataList.id]).then((res) => {
if (res.data.msg === 'success') { if (res.data.msg === 'success') {
message.success('取消成功') message.success('取消成功')
scFlag.value = false // eslint-disable-next-line vue/no-mutating-props
props.dataList.isCollect = false
scFlag2.value = true scFlag2.value = true
} }
}) })
@ -149,7 +149,8 @@
]).then((res) => { ]).then((res) => {
if (res.data.msg === 'success') { if (res.data.msg === 'success') {
message.success('添加收藏成功!') message.success('添加收藏成功!')
scFlag.value = true // eslint-disable-next-line vue/no-mutating-props
props.dataList.isCollect = true
scFlag2.value = true scFlag2.value = true
} }
}) })
@ -200,9 +201,6 @@
if (obj) { if (obj) {
componentType.value = obj.attrValue componentType.value = obj.attrValue
} }
if (val.isCollect) {
scFlag.value = true
}
} }
} }
) )

View File

@ -2,7 +2,7 @@
* @Author: hisense.liangjunhua * @Author: hisense.liangjunhua
* @Date: 2022-06-08 11:56:28 * @Date: 2022-06-08 11:56:28
* @LastEditors: hisense.liangjunhua * @LastEditors: hisense.liangjunhua
* @LastEditTime: 2022-07-15 17:32:08 * @LastEditTime: 2022-07-19 11:10:06
* @Description: 开发组件详情页头部 * @Description: 开发组件详情页头部
--> -->
<template> <template>
@ -59,7 +59,7 @@
加入购物车 加入购物车
</a-button> </a-button>
<a-button type="primary" @click="goTOCollection()"> <a-button type="primary" @click="goTOCollection()">
{{ scFlag ? '已' : '' }}收藏 {{ props.dataList.isCollect == 'true' ? '已' : '' }}收藏
</a-button> </a-button>
</div> </div>
</div> </div>
@ -122,17 +122,17 @@
}) })
} }
// //
const scFlag = ref(props.dataList.isCollect)
const scFlag2 = ref(true) const scFlag2 = ref(true)
const goTOCollection = () => { const goTOCollection = () => {
console.log('收藏===================》', props.dataList) console.log('收藏===================》', props.dataList)
if (scFlag2.value) { if (scFlag2.value) {
scFlag2.value = false scFlag2.value = false
if (scFlag.value) { if (props.dataList.isCollect) {
scDel([props.dataList.id]).then((res) => { scDel([props.dataList.id]).then((res) => {
if (res.data.msg === 'success') { if (res.data.msg === 'success') {
message.success('取消成功') message.success('取消成功')
scFlag.value = false // eslint-disable-next-line vue/no-mutating-props
props.dataList.isCollect = false
scFlag2.value = true scFlag2.value = true
} }
}) })
@ -144,7 +144,8 @@
]).then((res) => { ]).then((res) => {
if (res.data.msg === 'success') { if (res.data.msg === 'success') {
message.success('添加收藏成功!') message.success('添加收藏成功!')
scFlag.value = true // eslint-disable-next-line vue/no-mutating-props
props.dataList.isCollect = true
scFlag2.value = true scFlag2.value = true
} }
}) })
@ -206,9 +207,6 @@
if (obj) { if (obj) {
componentType.value = obj.attrValue componentType.value = obj.attrValue
} }
if (val.isCollect) {
scFlag.value = true
}
} }
} }
) )

View File

@ -2,7 +2,7 @@
* @Author: hisense.liangjunhua * @Author: hisense.liangjunhua
* @Date: 2022-06-08 11:56:28 * @Date: 2022-06-08 11:56:28
* @LastEditors: hisense.liangjunhua * @LastEditors: hisense.liangjunhua
* @LastEditTime: 2022-07-15 17:32:31 * @LastEditTime: 2022-07-19 11:10:20
* @Description: 算法详情页头部 * @Description: 算法详情页头部
--> -->
<template> <template>
@ -59,7 +59,7 @@
加入申购车 加入申购车
</a-button> </a-button>
<a-button type="primary" @click="goTOCollection()"> <a-button type="primary" @click="goTOCollection()">
{{ scFlag ? '已' : '' }}收藏 {{ props.dataList.isCollect == 'true' ? '已' : '' }}收藏
</a-button> </a-button>
</div> </div>
</div> </div>
@ -122,17 +122,17 @@
}) })
} }
// //
const scFlag = ref(props.dataList.isCollect)
const scFlag2 = ref(true) const scFlag2 = ref(true)
const goTOCollection = () => { const goTOCollection = () => {
console.log('收藏===================》', props.dataList) console.log('收藏===================》', props.dataList)
if (scFlag2.value) { if (scFlag2.value) {
scFlag2.value = false scFlag2.value = false
if (scFlag.value) { if (props.dataList.isCollect) {
scDel([props.dataList.id]).then((res) => { scDel([props.dataList.id]).then((res) => {
if (res.data.msg === 'success') { if (res.data.msg === 'success') {
message.success('取消成功') message.success('取消成功')
scFlag.value = false // eslint-disable-next-line vue/no-mutating-props
props.dataList.isCollect = false
scFlag2.value = true scFlag2.value = true
} }
}) })
@ -144,7 +144,8 @@
]).then((res) => { ]).then((res) => {
if (res.data.msg === 'success') { if (res.data.msg === 'success') {
message.success('添加收藏成功!') message.success('添加收藏成功!')
scFlag.value = true // eslint-disable-next-line vue/no-mutating-props
props.dataList.isCollect = true
scFlag2.value = true scFlag2.value = true
} }
}) })
@ -199,9 +200,6 @@
if (obj) { if (obj) {
componentType.value = obj.attrValue componentType.value = obj.attrValue
} }
if (val.isCollect) {
scFlag.value = true
}
} }
} }
) )

View File

@ -367,12 +367,12 @@
p { p {
// width: 1.60rem; // width: 1.60rem;
height: 0.2rem; height: 0.2rem;
margin-right: 0.15rem;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
// overflow: hidden;
white-space: nowrap;
-webkit-line-clamp: 1; -webkit-line-clamp: 1;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
margin-right: 0.15rem;
word-break: break-all; word-break: break-all;
span { span {

View File

@ -141,7 +141,7 @@
</div> </div>
</template> </template>
<script setup> <script setup>
import { onMounted, ref } from 'vue' import { onMounted, ref, watch } from 'vue'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { message } from 'ant-design-vue' import { message } from 'ant-design-vue'
import { updateVisits, browsingInsert } from '@/api/home' import { updateVisits, browsingInsert } from '@/api/home'
@ -218,6 +218,7 @@
type.value = '' type.value = ''
pageNum.value = '1' pageNum.value = '1'
pageSize.value = '5' pageSize.value = '5'
tabIndex.value = 0
showKey.value++ showKey.value++
checkAll.value = false checkAll.value = false
getList() getList()
@ -229,6 +230,8 @@
getBsList({ getBsList({
limit: pageSize.value, limit: pageSize.value,
page: pageNum.value, page: pageNum.value,
type: tabList.value[tabIndex.value],
name: name.value,
}).then((res) => { }).then((res) => {
checkAll.value = true checkAll.value = true
console.log('申购车列表================>', res) console.log('申购车列表================>', res)
@ -328,7 +331,7 @@
showKey.value++ showKey.value++
} }
// //
const tabIndex = ref(-1) const tabIndex = ref(0)
const changeTab = (index) => { const changeTab = (index) => {
console.log('tabIndex', tabIndex.value, index, tabList) console.log('tabIndex', tabIndex.value, index, tabList)
if (tabIndex.value == index) { if (tabIndex.value == index) {
@ -381,6 +384,42 @@
} }
} }
} }
//tabindex
watch(tabIndex, (val) => {
getBsList({
limit: pageSize.value,
page: pageNum.value,
type: tabList.value[val],
name: name.value,
}).then((res) => {
checkAll.value = true
console.log('申购车列表================>', res)
initLoading.value = false
list.value = []
total.value = res.data.data.total
res.data.data.list.forEach((val) => {
const obj = {
loading: false,
name: val.resourceDTO.name,
id: val.id,
checked: false,
visits: val.resourceDTO.visits,
type: val.resourceDTO.type,
link: val.resourceDTO.link,
resourceId: val.resourceId,
createDate: val.createDate,
description: val.resourceDTO.description,
delFlag: val.resourceDTO.delFlag,
}
if (checkedList.value.indexOf(val.id) == -1) {
checkAll.value = false
} else {
obj.checked = true
}
list.value.push(obj)
})
})
})
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.ant-list { .ant-list {