@@ -35,6 +35,7 @@ export namespace SysUserPersonnel { | |||
userName?: string | number | undefined; | |||
majorId?: any; | |||
majorName?: any; | |||
teacherId?: any; | |||
} | |||
/** 人脸信息 */ | |||
export interface SysUserAvatar { | |||
@@ -4,7 +4,7 @@ | |||
* @Date: 2023-12-15 15:38:32 | |||
!--> | |||
<template> | |||
<el-select :placeholder="placeholder" :filterable="filterable" class="w-full" v-bind="$attrs" clearable> | |||
<el-select :placeholder="placeholder" :filterable="filterable" class="w-full" v-bind="$attrs" :clearable="clearable"> | |||
<el-option v-for="(item, index) in options" :key="index" :label="item[props.label]" :value="item[props.value]" /> | |||
</el-select> | |||
</template> | |||
@@ -21,7 +21,8 @@ const props = withDefaults(defineProps<SSelectProps>(), { | |||
value: "value", | |||
label: "label", | |||
button: false, | |||
filterable: false //是否可搜索 | |||
filterable: false, //是否可搜索 | |||
clearable: true //是否可清空 | |||
}); | |||
const placeholder = computed(() => { | |||
@@ -22,4 +22,5 @@ export interface SSelectProps { | |||
/** 选项值 */ | |||
value?: string; | |||
filterable?: boolean; | |||
clearable?: boolean; | |||
} |
@@ -15,7 +15,7 @@ | |||
label-width="auto" | |||
label-suffix=" :" | |||
> | |||
<s-form-item label="指定推送人" prop="userId"> | |||
<s-form-item label="指定人员" prop="userId"> | |||
<el-button link type="primary" @click="showSelector">选择</el-button> | |||
<el-tag v-if="liveUserProps.record.userId" class="ml-3px" type="warning" closable @close="removeDirector">{{ | |||
liveUserProps.record.userInfo?.name | |||
@@ -32,7 +32,7 @@ | |||
</template> | |||
<script setup lang="ts"> | |||
import { SysOrg, SysUser, sysOrgApi, sysPositionApi, sysRoleApi, sysUserApi, monitorLIVEApi } from "@/api"; | |||
import { SysOrg, SysUser, sysOrgApi, userManageTeacherApi, sysPositionApi, sysRoleApi, sysUserApi, monitorLIVEApi } from "@/api"; | |||
import { FormOptEnum, SysDictEnum } from "@/enums"; | |||
import { required } from "@/utils/formRules"; | |||
import { FormInstance } from "element-plus"; | |||
@@ -51,7 +51,7 @@ const liveUserProps = reactive<FormProps.Base<any>>({ | |||
// 表单验证规则 | |||
const rules = reactive({ | |||
userId: [required("请选择指定推送人")] | |||
userId: [required("请选择指定人")] | |||
}); | |||
/** | |||
@@ -98,7 +98,7 @@ async function handleSubmit() { | |||
.finally(() => { | |||
onClose(); | |||
}); | |||
} else { | |||
} else if (liveUserProps.opt == "视频推送人") { | |||
params.userId = liveUserProps.record.userId; | |||
params.ids.push(liveUserProps.record.id); | |||
//提交表单 | |||
@@ -111,6 +111,29 @@ async function handleSubmit() { | |||
onClose(); | |||
}); | |||
// delete params. | |||
} else if (liveUserProps.opt == "绑定班主任") { | |||
await userManageTeacherApi | |||
.add(liveUserProps.record) | |||
.then(() => { | |||
liveUserProps.successful!(); //调用父组件的successful方法 | |||
}) | |||
.finally(() => { | |||
onClose(); | |||
}); | |||
} else if (liveUserProps.opt == "修改班主任") { | |||
let params = { | |||
id: liveUserProps.record.teacherId, | |||
userId: liveUserProps.record.userId, | |||
personSetId: liveUserProps.record.personSetId | |||
}; | |||
await userManageTeacherApi | |||
.update(params) | |||
.then(() => { | |||
liveUserProps.successful!(); //调用父组件的successful方法 | |||
}) | |||
.finally(() => { | |||
onClose(); | |||
}); | |||
} | |||
// console.log(params); | |||
// return; | |||
@@ -396,6 +396,10 @@ async function onDelete(ids: string[], msg: string) { | |||
function RefreshTable() { | |||
proTable.value?.refresh(); | |||
} | |||
function RefreshTables() { | |||
proTable.value?.refresh(); | |||
getGroupList(); | |||
} | |||
// 表单引用 | |||
const formRef = ref<InstanceType<typeof Form> | null>(null); | |||
/** | |||
@@ -416,7 +420,7 @@ const userFormRef = ref<InstanceType<typeof Form> | null>(null); | |||
* @param record 记录 | |||
*/ | |||
function pushPerson(opt: FormOptEnum, record: {} | SysOrg.SysOrgInfo = {}) { | |||
userFormRef.value?.onOpen({ opt: opt, record: record, successful: RefreshTable }); | |||
userFormRef.value?.onOpen({ opt: opt, record: record, successful: RefreshTables }); | |||
} | |||
// 详情数据 | |||
// let detailData: globalThis.Ref<{}> | |||
@@ -35,13 +35,13 @@ | |||
<el-link type="primary" :underline="false" :icon="ArrowDown"> 更多 </el-link> | |||
<template #dropdown> | |||
<el-dropdown-menu> | |||
<el-dropdown-item v-if="!scope.row.userId" :command="commander(scope.row, cmdEnumTree.AddTeacher)"> | |||
<el-dropdown-item v-if="!scope.row.pushUserId" :command="commander(scope.row, cmdEnumTree.AddTeacher)"> | |||
{{ cmdEnumTree.AddTeacher }} | |||
</el-dropdown-item> | |||
<el-dropdown-item v-if="scope.row.userId" :command="commander(scope.row, cmdEnumTree.UpdateTeacher)"> | |||
<el-dropdown-item v-if="scope.row.pushUserId" :command="commander(scope.row, cmdEnumTree.UpdateTeacher)"> | |||
{{ cmdEnumTree.UpdateTeacher }} | |||
</el-dropdown-item> | |||
<el-dropdown-item v-if="scope.row.userId" :command="commander(scope.row, cmdEnumTree.DeleteTeacher)"> | |||
<el-dropdown-item v-if="scope.row.pushUserId" :command="commander(scope.row, cmdEnumTree.DeleteTeacher)"> | |||
{{ cmdEnumTree.DeleteTeacher }} | |||
</el-dropdown-item> | |||
</el-dropdown-menu> | |||
@@ -50,12 +50,12 @@ | |||
</el-space> | |||
</template> | |||
</ProTable> | |||
<!-- 人员选择 --> | |||
<userForm ref="userFormRef" /> | |||
</div> | |||
<!-- 班级新增/编辑表单 --> | |||
<FormClass ref="formRefC" /> | |||
<!-- 班主任绑定/修改 --> | |||
<FormTeacher ref="formRefT" /> | |||
</div> | |||
</template> | |||
<script setup lang="tsx" name="SysUserKeyPersonnel"> | |||
@@ -63,9 +63,9 @@ import { userManageClassManageApi,userManageTeacherApi,SysUserPersonnel,userMana | |||
import { useHandleData } from "@/hooks/useHandleData"; | |||
import { FormOptEnum } from "@/enums"; | |||
import FormClass from "./components/formClass/index.vue"; | |||
import FormTeacher from "./components/formTeacher/index.vue"; | |||
import { ArrowDown } from "@element-plus/icons-vue"; | |||
import { ColumnProps, ProTableInstance } from "@/components/ProTable/interface"; | |||
import userForm from "@/views/monitor/live/components/userForm.vue"; | |||
// 获取 ProTable 元素,调用其获取刷新数据方法(还能获取到当前查询参数,方便导出携带参数) | |||
const proTable = ref<ProTableInstance>(); | |||
const majorOptions = ref<any>([]) | |||
@@ -127,9 +127,6 @@ const columns: ColumnProps<SysUserPersonnel.ClassPage>[] = [ | |||
// 班级表单引用 | |||
const formRefC = ref<InstanceType<typeof FormClass> | null>(null); | |||
// 班级表单引用 | |||
const formRefT = ref<InstanceType<typeof FormTeacher> | null>(null); | |||
/** | |||
* 打开班级表单 | |||
@@ -184,20 +181,30 @@ function commander(row: SysUserPersonnel.ClassPage, commander: cmdEnumTree): Com | |||
async function handleCommandTree(commander: CommandTree) { | |||
switch (commander.commander) { | |||
case cmdEnumTree.AddTeacher: | |||
formRefT.value?.onOpen({ opt: commander.commander, record: commander.row, successful: RefreshTable }); | |||
pushPerson(cmdEnumTree.AddTeacher, commander.row) | |||
break | |||
case cmdEnumTree.UpdateTeacher: | |||
formRefT.value?.onOpen({ opt: commander.commander, record: commander.row, successful: RefreshTable }); | |||
pushPerson(cmdEnumTree.UpdateTeacher, commander.row) | |||
break; | |||
case cmdEnumTree.DeleteTeacher: | |||
// 二次确认 => 请求api => 刷新表格 | |||
await useHandleData(userManageTeacherApi.delete, {id: commander.row.userId}, '解绑教师'); | |||
await useHandleData(userManageTeacherApi.delete, {id: commander.row.teacherId}, '解绑教师'); | |||
RefreshTable(); //刷新表格 | |||
break; | |||
} | |||
} | |||
// 人员选择 | |||
// 表单引用 | |||
const userFormRef = ref<InstanceType<typeof userForm> | null>(null); | |||
/** | |||
* 打开表单 | |||
* @param opt 操作类型 | |||
* @param record 记录 | |||
*/ | |||
function pushPerson(opt: cmdEnumTree, record: {}) { | |||
userFormRef.value?.onOpen({ opt: opt, record: record, successful: RefreshTable }); | |||
} | |||
onMounted(() => { | |||
// 获取专业下拉数据 | |||
getMajorList(); | |||
@@ -5,13 +5,16 @@ | |||
--> | |||
<template> | |||
<div class="main-box"> | |||
<!-- :request-api="userManageClothApi.getList" --> | |||
<TreeFilter | |||
ref="treeFilter" | |||
label="clothSetName" | |||
id="clothSetId" | |||
width="300px" | |||
:show-all="true" | |||
:request-api="userManageClothApi.getList" | |||
:show-all="false" | |||
:isData="true" | |||
:data="treeData" | |||
:default-value="clothSetId" | |||
@change="changeTreeFilter" | |||
> | |||
<template v-slot:header> | |||
@@ -35,7 +38,7 @@ | |||
<ProTable ref="proTable" title="服装库管理" :columns="columns" rowKey="clothId" :data="tableData.clothes"> | |||
<!-- 表格 header 按钮 --> | |||
<template #tableHeader="scope"> | |||
<s-button suffix="服装" @click="onOpen(FormOptEnum.ADD, { clothSetId: clothSetId }, treeFilter.treeAllData)" /> | |||
<s-button suffix="服装" @click="onOpen(FormOptEnum.ADD, { clothSetId: clothSetId }, treeData)" /> | |||
<s-button | |||
type="danger" | |||
:opt="FormOptEnum.DELETE" | |||
@@ -87,6 +90,8 @@ const treeFilter = ref<any>({}); | |||
const userStore = useUserStore(); | |||
const { accessToken } = userStore; | |||
const tableData = ref<any>([]) | |||
// 初始化数据 | |||
const treeData = ref<any>([]); | |||
// 表格配置项 | |||
const columns: ColumnProps<SysUserCloth.list>[] = [ | |||
{ type: "selection", fixed: "left", width: 50 }, | |||
@@ -171,14 +176,17 @@ function changeTreeFilter(val: number | string) { | |||
} | |||
// 获取列表 | |||
const getList = (clothSetId:any)=>{ | |||
// if(!clothSetId) return false | |||
if(!clothSetId) return false | |||
userManageClothApi.page({clothSetId:clothSetId}).then((resp:any)=>{ | |||
if(resp.code == 200){ | |||
tableData.value = resp.data | |||
} | |||
}) | |||
} | |||
onMounted(() => { | |||
onMounted(async () => { | |||
const { data }:any = await userManageClothApi.getList({}); | |||
treeData.value = data; | |||
clothSetId.value = data[0].clothSetId.toString() | |||
getList(clothSetId.value) | |||
}) | |||
</script> | |||
@@ -62,6 +62,15 @@ const getDepartmentList = async () => { | |||
// 表格配置项 | |||
const columns: ColumnProps<SysMajor.MajorInfo>[] = [ | |||
{ type: "selection", fixed: "left", width: 50 }, | |||
{ | |||
prop: "code", | |||
label: "专业编号" | |||
}, | |||
{ | |||
prop: "name", | |||
label: "专业名称" | |||
}, | |||
{ | |||
prop: "depId", | |||
label: "所属院系", | |||
@@ -72,14 +81,6 @@ const columns: ColumnProps<SysMajor.MajorInfo>[] = [ | |||
}, | |||
fieldNames: { label: "name", value: "id" } | |||
}, | |||
{ | |||
prop: "code", | |||
label: "专业编号" | |||
}, | |||
{ | |||
prop: "name", | |||
label: "专业名称" | |||
}, | |||
{ | |||
prop: "introduce", | |||
label: "专业简介" | |||
@@ -107,7 +107,7 @@ const onTimeSubmit = ()=>{ | |||
a.click(); | |||
a.remove(); | |||
ElMessage({ | |||
message: res.msg, | |||
message: '导出成功', | |||
type: 'success' | |||
}); | |||
closeTime(); | |||
@@ -107,7 +107,13 @@ | |||
<div class="situation attendanceStatus"> | |||
<div class="top"> | |||
<span class="title">出勤情况分析</span> | |||
<s-select v-model="state.attendanceTime" :options="state.options" style="width: 100px" @change="getStuAttendance"></s-select> | |||
<s-select | |||
v-model="state.attendanceTime" | |||
:clearable="false" | |||
:options="state.options" | |||
style="width: 100px" | |||
@change="getStuAttendance" | |||
></s-select> | |||
</div> | |||
<div class="contentBox"> | |||
<div class="tip"> | |||
@@ -123,7 +129,13 @@ | |||
<div class="situation schoolStatus"> | |||
<div class="top"> | |||
<span class="title">出校访学情况</span> | |||
<s-select v-model="state.leavesSchTime" :options="state.options" style="width: 100px" @change="getStuLeave"></s-select> | |||
<s-select | |||
v-model="state.leavesSchTime" | |||
:clearable="false" | |||
:options="state.options" | |||
style="width: 100px" | |||
@change="getStuLeave" | |||
></s-select> | |||
</div> | |||
<div class="contentBox"> | |||
<div class="tip"> | |||
@@ -168,7 +180,13 @@ | |||
<div class="situation attendanceStatus"> | |||
<div class="top"> | |||
<span class="title">图书馆使用情况</span> | |||
<s-select v-model="state.libraryTime" :options="state.options" style="width: 100px" @change="getStuLibrary"></s-select> | |||
<s-select | |||
v-model="state.libraryTime" | |||
:clearable="false" | |||
:options="state.options" | |||
style="width: 100px" | |||
@change="getStuLibrary" | |||
></s-select> | |||
</div> | |||
<div class="contentBox"> | |||
<div class="tip"> | |||
@@ -188,7 +206,13 @@ | |||
<div class="situation attendanceStatus"> | |||
<div class="top"> | |||
<span class="title">一卡通消费情况</span> | |||
<s-select v-model="state.oneCardTime" :options="state.options" style="width: 100px" @change="getOneCardSolution"></s-select> | |||
<s-select | |||
v-model="state.oneCardTime" | |||
:clearable="false" | |||
:options="state.options" | |||
style="width: 100px" | |||
@change="getOneCardSolution" | |||
></s-select> | |||
</div> | |||
<div class="contentBox"> | |||
<div class="tip"> | |||