Commit 0f20918b authored by 张俊's avatar 张俊

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

parents 90126061 07a50d43
<template>
<div>
<div v-if="type == 'cropper'">
<cropper :max="max" :readOnly="readOnly" :fileArray="fileArray" :fit="fit" @getNewUrl="getNewUrl"></cropper>
<cropper
:max="max"
:readOnly="readOnly"
:fileArray="fileArray"
:fit="fit"
@getNewUrl="getNewUrl"
></cropper>
</div>
<div v-else>
<el-upload
......@@ -38,50 +44,54 @@
import cropper from "@/components/general/cropper";
export default {
components: {
cropper
cropper,
},
data() {
return {
hideUpload: false,
fileArray: [],
anotherData: {
directory: "file"
}
directory: "file",
},
};
},
props: {
multiple: {
type: Boolean,
default: false
default: false,
},
directory: {
type: String,
default: ''
default: "",
},
max: {
type: Number,
default: 1
default: 1,
},
list: {
type: Array,
default: () => []
default: () => [],
},
type: {
type: String,
default: ""
default: "",
},
readOnly: {
type: Boolean,
default: false
default: false,
},
fit: {
type: String,
default: ""
default: "",
},
drag: {
type: Boolean,
default: false
}
default: false,
},
unique: {
type: Boolean,
default: false,
},
},
watch: {
list(value) {
......@@ -90,19 +100,20 @@ export default {
for (var i = 0; i < value.length; i++) {
getListImg.push({
name: value[i],
url: value[i]
url: value[i],
});
}
}
this.fileArray = [...getListImg];
this.hideUpload = this.fileArray.length >= this.max;
}
},
},
created(){
if(this.directory){
this.anotherData={
directory: this.directory
}
created() {
if (this.directory) {
this.anotherData = {
directory: this.directory,
"unique-code": this.unique ? "" : false,
};
}
},
methods: {
......@@ -128,7 +139,6 @@ export default {
}
return isJPG && isLt10M;
} else {
}
},
handleAvatarSuccess(response, file, fileList) {
......@@ -137,7 +147,7 @@ export default {
if (response.success == 1) {
this.fileArray.push({
url: response.data,
name: file.name
name: file.name,
});
}
this.$emit("getNewList", this.fileArray);
......@@ -146,7 +156,7 @@ export default {
this.fileArray.push({
url: response.data,
name: file.name,
size: file.size
size: file.size,
});
}
this.$emit("getNewList", this.fileArray);
......@@ -154,7 +164,7 @@ export default {
if (response.success == 1) {
this.fileArray.push({
url: response.data,
name: file.name
name: file.name,
});
}
this.$emit("getNewList", this.fileArray);
......@@ -181,21 +191,24 @@ export default {
}
});
}
this.hideUpload = fileList.length >= this.max;
this.$emit("getNewList", this.fileArray);
},
remove_pic(){
document.querySelector('.eeupload').querySelector('.el-upload-list__item-delete').click();
setTimeout(()=>{
document.querySelector('.eeupload').querySelector('.el-upload').click();
},1000)
remove_pic() {
document
.querySelector(".eeupload")
.querySelector(".el-upload-list__item-delete")
.click();
setTimeout(() => {
document.querySelector(".eeupload").querySelector(".el-upload").click();
}, 1000);
},
getNewUrl(val) {
let fileObj = [{ name: val, url: val }];
this.$emit("getNewList", fileObj);
}
}
},
},
};
</script>
<style>
......
This diff is collapsed.
......@@ -58,7 +58,7 @@ export default {
}
},
data: () => ({
selectValue: "0"
selectValue: 0
}),
mounted() {
this.selectValue = this.item;
......
......@@ -102,6 +102,7 @@ export default {
apply_type: item.apply_type,
use_uid: item.use_uid,
user_id: item.user_id,
isApprove: 1
},
});
},
......
......@@ -105,10 +105,10 @@
</div>
</div>
<div class="params_block_item_in">
<span class="params_block_item_title">CPU</span>
<span class="params_block_item_title">内存</span>
<div class="params_block_item_val">
<span class="val_has_2">最高&nbsp;{{ cloudDteail.one_memory_max }}</span>
<span class="val_has_2">默认&nbsp;{{ cloudDteail.one_memory_min }}</span>
<span class="val_has_2">最高&nbsp;{{ cloudDteail.one_memory_max }}G</span>
<span class="val_has_2">默认&nbsp;{{ cloudDteail.one_memory_min }}G</span>
</div>
</div>
</div>
......@@ -155,10 +155,10 @@
</div>
</div>
<div class="params_block_item_in">
<span class="params_block_item_title">CPU</span>
<span class="params_block_item_title">内存</span>
<div class="params_block_item_val">
<span class="val_has_2">最高&nbsp;{{ cloudDetailNew.adjust_one_memory_max }}</span>
<span class="val_has_2">默认&nbsp;{{ cloudDetailNew.adjust_one_memory_min }}</span>
<span class="val_has_2">最高&nbsp;{{ cloudDetailNew.adjust_one_memory_max }}G</span>
<span class="val_has_2">默认&nbsp;{{ cloudDetailNew.adjust_one_memory_min }}G</span>
</div>
</div>
</div>
......@@ -245,7 +245,7 @@
@click="pass"
>提交资源申请</el-button>
<el-button
v-if="now_user == 0 && apploy_msg.second_level != 0"
v-if="now_user == 0 && use_uid != '' && apploy_msg.second_level != 0"
class="adjustment"
@click="adjustment"
>资源调整</el-button>
......@@ -264,7 +264,7 @@
class="adjustment"
@click="pass"
>通过</el-button>
<el-button v-if="now_user == 2 && use_uid != ''" class="refuse" @click="deleteItem">删除</el-button>
<el-button v-if="now_user == 2 && use_uid != '' && !isApprove" class="refuse" @click="deleteItem">删除</el-button>
</div>
</BlockRadius>
<AllotInfoConfirm ref="allotConfirm"></AllotInfoConfirm>
......@@ -306,7 +306,7 @@ export default {
{
title: "审批通过后工作区域规格:",
type: "solt",
solt_name: "ApplyParams"
solt_name: "ApplyBeforeParams"
},
{
title: "资源申请文件:",
......@@ -460,7 +460,10 @@ export default {
watch: {},
computed: {
...mapGetters(["level"]),
...mapState(["userInfo"])
...mapState(["userInfo"]),
isApprove() {
return this.$route.query.isApprove == 1;
}
},
created() {
if (this.userInfo) {
......@@ -712,11 +715,11 @@ export default {
this.cloudDetailNew.adjust_cpu = data.adjust_cpu;
this.cloudDetailNew.adjust_disk = data.adjust_disk;
this.cloudDetailNew.adjust_memory = data.adjust_memory;
this.cloudDteail.adjust_duration_time = data.adjust_duration_time;
this.cloudDteail.adjust_one_cpu_max = data.adjust_one_cpu_max;
this.cloudDteail.adjust_one_cpu_min = data.adjust_one_cpu_min;
this.cloudDteail.adjust_one_memory_max = data.adjust_one_memory_max;
this.cloudDteail.adjust_one_memory_min = data.adjust_one_memory_min;
this.cloudDetailNew.adjust_duration_time = data.adjust_duration_time;
this.cloudDetailNew.adjust_one_cpu_max = data.adjust_one_cpu_max;
this.cloudDetailNew.adjust_one_cpu_min = data.adjust_one_cpu_min;
this.cloudDetailNew.adjust_one_memory_max = data.adjust_one_memory_max;
this.cloudDetailNew.adjust_one_memory_min = data.adjust_one_memory_min;
this.apploy_msg.first_level = data.first_level;
this.apploy_msg.second_level = data.second_level;
this.cloudData.namespace = data.namespace;
......
......@@ -408,8 +408,8 @@ export default {
align: "left",
width: 100,
selectArr: [
{ label: "", value: "1" },
{ label: "", value: "0" }
{ label: "", value: 1 },
{ label: "", value: 0 }
],
hasDefault: true
},
......
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