Commit 85c35d50 authored by 徐一鸣's avatar 徐一鸣

服务管理-云资源列表(普通用户和组织管理员)接口调试完毕

parent c84dd1a3
......@@ -11,29 +11,23 @@
<p class="info_text text_grey">申请组织:</p>
<p
class="info_text"
v-text="(detail && detail['a_申请组织']) || ''"
v-text="(detail && detail['department_name']) || '-'"
></p>
</div>
<div class="info_list" style="width: 50%;">
<p class="info_text text_grey">申请用户:</p>
<p
class="info_text"
v-text="(detail && detail['a_申请用户']) || ''"
v-text="(detail && detail['user_name']) || '-'"
></p>
</div>
<div class="info_list" style="width: 50%;">
<p class="info_text text_grey">联系电话:</p>
<p
class="info_text"
v-text="(detail && detail['a_联系电话']) || ''"
></p>
<p class="info_text" v-text="(detail && detail['phone']) || '-'"></p>
</div>
<div class="info_list" style="width: 100%;">
<p class="info_text text_grey">上传申请文件:</p>
<p
class="info_text"
v-text="(detail && detail['a_上传申请文件']) || ''"
></p>
<p class="info_text" v-text="(detail && detail['file']) || '-'"></p>
</div>
<div class="info_list" style="width: 100%;">
<!-- <p class="detail_title info_text text_grey">原规格:</p> -->
......@@ -42,35 +36,37 @@
<p class="info_text">基本信息:</p>
<p class="info_text info_cell">
<span class="text_grey">工作区域名称:</span>
<span
v-text="(detail && detail['a_工作区域名称']) || ''"
></span>
<span v-text="(detail && detail['namespace']) || '-'"></span>
</p>
<p class="info_text info_cell">
<span class="text_grey">中文名称:</span>
<span v-text="(detail && detail['a_中文名称']) || ''"></span>
<span v-text="(detail && detail['workplace']) || '-'"></span>
</p>
<p class="info_text info_cell">
<span class="text_grey">描述信息:</span>
<span v-text="(detail && detail['a_描述信息']) || ''"></span>
<span
v-text="(detail && detail['workplacedesc']) || '-'"
></span>
</p>
</div>
<div class="detail_list">
<p class="info_text">工作区域申请规格:</p>
<p class="info_text info_cell">
<span class="text_grey">CPU:</span>
<span v-text="(detail && detail['a_CPU']) || ''"></span>
<span v-text="(detail && detail['cpu']) || '-'"></span>
</p>
<p class="info_text info_cell">
<span class="text_grey"> 内存:</span>
<span v-text="(detail && detail['a_内存']) || ''"></span>
<span v-text="(detail && detail['memory']) || '-'"></span>
</p>
</div>
<div class="detail_list">
<p class="info_text">申请时长:</p>
<p class="info_text info_cell">
<span class="text_grey"> 申请时长:</span>
<span v-text="(detail && detail['a_申请时长']) || ''"></span>
<span
v-text="(detail && detail['duration_time']) || '-'"
></span>
</p>
</div>
</div>
......@@ -82,7 +78,12 @@
<el-button type="defalut" size="mini" @click="hideDialog">
取消
</el-button>
<el-button type="primary" size="mini" @click="confrimAction">
<el-button
type="primary"
size="mini"
:loading="submitLoading"
@click="confrimAction"
>
确认提交
</el-button>
</template>
......@@ -96,6 +97,7 @@ export default {
components: { apassDialog },
data: () => ({
detail: null,
submitLoading: false,
}),
methods: {
showDialog() {
......@@ -104,18 +106,22 @@ export default {
hideDialog() {
this.$refs.confrim.hide();
},
getDetail(applyid) {
getDetail(apply_id) {
this.$http
.get("/apaas/service/v3/resource/user/apply/approveddetail", {
.get("/apaas/service/v3/resource/apply/distributionDisplay", {
params: {
type: 0,
applyid: applyid,
apply_id: apply_id,
},
})
.then(({ data }) => {
if (data.success) {
console.log(data.data);
// this.detail = data.data;
let datas = data.data;
this.detail = {
...datas,
cpu: `最高${datas.max_cpu}核,默认${datas.min_cpu}核`,
memory: `最高${datas.max_memory}GB,默认${datas.min_memory}GB`,
};
} else {
this.$message({
message: "获取详情失败",
......@@ -130,24 +136,44 @@ export default {
});
});
this.detail = {
a_申请组织: "贵州省交通运输厅",
a_申请用户: "贵州省交通运输厅",
a_联系电话: "13523232333",
a_上传申请文件: "云资源申请修改意见V2.0审批审批函.pdf",
a_工作区域名称: "aPaaS-V3.0",
a_中文名称: "aPaaS平台V3.0",
a_描述信息:
"用于部署运行aPaaS平台V3.0用于部署运行aPaaS平台V3.0用于部署运行aPaaS平台V3.0",
a_CPU: "最高2核,默认1核",
a_内存: "最高2GB,默认1GB",
a_申请时长: "6个月",
};
this.showDialog();
},
confrimAction() {
console.log("confrim");
this.submitLoading = true;
this.$http
.put("/apaas/service/v3/resource/apply/distribution", null, {
params: {
id: this.detail.id,
user_id: this.detail.user_id,
},
})
.then(({ data }) => {
this.submitLoading = false;
if (data.success) {
this.$message({
message: "分配成功",
type: "success",
});
this.$emit("allot-success");
this.hideDialog();
} else {
this.$message({
message: "分配失败",
type: "warning",
});
}
})
.catch((error) => {
this.submitLoading = false;
this.$message({
message: "分配失败",
type: "warning",
});
});
},
},
};
......
<template>
<div class="organization_card">
<a class="remove_btn" @click.prevent="deleteAction">
<a class="remove_btn" @click.prevent="deleteAction" v-if="!hideDelete">
<i class="el-icon-close"></i>
</a>
<div class="organization_card-icon">
<el-avatar shape="square" :size="56" fit="cover" :src="data.picture_path" />
<el-avatar
shape="square"
:size="56"
fit="cover"
:src="data.picture_path"
/>
</div>
<div class="organization_card-info">
<p
......@@ -52,9 +57,12 @@ export default {
type: String,
default: 0,
},
hideDelete: {
type: Boolean,
default: false,
},
},
created(){
},
created() {},
methods: {
deleteAction() {
this.$emit("delete-action", this.data);
......
......@@ -5,6 +5,7 @@
:key="'organization_card_' + index"
:data="item"
@delete-action="deleteAction"
:hide-delete="hideDelete"
:details-url="detailsUrl"
:style="{ width: 'calc(100% / ' + rowNum + ' - 36px)' }"
></organization-card>
......@@ -27,6 +28,10 @@ export default {
type: String,
default: 0,
},
hideDelete: {
type: Boolean,
default: false,
},
},
data: () => ({
rowNum: 5,
......
This diff is collapsed.
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