From bb472b43a0a58b3156a28b9cfb4ff4030932c6c5 Mon Sep 17 00:00:00 2001
From: “zhuo” <“zhuo@itcast.cn”>
Date: 星期一, 08 一月 2024 17:29:11 +0800
Subject: [PATCH] 员工数据对比

---
 src/components/view/data-comparison.vue |  154 +++++++++++++++++++++++++++++++++++++++++++++++++++
 src/view/index.vue                      |    6 ++
 src/assets/api/controller.js            |    1 
 3 files changed, 161 insertions(+), 0 deletions(-)

diff --git a/src/assets/api/controller.js b/src/assets/api/controller.js
index 6fa02e0..3b99793 100644
--- a/src/assets/api/controller.js
+++ b/src/assets/api/controller.js
@@ -37,6 +37,7 @@
 	downRegistrantCountFile: "/dataReporting/downRegistrantCountFile", //瀵煎嚭鍛樺伐鏁版嵁缁熻
 	downFansSubmitFile: "/dataReporting/downFansSubmitFile", //瀵煎嚭杩涚矇涓婃姤
 	inputFansSubmitCsv: "/dataReporting/inputFansSubmitCsv", //瀵煎叆杩涚矇涓婃姤
+	selectDataComparisonDtoPageList: "/dataReporting/selectDataComparisonDtoPageList", //鑾峰彇鏁版嵁瀵规瘮鍒楄〃
 	
 	selectFansSubmitList: "/dataReporting/selectFansSubmitList", //鑾峰彇杩涚矇涓婃姤鍒楄〃
 	delFansSubmit: "/dataReporting/delFansSubmit", //鍒犻櫎杩涚矇涓婃姤淇℃伅
diff --git a/src/components/view/data-comparison.vue b/src/components/view/data-comparison.vue
new file mode 100644
index 0000000..45b69a3
--- /dev/null
+++ b/src/components/view/data-comparison.vue
@@ -0,0 +1,154 @@
+<style scoped>
+	.title {
+		height: 60px;
+		line-height: 60px;
+	}
+
+	.search {
+		background-color: #fff;
+		height: 80px;
+		display: flex;
+		align-items: center;
+	}
+
+	.search_thing {
+		width: 350px;
+		display: flex;
+		align-items: center;
+	}
+
+	.search_label {
+		width: 120px;
+		font-size: 14px;
+		text-align: right;
+	}
+
+	.search_input {
+		width: calc(100% - 110px);
+	}
+
+	.table {
+		margin-top: 10px;
+		background-color: #fff;
+		width: calc(100% - 40px);
+		height: calc(100% - 60px - 80px - 10px - 40px);
+		padding: 20px;
+	}
+</style>
+
+<template>
+	<div class="role_manage">
+		<div>
+			<el-row class="title">
+				<el-col :span="12" style="padding-left: 20px;">鍛樺伐鏁版嵁瀵规瘮</el-col>
+			</el-row>
+		</div>
+		<div class="search">
+			<div class="search_thing">
+				<div class="search_label">璐︽埛鍚嶇О锛�</div>
+				<div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="componentData.entity.name"
+					></el-input></div>
+			</div>
+            <div class="search_thing">
+				<div class="search_label">瀵规瘮鐨勮处鎴峰悕绉帮細</div>
+				<div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="componentData.entity.comparisonName"
+					></el-input></div>
+			</div>
+            <div class="search_thing">
+				<div class="search_label">鐧昏鏃ユ湡锛�</div>
+				<div class="search_input">
+					<el-date-picker size="small" v-model="componentData.entity.createTime" type="date" placeholder="閫夋嫨鏃ユ湡" value-format="yyyy-MM-dd" clearable></el-date-picker>
+				</div>
+			</div>
+			<div class="search_thing" style="padding-left: 30px;">
+				<el-button size="small" @click="refresh()">閲� 缃�</el-button>
+				<el-button size="small" type="primary" @click="refreshTable()">鏌� 璇�</el-button>
+			</div>
+		</div>
+		<div class="table">
+			<ValueTable ref="ValueTable" :url="$api.dataReporting.selectDataComparisonDtoPageList" :componentData="componentData" :key="upIndex"/>
+		</div>
+	</div>
+</template>
+
+<script>
+	import ValueTable from '../tool/value-table.vue'
+	export default {
+		components: {
+			ValueTable
+		},
+		data() {
+			return {
+				componentData: {
+					entity: {
+						name: null,
+                        comparisonName:null,
+                        createTime: null,
+						orderBy: {
+							field: 'createTime',
+							order: 'desc'
+						}
+					},
+					isIndex: false,
+					showSelect: false,
+					select: true,
+					do: [],
+					tagField: {}
+				},
+				entityCopy: {},
+				upIndex: 0,
+				addDia: false,
+				product: [],
+				outPower: true
+			}
+		},
+        created() {
+			var today = new Date();
+			var yesterday = new Date(today);
+			yesterday.setDate(today.getDate() - 1);
+			var yyyy = yesterday.getFullYear();
+			var mm = yesterday.getMonth() + 1;
+			var dd = yesterday.getDate()
+			if (dd < 10) {
+				dd = "0" + dd;
+			}
+			if (mm < 10) {
+				mm = "0" + mm;
+			}
+			this.componentData.entity.createTime = `${yyyy}-${mm}-${dd} 00:00:00`
+		},
+		mounted() {
+			this.entityCopy = this.HaveJson(this.componentData.entity)
+			this.selectDataComparisonDtoPageList()
+		},
+		methods: {
+			refreshTable() {
+                if(this.componentData.entity.name == null || this.componentData.entity.name == '') {
+                    this.$message.error('璐︽埛鍚嶇О鏄繀濉」')
+                }else if(this.componentData.entity.comparisonName == null || this.componentData.entity.comparisonName == '') {
+                    this.$message.error('瀵规瘮鐨勮处鎴峰悕绉版槸蹇呭~椤�')
+                }else if(this.componentData.entity.createTime == null) {
+                    this.$message.error('鐧昏鏃堕棿鏄繀濉」')
+                }else if(this.componentData.entity.name === this.componentData.entity.comparisonName) {
+                    this.$message.error('瀵规瘮鐨勮处鎴蜂笉鑳介噸澶�')
+                }else {
+                    this.$refs['ValueTable'].selectList()
+                }
+			},
+			refresh() {
+				this.componentData.entity = this.HaveJson(this.entityCopy)
+				this.upIndex++
+			},
+			selectDataComparisonDtoPageList() {
+				this.$axios.get(this.$api.dataReporting.selectDataComparisonDtoPageList).then(res => {
+					res.data.forEach(a => {
+						a.isClick = false
+						a.look = false
+					})
+					this.menu = res.data
+					this.menuCopy = this.HaveJson(res.data)
+				})
+			}
+		}
+	}
+</script>
\ No newline at end of file
diff --git a/src/view/index.vue b/src/view/index.vue
index 1e2e81c..90e3a44 100644
--- a/src/view/index.vue
+++ b/src/view/index.vue
@@ -371,6 +371,12 @@
 							i: "font icon-24gl-clipboardList",
 							u: "registrant-count",
 							p: "selectRegistrantCountDtoPageList"
+						},{
+							k: 12,
+							v: "鍛樺伐鏁版嵁瀵规瘮",
+							i: "font icon-24gl-clipboardList",
+							u: "data-comparison",
+							p: "selectDataComparisonDtoPageList"
 						}]
 					},
 					{

--
Gitblit v1.9.3