diff --git a/src/views/kc/detection/KcDetectionMain.data.ts b/src/views/kc/detection/KcDetectionMain.data.ts index 8d11641..914e0e3 100644 --- a/src/views/kc/detection/KcDetectionMain.data.ts +++ b/src/views/kc/detection/KcDetectionMain.data.ts @@ -1,7 +1,10 @@ +import { h } from 'vue'; +import { Input } from 'ant-design-vue'; import { BasicColumn } from '/@/components/Table'; import { FormSchema } from '/@/components/Table'; import { rules } from '/@/utils/helper/validator'; import { render } from '/@/utils/common/renderUtils'; + //列表数据 export const columns: BasicColumn[] = [ { @@ -9,32 +12,42 @@ export const columns: BasicColumn[] = [ align: "center", dataIndex: 'xnxq' }, + { + title: '授课日期', + align: "center", + dataIndex: 'createTime' + }, { title: '课程名称', align: "center", dataIndex: 'kcmc' }, + { + title: '节次', + align: "center", + dataIndex: ['ketangbiaoInfo', 'hh'] + }, - { - title: '任务编号', - align: "center", - dataIndex: 'rwbh' - }, - { - title: '课程编号', - align: "center", - dataIndex: 'kcbh' - }, - { - title: '教室编号', - align: "center", - dataIndex: 'jsbh' - }, - { - title: '检测url', - align: "center", - dataIndex: 'detectionUrl' - }, + // { + // title: '任务编号', + // align: "center", + // dataIndex: 'rwbh', + // }, + // { + // title: '课程编号', + // align: "center", + // dataIndex: 'kcbh' + // }, + // { + // title: '教室编号', + // align: "center", + // dataIndex: 'jsbh' + // }, + // { + // title: '检测url', + // align: "center", + // dataIndex: 'detectionUrl' + // }, { title: '检测次数', align: "center", @@ -50,6 +63,32 @@ export const columns: BasicColumn[] = [ align: "center", dataIndex: 'averageNum', }, + { + title: '选课人数', + align: "center", + dataIndex: ['ketangbiaoInfo', 'xkrs'], + }, + { + title: '出勤率', + align: "center", + dataIndex: 'averageNum', + customRender: ({ record }) => { + let { ketangbiaoInfo, averageNum } = record; + let { xkrs } = ketangbiaoInfo; + 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 ''; + } + } + } + }, + // { // title: 'A', // align: "center", @@ -65,13 +104,13 @@ export const searchFormSchema: FormSchema[] = [ //表单数据 export const formSchema: FormSchema[] = [ { - label: '任务编号', - field: 'rwbh', + label: '学年学期', + field: 'xnxq', component: 'Input', }, { - label: '课程编号', - field: 'kcbh', + label: '授课日期', + field: 'createTime', component: 'Input', }, { @@ -79,20 +118,38 @@ export const formSchema: FormSchema[] = [ field: 'kcmc', component: 'Input', }, + { + label: '节次', + field: 'ketangbiaoInfo', + component: 'Input', + render: ({ values }) => { + let text = values?.ketangbiaoInfo?.hh; + return h(Input, { value: text, disabled: true }); + } + }, + { + label: '任务编号', + field: 'rwbh', + component: 'Input', + show: false, + }, + { + label: '课程编号', + field: 'kcbh', + component: 'Input', + show: false, + }, { label: '教室编号', field: 'jsbh', component: 'Input', - }, - { - label: '学年学期', - field: 'xnxq', - component: 'Input', + show: false, }, { label: '检测url', field: 'detectionUrl', component: 'Input', + show: false, }, { label: '检测次数', @@ -109,6 +166,37 @@ export const formSchema: FormSchema[] = [ field: 'averageNum', component: 'InputNumber', }, + { + label: '选课人数', + field: 'xkrs', + component: "Input", + render: ({ values }) => { + let text = values?.ketangbiaoInfo?.xkrs; + return h(Input, { value: text, disabled: true }); + } + + }, + { + label: '出勤率', + field: 'averageNum', + component: "Input", + render: ({ values }) => { + let text = ''; + let { ketangbiaoInfo, averageNum } = values??{}; + let { xkrs } = ketangbiaoInfo??{}; + let xkrsNum = Number(xkrs); + if(!isNaN(xkrsNum) && xkrsNum != 0 && averageNum != 0) { + let num = averageNum / xkrsNum * 100; + text = num.toFixed(2) + '%'; + }else{ + if(averageNum == 0){ + text ='0.00' + '%'; + } + } + return h(Input, { value: text, disabled: true }); + }, + }, + { label: '', field: 'detectionDetailedList', @@ -168,6 +256,11 @@ export const detectionDetailedListColumns: BasicColumn[] = [ // align: "center", // dataIndex: 'jsbh' // }, + { + title: '检测序号', + align: "center", + dataIndex: 'detectionNum' + }, { title: '截取图片', align: "center", @@ -175,20 +268,21 @@ export const detectionDetailedListColumns: BasicColumn[] = [ slots: { customRender: 'imgSlot' }, }, { - title: '检测序号', + title: '检测时间', align: "center", - dataIndex: 'detectionNum' + dataIndex: 'createTime' }, { title: '人数', align: "center", dataIndex: 'num' }, - { - title: '人数计算结果', - align: "center", - dataIndex: 'detectionOutImgRes' - }, // { + // { + // title: '人数计算结果', + // align: "center", + // dataIndex: 'detectionOutImgRes' + // }, + // { // title: 'A', // align: "center", // dataIndex: ['ketangbiaoInfo', 'kcmc'], diff --git a/src/views/kc/detection/components/KcDetectionMainModal.vue b/src/views/kc/detection/components/KcDetectionMainModal.vue index 18fbd74..22372f6 100644 --- a/src/views/kc/detection/components/KcDetectionMainModal.vue +++ b/src/views/kc/detection/components/KcDetectionMainModal.vue @@ -6,7 +6,7 @@