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

This commit is contained in:
guoyue 2022-10-18 14:12:26 +08:00
commit a7ac2e8a1e
2 changed files with 47 additions and 3 deletions

View File

@ -318,7 +318,7 @@
// //
const funnelPlot = (dataList) => { const funnelPlot = (dataList) => {
// //
let arrCopy = ['0-5', '5-10', '10-15', '15-20', '20以上'] let arrCopy = ['1-5', '5-10', '10-15', '15-20', '20以上']
// //
dataList.sort((a, b) => { dataList.sort((a, b) => {
return Number(a.value) - Number(b.value) return Number(a.value) - Number(b.value)

View File

@ -126,11 +126,17 @@
title="已申请摄像头列表" title="已申请摄像头列表"
@ok="videoVisible = false" @ok="videoVisible = false"
> >
<a-select placeholder="请选择归属部门" v-model:value="deptName" :getPopupContainer="(triggerNode) => triggerNode.parentNode" show-search option-filter-prop="children" :filterOption="filterOption" @change="deptIdChangeFunction">
<a-select-option v-for="(item, index) in deptNameAll" :key="`${index}-${item}`" :value="item.name">
{{ item.name }}
</a-select-option>
</a-select>
<a-table <a-table
:columns="columns" :columns="columns"
:data-source="xVideoList" :data-source="xVideoList"
bordered bordered
:pagination="{ defaultPageSize: 6 }" :pagination="{ defaultPageSize: 6 }"
style="margin-top:10px"
> >
<template #bodyCell="{ column, text }"> <template #bodyCell="{ column, text }">
<!-- <template> <!-- <template>
@ -146,6 +152,7 @@
import { message } from 'ant-design-vue' import { message } from 'ant-design-vue'
import { ref, defineProps } from 'vue' import { ref, defineProps } from 'vue'
import mybus from '@/myplugins/mybus' import mybus from '@/myplugins/mybus'
import { getDeptAll } from '@/api/user'
const router = useRouter() const router = useRouter()
const props = defineProps({ const props = defineProps({
dataList: { type: Array, default: null }, dataList: { type: Array, default: null },
@ -154,12 +161,19 @@
let dataForm = ref([]) let dataForm = ref([])
const videoVisible = ref(false) const videoVisible = ref(false)
const xVideoList = ref([]) const xVideoList = ref([])
const xVideoListAll = ref([])
const deptNameAll = ref([]) //
const deptFlage = ref(true) //
const deptName = ref(null)
const columns = ref([ const columns = ref([
{ {
title: '摄像头名称', title: '摄像头名称',
dataIndex: 'name', dataIndex: 'name',
}, },
{
title: '归属部门',
dataIndex: 'managementUnitName',
}
]) ])
// eslint-disable-next-line vue/no-setup-props-destructure // eslint-disable-next-line vue/no-setup-props-destructure
dataForm.value = props.dataList dataForm.value = props.dataList
@ -189,14 +203,16 @@
// //
const showItem = (id, type, delFlag, note1) => { const showItem = (id, type, delFlag, note1) => {
if (type == '基础设施') { if (type == '基础设施') {
let arr = JSON.parse(note1) let arr = JSON.parse(note1);
xVideoList.value = [] xVideoList.value = []
arr.map((val) => { arr.map((val) => {
xVideoList.value.push({ xVideoList.value.push({
name: val.channelName || '', name: val.channelName || '',
key: val.channelId, key: val.channelId,
managementUnitName:val.managementUnitName || '',
}) })
}) })
xVideoListAll.value = xVideoList.value;
videoVisible.value = true videoVisible.value = true
} else { } else {
if (delFlag == 0) { if (delFlag == 0) {
@ -211,6 +227,27 @@
} }
} }
} }
//
const deptIdChangeFunction = (name) => {
//console.log('nnnndddd',name);
//console.log('xVideoList',xVideoList);
//namexVideoList
xVideoList.value = xVideoListAll.value.filter((item) => {
if (name && item.managementUnitName.indexOf(name) < 0) return false
return true
});
}
//
const getDeptAllData = () =>{
getDeptAll().then((res) => {
deptNameAll.value = res.data.data
})
}
getDeptAllData();
//select
const filterOption = (input, option) => {
return option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
@ -351,4 +388,11 @@
display: flex; display: flex;
align-items: center; align-items: center;
} }
::v-deep .ant-table-thead > tr > th {
//padding-left: px;
font-size: 18px;
font-weight: bold;
color:#000000 ;
//background: # !important;
}
</style> </style>