利元亨 部门选仿真负责人功能
This commit is contained in:
@@ -155,3 +155,12 @@ export const queryProjectBatchApi = (params: any) => {
|
||||
export const queryProjectInfoApi = (params: any) => {
|
||||
return get(`${PREFIX}node/queryProjectInfo`, params);
|
||||
};
|
||||
|
||||
/**
|
||||
* lyric 同步阶段接口
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export const syncPhaseApi = (params: any) => {
|
||||
return post(`${PREFIX}node/syncPhase`, params);
|
||||
};
|
||||
|
||||
25
src/api/system/departMent.ts
Normal file
25
src/api/system/departMent.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { get, post } from '@/api/request';
|
||||
|
||||
const env = import.meta.env;
|
||||
const PREFIX = env.VITE_API_PREFIX_SYSTEM;
|
||||
|
||||
/**
|
||||
* 查询部门及负责人
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export const listDeptApi = (params: any) => {
|
||||
return get(`${PREFIX}dept/listDept`, params);
|
||||
};
|
||||
|
||||
export const editDeptApi = (params: any) => {
|
||||
return post(`${PREFIX}dept/editDept`, params);
|
||||
};
|
||||
|
||||
export const addDeptApi = (params: any) => {
|
||||
return post(`${PREFIX}dept/addDept`, params);
|
||||
};
|
||||
|
||||
export const delDeptApi = (params: any) => {
|
||||
return post(`${PREFIX}dept/delDept`, params);
|
||||
};
|
||||
@@ -0,0 +1,4 @@
|
||||
export interface Options {
|
||||
label: string;
|
||||
value: string | number;
|
||||
}
|
||||
|
||||
@@ -1,114 +1,104 @@
|
||||
<template>
|
||||
<div class="gl-page-content">
|
||||
<div class="head">
|
||||
<el-space>
|
||||
<el-tabs type="card" editable>
|
||||
<el-tab-pane
|
||||
v-for="item in configurationList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:name="item.name"
|
||||
>
|
||||
{{ item.content }}
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<el-button type="primary" @click="displayConfigurationFun">新增配置</el-button>
|
||||
</el-space>
|
||||
</div>
|
||||
<div class="body">
|
||||
<div class="add-level">
|
||||
<el-button type="primary" @click="addSelectLevelFun">添加层级</el-button>
|
||||
<el-button type="primary">保存</el-button>
|
||||
</div>
|
||||
<div class="add-content">
|
||||
<div class="select-level-box" v-for="item in selectLevelList" :key="item.id">
|
||||
<span>{{ item.name }}</span>
|
||||
<el-select class="select-level">
|
||||
<el-option
|
||||
v-for="(item_1, index_1) in options"
|
||||
:key="index_1"
|
||||
v-bind="item_1"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<DragSplit :leftContentWidth="400">
|
||||
<template #left>
|
||||
<div class="left-box">
|
||||
<ul class="menu-list">
|
||||
<li
|
||||
v-for="(item, index) in configList"
|
||||
:key="index"
|
||||
class="menu-item"
|
||||
:class="{ active: currentActive === item.value }"
|
||||
@click="handleMenuClick(item.value)"
|
||||
>
|
||||
<!-- <i :class="`menu-icon ${item.icon}`"></i> -->
|
||||
{{ item.label }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template #right>
|
||||
<div class="right-box">
|
||||
<DepartMent v-if="currentActive === 'department'"></DepartMent>
|
||||
</div>
|
||||
</template>
|
||||
</DragSplit>
|
||||
</div>
|
||||
<AddConfigurationDia v-model="addDiaVisible" @close="closeFun" @confirm="addConfigurationFun" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import DragSplit from '@/components/common/dragSplit/index.vue';
|
||||
import DepartMent from './components/departMent.vue';
|
||||
import { ref } from 'vue';
|
||||
import AddConfigurationDia from './components/addConfigurationDia.vue';
|
||||
|
||||
const configurationList = ref<any>([]);
|
||||
const addDiaVisible = ref<boolean>(false);
|
||||
const displayConfigurationFun = () => {
|
||||
addDiaVisible.value = true;
|
||||
};
|
||||
const closeFun = () => {
|
||||
addDiaVisible.value = false;
|
||||
};
|
||||
const addConfigurationFun = (addFormData: any) => {
|
||||
configurationList.value.push({
|
||||
name: addFormData.name,
|
||||
id: new Date().getTime(),
|
||||
});
|
||||
addDiaVisible.value = false;
|
||||
};
|
||||
const selectLevelList = ref<any>([]);
|
||||
const options = [
|
||||
const configList = [
|
||||
{
|
||||
label: 'test1',
|
||||
value: 'test1',
|
||||
label: '部门配置',
|
||||
value: 'department',
|
||||
},
|
||||
{
|
||||
label: 'test2',
|
||||
value: 'test2',
|
||||
},
|
||||
{
|
||||
label: 'test3',
|
||||
value: 'test3',
|
||||
label: '其他配置',
|
||||
value: 'other',
|
||||
},
|
||||
];
|
||||
const addSelectLevelFun = () => {
|
||||
selectLevelList.value.push({
|
||||
name: selectLevelList.value.length + 1 + '级',
|
||||
id: new Date().getTime(),
|
||||
});
|
||||
|
||||
// 当前选中的索引(默认选中第一个)
|
||||
const currentActive = ref('department');
|
||||
|
||||
// 点击菜单切换选中状态
|
||||
const handleMenuClick = (departValue: string) => {
|
||||
currentActive.value = departValue;
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.gl-page-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.head {
|
||||
height: 100%;
|
||||
padding: 0;
|
||||
.left-box {
|
||||
padding: var(--padding-normal);
|
||||
height: 100%;
|
||||
}
|
||||
.right-box {
|
||||
padding: var(--padding-normal);
|
||||
height: 100%;
|
||||
}
|
||||
/* 菜单列表样式 */
|
||||
.menu-list {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
/* 菜单项基础样式 */
|
||||
.menu-item {
|
||||
height: 50px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
padding-bottom: 12px;
|
||||
padding: 0 16px;
|
||||
font-size: 14px;
|
||||
color: #374151;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.2s;
|
||||
}
|
||||
.body {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.add-content {
|
||||
flex: 1;
|
||||
padding: var(--padding-normal);
|
||||
.select-level-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 12px;
|
||||
span {
|
||||
width: 60px;
|
||||
text-align: right;
|
||||
margin-right: 12px;
|
||||
}
|
||||
.select-level {
|
||||
width: 200px;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* 菜单项 hover 样式 */
|
||||
.menu-item:hover {
|
||||
background-color: var(--el-disabled-bg-color);
|
||||
}
|
||||
/* 选中条目高亮样式 */
|
||||
.menu-item.active {
|
||||
background-color: var(--el-color-primary-light-7);
|
||||
color: var(--el-color-primary);
|
||||
font-weight: 500;
|
||||
}
|
||||
/* 菜单图标样式 */
|
||||
.menu-icon {
|
||||
margin-right: 10px;
|
||||
font-size: 16px;
|
||||
color: #60a5fa;
|
||||
}
|
||||
// .content {
|
||||
// position: relative;
|
||||
// height: 100%;
|
||||
// display: flex;
|
||||
// }
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -223,7 +223,7 @@ const getPhaseListApi = async () => {
|
||||
} else {
|
||||
phaseListOptions.value = [];
|
||||
}
|
||||
emits('getPhaseList', phaseListOptions.value.length);
|
||||
emits('getPhaseList', phaseListOptions.value);
|
||||
};
|
||||
|
||||
const showTaskDetailDialog = ref(false);
|
||||
|
||||
@@ -39,9 +39,19 @@
|
||||
:hideKeys="hideKeys"
|
||||
:data="editFormInfo"
|
||||
>
|
||||
<template v-for="name in Object.keys($slots)" :key="name" #[name]="scope">
|
||||
<slot :name="name" v-bind="scope" />
|
||||
<template #form-pMemberList>
|
||||
<el-select v-model="editFormInfo.pMemberList" filterable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in deptOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
<!-- <template v-for="name in Object.keys($slots)" :key="name" #[name]="scope">
|
||||
<slot :name="name" v-bind="scope" />
|
||||
</template> -->
|
||||
</TableForm>
|
||||
<template #footer>
|
||||
<div>
|
||||
@@ -72,6 +82,7 @@ import { getMemberListIds } from '@/utils/task';
|
||||
import { enableConfigByTenant, TENANT_ENUM } from '@/tenants/tenant';
|
||||
import { syncDemandList } from '../taskPage';
|
||||
import { getChildrenNodeListApi } from '@/api/project/node';
|
||||
import type { Options } from '@/types';
|
||||
|
||||
const env = import.meta.env;
|
||||
const PREFIX = env.VITE_API_PREFIX_PROJECT;
|
||||
@@ -81,6 +92,10 @@ defineProps({
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
deptOptions: {
|
||||
type: Array<Options>,
|
||||
default: () => [],
|
||||
},
|
||||
});
|
||||
|
||||
const emits = defineEmits(['visibleDialog', 'loadTableForm', 'changeForm']);
|
||||
@@ -129,7 +144,7 @@ const demandInfo = reactive({
|
||||
|
||||
const isCreateDialog = ref(true);
|
||||
|
||||
const editFormInfo = ref({});
|
||||
const editFormInfo = ref<any>({});
|
||||
|
||||
const visibleDialog = async (isCreate: boolean, row?: any) => {
|
||||
formVisible.value = true;
|
||||
@@ -202,6 +217,7 @@ const confirmFun = async () => {
|
||||
if (await tableFormRef.value.validateFun()) {
|
||||
loadingInterface.value = true;
|
||||
const fromData: any = tableFormRef.value.getFormDataFun();
|
||||
console.log('fromData', fromData);
|
||||
if (fromData.planTime) {
|
||||
fromData.beginTime = fromData.planTime[0];
|
||||
fromData.endTime = fromData.planTime[1];
|
||||
|
||||
Reference in New Issue
Block a user