租户功能
This commit is contained in:
parent
cb262d88e5
commit
eef8a79685
|
|
@ -31,6 +31,14 @@ export const getImportUrl = Api.importExcel;
|
||||||
*/
|
*/
|
||||||
export const getStationList = (params) => defHttp.get({ url: Api.getStationList, params });
|
export const getStationList = (params) => defHttp.get({ url: Api.getStationList, params });
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表接口
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const getStationLists = (params) => defHttp.get({ url: Api.getStationList, params }, { isTransformResponse: false });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表接口
|
* 列表接口
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,25 @@
|
||||||
<template>
|
<template>
|
||||||
<a-row :gutter="16" style="margin-bottom: 10px;">
|
<a-row :gutter="16" style="margin-bottom: 10px">
|
||||||
<a-col class="gutter-row" :span="4">
|
<a-col class="gutter-row" :span="6">
|
||||||
<ApiSelect
|
<!-- <ApiSelect-->
|
||||||
:api="getStationList"
|
<!-- :api="getStationList"-->
|
||||||
v-model:value="searchStationCode"
|
<!-- v-model:value="searchStationCode"-->
|
||||||
showSearch
|
<!-- showSearch-->
|
||||||
optionFilterProp="label"
|
<!-- optionFilterProp="label"-->
|
||||||
resultField="list"
|
<!-- resultField="list"-->
|
||||||
labelField="stationName"
|
<!-- labelField="stationName"-->
|
||||||
valueField="stationCode"
|
<!-- valueField="stationCode"-->
|
||||||
placeholder="请选择"
|
<!-- placeholder="请选择"-->
|
||||||
style="width: 100%;"
|
<!-- style="width: 100%"-->
|
||||||
@change="loadChart"
|
<!-- @change="loadChart"-->
|
||||||
allowClear
|
<!-- allowClear-->
|
||||||
/>
|
<!-- />-->
|
||||||
|
|
||||||
|
<a-select :disabled="disabled" placeholder="请选择监测站" v-model:value="searchStationCode" @change="loadChart" style="width: 100%">
|
||||||
|
<a-select-option v-for="item in stations" :key="item.stationCode" :value="item.stationCode">
|
||||||
|
{{ item.stationName }}
|
||||||
|
</a-select-option>
|
||||||
|
</a-select>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col class="gutter-row" :span="4">
|
<a-col class="gutter-row" :span="4">
|
||||||
<a-date-picker placeholder="" v-model:value="searchYear" format="YYYY" picker="year" style="width: 100%" @change="loadYearChart" />
|
<a-date-picker placeholder="" v-model:value="searchYear" format="YYYY" picker="year" style="width: 100%" @change="loadYearChart" />
|
||||||
|
|
@ -25,27 +31,35 @@
|
||||||
import { onMounted, ref, Ref } from 'vue';
|
import { onMounted, ref, Ref } from 'vue';
|
||||||
import { useECharts } from '/@/hooks/web/useECharts';
|
import { useECharts } from '/@/hooks/web/useECharts';
|
||||||
import { basicProps } from './props';
|
import { basicProps } from './props';
|
||||||
import { getWaterPollutionSummary} from '../api';
|
import { getWaterPollutionSummary } from '../api';
|
||||||
import { ApiSelect} from '/@/components/Form/index';
|
import { ApiSelect } from '/@/components/Form/index';
|
||||||
import { getStationList } from '../../../appmana/station/SurvStationInfo.api'
|
import { getStationLists } from '../../../appmana/station/SurvStationInfo.api';
|
||||||
import dayjs, { Dayjs } from 'dayjs';
|
import dayjs, { Dayjs } from 'dayjs';
|
||||||
const dateFormat = 'YYYY';
|
const dateFormat = 'YYYY';
|
||||||
let arr1: any[] = [];
|
let arr1: any[] = [];
|
||||||
let searchStationCode = ref('S_1');
|
let searchStationCode = ref('');
|
||||||
let searchYear = ref<Dayjs>(dayjs());
|
let searchYear = ref<Dayjs>(dayjs());
|
||||||
let summaryTpDataList = ref(arr1);
|
let summaryTpDataList = ref(arr1);
|
||||||
let summaryTnDataList = ref(arr1);
|
let summaryTnDataList = ref(arr1);
|
||||||
let summaryNoDataList = ref(arr1);
|
let summaryNoDataList = ref(arr1);
|
||||||
let summaryNhDataList = ref(arr1);
|
let summaryNhDataList = ref(arr1);
|
||||||
let summaryCodDataList = ref(arr1);
|
let summaryCodDataList = ref(arr1);
|
||||||
|
let stations = ref(arr1);
|
||||||
let dateList = ref(arr1);
|
let dateList = ref(arr1);
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
onMounted(() => {
|
getStationLists({}).then((res) => {
|
||||||
|
searchStationCode.value = '';
|
||||||
|
if (res.code == 0) {
|
||||||
});
|
stations.value = res.result;
|
||||||
|
if (stations.value.length > 0) {
|
||||||
|
searchStationCode.value = stations.value[0].stationCode;
|
||||||
|
loadChart(searchStationCode.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log('xxxxx' + res.result);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
defineProps({
|
defineProps({
|
||||||
...basicProps,
|
...basicProps,
|
||||||
|
|
@ -53,32 +67,29 @@ onMounted(() => {
|
||||||
const chartRef = ref<HTMLDivElement | null>(null);
|
const chartRef = ref<HTMLDivElement | null>(null);
|
||||||
const { setOptions } = useECharts(chartRef as Ref<HTMLDivElement>);
|
const { setOptions } = useECharts(chartRef as Ref<HTMLDivElement>);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const loadChart = (value: string) => {
|
const loadChart = (value: string) => {
|
||||||
if(value==null){
|
if (value == null) {
|
||||||
value="";
|
value = '';
|
||||||
searchStationCode.value="";
|
searchStationCode.value = '';
|
||||||
}
|
}
|
||||||
getSummary(value,searchYear.value.format(dateFormat));
|
getSummary(value, searchYear.value.format(dateFormat));
|
||||||
};
|
};
|
||||||
|
|
||||||
const loadYearChart = (value) => {
|
const loadYearChart = (value) => {
|
||||||
if(value==null){
|
if (value == null) {
|
||||||
value=ref<Dayjs>();
|
value = ref<Dayjs>();
|
||||||
searchYear=ref<Dayjs>();
|
searchYear = ref<Dayjs>();
|
||||||
}else{
|
} else {
|
||||||
value=value.format(dateFormat)
|
value = value.format(dateFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
getSummary(searchStationCode.value,value);
|
getSummary(searchStationCode.value, value);
|
||||||
};
|
};
|
||||||
|
|
||||||
function getSummary(stationCode,chooseYear) {
|
function getSummary(stationCode, chooseYear) {
|
||||||
getWaterPollutionSummary(stationCode,chooseYear).then((res) => {
|
getWaterPollutionSummary(stationCode, chooseYear).then((res) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
dateList.value = [1,2,3,4,5,6,7,8,9,10,11,12];
|
dateList.value = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
||||||
summaryTpDataList.value = res.result[0].TPSummry;
|
summaryTpDataList.value = res.result[0].TPSummry;
|
||||||
summaryTnDataList.value = res.result[0].TNSummry;
|
summaryTnDataList.value = res.result[0].TNSummry;
|
||||||
summaryNoDataList.value = res.result[0].NOSummry;
|
summaryNoDataList.value = res.result[0].NOSummry;
|
||||||
|
|
@ -87,7 +98,8 @@ onMounted(() => {
|
||||||
setOptions({
|
setOptions({
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis',
|
trigger: 'axis',
|
||||||
formatter:'<strong> {b0}时</strong> <br /> <span style="display: inline-block; margin-right: 4px; border-radius: 10px; width: 10px; height: 10px;background-color: #5470c6;"></span> 总磷:<strong>{c0}</strong>mg/L <br /> <span style="display: inline-block; margin-right: 4px; border-radius: 10px; width: 10px; height: 10px;background-color: #91cc75;"></span> 总氮:<strong>{c1}</strong>mg/L<br /> <span style="display: inline-block; margin-right: 4px; border-radius: 10px; width: 10px; height: 10px;background-color: #019634;"></span> 硝态氮:<strong>{c2}</strong>mg/L <br /> <span style="display: inline-block; margin-right: 4px; border-radius: 10px; width: 10px; height: 10px;background-color: #075ca6;"></span> 氨氮:<strong>{c3}</strong>mg/L<br /> <span style="display: inline-block; margin-right: 4px; border-radius: 10px; width: 10px; height: 10px;background-color: #a65107;"></span> 化学需氧量:<strong>{c4}</strong>mg/L',
|
formatter:
|
||||||
|
'<strong> {b0}时</strong> <br /> <span style="display: inline-block; margin-right: 4px; border-radius: 10px; width: 10px; height: 10px;background-color: #5470c6;"></span> 总磷:<strong>{c0}</strong>mg/L <br /> <span style="display: inline-block; margin-right: 4px; border-radius: 10px; width: 10px; height: 10px;background-color: #91cc75;"></span> 总氮:<strong>{c1}</strong>mg/L<br /> <span style="display: inline-block; margin-right: 4px; border-radius: 10px; width: 10px; height: 10px;background-color: #019634;"></span> 硝态氮:<strong>{c2}</strong>mg/L <br />',
|
||||||
axisPointer: {
|
axisPointer: {
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
width: 1,
|
width: 1,
|
||||||
|
|
@ -122,8 +134,8 @@ onMounted(() => {
|
||||||
axisTick: {
|
axisTick: {
|
||||||
show: false,
|
show: false,
|
||||||
},
|
},
|
||||||
axisLabel:{
|
axisLabel: {
|
||||||
formatter: '{value} mg/L'
|
formatter: '{value} mg/L',
|
||||||
},
|
},
|
||||||
splitArea: {
|
splitArea: {
|
||||||
show: true,
|
show: true,
|
||||||
|
|
@ -198,9 +210,6 @@ onMounted(() => {
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue