This commit is contained in:
Teo
2025-08-14 01:58:00 +08:00
parent 606722f19e
commit 3158dc84f7
99 changed files with 620 additions and 554 deletions

View File

@ -111,7 +111,7 @@ const dialog = reactive<DialogOption>({
const initFormData: QuestionsCategoryForm = {
id: undefined,
projectId: currentProject.value.id,
projectId: currentProject.value?.id,
categoryName: undefined
};
const data = reactive<PageData<QuestionsCategoryForm, QuestionsCategoryQuery>>({
@ -119,7 +119,7 @@ const data = reactive<PageData<QuestionsCategoryForm, QuestionsCategoryQuery>>({
queryParams: {
pageNum: 1,
pageSize: 10,
projectId: currentProject.value.id,
projectId: currentProject.value?.id,
categoryName: undefined,
params: {}
},
@ -194,7 +194,7 @@ const submitForm = () => {
questionsCategoryFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
form.value.projectId = currentProject.value.id;
form.value.projectId = currentProject.value?.id;
if (form.value.id) {
await updateQuestionsCategory(form.value).finally(() => (buttonLoading.value = false));
} else {
@ -218,7 +218,7 @@ const handleDelete = async (row?: QuestionsCategoryVO) => {
//监听项目id刷新数据
const listeningProject = watch(
() => currentProject.value.id,
() => currentProject.value?.id,
(nid, oid) => {
queryParams.value.projectId = nid;
form.value.projectId = nid;