添加老师排序

This commit is contained in:
YuNan 2025-03-11 20:30:57 +08:00
parent 1416ffced7
commit 22a68dae35
3 changed files with 329 additions and 294 deletions

View File

@ -4,7 +4,7 @@ import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils'; import { render } from '/@/utils/common/renderUtils';
import { ref, onMounted, reactive } from 'vue'; import { ref, onMounted, reactive } from 'vue';
const groupOptions=ref() const groupOptions = ref();
// 创建一个简单的事件总线 // 创建一个简单的事件总线
export const updateGroupOptions = reactive({ export const updateGroupOptions = reactive({
updateGroupOptions(newOptions: any) { updateGroupOptions(newOptions: any) {
@ -17,34 +17,39 @@ export const columns: BasicColumn[] = [
{ {
title: '姓名', title: '姓名',
align: 'center', align: 'center',
sorter: true,
dataIndex: 'userName', dataIndex: 'userName',
}, },
{ {
title: '用户ID', title: '用户ID',
align: 'center', align: 'center',
sorter: true,
dataIndex: 'userId', dataIndex: 'userId',
}, },
{ {
title: '工号', title: '工号',
align: 'center', align: 'center',
sorter: true,
dataIndex: 'teacherId', dataIndex: 'teacherId',
}, },
{ {
title: '手机号', title: '手机号',
align: 'center', align: 'center',
sorter: true,
dataIndex: 'phone', dataIndex: 'phone',
}, },
{ {
title: '学科', title: '学科',
align: 'center', align: 'center',
dataIndex: 'majorId' sorter: true,
dataIndex: 'majorId',
}, },
{ {
title: '所属分组', title: '所属分组',
align: 'center', align: 'center',
//dataIndex: 'groupId', //dataIndex: 'groupId',
customRender: ({ text }) => { customRender: ({ text }) => {
const group = groupOptions.value.find(item => item.value === text.groupId); const group = groupOptions.value.find((item) => item.value === text.groupId);
if (group) { if (group) {
return group.label; return group.label;
} }
@ -54,6 +59,7 @@ export const columns: BasicColumn[] = [
{ {
title: '是否第一次阅卷', title: '是否第一次阅卷',
align: 'center', align: 'center',
sorter: true,
dataIndex: 'status', dataIndex: 'status',
}, },
//{ //{
@ -62,13 +68,11 @@ export const columns: BasicColumn[] = [
// dataIndex: 'userMajorId', // dataIndex: 'userMajorId',
//}, //},
//{ //{
// title: '使用次数', // title: '使用次数',
// align: 'center', // align: 'center',
// dataIndex: 'numberuse', // dataIndex: 'numberuse',
//}, //},
]; ];
//查询数据 //查询数据
export const searchFormSchema: FormSchema[] = [ export const searchFormSchema: FormSchema[] = [
@ -90,7 +94,7 @@ export const searchFormSchema: FormSchema[] = [
{ label: '政治', value: 8 }, { label: '政治', value: 8 },
], ],
}, },
} },
]; ];
//表单数据 //表单数据
export const formSchema: FormSchema[] = [ export const formSchema: FormSchema[] = [

View File

@ -18,41 +18,49 @@ export const columns: BasicColumn[] = [
{ {
title: '姓名', title: '姓名',
align: 'center', align: 'center',
sorter: true,
dataIndex: 'userName', dataIndex: 'userName',
}, },
{ {
title: '用户ID', title: '用户ID',
align: 'center', align: 'center',
sorter: true,
dataIndex: 'userId', dataIndex: 'userId',
}, },
{ {
title: '年龄', title: '年龄',
align: 'center', align: 'center',
sorter: true,
dataIndex: 'age', dataIndex: 'age',
}, },
{ {
title: '性别', title: '性别',
align: 'center', align: 'center',
sorter: true,
dataIndex: 'sex', dataIndex: 'sex',
}, },
{ {
title: '学科', title: '学科',
align: 'center', align: 'center',
dataIndex: 'majorId' sorter: true,
dataIndex: 'majorId',
}, },
{ {
title: '手机号', title: '手机号',
align: 'center', align: 'center',
sorter: true,
dataIndex: 'phone', dataIndex: 'phone',
}, },
{ {
title: '职称', title: '职称',
align: 'center', align: 'center',
sorter: true,
dataIndex: 'jobTitle', dataIndex: 'jobTitle',
}, },
{ {
title: '职务', title: '职务',
align: 'center', align: 'center',
sorter: true,
dataIndex: 'office', dataIndex: 'office',
}, },
{ {

View File

@ -1,8 +1,15 @@
<template> <template>
<div> <div>
<!--引用表格--> <!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection" ref="tableRef" :expandedRowKeys="expandedKeys" <BasicTable
rowKey="id" :expandedRowRender="renderExpandedRow" @expand="handleExpand"> @register="registerTable"
:rowSelection="rowSelection"
ref="tableRef"
:expandedRowKeys="expandedKeys"
rowKey="id"
:expandedRowRender="renderExpandedRow"
@expand="handleExpand"
>
<!--插槽:table标题--> <!--插槽:table标题-->
<template #tableTitle> <template #tableTitle>
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button> <a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
@ -17,7 +24,8 @@
</a-menu-item> </a-menu-item>
</a-menu> </a-menu>
</template> </template>
<a-button>批量操作 <a-button
>批量操作
<Icon icon="mdi:chevron-down" /> <Icon icon="mdi:chevron-down" />
</a-button> </a-button>
</a-dropdown> </a-dropdown>
@ -52,16 +60,21 @@
</span> </span>
<span v-if="column.dataIndex === 'dormitoryName'"> <span v-if="column.dataIndex === 'dormitoryName'">
<!-- 选择逻辑存在问题使placeholder没办法显示 --> <!-- 选择逻辑存在问题使placeholder没办法显示 -->
<a-select placeholder="请选择" size="small" style="width: 120px" v-model:value="record.dormitoryName" <a-select
:disabled="record.dormitoryId != null" @focus="handleFocus(record.sex, record)" placeholder="请选择"
@change="handleChange(record.userId, record.dormitoryName, record)" filterables> size="small"
style="width: 120px"
v-model:value="record.dormitoryName"
:disabled="record.dormitoryName != null"
@focus="handleFocus(record.sex, record)"
@change="handleChange(record.userId, record.dormitoryName, record)"
filterables
>
<template v-if="dormOptions.length === 0"> <template v-if="dormOptions.length === 0">
<a-option value="" label="加载中..." disabled /> <a-option value="" label="加载中..." disabled />
</template> </template>
<a-select-option v-for="item in dormOptions" :key="item.value" :label="item.label" :value="item.value">{{ <a-select-option v-for="item in dormOptions" :key="item.value" :label="item.label" :value="item.value">{{ item.label }}</a-select-option>
item.label
}}</a-select-option>
<template v-if="dormOptions.length === 0"> <template v-if="dormOptions.length === 0">
<a-option value="" label="暂无数据" disabled /> <a-option value="" label="暂无数据" disabled />
@ -82,7 +95,17 @@ import { useModal } from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage'; import { useListPage } from '/@/hooks/system/useListPage';
import CeesWaiTeacherModal from './components/CeesWaiTeacherModal.vue'; import CeesWaiTeacherModal from './components/CeesWaiTeacherModal.vue';
import { columns, searchFormSchema, superQuerySchema, updateGroupOptions } from './CeesWaiTeacher.data'; import { columns, searchFormSchema, superQuerySchema, updateGroupOptions } from './CeesWaiTeacher.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, getGroup, updateDormitory, cancelCheckIn, confirmCheckIn } from './CeesWaiTeacher.api'; import {
list,
deleteOne,
batchDelete,
getImportUrl,
getExportUrl,
getGroup,
updateDormitory,
cancelCheckIn,
confirmCheckIn,
} from './CeesWaiTeacher.api';
import { selectBySex } from '/@/views/cees/dormitory/CeesDormitoryInfo.api'; import { selectBySex } from '/@/views/cees/dormitory/CeesDormitoryInfo.api';
import { downloadFile } from '/@/utils/common/renderUtils'; import { downloadFile } from '/@/utils/common/renderUtils';
import { useUserStore } from '/@/store/modules/user'; import { useUserStore } from '/@/store/modules/user';
@ -340,9 +363,9 @@ async function handleFocus(sex, record) {
} }
// handleFocus // handleFocus
async function handleChange(userId, dormitory, record) { async function handleChange(userId, dormitory, record) {
console.log("userId", userId) console.log('userId', userId);
console.log("dormitory", dormitory) console.log('dormitory', dormitory);
console.log("record", record) console.log('record', record);
let params = { let params = {
id: userId, id: userId,
dormitory: dormitory, dormitory: dormitory,