|
@@ -5,13 +5,15 @@
|
|
>
|
|
>
|
|
<base-dialog v-model="modalVisible" title="选择评卷员" :width="600" class="marker-dialog">
|
|
<base-dialog v-model="modalVisible" title="选择评卷员" :width="600" class="marker-dialog">
|
|
<vxe-table
|
|
<vxe-table
|
|
|
|
+ size="small"
|
|
|
|
+ show-overflow
|
|
:max-height="tableMaxHeight"
|
|
:max-height="tableMaxHeight"
|
|
- :column-config="{ resizable: true }"
|
|
|
|
- :tree-config="{ childrenField: 'markers', rowField: 'id', expandAll: true }"
|
|
|
|
|
|
+ :tree-config="{ childrenField: 'markers', rowField: 'id', expandAll: true, transform: true }"
|
|
:data="tableData"
|
|
:data="tableData"
|
|
:checkbox-config="{ highlight: false }"
|
|
:checkbox-config="{ highlight: false }"
|
|
- :scroll-y="{ enabled: true }"
|
|
|
|
|
|
+ :scroll-y="{ enabled: true, gt: 40 }"
|
|
@checkbox-change="selectChangeEvent"
|
|
@checkbox-change="selectChangeEvent"
|
|
|
|
+ @checkbox-all="selectChangeEvent"
|
|
>
|
|
>
|
|
<vxe-column type="checkbox" title="ID" width="280" tree-node></vxe-column>
|
|
<vxe-column type="checkbox" title="ID" width="280" tree-node></vxe-column>
|
|
<vxe-column field="showName" title="姓名"></vxe-column>
|
|
<vxe-column field="showName" title="姓名"></vxe-column>
|
|
@@ -43,15 +45,37 @@ const tableMaxHeight = window.innerHeight - 150 + 'px'
|
|
const modalVisible = ref(false)
|
|
const modalVisible = ref(false)
|
|
const { fetch: fetchMarkers, result } = useFetch('adminGetMarkers')
|
|
const { fetch: fetchMarkers, result } = useFetch('adminGetMarkers')
|
|
const tableData = computed(() => {
|
|
const tableData = computed(() => {
|
|
- return (result.value || []).map((item: any) => {
|
|
|
|
|
|
+ let arr = []
|
|
|
|
+ let res = result.value || []
|
|
|
|
+ for (let i = 0; i < res.length; i++) {
|
|
|
|
+ let item = res[i]
|
|
|
|
+ item.id = '_' + item.markingGroupNumber
|
|
item.showName = `第${item.markingGroupNumber}组`
|
|
item.showName = `第${item.markingGroupNumber}组`
|
|
- !item.id && (item.id = '_' + item.markingGroupNumber)
|
|
|
|
- item.markers = (item.markers || []).map((v: any) => {
|
|
|
|
- v.showName = v.loginName + '-' + v.name
|
|
|
|
- return v
|
|
|
|
- })
|
|
|
|
- return item
|
|
|
|
- })
|
|
|
|
|
|
+ item.parentId = null
|
|
|
|
+ arr.push({ ...item })
|
|
|
|
+ let children = item.markers || []
|
|
|
|
+ for (let j = 0; j < children.length; j++) {
|
|
|
|
+ let child = children[j]
|
|
|
|
+ let v = { id: child.id + '', parentId: item.id, showName: child.loginName + '-' + child.name }
|
|
|
|
+ arr.push({ ...v })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return arr
|
|
|
|
+ //以下为大数据量下的测试代码,经验证不卡顿
|
|
|
|
+ // let arr = result.value || []
|
|
|
|
+ // let arr2 = []
|
|
|
|
+ // for (let i = 0; i < 10000; i++) {
|
|
|
|
+ // let item = JSON.parse(JSON.stringify(arr[0]))
|
|
|
|
+ // item.id = Math.random() + ''
|
|
|
|
+ // item.parentId = null
|
|
|
|
+ // item.showName = '组组组'
|
|
|
|
+ // arr2.push({ ...item })
|
|
|
|
+ // for (let j = 0; j < item.markers.length; j++) {
|
|
|
|
+ // let v = { id: Math.random(), parentId: item.id, showName: item.markers[j].loginName + '-' + item.markers[j].name }
|
|
|
|
+ // arr2.push({ ...v })
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // return arr2
|
|
})
|
|
})
|
|
const props = defineProps<{
|
|
const props = defineProps<{
|
|
subjectCode: string | number | undefined
|
|
subjectCode: string | number | undefined
|
|
@@ -69,6 +93,7 @@ const selectChangeEvent: VxeTableEvents.CheckboxChange<any> = ({ $table }) => {
|
|
console.info(`勾选${records.length}个树形节点`, records)
|
|
console.info(`勾选${records.length}个树形节点`, records)
|
|
chooseResult.value = records.filter((item) => !!item.loginName)
|
|
chooseResult.value = records.filter((item) => !!item.loginName)
|
|
}
|
|
}
|
|
|
|
+
|
|
const confirm = () => {
|
|
const confirm = () => {
|
|
confirmResult.value = cloneDeep(chooseResult.value)
|
|
confirmResult.value = cloneDeep(chooseResult.value)
|
|
emits('user-list', [...confirmResult.value])
|
|
emits('user-list', [...confirmResult.value])
|