diff --git a/src/components/app-list/app-card.vue b/src/components/app-list/app-card.vue index 32fab12b8984ec665aa5c3daee70ba3bc642305d..11805fecca7671119c3aa660f9d5609c14134a68 100644 --- a/src/components/app-list/app-card.vue +++ b/src/components/app-list/app-card.vue @@ -53,7 +53,7 @@ export default { this.$emit("delete-action", this.data); }, intoDetail() { - this.$router.push(`${this.detailsUrl}${this.data.up_userid}`); + this.$router.push(`${this.detailsUrl}${this.data.app_id}`); }, }, }; diff --git a/src/components/service-header.vue b/src/components/service-header.vue index 835592b1260ce19749a2e2ec238b1287b90054d2..9500da04c6b0b358d09ba197f2be5ce7a79e8546 100644 --- a/src/components/service-header.vue +++ b/src/components/service-header.vue @@ -7,10 +7,10 @@

{{ data.name }} 一键部署 - 我要编辑 - | - 申请下线 - 申请下架 + 我要编辑 + | + {{data.xxdetail}} + {{data.yydetail}} 申请密钥 我要修改

@@ -61,11 +61,11 @@ export default { }else if(val == 1){ this.$emit('editapp') }else if(val == 2){ - this.$emit('unline',0) + this.$emit('unline',this.data) }else if(val == 3){ - this.$emit('unsell',1) + this.$emit('unsell',this.data) }else if(val == 4){ - this.$emit('applymy',1) + this.$emit('applymy') } }, goto_page(url){ diff --git a/src/components/service-tabs/service-tab-comments.vue b/src/components/service-tabs/service-tab-comments.vue index 8e69c0759290d5e43ccd01e208f5790654a9159d..4dac2254037592ef00f2cb79056077527e4e8423 100644 --- a/src/components/service-tabs/service-tab-comments.vue +++ b/src/components/service-tabs/service-tab-comments.vue @@ -33,6 +33,10 @@ export default { type: String, required: true, }, + is_app_detail:{ + type: Boolean, + default: false, + } }, data: () => ({ commentsTtotal: 0, @@ -75,16 +79,31 @@ export default { this.init(); }, init() { + if(this.is_app_detail){ + var temp = { + params: { + page: this.currentPage, + limit: this.pageSize, + }, + } + }else{ + var temp = { + params: { + page: this.currentPage, + size: this.pageSize, + }, + } + } this.$http - .get(this.url, { - params: { - page: this.currentPage, - size: this.pageSize, - }, - }) + .get(this.url, temp) .then(({ data }) => { - this.commentsTtotal = data.total; - this.commentsList = data.data; + if(this.is_app_detail){ + this.commentsTtotal = data.data.overview.total; + this.commentsList = data.data.list; + }else{ + this.commentsTtotal = data.total; + this.commentsList = data.data; + } }) .catch(function(error) { console.log(error); diff --git a/src/components/table/table-um.vue b/src/components/table/table-um.vue index 8d674957634a6abd9e0c55482878af84ab8c17f9..ff8751b3b6b9aa7714acc5d8c916fe8d832ee5f0 100644 --- a/src/components/table/table-um.vue +++ b/src/components/table/table-um.vue @@ -53,10 +53,12 @@ :border="border" @select="select" @select-all="selectAll" + v-infinite-scroll="asynload" :defaultSelections="defaultSelections" element-loading-text="加载中..." :empty-text="emptyText" :stripe="stripe" + :style="{height:isLoad,overflow:isLoad?'auto':''}" row-key="id" :show-header="showHeader" default-expand-all @@ -264,6 +266,10 @@ export default { "v-apaas-table-filter": TableFilter }, props: { + //是否控制5行显示 + isLoad:'', + //是否滚动加载 + asyn_load1:{ type: Boolean, default: false }, // 表格型号:mini,medium,small size: { type: String, default: "medium" }, loading: { type: Boolean, default: false }, @@ -429,6 +435,12 @@ export default { } }, methods: { + asynload(){ + console.log('111'); + if(this.asyn_load1){ + this.$emit("load_data"); + } + }, //本地删除 deleteLocal(val) { this.selectedTabsPage.splice(val.$index, 1); diff --git a/src/components/upload_file.vue b/src/components/upload_file.vue index 0b2595ae6ac3aa6fbba1ea4404f187cfae99d36c..7d4e96bb558b98ab7e317b866d1a9ff9151ab530 100644 --- a/src/components/upload_file.vue +++ b/src/components/upload_file.vue @@ -127,6 +127,8 @@ export default { this.$message.error("上传图片大小不能超过 10MB!"); } return isJPG && isLt10M; + } else { + } }, handleAvatarSuccess(response, file, fileList) { @@ -147,6 +149,14 @@ export default { }); } this.$emit("getNewList", this.fileArray); + } else { + if (response.success == 1) { + this.fileArray.push({ + url: response.data, + name: file.name + }); + } + this.$emit("getNewList", this.fileArray); } this.hideUpload = fileList.length >= this.max; }, diff --git a/src/main.js b/src/main.js index de017c31b71e93ac5fc8e2d8a5600e3ab6fdab3b..4f9e14fa19d84bdec79762ae722484b8795f3f61 100644 --- a/src/main.js +++ b/src/main.js @@ -4,6 +4,10 @@ import store from "@/store"; import Vue from 'vue' +import mavonEditor from 'mavon-editor' +import 'mavon-editor/dist/css/index.css' +Vue.use(mavonEditor) + import VueResource from "vue-resource"; Vue.use(VueResource); diff --git a/src/pages/authority/organizationuser.vue b/src/pages/authority/organizationuser.vue index 4db07fdfa91e504a4f20489f92a9762cdebace5d..13f8cb3efc098804598385e3891c47bdf38a8204 100644 --- a/src/pages/authority/organizationuser.vue +++ b/src/pages/authority/organizationuser.vue @@ -257,7 +257,7 @@ export default { desc:data.description, person:data.create_user, date:data.create_date, - ip:transform_func(data.ip_whitelist), + ip:this.transform_func(data.ip_whitelist), domain:data.domain_name } }) diff --git a/src/pages/workbench/yygl/app_detail.vue b/src/pages/workbench/yygl/app_detail.vue index ba06b48576579af064b755133e74a51c5474021c..a2a94ba4eaea475ff08c5c313b349d34db37f338 100644 --- a/src/pages/workbench/yygl/app_detail.vue +++ b/src/pages/workbench/yygl/app_detail.vue @@ -24,18 +24,16 @@
- -
-
+

镜像列表:

@@ -53,19 +51,33 @@

上传镜像包:

- + + + +
将文件拖到此处,或点击上传
+
- 保存 - 取消 + 保存 + 取消

压缩包:

-

{{oldpag_name}} 下载原压缩包

+

{{oldpag_name}} 下载原压缩包

上传新的压缩包:

压缩包上传提示:

@@ -73,15 +85,32 @@

2.上述文件必须按照上述名称进行命名;

3.请将文件夹压缩为“.zip”、“.tgz”、“.tar.gz”格式,如:名称为redis-ha的文件夹压缩为redis-ha.zip。

- + + +
将文件拖到此处,或点击上传
+
- 保存 + 保存 取消
- + +
@@ -102,6 +131,7 @@ import dialogAction from "@/components/dialog-action"; import uploadFile from '@/components/upload_file' import serviceTabComments from '@/components/service-tabs/service-tab-comments' import { getRole } from "@/utils/common"; +import { mapGetters,mapState } from 'vuex' export default { components: { infoList, @@ -115,22 +145,36 @@ export default { return { now_user: 0, //0:普通用户,1:组织管理员,2:超级管理员 buy_style: 0, - oldpag_name:'镜像文件002.rar', + preview:'preview', + subfield:false, + image_arr:[], + now_page:1, + total:0, + anotherData:{}, + anotherData1:{}, + asynLoad:false, + oldpag_name:'', imgList: [], imgList1: [], + is_app_detail:true, + commentsData:{ + avgScore:0, + scoreStatic:{}, + }, + commentsUrl:'', form:{ name: '', - fileList:'', + fileList:[], taps:'' }, - fileList:'', + fileList:[], rules:{ name:[ {required: true, message: '请输入镜像名称', trigger: 'blur'} ], taps:[ {required: true, message: '请输入镜像标签', trigger: 'blur'} - ], + ] }, tipsOptions: { title:'', @@ -146,21 +190,54 @@ export default { ], service_header_arr: { name: "", - first: [], - second: [], - yydetail: true, + first: [ + { + "name": "在线状态", + "text": "" + }, + { + "name": "应用类型", + "text": "" + }, + { + "name": "业务领域", + "text": "" + } + ], + second: [ + { + "name": "申请类型", + "text": "" + }, + { + "name": "申请开发次数", + "text": "" + }, + { + "name": "申请部署次数", + "text": "" + }, + { + "name":"创建时间", + "text":"" + } + ], + yydetail: '', + xxdetail:'', aqdetail: true, + fxdetail:false, + url:'', }, now_service: 0, header_arr: [ { - prop: "jxmc", + prop: "name", label: "镜像名称", minWidth: "33.33%", align: "center", }, { - prop: "bbh", + prop: "tag", label: "版本号", minWidth: "33.33%", align: "center", @@ -179,63 +256,136 @@ export default { }, ], - list_arr: [ - { - title: "应用简介:", - info: "", - }, - { - title: "功能简介:", - info: "", - }, - { - title: "应用场景:", - info: "", - }, - { - title: "应用参数:", - info: "", - type: "solt", - solt_name: "app_code", - }, - ], + list_arr: '', appcode: "", addImageFlag:false }; }, + computed:{ + ...mapGetters([ + 'level', + ]), + ...mapState(['userInfo']), + }, watch: { }, created() { - this.now_user = this.$store.state.role; - getRole().then((data) => { - this.now_user = data; - this.$store.commit("rolefun", data); - this.getServiceInfo(); - this.getServiceBaseInfo(); - }); + if(this.userInfo){ + this.now_user = this.level + }else{ + this.getCurrentUser() + } + this.asynLoad=false + this.commentsUrl = `/apaas/hubApi/market/comments/${this.$route.params.id}` + this.getServiceInfo(); + this.getServiceBaseInfo(); + this.get_image_list() + this.get_options() + this.get_file_name() }, mounted() {}, methods: { - getNewList(val) { - console.log(val); - this.form.fileList = "" - this.form.fileList = url.map((v,k)=>{ - return v.url - }).join(';') - console.log(this.form.fileList) - }, - getNewList1(val) { - console.log(val); - this.fileList = "" - this.fileList = url.map((v,k)=>{ - return v.url - }).join(';') - console.log(this.fileList) - }, + getCurrentUser() { + this.$api.user.getNowUser().then(({ data }) => { + if (data.success == 1) { + console.log("--- user info ---"); + console.log(data.data); + console.log("--- user info ---"); + this.$store.commit("userInfofun", data.data); + this.now_user = this.level + console.log(this.level); + } else { + console.log(data.errMsg); + } + }); + }, addImage(){ this.addImageFlag = true }, + down_load_zip(){ + const a = document.createElement('a'); // 创建a标签 + a.setAttribute('download', '');// download属性 + a.setAttribute('href', '/apaas/hubApi/market/download/'+this.$route.params.id);// href链接 + a.click();// 自执行点击事件 + }, + get_options(){ + this.$http.get(`/apaas/hubApi/market/comments/${this.$route.params.id}?limit=10&page=1`) + .then((response)=>{ + if(response.data.success==1){ + console.log(response); + var temp = {} + response.data.data.overview.detail_counts.forEach(e => { + temp[e.score]=e.count + }); + this.commentsData={ + avgScore:response.data.data.overview.ave, + scoreStatic:temp, + } + } + }) + }, + submit_form(formName){ + this.$refs[formName].validate((valid) => { + if (valid) { + this.anotherData = { + image_name:this.form.name, + tag:this.form.taps + } + console.log(this.anotherData); + this.$refs['upload'].submit() + } else { + console.log('error submit!!'); + return false; + } + }); + }, + save_zip(){ + this.anotherData1 = { + app_id:this.$route.params.id + } + console.log(this.anotherData1); + this.$refs['upload1'].submit() + }, + upload_success(response, file, fileList){ + if(response.success == 1){ + this.$message.success('上传成功') + this.get_image_list() + }else{ + this.$message.error(response.errMsg) + } + }, + upload_error(){ + this.$message.error('上传失败') + }, + load_data(){ + console.log(2222); + this.asynLoad=false + if(5*this.now_page{ + if(response.data.success==1){ + console.log(response); + this.asynLoad=true + this.image_arr.push(...response.data.data) + this.total = response.data.total + } + }) + }, + get_file_name(){ + this.$http.get(`/apaas/hubApi/market/chartsName/${this.$route.params.id}`) + .then((response)=>{ + if(response.data.success==1){ + console.log(response); + this.oldpag_name = response.data.data + } + }) + }, actiondelete(){ this.tipsOptions= { title:'', @@ -251,11 +401,25 @@ export default { }; this.$refs.myConfirm.showModel(); }, + change_up_state(url,state){ + this.$http.put(`${url}/${this.$route.params.id}/${state}`).then((response)=>{ + if(response.data.success == 1){ + this.$message.success('申请成功') + setTimeout(()=>{ + this.getServiceInfo() + },1000) + }else{ + this.$message.error('申请失败') + } + }).catch((res)=>{ + this.$message.error('申请失败') + }) + }, deploy(){ console.log('0000'); }, editapp(){ - console.log('11111'); + this.$router.push(`${this.$route.path.split('detail')[0]}edit/${this.$route.params.id}`) }, unline(val){ console.log(val); @@ -266,11 +430,23 @@ export default { btnCancelText: "", position: "", } - this.tipsOptions.message="该操作会将该应用从应用商店的平台应用区域下线至开发者应用区域,下线前需向超级管理员发送通知,超级管理员通过后此应用将下线至开发者应用区域。" - this.tipsOptions.btnSubmitText="发送通知" + if(val.xxdetail == '申请下线'){ + this.tipsOptions.message="该操作会将该应用从应用商店的平台应用区域下线至开发者应用区域,下线前需向超级管理员发送通知,超级管理员通过后此应用将下线至开发者应用区域。" + this.tipsOptions.btnSubmitText="发送通知" + } + if(val.xxdetail == '申请上线'){ + this.tipsOptions.message="该操作会将该应用从应用商店开发者应用上线至平台应用" + this.tipsOptions.btnSubmitText="确认" + } this.tipsOptions.position="left" this.tipsOptions.confirmSubmit = () => { console.log("deleteItem - "); + if(val.xxdetail == '申请下线'){ + this.change_up_state('/apaas/hubApi/market/platformStatus',3) + } + if(val.xxdetail == '申请上线'){ + this.change_up_state('/apaas/hubApi/market/platformStatus',1) + } this.$refs.myConfirm.hideModel(); }; this.$refs.myConfirm.showModel(); @@ -284,35 +460,79 @@ export default { btnCancelText: "", position: "", } - this.tipsOptions.message="申请下架应用需要向组织管理员发送通知,组织管理员通过下架请求后该应用将从应用商店下架。" - this.tipsOptions.btnSubmitText="发送通知" + if(val.yydetail == '申请下架'){ + this.tipsOptions.message="申请下架应用需要向组织管理员发送通知,组织管理员通过下架请求后该应用将从应用商店下架。" + this.tipsOptions.btnSubmitText="发送通知" + } + if(val.yydetail == '申请上架'){ + this.tipsOptions.message="申请下架应用需要向组织管理员发送通知,组织管理员通过上架请求后该应用将在应用商店上架。" + this.tipsOptions.btnSubmitText="确认" + } this.tipsOptions.confirmSubmit = () => { console.log("deleteItem - "); + if(val.yydetail == '申请下架'){ + this.change_up_state('/apaas/hubApi/market/deployStatus',3) + } + if(val.yydetail == '申请上架'){ + this.change_up_state('/apaas/hubApi/market/deployStatus',1) + } this.$refs.myConfirm.hideModel(); }; this.$refs.myConfirm.showModel(); }, getServiceInfo() { this.$http - .get("/static/appdetail.json") + .get("/apaas/hubApi/market/baseInfo?id="+this.$route.params.id) .then((response) => { - let data = response.data.data; - this.$set(this.service_header_arr, "name", data.appInfo.name); - this.$set(this.service_header_arr, "first", data.appInfo.first); - this.$set(this.service_header_arr, "second", data.appInfo.second); + if(response.data.success){ + let data = response.data.data; + this.$set(this.service_header_arr, "name", data.app_name+'V'+data.version); + this.$set(this.service_header_arr['first'][0], "text", data.online_state_name); + this.$set(this.service_header_arr['first'][1], "text", data.type_name); + this.$set(this.service_header_arr['first'][2], "text", data.ywly_name); + this.$set(this.service_header_arr['second'][0], "text", data.apply_type_name); + this.$set(this.service_header_arr['second'][1], "text", data.apply_times+'次'); + this.$set(this.service_header_arr['second'][2], "text", data.deploy_times+'次'); + this.$set(this.service_header_arr['second'][3], "text", data.create_date); + this.$set(this.service_header_arr, "yydetail", ''); + this.$set(this.service_header_arr, "xxdetail", ''); + if(data.up_deploy_status==0){ + this.$set(this.service_header_arr, "yydetail", '申请上架'); + }else if(data.up_deploy_status==2){ + this.$set(this.service_header_arr, "yydetail", '申请下架'); + } + if(data.up_platform_status==0){ + this.$set(this.service_header_arr, "xxdetail", '申请上线'); + }else if(data.up_platform_status==2){ + this.$set(this.service_header_arr, "xxdetail", '申请下线'); + } + if(this.now_user == 0){ + this.$set(this.service_header_arr, "fxdetail", true); + } + if(this.now_user == 1){ + this.$set(this.service_header_arr, "xxdetail", ''); + this.$set(this.service_header_arr, "yydetail", ''); + this.$set(this.service_header_arr, "fxdetail", ''); + this.$set(this.service_header_arr, "aqdetail", false); + } + if(this.now_user == 2){ + this.$set(this.service_header_arr, "xxdetail", ''); + this.$set(this.service_header_arr, "yydetail", ''); + this.$set(this.service_header_arr, "aqdetail", true); + } + + this.$set(this.service_header_arr, "url", data.logo); + } }) .catch(function(response) {}); }, getServiceBaseInfo() { this.$http - .get("/static/appdetail.json") + .get("/apaas/hubApi/market/readme/"+this.$route.params.id) .then((response) => { let data = response.data.data; - this.$set(this.list_arr[0], "info", data.appbaseinfo.intorduce); - this.$set(this.list_arr[1], "info", data.appbaseinfo.action); - this.$set(this.list_arr[2], "info", data.appbaseinfo.use); - this.appcode = data.appbaseinfo.appcode; + this.list_arr = data }) .catch(function(response) {}); }, diff --git a/src/pages/workbench/yygl/app_edit.vue b/src/pages/workbench/yygl/app_edit.vue index 4b073f2600a518377d369f7342a67e64f88c471d..98c5fd78f5dbd97c69645f09f2f7353c23b956d6 100644 --- a/src/pages/workbench/yygl/app_edit.vue +++ b/src/pages/workbench/yygl/app_edit.vue @@ -233,7 +233,7 @@ export default { getNewList(val) { console.log(val); this.form.fileList = "" - this.form.fileList = url.map((v,k)=>{ + this.form.fileList = val.map((v,k)=>{ return v.url }).join(';') console.log(this.form.fileList) diff --git a/src/pages/workbench/yygl/deploy_app_detail.vue b/src/pages/workbench/yygl/deploy_app_detail.vue index 804adc68a6cb282af35b428b514006c3ebb005f1..8f7ddf9ffd32db8d5ec64785090d1a11360be096 100644 --- a/src/pages/workbench/yygl/deploy_app_detail.vue +++ b/src/pages/workbench/yygl/deploy_app_detail.vue @@ -564,7 +564,7 @@ export default { getNewList(val) { console.log(val); this.form.fileList = ""; - this.form.fileList = url + this.form.fileList = val .map((v, k) => { return v.url; }) @@ -574,7 +574,7 @@ export default { getNewList1(val) { console.log(val); this.fileList = ""; - this.fileList = url + this.fileList = val .map((v, k) => { return v.url; })