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

wordpress查看自己网站的ip量企业形象网站模板

wordpress查看自己网站的ip量,企业形象网站模板,北京智能建站系统价格,旅游网站开发文献综述功能需求: 列表进行批量查询,需要对输入的值做提交校验,分三种情况: 若部分字符串有误,部分字符串需要变更字体颜色做提示,再次点击确认则对部分正确数据执行批量查询 若全部数据有误则变更字体颜色做提示&…

功能需求:

列表进行批量查询,需要对输入的值做提交校验,分三种情况:
若部分字符串有误,部分字符串需要变更字体颜色做提示,再次点击确认则对部分正确数据执行批量查询
若全部数据有误则变更字体颜色做提示,再次点击确认查询为空
若全部数据正确则直接执行批量查询

需要变更字体颜色做提示的情况分三种:
一种为重复数据
一种为未通过校验数据
一种为既没有通过校验又重复的数据

知识点:

contenteditable:contenteditable为true可编辑元素内容

实现:

<el-button type="primary" :size="$formSize" @click="handleBatchQuery">批量查询</el-button><!--批量查询-->
<el-dialog title="批量查询" :visible.sync="batchQuery" width="600px"><div v-if="batchQuery" id="editor" class="editor" ref="editor" contenteditable="true" @click="showInput=true"><span v-if="!showInput" class="uninput">手动输入多个ICCID或设备id,以换行符分隔,如:<br/>94816c8ded8f<br/>94816c8ded8f</span></div><div slot="footer" class="dialog-footer"><el-button @click="cancelQuery">取消</el-button><el-button type="primary" @click="submitQuery">确定</el-button></div>
</el-dialog>
import request from "@/utils/request";
export default {data(){return{searchForm:{}batchQuery:false,showInput:false,queryInput:'',oldQueryInput:[],resultList:[],once:false,}},methods:{//批量查询handleBatchQuery(){this.showInput=falsethis.batchQuery=truethis.queryInput=undefinedthis.searchForm.batchStr=undefined //查询条件this.oldQueryInput=[]this.once=false},//取消批量查询cancelQuery(){this.showInput=falsethis.batchQuery=falsethis.queryInput=undefinedthis.searchForm.batchStr=undefinedthis.oldQueryInput=[]this.once=falsethis.$refs.editor.innerHTML=''},//提交批量查询submitQuery(){//无填写内容有提示语时确认if(this.$refs.editor.innerHTML.indexOf('手动输入多个ICCID或设备id')!=-1){this.handleQuery()this.batchQuery=falsereturn}this.queryInput=this.$refs.editor.innerText.split(/[(\r\n)\r\n]+/).filter(item=>item)//填写内容超过100条时确认if(this.queryInput.length>100){this.$message.warning('批量查询数据数量不能超过100条')this.batchQuery=truethis.once=falsereturn}//无填写内容无提示语时确认if(this.queryInput.length===0){this.handleQuery()this.batchQuery=falsereturn}let batchList=this.queryInputif(!this.once){this.oldQueryInput=this.queryInput}else{this.oldQueryInput=Array.from(new Set(this.oldQueryInput.filter(item=>!this.resultList.includes(item))))}let batchStr=this.oldQueryInput.join(',');//联调校验接口request({url: `接口路径`,method: 'post',data: {batchStr:batchStr},}).then((res) => {if (res.code === "200") {this.resultList=res.data || []this.once=trueif(this.resultList.length===0){this.batchQuery=falsethis.searchForm.batchStr=this.oldQueryInput.join(',');this.handleQuery()this.$refs.editor.innerHTML=''this.showInput=false}else{this.batchQuery=truelet repeat=[]for (let i = 0; i < batchList.length; i++) {if (batchList.indexOf(batchList[i]) !== i) {repeat.push(batchList[i]);}}batchList=batchList.map(item=>{if(repeat.includes(item)&&!this.resultList.includes(item)){return item=`<div style="color:red">${item+',数据重复'}</div>`}else if(this.resultList.includes(item)&&!repeat.includes(item)){return item=`<div style="color:red">${item+',无结果'}</div>`}else if(repeat.includes(item)&&this.resultList.includes(item)){return item=item=`<div style="color:red">${item+',无结果且数据重复'}</div>`}else{return item=`<div>${item}</div>`;}})this.$refs.editor.innerHTML=batchList.join('\n')}}})},}
}
.editor{width: 100%;height: 150px;overflow: auto;border: 1px solid #dcdfe6;
}
.uninput{color: #dcdfe6;color: #c0c4cc;line-height: 20px;
}

效果:
在这里插入图片描述
在这里插入图片描述

当文字颜色变更提示后,再次点击确认后只会查询正确的(包含数据重复的)数据

http://www.yayakq.cn/news/22905/

相关文章:

  • wordpress建站心得怎么做公司
  • 网站域名购买com营销服务机构有哪些
  • 做跳转链接到自己的网站做册子模板素材有哪些网站
  • WordPress不关站备案插件中国网站排行榜前100名
  • 中兴建设云南有限公司网站网站建设好销售吗
  • 网站设计机构排名衡水做网站
  • 网站哪家公司做的最好中国企业登记网官网
  • 和平天津网站建设江门网站建设推广策划
  • 岳阳建设公司网站集团公司简介模板
  • 品牌网站建是啥百度百科创建
  • 网站建设简报崂山区建设管理局网站怎么了黑
  • 自己做网站怎么连接外网万州网站推广
  • 英德市住房和城乡建设局网站建设项目验收公示网站
  • 黄山建设厅官方网站东莞网站建设的公司
  • 北京公司注册在哪个网站运营企业网站
  • asp.net做网站视频网站下拉菜单html做多大
  • 织梦企业黄页网站源码无人区在线观看高清1080
  • 网站中图片怎么做的济南网站排名优化报价
  • 虹口集团网站建设1688品牌加盟网
  • 宜春做网站公司如何建造一个网站
  • 网站开发公司面试题开发一个app要多少费用
  • 荣县住房和城乡建设厅网站湛艺建设集团网站
  • 天津手机网站建站培训网站建设需要提供那些资料
  • 怎么做搜索网站网站安全证书存在问题
  • 建立网站目的管理软件应用
  • tomcat建网站能用的免费proxy网页
  • 一步步教做音乐网站wordpress免费简约主题下载
  • 手机号交易网站源码基于php的网站开发英文文献
  • 网站备案取消前置审批彩票网站开发违法
  • 邯郸网站推广wordpress证书查询