From eda3b43e73badb292bf05c224d539101da5e2a0c Mon Sep 17 00:00:00 2001 From: lilinyuan <1084668738@qq.com> Date: Tue, 26 Mar 2024 16:28:15 +0800 Subject: [PATCH 1/7] =?UTF-8?q?fix:=20=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/styles/index.scss | 7 +++++++ src/assets/styles/sidebar.scss | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss index e47e3e0..9a4f08f 100644 --- a/src/assets/styles/index.scss +++ b/src/assets/styles/index.scss @@ -515,3 +515,10 @@ html, body, #app, .el-container, .el-aside, .el-main { .el-pagination { margin-top: 10px; } + +// 操作页面底部按钮 +.oper-page-btn { + position: fixed; + bottom: 15px; + right: 15px; +} diff --git a/src/assets/styles/sidebar.scss b/src/assets/styles/sidebar.scss index 15aad29..9713c8d 100644 --- a/src/assets/styles/sidebar.scss +++ b/src/assets/styles/sidebar.scss @@ -39,7 +39,7 @@ } } .el-menu-item.is-active { - background: #BEA266; + background: rgba(190,162,102,0.5); //background-color: #373350 !important; } } From 82947fe5b610743fe396258489ca770f88baf825 Mon Sep 17 00:00:00 2001 From: lilinyuan <1084668738@qq.com> Date: Tue, 26 Mar 2024 16:28:46 +0800 Subject: [PATCH 2/7] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4tagsView=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/tagsview.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/stores/tagsview.js b/src/stores/tagsview.js index bcd8706..b278540 100644 --- a/src/stores/tagsview.js +++ b/src/stores/tagsview.js @@ -1,20 +1,21 @@ import { defineStore } from "pinia"; import { ref } from "vue"; -import { useRouter } from "vue-router"; +import { useRouter, useRoute } from "vue-router"; export const useTagsView = defineStore('tagsView',()=>{ const router = useRouter() + const route = useRoute() //已显示的标签页list const visitedViews = ref([]) //添加标签页面 - const addVisitedViews = ({path,meta}) => { + const addVisitedViews = ({path,meta,query}) => { if(visitedViews.value.length == 0) { - visitedViews.value.push({path,meta}) + visitedViews.value.push({path,meta,query}) }else { const paths = visitedViews.value.map(item => item.path) if(paths.includes(path) == false) { - visitedViews.value.push({path,meta}) + visitedViews.value.push({path,meta,query}) } } } @@ -32,6 +33,16 @@ export const useTagsView = defineStore('tagsView',()=>{ toLastTagView(visitedViews) } + //删除当前标签页并跳转到指定路由 + const delViewAndGoView = (path) => { + visitedViews.value.forEach((item,index)=>{ + if(item.path == route.path) { + visitedViews.value.splice(index,1) + } + }) + router.push(path) + } + //删除其他标签页 const delOtherVisitedViews = ({path,meta}) => { visitedViews.value = [] @@ -50,5 +61,6 @@ export const useTagsView = defineStore('tagsView',()=>{ addVisitedViews, delVisitedViews, delOtherVisitedViews, + delViewAndGoView } }) From ed0d51d47d9240e8941d20f42eb69f74093fa51c Mon Sep 17 00:00:00 2001 From: lilinyuan <1084668738@qq.com> Date: Tue, 26 Mar 2024 16:29:09 +0800 Subject: [PATCH 3/7] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/fvcomponents/fvForm/index.vue | 3 +-- src/fvcomponents/fvTable/index.vue | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/fvcomponents/fvForm/index.vue b/src/fvcomponents/fvForm/index.vue index 2d58b50..a229a9e 100644 --- a/src/fvcomponents/fvForm/index.vue +++ b/src/fvcomponents/fvForm/index.vue @@ -5,7 +5,7 @@ label-width="auto" ref="formInstance" > - + { }) }) -console.log(filterSchma.value, 'filterSchma'); const validate = async () => { let validObj = {} diff --git a/src/fvcomponents/fvTable/index.vue b/src/fvcomponents/fvTable/index.vue index 066c029..8833ea9 100644 --- a/src/fvcomponents/fvTable/index.vue +++ b/src/fvcomponents/fvTable/index.vue @@ -6,7 +6,7 @@ v-for="btn in tableConfig.btns" :key="btn.key" :type="btn.type || ''" - :v-perm="btn.auth || '[*:*:*]'" + v-perm="btn.auth || ['*:*:*']" @click="handleClickBtns(btn.key)" > {{ btn.name }} From 03b9eae07d7a38c47fcf1b06001378f620aaaec9 Mon Sep 17 00:00:00 2001 From: lilinyuan <1084668738@qq.com> Date: Tue, 26 Mar 2024 16:30:13 +0800 Subject: [PATCH 4/7] =?UTF-8?q?fix:=20=E5=88=A0=E9=99=A4=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E6=8C=87=E4=BB=A4consolelog?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/directives/permission.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/directives/permission.js b/src/directives/permission.js index 65509b9..65ea03a 100644 --- a/src/directives/permission.js +++ b/src/directives/permission.js @@ -10,7 +10,6 @@ export const hasPerm = (el, binding, vnode) => { const hasPermission = permisstions.some(permission => { return allPermission === permission || permissiosFlag.includes(permission) }) - console.log(hasPermission); if (!hasPermission) { el.parentNode && el.parentNode.removeChild(el) } From 103b24fdb3841b2edb4b5d7015aa6ca4365fa10c Mon Sep 17 00:00:00 2001 From: lilinyuan <1084668738@qq.com> Date: Tue, 26 Mar 2024 16:30:33 +0800 Subject: [PATCH 5/7] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4tagsViewvue?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/tagsview/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layout/tagsview/index.vue b/src/layout/tagsview/index.vue index a9a1ba7..8b557ff 100644 --- a/src/layout/tagsview/index.vue +++ b/src/layout/tagsview/index.vue @@ -4,7 +4,7 @@
From f782587b79ec6609c519527d3125dfdf50653b5e Mon Sep 17 00:00:00 2001 From: lilinyuan <1084668738@qq.com> Date: Tue, 26 Mar 2024 16:30:53 +0800 Subject: [PATCH 6/7] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=85=AC?= =?UTF-8?q?=E5=85=B1=E7=BB=84=E4=BB=B6title?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/baseTitle/index.vue | 33 ++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/components/baseTitle/index.vue diff --git a/src/components/baseTitle/index.vue b/src/components/baseTitle/index.vue new file mode 100644 index 0000000..4dad714 --- /dev/null +++ b/src/components/baseTitle/index.vue @@ -0,0 +1,33 @@ + + + + + \ No newline at end of file From 462c2e2110e542c4d2c168950ee44721ba22c7a2 Mon Sep 17 00:00:00 2001 From: lilinyuan <1084668738@qq.com> Date: Tue, 26 Mar 2024 16:31:16 +0800 Subject: [PATCH 7/7] =?UTF-8?q?feat:=20=E5=AE=8C=E6=88=90user=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E7=BC=96=E8=BE=91=E8=AF=A6=E6=83=85=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/user/user.js | 23 +++- src/views/system/user/add.vue | 235 ++++++++++++++++++++++++++++++++ src/views/system/user/index.vue | 48 ++++++- 3 files changed, 297 insertions(+), 9 deletions(-) create mode 100644 src/views/system/user/add.vue diff --git a/src/api/user/user.js b/src/api/user/user.js index 30d10b5..fcd2c33 100644 --- a/src/api/user/user.js +++ b/src/api/user/user.js @@ -16,6 +16,22 @@ export const getSubCompOpt = () => { }) } +// 查询角色信息 +export const getRolesOpt = () => { + return request({ + url: '/admin/role/option', + method: 'get', + }) +} + +// 获取岗位下拉 +export const getJobOpt = () => { + return request({ + url: '/admin/job/option', + method: 'get', + }) +} + export const getUserList = (params) => { return request({ url: '/admin/user', @@ -23,18 +39,17 @@ export const getUserList = (params) => { params }) } - //获取用户详情 export const getUserDetail = (userId) => { return request({ - url: `/admin/user/info/${userId}`, + url: `/admin/mosr/user/info/${userId}`, method: "get" }); }; // 新增用户 export const addUser = (data) => { return request({ - url: '/admin/user', + url: '/admin/mosr/user', method: 'post', data }) @@ -42,7 +57,7 @@ export const addUser = (data) => { // 修改用户 export const editUser = (data) => { return request({ - url: '/admin/user', + url: '/admin/mosr/user', method: 'put', data }) diff --git a/src/views/system/user/add.vue b/src/views/system/user/add.vue new file mode 100644 index 0000000..af2541d --- /dev/null +++ b/src/views/system/user/add.vue @@ -0,0 +1,235 @@ + + + + + \ No newline at end of file diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 7ec0a9f..674b2a4 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -7,9 +7,11 @@ import Tag from '@/components/Tag.vue' import fvSelect from '@/fvcomponents/fvSelect/index.vue' import { useAuthStore } from '@/stores/userstore.js' -import { getDeptOpt, getSubCompOpt } from '../../../api/user/user'; +import { getDeptOpt, getSubCompOpt } from '../../../api/user/user.js'; +import { ElMessageBox } from 'element-plus'; const authStore = useAuthStore() +const router = useRouter() const searchConfig = ref([ { @@ -117,15 +119,18 @@ const tableConfig = reactive({ currentRender: ({row, index}) => { return (
- 编辑 - 删除 + handleEdit(row)}>编辑 + handleDel(row)}>删除
) } } ], api: '/admin/mosr/user', - params: {} + params: {}, + btns: [ + {name: '新增', type: 'primary', auth: ['admin:user:add'], key: 'add'} + ] }) const init = async () => { @@ -147,7 +152,40 @@ const search = (val) => { tableIns.value.refresh() } -const headBtnClick = (key) => {} +const handleAdd = () => { + router.push({ + path: '/system/useradd', + query: { + isAdd: 1 + } + }) +} + +const handleEdit = (row) => { + router.push({ + path: '/system/useredit', + query: { + id: row.userId + } + }) +} + +const handleDel = (row) => { + ElMessageBox.confirm('确定删除该条数据吗?', '确定删除', { + type: 'warning', + confirmButtonText: '确定', + cancelButtonText: '取消' + }).then(async res => { + // const { code } = await + }).catch(()=>{}) +} + +const headBtnClick = (key) => { + switch(key) { + case 'add': handleAdd() + break; + } +}