| | |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="设备组" prop="name"> |
| | | <!-- <el-select |
| | | <el-select |
| | | v-model="ruleForm.equr" |
| | | allow-create |
| | | filterable |
| | | @blur="selectInput" |
| | | @create="" |
| | | placeholder="请选择设备组" |
| | | > |
| | | <el-option |
| | |
| | | :value="list" |
| | | > |
| | | </el-option> |
| | | </el-select> --> |
| | | <el-autocomplete |
| | | </el-select> |
| | | <!-- <el-autocomplete |
| | | class="inline-input" |
| | | v-model="ruleForm.equr" |
| | | :fetch-suggestions="querySearch" |
| | | placeholder="请输入内容" |
| | | ></el-autocomplete> |
| | | ></el-autocomplete> --> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | selectInput(){ |
| | | |
| | | }, |
| | | querySearch(queryString, cb) { |
| | | console.log(this.equaip); |
| | | var restaurants = this.equaip; |
| | | var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants; |
| | | // 调用 callback 返回建议列表的数据 |
| | | cb(results); |
| | | }, |
| | | createFilter(queryString) { |
| | | return (restaurant) => { |
| | | return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0); |
| | | }; |
| | | }, |
| | | // querySearch(queryString, cb) { |
| | | // console.log(this.equaip); |
| | | // var restaurants = this.equaip; |
| | | // var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants; |
| | | // // 调用 callback 返回建议列表的数据 |
| | | // cb(results); |
| | | // }, |
| | | // createFilter(queryString) { |
| | | // return (restaurant) => { |
| | | // return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0); |
| | | // }; |
| | | // }, |
| | | staueValueChange() { |
| | | this.selectDevice() |
| | | // this.tableData = []; |
| | |
| | | params:{ |
| | | type:this.equip |
| | | } |
| | | }).then(res =>{ |
| | | res.data.forEach(item=>{ |
| | | let obj={ |
| | | id: item, |
| | | value: item |
| | | } |
| | | this.equaip.push(obj) |
| | | console.log("设备组",this.equip); |
| | | }) |
| | | }) |
| | | .then(res =>{ |
| | | this.equaip = res.data |
| | | // res.data.forEach(item=>{ |
| | | // let obj={ |
| | | // id: item, |
| | | // value: item |
| | | // } |
| | | // this.equaip.push(obj) |
| | | console.log(this.equaip); |
| | | // }) |
| | | }) |
| | | }, |
| | | RadioChange(val){ |
| | |
| | | type:this.ruleForm.type, |
| | | }, {headers: {"Content-Type": "application/json"} |
| | | }).then(res =>{ |
| | | this.selectDevice() |
| | | this.$message.success('新增成功') |
| | | this.ruleForm = {} |
| | | this.selectDevice() |
| | | }) |
| | | }, |
| | | // tableDataApi() { |