From 06ee76d0a83854ad7a044689627e0f00a66e5ce5 Mon Sep 17 00:00:00 2001
From: lijh <lijh>
Date: Wed, 19 Jan 2022 18:36:23 +0800
Subject: [PATCH] 表单校验

---
 src/components/swichLabel/main1-show.vue |   90 +++++++++++++++++++++++++++++++++-----------
 1 files changed, 67 insertions(+), 23 deletions(-)

diff --git a/src/components/swichLabel/main1-show.vue b/src/components/swichLabel/main1-show.vue
index 15a592b..d9ab8d2 100644
--- a/src/components/swichLabel/main1-show.vue
+++ b/src/components/swichLabel/main1-show.vue
@@ -12,19 +12,26 @@
 				:bodyStyle="{padding:'0px'}" :wrapStyle="{padding:'0px',top:'60px'}">
 				<boxRight></boxRight>
 			</a-drawer>
-
-			<a-modal v-model="visible" title="日志添加" on-ok="handleOk" >
-				<template slot="footer">
-					<a-button key="back" @click="handleCancel">
-						暂缓
-					</a-button>
-					<a-button key="submit" type="primary" :loading="loading" @click="handleOk">
-						完事..
-					</a-button>
-				</template>
-				<box10 ref="modal" ></box10>
-			</a-modal>
-
+			<a-row>
+				<a-col v-bind="colApiLeft">
+					<div class="myModal">
+						<a-modal v-model="visible" title="日志添加" on-ok="handleOk">
+							<template slot="footer">
+								<a-button key="reset" @click="reset" type="danger">
+									擦掉重来
+								</a-button>
+								<a-button key="back" @click="handleCancel">
+									歇会
+								</a-button>
+								<a-button key="submit" type="primary" :loading="loading" @click="handleOk">
+									完事<span style="font-size: 10px;">儿</span>..
+								</a-button>
+							</template>
+							<box10 ref="modalBox"></box10>
+						</a-modal>
+					</div>
+				</a-col>
+			</a-row>
 		</div>
 		<div class="blog-main">
 			<a-row>
@@ -41,8 +48,9 @@
 					</a-button>
 					<a-button @click="showModal">
 						日志
-						<a-icon type="plus-circle" style="margin-left: 0px;"/>
+						<a-icon type="plus-circle" style="margin-left: 0px;" />
 					</a-button>
+					<tempFriendBox></tempFriendBox>
 					<router-view class="fade"></router-view>
 				</a-col>
 
@@ -56,35 +64,52 @@
 </template>
 
 <script>
+	import tempFriendBox from "../group/tempFriendBox.vue"
 	import box10 from "../mini/box10-add.vue"
 	import boxLeft from "../group/boxLeft.vue"
 	import boxRight from "../group/boxRight.vue"
-	import articleList from "../group/articleList.vue"
 	import articleListScorll from "../group/articleListScorll.vue"
 
 	export default {
 
 		components: {
+			tempFriendBox,
 			box10,
 			boxLeft,
 			boxRight,
-			articleList,
 			articleListScorll,
-
-
 		},
 		methods: {
+			getCalendarContainer(trigger) {
+				return this.$refs.myModal;
+			},
 			showModal() {
 				this.visible = true;
 			},
 			handleOk(e) {
-				console.log(this.$refs.modal.form);
-		
+				console.log(this.$refs.modalBox.form);
+				var res = this.$refs.modalBox.$refs.myForm.validate(valid => {
+					if (valid) {
+						this.$message.info("校验通过")
+					} else {
+						this.$message.info("校验失败")
+						return false;
+					}
+				});
+
+
+				if (!res) return;
+
+				this.$message.info("提交表单")
+
 				this.loading = true;
 				setTimeout(() => {
 					this.visible = false;
 					this.loading = false;
 				}, 3000);
+			},
+			reset(e) {
+				var res = this.$refs.modalBox.$refs.myForm.resetFields()
 			},
 			handleCancel(e) {
 				this.visible = false;
@@ -231,11 +256,14 @@
 	}
 
 
+	@card-box-shadow: 8px 8px 18px rgba(0, 0, 0, 0.1), -8px -8px 18px rgba(255, 255, 255, 1);
+
 	/*---------------------
 		|   核心盒子构成start   |
 		------- ---------------*/
 	.blog-container {
 		border-radius: 15px;
+		// background-color: #f5f8fa;
 		background-color: white;
 
 		line-height: 1.4;
@@ -255,9 +283,25 @@
 		padding-top: 10px;
 		padding-bottom: 20px;
 		overflow: hidden;
-		-webkit-box-shadow: 0 12px 15px 0 rgba(0, 0, 0, 0.24), 0 17px 50px 0 rgba(0, 0, 0, 0.19);
-		box-shadow: 0 12px 15px 0 rgba(0, 0, 0, 0.24), 0 17px 50px 0 rgba(0, 0, 0, 0.19);
-		// box-shadow: 1px 1px 1px 2px #00000059
+		// box-shadow: 1px 1px 1px 2px #00000059;
+		
+		// -webkit-box-shadow: 0 12px 15px 0 rgba(0, 0, 0, 0.24), 0 17px 50px 0 rgba(0, 0, 0, 0.19);
+		// box-shadow: 0 12px 15px 0 rgba(0, 0, 0, 0.24), 0 17px 50px 0 rgba(0, 0, 0, 0.19);
+
+		box-shadow: @card-box-shadow;
+		-webkit-box-shadow: @card-box-shadow;
+		transition: all .4s;
+		-webkit-transition: all .6s;
+		-moz-transition: all .6s;
+		-o-transition: all .6s;
+		-ms-transition: all .6s;
+	}
+
+	//div本体阴影
+	.blog-container:hover {
+		transition: all .25s;
+		-webkit-box-shadow: 0 0 0 rgba(0, 0, 0, 0.2), 0 0 0 rgba(255, 255, 255, 0.8), inset 9px 9px 15px rgba(0, 0, 0, 0.1), inset -9px -9px 15px rgba(255, 255, 255, 1);
+		box-shadow: 0 0 0 rgba(0, 0, 0, 0.2), 0 0 0 rgba(255, 255, 255, 0.8), inset 9px 9px 15px rgba(0, 0, 0, 0.1), inset -9px -9px 15px rgba(255, 255, 255, 1);
 	}
 
 	.show-line {

--
Gitblit v1.9.1