mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2026-02-02 08:35:25 +08:00
【v3.8.3】部门大改造关联修改
This commit is contained in:
@ -3,7 +3,7 @@ import { defHttp } from '/@/utils/http/axios';
|
||||
export enum Api {
|
||||
list = '/sys/user/queryByOrgCodeForAddressList',
|
||||
positionList = '/sys/position/list',
|
||||
queryDepartTreeSync = '/sys/sysDepart/queryDepartTreeSync',
|
||||
queryDepartTreeSync = '/sys/sysDepart/queryDepartAndPostTreeSync',
|
||||
}
|
||||
/**
|
||||
* 获取部门树列表
|
||||
|
||||
@ -14,7 +14,12 @@ export const columns: BasicColumn[] = [
|
||||
},
|
||||
{
|
||||
title: '部门',
|
||||
dataIndex: 'departName',
|
||||
dataIndex: 'orgCodeTxt',
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
title: '主岗位',
|
||||
dataIndex: 'mainDepPostId_dictText',
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
|
||||
@ -14,7 +14,11 @@
|
||||
:load-data="loadChildrenTreeData"
|
||||
v-model:expandedKeys="expandedKeys"
|
||||
@select="onSelect"
|
||||
></a-tree>
|
||||
>
|
||||
<template #title="{ orgCategory, title }">
|
||||
<TreeIcon :orgCategory="orgCategory" :title="title"></TreeIcon>
|
||||
</template>
|
||||
</a-tree>
|
||||
</template>
|
||||
<a-empty v-else description="暂无数据" />
|
||||
</a-spin>
|
||||
@ -26,6 +30,7 @@
|
||||
import { queryDepartTreeSync } from '../address.api';
|
||||
import { searchByKeywords } from '/@/views/system/departUser/depart.user.api';
|
||||
import { Popconfirm } from 'ant-design-vue';
|
||||
import TreeIcon from "@/components/Form/src/jeecg/components/TreeIcon/TreeIcon.vue";
|
||||
|
||||
const prefixCls = inject('prefixCls');
|
||||
// 定义props
|
||||
@ -142,7 +147,7 @@
|
||||
try {
|
||||
loading.value = true;
|
||||
treeData.value = [];
|
||||
let result = await searchByKeywords({ keyWord: value });
|
||||
let result = await searchByKeywords({ keyWord: value, orgCategory: '1,2,3,4' });
|
||||
if (Array.isArray(result)) {
|
||||
treeData.value = result;
|
||||
}
|
||||
|
||||
@ -25,10 +25,12 @@
|
||||
import { provide, ref, unref } from 'vue';
|
||||
import { useDesign } from '/@/hooks/web/useDesign';
|
||||
import DepartLeftTree from './components/DepartLeftTree.vue';
|
||||
import { BasicTable } from '/@/components/Table';
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns, searchFormSchema } from './address.data';
|
||||
import { list, positionList } from './address.api';
|
||||
import { getCacheByDynKey } from "@/utils/auth";
|
||||
import { JEECG_CHAT_UID } from "@/enums/cacheEnum";
|
||||
|
||||
const { prefixCls } = useDesign('address-list');
|
||||
provide('prefixCls', prefixCls);
|
||||
@ -46,14 +48,13 @@
|
||||
api: list,
|
||||
columns,
|
||||
//update-begin---author:wangshuai ---date:20220629 for:[VUEN-1485]进入系统管理--通讯录页面后,网页命令行报错------------
|
||||
rowKey: 'userId',
|
||||
rowKey: 'id',
|
||||
//update-end---author:wangshuai ---date:20220629 for:[VUEN-1485]进入系统管理--通讯录页面后,网页命令行报错--------------
|
||||
showIndexColumn: true,
|
||||
formConfig: {
|
||||
schemas: searchFormSchema,
|
||||
},
|
||||
canResize: false,
|
||||
actionColumn: null,
|
||||
showTableSetting: false,
|
||||
// 请求之前对参数做处理
|
||||
beforeFetch(params) {
|
||||
|
||||
@ -168,6 +168,8 @@ export function useBaseInfoForm(treeData: Ref<any[]>) {
|
||||
return '部门';
|
||||
} else if (val === '3') {
|
||||
return '岗位';
|
||||
} else if(val === '4'){
|
||||
return '子公司';
|
||||
}
|
||||
return val;
|
||||
},
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
}
|
||||
});
|
||||
//设置标题
|
||||
const getTitle = computed(() => (!unref(isUpdate) ? '新增职务' : '编辑职务'));
|
||||
const getTitle = computed(() => (!unref(isUpdate) ? '新增职务级别' : '编辑职务级别'));
|
||||
//表单提交事件
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
@ -51,3 +51,8 @@
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
:deep(.ant-input-number){
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
133
jeecgboot-vue3/src/views/system/position/TenantPositionList.vue
Normal file
133
jeecgboot-vue3/src/views/system/position/TenantPositionList.vue
Normal file
@ -0,0 +1,133 @@
|
||||
<template>
|
||||
<div>
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" preIcon="ant-design:plus-outlined" @click="handleAdd">新增</a-button>
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item key="1" @click="batchHandleDelete">
|
||||
<Icon icon="ant-design:delete-outlined"></Icon>
|
||||
删除
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button
|
||||
>批量操作
|
||||
<Icon icon="ant-design:down-outlined"></Icon>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getActions(record)" />
|
||||
</template>
|
||||
</BasicTable>
|
||||
<PositionModal @register="registerModal" @success="reload" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" name="TenantPositionList" setup>
|
||||
import { onMounted } from 'vue';
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { getPositionList, deletePosition, batchDeletePosition, getExportUrl, getImportUrl } from './position.api';
|
||||
import { columns, searchFormSchema } from './position.data';
|
||||
import PositionModal from './PositionModal.vue';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { tenantSaasMessage } from '@/utils/common/compUtils';
|
||||
import { getTenantId } from '@/utils/auth';
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
|
||||
// 列表页面公共参数、方法
|
||||
const { onExportXls, onImportXls, tableContext } = useListPage({
|
||||
tableProps: {
|
||||
title: '租户职务列表',
|
||||
api: getPositionList,
|
||||
columns: columns,
|
||||
formConfig: {
|
||||
schemas: searchFormSchema,
|
||||
},
|
||||
actionColumn: {
|
||||
width: 180,
|
||||
},
|
||||
showIndexColumn: true,
|
||||
defSort: {
|
||||
column: '',
|
||||
order: '',
|
||||
},
|
||||
beforeFetch(params) {
|
||||
return Object.assign({ tenantId: getTenantId() }, params);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: '租户职务列表',
|
||||
url: getExportUrl,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
},
|
||||
});
|
||||
|
||||
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
|
||||
/**
|
||||
* 操作列定义
|
||||
* @param record
|
||||
*/
|
||||
function getActions(record) {
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
function handleAdd() {
|
||||
openModal(true, {
|
||||
isUpdate: false,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑事件
|
||||
*/
|
||||
function handleEdit(record) {
|
||||
openModal(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除事件
|
||||
*/
|
||||
async function handleDelete(record) {
|
||||
await deletePosition({ id: record.id }, reload);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除事件
|
||||
*/
|
||||
async function batchHandleDelete() {
|
||||
await batchDeletePosition({ ids: selectedRowKeys.value }, () => {
|
||||
selectedRowKeys.value = [];
|
||||
reload();
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
//提示信息
|
||||
tenantSaasMessage('租户职务');
|
||||
});
|
||||
</script>
|
||||
@ -53,6 +53,10 @@
|
||||
width: 180,
|
||||
},
|
||||
showIndexColumn: true,
|
||||
defSort: {
|
||||
column: "",
|
||||
order: ""
|
||||
}
|
||||
},
|
||||
exportConfig: {
|
||||
name: '职务列表',
|
||||
|
||||
@ -9,22 +9,21 @@ export const columns: BasicColumn[] = [
|
||||
// align: 'left',
|
||||
// },
|
||||
{
|
||||
title: '职务名称',
|
||||
title: '职务级别名称',
|
||||
dataIndex: 'name',
|
||||
align: 'left'
|
||||
// width: 200,
|
||||
},
|
||||
// {
|
||||
// title: '职务等级',
|
||||
// dataIndex: 'postRank_dictText',
|
||||
// width: 100,
|
||||
// },
|
||||
{
|
||||
title: '职务级别(越小级别越高)',
|
||||
dataIndex: 'postLevel',
|
||||
},
|
||||
];
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
field: 'name',
|
||||
label: '职务名称',
|
||||
label: '职务级别名称',
|
||||
component: 'Input',
|
||||
colProps: { span: 8 },
|
||||
},
|
||||
@ -37,25 +36,25 @@ export const formSchema: FormSchema[] = [
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
// {
|
||||
// label: '职级',
|
||||
// field: 'postRank',
|
||||
// component: 'JDictSelectTag',
|
||||
// required: true,
|
||||
// componentProps: {
|
||||
// dictCode: 'position_rank',
|
||||
// dropdownStyle: {
|
||||
// maxHeight: '100vh',
|
||||
// },
|
||||
// getPopupContainer: () => document.body,
|
||||
// },
|
||||
// },
|
||||
{
|
||||
field: 'name',
|
||||
label: '职务名称',
|
||||
label: '职务级别名称',
|
||||
component: 'Input',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: '职务级别',
|
||||
field: 'postLevel',
|
||||
component: 'InputNumber',
|
||||
required: true,
|
||||
componentProps: {
|
||||
min: 1,
|
||||
max: 99
|
||||
},
|
||||
dynamicRules: ({ model, schema }) => {
|
||||
return [{ required: true, message: '请输入职务级别!' }];
|
||||
},
|
||||
},
|
||||
// {
|
||||
// field: 'code',
|
||||
// label: '职务编码',
|
||||
|
||||
Reference in New Issue
Block a user