From 3d9f143467b3f29b533a52fb0f2509aab83c65e6 Mon Sep 17 00:00:00 2001
From: kun <1422840143@qq.com>
Date: Mon, 8 Apr 2024 19:12:10 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20BUG=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/assets/js/api/jxjadmin.js | 2 +
src/assets/js/http.js | 1 +
src/components/account.vue | 7 +-
src/components/header.vue | 2 +-
src/components/userChange.vue | 9 +-
src/store/index.js | 2 +-
src/views/companyAdmin/companyDiagram.vue | 6 +-
.../systemSetup/enterpriseInfo.vue | 1 +
src/views/home/login_v1.vue | 1 +
src/views/home/login_v2.vue | 166 +++++++++++++++---
src/views/jxjadmin/systemSettings.vue | 1 +
src/views/projectAdmin/projectIndex.vue | 26 ++-
src/views/workSpace/index.vue | 7 +-
13 files changed, 194 insertions(+), 37 deletions(-)
diff --git a/src/assets/js/api/jxjadmin.js b/src/assets/js/api/jxjadmin.js
index f7d21d9d..a8eadbd6 100644
--- a/src/assets/js/api/jxjadmin.js
+++ b/src/assets/js/api/jxjadmin.js
@@ -39,6 +39,8 @@ export const deleteModuleApi = (data) => post('xmgl/baseModule/delete', data)
export const editModuleApi = (data) => post('xmgl/baseModule/edit', data)
export const getAllModuleApi = (data) => post('xmgl/baseModule/list', data)
export const getAllModulePageApi = (data) => post('/xmgl/baseModule/page', data)
+// 新用户账号模块查询
+export const getNewUserAllModulePageApi = (data) => post('/xmgl/baseModule/getModuleAndMenuList', data)
/**
* 菜单管理
diff --git a/src/assets/js/http.js b/src/assets/js/http.js
index 2717a9e3..6f530745 100644
--- a/src/assets/js/http.js
+++ b/src/assets/js/http.js
@@ -245,6 +245,7 @@ function logout() {
store.commit('setMapBackArr', [])
store.commit('setMoudle', null)
store.commit('setProDetail', null)
+ store.commit('setSelectedGroupSn', null)
sessionStorage.clear()
sessionStorage.setItem('errorResponse', '1')
diff --git a/src/components/account.vue b/src/components/account.vue
index 549f26d7..8e91a88f 100644
--- a/src/components/account.vue
+++ b/src/components/account.vue
@@ -44,7 +44,8 @@
v-if="
$route.path.indexOf('/firm/projectManage') == -1 &&
$store.state.userInfo.accountType != 5 &&
- $store.state.userInfo.accountType != 6
+ $store.state.userInfo.accountType != 6 &&
+ $store.state.userInfo.accountType != 10
"
:title="enterpriseFront"
>
@@ -58,7 +59,8 @@
v-if="
$route.path.indexOf('/companyAdmin/companyDiagram') == -1 &&
$store.state.userInfo.accountType != 5 &&
- $store.state.userInfo.accountType != 6
+ $store.state.userInfo.accountType != 6 &&
+ $store.state.userInfo.accountType != 10
"
:title="enterpriseBackground"
>
@@ -306,6 +308,7 @@ export default {
this.$store.commit("setMapBackArr", []);
this.$store.commit("setMoudle", null);
this.$store.commit("setProDetail", null);
+ this.$store.commit('setSelectedGroupSn', null);
window.localStorage.removeItem("isIframe");
window.localStorage.removeItem("soundList");
let json = {
diff --git a/src/components/header.vue b/src/components/header.vue
index f4999d53..9df3f779 100644
--- a/src/components/header.vue
+++ b/src/components/header.vue
@@ -41,7 +41,7 @@
v-if="$route.path.indexOf('/firm/') == -1 && company != 'nanchang'"
@click="changeArea(-1)"
>{{
- titleName ? systemInfo.platformName + " - " + titleName : headerName
+ $store.state.currentProDetail.name ? systemInfo.platformName + " - " + $store.state.currentProDetail.name : headerName
}}
- 18772114025
+ {{$store.state.currentProDetail.name}}
@@ -100,6 +100,7 @@ export default {
this.selectedProjectSn = obj.sn;
// 修改全局projectSn
this.$store.commit("setProjectSn", obj.sn);
+ this.$store.commit("setProDetail", obj);
}
}
},
@@ -131,6 +132,7 @@ export default {
this.selectedProjectSn = data.projectSn;
// 修改全局projectSn
this.$store.commit("setProjectSn", data.projectSn);
+ this.$store.commit("setProDetail", data);
// 收起popover
this.visible = false;
}
@@ -207,6 +209,11 @@ export default {
cursor: pointer;
.flexStyle();
> span {
+ display: inline-block;
+ width: 77px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
margin: 0px 10px;
}
}
diff --git a/src/store/index.js b/src/store/index.js
index 6313746a..23e87f74 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -50,7 +50,7 @@ export default new Vuex.Store({
// FILEURL:' http://101.43.164.214:11111/image/',// 百色
UPLOADURL:'http://192.168.34.221:9111/upload/image/',// 郭圣雄
FILEURL:'http://192.168.34.221:9111/image/',//郭圣雄
- WORKFLOWURL: 'http://192.168.34.155:88/#/workspace/forms',//测试
+ WORKFLOWURL: 'http://192.168.34.138:88/#/workspace/forms',//测试工作流地址(本地)
// UPLOADURL:'http://10.0.1.43:6023/upload/image',//测试
// FILEURL:'http://10.0.1.43:6023/image/',//测试
// BASEURL: baseUrl
diff --git a/src/views/companyAdmin/companyDiagram.vue b/src/views/companyAdmin/companyDiagram.vue
index ed11311e..995b3391 100644
--- a/src/views/companyAdmin/companyDiagram.vue
+++ b/src/views/companyAdmin/companyDiagram.vue
@@ -263,7 +263,7 @@
-
+
{
if(item.companySn){
companySnArr.add(item.companySn)
diff --git a/src/views/companyAdmin/systemSetup/enterpriseInfo.vue b/src/views/companyAdmin/systemSetup/enterpriseInfo.vue
index 5336db91..2f264152 100644
--- a/src/views/companyAdmin/systemSetup/enterpriseInfo.vue
+++ b/src/views/companyAdmin/systemSetup/enterpriseInfo.vue
@@ -418,6 +418,7 @@ export default {
this.$store.commit('setMapBackArr', [])
this.$store.commit('setMoudle', null)
this.$store.commit('setProDetail', null)
+ this.$store.commit('setSelectedGroupSn', null);
window.localStorage.removeItem('isIframe')
window.localStorage.removeItem('soundList')
let json = {
diff --git a/src/views/home/login_v1.vue b/src/views/home/login_v1.vue
index f4f8b942..764c4e91 100644
--- a/src/views/home/login_v1.vue
+++ b/src/views/home/login_v1.vue
@@ -604,6 +604,7 @@ export default {
this.$store.commit('setMapBackArr', [])
this.$store.commit('setMoudle', null)
this.$store.commit('setProDetail', null)
+ this.$store.commit('setSelectedGroupSn', null);
window.localStorage.removeItem('isIframe')
window.localStorage.removeItem('soundList')
diff --git a/src/views/home/login_v2.vue b/src/views/home/login_v2.vue
index a6c774e3..df21f90c 100644
--- a/src/views/home/login_v2.vue
+++ b/src/views/home/login_v2.vue
@@ -82,8 +82,13 @@
-
+
{
if (res.code == 200) {
//赋值
+ // 前端判断登录账号与选中的登录方式(用户登录、供应商登录)不一致
+ if (this.loginType == 1 && res.result.accountType == 11) {
+ this.$message.error("当前登录账号与所选登录方式不符,无法登录");
+ return;
+ }
+ if (this.loginType == 2 && res.result.accountType != 11) {
+ this.$message.error("当前登录账号与所选登录方式不符,无法登录");
+ return;
+ }
this.parseLoginData(res.result);
} else {
this.$message.error(res.message);
@@ -604,8 +618,8 @@ export default {
this.isLogin = true;
},
// 去重置密码
- goReset(){
- console.log(666)
+ goReset() {
+ console.log(666);
this.$router.push({ path: "/resetPassword" });
},
// 去注册
@@ -616,7 +630,7 @@ export default {
pw: "",
email: "",
companyName: "",
- }
+ };
},
//修改密码提交
savePasswordBtn() {
@@ -704,6 +718,7 @@ export default {
this.$store.commit("setMapBackArr", []);
this.$store.commit("setMoudle", null);
this.$store.commit("setProDetail", null);
+ this.$store.commit('setSelectedGroupSn', null);
window.localStorage.removeItem("isIframe");
window.localStorage.removeItem("soundList");
@@ -729,12 +744,39 @@ export default {
loginApi(this.form).then((res) => {
console.log("--------------------么么儿们10");
console.log(res.result);
+
+ // 前端判断登录账号与选中的登录方式(用户登录、供应商登录)不一致
+ if (this.loginType == 1 && res.result.accountType == 11) {
+ this.$message.error(
+ "当前登录账号与所选登录方式不符,无法登录"
+ );
+ return;
+ }
+ if (this.loginType == 2 && res.result.accountType != 11) {
+ this.$message.error(
+ "当前登录账号与所选登录方式不符,无法登录"
+ );
+ return;
+ }
this.parseLoginData(res.result);
this.getDetail(this.headquartersSnData);
});
} else if (LOGINTYPE == 2) {
console.log(2222222222222);
companyLoginApi(this.form).then((res) => {
+ // 前端判断登录账号与选中的登录方式(用户登录、供应商登录)不一致
+ if (this.loginType == 1 && res.result.accountType == 11) {
+ this.$message.error(
+ "当前登录账号与所选登录方式不符,无法登录"
+ );
+ return;
+ }
+ if (this.loginType == 2 && res.result.accountType != 11) {
+ this.$message.error(
+ "当前登录账号与所选登录方式不符,无法登录"
+ );
+ return;
+ }
this.parseLoginData(res.result);
this.getDetail(this.headquartersSnData);
});
@@ -744,6 +786,19 @@ export default {
console.log(333333333);
projectLoginApi(this.form).then((res) => {
+ // 前端判断登录账号与选中的登录方式(用户登录、供应商登录)不一致
+ if (this.loginType == 1 && res.result.accountType == 11) {
+ this.$message.error(
+ "当前登录账号与所选登录方式不符,无法登录"
+ );
+ return;
+ }
+ if (this.loginType == 2 && res.result.accountType != 11) {
+ this.$message.error(
+ "当前登录账号与所选登录方式不符,无法登录"
+ );
+ return;
+ }
this.parseLoginData(res.result);
this.getDetail(this.headquartersSnData);
});
@@ -774,6 +829,19 @@ export default {
this.addPasswordDialog = true;
this.passwordForm.token = res.result.token;
} else {
+ // 前端判断登录账号与选中的登录方式(用户登录、供应商登录)不一致
+ if (this.loginType == 1 && res.result.accountType == 11) {
+ this.$message.error(
+ "当前登录账号与所选登录方式不符,无法登录"
+ );
+ return;
+ }
+ if (this.loginType == 2 && res.result.accountType != 11) {
+ this.$message.error(
+ "当前登录账号与所选登录方式不符,无法登录"
+ );
+ return;
+ }
this.parseLoginData(res.result);
this.getDetail(this.headquartersSnData);
}
@@ -782,6 +850,19 @@ export default {
console.log(2222222222222);
companyLoginApi(this.form).then((res) => {
+ // 前端判断登录账号与选中的登录方式(用户登录、供应商登录)不一致
+ if (this.loginType == 1 && res.result.accountType == 11) {
+ this.$message.error(
+ "当前登录账号与所选登录方式不符,无法登录"
+ );
+ return;
+ }
+ if (this.loginType == 2 && res.result.accountType != 11) {
+ this.$message.error(
+ "当前登录账号与所选登录方式不符,无法登录"
+ );
+ return;
+ }
this.parseLoginData(res.result);
this.getDetail(this.headquartersSnData);
});
@@ -789,6 +870,19 @@ export default {
console.log(333333333);
projectLoginApi(this.form).then((res) => {
+ // 前端判断登录账号与选中的登录方式(用户登录、供应商登录)不一致
+ if (this.loginType == 1 && res.result.accountType == 11) {
+ this.$message.error(
+ "当前登录账号与所选登录方式不符,无法登录"
+ );
+ return;
+ }
+ if (this.loginType == 2 && res.result.accountType != 11) {
+ this.$message.error(
+ "当前登录账号与所选登录方式不符,无法登录"
+ );
+ return;
+ }
this.parseLoginData(res.result);
this.getDetail(this.headquartersSnData);
});
@@ -804,6 +898,15 @@ export default {
this.$refs["form2"].validate((valid) => {
if (valid) {
loginPhoneApi(this.form2).then((res) => {
+ // 前端判断登录账号与选中的登录方式(用户登录、供应商登录)不一致
+ if (this.loginType == 1 && res.result.accountType == 11) {
+ this.$message.error("当前登录账号与所选登录方式不符,无法登录");
+ return;
+ }
+ if (this.loginType == 2 && res.result.accountType != 11) {
+ this.$message.error("当前登录账号与所选登录方式不符,无法登录");
+ return;
+ }
this.parseLoginData(res.result);
});
} else {
@@ -815,22 +918,26 @@ export default {
},
registerFn() {
this.$refs["registerForm"].validate((valid) => {
- // console.log("this.$refs['LoginInfo']:", this.$refs["LoginInfo"]);
- let requestData = {...this.registerForm}
- requestData.accountType = this.registerType;
- if(this.registerType == 1){
- delete requestData.enterpriseName
- }
- if (valid) {
- newRegisterApi({...this.registerForm, headquartersSn: this.headquartersSnData, accountType:this.registerType}).then((res) => {
- this.$message.success('注册成功');
- this.goLogin();
- });
- } else {
- console.log("error submit!!");
- return false;
- }
- });
+ // console.log("this.$refs['LoginInfo']:", this.$refs["LoginInfo"]);
+ let requestData = { ...this.registerForm };
+ requestData.accountType = this.registerType;
+ if (this.registerType == 1) {
+ delete requestData.enterpriseName;
+ }
+ if (valid) {
+ newRegisterApi({
+ ...this.registerForm,
+ headquartersSn: this.headquartersSnData,
+ accountType: this.registerType,
+ }).then((res) => {
+ this.$message.success("注册成功");
+ this.goLogin();
+ });
+ } else {
+ console.log("error submit!!");
+ return false;
+ }
+ });
},
selectMp3FileList() {
selectNoticeRemindSoundApi({
@@ -861,7 +968,10 @@ export default {
: [];
var companyModule = [];
var projectModule = [];
- if (moduleList.length == 0 && (data.accountType != 1 && data.accountType != 10)) {
+ if (
+ moduleList.length == 0 &&
+ data.accountType != 1 && data.accountType != 10
+ ) {
this.$message.warning("当前账号还没分配权限");
return false;
}
@@ -960,7 +1070,7 @@ export default {
console.log("arr2", arr2);
// 如果数组为空表示该用户没有权限访问
if (!arr2.length) {
- if(this.loginType == 1){
+ if (this.loginType == 1) {
// this.$router.push("/projectIndex");
this.$router.push("/workSpace");
} else {
@@ -975,7 +1085,7 @@ export default {
(data.styleType != 2 && data.styleType != 3) ||
!data.styleType
) {
- if(this.loginType == 1){
+ if (this.loginType == 1) {
// this.$router.push("/projectIndex");
this.$router.push("/workSpace");
} else {
@@ -1135,7 +1245,7 @@ export default {
height: 24px;
}
}
- .operate-btn{
+ .operate-btn {
display: flex;
align-items: center;
justify-content: space-between;
diff --git a/src/views/jxjadmin/systemSettings.vue b/src/views/jxjadmin/systemSettings.vue
index b42d3ee7..5c2351ac 100644
--- a/src/views/jxjadmin/systemSettings.vue
+++ b/src/views/jxjadmin/systemSettings.vue
@@ -477,6 +477,7 @@ export default {
this.$store.commit('setMapBackArr', [])
this.$store.commit('setMoudle', null)
this.$store.commit('setProDetail', null)
+ this.$store.commit('setSelectedGroupSn', null);
window.localStorage.removeItem('isIframe')
window.localStorage.removeItem('soundList')
let json = {
diff --git a/src/views/projectAdmin/projectIndex.vue b/src/views/projectAdmin/projectIndex.vue
index b6765000..39eec627 100644
--- a/src/views/projectAdmin/projectIndex.vue
+++ b/src/views/projectAdmin/projectIndex.vue
@@ -122,6 +122,7 @@ import { getProjectDetail } from "@/assets/js/api/baseInfo.js";
import {
getProjectModuleList,
getAllModuleApi,
+ getNewUserAllModulePageApi
} from "@/assets/js/api/jxjadmin.js";
import { getSafeyHatSessionApi } from "@/assets/js/api/demo";
import { getDockingUrlApi } from "@/assets/js/api/configManage";
@@ -337,7 +338,28 @@ export default {
},
//为了展示未解锁产品,所以需要查询所有模块
getAllModule(half) {
- getAllModuleApi({
+ // 新用户功能模块
+ if(this.$store.state.userInfo.accountType == 10){
+ getNewUserAllModulePageApi({
+ projectSn: this.projectSn,
+ }).then((res) => {
+ if (res.success) {
+ var all = res.result.moduleList;
+ console.log("all", all);
+ all.forEach((element, index) => {
+ all[index].operation = false;
+ res.result.menuList.forEach((element2) => {
+ if (element2.moduleId == element.moduleId) {
+ all[index].operation = true;
+ all[index].menuList = element2.menuList;
+ }
+ });
+ });
+ this.list = all;
+ }
+ });
+ } else {
+ getAllModuleApi({
moduleType: 2,
styleType: this.$store.state.userInfo.styleType,
}).then((res) => {
@@ -356,6 +378,8 @@ export default {
this.list = all;
}
});
+ }
+
},
insertAfter(newElement, targetElement) {
// newElement是要追加的元素 targetElement 是指定元素的位置
diff --git a/src/views/workSpace/index.vue b/src/views/workSpace/index.vue
index db81cd09..08c08570 100644
--- a/src/views/workSpace/index.vue
+++ b/src/views/workSpace/index.vue
@@ -10,7 +10,7 @@
frameborder="1"
>
-
+
{