Merge branch 'hi-ucs-dev' of http://124.222.94.39:3001/wuhongjian/hi-ucs into hi-ucs-dev

This commit is contained in:
guoyue 2022-07-15 17:33:47 +08:00
commit 497e3f5dbc
16 changed files with 1115 additions and 742 deletions

View File

@ -36,8 +36,8 @@
<div class="add">添加更多{{ configure.name }}</div> <div class="add">添加更多{{ configure.name }}</div>
<div class="form" v-for="(val, index) in configure.list" :key="'key3' + val.name + index"> <div class="form" v-for="(val, index) in configure.list" :key="'key3' + val.name + index">
<span>{{ val.name }}</span> <span>{{ val.name }}</span>
<!-- <a-input v-model:value="val.note1" ::maxlength="24" placeholder="'请填写' + val.name + ',不超过24个字符'" <a-input v-model:value="val.note1" ::maxlength="24" :placeholder="'请填写' + val.name + ',不超过24个字符'"
v-if="val.type == 'input'"/> --> v-if="val.type == 'input'"/>
<template v-if="val.type == 'input2'"> <template v-if="val.type == 'input2'">
<a-input <a-input
v-model:value="val.note1" v-model:value="val.note1"

View File

@ -1,8 +1,8 @@
/* /*
* @Author: hisense.wuhongjian * @Author: hisense.wuhongjian
* @Date: 2022-03-29 17:48:03 * @Date: 2022-03-29 17:48:03
* @LastEditors: hisense.wuhongjian * @LastEditors: hisense.liangjunhua
* @LastEditTime: 2022-04-12 10:07:15 * @LastEditTime: 2022-07-15 16:42:22
* @Description: 告诉大家这是什么 * @Description: 告诉大家这是什么
*/ */
import request from '@/utils/request' import request from '@/utils/request'
@ -30,6 +30,13 @@ export function getUserInfo() {
method: 'get', method: 'get',
}) })
} }
export function getDeptAll() {
//mock.js使dataaccessToken使mockheaders
return request({
url: '/sys/dept/all',
method: 'get',
})
}
export function logout() { export function logout() {
return request({ return request({

View File

@ -46,6 +46,7 @@
:refData="refData" :refData="refData"
:dataFrom="dataFrom" :dataFrom="dataFrom"
:fileList="fileList" :fileList="fileList"
:packageList="packageList"
:imgList="imgList" :imgList="imgList"
:externalField="['接口服务', '接口请求方式']" :externalField="['接口服务', '接口请求方式']"
:configure="bs" :configure="bs"
@ -197,6 +198,7 @@
const navList = ref([]) const navList = ref([])
const navList2 = ref([]) const navList2 = ref([])
const fileList = ref({}) const fileList = ref({})
const packageList = ref({})
const imgList = ref({}) const imgList = ref({})
const videoList = ref({}) const videoList = ref({})
const data = ref({}) const data = ref({})
@ -310,6 +312,18 @@
key: val.name, key: val.name,
}) })
navList2.value.push(val.name) navList2.value.push(val.name)
if (val.name === '部署与使用') {
console.log(val, '部署与使用')
val.children.forEach((valChild) => {
if (valChild.name === '使用方式') {
valChild.children.forEach((valChilds) => {
if (valChilds.name === '使用方式') {
valChilds.note1 = '调用接口'
}
})
}
})
}
}) })
data.value = res.data.data.children data.value = res.data.data.children
refData.value = data.value.filter( refData.value = data.value.filter(
@ -342,6 +356,9 @@
mybus.on('chageFileList', (obj) => { mybus.on('chageFileList', (obj) => {
fileList.value = obj fileList.value = obj
}) })
mybus.on('chagePackageList', (obj) => {
packageList.value = obj
})
mybus.on('chageImgList', (obj) => { mybus.on('chageImgList', (obj) => {
imgList.value = obj imgList.value = obj
}) })
@ -380,72 +397,56 @@
}) })
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.box { .box {
position: relative; position: relative;
top: 64px; top: 64px;
margin: 15px 400px; margin: 15px 400px;
padding: 10px; padding: 10px;
background: #fff; background: #fff;
.header { .header {
font-size: 28px; font-size: 28px;
font-weight: 600; font-weight: 600;
} }
.vue-box { .vue-box {
padding: 0 100px; padding: 0 100px;
} }
.top { .top {
margin: 10px 20px 0; margin: 10px 20px 0;
padding: 15px 30px; padding: 15px 30px;
background: #edf4fc; background: #edf4fc;
display: flex;
justify-content: space-between;
div {
font-size: 18px;
color: #999;
display: flex; display: flex;
justify-content: space-between; justify-content: center;
div { align-items: center;
font-size: 18px; .bg-box {
color: #999;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
.bg-box { width: 45px;
height: 45px;
border-radius: 50%;
border: 1px solid rgb(214, 214, 214);
margin-right: 10px;
transition: all 0.3s ease;
span {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
width: 45px; width: 30px;
height: 45px; height: 30px;
border-radius: 50%; border-radius: 50%;
border: 1px solid rgb(214, 214, 214); border: 1px solid #999;
margin-right: 10px;
transition: all 0.3s ease;
span {
display: flex;
justify-content: center;
align-items: center;
width: 30px;
height: 30px;
border-radius: 50%;
border: 1px solid #999;
}
}
.line {
margin-left: 10px;
width: 130px;
height: 1px;
background: #999;
} }
} }
.finish { .line {
color: #0087ff; margin-left: 10px;
.bg-box { width: 130px;
background: #9ccefa; height: 1px;
color: #fff; background: #999;
border: 1px solid #9ccefa;
span {
background: #0087ff;
border: 1px solid #0087ff;
}
}
.line {
background: #0087ff;
}
} }
} }
.btn { .btn {
@ -458,8 +459,13 @@
height: 35px; height: 35px;
text-align: center; text-align: center;
color: #fff; color: #fff;
border: none; border: 1px solid #9ccefa;
border-radius: 6px; span {
background: #0087ff;
border: 1px solid #0087ff;
}
}
.line {
background: #0087ff; background: #0087ff;
} }
button:nth-of-type(1) { button:nth-of-type(1) {
@ -474,4 +480,30 @@
justify-content: space-around; justify-content: space-around;
} }
} }
.btn {
display: flex;
justify-content: space-between;
padding: 10px 400px 0;
button {
cursor: pointer;
width: 80px;
height: 35px;
text-align: center;
color: #fff;
border: none;
border-radius: 6px;
background: #0087ff;
}
button:nth-of-type(1) {
color: #0087ff;
background: #e1edfa;
}
button:nth-of-type(2) {
background: #01c5dc;
}
}
.first {
justify-content: center;
}
}
</style> </style>

View File

@ -2,7 +2,7 @@
* @Author: hisense.liangjunhua * @Author: hisense.liangjunhua
* @Date: 2022-06-17 14:11:08 * @Date: 2022-06-17 14:11:08
* @LastEditors: hisense.liangjunhua * @LastEditors: hisense.liangjunhua
* @LastEditTime: 2022-07-15 16:21:41 * @LastEditTime: 2022-07-15 16:56:49
* @Description: 上架 * @Description: 上架
--> -->
<template> <template>
@ -117,7 +117,23 @@
</template> </template>
<template v-else> <template v-else>
<div class="bottom"> <div class="bottom">
<div class="form" v-for="item in title.children" :key="item.id"> <div
class="form"
v-for="item in title.children"
:key="item.id"
v-show="
!(
(showType == '调用接口' && item.name == '平台地址') ||
(showType == '调用接口' && item.name == 'SDK安装包') ||
(showType == '平台对接' && item.name == 'SDK安装包') ||
(showType == '平台对接' && item.name == '接口请求方式') ||
(showType == '平台对接' && item.name == '服务接口') ||
(showType == 'SDK' && item.name == '平台地址') ||
(showType == 'SDK' && item.name == '接口请求方式') ||
(showType == 'SDK' && item.name == '服务接口')
)
"
>
<span>{{ item.name }}</span> <span>{{ item.name }}</span>
<a-input <a-input
v-if="item.type == 'input'" v-if="item.type == 'input'"
@ -176,6 +192,15 @@
:list="props.fileList2" :list="props.fileList2"
tip="支持文件类型大小不超过100M" tip="支持文件类型大小不超过100M"
></upload> ></upload>
<upload
v-else-if="item.type == 'package'"
type="压缩包"
btnName="上传安装包"
:maxCount="1"
:data="item"
:list="props.packageList"
tip="支持.zip类型"
></upload>
<div <div
class="Technical-text" class="Technical-text"
v-else-if="item.type == 'richText'" v-else-if="item.type == 'richText'"
@ -211,6 +236,21 @@
> >
请选择关联组件 请选择关联组件
</a-button> </a-button>
<a-select
v-else-if="item.type == 'select' && item.name == '使用方式'"
style="width: 240px"
v-model:value="item.note1"
:placeholder="'请选择' + item.name"
@change="showTypeClick"
>
<a-select-option
v-for="(itemSelect, indexSelect) in item.options"
:key="indexSelect"
:value="itemSelect.dictLabel"
>
{{ itemSelect.dictLabel }}
</a-select-option>
</a-select>
<a-select <a-select
v-else-if="item.type == 'select'" v-else-if="item.type == 'select'"
style="width: 240px" style="width: 240px"
@ -225,6 +265,18 @@
{{ itemSelect.dictLabel }} {{ itemSelect.dictLabel }}
</a-select-option> </a-select-option>
</a-select> </a-select>
<a-select
v-else-if="item.name === '归属部门'"
style="width: 240px"
v-model:value="item.note1"
show-search
placeholder="请输入关键字"
:options="item.options"
:filter-option="filterOption"
@focus="handleFocus"
@blur="handleBlur"
@change="handleChange2"
></a-select>
<div <div
v-else-if="item.type == 'checkBox'" v-else-if="item.type == 'checkBox'"
class="application-Area" class="application-Area"
@ -277,6 +329,7 @@
import mybus from '@/myplugins/mybus' import mybus from '@/myplugins/mybus'
import upload from '@/views/components/upload' import upload from '@/views/components/upload'
import { message } from 'ant-design-vue' import { message } from 'ant-design-vue'
import { getUserInfo, getDeptAll } from '@/api/user'
import { import {
getCategoryTreePage, getCategoryTreePage,
queryApplicationRelByResourceId, queryApplicationRelByResourceId,
@ -296,6 +349,8 @@
// //
fileList: { type: Array, default: null }, fileList: { type: Array, default: null },
fileList2: { type: Array, default: null }, fileList2: { type: Array, default: null },
//
packageList: { type: Array, default: null },
// //
imgList: { type: Array, default: null }, imgList: { type: Array, default: null },
// //
@ -412,6 +467,25 @@
} }
data.value.list.push(item) data.value.list.push(item)
}) })
} else if (item.name === '归属部门') {
getDeptAll().then((res) => {
const dataList = []
res.data.data.forEach((element) => {
dataList.push({
value: element.id,
label: element.name,
})
})
item.options = dataList
if (!item.note1) {
getUserInfo().then(({ data: res1 }) => {
console.log(res1.data)
item.note1 = res1.data.deptId
console.log('默认部门=========>', item, res1.data)
data.value.list.push(item)
})
}
})
} else { } else {
data.value.list.push(item) data.value.list.push(item)
} }
@ -591,6 +665,13 @@
visibleAssociatedApplication.value = false visibleAssociatedApplication.value = false
} }
const showType = ref('')
const showTypeClick = (e) => {
showType.value = e
console.log(e, 'showType', showType.value)
}
showTypeClick('调用接口')
watch(data.value.list, (newProps, oldProps) => { watch(data.value.list, (newProps, oldProps) => {
// console.log(newProps, oldProps) // console.log(newProps, oldProps)
newProps.forEach((val) => { newProps.forEach((val) => {
@ -624,256 +705,271 @@
} }
}) })
}) })
const handleChange2 = (value) => {
console.log(`selected ${value}`)
}
const handleBlur = () => {
console.log('blur')
}
const handleFocus = () => {
console.log('focus')
}
const filterOption = (input, option) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
</script> </script>
<style></style> <style></style>
<style lang="less" scoped> <style lang="less" scoped>
.put-on-the-shelf { .put-on-the-shelf {
height: 680px; height: 680px;
overflow: scroll; overflow: scroll;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
padding: 50px 100px 25px; padding: 50px 100px 25px;
.Technical-text { .Technical-text {
height: 30px; height: 30px;
width: 100px; width: 100px;
border: 1px solid #bbd3ef; border: 1px solid #bbd3ef;
border-radius: 6px; border-radius: 6px;
background: #edf4fc; background: #edf4fc;
color: #0087ff; color: #0087ff;
font-size: 14px; font-size: 14px;
text-align: center; text-align: center;
line-height: 30px; line-height: 30px;
} }
.Technical-text:hover { .Technical-text:hover {
cursor: pointer; cursor: pointer;
}
& > div {
width: 100%;
margin-top: 60px;
.top {
color: #333333;
font-size: 22px;
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 25px;
div:first-child,
div:last-child {
width: 245px;
height: 1px;
background: #f0f0f0;
}
div:nth-child(2) {
margin: 0 30px;
}
}
.bottom {
margin-top: 25px;
.items {
background: #fafafa;
padding: 10px;
p {
display: flex;
justify-content: space-between;
span:nth-of-type(1) {
width: 200px;
}
span:nth-of-type(2) {
width: 100%;
font-weight: 600;
}
}
p:nth-of-type(1) > span:nth-of-type(1) {
font-size: 18px;
font-weight: 600;
}
.del {
display: flex;
justify-content: flex-end;
align-items: center;
.delImg {
cursor: pointer;
display: inline-block;
width: 16px;
height: 18px;
background: url(~@/assets/home/sf_del.png) no-repeat;
margin-right: 5px;
}
div {
cursor: pointer;
}
}
}
.add {
margin-top: 10px;
font-size: 16px;
color: #007efb;
}
.form {
margin-top: 20px;
display: flex;
justify-content: flex-start;
align-items: center;
span:first-child {
width: 120px;
}
:deep(.ant-input-textarea) {
width: 520px;
}
:deep(.ant-radio-group) {
width: 520px;
}
:deep(.ant-input-number) {
width: 200px;
}
:deep(.ant-input) {
resize: none;
width: 520px;
}
.ant-btn {
width: 160px;
height: 32px;
text-align: center;
background: #edf4fc;
color: #0087ff;
border: 1px solid #bbd3ef;
border-radius: 6px;
}
}
.submit {
margin-top: 40px;
display: flex;
justify-content: flex-end;
.ant-btn {
width: 80px;
height: 28px;
text-align: center;
background: #d9ebff;
color: #0087ff;
border: 1px solid #0087ff;
border-radius: 6px;
}
}
}
}
& > div:nth-of-type(1) {
margin-top: 0;
}
} }
.application-Area { & > div {
width: 520px; width: 100%;
display: grid; margin-top: 60px;
margin-top: -5px;
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
.application-Area-son { .top {
cursor: pointer;
font-size: 14px;
width: 90px;
height: 26px;
border-radius: 13px;
color: #333333; color: #333333;
background: #f5f5f5; font-size: 22px;
border: 1px #cccccc solid;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
margin-top: 10px; margin-bottom: 25px;
font-weight: 500;
div:first-child,
div:last-child {
width: 245px;
height: 1px;
background: #f0f0f0;
}
div:nth-child(2) {
margin: 0 30px;
}
} }
.application-Area-down { .bottom {
background: #0087ff; margin-top: 25px;
color: #fff;
.items {
background: #fafafa;
padding: 10px;
p {
display: flex;
justify-content: space-between;
span:nth-of-type(1) {
width: 200px;
}
span:nth-of-type(2) {
width: 100%;
font-weight: 600;
}
}
p:nth-of-type(1) > span:nth-of-type(1) {
font-size: 18px;
font-weight: 600;
}
.del {
display: flex;
justify-content: flex-end;
align-items: center;
.delImg {
cursor: pointer;
display: inline-block;
width: 16px;
height: 18px;
background: url(~@/assets/home/sf_del.png) no-repeat;
margin-right: 5px;
}
div {
cursor: pointer;
}
}
}
.add {
margin-top: 10px;
font-size: 16px;
color: #007efb;
}
.form {
margin-top: 20px;
display: flex;
justify-content: flex-start;
align-items: center;
span:first-child {
width: 120px;
}
:deep(.ant-input-textarea) {
width: 520px;
}
:deep(.ant-radio-group) {
width: 520px;
}
:deep(.ant-input-number) {
width: 200px;
}
:deep(.ant-input) {
resize: none;
width: 520px;
}
.ant-btn {
width: 160px;
height: 32px;
text-align: center;
background: #edf4fc;
color: #0087ff;
border: 1px solid #bbd3ef;
border-radius: 6px;
}
}
.submit {
margin-top: 40px;
display: flex;
justify-content: flex-end;
.ant-btn {
width: 80px;
height: 28px;
text-align: center;
background: #d9ebff;
color: #0087ff;
border: 1px solid #0087ff;
border-radius: 6px;
}
}
} }
} }
:deep(.ant-image-img) { & > div:nth-of-type(1) {
width: 100%; margin-top: 0;
height: 100%;
object-fit: contain;
} }
}
:deep(.ant-modal) { .application-Area {
width: 960px; width: 520px;
} display: grid;
margin-top: -5px;
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
:deep(.ant-transfer-list) { .application-Area-son {
width: 39.5%; cursor: pointer;
height: 520px; font-size: 14px;
} width: 90px;
height: 26px;
:deep(.ant-transfer-operation) { border-radius: 13px;
flex-direction: row-reverse; color: #333333;
margin: 0 30px; background: #f5f5f5;
} border: 1px #cccccc solid;
:deep(.ant-btn) {
width: 56px;
height: 40px;
border-radius: 4px;
}
:deep(.ant-btn:first-child) {
margin-left: 4px;
}
:deep(.ant-modal-footer) {
border: 0;
}
:deep(.ant-modal-header) {
border: 0;
}
:deep(.ant-modal-title) {
line-height: 24px;
font-size: 18px;
color: #303133;
}
:deep(.ant-transfer-list-header) {
background: #f5f7fa;
}
:deep(.ant-transfer-list-header-selected) {
display: flex; display: flex;
width: 90%; justify-content: center;
flex-direction: row-reverse;
justify-content: space-between;
align-items: center; align-items: center;
margin-top: 10px;
font-weight: 500;
} }
:deep(.ant-transfer-list-header-title) { .application-Area-down {
font-size: 16px; background: #0087ff;
color: #303133; color: #fff;
font-weight: 400;
text-align: left;
} }
}
:deep(.ant-image-img) {
width: 100%;
height: 100%;
object-fit: contain;
}
:deep(.ant-modal) {
width: 960px;
}
:deep(.ant-transfer-list) {
width: 39.5%;
height: 520px;
}
:deep(.ant-transfer-operation) {
flex-direction: row-reverse;
margin: 0 30px;
}
:deep(.ant-btn) {
width: 56px;
height: 40px;
border-radius: 4px;
}
:deep(.ant-btn:first-child) {
margin-left: 4px;
}
:deep(.ant-modal-footer) {
border: 0;
}
:deep(.ant-modal-header) {
border: 0;
}
:deep(.ant-modal-title) {
line-height: 24px;
font-size: 18px;
color: #303133;
}
:deep(.ant-transfer-list-header) {
background: #f5f7fa;
}
:deep(.ant-transfer-list-header-selected) {
display: flex;
width: 90%;
flex-direction: row-reverse;
justify-content: space-between;
align-items: center;
}
:deep(.ant-transfer-list-header-title) {
font-size: 16px;
color: #303133;
font-weight: 400;
text-align: left;
}
</style> </style>

View File

@ -76,6 +76,8 @@
file.type === 'application/msword' || file.type === 'application/msword' ||
file.type === file.type ===
'application/vnd.openxmlformats-officedocument.wordprocessingml.document' 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
} else if (props.type === '压缩包') {
flag = file.type === 'application/x-zip-compressed'
} }
console.log(flag) console.log(flag)
if (!flag) { if (!flag) {
@ -115,6 +117,8 @@
} else { } else {
mybus.emit('chageFileList', fileList.value) mybus.emit('chageFileList', fileList.value)
} }
} else if (props.type === '压缩包') {
mybus.emit('chagePackageList', fileList.value)
} else if (props.type === '视频') { } else if (props.type === '视频') {
mybus.emit('chageVideoList', fileList.value) mybus.emit('chageVideoList', fileList.value)
} }
@ -129,16 +133,16 @@
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.upload-list-inline { .upload-list-inline {
width: unset; width: unset;
button { button {
height: 30px; height: 30px;
width: 100px; width: 100px;
border: 1px solid #bbd3ef; border: 1px solid #bbd3ef;
border-radius: 6px; border-radius: 6px;
background: #edf4fc; background: #edf4fc;
color: #0087ff; color: #0087ff;
font-size: 14px; font-size: 14px;
}
} }
}
</style> </style>

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-05 11:41:52 * @LastEditTime: 2022-07-15 17:30:19
* @Description: 算法详情页头部 * @Description: 算法详情页头部
--> -->
<template> <template>
@ -58,7 +58,9 @@
<template #icon><shopping-cart-outlined /></template> <template #icon><shopping-cart-outlined /></template>
加入申购车 加入申购车
</a-button> </a-button>
<a-button type="primary" @click="goTOCollection()">收藏</a-button> <a-button type="primary" @click="goTOCollection()">
{{ scFlag ? '已' : '' }}收藏
</a-button>
</div> </div>
</div> </div>
<div class="right"></div> <div class="right"></div>
@ -67,7 +69,7 @@
<script setup> <script setup>
import { FormOutlined, ShoppingCartOutlined } from '@ant-design/icons-vue' import { FormOutlined, ShoppingCartOutlined } from '@ant-design/icons-vue'
import { defineProps, ref, watch } from 'vue' import { defineProps, ref, watch } from 'vue'
import { scInsert } from '@/api/personalCenter' import { scInsert, scDel } from '@/api/personalCenter'
import { sgcInsert } from '@/api/home' import { sgcInsert } from '@/api/home'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import mybus from '@/myplugins/mybus' import mybus from '@/myplugins/mybus'
@ -75,6 +77,7 @@
const props = defineProps({ const props = defineProps({
dataList: { type: Object, default: null }, dataList: { type: Object, default: null },
}) })
// console.log('==================>', props.dataList.isCollect)
const router = useRouter() const router = useRouter()
const applicationArea = ref('') const applicationArea = ref('')
const deploymentLocation = ref('') // const deploymentLocation = ref('') //
@ -121,12 +124,38 @@
} }
const componentType = ref('') const componentType = ref('')
// //
const scFlag = ref(props.dataList.isCollect)
const scFlag2 = ref(true)
const goTOCollection = () => { const goTOCollection = () => {
console.log('收藏===================》', props.dataList) console.log('收藏===================》', props.dataList)
scInsert([{ resourceId: props.dataList.id }]).then((res) => { if (scFlag2.value) {
console.log(res) scFlag2.value = false
message.success('收藏成功') 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(

View File

@ -8,10 +8,10 @@
></DetalsTitle> ></DetalsTitle>
</div> </div>
<div class="content" v-for="item in dataFrom.content" :key="item.title"> <div class="content" v-for="item in dataFrom.content" :key="item.title">
<div class="content-left"> <div class="content-left" v-if="item.titleType === '调用接口'">
<div class="left"> <div class="left">
<div class="content-left-title"> <div class="content-left-title">
<span>{{ item.title }}</span> <span>{{ item.title }}{{ item.titleType }}</span>
</div> </div>
<div class="content-left-content"> <div class="content-left-content">
<p> <p>
@ -29,7 +29,41 @@
</div> </div>
<div class="right"> <div class="right">
<div @click="technical()">技术文档</div> <div @click="technical()">技术文档</div>
<div @click="technicalNew()">新手指引</div> <!-- <div @click="technicalNew()">新手指引</div> -->
<!-- <div @click="SDKClick()">SDK安装包</div> -->
</div>
</div>
<div class="content-left" v-else-if="item.titleType === '平台对接'">
<div class="left">
<div class="content-left-title">
<span>{{ item.title }}{{ item.titleType }}</span>
</div>
<div class="content-left-content">
<p>
<span>{{ item.linkPlatform.name }}</span>
<a-tooltip>
<template #title>{{ item.linkPlatform.value }}</template>
<span>{{ item.linkPlatform.value }}</span>
</a-tooltip>
</p>
</div>
</div>
<div class="right">
<div @click="technical()">技术文档</div>
<!-- <div @click="technicalNew()">新手指引</div> -->
<!-- <div @click="SDKClick()">SDK安装包</div> -->
</div>
</div>
<div class="content-left" v-else-if="item.titleType === 'SDK'">
<div class="left">
<div class="content-left-title">
<span>{{ item.title }}{{ item.titleType }}</span>
</div>
</div>
<div class="right">
<div @click="technical()">技术文档</div>
<!-- <div @click="technicalNew()">新手指引</div> -->
<div @click="SDKClick()">SDK安装包</div>
</div> </div>
</div> </div>
<div class="content-right"> <div class="content-right">
@ -98,13 +132,19 @@
let dataFrom = ref({ let dataFrom = ref({
title: '使用方式', title: '使用方式',
englishTitle: 'USAGE', englishTitle: 'USAGE',
SDK: '',
content: [ content: [
{ {
title: '组件地址', title: '使用方式',
titleType: '',
link: { link: {
name: '服务接口:', name: '服务接口:',
value: '', value: '',
}, },
linkPlatform: {
name: '平台地址:',
value: '',
},
postMethod: { postMethod: {
name: '请求方式:', name: '请求方式:',
value: '', value: '',
@ -151,7 +191,7 @@
dataFrom.value.content[0].facilitator.value = props.dataList.deptName dataFrom.value.content[0].facilitator.value = props.dataList.deptName
dataFrom.value.content[0].people.value = props.dataList.deptContacts dataFrom.value.content[0].people.value = props.dataList.deptContacts
dataFrom.value.content[0].phone.value = props.dataList.deptPhone dataFrom.value.content[0].phone.value = props.dataList.deptPhone
dataFrom.value.content[0].postMethod.value = val.apiMethodType dataFrom.value.content[0].postMethod.value = props.dataList.apiMethodType
console.log('dataList', props.dataList) console.log('dataList', props.dataList)
props.dataList.infoList.map((item) => { props.dataList.infoList.map((item) => {
if (item.attrType === '组件地址') { if (item.attrType === '组件地址') {
@ -163,8 +203,13 @@
} else if (item.attrType === '服务商联系电话') { } else if (item.attrType === '服务商联系电话') {
dataFrom.value.content[0].phone2.value = item.attrValue || '--' dataFrom.value.content[0].phone2.value = item.attrValue || '--'
} else if (item.attrType === '服务接口') { } else if (item.attrType === '服务接口') {
debugger
dataFrom.value.content[0].link.value = item.attrValue || '--' dataFrom.value.content[0].link.value = item.attrValue || '--'
} else if (item.attrType === '平台地址') {
dataFrom.value.content[0].linkPlatform.value = item.attrValue || '--'
} else if (item.attrType === 'SDK安装包') {
dataFrom.value.SDK = item.attrValue || '--'
} else if (item.attrType === '使用方式') {
dataFrom.value.content[0].titleType = item.attrValue || '--'
} }
}) })
} }
@ -203,8 +248,14 @@
} else if (item.attrType === '服务商联系电话') { } else if (item.attrType === '服务商联系电话') {
dataFrom.value.content[0].phone2.value = item.attrValue || '--' dataFrom.value.content[0].phone2.value = item.attrValue || '--'
} else if (item.attrType === '服务接口') { } else if (item.attrType === '服务接口') {
debugger
dataFrom.value.content[0].link.value = item.attrValue || '--' dataFrom.value.content[0].link.value = item.attrValue || '--'
} else if (item.attrType === '平台地址') {
dataFrom.value.content[0].linkPlatform.value =
item.attrValue || '--'
} else if (item.attrType === 'SDK安装包') {
dataFrom.value.SDK = item.attrValue || '--'
} else if (item.attrType === '使用方式') {
dataFrom.value.content[0].titleType = item.attrValue || '--'
} }
}) })
} }
@ -257,140 +308,154 @@
message.error('暂未上传使用手册') message.error('暂未上传使用手册')
} }
} }
function SDKClick() {
let obj = props.dataList.infoList.filter(
(item) => item.attrType === 'SDK安装包'
)[0]
if (obj) {
window.open(dataFrom.value.SDK)
} else {
message.config({
top: '100px', //
})
message.error('SDK安装包')
}
}
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.usage-mode { .usage-mode {
display: flex;
flex-direction: column;
align-items: center;
padding: 0.8rem 0;
.content {
margin-top: 0.3rem;
display: flex; display: flex;
flex-direction: column;
align-items: center;
padding: 0.8rem 0;
.content { .content-left {
margin-top: 0.3rem; height: 1.5rem;
width: 6.2rem;
background: url('~@/assets/detailsAll/business/business_usage_mode_bg.png')
no-repeat;
background-position: center;
background-size: 100% 100%;
border-radius: 0.1rem;
margin-right: 0.6rem;
box-shadow: 0rem 0.05rem 0.15rem rgba(82, 106, 255, 0.4);
display: flex; display: flex;
align-items: center;
justify-content: space-between;
padding: 0 0.35rem;
.content-left { .left {
height: 1.5rem; .content-left-title {
width: 6.2rem; font-size: 0.26rem;
background: url('~@/assets/detailsAll/business/business_usage_mode_bg.png') line-height: 0.26rem;
no-repeat; color: #212956;
background-position: center; margin-bottom: 0.2rem;
background-size: 100% 100%;
border-radius: 0.1rem;
margin-right: 0.6rem;
box-shadow: 0rem 0.05rem 0.15rem rgba(82, 106, 255, 0.4);
display: flex;
align-items: center;
padding: 0 0.35rem;
.left { span:first-child {
.content-left-title { margin-right: 0.1rem;
font-size: 0.26rem;
line-height: 0.26rem;
color: #212956;
margin-bottom: 0.2rem;
span:first-child {
margin-right: 0.1rem;
}
}
.content-left-content {
width: 4.2rem;
font-size: 0.2rem;
color: rgba(33, 41, 86, 0.8);
line-height: 0.2rem;
p {
display: -webkit-box;
margin-bottom: 0.1rem;
span:last-of-type {
width: 298px;
display: -webkit-box;
overflow: hidden;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
}
} }
} }
.right { .content-left-content {
div { width: 4.2rem;
height: 0.4rem; font-size: 0.2rem;
width: 1.3rem; color: rgba(33, 41, 86, 0.8);
background: #ffffff; line-height: 0.2rem;
border-radius: 0.2rem;
color: #526aff;
font-size: 0.2rem;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
}
div:first-child { p {
margin-bottom: 0.2rem; display: -webkit-box;
margin-bottom: 0.1rem;
span:last-of-type {
width: 298px;
display: -webkit-box;
overflow: hidden;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
} }
} }
} }
.content-right { .right {
height: 1.5rem; div {
width: 6.2rem; height: 0.4rem;
background: url('~@/assets/detailsAll/business/business_usage_mode_bg.png') width: 1.3rem;
no-repeat; background: #ffffff;
background-position: center; border-radius: 0.2rem;
background-size: 100% 100%; color: #526aff;
border-radius: 0.1rem; font-size: 0.2rem;
box-shadow: 0rem 0.05rem 0.15rem rgba(82, 106, 255, 0.4);
display: flex;
justify-content: space-around;
align-items: center;
padding: 0 0.3rem;
.content-right-left {
border-right: 0.01rem solid #707fe0;
padding-right: 0.1rem;
margin-right: 0.1rem;
}
.content-right-title {
font-size: 0.26rem;
line-height: 0.26rem;
color: #212956;
margin-bottom: 0.15rem;
}
.content-right-content {
display: flex; display: flex;
font-size: 0.16rem; justify-content: center;
color: rgba(33, 41, 86, 0.8); align-items: center;
line-height: 0.2rem; cursor: pointer;
overflow: hidden; }
div:first-child {
margin-bottom: 0.2rem;
}
}
}
.content-right {
height: 1.5rem;
width: 6.2rem;
background: url('~@/assets/detailsAll/business/business_usage_mode_bg.png')
no-repeat;
background-position: center;
background-size: 100% 100%;
border-radius: 0.1rem;
box-shadow: 0rem 0.05rem 0.15rem rgba(82, 106, 255, 0.4);
display: flex;
justify-content: space-around;
align-items: center;
padding: 0 0.3rem;
.content-right-left {
border-right: 0.01rem solid #707fe0;
padding-right: 0.1rem;
margin-right: 0.1rem;
}
.content-right-title {
font-size: 0.26rem;
line-height: 0.26rem;
color: #212956;
margin-bottom: 0.15rem;
}
.content-right-content {
display: flex;
font-size: 0.16rem;
color: rgba(33, 41, 86, 0.8);
line-height: 0.2rem;
overflow: hidden;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
flex-direction: column;
p {
// width: 1.60rem;
height: 0.2rem;
display: -webkit-box;
// overflow: hidden;
margin-bottom: 0.08rem;
white-space: nowrap;
-webkit-line-clamp: 1; -webkit-line-clamp: 1;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
flex-direction: column; margin-right: 0.15rem;
p { span {
// width: 1.60rem; cursor: pointer;
height: 0.2rem;
display: -webkit-box;
// overflow: hidden;
margin-bottom: 0.08rem;
white-space: nowrap;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
margin-right: 0.15rem;
span {
cursor: pointer;
}
} }
} }
} }
} }
} }
}
</style> </style>

View File

@ -68,11 +68,13 @@
item.attrType === '部署位置' item.attrType === '部署位置'
) { ) {
dataFrom.value.content[0].childrenContent.push(item) dataFrom.value.content[0].childrenContent.push(item)
} else if ( } else if (item.attrType === '等保定级') {
item.attrType === '是否等保备案' ||
item.attrType === '等保定级'
) {
dataFrom.value.content[1].childrenContent.push(item) dataFrom.value.content[1].childrenContent.push(item)
let isAndNo = {
attrType: '是否等保备案',
attrValue: '是',
}
dataFrom.value.content[1].childrenContent.push(isAndNo)
} else if (item.attrType === '访问地址') { } else if (item.attrType === '访问地址') {
let obj = { let obj = {
attrType: '访问地址', attrType: '访问地址',
@ -85,7 +87,7 @@
let data = [ let data = [
{ {
attrType: '是否等保备案', attrType: '是否等保备案',
attrValue: '------', attrValue: '',
}, },
{ {
attrType: '等保定级', attrType: '等保定级',
@ -116,11 +118,13 @@
item.attrType === '部署位置' item.attrType === '部署位置'
) { ) {
dataFrom.value.content[0].childrenContent.push(item) dataFrom.value.content[0].childrenContent.push(item)
} else if ( } else if (item.attrType === '等保定级') {
item.attrType === '是否等保备案' ||
item.attrType === '等保定级'
) {
dataFrom.value.content[1].childrenContent.push(item) dataFrom.value.content[1].childrenContent.push(item)
let isAndNo = {
attrType: '是否等保备案',
attrValue: '是',
}
dataFrom.value.content[1].childrenContent.push(isAndNo)
} else if (item.attrType === '访问地址') { } else if (item.attrType === '访问地址') {
let obj = { let obj = {
attrType: '访问地址', attrType: '访问地址',
@ -130,10 +134,11 @@
} }
}) })
if (dataFrom.value.content[1].childrenContent.length <= 0) { if (dataFrom.value.content[1].childrenContent.length <= 0) {
debugger
let data = [ let data = [
{ {
attrType: '是否等保备案', attrType: '是否等保备案',
attrValue: '------', attrValue: '',
}, },
{ {
attrType: '等保定级', attrType: '等保定级',

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-06-14 11:31:12 * @LastEditTime: 2022-07-15 17:30:26
* @Description: 算法详情页头部 * @Description: 算法详情页头部
--> -->
<template> <template>
@ -53,236 +53,265 @@
加入购物车 加入购物车
</a-button> --> </a-button> -->
<!-- 融合服务 存在fuseResourceList --> <!-- 融合服务 存在fuseResourceList -->
<a-button type="primary" @click="handleAKeyApplication()" v-if="dataList.fuseResourceList"> <a-button
type="primary"
@click="handleAKeyApplication()"
v-if="dataList.fuseResourceList"
>
<template #icon> <template #icon>
<form-outlined /> <form-outlined />
</template> </template>
申请使用 申请使用
</a-button> </a-button>
<a-button type="primary" @click="goTOCollection()">收藏</a-button> <a-button type="primary" @click="goTOCollection()">
{{ scFlag ? '已' : '' }}收藏
</a-button>
</div> </div>
</div> </div>
<div class="right"></div> <div class="right"></div>
</div> </div>
</template> </template>
<script setup> <script setup>
// import { ShoppingCartOutlined } from '@ant-design/icons-vue' // import { ShoppingCartOutlined } from '@ant-design/icons-vue'
import { defineProps, ref, watch } from 'vue' import { defineProps, ref, watch } from 'vue'
import { scInsert } from '@/api/personalCenter' import { scInsert, scDel } from '@/api/personalCenter'
// import { sgcInsert } from '@/api/home' // import { sgcInsert } from '@/api/home'
// import { useRouter } from 'vue-router' // import { useRouter } from 'vue-router'
// import mybus from '@/myplugins/mybus' // import mybus from '@/myplugins/mybus'
import { message } from 'ant-design-vue' import { message } from 'ant-design-vue'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
// //
const router = useRouter() const router = useRouter()
const props = defineProps({ const props = defineProps({
dataList: { type: Object, default: null }, dataList: { type: Object, default: null },
})
console.log('dataList------------>', props.dataList);
// const router = useRouter()
const applicationArea = ref('')
// //
// const addShoppingCart = () => {
// console.log('==================>', props.dataList)
// sgcInsert({
// delFlag: '0',
// resourceId: props.dataList.id,
// // userId: userId.value,
// }).then((res) => {
// console.log(res)
// message.success('')
// mybus.emit('getSgcNum')
// })
// }
// //
// function toView() {
// // window.open(newpage.href, '_blank')
// router.push({
// path: '/apply',
// query: {
// name: props.dataList.name,
// resourceId: [props.dataList.id],
// },
// })
// }
// --
const handleAKeyApplication = () => {
let _applyList = [];
(props.dataList.fuseResourceList || []).map(v => {
let resource = v.resource || {}
let obj = {
arr: [
{
delFlag: resource.delFlag,
description: resource.description,
resourceId: resource.id,
resourceName: resource.name,
time: resource.createDate,
type: resource.type,
},
],
deptId: resource.deptId,
deptName: resource.deptName,
}
_applyList.push(obj)
}) })
localStorage.setItem( console.log('dataList------------>', props.dataList)
'applyList',
JSON.stringify(_applyList)
)
router.push({
path: '/apply',
})
}
// // const router = useRouter()
const goTOCollection = () => { const applicationArea = ref('')
console.log('收藏===================》', props.dataList) // //
scInsert([{ resourceId: props.dataList.id }]).then((res) => { // const addShoppingCart = () => {
console.log(res) // console.log('==================>', props.dataList)
message.success('收藏成功') // sgcInsert({
}) // delFlag: '0',
} // resourceId: props.dataList.id,
if (props.dataList.infoList) { // // userId: userId.value,
applicationArea.value = props.dataList.infoList.filter( // }).then((res) => {
(val) => val.attrType === '应用领域' // console.log(res)
)[0].attrValue // message.success('')
} // mybus.emit('getSgcNum')
watch( // })
() => props.dataList, // }
(val) => { // //
if (val) { // function toView() {
console.log('props.dataList-----watch------->', val); // // window.open(newpage.href, '_blank')
// router.push({
// path: '/apply',
// query: {
// name: props.dataList.name,
// resourceId: [props.dataList.id],
// },
// })
// }
// --
const handleAKeyApplication = () => {
let _applyList = []
;(props.dataList.fuseResourceList || []).map((v) => {
let resource = v.resource || {}
let obj = {
arr: [
{
delFlag: resource.delFlag,
description: resource.description,
resourceId: resource.id,
resourceName: resource.name,
time: resource.createDate,
type: resource.type,
},
],
deptId: resource.deptId,
deptName: resource.deptName,
}
_applyList.push(obj)
})
applicationArea.value = props.dataList.infoList.filter( localStorage.setItem('applyList', JSON.stringify(_applyList))
(val) => val.attrType === '应用领域' router.push({
)[0].attrValue path: '/apply',
} })
} }
)
//
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 === '应用领域'
)[0].attrValue
}
watch(
() => props.dataList,
(val) => {
if (val) {
console.log('props.dataList-----watch------->', val)
applicationArea.value = props.dataList.infoList.filter(
(val) => val.attrType === '应用领域'
)[0].attrValue
}
}
)
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.algorithm-top-details { .algorithm-top-details {
height: 6rem; height: 6rem;
padding: 1.8rem 0 0; padding: 1.8rem 0 0;
background: url('~@/assets/detailsAll/sf_top_bg.png') no-repeat; background: url('~@/assets/detailsAll/sf_top_bg.png') no-repeat;
background-size: 100%;
display: flex;
justify-content: center;
.left {
max-width: 7.2rem;
color: #fff;
margin-right: 0.8rem;
.top {
display: flex;
align-items: center;
span {
font-size: 0.14rem;
}
.name {
// max-width: 3.3rem;
// overflow: hidden;
// text-overflow: ellipsis;
// white-space: nowrap;
font-size: 0.4rem;
margin-right: 0.2rem;
font-size: 0.4rem;
margin-right: 0.2rem;
max-width: 7rem;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
.label-content {
position: relative;
}
.lable-father {
position: absolute;
min-width: 3.5rem;
right: -3.5rem;
top: 0;
}
.label {
padding: 0.01rem 0.1rem;
margin-right: 0.1rem;
border-radius: 0.13rem;
background: rgba(255, 255, 255, 0.4);
}
}
.main {
margin-top: 0.2rem;
font-size: 0.18rem;
line-height: 0.34rem;
&>div:nth-of-type(1) {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
&>div:nth-of-type(2) {
max-height: 1rem;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
}
}
.bottom {
margin-top: 0.4rem;
display: flex;
.ant-btn {
height: 0.5rem;
margin-right: 0.2rem;
background: #ff8b55;
border-radius: 0.06rem;
font-size: 0.2rem;
display: flex;
justify-content: center;
align-items: center;
}
.ant-btn:nth-of-type(1) {
width: 1.8rem;
}
.ant-btn:nth-of-type(2) {
width: 2.2rem;
}
.ant-btn:nth-of-type(3) {
width: 1.45rem;
background: #fff;
color: #526aff;
}
}
}
.right {
width: 5.8rem;
height: 4rem;
background: url('~@/assets/detailsAll/sf_right_bg.png') no-repeat;
background-size: 100%; background-size: 100%;
margin-top: -0.4rem; display: flex;
justify-content: center;
.left {
max-width: 7.2rem;
color: #fff;
margin-right: 0.8rem;
.top {
display: flex;
align-items: center;
span {
font-size: 0.14rem;
}
.name {
// max-width: 3.3rem;
// overflow: hidden;
// text-overflow: ellipsis;
// white-space: nowrap;
font-size: 0.4rem;
margin-right: 0.2rem;
font-size: 0.4rem;
margin-right: 0.2rem;
max-width: 7rem;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
.label-content {
position: relative;
}
.lable-father {
position: absolute;
min-width: 3.5rem;
right: -3.5rem;
top: 0;
}
.label {
padding: 0.01rem 0.1rem;
margin-right: 0.1rem;
border-radius: 0.13rem;
background: rgba(255, 255, 255, 0.4);
}
}
.main {
margin-top: 0.2rem;
font-size: 0.18rem;
line-height: 0.34rem;
& > div:nth-of-type(1) {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
& > div:nth-of-type(2) {
max-height: 1rem;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
}
}
.bottom {
margin-top: 0.4rem;
display: flex;
.ant-btn {
height: 0.5rem;
margin-right: 0.2rem;
background: #ff8b55;
border-radius: 0.06rem;
font-size: 0.2rem;
display: flex;
justify-content: center;
align-items: center;
}
.ant-btn:nth-of-type(1) {
width: 1.8rem;
}
.ant-btn:nth-of-type(2) {
width: 2.2rem;
}
.ant-btn:nth-of-type(3) {
width: 1.45rem;
background: #fff;
color: #526aff;
}
}
}
.right {
width: 5.8rem;
height: 4rem;
background: url('~@/assets/detailsAll/sf_right_bg.png') no-repeat;
background-size: 100%;
margin-top: -0.4rem;
}
} }
}
</style> </style>

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-05 11:42:27 * @LastEditTime: 2022-07-15 17:31:32
* @Description: 算法详情页头部 * @Description: 算法详情页头部
--> -->
<template> <template>
@ -62,7 +62,9 @@
</template> </template>
加入申购车 加入申购车
</a-button> </a-button>
<a-button type="primary" @click="goTOCollection()">收藏</a-button> <a-button type="primary" @click="goTOCollection()">
{{ scFlag ? '已' : '' }}收藏
</a-button>
</div> </div>
</div> </div>
<div class="right"></div> <div class="right"></div>
@ -71,7 +73,7 @@
<script setup> <script setup>
import { ShoppingCartOutlined } from '@ant-design/icons-vue' import { ShoppingCartOutlined } from '@ant-design/icons-vue'
import { defineProps, ref, watch } from 'vue' import { defineProps, ref, watch } from 'vue'
import { scInsert } from '@/api/personalCenter' import { scInsert, scDel } from '@/api/personalCenter'
import { sgcInsert } from '@/api/home' import { sgcInsert } from '@/api/home'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import mybus from '@/myplugins/mybus' import mybus from '@/myplugins/mybus'
@ -125,12 +127,38 @@
}) })
} }
// //
const scFlag = ref(props.dataList.isCollect)
const scFlag2 = ref(true)
const goTOCollection = () => { const goTOCollection = () => {
console.log('收藏===================》', props.dataList) console.log('收藏===================》', props.dataList)
scInsert([{ resourceId: props.dataList.id }]).then((res) => { if (scFlag2.value) {
console.log(res) scFlag2.value = false
message.success('收藏成功') 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) {
businessArea.value = props.dataList.infoList.filter( businessArea.value = props.dataList.infoList.filter(

View File

@ -138,10 +138,12 @@
flag.value = false flag.value = false
} else { } else {
// eslint-disable-next-line vue/no-setup-props-destructure // eslint-disable-next-line vue/no-setup-props-destructure
dataFrom.value.content[0].link.value = props.dataList.apiUrl dataFrom.value.content[0].link.value = props.dataList.apiUrl || '--'
dataFrom.value.content[0].facilitator.value = props.dataList.deptName dataFrom.value.content[0].facilitator.value =
dataFrom.value.content[0].people.value = props.dataList.deptContacts props.dataList.deptName || '--'
dataFrom.value.content[0].phone.value = props.dataList.deptPhone dataFrom.value.content[0].people.value =
props.dataList.deptContacts || '--'
dataFrom.value.content[0].phone.value = props.dataList.deptPhone || '--'
console.log('dataList', props.dataList) console.log('dataList', props.dataList)
props.dataList.infoList.map((item) => { props.dataList.infoList.map((item) => {
if (item.attrType === '组件地址') { if (item.attrType === '组件地址') {
@ -173,10 +175,10 @@
if (!obj) { if (!obj) {
flag.value = false flag.value = false
} else { } else {
dataFrom.value.content[0].link.value = val.apiUrl dataFrom.value.content[0].link.value = val.apiUrl || '--'
dataFrom.value.content[0].facilitator.value = val.deptName dataFrom.value.content[0].facilitator.value = val.deptName || '--'
dataFrom.value.content[0].people.value = val.deptContacts dataFrom.value.content[0].people.value = val.deptContacts || '--'
dataFrom.value.content[0].phone.value = val.deptPhone dataFrom.value.content[0].phone.value = val.deptPhone || '--'
console.log('dataList', val) console.log('dataList', val)
val.infoList.map((item) => { val.infoList.map((item) => {
if (item.attrType === '组件地址') { if (item.attrType === '组件地址') {

View File

@ -103,23 +103,23 @@
flag.value = false flag.value = false
} else { } else {
dataFrom.value.content[0].childrenContent[1].attrValue = dataFrom.value.content[0].childrenContent[1].attrValue =
props.dataList.deptContacts props.dataList.deptContacts || '--'
dataFrom.value.content[0].childrenContent[2].attrValue = dataFrom.value.content[0].childrenContent[2].attrValue =
props.dataList.deptPhone props.dataList.deptPhone || '--'
dataFrom.value.content[0].childrenContent[0].attrValue = dataFrom.value.content[0].childrenContent[0].attrValue =
props.dataList.deptName props.dataList.deptName || '--'
props.dataList.infoList.map((item) => { props.dataList.infoList.map((item) => {
if (item.attrType == '组件地址') { if (item.attrType == '组件地址') {
dataFrom.value.link = item.attrValue dataFrom.value.link = item.attrValue
} else if (item.attrType == '服务商联系人') { } else if (item.attrType == '服务商联系人') {
dataFrom.value.content[1].childrenContent[1].attrValue = dataFrom.value.content[1].childrenContent[1].attrValue =
item.attrValue item.attrValue || '--'
} else if (item.attrType == '服务商联系电话') { } else if (item.attrType == '服务商联系电话') {
dataFrom.value.content[1].childrenContent[2].attrValue = dataFrom.value.content[1].childrenContent[2].attrValue =
item.attrValue item.attrValue || '--'
} else if (item.attrType == '服务商' || item.attrType == '服务商名') { } else if (item.attrType == '服务商' || item.attrType == '服务商名') {
dataFrom.value.content[1].childrenContent[0].attrValue = dataFrom.value.content[1].childrenContent[0].attrValue =
item.attrValue item.attrValue || '--'
} }
}) })
} }
@ -165,26 +165,26 @@
flag.value = false flag.value = false
} else { } else {
dataFrom.value.content[0].childrenContent[1].attrValue = dataFrom.value.content[0].childrenContent[1].attrValue =
props.dataList.deptContacts props.dataList.deptContacts || '--'
dataFrom.value.content[0].childrenContent[2].attrValue = dataFrom.value.content[0].childrenContent[2].attrValue =
props.dataList.deptPhone props.dataList.deptPhone || '--'
dataFrom.value.content[0].childrenContent[0].attrValue = dataFrom.value.content[0].childrenContent[0].attrValue =
props.dataList.deptName props.dataList.deptName || '--'
props.dataList.infoList.map((item) => { props.dataList.infoList.map((item) => {
if (item.attrType == '组件地址') { if (item.attrType == '组件地址') {
dataFrom.value.link = item.attrValue dataFrom.value.link = item.attrValue
} else if (item.attrType == '服务商联系人') { } else if (item.attrType == '服务商联系人') {
dataFrom.value.content[1].childrenContent[1].attrValue = dataFrom.value.content[1].childrenContent[1].attrValue =
item.attrValue item.attrValue || '--'
} else if (item.attrType == '服务商联系电话') { } else if (item.attrType == '服务商联系电话') {
dataFrom.value.content[1].childrenContent[2].attrValue = dataFrom.value.content[1].childrenContent[2].attrValue =
item.attrValue item.attrValue || '--'
} else if ( } else if (
item.attrType == '服务商' || item.attrType == '服务商' ||
item.attrType == '服务商名' item.attrType == '服务商名'
) { ) {
dataFrom.value.content[1].childrenContent[0].attrValue = dataFrom.value.content[1].childrenContent[0].attrValue =
item.attrValue item.attrValue || '--'
} }
}) })
} }

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-05 11:42:59 * @LastEditTime: 2022-07-15 17:32:08
* @Description: 开发组件详情页头部 * @Description: 开发组件详情页头部
--> -->
<template> <template>
@ -58,7 +58,9 @@
<template #icon><shopping-cart-outlined /></template> <template #icon><shopping-cart-outlined /></template>
加入购物车 加入购物车
</a-button> </a-button>
<a-button type="primary" @click="goTOCollection()">收藏</a-button> <a-button type="primary" @click="goTOCollection()">
{{ scFlag ? '已' : '' }}收藏
</a-button>
</div> </div>
</div> </div>
<div class="right"></div> <div class="right"></div>
@ -67,7 +69,7 @@
<script setup> <script setup>
import { FormOutlined, ShoppingCartOutlined } from '@ant-design/icons-vue' import { FormOutlined, ShoppingCartOutlined } from '@ant-design/icons-vue'
import { defineProps, ref, watch } from 'vue' import { defineProps, ref, watch } from 'vue'
import { scInsert } from '@/api/personalCenter' import { scInsert, scDel } from '@/api/personalCenter'
import { sgcInsert } from '@/api/home' import { sgcInsert } from '@/api/home'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import mybus from '@/myplugins/mybus' import mybus from '@/myplugins/mybus'
@ -120,12 +122,38 @@
}) })
} }
// //
const scFlag = ref(props.dataList.isCollect)
const scFlag2 = ref(true)
const goTOCollection = () => { const goTOCollection = () => {
console.log('收藏===================》', props.dataList) console.log('收藏===================》', props.dataList)
scInsert([{ resourceId: props.dataList.id }]).then((res) => { if (scFlag2.value) {
console.log(res) scFlag2.value = false
message.success('收藏成功') 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('')
// })
} }
const componentType = ref('') const componentType = ref('')
if (props.dataList.infoList) { if (props.dataList.infoList) {

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-05 11:43:18 * @LastEditTime: 2022-07-15 17:32:31
* @Description: 算法详情页头部 * @Description: 算法详情页头部
--> -->
<template> <template>
@ -58,7 +58,9 @@
<template #icon><shopping-cart-outlined /></template> <template #icon><shopping-cart-outlined /></template>
加入申购车 加入申购车
</a-button> </a-button>
<a-button type="primary" @click="goTOCollection()">收藏</a-button> <a-button type="primary" @click="goTOCollection()">
{{ scFlag ? '已' : '' }}收藏
</a-button>
</div> </div>
</div> </div>
<div class="right"></div> <div class="right"></div>
@ -67,7 +69,7 @@
<script setup> <script setup>
import { FormOutlined, ShoppingCartOutlined } from '@ant-design/icons-vue' import { FormOutlined, ShoppingCartOutlined } from '@ant-design/icons-vue'
import { defineProps, ref, watch } from 'vue' import { defineProps, ref, watch } from 'vue'
import { scInsert } from '@/api/personalCenter' import { scInsert, scDel } from '@/api/personalCenter'
import { sgcInsert } from '@/api/home' import { sgcInsert } from '@/api/home'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import mybus from '@/myplugins/mybus' import mybus from '@/myplugins/mybus'
@ -120,12 +122,38 @@
}) })
} }
// //
const scFlag = ref(props.dataList.isCollect)
const scFlag2 = ref(true)
const goTOCollection = () => { const goTOCollection = () => {
console.log('收藏===================》', props.dataList) console.log('收藏===================》', props.dataList)
scInsert([{ resourceId: props.dataList.id }]).then((res) => { if (scFlag2.value) {
console.log(res) scFlag2.value = false
message.success('收藏成功') 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('')
// })
} }
const componentType = ref('') const componentType = ref('')
if (props.dataList.infoList) { if (props.dataList.infoList) {

View File

@ -142,10 +142,12 @@
flag.value = false flag.value = false
} else { } else {
// eslint-disable-next-line vue/no-setup-props-destructure // eslint-disable-next-line vue/no-setup-props-destructure
dataFrom.value.content[0].link.value = props.dataList.apiUrl dataFrom.value.content[0].link.value = props.dataList.apiUrl || '--'
dataFrom.value.content[0].facilitator.value = props.dataList.deptName dataFrom.value.content[0].facilitator.value =
dataFrom.value.content[0].people.value = props.dataList.deptContacts props.dataList.deptName || '--'
dataFrom.value.content[0].phone.value = props.dataList.deptPhone dataFrom.value.content[0].people.value =
props.dataList.deptContacts || '--'
dataFrom.value.content[0].phone.value = props.dataList.deptPhone || '--'
console.log('dataList', props.dataList) console.log('dataList', props.dataList)
props.dataList.infoList.map((item) => { props.dataList.infoList.map((item) => {
if (item.attrType === '服务地址') { if (item.attrType === '服务地址') {
@ -179,10 +181,10 @@
if (!obj) { if (!obj) {
flag.value = false flag.value = false
} else { } else {
dataFrom.value.content[0].link.value = val.apiUrl dataFrom.value.content[0].link.value = val.apiUrl || '--'
dataFrom.value.content[0].facilitator.value = val.deptName dataFrom.value.content[0].facilitator.value = val.deptName || '--'
dataFrom.value.content[0].people.value = val.deptContacts dataFrom.value.content[0].people.value = val.deptContacts || '--'
dataFrom.value.content[0].phone.value = val.deptPhone dataFrom.value.content[0].phone.value = val.deptPhone || '--'
console.log('dataList', val) console.log('dataList', val)
val.infoList.map((item) => { val.infoList.map((item) => {
if (item.attrType === '服务地址') { if (item.attrType === '服务地址') {

View File

@ -136,7 +136,7 @@
</div> </div>
</div> </div>
<div class="dec"> <div class="dec">
<div <!-- <div
v-if=" v-if="
selectCardsname !== '基础设施' && selectCardsname !== '基础设施' &&
selectCardsname !== '数据资源' && selectCardsname !== '数据资源' &&
@ -144,49 +144,54 @@
" "
> >
<span>{{ item.shareType || '--' }}</span> <span>{{ item.shareType || '--' }}</span>
</div> </div> -->
<div v-if="selectCardsname !== '融合服务'"> <div v-if="selectCardsname !== '融合服务'">
<span>{{ item.deptName || '--' }}</span> <span>{{ item.deptName || '--' }}</span>
</div> </div>
<div v-if="selectCardsname !== '基础设施'">
<a-tooltip>
<template #title>{{ item.description }}</template>
{{ item.description || '--' }}
</a-tooltip>
</div>
</div> </div>
<div class="bottom" v-if="selectCardsname !== '基础设施'"> <div
<div> v-if="selectCardsname !== '基础设施'"
<div style="margin-top: 0.1rem"
v-if=" class="description"
selectCardsname !== '数据资源' && >
selectCardsname !== '融合服务' <a-tooltip>
" <template #title>{{ item.description }}</template>
> {{ item.description || '--' }}
浏览量{{ item.visits || 0 }} </a-tooltip>
</div>
<div class="btn">
<div class="bottom" v-if="selectCardsname !== '基础设施'">
<div>
<div
v-if="
selectCardsname !== '数据资源' &&
selectCardsname !== '融合服务'
"
>
浏览量{{ item.visits || 0 }}
</div>
<div
v-if="
selectCardsname !== '应用资源' &&
selectCardsname !== '数据资源' &&
selectCardsname !== '融合服务'
"
>
申请量{{ item.applyCount || 0 }}
</div>
<div
v-if="
selectCardsname === '数据资源' &&
selectCardsname !== '融合服务'
"
>
数据量{{ item.sjlCount || 0 }}
</div>
<div v-if="selectCardsname !== '数据资源'">
收藏量{{ item.collectCount || 0 }}
</div>
</div> </div>
<div <!-- <div class="pingfen">
v-if="
selectCardsname !== '应用资源' &&
selectCardsname !== '数据资源' &&
selectCardsname !== '融合服务'
"
>
申请量{{ item.applyCount || 0 }}
</div>
<div
v-if="
selectCardsname === '数据资源' &&
selectCardsname !== '融合服务'
"
>
数据量{{ item.sjlCount || 0 }}
</div>
<div v-if="selectCardsname !== '数据资源'">
收藏量{{ item.collectCount || 0 }}
</div>
</div>
<!-- <div class="pingfen">
<a-tooltip placement="top" mouseEnterDelay="1"> <a-tooltip placement="top" mouseEnterDelay="1">
<a-rate <a-rate
:value="item.score || 0" :value="item.score || 0"
@ -195,8 +200,7 @@
/> />
</a-tooltip> </a-tooltip>
</div> --> </div> -->
</div> </div>
<div class="btn">
<div class="right" v-if="selectCardsname !== '基础设施'"> <div class="right" v-if="selectCardsname !== '基础设施'">
<div class="shopping" :key="shoppingKey"> <div class="shopping" :key="shoppingKey">
<template v-if="selectCardsname == '组件服务'"> <template v-if="selectCardsname == '组件服务'">
@ -916,7 +920,7 @@
padding-left: 10px; padding-left: 10px;
padding-right: 10px; padding-right: 10px;
} }
div:nth-child(3) { div:nth-child(2) {
max-width: 200px; max-width: 200px;
display: -webkit-box; display: -webkit-box;
/*设置为弹性盒子*/ /*设置为弹性盒子*/
@ -1049,4 +1053,18 @@
} }
} }
} }
.description {
max-width: 990px;
height: 52px;
font-size: 14px;
line-height: 18px;
display: -webkit-box;
-webkit-line-clamp: 3;
/*最多显示3行*/
overflow: hidden;
/*超出隐藏*/
text-overflow: ellipsis;
/*超出显示为省略号*/
-webkit-box-orient: vertical;
}
</style> </style>