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

apaas

parent efb058a2
......@@ -42,10 +42,11 @@
<el-col :span="6" class="cell_specification">
<div v-if="cellItem.order_type == 1">
<el-tooltip class="item" effect="dark" placement="right">
<div
slot="content"
class="gg"
>规格:日访问次数:{{cellItem.spec_svc_count}}次,日访问量:{{cellItem.spec_svc_pv }}</div>
<div slot="content" class="gg">
规格:
<br />
日访问次数:{{cellItem.spec_svc_count}}次,日访问量:{{cellItem.spec_svc_pv }}
</div>
<div>规格:日访问次数:{{ cellItem.spec_svc_count }}次,日访问量:{{ cellItem.spec_svc_pv }}</div>
</el-tooltip>
<div
......@@ -54,31 +55,41 @@
</div>
<div v-else-if="cellItem.order_type == 2">
<el-tooltip class="item" effect="dark" placement="right">
<div
slot="content"
class="gg"
>{{ cellItem.spec_app == 0 ? '规格:申请获取应用镜像部署权限' : '规格:申请获取应用镜像开发权限' }}</div>
<div slot="content" class="gg">
规格:
<br />
{{ cellItem.spec_app == 0 ? '申请获取应用镜像部署权限' : '申请获取应用镜像开发权限' }}
</div>
<div>规格:{{ cellItem.spec_app == 0 ? "申请获取应用镜像部署权限" : "申请获取应用镜像开发权限" }}</div>
</el-tooltip>
</div>
<div v-else-if="cellItem.order_type == 3">
<el-tooltip v-if="cellItem.apply_type == 0" class="item" effect="dark" placement="right">
<div
slot="content"
class="gg"
>规格:CPU {{ cellItem.cpu }}核,内存 {{ cellItem.memory }}GB,容器组 {{ cellItem.containers }}个;数据盘 {{ cellItem.disk_num }}块,每块数据盘容量 {{ cellItem.disk_cap }}GB</div>
<div slot="content" class="gg">
规格:
<br />
CPU {{ cellItem.cpu }}核,内存 {{ cellItem.memory }}GB,容器组 {{ cellItem.containers }}个;
<br />
数据盘 {{ cellItem.disk_num }}块,每块数据盘容量 {{ cellItem.disk_cap }}GB;
</div>
<div class="specification_item">
规格:CPU {{ cellItem.cpu }}核,内存 {{ cellItem.memory }}GB,容器组 {{ cellItem.containers }}个;
<span
v-if="cellItem.disk_num != 0"
>数据盘 {{ cellItem.disk_num }}块,每块数据盘容量 {{ cellItem.disk_cap }}GB</span>
>数据盘 {{ cellItem.disk_num }}块,每块数据盘容量 {{ cellItem.disk_cap }}GB</span>
</div>
</el-tooltip>
<el-tooltip v-else class="item" effect="dark" placement="right">
<div
slot="content"
class="gg"
>规格:CPU {{ cellItem.cpu }}核,内存 {{ cellItem.memory }}GB,容器组 {{ cellItem.containers }}个;{{ thisDisks }}</div>
<div slot="content" class="gg">
规格:
<br />
CPU {{ cellItem.cpu }}核,内存 {{ cellItem.memory }}GB,容器组 {{ cellItem.containers }}个;
<span
class="gg_span"
v-for="(item, index) in cellItem.adjust_disk"
:key="'sjj' + index"
>数据盘 {{item.disk_num}}块,每块数据盘容量 {{item.disk_cap}}GB;</span>
</div>
<div class="specification_item">
规格:CPU {{ cellItem.cpu }}核,内存 {{ cellItem.memory }}GB,容器组 {{ cellItem.containers }}个;
<span>{{ thisDisks }}</span>
......@@ -86,7 +97,7 @@
</el-tooltip>
<div
class="cell_specification_type"
>单个容器组:CPU最高 {{ cellItem.one_cpu_max }}核,默认 {{ cellItem.one_cpu_min }}核;内存最高 {{ cellItem.one_memory_max }}GB,默认 {{ cellItem.one_memory_min }}GB</div>
>单个容器组:CPU最高 {{ cellItem.one_cpu_max }}核,默认 {{ cellItem.one_cpu_min }}核;内存最高 {{ cellItem.one_memory_max }}GB,默认 {{ cellItem.one_memory_min }}GB</div>
</div>
</el-col>
<el-col :span="4" class="approval_status">
......@@ -562,13 +573,16 @@ export default {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.gg {
max-width: 200px;
/* max-width: 200px; */
word-wrap: break-word;
}
.gg_span {
display: block;
}
</style>
<style>
.pop_rate .el-rate__icon {
......
......@@ -26,7 +26,14 @@
<script>
export default {
props: {},
props: {
formInline: {
type: Object,
default: function () {
return {};
},
},
},
components: {},
data() {
var check_phone = (rule, value, callback) => {
......@@ -41,21 +48,16 @@ export default {
};
return {
formInline: {
depart: "",
preson: "",
phone: ""
},
rules: {
preson: [
{ required: true, message: "请输入部门联系人", trigger: "blur" },
{max:16, message: "不能超过16个字符", trigger: "blur" }
{ max: 16, message: "不能超过16个字符", trigger: "blur" },
],
phone: [
{ required: true, message: "请输入联系电话", trigger: "blur" },
{ validator: check_phone, trigger: "blur" }
]
}
{ validator: check_phone, trigger: "blur" },
],
},
};
},
watch: {},
......@@ -66,16 +68,18 @@ export default {
},
methods: {
submitForm() {
this.$refs["ruleForm"].validate(valid => {
var flag = null;
this.$refs.ruleForm.validate((valid) => {
console.log(valid);
if (valid) {
alert("submit!");
flag = true;
} else {
console.log("error submit!!");
return false;
flag = false;
}
});
}
}
return flag;
},
},
};
</script>
......
<template>
<div class="apply_container">
<info-list :list_arr="module_arr">
<apply-form ref="apply_info" slot="apply_info"></apply-form>
<apply-form :formInline="formInline" ref="apply_info" slot="apply_info"></apply-form>
<service-list ref="apply_service" slot="apply_service" :service_arr="service_arr"></service-list>
</info-list>
......@@ -21,21 +21,26 @@ export default {
components: {
infoList,
applyForm,
serviceList
serviceList,
},
data() {
return {
formInline: {
depart: "",
preson: "",
phone: "",
},
module_arr: [
{
title: "服务申请",
type: "solt",
solt_name: "apply_info"
solt_name: "apply_info",
},
{
title: "申请的服务",
type: "solt",
solt_name: "apply_service"
}
solt_name: "apply_service",
},
],
post_arr: [],
service_arr: [
......@@ -86,18 +91,18 @@ export default {
"",
{
name: "共享",
val: "share"
val: "share",
},
{
name: "受限",
val: "limit"
val: "limit",
},
{
name: "敏感",
val: "mg"
}
val: "mg",
},
],
temp_sub_arr: []
temp_sub_arr: [],
};
},
watch: {},
......@@ -110,7 +115,7 @@ export default {
} else {
console.log(JSON.parse(window.sessionStorage.getItem("shoppingCart")));
var temp_arr = [];
JSON.parse(window.sessionStorage.getItem("shoppingCart")).forEach(e => {
JSON.parse(window.sessionStorage.getItem("shoppingCart")).forEach((e) => {
temp_arr.push(e.id);
});
this.get_car_list(temp_arr);
......@@ -121,7 +126,7 @@ export default {
get_one_app(app_data) {
this.$http
.get(`/apaas/serviceapp/v3/shopcart/appinfo?app_id=${app_data.app_id}`)
.then(response => {
.then((response) => {
console.log(response);
let data = response.data.data;
if (response.data.success && data) {
......@@ -152,7 +157,7 @@ export default {
.get(
`/apaas/serviceapp/v3/shopcart/serviceinfo?service_id=${service_data.service_id}`
)
.then(response => {
.then((response) => {
console.log(response);
let data = response.data.data;
if (response.data.success && data) {
......@@ -172,12 +177,12 @@ export default {
this.service_arr[0]["tips"] = [
{
tip: this.share_arr[data.openness].name,
type: this.share_arr[data.openness].val
}
type: this.share_arr[data.openness].val,
},
];
this.service_arr[0]["auth"] = data.organization_name;
this.service_arr[0]["size"] = "规格:";
data.request_spcs_info.forEach(el => {
data.request_spcs_info.forEach((el) => {
if (service_data.spec_id == el.id) {
this.service_arr[0]["size"] =
this.service_arr[0]["size"] +
......@@ -202,7 +207,7 @@ export default {
.catch(() => {});
},
deal_data(data) {
data.forEach(e => {
data.forEach((e) => {
if (e.selected) {
e.selected = 1;
} else {
......@@ -213,100 +218,121 @@ export default {
}
});
},
sub_service() {
let formInline = this.$refs.apply_info.formInline;
if (formInline.preson && formInline.phone) {
var phone_ruler = /^(?:(?:\+|00)86)?1[3-9]\d{9}$/;
if (!phone_ruler.test(formInline.phone)) {
this.$message.error("输入正确号码");
return;
}
var temp = {
apply_part: {
o_name: formInline.preson,
o_mobile: formInline.phone
},
carts: []
};
var temp1 = this.$refs.apply_service.$refs.apply_service_state;
this.post_arr.forEach((e, idx) => {
if (e.service_id) {
temp.carts.push({
id: e.id,
service_id: e.service_id,
duration: e.duration,
spec_id: e.spec_id,
duration_method: e.duration_method,
is_subscribe: e.is_subscribe,
app_id: 0,
scene: temp1[idx].sceneinput,
apply_file: temp1[idx].fileList,
apply_fields: []
});
// 判断表格ref是否存在
this.temp_sub_arr = temp1[idx].$refs.apply_service_state_table
? temp1[idx].$refs.apply_service_state_table.metaData
: [];
this.deal_data(this.temp_sub_arr);
temp.carts[temp.carts.length - 1][
"apply_fields"
] = this.temp_sub_arr;
abc() {
return new Promise((resolve, reject) => {
this.$refs.apply_info.$refs.ruleForm.validate((valid) => {
console.log(valid);
if (valid) {
flag = true;
} else {
temp.carts.push({
id: e.id,
service_id: 0,
duration: e.duration,
spec_id: e.spec_id,
duration_method: e.duration_method,
is_subscribe: e.is_subscribe,
app_id: e.app_id,
scene: this.$refs.apply_service.$refs.apply_service_state[idx]
.sceneinput,
apply_file: ""
});
flag = false;
}
});
} else {
this.$message.error("请完善服务申请");
return;
}
for (let index = 0; index < temp.carts.length; index++) {
const e = temp.carts[index];
// 若表格数据长度不为0,执行以下
if (e.service_id && e.apply_fields.length != 0) {
if (e.apply_fields[0].selected == 0) {
this.$message.error("请选择所需参数");
console.log(res);
if (res) {
resolve(res);
} else {
reject(res);
}
});
},
sub_service() {
let formInline = this.$refs.apply_info.formInline;
let flag = null;
this.$refs.apply_info.$refs.ruleForm.validate((valid) => {
console.log(valid);
if (valid) {
var phone_ruler = /^(?:(?:\+|00)86)?1[3-9]\d{9}$/;
if (!phone_ruler.test(formInline.phone)) {
this.$message.error("输入正确号码");
return;
}
}
}
this.$http
.post(`/apaas/serviceapp/v3/shopcart/apply`, temp)
.then(response => {
console.log(response);
if (response.data.success) {
this.$store.commit("setMenuCartState");
this.$message.success("申请成功");
this.$router.replace("/shop/service_application_successfully");
} else {
this.$message.error(response.data.errMsg);
var temp = {
apply_part: {
o_name: formInline.preson,
o_mobile: formInline.phone,
},
carts: [],
};
var temp1 = this.$refs.apply_service.$refs.apply_service_state;
this.post_arr.forEach((e, idx) => {
if (e.service_id) {
temp.carts.push({
id: e.id,
service_id: e.service_id,
duration: e.duration,
spec_id: e.spec_id,
duration_method: e.duration_method,
is_subscribe: e.is_subscribe,
app_id: 0,
scene: temp1[idx].sceneinput,
apply_file: temp1[idx].fileList,
apply_fields: [],
});
// 判断表格ref是否存在
this.temp_sub_arr = temp1[idx].$refs.apply_service_state_table
? temp1[idx].$refs.apply_service_state_table.metaData
: [];
this.deal_data(this.temp_sub_arr);
temp.carts[temp.carts.length - 1][
"apply_fields"
] = this.temp_sub_arr;
} else {
temp.carts.push({
id: e.id,
service_id: 0,
duration: e.duration,
spec_id: e.spec_id,
duration_method: e.duration_method,
is_subscribe: e.is_subscribe,
app_id: e.app_id,
scene: this.$refs.apply_service.$refs.apply_service_state[idx]
.sceneinput,
apply_file: "",
});
}
});
for (let index = 0; index < temp.carts.length; index++) {
const e = temp.carts[index];
// 若表格数据长度不为0,执行以下
if (e.service_id && e.apply_fields.length != 0) {
if (e.apply_fields[0].selected == 0) {
this.$message.error("请选择所需参数");
return;
}
}
}
})
.catch(() => {
this.$message.error("申请失败");
});
this.$http
.post(`/apaas/serviceapp/v3/shopcart/apply`, temp)
.then((response) => {
console.log(response);
if (response.data.success) {
this.$store.commit("setMenuCartState");
this.$message.success("申请成功");
this.$router.replace("/shop/service_application_successfully");
} else {
this.$message.error(response.data.errMsg);
}
})
.catch(() => {
this.$message.error("申请失败");
});
} else {
this.$message.error("请完善服务申请");
return;
}
});
},
get_car_list(car_arr) {
this.service_arr = [];
this.post_arr = [];
this.$http
.get(`/apaas/serviceapp/v3/shopcart/list`)
.then(response => {
.then((response) => {
console.log(response);
let data = response.data.data.valid;
data.forEach(e => {
data.forEach((e) => {
if (car_arr.indexOf(e.id) == -1) {
return;
}
......@@ -334,12 +360,12 @@ export default {
this.service_arr[l]["tips"] = [
{
tip: this.share_arr[e.service.openness].name,
type: this.share_arr[e.service.openness].val
}
type: this.share_arr[e.service.openness].val,
},
];
this.service_arr[l]["auth"] = e.service.organization_name;
this.service_arr[l]["size"] = "规格:";
e.service.request_spcs_info.forEach(el => {
e.service.request_spcs_info.forEach((el) => {
if (e.spec_id == el.id) {
this.service_arr[l]["size"] =
this.service_arr[l]["size"] +
......@@ -354,16 +380,18 @@ export default {
"申请方式:" + (e.duration_method == 1 ? "" : "");
this.service_arr[l]["num"] = e.duration;
this.service_arr[l]["isMg"] = e.service.openness == 3;
this.service_arr[l]["data"] = e.service.res_fields?JSON.parse(e.service.res_fields):'[]';
this.service_arr[l]["data"] = e.service.res_fields
? JSON.parse(e.service.res_fields)
: "[]";
console.log(this.service_arr[l]["data"]);
this.service_arr[l]["isapp"] = false;
}
});
// this.service_arr =
})
.catch(response => {});
}
}
.catch((response) => {});
},
},
};
</script>
......
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