|
@@ -27,8 +27,8 @@
|
|
|
highlight-current-row
|
|
|
@current-change="onCheckTask"
|
|
|
></base-table> -->
|
|
|
- <div class="table-wrap">
|
|
|
- <base-table
|
|
|
+ <div v-loading="loading1" class="table-wrap">
|
|
|
+ <!-- <base-table
|
|
|
ref="table1"
|
|
|
v-loading="loading1"
|
|
|
border
|
|
@@ -37,7 +37,16 @@
|
|
|
:columns="columns1"
|
|
|
:data="unMarkPaperList?.result"
|
|
|
@selection-change="handleSelectionChange1"
|
|
|
- ></base-table>
|
|
|
+ ></base-table> -->
|
|
|
+ <el-table-v2
|
|
|
+ :header-height="43"
|
|
|
+ :row-height="43"
|
|
|
+ :height="tableHeight"
|
|
|
+ :width="tableWidth"
|
|
|
+ :columns="columns1"
|
|
|
+ :data="unMarkPaperList ? unMarkPaperList.result : []"
|
|
|
+ fixed
|
|
|
+ ></el-table-v2>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="radius-base fill-blank p-base overflow-hidden m-l-base flex-1">
|
|
@@ -59,8 +68,8 @@
|
|
|
highlight-current-row
|
|
|
@current-change="onCheckTask2"
|
|
|
></base-table> -->
|
|
|
- <div class="table-wrap">
|
|
|
- <base-table
|
|
|
+ <div v-loading="loading4" class="table-wrap">
|
|
|
+ <!-- <base-table
|
|
|
ref="table2"
|
|
|
v-loading="loading4"
|
|
|
border
|
|
@@ -69,7 +78,16 @@
|
|
|
:columns="columns1"
|
|
|
:data="unMarkBackPaperList?.result"
|
|
|
@selection-change="handleSelectionChange2"
|
|
|
- ></base-table>
|
|
|
+ ></base-table> -->
|
|
|
+ <el-table-v2
|
|
|
+ :header-height="43"
|
|
|
+ :row-height="43"
|
|
|
+ :height="tableHeight"
|
|
|
+ :width="tableWidth"
|
|
|
+ :columns="columns11"
|
|
|
+ :data="unMarkBackPaperList ? unMarkBackPaperList.result : []"
|
|
|
+ fixed
|
|
|
+ ></el-table-v2>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="radius-base fill-blank p-base overflow-hidden m-l-base flex-1">
|
|
@@ -142,10 +160,10 @@
|
|
|
</base-dialog>
|
|
|
</template>
|
|
|
|
|
|
-<script setup lang="ts" name="EndCheck">
|
|
|
+<script setup lang="tsx" name="EndCheck">
|
|
|
/** 收尾检查 */
|
|
|
-import { reactive, ref, computed, watch } from 'vue'
|
|
|
-import { ElButton, ElMessage } from 'element-plus'
|
|
|
+import { reactive, ref, computed, watch, onMounted, onBeforeUnmount } from 'vue'
|
|
|
+import { ElButton, ElMessage, ElTableV2, ElCheckbox } from 'element-plus'
|
|
|
import BaseForm from '@/components/element/BaseForm.vue'
|
|
|
import BaseTable from '@/components/element/BaseTable.vue'
|
|
|
import BaseDialog from '@/components/element/BaseDialog.vue'
|
|
@@ -154,20 +172,72 @@ import useFetch from '@/hooks/useFetch'
|
|
|
import useOptions from '@/hooks/useOptions'
|
|
|
import useVW from '@/hooks/useVW'
|
|
|
import useForm from '@/hooks/useForm'
|
|
|
-
|
|
|
+import useMainLayoutStore from '@/store/layout'
|
|
|
import type { ExtractApiParams, ExtractMultipleApiResponse } from '@/api/api'
|
|
|
import type { EpFormItem, EpTableColumn, EpFormRules } from 'global-type'
|
|
|
|
|
|
-const table1 = ref()
|
|
|
-const table2 = ref()
|
|
|
-const multipleSelection1 = ref<any[]>([])
|
|
|
-const multipleSelection2 = ref<any[]>([])
|
|
|
-const handleSelectionChange1 = (val: any[]) => {
|
|
|
- multipleSelection1.value = val
|
|
|
+const SelectionCell: any = (obj: any) => {
|
|
|
+ const { value, intermediate = false, onChange } = obj
|
|
|
+ return <ElCheckbox onChange={onChange} modelValue={value} indeterminate={intermediate} />
|
|
|
}
|
|
|
-const handleSelectionChange2 = (val: any[]) => {
|
|
|
- multipleSelection2.value = val
|
|
|
+
|
|
|
+const mainLayout = useMainLayoutStore()
|
|
|
+// const table1 = ref()
|
|
|
+// const table2 = ref()
|
|
|
+let tableWidth = ref(1)
|
|
|
+let tableHeight = ref(window.innerHeight - 280)
|
|
|
+
|
|
|
+function setTableWidth() {
|
|
|
+ let winWidth = window.innerWidth > 1240 ? window.innerWidth : 1240
|
|
|
+ let leftWidth = mainLayout.collapse ? 220 : 0
|
|
|
+ tableWidth.value = parseInt((winWidth - leftWidth - 40) / 4 - 80 + '')
|
|
|
+ tableHeight.value = window.innerHeight - 280
|
|
|
+}
|
|
|
+// let tableWidth = computed(() => {
|
|
|
+// let winWidth = window.innerWidth
|
|
|
+// let leftWidth = mainLayout.collapse ? 220 : 0
|
|
|
+// return parseInt((winWidth - leftWidth - 40) / 4 - 80 + '')
|
|
|
+// })
|
|
|
+setTableWidth()
|
|
|
+watch(
|
|
|
+ () => mainLayout.collapse,
|
|
|
+ () => {
|
|
|
+ setTimeout(setTableWidth, 400)
|
|
|
+ }
|
|
|
+)
|
|
|
+function listenResize() {
|
|
|
+ setTableWidth()
|
|
|
}
|
|
|
+onMounted(() => {
|
|
|
+ window.addEventListener('resize', listenResize)
|
|
|
+})
|
|
|
+onBeforeUnmount(() => {
|
|
|
+ window.removeEventListener('resize', listenResize)
|
|
|
+})
|
|
|
+const multipleSelection1 = computed(() => {
|
|
|
+ if (unMarkPaperList.value?.result && unMarkPaperList.value?.result.length) {
|
|
|
+ return unMarkPaperList.value?.result.filter((item: any) => {
|
|
|
+ return !!item.checked
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ return []
|
|
|
+ }
|
|
|
+})
|
|
|
+const multipleSelection2 = computed(() => {
|
|
|
+ if (unMarkBackPaperList.value?.result && unMarkBackPaperList.value?.result.length) {
|
|
|
+ return unMarkBackPaperList.value?.result.filter((item: any) => {
|
|
|
+ return !!item.checked
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ return []
|
|
|
+ }
|
|
|
+})
|
|
|
+// const handleSelectionChange1 = (val: any[]) => {
|
|
|
+// multipleSelection1.value = val
|
|
|
+// }
|
|
|
+// const handleSelectionChange2 = (val: any[]) => {
|
|
|
+// multipleSelection2.value = val
|
|
|
+// }
|
|
|
|
|
|
/** 指定评卷员 */
|
|
|
const visibleChangeMarker = ref<boolean>(false)
|
|
@@ -254,18 +324,89 @@ const items = computed<EpFormItem[]>(() => [
|
|
|
])
|
|
|
|
|
|
/** 未评卷 table */
|
|
|
-const columns1: EpTableColumn[] = [
|
|
|
- { type: 'selection', width: 55 },
|
|
|
- {
|
|
|
- label: '评卷员',
|
|
|
- prop: 'markerName',
|
|
|
- formatter(row) {
|
|
|
- return `${row.loginName}-${row.markerName}`
|
|
|
+const columns1 = computed(() => {
|
|
|
+ const w = parseInt((tableWidth.value - 41) / 3 + '')
|
|
|
+
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ key: 'selection',
|
|
|
+ width: 40,
|
|
|
+ cellRenderer: (rowObj: any) => {
|
|
|
+ const { rowData } = rowObj
|
|
|
+ const onChange = (value: any) => (rowData.checked = value)
|
|
|
+ return <SelectionCell value={rowData.checked} onChange={onChange} />
|
|
|
+ },
|
|
|
+
|
|
|
+ headerCellRenderer: () => {
|
|
|
+ let data = unMarkPaperList.value ? unMarkPaperList.value.result : []
|
|
|
+ // const _data = unref(data)
|
|
|
+ const onChange = (value: any) =>
|
|
|
+ (data = data.map((row: any) => {
|
|
|
+ row.checked = value
|
|
|
+ return row
|
|
|
+ }))
|
|
|
+ const allSelected = !data.length ? false : data.every((row: any) => row.checked)
|
|
|
+ const containsChecked = !data.length ? false : data.some((row: any) => row.checked)
|
|
|
+
|
|
|
+ return <SelectionCell value={allSelected} intermediate={containsChecked && !allSelected} onChange={onChange} />
|
|
|
+ },
|
|
|
},
|
|
|
- },
|
|
|
- { label: '密号', prop: 'secretNumber' },
|
|
|
- { label: '大题', prop: 'questionMainName' },
|
|
|
-]
|
|
|
+ {
|
|
|
+ title: '评卷员',
|
|
|
+ key: 'markerName',
|
|
|
+ dataKey: 'markerName',
|
|
|
+ width: w,
|
|
|
+ // formatter(row: any) {
|
|
|
+ // return `${row.loginName}-${row.markerName}`
|
|
|
+ // },
|
|
|
+ },
|
|
|
+ { title: '密号', key: 'secretNumber', dataKey: 'secretNumber', width: w },
|
|
|
+ { title: '大题', key: 'questionMainName', dataKey: 'questionMainName', width: w + 1 },
|
|
|
+ ]
|
|
|
+})
|
|
|
+const columns11 = computed(() => {
|
|
|
+ const w = parseInt((tableWidth.value - 41) / 3 + '')
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ key: 'selection',
|
|
|
+ width: 40,
|
|
|
+ cellRenderer: (rowObj: any) => {
|
|
|
+ const { rowData } = rowObj
|
|
|
+ const onChange = (value: any) => (rowData.checked = value)
|
|
|
+ return <SelectionCell value={rowData.checked} onChange={onChange} />
|
|
|
+ },
|
|
|
+
|
|
|
+ headerCellRenderer: () => {
|
|
|
+ let data = unMarkBackPaperList.value ? unMarkBackPaperList.value.result : []
|
|
|
+ // const _data = unref(data)
|
|
|
+ const onChange = (value: any) =>
|
|
|
+ (data = data.map((row: any) => {
|
|
|
+ row.checked = value
|
|
|
+ return row
|
|
|
+ }))
|
|
|
+ const allSelected = !data.length ? false : data.every((row: any) => row.checked)
|
|
|
+ const containsChecked = !data.length ? false : data.some((row: any) => row.checked)
|
|
|
+
|
|
|
+ return <SelectionCell value={allSelected} intermediate={containsChecked && !allSelected} onChange={onChange} />
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '评卷员',
|
|
|
+ key: 'markerName',
|
|
|
+ dataKey: 'markerName',
|
|
|
+ width: w,
|
|
|
+ cellRenderer: (rowObj: any) => {
|
|
|
+ const { rowData } = rowObj
|
|
|
+ return <span>{`${rowData.loginName}-${rowData.markerName}`}</span>
|
|
|
+ },
|
|
|
+ // formatter(row: any) {
|
|
|
+ // return `${row.loginName}-${row.markerName}`
|
|
|
+ // },
|
|
|
+ },
|
|
|
+ { title: '密号', key: 'secretNumber', dataKey: 'secretNumber', width: w },
|
|
|
+ { title: '大题', key: 'questionMainName', dataKey: 'questionMainName', width: w + 1 },
|
|
|
+ ]
|
|
|
+})
|
|
|
/** 未处理问题卷table */
|
|
|
const columns2: EpTableColumn[] = [
|
|
|
{ label: '密号', prop: 'secretNumber' },
|