Commit a6547379 authored by 刘殿昕's avatar 刘殿昕

Merge branch 'ldx' into dev

parents cfab0983 13b969e4
<template>
<div class="menu">
<img src="../assets/imgs/home_img_logo.png" alt class="logo" />
<div
style="float:right;cursor: pointer;position:relative;"
class="user_hover"
>
<div style="float:right;cursor: pointer;position:relative;" class="user_hover">
<span class="user">用户</span>
<img src="../assets/imgs/home_ic_user.png" alt class="user_pic" />
<div class="user_menu">
......@@ -12,16 +9,11 @@
v-for="(item, index) in user_arr"
:key="index + 700"
@click="gotopage(item.path)"
>
{{ item.name }}
</div>
>{{ item.name }}</div>
</div>
<div class="sj"></div>
</div>
<div
style="float:right;cursor: pointer;position:relative;"
class="shop_hover"
>
<div style="float:right;cursor: pointer;position:relative;" class="shop_hover">
<div class="number">99+</div>
<img src="../assets/imgs/home_ic_shop.png" alt class="car" />
<div class="shop_menu">
......@@ -56,17 +48,11 @@
</p>
</div>
<div>
<img
@click.stop="deleteItem(item.id)"
src="../assets/imgs/ic_delete.png"
alt
/>
<img @click.stop="deleteItem(item.id)" src="../assets/imgs/ic_delete.png" alt />
</div>
</div>
<div class="shop_footer">
<el-button @click="settlement" size="small" class="shop_settlement"
>去购物车申请结算</el-button
>
<el-button @click="settlement" size="small" class="shop_settlement">去购物车申请结算</el-button>
</div>
</div>
<div class="shop_sj"></div>
......@@ -81,24 +67,14 @@
:style="{ color: now_menu == index ? '#fff' : '' }"
>
{{ item.name }}
<div
class="user_menu"
v-if="item.children && item.children.length"
style="left: 30px;"
>
<div class="user_menu" v-if="item.children && item.children.length" style="left: 30px;">
<div
v-for="(v, indexs) in item.children"
:key="indexs + 700"
@click.stop="gotoChildPage(v, index)"
>
{{ v.name }}
</div>
>{{ v.name }}</div>
</div>
<div
class="sj"
v-if="item.children && item.children.length"
style="left: 60px;"
></div>
<div class="sj" v-if="item.children && item.children.length" style="left: 60px;"></div>
<div class="bottom_show" v-if="now_menu == index"></div>
</div>
</div>
......@@ -116,21 +92,21 @@ export default {
children: [
{
name: "服务注册",
path: "/fwzc/fwcs",
path: "/fwzc/fwcs"
},
{
name: "服务管理",
path: "/fwgl/",
path: "/fwgl/"
},
{
name: "应用管理",
path: "/yygl/",
},
],
path: "/yygl/"
}
]
},
{
name: "技术支持",
path: "/xxx",
path: "/xxx"
},
{
name: "服务超市",
......@@ -138,34 +114,34 @@ export default {
children: [
{
name: "数据服务",
path: "/shop/data_service_list/5",
path: "/shop/data_service_list/5"
},
{
name: "时空服务",
path: "/shop/space_time_service_list/6",
path: "/shop/space_time_service_list/6"
},
{
name: "视频服务",
path: "/shop/video_service_list/7",
path: "/shop/video_service_list/7"
},
{
name: "感知服务",
path: "/shop/perception_service_list/10",
path: "/shop/perception_service_list/10"
},
{
name: "综合应用",
path: "/shop/comprehensive_app_list/11",
path: "/shop/comprehensive_app_list/11"
},
{
name: "云资源服务",
path: "/shop/cloud",
path: "/shop/cloud"
},
{
name: "应用商店",
path: "/shop/app_store_list/12",
},
],
},
path: "/shop/app_store_list/12"
}
]
}
],
now_menu: 2,
user_arr: [
......@@ -173,34 +149,51 @@ export default {
{ name: "消息通知", path: "/user/message" },
{ name: "收银中心", path: "/authority" },
{ name: "关于BD-aPaaS", path: "/data_analysis" },
{ name: "退出登录", path: "" },
{ name: "退出登录", path: "logout" }
],
shopping_list: [],
shopping_list: []
};
},
mounted() {
this.getMenuIndex();
this.getList();
},
computed: {
getMenuCartState() {
return this.$store.state.menuCartState;
},
}
},
watch: {
getMenuCartState(newVal) {
this.getList();
},
}
},
methods: {
gotopage(n) {
if (n == "logout") {
let query = {
returnUrl: this.$route.path
};
this.$api.general.logout(query).then(response => {
if (response.data.success == 1) {
this.$message({
message: `登出成功`,
type: "success"
});
} else {
console.log(response.data.errMsg);
}
});
} else {
this.$router.push(n);
}
},
settlement() {
this.$router.push({ name: "shoppingCart" });
},
deleteItem(id) {
let query = [id];
this.$api.serviceShop.delShoppingCart(query).then((response) => {
this.$api.serviceShop.delShoppingCart(query).then(response => {
this.getList();
});
},
......@@ -212,6 +205,7 @@ export default {
navAction(index, path) {
this.$router.push(path);
this.now_menu = index;
window.sessionStorage.setItem("menuIndex", index);
},
gotoChildPage(v, parent) {
if (v.path) {
......@@ -224,10 +218,11 @@ export default {
this.$router.push(v.path);
}
this.now_menu = parent;
window.sessionStorage.setItem("menuIndex", parent);
}
},
getList() {
this.$api.serviceShop.getShoppingCart().then((response) => {
this.$api.serviceShop.getShoppingCart().then(response => {
if (response.data.success == "1") {
console.log(response.data.data);
this.shopping_list = response.data.data.valid
......@@ -238,7 +233,12 @@ export default {
}
});
},
},
getMenuIndex() {
let index = window.sessionStorage.getItem("menuIndex");
console.log(index)
this.now_menu = index ? index : 2;
}
}
};
</script>
......
......@@ -39,7 +39,7 @@ export default {
default: ""
},
id: {
type: [String,Number],
type: [String, Number],
default: ""
},
name: {
......@@ -51,6 +51,10 @@ export default {
couldNotEdit: {
type: Boolean,
default: false
},
hasDefault: {
type: Boolean,
default: false
}
},
data: () => ({
......@@ -58,10 +62,17 @@ export default {
}),
mounted() {
this.selectValue = this.item;
if (this.selectValue == null || !this.selectValue || this.selectValue == "") {
if (
this.selectValue == null ||
!this.selectValue ||
this.selectValue == ""
) {
if (this.selectArr && this.selectArr.length != 0) {
this.selectValue = ""
// this.selectValue = this.selectArr[0].value;//去掉默认值
if (this.hasDefault) {
this.selectValue = this.selectArr[0].value;
} else {
this.selectValue = "";
}
} else {
this.selectValue = "";
}
......
......@@ -164,6 +164,7 @@
:name="scope.row.name"
:selectArr="item.selectArr"
:rowId="scope.$index"
:hasDefault="item.hasDefault"
:couldNotEdit="couldNotEdit"
@changeInputValue="changeInputValue"
></v-apaas-table-select>
......
......@@ -412,7 +412,8 @@ export default {
selectArr: [
{ label: "", value: "1" },
{ label: "", value: "0" }
]
],
hasDefault: true
},
{ label: "字段说明", prop: "descript", type: "input", align: "left" }
],
......@@ -720,7 +721,7 @@ export default {
registe() {
this.$refs.form.validate(valid => {
if (valid) {
if (this.cover.length == 0) {
if (this.cover.length != 0) {
let query = {
name: this.form.name,
sectors: this.form.area,
......@@ -744,6 +745,7 @@ export default {
this.$api.workbench.serviceAdd(query).then(response => {
if (response.data.success == 1) {
this.$message.success("服务注册成功");
this.$router.push("/fwgl/" + this.$store.getters.level);
} else {
console.log(response.data.errMsg);
this.$message.error(response.data.errMsg);
......
......@@ -3,7 +3,9 @@ import qs from 'qs'; // 根据需求是否导入qs模块
const general = {
// general api
logout(params) {
return axios.get(`/iam/api/logout?ReturnUrl=${encodeURIComponent(params.returnUrl)}`);
},
}
export default general;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment