摄像头申请流程

This commit is contained in:
a0049873 2022-06-30 15:27:16 +08:00
parent c4b6faaa6d
commit 0f6b37e52e
5 changed files with 163 additions and 118 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

@ -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,57 @@
}
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) => {
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,43 @@
},
])
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) {
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)
})
} 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)