Przeglądaj źródła

1

Signed-off-by: lcw <1324309909@qq.com>
lcw 4 lat temu
rodzic
commit
d079af1616

+ 18 - 0
src/components/pages/class.vue

@@ -108,6 +108,24 @@
 			this.page = 1;
 			this.getClass();
 		},
+		mounted() {
+			this.$nextTick(function () {
+				this.tableHeight =
+					window.innerHeight - this.$refs.table.$el.offsetTop - 200;
+				if (this.tableHeight <= 530) {
+					this.tableHeight = 530;
+				}
+				// 监听窗口大小变化
+				let self = this;
+				window.onresize = function () {
+					self.tableHeight =
+						window.innerHeight - self.$refs.table.$el.offsetTop - 200;
+					if (self.tableHeight <= 530) {
+						self.tableHeight = 530;
+					}
+				};
+			});
+		},
 		methods: {
 			tableRowClassName({ row, rowIndex }) {
 				if ((rowIndex + 1) % 2 === 0) {

+ 28 - 3
src/components/pages/data.vue

@@ -124,7 +124,32 @@
 				},
 			};
 		},
+		mounted() {
+			this.$nextTick(function () {
+				this.tableHeight =
+					window.innerHeight - this.$refs.table.$el.offsetTop - 200;
+				if (this.tableHeight <= 530) {
+					this.tableHeight = 530;
+				}
+				// 监听窗口大小变化
+				let self = this;
+				window.onresize = function () {
+					self.tableHeight =
+						window.innerHeight - self.$refs.table.$el.offsetTop - 200;
+					if (self.tableHeight <= 530) {
+						self.tableHeight = 530;
+					}
+				};
+			});
+		},
 		methods: {
+			tableRowClassName({ row, rowIndex }) {
+				if ((rowIndex + 1) % 2 === 0) {
+					return "even_row";
+				} else {
+					return "";
+				}
+			},
 			getSchool() {
 				this.isLoading = true;
 				let params = {
@@ -147,10 +172,10 @@
 					{
 						uid: this.$store.state.userInfo.userid,
 						sname: this.ruleForm.name,
-            ph:this.ruleForm.phone,
+						ph: this.ruleForm.phone,
 						sex: this.ruleForm.sex == "男" ? "0" : "1",
 						email: this.ruleForm.mail,
-            oid:this.ruleForm.sBySchool,
+						oid: this.ruleForm.sBySchool,
 						js: this.ruleForm.desc,
 					},
 				];
@@ -161,7 +186,7 @@
 							message: "修改成功",
 							type: "success",
 						});
-            this.getDetail();
+						this.getDetail();
 					})
 					.catch((err) => {
 						this.$message.error("修改失败");

+ 29 - 3
src/components/pages/notice.vue

@@ -29,8 +29,9 @@
 						label="创建者"
 						min-width="15"
 						align="center"
-					>
-						{{ this.tableData[0].creater ? this.tableData[0].creater : "未知" }}
+						><template slot-scope="scope">
+							{{ scope.row.creater ? scope.row.creater : "未知" }}
+						</template>
 					</el-table-column>
 					<el-table-column
 						prop="creatTime"
@@ -80,7 +81,7 @@
 				<div class="pb_head">
 					<span style="font-size: 20px">{{ res.title }}</span>
 					<span style="font-size: 15px; line-height: 35px">{{
-						this.tableData[0].creater
+						res.creater ? res.creater : "未知"
 					}}</span>
 				</div>
 				<div class="notice_content" v-html="res.newscontent"></div>
@@ -113,7 +114,32 @@
 				res: [],
 			};
 		},
+		mounted() {
+			this.$nextTick(function () {
+				this.tableHeight =
+					window.innerHeight - this.$refs.table.$el.offsetTop - 200;
+				if (this.tableHeight <= 530) {
+					this.tableHeight = 530;
+				}
+				// 监听窗口大小变化
+				let self = this;
+				window.onresize = function () {
+					self.tableHeight =
+						window.innerHeight - self.$refs.table.$el.offsetTop - 200;
+					if (self.tableHeight <= 530) {
+						self.tableHeight = 530;
+					}
+				};
+			});
+		},
 		methods: {
+			tableRowClassName({ row, rowIndex }) {
+				if ((rowIndex + 1) % 2 === 0) {
+					return "even_row";
+				} else {
+					return "";
+				}
+			},
 			snippet(value) {
 				return value.replace(/<[^>]*>/g, "");
 			},

+ 26 - 4
src/components/pages/works.vue

@@ -79,10 +79,7 @@
 					></el-table-column>
 					<el-table-column label="操作" min-width="30">
 						<template>
-							<el-button
-								type="primary"
-								size="small"
-								@click="lookStudent"
+							<el-button type="primary" size="small" @click="lookStudent"
 								>查看学生</el-button
 							>
 						</template>
@@ -381,7 +378,32 @@
 				total: 0,
 			};
 		},
+		mounted() {
+			this.$nextTick(function () {
+				this.tableHeight =
+					window.innerHeight - this.$refs.table.$el.offsetTop - 200;
+				if (this.tableHeight <= 530) {
+					this.tableHeight = 530;
+				}
+				// 监听窗口大小变化
+				let self = this;
+				window.onresize = function () {
+					self.tableHeight =
+						window.innerHeight - self.$refs.table.$el.offsetTop - 200;
+					if (self.tableHeight <= 530) {
+						self.tableHeight = 530;
+					}
+				};
+			});
+		},
 		methods: {
+			tableRowClassName({ row, rowIndex }) {
+				if ((rowIndex + 1) % 2 === 0) {
+					return "even_row";
+				} else {
+					return "";
+				}
+			},
 			handleClose(done) {
 				done();
 			},

+ 2 - 2
src/config/config.js

@@ -9,8 +9,8 @@ const store = new Vuex.Store({
         luyou:1,
         userInfo: {},
         nCount:0,
-        api: 'https://pbl.cocorobo.cn/api/pbl/',
-        // api: 'http://localhost:7003/pbl/',
+        // api: 'https://pbl.cocorobo.cn/api/pbl/',
+        api: 'http://localhost:7003/pbl/',
     },
 
     mutations: {