Commit 9a4f3652 authored by 张俊's avatar 张俊

Merge branch 'dev' of cloud.wodcloud.com:apaas/apaas-v3-ui into dev

parents 225b17c6 22cafe81
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</span> </span>
<span v-else v-html="item.info" style="white-space:pre-wrap;"></span> <span v-else v-html="item.info" style="white-space:pre-wrap;"></span>
<span <span
v-if="item.type && item.type == 'down'" v-if="item.type && item.type == 'down' && item.url != ''"
class="filebtn" class="filebtn"
@click="download(item.url)" @click="download(item.url)"
>下载文件</span> >下载文件</span>
......
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
@click="nextApply" @click="nextApply"
>再次申请</el-button> >再次申请</el-button>
<el-button <el-button
v-if="orderDetail.approval_first_level == 1 && orderDetail.approval_second_level == 0 && orderDetail.pay_status != -1" v-if="(orderDetail.approval_first_level == 0 && orderDetail.pay_status != -1) || (orderDetail.approval_first_level == 1 && orderDetail.approval_second_level == 0 && orderDetail.pay_status != -1)"
class="again" class="again"
@click="cancelDetail" @click="cancelDetail"
>取消申请</el-button> >取消申请</el-button>
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
<img :src="require('@/assets/imgs/img_yunziyuan.png')" class="detail_service_msg_img" /> <img :src="require('@/assets/imgs/img_yunziyuan.png')" class="detail_service_msg_img" />
<div class="detail_service_msg_right"> <div class="detail_service_msg_right">
<div class="detail_service_name_cloud"> <div class="detail_service_name_cloud">
<span>{{ orderDetail.namespace }}云资源申请</span> <span>{{ orderDetail.namespace }}{{ orderDetail.workplace }}</span>
</div> </div>
</div> </div>
</el-col> </el-col>
...@@ -382,7 +382,10 @@ export default { ...@@ -382,7 +382,10 @@ export default {
.then(response => { .then(response => {
if (response.data.success == 1) { if (response.data.success == 1) {
this.orderDetail = response.data.data; this.orderDetail = response.data.data;
if (this.orderDetail.res_fields != "") {
this.data = JSON.parse(this.orderDetail.res_fields); this.data = JSON.parse(this.orderDetail.res_fields);
}
console.log(this.data);
this.getOrderUser(); this.getOrderUser();
this.getOrderApproval(); this.getOrderApproval();
} else { } else {
...@@ -407,7 +410,10 @@ export default { ...@@ -407,7 +410,10 @@ export default {
}, },
getOrderApproval() { getOrderApproval() {
this.$api.user this.$api.user
.getOrderApproval({ apply_id: this.orderDetail.apply_id }) .getOrderApproval({
apply_id: this.orderDetail.apply_id,
kind: this.orderDetail.order_type
})
.then(response => { .then(response => {
if (response.data.success == 1) { if (response.data.success == 1) {
let data = response.data.data; let data = response.data.data;
......
...@@ -243,7 +243,7 @@ ...@@ -243,7 +243,7 @@
<el-button <el-button
v-if="now_user == 1 && apploy_msg.first_level == 0" v-if="now_user == 1 && apploy_msg.first_level == 0"
class="submit" class="submit"
@click="submit" @click="pass"
>提交资源申请</el-button> >提交资源申请</el-button>
<el-button <el-button
v-if="now_user == 0 && apploy_msg.second_level != 0" v-if="now_user == 0 && apploy_msg.second_level != 0"
...@@ -418,43 +418,10 @@ export default { ...@@ -418,43 +418,10 @@ export default {
align: "center" align: "center"
} }
], ],
appList: [ appList: [],
{
id: "123",
app_name: "单文件啊"
},
{
id: "1223",
app_name: "单文件啊"
},
{
id: "1313",
app_name: "单文件啊"
},
{
id: "124563",
app_name: "单文件啊"
},
{
id: "126783",
app_name: "单文件啊"
},
{
id: "1225673",
app_name: "单文件啊"
},
{
id: "13134563",
app_name: "单文件啊"
},
{
id: "12234563",
app_name: "单文件啊"
}
],
now_user: "", now_user: "",
activeName: null, activeName: null,
tabShow: true, tabShow: false,
cloudData: { cloudData: {
namespace: "", namespace: "",
workplace: "", workplace: "",
...@@ -519,10 +486,7 @@ export default { ...@@ -519,10 +486,7 @@ export default {
this.user_id = this.$route.query.user_id || ""; this.user_id = this.$route.query.user_id || "";
this.apply_type = this.$route.query.apply_type || 0; this.apply_type = this.$route.query.apply_type || 0;
this.use_uid = this.$route.query.use_uid || ""; this.use_uid = this.$route.query.use_uid || "";
this.id = this.$route.query.id || ""; this.id = this.$route.params.id || "";
if (this.use_uid != "") {
this.getCloudApplication();
}
}, },
getUrl() { getUrl() {
return this.$route.path.substring(0, 9); return this.$route.path.substring(0, 9);
...@@ -543,22 +507,7 @@ export default { ...@@ -543,22 +507,7 @@ export default {
this.$router.push("/shop/cloud"); this.$router.push("/shop/cloud");
}, },
distribution() { distribution() {
this.$api.workbench this.$refs.allotConfirm.getDetail(this.apply_id);
.setCloudAllocation({ id: this.id, userId: this.user_id })
.then(response => {
if (response.data.success == 1) {
this.$message({
message: "分配成功",
type: "success"
});
this.$router.push(this.getUrl());
} else {
this.$message({
message: "分配失败",
type: "error"
});
}
});
}, },
refuse() { refuse() {
let query = { let query = {
...@@ -638,55 +587,66 @@ export default { ...@@ -638,55 +587,66 @@ export default {
} }
}); });
}, },
submit() {
this.$refs.allotConfirm.getDetail(this.apply_id);
},
clickTab() {}, clickTab() {},
// 根据列表参数来判断显示什么 // 根据列表参数来判断显示什么
setListWithRole() { setListWithRole() {
console.log(this.now_user + ".." + this.apply_type);
if (this.now_user == 0) { if (this.now_user == 0) {
// 普通用户 // 普通用户
if (this.apply_type == 0) { if (this.use_uid == "") {
// 申请类型0 // 没分配
let index = this.list_arr.findIndex( let index = this.list_arr.findIndex(
item => item.title == "资源使用情况:" item => item.title == "资源使用情况:"
); );
this.list_arr.splice(index); this.list_arr.splice(index);
this.tabShow = false; }
if (this.apply_type == 0) {
// 申请类型0
this.list_arr.splice(2, 1);
} else if (this.apply_type != 0) { } else if (this.apply_type != 0) {
// 申请类型1 // 申请类型1
this.tabShow = false;
} }
this.tabShow = false;
this.activeName = "0";
} else if (this.now_user == 1) { } else if (this.now_user == 1) {
// 组织 // 组织
if (this.apply_type == 0) { if (this.use_uid == "") {
// 申请类型 // 没分配
let index = this.list_arr.findIndex( let index = this.list_arr.findIndex(
item => item.title == "资源使用情况:" item => item.title == "资源使用情况:"
); );
this.list_arr.splice(index); this.list_arr.splice(index);
}
if (this.apply_type == 0) {
// 申请类型0
this.list_arr.splice(2, 1);
} else if (this.apply_type != 0) { } else if (this.apply_type != 0) {
} }
if (this.apploy_msg.first_level == 0) { if (this.apploy_msg.first_level == 0) {
// 没分配 // 没审批
this.tabShow = false; this.tabShow = false;
} else if (this.apploy_msg.first_level != 0) { } else if (this.apploy_msg.first_level != 0) {
// 分配 // 组织审批了
this.tabShow = true; this.tabShow = true;
} }
this.activeName = "0";
} else if (this.now_user == 2) { } else if (this.now_user == 2) {
// 超管 // 超管
if (this.apply_type == 0) { if (this.use_uid == "") {
// 没分配
let index = this.list_arr.findIndex( let index = this.list_arr.findIndex(
item => item.title == "资源使用情况:" item => item.title == "资源使用情况:"
); );
this.list_arr.splice(index); this.list_arr.splice(index);
this.tabShow = false;
} else if (this.apply_type != 0) {
this.tabShow = false;
} }
if (this.apply_type == 0) {
// 申请类型0
this.list_arr.splice(2, 1);
} else if (this.apply_type != 0) {
} }
this.tabShow = false;
this.activeName = "0"; this.activeName = "0";
}
}, },
getCloudDetail() { getCloudDetail() {
let query = { let query = {
...@@ -696,7 +656,7 @@ export default { ...@@ -696,7 +656,7 @@ export default {
}; };
this.$api.workbench.getCloudDetail(query).then(response => { this.$api.workbench.getCloudDetail(query).then(response => {
let data = response.data.data; let data = response.data.data;
console.log(data); if (data) {
this.list_arr[3].info = helper.downloadFileFormat( this.list_arr[3].info = helper.downloadFileFormat(
data.apply_file ? data.apply_file : "" data.apply_file ? data.apply_file : ""
); // application file name ); // application file name
...@@ -712,7 +672,9 @@ export default { ...@@ -712,7 +672,9 @@ export default {
if (count) { if (count) {
this.data1.total = count.cpu_total; this.data1.total = count.cpu_total;
this.data1.remaining = count.cpu_total - count.cpu_use; this.data1.remaining = count.cpu_total - count.cpu_use;
this.data1.data = Math.round((count.cpu_total / count.cpu_use) * 100); this.data1.data = Math.round(
(count.cpu_total / count.cpu_use) * 100
);
this.data2.total = count.memory_total; this.data2.total = count.memory_total;
this.data2.remaining = count.memory_total - count.memory_use; this.data2.remaining = count.memory_total - count.memory_use;
this.data2.data = Math.round( this.data2.data = Math.round(
...@@ -724,7 +686,8 @@ export default { ...@@ -724,7 +686,8 @@ export default {
(count.disk_total / count.disk_use) * 100 (count.disk_total / count.disk_use) * 100
); );
this.data4.total = count.containers_total; this.data4.total = count.containers_total;
this.data4.remaining = count.containers_total - count.containers_use; this.data4.remaining =
count.containers_total - count.containers_use;
this.data4.data = Math.round( this.data4.data = Math.round(
(count.containers_total / count.containers_use) * 100 (count.containers_total / count.containers_use) * 100
); );
...@@ -755,6 +718,10 @@ export default { ...@@ -755,6 +718,10 @@ export default {
this.cloudData.phone = data.phone; this.cloudData.phone = data.phone;
this.cloudData.apply_time = data.apply_time; this.cloudData.apply_time = data.apply_time;
this.cloudData.system_name = data.system_name; this.cloudData.system_name = data.system_name;
}
if (this.use_uid != "") {
this.getCloudApplication();
}
this.setListWithRole(); this.setListWithRole();
}); });
} }
......
...@@ -1205,9 +1205,11 @@ export default { ...@@ -1205,9 +1205,11 @@ export default {
if (this.type == 2) { if (this.type == 2) {
const cloud = data.data.cloud_resource_count; const cloud = data.data.cloud_resource_count;
if (this.level == 1) { if (this.level != 2) {
this.listTotal = data.total; this.listTotal = data.total;
this.listData = data.data.cloud_apply_list; this.listData = data.data.cloud_apply_list;
if (this.level == 1) {
this.cloud_zuzhi = { this.cloud_zuzhi = {
count_zy: cloud.count_zy, count_zy: cloud.count_zy,
dashboard_list: [ dashboard_list: [
...@@ -1237,7 +1239,8 @@ export default { ...@@ -1237,7 +1239,8 @@ export default {
}, },
], ],
}; };
} else if (this.level == 2) { }
} else {
this.cloud_admin = { this.cloud_admin = {
dashboard_list: [ dashboard_list: [
{ {
......
...@@ -450,7 +450,7 @@ export default { ...@@ -450,7 +450,7 @@ export default {
align: "center", align: "center",
}, },
{ {
label: "部署区域", label: "工作区域",
prop: "namespace", prop: "namespace",
align: "center", align: "center",
}, },
...@@ -757,7 +757,7 @@ export default { ...@@ -757,7 +757,7 @@ export default {
align: "center", align: "center",
}, },
{ {
label: "部署区域", label: "工作区域",
prop: "namespace", prop: "namespace",
align: "center", align: "center",
}, },
......
...@@ -32,7 +32,7 @@ const user = { ...@@ -32,7 +32,7 @@ const user = {
return axios.get(`/apaas/serviceapp/v3/order/applyInfo?order_id=${params.order_id}`); return axios.get(`/apaas/serviceapp/v3/order/applyInfo?order_id=${params.order_id}`);
}, },
getOrderApproval(params) { getOrderApproval(params) {
return axios.get(`/apaas/serviceapp/v3/order/approval?apply_id=${params.apply_id}`); return axios.get(`/apaas/serviceapp/v3/order/approval?apply_id=${params.apply_id}&kind=${params.kind}`);
}, },
cancelOrder(params) { cancelOrder(params) {
return axios.get(`/order/cancel?order_id=${params.order_id}`); return axios.get(`/order/cancel?order_id=${params.order_id}`);
......
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