页面bug修改

This commit is contained in:
王兴凯 2026-09-02 18:24:20 +08:00
parent d1e74a1950
commit 0bd8771cbe
4 changed files with 57 additions and 31 deletions

View File

@ -158,7 +158,7 @@
:filter-option="filterOption"
:loading="rvcdLoading"
@change="handleRvcdChange"
style="width: 200px; margin-right: 10px"
style="width: 340px; margin-right: 10px"
:max-tag-count="2"
>
<a-select-option
@ -196,15 +196,13 @@
<div style="display: flex; align-items: center">
<a-checkbox value="baseId">基地</a-checkbox>
<a-select
v-model:value="formData.rvcd"
v-model:value="formData.yearBaseRvcd"
placeholder="请选择水电基地"
mode="multiple"
allow-clear
show-search
:filter-option="filterOption"
:loading="rvcdLoading"
@change="handleRvcdChange"
style="width: 200px; margin-right: 10px"
style="width: 460px; margin-right: 10px"
:max-tag-count="2"
>
<a-select-option
@ -229,7 +227,7 @@
show-search
:filter-option="filterOption"
:loading="lyLoading"
style="width: 200px; margin-right: 10px"
style="width: 460px; margin-right: 10px"
:max-tag-count="2"
>
<a-select-option
@ -296,6 +294,7 @@ const formData = reactive({
yearStatContent: [] as string[],
statYears: [] as string[],
yearDimContent: [] as string[],
yearBaseRvcd: [] as string[],
lyRvcd: [] as string[],
dimensionStat: '',
content: ''
@ -374,6 +373,7 @@ watch(
value: item.wbsCode
}));
formData.rvcd = [rvcdOptions.value[0].value];
formData.yearBaseRvcd = [rvcdOptions.value[0].value];
loadStationOptions(formData.rvcd);
initDone.value = true;
},
@ -386,6 +386,31 @@ const handleRvcdChange = (values: string[]) => {
loadStationOptions(values);
};
//
watch(
() => formData.timeDimension,
() => {
const now = new Date();
const year = now.getFullYear();
//
formData.monitorElements = dataFieldOption.value.map(item => item.itemCode);
formData.rvcd = rvcdOptions.value.length > 0 ? [rvcdOptions.value[0].value] : [];
formData.stations = [];
formData.statMonths = getDefaultStatMonths();
formData.dataSource = 'true';
//
formData.yearStatContent = ['wq', 'qec'];
formData.statYears = [String(year)];
formData.yearDimContent = ['stcd', 'baseId'];
formData.yearBaseRvcd = rvcdOptions.value.length > 0 ? [rvcdOptions.value[0].value] : [];
formData.lyRvcd = lyOptions.value.length > 0 ? [lyOptions.value[0].value] : [];
//
if (formData.rvcd.length > 0) {
loadStationOptions(formData.rvcd);
}
}
);
//
const loadLyOptions = async () => {
lyLoading.value = true;
@ -472,7 +497,7 @@ const handleExport = async () => {
params.stcd = formData.stations.join(',');
}
if (formData.yearDimContent.includes('baseId')) {
params.baseId = formData.rvcd.join(',');
params.baseId = formData.yearBaseRvcd.join(',');
}
if (formData.yearDimContent.includes('ly')) {
params.hbRvcd = formData.lyRvcd.join(',');
@ -510,7 +535,6 @@ onMounted(() => {
<style scoped lang="scss">
.export-container {
padding: 20px;
// max-width: 800px;
width: 100%;
.export-form {
@ -524,7 +548,4 @@ onMounted(() => {
z-index: 900;
pointer-events: all;
}
// .export-container{
// }
</style>

View File

@ -22,7 +22,6 @@
<a-radio
v-if="
field.key === 'day' ||
field.key === 'month' ||
field.key === 'week'
"
value="none"
@ -385,9 +384,9 @@ const generateFieldValue = (key: string) => {
case 'nthWeek':
return `${data.nthWeek}#${data.nthWeekDay}`;
case 'lastWeekDay':
return `L#${data.lastWeekDay}`;
return `${data.lastWeekDay}L`;
case 'weekday':
return `W${data.weekdayDay}`;
return `${data.weekdayDay}W`;
case 'lastDay':
return 'L';
case 'specify':
@ -477,7 +476,7 @@ const validateCron = (
!isRange(day) &&
!isInterval(day) &&
!isList(day) &&
!day.startsWith('W') &&
!day.endsWith('W') &&
day !== 'L'
) {
const num = parseInt(day);
@ -495,7 +494,7 @@ const validateCron = (
!isRange(week) &&
!isList(week) &&
!week.includes('#') &&
!week.startsWith('L')
!week.endsWith('L')
) {
const num = parseInt(week);
if (isNaN(num) || num < 1 || num > 7) {
@ -580,12 +579,12 @@ const parseCron = (expression: string) => {
const [nth, day] = value.split('#').map(Number);
data.nthWeek = nth;
data.nthWeekDay = day;
} else if (value.startsWith('L#')) {
} else if (value.endsWith('L') && value.length > 1) {
data.type = 'lastWeekDay';
data.lastWeekDay = parseInt(value.substring(2));
} else if (value.startsWith('W')) {
data.lastWeekDay = parseInt(value.substring(0, value.length - 1));
} else if (value.endsWith('W')) {
data.type = 'weekday';
data.weekdayDay = parseInt(value.substring(1));
data.weekdayDay = parseInt(value.substring(0, value.length - 1));
} else if (value === 'L') {
data.type = 'lastDay';
} else if (value.includes(',')) {

View File

@ -158,7 +158,7 @@
:filter-option="filterOption"
:loading="rvcdLoading"
@change="handleRvcdChange"
style="width: 200px; margin-right: 10px"
style="width: 300px; margin-right: 10px"
:max-tag-count="2"
>
<a-select-option
@ -196,15 +196,13 @@
<div style="display: flex; align-items: center">
<a-checkbox value="baseId">基地</a-checkbox>
<a-select
v-model:value="formData.rvcd"
v-model:value="formData.yearBaseRvcd"
placeholder="请选择水电基地"
mode="multiple"
allow-clear
show-search
:filter-option="filterOption"
:loading="rvcdLoading"
@change="handleRvcdChange"
style="width: 200px; margin-right: 10px"
style="width: 360px; margin-right: 10px"
:max-tag-count="2"
>
<a-select-option
@ -229,7 +227,7 @@
show-search
:filter-option="filterOption"
:loading="lyLoading"
style="width: 200px; margin-right: 10px"
style="width: 360px; margin-right: 10px"
:max-tag-count="2"
>
<a-select-option
@ -296,6 +294,7 @@ const formData = reactive({
yearStatContent: [] as string[],
statYears: [] as string[],
yearDimContent: [] as string[],
yearBaseRvcd: [] as string[],
lyRvcd: [] as string[],
dimensionStat: '',
content: ''
@ -472,7 +471,7 @@ const handleExport = async () => {
params.stcd = formData.stations.join(',');
}
if (formData.yearDimContent.includes('baseId')) {
params.baseId = formData.rvcd.join(',');
params.baseId = formData.yearBaseRvcd.join(',');
}
if (formData.yearDimContent.includes('ly')) {
params.hbRvcd = formData.lyRvcd.join(',');
@ -510,7 +509,6 @@ onMounted(() => {
<style scoped lang="scss">
.export-container {
padding: 20px;
// max-width: 800px;
width: 100%;
.export-form {
@ -524,7 +522,4 @@ onMounted(() => {
z-index: 900;
pointer-events: all;
}
// .export-container{
// }
</style>

View File

@ -228,6 +228,8 @@ const handleEditSubmit = async (values: any) => {
};
//
const switchChange = async (checked: any, record: any) => {
// checked v-model record.isSms
const originalValue = checked === 1 ? 0 : 1;
Modal.confirm({
title: '确认修改',
content: '确定要修改短信提醒的开关状态吗?',
@ -241,10 +243,19 @@ const switchChange = async (checked: any, record: any) => {
if (res.code == 0) {
message.success(`修改成功`);
basicTable.value.refresh();
} else {
//
record.isSms = originalValue;
}
} catch (error) {
//
record.isSms = originalValue;
return;
}
},
onCancel: () => {
//
record.isSms = originalValue;
}
});
};