diff --git a/admin/package.json b/admin/package.json
index 4150cdf..fc2241e 100644
--- a/admin/package.json
+++ b/admin/package.json
@@ -73,6 +73,7 @@
"gg-editor": "^2.0.2",
"lodash": "^4.17.11",
"lodash-decorators": "^6.0.0",
+ "mediainfo.js": "^0.1.7",
"moment": "^2.25.3",
"numeral": "^2.0.6",
"nzh": "^1.0.3",
@@ -83,6 +84,7 @@
"react-dom": "^17.0.0",
"react-fittext": "^1.0.0",
"react-helmet-async": "^1.0.4",
+ "react-mediainfo": "^0.0.42",
"react-quill": "^1.3.5",
"react-router": "^4.3.1",
"umi": "^3.5.20",
diff --git a/admin/src/pages/demo/index.tsx b/admin/src/pages/demo/index.tsx
index 4b03e7a..94c8bc3 100644
--- a/admin/src/pages/demo/index.tsx
+++ b/admin/src/pages/demo/index.tsx
@@ -2,6 +2,7 @@ import { DingdingOutlined, UploadOutlined } from '@ant-design/icons';
import { Button, Card, Steps, Result, Descriptions, Modal, Input, Upload, Popconfirm, Menu, Radio } from 'antd';
import { Fragment, useEffect, useRef, useState } from 'react';
import { GridContent } from '@ant-design/pro-layout';
+import { getInfo } from 'react-mediainfo';
import { Line } from '@ant-design/charts';
import { DualAxes } from "@ant-design/charts";
import styles from './index.less';
@@ -57,12 +58,12 @@ const formatSeconds= (value)=>{
// if (day > 0) {
// result = '' + parseInt(day) + '天' + result
// }
- console.log('result:', result)
+ //console.log('result:', result)
return result
}
export default () => {
const uuid = uuidv4()
- console.log('uuid', uuidv4());
+ //console.log('uuid', uuidv4());
const data = [
{
year: "1991",
@@ -194,10 +195,11 @@ export default () => {
return queryCourseList();
});
useEffect(() => {
- console.log('listData', listData)
+ //console.log('listData', listData)
+ /*
setInterval(() => {
setChartData(Math.random() > 0.5 ? [data, data] : [data2, data2]);
- }, 1000);
+ }, 1000);*/
@@ -205,7 +207,7 @@ export default () => {
const menuItems = [];
if(listData?.length > 0){
- console.log('push');
+ //console.log('push');
listData.list.forEach((item: {code: number, name: string})=>{
menuItems.push(
{item?.course_name})
})
@@ -234,7 +236,7 @@ export default () => {
{
saveInputRef.current.focus({})
- console.log('ref', saveInputRef.current)
+ //console.log('ref', saveInputRef.current)
}}>焦点
{handleModalVisible(true)}}>课程
uuid: {uuidv4()}
@@ -256,6 +258,18 @@ export default () => {
{
+ const {media: {track:[General, Video, Audio]}} = await getInfo(file)
+ console.log('General:', General)
+ console.log('Video:', Video)
+ console.log('Video:', Video.format) // AVC
+ console.log('Audio:', Audio.format) // AAC
+ /*
+ console.log('info:', media)
+ console.log('track[0]:', media.track[0])
+ console.log('track[1]:', media.track[1])
+ console.log('track[2]:', media.track[2])*/
+ }}
data={
{
name: '4.jpg',
@@ -305,10 +319,9 @@ export default () => {
Delete
-
+ {/*
-
-
+*/}
{
}}>
A
diff --git a/admin/src/pages/examinationrules/attestation/index.tsx b/admin/src/pages/examinationrules/attestation/index.tsx
index cac562b..43bd05e 100644
--- a/admin/src/pages/examinationrules/attestation/index.tsx
+++ b/admin/src/pages/examinationrules/attestation/index.tsx
@@ -119,6 +119,7 @@ const ExaminationRules: React.FC = () => {
},
{
title: '考试时长',
+ width: 80,
dataIndex: 'examination_time',
valueType: 'text',
sorter: false,
@@ -171,6 +172,7 @@ const ExaminationRules: React.FC = () => {
},
{
title: '试卷数量',
+ width: 80,
dataIndex: 'paper_count',
sorter: false,
valueType: 'text',
@@ -181,6 +183,7 @@ const ExaminationRules: React.FC = () => {
},
{
title: '总分',
+ width: 50,
dataIndex: 'sum_score',
sorter: false,
valueType: 'text',
@@ -190,6 +193,7 @@ const ExaminationRules: React.FC = () => {
},
{
title: '通过线',
+ width: 60,
dataIndex: 'pass_score',
sorter: false,
valueType: 'text',
@@ -201,6 +205,7 @@ const ExaminationRules: React.FC = () => {
title: '操作',
dataIndex: 'option',
valueType: 'option',
+ width: 100,
render: (_dom: any, record: React.SetStateAction) => {
console.log(record, 'record')
return [
diff --git a/admin/src/pages/examinationrules/normal/index.tsx b/admin/src/pages/examinationrules/normal/index.tsx
index b1237af..867a9ef 100644
--- a/admin/src/pages/examinationrules/normal/index.tsx
+++ b/admin/src/pages/examinationrules/normal/index.tsx
@@ -167,6 +167,7 @@ const ExaminationRules: React.FC = () => {
title: '操作',
dataIndex: 'option',
valueType: 'option',
+ width: 160,
render: (_dom: any, record: React.SetStateAction) => {
return [
// {
}}
formProps={{
layout: "horizontal",
- labelCol: { span: 8 },
+ labelCol: { span: 7 },
wrapperCol: { span: 12 },
validateMessages: {
required: '此项为必填项',
@@ -266,7 +258,7 @@ export default () => {
{
/>
{
return querySubjectList().then(({ data }) => {
@@ -306,8 +298,23 @@ export default () => {
name="subject_id"
label="关联主题"
/>
- {
+ const val = `${e.currentTarget?.value}`;
+ if(val.length > 3) {
+ e.currentTarget.value = val.slice(0,3)
+ }
+ }
+ //style:{width: '100%'}
+ }}
initialValue={ruleData?.examination_time}
rules={[
{
@@ -318,7 +325,7 @@ export default () => {
pattern: /^[^\s]*$/,
message: '禁止输入空格'
}]}
- tooltip="单位(分钟)" />
+ />
>
)}
@@ -344,6 +351,7 @@ export default () => {
}}
>
+
{rulesName}
{/** 一旦录入另一项将禁用,清空组卷后可选另一项 */}
{
@@ -358,7 +366,7 @@ export default () => {
-
+
{
sorter: false,
hideInTable: true,
hideInForm: false,
- hideInSearch: false,
+ hideInSearch: true,
fieldProps: {
mode: "multiple"
},
@@ -136,7 +136,11 @@ const QuestionBank = () => {
},
]
},
- renderText: (val: string) => `${val}`,
+ /*
+ renderFormItem:(item,{ type, defaultRender, formItemProps, fieldProps, ...rest },form)=>{
+ return defaultRender
+ },*/
+ //renderText: (val: string) => `${val}`,
request: async () => {
const { data: Items } = await queryTagList({});
console.log('queryTagList...')
@@ -155,7 +159,7 @@ const QuestionBank = () => {
sorter: false,
hideInTable: false,
hideInForm: false,
- hideInSearch: false,
+ hideInSearch: true,
fieldProps: {
//mode: "multiple"
},
@@ -188,7 +192,7 @@ const QuestionBank = () => {
hideInTable: false,
hideInDescriptions: false,
hideInForm: false,
- hideInSearch: false,
+ hideInSearch: true,
formItemProps: {
rules: [
{
@@ -302,19 +306,7 @@ const QuestionBank = () => {
/>
),
},
- {
- title: '创建时间',
- dataIndex: 'create_time',
- valueType: 'text',
- sorter: false,
- hideInTable: true,
- hideInForm: true,
- hideInSearch: false,
- // renderText: (val: string) => (),
- renderFormItem: (item, { defaultRender, ...rest }, form) => (
-<>>
- ),
- },
+
]
@@ -351,7 +343,9 @@ const QuestionBank = () => {
showSizeChanger: false,
showQuickJumper: true
}}
- search={{}}
+ search={{
+ labelWidth: 120,
+ }}
toolBarRender={() => {
const menuItems = [];
console.log('toolBarRender', questionType);
@@ -487,10 +481,14 @@ const QuestionBank = () => {
showExtra="always"
metas={{
title: {
+ title: '题干',
+ search: false,
dataIndex: 'question_stem',
render: (text: React.ReactNode, record: T, index: number) => (<>{record?.id} {text}>),
},
avatar: {
+ title: '题型',
+ search: false,
dataIndex: 'question_type',
valueType: 'text',
render: (text: React.ReactNode, record: T, index: number) => {
@@ -506,6 +504,7 @@ const QuestionBank = () => {
},
},
description: {
+ search: false,
dataIndex: 'answers',
valueType: 'checkbox',
render: (text: React.ReactNode, record: T, index: number) => {
@@ -528,8 +527,11 @@ const QuestionBank = () => {
);
},
},
- subTitle: { },
+ subTitle: {
+ search: false
+ },
content: {
+ search: false,
render: (text: React.ReactNode, record: T, index: number) => {
let answer = '';
const answertrue = record?.answertrue?.split(',');
@@ -567,6 +569,7 @@ const QuestionBank = () => {
},
},
actions: {
+ search: false,
cardActionProps: 'extra',
render: (text: React.ReactNode, record: T, _index: number) => {
let eye
@@ -638,6 +641,75 @@ const QuestionBank = () => {
)
}
},
+ /** 搜索定义 */
+ question_type:{
+ title: '题型',
+ valueType: 'select',
+ search: true,
+ dataIndex: 'question_type',
+ request: async () => {
+ const { list: Items } = await queryQuestionType();
+ console.log('queryQuestionType...', Items)
+ const types = []
+ for (let i = 0; i < Items.length; i++) {
+ types.push({ label: Items[i]?.name, value: Items[i]?.code })
+ }
+ console.log(types, 'types:::');
+ return types;
+ },
+ },
+ tags: {
+ title: '标签',
+ search: true,
+ valueType: 'select',
+ dataIndex: 'tag_ids',
+ fieldProps: {
+ mode: "multiple"
+ },
+ request: async () => {
+ const { data: Items } = await queryTagList({});
+ console.log('queryTagList...')
+ const tags = []
+ for (let i = 0; i < Items.length; i++) {
+ tags.push({ label: Items[i]?.tag_name, value: Items[i]?.tag_id })
+ }
+ console.log(tags, 'tags:::');
+ return tags;
+ },
+ },
+ course_id: {
+ title: '课程',
+ search: true,
+ valueType: 'select',
+ dataIndex: 'course_id',
+ fieldProps: {
+ //mode: "multiple"
+ },
+ dependencies: ['tag_ids'],
+ request: async (params) => {
+ const {tag_ids} = params;
+ const { data: Items } = await queryCourseListByTag({tag_ids: tag_ids?.toString()});
+ console.log('queryCourseListByTag...')
+ const courses = []
+ for (let i = 0; i < Items?.length; i++) {
+ courses.push({ label: Items[i]?.course_name, value: Items[i]?.course_id })
+ }
+ console.log(courses, 'courses:::');
+ return courses;
+ }
+ },
+ question_stem: {
+ title: '搜索', // 题干
+ search: true,
+ dataIndex: 'question_stem',
+ valueType: 'text',
+ },
+ create_time: {
+ title: '创建时间',
+ search: true,
+ dataIndex: 'create_time',
+ valueType: 'dateRange',
+ },
}}
/>