From 0f03522d5a541c26875c1279ba5b18ef59e933fe Mon Sep 17 00:00:00 2001
From: 王旭 <1377869194@qq.com>
Date: 星期四, 11 五月 2023 16:00:31 +0800
Subject: [PATCH] 树结构下拉框点击选中收回

---
 src/views/datamanage/versionManage.vue |  143 +++++++++++++++++------------------------------
 1 files changed, 52 insertions(+), 91 deletions(-)

diff --git a/src/views/datamanage/versionManage.vue b/src/views/datamanage/versionManage.vue
index dd25276..6c3b264 100644
--- a/src/views/datamanage/versionManage.vue
+++ b/src/views/datamanage/versionManage.vue
@@ -1,19 +1,14 @@
 <template>
   <div class="verSionBox">
-    <My-bread :list="[
+    <My-bread
+      :list="[
         `${$t('dataManage.dataManage')}`,
         `${$t('dataManage.versionManage')}`,
-      ]"></My-bread>
+      ]"
+    ></My-bread>
     <el-divider />
-    <div
-      class="inquire subpage_Div"
-      ref="container"
-    >
-      <el-form
-        ref="ruleForm"
-        :model="ruleForm"
-        :inline="true"
-      >
+    <div class="inquire subpage_Div" ref="container">
+      <el-form ref="ruleForm" :model="ruleForm" :inline="true">
         <div class="flex_box">
           <div style="margin-right: auto">
             <el-form-item size="small">
@@ -22,6 +17,7 @@
                 v-model="ruleForm.dirid"
                 placeholder="璇烽�夋嫨瀛樺偍鐩綍"
                 style="width: 200px"
+                ref="treeSelect"
               >
                 <el-option
                   :value="ruleForm.dirid"
@@ -55,12 +51,13 @@
               <el-input
                 v-model="ruleForm.name"
                 :placeholder="$t('shuJuGuanLi.lable5')"
-              ><i
+                ><i
                   slot="suffix"
                   class="el-icon-search"
                   @click="onSubmit('ruleForm')"
                   style="padding-right: 8px"
-                ></i></el-input>
+                ></i
+              ></el-input>
             </el-form-item>
           </div>
           <div>
@@ -71,7 +68,8 @@
                 @click="(InsertFormdialog = true), getSelectdirTab()"
                 icon="el-icon-plus"
                 size="small"
-              >{{ $t("common.append") }}</el-button>
+                >{{ $t("common.append") }}</el-button
+              >
               <!--              <el-button
                 @click="onSubmit('ruleForm')"
                 icon="el-icon-search"
@@ -84,7 +82,8 @@
                 @click="resetForm('ruleForm')"
                 icon="el-icon-delete"
                 size="small"
-              >{{ $t("common.empty") }}</el-button>
+                >{{ $t("common.empty") }}</el-button
+              >
             </el-form-item>
           </div>
         </div>
@@ -92,10 +91,7 @@
     </div>
 
     <div class="dividing-line"></div>
-    <div
-      class="table_box"
-      :style="styleVar"
-    >
+    <div class="table_box" :style="styleVar">
       <el-table
         :data="tableData"
         style="width: 100%"
@@ -108,11 +104,7 @@
           :label="$t('dataManage.vmobj.index')"
           width="70px"
         />
-        <el-table-column
-          align="center"
-          prop="id"
-          v-if="false"
-        />
+        <el-table-column align="center" prop="id" v-if="false" />
         <el-table-column
           align="center"
           prop="name"
@@ -150,10 +142,7 @@
           :label="$t('dataManage.vmobj.updateontime')"
           :formatter="formatTime"
         />
-        <el-table-column
-          min-width="150"
-          :label="$t('common.operate')"
-        >
+        <el-table-column min-width="150" :label="$t('common.operate')">
           <template slot-scope="scope">
             <el-button
               v-if="btnStatus.update"
@@ -164,21 +153,20 @@
               type="warning"
               size="small"
               plain
-            >{{ $t("common.update") }}</el-button>
+              >{{ $t("common.update") }}</el-button
+            >
             <el-button
               v-if="btnStatus.delete"
               @click="handleDelete(scope.$index, scope.row)"
               type="danger"
               size="small"
               plain
-            >{{ $t("common.delete") }}</el-button>
+              >{{ $t("common.delete") }}</el-button
+            >
           </template>
         </el-table-column>
       </el-table>
-      <div
-        class="pagination_box"
-        style="margin-top: 15px"
-      >
+      <div class="pagination_box" style="margin-top: 15px">
         <el-pagination
           @size-change="handleSizeChange"
           @current-change="handleCurrentChange"
@@ -198,10 +186,7 @@
       :before-close="handleClose"
     >
       <div style="height: 500px; overflow: auto">
-        <el-form
-          :model="upform"
-          label-position="top"
-        >
+        <el-form :model="upform" label-position="top">
           <el-form-item
             :label="$t('dataManage.vmobj.name')"
             :label-width="formLabelWidth"
@@ -209,7 +194,7 @@
             <el-input
               v-model="upform.name"
               autocomplete="off"
-              style="width:85%"
+              style="width: 85%"
             ></el-input>
           </el-form-item>
           <el-form-item
@@ -220,7 +205,7 @@
               :popper-append-to-body="false"
               v-model="upform.dirid"
               :placeholder="$t('shuJuGuanLi.pselect.select')"
-              style="width:85%"
+              style="width: 85%"
             >
               <el-option
                 :value="upform.dirid"
@@ -251,27 +236,16 @@
             <el-input
               v-model="upform.descr"
               autocomplete="off"
-              style="width:85%"
+              style="width: 85%"
             ></el-input>
           </el-form-item>
         </el-form>
       </div>
-      <div
-        slot="footer"
-        type="info"
-        class="dialog-footer"
-      >
-        <el-button
-          size="small"
-          @click="editFromDataClose"
-        >{{
+      <div slot="footer" type="info" class="dialog-footer">
+        <el-button size="small" @click="editFromDataClose">{{
           $t("common.close")
         }}</el-button>
-        <el-button
-          size="small"
-          @click="editFromData"
-          class="primary"
-        >{{
+        <el-button size="small" @click="editFromData" class="primary">{{
           $t("common.confirm")
         }}</el-button>
       </div>
@@ -283,16 +257,13 @@
       :before-close="handleCloseadd"
     >
       <div style="height: 500px; overflow: auto">
-        <el-form
-          :model="insertform"
-          label-position="top"
-        >
+        <el-form :model="insertform" label-position="top">
           <el-form-item
             :label="$t('dataManage.vmobj.name')"
             :label-width="formLabelWidth"
           >
             <el-input
-              style="width:85%"
+              style="width: 85%"
               v-model="insertform.name"
               autocomplete="off"
               :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valueName1')"
@@ -306,7 +277,7 @@
               :popper-append-to-body="false"
               v-model="insertform.dirName"
               :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuedirectory')"
-              style="width:85%"
+              style="width: 85%"
             >
               <el-option
                 :value="insertform.path"
@@ -336,30 +307,19 @@
             :label-width="formLabelWidth"
           >
             <el-input
-              style="width:85%"
+              style="width: 85%"
               v-model="insertform.descr"
               autocomplete="off"
-               :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuedescription')"
+              :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuedescription')"
             ></el-input>
           </el-form-item>
         </el-form>
       </div>
-      <div
-        slot="footer"
-        class="dialog-footer"
-      >
-        <el-button
-          @click="insertFromDataClose"
-          type="info"
-          size="small"
-        >{{
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="insertFromDataClose" type="info" size="small">{{
           $t("common.close")
         }}</el-button>
-        <el-button
-          @click="insertFromData"
-          class="primary"
-          size="small"
-        >{{
+        <el-button @click="insertFromData" class="primary" size="small">{{
           $t("common.confirm")
         }}</el-button>
       </div>
@@ -484,7 +444,7 @@
       upform: {},
       ruleForm: {},
       insertform: {
-        name:""
+        name: "",
       },
       tableData: [],
       companyOption: [],
@@ -557,9 +517,8 @@
       this.insertform.dirid = value;
     },
     catalogChangeAdd(data, node, nodeData) {
-
-      this.insertform.path = data.id
-      this.insertform.dirid = data.id
+      this.insertform.path = data.id;
+      this.insertform.dirid = data.id;
       // this.$set(this.insertform, "path", data.id);
       this.$set(this.insertform, "dirName", data.name);
     },
@@ -689,11 +648,11 @@
     editFromDataClose() {
       this.$confirm("鍏抽棴鍚庢棤娉曚繚瀛橈紝鏄惁鍏抽棴?")
         .then((_) => {
-          this.dialogFormVisible = false
+          this.dialogFormVisible = false;
           this.upform = {};
           this.getRoleTabelData();
         })
-        .catch((_) => { });
+        .catch((_) => {});
       // this.dialogFormVisible = false;
       // this.upform = {};
     },
@@ -724,16 +683,15 @@
     insertFromDataClose() {
       this.$confirm("鍏抽棴鍚庢棤娉曚繚瀛橈紝鏄惁鍏抽棴?")
         .then((_) => {
-          this.InsertFormdialog = false
+          this.InsertFormdialog = false;
           this.insertform = {};
           this.getRoleTabelData();
         })
-        .catch((_) => { });
+        .catch((_) => {});
       // this.InsertFormdialog = false;
       // this.insertform = {};
     },
     async insertFromData() {
-
       if (this.insertform.dirid == null) {
         this.$message({
           message: "璇烽�夋嫨瑙掕壊鎵�灞炲崟浣�",
@@ -802,24 +760,27 @@
     handleClose() {
       this.$confirm("鍏抽棴鍚庢棤娉曚繚瀛橈紝鏄惁鍏抽棴?")
         .then((_) => {
-          this.dialogFormVisible = false
+          this.dialogFormVisible = false;
           this.getRoleTabelData();
         })
-        .catch((_) => { });
+        .catch((_) => {});
     },
     handleCloseadd() {
       this.$confirm("鍏抽棴鍚庢棤娉曚繚瀛橈紝鏄惁鍏抽棴?")
         .then((_) => {
-          this.InsertFormdialog = false
+          this.InsertFormdialog = false;
           this.getRoleTabelData();
         })
-        .catch((_) => { });
+        .catch((_) => {});
     },
   },
   watch: {
     pathId: {
       immediate: true,
-      handler(val) { },
+      handler(val) {},
+    },
+    "ruleForm.dirid"() {
+      this.$refs.treeSelect.visible = false;
     },
   },
 };

--
Gitblit v1.9.3