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

This commit is contained in:
hucongqian 2022-06-30 16:50:06 +08:00
commit 702c685372
9 changed files with 224 additions and 154 deletions

View File

@ -2,7 +2,7 @@
* @Author: hisense.wuhongjian
* @Date: 2020-07-07 16:03:23
* @LastEditors: hisense.liangjunhua
* @LastEditTime: 2022-06-27 14:22:56
* @LastEditTime: 2022-06-30 11:05:52
* @Description: 数据资源参数配置
*/
const newLocation = 'qingdao'
@ -14,6 +14,8 @@ const whoShow = {}
const launchedDataNumObject = {}
//
const navListManagement = {}
//
const infrastructure = {}
//
const mapTestNum = {}
//
@ -21,6 +23,8 @@ const footerDataList = {}
// qingdao
if (newLocation === 'qingdao') {
whoShow.itShowQingDao = true
infrastructure.deptName = '青岛市大数据发展管理局'
infrastructure.deptId = '1067246875800000066'
navListManagement.navList = [
{ name: '共享门户', key: 'home' },
{ name: '能力集市', key: 'DetailsPageconetent' },

View File

@ -28,18 +28,19 @@
name: '组件展示',
key: 'business-presentation',
},
{
name: '关联能力',
key: 'business-associated-ability',
},
{
name: '功能介绍',
key: 'function-introduction',
},
{
name: '应用场景',
key: 'application-scenarios',
},
{
name: '关联能力',
key: 'business-associated-ability',
},
{
name: '应用案例',
key: 'application-case',
@ -68,6 +69,7 @@
list.value = []
let arr = [
'组件视频介绍',
'关联能力',
'功能介绍',
'应用场景',
'应用案例',
@ -117,6 +119,7 @@
list.value = []
let arr = [
'组件视频介绍',
'关联能力',
'功能介绍',
'应用场景',
'应用案例',

View File

@ -115,6 +115,8 @@
// eslint-disable-next-line vue/no-setup-props-destructure
dataFrom.value.content[0].link.value = props.dataList.apiUrl
dataFrom.value.content[0].facilitator.value = props.dataList.deptContacts
dataFrom.value.content[0].people.value = props.dataList.deptContacts
dataFrom.value.content[0].phone.value = props.dataList.deptPhone
console.log('dataList', props.dataList)
props.dataList.infoList.map((item) => {
if (item.attrType === '组件地址') {
@ -139,6 +141,8 @@
} else {
dataFrom.value.content[0].link.value = val.apiUrl
dataFrom.value.content[0].facilitator.value = val.deptContacts
dataFrom.value.content[0].people.value = val.deptContacts
dataFrom.value.content[0].phone.value = val.deptPhone
console.log('dataList', val)
val.infoList.map((item) => {
if (item.attrType === '组件地址') {

View File

@ -34,14 +34,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>
@ -49,42 +49,42 @@
</div>
</template>
<script setup>
// import { ShoppingCartOutlined } from '@ant-design/icons-vue'
import { FormOutlined, 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 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 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 goTOCollection = () => {
console.log('收藏===================》', props.dataList)

View File

@ -28,7 +28,8 @@
</div>
<div class="content-right">
<div class="content-right-title">
{{ item.contact }}{{ item.facilitator.values }}
<!-- {{ item.facilitator.values }} -->
{{ item.contact }}
</div>
<div class="content-right-content">
<p>

View File

@ -16,7 +16,17 @@
<span>{{ val.resourceName }}</span>
<span>{{ val.type }}</span>
</div>
<div class="description">{{ val.description || '--' }}</div>
<div class="description">
{{
val.description ||
(val.note1 &&
JSON.parse(val.note1)[0].channelName +
'等' +
JSON.parse(val.note1).length +
'个摄像头') ||
'--'
}}
</div>
<div class="remove" @click="removeFunction(val)"></div>
</div>
</template>
@ -48,7 +58,7 @@
//
const removeFunction = (data) => {
dataForm.value.map((val) => {
val.arr = val.arr.filter((item) => item.resourceId !== data.resourceId)
val.arr = val.arr.filter((item) => item.id !== data.id)
})
dataForm.value = dataForm.value.filter((val) => val.arr.length !== 0)
}

View File

@ -378,88 +378,58 @@
}
let ids = []
formName.system = []
console.log('list==================', list.value)
list.value.map((val) => {
val.arr.map((item) => {
formName.system.push({
resourceId: item.resourceId,
resourceName: item.resourceName,
})
console.log(item.id)
ids.push(item.id)
if (item.type !== '基础设施') {
formName.system.push({
resourceId: item.resourceId,
resourceName: item.resourceName,
})
console.log(item.id)
ids.push(item.id)
} else {
let obj = {}
Object.assign(obj, formName)
console.log('摄像头===============>', obj, item)
obj.system = []
item.note1 = JSON.parse(item.note1)
item.note1.map((sxt) => {
obj.system.push({
resourceId: sxt.idtCameraChannel,
resourceName: sxt.channelName,
cameraId: sxt.channelId,
})
})
submitApply(obj).then((res) => {
applySuccess.value = false
console.log('摄像头申请================>', res)
if (item.id) {
sgcDel({ ids: [item.id] }).then((res) => {
if (res.data.msg === 'success') {
mybus.emit('getSgcNum')
}
})
}
})
}
})
})
console.log('提交数据==========================>', formName, ids)
submitApply(formName).then((res) => {
applySuccess.value = false
message.success('操作成功!')
console.log('能力申请================>', res)
if (ids) {
sgcDel({ ids: ids }).then((res) => {
if (res.data.msg === 'success') {
mybus.emit('getSgcNum')
}
})
}
})
// if (arr && arr.length !== 0) {
// console.log('')
// const obj = ref({})
// for (const key in formName) {
// if (key !== 'formNameSystem') {
// obj.value[key] = formName[key]
// }
// }
// submitApply(obj.value).then((res) => {
// applySuccess.value = false
// message.success('')
// console.log('================>', res)
// if (ids) {
// sgcDel({ ids: ids }).then((res) => {
// if (res.data.msg === 'success') {
// mybus.emit('getSgcNum')
// }
// })
// }
// })
// } else {
// lastestPage({
// key: dataForm.processDefinitionKey,
// })
// .then(({ data: res }) => {
// if (res.code !== 0) {
// return message.error(res.msg)
// }
// if (!res.data.list || res.data.list.length <= 0) {
// return message.error('')
// }
// // proxy.$http['post'](formUrl, rootObj[formName])
// tabilityapplication(formName)
// .then(({ data: res }) => {
// if (res.code !== 0) {
// message.error(res.msg)
// if (callbacks.formSaveErrorCallback) {
// callbacks.formSaveErrorCallback(res)
// }
// }
// if (callbacks.formSaveSuccessCallback) {
// callbacks.formSaveSuccessCallback(res)
// }
// if (!res.data.businessKey) {
// return message.error('KEY')
// // startProcess(dataForm.processDefinitionKey, null, rootObj[formName])
// } else {
// startProcess(
// dataForm.processDefinitionKey,
// res.data.businessKey
// // rootObj[formName]
// )
// }
// })
// .catch(() => {})
// })
// .catch(() => {})
// // })
// }
if (formName.system.length !== 0) {
submitApply(formName).then((res) => {
applySuccess.value = false
message.success('操作成功!')
console.log('能力申请================>', res)
if (ids) {
sgcDel({ ids: ids }).then((res) => {
if (res.data.msg === 'success') {
mybus.emit('getSgcNum')
}
})
}
})
}
})
}
}

View File

@ -37,7 +37,7 @@
<i class="boundary"></i>
<p>
已选
<span>{{ allClick.length }}</span>
<span>{{ selectedRowKeys.length }}</span>
</p>
</div>
@ -86,7 +86,9 @@
@change="handleTableChange"
:row-selection="{
selectedRowKeys: selectedRowKeys,
onChange: onSelectChange,
// onChange: onSelectChange,
onSelect: onSelectChange,
onSelectAll: onSelectAll,
}"
>
<template #bodyCell="{ column, record }">
@ -115,6 +117,7 @@
import VideoSurveillance from '@/views/home/videoSurveillance'
import { getCategoryTreePage } from '@/api/personalCenter'
import { dataType } from 'element-plus/es/components/table-v2/src/common'
import { useRouter } from 'vue-router'
import { ref, reactive, onMounted } from 'vue'
import {
getCameraByParentId,
@ -124,6 +127,7 @@
import { sgcInsert } from '@/api/home'
import { message } from 'ant-design-vue'
import mybus from '@/myplugins/mybus'
const router = useRouter()
const options = reactive({
width: '700px', //
height: '400px', //
@ -189,6 +193,7 @@
})
})
const selectedList = ref([])
const selectedRowKeys = ref([])
const tabList = ref([
{
title: '设施类型',
@ -317,8 +322,35 @@
getCamera()
}
//
const dept = reactive({})
// eslint-disable-next-line no-undef
if (infrastructure) {
// eslint-disable-next-line no-undef
dept.deptId = infrastructure.deptId
// eslint-disable-next-line no-undef
dept.deptName = infrastructure.deptName
}
const apply = () => {
console.log('一键申请')
console.log('一键申请', selectedList.value)
let arr = [
{
arr: [
{
description: '',
note1: JSON.stringify(selectedList.value),
resourceId: '1522550195055828996',
resourceName: '摄像头列表',
type: '基础设施',
},
],
deptId: dept.deptId,
deptName: dept.deptName,
},
]
localStorage.setItem('applyList', JSON.stringify(arr))
router.push({
path: '/apply',
})
}
//
const addShopCar = () => {
@ -367,11 +399,59 @@
},
])
const allClick = ref([])
const onSelectChange = (selectedRowKeys, selectedRows) => {
console.log('hahhahah', selectedRowKeys, selectedRows)
selectedList.value = selectedRows
const onSelectChange = (record, selected, selectedRows, nativeEvent) => {
console.log('hahhahah', record, selected, selectedRows, nativeEvent)
if (selected) {
if (selectedRowKeys.value.length == 10) {
message.warning('最多只能添加10个摄像头')
} else {
selectedList.value.push(record)
selectedRowKeys.value.push(record.channelCode)
}
} else {
selectedList.value = selectedList.value.filter(
(item) => item.idtCameraChannel !== record.idtCameraChannel
)
selectedRowKeys.value.splice(
selectedRowKeys.value.indexOf(record.channelCode),
1
)
}
console.log('已选中======================>', selectedList.value)
// selectedList.value = selectedRows
// allClick.value = selectedRowKeys
}
const onSelectAll = (selected, selectedRows, changeRows) => {
if (selected) {
changeRows.map((val) => {
selectedList.value.push(val)
selectedRowKeys.value.push(val.channelCode)
})
if (selectedRowKeys.value.length > 10) {
message.warning('最多只能添加10个摄像头')
changeRows.map((val) => {
selectedList.value = selectedList.value.filter(
(item) => item.idtCameraChannel !== val.idtCameraChannel
)
selectedRowKeys.value.splice(
selectedRowKeys.value.indexOf(val.channelCode),
1
)
})
}
} else {
changeRows.map((val) => {
selectedList.value = selectedList.value.filter(
(item) => item.idtCameraChannel !== val.idtCameraChannel
)
selectedRowKeys.value.splice(
selectedRowKeys.value.indexOf(val.channelCode),
1
)
})
}
console.log('heiheiheiehiehei', selected, selectedRows, changeRows)
}
const handleTableChange = (val) => {
pagination.value.current = val.current
pagination.value.pageSize = val.pageSize

View File

@ -4,7 +4,7 @@
<a-checkbox v-model:checked="checkAll" @change="onCheckAllChange">
全选
</a-checkbox>
<div @click="reverseSelection" class="reverseSelection">反选</div>
<!-- <div @click="reverseSelection" class="reverseSelection">反选</div> -->
<p>
已选
<span class="num">{{ checkedListAbility.length || 0 }}</span>
@ -108,9 +108,7 @@
>
<template #title>
<span
@click="
showItem(item.resourceId, item.type, item.delFlag)
"
@click="showItem(item.id, item.type, item.delFlag)"
style="cursor: pointer"
class="name"
>
@ -241,7 +239,7 @@
list.value.forEach((val) => {
if (checkedList.value.indexOf(val.deptId) !== -1) {
if (val.delFlag == 0) {
scArr.push({ resourceId: val.resourceId })
scArr.push({ id: val.id })
}
}
})
@ -267,9 +265,9 @@
}
if (val.children.length > 0) {
val.children.map((item) => {
if (checkedListAbility.value.indexOf(item.resourceId) == -1) {
checkedListAbility.value.push(item.resourceId)
val.checkedList.push(item.resourceId)
if (checkedListAbility.value.indexOf(item.id) == -1) {
checkedListAbility.value.push(item.id)
val.checkedList.push(item.id)
checkNum.value++
}
item.checked = true
@ -301,13 +299,13 @@
if (val.children.length > 0) {
val.children.map((item) => {
// console.log('child=============>', checkedListAbility.value, item)
if (checkedListAbility.value.indexOf(item.resourceId) > -1) {
if (checkedListAbility.value.indexOf(item.id) > -1) {
item.checked = false
checkedListAbility.value.splice(
checkedListAbility.value.indexOf(item.resourceId),
checkedListAbility.value.indexOf(item.id),
1
)
val.checkedList.splice(val.checkedList.indexOf(item.resourceId), 1)
val.checkedList.splice(val.checkedList.indexOf(item.id), 1)
}
})
}
@ -347,8 +345,8 @@
if (val.children.length > 0) {
val.children.map((item) => {
item.checked = true
checkedListAbility.value.push(item.resourceId)
val.checkedList.push(item.resourceId)
checkedListAbility.value.push(item.id)
val.checkedList.push(item.id)
})
}
arr.push(val.deptId)
@ -446,23 +444,23 @@
item.checkAll == true ||
checkedList.value.indexOf(item.deptId) > -1
) {
if (checkedListAbility.value.indexOf(val.resourceId) == -1) {
checkedListAbility.value.push(val.resourceId)
item.checkedList.push(val.resourceId)
if (checkedListAbility.value.indexOf(val.id) == -1) {
checkedListAbility.value.push(val.id)
item.checkedList.push(val.id)
}
val.checked = true
checkNum.value++
} else if (checkedListAbility.value.indexOf(val.resourceId) == -1) {
} else if (checkedListAbility.value.indexOf(val.id) == -1) {
val.checked = false
}
} else {
// console.log(
// '++++++++++++++',
// checkedListAbility.value,
// val.resourceId
// val.id
// )
if (
checkedListAbility.value.indexOf(val.resourceId) > -1 ||
checkedListAbility.value.indexOf(val.id) > -1 ||
(item.load < Number(item.pageNum) &&
checkedListAll.value.indexOf(item.deptId) > -1)
) {
@ -515,9 +513,9 @@
if (item.checked) {
if (item.children.length > 0) {
item.children.map((val) => {
if (checkedListAbility.value.indexOf(val.resourceId) == -1) {
checkedListAbility.value.push(val.resourceId)
item.checkedList.push(val.resourceId)
if (checkedListAbility.value.indexOf(val.id) == -1) {
checkedListAbility.value.push(val.id)
item.checkedList.push(val.id)
}
val.checked = true
})
@ -535,12 +533,12 @@
} else {
if (item.children.length > 0) {
item.children.map((val) => {
if (checkedListAbility.value.indexOf(val.resourceId) > -1) {
if (checkedListAbility.value.indexOf(val.id) > -1) {
checkedListAbility.value.splice(
checkedListAbility.value.indexOf(val.resourceId),
checkedListAbility.value.indexOf(val.id),
1
)
item.checkedList.splice(item.checkedList.indexOf(val.resourceId), 1)
item.checkedList.splice(item.checkedList.indexOf(val.id), 1)
val.checked = false
}
})
@ -579,7 +577,7 @@
} else {
let all = true
item.children.map((child) => {
if (checkedListAbility.value.indexOf(child.resourceId) == -1) {
if (checkedListAbility.value.indexOf(child.id) == -1) {
all = false
}
})
@ -596,17 +594,17 @@
item.checked = !item.checked
if (item.checked) {
checkNum.value++
if (checkedListAbility.value.indexOf(item.resourceId) == -1) {
checkedListAbility.value.push(item.resourceId)
val.checkedList.push(item.resourceId)
if (checkedListAbility.value.indexOf(item.id) == -1) {
checkedListAbility.value.push(item.id)
val.checkedList.push(item.id)
}
} else {
checkNum.value--
checkedListAbility.value.splice(
checkedListAbility.value.indexOf(item.resourceId),
checkedListAbility.value.indexOf(item.id),
1
)
val.checkedList.splice(val.checkedList.indexOf(item.resourceId), 1)
val.checkedList.splice(val.checkedList.indexOf(item.id), 1)
}
// console.log('===============>', val, checkedListAll.value)
if (val.checkedList.length == val.count) {
@ -681,7 +679,7 @@
let arr = []
list.value.map((val) => {
val.arr = val.children.filter(
(item) => checkedListAbility.value.indexOf(item.resourceId) > -1
(item) => checkedListAbility.value.indexOf(item.id) > -1
)
})
arr = list.value.filter((val) => val.arr.length !== 0)