新增能力集市 和详情页申请功能 摄像头申请功能完善

This commit is contained in:
a0049873 2022-07-01 14:31:46 +08:00
parent 91c7e6c904
commit 4f11e078b8
8 changed files with 229 additions and 116 deletions

View File

@ -2,7 +2,7 @@
* @Author: hisense.liangjunhua
* @Date: 2022-06-08 11:56:28
* @LastEditors: hisense.liangjunhua
* @LastEditTime: 2022-06-13 15:29:27
* @LastEditTime: 2022-07-01 14:16:18
* @Description: 算法详情页头部
-->
<template>
@ -77,12 +77,28 @@
//
function toView() {
// window.open(newpage.href, '_blank')
console.log('一键申请===================>', props.dataList)
localStorage.setItem(
'applyList',
JSON.stringify([
{
arr: [
{
delFlag: props.dataList.delFlag,
description: props.dataList.description,
resourceId: props.dataList.id,
resourceName: props.dataList.name,
time: props.dataList.createDate,
type: props.dataList.type,
},
],
deptId: props.dataList.deptId,
deptName: props.dataList.deptName,
},
])
)
router.push({
path: '/apply',
query: {
name: props.dataList.name,
resourceId: [props.dataList.id],
},
})
}
const componentType = ref('')

View File

@ -2,7 +2,7 @@
* @Author: hisense.liangjunhua
* @Date: 2022-06-08 11:56:28
* @LastEditors: hisense.liangjunhua
* @LastEditTime: 2022-06-14 11:31:12
* @LastEditTime: 2022-07-01 14:20:52
* @Description: 算法详情页头部
-->
<template>
@ -35,14 +35,14 @@
</div>
</div>
<div class="bottom" v-if="props.dataList.id">
<!-- <a-button type="primary" @click="toView()">
<a-button type="primary" @click="toView()">
<template #icon><form-outlined /></template>
申请使用
</a-button>
<a-button type="primary" @click="addShoppingCart()">
<template #icon><shopping-cart-outlined /></template>
加入申购车
</a-button> -->
</a-button>
<a-button type="primary" @click="goTOCollection()">收藏</a-button>
</div>
</div>
@ -50,42 +50,58 @@
</div>
</template>
<script setup>
// import { ShoppingCartOutlined } from '@ant-design/icons-vue'
import { ShoppingCartOutlined } from '@ant-design/icons-vue'
import { defineProps, ref, watch } from 'vue'
import { scInsert } from '@/api/personalCenter'
// import { sgcInsert } from '@/api/home'
// import { useRouter } from 'vue-router'
// import mybus from '@/myplugins/mybus'
import { sgcInsert } from '@/api/home'
import { useRouter } from 'vue-router'
import mybus from '@/myplugins/mybus'
import { message } from 'ant-design-vue'
const props = defineProps({
dataList: { type: Object, default: null },
})
// const router = useRouter()
const router = useRouter()
const businessArea = 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')
// })
// }
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],
// },
// })
// }
function toView() {
// window.open(newpage.href, '_blank')
console.log('一键申请===================>', props.dataList)
localStorage.setItem(
'applyList',
JSON.stringify([
{
arr: [
{
delFlag: props.dataList.delFlag,
description: props.dataList.description,
resourceId: props.dataList.id,
resourceName: props.dataList.name,
time: props.dataList.createDate,
type: props.dataList.type,
},
],
deptId: props.dataList.deptId,
deptName: props.dataList.deptName,
},
])
)
router.push({
path: '/apply',
})
}
//
const goTOCollection = () => {
console.log('收藏===================》', props.dataList)

View File

@ -2,7 +2,7 @@
* @Author: hisense.liangjunhua
* @Date: 2022-06-08 11:56:28
* @LastEditors: hisense.liangjunhua
* @LastEditTime: 2022-06-14 11:31:12
* @LastEditTime: 2022-07-01 14:21:04
* @Description: 开发组件详情页头部
-->
<template>
@ -77,12 +77,28 @@
//
function toView() {
// window.open(newpage.href, '_blank')
console.log('一键申请===================>', props.dataList)
localStorage.setItem(
'applyList',
JSON.stringify([
{
arr: [
{
delFlag: props.dataList.delFlag,
description: props.dataList.description,
resourceId: props.dataList.id,
resourceName: props.dataList.name,
time: props.dataList.createDate,
type: props.dataList.type,
},
],
deptId: props.dataList.deptId,
deptName: props.dataList.deptName,
},
])
)
router.push({
path: '/apply',
query: {
name: props.dataList.name,
resourceId: [props.dataList.id],
},
})
}
//

View File

@ -2,7 +2,7 @@
* @Author: hisense.liangjunhua
* @Date: 2022-06-08 11:56:28
* @LastEditors: hisense.liangjunhua
* @LastEditTime: 2022-06-14 11:31:12
* @LastEditTime: 2022-07-01 14:21:10
* @Description: 算法详情页头部
-->
<template>
@ -78,12 +78,28 @@
//
function toView() {
// window.open(newpage.href, '_blank')
console.log('一键申请===================>', props.dataList)
localStorage.setItem(
'applyList',
JSON.stringify([
{
arr: [
{
delFlag: props.dataList.delFlag,
description: props.dataList.description,
resourceId: props.dataList.id,
resourceName: props.dataList.name,
time: props.dataList.createDate,
type: props.dataList.type,
},
],
deptId: props.dataList.deptId,
deptName: props.dataList.deptName,
},
])
)
router.push({
path: '/apply',
query: {
name: props.dataList.name,
resourceId: [props.dataList.id],
},
})
}
//

View File

@ -387,7 +387,9 @@
resourceName: item.resourceName,
})
console.log(item.id)
if (item.id) {
ids.push(item.id)
}
} else {
let obj = {}
Object.assign(obj, formName)

View File

@ -182,21 +182,15 @@
>
免费试用
</a-button> -->
<!-- <a-button
<a-button
type="primary"
@click="toView('apply', item)"
v-show="
cardType !== '数据资源' &&
!(
cardType == '组件服务' &&
findComponentName(item, '智能算法')
)
"
v-show="cardType == '组件服务'"
>
{{
item.shareCondition == '免批申请' ? '免批申请' : '立即申请'
}}
</a-button> -->
</a-button>
</div>
<div class="right" v-else>
<a-button type="primary" @click="openVideo(item)">
@ -382,13 +376,28 @@
)
} else {
if (type === 'apply') {
// window.open(newpage.href, '_blank')
console.log('一键申请===================>', item)
localStorage.setItem(
'applyList',
JSON.stringify([
{
arr: [
{
delFlag: item.delFlag,
description: item.description,
resourceId: item.id,
resourceName: item.name,
time: item.createDate,
type: item.type,
},
],
deptId: item.deptId,
deptName: item.deptName,
},
])
)
router.push({
path: '/apply',
query: {
name: [item.name],
resourceId: [item.id],
},
})
} else {
console.log(

View File

@ -48,7 +48,12 @@
<a-tooltip>
<template #title>{{ item.name }}</template>
<div class="content-body-title">
<span v-if="item.name ==='申请摄像头列表'" @click="showVideoList(item)"> 名称{{ item.name }} </span>
<span
v-if="item.name === '申请摄像头列表'"
@click="showVideoList(item)"
>
名称{{ item.name }}
</span>
<span v-else>名称{{ item.name }}</span>
<div></div>
</div>
@ -71,9 +76,43 @@
</p>
</div>
<div v-else>
<p class="content-body-content-son">
<span v-if="item.name ==='申请摄像头列表'">申请结果{{ '列表地址' + backUrl + 'resource/getApplyCameraList/' + item.processInstanceId+';'+ '视频流地址'+backUrl + '/resource/hls/getHls/?channelId='}}</span>
<span v-else>申请结果{{ item.comment || '暂无' }}</span>
<p
class="content-body-content-son"
v-if="item.name === '申请摄像头列表'"
>
<span>
申请结果{{
'列表地址:' +
backUrl +
'resource/getApplyCameraList/' +
item.processInstanceId +
';' +
'视频流地址:' +
backUrl +
'/resource/hls/getHls/?channelId='
}}
</span>
<a-button
type="primary"
size="small"
@click="
copyComment(
'列表地址:' +
backUrl +
'resource/getApplyCameraList/' +
item.processInstanceId +
';' +
'视频流地址:' +
backUrl +
'/resource/hls/getHls/?channelId='
)
"
>
复制
</a-button>
</p>
<p class="content-body-content-son" v-else>
<span>申请结果{{ item.comment || '暂无' }}</span>
<a-button
type="primary"
size="small"
@ -227,7 +266,12 @@
title="已申请摄像头列表"
@ok="videoVisible = false"
>
<a-table :columns="columns" :data-source="xVideoList" bordered :pagination="{defaultPageSize: 6}">
<a-table
:columns="columns"
:data-source="xVideoList"
bordered
:pagination="{ defaultPageSize: 6 }"
>
<template #bodyCell="{ column, text }">
<!-- <template>
<a>{{ text }}</a>
@ -246,7 +290,12 @@
getTaskHandleDetailInfo,
// getProcDefBizRoute,
} from '@/api/personalCenter'
import { updateRes, relaunch, selectOne,getApplyCameraList } from '@/api/home'
import {
updateRes,
relaunch,
selectOne,
getApplyCameraList,
} from '@/api/home'
import { useRouter } from 'vue-router'
import { message } from 'ant-design-vue'
import ApplyDetails from '@/views/personalCenter/components/ApplyDetails'
@ -257,39 +306,13 @@
// let contentListLength = contentList.length
let tabIndex = ref(0)
const videoVisible = ref(false)
const columns = ref([{
const columns = ref([
{
title: '摄像头名称',
dataIndex: 'name'
}])
const xVideoList = ref([{
name: '111'
}, {
name: '222'
},{
name: '111'
}, {
name: '222'
},{
name: '111'
}, {
name: '222'
},{
name: '111'
}, {
name: '222'
},{
name: '111'
}, {
name: '222'
},{
name: '111'
}, {
name: '222'
},{
name: '111'
}, {
name: '222'
},])
dataIndex: 'name',
},
])
const xVideoList = ref([])
function tabqiehuan(item, index) {
// debugger
tabIndex.value = index
@ -332,9 +355,14 @@
resourceId.value = item.resourceId
}
const showVideoList = (item) => {
// getApplyCameraList(item.processInstanceId).then(res=>{
// console.log('res', res)
// })
console.log('显示列表', item)
getApplyCameraList(item.processInstanceId).then((res) => {
console.log('res', res)
xVideoList.value = []
res.data.data.map((val) => {
xVideoList.value.push({ name: val.channelName, key: val.channelId })
})
})
videoVisible.value = true
}
const copyComment = (data) => {

View File

@ -233,21 +233,30 @@
// scInsert
// )
let scArr = []
if (checkedList.value.length === 0) {
if (checkedListAbility.value.length === 0) {
message.error('请选择需要收藏的数据')
} else {
list.value.forEach((val) => {
if (checkedList.value.indexOf(val.deptId) !== -1) {
if (val.delFlag == 0) {
scArr.push({ id: val.id })
if (val.children) {
val.children.map((item) => {
if (item.resourceId == '8888888880000000001') {
message.warning('摄像头无法添加收藏!')
} else {
if (
checkedListAbility.value.indexOf(item.id) > -1 &&
item.delFlag == 0
) {
scArr.push({ resourceId: item.resourceId })
}
}
})
}
})
if (scArr.length > 0) {
scInsert(scArr).then((res) => {
if (res.data.code === 0) {
message.success('收藏成功')
checkedList.value = []
clean()
}
})
} else {
@ -373,6 +382,7 @@
pageNum.value = '1'
pageSize.value = '99999'
checkedList.value = []
checkedListAbility.value = []
checkedListAll.value = []
checkAll.value = false
showKey.value++
@ -631,11 +641,11 @@
}
//
const delList = () => {
if (checkedList.value.length == 0) {
if (checkedListAbility.value.length == 0) {
message.error('请先选择需要操作的数据!')
} else {
sgcDel({
ids: checkedList.value,
ids: checkedListAbility.value,
}).then((res) => {
if (res.data.msg === 'success') {
message.success('删除成功')