liwei19941102 2 лет назад
Родитель
Сommit
73c3be3143

+ 52 - 0
src/components/Public/videoDiv.vue

@@ -0,0 +1,52 @@
+<template>
+    <div class='info' style='display:flex;flex-direction:column;'>
+        <div :id='props.videoId' style='border-radius: 10px;width:100%;' height="200"></div>
+    </div>
+</template>
+
+<script setup name="videoKdg" lang="ts">
+    import EZUIKit from 'ezuikit-js';
+    import { getCameraPlayerConfig } from '@/api/gpsData';
+
+    const playerObj = ref(null)
+
+    const props = defineProps({
+        videoId: {
+            type: [String],
+            default: "video-container"
+        },
+    });
+
+    const initVideo = (code) => {
+        console.log(code)
+        // var code = "FM4945280"
+        getCameraPlayerConfig(code).then(res => {
+            console.log(res.data);
+            var player = new EZUIKit.EZUIKitPlayer({
+                height: 200,
+                template: "pcLive",
+                id: props.videoId, // 视频容器ID
+                ...res.data
+            })
+            playerObj.value = player
+        })
+    }
+
+    // initVideo()
+
+
+    defineExpose({ initVideo })
+
+    onBeforeUnmount(() => {
+        if (playerObj.value) {
+            playerObj.value.stop()
+            playerObj.value.destroy()
+        }
+    })
+</script>
+
+<style lang="scss" scoped>
+    #video-container {
+        height: 200px
+    }
+</style>

+ 2 - 2
src/views/car/carInfo/index.vue

@@ -37,14 +37,14 @@
                       :value="item.dictValue" />
                   </el-select>
                 </el-form-item>
-                <el-form-item label="网格" prop="wangge">
+                <!-- <el-form-item label="网格" prop="wangge">
                   <el-input v-model="queryParams.params.ext1$wangge" placeholder="请输入网格" clearable style="width: 160px"
                     @keyup.enter="handleQuery" />
                 </el-form-item>
                 <el-form-item label="单位" prop="dept">
                   <el-input v-model="queryParams.params.ext1$dept" placeholder="请输入单位" clearable style="width: 160px"
                     @keyup.enter="handleQuery" />
-                </el-form-item>
+                </el-form-item> -->
               </el-form>
             </div>
             <div style="width: 15%;">

+ 1 - 1
src/views/country/index.vue

@@ -77,7 +77,7 @@
         </el-form-item>
         <el-form-item label="站点" prop="sites">
           <!-- <el-input v-model="form.sites" type="textarea" placeholder="请输入内容" /> -->
-          <el-select multiple v-model="form.sitesList" placeholder="请选择站点" style="width: 240px">
+          <el-select  filterable multiple v-model="form.sitesList" placeholder="请选择站点" style="width: 240px">
             <el-option v-for="item in sitesList" :key="item.dictCode" :label="item.dictLabel" :value="item.dictCode" />
           </el-select>
         </el-form-item>

+ 156 - 109
src/views/statics/index.vue

@@ -17,13 +17,17 @@
           </div>
         </div>
         <div style="margin-top: 20px; padding-left: 10px;">
+          <el-tree-select v-model="deptId" :data="deptOptions" @change="changeDept"
+            :props="{ value: 'id', label: 'label', children: 'children' }" value-key="id" placeholder="请选择归属部门"
+            check-strictly />
           <el-input style="margin-top: 10px;" v-model="filterText" placeholder="输入关键字" />
           <el-tree-v2 v-if="showTree" style="margin-top: 10px;" ref="treeRef" class="filter-tree"
             :height="gettreeheight()" :data="data" :indent="treeIndent" :props="defaultProps"
             :filter-method="filterNode" @node-click="treeclick">
             <template v-slot:default="{ node }">
               <element-tree-line :node="node" :treeData="data" :showLabelLine="false" :indent="treeIndent">
-                 <div ><span>{{node.label}}</span> <el-tag style="margin-left: 20px;" :type="node.data.time=='在线'?'success':'danger'" > {{ node.data.time }}</el-tag></div>
+                <div><span>{{node.label}}</span> <el-tag style="margin-left: 20px;"
+                    :type="node.data.time=='在线'?'success':'danger'"> {{ node.data.time }}</el-tag></div>
               </element-tree-line>
             </template>
           </el-tree-v2>
@@ -42,11 +46,11 @@
                 margin-left: 5px;
               ">车辆视频</span>
             <span style="margin-left: 30px; font-size: 14px">{{ currentdata?.label }}</span>
-             <div style="margin-top: 20px" >
+            <div style="margin-top: 20px">
 
 
 
-             </div>
+            </div>
 
 
           </div>
@@ -61,133 +65,176 @@
 </template>
 
 <script setup>
-import { listCarInfo } from '@/api/carInfo';
-import moment from 'moment';
+  import { listCarInfo } from '@/api/carInfo';
+  import moment from 'moment';
+  import api from "@/api/system/user"
+  // import { DeptVO } from "@/api/system/dept/types";
 
 
-const carlist = ref([]);
+  const carlist = ref([]);
+  const carData = ref([])
 
-const showTree = ref(true)
+  const showTree = ref(true)
 
-const filterText = ref("");
-const treeRef = ref(null);
+  const filterText = ref("");
+  const treeRef = ref(null);
 
-const gettreeheight = () => {
-  return document.body.clientHeight - 300;
-}
+  const deptOptions = ref([]);
 
+  const deptId = ref([])
 
-const initData = async () => {
-  listCarInfo({ pageSize: 1000000 }).then(res => {
-    carlist.value = res.rows.filter(i => {
-      var hsin = false;
-      if (i.deviceInfos) {
-        JSON.parse(i.deviceInfos).forEach(item => {
-          if (item.type == "camera") {
-            hsin = true;
-            return true;
-          }
-        })
-      }
-      return hsin;
+  const gettreeheight = () => {
+    return document.body.clientHeight - 300;
+  }
 
-    });
 
-  }
-  );
-}
+  const getTreeSelect = async () => {
+    const res = await api.deptTreeSelect();
+    console.log(res)
+    deptOptions.value = res.data;
+  };
+
 
 
-const defaultProps = {
-  children: "children",
-  label: "label",
-  value: 'id',
-};
-const treeIndent = ref(40);
+  const initData = async () => {
+    listCarInfo({ pageSize: 1000000 }).then(res => {
+      carData.value = carlist.value = res.rows.filter(i => {
+        var hsin = false;
+        if (i.deviceInfos) {
+          JSON.parse(i.deviceInfos).forEach(item => {
+            if (item.type == "camera") {
+              hsin = true;
+              return true;
+            }
+          })
+        }
+        return hsin;
+
+      });
+      carlist.value = res.rows.filter(i => {
+        var hsin = false;
+        if (i.deviceInfos) {
+          JSON.parse(i.deviceInfos).forEach(item => {
+            if (item.type == "camera") {
+              hsin = true;
+              return true;
+            }
+          })
+        }
+        return hsin;
+
+      });
 
-watch(filterText, (val) => {
-  if (treeRef.value) {
-    treeRef.value.filter(val);
+    }
+    );
   }
-});
 
-const currenturl = ref("");
 
+  const defaultProps = {
+    children: "children",
+    label: "label",
+    value: 'id',
+  };
+  const treeIndent = ref(40);
+
+  watch(filterText, (val) => {
+    if (treeRef.value) {
+      treeRef.value.filter(val);
+    }
+  });
 
-const filterNode = (value, node) => {
-  if (node.id == 1) return true;
-  return node.label.indexOf(value) != -1;
-};
+  const currenturl = ref("");
 
-const currentdata = ref(null)
 
+  const filterNode = (value, node) => {
+    if (node.id == 1) return true;
+    return node.label.indexOf(value) != -1;
+  };
 
-const treeclick = (data, node) => {
-  if (data.deviceInfos) {
-    JSON.parse(data.deviceInfos).forEach(item => {
+  const currentdata = ref(null)
 
-          if (item.type == "camera") {
-            currenturl.value = item.code;
-            jessibuca.play(currenturl.value);
-          }
-        })
+
+  const treeclick = (data, node) => {
+    if (data.deviceInfos) {
+      JSON.parse(data.deviceInfos).forEach(item => {
+
+        if (item.type == "camera") {
+          currenturl.value = item.code;
+          jessibuca.play(currenturl.value);
+        }
+      })
     }
-}
-
-
-const data = computed(() => {
-  let index = 0;
-  return carlist.value.map(i => { return { id: ++index, label: i.carNum,deviceInfos:i.deviceInfos,time:  i.lastCountTime==null?"离线": ((moment().unix()- moment(i.lastCountTime).unix())>60*5?"离线":"在线") } })
-});
-var jessibuca = null;
-onMounted(() => {
-  initData();
-
-  var $container = document.getElementById('container');
-   jessibuca = new Jessibuca({
-            container: $container,
-            videoBuffer: 0.2, // 缓存时长
-            isResize: false,
-           text: "",
-            decoder:"/jess/decoder.js",
-            loadingText: "",
-            useMSE: false,
-            debug: true,
-            showBandwidth: true, // 显示网速
-            operateBtns: {
-                fullscreen: true,
-                screenshot: false,
-                play: true,
-                audio: false,
-                recorder: false
-            },
-            forceNoOffscreen: true,
-            isNotMute: false,
-        },);
-  // if (treeRef.value) {
-  //   setTimeout(() => {
-  //     treeRef.value.expandNode(treeRef.value.getNode(1))
-  //   }, 100);
-  //   getSites();
-  //   initData();
-  //   // treeRef.value.expandNode(treeRef.value.getNode(1))
-  // }
-});
+  }
+
+  const changeDept = () => {
+    var carListData = []
+    for(var index in carData.value){
+        var carDataObj = JSON.parse(carData.value[index].ext1)
+        if(carDataObj.deptId){
+          if(carDataObj.deptId == deptId.value){
+            carListData.push(carData.value[index])
+          }
+        }
+    } 
+    carlist.value = carListData
+    // console.log(carListData)
+  }
+
+
+  const data = computed(() => {
+    let index = 0;
+    return carlist.value.map(i => { return { id: ++index, label: i.carNum, deviceInfos: i.deviceInfos, time: i.lastCountTime == null ? "离线" : ((moment().unix() - moment(i.lastCountTime).unix()) > 60 * 5 ? "离线" : "在线") } })
+  });
+  var jessibuca = null;
+  onMounted(() => {
+    initData();
+    getTreeSelect();
+    var $container = document.getElementById('container');
+    jessibuca = new Jessibuca({
+      container: $container,
+      videoBuffer: 0.2, // 缓存时长
+      isResize: false,
+      text: "",
+      decoder: "/jess/decoder.js",
+      loadingText: "",
+      useMSE: false,
+      debug: true,
+      showBandwidth: true, // 显示网速
+      operateBtns: {
+        fullscreen: true,
+        screenshot: false,
+        play: true,
+        audio: false,
+        recorder: false
+      },
+      forceNoOffscreen: true,
+      isNotMute: false,
+    },);
+    // if (treeRef.value) {
+    //   setTimeout(() => {
+    //     treeRef.value.expandNode(treeRef.value.getNode(1))
+    //   }, 100);
+    //   getSites();
+    //   initData();
+    //   // treeRef.value.expandNode(treeRef.value.getNode(1))
+    // }
+  });
 </script>
 
 <style lang="scss" scoped>
- #container {
-            background: rgba(13, 14, 27, 0.7);
-            width: 50vw;
-            height: 398px;
-        }
-.card-header {
-  display: flex;
-  flex-direction: row;
-  justify-content: space-between;
-}
-
-.boxunused {
-  background: #3333332d;
-}
-</style>
+  #container {
+    background: rgba(13, 14, 27, 0.7);
+    width: 50vw;
+    height: 398px;
+  }
+
+  .card-header {
+    display: flex;
+    flex-direction: row;
+    justify-content: space-between;
+  }
+
+  .boxunused {
+    background: #3333332d;
+  }
+</style>

+ 471 - 453
src/views/statics/passengerFlow.vue

@@ -17,10 +17,15 @@
                                     <el-form-item label="车辆">
                                         <el-select v-model="queryParams.carNum" placeholder="请选择车辆"
                                             style="width: 120px">
-                                            <el-option v-for="item in carInfoList" :key="item.carNum" :label="item.carNum"
-                                                :value="item.carNum" />
+                                            <el-option v-for="item in carInfoList" :key="item.carNum"
+                                                :label="item.carNum" :value="item.carNum" />
                                         </el-select>
                                     </el-form-item>
+                                    <el-form-item label="单位">
+                                        <el-tree-select v-model="deptId" :data="deptOptions"
+                                            :props="{ value: 'id', label: 'label', children: 'children' }"
+                                            value-key="id" placeholder="请选择归属部门" check-strictly />
+                                    </el-form-item>
                                     <el-form-item label="时间" prop="carNum">
                                         <el-date-picker v-model="dataValue" type="datetimerange" :shortcuts="shortcuts"
                                             range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" />
@@ -93,106 +98,91 @@
 </template>
 
 <script setup name="CarInfo" lang="ts">
-import { listCarInfo, getCarInfo, delCarInfo, addCarInfo, updateCarInfo } from '@/api/carInfo';
-import { listCarSchedule, getCarSchedule, delCarSchedule, addCarSchedule, updateCarSchedule } from '@/api/carSchedule';
-import { CarInfoVO, CarInfoQuery, CarInfoForm } from '@/api/carInfo/types';
-import { updateData, listData } from "@/api/system/dict/data";
-import { listCarPath, getCarPath, delCarPath, addCarPath, updateCarPath } from '@/api/carPath';
-
-import { liststaticFlow, listsitesFlow } from '@/api/gpsData';
-import tableElm from "@/components/Public/table.vue";
-import { useRoute, useRouter } from "vue-router";
-import moment from 'moment';
-
-const route = useRoute();
-const router = useRouter();
-
-const { proxy } = getCurrentInstance() as ComponentInternalInstance;
-
-const carInfoList = ref<CarInfoVO[]>([]);
-const buttonLoading = ref(false);
-const loading = ref(true);
-const showSearch = ref(true);
-const ids = ref<Array<string | number>>([]);
-const single = ref(true);
-const multiple = ref(true);
-const total = ref(0);
-const total2 = ref(0);
-const value2 = ref('')
-const carPathList = ref([])
-
-const queryFormRef = ref<ElFormInstance>();
-const carInfoFormRef = ref<ElFormInstance>();
-const siteFlowList = ref([])
-
-const dataValue = ref<[Date, Date]>([
-    new Date(new Date().getTime() - 3600 * 24 * 1000),
-    new Date(),
-])
-
-const dataValue2 = ref<[Date, Date]>([
-    new Date(new Date().getTime() - 3600 * 24 * 1000),
-    new Date(),
-])
-
-const dialog = reactive<DialogOption>({
-    visible: false,
-    title: ''
-});
-
-const sites = ref([]);
-const table = ref(tableElm)
-const table1 = ref(tableElm)
-const table2 = ref(tableElm)
-const activeName = ref("first")
-const carFlowList = ref([])
-const lineFlowList = ref([])
-
-const columns = ref([
-    // {label: '上层位置', prop: 'v', visible: true},
-    { label: '来源', prop: 'carNum', visible: true, isTemplate: false },
-    { label: '时间', prop: 'workTime', visible: true, isTemplate: false, },
-    { label: '内容', prop: 'workName', pprop: "ext1", visible: true, isTemplate: false },
-])
-
-const columns1 = ref([
-    // {label: '上层位置', prop: 'v', visible: true},
-    { label: '车牌号', prop: 'carNum', visible: true, isTemplate: false },
-    { label: '开始时间', prop: 'startTime', visible: true, isTemplate: false, },
-    { label: '结束时间', prop: 'endTime', pprop: "ext1", visible: true, isTemplate: false },
-    { label: '上车总数', prop: 'others.incount', visible: true, isTemplate: false, },
-    { label: '下车总数', prop: 'others.outcount', pprop: "ext1", visible: true, isTemplate: false },
-])
-
-const columns2 = ref([
-    // {label: '上层位置', prop: 'v', visible: true},
-    { label: '站点名', prop: 'dictLabel', visible: true, isTemplate: false },
-    { label: '开始时间', prop: 'startTime', visible: true, isTemplate: false, },
-    { label: '结束时间', prop: 'endTime', pprop: "ext1", visible: true, isTemplate: false },
-    { label: '上车总数', prop: 'others.incount', visible: true, isTemplate: false, },
-    { label: '下车总数', prop: 'others.outcount', pprop: "ext1", visible: true, isTemplate: false },
-])
-
-const initFormData: CarInfoForm = {
-    id: undefined,
-    carNum: undefined,
-    carType: undefined,
-    deviceInfos: undefined,
-    repairInfo: undefined,
-    maintenanceInfo: undefined,
-    insuranceInfo: undefined,
-    inspectionInfo: undefined,
-    trafficAccidentInfo: undefined,
-    violationInfo: undefined,
-    changeInfo: undefined,
-    ext1: undefined,
-    ext2: undefined
-}
-const data = reactive<PageData<CarInfoForm, CarInfoQuery>>({
-    form: { ...initFormData },
-    queryParams: {
-        pageNum: 1,
-        pageSize: 10,
+    import { listCarInfo, getCarInfo, delCarInfo, addCarInfo, updateCarInfo } from '@/api/carInfo';
+    import { listCarSchedule, getCarSchedule, delCarSchedule, addCarSchedule, updateCarSchedule } from '@/api/carSchedule';
+    import { CarInfoVO, CarInfoQuery, CarInfoForm } from '@/api/carInfo/types';
+    import { updateData, listData } from "@/api/system/dict/data";
+    import { listCarPath, getCarPath, delCarPath, addCarPath, updateCarPath } from '@/api/carPath';
+    import api from "@/api/system/user"
+    import { liststaticFlow, listsitesFlow } from '@/api/gpsData';
+    import tableElm from "@/components/Public/table.vue";
+    import { useRoute, useRouter } from "vue-router";
+    import moment from 'moment';
+
+    const route = useRoute();
+    const router = useRouter();
+
+    const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+
+    const carInfoList = ref < CarInfoVO[] > ([]);
+    const buttonLoading = ref(false);
+    const loading = ref(true);
+    const showSearch = ref(true);
+    const ids = ref < Array < string | number >> ([]);
+    const single = ref(true);
+    const multiple = ref(true);
+    const total = ref(0);
+    const total2 = ref(0);
+    const value2 = ref('')
+    const carPathList = ref([])
+
+    const queryFormRef = ref < ElFormInstance > ();
+    const carInfoFormRef = ref < ElFormInstance > ();
+    const siteFlowList = ref([])
+
+    const dataValue = ref < [Date, Date] > ([
+        new Date(new Date().getTime() - 3600 * 24 * 1000),
+        new Date(),
+    ])
+
+    const dataValue2 = ref < [Date, Date] > ([
+        new Date(new Date().getTime() - 3600 * 24 * 1000),
+        new Date(),
+    ])
+
+    const dialog = reactive < DialogOption > ({
+        visible: false,
+        title: ''
+    });
+
+    const sites = ref([]);
+    const table = ref(tableElm)
+    const table1 = ref(tableElm)
+    const table2 = ref(tableElm)
+    const activeName = ref("first")
+    const carFlowList = ref([])
+    const lineFlowList = ref([])
+
+    const columns = ref([
+        // {label: '上层位置', prop: 'v', visible: true},
+        { label: '来源', prop: 'carNum', visible: true, isTemplate: false },
+        { label: '时间', prop: 'workTime', visible: true, isTemplate: false, },
+        { label: '内容', prop: 'workName', pprop: "ext1", visible: true, isTemplate: false },
+    ])
+
+    const columns1 = ref([
+        // {label: '上层位置', prop: 'v', visible: true},
+        { label: '车牌号', prop: 'carNum', visible: true, isTemplate: false },
+        { label: '开始时间', prop: 'startTime', visible: true, isTemplate: false, },
+        { label: '结束时间', prop: 'endTime', pprop: "ext1", visible: true, isTemplate: false },
+        { label: '上车总数', prop: 'others.incount', visible: true, isTemplate: false, },
+        { label: '下车总数', prop: 'others.outcount', pprop: "ext1", visible: true, isTemplate: false },
+    ])
+
+    const columns2 = ref([
+        // {label: '上层位置', prop: 'v', visible: true},
+        { label: '站点名', prop: 'dictLabel', visible: true, isTemplate: false },
+        { label: '开始时间', prop: 'startTime', visible: true, isTemplate: false, },
+        { label: '结束时间', prop: 'endTime', pprop: "ext1", visible: true, isTemplate: false },
+        { label: '上车总数', prop: 'others.incount', visible: true, isTemplate: false, },
+        { label: '下车总数', prop: 'others.outcount', pprop: "ext1", visible: true, isTemplate: false },
+    ])
+
+    const deptId = ref(null)
+    const deptOptions = ref([]);
+
+    const initFormData: CarInfoForm = {
+        id: undefined,
         carNum: undefined,
         carType: undefined,
         deviceInfos: undefined,
@@ -204,385 +194,413 @@ const data = reactive<PageData<CarInfoForm, CarInfoQuery>>({
         violationInfo: undefined,
         changeInfo: undefined,
         ext1: undefined,
-        ext2: undefined,
-        params: {
+        ext2: undefined
+    }
+    const data = reactive < PageData < CarInfoForm, CarInfoQuery>> ({
+        form: { ...initFormData },
+        queryParams: {
+            pageNum: 1,
+            pageSize: 10,
+            carNum: undefined,
+            carType: undefined,
+            deviceInfos: undefined,
+            repairInfo: undefined,
+            maintenanceInfo: undefined,
+            insuranceInfo: undefined,
+            inspectionInfo: undefined,
+            trafficAccidentInfo: undefined,
+            violationInfo: undefined,
+            changeInfo: undefined,
+            ext1: undefined,
+            ext2: undefined,
+            params: {
+            }
+        },
+        queryParams2: {
+            pageNum: 1,
+            pageSize: 10,
+            site: '',
+            line: [],
+        },
+        rules: {
+            id: [
+                { required: true, message: "编号不能为空", trigger: "blur" }
+            ],
+            carNum: [
+                { required: true, message: "车牌号不能为空", trigger: "blur" }
+            ],
+            carType: [
+                { required: true, message: "车类型不能为空", trigger: "change" }
+            ],
+            deviceInfos: [
+                { required: true, message: "所有车载设备信息不能为空", trigger: "blur" }
+            ],
+            repairInfo: [
+                { required: true, message: "维修信息不能为空", trigger: "blur" }
+            ],
+            maintenanceInfo: [
+                { required: true, message: "保养信息不能为空", trigger: "blur" }
+            ],
+            insuranceInfo: [
+                { required: true, message: "保险信息不能为空", trigger: "blur" }
+            ],
+            inspectionInfo: [
+                { required: true, message: "年检信息不能为空", trigger: "blur" }
+            ],
+            trafficAccidentInfo: [
+                { required: true, message: "交通事故信息不能为空", trigger: "blur" }
+            ],
+            violationInfo: [
+                { required: true, message: "违章信息不能为空", trigger: "blur" }
+            ],
+            changeInfo: [
+                { required: true, message: "车辆变更信息不能为空", trigger: "blur" }
+            ],
+            ext1: [
+                { required: true, message: "扩展1不能为空", trigger: "blur" }
+            ],
+            ext2: [
+                { required: true, message: "扩展2不能为空", trigger: "blur" }
+            ]
         }
-    },
-    queryParams2: {
-        pageNum: 1,
-        pageSize: 10,
-        site:'',
-        line:[],
-    },
-    rules: {
-        id: [
-            { required: true, message: "编号不能为空", trigger: "blur" }
-        ],
-        carNum: [
-            { required: true, message: "车牌号不能为空", trigger: "blur" }
-        ],
-        carType: [
-            { required: true, message: "车类型不能为空", trigger: "change" }
-        ],
-        deviceInfos: [
-            { required: true, message: "所有车载设备信息不能为空", trigger: "blur" }
-        ],
-        repairInfo: [
-            { required: true, message: "维修信息不能为空", trigger: "blur" }
-        ],
-        maintenanceInfo: [
-            { required: true, message: "保养信息不能为空", trigger: "blur" }
-        ],
-        insuranceInfo: [
-            { required: true, message: "保险信息不能为空", trigger: "blur" }
-        ],
-        inspectionInfo: [
-            { required: true, message: "年检信息不能为空", trigger: "blur" }
-        ],
-        trafficAccidentInfo: [
-            { required: true, message: "交通事故信息不能为空", trigger: "blur" }
-        ],
-        violationInfo: [
-            { required: true, message: "违章信息不能为空", trigger: "blur" }
-        ],
-        changeInfo: [
-            { required: true, message: "车辆变更信息不能为空", trigger: "blur" }
-        ],
-        ext1: [
-            { required: true, message: "扩展1不能为空", trigger: "blur" }
-        ],
-        ext2: [
-            { required: true, message: "扩展2不能为空", trigger: "blur" }
-        ]
+    });
+
+    const paramData = ref({
+        starttime: '',
+        endtime: ''
+    })
+
+    const { queryParams, queryParams2, form, rules } = toRefs(data);
+
+    const goadd = () => {
+        router.push("/car/work/addWork")
     }
-});
 
-const paramData = ref({
-    starttime: '',
-    endtime: ''
-})
+    const getSites = () => {
+        listData({ dictType: "tbl_sites" }).then(res2 => {
+            sites.value = res2.rows;
+        });
+    }
 
-const { queryParams, queryParams2, form, rules } = toRefs(data);
+    const getTreeSelect = async () => {
+        const res = await api.deptTreeSelect();
+        console.log(res)
+        deptOptions.value = res.data;
+    };
 
-const goadd = () => {
-    router.push("/car/work/addWork")
-}
+    const searchData = () => {
+        console.log(dataValue.value)
+    }
 
-const getSites = () => {
-    listData({ dictType: "tbl_sites" }).then(res2 => {
-        sites.value = res2.rows;
-    });
-}
-
-const searchData = () => {
-    console.log(dataValue.value)
-}
-
-/** 查询车辆信息列表 */
-const getList = async () => {
-    // loading.value = true;
-    // const res = await listCarInfo(queryParams.value);
-    var res = {
-        rows: [
-            {
-                carNum: '苏A862123',
-                startTime: "2024-01-23 09:12:23",
-                endTime: "2024-01-23 09:13:23",
-                upCount: "10",
-                downCount: "9",
-            },
-            {
-                carNum: '苏A862123',
-                startTime: "2024-01-23 10:12:23",
-                endTime: "2024-01-23 10:13:23",
-                upCount: "10",
-                downCount: "9",
+    /** 查询车辆信息列表 */
+    const getList = async () => {
+        // loading.value = true;
+        // const res = await listCarInfo(queryParams.value);
+        var res = {
+            rows: [
+                {
+                    carNum: '苏A862123',
+                    startTime: "2024-01-23 09:12:23",
+                    endTime: "2024-01-23 09:13:23",
+                    upCount: "10",
+                    downCount: "9",
+                },
+                {
+                    carNum: '苏A862123',
+                    startTime: "2024-01-23 10:12:23",
+                    endTime: "2024-01-23 10:13:23",
+                    upCount: "10",
+                    downCount: "9",
 
-            }
-        ],
-        total: 1
+                }
+            ],
+            total: 1
+        }
+        var res1 = {
+            rows: [
+                {
+                    siteName: '松罗客运站',
+                    startTime: "2024-01-23 09:12:23",
+                    endTime: "2024-01-23 09:13:23",
+                    upCount: "10",
+                    downCount: "9",
+                },
+                {
+                    siteName: '福清客运站',
+                    startTime: "2024-01-23 10:12:23",
+                    endTime: "2024-01-23 10:13:23",
+                    upCount: "10",
+                    downCount: "9",
+
+                }
+            ],
+            total: 1
+        }
+        var buttons = [
+            { type: 'danger', text: '删除', func: "goAdd" },
+        ]
+        table1.value.setDataList(res.rows);
+        table1.value.setButton(buttons);
+        table2.value.setDataList(res1.rows);
+        table2.value.setButton(buttons);
+        total.value = res.total;
+        loading.value = false;
     }
-    var res1 = {
-        rows: [
-            {
-                siteName: '松罗客运站',
-                startTime: "2024-01-23 09:12:23",
-                endTime: "2024-01-23 09:13:23",
-                upCount: "10",
-                downCount: "9",
-            },
-            {
-                siteName: '福清客运站',
-                startTime: "2024-01-23 10:12:23",
-                endTime: "2024-01-23 10:13:23",
-                upCount: "10",
-                downCount: "9",
 
-            }
-        ],
-        total: 1
+    /** 取消按钮 */
+    const cancel = () => {
+        reset();
+        dialog.visible = false;
     }
-    var buttons = [
-        { type: 'danger', text: '删除', func: "goAdd" },
-    ]
-    table1.value.setDataList(res.rows);
-    table1.value.setButton(buttons);
-    table2.value.setDataList(res1.rows);
-    table2.value.setButton(buttons);
-    total.value = res.total;
-    loading.value = false;
-}
-
-/** 取消按钮 */
-const cancel = () => {
-    reset();
-    dialog.visible = false;
-}
-
-/** 表单重置 */
-const reset = () => {
-    form.value = { ...initFormData };
-    carInfoFormRef.value?.resetFields();
-}
-
-/** 搜索按钮操作 */
-const handleQuery = () => {
-    queryParams.value.pageNum = 1;
-    getList();
-}
-
-/** 重置按钮操作 */
-const resetQuery = () => {
-    queryFormRef.value?.resetFields();
-    handleQuery();
-}
-
-/** 多选框选中数据 */
-const handleSelectionChange = (selection: CarInfoVO[]) => {
-    ids.value = selection.map(item => item.id);
-    single.value = selection.length != 1;
-    multiple.value = !selection.length;
-}
-
-/** 新增按钮操作 */
-const handleAdd = () => {
-    reset();
-    dialog.visible = true;
-    dialog.title = "添加车辆信息";
-}
-
-/** 修改按钮操作 */
-const handleUpdate = async (row?: CarInfoVO) => {
-    reset();
-    const _id = row?.id || ids.value[0]
-    const res = await getCarInfo(_id);
-    Object.assign(form.value, res.data);
-    dialog.visible = true;
-    dialog.title = "修改车辆信息";
-}
-
-const childrenClick = (data) => {
-    eval(data.func + "(data.data)")
-}
-
-const openDialog = () => {
-    dialog.visible = true
-}
-
-/** 提交按钮 */
-const submitForm = () => {
-    carInfoFormRef.value?.validate(async (valid: boolean) => {
-        if (valid) {
-            buttonLoading.value = true;
-            if (form.value.id) {
-                await updateCarInfo(form.value).finally(() => buttonLoading.value = false);
-            } else {
-                await addCarInfo(form.value).finally(() => buttonLoading.value = false);
-            }
-            proxy?.$modal.msgSuccess("修改成功");
-            dialog.visible = false;
-            await getList();
-        }
-    });
-}
-
-/** 删除按钮操作 */
-const handleDelete = async (row?: CarInfoVO) => {
-    const _ids = row?.id || ids.value;
-    await proxy?.$modal.confirm('是否确认删除车辆信息编号为"' + _ids + '"的数据项?').finally(() => loading.value = false);
-    await delCarInfo(_ids);
-    proxy?.$modal.msgSuccess("删除成功");
-    await getList();
-}
-
-/** 导出按钮操作 */
-const handleExport = () => {
-    proxy?.download('system/carInfo/export', {
-        ...queryParams.value
-    }, `carInfo_${new Date().getTime()}.xlsx`)
-}
-
-const initData = async () => {
-    const res = await listCarPath({ pageSize: 1000 });
-    carPathList.value = res.rows
-    const res2 = await listCarInfo({ pageSize: 1000 });
-    carInfoList.value = res2.rows
-    var params = {
-        starttime: moment(dataValue2.value[0]).format("YYYY-MM-DD HH:mm:ss"),
-        endtime: moment(dataValue2.value[1]).format("YYYY-MM-DD HH:mm:ss")
+
+    /** 表单重置 */
+    const reset = () => {
+        form.value = { ...initFormData };
+        carInfoFormRef.value?.resetFields();
     }
-    const res3 = await listCarSchedule({ pageSize: 1000, params: params })
-    getSites();
-    carFlowList.value = [];
-    siteFlowList.value = [];
-    searchCar();
-    searchSite();
-    // for (var index in carInfoList.value) {
-    //     if (carInfoList.value[index].deviceInfos != null) {
-    //         var deviceCode = JSON.parse(carInfoList.value[index].deviceInfos)[0].code
-    //         console.log(deviceCode)
-    //         await getFlowData(deviceCode, carInfoList.value[index].carNum)
-    //     }
-    //     //getFlowData();
-    // }
-    // for (var index in res3.data) {
-    //     if (res3.data[index].ext1 != null) {
-    //         var siteList = JSON.parse(res3.data[index].ext1)
-    //         var gpsCode = ''
-    //         for (var j in carInfoList.value) {
-    //             if (carInfoList.value[j].carNum == res3.data[index]) {
-    //                 gpsCode = JSON.parse(carInfoList.value[index].deviceInfos)[0].code
-    //             }
-    //         }
-    //         for (var key in siteList) {
-    //             var obj = siteList[key]
-    //             await getSiteData(key, gpsCode, obj.intime, obj.outtime);
-    //         }
-    //     }
-    // }
-    // table2.value.setButton([]);
-    // console.log(carFlowList.value)
-    // table2.value.setDataList(siteFlowList.value);
-}
-
-const searchCar = () => {
-    var obj = {
-        pageSize: queryParams.value.pageSize,
-        pageNum: queryParams.value.pageNum,
-        carNum: queryParams.value.carNum,
-        params: {
-            starttime: moment(dataValue.value[0]).format("YYYY-MM-DD HH:mm:ss"),
-            endtime: moment(dataValue.value[1]).format("YYYY-MM-DD HH:mm:ss")
-        }
+
+    /** 搜索按钮操作 */
+    const handleQuery = () => {
+        queryParams.value.pageNum = 1;
+        getList();
     }
-    liststaticFlow(obj).then(res => {
-        total.value = res.total
-        table1.value.setButton([]);
-        for (var index in res.rows) {
-            res.rows[index].startTime = moment(dataValue.value[0]).format("YYYY-MM-DD HH:mm:ss")
-            res.rows[index].endTime = moment(dataValue.value[1]).format("YYYY-MM-DD HH:mm:ss")
-        }
-        table1.value.setDataList(res.rows);
-    })
-}
-
-const searchSite = () => {
-    var sites = []
-    for(var index in carPathList.value){
-         if(queryParams2.value.line == carPathList.value[index].id){
-              for(var j in JSON.parse(carPathList.value[index].stationList)){
-                   var station = JSON.parse(carPathList.value[index].stationList)[j].data
-                   sites.push(station.dictLabel)
-              }
-         }
+
+    /** 重置按钮操作 */
+    const resetQuery = () => {
+        queryFormRef.value?.resetFields();
+        handleQuery();
+    }
+
+    /** 多选框选中数据 */
+    const handleSelectionChange = (selection: CarInfoVO[]) => {
+        ids.value = selection.map(item => item.id);
+        single.value = selection.length != 1;
+        multiple.value = !selection.length;
+    }
+
+    /** 新增按钮操作 */
+    const handleAdd = () => {
+        reset();
+        dialog.visible = true;
+        dialog.title = "添加车辆信息";
     }
-    var params = {
-        starttime: moment(dataValue2.value[0]).format("YYYY-MM-DD HH:mm:ss"),
-        endtime: moment(dataValue2.value[1]).format("YYYY-MM-DD HH:mm:ss")
+
+    /** 修改按钮操作 */
+    const handleUpdate = async (row?: CarInfoVO) => {
+        reset();
+        const _id = row?.id || ids.value[0]
+        const res = await getCarInfo(_id);
+        Object.assign(form.value, res.data);
+        dialog.visible = true;
+        dialog.title = "修改车辆信息";
     }
-    if(sites.length > 0){
-        params.sites = sites.join(',')
+
+    const childrenClick = (data) => {
+        eval(data.func + "(data.data)")
     }
-    var obj = {
-        dictLabel:queryParams2.value.site,
-        pageSize: queryParams2.value.pageSize,
-        pageNum: queryParams2.value.pageNum,
-        params: params
+
+    const openDialog = () => {
+        dialog.visible = true
     }
-    listsitesFlow(obj).then(res => {
-        total2.value = res.total
-        for (var index in res.rows) {
-            res.rows[index].startTime = moment(dataValue.value[0]).format("YYYY-MM-DD HH:mm:ss")
-            res.rows[index].endTime = moment(dataValue.value[1]).format("YYYY-MM-DD HH:mm:ss")
-            if(res.rows[index].others == null || res.rows[index].others == ''){
-                var countData = {
-                    incount:0,
-                    outcount:0
+
+    /** 提交按钮 */
+    const submitForm = () => {
+        carInfoFormRef.value?.validate(async (valid: boolean) => {
+            if (valid) {
+                buttonLoading.value = true;
+                if (form.value.id) {
+                    await updateCarInfo(form.value).finally(() => buttonLoading.value = false);
+                } else {
+                    await addCarInfo(form.value).finally(() => buttonLoading.value = false);
                 }
-                res.rows[index].others = countData
+                proxy?.$modal.msgSuccess("修改成功");
+                dialog.visible = false;
+                await getList();
             }
-        }
-        console.log(res.rows)
-        table2.value.setButton([]);
-        table2.value.setDataList(res.rows);
-    })
-}
+        });
+    }
 
-const getFlowData = (carCode, carNum) => {
-    var obj = {
-        starttime: moment(dataValue.value[0]).format('YYYY-MM-DD'),
-        endtime: moment(dataValue.value[1]).format('YYYY-MM-DD')
+    /** 删除按钮操作 */
+    const handleDelete = async (row?: CarInfoVO) => {
+        const _ids = row?.id || ids.value;
+        await proxy?.$modal.confirm('是否确认删除车辆信息编号为"' + _ids + '"的数据项?').finally(() => loading.value = false);
+        await delCarInfo(_ids);
+        proxy?.$modal.msgSuccess("删除成功");
+        await getList();
     }
-    getCountData({ devicecode: carCode, params: obj }).then(res => {
-        var data = {
-            carNum: carNum,
-            startTime: moment(dataValue.value[0]).format('YYYY-MM-DD'),
-            endTime: moment(dataValue.value[1]).format('YYYY-MM-DD'),
-            upCount: res.data.totalin,
-            downCount: res.data.totalout
+
+    /** 导出按钮操作 */
+    const handleExport = () => {
+        proxy?.download('system/carInfo/export', {
+            ...queryParams.value
+        }, `carInfo_${new Date().getTime()}.xlsx`)
+    }
+
+    const initData = async () => {
+        const res = await listCarPath({ pageSize: 1000 });
+        carPathList.value = res.rows
+        const res2 = await listCarInfo({ pageSize: 1000 });
+        carInfoList.value = res2.rows
+        var params = {
+            starttime: moment(dataValue2.value[0]).format("YYYY-MM-DD HH:mm:ss"),
+            endtime: moment(dataValue2.value[1]).format("YYYY-MM-DD HH:mm:ss")
         }
-        carFlowList.value.push(data);
-    })
-}
+        const res3 = await listCarSchedule({ pageSize: 1000, params: params })
+        getSites();
+        carFlowList.value = [];
+        siteFlowList.value = [];
+        searchCar();
+        searchSite();
+        // for (var index in carInfoList.value) {
+        //     if (carInfoList.value[index].deviceInfos != null) {
+        //         var deviceCode = JSON.parse(carInfoList.value[index].deviceInfos)[0].code
+        //         console.log(deviceCode)
+        //         await getFlowData(deviceCode, carInfoList.value[index].carNum)
+        //     }
+        //     //getFlowData();
+        // }
+        // for (var index in res3.data) {
+        //     if (res3.data[index].ext1 != null) {
+        //         var siteList = JSON.parse(res3.data[index].ext1)
+        //         var gpsCode = ''
+        //         for (var j in carInfoList.value) {
+        //             if (carInfoList.value[j].carNum == res3.data[index]) {
+        //                 gpsCode = JSON.parse(carInfoList.value[index].deviceInfos)[0].code
+        //             }
+        //         }
+        //         for (var key in siteList) {
+        //             var obj = siteList[key]
+        //             await getSiteData(key, gpsCode, obj.intime, obj.outtime);
+        //         }
+        //     }
+        // }
+        // table2.value.setButton([]);
+        // console.log(carFlowList.value)
+        // table2.value.setDataList(siteFlowList.value);
+    }
 
-const getSiteData = (carCode, siteName, startTime, endTime) => {
-    var obj = {
-        starttime: startTime,
-        endtime: endTime
+    const searchCar = () => {
+        var obj = {
+            pageSize: queryParams.value.pageSize,
+            pageNum: queryParams.value.pageNum,
+            carNum: queryParams.value.carNum,
+            params: {
+                starttime: moment(dataValue.value[0]).format("YYYY-MM-DD HH:mm:ss"),
+                endtime: moment(dataValue.value[1]).format("YYYY-MM-DD HH:mm:ss")
+            }
+        }
+        if (deptId.value != null) {
+            obj.params["ext1$dept"] = deptId.value
+        }
+        liststaticFlow(obj).then(res => {
+            total.value = res.total
+            table1.value.setButton([]);
+            for (var index in res.rows) {
+                res.rows[index].startTime = moment(dataValue.value[0]).format("YYYY-MM-DD HH:mm:ss")
+                res.rows[index].endTime = moment(dataValue.value[1]).format("YYYY-MM-DD HH:mm:ss")
+            }
+            table1.value.setDataList(res.rows);
+        })
     }
-    getCountData({ devicecode: carCode, params: obj }).then(res => {
-        var data = {
-            siteName: siteName,
-            startTime: moment(dataValue.value[0]).format('YYYY-MM-DD'),
-            endTime: moment(dataValue.value[1]).format('YYYY-MM-DD'),
-            upCount: res.data.totalin,
-            downCount: res.data.totalout
+
+    const searchSite = () => {
+        var sites = []
+        for (var index in carPathList.value) {
+            if (queryParams2.value.line == carPathList.value[index].id) {
+                for (var j in JSON.parse(carPathList.value[index].stationList)) {
+                    var station = JSON.parse(carPathList.value[index].stationList)[j].data
+                    sites.push(station.dictLabel)
+                }
+            }
         }
-        siteFlowList.value.push(data);
-    })
-}
+        var params = {
+            starttime: moment(dataValue2.value[0]).format("YYYY-MM-DD HH:mm:ss"),
+            endtime: moment(dataValue2.value[1]).format("YYYY-MM-DD HH:mm:ss")
+        }
+        if (sites.length > 0) {
+            params.sites = sites.join(',')
+        }
+        var obj = {
+            dictLabel: queryParams2.value.site,
+            pageSize: queryParams2.value.pageSize,
+            pageNum: queryParams2.value.pageNum,
+            params: params
+        }
+        listsitesFlow(obj).then(res => {
+            total2.value = res.total
+            for (var index in res.rows) {
+                res.rows[index].startTime = moment(dataValue.value[0]).format("YYYY-MM-DD HH:mm:ss")
+                res.rows[index].endTime = moment(dataValue.value[1]).format("YYYY-MM-DD HH:mm:ss")
+                if (res.rows[index].others == null || res.rows[index].others == '') {
+                    var countData = {
+                        incount: 0,
+                        outcount: 0
+                    }
+                    res.rows[index].others = countData
+                }
+            }
+            console.log(res.rows)
+            table2.value.setButton([]);
+            table2.value.setDataList(res.rows);
+        })
+    }
+
+    const getFlowData = (carCode, carNum) => {
+        var obj = {
+            starttime: moment(dataValue.value[0]).format('YYYY-MM-DD'),
+            endtime: moment(dataValue.value[1]).format('YYYY-MM-DD')
+        }
+        getCountData({ devicecode: carCode, params: obj }).then(res => {
+            var data = {
+                carNum: carNum,
+                startTime: moment(dataValue.value[0]).format('YYYY-MM-DD'),
+                endTime: moment(dataValue.value[1]).format('YYYY-MM-DD'),
+                upCount: res.data.totalin,
+                downCount: res.data.totalout
+            }
+            carFlowList.value.push(data);
+        })
+    }
 
-const getStationData = (carCode, siteName) => {
-    var obj = {
-        starttime: moment(dataValue.value[0]).format('YYYY-MM-DD'),
-        endtime: moment(dataValue.value[1]).format('YYYY-MM-DD')
+    const getSiteData = (carCode, siteName, startTime, endTime) => {
+        var obj = {
+            starttime: startTime,
+            endtime: endTime
+        }
+        getCountData({ devicecode: carCode, params: obj }).then(res => {
+            var data = {
+                siteName: siteName,
+                startTime: moment(dataValue.value[0]).format('YYYY-MM-DD'),
+                endTime: moment(dataValue.value[1]).format('YYYY-MM-DD'),
+                upCount: res.data.totalin,
+                downCount: res.data.totalout
+            }
+            siteFlowList.value.push(data);
+        })
     }
-    getCountData({ devicecode: carCode, params: obj }).then(res => {
-        var data = {
-            siteName: siteName,
-            startTime: moment(dataValue.value[0]).format('YYYY-MM-DD'),
-            endTime: moment(dataValue.value[1]).format('YYYY-MM-DD'),
-            upCount: res.data.totalin,
-            downCount: res.data.totalout
+
+    const getStationData = (carCode, siteName) => {
+        var obj = {
+            starttime: moment(dataValue.value[0]).format('YYYY-MM-DD'),
+            endtime: moment(dataValue.value[1]).format('YYYY-MM-DD')
         }
-        carFlowList.value.push(data);
-    })
-}
+        getCountData({ devicecode: carCode, params: obj }).then(res => {
+            var data = {
+                siteName: siteName,
+                startTime: moment(dataValue.value[0]).format('YYYY-MM-DD'),
+                endTime: moment(dataValue.value[1]).format('YYYY-MM-DD'),
+                upCount: res.data.totalin,
+                downCount: res.data.totalout
+            }
+            carFlowList.value.push(data);
+        })
+    }
 
-onMounted(() => {
-    initData();
-});
+    onMounted(() => {
+        initData();
+        getTreeSelect();
+    });
 </script>
 
 
-<style></style>
+<style></style>

+ 1 - 1
src/views/yunying/kdg/index.vue

@@ -17,7 +17,7 @@
           </div>
         </div>
         <div style="margin-top: 20px; padding-left: 10px">
-          <el-select v-model="line" placeholder="请选择路线" style="width: 240px" @change="getCountrySites()">
+          <el-select v-model="line" placeholder="请选择乡镇" style="width: 240px" @change="getCountrySites()">
             <el-option v-for="item in countryList" :key="item.id" :label="item.name" :value="item.id" />
           </el-select>
           <el-input style="margin-top: 10px;" v-model="filterText" placeholder="输入关键字" />

+ 488 - 0
src/views/yunying/videoKdg/index.vue

@@ -0,0 +1,488 @@
+<!-- eslint-disable prettier/prettier -->
+<template>
+    <div class="p-2" style="padding: 10px">
+        <div style="display: flex; flex-direction: row">
+            <div style="width: 20%">
+                <div class="card-header">
+                    <div style="display: flex; flex-direction: row">
+                        <div style="width: 4px; height: 19px; opacity: 1; background: #409eff"></div>
+                        <span style="
+                    font-family: PingFang SC;
+                    font-size: 14px;
+                    font-weight: normal;
+                    line-height: 19px;
+                    height: 19px;
+                    margin-left: 5px;
+                  ">快递柜列表</span>
+                    </div>
+                </div>
+                <div style="margin-top: 20px; padding-left: 10px">
+                    <!-- <el-select v-model="line" placeholder="请选择路线" style="width: 240px" @change="getCountrySites()">
+                        <el-option v-for="item in countryList" :key="item.id" :label="item.name" :value="item.id" />
+                    </el-select>
+                    <el-input style="margin-top: 10px;" v-model="filterText" placeholder="输入关键字" /> -->
+                    <el-tree-v2 v-if="showTree" style="margin-top: 10px" ref="treeRef" class="filter-tree"
+                        :height="gettreeheight()" :data="data" :indent="treeIndent" :props="defaultProps"
+                        :filter-method="filterNode" @node-click="treeclick">
+                        <template v-slot:default="{ node }">
+                            <element-tree-line :node="node" :treeData="data" :showLabelLine="false"
+                                :indent="treeIndent">
+                            </element-tree-line>
+                        </template>
+                    </el-tree-v2>
+                </div>
+            </div>
+            <div style="width: 77%; margin-left: 2%">
+                <div style="display: flex;flex-direction: column;">
+                    <div style="display: flex;flex-direction: row;">
+                        <div style="width: 33%;">
+                            <videoDiv videoId="video-container1" ref="video1" v-if="videoCount > 0"></videoDiv>
+                        </div>
+                        <div style="width: 33%;">
+                            <videoDiv videoId="video-container2" ref="video2" v-if="videoCount > 1"></videoDiv>
+                        </div>
+                        <div style="width: 33%;">
+                            <videoDiv videoId="video-container3" ref="video3" v-if="videoCount > 2"></videoDiv>
+                        </div>
+                    </div>
+                    <div style="display: flex;flex-direction: row;">
+                        <div style="width: 33%;">
+                            <videoDiv videoId="video-container4" ref="video4" v-if="videoCount > 3"></videoDiv>
+                        </div>
+                        <div style="width: 33%;">
+                            <videoDiv videoId="video-container5" ref="video5" v-if="videoCount > 4"></videoDiv>
+                        </div>
+                        <div style="width: 33%;">
+                            <videoDiv videoId="video-container6" ref="video6" v-if="videoCount > 5"></videoDiv>
+                        </div>
+                    </div>
+                    <div style="display: flex;flex-direction: row;">
+                        <div style="width: 33%;">
+                            <videoDiv videoId="video-container7" ref="video7" v-if="videoCount > 6"></videoDiv>
+                        </div>
+                        <div style="width: 33%;">
+                            <videoDiv videoId="video-container8" ref="video8" v-if="videoCount > 7"></videoDiv>
+                        </div>
+                        <div style="width: 33%;">
+                            <videoDiv videoId="video-container9" ref="video9" v-if="videoCount > 8"></videoDiv>
+                        </div>
+                    </div>
+                </div>
+                <div class="example-pagination-block" v-if="total > 0">
+                    <el-pagination layout="prev, pager, next" :total="total" :current-page="CurrentPage"
+                        @current-change="pageChange" />
+                </div>
+            </div>
+        </div>
+
+    </div>
+</template>
+
+<script setup name="CarInfo" lang="ts">
+    import { listCountry, getCountry, delCountry, addCountry, updateCountry } from '@/api/country';
+    import { TreeNode } from "element-plus";
+    import { useRoute, useRouter } from "vue-router";
+    import EZUIKit from 'ezuikit-js';
+    import { ElMessage, ElMessageBox } from 'element-plus'
+    import { getCameraPlayerConfig } from '@/api/gpsData';
+    import { updateData, listData } from "@/api/system/dict/data";
+    import imgulock from "@/assets/images/unlock@2x.png";
+    import videoDiv from "@/components/Public/videoDiv.vue"
+
+
+    const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+
+    const sites = ref([]);
+
+    const showTree = ref(true)
+
+    const type = ref([])
+
+    const total = ref(0);
+    const CurrentPage = ref(1)
+
+    const videoCount = ref(9)
+
+    const boxData = ref([])
+    const boxCode = ref(null)
+    const showKdg = ref(false)
+
+
+    const formdata = ref({
+        name: "",
+        type: "",
+        code: ""
+    })
+
+
+    const route = useRoute();
+    const router = useRouter();
+
+    const tableData = ref([]);
+    const carPathList = ref([]);
+    const line = ref([]);
+
+    const activeName = ref("camera")
+
+    const countryList = ref([])
+
+    const deviceData = ref([])
+
+    const filterText = ref("");
+    const treeRef = ref(null);
+    const dialogVisible = ref(false);
+
+    const gettreeheight = () => {
+        return document.body.clientHeight - 300;
+    }
+
+    const goAdd = () => {
+        dialogVisible.value = true
+        formdata.value = {
+            name: "",
+            type: "",
+            code: ""
+        }
+    }
+
+
+    const defaultProps = {
+        children: "children",
+        label: "label",
+        value: 'id',
+    };
+    const treeIndent = ref(40);
+
+    watch(filterText, (val) => {
+        if (treeRef.value) {
+            treeRef.value.filter(val);
+        }
+    });
+
+    const pageChange = (val) => {
+        CurrentPage.value = val
+        var pageData = val-1
+        const deviceList = deviceData.value
+        var videoList = []
+        if (deviceList.length > val * 9) {
+            videoCount.value = 9
+            for (var index = 0; index < 9; index++) {
+                videoList.push(deviceList[pageData * 9+index])
+            }
+        } else {
+            videoCount.value = deviceList.length-pageData*9
+            for (var index = 0; index < deviceList.length-pageData*9; index++) {
+                console.log(pageData * 9 + index)
+                videoList.push(deviceList[pageData * 9 + index])
+            }
+        }
+        console.log("摄像头列表"+videoList)
+        setTimeout(() => {
+            initVideos(videoList)
+        }, 100);
+    }
+
+    const getSites = () => {
+        listData({ dictType: "tbl_sites" }).then(res2 => {
+            sites.value = res2.rows;
+        });
+    }
+
+    const handleTabClick = () => {
+
+    }
+
+    const filterNode = (value: string, node: TreeNode) => {
+        if (node.id == 1) return true;
+        console.log(node.label.indexOf(value) != -1)
+        return node.label.indexOf(value) != -1;
+    };
+
+    const currentdata = ref(null)
+
+    const treeclick = (data: TreeNodeData, node: TreeNode) => {
+        //    console.log(data.data.sites)
+        var siteList = data.data.sites.split(",")
+        var deviceList = [];
+        for (var i in sites.value) {
+            if (siteList.indexOf(sites.value[i].dictCode) > -1) {
+                if (isJSON(sites.value[i].remark)) {
+                    var deviceJson = JSON.parse(sites.value[i].remark)
+                    console.log(sites.value[i].remark)
+                    for (var j in deviceJson) {
+                        if (deviceJson[j].type == "camera") {
+                            console.log(deviceJson[j].code)
+                            deviceList.push(deviceJson[j].code);
+                        }
+                    }
+                }
+            }
+        }
+        deviceData.value = deviceList
+        total.value = deviceList.length
+        CurrentPage.value = 1
+        const videoList = []
+        if (deviceList.length > 9) {
+            console.log(deviceList)
+            for (var index = 0; index < 9; index++) {
+                videoCount.value = 9
+                videoList.push(deviceList[index])
+            }
+        } else {
+            for (var index in deviceList) {
+                videoCount.value = deviceList.length;
+                videoList.push(deviceList[index])
+            }
+        }
+        initVideos(videoList)
+    }
+
+    const initVideos = (videoList) => {
+        for (var index in videoList) {
+            initVideoDiv(index, videoList[index])
+            // setTimeout(() => {
+            //     initVideoDiv(index, videoList[index])
+            // }, 1000);
+        }
+    }
+
+    const initVideoDiv = (index, code) => {
+        console.log(index)
+        console.log(code)
+        if (index == 0) {
+            // console.log(code)
+            proxy.$refs.video1.initVideo(code)
+        } else if (index == 1) {
+            // console.log(code)
+            proxy.$refs.video2.initVideo(code)
+            // console.log(code)
+        } else if (index == 2) {
+            // console.log(code)
+            proxy.$refs.video3.initVideo(code)
+        } else if (index == 3) {
+            // console.log(code)
+            proxy.$refs.video4.initVideo(code)
+        } else if (index == 4) {
+            proxy.$refs.video5.initVideo(code)
+        } else if (index == 5) {
+            proxy.$refs.video6.initVideo(code)
+        } else if (index == 6) {
+            proxy.$refs.video7.initVideo(code)
+        } else if (index == 7) {
+            proxy.$refs.video8.initVideo(code)
+        } else if (index == 8) {
+            proxy.$refs.video9.initVideo(code)
+        }
+    }
+
+    const isJSON = (str) => {
+        if (typeof str == 'string') {
+            try {
+                var obj = JSON.parse(str);
+                if (typeof obj == 'object' && obj) {
+                    return true;
+                } else {
+                    return false;
+                }
+
+            } catch (e) {
+                return false;
+            }
+        }
+    }
+
+    const getBoxInfoData = (code) => {
+        showKdg.value = false
+        getBoxInfo(code).then(res => {
+            boxData.value = res.data.list
+            showKdg.value = true
+            console.log(boxData.value)
+        })
+    }
+
+    const addDevice = () => {
+        dialogVisible.value = false;
+        if (formdata.value.name == "") {
+            ElMessage.warning("设备名称未填写");
+            return;
+        }
+        if (formdata.value.type == "") {
+            ElMessage.warning("设备类型未填写");
+            return;
+        }
+        if (formdata.value.code == "") {
+            ElMessage.warning("设备序列号未填写");
+            return;
+        }
+        if (tableData.value.filter(i => i.type == formdata.value.type).length > 0) {
+            ElMessage.warning("存在相同类型的设备");
+            return;
+        }
+        tableData.value.push(formdata.value);
+        var data = {
+            dictCode: currentdata.value.dictCode,
+            dictValue: currentdata.value.value,
+            dictLabel: currentdata.value.label,
+            dictType: "tbl_sites",
+            remark: JSON.stringify(tableData.value)
+        }
+        updateData(data).then(res => {
+            ElMessage.success("成功!");
+        })
+
+
+    }
+
+    const currentCabinet = ref({
+        total: 40,
+        unused: 10,
+        boxlist: []
+    })
+    const SycCabinet = (code) => {
+        //TODO 获取格数
+        // var toalnum
+        currentCabinet.value.boxlist = [];
+        for (var i = 0; i < currentCabinet.value.total; i++) {
+            // eslint-disable-next-line @typescript-eslint/ban-ts-comment
+            //@ts-ignore
+            currentCabinet.value.boxlist.push({
+                box_id: 1,
+                box_name: (i + 1) + "",
+                box_status: i % 2
+            }
+            )
+        }
+    }
+    // const openbox = (code) => {
+    //   setTimeout(() => {
+    //     ElMessage.success("指令已发送!");
+    //   }, 1000);
+    // }
+
+    const formatIndex = (value) => {
+        if (value < 10) {
+            return '0' + value
+        } else {
+            return value
+        }
+    }
+
+    const getStatus = (index) => {
+        console.log(boxData.value.length)
+        if (index - 1 < boxData.value.length) {
+            if (boxData.value[index - 1].box_use_status == 0) {
+                return '空闲中'
+            } else {
+                return '使用中'
+            }
+        } else {
+            return '暂无'
+        }
+
+    }
+
+    const getCountrySites = () => {
+        for (var i in countryList.value) {
+            if (line.value == countryList.value[i].id) {
+                console.log(countryList.value[i].sites)
+                var siteList = countryList.value[i].sites.split(",")
+                var siteObjList = [];
+                for (var j in sites.value) {
+                    if (siteList.indexOf(sites.value[j].dictCode) > -1) {
+                        siteObjList.push(sites.value[j])
+                    }
+                }
+                updateSites(siteObjList)
+            }
+        }
+    }
+
+    const getCountry = () => {
+        listCountry({ pageSize: 10000 }).then(res => {
+            console.log(res)
+            countryList.value = res.rows
+        })
+    }
+
+    const updateSites = (sitesList) => {
+        console.log(sitesList)
+        var sites = []
+        for (var i in sitesList) {
+
+            sites.push({ id: i, label: sitesList[i].dictLabel })
+        }
+        console.log(sites)
+        data.value = [{
+            id: 1,
+            label: "站点",
+        },];
+        data.value[0].children = sites
+        console.log(data.value)
+        showTree.value = false;
+        setTimeout(() => {
+            showTree.value = true
+        }, 100);
+    }
+
+    const data = computed(() => {
+
+        var index = 1;
+
+        return [{
+            id: 1,
+            label: "乡镇",
+            children: countryList.value.map(i => { return { id: ++index, label: i.name, data: i } }),
+        },]
+    });
+    onMounted(() => {
+        if (treeRef.value) {
+            setTimeout(() => {
+                treeRef.value.expandNode(treeRef.value.getNode(1))
+            }, 100);
+            getSites();
+            // initData();
+            getCountry();
+            // treeRef.value.expandNode(treeRef.value.getNode(1))
+        }
+    });
+</script>
+
+<style lang="scss" scoped>
+    .card-header {
+        display: flex;
+        flex-direction: row;
+        justify-content: space-between;
+    }
+
+    .boxunused {
+        background: #3333332d;
+    }
+
+    .indexDiv {
+        background-color: white;
+        width: 20px;
+        height: 10px;
+        color: #000;
+        font-weight: 600;
+        position: absolute;
+        right: 2px;
+        bottom: 1px;
+        z-index: 1000;
+        font-size: 10px;
+        text-align: center;
+    }
+
+    .indexDivLeft {
+        background-color: white;
+        width: 40px;
+        height: 10px;
+        color: #000;
+        font-weight: 600;
+        position: absolute;
+        left: 2px;
+        bottom: 1px;
+        z-index: 1000;
+        font-size: 10px;
+        text-align: center;
+    }
+</style>