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

Merge branch 'ldx' into dev

parents b6ceacf9 0ccbc4e1
<template> <template>
<div id="app"> <div id="app">
<bd-menu class="outmenu"></bd-menu> <bd-menu v-if="this.$route.path != '/login'" class="outmenu"></bd-menu>
<router-view /> <router-view />
</div> </div>
</template> </template>
......
<template> <template>
<div class="order_cell"> <div class="order_cell">
<div class="order_cell_head"> <div class="order_cell_head">
<div class="application_time">申请时间:{{ cellItem.applicationTime }}</div> <div class="application_time">申请时间:{{ helper.dateFormat(cellItem.add_time) }}</div>
<div class="order_number">订单编号:{{ cellItem.orderNumber }}</div> <div class="order_number">订单编号:{{ cellItem.orderNumber }}</div>
<div class="cell_del_btn">删除</div> <div class="cell_del_btn">删除</div>
</div> </div>
...@@ -107,6 +107,7 @@ ...@@ -107,6 +107,7 @@
</template> </template>
<script> <script>
import helper from "@/services/helper";
export default { export default {
props: { props: {
cellItem: { cellItem: {
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
<el-tab-pane <el-tab-pane
v-for="(item, index) in stateList" v-for="(item, index) in stateList"
:key="'state' + index" :key="'state' + index"
:label="item" :label="item.label"
:name="item" :name="item.value"
></el-tab-pane> ></el-tab-pane>
</el-tabs> </el-tabs>
<div class="list_options"> <div class="list_options">
...@@ -85,17 +85,24 @@ export default { ...@@ -85,17 +85,24 @@ export default {
OrderList OrderList
}, },
data: () => ({ data: () => ({
stateList: ["全部订单", "待审核", "审核中", "已获取", "未通过", "已取消"], stateList: [
activeName: "全部订单", { value: "0", label: "全部订单" },
{ value: "1", label: "待审核" },
{ value: "2", label: "审核中" },
{ value: "3", label: "已获取" },
{ value: "4", label: "未通过" },
{ value: "5", label: "已取消" }
],
activeName: "0",
buttonList: [ buttonList: [
{ label: "全部", state: false }, { value: 0, label: "全部", state: false },
{ label: "数据服务", state: false }, { value: 1, label: "数据服务", state: false },
{ label: "时空服务", state: false }, { value: 2, label: "时空服务", state: false },
{ label: "视频服务", state: false }, { value: 3, label: "视频服务", state: false },
{ label: "感知服务", state: false }, { value: 4, label: "感知服务", state: false },
{ label: "综合服务", state: false }, { value: 5, label: "综合服务", state: false },
{ label: "云资源", state: false }, { value: 6, label: "云资源", state: false },
{ label: "应用镜像", state: false } { value: 7, label: "应用镜像", state: false }
], ],
search: "", search: "",
pagination: { pagination: {
...@@ -117,64 +124,15 @@ export default { ...@@ -117,64 +124,15 @@ export default {
label: "50" label: "50"
} }
], ],
datas: [ datas: []
{
id: 0,
name: "水路货物周转量情况",
type: "基础数据服务",
creator: "贵州省交通运输厅0",
state: 1,
mapService: 1,
num: 2,
checkedSubscription: false,
specification: 1,
specificationApplication: 2,
evaluationText: "这条服条服务非常好非常实用这条服务非常好非常实用这条服务非常好非常实用。这条服务非常好非常实用这条服务非常好非常实用这条服务非常好非常实用这条服务非常好非常实用这条服务非常好非常实用这条服务非常好非常实用。",
evaluationRate: 4.7,
applicationTime: "2021-04-24 15:02:00",
orderNumber: "2020042422222222000001",
getStatus: 2
},
{
id: 1,
name: "水路货物周转量情况水路货物周水路货物周转量情况水路货物周",
type: "基础数据服务",
creator: "贵州省交通运输厅1",
state: 1,
num: 2,
checkedSubscription: false,
specification: 1,
specificationApplication: 2,
evaluationText: "这条服务非常好务非常好非常实用这非常实用这条服务非常好非常实用。",
evaluationRate: 3.7,
applicationTime: "2020-04-24 15:02:00",
orderNumber: "202004241502000001",
getStatus: 3
},
{
id: 2,
name: "水路货物周转量情况水路货物周转量情况路货物周转量情况",
type: "基础数据服务",
creator: "贵州省交通运输厅2",
state: 1,
mapService: 1,
num: 2,
checkedSubscription: true,
specification: 1,
specificationApplication: 2,
evaluationText: "这条服务非常好非常实用这条服务非常好非常实用这条服务非常好非常实用这条服务非常好非常实用这条服务非常好非常实用这条服务非常好非常实用。这条服务非常好非常实用这条服务非常好非常实用这条服务非常好非常实用这条服务非常好非常实用这条服务非常好非常实用这条服务非常好非常实用。",
evaluationRate: 3.7,
applicationTime: "2020-04-24 15:02:00",
orderNumber: "202004241502000001",
getStatus: 1
}
]
}), }),
mounted() { mounted() {
this.getTotal(); this.getData();
}, },
methods: { methods: {
tabClick() {}, tabClick() {
this.getData();
},
btnClick(index) { btnClick(index) {
if (index != 0) { if (index != 0) {
this.buttonList[0].state = false; this.buttonList[0].state = false;
...@@ -185,24 +143,42 @@ export default { ...@@ -185,24 +143,42 @@ export default {
} }
this.buttonList[0].state = !this.buttonList[0].state; this.buttonList[0].state = !this.buttonList[0].state;
} }
this.getData();
}, },
// search debonce 500ms // search debonce 500ms
searchVal() { searchVal() {
if (this.times !== null) clearTimeout(this.times); if (this.times !== null) clearTimeout(this.times);
this.times = setTimeout(() => { this.times = setTimeout(() => {
this.getShopList(); this.getData();
}, 500); }, 500);
}, },
getTotal() { getData() {
this.pagination.total = this.datas.length; let arr = [];
this.buttonList.forEach(item => {
if (item.state == true) {
arr.push(item.value);
}
});
let params = {
select: this.search,
page: this.pagination.page,
limit: this.pagination.rowsPerPage,
status: this.activeName,
types: arr
};
this.$api.user.orderList(params).then(response => {
console.log(response);
this.datas = response.data.data;
this.pagination.total = response.data.total;
});
}, },
handleSizeChange(val) { handleSizeChange(val) {
this.pagination.rowsPerPage = val; this.pagination.rowsPerPage = val;
this.$emit("refresh", this.pagination); this.getData();
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.pagination.page += val; this.pagination.page += val;
this.$emit("refresh", this.pagination); this.getData();
} }
} }
}; };
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
<!-- filter --> <!-- filter -->
<div v-if="urlFilter" class="classification"> <div v-if="urlFilter" class="classification">
<div v-for="(item, index) in filterLists" :key="'cd' + index" class="classification_line"> <div v-for="(item, index) in filterLists" :key="'cd' + index" class="classification_line">
<div v-if="item.childDomains && item.childDomains.length != 0">
<div class="classification_line_title">{{ item.name }}</div> <div class="classification_line_title">{{ item.name }}</div>
<div <div
:class="index == filterLists.length - 1 ? 'classification_line_items':'classification_line_items classification_line_items_border'" :class="index == filterLists.length - 1 ? 'classification_line_items':'classification_line_items classification_line_items_border'"
...@@ -35,24 +36,31 @@ ...@@ -35,24 +36,31 @@
> >
<ul :id="item.id" class="classification_line_items_ul"> <ul :id="item.id" class="classification_line_items_ul">
<li <li
:class="items.children && openChildren[index].state == true && openChildren[index].index == indexs ? 'classification_line_items_li_act classification_line_items_li':'classification_line_items_li'" v-for="(items, indexs) in item.childDomains"
v-for="(items, indexs) in item.children" :class="items.childDomains && openChildren[index].state == true && openChildren[index].index == items.id ? 'classification_line_items_li_act classification_line_items_li':'classification_line_items_li'"
:key="'cds' + indexs" :key="'cds' + indexs"
> >
<div class="classification_span" @click="clickItem(index, indexs, items)"> <div class="classification_span">
<span <span
:class="activeOptions[index] == items.id ? 'classification_act':''" @click="clickItem(index, indexs, items)"
:class="activeOptions[index].indexOf(items.id) != -1 ? 'classification_act':''"
>{{ items.name }}</span> >{{ items.name }}</span>
<!-- if item have children, we will use an arrow to prompt --> <!-- if item have children, we will use an arrow to prompt -->
<i <i
v-if="items.children && openChildren[index].state == true && openChildren[index].index == indexs" v-if="items.childDomains && openChildren[index].state == true && openChildren[index].index == items.id"
@click="clickItemChild(index, indexs, items)"
class="el-icon-caret-top" class="el-icon-caret-top"
></i> ></i>
<i <i
v-else-if="items.children && openChildren[index].state == false && openChildren[index].index == indexs" v-else-if="items.childDomains && openChildren[index].state == false && openChildren[index].index == items.id"
@click="clickItemChild(index, indexs, items)"
class="el-icon-caret-bottom"
></i>
<i
v-else-if="items.childDomains"
@click="clickItemChild(index, indexs, items)"
class="el-icon-caret-bottom" class="el-icon-caret-bottom"
></i> ></i>
<i v-else-if="items.children" class="el-icon-caret-bottom"></i>
</div> </div>
</li> </li>
</ul> </ul>
...@@ -76,9 +84,12 @@ ...@@ -76,9 +84,12 @@
v-for="itemChildren in openChildren[index].act" v-for="itemChildren in openChildren[index].act"
:key="itemChildren.id" :key="itemChildren.id"
> >
<div class="classification_span" @click="clickChildren(itemChildren.id, index)"> <div
class="classification_span"
@click="clickChildren(itemChildren.id, index, openChildren[index].index)"
>
<span <span
:class="activeOptions[index] == itemChildren.id ? 'classification_act':''" :class="activeChildOptions[index].indexOf(itemChildren.id) != -1 ? 'classification_act':''"
>{{ itemChildren.name }}</span> >{{ itemChildren.name }}</span>
</div> </div>
</li> </li>
...@@ -87,6 +98,7 @@ ...@@ -87,6 +98,7 @@
</div> </div>
</div> </div>
</div> </div>
</div>
<div class="gray_line"></div> <div class="gray_line"></div>
<!-- filter button --> <!-- filter button -->
<div class="btn_group"> <div class="btn_group">
...@@ -94,7 +106,7 @@ ...@@ -94,7 +106,7 @@
v-for="(item, index) in buttonFilter" v-for="(item, index) in buttonFilter"
:key="item.name" :key="item.name"
size="small" size="small"
:class="item.state == false ? 'button_filter':'button_filter_act'" :class="index == activeBtn ? 'button_filter_act':'button_filter'"
@click="clickButtonFilter(index)" @click="clickButtonFilter(index)"
>{{ item.name }}</el-button> >{{ item.name }}</el-button>
</div> </div>
...@@ -140,25 +152,23 @@ export default { ...@@ -140,25 +152,23 @@ export default {
{ index: null, state: false, act: null }, { index: null, state: false, act: null },
{ index: null, state: false, act: null } { index: null, state: false, act: null }
], ],
activeOptions: [null, null, null, null], activeOptions: [[], [], [], []],
activeChildOptions: [[], [], [], []],
buttonFilter: [ buttonFilter: [
{ {
name: "综合排序", name: "综合排序"
state: false
}, },
{ {
name: "最新更新", name: "最新更新"
state: false
}, },
{ {
name: "最高人气", name: "最高人气"
state: false
}, },
{ {
name: "最好好评", name: "最好好评"
state: false
} }
], ],
activeBtn: null,
lists: [ lists: [
{ {
id: 0, id: 0,
...@@ -228,145 +238,24 @@ export default { ...@@ -228,145 +238,24 @@ export default {
], ],
filterLists: [ filterLists: [
{ {
id: 1283, id: 10,
name: "数据服务类型", name: "数据服务类型",
children: [ prop: "serviceTypeInfo",
{ childDomains: []
id: 1233,
name: "诶哦尬舞",
children: [
{ id: 18273, name: "那我空间服务" },
{
id: 12378343,
name: "诶哦尬舞"
},
{
id: 123533,
name: "诶哦尬舞"
}
]
},
{
id: 121833,
name: "诶哦尬舞"
},
{
id: 1234573,
name: "诶哦尬舞"
},
{
id: 134534233,
name: "诶哦尬舞"
},
{
id: 1234533,
name: "诶哦尬舞"
}, },
{ {
id: 123533, id: 11,
name: "诶哦尬舞",
children: [
{ id: 1824573, name: "那我空间服务" },
{
id: 123378343,
name: "诶哦尬舞"
},
{
id: 1235333,
name: "诶哦尬舞"
}
]
},
{
id: 12112833,
name: "诶哦尬舞"
},
{
id: 12341573,
name: "诶哦尬舞"
},
{
id: 1345434233,
name: "诶哦尬舞"
},
{
id: 12345533,
name: "诶哦尬舞"
}
]
},
{
id: 128133,
name: "数据服务类型", name: "数据服务类型",
children: [ prop: "serviceDomain",
{ childDomains: []
id: 123313,
name: "诶哦尬舞",
children: [
{ id: 1821373, name: "那我个社工师空间服务" },
{
id: 123728343,
name: "诶哦甲方推荐尬舞"
},
{
id: 12312533,
name: "诶哦库空调尬舞"
}
]
},
{
id: 121123833,
name: "诶哦尬舞"
},
{
id: 1231234573,
name: "诶哦达瓦大尬舞"
},
{
id: 13453334233,
name: "诶哦达瓦大尬舞"
},
{
id: 1234123533,
name: "诶哦尬舞"
},
{
id: 123512333,
name: "诶哦尬舞",
children: [
{ id: 1824123573, name: "那我空间服务" },
{
id: 1233738343,
name: "诶哦尬舞"
},
{
id: 123125333,
name: "诶哦尬舞"
}
]
},
{
id: 1211312833,
name: "诶哦挖到尬舞"
},
{
id: 12341231573,
name: "诶哦尬舞"
}, },
{ {
id: 13454314233, id: 100,
name: "诶哦色粉尬舞" name: "数据服务类型",
}, prop: "organizations",
{ childDomains: []
id: 123452533,
name: "诶环境日哦尬舞"
}
]
} }
], ],
dataServiceType: "",
dataField: "",
dataSourceOrganization: "",
page: 1, page: 1,
limit: 10 limit: 10
}), }),
...@@ -376,42 +265,38 @@ export default { ...@@ -376,42 +265,38 @@ export default {
}, },
methods: { methods: {
getShopList() { getShopList() {
// dataServiceType: "", let query = {
// dataField: "", serviceName: this.search,
// dataSourceOrganization: "" serviceType1: this.activeOptions[0].join(","),
let url = `${this.urlList}`; serviceType2s: this.activeChildOptions[0].join(","),
this.$http dataDomains: this.activeOptions[1].join(","),
.get(url) organizeIds: this.activeOptions[2].join(","),
.then(response => { orderBy: this.activeBtn,
Page: this.page,
Size: this.limit
};
this.$api.serviceShop.getServiceShopList(query).then(response => {
if (response.data.message == "success") { if (response.data.message == "success") {
this.list = response.data.data; this.list = response.data.data;
} else { } else {
console.log(response.data.message); console.log(response.data.message);
} }
})
.catch(function(response) {
this.error = true;
}); });
}, },
getShopFilter() { getShopFilter() {
let query = {
type: this.urlFilter
};
this.$api.serviceShop.getServiceShopFilter(query).then(response => {
if (response.data.success == 1) {
this.filterLists = response.data;
setTimeout(() => { setTimeout(() => {
if (this.urlFilter) {
this.judgeHeight(); this.judgeHeight();
}
}, 0); }, 0);
// let url = `${this.urlFilter}`; } else {
// this.$http console.log(response.data.errMsg);
// .get(url) }
// .then(response => { });
// if (response.data.message == "success") {
// this.filterList = response.data.data;
// } else {
// console.log(response.data.message);
// }
// })
// .catch(function(response) {
// this.error = true;
// });
}, },
judgeHeight() { judgeHeight() {
let list = this.filterLists; let list = this.filterLists;
...@@ -436,19 +321,35 @@ export default { ...@@ -436,19 +321,35 @@ export default {
// 这里不能像上面那样整体更新,因为啥我也不知道,我太菜 // 这里不能像上面那样整体更新,因为啥我也不知道,我太菜
}, },
clickItem(index, indexs, items) { clickItem(index, indexs, items) {
this.activeOptions[index] = items.id; let i = this.activeOptions[index].indexOf(items.id);
if (items.children) { if (i == -1) {
if (this.openChildren[index].index == indexs) { this.activeOptions[index].push(items.id);
} else {
this.activeOptions[index].splice(i, 1);
if (items.childDomains) {
items.childDomains.forEach(e => {
let i = this.activeChildOptions[index].indexOf(e.id);
if (i != -1) {
this.activeChildOptions[index].splice(i, 1);
}
});
}
}
this.getFilterValue();
},
clickItemChild(index, indexs, items) {
if (items.childDomains) {
if (this.openChildren[index].index == items.id) {
this.$set(this.openChildren, index, { this.$set(this.openChildren, index, {
index: indexs, index: indexs,
state: !this.openChildren[index].state, state: !this.openChildren[index].state,
act: items.children act: items.childDomains
}); });
} else { } else {
this.$set(this.openChildren, index, { this.$set(this.openChildren, index, {
index: indexs, index: items.id,
state: true, state: true,
act: items.children act: items.childDomains
}); });
} }
} else { } else {
...@@ -458,30 +359,26 @@ export default { ...@@ -458,30 +359,26 @@ export default {
act: null act: null
}); });
} }
this.getFilterValue(items.id, index);
}, },
clickButtonFilter(index) { clickButtonFilter(index) {
this.buttonFilter[index].state = !this.buttonFilter[index].state; this.activeBtn = index;
this.getShopList(); this.getShopList();
}, },
clickChildren(id, index) { clickChildren(id, index, fatherId) {
this.$set(this.activeOptions, index, id); let i = this.activeChildOptions[index].indexOf(id);
this.getFilterValue(id, index); let j = this.activeOptions[index].indexOf(fatherId);
}, if (i == -1) {
getFilterValue(id, index) { this.activeChildOptions[index].push(id);
switch (index) { if (j == -1) {
case 0: this.activeOptions[index].push(fatherId);
this.dataServiceType = id; }
break; } else {
case 1: this.activeChildOptions[index].splice(i, 1);
this.dataField = id;
break;
case 2:
this.dataSourceOrganization = id;
break;
default:
break;
} }
console.log(this.activeChildOptions, i, fatherId);
this.getFilterValue();
},
getFilterValue() {
this.getShopList(); this.getShopList();
}, },
// search debonce 500ms // search debonce 500ms
...@@ -615,6 +512,6 @@ export default { ...@@ -615,6 +512,6 @@ export default {
outline: none; outline: none;
} }
.input_right .el-input__inner:focus-within { .input_right .el-input__inner:focus-within {
border: 1px solid #626DE9; border: 1px solid #626de9;
} }
</style> </style>
\ No newline at end of file
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
<el-input-number <el-input-number
v-model="formNew.containerGroup" v-model="formNew.containerGroup"
controls-position="right" controls-position="right"
:min="1" :min="0"
:max="10" :max="10"
placeholder="取值范围[0,24]" placeholder="取值范围[0,24]"
></el-input-number> ></el-input-number>
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
<el-input-number <el-input-number
v-model="formNew.dataDisk" v-model="formNew.dataDisk"
controls-position="right" controls-position="right"
:min="1" :min="0"
:max="10" :max="10"
placeholder="请选择数量" placeholder="请选择数量"
></el-input-number> ></el-input-number>
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
<el-input-number <el-input-number
v-model="formNew.perDataDisk" v-model="formNew.perDataDisk"
controls-position="right" controls-position="right"
:min="1" :min="0"
:max="10" :max="10"
placeholder="请选择容量" placeholder="请选择容量"
></el-input-number> ></el-input-number>
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
<el-input-number <el-input-number
v-model="formNew.perCPUs" v-model="formNew.perCPUs"
controls-position="right" controls-position="right"
:min="1" :min="0"
:max="10" :max="10"
placeholder="请选择CPU最高使用量" placeholder="请选择CPU最高使用量"
></el-input-number> ></el-input-number>
...@@ -149,7 +149,7 @@ ...@@ -149,7 +149,7 @@
<el-input-number <el-input-number
v-model="formNew.perCPU" v-model="formNew.perCPU"
controls-position="right" controls-position="right"
:min="1" :min="0"
:max="10" :max="10"
placeholder="请选择CPU默认使用量" placeholder="请选择CPU默认使用量"
></el-input-number> ></el-input-number>
...@@ -165,7 +165,7 @@ ...@@ -165,7 +165,7 @@
<el-input-number <el-input-number
v-model="formNew.perRAMs" v-model="formNew.perRAMs"
controls-position="right" controls-position="right"
:min="1" :min="0"
:max="10" :max="10"
placeholder="请选择内存最高使用量" placeholder="请选择内存最高使用量"
></el-input-number> ></el-input-number>
...@@ -178,7 +178,7 @@ ...@@ -178,7 +178,7 @@
<el-input-number <el-input-number
v-model="formNew.perRAM" v-model="formNew.perRAM"
controls-position="right" controls-position="right"
:min="1" :min="0"
:max="10" :max="10"
placeholder="请选择内存默认使用量" placeholder="请选择内存默认使用量"
></el-input-number> ></el-input-number>
...@@ -194,7 +194,7 @@ ...@@ -194,7 +194,7 @@
<el-input-number <el-input-number
v-model="formNew.appDuration" v-model="formNew.appDuration"
controls-position="right" controls-position="right"
:min="1" :min="0"
:max="10" :max="10"
></el-input-number> ></el-input-number>
<el-select <el-select
...@@ -302,7 +302,7 @@ ...@@ -302,7 +302,7 @@
<el-input-number <el-input-number
v-model="formOld.containerGroup" v-model="formOld.containerGroup"
controls-position="right" controls-position="right"
:min="1" :min="0"
:max="10" :max="10"
placeholder="取值范围[0,24]" placeholder="取值范围[0,24]"
></el-input-number> ></el-input-number>
...@@ -315,7 +315,7 @@ ...@@ -315,7 +315,7 @@
<el-input-number <el-input-number
v-model="formOld.dataDisk" v-model="formOld.dataDisk"
controls-position="right" controls-position="right"
:min="1" :min="0"
:max="10" :max="10"
></el-input-number> ></el-input-number>
<div class="input_right"></div> <div class="input_right"></div>
...@@ -327,7 +327,7 @@ ...@@ -327,7 +327,7 @@
<el-input-number <el-input-number
v-model="formOld.perDataDisk" v-model="formOld.perDataDisk"
controls-position="right" controls-position="right"
:min="1" :min="0"
:max="10" :max="10"
></el-input-number> ></el-input-number>
<div class="input_right">GB</div> <div class="input_right">GB</div>
...@@ -366,7 +366,7 @@ ...@@ -366,7 +366,7 @@
<el-input-number <el-input-number
v-model="formOld.perCPUs" v-model="formOld.perCPUs"
controls-position="right" controls-position="right"
:min="1" :min="0"
:max="10" :max="10"
placeholder="请设置CPU最高使用量" placeholder="请设置CPU最高使用量"
></el-input-number> ></el-input-number>
...@@ -379,7 +379,7 @@ ...@@ -379,7 +379,7 @@
<el-input-number <el-input-number
v-model="formOld.perCPU" v-model="formOld.perCPU"
controls-position="right" controls-position="right"
:min="1" :min="0"
:max="10" :max="10"
placeholder="请设置CPU默认使用量" placeholder="请设置CPU默认使用量"
></el-input-number> ></el-input-number>
...@@ -395,7 +395,7 @@ ...@@ -395,7 +395,7 @@
<el-input-number <el-input-number
v-model="formOld.perRAMs" v-model="formOld.perRAMs"
controls-position="right" controls-position="right"
:min="1" :min="0"
:max="10" :max="10"
placeholder="请设置内存最高使用量" placeholder="请设置内存最高使用量"
></el-input-number> ></el-input-number>
...@@ -408,7 +408,7 @@ ...@@ -408,7 +408,7 @@
<el-input-number <el-input-number
v-model="formOld.perRAM" v-model="formOld.perRAM"
controls-position="right" controls-position="right"
:min="1" :min="0"
:max="10" :max="10"
placeholder="请设置内存默认使用量" placeholder="请设置内存默认使用量"
></el-input-number> ></el-input-number>
...@@ -437,7 +437,7 @@ ...@@ -437,7 +437,7 @@
<el-input-number <el-input-number
v-model="formOld.appDuration" v-model="formOld.appDuration"
controls-position="right" controls-position="right"
:min="1" :min="0"
:max="10" :max="10"
></el-input-number> ></el-input-number>
<el-select <el-select
...@@ -675,6 +675,9 @@ export default { ...@@ -675,6 +675,9 @@ export default {
getForm(val) { getForm(val) {
if (val != "") { if (val != "") {
this.formShow = true; this.formShow = true;
Object.keys(this.formOld).forEach(item => {
this.formOld[item] = "";
});
} else { } else {
this.formShow = false; this.formShow = false;
} }
...@@ -916,6 +919,7 @@ export default { ...@@ -916,6 +919,7 @@ export default {
<style> <style>
.form_block .el-input .el-input__inner { .form_block .el-input .el-input__inner {
background-color: #f7f8f9; background-color: #f7f8f9;
color: #242c43;
} }
.cloud_form .el-input { .cloud_form .el-input {
width: 100%; width: 100%;
...@@ -929,12 +933,14 @@ export default { ...@@ -929,12 +933,14 @@ export default {
} }
.cloud_form .input_has_left_right .el-input__inner { .cloud_form .input_has_left_right .el-input__inner {
border-radius: 0; border-radius: 0;
color: #242c43;
} }
.cloud_form .el-select { .cloud_form .el-select {
width: 100%; width: 100%;
} }
.cloud_form .el-input .el-input__inner { .cloud_form .el-input .el-input__inner {
background-color: #f7f8f9; background-color: #f7f8f9;
color: #242c43;
} }
.cloud_form .el-input-number { .cloud_form .el-input-number {
width: calc(100% - 60px); width: calc(100% - 60px);
...@@ -948,6 +954,7 @@ export default { ...@@ -948,6 +954,7 @@ export default {
} }
.cloud_form .el-input-number .el-input__inner { .cloud_form .el-input-number .el-input__inner {
text-align: left; text-align: left;
color: #242c43;
} }
.cloud_form .el-textarea { .cloud_form .el-textarea {
width: 100%; width: 100%;
...@@ -955,6 +962,7 @@ export default { ...@@ -955,6 +962,7 @@ export default {
.cloud_form .el-textarea .el-textarea__inner { .cloud_form .el-textarea .el-textarea__inner {
background-color: #f7f8f9; background-color: #f7f8f9;
border-radius: 8px; border-radius: 8px;
color: #242c43;
} }
.form_item .el-form-item__content { .form_item .el-form-item__content {
width: 100%; width: 100%;
...@@ -964,6 +972,7 @@ export default { ...@@ -964,6 +972,7 @@ export default {
} }
.input_has_right .el-input__inner { .input_has_right .el-input__inner {
border-radius: 8px 0 0 8px; border-radius: 8px 0 0 8px;
color: #242c43;
} }
.cloud_form .input_has_right_select .el-input-number { .cloud_form .input_has_right_select .el-input-number {
width: calc(100% - 100px); width: calc(100% - 100px);
...@@ -979,6 +988,7 @@ export default { ...@@ -979,6 +988,7 @@ export default {
} }
.input_has_right_select .el-input__inner { .input_has_right_select .el-input__inner {
border-radius: 8px 0 0 8px; border-radius: 8px 0 0 8px;
color: #242c43;
} }
.input_has_right_select .input_right_select.el-select .el-input { .input_has_right_select .input_right_select.el-select .el-input {
width: 100px; width: 100px;
...@@ -995,6 +1005,7 @@ export default { ...@@ -995,6 +1005,7 @@ export default {
} }
.input_right_select .el-input .el-input__inner { .input_right_select .el-input .el-input__inner {
background-color: #0f2683; background-color: #0f2683;
color: #242c43;
} }
.cloud_form .el-input-number .el-input-number__increase, .cloud_form .el-input-number .el-input-number__increase,
.cloud_form .el-input-number .el-input-number__decrease { .cloud_form .el-input-number .el-input-number__decrease {
......
...@@ -42,7 +42,6 @@ export default { ...@@ -42,7 +42,6 @@ export default {
checkList: { checkList: {
immediate: true, // 这句重要 immediate: true, // 这句重要
handler(val) { handler(val) {
console.log("ss")
this.checkLists = val; this.checkLists = val;
} }
} }
......
<template> <template>
<div></div> <div>
<el-breadcrumb separator="/" class="bread_crumb1">
<el-breadcrumb-item :to="{ path: '/authority' }">权限管理</el-breadcrumb-item>
<el-breadcrumb-item>菜单管理</el-breadcrumb-item>
</el-breadcrumb>
<el-container class="cont">
<el-row class="row_height">
<el-col :span="8" class="col_sty_r">
<div class="right_station">
<div class="right_station_head">菜单结构列表</div>
<div class="line"></div>
<div class="tree_station">
<el-tree
class="filter-tree"
node-key="id"
:expand-on-click-node="false"
@node-click="nodeClick"
:data="treeData"
:props="defaultProps"
default-expand-all
:filter-node-method="checkNode"
ref="tree"
></el-tree>
</div>
</div>
</el-col>
<el-col :span="16" class="col_sty_l">
<div class="left_station">
<div class="btn_club">
<button v-if="nodeId==''" class="btn btn_dis">
<i class="el-icon-plus"></i>&nbsp;新建
</button>
<button v-else class="btn btn_act1" @click="appendNode()">
<i class="el-icon-plus"></i>&nbsp;新建
</button>
<button v-if="!previousSibling" class="btn btn_dis">
<i class="el-icon-top"></i>&nbsp;上移
</button>
<button v-else class="btn btn_act2" @click="nodePosition(-1)">
<i class="el-icon-top"></i>&nbsp;上移
</button>
<button v-if="!nextSibling" class="btn btn_dis">
<i class="el-icon-bottom"></i>&nbsp;下移
</button>
<button v-else class="btn btn_act2" @click="nodePosition(1)">
<i class="el-icon-bottom"></i>&nbsp;下移
</button>
<button v-if="mcHold&&ymHold" class="btn btn_act1" @click="saveNode()">
<i class="el-icon-check"></i>&nbsp;保存
</button>
<button v-else class="btn btn_dis">
<i class="el-icon-check"></i>&nbsp;保存
</button>
<button v-if="!reset" class="btn btn_dis">
<i class="el-icon-refresh-left"></i>&nbsp;重置
</button>
<button v-else class="btn btn_act4" @click="resetForm()">
<i class="el-icon-refresh-left"></i>&nbsp;重置
</button>
<button v-if="nodeId==''" class="btn btn_dis">
<i class="el-icon-close"></i>&nbsp;删除
</button>
<button v-else class="btn btn_act3" @click="deleteNode()">
<i class="el-icon-close"></i>&nbsp;删除
</button>
</div>
<div class="line"></div>
<el-form class="form_station" :model="formDetail" :rules="rules">
<el-form-item prop="menuName">
<div class="form_item_title">菜单名称:</div>
<el-input v-model="formDetail.menu_name"></el-input>
</el-form-item>
<el-form-item prop="pageUrl">
<div class="form_item_title">菜单访问地址:</div>
<el-input v-model="formDetail.visit_url"></el-input>
</el-form-item>
<el-form-item prop="describe">
<div class="form_item_title">菜单组别:</div>
<el-input v-model="formDetail.team_name"></el-input>
</el-form-item>
<el-form-item prop="describe">
<div class="form_item_title">菜单描述:</div>
<el-input v-model="formDetail.detail"></el-input>
</el-form-item>
<el-form-item prop="describe">
<div class="form_item_title">菜单排序:</div>
<el-input v-model="formDetail.sort" disabled></el-input>
</el-form-item>
<el-form-item>
<div class="form_item_title">创建人:</div>
<el-input v-model="formDetail.founder" disabled></el-input>
</el-form-item>
<el-form-item>
<div class="form_item_title">创建时间:</div>
<el-input v-model="formDetail.createTime" disabled></el-input>
</el-form-item>
</el-form>
</div>
</el-col>
</el-row>
</el-container>
</div>
</template> </template>
<script> <script>
export default { export default {
methods: {} data() {
var validateMenuName = (rule, value, callback) => {
if (value != this.formContrast.mcHold) {
this.reset = true;
}
if (value == "") {
this.mcHold = false;
callback(new Error("请填写菜单名称"));
} else {
this.mcHold = true;
callback();
}
};
var validatePageUrl = (rule, value, callback) => {
if (value != this.formContrast.pageUrl) {
this.reset = true;
}
if (value == "") {
this.ymHold = false;
callback(new Error("请填写运行页面"));
} else {
this.ymHold = true;
callback();
}
};
var validateDescribe = (rule, value, callback) => {
if (value != this.formContrast.describe) {
this.reset = true;
}
callback();
};
return {
checkText: "",
treeData: [
{
id: 1,
label: "一级 2",
children: [
{
id: 3,
label: "二级 2-1",
children: [
{
id: 4,
label: "三级 3-1-1",
children: [
{
id: 5,
label: "三级 3-1-2",
disabled: true
}
]
},
{
id: 5,
label: "三级 3-1-2",
disabled: true
}
]
},
{
id: 2,
label: "二级 2-2",
disabled: true,
children: [
{
id: 6,
label: "三级 3-2-1"
},
{
id: 7,
label: "三级 3-2-2",
disabled: true
}
]
}
]
}
],
defaultProps: {
children: "children",
label: "label"
},
formDetail: {
menu_name: "",
visit_url: "",
team_name: "",
detail: "",
sort: "",
creatTime: ""
},
formYs: {
menu_name: "",
visit_url: "",
team_name: "",
detail: "",
sort: "",
creatTime: ""
},
formContrast: {
menu_name: "",
visit_url: "",
team_name: "",
detail: "",
sort: "",
creatTime: ""
},
rules: {
menuName: [
{ required: true, message: "请填写菜单名称", trigger: "blur" },
{ validator: validateMenuName, trigger: "blur" }
],
pageUrl: [
{ required: true, message: "请填写运行页面", trigger: "blur" },
{ validator: validatePageUrl, trigger: "blur" }
],
describe: [{ validator: validateDescribe, trigger: "blur" }]
},
nodeId: "",
previousSibling: false,
nextSibling: false,
mcHold: false,
ymHold: false,
reset: false,
newI: 0
};
},
watch: {
checkText(val) {
this.$refs.tree.filter(val);
}
},
mounted() {
// this.getTree();
},
methods: {
checkNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
nodeClick(data, node) {
this.nodeId = data.id;
if (node.previousSibling != undefined) {
this.previousSibling = true;
} else {
this.previousSibling = false;
}
if (node.nextSibling != undefined) {
this.nextSibling = true;
} else {
this.nextSibling = false;
}
let cid = String(data.id);
if (cid.indexOf("new") > -1) {
this.formDetail = this.formYs;
} else {
let query = {
id: this.nodeId
};
this.$api.authority.getMenu(query).then(response => {
if (response.data.success == 1) {
this.formDetail = response.data.data;
this.formContrast = response.data.data;
callback();
} else {
this.ruleFormIcon.username = false;
callback(new Error(response.data.errMsg));
}
});
}
},
appendNode() {
let newChild = { id: "new" + this.newI, label: "新菜单", children: [] };
this.newI++;
let data = this.nodeData;
this.$refs.tree.append(newChild, this.nodeId);
this.$refs.tree.setCurrentKey(newChild.id);
let node = this.$refs.tree.getNode(newChild.id);
this.nodeClick(newChild, node);
this.formDetail.sort = node.parent.childNodes.length;
},
resetForm() {
this.formDetail = this.formContrast;
},
getTree() {
this.$api.authority.getMenuList().then(response => {
console.log(response);
this.treeData = response.data.spec;
});
},
saveNode() {
console.log(this.formDetail);
let query = {
menu_id: this.nodeId,
menu_name: this.formDetail.menu_name,
detail: this.formDetail.detail,
visit_url: this.formDetail.visit_url,
team_name: this.formDetail.team_name
};
this.$api.authority.editMenu(query).then(response => {
if (response.data.success == 1) {
this.getTree();
} else {
console.log(response.data.errMsg);
}
});
},
deleteNode() {
let params = {
id: this.nodeId
};
this.$api.authority.delMenu(params).then(response => {
if (response.data.success == 1) {
this.getTree();
} else {
console.log(response.data.errMsg);
}
});
},
nodePosition(type) {
let node = this.$refs.tree.getNode(this.nodeId);
let nodesNum = node.parent.childNodes.indexOf(node);
let nodeNext = {};
if (nodesNum != -1) {
nodeNext = node.parent.childNodes[nodesNum + type];
}
let params = {
data: [
{
id: node.data.id,
sort: nodeNext.data.sort
},
{
id: nodeNext.data.id,
sort: node.data.sort
}
]
};
console.log(params);
this.$api.authority.positionMenu(params).then(response => {
if (response.data.success == 1) {
this.getTree();
} else {
console.log(response.data.errMsg);
}
});
}
}
}; };
</script> </script>
<style scoped> <style scoped>
.cont {
height: calc(100vh - 140px);
margin: 0 20px;
}
.row_height {
width: 100%;
height: 100%;
}
.col_sty_r {
height: 100%;
padding: 0 10px 20px 0;
}
.col_sty_l {
height: 100%;
padding: 0 0 20px 10px;
}
.right_station {
height: 100%;
background-color: #fff;
border-radius: 8px;
}
.left_station {
height: 100%;
background-color: #fff;
border-radius: 8px;
}
.right_station_head {
padding: 20px 20px 20px 40px;
position: relative;
line-height: 20px;
color: #58617a;
font-size: 16px;
font-weight: 700;
}
.right_station_head::after {
content: "";
position: absolute;
width: 4px;
height: 16px;
background-color: #515fe7;
border-radius: 2px;
top: 22px;
left: 24px;
}
.cont .line {
width: 100%;
height: 1px;
margin: 0;
background-color: #edf0ff;
}
.right_station .tree_station {
height: calc(100% - 90px);
margin: 15px 10px 0 20px;
overflow: auto;
}
.right_station1 .tree_station::-webkit-scrollbar {
/*滚动条整体样式*/
width: 16px; /*高宽分别对应横竖滚动条的尺寸*/
height: 1px;
}
.right_station1 .tree_station::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
border-radius: 8px;
/* background: #dde4ff; */
box-shadow: 8px 0 0 #a5adb7 inset;
border: 4px solid rgba(0, 0, 0, 0);
}
.right_station1 .tree_station::-webkit-scrollbar-track {
/*滚动条里面轨道*/
border-radius: 8px;
/* background: #f4f4f4; */
box-shadow: 8px 0 0 #f4f4f4 inset;
border: 4px solid rgba(0, 0, 0, 0);
}
.btn_club {
height: 60px;
line-height: 40px;
padding: 10px 20px;
}
.left_station .btn {
height: 30px;
padding: 0 14px;
font-size: 12px;
border-radius: 4px;
outline: none;
border: 1px #eee solid;
margin-right: 4px;
}
.left_station .btn.btn_act1 {
background-color: #264dd9;
color: #f4f7fc;
cursor: pointer;
}
.left_station .btn.btn_act1:hover {
background-color: #4969db;
}
.left_station .btn.btn_act2 {
background-color: #e6ebfe;
color: #0f2683;
cursor: pointer;
}
.left_station .btn.btn_act2:hover {
background-color: #eaf1ff;
}
.left_station .btn.btn_act3 {
background-color: #e15260;
color: #f8f9fd;
cursor: pointer;
}
.left_station .btn.btn_act3:hover {
background-color: #f16270;
}
.left_station .btn.btn_act4 {
background-color: #41558c;
color: #f4f7fc;
cursor: pointer;
}
.left_station .btn.btn_act4:hover {
background-color: #5b6a91;
}
.left_station .btn.btn_dis {
background-color: #bcc1d0;
color: #f4f7fc;
cursor: not-allowed;
}
.left_station .form_station {
height: calc(100% - 90px);
margin: 15px 20px 0;
overflow: auto;
}
.form_item_title {
padding: 0 15px;
line-height: 40px;
}
</style>
<style>
.left_station .el-form-item {
margin-bottom: 10px;
}
.left_station .el-input__inner {
background-color: #f7f8f9;
border-radius: 8px;
border: solid 1px #e3e5ef;
padding: 0 15px;
color: #242c43;
}
.left_station .is-disabled .el-input__inner {
background-color: #e3e4e6;
border-radius: 8px;
border: solid 1px #e3e5ef;
padding: 0 15px;
color: #242c43;
}
.left_station .el-textarea__inner::-webkit-scrollbar {
/*滚动条整体样式*/
width: 16px; /*高宽分别对应横竖滚动条的尺寸*/
height: 1px;
}
.left_station .el-textarea__inner::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
border-radius: 8px;
box-shadow: 8px 0 0 #a5adb7 inset;
border: 4px solid rgba(0, 0, 0, 0);
}
.left_station .el-textarea__inner::-webkit-scrollbar-track {
/*滚动条里面轨道*/
border-radius: 8px;
box-shadow: 8px 0 0 #f4f4f4 inset;
border: 4px solid rgba(0, 0, 0, 0);
}
.left_station .el-form-item__label {
font-weight: bold;
}
.tree_station .el-tree-node__content {
height: 30px;
}
.tree_station .el-tree-node__label {
font-size: 14px;
}
.tree_station .el-tree-node__expand-icon {
color: #264dd9;
padding: 2px;
}
.tree_station .el-tree-node__expand-icon.is-leaf {
color: transparent;
border: 0;
}
.tree_station .el-tree-node.is-current > .el-tree-node__content {
background-color: #e6ebfe;
color: #515fe7;
}
.tree_station .el-tree-node__expand-icon.expanded {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
.tree_station .el-icon-caret-right {
margin-right: 15px;
border: 1px #d0d6f4 solid;
border-radius: 4px;
}
.tree_station .el-icon-caret-right:before {
}
.tree_station .el-tree-node__expand-icon.expanded.el-icon-caret-right:before {
content: "\e6d8";
font-size: 12px;
}
.tree_station .el-tree-node__expand-icon.el-icon-caret-right:before {
content: "\e6d9";
font-size: 12px;
}
</style> </style>
<template>
<div class="login_backg">
<div class="login_all">
<div class="headercontainer">
<div class="center-logo" style="width:100%;">
<img class="logo" src="@/assets/imgs/ic_fuwuzs_navy.png" alt />
</div>
</div>
<el-card v-if="active == 'login'" class="box-card login">
<!-- <div slot="header" class="clearfix">
<span class="login_head">用户登录</span>
</div>-->
<div v-if="msgShow" :class="msgShow==true?'login_msg':''">{{msg}}</div>
<el-form :model="form" ref="form1" @submit.native.prevent class="login_forms">
<el-form-item>
<el-input v-model="form.username" autofocus="autofocus" placeholder="请输入用户名或邮箱"></el-input>
</el-form-item>
<el-form-item>
<el-input
v-if="visible"
:type="visible ? 'password':'text'"
v-model="form.password"
placeholder="请输入密码"
>
<i
slot="suffix"
title="显示密码"
@click="changePass()"
style="cursor:pointer;"
:class="visible ? 'el-icon-view':'el-icon-view icon_blue'"
></i>
</el-input>
</el-form-item>
</el-form>
<el-form>
<el-form-item class="rembme">
<el-checkbox v-model="checked">记住我</el-checkbox>
</el-form-item>
<el-form-item>
<el-button
class="btn_sub sub1"
type="primary"
@click.prevent="login_remember_info()"
>登 录</el-button>
</el-form-item>
<el-form-item>
<el-button class="btn_sub sub2" @click.prevent="register">
还没有账户?立即注册&nbsp;&nbsp;
<i class="el-icon-arrow-right"></i>
</el-button>
</el-form-item>
</el-form>
</el-card>
<el-card v-else-if="active == 'register'" class="box-card login">
<div slot="header" class="clearfix">
<span class="login_head">用户注册</span>
</div>
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" class="demo-ruleForm">
<el-form-item prop="username" :class="ruleFormIcon.username?'':'icon_show'">
<el-input v-model.trim="ruleForm.username" placeholder="账号为字母、数字、下划线或其组合"></el-input>
</el-form-item>
<el-form-item prop="email" :class="ruleFormIcon.email?'':'icon_show'">
<el-input v-model.trim="ruleForm.email" placeholder="请输入邮箱"></el-input>
</el-form-item>
<el-form-item prop="cname" :class="ruleFormIcon.cname?'':'icon_show'">
<el-input v-model.trim="ruleForm.cname" placeholder="请输入中文名"></el-input>
</el-form-item>
<el-form-item prop="password" :class="ruleFormIcon.password?'':'icon_show'">
<el-input
auto-complete="new-password"
autocomplete="off"
v-model.trim="ruleForm.password"
:type="pwdCheck?'text':'password'"
placeholder="密码为大小写字母及数字组合,不少于6位"
>
<i
slot="suffix"
:title="truePwdCheck?'隐藏密码':'显示密码'"
:class="pwdCheck?'el-icon-view icon_blue':'el-icon-view'"
@click="pwdCheck=!pwdCheck"
></i>
</el-input>
</el-form-item>
<el-form-item prop="truePassword" :class="ruleFormIcon.truePassword?'':'icon_show'">
<el-input
auto-complete="new-password"
autocomplete="off"
v-model.trim="ruleForm.truePassword"
:type="truePwdCheck?'text':'password'"
placeholder="请确认密码"
>
<i
slot="suffix"
:title="truePwdCheck?'隐藏密码':'显示密码'"
:class="truePwdCheck?'el-icon-view icon_blue':'el-icon-view'"
@click="truePwdCheck=!truePwdCheck"
></i>
</el-input>
</el-form-item>
</el-form>
<el-form :model="yzms" :rules="yzmRules" ref="yzms" class="demo-ruleForm">
<el-form-item prop="yzm" class="yzm" :class="ruleFormIcon.yzm?'':'icon_show'">
<el-input v-model.trim="yzms.yzm" placeholder="请输入验证码"></el-input>
<img class="yzm_img" title="看不清?换一张" :src="imgSrc" @click="getImg()" />
</el-form-item>
</el-form>
<el-form class="demo-ruleForm">
<el-form-item>
<el-button class="btn_sub sub1" type="primary" @click.prevent="submitForm()">注 册</el-button>
</el-form-item>
<el-form-item>
<el-button class="btn_sub sub2" @click.prevent="login">
<i class="el-icon-arrow-left"></i>&nbsp;&nbsp;登录已有账号
</el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</div>
</template>
<script>
import { getCookie, clearCookie, setCookie } from "@/services/cookie.js";
export default {
data() {
var validatePass = (rule, value, callback) => {
if (value !== this.ruleForm.password) {
this.ruleFormIcon.truePassword = false;
callback(new Error("密码和确认密码不一致"));
} else {
this.ruleFormIcon.truePassword = true;
callback();
}
};
var validateUser = (rule, value, callback) => {
let reg = new RegExp(/^[a-zA-Z0-9-_]{0,50}$/);
if (value == "") {
this.ruleFormIcon.username = false;
callback(new Error("请输入账号"));
} else if (!reg.test(value)) {
this.ruleFormIcon.username = false;
callback(new Error("支持大小写字母,数字,-_ ,长度不超过50个字符"));
} else {
let url = `/awecloud/dex/user/${value}`;
this.$http
.get(url)
.then(response => {
if (response.data.success == 1) {
this.ruleFormIcon.username = true;
callback();
} else {
this.ruleFormIcon.username = false;
callback(new Error(response.data.errMsg));
}
})
.catch(function(response) {});
}
};
var validateEmail = (rule, value, callback) => {
let reg = new RegExp(
/^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/
);
if (value == "") {
this.ruleFormIcon.email = false;
callback(new Error("请输入邮箱"));
} else if (!reg.test(value)) {
this.ruleFormIcon.email = false;
callback(new Error("请输入正确的邮箱格式"));
} else {
let url = `/awecloud/dex/email/${value}`;
this.$http
.get(url)
.then(response => {
if (response.data.success == 1) {
this.ruleFormIcon.email = true;
callback();
} else {
this.ruleFormIcon.email = false;
callback(new Error(response.data.errMsg));
}
})
.catch(function(response) {});
}
};
var validatePassword = (rule, value, callback) => {
let reg = new RegExp(
/^.*(?=.{6,50})(?=.*\d)(?=.*[A-Z]{1,})(?=.*[a-z]{1,}).*$/
);
if (value == "") {
this.ruleFormIcon.password = false;
callback(new Error("请输入密码"));
} else if (!reg.test(value)) {
this.ruleFormIcon.password = false;
callback(new Error("密码包含大小写字母、数字,长度不小于6位"));
} else {
this.ruleFormIcon.password = true;
callback();
}
};
var validateCname = (rule, value, callback) => {
if (value == "") {
this.ruleFormIcon.cname = false;
callback(new Error("请输入中文姓名"));
} else {
this.ruleFormIcon.cname = true;
callback();
}
};
var validateYzm = (rule, value, callback) => {
if (value == "") {
this.ruleFormIcon.yzm = false;
this.yzmState = false;
callback(new Error("请输入验证码"));
} else {
let url = `/awecloud/dex/verifyCaptcha?id=${this.imgId}&value=${value}`;
this.$http
.get(url)
.then(response => {
if (response.data.success == 1) {
this.ruleFormIcon.yzm = true;
this.yzmState = true;
callback();
} else {
this.ruleFormIcon.yzm = false;
this.yzmState = false;
callback(new Error(response.data.errMsg));
}
})
.catch(function(response) {});
}
};
return {
form: {
username: "",
password: ""
},
visible: true,
checked: false,
msg: "",
msgShow: false,
active: "login",
pwdCheck: false,
truePwdCheck: false,
ruleForm: {
username: "",
cname: "",
password: "",
truePassword: "",
email: ""
},
yzms: {
yzm: ""
},
yzmRules: {
yzm: [{ validator: validateYzm, trigger: "blur" }]
},
yzmState: false,
ruleFormIcon: {
username: true,
cname: true,
password: true,
truePassword: true,
email: true,
yzm: true
},
rules: {
username: [{ validator: validateUser, trigger: "blur" }],
cname: [{ validator: validateCname, trigger: "blur" }],
password: [{ validator: validatePassword, trigger: "blur" }],
truePassword: [{ validator: validatePass, trigger: "blur" }],
email: [{ validator: validateEmail, trigger: "blur" }]
},
imgSrc: "",
imgId: ""
};
},
mounted() {
this.init();
},
created() {
if (getCookie("username") && getCookie("password")) {
this.checked = true;
this.form.username = window.atob(getCookie("username"));
this.form.password = window.atob(getCookie("password"));
} else {
this.checked = false;
}
},
methods: {
init() {
if (this.$route.params.username != undefined) {
this.form.username = this.$route.params.username;
this.form.password = this.$route.params.password;
}
},
//登录请求
login_request() {
let url = `/awecloud/dex/login`;
let query = this.form;
this.$http
.post(url, JSON.stringify(query), {
headers: {
"Content-Type": "application/json;charset=UTF-8"
}
})
.then(response => {
if (response.data.success == 1) {
window.location.href = "/awecloud/ui/";
} else if (response.data.success == 0) {
this.msg = response.data.errMsg;
this.msgShow = true;
// if (errCode.indexOf("invalid_login") != -1) {
// this.hint = "帐号或密码错误";
// }
// if (errCode.indexOf("too_many_errors1") != -1) {
// this.hint = "该账号已被冻结";
// }
// if (errCode.indexOf("no_user") != -1) {
// this.hint = "未注册此用户";
// }
// if (errCode.indexOf("no_pass") != -1) {
// this.hint = "该账户未审批";
// }
// if (errCode.indexOf("too_many_errors2") != -1) {
// var num = errCode.split("|")[1].split("_")[0];
// var time = errCode.split("|")[1].split("_")[1];
// this.hint =
// "该账号密码连续错误次数达到" +
// num +
// "次,系统自动冻结" +
// time +
// "分钟";
// }
// if (errCode.indexOf("new_login") != -1) {
// this.hint =
// "您的账户已经在其他地方登陆,点击确定重新登录。如果不是您自己操作,您的密码可能已经丢失,请尽快修改密码。";
// }
}
})
.catch(function(response) {
console.log(response);
});
},
login_remember_info() {
// console.log(this.checked);
if (this.checked) {
setCookie("username", window.btoa(this.form.username));
setCookie("password", window.btoa(this.form.password));
} else {
clearCookie("username");
clearCookie("password");
}
this.login_request();
},
changePass() {
this.visible = !this.visible;
},
register() {
this.active = "register";
this.getImg();
},
getImg() {
let url = `/awecloud/dex/getCaptcha?width=240&height=60`;
this.$http
.get(url)
.then(response => {
if (response.data.success == 1) {
// console.log(response.data.data.captcha);
this.imgId = response.data.data.id;
this.imgSrc = response.data.data.captcha;
// this.$router.push({
// path: "/login",
// query: {
// username: this.ruleForm.username,
// password: this.ruleForm.password
// }
// });
}
})
.catch(function(response) {});
},
submitForm() {
let self = this;
let setI = setInterval(function() {
// console.log(self.yzmState);
if (self.yzmState) {
clearInterval(setI);
self.submitAll();
}
}, 50);
},
submitAll() {
this.$refs["ruleForm"].validate(valid => {
if (valid) {
let url = `/awecloud/dex/register`;
let query = {
name: this.ruleForm.username,
alias: this.ruleForm.cname,
password: this.ruleForm.password,
email: this.ruleForm.email,
phone: "",
avatar: ""
};
this.$http
.post(url, query)
.then(response => {
if (response.data.success == 1) {
// console.log(response.data.data);
this.$message({
message: "注册成功",
type: "success",
duration: 1000
});
let self = this;
self.$router.push({
name: "Login"
});
// self.$router.push({
// name: "Login",
// params: {
// username: self.ruleForm.username,
// password: self.ruleForm.password
// }
// });
}
})
.catch(function(response) {});
} else {
return false;
}
});
},
login() {
this.active = "login";
}
}
};
</script>
<style scoped>
.login_backg {
height: 100vh;
background: url("~@/assets/imgs/shop_img_banner_test.png") center center;
background-size: 100% 100%;
overflow: auto;
}
.login_all {
width: 500px;
height: 100%;
padding-top: 20vh;
margin: 0 auto;
}
.login {
min-width: 500px;
font-size: 16px;
}
.login .el-card__header {
padding: 10px;
}
.login_head {
display: block;
width: 100%;
font-size: 16px;
font-weight: bold;
text-align: center;
color: #1a2236;
}
.login .el-form-item {
margin-bottom: 22px;
}
.warning_icon_div {
display: inline-block;
width: 9%;
}
.login .el-input {
width: 80%;
margin-left: 10%;
}
.login .el-input__inner {
height: 40px;
border-radius: 20px;
padding-left: 20px;
padding-right: 38px;
border: solid 1px #9cb5f8;
}
.login .el-input__suffix {
right: 15px;
font-size: 18px;
}
.login .rembme {
padding-left: 14%;
margin-bottom: 10px;
}
.login .el-button {
width: 80%;
margin-left: 10%;
height: 40px;
border-radius: 20px;
}
.sub1 {
background-color: #264dd9;
color: #fff;
}
.sub2 {
background-color: #dde4ff;
color: #264dd9;
}
.headercontainer {
max-width: 960px;
margin: 10px 0px 15px 0px;
margin-right: auto;
margin-left: auto;
}
.center-logo {
/* margin: 8px 0; */
text-align: center;
}
.el-form--label-top .el-form-item__label {
padding: 0px;
}
.logo {
width: 160px;
height: 36px;
}
.login_forms {
margin-top: 20px;
}
.login_msg {
width: 100%;
height: 30px;
margin-top: 10px;
color: #c62249;
text-align: center;
position: relative;
top: 0;
opacity: 1;
animation: login_in 1s;
}
@keyframes login_in {
0% {
top: 100%;
opacity: 0;
}
100% {
top: 0;
opacity: 1;
}
}
.icon_show {
position: relative;
}
.icon_show::before {
content: "";
width: 20px;
height: 20px;
position: absolute;
top: 10px;
left: 15px;
background: url("~@/assets/imgs/ic_warning.png") no-repeat center center;
}
.icon_blue {
color: #5c82ff;
}
.login .yzm .el-input {
width: 40%;
margin-left: 10%;
}
.yzm {
position: relative;
}
.yzm .yzm_img {
position: absolute;
width: 30%;
margin-left: 5%;
cursor: pointer;
}
</style>
<style>
.login .el-input__suffix {
font-size: 20px;
right: 10px;
}
.login .el-form-item__error {
left: 14%;
}
</style>
\ No newline at end of file
<template>
<div>
<el-container>
<el-aside width="180px">
<service-shop-menu></service-shop-menu>
</el-aside>
<el-main>
<service-list :name="name" :url="url" :urlList="urlList" :urlFilter="urlFilter"></service-list>
</el-main>
</el-container>
</div>
</template>
<script>
import ServiceShopMenu from "@/components/service_shop_menu";
import ServiceList from "@/components/service_list";
export default {
components: {
ServiceShopMenu,
ServiceList
},
data: () => ({
urlFilter: "",
url: "",
urlList: "2222",
name: ""
}),
mounted() {
this.getVal(this.$route.path);
},
methods: {
getVal(val) {
switch (val) {
case "/shop/data_service_list":
this.name = "数据服务";
this.urlFilter = "5";
break;
case "/shop/space_time_service_list":
this.name = "时空服务";
this.urlFilter = "6";
break;
case "/shop/video_service_list":
this.name = "视频服务";
this.urlFilter = "7";
break;
case "/shop/perception_service_list":
this.name = "感知服务";
this.urlFilter = "10";
break;
case "/shop/comprehensive_app_list":
this.name = "综合服务";
this.urlFilter = "";
break;
case "/shop/app_store_list":
this.name = "应用商店";
this.urlFilter = "";
break;
default:
this.name = "";
this.urlFilter = "";
break;
}
}
},
watch: {
"$route.path": {
handler(val) {
this.getVal(val);
}
}
}
};
</script>
<style scoped>
</style>
\ No newline at end of file
<template>
<div>
<el-container>
<el-aside width="180px">
<service-shop-menu></service-shop-menu>
</el-aside>
<el-main>
<service-list name="应用商店" url="yysdDetail" urlList="url1sss" urlFilter="urldwad2222"></service-list>
</el-main>
</el-container>
</div>
</template>
<script>
import ServiceShopMenu from "@/components/service_shop_menu";
import ServiceList from "@/components/service_list";
export default {
components: {
ServiceShopMenu,
ServiceList
},
data: () => ({}),
mounted() {},
methods: {}
};
</script>
<style scoped>
</style>
\ No newline at end of file
<template>
<div>
<el-container>
<el-aside width="180px">
<service-shop-menu></service-shop-menu>
</el-aside>
<el-main>
<service-list name="综合应用" url="zhfwDetail" urlList="url1sss" urlFilter="urldwad2222"></service-list>
</el-main>
</el-container>
</div>
</template>
<script>
import ServiceShopMenu from "@/components/service_shop_menu";
import ServiceList from "@/components/service_list";
export default {
components: {
ServiceShopMenu,
ServiceList
},
data: () => ({}),
mounted() {},
methods: {}
};
</script>
<style scoped>
</style>
\ No newline at end of file
<template>
<div>
<el-container>
<el-aside width="180px">
<service-shop-menu></service-shop-menu>
</el-aside>
<el-main>
<service-list name="数据服务" url="sjfwDetail" urlList="url1sss" urlFilter="urldwad2222"></service-list>
</el-main>
</el-container>
</div>
</template>
<script>
import ServiceShopMenu from "@/components/service_shop_menu";
import ServiceList from "@/components/service_list";
export default {
components: {
ServiceShopMenu,
ServiceList
},
data: () => ({}),
mounted() {},
methods: {}
};
</script>
<style scoped>
</style>
\ No newline at end of file
<template>
<div>
<el-container>
<el-aside width="180px">
<service-shop-menu></service-shop-menu>
</el-aside>
<el-main>
<service-list name="感知服务"></service-list>
</el-main>
</el-container>
</div>
</template>
<script>
import ServiceShopMenu from "@/components/service_shop_menu";
import ServiceList from "@/components/service_list";
export default {
components: {
ServiceShopMenu,
ServiceList
},
data: () => ({}),
mounted() {},
methods: {}
};
</script>
<style scoped>
</style>
\ No newline at end of file
<template>
<div>
<el-container>
<el-aside width="180px">
<service-shop-menu></service-shop-menu>
</el-aside>
<el-main>
<service-list name="时空服务" url="skfwDetail" urlList="url1sss" urlFilter="urldwad2222"></service-list>
</el-main>
</el-container>
</div>
</template>
<script>
import ServiceShopMenu from "@/components/service_shop_menu";
import ServiceList from "@/components/service_list";
export default {
components: {
ServiceShopMenu,
ServiceList
},
data: () => ({}),
mounted() {},
methods: {}
};
</script>
<style scoped>
</style>
\ No newline at end of file
<template>
<div>
<el-container>
<el-aside width="180px">
<service-shop-menu></service-shop-menu>
</el-aside>
<el-main>
<service-list name="视频服务"></service-list>
</el-main>
</el-container>
</div>
</template>
<script>
import ServiceShopMenu from "@/components/service_shop_menu";
import ServiceList from "@/components/service_list";
export default {
components: {
ServiceShopMenu,
ServiceList
},
data: () => ({}),
mounted() {},
methods: {}
};
</script>
<style scoped>
</style>
\ No newline at end of file
...@@ -25,7 +25,7 @@ export default { ...@@ -25,7 +25,7 @@ export default {
margin: 0 auto; margin: 0 auto;
} }
.shopping_title { .shopping_title {
height: 40px; height: 45px;
line-height: 40px; line-height: 45px;
} }
</style> </style>
\ No newline at end of file
import workbench from '@/request/api/workbench'; import workbench from '@/request/api/workbench';
import serviceShop from '@/request/api/service_shop'; import serviceShop from '@/request/api/service_shop';
import user from '@/request/api/user'; import user from '@/request/api/user';
import authority from '@/request/api/authority';
export default { export default {
workbench, workbench,
serviceShop, serviceShop,
user user,
authority
} }
\ No newline at end of file
import axios from '@/request/http'; // 导入http中创建的axios实例
import qs from 'qs'; // 根据需求是否导入qs模块
const authority = {
// Menu
getMenuList() {
return axios.get(`/apaas/backmgt/menu/list`);
},
addMenu(params) {
return axios.post(`/apaas/backmgt/menu`, params);
},
delMenu(params) {
return axios.delete(`/apaas/backmgt/menu/id/${params.id}`);
},
getMenu(params) {
return axios.get(`/apaas/backmgt/menu/id/${params.id}`);
},
positionMenu(params) {
return axios.post(`/apaas/backmgt/menu/menuOrder`, params);
},
editMenu(params) {
return axios.put(`/apaas/backmgt/menu`, params);
}
}
export default authority;
...@@ -3,6 +3,42 @@ import qs from 'qs'; // 根据需求是否导入qs模块 ...@@ -3,6 +3,42 @@ import qs from 'qs'; // 根据需求是否导入qs模块
const serviceShop = { const serviceShop = {
// service list
getServiceShopFilter(params) {
// 5:数据 6:时空 7:视频 10:感知
return axios.get(`/apaas/serviceapp/v3/servicemarket/profileInfo?serviceType=${params.type}`);
},
getServiceShopList(params) {
return axios.get(`/apaas/serviceapp/v3/servicemarket/list?
serviceName=${params.serviceName}&serviceType1=${params.serviceType1}&
serviceType2s=${params.serviceType2s}&dataDomains=${params.dataDomains}&
organizeIds=${params.organizeIds}&orderBy=${params.orderBy}&
Page=${params.Page}&Size=${params.Size}`);
},
getServiceShopDetail(params) {
return axios.get(`/apaas/serviceapp/v3/servicemarket/detail?serviceId=`)
},
// shopping cart
addShoppingCart(params) {
return axios.post(`/apaas/serviceapp/v3/shopcart/add`, params);
},
delShoppingCart(params) {
// note: if parans is empty, it will delete all data.
return axios.post(`/apaas/serviceapp/v3/shopcart/del`, params);
},
getShoppingCart() {
return axios.get(`/apaas/serviceapp/v3/shopcart/list`);
},
updateShoppingCart(params) {
return axios.post(`/apaas/serviceapp/v3/shopcart/update`, params);
},
getSystemList() {
return axios.get(`/apaas/serviceapp/v3/shopcart/systems`);
},
submitShoppingCart() {
return axios.post(`/apaas/serviceapp/v3/shopcart/apply`, params);
},
} }
export default serviceShop; export default serviceShop;
...@@ -2,7 +2,9 @@ import axios from '@/request/http'; // 导入http中创建的axios实例 ...@@ -2,7 +2,9 @@ import axios from '@/request/http'; // 导入http中创建的axios实例
import qs from 'qs'; // 根据需求是否导入qs模块 import qs from 'qs'; // 根据需求是否导入qs模块
const user = { const user = {
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}`);
},
} }
export default user; export default user;
...@@ -5,9 +5,11 @@ ...@@ -5,9 +5,11 @@
import axios from 'axios'; import axios from 'axios';
import router from '../router'; import router from '../router';
import store from '../store/index'; import store from '../store/index';
import ElementUI from 'element-ui';
const tip = msg => { const tip = msg => {
console.log(msg) console.log(msg);
ElementUI.Message.error(msg);
} }
/** /**
...@@ -67,8 +69,8 @@ instance.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlenco ...@@ -67,8 +69,8 @@ instance.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlenco
*/ */
instance.interceptors.request.use( instance.interceptors.request.use(
config => { config => {
const token = store.state.token; // const token = store.state.token;
token && (config.headers.Authorization = token); // token && (config.headers.Authorization = token);
return config; return config;
}, },
error => Promise.error(error)) error => Promise.error(error))
......
...@@ -16,6 +16,11 @@ export default new Router({ ...@@ -16,6 +16,11 @@ export default new Router({
path: "/", path: "/",
redirect: "/index", redirect: "/index",
}, },
{
path: "/login", // 登录注册
name: "login",
component: () => import("@/pages/login"),
},
{ {
path: "/index", path: "/index",
name: "index", name: "index",
...@@ -120,30 +125,27 @@ export default new Router({ ...@@ -120,30 +125,27 @@ export default new Router({
{ {
path: "/shop/data_service_list", // 数据服务列表页 path: "/shop/data_service_list", // 数据服务列表页
name: "shopDataList", name: "shopDataList",
component: () => import("@/pages/service_shop/shop_list_data"), component: () => import("@/pages/service_shop/shop_list"),
}, },
{ {
path: "/shop/space_time_service_list", // 时空服务列表页 path: "/shop/space_time_service_list", // 时空服务列表页
name: "shopSpaceTimeList", name: "shopSpaceTimeList",
component: () => component: () => import("@/pages/service_shop/shop_list"),
import("@/pages/service_shop/shop_list_space_time"),
}, },
{ {
path: "/shop/video_service_list", // 视频服务列表页 path: "/shop/video_service_list", // 视频服务列表页
name: "shopVideoList", name: "shopVideoList",
component: () => import("@/pages/service_shop/shop_list_video"), component: () => import("@/pages/service_shop/shop_list"),
}, },
{ {
path: "/shop/perception_service_list", // 感知服务列表页 path: "/shop/perception_service_list", // 感知服务列表页
name: "shopPerceptionList", name: "shopPerceptionList",
component: () => component: () => import("@/pages/service_shop/shop_list"),
import("@/pages/service_shop/shop_list_perception"),
}, },
{ {
path: "/shop/comprehensive_app_list", // 综合应用列表页 path: "/shop/comprehensive_app_list", // 综合应用列表页
name: "shopComAppList", name: "shopComAppList",
component: () => component: () => import("@/pages/service_shop/shop_list"),
import("@/pages/service_shop/shop_list_comprehensive_app"),
}, },
{ {
path: "/shop/cloud", // 云资源服务 path: "/shop/cloud", // 云资源服务
...@@ -159,8 +161,7 @@ export default new Router({ ...@@ -159,8 +161,7 @@ export default new Router({
{ {
path: "/shop/app_store_list", // 应用商店列表页 path: "/shop/app_store_list", // 应用商店列表页
name: "shopAppStoreList", name: "shopAppStoreList",
component: () => component: () => import("@/pages/service_shop/shop_list"),
import("@/pages/service_shop/shop_list_app_store"),
}, },
{ {
path: "/shop/shopping_cart", // 购物车页 path: "/shop/shopping_cart", // 购物车页
......
// 取得cookie
function getCookie(name) {
var nameEQ = name + '='
var ca = document.cookie.split(';') // 把cookie分割成组
for (var i = 0; i < ca.length; i++) {
var c = ca[i] // 取得字符串
while (c.charAt(0) == ' ') { // 判断一下字符串有没有前导空格
c = c.substring(1, c.length) // 有的话,从第二位开始取
}
if (c.indexOf(nameEQ) == 0) { // 如果含有我们要的name
return unescape(c.substring(nameEQ.length, c.length)) // 解码并截取我们要值
}
}
return false
}
// 清除cookie
function clearCookie(name) {
setCookie(name, "", -1);
}
// 设置cookie
function setCookie(name, value, seconds) {
seconds = seconds || 0; //seconds有值就直接赋值,没有为0,这个根php不一样。
var expires = "";
if (seconds != 0 ) { //设置cookie生存时间
var date = new Date();
date.setTime(date.getTime()+(seconds*1000));
expires = "; expires="+date.toGMTString();
}
document.cookie = name+"="+escape(value)+expires+"; path=/"; //转码并赋值
}
export {
getCookie,
clearCookie,
setCookie,
}
...@@ -14,28 +14,6 @@ module.exports.GetProperty = function (obj, prop) { ...@@ -14,28 +14,6 @@ module.exports.GetProperty = function (obj, prop) {
return res; return res;
} }
module.exports.ymhdateFormat = function (timestamp) {
let date = new Date(timestamp);
let ret;
const opt = {
"Y+": date.getFullYear().toString(), // 年
"m+": (date.getMonth() + 1).toString(), // 月
"d+": date.getDate().toString(), // 日
"H+": date.getHours().toString(), // 时
"M+": date.getMinutes().toString(), // 分
"S+": date.getSeconds().toString() // 秒
// 有其他格式化字符需求可以继续添加,必须转化成字符串
};
var fmt="YYYY-mm-dd HH:MM:SS"
for (let k in opt) {
ret = new RegExp("(" + k + ")").exec(fmt);
if (ret) {
fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
};
};
return fmt;
}
module.exports.dateFormat = function (fmt, timestamp) { module.exports.dateFormat = function (fmt, timestamp) {
let date = new Date(timestamp); let date = new Date(timestamp);
let ret; let ret;
......
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