format
This commit is contained in:
parent
dc0d6d5b48
commit
29054c6188
@ -38,7 +38,7 @@ export const knowledgeKeyApi = {
|
|||||||
},
|
},
|
||||||
validDataSet: () => {
|
validDataSet: () => {
|
||||||
return client.get('/knowledge/dataset/validDataSet', {});
|
return client.get('/knowledge/dataset/validDataSet', {});
|
||||||
}
|
},
|
||||||
|
|
||||||
// // 获取知识库密钥
|
// // 获取知识库密钥
|
||||||
// getKnowledgeKey: () => {
|
// getKnowledgeKey: () => {
|
||||||
|
|||||||
@ -78,5 +78,5 @@ export function videoUpdate(id: number, params: any) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getResourceUrl(id: number) {
|
export function getResourceUrl(id: number) {
|
||||||
return client.get(`/backend/v1/resource/getResourceUrl?id=`+id, {});
|
return client.get(`/backend/v1/resource/getResourceUrl?id=` + id, {});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,6 @@ import client from './internal/httpClient';
|
|||||||
|
|
||||||
export function textbookList(page: number, size: number, title: string) {
|
export function textbookList(page: number, size: number, title: string) {
|
||||||
return client.get('/backend/v1/jc/textbook/index', {
|
return client.get('/backend/v1/jc/textbook/index', {
|
||||||
// return client.get('/backend/v1/course/index', {
|
|
||||||
page: page,
|
page: page,
|
||||||
size: size,
|
size: size,
|
||||||
title: title,
|
title: title,
|
||||||
|
|||||||
@ -185,4 +185,4 @@ const ExamAdministrationDetails = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default ExamAdministrationDetails
|
export default ExamAdministrationDetails;
|
||||||
|
|||||||
@ -329,7 +329,8 @@ const ExamAdministrationPage = () => {
|
|||||||
}*/
|
}*/
|
||||||
// 根据不同操作类型,调用对应的后端批量接口
|
// 根据不同操作类型,调用对应的后端批量接口
|
||||||
switch (currentOperation) {
|
switch (currentOperation) {
|
||||||
case 'resetExam': { // 批量重置接口:传递 examIds
|
case 'resetExam': {
|
||||||
|
// 批量重置接口:传递 examIds
|
||||||
const resResetExam = (await updateList(ids ?? [], '3', '')) as UpdateListResponse;
|
const resResetExam = (await updateList(ids ?? [], '3', '')) as UpdateListResponse;
|
||||||
if (resResetExam?.code === 0) {
|
if (resResetExam?.code === 0) {
|
||||||
message.success(`成功重置 ${data.records.length} 名学生的考试状态`);
|
message.success(`成功重置 ${data.records.length} 名学生的考试状态`);
|
||||||
|
|||||||
@ -369,7 +369,12 @@ const DictionaryDetailPage = () => {
|
|||||||
<Button onClick={enterFullscreen}>放大</Button>
|
<Button onClick={enterFullscreen}>放大</Button>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.iframeContainer}>
|
<div className={styles.iframeContainer}>
|
||||||
<iframe ref={iframeRef} src={accessUrl} className={styles.iframe} title="数字孪生程序" />
|
<iframe
|
||||||
|
ref={iframeRef}
|
||||||
|
src={accessUrl}
|
||||||
|
className={styles.iframe}
|
||||||
|
title="数字孪生程序"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
@ -472,7 +477,7 @@ const DictionaryDetailPage = () => {
|
|||||||
right: 4,
|
right: 4,
|
||||||
bottom: 4,
|
bottom: 4,
|
||||||
borderRadius: 8,
|
borderRadius: 8,
|
||||||
overflow: 'hidden'
|
overflow: 'hidden',
|
||||||
}}
|
}}
|
||||||
onError={(error) => handleVideoError(error, item)}
|
onError={(error) => handleVideoError(error, item)}
|
||||||
onReady={() => handleVideoReady(item)}
|
onReady={() => handleVideoReady(item)}
|
||||||
@ -491,7 +496,7 @@ const DictionaryDetailPage = () => {
|
|||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
backgroundColor: '#f0f0f0',
|
backgroundColor: '#f0f0f0',
|
||||||
color: '#666',
|
color: '#666',
|
||||||
borderRadius: 8
|
borderRadius: 8,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
视频无法加载
|
视频无法加载
|
||||||
@ -511,7 +516,7 @@ const DictionaryDetailPage = () => {
|
|||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
backgroundColor: '#f0f0f0',
|
backgroundColor: '#f0f0f0',
|
||||||
color: '#666',
|
color: '#666',
|
||||||
borderRadius: 8
|
borderRadius: 8,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
无视频源
|
无视频源
|
||||||
|
|||||||
@ -38,7 +38,7 @@ import defaultThumb2 from '../../assets/thumb/thumb2.png';
|
|||||||
import defaultThumb3 from '../../assets/thumb/thumb3.png';
|
import defaultThumb3 from '../../assets/thumb/thumb3.png';
|
||||||
import { FileUploader } from '../../compenents/uploadFile';
|
import { FileUploader } from '../../compenents/uploadFile';
|
||||||
import { TreeAttachments } from '../offline-course/compenents/attachments';
|
import { TreeAttachments } from '../offline-course/compenents/attachments';
|
||||||
import {getResourceUrl} from "../../api/resource";
|
import { getResourceUrl } from '../../api/resource';
|
||||||
|
|
||||||
//搜索框
|
//搜索框
|
||||||
type SearchProps = GetProps<typeof Input.Search>;
|
type SearchProps = GetProps<typeof Input.Search>;
|
||||||
@ -214,7 +214,7 @@ const Experiment = () => {
|
|||||||
interface UploadRes {
|
interface UploadRes {
|
||||||
data?: string; // 根据后端实际返回结构调整,比如可能是路径字符串
|
data?: string; // 根据后端实际返回结构调整,比如可能是路径字符串
|
||||||
}
|
}
|
||||||
const getImageUrl=(id:any)=>{
|
const getImageUrl = (id: any) => {
|
||||||
getResourceUrl(id).then((res: any) => {
|
getResourceUrl(id).then((res: any) => {
|
||||||
setThumb(res.data.resource_url);
|
setThumb(res.data.resource_url);
|
||||||
});
|
});
|
||||||
@ -356,7 +356,7 @@ const Experiment = () => {
|
|||||||
}
|
}
|
||||||
// 修复拼写错误并添加空值判断
|
// 修复拼写错误并添加空值判断
|
||||||
if (res.data.labCourseImage) {
|
if (res.data.labCourseImage) {
|
||||||
getImageUrl(res.data.labCourseImage)
|
getImageUrl(res.data.labCourseImage);
|
||||||
}
|
}
|
||||||
setSelectedId(res.data.id);
|
setSelectedId(res.data.id);
|
||||||
// 打开弹窗
|
// 打开弹窗
|
||||||
|
|||||||
@ -11,7 +11,6 @@ const HomePage = () => {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={styles['layout-wrap']}>
|
<div className={styles['layout-wrap']}>
|
||||||
|
|
||||||
<div className={styles['left-menu']}>
|
<div className={styles['left-menu']}>
|
||||||
<LeftMenu />
|
<LeftMenu />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -81,8 +81,7 @@ const formatDate = (value?: string | number | null): string => {
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
const date =
|
const date = value.toString().length === 10 ? new Date(value * 1000) : new Date(value);
|
||||||
value.toString().length === 10 ? new Date(value * 1000) : new Date(value);
|
|
||||||
if (Number.isNaN(date.getTime())) {
|
if (Number.isNaN(date.getTime())) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
@ -106,8 +105,7 @@ const normalizeListResponse = (payload: any) => {
|
|||||||
root?.items,
|
root?.items,
|
||||||
Array.isArray(root) ? root : null,
|
Array.isArray(root) ? root : null,
|
||||||
];
|
];
|
||||||
const list =
|
const list = listCandidates.find((candidate) => Array.isArray(candidate)) ?? [];
|
||||||
listCandidates.find((candidate) => Array.isArray(candidate)) ?? [];
|
|
||||||
|
|
||||||
const total =
|
const total =
|
||||||
root?.total ??
|
root?.total ??
|
||||||
@ -155,9 +153,7 @@ const ResourceLibraryReviewPage = () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const [growthTrend, setGrowthTrend] = useState<GrowthRecord[]>([]);
|
const [growthTrend, setGrowthTrend] = useState<GrowthRecord[]>([]);
|
||||||
const [distributionData, setDistributionData] = useState<
|
const [distributionData, setDistributionData] = useState<{ value: number; name: string }[]>([]);
|
||||||
{ value: number; name: string }[]
|
|
||||||
>([]);
|
|
||||||
|
|
||||||
const [modalVisible, setModalVisible] = useState(false);
|
const [modalVisible, setModalVisible] = useState(false);
|
||||||
const [selectedQuestion, setSelectedQuestion] = useState<QuestionRecord | null>(null);
|
const [selectedQuestion, setSelectedQuestion] = useState<QuestionRecord | null>(null);
|
||||||
@ -320,9 +316,7 @@ const ResourceLibraryReviewPage = () => {
|
|||||||
});
|
});
|
||||||
const filtered =
|
const filtered =
|
||||||
kmType !== undefined
|
kmType !== undefined
|
||||||
? normalizedList.filter(
|
? normalizedList.filter((item) => Number(item?.kmType) === Number(kmType))
|
||||||
(item) => Number(item?.kmType) === Number(kmType)
|
|
||||||
)
|
|
||||||
: normalizedList;
|
: normalizedList;
|
||||||
setQuestionList(filtered);
|
setQuestionList(filtered);
|
||||||
if (kmType !== undefined && filtered.length !== list.length) {
|
if (kmType !== undefined && filtered.length !== list.length) {
|
||||||
@ -486,15 +480,10 @@ const ResourceLibraryReviewPage = () => {
|
|||||||
<div
|
<div
|
||||||
className={styles['htr-stat-trend']}
|
className={styles['htr-stat-trend']}
|
||||||
style={{
|
style={{
|
||||||
color:
|
color: statistics.kmTypeReviewGrowthRate >= 0 ? '#52c41a' : '#ff4d4f',
|
||||||
statistics.kmTypeReviewGrowthRate >= 0 ? '#52c41a' : '#ff4d4f',
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{statistics.kmTypeReviewGrowthRate >= 0 ? (
|
{statistics.kmTypeReviewGrowthRate >= 0 ? <RiseOutlined /> : <FallOutlined />}
|
||||||
<RiseOutlined />
|
|
||||||
) : (
|
|
||||||
<FallOutlined />
|
|
||||||
)}
|
|
||||||
<span>
|
<span>
|
||||||
{statistics.kmTypeReviewGrowthRate >= 0 ? '较昨日增长' : '较昨日下降'}{' '}
|
{statistics.kmTypeReviewGrowthRate >= 0 ? '较昨日增长' : '较昨日下降'}{' '}
|
||||||
{Math.abs(statistics.kmTypeReviewGrowthRate)}%
|
{Math.abs(statistics.kmTypeReviewGrowthRate)}%
|
||||||
@ -568,8 +557,7 @@ const ResourceLibraryReviewPage = () => {
|
|||||||
<div
|
<div
|
||||||
className={styles['htr-stat-trend']}
|
className={styles['htr-stat-trend']}
|
||||||
style={{
|
style={{
|
||||||
color:
|
color: statistics.kmQueryDuplicateRateGrowth >= 0 ? '#52c41a' : '#ff4d4f',
|
||||||
statistics.kmQueryDuplicateRateGrowth >= 0 ? '#52c41a' : '#ff4d4f',
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{statistics.kmQueryDuplicateRateGrowth >= 0 ? (
|
{statistics.kmQueryDuplicateRateGrowth >= 0 ? (
|
||||||
@ -636,7 +624,9 @@ const ResourceLibraryReviewPage = () => {
|
|||||||
<Button
|
<Button
|
||||||
type="primary"
|
type="primary"
|
||||||
icon={<SearchOutlined />}
|
icon={<SearchOutlined />}
|
||||||
onClick={() => fetchQuestionList(1, searchKeyword, statusFilter, experimentTypeFilter)}
|
onClick={() =>
|
||||||
|
fetchQuestionList(1, searchKeyword, statusFilter, experimentTypeFilter)
|
||||||
|
}
|
||||||
>
|
>
|
||||||
搜索
|
搜索
|
||||||
</Button>
|
</Button>
|
||||||
@ -662,15 +652,15 @@ const ResourceLibraryReviewPage = () => {
|
|||||||
showTotal: (count, range) => `显示 ${range[0]}-${range[1]} 条,共 ${count} 条`,
|
showTotal: (count, range) => `显示 ${range[0]}-${range[1]} 条,共 ${count} 条`,
|
||||||
onChange: (current) => setPage(current),
|
onChange: (current) => setPage(current),
|
||||||
}}
|
}}
|
||||||
rowKey={(record) =>
|
rowKey={(record) =>
|
||||||
record.id ||
|
record.id ||
|
||||||
record.kmConversationId ||
|
record.kmConversationId ||
|
||||||
record.km_conversation_id ||
|
record.km_conversation_id ||
|
||||||
record.kmId ||
|
record.kmId ||
|
||||||
record.km_id ||
|
record.km_id ||
|
||||||
record.kmQuery ||
|
record.kmQuery ||
|
||||||
Math.random()
|
Math.random()
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
@ -819,12 +809,7 @@ const ResourceLibraryReviewPage = () => {
|
|||||||
>
|
>
|
||||||
拒绝
|
拒绝
|
||||||
</Button>,
|
</Button>,
|
||||||
<Button
|
<Button key="submit" type="primary" onClick={handleModalOk} loading={modalSubmitting}>
|
||||||
key="submit"
|
|
||||||
type="primary"
|
|
||||||
onClick={handleModalOk}
|
|
||||||
loading={modalSubmitting}
|
|
||||||
>
|
|
||||||
通过并加入知识库
|
通过并加入知识库
|
||||||
</Button>,
|
</Button>,
|
||||||
]}
|
]}
|
||||||
@ -845,7 +830,9 @@ const ResourceLibraryReviewPage = () => {
|
|||||||
<div className={styles['htr-modal-info-item']}>
|
<div className={styles['htr-modal-info-item']}>
|
||||||
<Text strong>提问人</Text>
|
<Text strong>提问人</Text>
|
||||||
<Space>
|
<Space>
|
||||||
<Avatar>{selectedQuestion.kmUser ? selectedQuestion.kmUser.charAt(0) : ''}</Avatar>
|
<Avatar>
|
||||||
|
{selectedQuestion.kmUser ? selectedQuestion.kmUser.charAt(0) : ''}
|
||||||
|
</Avatar>
|
||||||
<div>{selectedQuestion.kmUser || '匿名用户'}</div>
|
<div>{selectedQuestion.kmUser || '匿名用户'}</div>
|
||||||
</Space>
|
</Space>
|
||||||
</div>
|
</div>
|
||||||
@ -915,4 +902,3 @@ const ResourceLibraryReviewPage = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default ResourceLibraryReviewPage;
|
export default ResourceLibraryReviewPage;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user