diff --git a/.env.dr b/.env.dr index 99babbcf..edb7b759 100644 --- a/.env.dr +++ b/.env.dr @@ -33,7 +33,7 @@ VUE_APP_THEME_CLASS = 'theme-blue-black' VUE_APP_BASE_API = '/dev-api' #平台大屏地址 -VUE_APP_BIGSCREEN_PLATFORM_URL = 'https://goview.drgyen.cn/#/chart/preview/202409060982078' +VUE_APP_BIGSCREEN_PLATFORM_URL = 'https://goview.drgyen.cn/#/chart/preview/202409030993958' #项目大屏地址 VUE_APP_BIGSCREEN_PROJECT_URL = '' @@ -55,4 +55,4 @@ port= 9988 // 开发端 # target = https://digital-core.dieruen-iot.com // 黄明 本地 -target = http://192.168.1.17:8899 +target = https://digital-core.dieruen-iot.com diff --git a/.env.drprod b/.env.drprod index ed56f0b7..fe61b6e4 100644 --- a/.env.drprod +++ b/.env.drprod @@ -34,7 +34,7 @@ VUE_APP_THEME_CLASS = 'theme-blue-black' VUE_APP_BASE_API = '/prod-api' #平台大屏地址 -VUE_APP_BIGSCREEN_PLATFORM_URL = 'https://goview.drgyen.cn/#/chart/preview/202409060982078' +VUE_APP_BIGSCREEN_PLATFORM_URL = 'https://goview.drgyen.cn/#/chart/preview/202409030993958' #项目大屏地址 VUE_APP_BIGSCREEN_PROJECT_URL = '' @@ -52,4 +52,4 @@ port= 9988 // 测试端 // target = http://192.168.10.241:32024 // 开发端 - target = https://power-core.drgyen.com + target = https://digital-core.dieruen-iot.com diff --git a/src/api/tenant/projectUser.js b/src/api/tenant/projectUser.js index 5acf3a79..48e7df4a 100644 --- a/src/api/tenant/projectUser.js +++ b/src/api/tenant/projectUser.js @@ -27,6 +27,8 @@ export function addProjectUser(data) { }); } + + // 删除项目用户 export function delProjectUser(projectId, userIds) { return request({ @@ -43,3 +45,46 @@ export function exportProjectUser(query) { params: query }); } + +// 查询项目列表 +export function listProjectMember(query) { + return request({ + url: "/app/project/userlist", + method: "get", + params: query + }); +} + +// 新增项目成员 +export function addProjectMember(data) { + return request({ + url: "/app/project/useradd", + method: "post", + data: data + }); +} + +// 修改项目成员角色 +export function editProjectMemberRole(projectId, userId,roleKey) { + return request({ + url: "/app/project/" + projectId + '/' + userId + '/' + roleKey, + method: "put", + }); +} + +// 移交项目成员 +export function transferProjectMember(data) { + return request({ + url: "/app/project/transfer", + method: "post", + data: data + }); +} + +// 删除项目成员 +export function delProjectMember(projectId, userIds) { + return request({ + url: "/app/project/" + projectId + '/' + userIds, + method: "delete" + }); +} diff --git a/src/views/iot/device/index.vue b/src/views/iot/device/index.vue index ba4557c3..a4dc8207 100644 --- a/src/views/iot/device/index.vue +++ b/src/views/iot/device/index.vue @@ -133,22 +133,21 @@ > - + - + + + + + + + - - + + + + + + + + + + + + + + + 修改角色 + + 解除用户 + >删除成员 + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + 用户昵称 + + {{editForm.nickName}} + + + + + + + + + + + + + + + + 用户手机号 + + + + + + + + + + + + + @@ -104,8 +202,11 @@ import { listProjectUser, delProjectUser, addProjectUser, + listProjectMember, + addProjectMember, + delProjectMember, exportProjectUser, - listProjectNotUsed + listProjectNotUsed, transferProjectMember, editProjectMemberRole } from "@/api/tenant/projectUser"; import SelectTableWrap from "@/components/SelectTable/index"; export default { @@ -117,6 +218,7 @@ export default { data() { return { selectTableShow: false, + editMemberVisible:false, tableSelectOption: {}, selectResult: {}, // 遮罩层 @@ -142,12 +244,41 @@ export default { pageNum: 1, pageSize: 10, orderByColumn: "createTime", - isAsc: "desc" + isAsc: "desc", + phoneNumber:'', }, // 表单参数 - form: {}, + form: { + projectId: null, + phone: null, + }, // 表单校验 - rules: {}, + rules: { + phone: [ + { required: true, message: "用户手机号不能为空", trigger: "blur" }, + ], + }, + editForm: { + projectId: null, + nickName: null, + userId: null, + role: null + }, + editRules: { + role: [ + { required: true, message: "用户手机号不能为空", trigger: "change" }, + ], + }, + roleList: [ + { + value: 'personal', + label: '普通成员' + }, + { + value: 'operator', + label: '设备运维员' + } + ], // 用户状态 statusOptions: [], tenantTypeOptions: [] @@ -176,6 +307,85 @@ export default { val + 1 + (this.queryParams.pageNum - 1) * this.queryParams.pageSize ); }, + childGetList(data) { + listProjectNotUsed(Object.assign(data.page, data.param)).then( + response => { + this.tableSelectOption.tableList = response.rows; + this.tableSelectOption.queryOpt.page.total = Number(response.total); + } + ); + }, + returnEvent(data) { + if (data.type === "dblclick") { + this.form.userId = data.value.userId; + this.form.tenantId = data.value.tenantId; + this.submitForm(); + } else if (data.type === "click") { + this.form.userId = data.value.userId; + this.form.tenantId = data.value.tenantId; + } + }, + // 用户状态字典翻译 + statusFormat(row, column) { + var rulesStr = ""; + this.statusOptions.forEach(v => { + if (v.dictValue === row.status) { + rulesStr = v.dictLabel; + } + }); + return rulesStr; + }, + tenantTypeFormat(row, column) { + var rulesStr = ""; + this.tenantTypeOptions.forEach(v => { + if (v.dictValue === row.status) { + rulesStr = v.dictLabel; + } + }); + return rulesStr; + }, + /** 查询项目用户关系列表 */ + getList() { + this.loading = true; + this.queryParams.projectId = this.projectId; + // let params = { + // projectId: this.projectId, + // phoneNumber: this.queryParams.phoneNumber, + // }; + listProjectMember(this.queryParams).then(response => { + this.project_tenantList = response.rows; + this.total = response.total; + this.loading = false; + }); + }, + // 取消按钮 + cancel() { + this.open = false; + this.reset(); + }, + // 表单重置 + reset() { + this.form = { + projectId: this.projectId, + phone: null, + }; + this.resetForm("form"); + }, + /** 搜索按钮操作 */ + handleQuery() { + this.queryParams.pageNum = 1; + this.getList(); + }, + /** 重置按钮操作 */ + resetQuery() { + this.resetForm("queryForm"); + this.handleQuery(); + }, + /** 新增按钮操作 */ + handleAdd() { + this.reset(); + this.handleDetails(); + }, // 打开厂商选择窗口 ——表格 handleDetails() { this.selectResult = {}; @@ -264,101 +474,68 @@ export default { }; this.selectTableShow = true; }, - childGetList(data) { - listProjectNotUsed(Object.assign(data.page, data.param)).then( - response => { - this.tableSelectOption.tableList = response.rows; - this.tableSelectOption.queryOpt.page.total = Number(response.total); - } - ); - }, - returnEvent(data) { - if (data.type === "dblclick") { - this.form.userId = data.value.userId; - this.form.tenantId = data.value.tenantId; - this.submitForm(); - } else if (data.type === "click") { - this.form.userId = data.value.userId; - this.form.tenantId = data.value.tenantId; - } - }, - // 用户状态字典翻译 - statusFormat(row, column) { - var rulesStr = ""; - this.statusOptions.forEach(v => { - if (v.dictValue === row.status) { - rulesStr = v.dictLabel; - } - }); - return rulesStr; - }, - tenantTypeFormat(row, column) { - var rulesStr = ""; - this.tenantTypeOptions.forEach(v => { - if (v.dictValue === row.status) { - rulesStr = v.dictLabel; - } - }); - return rulesStr; - }, - /** 查询项目用户关系列表 */ - getList() { - this.loading = true; - this.queryParams.projectId = this.projectId; - listProjectUser(this.queryParams).then(response => { - this.project_tenantList = response.rows; - this.total = response.total; - this.loading = false; - }); - }, - // 取消按钮 - cancel() { - this.open = false; - this.reset(); - }, - // 表单重置 - reset() { - this.form = { - projectId: this.projectId, - userId: null, - tenantId: null - }; - this.resetForm("form"); - }, - /** 搜索按钮操作 */ - handleQuery() { - this.queryParams.pageNum = 1; - this.getList(); - }, - /** 重置按钮操作 */ - resetQuery() { - this.resetForm("queryForm"); - this.handleQuery(); - }, - /** 新增按钮操作 */ - handleAdd() { - this.reset(); - this.handleDetails(); - }, /** 提交按钮 */ submitForm() { - addProjectUser(this.form).then(response => { - this.msgSuccess("新增成功"); - this.selectTableShow = false; - this.getList(); + // addProjectUser(this.form).then(response => { + // this.msgSuccess("新增成功"); + // this.selectTableShow = false; + // this.getList(); + // }); + this.$refs['form'].validate((valid) => { + if (valid) { + // alert('submit!'); + addProjectMember(this.form).then(response => { + this.msgSuccess("新增成功"); + this.selectTableShow = false; + this.getList(); + }); + } else { + console.log('error submit!!'); + return false; + } }); }, + //项目移交 + handleTransfer(row){ + const projectIds = this.projectId; + const userId = row.userId; + transferProjectMember({projectIds,userId}).then(res=>{ + this.msgSuccess(res.msg); + }).catch(err=>{ + this.msgError(err.msg); + }) + }, + //修改角色 + handleEdit(){ + editProjectMemberRole(this.editForm.projectId,this.editForm.userId,this.editForm.role).then(res=>{ + this.msgSuccess(res.msg); + this.editMemberVisible = false; + this.getList(); + }).catch(err=>{ + this.msgError(err.msg); + }) + }, + openEdit(row) { + console.log("row",row) + this.editForm = { + projectId: this.projectId, + nickName: row.nickName, + userId: row.userId, + role: row.roleKey + } + this.editMemberVisible = true; + }, /** 删除按钮操作 */ handleDelete(row) { const projectIds = this.projectId; const userId = row.userId; - this.$confirm("是否确认解除当前人员?", "警告", { + this.$confirm("是否确认删除当前成员?", "警告", { confirmButtonText: "确定", cancelButtonText: "取消", type: "warning" }) .then(function() { - return delProjectUser(projectIds, userId); + return delProjectMember(projectIds, userId); }) .then(() => { this.getList(); diff --git a/src/views/login-blue-black.vue b/src/views/login-blue-black.vue index 11246246..1863be61 100644 --- a/src/views/login-blue-black.vue +++ b/src/views/login-blue-black.vue @@ -10,19 +10,24 @@ - 运营登录 - - - - 用户登录 - + {{ formTitleType === 'system'?'运营登录':'用户登录' }} + + + + + + + + + + + + + + @@ -32,50 +37,66 @@ - - + + - - - - - - + - - - + + + + + + + + + + + + + + + 记住密码 登 录 登 录 中... + + + 运营登录 + + + 用户登录 + + @@ -142,7 +163,7 @@ export default { this.systemName = process.env.VUE_APP_SYSTEM_NAME; this.recordNumber = process.env.VUE_APP_RECORD_NUMBER; - this.getCode(); + // this.getCode(); this.getCookie(); }, methods: { @@ -203,7 +224,7 @@ export default { }) .catch(() => { this.loading = false; - this.getCode(); + // this.getCode(); }); } }); @@ -212,7 +233,7 @@ export default { }; -