|
@@ -34,13 +34,13 @@ export default defineComponent({
|
|
|
vanSearch: Search,
|
|
|
},
|
|
|
beforeRouteLeave(to, from, next) {
|
|
|
- console.log('导航')
|
|
|
- console.log(to)
|
|
|
- console.log(from)
|
|
|
- console.log("=====")
|
|
|
+ console.log("导航");
|
|
|
+ console.log(to);
|
|
|
+ console.log(from);
|
|
|
+ console.log("=====");
|
|
|
if (to.name === "home") {
|
|
|
let mac: any = getCookieMac();
|
|
|
- to.fullPath=to.fullPath+`?mac=${mac}`
|
|
|
+ to.fullPath = to.fullPath + `?mac=${mac}`;
|
|
|
to.query.mac = mac;
|
|
|
}
|
|
|
next();
|
|
@@ -67,7 +67,7 @@ export default defineComponent({
|
|
|
proxyData.cloneProjects = JSON.parse(JSON.stringify(projects));
|
|
|
proxyData.projects = projects;
|
|
|
} else {
|
|
|
- Toast("登录过期,请重新扫码进入!")
|
|
|
+ Toast("登录过期,请重新扫码进入!");
|
|
|
router.push({ name: "home" });
|
|
|
}
|
|
|
});
|
|
@@ -78,15 +78,23 @@ export default defineComponent({
|
|
|
proxyData.fuzzyQuery(proxyData.searchVal);
|
|
|
},
|
|
|
onCancel() {},
|
|
|
+ // 搜索
|
|
|
fiflterName(list: any, keyWord: any) {
|
|
|
- var arr = [];
|
|
|
- for (var i = 0; i < list.length; i++) {
|
|
|
- if (list[i].name.match(keyWord) != null) {
|
|
|
- arr.push(list[i]);
|
|
|
+ if (keyWord != "") {
|
|
|
+ let reg: any = new RegExp(keyWord);
|
|
|
+ let arr: any = [];
|
|
|
+ for (let i = 0; i < list.length; i++) {
|
|
|
+ if (reg.test(list[i].localName)) {
|
|
|
+ //这里匹配的是数组中微信号名称以及公众号id,可根据业务需求自行修改!
|
|
|
+ arr.push(list[i]);
|
|
|
+ }
|
|
|
}
|
|
|
+ return arr; //返回符合条件的数组
|
|
|
+ } else {
|
|
|
+ return list;
|
|
|
}
|
|
|
- return arr;
|
|
|
},
|
|
|
+ // 模糊匹配
|
|
|
fuzzyQuery(val: any) {
|
|
|
let arr: any = JSON.parse(JSON.stringify(proxyData.cloneProjects));
|
|
|
if (val) {
|