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

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 * @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-13 15:29:27 * @LastEditTime: 2022-07-01 14:16:18
* @Description: 算法详情页头部 * @Description: 算法详情页头部
--> -->
<template> <template>
@ -77,12 +77,28 @@
// //
function toView() { function toView() {
// window.open(newpage.href, '_blank') // 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({ router.push({
path: '/apply', path: '/apply',
query: {
name: props.dataList.name,
resourceId: [props.dataList.id],
},
}) })
} }
const componentType = ref('') const componentType = ref('')

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-01 14:20:52
* @Description: 算法详情页头部 * @Description: 算法详情页头部
--> -->
<template> <template>
@ -35,14 +35,14 @@
</div> </div>
</div> </div>
<div class="bottom" v-if="props.dataList.id"> <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> <template #icon><form-outlined /></template>
申请使用 申请使用
</a-button> </a-button>
<a-button type="primary" @click="addShoppingCart()"> <a-button type="primary" @click="addShoppingCart()">
<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()">收藏</a-button>
</div> </div>
</div> </div>
@ -50,42 +50,58 @@
</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 } 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'
const props = defineProps({ const props = defineProps({
dataList: { type: Object, default: null }, dataList: { type: Object, default: null },
}) })
// const router = useRouter() const router = useRouter()
const businessArea = ref('') const businessArea = ref('')
// // // //
// const addShoppingCart = () => { const addShoppingCart = () => {
// console.log('==================>', props.dataList) console.log('加入申购车==================>', props.dataList)
// sgcInsert({ sgcInsert({
// delFlag: '0', delFlag: '0',
// resourceId: props.dataList.id, resourceId: props.dataList.id,
// // userId: userId.value, // userId: userId.value,
// }).then((res) => { }).then((res) => {
// console.log(res) console.log(res)
// message.success('') message.success('添加申购车成功!')
// mybus.emit('getSgcNum') mybus.emit('getSgcNum')
// }) })
// } }
// // // //
// function toView() { function toView() {
// // window.open(newpage.href, '_blank') // window.open(newpage.href, '_blank')
// router.push({ console.log('一键申请===================>', props.dataList)
// path: '/apply', localStorage.setItem(
// query: { 'applyList',
// name: props.dataList.name, JSON.stringify([
// resourceId: [props.dataList.id], {
// }, 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 = () => { const goTOCollection = () => {
console.log('收藏===================》', props.dataList) console.log('收藏===================》', props.dataList)

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-01 14:21:04
* @Description: 开发组件详情页头部 * @Description: 开发组件详情页头部
--> -->
<template> <template>
@ -77,12 +77,28 @@
// //
function toView() { function toView() {
// window.open(newpage.href, '_blank') // 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({ router.push({
path: '/apply', path: '/apply',
query: {
name: props.dataList.name,
resourceId: [props.dataList.id],
},
}) })
} }
// //

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-01 14:21:10
* @Description: 算法详情页头部 * @Description: 算法详情页头部
--> -->
<template> <template>
@ -78,12 +78,28 @@
// //
function toView() { function toView() {
// window.open(newpage.href, '_blank') // 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({ router.push({
path: '/apply', path: '/apply',
query: {
name: props.dataList.name,
resourceId: [props.dataList.id],
},
}) })
} }
// //

View File

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

View File

@ -182,21 +182,15 @@
> >
免费试用 免费试用
</a-button> --> </a-button> -->
<!-- <a-button <a-button
type="primary" type="primary"
@click="toView('apply', item)" @click="toView('apply', item)"
v-show=" v-show="cardType == '组件服务'"
cardType !== '数据资源' &&
!(
cardType == '组件服务' &&
findComponentName(item, '智能算法')
)
"
> >
{{ {{
item.shareCondition == '免批申请' ? '免批申请' : '立即申请' item.shareCondition == '免批申请' ? '免批申请' : '立即申请'
}} }}
</a-button> --> </a-button>
</div> </div>
<div class="right" v-else> <div class="right" v-else>
<a-button type="primary" @click="openVideo(item)"> <a-button type="primary" @click="openVideo(item)">
@ -382,13 +376,28 @@
) )
} else { } else {
if (type === 'apply') { 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({ router.push({
path: '/apply', path: '/apply',
query: {
name: [item.name],
resourceId: [item.id],
},
}) })
} else { } else {
console.log( console.log(

View File

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

View File

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