From 9a6cee214ccbba90c3421a775adca8c569a0648d Mon Sep 17 00:00:00 2001 From: bai <1643359946@qq.com> Date: Sat, 25 May 2024 18:50:53 +0800 Subject: [PATCH] =?UTF-8?q?2024=E5=B9=B45=E6=9C=8825=E6=97=A5=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kc/detection/KcDetectionMain.data.ts | 86 ++- .../components/KcDetectionMainModal.vue | 23 +- src/views/kc/detection/zyZhjsList.vue | 87 ++- src/views/zy/jiaoXueDanYuanNeiRong/index2.vue | 321 +++++---- .../jiaoXueDanYuanNeiRong/index2.vue.allSave | 663 ++++++++++++++++++ .../zy/jiaoXueDanYuanNeiRong/stuIndex.vue | 13 +- 6 files changed, 1005 insertions(+), 188 deletions(-) create mode 100644 src/views/zy/jiaoXueDanYuanNeiRong/index2.vue.allSave diff --git a/src/views/kc/detection/KcDetectionMain.data.ts b/src/views/kc/detection/KcDetectionMain.data.ts index 914e0e3..effc533 100644 --- a/src/views/kc/detection/KcDetectionMain.data.ts +++ b/src/views/kc/detection/KcDetectionMain.data.ts @@ -12,21 +12,26 @@ export const columns: BasicColumn[] = [ align: "center", dataIndex: 'xnxq' }, - { - title: '授课日期', - align: "center", - dataIndex: 'createTime' - }, { title: '课程名称', align: "center", dataIndex: 'kcmc' }, { - title: '节次', + title: '授课日期', + align: "center", + dataIndex: ['ketangbiaoInfo', 'skrq'] + }, + { + title: '授课节次', align: "center", dataIndex: ['ketangbiaoInfo', 'hh'] }, + { + title: '选课人数', + align: "center", + dataIndex: ['ketangbiaoInfo', 'xkrs'], + }, // { // title: '任务编号', @@ -49,25 +54,20 @@ export const columns: BasicColumn[] = [ // dataIndex: 'detectionUrl' // }, { - title: '检测次数', + title: '抓取次数', align: "center", dataIndex: 'detectionNum' }, { - title: '人数(累加)', + title: '累计抓取人数', align: "center", dataIndex: 'allNum' }, { - title: '平均数', + title: '平均抓取人数', align: "center", dataIndex: 'averageNum', }, - { - title: '选课人数', - align: "center", - dataIndex: ['ketangbiaoInfo', 'xkrs'], - }, { title: '出勤率', align: "center", @@ -108,18 +108,22 @@ export const formSchema: FormSchema[] = [ field: 'xnxq', component: 'Input', }, - { - label: '授课日期', - field: 'createTime', - component: 'Input', - }, { label: '课程名称', field: 'kcmc', component: 'Input', }, { - label: '节次', + label: '授课日期', + field: 'createTime', + component: 'Input', + render: ({ values }) => { + let text = values?.ketangbiaoInfo?.skrq; + return h(Input, { value: text, disabled: true }); + } + }, + { + label: '授课节次', field: 'ketangbiaoInfo', component: 'Input', render: ({ values }) => { @@ -152,17 +156,17 @@ export const formSchema: FormSchema[] = [ show: false, }, { - label: '检测次数', + label: '抓取次数', field: 'detectionNum', component: 'InputNumber', }, { - label: '人数(累加)', + label: '累计抓取人数', field: 'allNum', component: 'InputNumber', }, { - label: '平均数', + label: '平均抓取人数', field: 'averageNum', component: 'InputNumber', }, @@ -257,26 +261,52 @@ export const detectionDetailedListColumns: BasicColumn[] = [ // dataIndex: 'jsbh' // }, { - title: '检测序号', + title: '序号', align: "center", - dataIndex: 'detectionNum' + dataIndex: 'detectionNum', + customRender: ({ index }) => { + return index+1; + }, + }, + // { + // title: '序号', + // align: "center", + // dataIndex: 'detectionNum', + // }, + { + title: '授课地点', + align: "center", + dataIndex: 'none1', + slots: { customRender: 'skkd' }, }, { - title: '截取图片', + title: '抓取图片', align: "center", dataIndex: 'detectionOutImgUrl', slots: { customRender: 'imgSlot' }, }, { - title: '检测时间', + title: '抓取时间', align: "center", dataIndex: 'createTime' }, { - title: '人数', + title: '选课人数', + align: "center", + dataIndex: 'none2', + slots: { customRender: 'xkrs' }, + }, + { + title: 'AI识别人数', align: "center", dataIndex: 'num' }, + { + title: '到课识别率', + align: "center", + dataIndex: 'none3', + slots: { customRender: 'dksbl' }, + }, // { // title: '人数计算结果', // align: "center", diff --git a/src/views/kc/detection/components/KcDetectionMainModal.vue b/src/views/kc/detection/components/KcDetectionMainModal.vue index 22372f6..5f03b6f 100644 --- a/src/views/kc/detection/components/KcDetectionMainModal.vue +++ b/src/views/kc/detection/components/KcDetectionMainModal.vue @@ -8,6 +8,9 @@ 无图片 + + + @@ -27,7 +30,7 @@ import { saveOrUpdate } from '../KcDetectionMain.api'; const emit = defineEmits(['register', 'success']); const isUpdate = ref(true); //表单配置 -const [registerForm, { setProps, resetFields, setFieldsValue, validate }] = useForm({ +const [registerForm, { setProps, getFieldsValue, resetFields, setFieldsValue, validate }] = useForm({ //labelWidth: 150, schemas: formSchema, showActionButtonGroup: false, @@ -49,7 +52,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data setProps({ disabled: !data?.showFooter }) }); //设置标题 -const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑')); +const title = computed(() => '查看'); //表单提交事件 async function handleSubmit(v) { try { @@ -66,6 +69,22 @@ async function handleSubmit(v) { } } +function calcAverageNum(record){ + let xkrs = getFieldsValue('ketangbiaoInfo')?.ketangbiaoInfo?.xkrs; + let { num: averageNum } = record; + let xkrsNum = Number(xkrs); + if(!isNaN(xkrsNum) && xkrsNum != 0 && averageNum != 0) { + let num = averageNum / xkrsNum * 100; + return num.toFixed(2) + '%'; + }else{ + if(averageNum == 0){ + return '0.00' + '%'; + }else{ + return ''; + } + } +} + /** * 获取预览图片 */ diff --git a/src/views/kc/detection/zyZhjsList.vue b/src/views/kc/detection/zyZhjsList.vue index 5a257a4..f190367 100644 --- a/src/views/kc/detection/zyZhjsList.vue +++ b/src/views/kc/detection/zyZhjsList.vue @@ -1,10 +1,40 @@ -
+
视频
文档
@@ -97,76 +97,12 @@ {{ three.title }} - + + - - - - - -
-
- -
-
- - - - -
-
-
@@ -220,7 +156,7 @@ import { defHttp } from '/@/utils/http/axios'; import { useMessage } from "/@/hooks/web/useMessage"; import { useRouter } from 'vue-router'; - import { randomString, simpleDebounce } from '/@/utils/common/compUtils' + import { randomString, simpleDebounce, getFileAccessHttpUrl } from '/@/utils/common/compUtils' import draggable from 'vuedraggable'; import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue'; @@ -270,16 +206,41 @@ }); enum Api { - list = '/teachingunitcontent/kcTeachingUnitContentOne/allList', - edit = '/teachingunitcontent/kcTeachingUnitContentOne/edit', -} + list = '/teachingunitcontent/kcTeachingUnitContentOne/allList', + editAll = '/teachingunitcontent/kcTeachingUnitContentOne/editAll', + + addOne = '/teachingunitcontent/kcTeachingUnitContentOne/add', + editOne = '/teachingunitcontent/kcTeachingUnitContentOne/edit', + delOne = '/teachingunitcontent/kcTeachingUnitContentOne/delete', + + addTwo = '/teachingunitcontent/kcTeachingUnitContentTwo/add', + editTwo = '/teachingunitcontent/kcTeachingUnitContentTwo/edit', + delTwo = '/teachingunitcontent/kcTeachingUnitContentTwo/delete', + + addThree = '/teachingunitcontent/kcTeachingUnitContentThree/add', + editThree = '/teachingunitcontent/kcTeachingUnitContentThree/edit', + delThree = '/teachingunitcontent/kcTeachingUnitContentThree/delete', + + } /** * 列表接口 * @param params */ const listAll = (params) => defHttp.get({ url: Api.list, params }); - const editAll = (params) => defHttp.post({ url: Api.edit, params }, { isTransformResponse: true }); + const editAll = (params) => defHttp.post({ url: Api.editAll, params }, { isTransformResponse: true }); + + const addOneFetch = (params) => defHttp.post({ url: Api.addOne, params }, { isTransformResponse: false }); + const editOneFetch = (params) => defHttp.put({ url: Api.editOne, params }, { isTransformResponse: false }); + const delOneFetch = (params) => defHttp.delete({ url: Api.delOne, params }, { isTransformResponse: false, joinParamsToUrl: true }); + + const addTwoFetch = (params) => defHttp.post({ url: Api.addTwo, params }, { isTransformResponse: false }); + const editTwoFetch = (params) => defHttp.put({ url: Api.editTwo, params }, { isTransformResponse: false }); + const delTwoFetch = (params) => defHttp.delete({ url: Api.delTwo, params }, { isTransformResponse: false, joinParamsToUrl: true }); + + const addThreeFetch = (params) => defHttp.post({ url: Api.addThree, params }, { isTransformResponse: false }); + const editThreeFetch = (params) => defHttp.put({ url: Api.editThree, params }, { isTransformResponse: false }); + const delThreeFetch = (params) => defHttp.delete({ url: Api.delThree, params }, { isTransformResponse: false, joinParamsToUrl: true }); function reload() { @@ -332,51 +293,6 @@ dataRecursion(dataSource.value, (x, i) => x.sort = i+1); } - //创建新的节点 - function createNoneData(){ - let data = { - //临时ID,兼容新增和修改 - _id: randomString(32), - title: null, - sort: 0, - childrenList: [], - } - return data; - } - - function stop(e) { - e?.stopPropagation(); - } - - function changeInput(e, pdata, key) { - let { target } = e; - let { value } = target; - pdata[key] = value; - } - - function addOne(){ - dataSource.value.push(createNoneData()); - createMessage.success('添加标题成功!'); - nextTick(() => { - refreshDataSort(); - }) - } - - function delOne(e, one){ - stop(e); - let index = dataSource.value.findIndex(x => x == one); - if(index == -1) return; - dataSource.value.splice(index, 1); - createMessage.success('删除标题成功!'); - nextTick(() => { - refreshDataSort(); - }) - } - - // function insertOne(index){ - // dataSource.value.splice(index,0, createNoneData()); - // } - //获取祖宗级对象 function getBtnEle(e, className){ if(e){ @@ -398,6 +314,74 @@ } } + //创建新的节点 + function createNoneData(){ + let data = { + //临时ID,兼容新增和修改 + _id: randomString(32), + rwbh, + xqxn, + title: null, + sort: 0, + childrenList: [], + } + return data; + } + + function stop(e) { + e?.stopPropagation(); + } + + function changeInput(e, pdata, key) { + let { target } = e; + let { value } = target; + pdata[key] = value; + } + + function addOne(){ + //调用后台保存(创建个新的) + let nowData = createNoneData(); + dataSource.value.push(nowData); + refreshDataSort(); + addOneFetch(nowData).then(res => { + if(res.success){ + nowData.id = res.result.id; + createMessage.success('添加标题成功!'); + // nextTick(() => { + // refreshDataSort(); + // }); + } + }); + } + + function editOne(one){ + editOneFetch(one).then(res => { + if(res.success){ + createMessage.success('修改标题成功!'); + } + }); + } + + function delOne(e, one){ + stop(e); + //删除 + delOneFetch({ id: one.id }).then(res => { + if(res.success){ + let index = dataSource.value.findIndex(x => x == one); + if(index == -1) return; + dataSource.value.splice(index, 1); + createMessage.success('删除标题成功!'); + nextTick(() => { + refreshDataSort(); + }) + } + }); + } + + // function insertOne(index){ + // dataSource.value.splice(index,0, createNoneData()); + // } + function addTwo(e, one){ let btn = getBtnEle(e.target, 'twoBtn'); if(btn == null){ @@ -418,27 +402,44 @@ }else{ stop(e); } + let nowData = createNoneData(); + nowData.pid = one.id; if(one.childrenList){ - one.childrenList.push(createNoneData()); + one.childrenList.push(nowData); }else{ - one.childrenList = [ createNoneData() ]; + one.childrenList = [ nowData ]; } + refreshDataSort(); + addTwoFetch(nowData).then(res => { + if(res.success){ + nowData.id = res.result.id; + createMessage.success('添加章节成功!'); + } + }); + } - createMessage.success('添加章节成功!'); - nextTick(() => { - refreshDataSort(); - }) + function editTwo(two){ + editTwoFetch(two).then(res => { + if(res.success){ + createMessage.success('修改章节成功!'); + } + }); } function delTwo(e, one, two){ stop(e); - let index = one.childrenList.findIndex(x => x == two); - if(index == -1) return; - one.childrenList.splice(index, 1); - createMessage.success('删除章节成功!'); - nextTick(() => { - refreshDataSort(); - }) + delTwoFetch({ id: two.id }).then(res => { + if(res.success){ + let index = one.childrenList.findIndex(x => x == two); + if(index == -1) return; + one.childrenList.splice(index, 1); + createMessage.success('删除章节成功!'); + nextTick(() => { + refreshDataSort(); + }) + } + }); + } // function insertTwo(one, index){ @@ -479,16 +480,24 @@ function delThree(e, two, three){ stop(e); - let index = two.childrenList.findIndex(x => x == three); - if(index == -1) return; - two.childrenList.splice(index, 1); + delThreeFetch({ id: three.id }).then(res => { + if(res.success){ + let index = two.childrenList.findIndex(x => x == three); + if(index == -1) return; + two.childrenList.splice(index, 1); - createMessage.success('删除成功!'); - nextTick(() => { - refreshDataSort(); - }) + createMessage.success('删除成功!'); + nextTick(() => { + refreshDataSort(); + }) + } + }); } + function downloadFile(three) { + let url = getFileAccessHttpUrl(three.filePath); + window.open(url,"_blank"); + } //移动结束时触发,如果未移动则不触发,刷新排序, function endDraggable(){ @@ -523,23 +532,32 @@ } } - if(!threeIndex){ + if(!threeIndex && threeIndex !== 0){ + three.pid = two.id; //新增 if(two.childrenList){ two.childrenList.push(three); }else{ two.childrenList = [ three ]; } - createMessage.success('新增成功!'); + refreshDataSort(); + addThreeFetch(three).then(res => { + if(res.success){ + three.id = res.result.id; + createMessage.success('添加成功!'); + } + }); }else{ //修改 two.childrenList[threeIndex] = three; - createMessage.success('修改成功!'); + refreshDataSort(); + editThreeFetch(three).then(res => { + if(res.success){ + createMessage.success('修改成功!'); + } + }); } - nextTick(() => { - refreshDataSort(); - }) threePageOpen.value = false; @@ -657,7 +675,14 @@ overflow: auto; } -:deep(.maxDiv) .ant-collapse-header{ - align-items: center; +:deep(.maxDiv){ + .ant-collapse-header{ + align-items: center; + padding-bottom: 0; + } + .ant-card-body { + padding-top: 0; + } } + diff --git a/src/views/zy/jiaoXueDanYuanNeiRong/index2.vue.allSave b/src/views/zy/jiaoXueDanYuanNeiRong/index2.vue.allSave new file mode 100644 index 0000000..4794734 --- /dev/null +++ b/src/views/zy/jiaoXueDanYuanNeiRong/index2.vue.allSave @@ -0,0 +1,663 @@ + + + + + diff --git a/src/views/zy/jiaoXueDanYuanNeiRong/stuIndex.vue b/src/views/zy/jiaoXueDanYuanNeiRong/stuIndex.vue index 7910352..e34c92d 100644 --- a/src/views/zy/jiaoXueDanYuanNeiRong/stuIndex.vue +++ b/src/views/zy/jiaoXueDanYuanNeiRong/stuIndex.vue @@ -75,7 +75,10 @@ {{ three.title }} - + + + + @@ -176,7 +179,7 @@ import { defHttp } from '/@/utils/http/axios'; import { useMessage } from "/@/hooks/web/useMessage"; import { useRouter } from 'vue-router'; - import { randomString, simpleDebounce } from '/@/utils/common/compUtils' + import { randomString, simpleDebounce, getFileAccessHttpUrl } from '/@/utils/common/compUtils' import draggable from 'vuedraggable'; import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue'; @@ -451,6 +454,12 @@ threePageOpen.value = false; } + function downloadFile(three) { + let url = getFileAccessHttpUrl(three.filePath); + window.open(url,"_blank"); + } + + //移动结束时触发,如果未移动则不触发,刷新排序, function endDraggable(){