diff --git a/src/api/system/newdept.js b/src/api/system/newdept.js new file mode 100644 index 00000000..08adf9e8 --- /dev/null +++ b/src/api/system/newdept.js @@ -0,0 +1,95 @@ +import request from '@/utils/request' + +// 获取机构树形列表 +export function listOrgTree(query) { + return request({ + url: '/system/newDept/org/treeList', + method: 'get', + params: query + }) +} + +// 获取机构树(用于部门管理左侧) +export function listOrgTreeSimple() { + return request({ + url: '/system/newDept/org/tree', + method: 'get' + }) +} + +// 根据机构获取部门列表 +export function listDeptByOrg(orgId, query) { + return request({ + url: `/system/newDept/dept/list/${orgId}`, + method: 'get', + params: query + }) +} + +// 新增机构 +export function addOrg(data) { + return request({ + url: '/system/newDept/org', + method: 'post', + data: data + }) +} + +// 修改机构 +export function updateOrg(data) { + return request({ + url: '/system/newDept/org', + method: 'put', + data: data + }) +} + +// 删除机构 +export function deleteOrg(orgId) { + return request({ + url: `/system/newDept/org/${orgId}`, + method: 'delete' + }) +} + +// 新增部门 +export function addDept(data) { + return request({ + url: '/system/newDept/dept', + method: 'post', + data: data + }) +} + +// 修改部门 +export function updateDept(data) { + return request({ + url: '/system/newDept/dept', + method: 'put', + data: data + }) +} + +// 删除部门 +export function deleteDept(deptId) { + return request({ + url: `/system/newDept/dept/${deptId}`, + method: 'delete' + }) +} + +// 导入机构 +export function importOrg() { + return request({ + url: '/system/newDept/org/import', + method: 'post' + }) +} + +// 导入部门 +export function importDept() { + return request({ + url: '/system/newDept/dept/import', + method: 'post' + }) +} diff --git a/src/views/system/dept/index - 副本.vue b/src/views/system/dept/index - 副本.vue new file mode 100644 index 00000000..c1732b98 --- /dev/null +++ b/src/views/system/dept/index - 副本.vue @@ -0,0 +1,527 @@ + + + + + diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue index c1732b98..3a936bd6 100644 --- a/src/views/system/dept/index.vue +++ b/src/views/system/dept/index.vue @@ -1,527 +1,904 @@ - + mounted() { + // 初始化数据 + this.getOrgList(); + // 如果默认是部门标签页,也需要加载机构树 + if (this.activeTab === 'dept') { + this.getOrgTree(); + } + } + }; + - + // ========== 机构管理样式 ========== + .org-container { + background: #fff; + padding: 20px; + border-radius: 4px; + } + + // ========== 部门管理样式 ========== + .dept-container { + background: #fff; + padding: 20px; + border-radius: 4px; + } + + .dept-layout { + display: flex; + gap: 20px; + height: calc(100vh - 200px); + } + + .org-tree-panel { + width: 300px; + border: 1px solid #e4e7ed; + border-radius: 4px; + background: #fff; + display: flex; + flex-direction: column; + } + + .tree-search { + padding: 10px; + border-bottom: 1px solid #e4e7ed; + } + + .tree-content { + flex: 1; + overflow-y: auto; + padding: 10px; + } + + .dept-content-panel { + flex: 1; + display: flex; + flex-direction: column; + } + + .dept-header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 15px; + padding: 10px 0; + } + + .current-org { + font-size: 16px; + font-weight: bold; + color: #303133; + } + + // ========== 通用样式 ========== + .query-form { + margin-bottom: 15px; + padding: 15px; + background: #fafafa; + border-radius: 4px; + } + + .action-buttons { + margin-bottom: 15px; + + .el-button { + margin-right: 10px; + } + } + + // 表格样式调整 + ::v-deep .el-table { + .el-table__row { + &:hover { + background-color: #f5f7fa; + } + } + } + + // 树节点选中样式 + ::v-deep .el-tree-node.is-current > .el-tree-node__content { + background-color: #ecf5ff; + color: #409eff; + } + + // 标签页样式 + ::v-deep .el-tabs { + .el-tabs__header { + margin-bottom: 20px; + background: #fff; + padding: 0 20px; + border-radius: 4px 4px 0 0; + } + + .el-tabs__item { + height: 50px; + line-height: 50px; + font-size: 14px; + + &.is-active { + color: #409eff; + font-weight: bold; + } + } + + .el-tabs__active-bar { + background-color: #409eff; + } + } + + // 输入框图标样式 + ::v-deep .el-input__suffix { + .el-icon-edit { + color: #909399; + cursor: pointer; + + &:hover { + color: #409eff; + } + } + } +