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' axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
const request = axios.create({ const request = axios.create({
//baseURL: 'http://172.18.113.50:8080/zhapi', //baseURL: 'http://172.18.113.50:8080/zhapi',
baseURL: 'http://192.168.0.188:8888/zhapi', //baseURL: 'http://192.168.0.188:8888/zhapi',
//baseURL: `http://${window.location.host}/zhapi`, baseURL: `http://${window.location.host}/zhapi`,
timeout: 50000, timeout: 50000,
headers: { 'content-type': 'application/json' }, headers: { 'content-type': 'application/json' },
}) })

@ -3,6 +3,7 @@
<el-table <el-table
:data="table_data" :data="table_data"
class="company_table" class="company_table"
:stripe="stripe"
:header-cell-style="table_header" :header-cell-style="table_header"
:cell-style="{ background: 'revert', 'text-align': 'center' }" :cell-style="{ background: 'revert', 'text-align': 'center' }"
> >
@ -66,7 +67,16 @@
> >
</el-table-column> </el-table-column>
</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> </el-table>
</div> </div>
</template> </template>
@ -79,9 +89,14 @@ export default {
}, },
}, },
data() { data() {
return {}; return {
stripe: true,
};
}, },
methods: { methods: {
jump(val) {
console.log(val);
},
// //
table_header({ row, rowIndex }) { table_header({ row, rowIndex }) {
console.log(row); console.log(row);
@ -89,7 +104,7 @@ export default {
return { return {
"text-align": "center", // "text-align": "center", //
color: "#fff", color: "#fff",
"border": "0.1px solid #425969", border: "0.1px solid #425969",
}; };
}, },
}, },
@ -100,12 +115,17 @@ export default {
width: 85.2vw; width: 85.2vw;
height: 65vh; height: 65vh;
background: rgba(0, 0, 0, 0); background: rgba(0, 0, 0, 0);
border: 0.1px solid #425969; border: 0.1px solid #3f5564;
thead { thead {
color: #fff; color: #fff;
font-weight: 500; font-weight: 500;
border: 0.1px solid #425969; border: 0.1px solid #3f5564;
background: linear-gradient(to right, #284f49, #2f6363, #233b38) !important; background: linear-gradient(
to right,
#284f49,
#2f6363 5%,
#233b38 80%
) !important;
& th { & th {
background-color: transparent; background-color: transparent;
@ -117,7 +137,28 @@ export default {
} }
tr { tr {
color: #fff; 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> </style>

@ -113,7 +113,8 @@ export default {
year: new Date().getFullYear(), // year: new Date().getFullYear(), //
month: new Date().getMonth() + 1, // month: new Date().getMonth() + 1, //
showValue: "", //input showValue: "", //input
season_num:'', season_num: "",
season_param: "",
}; };
}, },
created() { created() {
@ -124,6 +125,7 @@ export default {
this.defaultValue = this.year + "-" + this.month; this.defaultValue = this.year + "-" + this.month;
this.changeDefaultVal(); this.changeDefaultVal();
} }
console.log("showValue", this.showValue);
}, },
watch: { watch: {
defaultValue(value) { defaultValue(value) {
@ -148,13 +150,19 @@ export default {
let month = +arr[1]; let month = +arr[1];
if (month >= 1 && month <= 3) { if (month >= 1 && month <= 3) {
this.showValue = `${this.year}年1季度`; this.showValue = `${this.year}年1季度`;
this.season_param = `${this.year}-03`
} else if (month >= 4 && month <= 6) { } else if (month >= 4 && month <= 6) {
this.showValue = `${this.year}年2季度`; this.showValue = `${this.year}年2季度`;
this.season_param = `${this.year}-06`
} else if (month >= 7 && month <= 9) { } else if (month >= 7 && month <= 9) {
this.showValue = `${this.year}年3季度`; this.showValue = `${this.year}年3季度`;
this.season_param = `${this.year}-09`
} else if (month >= 10 && month <= 12) { } else if (month >= 10 && month <= 12) {
this.showValue = `${this.year}年4季度`; 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() { prev() {
@ -165,13 +173,13 @@ export default {
}, },
selectSeason(quarter) { selectSeason(quarter) {
if (quarter === 1) { if (quarter === 1) {
this.season_num = '03' this.season_num = "03";
} else if (quarter === 2) { } else if (quarter === 2) {
this.season_num = '06' this.season_num = "06";
} else if (quarter === 3) { } else if (quarter === 3) {
this.season_num = '09' this.season_num = "09";
} else if (quarter === 4) { } else if (quarter === 4) {
this.season_num = '12' this.season_num = "12";
} }
let result = { let result = {
date: `${this.year}-${this.season_num}`, date: `${this.year}-${this.season_num}`,
@ -196,8 +204,12 @@ export default {
background: rgba(0, 0, 0, 0); background: rgba(0, 0, 0, 0);
z-index: 999; z-index: 999;
} }
.el-input.el-input--prefix {
width: 10vw;
}
/deep/.el-input__inner { /deep/.el-input__inner {
background: rgba(0, 0, 0, 0); background: rgba(0, 0, 0, 0);
border: 0.1px solid #34a6a6;
border-radius: 0px; border-radius: 0px;
color: #fff; color: #fff;
width: 10vw; width: 10vw;

@ -33,6 +33,7 @@
v-if="this.search_date === '2'" v-if="this.search_date === '2'"
ref="season" ref="season"
@getValue="getValue" @getValue="getValue"
@get_season_param="get_season_param"
></Season> ></Season>
<el-date-picker <el-date-picker
v-if="this.search_date === '3'" v-if="this.search_date === '3'"
@ -60,6 +61,19 @@
ref="companyTable" ref="companyTable"
:table_data="table_data" :table_data="table_data"
></CompanyTable> ></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>
</div> </div>
</el-card> </el-card>
@ -99,19 +113,39 @@ export default {
}, },
], ],
table_data: [], 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: { methods: {
date_select(val) { date_select(val) {
console.log("val", 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; this.date_state = val;
if (val === "month") { if (val === "month") {
this.search_date = "1"; this.search_date = "1";
this.month_date = `${year}-${month}`;
} else if (val === "season") { } else if (val === "season") {
this.search_date = "2"; this.search_date = "2";
} else if (val === "year") { } else if (val === "year") {
this.search_date = "3"; this.search_date = "3";
this.year_date = `${year}`;
} }
}, },
@ -125,29 +159,52 @@ export default {
console.log("val123", val); console.log("val123", val);
this.statistics_date = val.date; // statisticsDate this.statistics_date = val.date; // statisticsDate
}, },
get_season_param(val) {
this.statistics_date = val;
},
year_change(val) { year_change(val) {
// //
console.log("year", val); console.log("year", val);
this.statistics_date = val; // statisticsDate 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() { search() {
const params = { const params = {
scoreType: this.date_state, scoreType: this.date_state,
statisticsDate: this.statistics_date, statisticsDate: this.statistics_date,
companyParamName: this.search_company, companyParamName: this.search_company,
levelIndex: "1", levelIndex: "1",
pageNum: this.pageNum,
pageSize: this.pageSize,
}; };
getSafeCompany(params) getSafeCompany(params)
.then((res) => { .then((res) => {
console.log("res", res);
this.table_data = res.rows; this.table_data = res.rows;
this.$message.success("企业查询成功"); this.total = res.total;
// this.$message.success("");
}) })
.catch((err) => { .catch((err) => {
console.log(err); console.log(err);
this.$message.warning("企业查询失败"); 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> </script>
@ -176,21 +233,23 @@ export default {
.search_top { .search_top {
width: 85.2vw; width: 85.2vw;
height: 4.3vh; height: 4.3vh;
border: 0.1px solid #4d8f89; // border: 0.1px solid #4d8f89;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
.select_left { .select_left {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
width: 22vw; width: 21vw;
} }
.search_right { .search_right {
display: flex; display: flex;
.el-button { .el-button {
font-size: 18px; font-size: 18px;
height: 4vh;
border-radius: 0px; border-radius: 0px;
color: #fff; color: #fff;
background: rgba(0, 0, 0, 0); background: rgba(0, 0, 0, 0);
border: 0.1px solid #495e70;
} }
.el-button:hover { .el-button:hover {
background: #4d8f89; background: #4d8f89;
@ -205,16 +264,24 @@ export default {
} }
/deep/.el-input--suffix .el-input__inner { /deep/.el-input--suffix .el-input__inner {
color: #fff; color: #fff;
border: 0.1px solid #fff; border: 0.1px solid #34a6a6;
border-radius: 0px; border-radius: 0px;
background: rgba(0, 0, 0, 0); background: rgba(0, 0, 0, 0);
width: 10vw; width: 10vw;
height: 4vh; 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 { /deep/ .search_right_input.el-input {
.el-input__inner { .el-input__inner {
color: #fff; color: #fff;
border: 0.1px solid #fff; border: 0.1px solid #495e70;
border-radius: 0px; border-radius: 0px;
background: rgba(0, 0, 0, 0); background: rgba(0, 0, 0, 0);
width: 10vw; 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> </style>

@ -1,7 +1,9 @@
<template> <template>
<!-- 系统管理左侧导航菜单 --> <!-- 系统管理左侧导航菜单 -->
<el-menu <el-menu
:default-active="activeIndex" ref="menu"
@select="select"
:default-active="active"
class="el-menu-vertical-demo" class="el-menu-vertical-demo"
@open="handleOpen" @open="handleOpen"
@close="handleClose" @close="handleClose"
@ -14,7 +16,7 @@
@click="clickMenu(item)" @click="clickMenu(item)"
v-for="item in menuList" v-for="item in menuList"
:key="item.name" :key="item.name"
:index="item.name" :index="item.value"
> >
<i> <i>
<img :src="item.src" alt="" /> <img :src="item.src" alt="" />
@ -29,31 +31,35 @@ export default {
data() { data() {
return { return {
isCollapse: false, isCollapse: false,
activeIndex: "/", active: "1",
menu: [ menu: [
// //
{ {
path: "/safeIndex", path: "/safeIndex",
name: "safeIndex", name: "safeIndex",
label: "平安指数", label: "平安指数",
value: "1",
src: require("@/assets/companyFile/menu01.png"), src: require("@/assets/companyFile/menu01.png"),
}, },
{ {
path: "/companyScore", path: "/companyScore",
name: "companyScore", name: "companyScore",
label: "企业赋分", label: "企业赋分",
value: "2",
src: require("@/assets/companyFile/menu02.png"), src: require("@/assets/companyFile/menu02.png"),
}, },
{ {
path: "/companyList", path: "/companyList",
name: "companyList", name: "companyList",
label: "企业名单", label: "企业名单",
value: "3",
src: require("@/assets/companyFile/menu03.png"), src: require("@/assets/companyFile/menu03.png"),
}, },
{ {
path: "/correlationEquipment", path: "/correlationEquipment",
name: "correlationEquipment", name: "correlationEquipment",
label: "关联设备", label: "关联设备",
value: "4",
src: require("@/assets/companyFile/menu04.png"), src: require("@/assets/companyFile/menu04.png"),
}, },
], ],
@ -72,6 +78,9 @@ export default {
}, },
created() { created() {
this.setCurrentRoute(); this.setCurrentRoute();
if (sessionStorage.getItem("navkeep")) {
this.active = sessionStorage.getItem("navkeep");
}
}, },
methods: { methods: {
// //
@ -81,7 +90,7 @@ export default {
}); });
}, },
setCurrentRoute() { setCurrentRoute() {
this.activeIndex = this.$route.path; // this.active = this.$route.path; //
}, },
handleOpen(key, keyPath) { handleOpen(key, keyPath) {
console.log(key, keyPath); console.log(key, keyPath);
@ -89,6 +98,9 @@ export default {
handleClose(key, keyPath) { handleClose(key, keyPath) {
console.log(key, keyPath); console.log(key, keyPath);
}, },
select() {
sessionStorage.setItem("navkeep", this.$refs.menu.activeIndex);
},
}, },
}; };
</script> </script>

Loading…
Cancel
Save