feat(faq): refine category icons and project faq flows
This commit is contained in:
@@ -235,7 +235,7 @@ const loadReplies = async () => {
|
||||
const id = route.params.itemId as string;
|
||||
repliesLoading.value = true;
|
||||
try {
|
||||
const { data } = await fetchFaqReplies(id);
|
||||
const { data } = await fetchFaqReplies(id, item.value?.study_id || study.currentStudy?.id);
|
||||
replies.value = Array.isArray(data) ? data : data.items || [];
|
||||
await loadReplyAttachments();
|
||||
} catch (e: any) {
|
||||
@@ -249,7 +249,7 @@ const loadData = async () => {
|
||||
const id = route.params.itemId as string;
|
||||
loading.value = true;
|
||||
try {
|
||||
const { data: faqData } = await fetchFaqItem(id);
|
||||
const { data: faqData } = await fetchFaqItem(id, study.currentStudy?.id);
|
||||
item.value = faqData;
|
||||
const questionTitle = String(faqData.question || "").trim();
|
||||
study.setViewContext({
|
||||
@@ -288,7 +288,7 @@ const submitReply = async () => {
|
||||
if (!item.value) return;
|
||||
submitting.value = true;
|
||||
try {
|
||||
const { data } = await createFaqReply(item.value.id, {
|
||||
const { data } = await createFaqReply(item.value.id, item.value.study_id, {
|
||||
content: replyContent.value,
|
||||
quote_reply_id: quoteReply.value?.id || null,
|
||||
});
|
||||
@@ -324,7 +324,7 @@ const removeReply = async (reply: any) => {
|
||||
const ok = await ElMessageBox.confirm(TEXT.common.confirm.delete, TEXT.common.labels.tips).catch(() => null);
|
||||
if (!ok) return;
|
||||
try {
|
||||
await deleteFaqReply(item.value.id, reply.id);
|
||||
await deleteFaqReply(item.value.id, reply.id, item.value.study_id);
|
||||
ElMessage.success(TEXT.common.messages.deleteSuccess);
|
||||
loadReplies();
|
||||
} catch (e: any) {
|
||||
@@ -344,7 +344,7 @@ const toggleBest = async (reply: any) => {
|
||||
const ok = await ElMessageBox.confirm(TEXT.modules.knowledgeMedicalConsult.confirmBestReply, TEXT.common.labels.tips).catch(() => null);
|
||||
if (!ok) return;
|
||||
}
|
||||
const { data } = await setFaqBestReply(item.value.id, { best_reply_id: target });
|
||||
const { data } = await setFaqBestReply(item.value.id, item.value.study_id, { best_reply_id: target });
|
||||
item.value = data;
|
||||
ElMessage.success(target ? TEXT.modules.knowledgeMedicalConsult.bestReplySet : TEXT.modules.knowledgeMedicalConsult.bestReplyCleared);
|
||||
} catch (e: any) {
|
||||
@@ -359,7 +359,7 @@ const confirmResolved = async () => {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const { data } = await setFaqStatus(item.value.id, { status: "RESOLVED" });
|
||||
const { data } = await setFaqStatus(item.value.id, item.value.study_id, { status: "RESOLVED" });
|
||||
item.value = data;
|
||||
ElMessage.success(TEXT.modules.knowledgeMedicalConsult.resolvedSuccess);
|
||||
} catch (e: any) {
|
||||
@@ -413,6 +413,14 @@ onMounted(() => {
|
||||
.page {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
:deep(.el-card.unified-shell) {
|
||||
border-radius: 8px !important;
|
||||
}
|
||||
|
||||
.page :deep(.unified-shell) {
|
||||
border-radius: 8px;
|
||||
}
|
||||
.content {
|
||||
white-space: pre-wrap;
|
||||
line-height: 1.6;
|
||||
@@ -548,7 +556,7 @@ onMounted(() => {
|
||||
.question-text {
|
||||
margin: 6px 0 0;
|
||||
padding: 12px 14px;
|
||||
border-radius: 10px;
|
||||
border-radius: 8px;
|
||||
background: #f5f7ff;
|
||||
border: 1px solid #e0e7ff;
|
||||
color: #1f2a44;
|
||||
|
||||
Reference in New Issue
Block a user