jn517618 2 years ago
commit c81b5ac135
  1. 53
      src/views/dataStatistics/carbon.vue
  2. 49
      src/views/dataStatistics/carbonIntensity.vue
  3. 55
      src/views/dataStatistics/carbonTrend.vue

@ -19,12 +19,26 @@
:model="searchForm" :model="searchForm"
label-width="120px" label-width="120px"
style="border: 0px solid red; margin-bottom: 8px" style="border: 0px solid red; margin-bottom: 8px"
> >
<el-row> <el-row>
<el-col :span="2.5">
<el-date-picker
:clearable="false"
class="search-picker"
v-model="searchForm.currentYear"
format="yyyy"
value-format="yyyy"
type="year"
placeholder="选择日期">
</el-date-picker>
</el-col>
<el-col style="margin-left: 18px" :span="3.5"> <el-col style="margin-left: 18px" :span="3.5">
<el-button class="search" @click="searchHandle(0)" <el-button class="search" @click="searchHandle(0)"
>查询</el-button >查询</el-button
> >
<el-button class="reset" @click="searchHandle(1)"
>重置</el-button
>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
@ -81,7 +95,7 @@ export default {
}, },
// //
searchForm: { searchForm: {
name: "", currentYear:null,
}, },
searchText: { searchText: {
flag: 3, flag: 3,
@ -220,9 +234,9 @@ export default {
}; };
}, },
mounted() { mounted() {
if (JSON.stringify(this.$store.state.client.supplierParams) !== "{}") { // if (JSON.stringify(this.$store.state.client.supplierParams) !== "{}") {
this.searchForm = this.$store.state.client.supplierParams; // this.searchForm = this.$store.state.client.supplierParams;
} // }
this.onLoad(); this.onLoad();
}, },
methods: { methods: {
@ -236,20 +250,20 @@ export default {
this.onLoad(); this.onLoad();
}, },
// //
searchHandle(item, index) { searchHandle(val) {
this.page.current = 1; if (val == 0) {
if (index === 1) { this.onLoad()
this.searchForm = {
name: "",
};
} else { } else {
this.searchForm = item; this.searchForm = {
currentYear:null
}
this.onLoad()
} }
this.onLoad(); // this.onLoad();
this.$store.dispatch("changeSetting", { // this.$store.dispatch("changeSetting", {
title: "supplierParams", // title: "supplierParams",
form: this.searchForm, // form: this.searchForm,
}); // });
}, },
// //
addHandle() { addHandle() {
@ -259,7 +273,7 @@ export default {
onLoad() { onLoad() {
this.loading = true; this.loading = true;
const { current, size } = this.page; const { current, size } = this.page;
getCarborList( Object.assign({ current, size })).then((res) => { getCarborList({current:this.page.current,size:this.page.size,...this.searchForm}).then((res) => {
const {records,total} = res.data.data const {records,total} = res.data.data
this.data = records this.data = records
this.page.total = total this.page.total = total
@ -407,6 +421,9 @@ export default {
height: 46px; height: 46px;
border-radius: 0; border-radius: 0;
margin-left: 10px; margin-left: 10px;
/deep/ .el-input__inner{
height: 100% !important;
}
} }
.search-select { .search-select {
width: 240px !important; width: 240px !important;

@ -21,10 +21,20 @@
style="border: 0px solid red; margin-bottom: 8px" style="border: 0px solid red; margin-bottom: 8px"
> >
<el-row> <el-row>
<el-col :span="2.5">
<el-date-picker
:clearable="false"
class="search-picker"
v-model="searchForm.currentMonth"
type="month"
placeholder="选择日期"
format="yyyy-MM"
value-format="yyyy-MM">
</el-date-picker>
</el-col>
<el-col style="margin-left: 18px" :span="3.5"> <el-col style="margin-left: 18px" :span="3.5">
<el-button class="search" @click="searchHandle(0)" <el-button class="search" @click="searchHandle(0)">查询</el-button>
>查询</el-button <el-button class="reset" @click="searchHandle(1)">重置</el-button>
>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
@ -81,7 +91,7 @@ export default {
}, },
// //
searchForm: { searchForm: {
name: "", currentMonth: null,
}, },
searchText: { searchText: {
flag: 3, flag: 3,
@ -154,9 +164,9 @@ export default {
}; };
}, },
mounted() { mounted() {
if (JSON.stringify(this.$store.state.client.supplierParams) !== "{}") { // if (JSON.stringify(this.$store.state.client.supplierParams) !== "{}") {
this.searchForm = this.$store.state.client.supplierParams; // this.searchForm = this.$store.state.client.supplierParams;
} // }
this.onLoad(); this.onLoad();
}, },
methods: { methods: {
@ -170,20 +180,15 @@ export default {
this.onLoad(); this.onLoad();
}, },
// //
searchHandle(item, index) { searchHandle(val) {
this.page.current = 1; if(val == 0){
if (index === 1) { this.onLoad()
}else{
this.searchForm = { this.searchForm = {
name: "", currentMonth:null
}; }
} else { this.onLoad()
this.searchForm = item;
} }
this.onLoad();
this.$store.dispatch("changeSetting", {
title: "supplierParams",
form: this.searchForm,
});
}, },
// //
addHandle() { addHandle() {
@ -192,8 +197,7 @@ export default {
onLoad() { onLoad() {
this.loading = true; this.loading = true;
const { current, size } = this.page; getIntensity({current:this.page.current,size:this.page.size,...this.searchForm}).then((res) => {
getIntensity( Object.assign({ current, size })).then((res) => {
const {records,total} = res.data.data const {records,total} = res.data.data
this.data = records this.data = records
this.page.total = total this.page.total = total
@ -338,6 +342,9 @@ export default {
height: 46px; height: 46px;
border-radius: 0; border-radius: 0;
margin-left: 10px; margin-left: 10px;
/deep/ .el-input__inner{
height: 100% !important;
}
} }
.search-select { .search-select {
width: 240px !important; width: 240px !important;

@ -21,21 +21,22 @@
style="border: 0px solid red; margin-bottom: 8px" style="border: 0px solid red; margin-bottom: 8px"
> >
<el-row> <el-row>
<!-- <el-col :span="2.5"> <el-col :span="2.5">
<el-select <el-date-picker
v-model="searchForm.status" :clearable="false"
class="search-select" class="search-picker"
placeholder="请选择状态" v-model="searchForm.currentMonth"
> type="month"
<el-option label="启用" :value="1"></el-option> placeholder="选择日期"
<el-option label="停用" :value="0"></el-option> format="yyyy-MM"
</el-select> value-format="yyyy-MM">
</el-col> --> </el-date-picker>
</el-col>
<el-col style="margin-left: 18px" :span="3.5"> <el-col style="margin-left: 18px" :span="3.5">
<el-button class="search" @click="searchHandle(0)" <el-button class="search" @click="searchHandle(0)"
>查询</el-button >查询</el-button
> >
<!-- <el-button class="reset" @click="searchHandle(1)">重置</el-button> --> <el-button class="reset" @click="searchHandle(1)">重置</el-button>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
@ -92,7 +93,7 @@ export default {
}, },
// //
searchForm: { searchForm: {
name: "", currentMonth: null,
}, },
searchText: { searchText: {
flag: 3, flag: 3,
@ -165,9 +166,9 @@ export default {
}; };
}, },
mounted() { mounted() {
if (JSON.stringify(this.$store.state.client.supplierParams) !== "{}") { // if (JSON.stringify(this.$store.state.client.supplierParams) !== "{}") {
this.searchForm = this.$store.state.client.supplierParams; // this.searchForm = this.$store.state.client.supplierParams;
} // }
this.onLoad(); this.onLoad();
}, },
methods: { methods: {
@ -181,20 +182,15 @@ export default {
this.onLoad(); this.onLoad();
}, },
// //
searchHandle(item, index) { searchHandle(val) {
this.page.current = 1; if(val == 0){
if (index === 1) { this.onLoad()
}else{
this.searchForm = { this.searchForm = {
name: "", currentMonth:null
}; }
} else { this.onLoad()
this.searchForm = item;
} }
this.onLoad();
this.$store.dispatch("changeSetting", {
title: "supplierParams",
form: this.searchForm,
});
}, },
// //
addHandle() { addHandle() {
@ -204,7 +200,7 @@ export default {
onLoad() { onLoad() {
this.loading = true; this.loading = true;
const { current, size } = this.page; const { current, size } = this.page;
getTrendList( Object.assign({ current, size })).then((res) => { getTrendList({current:this.page.current,size:this.page.size,...this.searchForm}).then((res) => {
const {records,total} = res.data.data const {records,total} = res.data.data
this.data = records this.data = records
this.page.total = total this.page.total = total
@ -354,6 +350,9 @@ export default {
height: 46px; height: 46px;
border-radius: 0; border-radius: 0;
margin-left: 10px; margin-left: 10px;
/deep/ .el-input__inner{
height: 100% !important;
}
} }
.search-select { .search-select {
width: 240px !important; width: 240px !important;

Loading…
Cancel
Save