Compare commits

...

2 Commits

Author SHA1 Message Date
a0049873 a2a4a5d92c Merge branch 'hi-ucs-dev' of http://15.2.21.221:3000/wuhongjian/hi-ucs into hi-ucs-dev 2022-07-04 11:56:52 +08:00
a0049873 5ffeb562da BUG修改 2022-07-04 11:56:45 +08:00
4 changed files with 169 additions and 122 deletions

View File

@ -1,8 +1,8 @@
<!-- <!--
* @Author: hisense.liangjunhua * @Author: hisense.liangjunhua
* @Date: 2022-06-08 14:54:01 * @Date: 2022-06-08 14:54:01
* @LastEditors: hisense.wuhongjian * @LastEditors: hisense.liangjunhua
* @LastEditTime: 2022-06-30 17:09:40 * @LastEditTime: 2022-07-04 10:08:10
* @Description: 算法详情页导航 * @Description: 算法详情页导航
--> -->
<template> <template>
@ -65,19 +65,21 @@
]) ])
const list = ref([]) const list = ref([])
// id // id
queryPartAppByKeyId2({ keyId: keyId }).then((res) => { if (keyId) {
console.log('ressssssss', res) queryPartAppByKeyId2({ keyId: keyId }).then((res) => {
if (res.data.data.length > 0) { console.log('ressssssss', res)
// if (res.data.data.length > 0) {
navList.value.unshift({ //
name: '关联应用', navList.value.unshift({
key: 'algorithm-associated-ability', name: '关联应用',
show: true, key: 'algorithm-associated-ability',
}) show: true,
// list.value.push('') })
console.log('navList', navList) // list.value.push('')
} console.log('navList', navList)
}) }
})
}
const props = defineProps({ const props = defineProps({
selectNow: { type: String, default: '' }, selectNow: { type: String, default: '' },
dataList: { type: Object, default: null }, dataList: { type: Object, default: null },

View File

@ -1,6 +1,10 @@
<template> <template>
<div class="ability-to-apply-for"> <div class="ability-to-apply-for" :class="{ all: falg }">
<div class="title">申请能力</div> <div class="title">
<span>申请能力</span>
<span class="btn" @click="falg = !falg" v-show="!falg">展开</span>
<span class="btn" @click="falg = !falg" v-show="falg">收起</span>
</div>
<div <div
v-for="(item, index) in dataForm" v-for="(item, index) in dataForm"
:key="index" :key="index"
@ -12,20 +16,38 @@
</div> </div>
<template v-for="val in item.arr" :key="val.resourceId"> <template v-for="val in item.arr" :key="val.resourceId">
<div class="item"> <div class="item">
<div class="name"> <div
<span>{{ val.resourceName }}</span> class="tx"
<span>{{ val.type }}</span> :class="
</div> val.type == '基础设施'
<div class="description"> ? 'sxt'
{{ : val.componentType == '智能算法'
val.description || ? 'znsf'
(val.note1 && : val.componentType == '图层服务'
JSON.parse(val.note1)[0].channelName + ? 'tcfw'
'等' + : val.componentType == '开发组件'
JSON.parse(val.note1).length + ? 'kfzj'
'个摄像头') || : val.componentType == '业务组件'
'--' ? 'ywzj'
}} : ''
"
></div>
<div class="text">
<div class="name">
<span>{{ val.resourceName }}</span>
<span>{{ val.type }}</span>
</div>
<div class="description">
{{
val.description ||
(val.note1 &&
JSON.parse(val.note1)[0].channelName +
'等' +
JSON.parse(val.note1).length +
'个摄像头') ||
'--'
}}
</div>
</div> </div>
<div class="remove" @click="removeFunction(val)"></div> <div class="remove" @click="removeFunction(val)"></div>
</div> </div>
@ -35,27 +57,29 @@
</template> </template>
<script setup> <script setup>
import { useRouter } from 'vue-router' // import { useRouter } from 'vue-router'
import { message } from 'ant-design-vue' import { message } from 'ant-design-vue'
import { ref, defineProps } from 'vue' import { ref, defineProps } from 'vue'
import mybus from '@/myplugins/mybus' // import mybus from '@/myplugins/mybus'
const props = defineProps({ const props = defineProps({
dataList: { type: Array, default: null }, dataList: { type: Array, default: null },
}) })
const falg = ref(false)
let dataForm = ref([]) let dataForm = ref([])
// eslint-disable-next-line vue/no-setup-props-destructure // eslint-disable-next-line vue/no-setup-props-destructure
dataForm.value = props.dataList dataForm.value = props.dataList
const router = useRouter() console.log(dataForm.value)
const arr = // const router = useRouter()
router.currentRoute.value.query.name instanceof Array // const arr =
? router.currentRoute.value.query.name // router.currentRoute.value.query.name instanceof Array
: [router.currentRoute.value.query.name] // ? router.currentRoute.value.query.name
const dataResourceId = router.currentRoute.value.query.resourceId // : [router.currentRoute.value.query.name]
// const dataResourceId = router.currentRoute.value.query.resourceId
const depList = ref({ // const depList = ref({
Name: [], // Name: [],
depID: [], // depID: [],
}) // })
// //
const removeFunction = (data) => { const removeFunction = (data) => {
dataForm.value.map((val) => { dataForm.value.map((val) => {
@ -71,25 +95,26 @@
<style scoped lang="less"> <style scoped lang="less">
.ability-to-apply-for { .ability-to-apply-for {
height: 290px;
overflow: hidden;
.title { .title {
font-size: 0.16rem; font-size: 0.16rem;
color: #212121; color: #212121;
border-bottom: 0.01rem #dddee1 solid; border-bottom: 0.01rem #dddee1 solid;
padding-bottom: 0.1rem; padding-bottom: 0.1rem;
margin-bottom: 0.2rem; margin-bottom: 0.2rem;
display: flex;
justify-content: space-between;
} }
.ability-to-apply-for-content { .ability-to-apply-for-content {
// margin-bottom: 0.3rem;
// border-bottom: 0.01rem #dddee1 solid;
// padding-bottom: 0.3rem;
padding-right: 0.5rem; padding-right: 0.5rem;
position: relative; position: relative;
.dep-name { .dep-name {
color: #0558e1; color: #0558e1;
font-size: 0.18rem; font-size: 0.22rem;
display: flex; display: flex;
align-items: center; align-items: center;
line-height: 0.18rem; line-height: 0.22rem;
margin-bottom: 0.2rem; margin-bottom: 0.2rem;
span { span {
display: inline-block; display: inline-block;
@ -104,14 +129,19 @@
padding-bottom: 0.1rem; padding-bottom: 0.1rem;
margin-bottom: 0.1rem; margin-bottom: 0.1rem;
border-bottom: 1px solid #dddee1; border-bottom: 1px solid #dddee1;
position: relative; display: flex;
align-items: center;
.text {
margin-left: 0.2rem;
width: 8.8rem;
}
} }
.name { .name {
margin-bottom: 0.2rem; margin-bottom: 0.2rem;
span:first-child { span:first-child {
display: inline-block; display: inline-block;
margin-right: 0.08rem; margin-right: 0.08rem;
font-size: 0.2rem; font-size: 0.18rem;
color: #000000; color: #000000;
} }
span:last-child { span:last-child {
@ -122,16 +152,13 @@
} }
} }
.description { .description {
width: 10rem; width: 8.8rem;
color: rgba(0, 0, 0, 0.45); color: rgba(0, 0, 0, 0.45);
} }
.remove { .remove {
margin-left: 0.1rem;
width: 0.32rem; width: 0.32rem;
height: 0.32rem; height: 0.32rem;
position: absolute;
right: 0;
top: 50%;
margin-top: -0.16rem;
background: url('~@/assets/home/remove.png') no-repeat; background: url('~@/assets/home/remove.png') no-repeat;
background-size: cover; background-size: cover;
cursor: pointer; cursor: pointer;
@ -142,4 +169,36 @@
} }
} }
} }
.all {
height: unset;
}
.btn {
cursor: pointer;
}
.tx {
display: inline-block;
width: 0.8rem;
height: 0.8rem;
margin-left: 0.1rem;
}
.sxt {
background: url('~@/assets/home/sxt_square.png') no-repeat;
background-size: 100%;
}
.znsf {
background: url('~@/assets/home/znsf_square.png') no-repeat;
background-size: 100%;
}
.tcfw {
background: url('~@/assets/home/tcfw_square.png') no-repeat;
background-size: 100%;
}
.kfzj {
background: url('~@/assets/home/kfzj_square.png') no-repeat;
background-size: 100%;
}
.ywzj {
background: url('~@/assets/home/ywzj_square.png') no-repeat;
background-size: 100%;
}
</style> </style>

View File

@ -118,9 +118,10 @@
name="applicationBackground" name="applicationBackground"
:rules="[{ required: true, message: '请输入应用背景' }]" :rules="[{ required: true, message: '请输入应用背景' }]"
> >
<a-input <a-textarea
placeholder="请输入应用背景" placeholder="请输入应用背景"
v-model:value="formName.applicationBackground" v-model:value="formName.applicationBackground"
:rows="4"
/> />
</a-form-item> </a-form-item>
</div> </div>
@ -130,9 +131,10 @@
name="effectWish" name="effectWish"
:rules="[{ required: true, message: '请输入期望效果' }]" :rules="[{ required: true, message: '请输入期望效果' }]"
> >
<a-input <a-textarea
placeholder="请输入期望效果" placeholder="请输入期望效果"
v-model:value="formName.effectWish" v-model:value="formName.effectWish"
:rows="4"
/> />
</a-form-item> </a-form-item>
</div> </div>
@ -173,7 +175,7 @@
</a-upload> </a-upload>
</a-form-item> </a-form-item>
<a-form-item :wrapper-col="{ offset: 8, span: 16 }"> <div class="bottom-btn">
<a-button <a-button
style=" style="
width: 80px; width: 80px;
@ -211,7 +213,7 @@
> >
提交申请 提交申请
</a-button> </a-button>
</a-form-item> </div>
</a-form> </a-form>
</div> </div>
<div class="success" v-else> <div class="success" v-else>
@ -504,6 +506,7 @@
}, },
]) ])
const systemOptions = ref([]) const systemOptions = ref([])
const systemOptions2 = ref([])
const handleChange = (info) => { const handleChange = (info) => {
if (info.file.status !== 'uploading') { if (info.file.status !== 'uploading') {
@ -536,83 +539,50 @@
return isPNG || Upload.LIST_IGNORE return isPNG || Upload.LIST_IGNORE
} }
const fileList = ref([]) const fileList = ref([])
//arr
// mybus.on('reomveOldData', (item) => {
// debugger
// arr = []
// formName.system = []
// record.value = record.value + '1'
// arr = item.Name
// // dataResourceId = item.depID
// if (arr && arr.length !== 0) {
// disabled.value = true
// let str = ''
// arr.forEach((val, index) => {
// str += val
// if (index < arr.length - 1) {
// str += ''
// }
// })
// formName.formNameSystem = str
// }
// arr.forEach((val, index) => {
// formName.system.push({
// resourceName: val,
// // resourceId: dataResourceId[index],
// })
// })
// })
// //
const flag = ref(true)
const systemHandleChange = (value) => { const systemHandleChange = (value) => {
console.log(`selected ${value}`) console.log(`selected ${value}`)
} }
const systemHandleSearch = (value) => { const systemHandleSearch = (value) => {
console.log(`search ${value}`) console.log(`search ${value}`)
text.value = value text.value = value
systemOptions.value = [] systemOptions.value = systemOptions2.value.filter(
window.setTimeout(() => { (item) => item.label.search(text.value) > -1
if (flag.value && text.value == value && text.value !== '') { )
console.log('1秒未输入~~~~~~~~~~~~~~~~~~~~~~~~~~')
pageWithAttrs({
pageNum: 99999,
pageSize: 5,
type: '应用资源',
name: text.value,
infoList: [],
}).then((res) => {
if (res.data.code == 0) {
if (res.data.data.records.length == 0) {
message.warning('该关键词,暂无应用资源!')
} else {
res.data.data.records.map((val) => {
systemOptions.value.push({
value: val.name,
label: val.name,
})
})
console.log(
'第一次获取===================>',
systemOptions.value
)
}
} else {
message.error('获取数据失败!')
}
})
}
}, 2000)
} }
pageWithAttrs({
pageNum: 1,
pageSize: 99999,
type: '应用资源',
name: '',
infoList: [],
}).then((res) => {
if (res.data.code == 0) {
if (res.data.data.records.length == 0) {
message.warning('该关键词,暂无应用资源!')
} else {
res.data.data.records.map((val) => {
systemOptions2.value.push({
value: val.name,
label: val.name,
})
})
// console.log('===================>', systemOptions2.value)
}
} else {
message.error('应用系统获取数据失败!')
}
})
const handleBlur = () => { const handleBlur = () => {
console.log('blur') console.log('blur')
flag.value = false
} }
const handleFocus = () => { const handleFocus = () => {
console.log('focus') console.log('focus')
flag.value = true // console.log(formName.applicationSystem)
systemOptions.value = [] // formName.applicationSystem = []
systemOptions.value = systemOptions2.value
// systemOptions.value = []
} }
// const filterOption = (input, option) => { // const filterOption = (input, option) => {
@ -727,4 +697,17 @@
flex-wrap: nowrap; flex-wrap: nowrap;
} }
} }
textarea {
resize: none;
font-size: 14px;
}
.bottom-btn {
display: flex;
justify-content: center;
// position: fixed;
}
:deep(.ant-form-item-control-input-content) {
display: flex;
justify-content: space-around;
}
</style> </style>

View File

@ -437,6 +437,9 @@
resourceName: item.name, resourceName: item.name,
time: item.createDate, time: item.createDate,
type: item.type, type: item.type,
componentType: item.infoList.filter(
(val) => val.attrType == '组件类型'
)[0].attrValue,
}, },
], ],
deptId: item.deptId, deptId: item.deptId,