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;
+ }
+}