|
|
@ -16,13 +16,24 @@ |
|
|
<el-input v-model="userPrint.ipaddress" ></el-input> |
|
|
<el-input v-model="userPrint.ipaddress" ></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="打印机名称"> |
|
|
<el-form-item label="打印机名称"> |
|
|
<el-select placeholder="" |
|
|
|
|
|
filterable |
|
|
|
|
|
@blur="selectBlur" style="width:100%" v-model="userPrint.newprintername"> |
|
|
|
|
|
<el-option v-for="(item,index) in printList" |
|
|
|
|
|
:key="index" |
|
|
|
|
|
:label="item.label" :value="item.label"></el-option> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
|
|
|
<!-- <el-select placeholder=""--> |
|
|
|
|
|
<!-- filterable--> |
|
|
|
|
|
<!-- @blur="selectBlur" style="width:100%" v-model="userPrint.newprintername">--> |
|
|
|
|
|
<!-- <el-option v-for="(item,index) in printList"--> |
|
|
|
|
|
<!-- :key="index"--> |
|
|
|
|
|
<!-- :label="item.label" :value="item.label"></el-option>--> |
|
|
|
|
|
<!-- </el-select>--> |
|
|
|
|
|
<el-autocomplete |
|
|
|
|
|
class="inline-input" |
|
|
|
|
|
v-model="userPrint.newprintername" |
|
|
|
|
|
:fetch-suggestions="querySearch" |
|
|
|
|
|
style="width:100% " |
|
|
|
|
|
placeholder="请输入内容" |
|
|
|
|
|
> |
|
|
|
|
|
<template slot-scope="{ item }"> |
|
|
|
|
|
<span class="addr">{{ item.label }}</span> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-autocomplete> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-form> |
|
|
</el-form> |
|
|
|
|
|
|
|
|
@ -72,6 +83,17 @@ export default { |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
querySearch(queryString, cb) { |
|
|
|
|
|
var restaurants = this.printList; |
|
|
|
|
|
var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants; |
|
|
|
|
|
// 调用 callback 返回建议列表的数据 |
|
|
|
|
|
cb(results); |
|
|
|
|
|
}, |
|
|
|
|
|
createFilter(queryString) { |
|
|
|
|
|
return (restaurant) => { |
|
|
|
|
|
return (restaurant.label.indexOf(queryString) === 0); |
|
|
|
|
|
}; |
|
|
|
|
|
}, |
|
|
selectBlur(e){ |
|
|
selectBlur(e){ |
|
|
this.userPrint.printername = e.target.value |
|
|
this.userPrint.printername = e.target.value |
|
|
}, |
|
|
}, |
|
|
@ -93,7 +115,7 @@ export default { |
|
|
let list = [] |
|
|
let list = [] |
|
|
for (let child of children) { |
|
|
for (let child of children) { |
|
|
let option = { |
|
|
let option = { |
|
|
value: child.index, |
|
|
|
|
|
|
|
|
value: child.innerText, |
|
|
label: child.innerText |
|
|
label: child.innerText |
|
|
} |
|
|
} |
|
|
list.push(option) |
|
|
list.push(option) |
|
|
|