租户功能

This commit is contained in:
zy 2026-03-04 15:51:31 +08:00
parent cb262d88e5
commit eef8a79685
2 changed files with 187 additions and 170 deletions

View File

@ -31,6 +31,14 @@ export const getImportUrl = Api.importExcel;
*/
export const getStationList = (params) => defHttp.get({ url: Api.getStationList, params });
/**
*
* @param params
*/
export const getStationLists = (params) => defHttp.get({ url: Api.getStationList, params }, { isTransformResponse: false });
/**
*

View File

@ -1,19 +1,25 @@
<template>
<a-row :gutter="16" style="margin-bottom: 10px;">
<a-col class="gutter-row" :span="4">
<ApiSelect
:api="getStationList"
v-model:value="searchStationCode"
showSearch
optionFilterProp="label"
resultField="list"
labelField="stationName"
valueField="stationCode"
placeholder="请选择"
style="width: 100%;"
@change="loadChart"
allowClear
/>
<a-row :gutter="16" style="margin-bottom: 10px">
<a-col class="gutter-row" :span="6">
<!-- <ApiSelect-->
<!-- :api="getStationList"-->
<!-- v-model:value="searchStationCode"-->
<!-- showSearch-->
<!-- optionFilterProp="label"-->
<!-- resultField="list"-->
<!-- labelField="stationName"-->
<!-- valueField="stationCode"-->
<!-- placeholder="请选择"-->
<!-- style="width: 100%"-->
<!-- @change="loadChart"-->
<!-- 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 class="gutter-row" :span="4">
<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 { useECharts } from '/@/hooks/web/useECharts';
import { basicProps } from './props';
import { getWaterPollutionSummary} from '../api';
import { ApiSelect} from '/@/components/Form/index';
import { getStationList } from '../../../appmana/station/SurvStationInfo.api'
import { getWaterPollutionSummary } from '../api';
import { ApiSelect } from '/@/components/Form/index';
import { getStationLists } from '../../../appmana/station/SurvStationInfo.api';
import dayjs, { Dayjs } from 'dayjs';
const dateFormat = 'YYYY';
let arr1: any[] = [];
let searchStationCode = ref('S_1');
let searchStationCode = ref('');
let searchYear = ref<Dayjs>(dayjs());
let summaryTpDataList = ref(arr1);
let summaryTnDataList = ref(arr1);
let summaryNoDataList = ref(arr1);
let summaryNhDataList = ref(arr1);
let summaryCodDataList = ref(arr1);
let stations = 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({
...basicProps,
@ -53,32 +67,29 @@ onMounted(() => {
const chartRef = ref<HTMLDivElement | null>(null);
const { setOptions } = useECharts(chartRef as Ref<HTMLDivElement>);
const loadChart = (value: string) => {
if(value==null){
value="";
searchStationCode.value="";
if (value == null) {
value = '';
searchStationCode.value = '';
}
getSummary(value,searchYear.value.format(dateFormat));
getSummary(value, searchYear.value.format(dateFormat));
};
const loadYearChart = (value) => {
if(value==null){
value=ref<Dayjs>();
searchYear=ref<Dayjs>();
}else{
value=value.format(dateFormat)
if (value == null) {
value = ref<Dayjs>();
searchYear = ref<Dayjs>();
} else {
value = value.format(dateFormat);
}
getSummary(searchStationCode.value,value);
getSummary(searchStationCode.value, value);
};
function getSummary(stationCode,chooseYear) {
getWaterPollutionSummary(stationCode,chooseYear).then((res) => {
function getSummary(stationCode, chooseYear) {
getWaterPollutionSummary(stationCode, chooseYear).then((res) => {
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;
summaryTnDataList.value = res.result[0].TNSummry;
summaryNoDataList.value = res.result[0].NOSummry;
@ -87,7 +98,8 @@ onMounted(() => {
setOptions({
tooltip: {
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: {
lineStyle: {
width: 1,
@ -122,8 +134,8 @@ onMounted(() => {
axisTick: {
show: false,
},
axisLabel:{
formatter: '{value} mg/L'
axisLabel: {
formatter: '{value} mg/L',
},
splitArea: {
show: true,
@ -198,9 +210,6 @@ onMounted(() => {
});
} else {
}
})
});
}
</script>