Merge pull request 'lukeyan' (#59) from lukeyan into master

Reviewed-on: #59
pull/64/head^2
lukeyan 1 year ago
commit 46e057f273

@ -5,8 +5,8 @@ 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://${window.location.host}/zhapi`,
//baseURL: 'http://192.168.0.188:8888/zhapi',
baseURL: `http://${window.location.host}/zhapi`,
timeout: 50000,
headers: { 'content-type': 'application/json' },
})

@ -3,6 +3,7 @@
<el-table
:data="table_data"
class="company_table"
:stripe="stripe"
:header-cell-style="table_header"
:cell-style="{ background: 'revert', 'text-align': 'center' }"
>
@ -66,7 +67,16 @@
>
</el-table-column>
</el-table-column>
<el-table-column prop="zip" label="操作"> </el-table-column>
<el-table-column prop="operation" label="操作">
<template slot-scope="scope">
<el-button
size="small"
class="operation"
@click="jump(scope.row)"
>赋分
</el-button>
</template>
</el-table-column>
</el-table>
</div>
</template>
@ -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;
}
</style>

@ -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,14 +172,14 @@ 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}`,
@ -196,8 +204,12 @@ 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: 0.1px solid #34a6a6;
border-radius: 0px;
color: #fff;
width: 10vw;

@ -33,6 +33,7 @@
v-if="this.search_date === '2'"
ref="season"
@getValue="getValue"
@get_season_param="get_season_param"
></Season>
<el-date-picker
v-if="this.search_date === '3'"
@ -60,6 +61,19 @@
ref="companyTable"
:table_data="table_data"
></CompanyTable>
<div class="table_pagination">
<el-pagination
:background="true"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:page-sizes="[5, 10]"
:page-size="pageSize"
:current-page="pageNum"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
>
</el-pagination>
</div>
</div>
</div>
</el-card>
@ -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();
},
},
};
</script>
@ -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;
}
}
}
}
</style>

@ -1,7 +1,9 @@
<template>
<!-- 系统管理左侧导航菜单 -->
<el-menu
:default-active="activeIndex"
ref="menu"
@select="select"
:default-active="active"
class="el-menu-vertical-demo"
@open="handleOpen"
@close="handleClose"
@ -14,7 +16,7 @@
@click="clickMenu(item)"
v-for="item in menuList"
:key="item.name"
:index="item.name"
:index="item.value"
>
<i>
<img :src="item.src" alt="" />
@ -29,31 +31,35 @@ export default {
data() {
return {
isCollapse: false,
activeIndex: "/",
active: "1",
menu: [
//
{
path: "/safeIndex",
name: "safeIndex",
label: "平安指数",
value: "1",
src: require("@/assets/companyFile/menu01.png"),
},
{
path: "/companyScore",
name: "companyScore",
label: "企业赋分",
value: "2",
src: require("@/assets/companyFile/menu02.png"),
},
{
path: "/companyList",
name: "companyList",
label: "企业名单",
value: "3",
src: require("@/assets/companyFile/menu03.png"),
},
{
path: "/correlationEquipment",
name: "correlationEquipment",
label: "关联设备",
value: "4",
src: require("@/assets/companyFile/menu04.png"),
},
],
@ -72,6 +78,9 @@ export default {
},
created() {
this.setCurrentRoute();
if (sessionStorage.getItem("navkeep")) {
this.active = sessionStorage.getItem("navkeep");
}
},
methods: {
//
@ -81,7 +90,7 @@ export default {
});
},
setCurrentRoute() {
this.activeIndex = this.$route.path; //
this.active = this.$route.path; //
},
handleOpen(key, keyPath) {
console.log(key, keyPath);
@ -89,6 +98,9 @@ export default {
handleClose(key, keyPath) {
console.log(key, keyPath);
},
select() {
sessionStorage.setItem("navkeep", this.$refs.menu.activeIndex);
},
},
};
</script>
@ -98,7 +110,7 @@ export default {
width: 100%; /* 保持和大的aside同宽 */
min-height: 98%; /* 固定侧边导航栏高度 */
background: url("~@/assets/companyFile/导航背景.png") no-repeat;
padding:20px;
padding: 20px;
box-sizing: border-box;
background-size: 100% 100%;
}

Loading…
Cancel
Save