From 277aed8a65d77a13ab38803f79f69d31c0c849e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98qinlong123=E2=80=99?= <‘1459657883@qq.com’> Date: Wed, 9 Oct 2024 06:27:55 +0800 Subject: [PATCH 01/12] =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/roster/batch/index.vue | 551 ++++++++++++++++++ .../src/views/roster/timeTemplate/index.vue | 138 +++++ ruoyi-fastapi-frontend/vite.config.js | 2 +- 3 files changed, 690 insertions(+), 1 deletion(-) create mode 100644 ruoyi-fastapi-frontend/src/views/roster/batch/index.vue create mode 100644 ruoyi-fastapi-frontend/src/views/roster/timeTemplate/index.vue diff --git a/ruoyi-fastapi-frontend/src/views/roster/batch/index.vue b/ruoyi-fastapi-frontend/src/views/roster/batch/index.vue new file mode 100644 index 0000000..a04842d --- /dev/null +++ b/ruoyi-fastapi-frontend/src/views/roster/batch/index.vue @@ -0,0 +1,551 @@ + + + diff --git a/ruoyi-fastapi-frontend/src/views/roster/timeTemplate/index.vue b/ruoyi-fastapi-frontend/src/views/roster/timeTemplate/index.vue new file mode 100644 index 0000000..0d9d427 --- /dev/null +++ b/ruoyi-fastapi-frontend/src/views/roster/timeTemplate/index.vue @@ -0,0 +1,138 @@ + + + + + \ No newline at end of file diff --git a/ruoyi-fastapi-frontend/vite.config.js b/ruoyi-fastapi-frontend/vite.config.js index ba9fd12..a210ce1 100644 --- a/ruoyi-fastapi-frontend/vite.config.js +++ b/ruoyi-fastapi-frontend/vite.config.js @@ -31,7 +31,7 @@ export default defineConfig(({ mode, command }) => { proxy: { // https://cn.vitejs.dev/config/#server-proxy '/dev-api': { - target: 'http://127.0.0.1:9099', + target: 'http://192.168.10.10:9099', changeOrigin: true, rewrite: (p) => p.replace(/^\/dev-api/, '') } -- Gitee From 8ec53a76018a4f52987188f3d97024524707a18e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98qinlong123=E2=80=99?= <‘1459657883@qq.com’> Date: Wed, 9 Oct 2024 11:16:27 +0800 Subject: [PATCH 02/12] =?UTF-8?q?=E6=8E=92=E7=8F=AD=E5=88=86=E7=BB=84?= =?UTF-8?q?=E7=AE=A1=E7=90=861=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/roster/batch/authUser.vue | 172 ++++ .../src/views/roster/batch/index.vue | 754 ++++++++---------- .../src/views/roster/batch/selectUser.vue | 138 ++++ 3 files changed, 640 insertions(+), 424 deletions(-) create mode 100644 ruoyi-fastapi-frontend/src/views/roster/batch/authUser.vue create mode 100644 ruoyi-fastapi-frontend/src/views/roster/batch/selectUser.vue diff --git a/ruoyi-fastapi-frontend/src/views/roster/batch/authUser.vue b/ruoyi-fastapi-frontend/src/views/roster/batch/authUser.vue new file mode 100644 index 0000000..66b5f5e --- /dev/null +++ b/ruoyi-fastapi-frontend/src/views/roster/batch/authUser.vue @@ -0,0 +1,172 @@ + + + + diff --git a/ruoyi-fastapi-frontend/src/views/roster/batch/index.vue b/ruoyi-fastapi-frontend/src/views/roster/batch/index.vue index a04842d..0c7e540 100644 --- a/ruoyi-fastapi-frontend/src/views/roster/batch/index.vue +++ b/ruoyi-fastapi-frontend/src/views/roster/batch/index.vue @@ -1,235 +1,132 @@ @@ -241,7 +138,9 @@ const router = useRouter(); const { proxy } = getCurrentInstance(); const { sys_normal_disable } = proxy.useDict("sys_normal_disable"); -const roleList = ref([]); +const workDate = ref(''); +const workTimeList = ['8:00-12:00', '12:00-16:00', '16:00-20:00']; +// const roleList = ref([]); const open = ref(false); const loading = ref(true); const showSearch = ref(true); @@ -263,288 +162,295 @@ const deptRef = ref(null); /** 数据范围选项*/ const dataScopeOptions = ref([ - { value: "1", label: "全部数据权限" }, - { value: "2", label: "自定数据权限" }, - { value: "3", label: "本部门数据权限" }, - { value: "4", label: "本部门及以下数据权限" }, - { value: "5", label: "仅本人数据权限" } + { value: "1", label: "全部数据权限" }, + { value: "2", label: "自定数据权限" }, + { value: "3", label: "本部门数据权限" }, + { value: "4", label: "本部门及以下数据权限" }, + { value: "5", label: "仅本人数据权限" } ]); const data = reactive({ - form: {}, - queryParams: { - pageNum: 1, - pageSize: 10, - roleName: undefined, - roleKey: undefined, - status: undefined - }, - rules: { - roleName: [{ required: true, message: "角色名称不能为空", trigger: "blur" }], - roleKey: [{ required: true, message: "权限字符不能为空", trigger: "blur" }], - roleSort: [{ required: true, message: "角色顺序不能为空", trigger: "blur" }] - }, + form: {}, + queryParams: { + pageNum: 1, + pageSize: 10, + roleName: undefined, + roleKey: undefined, + status: undefined + }, + rules: { + roleName: [{ required: true, message: "角色名称不能为空", trigger: "blur" }], + roleKey: [{ required: true, message: "权限字符不能为空", trigger: "blur" }], + roleSort: [{ required: true, message: "角色顺序不能为空", trigger: "blur" }] + }, }); const { queryParams, form, rules } = toRefs(data); +const fenzuList = [ + { command: '白班', workTime: '8:00-12:00', employees: '张三,李四,王五', createTime: '2024-10-08' }, + +] /** 查询角色列表 */ function getList() { - loading.value = true; - listRole(proxy.addDateRange(queryParams.value, dateRange.value)).then(response => { - roleList.value = response.rows; - total.value = response.total; - loading.value = false; - }); + loading.value = true; + + total.value = fenzuList.length; + loading.value = false; + listRole(proxy.addDateRange(queryParams.value, dateRange.value)).then(response => { + // roleList.value = response.rows; + console.log(response) + loading.value = false; + }); } /** 搜索按钮操作 */ function handleQuery() { - queryParams.value.pageNum = 1; - getList(); + queryParams.value.pageNum = 1; + getList(); } /** 重置按钮操作 */ function resetQuery() { - dateRange.value = []; - proxy.resetForm("queryRef"); - handleQuery(); + dateRange.value = []; + proxy.resetForm("queryRef"); + handleQuery(); } /** 删除按钮操作 */ function handleDelete(row) { - const roleIds = row.roleId || ids.value; - proxy.$modal.confirm('是否确认删除角色编号为"' + roleIds + '"的数据项?').then(function () { - return delRole(roleIds); - }).then(() => { - getList(); - proxy.$modal.msgSuccess("删除成功"); - }).catch(() => {}); + const roleIds = row.roleId || ids.value; + proxy.$modal.confirm('是否确认删除角色编号为"' + roleIds + '"的数据项?').then(function () { + return delRole(roleIds); + }).then(() => { + getList(); + proxy.$modal.msgSuccess("删除成功"); + }).catch(() => { }); } /** 导出按钮操作 */ function handleExport() { - proxy.download("system/role/export", { - ...queryParams.value, - }, `role_${new Date().getTime()}.xlsx`); + proxy.download("system/role/export", { + ...queryParams.value, + }, `role_${new Date().getTime()}.xlsx`); } /** 多选框选中数据 */ function handleSelectionChange(selection) { - ids.value = selection.map(item => item.roleId); - single.value = selection.length != 1; - multiple.value = !selection.length; + ids.value = selection.map(item => item.roleId); + single.value = selection.length != 1; + multiple.value = !selection.length; } /** 角色状态修改 */ function handleStatusChange(row) { - let text = row.status === "0" ? "启用" : "停用"; - proxy.$modal.confirm('确认要"' + text + '""' + row.roleName + '"角色吗?').then(function () { - return changeRoleStatus(row.roleId, row.status); - }).then(() => { - proxy.$modal.msgSuccess(text + "成功"); - }).catch(function () { - row.status = row.status === "0" ? "1" : "0"; - }); + let text = row.status === "0" ? "启用" : "停用"; + proxy.$modal.confirm('确认要"' + text + '""' + row.roleName + '"角色吗?').then(function () { + return changeRoleStatus(row.roleId, row.status); + }).then(() => { + proxy.$modal.msgSuccess(text + "成功"); + }).catch(function () { + row.status = row.status === "0" ? "1" : "0"; + }); } /** 更多操作 */ function handleCommand(command, row) { - switch (command) { - case "handleDataScope": - handleDataScope(row); - break; - case "handleAuthUser": - handleAuthUser(row); - break; - default: - break; - } + switch (command) { + case "handleDataScope": + handleDataScope(row); + break; + case "handleAuthUser": + handleAuthUser(row); + break; + default: + break; + } } /** 分配用户 */ function handleAuthUser(row) { - router.push("/system/role-auth/user/" + row.roleId); + router.push("/system/role-auth/user/" + row.roleId); } /** 查询菜单树结构 */ function getMenuTreeselect() { - menuTreeselect().then(response => { - menuOptions.value = response.data; - }); + menuTreeselect().then(response => { + menuOptions.value = response.data; + }); } /** 所有部门节点数据 */ function getDeptAllCheckedKeys() { - // 目前被选中的部门节点 - let checkedKeys = deptRef.value.getCheckedKeys(); - // 半选中的部门节点 - let halfCheckedKeys = deptRef.value.getHalfCheckedKeys(); - checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys); - return checkedKeys; + // 目前被选中的部门节点 + let checkedKeys = deptRef.value.getCheckedKeys(); + // 半选中的部门节点 + let halfCheckedKeys = deptRef.value.getHalfCheckedKeys(); + checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys); + return checkedKeys; } /** 重置新增的表单以及其他数据 */ function reset() { - if (menuRef.value != undefined) { - menuRef.value.setCheckedKeys([]); - } - menuExpand.value = false; - menuNodeAll.value = false; - deptExpand.value = true; - deptNodeAll.value = false; - form.value = { - roleId: undefined, - roleName: undefined, - roleKey: undefined, - roleSort: 0, - status: "0", - menuIds: [], - deptIds: [], - menuCheckStrictly: true, - deptCheckStrictly: true, - remark: undefined - }; - proxy.resetForm("roleRef"); + if (menuRef.value != undefined) { + menuRef.value.setCheckedKeys([]); + } + menuExpand.value = false; + menuNodeAll.value = false; + deptExpand.value = true; + deptNodeAll.value = false; + form.value = { + roleId: undefined, + roleName: undefined, + roleKey: undefined, + roleSort: 0, + status: "0", + menuIds: [], + deptIds: [], + menuCheckStrictly: true, + deptCheckStrictly: true, + remark: undefined + }; + proxy.resetForm("roleRef"); } -/** 添加角色 */ +/** 添加分组信息 */ function handleAdd() { - reset(); - getMenuTreeselect(); - open.value = true; - title.value = "添加角色"; + reset(); + getMenuTreeselect(); + open.value = true; + title.value = "添加分组排班信息"; } -/** 修改角色 */ +/** 修改分组信息 */ function handleUpdate(row) { - reset(); - const roleId = row.roleId || ids.value; - const roleMenu = getRoleMenuTreeselect(roleId); - getRole(roleId).then(response => { - form.value = response.data; - form.value.roleSort = Number(form.value.roleSort); - open.value = true; - nextTick(() => { - roleMenu.then((res) => { - let checkedKeys = res.checkedKeys; - checkedKeys.forEach((v) => { - nextTick(() => { - menuRef.value.setChecked(v, true, false); - }); - }); - }); - }); - title.value = "修改角色"; - }); + reset(); + const roleId = row.roleId || ids.value; + const roleMenu = getRoleMenuTreeselect(roleId); + getRole(roleId).then(response => { + form.value = response.data; + form.value.roleSort = Number(form.value.roleSort); + open.value = true; + nextTick(() => { + roleMenu.then((res) => { + let checkedKeys = res.checkedKeys; + checkedKeys.forEach((v) => { + nextTick(() => { + menuRef.value.setChecked(v, true, false); + }); + }); + }); + }); + title.value = "修改分组排班信息"; + }); } /** 根据角色ID查询菜单树结构 */ function getRoleMenuTreeselect(roleId) { - return roleMenuTreeselect(roleId).then(response => { - menuOptions.value = response.menus; - return response; - }); + return roleMenuTreeselect(roleId).then(response => { + menuOptions.value = response.menus; + return response; + }); } /** 根据角色ID查询部门树结构 */ function getDeptTree(roleId) { - return deptTreeSelect(roleId).then(response => { - deptOptions.value = response.depts; - return response; - }); + return deptTreeSelect(roleId).then(response => { + deptOptions.value = response.depts; + return response; + }); } /** 树权限(展开/折叠)*/ function handleCheckedTreeExpand(value, type) { - if (type == "menu") { - let treeList = menuOptions.value; - for (let i = 0; i < treeList.length; i++) { - menuRef.value.store.nodesMap[treeList[i].id].expanded = value; - } - } else if (type == "dept") { - let treeList = deptOptions.value; - for (let i = 0; i < treeList.length; i++) { - deptRef.value.store.nodesMap[treeList[i].id].expanded = value; - } - } + if (type == "menu") { + let treeList = menuOptions.value; + for (let i = 0; i < treeList.length; i++) { + menuRef.value.store.nodesMap[treeList[i].id].expanded = value; + } + } else if (type == "dept") { + let treeList = deptOptions.value; + for (let i = 0; i < treeList.length; i++) { + deptRef.value.store.nodesMap[treeList[i].id].expanded = value; + } + } } /** 树权限(全选/全不选) */ function handleCheckedTreeNodeAll(value, type) { - if (type == "menu") { - menuRef.value.setCheckedNodes(value ? menuOptions.value : []); - } else if (type == "dept") { - deptRef.value.setCheckedNodes(value ? deptOptions.value : []); - } + if (type == "menu") { + menuRef.value.setCheckedNodes(value ? menuOptions.value : []); + } else if (type == "dept") { + deptRef.value.setCheckedNodes(value ? deptOptions.value : []); + } } /** 树权限(父子联动) */ function handleCheckedTreeConnect(value, type) { - if (type == "menu") { - form.value.menuCheckStrictly = value ? true : false; - } else if (type == "dept") { - form.value.deptCheckStrictly = value ? true : false; - } + if (type == "menu") { + form.value.menuCheckStrictly = value ? true : false; + } else if (type == "dept") { + form.value.deptCheckStrictly = value ? true : false; + } } /** 所有菜单节点数据 */ function getMenuAllCheckedKeys() { - // 目前被选中的菜单节点 - let checkedKeys = menuRef.value.getCheckedKeys(); - // 半选中的菜单节点 - let halfCheckedKeys = menuRef.value.getHalfCheckedKeys(); - checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys); - return checkedKeys; + // 目前被选中的菜单节点 + let checkedKeys = menuRef.value.getCheckedKeys(); + // 半选中的菜单节点 + let halfCheckedKeys = menuRef.value.getHalfCheckedKeys(); + checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys); + return checkedKeys; } /** 提交按钮 */ function submitForm() { - proxy.$refs["roleRef"].validate(valid => { - if (valid) { - if (form.value.roleId != undefined) { - form.value.menuIds = getMenuAllCheckedKeys(); - updateRole(form.value).then(response => { - proxy.$modal.msgSuccess("修改成功"); - open.value = false; - getList(); - }); - } else { - form.value.menuIds = getMenuAllCheckedKeys(); - addRole(form.value).then(response => { - proxy.$modal.msgSuccess("新增成功"); - open.value = false; - getList(); - }); - } - } - }); + proxy.$refs["roleRef"].validate(valid => { + if (valid) { + if (form.value.roleId != undefined) { + form.value.menuIds = getMenuAllCheckedKeys(); + updateRole(form.value).then(response => { + proxy.$modal.msgSuccess("修改成功"); + open.value = false; + getList(); + }); + } else { + form.value.menuIds = getMenuAllCheckedKeys(); + addRole(form.value).then(response => { + proxy.$modal.msgSuccess("新增成功"); + open.value = false; + getList(); + }); + } + } + }); } /** 取消按钮 */ function cancel() { - open.value = false; - reset(); + open.value = false; + reset(); } /** 选择角色权限范围触发 */ function dataScopeSelectChange(value) { - if (value !== "2") { - deptRef.value.setCheckedKeys([]); - } + if (value !== "2") { + deptRef.value.setCheckedKeys([]); + } } /** 分配数据权限操作 */ function handleDataScope(row) { - reset(); - const deptTreeSelect = getDeptTree(row.roleId); - getRole(row.roleId).then(response => { - form.value = response.data; - openDataScope.value = true; - nextTick(() => { - deptTreeSelect.then(res => { - nextTick(() => { - if (deptRef.value) { - deptRef.value.setCheckedKeys(res.checkedKeys); - } - }); - }); - }); - title.value = "分配数据权限"; - }); + reset(); + const deptTreeSelect = getDeptTree(row.roleId); + getRole(row.roleId).then(response => { + form.value = response.data; + openDataScope.value = true; + nextTick(() => { + deptTreeSelect.then(res => { + nextTick(() => { + if (deptRef.value) { + deptRef.value.setCheckedKeys(res.checkedKeys); + } + }); + }); + }); + title.value = "分配数据权限"; + }); } /** 提交按钮(数据权限) */ function submitDataScope() { - if (form.value.roleId != undefined) { - form.value.deptIds = getDeptAllCheckedKeys(); - dataScope(form.value).then(response => { - proxy.$modal.msgSuccess("修改成功"); - openDataScope.value = false; - getList(); - }); - } + if (form.value.roleId != undefined) { + form.value.deptIds = getDeptAllCheckedKeys(); + dataScope(form.value).then(response => { + proxy.$modal.msgSuccess("修改成功"); + openDataScope.value = false; + getList(); + }); + } } /** 取消按钮(数据权限)*/ function cancelDataScope() { - openDataScope.value = false; - reset(); + openDataScope.value = false; + reset(); } getList(); diff --git a/ruoyi-fastapi-frontend/src/views/roster/batch/selectUser.vue b/ruoyi-fastapi-frontend/src/views/roster/batch/selectUser.vue new file mode 100644 index 0000000..9269f5c --- /dev/null +++ b/ruoyi-fastapi-frontend/src/views/roster/batch/selectUser.vue @@ -0,0 +1,138 @@ + + + -- Gitee From 4e662ae1c98906a32b8081b3b0a5e32193f2b077 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98qinlong123=E2=80=99?= <‘1459657883@qq.com’> Date: Thu, 10 Oct 2024 14:33:16 +0800 Subject: [PATCH 03/12] =?UTF-8?q?=E6=8E=92=E7=8F=AD=E5=88=86=E7=BB=84?= =?UTF-8?q?=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/roster/batch/index.vue | 77 ++++++++----------- .../src/views/roster/fake/index.vue | 0 2 files changed, 32 insertions(+), 45 deletions(-) create mode 100644 ruoyi-fastapi-frontend/src/views/roster/fake/index.vue diff --git a/ruoyi-fastapi-frontend/src/views/roster/batch/index.vue b/ruoyi-fastapi-frontend/src/views/roster/batch/index.vue index 0c7e540..a764290 100644 --- a/ruoyi-fastapi-frontend/src/views/roster/batch/index.vue +++ b/ruoyi-fastapi-frontend/src/views/roster/batch/index.vue @@ -83,9 +83,6 @@ - - - - - - - - - - - - - - - - - - - 展开/折叠 - 全选/全不选 - 父子联动 - - - + + + + {{ employee.name }} ({{ + employee.id }}) + + + @@ -138,6 +118,13 @@ const router = useRouter(); const { proxy } = getCurrentInstance(); const { sys_normal_disable } = proxy.useDict("sys_normal_disable"); +const employees = [ + { id: 'E001', name: '张三' }, + { id: 'E002', name: '李四' }, + { id: 'E003', name: '王五' } +]; +const selectedEmployees = ref([]); +const showDialog = ref(false); const workDate = ref(''); const workTimeList = ['8:00-12:00', '12:00-16:00', '16:00-20:00']; // const roleList = ref([]); @@ -191,17 +178,17 @@ const fenzuList = [ { command: '白班', workTime: '8:00-12:00', employees: '张三,李四,王五', createTime: '2024-10-08' }, ] -/** 查询角色列表 */ +/** 查询分组列表 */ function getList() { loading.value = true; total.value = fenzuList.length; loading.value = false; - listRole(proxy.addDateRange(queryParams.value, dateRange.value)).then(response => { - // roleList.value = response.rows; - console.log(response) - loading.value = false; - }); + // listRole(proxy.addDateRange(queryParams.value, dateRange.value)).then(response => { + // // roleList.value = response.rows; + // console.log(response) + // loading.value = false; + // }); } /** 搜索按钮操作 */ function handleQuery() { @@ -262,14 +249,14 @@ function handleCommand(command, row) { } /** 分配用户 */ function handleAuthUser(row) { - router.push("/system/role-auth/user/" + row.roleId); + showDialog.value = true; } /** 查询菜单树结构 */ -function getMenuTreeselect() { - menuTreeselect().then(response => { - menuOptions.value = response.data; - }); -} +// function getMenuTreeselect() { +// menuTreeselect().then(response => { +// menuOptions.value = response.data; +// }); +// } /** 所有部门节点数据 */ function getDeptAllCheckedKeys() { // 目前被选中的部门节点 @@ -305,7 +292,7 @@ function reset() { /** 添加分组信息 */ function handleAdd() { reset(); - getMenuTreeselect(); + // getMenuTreeselect(); open.value = true; title.value = "添加分组排班信息"; } diff --git a/ruoyi-fastapi-frontend/src/views/roster/fake/index.vue b/ruoyi-fastapi-frontend/src/views/roster/fake/index.vue new file mode 100644 index 0000000..e69de29 -- Gitee From 027ca204b11e8c68adb4dbfe1f8b76587208f98f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98qinlong123=E2=80=99?= <‘1459657883@qq.com’> Date: Fri, 11 Oct 2024 10:51:27 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-fastapi-frontend/src/api/rost/time.js | 27 +++++ .../src/views/roster/batch/index.vue | 78 ++++++------- .../src/views/roster/timeTemplate/index.vue | 104 +++++++++++++----- 3 files changed, 138 insertions(+), 71 deletions(-) create mode 100644 ruoyi-fastapi-frontend/src/api/rost/time.js diff --git a/ruoyi-fastapi-frontend/src/api/rost/time.js b/ruoyi-fastapi-frontend/src/api/rost/time.js new file mode 100644 index 0000000..b043289 --- /dev/null +++ b/ruoyi-fastapi-frontend/src/api/rost/time.js @@ -0,0 +1,27 @@ +import request from '@/utils/request' + +// 查询角色列表 +export function listTimeTemplate(query) { + return request({ + url: '/kaoqin/time_span/list', + method: 'get', + params: query + }) +} + +// 新增角色 +export function addTimeTemplate(data) { + return request({ + url: '/kaoqin/time_span', + method: 'post', + data: data + }) +} + +// 删除角色 +export function delTimeTemplate(timeTemplateIds) { + return request({ + url: '/kaoqin/time_span/' + timeTemplateIds, + method: 'delete' + }) +} diff --git a/ruoyi-fastapi-frontend/src/views/roster/batch/index.vue b/ruoyi-fastapi-frontend/src/views/roster/batch/index.vue index a764290..3324325 100644 --- a/ruoyi-fastapi-frontend/src/views/roster/batch/index.vue +++ b/ruoyi-fastapi-frontend/src/views/roster/batch/index.vue @@ -94,7 +94,10 @@ - + + 全选 + + {{ employee.name }} ({{ employee.id }}) @@ -118,6 +121,28 @@ const router = useRouter(); const { proxy } = getCurrentInstance(); const { sys_normal_disable } = proxy.useDict("sys_normal_disable"); +const checkAll = ref(false) +const isIndeterminate = ref(false) + +function handleCheckAllChange(val) { + if (val) { + // 全选 + selectedEmployees.value = employees.map(employee => employee.id); + } else { + // 取消全选 + selectedEmployees.value = []; + } + // 更新半选状态 + isIndeterminate.value = selectedEmployees.value.length > 0 && selectedEmployees.value.length < employees.length; +} + +function handleCheckedEmployeesChange(value) { + // 更新全选状态 + checkAll.value = value.length === employees.length; + + // 更新半选状态 + isIndeterminate.value = value.length > 0 && value.length < employees.length; +} const employees = [ { id: 'E001', name: '张三' }, { id: 'E002', name: '李四' }, @@ -125,7 +150,7 @@ const employees = [ ]; const selectedEmployees = ref([]); const showDialog = ref(false); -const workDate = ref(''); + const workTimeList = ['8:00-12:00', '12:00-16:00', '16:00-20:00']; // const roleList = ref([]); const open = ref(false); @@ -147,14 +172,7 @@ const openDataScope = ref(false); const menuRef = ref(null); const deptRef = ref(null); -/** 数据范围选项*/ -const dataScopeOptions = ref([ - { value: "1", label: "全部数据权限" }, - { value: "2", label: "自定数据权限" }, - { value: "3", label: "本部门数据权限" }, - { value: "4", label: "本部门及以下数据权限" }, - { value: "5", label: "仅本人数据权限" } -]); + const data = reactive({ form: {}, @@ -170,6 +188,7 @@ const data = reactive({ roleKey: [{ required: true, message: "权限字符不能为空", trigger: "blur" }], roleSort: [{ required: true, message: "角色顺序不能为空", trigger: "blur" }] }, + selectedEmployees: [], }); const { queryParams, form, rules } = toRefs(data); @@ -223,17 +242,7 @@ function handleSelectionChange(selection) { single.value = selection.length != 1; multiple.value = !selection.length; } -/** 角色状态修改 */ -function handleStatusChange(row) { - let text = row.status === "0" ? "启用" : "停用"; - proxy.$modal.confirm('确认要"' + text + '""' + row.roleName + '"角色吗?').then(function () { - return changeRoleStatus(row.roleId, row.status); - }).then(() => { - proxy.$modal.msgSuccess(text + "成功"); - }).catch(function () { - row.status = row.status === "0" ? "1" : "0"; - }); -} + /** 更多操作 */ function handleCommand(command, row) { switch (command) { @@ -346,31 +355,8 @@ function handleCheckedTreeExpand(value, type) { } } } -/** 树权限(全选/全不选) */ -function handleCheckedTreeNodeAll(value, type) { - if (type == "menu") { - menuRef.value.setCheckedNodes(value ? menuOptions.value : []); - } else if (type == "dept") { - deptRef.value.setCheckedNodes(value ? deptOptions.value : []); - } -} -/** 树权限(父子联动) */ -function handleCheckedTreeConnect(value, type) { - if (type == "menu") { - form.value.menuCheckStrictly = value ? true : false; - } else if (type == "dept") { - form.value.deptCheckStrictly = value ? true : false; - } -} -/** 所有菜单节点数据 */ -function getMenuAllCheckedKeys() { - // 目前被选中的菜单节点 - let checkedKeys = menuRef.value.getCheckedKeys(); - // 半选中的菜单节点 - let halfCheckedKeys = menuRef.value.getHalfCheckedKeys(); - checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys); - return checkedKeys; -} + + /** 提交按钮 */ function submitForm() { proxy.$refs["roleRef"].validate(valid => { diff --git a/ruoyi-fastapi-frontend/src/views/roster/timeTemplate/index.vue b/ruoyi-fastapi-frontend/src/views/roster/timeTemplate/index.vue index 0d9d427..117f269 100644 --- a/ruoyi-fastapi-frontend/src/views/roster/timeTemplate/index.vue +++ b/ruoyi-fastapi-frontend/src/views/roster/timeTemplate/index.vue @@ -7,27 +7,34 @@ - - + + - - + - - + + - + 添加模板 + + + + + 刷新 + @@ -36,14 +43,14 @@
-

上班时间:{{ template.startTime }}

-

下班时间:{{ template.endTime }}

+

上班时间:{{ template.timeStart }}

+

下班时间:{{ template.timeEnd }}

@@ -55,7 +62,8 @@ -- Gitee From 58af00684c12ca2e80052a990d528577108ea69d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98qinlong123=E2=80=99?= <‘1459657883@qq.com’> Date: Sat, 12 Oct 2024 14:58:42 +0800 Subject: [PATCH 06/12] =?UTF-8?q?=E6=8E=92=E7=8F=AD=E5=88=86=E7=BB=84?= =?UTF-8?q?=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/roster/batch/index.vue | 84 +++++++++++-------- 1 file changed, 49 insertions(+), 35 deletions(-) diff --git a/ruoyi-fastapi-frontend/src/views/roster/batch/index.vue b/ruoyi-fastapi-frontend/src/views/roster/batch/index.vue index 8beaded..a8034c5 100644 --- a/ruoyi-fastapi-frontend/src/views/roster/batch/index.vue +++ b/ruoyi-fastapi-frontend/src/views/roster/batch/index.vue @@ -8,11 +8,11 @@ - - + + - + @@ -86,7 +86,8 @@ - +
- - - - 全选 - - - {{ - employee[1] }} - - - + @@ -160,12 +145,10 @@ const gridData = [ }, ] -import { listEployees, addRostGroup, delRostGroup, addRost, listTimeTemplate, listRostGroup } from "@/api/rost/batch"; +import { listEployees, addRostGroup, listRostGroup } from "@/api/rost/batch"; import { ref } from "vue"; -const router = useRouter(); const { proxy } = getCurrentInstance(); -const { sys_normal_disable } = proxy.useDict("sys_normal_disable"); // 部门列表 const deptList = ref([ @@ -174,13 +157,8 @@ const deptList = ref([ { deptId: 3, deptName: "部门1" }, ]); -// 分配员工列表 +// 员工列表 const employeeList = ref([]); -const selectedEmployees = ref([]); // 选中的员工id列表 -const showDialog = ref(false); -const isIndeterminate = ref(false); -const checkAll = ref(false); -const rosterEmployeeList = ref([]); const workTimeList = ref([]); // const roleList = ref([]); @@ -188,15 +166,9 @@ const open = ref(false); const loading = ref(true); const showSearch = ref(true); const ids = ref([]); -const single = ref(true); -const multiple = ref(true); const total = ref(0); const title = ref(""); const dateRange = ref([]); -const menuExpand = ref(false); -const menuNodeAll = ref(false); -const deptExpand = ref(true); -const deptNodeAll = ref(false); const menuRef = ref(null); @@ -207,8 +179,9 @@ const data = reactive({ queryParams: { pageNum: 1, pageSize: 10, - rosterName: undefined, - status: undefined + eployeeId: "", + employeeName: "", + deptId: "", }, rules: { rosterName: [{ required: true, message: "排班名称不能为空", trigger: "blur" }], @@ -231,12 +204,7 @@ function getList() { console.log(response); total.value = response.total; fenzuList.value = response.rows; - // fenzuList.splice(0, fenzuList.length); - // response.rows.forEach(item => { - // fenzuList.push(item); - // }); console.log('fenzuList', fenzuList); - }); loading.value = false; @@ -252,24 +220,6 @@ function resetQuery() { proxy.resetForm("queryRef"); handleQuery(); } -/** 删除按钮操作 */ -function handleDelete(row) { - console.log('row', row.rosterId); - const rosterIds = row.rosterId || ids.value; - proxy.$modal.confirm('是否确认删除角色编号为"' + rosterIds + '"的数据项?').then(function () { - return delRostGroup(); - }).then(() => { - getList(); - proxy.$modal.msgSuccess("删除成功"); - }).catch(() => { }); -} - -/** 多选框选中数据 */ -function handleSelectionChange(selection) { - ids.value = selection.map(item => item.roleId); - single.value = selection.length != 1; - multiple.value = !selection.length; -} /** 重置新增的表单以及其他数据 */ function reset() { @@ -284,18 +234,7 @@ function reset() { }; proxy.resetForm("leaveRef"); } -/** 添加分组信息 */ -function handleAdd() { - reset(); - // getMenuTreeselect(); - listTimeTemplate().then(res => { - console.log(res) - workTimeList.value = res.rows; - console.log('workTimeList', workTimeList) - }) - open.value = true; - title.value = "添加分组排班信息"; -} + /** 修改请假信息 */ function handleUpdate(row) { reset(); @@ -347,15 +286,6 @@ function cancel() { /** 请假申请弹出框 */ function handleAuthUser(row) { - // showDialog.value = true; - // console.log(row); - // listEployees().then(response => { - // console.log(response); - // employeeList.value = response.msg; - // console.log(employeeList.value); - // }); - // rosterEmployeeList.rosterId = row.rosterId; - // console.log('rosterEmployeeList', rosterEmployeeList); open.value = true; title.value = "请假申请"; @@ -366,34 +296,15 @@ function handleView(row) { dialogTableVisible.value = true; } -// 分配员工多选框全选操作 -function handleCheckAllChange(val) { - selectedEmployees.value = val ? employeeList.value.map(employee => employee[0]) : []; - isIndeterminate.value = false; -} -function handleCheckedEmployeesChange(value) { - const checkedCount = value.length; - const totalCount = employeeList.value.length; - checkAll.value = checkedCount === totalCount; - isIndeterminate.value = checkedCount > 0 && checkedCount < totalCount; -} -// 在对应排班信息中添加选中的员工 -function addSelectedEmployees(val) { - // console.log(val) - rosterEmployeeList.value = val; - // console.log('rosterEmployeeList', rosterEmployeeList); - - addRost(rosterEmployeeList).then(response => { +// 获取员工列表 +function getEmployeeList() { + listEployees().then(response => { console.log(response); - showDialog.value = false; - selectedEmployees.value = []; - - isIndeterminate.value = false; - checkAll.value = false; - getList(); - proxy.$modal.msgSuccess("添加成功"); + employeeList.value = response.msg; + console.log(employeeList.value); }); } getList(); +getEmployeeList(); -- Gitee From 222d2f0f59ab836d214f0ff7f6a2d1701f8fb3ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98qinlong123=E2=80=99?= <‘1459657883@qq.com’> Date: Sun, 13 Oct 2024 12:09:56 +0800 Subject: [PATCH 08/12] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E7=BB=9F=E8=AE=A1+UI?= =?UTF-8?q?=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-fastapi-frontend/.env.development | 4 +- ruoyi-fastapi-frontend/.env.production | 4 +- ruoyi-fastapi-frontend/.env.staging | 4 +- ruoyi-fastapi-frontend/index.html | 2 +- ruoyi-fastapi-frontend/package.json | 2 +- .../src/layout/components/Navbar.vue | 4 +- .../src/views/dashboard/index.vue | 870 ++++-------------- .../src/views/dashboard/index1.vue | 738 +++++++++++++++ ruoyi-fastapi-frontend/src/views/login.vue | 2 +- ruoyi-fastapi-frontend/src/views/register.vue | 2 +- .../src/views/roster/batch/index.vue | 1 + 11 files changed, 927 insertions(+), 706 deletions(-) create mode 100644 ruoyi-fastapi-frontend/src/views/dashboard/index1.vue diff --git a/ruoyi-fastapi-frontend/.env.development b/ruoyi-fastapi-frontend/.env.development index a086d04..218f52f 100644 --- a/ruoyi-fastapi-frontend/.env.development +++ b/ruoyi-fastapi-frontend/.env.development @@ -1,8 +1,8 @@ # 页面标题 -VITE_APP_TITLE = vfadmin管理系统 +VITE_APP_TITLE = 考勤管理系统 # 开发环境配置 VITE_APP_ENV = 'development' -# vfadmin管理系统/开发环境 +# 考勤管理系统/开发环境 VITE_APP_BASE_API = '/dev-api' diff --git a/ruoyi-fastapi-frontend/.env.production b/ruoyi-fastapi-frontend/.env.production index ac80031..a260241 100644 --- a/ruoyi-fastapi-frontend/.env.production +++ b/ruoyi-fastapi-frontend/.env.production @@ -1,10 +1,10 @@ # 页面标题 -VITE_APP_TITLE = vfadmin管理系统 +VITE_APP_TITLE = 考勤管理系统 # 生产环境配置 VITE_APP_ENV = 'production' -# vfadmin管理系统/生产环境 +# 考勤管理系统/生产环境 VITE_APP_BASE_API = '/prod-api' # 是否在打包时开启压缩,支持 gzip 和 brotli diff --git a/ruoyi-fastapi-frontend/.env.staging b/ruoyi-fastapi-frontend/.env.staging index c3fcf1a..0ad21e9 100644 --- a/ruoyi-fastapi-frontend/.env.staging +++ b/ruoyi-fastapi-frontend/.env.staging @@ -1,10 +1,10 @@ # 页面标题 -VITE_APP_TITLE = vfadmin管理系统 +VITE_APP_TITLE = 考勤管理系统 # 生产环境配置 VITE_APP_ENV = 'staging' -# vfadmin管理系统/生产环境 +# 考勤管理系统/生产环境 VITE_APP_BASE_API = '/stage-api' # 是否在打包时开启压缩,支持 gzip 和 brotli diff --git a/ruoyi-fastapi-frontend/index.html b/ruoyi-fastapi-frontend/index.html index ab221b8..78ebd7f 100644 --- a/ruoyi-fastapi-frontend/index.html +++ b/ruoyi-fastapi-frontend/index.html @@ -7,7 +7,7 @@ - vfadmin管理系统 + 考勤管理系统 \ No newline at end of file + diff --git a/ruoyi-fastapi-frontend/src/views/dashboard/index1.vue b/ruoyi-fastapi-frontend/src/views/dashboard/index1.vue new file mode 100644 index 0000000..68023f7 --- /dev/null +++ b/ruoyi-fastapi-frontend/src/views/dashboard/index1.vue @@ -0,0 +1,738 @@ + + + + + + + + \ No newline at end of file diff --git a/ruoyi-fastapi-frontend/src/views/login.vue b/ruoyi-fastapi-frontend/src/views/login.vue index 28904a7..d9556c9 100644 --- a/ruoyi-fastapi-frontend/src/views/login.vue +++ b/ruoyi-fastapi-frontend/src/views/login.vue @@ -1,7 +1,7 @@ @@ -104,14 +105,14 @@ 全选 - - {{ + + {{ employee[1] }} @@ -120,7 +121,7 @@ - diff --git a/ruoyi-fastapi-frontend/src/views/roster/leave/index.vue b/ruoyi-fastapi-frontend/src/views/roster/leave/index.vue new file mode 100644 index 0000000..096330d --- /dev/null +++ b/ruoyi-fastapi-frontend/src/views/roster/leave/index.vue @@ -0,0 +1,435 @@ + + + \ No newline at end of file diff --git a/ruoyi-fastapi-frontend/src/views/roster/fake/index.vue b/ruoyi-fastapi-frontend/src/views/roster/leave/index1.vue similarity index 92% rename from ruoyi-fastapi-frontend/src/views/roster/fake/index.vue rename to ruoyi-fastapi-frontend/src/views/roster/leave/index1.vue index 2e8a3a2..838ae7a 100644 --- a/ruoyi-fastapi-frontend/src/views/roster/fake/index.vue +++ b/ruoyi-fastapi-frontend/src/views/roster/leave/index1.vue @@ -9,7 +9,7 @@ - + @@ -38,7 +38,7 @@ --> - + @@ -119,7 +119,7 @@ - -- Gitee From 608d81798a8b3d39c15f6626dbc614aae5a49ef6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98qinlong123=E2=80=99?= <‘1459657883@qq.com’> Date: Tue, 15 Oct 2024 14:34:04 +0800 Subject: [PATCH 10/12] =?UTF-8?q?=E8=AF=B7=E5=81=87=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-fastapi-frontend/src/api/rost/leave.js | 11 +++ .../src/views/roster/leave/index.vue | 85 ++++++++++++++----- 2 files changed, 77 insertions(+), 19 deletions(-) diff --git a/ruoyi-fastapi-frontend/src/api/rost/leave.js b/ruoyi-fastapi-frontend/src/api/rost/leave.js index 9612768..c27d6b7 100644 --- a/ruoyi-fastapi-frontend/src/api/rost/leave.js +++ b/ruoyi-fastapi-frontend/src/api/rost/leave.js @@ -18,3 +18,14 @@ export function editUserLeave(data) { }); } +// 获取用户详细信息 +export function getUserInfo(query) { + return request({ + url: "/kaoqin/leave/info", + method: "get", + params: query + }); +} + + + diff --git a/ruoyi-fastapi-frontend/src/views/roster/leave/index.vue b/ruoyi-fastapi-frontend/src/views/roster/leave/index.vue index 096330d..81f5303 100644 --- a/ruoyi-fastapi-frontend/src/views/roster/leave/index.vue +++ b/ruoyi-fastapi-frontend/src/views/roster/leave/index.vue @@ -95,7 +95,7 @@ - + @@ -121,19 +121,20 @@ - - - - {{ item.timeStart }} - {{ item.timeEnd }} + + + + {{ leavedDatetime.leave_datetime[0] }} - {{ leavedDatetime.leave_datetime[1] }} - + - @@ -171,14 +172,24 @@
+ + + + + + + + + + \ No newline at end of file -- Gitee From af22a7aa2e4d2917ee2b1f4271773654189cbcdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98qinlong123=E2=80=99?= <‘1459657883@qq.com’> Date: Tue, 15 Oct 2024 15:28:14 +0800 Subject: [PATCH 11/12] =?UTF-8?q?=E8=AF=B7=E5=81=87=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E3=80=81=E4=BF=AE=E6=94=B9=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E6=95=B0=E6=8D=AE=E9=87=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-fastapi-frontend/src/views/roster/leave/index.vue | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ruoyi-fastapi-frontend/src/views/roster/leave/index.vue b/ruoyi-fastapi-frontend/src/views/roster/leave/index.vue index 81f5303..febf2da 100644 --- a/ruoyi-fastapi-frontend/src/views/roster/leave/index.vue +++ b/ruoyi-fastapi-frontend/src/views/roster/leave/index.vue @@ -110,7 +110,7 @@ - +
@@ -249,6 +249,7 @@ const data = reactive({ deptId: undefined }, rules: { + leaveId: [{ required: true, message: "请假时间不能为空", trigger: "blur" }], leaveType: [{ required: true, message: "请假类别不能为空", trigger: "blur" }], leaveReason: [{ required: true, message: "请假原因不能为空", trigger: "blur" }], newLeaveDatetime: [{ required: true, message: "请假时间不能为空", trigger: "blur" }] @@ -308,9 +309,6 @@ function handleExport() { }, `user_${new Date().getTime()}.xlsx`); }; - - - /** 选择条数 */ function handleSelectionChange(selection) { ids.value = selection.map(item => item.userId); @@ -384,7 +382,7 @@ function handleAuthUser(row) { /** 修改请假信息 */ function handleUpdate(row) { - form.value.userId = row.userId; + // form.value.userId = row.userId; open.value = true; title.value = "请假信息修改"; // 根据工号获取员工的所有请假信息 -- Gitee From cb11102153ffc6742f82a223f461412cb555f52f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98qinlong123=E2=80=99?= <‘1459657883@qq.com’> Date: Tue, 15 Oct 2024 16:08:31 +0800 Subject: [PATCH 12/12] =?UTF-8?q?=E8=AF=B7=E5=81=87=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3=E8=81=94=E8=B0=83=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-fastapi-frontend/src/api/rost/leave.js | 1 + .../src/views/roster/leave/index.vue | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ruoyi-fastapi-frontend/src/api/rost/leave.js b/ruoyi-fastapi-frontend/src/api/rost/leave.js index c27d6b7..9b55055 100644 --- a/ruoyi-fastapi-frontend/src/api/rost/leave.js +++ b/ruoyi-fastapi-frontend/src/api/rost/leave.js @@ -15,6 +15,7 @@ export function editUserLeave(data) { return request({ url: "/kaoqin/leave", method: "put", + data: data, }); } diff --git a/ruoyi-fastapi-frontend/src/views/roster/leave/index.vue b/ruoyi-fastapi-frontend/src/views/roster/leave/index.vue index febf2da..2837ecf 100644 --- a/ruoyi-fastapi-frontend/src/views/roster/leave/index.vue +++ b/ruoyi-fastapi-frontend/src/views/roster/leave/index.vue @@ -406,7 +406,7 @@ function handleUpdate(row) { }); } -/** 提交按钮 */ + /** 提交按钮 */ function submitForm() { console.log('form.value', form.value); @@ -431,7 +431,15 @@ function submitForm() { getList(); }); } else { - + // 遍历已请假时间列表,给form赋值选中的请假信息(根据选中的) + for (let i = 0; i < leavedDatetimeList.value.length; i++) { + if (leavedDatetimeList.value[i].leave_id === form.value.leaveId) { + form.value.leaveType = leavedDatetimeList.value[i].leave_type; + form.value.leaveReason = leavedDatetimeList.value[i].leave_reason; + } + } + // form.value.leaveReason = ""; + // form.value.leaveType = ""; editUserLeave(form.value).then(response => { console.log('response', response); proxy.$modal.msgSuccess("修改成功!"); -- Gitee