From 11d38f8bf24183bd23a08f451dc7ae115912c2c2 Mon Sep 17 00:00:00 2001 From: lukeyan <1727408482@qq.com> Date: Thu, 8 Jun 2023 16:50:26 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BC=81=E4=B8=9A=E8=B5=8B=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/request.js | 4 +- .../companyScore/components/companyTable.vue | 57 ++++++-- .../companyScore/components/season.vue | 44 +++--- .../systemManagement/companyScore/index.vue | 132 +++++++++++++++++- .../systemManagement/components/leftNav.vue | 24 +++- 5 files changed, 222 insertions(+), 39 deletions(-) diff --git a/src/utils/request.js b/src/utils/request.js index b04d4c8..690ca1f 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -4,8 +4,8 @@ import vm from "../main"; import { getToken } from '@/utils/auth' axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8' const request = axios.create({ - //baseURL: 'http://172.18.113.50:8080/zhapi', - baseURL: 'http://192.168.0.188:8888/zhapi', + baseURL: 'http://172.18.113.50:8080/zhapi', + //baseURL: 'http://192.168.0.188:8888/zhapi', //baseURL: `http://${window.location.host}/zhapi`, timeout: 50000, headers: { 'content-type': 'application/json' }, diff --git a/src/views/systemManagement/companyScore/components/companyTable.vue b/src/views/systemManagement/companyScore/components/companyTable.vue index 77f4f22..acb36bc 100644 --- a/src/views/systemManagement/companyScore/components/companyTable.vue +++ b/src/views/systemManagement/companyScore/components/companyTable.vue @@ -3,6 +3,7 @@ @@ -66,7 +67,16 @@ > - + + + @@ -79,9 +89,14 @@ export default { }, }, data() { - return {}; + return { + stripe: true, + }; }, methods: { + jump(val) { + console.log(val); + }, // 表头样式 table_header({ row, rowIndex }) { console.log(row); @@ -89,7 +104,7 @@ export default { return { "text-align": "center", // 表头文字居中 color: "#fff", - "border": "0.1px solid #425969", + border: "0.1px solid #425969", }; }, }, @@ -99,13 +114,18 @@ export default { /deep/.company_table.el-table { width: 85.2vw; height: 65vh; - background: rgba(0,0,0,0); - border: 0.1px solid #425969; + background: rgba(0, 0, 0, 0); + border: 0.1px solid #3f5564; thead { color: #fff; font-weight: 500; - border: 0.1px solid #425969; - background: linear-gradient(to right, #284f49, #2f6363, #233b38) !important; + border: 0.1px solid #3f5564; + background: linear-gradient( + to right, + #284f49, + #2f6363 5%, + #233b38 80% + ) !important; & th { background-color: transparent; @@ -117,7 +137,28 @@ export default { } tr { color: #fff; - background: #1C2A2C; + background: rgba(0, 0, 0, 0); + } +} +/deep/.el-button.operation { + background-color: #182527; + border: 0px; + color: #2fabdc; } + + /deep/.el-button.operation:hover, + .el-button.operation:focus { + background-color: #182527; + border: 0px; + color: #2fabdc; + text-shadow: 0 0 9px rgba(21, 255, 198, 0.64); + } +/deep/.el-table--border::after, +.el-table--group::after { + width: 0px; +} +/deep/ .el-table td.el-table__cell, +.el-table th.el-table__cell.is-leaf { + border: 0.1px solid #3f5564; } \ No newline at end of file diff --git a/src/views/systemManagement/companyScore/components/season.vue b/src/views/systemManagement/companyScore/components/season.vue index a12cb5c..2eab09c 100644 --- a/src/views/systemManagement/companyScore/components/season.vue +++ b/src/views/systemManagement/companyScore/components/season.vue @@ -113,7 +113,8 @@ export default { year: new Date().getFullYear(), //默认当前年 month: new Date().getMonth() + 1, //默认当前月 showValue: "", //页面上input的内容 - season_num:'', + season_num: "", + season_param: "", }; }, created() { @@ -124,6 +125,7 @@ export default { this.defaultValue = this.year + "-" + this.month; this.changeDefaultVal(); } + console.log("showValue", this.showValue); }, watch: { defaultValue(value) { @@ -148,13 +150,19 @@ export default { let month = +arr[1]; if (month >= 1 && month <= 3) { this.showValue = `${this.year}年1季度`; + this.season_param = `${this.year}-03` } else if (month >= 4 && month <= 6) { this.showValue = `${this.year}年2季度`; + this.season_param = `${this.year}-06` } else if (month >= 7 && month <= 9) { this.showValue = `${this.year}年3季度`; + this.season_param = `${this.year}-09` } else if (month >= 10 && month <= 12) { this.showValue = `${this.year}年4季度`; + this.season_param = `${this.year}-12` } + console.log('this.season_param',this.season_param); + this.$emit('get_season_param',this.season_param) } }, prev() { @@ -164,15 +172,15 @@ export default { this.year = +this.year + 1; }, selectSeason(quarter) { - if(quarter === 1) { - this.season_num = '03' - } else if(quarter === 2) { - this.season_num = '06' - } else if(quarter === 3) { - this.season_num = '09' - } else if(quarter === 4) { - this.season_num = '12' - } + if (quarter === 1) { + this.season_num = "03"; + } else if (quarter === 2) { + this.season_num = "06"; + } else if (quarter === 3) { + this.season_num = "09"; + } else if (quarter === 4) { + this.season_num = "12"; + } let result = { date: `${this.year}-${this.season_num}`, year: this.year, @@ -196,14 +204,18 @@ export default { background: rgba(0, 0, 0, 0); z-index: 999; } +.el-input.el-input--prefix { + width: 10vw; +} /deep/.el-input__inner { - background: rgba(0, 0, 0, 0); - border-radius: 0px; - color: #fff; - width: 10vw; - height: 4vh; + background: rgba(0, 0, 0, 0); + border: 0.1px solid #34a6a6; + border-radius: 0px; + color: #fff; + width: 10vw; + height: 4vh; } .el-date-picker__header-label { - color: black !important; + color: black !important; } \ No newline at end of file diff --git a/src/views/systemManagement/companyScore/index.vue b/src/views/systemManagement/companyScore/index.vue index 94d5300..80a8f97 100644 --- a/src/views/systemManagement/companyScore/index.vue +++ b/src/views/systemManagement/companyScore/index.vue @@ -33,6 +33,7 @@ v-if="this.search_date === '2'" ref="season" @getValue="getValue" + @get_season_param="get_season_param" > +
+ + +
@@ -99,19 +113,39 @@ export default { }, ], table_data: [], + pageSize: 10, + pageNum: 1, + total: 0, }; }, - created() {}, + created() { + let get_date = new Date(); + let year = get_date.getFullYear(); + let month = get_date.getMonth() + 1; + month = month < 10 ? "0" + month : month; + this.statistics_date = `${year}-${month}`; + this.date_state = "month"; + this.search(); + }, + mounted() { + this.get_time(); + }, methods: { date_select(val) { console.log("val", val); + let get_date = new Date(); + let year = get_date.getFullYear(); + let month = get_date.getMonth() + 1; + month = month < 10 ? "0" + month : month; this.date_state = val; if (val === "month") { this.search_date = "1"; + this.month_date = `${year}-${month}`; } else if (val === "season") { this.search_date = "2"; } else if (val === "year") { this.search_date = "3"; + this.year_date = `${year}`; } }, @@ -125,29 +159,52 @@ export default { console.log("val123", val); this.statistics_date = val.date; // 查询statisticsDate赋值 }, + get_season_param(val) { + this.statistics_date = val; + }, year_change(val) { // 日历年度选择 console.log("year", val); this.statistics_date = val; // 查询statisticsDate赋值 }, + get_time() { + let get_date = new Date(); + let year = get_date.getFullYear(); + let month = get_date.getMonth() + 1; + month = month < 10 ? "0" + month : month; + this.month_date = `${year}-${month}`; + }, search() { const params = { scoreType: this.date_state, statisticsDate: this.statistics_date, companyParamName: this.search_company, levelIndex: "1", + pageNum: this.pageNum, + pageSize: this.pageSize, }; getSafeCompany(params) .then((res) => { - console.log("res", res); this.table_data = res.rows; - this.$message.success("企业查询成功"); + this.total = res.total; + // this.$message.success("企业查询成功"); }) .catch((err) => { console.log(err); this.$message.warning("企业查询失败"); }); }, + handleSizeChange(val) { + console.log(`每页 ${val} 条`); + this.pageNum = 1; + this.pageSize = val; + this.search(); + }, + handleCurrentChange(val) { + console.log(`当前页: ${val}`); + this.pageNum = val; + this.search(); + }, }, }; @@ -176,21 +233,23 @@ export default { .search_top { width: 85.2vw; height: 4.3vh; - border: 0.1px solid #4d8f89; + // border: 0.1px solid #4d8f89; display: flex; justify-content: space-between; .select_left { display: flex; justify-content: space-between; - width: 22vw; + width: 21vw; } .search_right { display: flex; .el-button { font-size: 18px; + height: 4vh; border-radius: 0px; color: #fff; background: rgba(0, 0, 0, 0); + border: 0.1px solid #495e70; } .el-button:hover { background: #4d8f89; @@ -205,16 +264,24 @@ export default { } /deep/.el-input--suffix .el-input__inner { color: #fff; - border: 0.1px solid #fff; + border: 0.1px solid #34a6a6; border-radius: 0px; background: rgba(0, 0, 0, 0); width: 10vw; height: 4vh; } + /deep/ .el-input.el-input--prefix { + width: 10vw; + } + /deep/.el-input__icon { + color: #fff; + line-height: 4vh; + height: 4vh; + } /deep/ .search_right_input.el-input { .el-input__inner { color: #fff; - border: 0.1px solid #fff; + border: 0.1px solid #495e70; border-radius: 0px; background: rgba(0, 0, 0, 0); width: 10vw; @@ -222,4 +289,55 @@ export default { } } } +.table_pagination { + width: 64vw; + height: 5vh; + /deep/.el-input--suffix .el-input__inner { + color: #fff; + border: 0.1px solid #34a6a6; + border-radius: 0px; + background: rgba(0, 0, 0, 0); + width: 5vw; + height: 2.6vh; + line-height: 2.6vh; + } + /deep/.el-input__icon { + color: #fff; + line-height: 2.6vh; + height: 2.6vh; + } + /deep/.el-pagination { + margin-left: 70%; + margin-top: 2vh; + .el-pagination__total { + color: #fff; + } + .el-input__inner { + border-radius: 0px; + background: #3c4b4a; + color: #fff; + } + .btn-prev { + border-radius: 0px; + background: #3c4b4a; + color: #fff; + } + ul { + li { + background: #3c4b4a; + color: #fff; + } + } + .btn-next { + border-radius: 0px; + background: #3c4b4a; + color: #fff; + } + .el-pager { + li { + background: #3c4b4a !important; + } + } + } +} \ No newline at end of file diff --git a/src/views/systemManagement/components/leftNav.vue b/src/views/systemManagement/components/leftNav.vue index c0e2047..47a5280 100644 --- a/src/views/systemManagement/components/leftNav.vue +++ b/src/views/systemManagement/components/leftNav.vue @@ -1,7 +1,9 @@