| | |
| | | * @Author: lzhe lzhe@example.com |
| | | * @Date: 2024-03-26 10:28:33 |
| | | * @LastEditors: lzhe lzhe@example.com |
| | | * @LastEditTime: 2024-04-09 21:00:31 |
| | | * @LastEditTime: 2024-04-10 17:05:04 |
| | | * @FilePath: /smart-web/src/views/master/person/main/index.vue |
| | | * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE |
| | | --> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="right-table"> |
| | | <el-table |
| | | ref="multipleTableRef" |
| | | :data="departmentList" |
| | | border |
| | | style="width: 100%" |
| | | class="multipleTableRef" |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <!-- lazy :load="tableLoad" --> |
| | | <el-table :data="departmentList" style="width: 100%;margin-bottom: 20px;" row-key="id" border default-expand-all ref="treeRef" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" /> |
| | | <el-table-column |
| | | prop="date" |
| | | label="岗位名称"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="name" |
| | | label="部门人数"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="name" |
| | | label="上级部门"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | fixed="right" |
| | | label="操作"> |
| | | <template #default="scope"> |
| | | <el-button type="text" size="small" @click="table_edit(scope.row, scope.$index)">编辑</el-button> |
| | | <el-button text type="primary" size="small" @click="table_show(scope.row, scope.$index)">查看</el-button> |
| | | </template> |
| | | <el-table-column prop="name" label="岗位名称"></el-table-column> |
| | | <el-table-column prop="peopleNum" label="部门人数"></el-table-column> |
| | | <el-table-column prop="parentName" label="上级部门"></el-table-column> |
| | | <el-table-column fixed="right" label="操作"> |
| | | <template #default="scope"> |
| | | <el-button type="text" size="small" @click="table_edit(scope.row, scope.$index)">编辑</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-pagination |
| | |
| | | name: "bakalaka", |
| | | data(){ |
| | | return { |
| | | selection: [], |
| | | total: 0, |
| | | searchData: { |
| | | groupType: 'group_organization', |
| | |
| | | }, |
| | | statusList: [], |
| | | isSaveing: false, |
| | | groups: [], |
| | | departmentFrom: { |
| | | department: "" |
| | | }, |
| | | departmentVisibleRules: { |
| | | department:[ |
| | | {required: true, message: '请选择部门'} |
| | | ] |
| | | }, |
| | | departmentVisible: false, |
| | | dialog: { |
| | | save: false |
| | | }, |
| | | leftActive: true, |
| | | input: '', |
| | | options: [{ |
| | | value: '选项1', |
| | | label: '黄金糕' |
| | | }], |
| | | input3: '', |
| | | departmentList: [] |
| | | } |
| | | }, |
| | |
| | | }, |
| | | mounted(){ |
| | | this.getStatus(); |
| | | this.getOrganizationList(); |
| | | }, |
| | | components: { |
| | | saveDialog |
| | | }, |
| | | methods: { |
| | | removeHasChildren(arr) { |
| | | return arr.map(item => { |
| | | // 创建一个不包含hasChildren的新对象 |
| | | const newItem = { ...item }; |
| | | delete newItem.hasChildren; // 删除hasChildren字段 |
| | | // 如果children字段存在且是数组,则递归处理children |
| | | if (Array.isArray(newItem.children)) { |
| | | newItem.children = this.removeHasChildren(newItem.children); |
| | | } |
| | | |
| | | return newItem; |
| | | }); |
| | | }, |
| | | getOrganizationList() { |
| | | this.$HTTP.get(`/api/blade-cps/organization/tree?` + this.$TOOL.qsStringify(this.searchData)).then(res=> { |
| | | if(res.code == 200) { |
| | | this.departmentList = res.data; |
| | | this.departmentList = this.removeHasChildren(res.data); |
| | | } |
| | | }) |
| | | }, |
| | |
| | | this.statusList = res.data; |
| | | } |
| | | }) |
| | | }, |
| | | departmentSubmit() { |
| | | this.departmentVisible=false; //部门调整 |
| | | }, |
| | | //添加 |
| | | addPerson(){ |
| | |
| | | this.$refs.saveDialog.open('edit').setData(row) |
| | | }) |
| | | }, |
| | | //查看 |
| | | table_show(row){ |
| | | this.dialog.save = true |
| | | this.$nextTick(() => { |
| | | this.$refs.saveDialog.open('show').setData(row) |
| | | }) |
| | | handleSelectionChange (selection) { |
| | | this.selection = selection; |
| | | }, |
| | | handleSelectionChange() {}, |
| | | delPerson() {}, |
| | | changeDepartment() { |
| | | this.departmentVisible = true; |
| | | }, |
| | | changeTab(name) { |
| | | if(name == 1) { |
| | | this.leftActive = true; |
| | | }else { |
| | | this.leftActive = false; |
| | | } |
| | | }, |
| | | handleSizeChange(val) { |
| | | console.log(`每页 ${val} 条`); |
| | | }, |