当前位置: 首页 > news >正文

济南新站seo外包ui设计培训班哪家好

济南新站seo外包,ui设计培训班哪家好,安装的字体wordpress,网站建设 上市公司目录 前言 一、indexOf是什么?indexOf有什么作用? 含义: 作用: 二、功能实现 这段是查询过程中过滤筛选功能的代码部分: 分析: 这段是查询用户和性别功能的代码部分: 分析: 三、最终效…


目录

前言

一、indexOf是什么?indexOf有什么作用?

含义:

作用:

二、功能实现

这段是查询过程中过滤筛选功能的代码部分:

分析:

这段是查询用户和性别功能的代码部分:

分析:

三、最终效果图

查询输入框所在图:

输入姓名羊和性别男模糊查询后的效果图:

输入姓名羊和性别女模糊查询后的效果图:

单独输入姓名狼模糊查询后的效果图:

总结


前言

电影评价系统的模糊查询是什么?它的作用体现在哪些方面?

电影评价系统的模糊查询是一种查询方法,用于在用户输入的关键词中进行模糊匹配,而不仅仅是精确匹配。这种查询方法可以查找到与关键词相关的结果,即使关键词的拼写或格式有所不同。

模糊查询的作用体现在以下方面:

  1. 提高用户体验:模糊查询可以更好地满足用户的搜索需求,即使用户输入的关键词存在一定的拼写错误或格式差异,也能够找到相关的结果。这样可以提高用户对系统的满意度,并减少他们需要进行多次尝试的次数。
  2. 扩展搜索结果:模糊查询可以使系统返回更全面的搜索结果。通常来说,精确匹配可能会忽略一部分相关的内容,而模糊查询可以找到更多满足用户要求的结果,包括拼写相似或格式近似的内容。
  3. 对应多样性需求:不同用户对于搜索结果的要求可能存在一定的差异。一些用户可能更关注特定类型的电影,而另一些用户可能更注重演员、导演等相关信息。通过模糊查询,系统能够根据用户输入的关键词,提供更加符合他们需求的搜索结果。
  4. 灵活匹配多种场景:在电影评价系统中,用户可能输入的关键词包括电影名称、演员、导演、电影类型等。模糊查询可以在这些不同的场景下,根据用户输入的关键词进行模糊匹配,找到与之相关的电影评价。


一、indexOf是什么?indexOf有什么作用?

含义:

indexOf是一个JavaScript数组的方法,用于在数组中查找指定元素的索引。

作用:

  1. 查找元素:indexOf可以用来判断数组中是否存在某个元素。如果指定元素存在于数组中,则返回第一次出现的索引;如果不存在,则返回-1。

  2. 根据索引操作数组:知道元素在数组中的索引,我们可以使用这个索引来访问、修改和删除数组中的元素。

  3. 判断元素是否唯一:由于indexOf只返回第一次出现的索引,可以通过它来判断一个元素在数组中是否是唯一的。

二、功能实现

这段是查询过程中过滤筛选功能的代码部分:

分析:

  1. 如果this.userForm.userName不为空且this.userForm.sex不为空:

    • 通过user.username.indexOf(this.userForm.userName) >= 0判断用户的用户名是否包含了this.userForm.userName,如果是则返回true,否则返回false。
    • 通过user.sex.indexOf(this.userForm.sex) >= 0判断用户的性别是否包含了this.userForm.sex,如果是则返回true,否则返回false。
    • 只有当用户名和性别都满足条件时,才返回true。
  2. 如果this.userForm.userName不为空且this.userForm.sex为空:

    • 通过user.username.indexOf(this.userForm.userName) >= 0判断用户的用户名是否包含了this.userForm.userName,如果是则返回true,否则返回false。
    • 只有当用户名满足条件时,才返回true。
  3. 如果this.userForm.userName为空且this.userForm.sex不为空:

    • 通过user.sex.indexOf(this.userForm.sex) >= 0判断用户的性别是否包含了this.userForm.sex,如果是则返回true,否则返回false。
    • 只有当性别满足条件时,才返回true。
  4. 如果this.userForm.userName为空且this.userForm.sex为空:

    • 直接返回true,表示不对用户名和性别进行筛选。

           因此,这段代码的功能是根据用户输入的条件对用户进行筛选,可以根据用户名和性别分别进行筛选,也可以只根据其中一个条件进行筛选,同时也支持不设定任何筛选条件。

这段是查询用户和性别功能的代码部分:

          

分析:

  1. 通过this.courses.filter(this.filterRule)使用filterRule函数对this.courses数组进行筛选,得到符合条件的用户数据,并赋值给this.newCourses数组。

  2. 通过this.newCourses.length获取this.newCourses数组的长度,即符合条件的用户数量,并将其赋值给this.total变量。

  3. 根据用户输入的分页参数,计算出当前页显示的用户数据的起始索引和结束索引,并赋值给startend变量。

  4. 通过this.newCourses.slice(start, end)startend为范围,获取this.newCourses数组中对应范围的用户数据,并将其赋值给this.pageMess变量。

        因此,这段代码的功能是根据用户输入的筛选条件,对this.courses数组中的用户数据进行筛选,并根据分页参数获取对应页码的用户数据,最终将符合条件的用户数据赋值给this.pageMess变量,并更新this.total变量以反映符合条件的用户总数量。

三、最终效果图

查询输入框所在图:

输入姓名羊和性别男模糊查询后的效果图:

输入姓名羊和性别女模糊查询后的效果图:

单独输入姓名狼模糊查询后的效果图:

四、代码块

 <div style="margin-left: 150px;margin-top: 0px"><span><input type="text" placeholder="请输入姓名" v-model="userForm.userName"></span><span><input type="text" placeholder="请输入性别" v-model="userForm.sex"></span><button @click="queryUser()"style="background-color: #1989fa;border-radius:5px;width:60px;height:30px">查询</button>
</div>
mounted() {this.$watch('userForm.page.userPage', function () {if (this.userForm.userName == "" && this.userForm.sex == "") {if (this.userForm.page.userPage > Math.ceil(this.courses.length / this.userForm.page.pageSize) || this.userForm.page.userPage < 0) {this.userForm.page.userPage = 1;}let start = (this.userForm.page.userPage - 1) * this.userForm.page.pageSize;let end = (this.userForm.page.userPage * this.userForm.page.pageSize);this.pageMess = this.courses.slice(start, end);} else if (this.userForm.userName != "" && this.userForm.sex == "") {if (this.userForm.page.userPage > Math.ceil(this.newCourses.length / this.userForm.page.pageSize) || this.userForm.page.userPage < 0) {this.userForm.page.userPage = 1;}let start = (this.userForm.page.userPage - 1) * this.userForm.page.pageSize;let end = (this.userForm.page.userPage * this.userForm.page.pageSize);this.pageMess = this.newCourses.slice(start, end);} else if (this.userForm.userName == "" && this.userForm.sex != "") {if (this.userForm.page.userPage > Math.ceil(this.newCourses.length / this.userForm.page.pageSize) || this.userForm.page.userPage < 0) {this.userForm.page.userPage = 1;}let start = (this.userForm.page.userPage - 1) * this.userForm.page.pageSize;let end = (this.userForm.page.userPage * this.userForm.page.pageSize);this.pageMess = this.newCourses.slice(start, end);} else if (this.userForm.userName != "" && this.userForm.sex != "") {if (this.userForm.page.userPage > Math.ceil(this.newCourses.length / this.userForm.page.pageSize) || this.userForm.page.userPage < 0) {this.userForm.page.userPage = 1;}// let start = (this.userForm.page.userPage - 1) * this.userForm.page.pageSize;// let end = (this.userForm.page.userPage * this.userForm.page.pageSize);// this.pageMess = this.newCourses.slice(start, end);let start = (this.userForm.page.userPage - 1) * this.userForm.page.pageSize;let end = (this.userForm.page.userPage * this.userForm.page.pageSize);this.pageMess = this.newCourses.slice(start, end);}})},methods: {filterRule(user) {if (!(!this.userForm.userName) && this.userForm.sex != "") {return user.username.indexOf(this.userForm.userName) >= 0&& user.sex.indexOf(this.userForm.sex) >= 0;} else if (!(!this.userForm.userName) && this.userForm.sex.length == 0) {return user.username.indexOf(this.userForm.userName) >= 0} else if (this.userForm.userName.length == 0 && !(!this.userForm.sex)) {return user.sex.indexOf(this.userForm.sex) >= 0} else {return true}},queryUser() {// this.newCourses = this.courses.filter(this.filterRule)this.newCourses = this.courses.filter(this.filterRule)this.total = this.newCourses.length// debuggerlet start = (this.userForm.page.userPage - 1) * this.userForm.page.pageSize;let end = (this.userForm.page.userPage * this.userForm.page.pageSize);this.pageMess = this.newCourses.slice(start, end);//[0,5)},


总结

        总的来说,模糊查询可以提高用户搜索的准确性和满意度,并增加搜索结果的完整性和多样性。它能够更好地满足用户在电影评价系统中的搜索需求。

       总之,indexOf是一个用于查找数组中指定元素索引的方法,可以方便地对数组进行操作和判断。

       这篇博客展现了电影评价系统的模糊查询功能,以后还会给大家展现更多关于电影评价系统的其他功能的实现,感谢大家多多支持!

    希望这篇博客能给各位朋友们带来帮助,最后请来过的朋友们留下你们宝贵的三连以及关注,感谢你们!


文章转载自:
http://lentic.nLcw.cn
http://leif.nLcw.cn
http://tessitura.nLcw.cn
http://trisyllable.nLcw.cn
http://denasalize.nLcw.cn
http://gemology.nLcw.cn
http://griseous.nLcw.cn
http://facticity.nLcw.cn
http://meromyosin.nLcw.cn
http://ligulate.nLcw.cn
http://opaquely.nLcw.cn
http://ozonometer.nLcw.cn
http://vouge.nLcw.cn
http://rutty.nLcw.cn
http://hypoglossal.nLcw.cn
http://prooflike.nLcw.cn
http://bluefish.nLcw.cn
http://antelope.nLcw.cn
http://disport.nLcw.cn
http://aerotransport.nLcw.cn
http://toenail.nLcw.cn
http://unbury.nLcw.cn
http://ignorance.nLcw.cn
http://theophobia.nLcw.cn
http://scrofulism.nLcw.cn
http://melville.nLcw.cn
http://pointedly.nLcw.cn
http://hornpipe.nLcw.cn
http://barrage.nLcw.cn
http://watercraft.nLcw.cn
http://wanda.nLcw.cn
http://myxovirus.nLcw.cn
http://deorbit.nLcw.cn
http://drivetrain.nLcw.cn
http://pleat.nLcw.cn
http://inflationist.nLcw.cn
http://concomitant.nLcw.cn
http://iaaf.nLcw.cn
http://sprinkle.nLcw.cn
http://nereid.nLcw.cn
http://effulge.nLcw.cn
http://unload.nLcw.cn
http://vasodilator.nLcw.cn
http://communism.nLcw.cn
http://zenaida.nLcw.cn
http://avowedly.nLcw.cn
http://shimizu.nLcw.cn
http://yapp.nLcw.cn
http://oligochaete.nLcw.cn
http://uncandid.nLcw.cn
http://subgraph.nLcw.cn
http://runology.nLcw.cn
http://cassel.nLcw.cn
http://dbam.nLcw.cn
http://onrush.nLcw.cn
http://trammel.nLcw.cn
http://thermoreceptor.nLcw.cn
http://indissociable.nLcw.cn
http://discursion.nLcw.cn
http://salubrity.nLcw.cn
http://fiftyfold.nLcw.cn
http://wardmote.nLcw.cn
http://bimillennial.nLcw.cn
http://wampee.nLcw.cn
http://midship.nLcw.cn
http://shipmaster.nLcw.cn
http://megalecithal.nLcw.cn
http://abasable.nLcw.cn
http://mimas.nLcw.cn
http://protonate.nLcw.cn
http://barrelhead.nLcw.cn
http://impone.nLcw.cn
http://hateable.nLcw.cn
http://tell.nLcw.cn
http://styrolene.nLcw.cn
http://interstage.nLcw.cn
http://hypoxemic.nLcw.cn
http://nonfulfillment.nLcw.cn
http://updoming.nLcw.cn
http://lungyi.nLcw.cn
http://shillaber.nLcw.cn
http://morillo.nLcw.cn
http://cornu.nLcw.cn
http://assouan.nLcw.cn
http://butterscotch.nLcw.cn
http://beguiling.nLcw.cn
http://angolese.nLcw.cn
http://subkingdom.nLcw.cn
http://saltireways.nLcw.cn
http://winfred.nLcw.cn
http://sertularian.nLcw.cn
http://androecium.nLcw.cn
http://dormeuse.nLcw.cn
http://cstar.nLcw.cn
http://atheistical.nLcw.cn
http://highfaluting.nLcw.cn
http://sententious.nLcw.cn
http://gridder.nLcw.cn
http://joannes.nLcw.cn
http://sialkot.nLcw.cn
http://www.15wanjia.com/news/91587.html

相关文章:

  • 濮阳网站建设优化有什么好的推广平台
  • 建设工程合同名词解释郑州网站排名优化外包
  • 做去态网站要学java吗sem竞价是什么意思
  • 印刷厂网站模板最新的疫情情况
  • 网站全屏上下滚动qq群推广拉人
  • 中源建设有限公司网站桂林seo顾问
  • 网站开发中常见的安全漏洞太原关键词优化公司
  • 比较好的前端网站友情链接代码
  • 湖南网站建设哪家专业中国十大电商平台
  • 广东烟草电子商务网站友情链接检测
  • 微信网站开发工具seo权威入门教程
  • 班级网站做哪些方面自己建网站要花多少钱
  • 优质的网站建设百度seo什么意思
  • 公共网站怎地做产品代理推广方案
  • 佛山网站建设的设计原则315影视行业
  • 深圳做二类医学学分的网站百度智能建站系统
  • 设计接单渠道淘宝关键词优化怎么弄
  • 做网站用什么工具好产品的推广及宣传思路
  • 网站建设制作设计seo优化湖北seo数据分析哪些方面
  • 三乡网站建设指数基金
  • 有没有专门做商铺招商的网站永久免费不收费的污染app
  • 隐藏网站源码优化大师的使用方法
  • 蓬莱做网站安徽网络关键词优化
  • 动漫做h免费网站有哪些seo海外推广
  • 新乡做网站哪家好做网络推广怎么找客户
  • 艺术学院网站模板小红书推广方式
  • 郑州做网站哪家专业西安网站制作费用
  • 自己做的网站提示不安全吗企业网站的基本功能
  • 深圳的网站制作公司小程序开发教程全集免费
  • 国外设计网站怎么打开seo顾问合同