|
@@ -29,8 +29,8 @@
|
|
|
|
|
|
<template #formFooter>
|
|
<template #formFooter>
|
|
<div class="w-full flex items-center justify-center my-3" v-if="Number(route.query.type) != 2">
|
|
<div class="w-full flex items-center justify-center my-3" v-if="Number(route.query.type) != 2">
|
|
- <a-button type="primary" @click="save" class="mr-2" :loading="isSubmit"> 保存 </a-button>
|
|
|
|
- <a-button type="error" @click="back" class="mr-2"> 关闭 </a-button>
|
|
|
|
|
|
+ <a-button type="primary" @click="save" class="mr-2" :loading="isSubmit"> 保存</a-button>
|
|
|
|
+ <a-button type="error" @click="back" class="mr-2"> 关闭</a-button>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</BasicForm>
|
|
</BasicForm>
|
|
@@ -54,6 +54,7 @@
|
|
import { useUserStore } from '/@/store/modules/user';
|
|
import { useUserStore } from '/@/store/modules/user';
|
|
import { storeToRefs } from 'pinia';
|
|
import { storeToRefs } from 'pinia';
|
|
import { areAllItemsAllFieldsFilled } from '/@/utils';
|
|
import { areAllItemsAllFieldsFilled } from '/@/utils';
|
|
|
|
+
|
|
const { close: closeTab } = useTabs();
|
|
const { close: closeTab } = useTabs();
|
|
const { userInfo } = storeToRefs(useUserStore());
|
|
const { userInfo } = storeToRefs(useUserStore());
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
@@ -64,6 +65,7 @@
|
|
});
|
|
});
|
|
const viewDataSport = ref<any>({});
|
|
const viewDataSport = ref<any>({});
|
|
const customTableData = ref({});
|
|
const customTableData = ref({});
|
|
|
|
+
|
|
async function isView() {
|
|
async function isView() {
|
|
if (Number(route.query.type) != 0) {
|
|
if (Number(route.query.type) != 0) {
|
|
await getDataList();
|
|
await getDataList();
|
|
@@ -80,25 +82,30 @@
|
|
});
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
isView();
|
|
isView();
|
|
|
|
+
|
|
async function getDataList() {
|
|
async function getDataList() {
|
|
const res = await getDetaile({ id: route.query.id });
|
|
const res = await getDetaile({ id: route.query.id });
|
|
// viewDataSportList.value = res;\
|
|
// viewDataSportList.value = res;\
|
|
- customTableData.value = res.priceRulesList.map((it) => {
|
|
|
|
|
|
+ customTableData.value = res.priceRulesList.map((it, index) => {
|
|
return {
|
|
return {
|
|
name: it.name,
|
|
name: it.name,
|
|
time: [it.startTime, it.endTime],
|
|
time: [it.startTime, it.endTime],
|
|
id: it.id,
|
|
id: it.id,
|
|
coursesId: it.coursesId,
|
|
coursesId: it.coursesId,
|
|
|
|
+ sort: index + 1,
|
|
};
|
|
};
|
|
});
|
|
});
|
|
viewDataSport.value = res.courses;
|
|
viewDataSport.value = res.courses;
|
|
}
|
|
}
|
|
|
|
|
|
const isSubmit = ref(false);
|
|
const isSubmit = ref(false);
|
|
|
|
+
|
|
async function back() {
|
|
async function back() {
|
|
await closeTab();
|
|
await closeTab();
|
|
}
|
|
}
|
|
|
|
+
|
|
async function save() {
|
|
async function save() {
|
|
await validate();
|
|
await validate();
|
|
const form = await getFieldsValue();
|
|
const form = await getFieldsValue();
|
|
@@ -121,14 +128,16 @@
|
|
isSubmit.value = false;
|
|
isSubmit.value = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
function transformData(data) {
|
|
function transformData(data) {
|
|
- return data.map((it) => {
|
|
|
|
|
|
+ return data.map((it, index) => {
|
|
return {
|
|
return {
|
|
startTime: unref(it.editValueRefs.time)[0],
|
|
startTime: unref(it.editValueRefs.time)[0],
|
|
endTime: unref(it.editValueRefs.time)[1],
|
|
endTime: unref(it.editValueRefs.time)[1],
|
|
name: unref(it.editValueRefs.name),
|
|
name: unref(it.editValueRefs.name),
|
|
id: typeof it.id == 'string' ? it.id : null,
|
|
id: typeof it.id == 'string' ? it.id : null,
|
|
coursesId: it.coursesId,
|
|
coursesId: it.coursesId,
|
|
|
|
+ sort: index + 1,
|
|
};
|
|
};
|
|
});
|
|
});
|
|
}
|
|
}
|