模糊查询与带参数跳转

2023-10-26

一、模糊查询

使用

<select id="selectByPhone" parameterType="String" resultMap="BaseResultMap">
    select * from auth_user where phone like '%' #{phone} '%'
  </select>

或使用

<select id="selectByPhone" parameterType="String" resultMap="BaseResultMap">
    select * from auth_user where phone like %${0}%
  </select>

二、页面带参数跳转

在前一个页面:

uni.redirectTo({
					url:'./user_update?id='+ id
				})	

后一个页面:

使用onLoad接收,在页面跳转时运行

onLoad:function(res){
			this.id = res.id
}

onLoad(options) {
			options.id
		}

三、如何修改中文乱码问题

 在yml文件中的jdbc中url上添加&characterEncoding=utf-8&useSSL=false

url: jdbc:mysql://39.107.35.145:3306/rz_cms?serverTimezone=UTC&characterEncoding=utf-8&useSSL=false
四、用户添加
<template>
	<view >
		<uni-nav-bar backgroundColor="#ffffff" title="睿智法务用户添加界面" leftText="返回" 
		@clickLeft="clickLect" rightText="保存" @clickRight="clickRight" ></uni-nav-bar>
		<view style=" margin-left: auto; margin-right: auto; margin-top: 80rpx;">
			<uni-group mode="card" top="10" title="用户管理系统:用户添加">
				手机号<input singleline='true' placeholder="请输入手机号" type="number" class="input_str" v-model="phone"/>
				昵称<input singleline='true' placeholder="请输入昵称" type="text" class="input_str" v-model="nickName"/>
			</uni-group>
			<uni-popup ref="alertDialog" type="message">
				<uni-popup-message  :message='msg' type="warning"></uni-popup-message>
			</uni-popup>
		</view>
		
	</view>
	
</template>

<script>
	export default{
		data(){
			//数据
			return{
				msg:'',
				phone:'',
				pwd:'123123',
				nickName:'',
				sculpture:'',
			}
		},
		methods:{
			clickLect(){
				uni.redirectTo({
					url:'./user'
				})
			},
			clickRight(){
				uni.request({
				    url: 'http://localhost:8070/auth/user/regedit/'+this.phone + '/' + this.pwd + '/' + this.nickName, //仅为示例,并非真实接口地址。
				    success: (res) => {
				        if(res.data.code == 200){
							uni.redirectTo({
								url:'./user'
							})
						}else{
							this.msg = res.data.message,
							this.$refs.alertDialog.open()
						}
				    }
				});
			},
			upload(){
				this.$refs.files.upload()
			}
		}
	}
</script>

<style>
	.input_str{
		border: 2px solid #000000;
		border-radius: 10rpx; height: 30rpx;
		line-height: 30rpx;
		padding: 10rpx; margin-bottom: 15rpx;
	}
</style>

五、用户修改

<template>
	<view>
		<uni-nav-bar backgroundColor="#ffffff" title="睿智法务用户修改界面" leftText="返回"
		@clickLeft="clickLect" rightText="保存" @clickRight="clickRight" ></uni-nav-bar>
		<view style="margin-left: auto;
				margin-right: auto; margin-top: 80rpx;">
			<uni-group mode="card" top="10" title="用户管理系统:用户修改" >
				手机号:<input singleline='true' placeholder="请输入手机号" type="number" class="input_str" v-model="phone"/>
				昵称:<input singleline='true' placeholder="请输入昵称" type="text" class="input_str" v-model="nickname"/>
			</uni-group>
			<uni-popup ref="alertDialog" type="message">
				<uni-popup-message  :message='msg' type="warning"></uni-popup-message>
			</uni-popup>
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				id:'',
				phone:'',
				pwd:'',
				nickname:'',
				sculpture:'',
				msg:''
			}
		},
		onLoad:function(res){
			this.id = res.id
			uni.request({
				url:'http://localhost:8070/auth/user/getUserById/'+this.id,
				success: (res) => {
					if(res.data.code == 200){
						this.phone = res.data.data.phone,
						this.pwd = res.data.data.passwd,
						this.nickname = res.data.data.nickname
					}else{
						this.msg = res.data.message,
						this.$refs.alertDialog.open()
					}
				}
			})
		}, 
		methods:{
			clickLect(){
				uni.redirectTo({
					url:'./user'
				})	
			},
			clickRight(){
				uni.request({
					url:'http://localhost:8070/auth/user/modity/'+ this.id +'/'+this.phone +'/'+this.pwd+'/'+ this.nickname,
					success: (res) => {
						if(res.data.code == 200){
								uni.redirectTo({
									url:'./user'
								})
							}else{
								this.msg = res.data.message,
								this.$refs.alertDialog.open()
							}
						
					}
				})
			},
		}
	}
	
</script>

<style>
	.input_str{
		border: 2px solid #000000;
		border-radius: 10rpx; height: 30rpx;
		 padding: 10rpx; margin-bottom: 15rpx;
	}
</style>

六、table多选回显

this.$refs.roletable.toggleRowSelection(j,true)

j:对应的行的序号

true:selected的值(true代表选中,默认值为false

七、搜索栏

<uni-search-bar @input="input" @confirm="confirm" :radius="100"
			style="margin-bottom: 15rpx;" bgColor="Pink" 
			@cancel="cancel" @clear="clear" placeholder='请输入手机号'></uni-search-bar>
<--@input 数据输入;@confirm 回车 ;@cancel 点击取消按钮 ;@clear 点击输入框最后的x号-->
clear(){

		this.getUserList()
},
cancel(){
		this.getUserList()
},
input(e){

},
confirm(res) {
	uni.request({
	url:'http://localhost:8070/auth/user/getUser/'+res.value,
	success: (res) => {
		this.userList = res.data.data
		this.total = res.data.rows
		}
	})
},
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

模糊查询与带参数跳转 的相关文章

随机推荐

  • vue3基础 ---- 上

    目录 一 vue3介绍 1 官网初识 2 环境搭建 2 1 线上尝试 2 2 CDN使用 2 3 Vue CLI 2 4 Vite 二 vue3基础 1 模板语法 1 1 我的第一个vue应用 1 2 应用背后的真相 1 3 模板语法 新的
  • API 治理的目标是什么?

    建立有效的API治理需要正确理解其目标 但它究竟是什么呢 是定义标准或规则并应用它们吗 都不是 虽然这些是治理的一个重要手段 但这并非其最终目的 为了揭示API治理的真正目标 让我们探讨一下在适当地制定标准后能得到什么 1 从 API 混乱
  • Jetty服务器好处

    Jetty可以同时处理大量连接而且可以长时间保持连接 适合于web聊天应用等等 Jetty的架构简单 因此作为服务器 Jetty可以按需加载组件 减少不需要的组件 减少了服务器内存开销 从而提高服务器性能 Jetty默认采用NIO结束在处理
  • python中sys是什么意思_python里的sys是什么意思

    sys模块功能多 我们这里介绍一些比较实用的功能 相信你会喜欢的 和我一起走进python的模块吧 sys模块的常见函数列表 sys argv 实现从程序外部向程序传递参数 sys exit arg 程序中间的退出 arg 0为正常退出 s
  • ubuntu配置mysql网络连接_在Ubuntu14.04中配置mysql远程连接教程

    上一篇文章 小编带大家学会了在Ubuntu14 04中安装MySQL 没有来得及上课的小伙伴们可以戳这篇文章 如何在Ubuntu14 04中安装mysql 今天给大家分享一下 如何简单的配置MySQL 可以实现远程连接 具体的教程如下 1
  • 代码雨类库的实现

    代码雨类库的实现 电影黑客帝国有个代码雨效果 挺酷的 我在网上看到了使用js写的代码雨的代码 我把由函数实现的代码 改为使用类实现代码雨特效 一 设计一个简单美化的网页且包含该有的功能 功能 1 一块画布 实现代码雨的展示 2 初始化按钮
  • 字节跳动第五届青训营后端练习题——分割ip(Java版)

    题目 有效 IP 地址正好由四个整数 每个整数位于 0 到 255 之间组成 且不能含有前导 0 整数之间用 分隔 例如 0 1 2 201 和 192 168 1 1 是有效 IP 地址 但是 0 011 255 245 192 168
  • nginx 反向代理常用配置

    全部代理 location 设置跨域 add header Access Control Allow Origin add header Access Control Allow Methods GET POST OPTIONS add h
  • TS2559: Type ‘{ children: string; }‘ has no properties in common with type ‘IntrinsicAttributes & Fi

    Type children string key string is not assignable to type IntrinsicAttributes FilterTagPropsType Property children does
  • 锁与事务的关系

    在并发场景下 我们往往需要在事务方法中加锁来应对并发 如下 下面以 ReentrantLock 为例子 public final static ReentrantLock MY LOCK new ReentrantLock Transact
  • ubuntu安装ssh无法连接解决日志(已解决,可连接)

    原文链接http bbs chinaunix net thread 3585704 1 1 html 网上有很多介绍在Ubuntu下开启SSH服务的文章 但大多数介绍的方法测试后都不太理想 均不能实现远程登录到Ubuntu上 最后分析原因是
  • SpringBoot项目配置全局处理异常

    1 自定义异常 自定义异常 public class RRException extends RuntimeException private static final long serialVersionUID 1L private St
  • k8s学习

    主节点配置一定要好 K8S学习之路 1 介绍 1 1单机部署 1 2 虚拟化部署 类似window上安装多个linux虚拟机 在虚拟机中部署程序 使得程序之间不会互相影响 1 3 容器化部署 共享了操作系统 保证每个系统拥有自己的文件系统
  • MySQL-binlog2sql:非主从关系实现数据的【数据同步+数据恢复+数据追踪】

    文章目录 MySQL binlog2sql 非主从实时同步 恢复误删数据 1 引 1 介绍 2 功能 3 针对3种场景 4 脚本汇总说明 2 先决条件 1 安装 MySQL 2 修改 MySQL 配置 3 安装 binlog2sql 1 解
  • yii2 mysql设置时区

    第一步 修改配置文件 common config db php 注 8 00为北京时间 Asia Shanghai common config main php 第二步 修改vendor yiisoft yii2 db Connection
  • 抓取网站中的视频

    最近想从别人家的网站宣传片上提取一些素材 借鉴一下 之前也没有弄过 但是我的思路就是从网页的缓存中查找播放完后缓存的视频 然后失败了 然后又想到了网页打开源代码 然后查找到网页源代码饮用的视频的路径 然后找到视频 然后 再次失败 网上找了好
  • css基础———清除浮动的一些方法及区别

    为什么要清楚浮动 地址 http blog csdn net qwe502763576 article details 78811658 清除浮动方法概览 这里例举四种常见的清除浮动方式 方式一 使用overflow属性来清除浮动 ovh
  • 论文阅读

    简介 paper https arxiv org abs 1911 11907 github https github com huawei noah ghostnet Ghostnet CVPR2020 是华为提出的一种轻量级网络 结构类
  • WSL安装

    WSL安装教程 WSL简介 Windows Subsystem for Linux 简称WSL 是一个在Windows10上能够运行原生Linux二进制可执行文件 ELF格式 的兼容层 它是有微软与Canonical公司合作开发 其目标正是
  • 模糊查询与带参数跳转

    一 模糊查询 使用