|
@@ -3,134 +3,50 @@
|
|
|
<!-- 树形组件start -->
|
|
|
<div class="grid-content treeDom">
|
|
|
<div style="text-align: center" class="mb-20">
|
|
|
- <el-button
|
|
|
- v-if="treeLevel == 3 || groupingId == 0 || treeLevel == 1"
|
|
|
- disabled
|
|
|
- >
|
|
|
+ <el-button :type="treeLevel == 3 || groupingId == 0 || treeLevel == 1 ? '' : 'primary'" @click="addGroup()"
|
|
|
+ :disabled="treeLevel == 3 || groupingId == 0 || treeLevel == 1 || store.state.authorities.indexOf('新增') == -1">
|
|
|
添加分组
|
|
|
</el-button>
|
|
|
- <el-button
|
|
|
- v-else
|
|
|
- type="primary"
|
|
|
- @click="addGroup()"
|
|
|
- :disabled="store.state.authorities.indexOf('新增') == -1"
|
|
|
- >
|
|
|
- 添加分组
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- v-if="treeLevel == 3 || groupingId == 0 || treeLevel == 1"
|
|
|
- disabled
|
|
|
- >
|
|
|
- 添加站点
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- v-else
|
|
|
- type="primary"
|
|
|
- @click="addSite()"
|
|
|
- :disabled="store.state.authorities.indexOf('新增') == -1"
|
|
|
- >
|
|
|
+ <el-button :type="treeLevel == 3 || groupingId == 0 || treeLevel == 1 ? '' : 'primary'" @click="addSite()"
|
|
|
+ :disabled="treeLevel == 3 || groupingId == 0 || treeLevel == 1 || store.state.authorities.indexOf('新增') == -1">
|
|
|
添加站点
|
|
|
</el-button>
|
|
|
</div>
|
|
|
- <el-input
|
|
|
- placeholder="输入关键字进行过滤"
|
|
|
- v-model="filterText"
|
|
|
- class="mb-20 searchInput"
|
|
|
- >
|
|
|
- <template>
|
|
|
- <i class="el-icon-search el-input__icon"></i>
|
|
|
- </template>
|
|
|
- </el-input>
|
|
|
- <!-- <el-scrollbar> -->
|
|
|
-
|
|
|
- <!-- <el-tree
|
|
|
- :data="data2"
|
|
|
- show-checkbox
|
|
|
- node-key="id"
|
|
|
- :default-expanded-keys="[1]"
|
|
|
- :default-checked-keys="[368]"
|
|
|
- :props="defaultProps2"
|
|
|
- /> -->
|
|
|
- <el-tree
|
|
|
- class="filter-tree siteTree"
|
|
|
- ref="tree"
|
|
|
- :data="data"
|
|
|
- node-key="id"
|
|
|
- :props="defaultProps"
|
|
|
- :filter-node-method="filterNode"
|
|
|
- @node-click="handleNodeClick"
|
|
|
- :expand-on-click-node="false"
|
|
|
- :highlight-current="showTree"
|
|
|
- default-expand-all
|
|
|
- :current-node-key="defaultExpand"
|
|
|
- >
|
|
|
+ <el-input placeholder="输入关键字进行过滤" v-model="filterText" class="mb-20 searchInput"></el-input>
|
|
|
+
|
|
|
+ <el-tree class="filter-tree siteTree" ref="tree" :data="treeData" node-key="id"
|
|
|
+ :props="{ children: 'children', label: 'label', }" :filter-node-method="filterNode" @node-click="handleNodeClick"
|
|
|
+ :expand-on-click-node="false" :highlight-current="true" default-expand-all :current-node-key="0">
|
|
|
<template #default="{ node, data }">
|
|
|
- <span
|
|
|
- class="custom-tree-node"
|
|
|
- style="width: 100%"
|
|
|
- @mouseenter="mouseenter(data)"
|
|
|
- @mouseleave="mouseleave(data)"
|
|
|
- >
|
|
|
+ <span class="custom-tree-node" style="width: 100%" @mouseenter="(event) => event.show = true"
|
|
|
+ @mouseleave="(event) => event.show = false">
|
|
|
<span>{{ node.label }}</span>
|
|
|
- <!-- <el-tooltip
|
|
|
- class="item"
|
|
|
- effect="dark"
|
|
|
- :content="node.label"
|
|
|
- placement="top-start"
|
|
|
- >
|
|
|
- <span>{{ node.label }}</span>
|
|
|
- </el-tooltip> -->
|
|
|
+ <!-- <el-tooltip class="item" effect="dark" :content="node.label" placement="top-start">
|
|
|
+ <span>{{ node.label }}</span>
|
|
|
+ </el-tooltip> -->
|
|
|
<span>
|
|
|
- <a
|
|
|
- class="deleteLink"
|
|
|
- v-show="data.show"
|
|
|
- @click="remove(node, data)"
|
|
|
- >
|
|
|
+ <a class="deleteLink" v-show="data.show" @click="remove(node, data)">
|
|
|
<!-- <i size="mini" class="el-icon-delete"></i> -->
|
|
|
</a>
|
|
|
</span>
|
|
|
</span>
|
|
|
</template>
|
|
|
</el-tree>
|
|
|
-
|
|
|
- <!-- </el-scrollbar> -->
|
|
|
</div>
|
|
|
<!-- 树形组件end -->
|
|
|
|
|
|
<!-- 站点主题start -->
|
|
|
- <div
|
|
|
- class="grid-content nestingDom"
|
|
|
- style="width: calc(100% - 300px)"
|
|
|
- v-if="flag2 && treeLevel != 1"
|
|
|
- >
|
|
|
- <el-tabs
|
|
|
- v-if="treeLevel == 3 || groupingId == 0"
|
|
|
- v-model="activeName"
|
|
|
- type="card"
|
|
|
- >
|
|
|
+ <div class="grid-content nestingDom" style="width: calc(100% - 300px)" v-if="flag2 && treeLevel != 1">
|
|
|
+ <el-tabs v-if="treeLevel == 3 || groupingId == 0" v-model="activeName" type="card">
|
|
|
<el-tab-pane label="基本信息" name="first">
|
|
|
- <basic-info
|
|
|
- class="basicInfo"
|
|
|
- :siteId="siteId"
|
|
|
- :groupingId="groupingId"
|
|
|
- :siteName="siteName"
|
|
|
- @func="getMsgFormSon3"
|
|
|
- :activeName="activeName"
|
|
|
- ></basic-info>
|
|
|
+ <basic-info class="basicInfo" :siteId="siteId" :groupingId="groupingId" :siteName="siteName"
|
|
|
+ @func="getMsgFormSon3" :activeName="activeName"></basic-info>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="监控设备" name="second">
|
|
|
- <watch-dog
|
|
|
- v-on:success="success(res)"
|
|
|
- :activeName="activeName"
|
|
|
- @func="getMsgFormSon"
|
|
|
- :siteId="siteId"
|
|
|
- ></watch-dog>
|
|
|
+ <watch-dog ref="watchDogRef" :siteId="siteId" :activeName="activeName" @func="activeName = 'third'"></watch-dog>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="变量列表" name="third">
|
|
|
- <variable-list
|
|
|
- :activeName="activeName"
|
|
|
- :siteId="siteId"
|
|
|
- ></variable-list>
|
|
|
+ <variable-list :activeName="activeName" :siteId="siteId"></variable-list>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="摄像头" name="five">
|
|
|
<camera :siteId="siteId" :activeName="activeName"></camera>
|
|
@@ -140,213 +56,132 @@
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
|
|
|
- <!-- 分组信息start -->
|
|
|
- <group-info-com
|
|
|
- :groupingId="groupingId"
|
|
|
- :label="label"
|
|
|
- @func="getMsgFormSon2"
|
|
|
- v-else
|
|
|
- ></group-info-com>
|
|
|
- <!-- 分组信息end -->
|
|
|
-
|
|
|
- <!-- 新建分组start -->
|
|
|
- <add-group-com
|
|
|
- :dialogTitle="dialogTitle"
|
|
|
- :itemInfo="tableItem"
|
|
|
- @closeDialog="closeDialog('默认关闭')"
|
|
|
- :flag="showDialog"
|
|
|
- ></add-group-com>
|
|
|
- <!-- 新建分组end -->
|
|
|
-
|
|
|
- <!-- 新建站点start -->
|
|
|
- <add-site-com
|
|
|
- :dialogTitle="dialogTitle"
|
|
|
- :itemInfo="tableItem"
|
|
|
- :groupingId="groupingId"
|
|
|
- @closeDialog="closeDialog"
|
|
|
- :flag="showDialog2"
|
|
|
- @changeFather="getFromSon"
|
|
|
- ></add-site-com>
|
|
|
- <!-- 新建站点end -->
|
|
|
+ <!-- 分组信息 -->
|
|
|
+ <group-info-com ref="groupInfoComRef" :groupingId="groupingId" :groupingName="groupingName"
|
|
|
+ @handleSelect="siteTreeList(), treeLevel = 1" v-else></group-info-com>
|
|
|
+ <!-- 新建分组 -->
|
|
|
+ <add-group-com ref="addGroupComRef" @handleSelect="siteTreeList"></add-group-com>
|
|
|
+ <!-- 新建站点 -->
|
|
|
+ <add-site-com ref="addSiteComRef" :groupingId="groupingId" @changeFather="getFromSon"
|
|
|
+ @handleSelect="siteTreeList"></add-site-com>
|
|
|
</div>
|
|
|
<!-- 站点主题end -->
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
- import { ref, watch, onMounted, nextTick } from 'vue'
|
|
|
-
|
|
|
- import basicInfo from './basicInfo'
|
|
|
- import WatchDog from './watchDog'
|
|
|
- import variableList from './variableList'
|
|
|
- import camera from './camera'
|
|
|
- // import PowerScore from './powerScore'
|
|
|
-
|
|
|
- import groupInfoCom from './groupInfoCom'
|
|
|
- import addGroupCom from './addGroupCom'
|
|
|
- import addSiteCom from './addSiteCom'
|
|
|
-
|
|
|
- import * as api from '@/api/siteManage/index'
|
|
|
- import { ElMessage } from 'element-plus'
|
|
|
- import { useStore } from 'vuex'
|
|
|
- import { useRoute } from 'vue-router'
|
|
|
-
|
|
|
- const store = useStore()
|
|
|
- const route = useRoute()
|
|
|
- const flag2 = ref(false)
|
|
|
- const tree = ref(null)
|
|
|
- const showTree = ref(true)
|
|
|
- const defaultExpand = ref(0)
|
|
|
- const showDialog = ref(false)
|
|
|
- const showDialog2 = ref(false)
|
|
|
- const dialogTitle = ref('')
|
|
|
- const treeLevel = ref(3)
|
|
|
- const groupingId = ref(1)
|
|
|
- const siteId = ref(0)
|
|
|
- const labelCom = ref('')
|
|
|
- const siteName = ref('')
|
|
|
- const label = ref('')
|
|
|
- const activeName = ref('first')
|
|
|
- const filterText = ref('')
|
|
|
- const selectNode = ref(0)
|
|
|
-
|
|
|
- const data = ref([
|
|
|
+/*----------------------------------依赖引入-----------------------------------*/
|
|
|
+import { useStore } from 'vuex'
|
|
|
+import { useRoute } from 'vue-router'
|
|
|
+import { ElMessage, ElNotification } from 'element-plus'
|
|
|
+import { ref, onMounted, watch, getCurrentInstance, reactive, toRefs, nextTick } from 'vue'
|
|
|
+/*----------------------------------接口引入-----------------------------------*/
|
|
|
+import * as api from '@/api/siteManage/index'
|
|
|
+/*----------------------------------组件引入-----------------------------------*/
|
|
|
+import PowerScore from './powerScore'
|
|
|
+import basicInfo from './basicInfo'
|
|
|
+import WatchDog from './watchDog'
|
|
|
+import variableList from './variableList'
|
|
|
+import camera from './camera'
|
|
|
+
|
|
|
+import groupInfoCom from './groupInfoCom'
|
|
|
+import addGroupCom from './addGroupCom'
|
|
|
+import addSiteCom from './addSiteCom'
|
|
|
+/*----------------------------------store引入-----------------------------------*/
|
|
|
+/*----------------------------------公共方法引入-----------------------------------*/
|
|
|
+/*----------------------------------公共变量-----------------------------------*/
|
|
|
+const store = useStore()
|
|
|
+const route = useRoute()
|
|
|
+const props = defineProps({
|
|
|
+ dataType: String
|
|
|
+}) //数据双向绑定
|
|
|
+const emit = defineEmits([]);
|
|
|
+const { proxy } = getCurrentInstance();
|
|
|
+/*----------------------------------变量声明-----------------------------------*/
|
|
|
+const tree = ref(null)
|
|
|
+const activeName = ref('first')
|
|
|
+const state = reactive({
|
|
|
+ treeData: [
|
|
|
{
|
|
|
label: '所有站点',
|
|
|
children: [],
|
|
|
},
|
|
|
- ])
|
|
|
+ ],
|
|
|
+ flag2: false,
|
|
|
+ treeLevel: 3,
|
|
|
+ groupingId: 1,
|
|
|
+ siteId: 0,
|
|
|
+ siteName: "",
|
|
|
+ groupingName: "",
|
|
|
+ filterText: "",
|
|
|
+})
|
|
|
+const { treeData, flag2, treeLevel, groupingId, siteId, siteName, groupingName, filterText } = toRefs(state)
|
|
|
|
|
|
- const defaultProps = ref({
|
|
|
- children: 'children',
|
|
|
- label: 'label',
|
|
|
- })
|
|
|
|
|
|
- const getMsgFormSon = () => {
|
|
|
- activeName.value = 'third'
|
|
|
- }
|
|
|
- const getMsgFormSon2 = () => {
|
|
|
- siteTreeList()
|
|
|
+//站点基本信息保存后触发
|
|
|
+const getMsgFormSon3 = (data) => {
|
|
|
+ siteTreeList()
|
|
|
+ setTimeout(() => {
|
|
|
+ tree.value.setCurrentKey(siteId.value)
|
|
|
+ }, 1000)
|
|
|
+
|
|
|
+ if (data == 0) {
|
|
|
setTimeout(() => {
|
|
|
treeLevel.value = 1
|
|
|
}, 1000)
|
|
|
}
|
|
|
- //站点基本信息保存后触发
|
|
|
- const getMsgFormSon3 = (data) => {
|
|
|
- siteTreeList()
|
|
|
- setTimeout(() => {
|
|
|
- tree.value.setCurrentKey(selectNode.value)
|
|
|
- }, 1000)
|
|
|
-
|
|
|
- if (data == 0) {
|
|
|
- setTimeout(() => {
|
|
|
- treeLevel.value = 1
|
|
|
- }, 1000)
|
|
|
- }
|
|
|
- }
|
|
|
- function mouseenter(data) {
|
|
|
- data.show = true
|
|
|
- }
|
|
|
- function mouseleave(data) {
|
|
|
- data.show = false
|
|
|
- }
|
|
|
+}
|
|
|
+function handleNodeClick(data, obj, node) {
|
|
|
+ activeName.value = 'first'
|
|
|
+ flag2.value = true
|
|
|
|
|
|
- const handleNodeClick = (data, obj, node) => {
|
|
|
- activeName.value = 'first'
|
|
|
- data, node
|
|
|
- flag2.value = true
|
|
|
-
|
|
|
- treeLevel.value = obj.level
|
|
|
- groupingId.value = obj.data.grouping_id
|
|
|
- label.value = obj.data.label
|
|
|
- // console.log('obj.data')
|
|
|
- // console.log(obj.data.id)
|
|
|
- selectNode.value = obj.data.id
|
|
|
- labelCom.value = obj.data.label
|
|
|
- store.state.siteManageLabelCom = obj.data.label
|
|
|
- store.state.basicInfoSiteName = ''
|
|
|
-
|
|
|
- if (treeLevel.value == 3) {
|
|
|
- siteId.value = obj.data.id
|
|
|
- }
|
|
|
- if (treeLevel.value == 2 && groupingId.value == 0) {
|
|
|
- // console.log(obj.data)
|
|
|
- siteId.value = obj.data.id
|
|
|
- }
|
|
|
- }
|
|
|
+ treeLevel.value = obj.level
|
|
|
+ groupingId.value = obj.data.grouping_id
|
|
|
+ groupingName.value = obj.data.label
|
|
|
|
|
|
- function filterNode(value, data) {
|
|
|
- if (!value) return true
|
|
|
- return data.label.indexOf(value) !== -1
|
|
|
- }
|
|
|
+ store.state.siteManageLabelCom = obj.data.label
|
|
|
+ store.state.basicInfoSiteName = ''
|
|
|
|
|
|
- // 异步任务 用于给tree传值
|
|
|
- const writeValue = (val) => {
|
|
|
- return tree.value.filter(val)
|
|
|
+ if (treeLevel.value == 3) {
|
|
|
+ siteId.value = obj.data.id
|
|
|
}
|
|
|
- // 定义 watch 监听
|
|
|
- watch(
|
|
|
- filterText,
|
|
|
- (newCount, old, clear) => {
|
|
|
- // 执行异步任务,并得到关闭异步任务的 id
|
|
|
- let id = writeValue(newCount, old)
|
|
|
- // 如果 watch 监听被重复执行了,则会先清除上次未完成的异步任务
|
|
|
- clear(() => clearTimeout(id))
|
|
|
- },
|
|
|
- // watch 刚被创建的时候不执行
|
|
|
- { lazy: true }
|
|
|
- )
|
|
|
- watch(
|
|
|
- activeName,
|
|
|
- (newCount, old, clear) => {
|
|
|
- newCount, old, clear
|
|
|
- // 清除定时器
|
|
|
- clear(() => clearTimeout(store.state.siteCameraTimer))
|
|
|
- },
|
|
|
- // watch 刚被创建的时候不执行
|
|
|
- { lazy: true }
|
|
|
- )
|
|
|
-
|
|
|
- // 新建分或站点的关闭操作
|
|
|
- const closeDialog = (res) => {
|
|
|
- if (store.state.basicInfoConst == 1 && res == '默认关闭') {
|
|
|
- // alert('1 并 默认关闭')
|
|
|
- showDialog.value = false
|
|
|
- showDialog2.value = false //弹框关闭
|
|
|
- siteTreeList()
|
|
|
- flag2.value = false //基本信息不显示
|
|
|
- treeLevel.value = 3 //新建站点 新建分组 按钮不可点击
|
|
|
- } else if (store.state.basicInfoConst == 1) {
|
|
|
- // alert('1')
|
|
|
- showDialog.value = false
|
|
|
- showDialog2.value = false
|
|
|
- }
|
|
|
+ if (treeLevel.value == 2 && groupingId.value == 0) {
|
|
|
+ siteId.value = obj.data.id
|
|
|
}
|
|
|
|
|
|
- //站点保存后关闭
|
|
|
- const getFromSon = (param, param2, param3) => {
|
|
|
- // alert('站点保存后关闭')
|
|
|
- siteId.value = param2
|
|
|
- siteName.value = param
|
|
|
- groupingId.value = param3
|
|
|
+ console.log(siteId.value)
|
|
|
+}
|
|
|
|
|
|
- flag2.value = true //基本信息显示
|
|
|
- treeLevel.value = 3 //新建站点 新建分组 按钮不可点击
|
|
|
- }
|
|
|
+function filterNode(value, data) {
|
|
|
+ if (!value) return true
|
|
|
+ return data.label.indexOf(value) !== -1
|
|
|
+}
|
|
|
+
|
|
|
+//站点保存后关闭
|
|
|
+function getFromSon(param, param2, param3) {
|
|
|
+ // alert('站点保存后关闭')
|
|
|
+ siteId.value = param2
|
|
|
+ siteName.value = param
|
|
|
+ groupingId.value = param3
|
|
|
+
|
|
|
+ treeLevel.value = 3 //新建站点 新建分组 按钮不可点击
|
|
|
+}
|
|
|
|
|
|
- //新建分组
|
|
|
- const tableItem = ref([])
|
|
|
- const addGroup = () => {
|
|
|
- tableItem.value = {
|
|
|
+//新建分组
|
|
|
+function addGroup() {
|
|
|
+ proxy.$refs['addGroupComRef'].openDialog({
|
|
|
+ dialogTitle: "新建分组",
|
|
|
+ tableItem: {
|
|
|
groupingName: '',
|
|
|
}
|
|
|
- dialogTitle.value = '新建分组'
|
|
|
- showDialog.value = true
|
|
|
- }
|
|
|
+ })
|
|
|
+}
|
|
|
|
|
|
- //新建站点
|
|
|
- const addSite = () => {
|
|
|
- tableItem.value = {
|
|
|
+//新建站点
|
|
|
+function addSite() {
|
|
|
+ proxy.$refs['addSiteComRef'].openDialog({
|
|
|
+ dialogTitle: "新建站点",
|
|
|
+ tableItem: {
|
|
|
id: '',
|
|
|
stationName: '',
|
|
|
xh: '',
|
|
@@ -356,116 +191,143 @@
|
|
|
guaZai: '',
|
|
|
checked: true,
|
|
|
}
|
|
|
- dialogTitle.value = '新建站点'
|
|
|
- showDialog2.value = true
|
|
|
- }
|
|
|
- const remove = (node, data) => {
|
|
|
- const parent = node.parent
|
|
|
- const children = parent.data.children || parent.data
|
|
|
- const index = children.findIndex((d) => d.id === data.id)
|
|
|
- children.splice(index, 1)
|
|
|
- this.dataSource = [...this.dataSource]
|
|
|
- }
|
|
|
+ })
|
|
|
+}
|
|
|
|
|
|
- //左侧树结构列表
|
|
|
- function siteTreeList() {
|
|
|
- api.siteTreeList({}).then((requset) => {
|
|
|
- if (requset.status === 'SUCCESS') {
|
|
|
- var jsona = JSON.stringify(requset.data)
|
|
|
- var jsonb = jsona.replace(/"grouping_name"/g, '"label"')
|
|
|
- jsonb = jsonb.replace(/"site_list"/g, '"children"')
|
|
|
- jsonb = jsonb.replace(/"site_name"/g, '"label"')
|
|
|
- jsonb = jsonb.replace(/"site_id"/g, '"id"')
|
|
|
- var jsonc = JSON.parse(jsonb)
|
|
|
- data.value[0].children = jsonc
|
|
|
-
|
|
|
- if (route.query.activeName && route.query.siteId) {
|
|
|
- setTimeout(() => {
|
|
|
- tree.value.setCurrentKey(route.query.siteId)
|
|
|
- }, 1000)
|
|
|
- flag2.value = true
|
|
|
- treeLevel.value = 3
|
|
|
- activeName.value = route.query.activeName
|
|
|
- siteId.value = route.query.siteId
|
|
|
- var bb = []
|
|
|
- jsonc.forEach(function (item) {
|
|
|
- if (item.id == siteId.value) {
|
|
|
- bb.push(item)
|
|
|
- }
|
|
|
- })
|
|
|
- store.state.siteManageLabelCom = bb[0].label
|
|
|
- }
|
|
|
- } else {
|
|
|
- ElMessage.error(requset.msg)
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
+function remove(node, data) {
|
|
|
+ const parent = node.parent
|
|
|
+ const children = parent.data.children || parent.data
|
|
|
+ const index = children.findIndex((d) => d.id === data.id)
|
|
|
+ children.splice(index, 1)
|
|
|
+}
|
|
|
+
|
|
|
+//左侧树结构列表
|
|
|
+function siteTreeList() {
|
|
|
+ api.siteTreeList({}).then((requset) => {
|
|
|
+ if (requset.status === 'SUCCESS') {
|
|
|
+ var jsona = JSON.stringify(requset.data)
|
|
|
+ var jsonb = jsona.replace(/"grouping_name"/g, '"label"')
|
|
|
+ jsonb = jsonb.replace(/"site_list"/g, '"children"')
|
|
|
+ jsonb = jsonb.replace(/"site_name"/g, '"label"')
|
|
|
+ jsonb = jsonb.replace(/"site_id"/g, '"id"')
|
|
|
+ var jsonc = JSON.parse(jsonb)
|
|
|
+ treeData.value[0].children = jsonc
|
|
|
|
|
|
- onMounted(() => {
|
|
|
- siteTreeList()
|
|
|
+ if (route.query.activeName && route.query.siteId) {
|
|
|
+ setTimeout(() => {
|
|
|
+ tree.value.setCurrentKey(route.query.siteId)
|
|
|
+ }, 1000)
|
|
|
+ flag2.value = true
|
|
|
+ treeLevel.value = 3
|
|
|
+ activeName.value = route.query.activeName
|
|
|
+ siteId.value = route.query.siteId
|
|
|
+ var bb = []
|
|
|
+ jsonc.forEach(function (item) {
|
|
|
+ if (item.id == siteId.value) {
|
|
|
+ bb.push(item)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ store.state.siteManageLabelCom = bb[0].label
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ ElMessage.error(requset.msg)
|
|
|
+ }
|
|
|
})
|
|
|
+}
|
|
|
+
|
|
|
+// 定义 watch 监听
|
|
|
+watch(
|
|
|
+ filterText,
|
|
|
+ (newCount, old, clear) => {
|
|
|
+ // 执行异步任务,并得到关闭异步任务的 id
|
|
|
+ let id = tree.value.filter(newCount)
|
|
|
+ // 如果 watch 监听被重复执行了,则会先清除上次未完成的异步任务
|
|
|
+ clear(() => clearTimeout(id))
|
|
|
+ },
|
|
|
+ // watch 刚被创建的时候不执行
|
|
|
+ { lazy: true }
|
|
|
+)
|
|
|
+watch(
|
|
|
+ activeName,
|
|
|
+ (newCount, old, clear) => {
|
|
|
+ newCount, old, clear
|
|
|
+ // 清除定时器
|
|
|
+ clear(() => clearTimeout(store.state.siteCameraTimer))
|
|
|
+ },
|
|
|
+ // watch 刚被创建的时候不执行
|
|
|
+ { lazy: true }
|
|
|
+)
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ siteTreeList()
|
|
|
+})
|
|
|
|
|
|
- nextTick(() => {})
|
|
|
+nextTick(() => { })
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
- .custom-tree-node {
|
|
|
- overflow: hidden;
|
|
|
- white-space: nowrap;
|
|
|
- text-overflow: ellipsis;
|
|
|
- display: block;
|
|
|
- }
|
|
|
- .app-container.page-nesting {
|
|
|
- padding: 0;
|
|
|
- background: rgba(0, 0, 0, 0);
|
|
|
- }
|
|
|
- .grid-content {
|
|
|
- background: #fff;
|
|
|
- height: calc(100vh - 130px);
|
|
|
- overflow-y: auto;
|
|
|
- }
|
|
|
- .el-input__inner {
|
|
|
- border-radius: 20px !important;
|
|
|
- }
|
|
|
- .treeDom {
|
|
|
- width: 290px;
|
|
|
- position: absolute;
|
|
|
- left: 0;
|
|
|
- // margin-left: 20px;
|
|
|
- padding: 20px;
|
|
|
- min-height: calc(100vh - 130px);
|
|
|
-
|
|
|
- .el-icon-search {
|
|
|
- color: #409eff;
|
|
|
- }
|
|
|
- .el-button {
|
|
|
- width: 100px;
|
|
|
- }
|
|
|
+.custom-tree-node {
|
|
|
+ overflow: hidden;
|
|
|
+ white-space: nowrap;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ display: block;
|
|
|
+}
|
|
|
+
|
|
|
+.grid-content {
|
|
|
+ background: #fff;
|
|
|
+ height: calc(100vh - 130px);
|
|
|
+ overflow-y: auto;
|
|
|
+}
|
|
|
+
|
|
|
+.el-input__inner {
|
|
|
+ border-radius: 20px !important;
|
|
|
+}
|
|
|
+
|
|
|
+.treeDom {
|
|
|
+ width: 290px;
|
|
|
+ position: absolute;
|
|
|
+ left: 0;
|
|
|
+ // margin-left: 20px;
|
|
|
+ padding: 20px;
|
|
|
+ min-height: calc(100vh - 130px);
|
|
|
+
|
|
|
+ .el-icon-search {
|
|
|
+ color: #409eff;
|
|
|
}
|
|
|
- .nestingDom {
|
|
|
- margin-left: 300px;
|
|
|
+
|
|
|
+ .el-button {
|
|
|
+ width: 100px;
|
|
|
}
|
|
|
+}
|
|
|
+
|
|
|
+.nestingDom {
|
|
|
+ margin-left: 300px;
|
|
|
+}
|
|
|
</style>
|
|
|
<style lang="scss">
|
|
|
- // tab重置样式
|
|
|
- .el-tabs--card > .el-tabs__header .el-tabs__item {
|
|
|
- line-height: 50px;
|
|
|
- height: 50px;
|
|
|
- font-size: 16px;
|
|
|
- }
|
|
|
- .el-tabs--card > .el-tabs__header .el-tabs__item.is-active {
|
|
|
- border-bottom: 2px solid #409eff;
|
|
|
- color: #409eff;
|
|
|
- }
|
|
|
- .el-tabs--card .el-tabs__header:hover,
|
|
|
- .el-tabs__item:hover {
|
|
|
- color: #409eff !important;
|
|
|
- }
|
|
|
- .el-tabs__header {
|
|
|
- margin-bottom: 0;
|
|
|
- }
|
|
|
- .el-tabs--card > .el-tabs__header .el-tabs__item,
|
|
|
- .el-tabs--card > .el-tabs__header .el-tabs__nav {
|
|
|
- border: none;
|
|
|
- }
|
|
|
+// tab重置样式
|
|
|
+.el-tabs--card>.el-tabs__header .el-tabs__item {
|
|
|
+ line-height: 50px;
|
|
|
+ height: 50px;
|
|
|
+ font-size: 16px;
|
|
|
+}
|
|
|
+
|
|
|
+.el-tabs--card>.el-tabs__header .el-tabs__item.is-active {
|
|
|
+ border-bottom: 2px solid #409eff;
|
|
|
+ color: #409eff;
|
|
|
+}
|
|
|
+
|
|
|
+.el-tabs--card .el-tabs__header:hover,
|
|
|
+.el-tabs__item:hover {
|
|
|
+ color: #409eff !important;
|
|
|
+}
|
|
|
+
|
|
|
+.el-tabs__header {
|
|
|
+ margin-bottom: 0;
|
|
|
+}
|
|
|
+
|
|
|
+.el-tabs--card>.el-tabs__header .el-tabs__item,
|
|
|
+.el-tabs--card>.el-tabs__header .el-tabs__nav {
|
|
|
+ border: none;
|
|
|
+}
|
|
|
</style>
|