| xqd
@@ -46,6 +46,9 @@
|
|
|
<body>
|
|
|
<div id="main">
|
|
|
<div class="container" v-if="isInstall">
|
|
|
+ <div v-for="(item,index) in list" style="font-size: .5rem;margin-top: .3rem;" @click="tapvalue(item)">
|
|
|
+ {{item}}
|
|
|
+ </div>
|
|
|
<input class="inputstyle" type="text" v-model="value" placeholder="请输入你需要升级的设备IMEI号码">
|
|
|
<button class="btnstyle" @click="installbtn">点击设置</button>
|
|
|
</div>
|
| xqd
@@ -89,12 +92,50 @@
|
|
|
equipment: "",
|
|
|
isxian: "",
|
|
|
versionNum: "",
|
|
|
- isnew: ""
|
|
|
+ isnew: "",
|
|
|
+ Numarr: [],
|
|
|
+ list: []
|
|
|
},
|
|
|
mounted() {
|
|
|
-
|
|
|
+ this.getNum()
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ value(newdata, jiu) {
|
|
|
+ if (typeof newdata === 'string') {
|
|
|
+ if (newdata.trim().length !== 0) {
|
|
|
+ this.debounce(this.changeStr, 1500);
|
|
|
+ } else { }
|
|
|
+ }
|
|
|
+ if (newdata == "") {
|
|
|
+ this.list = []
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
+ getNum() {
|
|
|
+ axios.get("/getDevcielist").then(res => {
|
|
|
+ this.Numarr = res.data.data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ tapvalue(item) {
|
|
|
+ this.value = item
|
|
|
+ this.list = []
|
|
|
+ },
|
|
|
+ changeStr() {
|
|
|
+ this.list = []
|
|
|
+ this.Numarr.forEach(item => {
|
|
|
+ if (item.substr(item.length - 4) == this.value) {
|
|
|
+ this.list.push(item)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ console.log(this.list)
|
|
|
+ },
|
|
|
+ debounce(fn, wait) {
|
|
|
+ if (this.fun !== null) {
|
|
|
+ clearTimeout(this.fun)
|
|
|
+ }
|
|
|
+ this.fun = setTimeout(fn, wait)
|
|
|
+ },
|
|
|
resetbtn() {
|
|
|
if (this.isxian == '在营') {
|
|
|
axios.get("/upVersion?id=" + this.value + "&type=" + 2).then(res => {
|