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

Merge branch 'dev'

parents ec84968d 8520c76a
......@@ -27,7 +27,7 @@
</span>
<span
class="right gap"
v-if="data.yydetail || data.xxdetail || data.yydev||data.public||data.unpublic||data.undeploy||data.deploy"
v-if="data.yydetail || data.xxdetail ||data.public||data.unpublic||data.undeploy||data.deploy"
>
|
</span>
......@@ -88,9 +88,9 @@
取消发布
</span>
<span class="info_fix" v-if="data.yydev" @click="subevent(6)">
<!-- <span class="info_fix" v-if="data.yydev" @click="subevent(6)">
应用开发
</span>
</span> -->
</p>
<div class="info_detail">
<p>
......
......@@ -1030,6 +1030,7 @@ export default {
let sumCM = 0;
let sumDisk = 0;
let a_deductions = 0;
let arrJifei = JSON.parse(JSON.stringify(this.jifeiList1));
if (this.activeName == "0") {
a_deductions = this.deductions;
if (this.cpu_memory && this.cpu_memory.length != 0) {
......@@ -1065,9 +1066,9 @@ export default {
}
sumCM = sumCM * Number(this.formNew.appDuration);
if (
this.formNew.dataDisk >= 1 &&
this.formNew.perDataDisk >= 1 &&
this.formNew.appDuration >= 1
this.formNew.dataDisk >= 0 &&
this.formNew.perDataDisk >= 0 &&
this.formNew.appDuration >= 0
) {
if (this.hard_disk && this.hard_disk.length != 0) {
this.disk_single_money = Number(this.hard_disk[0].price);
......@@ -1077,26 +1078,26 @@ export default {
Number(this.formNew.appDuration) *
Number(this.hard_disk[0].price);
}
this.jifeiList1[2] = {
arrJifei[2] = {
name: "数据盘",
num: `${this.formNew.dataDisk}个数据盘,每个数据盘${this.formNew.perDataDisk}GB`,
time: `${this.formNew.appDuration}个月`,
sum: `${sumDisk}金币`,
};
} else {
this.jifeiList1.splice(2);
arrJifei.splice(2);
}
this.jifeiList1[0].num = `${
this.formNew.cpu >= 1 ? this.formNew.cpu : 0
}核+${this.formNew.memory >= 1 ? this.formNew.memory : 0}G`;
this.jifeiList1[0].time = `${
arrJifei[0].num = `${this.formNew.cpu >= 1 ? this.formNew.cpu : 0}核+${
this.formNew.memory >= 1 ? this.formNew.memory : 0
}G`;
arrJifei[0].time = `${
this.formNew.appDuration >= 1 ? this.formNew.appDuration : 0
}个月`;
this.jifeiList1[0].sum = `${sumCM}金币`;
this.jifeiList1[1].num = `${
arrJifei[0].sum = `${sumCM}金币`;
arrJifei[1].num = `${
this.formNew.containerGroup >= 1 ? this.formNew.containerGroup : 0
}个`;
this.jifeiList1[1].time = `${
arrJifei[1].time = `${
this.formNew.appDuration >= 1 ? this.formNew.appDuration : 0
}个月`;
} else if (this.activeName == "1") {
......@@ -1134,9 +1135,9 @@ export default {
}
sumCM = sumCM * Number(this.formOld.appDuration);
if (
this.formOld.dataDisk >= 1 &&
this.formOld.perDataDisk >= 1 &&
this.formOld.appDuration >= 1
this.formOld.dataDisk >= 0 &&
this.formOld.perDataDisk >= 0 &&
this.formOld.appDuration >= 0
) {
if (this.hard_disk && this.hard_disk.length != 0) {
this.disk_single_money = Number(this.hard_disk[0].price);
......@@ -1146,29 +1147,32 @@ export default {
Number(this.formOld.appDuration) *
Number(this.hard_disk[0].price);
}
this.jifeiList1[2] = {
arrJifei[2] = {
name: "数据盘",
num: `${this.formOld.dataDisk}个数据盘,每个数据盘${this.formOld.perDataDisk}GB`,
time: `${this.formOld.appDuration}个月`,
sum: `${sumDisk}金币`,
};
} else {
this.jifeiList1.splice(2);
arrJifei.splice(2);
}
this.jifeiList1[0].num = `${
this.formOld.cpu >= 1 ? this.formOld.cpu : 0
}核+${this.formOld.memory >= 1 ? this.formOld.memory : 0}G`;
this.jifeiList1[0].time = `${
arrJifei[0].num = `${this.formOld.cpu >= 1 ? this.formOld.cpu : 0}核+${
this.formOld.memory >= 1 ? this.formOld.memory : 0
}G`;
arrJifei[0].time = `${
this.formOld.appDuration >= 1 ? this.formOld.appDuration : 0
}个月`;
this.jifeiList1[0].sum = `${sumCM}金币`;
this.jifeiList1[1].num = `${
arrJifei[0].sum = `${sumCM}金币`;
arrJifei[1].num = `${
this.formOld.containerGroup >= 1 ? this.formOld.containerGroup : 0
}个`;
this.jifeiList1[1].time = `${
arrJifei[1].time = `${
this.formOld.appDuration >= 1 ? this.formOld.appDuration : 0
}个月`;
}
this.$nextTick(() => {
this.jifeiList1 = arrJifei;
});
// console.log(sumCM, sumDisk)
this.amounts_payable = Number(
(Number(sumCM) + Number(sumDisk)).toFixed(2)
......@@ -1629,7 +1633,7 @@ export default {
name: "数据盘",
num: `${this.dataDiskList.length}个数据盘,共计${this.dataDiskList.length}GB"`,
time: "0个月",
sum: "2000金币",
sum: "0金币",
},
];
} else {
......
......@@ -38,16 +38,26 @@
:defaultOpen="preview"
:editable="false"
/> -->
<div slot="app_code" style="white-space: pre-wrap;background-color:rgb(251,251,251);padding:15px;border-radius:5px;">{{appcode}}</div>
<div
slot="app_code"
style="
white-space: pre-wrap;
background-color: rgb(251, 251, 251);
padding: 15px;
border-radius: 5px;
"
>
{{ appcode }}
</div>
</info-list>
<div
v-if="
service_arr[now_user][now_service] == '镜像文件管理' &&
now_user == 0
now_user == 0
"
>
<p style="color:#8890a7;">镜像列表:</p>
<p style="color: #8890a7">镜像列表:</p>
<div
v-if="image_arr"
class="image_list_container"
......@@ -58,10 +68,16 @@
:data="image_arr"
:padding-left="60"
></apass-table>
<p style="text-align: center;line-height: 36px;" v-if="image_loading">
<p
style="text-align: center; line-height: 36px"
v-if="image_loading"
>
加载中...
</p>
<p style="text-align: center;line-height: 36px;" v-if="image_noMore">
<p
style="text-align: center; line-height: 36px"
v-if="image_noMore"
>
没有更多了
</p>
</div>
......@@ -115,21 +131,21 @@
<div
v-if="
service_arr[now_user][now_service] == '部署文件管理' &&
now_user == 0
now_user == 0
"
>
<p style="color:#8890a7;">压缩包:</p>
<p style="color: #8890a7">压缩包:</p>
<p>
<img
src="@/assets/imgs/ic_olddata.png"
alt=""
style="margin-right: 10px;"
style="margin-right: 10px"
/>{{ oldpag_name }}
<span class="download" @click="down_load_zip">下载原压缩包</span>
</p>
<p style="color:#8890a7;margin:20px 0;">上传新的压缩包:</p>
<p style="color: #8890a7; margin: 20px 0">上传新的压缩包:</p>
<div class="uploadtips">
<p style="margin-left:-11px;">
<p style="margin-left: -11px">
<i class="el-icon-warning-outline"></i>压缩包上传提示:
</p>
<p>
......@@ -181,8 +197,8 @@
v-if="
(service_arr[now_user][now_service] == '评分及评论' &&
now_user == 0) ||
(service_arr[now_user][now_service] == '评分及评论' &&
now_user !== 0)
(service_arr[now_user][now_service] == '评分及评论' &&
now_user !== 0)
"
>
<service-tab-comments
......@@ -193,8 +209,8 @@
</service-tab-comments>
</div>
<div v-if="service_arr[now_user][now_service]=='应用计费规则'">
<p style="color: #8890a7;">应用规格:</p>
<div v-if="service_arr[now_user][now_service] == '应用计费规则'">
<p style="color: #8890a7">应用规格:</p>
<table-um
:stripe="true"
:headers="service_size_arr"
......@@ -209,7 +225,7 @@
</div>
<p
v-if="now_user == 1 && sizeset_flag"
style="color: #8890a7;margin-bottom:10px;"
style="color: #8890a7; margin-bottom: 10px"
>
规格设置:
</p>
......@@ -232,30 +248,30 @@
</div>
</div>
<div v-if="service_arr[now_user][now_service]=='应用交易记录'">
<div v-if="service_arr[now_user][now_service] == '应用交易记录'">
<info-list :list_arr="trans_log_arr">
<div slot="trans_all" class="trans_all">
<div class="trans_box">
<div class="trans_middle">
<img src="../../../assets/imgs/ic_shouyizonge.png" alt="">
<img src="../../../assets/imgs/ic_shouyizonge.png" alt="" />
<p>应用收益总额</p>
<p>{{trans_all_obj.all}} </p>
<p>{{ trans_all_obj.all }}</p>
<span>金币</span>
</div>
</div>
<div class="trans_box">
<div class="trans_middle">
<img src="../../../assets/imgs/ic_jiaoyizs.png" alt="">
<img src="../../../assets/imgs/ic_jiaoyizs.png" alt="" />
<p>交易总数</p>
<p>{{trans_all_obj.times}} </p>
<p>{{ trans_all_obj.times }}</p>
<span></span>
</div>
</div>
<div class="trans_box">
<div class="trans_middle">
<img src="../../../assets/imgs/ic_yuejiaoyi.png" alt="">
<img src="../../../assets/imgs/ic_yuejiaoyi.png" alt="" />
<p>本月交易总数</p>
<p>{{trans_all_obj.month}} </p>
<p>{{ trans_all_obj.month }}</p>
<span></span>
</div>
</div>
......@@ -310,35 +326,35 @@ export default {
serviceTabComments,
apassTable,
imageDetail,
ListPagination
ListPagination,
},
data() {
var checkname = (rule, value, callback) => {
var reg = /^[a-z\-_]+$/
setTimeout(() => {
if (reg.test(value)) {
callback();
} else {
callback(new Error('只支持小写字母 - _'));
}
}, 100);
};
var reg = /^[a-z\-_]+$/;
setTimeout(() => {
if (reg.test(value)) {
callback();
} else {
callback(new Error("只支持小写字母 - _"));
}
}, 100);
};
var checktag = (rule, value, callback) => {
var reg = /^[a-zA-Z0-9|.]+$/
setTimeout(() => {
if (reg.test(value)) {
callback();
} else {
callback(new Error('只支持小写字母 数字 .'));
}
}, 100);
};
var reg = /^[a-zA-Z0-9|.]+$/;
setTimeout(() => {
if (reg.test(value)) {
callback();
} else {
callback(new Error("只支持小写字母 数字 ."));
}
}, 100);
};
return {
now_user: 0, //0:普通用户,1:组织管理员,2:超级管理员
buy_style: 0,
image_loading: false,
image_noMore: false,
sizeset_flag:false,
sizeset_flag: false,
translistTotal: 0,
transcurrentPage: 1,
transpageSize: 10,
......@@ -346,7 +362,7 @@ export default {
preview: "preview",
subfield: false,
image_arr: [],
size_arr_down:[],
size_arr_down: [],
now_page: 1,
total: 0,
anotherData: {},
......@@ -367,7 +383,7 @@ export default {
taps: "",
},
fileList: [],
trans_log_header:[
trans_log_header: [
{
prop: "department_name",
label: "申请单位",
......@@ -411,29 +427,29 @@ export default {
align: "center",
},
],
trans_log_data:[],
trans_log_arr:[
trans_log_data: [],
trans_log_arr: [
{
title: "应用交易概览",
info: "",
prop:'title',
prop: "title",
type: "solt",
solt_name: "trans_all",
},
{
title: "应用交易记录",
info: "",
prop:'title',
prop: "title",
type: "solt",
solt_name: "trans_log",
},
],
trans_all_obj:{
all:0,
times:0,
month:0,
trans_all_obj: {
all: 0,
times: 0,
month: 0,
},
service_size_data:[],
service_size_data: [],
service_size_arr: [
{
prop: "type",
......@@ -460,13 +476,13 @@ export default {
align: "left",
},
],
edit_size_arr:[
edit_size_arr: [
{
prop: "type",
label: "规格类别",
width: "250px",
align: "left",
type:'input'
type: "input",
},
{
prop: "price",
......@@ -486,17 +502,18 @@ export default {
label: "规格说明",
minWidth: "33.33%",
align: "left",
type:'input'
}
type: "input",
},
],
rules: {
name: [{ required: true, message: "请输入镜像名称", trigger: "blur" },
{ max:20, message: "应小于20个字符", trigger: 'blur' },
{validator: checkname, trigger: 'blur' }
],
name: [
{ required: true, message: "请输入镜像名称", trigger: "blur" },
{ max: 20, message: "应小于20个字符", trigger: "blur" },
{ validator: checkname, trigger: "blur" },
],
taps: [
{ required: true, message: "请输入镜像版本", trigger: "blur" },
{ max:10, message: "应小于10个字符", trigger: 'blur' },
{ max: 10, message: "应小于10个字符", trigger: "blur" },
{ validator: checktag, trigger: "blur" },
],
},
......@@ -632,100 +649,109 @@ export default {
];
},
methods: {
get_app_size(){
get_app_size() {
this.$http
.get(
`/apaas/hubApi/market/appSpecification?id=${this.$route.params.id}`
).then((res)=>{
)
.then((res) => {
console.log(res);
if(res.data.success){
var data = res.data.data
var temp = [{
id:data.id,
type:'申请获取应用镜像部署权限',
time:'按月',
price:data.price,
des:data.specifications
}]
this.service_size_data = temp
this.size_arr_down = temp
if (res.data.success) {
var data = res.data.data;
var temp = [
{
id: data.id,
type: "申请获取应用镜像部署权限",
time: "按月",
price: data.price,
des: data.specifications,
},
];
this.service_size_data = temp;
this.size_arr_down = temp;
}
})
});
},
transchangePageSize(value) {
this.transpageSize = value;
this.transcurrentPage = 1;
this.get_app_trans_data()
this.get_app_trans_data();
},
transchangeCurrentPage(value) {
this.transcurrentPage = value;
this.get_app_trans_data()
this.get_app_trans_data();
},
change_service_size(){
change_service_size() {
console.log(this.size_arr_down);
this.$http
.put(
`/apaas/hubApi/market/appSpecification`,{
"id":parseInt(this.$route.params.id),
    "price":this.size_arr_down[0].price,
    "price_style":0,
    "specification_category":"申请获取应用镜像部署权限",
    "specifications":this.size_arr_down[0].des
}
).then(res=>{
if(res.data.success){
this.$message.success('修改成功')
this.sizeset_flag = false
this.get_app_size()
}else{
this.$message.error(this.data.errMsg)
}
})
if (
this.size_arr_down[0].price != "" &&
this.size_arr_down[0].des != ""
) {
this.$http
.put(`/apaas/hubApi/market/appSpecification`, {
id: parseInt(this.$route.params.id),
price: this.size_arr_down[0].price,
price_style: 0,
specification_category: "申请获取应用镜像部署权限",
specifications: this.size_arr_down[0].des,
})
.then((res) => {
if (res.data.success) {
this.$message.success("修改成功");
this.sizeset_flag = false;
this.get_app_size();
} else {
this.$message.error(res.data.errMsg);
}
});
} else {
this.$message.error("请完善规格信息");
}
},
get_app_trans_all(){
get_app_trans_all() {
this.$http
.get(
`/apaas/hubApi/market/incomeStatistics?id=${this.$route.params.id}&limit=${this.transpageSize}&page=${this.transcurrentPage}`
).then(res=>{
if(res.data.success){
var data = res.data.data
this.trans_all_obj={
all:data.sum,
times:data.count,
month:data.month_count,
}
)
.then((res) => {
if (res.data.success) {
var data = res.data.data;
this.trans_all_obj = {
all: data.sum,
times: data.count,
month: data.month_count,
};
}
})
});
},
get_app_trans_data(){
get_app_trans_data() {
this.$http
.get(
`/apaas/hubApi/market/transactionRecord?app_id=${this.$route.params.id}&limit=${this.transpageSize}&page=${this.transcurrentPage}`
).then(res=>{
)
.then((res) => {
console.log(res);
if(res.data.success){
res.data.data.forEach(e => {
e.add_time_name = helper.dateStringTransform(e.add_time)
if (res.data.success) {
res.data.data.forEach((e) => {
e.add_time_name = helper.dateStringTransform(e.add_time);
});
this.trans_log_data = res.data.data
this.translistTotal = res.data.total
this.trans_log_data = res.data.data;
this.translistTotal = res.data.total;
}
})
});
},
now_size_data(val){
val.forEach(e=>{
e.type = '申请获取应用镜像部署权限'
e.time = '按月'
})
this.size_arr_down = val
now_size_data(val) {
val.forEach((e) => {
e.type = "申请获取应用镜像部署权限";
e.time = "按月";
});
this.size_arr_down = val;
},
showImageDetail(item) {
this.$refs.imageDetail.showDialog({
...item,
app_id: this.$route.params.id
app_id: this.$route.params.id,
});
},
getCurrentUser() {
......@@ -817,10 +843,10 @@ export default {
this.$message.error(response.errMsg);
}
},
change_file_state(file,fileList){
console.log(file,fileList);
if(fileList.length>=2){
this.fileList = [file]
change_file_state(file, fileList) {
console.log(file, fileList);
if (fileList.length >= 2) {
this.fileList = [file];
}
},
upload_error() {
......@@ -868,7 +894,9 @@ export default {
},
delete_data(name) {
this.$http
.delete(`/apaas/hubApi/image/del/${name}?app_id=${this.$route.params.id}`)
.delete(
`/apaas/hubApi/image/del/${name}?app_id=${this.$route.params.id}`
)
.then((response) => {
if (response.data.success == 1) {
this.$message.success("删除成功");
......@@ -1080,16 +1108,17 @@ export default {
data.up_platform_status == 0
) {
this.service_arr[this.now_user].push("评分及评论");
if(this.$route.query.source == "apply"){
}else{
this.get_app_size()
this.get_app_trans_data()
this.get_app_trans_all()
this.service_arr[this.now_user].push(...["应用计费规则","应用交易记录"]);
if (this.$route.query.source == "apply") {
} else {
this.get_app_size();
this.get_app_trans_data();
this.get_app_trans_all();
this.service_arr[this.now_user].push(
...["应用计费规则", "应用交易记录"]
);
}
}
if (this.now_user == 0) {
temp_info.fxdetail = true;
}
......@@ -1108,7 +1137,7 @@ export default {
this.service_header_arr = temp_info;
}
})
.catch(function(response) {});
.catch(function (response) {});
},
getServiceBaseInfo() {
......@@ -1120,7 +1149,7 @@ export default {
this.$set(this.list_arr[1], "info", data.gnjj);
this.$set(this.list_arr[2], "info", data.cjsl);
})
.catch(function(response) {});
.catch(function (response) {});
},
get_app_code() {
this.$http
......@@ -1129,13 +1158,13 @@ export default {
let data = response.data.data;
this.appcode = data;
})
.catch(function(response) {});
.catch(function (response) {});
},
refreshImageList() {
this.now_page = 1;
this.image_arr = [];
this.get_image_list();
}
},
},
};
</script>
......@@ -1256,13 +1285,13 @@ export default {
height: 284px;
overflow-y: auto;
}
.trans_all{
.trans_all {
width: 100%;
height: 128px;
background-color: #fbfcfe;
border-radius: 12px;
background-color: #fbfcfe;
border-radius: 12px;
}
.trans_all .trans_box{
.trans_all .trans_box {
width: 33.3%;
float: left;
height: 65px;
......@@ -1270,10 +1299,10 @@ export default {
margin-top: 30px;
border-right: 2px solid #e6ebfe;
}
.trans_all .trans_box:nth-last-of-type(1){
.trans_all .trans_box:nth-last-of-type(1) {
border: 0;
}
.trans_middle{
.trans_middle {
width: 200px;
height: 65px;
line-height: 65px;
......@@ -1281,33 +1310,32 @@ export default {
position: relative;
text-align: right;
}
.trans_middle img{
.trans_middle img {
position: absolute;
left: 0;
top: 15px;
}
.trans_middle span{
.trans_middle span {
position: absolute;
right: -20px;
top: 18px;
font-size: 16px;
color: #242c43;
color: #242c43;
}
.trans_middle p{
.trans_middle p {
font-size: 16px;
line-height: 32px;
color: #58617a;
color: #58617a;
}
.trans_middle p:nth-of-type(2){
.trans_middle p:nth-of-type(2) {
font-size: 24px;
font-weight: bold;
color: #242c43;
font-weight: bold;
color: #242c43;
}
.trans_all .trans_box:nth-of-type(1) .trans_middle span{
.trans_all .trans_box:nth-of-type(1) .trans_middle span {
right: -40px;
}
.trans_log{
.trans_log {
width: 100%;
}
</style>
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