前台-上架联动

This commit is contained in:
gaoyuanwei 2022-07-15 17:22:48 +08:00
parent 3acee93e23
commit 5978bc1859
5 changed files with 574 additions and 439 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

@ -2,7 +2,7 @@
* @Author: hisense.liangjunhua * @Author: hisense.liangjunhua
* @Date: 2022-06-13 10:22:27 * @Date: 2022-06-13 10:22:27
* @LastEditors: hisense.liangjunhua * @LastEditors: hisense.liangjunhua
* @LastEditTime: 2022-07-15 11:50:22 * @LastEditTime: 2022-07-15 11:31:36
* @Description: 算法上架 * @Description: 算法上架
--> -->
<template> <template>
@ -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"
@ -196,6 +197,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({})
@ -306,6 +308,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(
@ -338,6 +352,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
}) })

View File

@ -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"
@ -296,6 +336,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 },
// //
@ -588,6 +630,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) => {

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)
} }

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,6 +308,19 @@
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>
@ -282,6 +346,7 @@
box-shadow: 0rem 0.05rem 0.15rem rgba(82, 106, 255, 0.4); box-shadow: 0rem 0.05rem 0.15rem rgba(82, 106, 255, 0.4);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between;
padding: 0 0.35rem; padding: 0 0.35rem;
.left { .left {