|  |  |  | 
|---|
|  |  |  | <GlobalWindow | 
|---|
|  |  |  | :title="title" | 
|---|
|  |  |  | :visible.sync="visible" | 
|---|
|  |  |  | width="50%" | 
|---|
|  |  |  | width="900px" | 
|---|
|  |  |  | :confirm-working="isWorking" | 
|---|
|  |  |  | @confirm="confirm" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <el-form :model="form" ref="form" :rules="rules"> | 
|---|
|  |  |  | <el-form-item label="门禁组名称" prop="name"> | 
|---|
|  |  |  | <el-form-item label="门禁点分组名称" prop="name"> | 
|---|
|  |  |  | <el-input v-model="form.name" placeholder="请输入名称" v-trim/> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="默认门禁组" prop="isDefault"> | 
|---|
|  |  |  | <el-form-item label="默认门禁点分组" prop="isDefault"> | 
|---|
|  |  |  | <el-switch | 
|---|
|  |  |  | v-model="form.isDefault" | 
|---|
|  |  |  | active-color="#13ce66" | 
|---|
|  |  |  | 
|---|
|  |  |  | <el-transfer | 
|---|
|  |  |  | v-if="form.radio === 1" | 
|---|
|  |  |  | style="margin-top: 15px;" | 
|---|
|  |  |  | :titles="['未选门禁组', '已选门禁组']" | 
|---|
|  |  |  | :titles="['未选门禁点', '已选门禁点']" | 
|---|
|  |  |  | filterable | 
|---|
|  |  |  | filter-placeholder="请输入门禁组名称" | 
|---|
|  |  |  | :filter-method="filterMethod" | 
|---|
|  |  |  | filter-placeholder="请输入门禁点或区域名称" | 
|---|
|  |  |  | v-model="form.doorIds" | 
|---|
|  |  |  | :data="device"> | 
|---|
|  |  |  | </el-transfer> | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | callback() | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | // 表单数据 | 
|---|
|  |  |  | form: { | 
|---|
|  |  |  | 
|---|
|  |  |  | radio: 0 | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | device: [], | 
|---|
|  |  |  | filterMethod(query, item) { | 
|---|
|  |  |  | if (!query) return item; | 
|---|
|  |  |  | return item.label.indexOf(query) > -1 || item.area.indexOf(query) > -1; | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 验证规则 | 
|---|
|  |  |  | rules: { | 
|---|
|  |  |  | name: [ | 
|---|
|  |  |  | 
|---|
|  |  |  | this.$emit('success') | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .catch(e => { | 
|---|
|  |  |  | this.$tip.apiFailed(e) | 
|---|
|  |  |  | // this.$tip.apiFailed(e) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .finally(() => { | 
|---|
|  |  |  | this.isWorking = false | 
|---|
|  |  |  | 
|---|
|  |  |  | this.$emit('success') | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .catch(e => { | 
|---|
|  |  |  | this.$tip.apiFailed(e) | 
|---|
|  |  |  | // this.$tip.apiFailed(e) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .finally(() => { | 
|---|
|  |  |  | this.isWorking = false | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 获取设备 | 
|---|
|  |  |  | getLists () { | 
|---|
|  |  |  | getList({}) | 
|---|
|  |  |  | getList({type:0, isdeleted:0 }) | 
|---|
|  |  |  | .then(res => { | 
|---|
|  |  |  | this.device = res.map(item => { | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | label: item.name, | 
|---|
|  |  |  | label: item.doorName, | 
|---|
|  |  |  | area: item.regionPathName, | 
|---|
|  |  |  | key: item.id | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <style> | 
|---|
|  |  |  | .el-transfer-panel { | 
|---|
|  |  |  | width: 350px; | 
|---|
|  |  |  | width: 350px !important; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </style> | 
|---|