From b6241d801261d7ca8b7618aababa722a93934b04 Mon Sep 17 00:00:00 2001 From: liudianxin Date: Wed, 10 Jun 2020 10:15:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=88=97=E8=A1=A8=EF=BC=8C?= =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=BF=A1=E6=81=AF=EF=BC=8C=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/menu.vue | 14 +-- src/components/service-list/service_list.vue | 27 +++-- src/components/service_shop_menu.vue | 12 +- src/pages/service_shop/shop_list.vue | 27 +++-- src/pages/user/user.vue | 2 +- src/pages/user/user_info.vue | 121 +++++++++++++++---- src/request/api/authority.js | 4 +- src/request/api/user.js | 12 ++ src/router/index.js | 31 ++++- 9 files changed, 187 insertions(+), 63 deletions(-) diff --git a/src/components/menu.vue b/src/components/menu.vue index c0f4c4e..02b30a0 100644 --- a/src/components/menu.vue +++ b/src/components/menu.vue @@ -103,23 +103,23 @@ export default { children: [ { name: "数据服务", - path: "/shop/service/5" + path: "/shop/data_service_list/5" }, { name: "时空服务", - path: "/shop/service/6" + path: "/shop/space_time_service_list/6" }, { name: "视频服务", - path: "/shop/service/7" + path: "/shop/video_service_list/7" }, { name: "感知服务", - path: "/shop/service/10" + path: "/shop/perception_service_list/10" }, { name: "综合应用", - path: "/shop/service/11" + path: "/shop/comprehensive_app_list/11" }, { name: "云资源服务", @@ -127,7 +127,7 @@ export default { }, { name: "应用商店", - path: "/shop/service/12" + path: "/shop/app_store_list/12" } ] } @@ -195,7 +195,7 @@ export default { this.$api.serviceShop.getShoppingCart().then(response => { if (response.data.success == "1") { console.log(response.data.data); - this.shopping_list = response.data.data.valid.slice(0, 3); + this.shopping_list = response.data.data.valid ? response.data.data.valid.slice(0, 3):[]; } else { console.log(response.data.message); } diff --git a/src/components/service-list/service_list.vue b/src/components/service-list/service_list.vue index 0e2d694..4ccd24b 100644 --- a/src/components/service-list/service_list.vue +++ b/src/components/service-list/service_list.vue @@ -2,7 +2,6 @@
@@ -140,10 +139,6 @@ export default { BlockRadius }, props: { - urlList: { - type: String, - default: "" - }, urlFilter: { type: String, default: "" @@ -201,9 +196,15 @@ export default { page: 1, limit: 10 }), - mounted() { - this.getShopList(); - this.getShopFilter(); + mounted() {}, + watch: { + urlFilter: { + handler(val) { + if (val) { + this.getShopFilter(); + } + } + } }, methods: { getShopList() { @@ -219,7 +220,7 @@ export default { Size: this.limit }; this.$api.serviceShop.getServiceShopList(query).then(response => { - if (response.data.message == "success") { + if (response.data.success == "1") { this.lists = response.data.data; } else { console.log(response.data.message); @@ -242,9 +243,11 @@ export default { this.filterLists[2].childDomains = data.organizations ? data.organizations : []; + console.log(this.filterLists); setTimeout(() => { this.judgeHeight(); }, 0); + this.getShopList(); } else { console.log(response.data.errMsg); } @@ -287,6 +290,7 @@ export default { }); } } + console.log(this.activeOptions); this.getFilterValue(); }, clickItemChild(index, indexs, items) { @@ -346,7 +350,6 @@ export default { this.getShopList(); }, clickAll(item) { - console.log(item); this.activeOptions[item] = []; this.activeChildOptions[item] = []; } diff --git a/src/components/service_shop_menu.vue b/src/components/service_shop_menu.vue index c4bada7..184e354 100644 --- a/src/components/service_shop_menu.vue +++ b/src/components/service_shop_menu.vue @@ -24,35 +24,35 @@ export default { { id: 0, label: "数据服务", - router: "/shop/service/5", + router: "/shop/data_service_list/5", active: "tool_ic_shujufw_sel", default: "tool_ic_shujufw" }, { id: 1, label: "时空服务", - router: "/shop/service/6", + router: "/shop/space_time_service_list/6", active: "tool_ic_shikongfw_sel", default: "tool_ic_shikongfw" }, { id: 2, label: "视频服务", - router: "/shop/service/7", + router: "/shop/video_service_list/7", active: "tool_ic_shipinfw_sel", default: "tool_ic_shipinfw" }, { id: 3, label: "感知服务", - router: "/shop/service/10", + router: "/shop/perception_service_list/10", active: "tool_ic_ganzhifw_sel", default: "tool_ic_ganzhifw" }, { id: 4, label: "综合服务", - router: "/shop/service/11", + router: "/shop/comprehensive_app_list/11", active: "tool_ic_zongheyyfw_sel", default: "tool_ic_zongheyyfw" }, @@ -66,7 +66,7 @@ export default { { id: 6, label: "应用商店", - router: "/shop/service/12", + router: "/shop/app_store_list/12", active: "tool_ic_yingyongsd_sel", default: "tool_ic_yingyongsd" } diff --git a/src/pages/service_shop/shop_list.vue b/src/pages/service_shop/shop_list.vue index bdc5ee0..9b31f10 100644 --- a/src/pages/service_shop/shop_list.vue +++ b/src/pages/service_shop/shop_list.vue @@ -5,7 +5,7 @@ - +
@@ -22,7 +22,6 @@ export default { data: () => ({ urlFilter: "", url: "", - urlList: "2222", name: "" }), mounted() { @@ -30,34 +29,44 @@ export default { }, methods: { getVal(val) { - switch (val) { - case "/shop/data_service_list": + let uri = val.substring(6); + uri = uri.substring(0, uri.indexOf("/")); + console.log(uri); + switch (uri) { + case "data_service_list": this.name = "数据服务"; this.urlFilter = "5"; + this.url = "/shop/sjfwDetail"; break; - case "/shop/space_time_service_list": + case "space_time_service_list": this.name = "时空服务"; this.urlFilter = "6"; + this.url = "/shop/skfwDetail"; break; - case "/shop/video_service_list": + case "video_service_list": this.name = "视频服务"; this.urlFilter = "7"; + this.url = ""; break; - case "/shop/perception_service_list": + case "perception_service_list": this.name = "感知服务"; this.urlFilter = "10"; + this.url = ""; break; - case "/shop/comprehensive_app_list": + case "comprehensive_app_list": this.name = "综合服务"; this.urlFilter = ""; + this.url = "/shop/zhfwDetail"; break; - case "/shop/app_store_list": + case "app_store_list": this.name = "应用商店"; this.urlFilter = ""; + this.url = "/shop/yysdDetail"; break; default: this.name = ""; this.urlFilter = ""; + this.url = ""; break; } } diff --git a/src/pages/user/user.vue b/src/pages/user/user.vue index b19a7d1..97bb69d 100644 --- a/src/pages/user/user.vue +++ b/src/pages/user/user.vue @@ -17,7 +17,7 @@ export default { data: () => ({ userNav: [ { - name: "个人档案", + name: "哪来的我个人档案", path: `/user/user_info` }, { diff --git a/src/pages/user/user_info.vue b/src/pages/user/user_info.vue index cc5f9ee..f3e06b2 100644 --- a/src/pages/user/user_info.vue +++ b/src/pages/user/user_info.vue @@ -5,24 +5,28 @@ {{ $t("lang.profile") }} - +
- +

账号:

- +

密码:

- + 修改密码

昵称:

- +

头像:

@@ -37,23 +41,30 @@

联系人:

- +

手机号:

- +

邮箱:

- +

组织机构:

- +
-

当前角色:

- +

当前用户类型:

+ + + 升级为开发者
@@ -126,15 +137,15 @@

旧密码:

- +

新密码:

- +

请再次输入密码:

- +
@@ -157,15 +168,20 @@ export default { }, data: () => ({ activeName: "0", - form: { + user_data: { accountNo: "", - password: "", + password: "12345678", nickname: "", contactPerson: "", phone: "", email: "", organization: "", - role: "" + userType: "" + }, + form: { + passwordOld: "", + passwordNew: "", + nextname: "" }, imgList: [], formBusiness: { @@ -194,14 +210,51 @@ export default { blackAddShow: false, newIpWhite: "", newIpBlack: "", - diaPassWord: false + diaPassWord: false, + userTypeOptions: [ + { value: 1, label: "超级管理员" }, + { value: 2, label: "组织管理员" }, + { value: 3, label: "普通用户" }, + { value: 4, label: "普通用户开发者" } + ] }), mounted() { - this.imgList.push( - "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg" - ); + // this.imgList.push( + // "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg" + // ); + this.getCurrentUser(); }, methods: { + getCurrentUser() { + this.$api.user.getNowUser().then(response => { + if (response.data.success == 1) { + this.getUserInfo(response.data.data.user_id); + } else { + console.log(response.data.errMsg); + } + }); + }, + getUserInfo(id) { + this.$api.user.getUserDetail({ id: id }).then(response => { + if (response.data.success == 1) { + let data = response.data.data; + this.user_data.accountNo = data.user_id; + this.user_data.nickname = data.user_name; + this.user_data.contactPerson = data.link_man; + this.user_data.phone = data.user_id; + this.user_data.email = data.user_id; + this.user_data.organization = data.department; + this.user_data.userType = data.is_admin; + this.imgList.push(data.picture_path); + this.formBusiness.businessSystemName = data.system_name; + this.formBusiness.domainName = data.domain_name; + this.formBusiness.ip_white = data.ip_whitelist; + this.formBusiness.ip_black = data.ip_blacklist; + this.formBusiness.key = data.key; + this.formBusiness.description = data.description; + } + }); + }, changeTab() {}, getNewList(val) { console.log(val); @@ -214,10 +267,23 @@ export default { cancelChangePwd() { this.diaPassWord = false; }, - submitChangePwd() {}, - upLevel() { - this.diaPassWord = true; + submitChangePwd() { + this.$api.user.editUserPassword(query).then(response => { + if (response.data.success == 1) { + this.$message({ + message: "修改密码成功", + type: "success" + }); + this.diaPassWord = false; + } else { + this.$message({ + message: "修改密码失败", + type: "error" + }); + } + }); }, + upLevel() {}, copyKey() { this.$refs.keys.select(); document.execCommand("Copy"); @@ -373,6 +439,13 @@ export default { width: calc(100% - 140px); margin-right: 10px; } +.info_item_right_btn .el-select { + width: calc(100% - 140px); + margin-right: 10px; +} +.info_item_right_btn .el-select .el-input { + width: 100%; +} .info_item_right_btn_2 .el-input { width: calc(100% - 280px); margin-right: 10px; diff --git a/src/request/api/authority.js b/src/request/api/authority.js index 178f01a..096b3ed 100644 --- a/src/request/api/authority.js +++ b/src/request/api/authority.js @@ -20,7 +20,9 @@ const authority = { }, editMenu(params) { return axios.put(`/apaas/backmgt/menu`, params); - } + }, + + // } export default authority; diff --git a/src/request/api/user.js b/src/request/api/user.js index f958044..8796826 100644 --- a/src/request/api/user.js +++ b/src/request/api/user.js @@ -2,9 +2,21 @@ import axios from '@/request/http'; // 导入http中创建的axios实例 import qs from 'qs'; // 根据需求是否导入qs模块 const user = { + // order orderList(params) { return axios.get(`/apaas/serviceapp/v3/order/list?serviceName=${params.select}&orderStatus=${params.status}&serviceTypes=${params.types.join(',')}&Page=${params.page}&Size=${params.limit}`); }, + + // user info + getNowUser() { + return axios.get(`/apaas/backmgt/user/getCurrentUser`); + }, + getUserDetail(params) { + return axios.get(`/apaas/backmgt/user/detail/${params.id}`); + }, + editUserPassword(params) { + return axios.post(`/apaas/backmgt/user/password/${params.id}`, params.form); + }, } export default user; diff --git a/src/router/index.js b/src/router/index.js index 8e9ee8e..ea97b32 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -114,12 +114,32 @@ export default new Router({ { path: "/shop", // 服务超市 name: "shop", - redirect: "/shop/service", + redirect: "/shop/data_service_list/5", component: () => import("@/pages/service_shop/shop"), children: [ { - path: "/shop/service/:id", // 数据服务、时空、视频、感知、综合、应用列表页 - name: "shopList", + path: "/shop/data_service_list/:id", // 数据服务列表页 + name: "shopDataList", + component: () => import("@/pages/service_shop/shop_list"), + }, + { + path: "/shop/space_time_service_list/:id", // 时空服务列表页 + name: "shopSpaceTimeList", + component: () => import("@/pages/service_shop/shop_list"), + }, + { + path: "/shop/video_service_list/:id", // 视频服务列表页 + name: "shopVideoList", + component: () => import("@/pages/service_shop/shop_list"), + }, + { + path: "/shop/perception_service_list/:id", // 感知服务列表页 + name: "shopPerceptionList", + component: () => import("@/pages/service_shop/shop_list"), + }, + { + path: "/shop/comprehensive_app_list/:id", // 综合应用列表页 + name: "shopComAppList", component: () => import("@/pages/service_shop/shop_list"), }, { @@ -133,6 +153,11 @@ export default new Router({ component: () => import("@/pages/service_shop/service_application_successfully"), }, + { + path: "/shop/app_store_list/:id", // 应用商店列表页 + name: "shopAppStoreList", + component: () => import("@/pages/service_shop/shop_list"), + }, { path: "/shop/shopping_cart", // 购物车页 name: "shoppingCart", -- 2.26.0