页面bug修改
This commit is contained in:
parent
d1e74a1950
commit
0bd8771cbe
@ -158,7 +158,7 @@
|
|||||||
:filter-option="filterOption"
|
:filter-option="filterOption"
|
||||||
:loading="rvcdLoading"
|
:loading="rvcdLoading"
|
||||||
@change="handleRvcdChange"
|
@change="handleRvcdChange"
|
||||||
style="width: 200px; margin-right: 10px"
|
style="width: 340px; margin-right: 10px"
|
||||||
:max-tag-count="2"
|
:max-tag-count="2"
|
||||||
>
|
>
|
||||||
<a-select-option
|
<a-select-option
|
||||||
@ -196,15 +196,13 @@
|
|||||||
<div style="display: flex; align-items: center">
|
<div style="display: flex; align-items: center">
|
||||||
<a-checkbox value="baseId">基地:</a-checkbox>
|
<a-checkbox value="baseId">基地:</a-checkbox>
|
||||||
<a-select
|
<a-select
|
||||||
v-model:value="formData.rvcd"
|
v-model:value="formData.yearBaseRvcd"
|
||||||
placeholder="请选择水电基地"
|
placeholder="请选择水电基地"
|
||||||
mode="multiple"
|
mode="multiple"
|
||||||
allow-clear
|
allow-clear
|
||||||
show-search
|
show-search
|
||||||
:filter-option="filterOption"
|
:filter-option="filterOption"
|
||||||
:loading="rvcdLoading"
|
style="width: 460px; margin-right: 10px"
|
||||||
@change="handleRvcdChange"
|
|
||||||
style="width: 200px; margin-right: 10px"
|
|
||||||
:max-tag-count="2"
|
:max-tag-count="2"
|
||||||
>
|
>
|
||||||
<a-select-option
|
<a-select-option
|
||||||
@ -229,7 +227,7 @@
|
|||||||
show-search
|
show-search
|
||||||
:filter-option="filterOption"
|
:filter-option="filterOption"
|
||||||
:loading="lyLoading"
|
:loading="lyLoading"
|
||||||
style="width: 200px; margin-right: 10px"
|
style="width: 460px; margin-right: 10px"
|
||||||
:max-tag-count="2"
|
:max-tag-count="2"
|
||||||
>
|
>
|
||||||
<a-select-option
|
<a-select-option
|
||||||
@ -296,6 +294,7 @@ const formData = reactive({
|
|||||||
yearStatContent: [] as string[],
|
yearStatContent: [] as string[],
|
||||||
statYears: [] as string[],
|
statYears: [] as string[],
|
||||||
yearDimContent: [] as string[],
|
yearDimContent: [] as string[],
|
||||||
|
yearBaseRvcd: [] as string[],
|
||||||
lyRvcd: [] as string[],
|
lyRvcd: [] as string[],
|
||||||
dimensionStat: '',
|
dimensionStat: '',
|
||||||
content: ''
|
content: ''
|
||||||
@ -374,6 +373,7 @@ watch(
|
|||||||
value: item.wbsCode
|
value: item.wbsCode
|
||||||
}));
|
}));
|
||||||
formData.rvcd = [rvcdOptions.value[0].value];
|
formData.rvcd = [rvcdOptions.value[0].value];
|
||||||
|
formData.yearBaseRvcd = [rvcdOptions.value[0].value];
|
||||||
loadStationOptions(formData.rvcd);
|
loadStationOptions(formData.rvcd);
|
||||||
initDone.value = true;
|
initDone.value = true;
|
||||||
},
|
},
|
||||||
@ -386,6 +386,31 @@ const handleRvcdChange = (values: string[]) => {
|
|||||||
loadStationOptions(values);
|
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 () => {
|
const loadLyOptions = async () => {
|
||||||
lyLoading.value = true;
|
lyLoading.value = true;
|
||||||
@ -472,7 +497,7 @@ const handleExport = async () => {
|
|||||||
params.stcd = formData.stations.join(',');
|
params.stcd = formData.stations.join(',');
|
||||||
}
|
}
|
||||||
if (formData.yearDimContent.includes('baseId')) {
|
if (formData.yearDimContent.includes('baseId')) {
|
||||||
params.baseId = formData.rvcd.join(',');
|
params.baseId = formData.yearBaseRvcd.join(',');
|
||||||
}
|
}
|
||||||
if (formData.yearDimContent.includes('ly')) {
|
if (formData.yearDimContent.includes('ly')) {
|
||||||
params.hbRvcd = formData.lyRvcd.join(',');
|
params.hbRvcd = formData.lyRvcd.join(',');
|
||||||
@ -510,7 +535,6 @@ onMounted(() => {
|
|||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.export-container {
|
.export-container {
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
// max-width: 800px;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
.export-form {
|
.export-form {
|
||||||
@ -524,7 +548,4 @@ onMounted(() => {
|
|||||||
z-index: 900;
|
z-index: 900;
|
||||||
pointer-events: all;
|
pointer-events: all;
|
||||||
}
|
}
|
||||||
// .export-container{
|
|
||||||
|
|
||||||
// }
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -22,7 +22,6 @@
|
|||||||
<a-radio
|
<a-radio
|
||||||
v-if="
|
v-if="
|
||||||
field.key === 'day' ||
|
field.key === 'day' ||
|
||||||
field.key === 'month' ||
|
|
||||||
field.key === 'week'
|
field.key === 'week'
|
||||||
"
|
"
|
||||||
value="none"
|
value="none"
|
||||||
@ -385,9 +384,9 @@ const generateFieldValue = (key: string) => {
|
|||||||
case 'nthWeek':
|
case 'nthWeek':
|
||||||
return `${data.nthWeek}#${data.nthWeekDay}`;
|
return `${data.nthWeek}#${data.nthWeekDay}`;
|
||||||
case 'lastWeekDay':
|
case 'lastWeekDay':
|
||||||
return `L#${data.lastWeekDay}`;
|
return `${data.lastWeekDay}L`;
|
||||||
case 'weekday':
|
case 'weekday':
|
||||||
return `W${data.weekdayDay}`;
|
return `${data.weekdayDay}W`;
|
||||||
case 'lastDay':
|
case 'lastDay':
|
||||||
return 'L';
|
return 'L';
|
||||||
case 'specify':
|
case 'specify':
|
||||||
@ -477,7 +476,7 @@ const validateCron = (
|
|||||||
!isRange(day) &&
|
!isRange(day) &&
|
||||||
!isInterval(day) &&
|
!isInterval(day) &&
|
||||||
!isList(day) &&
|
!isList(day) &&
|
||||||
!day.startsWith('W') &&
|
!day.endsWith('W') &&
|
||||||
day !== 'L'
|
day !== 'L'
|
||||||
) {
|
) {
|
||||||
const num = parseInt(day);
|
const num = parseInt(day);
|
||||||
@ -495,7 +494,7 @@ const validateCron = (
|
|||||||
!isRange(week) &&
|
!isRange(week) &&
|
||||||
!isList(week) &&
|
!isList(week) &&
|
||||||
!week.includes('#') &&
|
!week.includes('#') &&
|
||||||
!week.startsWith('L')
|
!week.endsWith('L')
|
||||||
) {
|
) {
|
||||||
const num = parseInt(week);
|
const num = parseInt(week);
|
||||||
if (isNaN(num) || num < 1 || num > 7) {
|
if (isNaN(num) || num < 1 || num > 7) {
|
||||||
@ -580,12 +579,12 @@ const parseCron = (expression: string) => {
|
|||||||
const [nth, day] = value.split('#').map(Number);
|
const [nth, day] = value.split('#').map(Number);
|
||||||
data.nthWeek = nth;
|
data.nthWeek = nth;
|
||||||
data.nthWeekDay = day;
|
data.nthWeekDay = day;
|
||||||
} else if (value.startsWith('L#')) {
|
} else if (value.endsWith('L') && value.length > 1) {
|
||||||
data.type = 'lastWeekDay';
|
data.type = 'lastWeekDay';
|
||||||
data.lastWeekDay = parseInt(value.substring(2));
|
data.lastWeekDay = parseInt(value.substring(0, value.length - 1));
|
||||||
} else if (value.startsWith('W')) {
|
} else if (value.endsWith('W')) {
|
||||||
data.type = 'weekday';
|
data.type = 'weekday';
|
||||||
data.weekdayDay = parseInt(value.substring(1));
|
data.weekdayDay = parseInt(value.substring(0, value.length - 1));
|
||||||
} else if (value === 'L') {
|
} else if (value === 'L') {
|
||||||
data.type = 'lastDay';
|
data.type = 'lastDay';
|
||||||
} else if (value.includes(',')) {
|
} else if (value.includes(',')) {
|
||||||
|
|||||||
@ -158,7 +158,7 @@
|
|||||||
:filter-option="filterOption"
|
:filter-option="filterOption"
|
||||||
:loading="rvcdLoading"
|
:loading="rvcdLoading"
|
||||||
@change="handleRvcdChange"
|
@change="handleRvcdChange"
|
||||||
style="width: 200px; margin-right: 10px"
|
style="width: 300px; margin-right: 10px"
|
||||||
:max-tag-count="2"
|
:max-tag-count="2"
|
||||||
>
|
>
|
||||||
<a-select-option
|
<a-select-option
|
||||||
@ -196,15 +196,13 @@
|
|||||||
<div style="display: flex; align-items: center">
|
<div style="display: flex; align-items: center">
|
||||||
<a-checkbox value="baseId">基地:</a-checkbox>
|
<a-checkbox value="baseId">基地:</a-checkbox>
|
||||||
<a-select
|
<a-select
|
||||||
v-model:value="formData.rvcd"
|
v-model:value="formData.yearBaseRvcd"
|
||||||
placeholder="请选择水电基地"
|
placeholder="请选择水电基地"
|
||||||
mode="multiple"
|
mode="multiple"
|
||||||
allow-clear
|
allow-clear
|
||||||
show-search
|
show-search
|
||||||
:filter-option="filterOption"
|
:filter-option="filterOption"
|
||||||
:loading="rvcdLoading"
|
style="width: 360px; margin-right: 10px"
|
||||||
@change="handleRvcdChange"
|
|
||||||
style="width: 200px; margin-right: 10px"
|
|
||||||
:max-tag-count="2"
|
:max-tag-count="2"
|
||||||
>
|
>
|
||||||
<a-select-option
|
<a-select-option
|
||||||
@ -229,7 +227,7 @@
|
|||||||
show-search
|
show-search
|
||||||
:filter-option="filterOption"
|
:filter-option="filterOption"
|
||||||
:loading="lyLoading"
|
:loading="lyLoading"
|
||||||
style="width: 200px; margin-right: 10px"
|
style="width: 360px; margin-right: 10px"
|
||||||
:max-tag-count="2"
|
:max-tag-count="2"
|
||||||
>
|
>
|
||||||
<a-select-option
|
<a-select-option
|
||||||
@ -296,6 +294,7 @@ const formData = reactive({
|
|||||||
yearStatContent: [] as string[],
|
yearStatContent: [] as string[],
|
||||||
statYears: [] as string[],
|
statYears: [] as string[],
|
||||||
yearDimContent: [] as string[],
|
yearDimContent: [] as string[],
|
||||||
|
yearBaseRvcd: [] as string[],
|
||||||
lyRvcd: [] as string[],
|
lyRvcd: [] as string[],
|
||||||
dimensionStat: '',
|
dimensionStat: '',
|
||||||
content: ''
|
content: ''
|
||||||
@ -472,7 +471,7 @@ const handleExport = async () => {
|
|||||||
params.stcd = formData.stations.join(',');
|
params.stcd = formData.stations.join(',');
|
||||||
}
|
}
|
||||||
if (formData.yearDimContent.includes('baseId')) {
|
if (formData.yearDimContent.includes('baseId')) {
|
||||||
params.baseId = formData.rvcd.join(',');
|
params.baseId = formData.yearBaseRvcd.join(',');
|
||||||
}
|
}
|
||||||
if (formData.yearDimContent.includes('ly')) {
|
if (formData.yearDimContent.includes('ly')) {
|
||||||
params.hbRvcd = formData.lyRvcd.join(',');
|
params.hbRvcd = formData.lyRvcd.join(',');
|
||||||
@ -510,7 +509,6 @@ onMounted(() => {
|
|||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.export-container {
|
.export-container {
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
// max-width: 800px;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
.export-form {
|
.export-form {
|
||||||
@ -524,7 +522,4 @@ onMounted(() => {
|
|||||||
z-index: 900;
|
z-index: 900;
|
||||||
pointer-events: all;
|
pointer-events: all;
|
||||||
}
|
}
|
||||||
// .export-container{
|
|
||||||
|
|
||||||
// }
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -228,6 +228,8 @@ const handleEditSubmit = async (values: any) => {
|
|||||||
};
|
};
|
||||||
//
|
//
|
||||||
const switchChange = async (checked: any, record: any) => {
|
const switchChange = async (checked: any, record: any) => {
|
||||||
|
// checked 是新值,反推出原值(因为 v-model 已更新 record.isSms)
|
||||||
|
const originalValue = checked === 1 ? 0 : 1;
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: '确认修改',
|
title: '确认修改',
|
||||||
content: '确定要修改短信提醒的开关状态吗?',
|
content: '确定要修改短信提醒的开关状态吗?',
|
||||||
@ -241,10 +243,19 @@ const switchChange = async (checked: any, record: any) => {
|
|||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
message.success(`修改成功`);
|
message.success(`修改成功`);
|
||||||
basicTable.value.refresh();
|
basicTable.value.refresh();
|
||||||
|
} else {
|
||||||
|
// 请求返回错误码,恢复原状态
|
||||||
|
record.isSms = originalValue;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
// 请求异常,恢复原状态
|
||||||
|
record.isSms = originalValue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
onCancel: () => {
|
||||||
|
// 用户取消确认,恢复原状态
|
||||||
|
record.isSms = originalValue;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user