From c94fe15cedea6dc6188ecc93c3de5c277c950e87 Mon Sep 17 00:00:00 2001 From: yanran200730 Date: Fri, 25 Mar 2022 11:29:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E9=A2=91=E7=9B=91=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wechat/AppAddressBook/components/List.vue | 22 +++--- .../AppMonitorManage/AppMonitorManage.vue | 31 ++++---- .../monitor/components/deviceSlider.vue | 72 +++++++++++++++++-- 3 files changed, 92 insertions(+), 33 deletions(-) diff --git a/packages/wechat/AppAddressBook/components/List.vue b/packages/wechat/AppAddressBook/components/List.vue index bd8d77c0..ebc7b9fe 100644 --- a/packages/wechat/AppAddressBook/components/List.vue +++ b/packages/wechat/AppAddressBook/components/List.vue @@ -34,17 +34,17 @@
+ :filter-node-method="filterNode" + ref="tree" + :props="defaultProps" + node-key="id" + :data="unitList" + highlight-current + @node-contextmenu="nodeContextmenu" + :current-node-key="search.departmentId" + :default-expanded-keys="defaultExpanded" + :default-checked-keys="defaultChecked" + @current-change="onTreeChange">
    -
    @@ -151,14 +151,6 @@
    {node.label}
    - this.handleSliderOption(e, data)}> - - - 修改名称 - 行政地区 - 地图标绘 - -
    ) } else return ( @@ -171,17 +163,20 @@
    ) }, - handleSliderOption(command, data) { - this.selected = JSON.parse(JSON.stringify({...data, command})) - this.selected.areaId = data.areaId || this.user.info.areaId - if (command == "edit") {//修改名称 + handleSliderOption(e) { + this.selected = { + command: e.type, + ...e.node + } + this.selected.areaId = e.node.areaId || this.user.info.areaId + if (e.type == "edit") {//修改名称 this.dialog = true - } else if (command == "area") {//绑定areaId + } else if (e.type == "area") {//绑定areaId this.$refs.BindArea?.chooseArea() - } else if (command == "locate") {//地图标绘 - this.latlng = data.lat && data.lng ? { - lat: data.lat, - lng: data.lng + } else if (e.type == "locate") {//地图标绘 + this.latlng = e.node.lat && e.node.lng ? { + lat: e.node.lat, + lng: e.node.lng } : '' this.locate = true } diff --git a/project/shandong10086/apps/shandong/monitor/components/deviceSlider.vue b/project/shandong10086/apps/shandong/monitor/components/deviceSlider.vue index 0ed1f089..f9a97599 100644 --- a/project/shandong10086/apps/shandong/monitor/components/deviceSlider.vue +++ b/project/shandong10086/apps/shandong/monitor/components/deviceSlider.vue @@ -24,10 +24,17 @@
    设备列表
    - - - + +
      +
    • 修改名称
    • +
    • 行政地区
    • +
    • 地图标绘
    • +
@@ -82,8 +89,14 @@ export default { noArea: [], staData: [], name: '', + isShowMenu: false, search: { bind: '' + }, + menuInfo: { + x: '', + y: '', + node: {} } } }, @@ -91,6 +104,10 @@ export default { handleShow() { this.$emit('update:show', !this.show) }, + + bindEvent() { + this.isShowMenu = false + }, getDevices() { this.ins.post("/app/appzyvideoequipment/tree", null, { params: {size: 999} @@ -103,6 +120,25 @@ export default { } }) }, + + handleTreeCommand (e, node) { + this.$emit('treeCommand', { + type: e, + node + }) + }, + + nodeContextmenu(e, node) { + this.isShowMenu = true + let y = e.y + 6 + if (y + 202 > document.body.clientHeight) { + y = y - 202 + } + this.menuInfo = { + x: e.x + 16, y, + node + } + }, handleNodeClick(data) { this.$emit('select', data) }, @@ -124,6 +160,10 @@ export default { created() { this.dict.load("deviceStatus") this.getDevices() + }, + + mounted () { + document.querySelector('html').addEventListener('click', this.bindEvent) } } @@ -134,12 +174,36 @@ export default { align-items: center; flex-shrink: 0; color: #fff; + overflow: hidden; div[flex] { display: flex; align-items: center; } + .deviceList { + overflow: auto; + + ::v-deep .el-tree { + width: -webkit-fit-content; + width: -moz-fit-content; + width: fit-content; + min-width: 100%; + } + &::-webkit-scrollbar { + width : 10px; + height: 15px; + } + &::-webkit-scrollbar-thumb { + box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.2); + background: #535353; + } + &::-webkit-scrollbar-track { + box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.2); + background: #fff; + } + } + div[fill] { flex: 1; min-width: 0;