From 5c3c18cf8b4a8a383bfcf582991c95e533af093f Mon Sep 17 00:00:00 2001
From: zhengpz <1838927346@qq.com>
Date: Tue, 14 Sep 2021 22:12:02 +0800
Subject: [PATCH] 下拉框换组件

---
 src/views/securityUnitOperation/operationAnalysis.vue |   64 +++++++++++++++----------------
 1 files changed, 31 insertions(+), 33 deletions(-)

diff --git a/src/views/securityUnitOperation/operationAnalysis.vue b/src/views/securityUnitOperation/operationAnalysis.vue
index defe937..17e7982 100644
--- a/src/views/securityUnitOperation/operationAnalysis.vue
+++ b/src/views/securityUnitOperation/operationAnalysis.vue
@@ -6,33 +6,27 @@
           <div class="rowTitle">
             <img src="../../../public/img/bajgxt/u1618.png" />
             <span>数据概览</span>
-
-            <!-- <el-select class="select0" v-model="value0" placeholder="请选择">
-              <el-option
-                v-for="item in options0"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value"
-              ></el-option>
-            </el-select> -->
-            <el-select
+            <avue-input-tree
               class="select1"
-              ref="treeForm"
-              v-model="node.title"
-              placeholder="请选择"
-            >
-              <el-option style="height: auto;" :value="node">
-                <el-tree
-                  :data="options1"
-                  default-expand-all
-                  node-key="id"
-                  @node-click="handleNodeClick"
-                  :props="props"
-                >
-                </el-tree>
-              </el-option>
-            </el-select>
-            <el-select
+              default-expand-all
+              v-model="value1"
+              placeholder="请选择内容"
+              type="tree"
+              :dic="options1"
+              :props="props"
+              @change="handleNodeClick"
+            ></avue-input-tree>
+            <avue-input-tree
+              class="select2"
+              default-expand-all
+              v-model="value2"
+              placeholder="请选择公司"
+              type="tree"
+              :dic="options2"
+              :props="props2"
+              @change="changeCompanys"
+            ></avue-input-tree>
+            <!-- <el-select
               class="select2"
               v-model="value2"
               placeholder="请选择"
@@ -44,7 +38,7 @@
                 :label="item.enterpriseName"
                 :value="item.departmentid"
               ></el-option>
-            </el-select>
+            </el-select> -->
             <el-button @click="toOperationTable">进入数据统计表</el-button>
           </div>
 
@@ -219,15 +213,18 @@
         label: "title",
         value: "id"
       },
+      props2: {
+        children: "children",
+        label: "enterpriseName",
+        value: "departmentid"
+      },
       node: {} //选中的记录
     };
   },
   methods: {
     //点击节点
-    handleNodeClick(data) {
-      this.node = data;
-      this.value1 = data.id;
-      this.$refs.treeForm.blur();
+    handleNodeClick(id) {
+      this.value1 = id;
       this.getCompanys();
     },
     setAgeEchart() {
@@ -285,6 +282,7 @@
     getCompanys() {
       getCompanys({ jurisdiction: this.value1 }).then(res => {
         if (res.data.code === 200) {
+          debugger
           this.options2 = res.data.data;
           this.value2 = this.options2[0] ? this.options2[0].departmentid : "";
           this.enterpriseName = this.options2[0]
@@ -509,7 +507,7 @@
   }
 }
 // 适配分辨率1600*900
-@media screen and (min-width: 1281px)and (max-width: 1600px)  {
+@media screen and (min-width: 1281px) and (max-width: 1600px) {
   .box-card {
     font-size: 15px;
     width: 128px;
@@ -594,7 +592,7 @@
     }
   }
 }
-@media screen and (min-width: 1601px)and (max-width: 1920px) {
+@media screen and (min-width: 1601px) and (max-width: 1920px) {
   .box-card {
     width: 150px;
     background: #00aaf1;

--
Gitblit v1.9.3