diff --git a/common/api.js b/common/api.js index 8c2f1e5..f8587aa 100644 --- a/common/api.js +++ b/common/api.js @@ -29,4 +29,16 @@ export function listWaitingReleaseRooms() { url: "/apartment/manager/listWaitingReleaseRooms", method: "get", }); +} + +// 上传文件 +export function uploadFile(data) { + return request({ + url: '/common/upload', + method: 'post', + data: data, + headers: { + 'Content-Type': 'multipart/form-data' + } + }) } \ No newline at end of file diff --git a/common/system/config.js b/common/system/config.js new file mode 100644 index 0000000..a404d82 --- /dev/null +++ b/common/system/config.js @@ -0,0 +1,60 @@ +import request from '@/utils/request' + +// 查询参数列表 +export function listConfig(query) { + return request({ + url: '/system/config/list', + method: 'get', + params: query + }) +} + +// 查询参数详细 +export function getConfig(configId) { + return request({ + url: '/system/config/' + configId, + method: 'get' + }) +} + +// 根据参数键名查询参数值 +export function getConfigKey(configKey) { + return request({ + url: '/system/config/configKey/' + configKey, + method: 'get' + }) +} + +// 新增参数配置 +export function addConfig(data) { + return request({ + url: '/system/config', + method: 'post', + data: data + }) +} + +// 修改参数配置 +export function updateConfig(data) { + return request({ + url: '/system/config', + method: 'put', + data: data + }) +} + +// 删除参数配置 +export function delConfig(configId) { + return request({ + url: '/system/config/' + configId, + method: 'delete' + }) +} + +// 刷新参数缓存 +export function refreshCache() { + return request({ + url: '/system/config/refreshCache', + method: 'delete' + }) +} diff --git a/common/system/dept.js b/common/system/dept.js new file mode 100644 index 0000000..9f8864b --- /dev/null +++ b/common/system/dept.js @@ -0,0 +1,72 @@ +import request from '@/utils/request' + +// 查询部门列表 +export function listDept(query) { + return request({ + url: '/system/dept/list', + method: 'get', + params: query + }) +} + +// 查询部门列表(排除节点) +export function listDeptExcludeChild(deptId) { + return request({ + url: '/system/dept/list/exclude/' + deptId, + method: 'get' + }) +} + +// 查询部门详细 +export function getDept(deptId) { + return request({ + url: '/system/dept/' + deptId, + method: 'get' + }) +} + +// 新增部门 +export function addDept(data) { + return request({ + url: '/system/dept', + method: 'post', + data: data + }) +} + +// 修改部门 +export function updateDept(data) { + return request({ + url: '/system/dept/edit', + method: 'post', + data: data + }) +} + +// 删除部门 +export function delDept(deptId) { + return request({ + url: "/mz/apartment/delete/" + deptId, + method: "post", + }); +} + +// 上传部门图片 +export function uploadDeptImages(data) { + return request({ + url: '/system/dept/upload', + method: 'post', + data: data, + headers: { + 'Content-Type': 'multipart/form-data' + } + }) +} + +// 房屋专属左侧组织树 +export function getdeptList() { + return request({ + url: '/mz/building/getdeptList', + method: 'get' + }) +} \ No newline at end of file diff --git a/common/system/dict/data.js b/common/system/dict/data.js new file mode 100644 index 0000000..8e3c63a --- /dev/null +++ b/common/system/dict/data.js @@ -0,0 +1,52 @@ +import request from '@/utils/request' + +// 查询字典数据列表 +export function listData(query) { + return request({ + url: '/system/dict/data/list', + method: 'get', + params: query + }) +} + +// 查询字典数据详细 +export function getData(dictCode) { + return request({ + url: '/system/dict/data/' + dictCode, + method: 'get' + }) +} + +// 根据字典类型查询字典数据信息 +export function getDicts(dictType) { + return request({ + url: '/system/dict/data/type/' + dictType, + method: 'get' + }) +} + +// 新增字典数据 +export function addData(data) { + return request({ + url: '/system/dict/data', + method: 'post', + data: data + }) +} + +// 修改字典数据 +export function updateData(data) { + return request({ + url: '/system/dict/data/updata', + method: 'post', + data: data + }) +} + +// 删除字典数据 +export function delData(dictCode) { + return request({ + url: '/system/dict/data/' + dictCode, + method: 'delete' + }) +} diff --git a/common/system/dict/type.js b/common/system/dict/type.js new file mode 100644 index 0000000..16e6aac --- /dev/null +++ b/common/system/dict/type.js @@ -0,0 +1,60 @@ +import request from '@/utils/request' + +// 查询字典类型列表 +export function listType(query) { + return request({ + url: '/system/dict/type/list', + method: 'get', + params: query + }) +} + +// 查询字典类型详细 +export function getType(dictId) { + return request({ + url: '/system/dict/type/' + dictId, + method: 'get' + }) +} + +// 新增字典类型 +export function addType(data) { + return request({ + url: '/system/dict/type', + method: 'post', + data: data + }) +} + +// 修改字典类型 +export function updateType(data) { + return request({ + url: '/system/dict/type/edit', + method: 'post', + data: data + }) +} + +// 删除字典类型 +export function delType(dictId) { + return request({ + url: '/system/dict/type/delete/' + dictId, + method: 'post' + }) +} + +// 刷新字典缓存 +export function refreshCache() { + return request({ + url: '/system/dict/type/refreshCache', + method: 'post' + }) +} + +// 获取字典选择框列表 +export function optionselect() { + return request({ + url: '/system/dict/type/optionselect', + method: 'get' + }) +} \ No newline at end of file diff --git a/common/system/menu.js b/common/system/menu.js new file mode 100644 index 0000000..6e70be1 --- /dev/null +++ b/common/system/menu.js @@ -0,0 +1,74 @@ +import request from '@/utils/request' + +// 查询菜单列表 +export function listMenu(query) { + return request({ + url: '/system/menu/list', + method: 'get', + params: query + }) +} + +// 查询菜单详细 +export function getMenu(menuId) { + return request({ + url: '/system/menu/' + menuId, + method: 'get' + }) +} + +// 查询菜单下拉树结构 +export function treeselect() { + return request({ + url: '/system/menu/treeselect', + method: 'get' + }) +} + +// 根据角色ID查询菜单下拉树结构 +export function roleMenuTreeselect(roleId) { + return request({ + url: '/system/menu/roleMenuTreeselect/' + roleId, + method: 'get' + }) +} + +// 新增菜单 +export function addMenu(data) { + return request({ + url: '/system/menu', + method: 'post', + data: data + }) +} + +// 修改菜单 +export function updateMenu(data) { + return request({ + url: '/system/menu/update', + method: 'post', + data: data + }) +} + +// 删除菜单 +export function delMenu(menuId) { + return request({ + url: '/system/menu/delete/' + menuId, + method: 'post' + }) +} +// 清除缓存 +export const clearCache = () => { + return request({ + url: '/cache/clearAll', + method: 'get' + }) +} +// 清除缓存 +export const clearCache1 = () => { + return request({ + url: '/static/count', + method: 'get' + }) +} \ No newline at end of file diff --git a/common/system/notice.js b/common/system/notice.js new file mode 100644 index 0000000..c274ea5 --- /dev/null +++ b/common/system/notice.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询公告列表 +export function listNotice(query) { + return request({ + url: '/system/notice/list', + method: 'get', + params: query + }) +} + +// 查询公告详细 +export function getNotice(noticeId) { + return request({ + url: '/system/notice/' + noticeId, + method: 'get' + }) +} + +// 新增公告 +export function addNotice(data) { + return request({ + url: '/system/notice', + method: 'post', + data: data + }) +} + +// 修改公告 +export function updateNotice(data) { + return request({ + url: '/system/notice', + method: 'put', + data: data + }) +} + +// 删除公告 +export function delNotice(noticeId) { + return request({ + url: '/system/notice/' + noticeId, + method: 'delete' + }) +} \ No newline at end of file diff --git a/common/system/post.js b/common/system/post.js new file mode 100644 index 0000000..1a8e9ca --- /dev/null +++ b/common/system/post.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询岗位列表 +export function listPost(query) { + return request({ + url: '/system/post/list', + method: 'get', + params: query + }) +} + +// 查询岗位详细 +export function getPost(postId) { + return request({ + url: '/system/post/' + postId, + method: 'get' + }) +} + +// 新增岗位 +export function addPost(data) { + return request({ + url: '/system/post', + method: 'post', + data: data + }) +} + +// 修改岗位 +export function updatePost(data) { + return request({ + url: '/system/post', + method: 'put', + data: data + }) +} + +// 删除岗位 +export function delPost(postId) { + return request({ + url: '/system/post/' + postId, + method: 'delete' + }) +} diff --git a/common/system/role.js b/common/system/role.js new file mode 100644 index 0000000..aadd9ff --- /dev/null +++ b/common/system/role.js @@ -0,0 +1,119 @@ +import request from '@/utils/request' + +// 查询角色列表 +export function listRole(query) { + return request({ + url: '/system/role/list', + method: 'get', + params: query + }) +} + +// 查询角色详细 +export function getRole(roleId) { + return request({ + url: '/system/role/' + roleId, + method: 'get' + }) +} + +// 新增角色 +export function addRole(data) { + return request({ + url: '/system/role', + method: 'post', + data: data + }) +} + +// 修改角色 +export function updateRole(data) { + return request({ + url: '/system/role/update', + method: 'post', + data: data + }) +} + +// 角色数据权限 +export function dataScope(data) { + return request({ + url: '/system/role/dataScope', + method: 'post', + data: data + }) +} + +// 角色状态修改 +export function changeRoleStatus(roleId, status) { + const data = { + roleId, + status + } + return request({ + url: '/system/role/changeStatus', + method: 'put', + data: data + }) +} + +// 删除角色 +export function delRole(roleId) { + return request({ + url: '/system/role/delete/' + roleId, + method: 'post' + }) +} + +// 查询角色已授权用户列表 +export function allocatedUserList(query) { + return request({ + url: '/system/role/authUser/allocatedList', + method: 'get', + params: query + }) +} + +// 查询角色未授权用户列表 +export function unallocatedUserList(query) { + return request({ + url: '/system/role/authUser/unallocatedList', + method: 'get', + params: query + }) +} + +// 取消用户授权角色 +export function authUserCancel(data) { + return request({ + url: '/system/role/authUser/cancel', + method: 'post', + data: data + }) +} + +// 批量取消用户授权角色 +export function authUserCancelAll(data) { + return request({ + url: '/system/role/authUser/cancelAll', + method: 'post', + params: data + }) +} + +// 授权用户选择 +export function authUserSelectAll(data) { + return request({ + url: '/system/role/authUser/selectAll', + method: 'get', + params: data + }) +} + +// 根据角色ID查询部门树结构 +export function deptTreeSelect(roleId) { + return request({ + url: '/system/role/deptTree/' + roleId, + method: 'get' + }) +} diff --git a/common/system/user.js b/common/system/user.js new file mode 100644 index 0000000..f3f5a06 --- /dev/null +++ b/common/system/user.js @@ -0,0 +1,136 @@ +import request from '@/utils/request' +import { parseStrEmpty } from "@/utils/ruoyi"; + +// 查询用户列表 +export function listUser(query) { + return request({ + url: '/system/user/list', + method: 'get', + params: query + }) +} + +// 查询用户详细 +export function getUser(userId) { + return request({ + url: '/system/user/' + parseStrEmpty(userId), + method: 'get' + }) +} + +// 新增用户 +export function addUser(data) { + return request({ + url: '/system/user', + method: 'post', + data: data + }) +} + +// 修改用户 +export function updateUser(data) { + return request({ + url: '/system/user/update', + method: 'post', + data: data + }) +} + +// 删除用户 +export function delUser(userId) { + return request({ + url: '/system/user/delete/' + userId, + method: 'post' + }) +} + +// 用户密码重置 +export function resetUserPwd(userId, password) { + const data = { + userId, + password + } + return request({ + url: '/system/user/resetPwd', + method: 'post', + data: data + }) +} + +// 用户状态修改 +export function changeUserStatus(userId, status) { + const data = { + userId, + status + } + return request({ + url: '/system/user/changeStatus', + method: 'post', + data: data + }) +} + +// 查询用户个人信息 +export function getUserProfile() { + return request({ + url: '/system/user/profile', + method: 'get' + }) +} + +// 修改用户个人信息 +export function updateUserProfile(data) { + return request({ + url: '/system/user/profile', + method: 'put', + data: data + }) +} + +// 用户密码重置 +export function updateUserPwd(oldPassword, newPassword) { + const data = { + oldPassword, + newPassword + } + return request({ + url: '/system/user/profile/updatePwd', + method: 'put', + params: data + }) +} + +// 用户头像上传 +export function uploadAvatar(data) { + return request({ + url: '/system/user/profile/avatar', + method: 'post', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + data: data + }) +} + +// 查询授权角色 +export function getAuthRole(userId) { + return request({ + url: '/system/user/authRole/' + userId, + method: 'get' + }) +} + +// 保存授权角色 +export function updateAuthRole(data) { + return request({ + url: '/system/user/authRole', + method: 'get', + params: data + }) +} + +// 查询部门下拉树结构 +export function deptTreeSelect() { + return request({ + url: '/system/user/deptTree', + method: 'get' + }) +} diff --git a/pages/tabBar/xjPage/xj.vue b/pages/tabBar/xjPage/xj.vue index 256c20c..c39ec46 100644 --- a/pages/tabBar/xjPage/xj.vue +++ b/pages/tabBar/xjPage/xj.vue @@ -9,13 +9,13 @@ - + - + @@ -68,7 +68,7 @@ - + @@ -77,20 +77,21 @@ import { queryDeptDropdownList, } from "@/common/rec"; -import { getdeptList,addInspection } from '@/common/api.js'; +import { getdeptList,addInspection,uploadFile } from '@/common/api.js'; +import { getDicts } from "@/common/system/dict/data"; export default { data () { return { + uploadUlr: 'http://219.146.91.110:30801/mz-api/common/upload', wtlxShow: false, lysqShow: false, deptOptions: [], - actions1: [ - { name: '问题1', }, - { name: '问题2', }, - ], + questionTypeList: [], form: { apartmentId: '', + apartmentName:'', questionType: '', + questionName: '', title: '', content: '', inspector: '', @@ -110,15 +111,32 @@ export default { }, onLoad () { this.getTree() + this.getDictType() }, methods: { afterRead(event) { let files = Array.isArray(event) ? event : [event] this.fileList = this.fileList.concat(files) + event.file.forEach(item=>{ + this.form.imageList.push({ + url:item.url, + name: '', + format: item.type + }) + }) + console.log(this.form.imageList); }, onDelete(event) { this.fileList.splice(event.index, 1) }, + getDictType(){ + getDicts('inspection_question_type').then((res) => { + this.questionTypeList = res.data.map(item=>{ + item.name = item.dictLabel + return item + }) + }); + }, getTree(){ getdeptList().then(async (res) => { this.deptOptions = this.handleTree( @@ -143,17 +161,37 @@ export default { }); }); }, + + uploadFile(file){ + uploadFile(file).then((res) => { + console.log(res); + }); + }, handleBtn () { - addInspection().then(res=>{ + console.log(this.form); + let parmas = JSON.parse(JSON.stringify(this.form)) + this.fileList.forEach(item => { + // parmas.imageList.push({ + // url:item.file.url, + // name: '', + // format: item.file.type + // }) + this.uploadFile(item.file) + }); + delete parmas.apartmentName + delete parmas.questionName + addInspection(parmas).then(res=>{ console.log(res); }) }, handleTreeSelect (e) { - console.log(e); - - // this.model1.userInfo.sex = e.name - // this.$refs.uForm.validateField('userInfo.sex') + this.form.apartmentName = e.name + this.form.apartmentId = e.id }, + handleQuestionSelect(e){ + this.form.questionName = e.dictLabel + this.form.questionType = e.dictValue + } } }