Jelajahi Sumber

Merge branch 'master' of http://47.101.143.145:8090/77975466/pco

qzyReal 3 tahun lalu
induk
melakukan
3d2fe343bc

+ 274 - 0
app/components/slider-verify/slider-verify.vue

@@ -0,0 +1,274 @@
+<template>
+	<view class="slider-verify-box" v-if="isShow">
+		<view class="verifyBox">
+			<view class="slider-title">图形验证</view>
+			<view class="slide-content">
+				<view class="slide-tips">拖动下方滑块完成拼图</view>
+				<view class="slider-pintu">
+					<!-- <image id="pintuImg" :src="'../../images/slider-verify/' + img + '.jpg'" class="pintu"></image> -->
+					<!-- <image id="pintuImg" :src="imgSrc" class="pintu"></image> -->
+					<image id="pintuImg" src="../../static/slider-verify/5.jpg" class="pintu"></image>
+					<view class="pintukuai" :style="{ top: top + 'px', left: oldx + 'px' }">
+						<!-- <image :src="'../../images/slider-verify/' + img + '.jpg'" :style="{ top: '-' + top + 'px', left: '-' + left + 'px'}"></image> -->
+						<image src="../../static/slider-verify/5.jpg" :style="{ top: '-' + top + 'px', left: '-' + left + 'px'}"></image>
+					</view>
+					<view class="yinying" :style="{ top: top + 'px', left: left + 'px' }"></view>
+				</view>
+
+				<view class="slider-movearea" @touchend="endTouchMove">
+					<movable-area :animation="true"><movable-view :x="x" direction="horizontal" @change="startMove"></movable-view></movable-area>
+
+					<view class="huadao">拖动左边滑块完成上方拼图</view>
+				</view>
+			</view>
+			
+			<view class="slider-btn-group">
+				<view class="slider-btn" @tap="closeSlider">关闭</view>
+				<view class="slider-btn slide-btn-refresh" @tap="refreshVerify">刷新</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+export default {
+	name: 'slider-verify',
+	props: {
+		isShow: true
+	},
+	data() {
+		return {
+			x: 0, //初始距离
+			oldx: 0, //移动的距离
+			img: 1, //显示哪张图片
+			left: 0, //随机拼图的最终X轴距离
+			top: 0, //拼图的top距离
+			//imgSrc: '@/static/slider-verify/1.jpg'
+			//imgSrc: '../../static/slider-verify/1.jpg'
+		};
+	},
+	watch: {
+		// 每次打开重新刷新拼图
+		isShow(newValue, oldValue) {
+			if(newValue){
+				this.refreshVerify();	//刷新
+			}
+		}
+	},
+	mounted() {
+		var that = this;
+		that.refreshVerify();
+	},
+	methods: {
+		//刷新验证
+		refreshVerify() {
+			var gl = Math.random().toFixed(2);
+			this.left = uni.upx2px(560) * gl > uni.upx2px(280) ? uni.upx2px(280) : uni.upx2px(560) * gl + uni.upx2px(150); //生成随机X轴最终距离
+			this.top = uni.upx2px(190) * gl; //生成随机Y轴初始距离
+			
+			if (gl <= 0.2) {
+				this.img = 1;
+			}
+			if (gl > 0.2 && gl <= 0.4) {
+				this.img = 2;
+			}
+			if (gl > 0.4 && gl <= 0.6) {
+				this.img = 3;
+			}
+			if (gl > 0.6 && gl <= 0.8) {
+				this.img = 4;
+			}
+			if (gl > 0.8 && gl <= 1) {
+				this.img = 5;
+			}
+			
+			this.resetMove();	//重置阴影位置
+		},
+
+		/* 滑动中 */
+		startMove(e) {
+			this.oldx = e.detail.x;
+		},
+
+		/* 滑动结束 */
+		endTouchMove() {
+			var that = this;
+
+			if (Math.abs(that.oldx - that.left) <= 5) {
+				uni.showToast({
+					title: '验证成功',
+					duration: 2500,
+					success() {
+						that.$emit('touchSliderResult', true);
+					}
+				});
+			} else {
+				that.refreshVerify();
+			}
+		},
+		
+		/* 重置阴影位置 */
+		resetMove() {
+			this.x = 1;
+			this.oldx = 1;
+			setTimeout(() => {
+				this.x = 0;
+				this.oldx = 0;
+			}, 300);
+		},
+		
+		// 关闭
+		closeSlider(){
+			this.$emit('touchSliderResult', false);
+		}	
+	}
+};
+</script>
+
+<style lang="less">
+.slider-verify-box {
+	position: fixed;
+	top: 0;
+	left: 0;
+	width: 100%;
+	height: 100%;
+	background-color: rgba(0, 0, 0, 0.5);
+	z-index: 999;
+}
+.verifyBox {
+	position: absolute;
+	top: 50%;
+	left: 50%;
+	transform: translate(-50%, -50%);
+	// width: 85%;
+	background-color: #fff;
+	border-radius: 20upx;
+	box-shadow: 0 0 5upx rgba(0, 0, 0);
+
+	.slider-title {
+		font-size: 36upx;
+		text-align: center;
+		padding: 1em 0;
+		color: rgba(2, 20, 33, 0.85);
+		border-bottom: 1px solid rgba(2, 20, 33, 0.15);
+	}
+
+	.slide-content {
+		width: 560rpx;
+		padding: 0 1em;
+		margin: 0 auto;
+		.slide-tips {
+			font-size: 28rpx;
+			color: rgba(2, 20, 33, 0.45);
+			padding: 0.5em 0;
+		}
+
+		.slider-pintu {
+			position: relative;
+			width: 100%;
+			border-radius: 10rpx;
+			overflow: hidden;
+			.pintu {
+				width: 560rpx;
+				height: 315rpx;
+				display: block;
+				margin: 0 auto;
+			}
+
+			.pintukuai {
+				position: absolute;
+				top: 0;
+				left: 0;
+				width: 120rpx;
+				height: 120rpx;
+				z-index: 100;
+				box-shadow: 0 0 5upx rgba(0, 0, 0, 0.3);
+				overflow: hidden;
+
+				image {
+					display: block;
+					position: absolute;
+					top: 0;
+					left: 0;
+					width: 560rpx;
+					height: 315rpx;
+				}
+			}
+		}
+
+		.yinying {
+			position: absolute;
+			width: 120rpx;
+			height: 120rpx;
+			background-color: rgba(0, 0, 0, 0.7);
+			//background-color: #ccc;
+		}
+	}
+}
+
+.slider-movearea {
+	position: relative;
+	height: 80upx;
+	width: 100%;
+	margin: 25upx auto;
+
+	movable-area {
+		height: 80upx;
+		width: 100%;
+
+		movable-view {
+			width: 80upx;
+			height: 80upx;
+			border-radius: 50%;
+			background-color: #007cff;
+			background-image: url(../../static/slider-verify/icon-button-normal.png);
+			background-repeat: no-repeat;
+			background-size: auto 30upx;
+			background-position: center;
+			position: relative;
+			z-index: 100;
+		}
+	}
+}
+
+.huadao {
+	width: 100%;
+	height: 66upx;
+	line-height: 66upx;
+	background: #eee;
+	box-shadow: inset 0 0 5upx #ccc;
+	border-radius: 40rpx;
+	color: #999;
+	text-align: center;
+	box-sizing: border-box;
+	position: absolute;
+	top: 7rpx;
+	left: 0;
+	font-size: 28rpx;
+	z-index: 99;
+}
+
+.slider-btn-group{
+	width: 100%;
+	display: flex;
+	justify-content: center;
+	align-items: center;
+	border-top: 1px solid rgba(2, 20, 33, 0.15);
+	
+	.slider-btn{
+		flex: 1;
+		height: 100rpx;
+		line-height: 100rpx;
+		text-align: center;
+		font-size: 36rpx;
+		color:rgba(2,20,33,0.85);
+		&:active{
+			opacity: 0.8;
+		}
+	}
+	.slide-btn-refresh{
+		color:rgba(14,107,176,1);
+		border-left: 1px solid rgba(2, 20, 33, 0.15);
+	}	
+}
+</style>

+ 3 - 0
app/manifest.json

@@ -73,6 +73,9 @@
         "router" : {
             "base" : "./",
             "mode" : "history"
+        },
+        "devServer" : {
+            "https" : true
         }
     }
 }

+ 1 - 1
app/pages/index/index.vue

@@ -215,7 +215,7 @@
 		align-items: center;
 		justify-content: center;
 		margin: 60rpx 0;
-		margin-top: -300rpx;
+		margin-top: -400rpx;
 		position: relative;
 		z-index: 2;
 

+ 49 - 5
app/pages/login/login.vue

@@ -1,9 +1,10 @@
 <template>
 	<view>
+		<view class="l-topbox">
+			<text>欢迎登录场站管理系统</text>
+		</view>
 		<view class="box">
-			<view class="top" style="margin-bottom: 50rpx;">
-				<text class="title">登录</text>
-			</view>
+			
 			<view class="item">
 				<view class="l">登录名:</view>
 				<view class="r">
@@ -24,7 +25,8 @@
 				</view>
 			</view> -->
 		</view>
-		<view class="common-btn" @click="loginFn">确认登录</view>
+		<view class="common-btn" @click="sliderVerifyFLag = true">确认登录</view>
+		<slider-verify :isShow="sliderVerifyFLag" @touchSliderResult="verifyResult" ref="verifyElement"></slider-verify>
 	</view>
 </template>
 
@@ -32,6 +34,7 @@
 	export default {
 		data() {
 			return {
+				sliderVerifyFLag: false, //滑块验证
 				form:{
 					key:'',
 					password:''
@@ -60,6 +63,16 @@
 						this.$common.toast('登录失败');
 					}
 				})
+			},
+			verifyResult(res) {
+				this.sliderVerifyFLag = false;
+				
+				if (res) {  //校验通过
+					this.loginFn()
+				}else{
+					// 校验失败,点击关闭按钮
+					console.log("验证失败,并点了关闭")
+				}
 			}
 			
 			
@@ -71,5 +84,36 @@
 	page{
 		background-color: #fff;
 	}
-	@import '@/common/common.scss'
+	.l-topbox{
+		//background-color: #0080ff;
+		height: 400rpx;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		//border-radius: 0 0 30rpx 30rpx;
+		margin-bottom: 50rpx;
+		background-image: url(../../static/login-bg.png);
+		background-size: 100% 100%;
+		text{
+			font-size: 50rpx;
+			font-weight: bold;
+			color: #fff;
+		}
+	}
+	@import '@/common/common.scss';
+	.box{
+		box-shadow: 0 10rpx 30rpx rgba(0,0,0,0.05);
+		background-color: #fff;
+		box-sizing: border-box;
+		margin: 60rpx;
+		margin-top: -150rpx;
+		width: auto;
+		border-radius: 10rpx;
+	}
+	.common-btn{
+		margin: 100rpx 60rpx;
+		width: auto;
+		height: 98rpx;
+		box-shadow: 0 30rpx 30rpx -15rpx rgba(0,128,255,0.2);
+	}
 </style>

TEMPAT SAMPAH
app/static/login-bg.png


TEMPAT SAMPAH
app/static/slider-verify/1.jpg


TEMPAT SAMPAH
app/static/slider-verify/2.jpg


TEMPAT SAMPAH
app/static/slider-verify/3.jpg


TEMPAT SAMPAH
app/static/slider-verify/4.jpg


TEMPAT SAMPAH
app/static/slider-verify/5.jpg


TEMPAT SAMPAH
app/static/slider-verify/icon-button-normal.png


+ 3 - 1
app/uview-ui/components/u-input/u-input.vue

@@ -287,7 +287,9 @@ export default {
 
 <style lang="scss" scoped>
 @import "../../libs/css/components.scss";
-
+.u-border{
+	border: none;
+}
 .u-input {
     @include flex(row);
     align-items: center;

+ 1 - 1
sp-admin/sa-frame/nav/nav-logo.vue

@@ -32,6 +32,6 @@
 		margin-left: 22px;
 	}
 	
-	.admin-title{padding-right: 0.5em; margin-left: 0.5em; font-size: 1.05em;}
+	.admin-title{padding-right: 0.5em; margin-left: 2em; font-size: 1.05em;}
 	
 </style>

+ 9 - 9
sp-admin/sa-view-sp/sp-admin/admin-list.html

@@ -24,23 +24,23 @@
 				<!-- ------------- 检索参数 ------------- -->
 				<h4 class="c-title">检索参数</h4>
 				<el-form>
-					<sa-item type="text" name="名" v-model="p.name"></sa-item>
+					<sa-item type="text" name="用户名" v-model="p.name"></sa-item>
 					<el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
 					<br>
-					<sa-item name="综合排序" class="s-radio-text">
-						<el-radio-group v-model="p.sort_type">
-							<el-radio :label="0">最近添加</el-radio>
-							<el-radio :label="2">最近登录</el-radio>
-							<el-radio :label="3">登录次数</el-radio>
-						</el-radio-group>
-					</sa-item>
+<!--					<sa-item name="综合排序" class="s-radio-text">-->
+<!--						<el-radio-group v-model="p.sort_type">-->
+<!--							<el-radio :label="0">最近添加</el-radio>-->
+<!--							<el-radio :label="2">最近登录</el-radio>-->
+<!--							<el-radio :label="3">登录次数</el-radio>-->
+<!--						</el-radio-group>-->
+<!--					</sa-item>-->
 				</el-form>
 				<!-- ------------- 快捷按钮 ------------- -->
 				<sa-item type="fast-btn" show="add,get,delete,export,reset"></sa-item>
 				<!-- ------------- 数据列表 ------------- -->
 				<el-table class="data-table" ref="data-table" :data="dataList">
 					<sa-td type="selection"></sa-td>
-					<sa-td type="user-avatar" name="昵称" prop="name,avatar" min-width="120px"></sa-td>
+					<sa-td type="user-avatar" name="用户名" prop="name,avatar" min-width="120px"></sa-td>
 					<sa-td type="text" name="手机" prop="phone"></sa-td>
 					<sa-td name="创建人" >
 						<template slot-scope="s">

+ 4 - 4
sp-admin/sa-view/tb-costomer/customer-admin-list.html

@@ -24,7 +24,7 @@
 				<!-- ------------- 检索参数 ------------- -->
 				<h4 class="c-title">检索参数</h4>
 				<el-form>
-					<sa-item type="text" name="登录名" v-model="p.name"></sa-item>
+					<sa-item type="text" name="用户名" v-model="p.name"></sa-item>
 					<el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
 					<br>
 
@@ -34,7 +34,7 @@
 				<!-- ------------- 数据列表 ------------- -->
 				<el-table class="data-table" ref="data-table" :data="dataList">
 					<sa-td type="selection"></sa-td>
-					<sa-td type="text" name="登录名" prop="name" min-width="120px"></sa-td>
+					<sa-td type="text" name="用户名" prop="name" min-width="120px"></sa-td>
 					<sa-td type="datetime" name="创建时间" prop="createTime" width="150px"></sa-td>
 					<sa-td type="datetime" name="最后登录" prop="loginTime" width="150px"></sa-td>
 					<sa-td type="text" name="登录次数" prop="loginCount" not="0" width="100px"></sa-td>
@@ -154,8 +154,8 @@
 					},
 					// 查看详情
 					getInfo: function(data) {
-						//sa.showIframe('账号详情', 'admin-info.html?id=' + data.id, '700px', '80%');
-						sa.$page.openAdminInfo(data.id, data.name);
+						sa.showIframe('账号详情', '../../sa-view-sp/sp-admin/admin-info.html?id=' + data.id, '700px', '80%');
+						//sa.$page.openAdminInfo(data.id, data.name);
 					},
 					// 查看 - 根据选中的
 					getBySelect: function(data) {

+ 2 - 2
sp-server/src/main/java/com/pj/project/tb_item/TbItem.java

@@ -47,8 +47,6 @@ public class TbItem extends Model<TbItem> implements Serializable {
      * 项目编号
      */
     private String itemCode;
-    private String typeName;
-
 
     /**
      * 项目名称
@@ -64,5 +62,7 @@ public class TbItem extends Model<TbItem> implements Serializable {
     private double maxWeight;
     private int status;
 
+    @TableField(exist = false)
+    private String typeName;
 
 }

+ 3 - 1
sp-server/src/main/java/com/pj/project/tb_item/TbItemMapper.xml

@@ -47,11 +47,13 @@
         <result property="carLength" column="car_length" />
         <result property="maxWeight" column="max_weight" />
         <result property="status" column="status" />
+        <result property="typeName" column="type_name" />
     </resultMap>
 
     <!-- 公共查询sql片段 -->
     <sql id="select_sql">
-		select *
+		select *,
+		(select name from tb_item_type where id = tb_item.type_id) as type_name
 		from tb_item
 	</sql>
 

+ 6 - 1
sp-server/src/main/java/com/pj/project/tb_item/TbItemService.java

@@ -2,14 +2,19 @@ package com.pj.project.tb_item;
 
 import java.util.List;
 
+import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.pj.project.tb_item_type.TbItemType;
+import com.pj.project.tb_item_type.TbItemTypeService;
 import com.pj.utils.so.SoMap;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import com.pj.utils.sg.*;
 
+import javax.annotation.Resource;
+
 /**
  * Service: tb_item -- 作业配置项
  * @author qzy 
@@ -43,7 +48,7 @@ public class TbItemService extends ServiceImpl<TbItemMapper,TbItem> implements I
 
 	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
 	List<TbItem> getList(SoMap so) {
-		return tbItemMapper.getList(so);	
+        return tbItemMapper.getList(so);
 	}