Browse Source

fix: 修复数据接口对接模式

feature-v1.0.0
Befend 1 month ago
parent
commit
6d258f2567
  1. 10
      src/views/Main/Dike/components/BaseInfo.vue
  2. 12
      src/views/Main/Reservoir/components/BaseInfo.vue
  3. 6
      src/views/Main/Sluice/components/BaseInfo.vue

10
src/views/Main/Dike/components/BaseInfo.vue

@ -294,12 +294,12 @@ const form: any = ref({});
const emits = defineEmits(["getResInfo"]); const emits = defineEmits(["getResInfo"]);
function initBaseInfo() { function initBaseInfo() {
getJbxx(props.resCode).then((res) => { getJbxx(props.resCode).then((res) => {
if (res?.data) { if (res) {
form.value = { form.value = {
...form.value, ...form.value,
...res.data, ...res,
}; };
emits("getResInfo", res.data); emits("getResInfo", res);
} }
}); });
} }
@ -311,8 +311,8 @@ function initRsppInfo() {
dikeCode: props.resCode, dikeCode: props.resCode,
}, },
}).then((res) => { }).then((res) => {
if (res?.data) { if (res) {
Object.assign(form.value, res.data[0] || {}); Object.assign(form.value, res[0] || {});
} }
}); });
} }

12
src/views/Main/Reservoir/components/BaseInfo.vue

@ -552,20 +552,20 @@ const dutyPersonList: any = ref([]);
const emits = defineEmits(["getResInfo"]); const emits = defineEmits(["getResInfo"]);
function initBaseInfo() { function initBaseInfo() {
getReservoirBaseDetailData(props.resCode).then((res) => { getReservoirBaseDetailData(props.resCode).then((res) => {
if (res?.data) { if (res) {
form.value = { form.value = {
...form.value, ...form.value,
...res.data, ...res,
}; };
emits("getResInfo", res.data); emits("getResInfo", res);
} }
}); });
} }
function initRsppInfo() { function initRsppInfo() {
getReservoirRsppDetailData(props.resCode).then((res) => { getReservoirRsppDetailData(props.resCode).then((res) => {
if (res?.data) { if (res) {
Object.keys(res.data).forEach((key) => { Object.keys(res).forEach((key) => {
form.value[key] = res.data[key]; form.value[key] = res[key];
}); });
} }
}); });

6
src/views/Main/Sluice/components/BaseInfo.vue

@ -203,12 +203,12 @@ const form: any = ref({});
const emits = defineEmits(["getResInfo"]); const emits = defineEmits(["getResInfo"]);
function initBaseInfo() { function initBaseInfo() {
getJbxx(props.resCode).then((res) => { getJbxx(props.resCode).then((res) => {
if (res?.data) { if (res) {
form.value = { form.value = {
...form.value, ...form.value,
...res.data, ...res,
}; };
emits("getResInfo", res.data); emits("getResInfo", res);
} }
}); });
} }

Loading…
Cancel
Save