Przeglądaj źródła

人员管理左侧列表接口联调

master
suyanyan 4 miesięcy temu
rodzic
commit
684cfcda70
3 zmienionych plików z 57 dodań i 15 usunięć
  1. +4
    -2
      SafeCampus.WEB/src/api/interface/sys/usermanage/personnel.ts
  2. +0
    -1
      SafeCampus.WEB/src/views/userManage/personnel/components/form/form_basic.vue
  3. +53
    -12
      SafeCampus.WEB/src/views/userManage/personnel/index.vue

+ 4
- 2
SafeCampus.WEB/src/api/interface/sys/usermanage/personnel.ts Wyświetl plik

@@ -24,15 +24,16 @@ export namespace SysUserPersonnel {

/** 底库信息 */
export interface ClassPage {
personSetId?: string | undefined;
personSetId?: string | number | undefined;
personSetName?: string | undefined;
id?: string | undefined;
name?: string | undefined;
personId?: string | undefined | number;
}
/** 人脸信息 */
export interface SysUserAvatar {
/** 人脸 */
personId?: string | undefined;
personId?: string | undefined | number;
faceId?: string | number;
faceUrl: string;
uid?: string | number;
@@ -61,5 +62,6 @@ export namespace SysUserPersonnel {
faces: Array<SysUserAvatar>;
/** 分组 */
personSets: Array<ClassPage>;
personSetId?: number | string;
}
}

+ 0
- 1
SafeCampus.WEB/src/views/userManage/personnel/components/form/form_basic.vue Wyświetl plik

@@ -15,7 +15,6 @@
<el-col :span="12">
<s-form-item label="所属班级" prop="personSetId">
<s-select v-model="userInfo.personSetId" :options="treeData" label="personSetName" value="personSetId"></s-select>
<!-- <s-input v-model="userInfo.personSets[0].personSetName" disabled></s-input> -->
</s-form-item>
</el-col>
</el-row>


+ 53
- 12
SafeCampus.WEB/src/views/userManage/personnel/index.vue Wyświetl plik

@@ -38,7 +38,7 @@
<ProTable ref="proTable" title="人员管理" :columns="columns" rowKey="personId" :request-api="userManagePersonnelApi.page">
<!-- 表格 header 按钮 -->
<template #tableHeader="scope">
<s-button v-auth="userPerButtonCode.add" suffix="人员" @click="onOpen(FormOptEnum.ADD)" />
<s-button v-auth="userPerButtonCode.add" suffix="人员" @click="onOpen(FormOptEnum.ADD, { personSetId: personSetId })" />
<s-button
v-auth="userPerButtonCode.delete"
type="danger"
@@ -58,8 +58,26 @@
<el-link type="primary" :underline="false" :icon="ArrowDown"> 更多 </el-link>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item :command="command(scope.row, cmdEnum.AddFace)">{{ cmdEnum.AddFace }}</el-dropdown-item>
<el-dropdown-item :command="command(scope.row, cmdEnum.UnderpantsUnBinding)">{{ cmdEnum.UnderpantsUnBinding }}</el-dropdown-item>
<el-dropdown-item :command="command(scope.row, cmdEnum.AddFace)"
><el-upload
ref="upload"
class="upload-demo"
action="/api/business/personApi/uploadFile"
:show-file-list="false"
:on-success="handleAvatarSuccess"
accept=".jpg, .jpeg, .png"
:headers="{
Authorization: `${TokenEnum.TOKEN_PREFIX} ${accessToken}`
}"
>
<template #trigger>
{{ cmdEnum.AddFace }}
</template>
</el-upload>
</el-dropdown-item>
<el-dropdown-item :command="command(scope.row, cmdEnum.UnderpantsUnBinding)">
{{ cmdEnum.UnderpantsUnBinding }}
</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
@@ -93,11 +111,16 @@ import FormClass from "./components/formClass/index.vue";
import { ArrowDown } from "@element-plus/icons-vue";
import { ColumnProps, ProTableInstance } from "@/components/ProTable/interface";
import TreeFilter from "@/components/TreeFilter/index.vue";
import { useUserStore } from "@/stores/modules";
import { TokenEnum } from "@/enums";
import type { UploadProps } from "element-plus";
// 获取 ProTable 元素,调用其获取刷新数据方法(还能获取到当前查询参数,方便导出携带参数)
const faceUrl = ref('');
const visible = ref(false); //是否显示人员表单
const proTable = ref<ProTableInstance>();
const treeFilter = ref<InstanceType<typeof TreeFilter> | null>(null);
const userStore = useUserStore();
const { accessToken } = userStore;
// 表格配置项
const columns: ColumnProps<SysUserPersonnel.SysUserPerInfo>[] = [
{ type: "selection", fixed: "left", width: 50 },
@@ -219,27 +242,45 @@ function command(row: SysUserPersonnel.SysUserPerInfo, command: cmdEnum): Comman
* 更多下拉菜单点击事件
* @param command
*/
const personId = ref<number | string>(); //人员id
function handleCommand(command: Command) {
switch (command.command) {
case cmdEnum.AddFace:
personId.value = command.row.personId; //获取人员id
break
case cmdEnum.UnderpantsUnBinding:
userManagePersonnelApi.personUnBindDfie({
personId:command.row.personId,
personSetId: command.row.personSets[0].personSetId
}).then(res=>{
if(res.code == 200){
ElMessage.success('底库解绑成功');
RefreshTable()
}
})
break;
}
}
const handleAvatarSuccess: UploadProps["onSuccess"] = (response, uploadFile) => {
if (response.code === 200) {
userManagePersonnelApi.addFace({
personId: personId.value,
faceUrl: response.data
}).then(res=>{
RefreshTable()
})
} else {
ElMessage.error(response.msg);
}
};

/** 部门切换 */
const personSetId = ref<number | string>()
function changeTreeFilter(val: number | string) {
console.log(proTable.value,".........",val);
personSetId.value = val
proTable.value!.pageable.pageNum = 1;
// if (val != "") {
// // 如果传入的val不为空,则将val赋值给initParam.parentId
// initParam.orgId = val;
// } else {
// // 否则将initParam.parentId赋值为0
// initParam.orgId = 0;
// }
proTable.value!.searchParam.personSetId = val;
proTable.value!.search();
}
</script>
<style scoped lang="scss">


Ładowanie…
Anuluj
Zapisz