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

View File

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

View File

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

View File

@ -34,14 +34,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>
@ -49,42 +49,42 @@
</div> </div>
</template> </template>
<script setup> <script setup>
// import { ShoppingCartOutlined } from '@ant-design/icons-vue' import { FormOutlined, 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 applicationArea = ref('') const applicationArea = 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({ router.push({
// path: '/apply', path: '/apply',
// query: { query: {
// name: props.dataList.name, name: props.dataList.name,
// resourceId: [props.dataList.id], resourceId: [props.dataList.id],
// }, },
// }) })
// } }
// //
const goTOCollection = () => { const goTOCollection = () => {
console.log('收藏===================》', props.dataList) console.log('收藏===================》', props.dataList)

View File

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

View File

@ -16,7 +16,17 @@
<span>{{ val.resourceName }}</span> <span>{{ val.resourceName }}</span>
<span>{{ val.type }}</span> <span>{{ val.type }}</span>
</div> </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 class="remove" @click="removeFunction(val)"></div>
</div> </div>
</template> </template>
@ -48,7 +58,7 @@
// //
const removeFunction = (data) => { const removeFunction = (data) => {
dataForm.value.map((val) => { 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) dataForm.value = dataForm.value.filter((val) => val.arr.length !== 0)
} }

View File

@ -378,17 +378,45 @@
} }
let ids = [] let ids = []
formName.system = [] formName.system = []
console.log('list==================', list.value)
list.value.map((val) => { list.value.map((val) => {
val.arr.map((item) => { val.arr.map((item) => {
if (item.type !== '基础设施') {
formName.system.push({ formName.system.push({
resourceId: item.resourceId, resourceId: item.resourceId,
resourceName: item.resourceName, resourceName: item.resourceName,
}) })
console.log(item.id) console.log(item.id)
ids.push(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) console.log('提交数据==========================>', formName, ids)
if (formName.system.length !== 0) {
submitApply(formName).then((res) => { submitApply(formName).then((res) => {
applySuccess.value = false applySuccess.value = false
message.success('操作成功!') message.success('操作成功!')
@ -401,65 +429,7 @@
}) })
} }
}) })
// 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(() => {})
// // })
// }
}) })
} }
} }

View File

@ -37,7 +37,7 @@
<i class="boundary"></i> <i class="boundary"></i>
<p> <p>
已选 已选
<span>{{ allClick.length }}</span> <span>{{ selectedRowKeys.length }}</span>
</p> </p>
</div> </div>
@ -86,7 +86,9 @@
@change="handleTableChange" @change="handleTableChange"
:row-selection="{ :row-selection="{
selectedRowKeys: selectedRowKeys, selectedRowKeys: selectedRowKeys,
onChange: onSelectChange, // onChange: onSelectChange,
onSelect: onSelectChange,
onSelectAll: onSelectAll,
}" }"
> >
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
@ -115,6 +117,7 @@
import VideoSurveillance from '@/views/home/videoSurveillance' import VideoSurveillance from '@/views/home/videoSurveillance'
import { getCategoryTreePage } from '@/api/personalCenter' import { getCategoryTreePage } from '@/api/personalCenter'
import { dataType } from 'element-plus/es/components/table-v2/src/common' import { dataType } from 'element-plus/es/components/table-v2/src/common'
import { useRouter } from 'vue-router'
import { ref, reactive, onMounted } from 'vue' import { ref, reactive, onMounted } from 'vue'
import { import {
getCameraByParentId, getCameraByParentId,
@ -124,6 +127,7 @@
import { sgcInsert } from '@/api/home' import { sgcInsert } from '@/api/home'
import { message } from 'ant-design-vue' import { message } from 'ant-design-vue'
import mybus from '@/myplugins/mybus' import mybus from '@/myplugins/mybus'
const router = useRouter()
const options = reactive({ const options = reactive({
width: '700px', // width: '700px', //
height: '400px', // height: '400px', //
@ -189,6 +193,7 @@
}) })
}) })
const selectedList = ref([]) const selectedList = ref([])
const selectedRowKeys = ref([])
const tabList = ref([ const tabList = ref([
{ {
title: '设施类型', title: '设施类型',
@ -317,8 +322,35 @@
getCamera() 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 = () => { 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 = () => { const addShopCar = () => {
@ -367,11 +399,59 @@
}, },
]) ])
const allClick = ref([]) const allClick = ref([])
const onSelectChange = (selectedRowKeys, selectedRows) => { const onSelectChange = (record, selected, selectedRows, nativeEvent) => {
console.log('hahhahah', selectedRowKeys, selectedRows) console.log('hahhahah', record, selected, selectedRows, nativeEvent)
selectedList.value = selectedRows 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 // 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) => { const handleTableChange = (val) => {
pagination.value.current = val.current pagination.value.current = val.current
pagination.value.pageSize = val.pageSize pagination.value.pageSize = val.pageSize

View File

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