添加老师排序
This commit is contained in:
parent
1416ffced7
commit
22a68dae35
|
@ -4,7 +4,7 @@ import { rules } from '/@/utils/helper/validator';
|
|||
import { render } from '/@/utils/common/renderUtils';
|
||||
import { ref, onMounted, reactive } from 'vue';
|
||||
|
||||
const groupOptions=ref()
|
||||
const groupOptions = ref();
|
||||
// 创建一个简单的事件总线
|
||||
export const updateGroupOptions = reactive({
|
||||
updateGroupOptions(newOptions: any) {
|
||||
|
@ -17,34 +17,39 @@ export const columns: BasicColumn[] = [
|
|||
{
|
||||
title: '姓名',
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
dataIndex: 'userName',
|
||||
},
|
||||
{
|
||||
title: '用户ID',
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
dataIndex: 'userId',
|
||||
},
|
||||
{
|
||||
title: '工号',
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
dataIndex: 'teacherId',
|
||||
},
|
||||
{
|
||||
title: '手机号',
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
dataIndex: 'phone',
|
||||
},
|
||||
{
|
||||
title: '学科',
|
||||
align: 'center',
|
||||
dataIndex: 'majorId'
|
||||
sorter: true,
|
||||
dataIndex: 'majorId',
|
||||
},
|
||||
{
|
||||
title: '所属分组',
|
||||
align: 'center',
|
||||
//dataIndex: 'groupId',
|
||||
customRender: ({ text }) => {
|
||||
const group = groupOptions.value.find(item => item.value === text.groupId);
|
||||
const group = groupOptions.value.find((item) => item.value === text.groupId);
|
||||
if (group) {
|
||||
return group.label;
|
||||
}
|
||||
|
@ -54,6 +59,7 @@ export const columns: BasicColumn[] = [
|
|||
{
|
||||
title: '是否第一次阅卷',
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
dataIndex: 'status',
|
||||
},
|
||||
//{
|
||||
|
@ -62,13 +68,11 @@ export const columns: BasicColumn[] = [
|
|||
// dataIndex: 'userMajorId',
|
||||
//},
|
||||
|
||||
|
||||
//{
|
||||
// title: '使用次数',
|
||||
// align: 'center',
|
||||
// dataIndex: 'numberuse',
|
||||
//},
|
||||
|
||||
];
|
||||
//查询数据
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
|
@ -90,7 +94,7 @@ export const searchFormSchema: FormSchema[] = [
|
|||
{ label: '政治', value: 8 },
|
||||
],
|
||||
},
|
||||
}
|
||||
},
|
||||
];
|
||||
//表单数据
|
||||
export const formSchema: FormSchema[] = [
|
||||
|
|
|
@ -18,41 +18,49 @@ export const columns: BasicColumn[] = [
|
|||
{
|
||||
title: '姓名',
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
dataIndex: 'userName',
|
||||
},
|
||||
{
|
||||
title: '用户ID',
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
dataIndex: 'userId',
|
||||
},
|
||||
{
|
||||
title: '年龄',
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
dataIndex: 'age',
|
||||
},
|
||||
{
|
||||
title: '性别',
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
dataIndex: 'sex',
|
||||
},
|
||||
{
|
||||
title: '学科',
|
||||
align: 'center',
|
||||
dataIndex: 'majorId'
|
||||
sorter: true,
|
||||
dataIndex: 'majorId',
|
||||
},
|
||||
{
|
||||
title: '手机号',
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
dataIndex: 'phone',
|
||||
},
|
||||
{
|
||||
title: '职称',
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
dataIndex: 'jobTitle',
|
||||
},
|
||||
{
|
||||
title: '职务',
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
dataIndex: 'office',
|
||||
},
|
||||
{
|
||||
|
|
|
@ -1,8 +1,15 @@
|
|||
<template>
|
||||
<div>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection" ref="tableRef" :expandedRowKeys="expandedKeys"
|
||||
rowKey="id" :expandedRowRender="renderExpandedRow" @expand="handleExpand">
|
||||
<BasicTable
|
||||
@register="registerTable"
|
||||
:rowSelection="rowSelection"
|
||||
ref="tableRef"
|
||||
:expandedRowKeys="expandedKeys"
|
||||
rowKey="id"
|
||||
:expandedRowRender="renderExpandedRow"
|
||||
@expand="handleExpand"
|
||||
>
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||
|
@ -17,7 +24,8 @@
|
|||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button>批量操作
|
||||
<a-button
|
||||
>批量操作
|
||||
<Icon icon="mdi:chevron-down" />
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
|
@ -52,16 +60,21 @@
|
|||
</span>
|
||||
<span v-if="column.dataIndex === 'dormitoryName'">
|
||||
<!-- 选择逻辑存在问题使placeholder没办法显示 -->
|
||||
<a-select placeholder="请选择" size="small" style="width: 120px" v-model:value="record.dormitoryName"
|
||||
:disabled="record.dormitoryId != null" @focus="handleFocus(record.sex, record)"
|
||||
@change="handleChange(record.userId, record.dormitoryName, record)" filterables>
|
||||
<a-select
|
||||
placeholder="请选择"
|
||||
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">
|
||||
<a-option value="" label="加载中..." disabled />
|
||||
</template>
|
||||
|
||||
<a-select-option v-for="item in dormOptions" :key="item.value" :label="item.label" :value="item.value">{{
|
||||
item.label
|
||||
}}</a-select-option>
|
||||
<a-select-option v-for="item in dormOptions" :key="item.value" :label="item.label" :value="item.value">{{ item.label }}</a-select-option>
|
||||
|
||||
<template v-if="dormOptions.length === 0">
|
||||
<a-option value="" label="暂无数据" disabled />
|
||||
|
@ -82,7 +95,17 @@ import { useModal } from '/@/components/Modal';
|
|||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import CeesWaiTeacherModal from './components/CeesWaiTeacherModal.vue';
|
||||
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 { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
|
@ -340,9 +363,9 @@ async function handleFocus(sex, record) {
|
|||
}
|
||||
// 定义 handleFocus 函数
|
||||
async function handleChange(userId, dormitory, record) {
|
||||
console.log("userId", userId)
|
||||
console.log("dormitory", dormitory)
|
||||
console.log("record", record)
|
||||
console.log('userId', userId);
|
||||
console.log('dormitory', dormitory);
|
||||
console.log('record', record);
|
||||
let params = {
|
||||
id: userId,
|
||||
dormitory: dormitory,
|
||||
|
|
Loading…
Reference in New Issue