vue樹形結構獲取鍵值


把鍵值文件放入

引入控件

  import { getTypeValue } from '@/api/dict/dictValue/index';

  

點擊搜索,打開彈窗

        <el-form-item label="機構名稱" placeholder="請選擇機構" prop="orgName">
          <el-input readonly type="text" v-model="form.orgName">
            <el-button slot="append" icon="el-icon-search" @click="openDepartDialog()"></el-button>
          </el-input>
        </el-form-item>

  

 打開控件事件,關閉控件事件

      openDepartDialog() {
        this.dialogDepartVisible = true
      },
      closeDepartDialog(depart) {
        console.log(depart)
        this.form.orgName = depart.label
        this.form.code = depart.id
        this.form.departId = depart.id
        this.dialogDepartVisible = false
      },

  

 

關閉彈窗按鈕

    <el-dialog title="選擇機構" width="30%" :visible.sync="dialogDepartVisible">
      <depart-selector @closeDepartDialog="closeDepartDialog" ref="departSelector"></depart-selector>
      <span slot="footer" class="dialog-footer">
        <el-button class="filter-item"  style="margin-left: 10px;" @click="handlerAddDepart" type="primary" icon="edit">添加</el-button>
      </span>
    </el-dialog>

  

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM