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/assets/styles/index.scss b/src/assets/styles/index.scss index 9b6cfb2..5c1a3c7 100644 --- a/src/assets/styles/index.scss +++ b/src/assets/styles/index.scss @@ -524,3 +524,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; } } 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 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) } 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 }} 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 @@
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 } }) 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; + } +}