尝试添加个人查看部门信息
This commit is contained in:
parent
2179458f24
commit
d814ee2aef
@ -18,16 +18,7 @@ export default {
|
|||||||
return response.data;
|
return response.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
updateOrganization(organization) {
|
getOrganizationByName(organizationName){
|
||||||
return axios.post('api/organizations/updateOrganization', organization).then(response => {
|
return axios.get('api/organizations/getByOrganizationName')
|
||||||
return response.data;
|
}
|
||||||
});
|
|
||||||
},
|
|
||||||
getOrganizationById(organizationId) {
|
|
||||||
return axios.post('http://localhost:8080/organizations/getOrganizationById', {organizationId:organizationId},{headers: {
|
|
||||||
'Content-Type': 'application/json' // 设置 Content-Type 为 application/json
|
|
||||||
}}).then(response => {
|
|
||||||
return response.data;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="department-management">
|
<div class="department-management" v-if="showTable">
|
||||||
<el-breadcrumb separator="/">
|
<el-breadcrumb separator="/">
|
||||||
<el-breadcrumb-item :to="{ path: '/login' }">登录界面</el-breadcrumb-item>
|
<el-breadcrumb-item :to="{ path: '/login' }">登录界面</el-breadcrumb-item>
|
||||||
<el-breadcrumb-item :to="{ path: '/' }">Hello world</el-breadcrumb-item>
|
<el-breadcrumb-item :to="{ path: '/' }">Hello world</el-breadcrumb-item>
|
||||||
@ -21,7 +21,7 @@
|
|||||||
<el-button @click="handleReset">重置</el-button>
|
<el-button @click="handleReset">重置</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-button type="primary" @click="showDialogAdd = true"><el-icon><Plus/></el-icon>添加部门</el-button>
|
<el-button type="primary" @click="showDialogAdd = true">添加部门</el-button>
|
||||||
<el-table
|
<el-table
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
style="width: 100%; margin-bottom: 20px"
|
style="width: 100%; margin-bottom: 20px"
|
||||||
@ -100,6 +100,39 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 用户显示界面-->
|
||||||
|
<el-dialog v-model="show" title="就职信息" width="80%">
|
||||||
|
<el-form :model="dialogFormPerson">
|
||||||
|
<el-form-item label="上级部门" :label-width="formLabelWidth">
|
||||||
|
<el-text>{{dialogFormPerson.}}</el-text>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item prop="organizationName" label="部门名称" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="dialogFormAdd.organizationName"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item prop="displayOrder" label="显示排列" :label-width="formLabelWidth">
|
||||||
|
<el-input-number v-model="dialogFormAdd.displayOrder" :min=1 :max="100"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item prop="leader" label="负责人" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="dialogFormAdd.leader"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item prop="contactPhone" label="联系电话" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="dialogFormAdd.contactPhone"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item prop="email" label="邮箱" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="dialogFormAdd.email"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="部门状态" :label-width="formLabelWidth">
|
||||||
|
<el-switch v-model="dialogFormAdd.organizationStatus" active-value="true" active-text="启用" inactive-value="false" inactive-text="禁用"></el-switch>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<span slot="footer">
|
||||||
|
<el-button @click="showDialogAdd = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="submitForm">提交</el-button>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
@ -122,6 +155,8 @@ interface Organization {
|
|||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
setup() {
|
setup() {
|
||||||
|
const showTable = ref(true);
|
||||||
|
const show = ref(false);
|
||||||
const showDialogAdd = ref(false);
|
const showDialogAdd = ref(false);
|
||||||
const formLabelWidth = ref('120px');
|
const formLabelWidth = ref('120px');
|
||||||
|
|
||||||
@ -144,6 +179,7 @@ export default defineComponent({
|
|||||||
const treeData = ref();
|
const treeData = ref();
|
||||||
const noChildrenData = ref();
|
const noChildrenData = ref();
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
tableData.value=[];
|
tableData.value=[];
|
||||||
const data = await organizationService.getAllOrganizations(); // 假设此函数可以获取后端数据
|
const data = await organizationService.getAllOrganizations(); // 假设此函数可以获取后端数据
|
||||||
@ -219,11 +255,6 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const deleteOrganization = (organizationId:number) => {
|
const deleteOrganization = (organizationId:number) => {
|
||||||
// const confirmDelete = ElMessageBox.confirm('确认删除该组织?', '提示');
|
|
||||||
// console.log(organizationId);
|
|
||||||
// if(!confirmDelete){
|
|
||||||
// organizationService.deleteOrganization(organizationId);
|
|
||||||
// }
|
|
||||||
organizationService.deleteOrganization(organizationId);
|
organizationService.deleteOrganization(organizationId);
|
||||||
fetchData();
|
fetchData();
|
||||||
}
|
}
|
||||||
@ -263,9 +294,6 @@ export default defineComponent({
|
|||||||
(!isStatusValid || data.organizationStatus === JSON.parse(search.value.status));
|
(!isStatusValid || data.organizationStatus === JSON.parse(search.value.status));
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
// }else{
|
|
||||||
// fetchData();
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
search.value.name = '';
|
search.value.name = '';
|
||||||
@ -281,6 +309,8 @@ export default defineComponent({
|
|||||||
originTableData,
|
originTableData,
|
||||||
tableData,
|
tableData,
|
||||||
showDialogAdd,
|
showDialogAdd,
|
||||||
|
showTable,
|
||||||
|
show,
|
||||||
dialogFormAdd,
|
dialogFormAdd,
|
||||||
submitForm,
|
submitForm,
|
||||||
formLabelWidth,
|
formLabelWidth,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user