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

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

parents 8fc4f2c3 5391b149
......@@ -184,7 +184,7 @@ export default {
this.hideDialog();
} else {
this.$message({
message: "分配失败",
message: data.errMsg || "分配失败",
type: "warning",
});
}
......
......@@ -2,11 +2,11 @@
<ul class="comments_list apaas_scroll">
<li class="comment_card" v-for="(item, index) in data" :key="'comment_' + index">
<div class="comment-left">
<el-avatar :size="45" fit="cover" :src="item.message" />
<el-avatar :size="45" fit="cover" :src="item.picture_path" />
</div>
<div class="comment-right">
<p class="comment-base">
<span class="comment-user_name text_clip" v-text="item.message"></span>
<span class="comment-user_name text_clip" v-text="item.user_name"></span>
<span class="comment-time text_clip" v-text="getTimeText(item.add_time || '')"></span>
</p>
<div class="commnet-rate">
......
......@@ -25,6 +25,8 @@ export default {
methods: {
graph() {
let self = this;
console.log(this.data.legend.data);
console.log(this.data.data);
return {
color: ["#274fee", "#ef9433"],
legend: {
......@@ -33,7 +35,7 @@ export default {
icon: "roundRect",
itemWidth: 10,
itemHeight: 10,
data: self.data.legend.data,
data: self.data.legend.data||[],
orient: "horizontal",
backgroundColor: "#f4f7fc"
},
......@@ -47,7 +49,7 @@ export default {
xAxis: [
{
type: "category",
data: self.data.data,
data: self.data.data||[],
axisLine: {
lineStyle: {
color: "#f2f2f2"
......@@ -91,9 +93,9 @@ export default {
],
series: [
{
name: self.data.series[0].name,
name: self.data.series[0].name||'',
type: "line",
data: self.data.series[0].data,
data: self.data.series[0].data||[],
symbolSize: 1,
symbol: "circle",
smooth: true,
......@@ -108,9 +110,9 @@ export default {
}
},
{
name: self.data.series[1].name,
name: self.data.series[1].name||'',
type: "line",
data: self.data.series[1].data,
data: self.data.series[1].data||[],
symbolSize: 1,
symbol: "circle",
smooth: true,
......
......@@ -69,7 +69,6 @@ export default {
};
var series = [];
yarr.forEach((e, idx) => {
series.push({
name: e.name,
......
......@@ -40,6 +40,7 @@ export default {
methods: {
init_health(num, color, text) {
var options = {
color:[color,'#c9cedd'],
title: {
text: num + "%",
textStyle: {
......@@ -96,47 +97,78 @@ export default {
},
series: [
{
type: "bar",
silent: true,
data: [
{
name: "作文得分",
value: num,
itemStyle: {
type: 'pie',
z:5,
center:['50%','50%'],
radius:['68%','72%'],
silent:true,
label: {
normal: {
color: color,
shadowColor: "rgba(0, 0, 0, 0.2)",
shadowBlur: 20
}
show: false
},
emphasis: {
show: false
}
},
labelLine: {
normal: {
show: false
},
emphasis: {
show: false
}
],
coordinateSystem: "polar",
roundCap: true,
barWidth: 8,
barGap: "-100%", // 两环重叠
z: 2
},
tooltip: {
show: false
},
data:[{
name:'',
value:num
},{
name:'',
value:100 - num
}]
},
{
// 灰色环
type: "bar",
silent: true,
data: [
{
value: 100,
type:'pie',
z:4,
center:['50%','50%'],
radius:['60%','80%'],
hoverAnimation:false,
avoidLabelOverlap: false,
label: {
normal: {
show: false
},
emphasis: {
show: false
}
},
labelLine: {
normal: {
show: false
},
emphasis: {
show: false
}
},
tooltip: {
show: false
},
itemStyle: {
color: "#c9cedd",
shadowColor: "rgba(0, 0, 0, 0.2)",
shadowBlur: 20
normal: {
color:'#f6f7fc'
}
},
emphasis:{
show:false,
itemStyle:{
color:'#f6f7fc'
}
],
coordinateSystem: "polar",
roundCap: true,
barWidth: 8,
barGap: "-100%", // 两环重叠
z: 1
},
data: [{
value: 1,
}],
}
]
};
......
......@@ -102,6 +102,9 @@ export default {
case 21:
this.$router.push(`/shop/zhfwDetail/${id}`);
break;
case 124:
this.$router.push(`/yygl/0/0/detail/${id.id}?source=${id.source}`);
break;
default:
this.$message({
message: "查看详情失败",
......
......@@ -222,7 +222,7 @@
:max="10"
placeholder="请选择内存最高使用量"
></el-input-number>
<div class="input_right"></div>
<div class="input_right">GB</div>
</el-form-item>
</el-col>
<el-col :span="11">
......@@ -238,7 +238,7 @@
:max="10"
placeholder="请选择内存默认使用量"
></el-input-number>
<div class="input_right"></div>
<div class="input_right">GB</div>
</el-form-item>
</el-col>
<el-col :span="24">
......@@ -918,6 +918,14 @@ import InfoList from "@/components/infoList";
import ApassDialog from "@/components/apass-dialog";
import helper from "@/services/helper.js";
var checkName = (rule, value, callback) => {
if (new RegExp("^[a-z0-9]([0-9]||[a-z]||-)*$").test(value)) {
callback();
} else {
callback(new Error("小写字母或数字开头,可以由小写字母、数字、- 组成"));
}
};
export default {
components: {
BlockRadius,
......@@ -959,12 +967,16 @@ export default {
ruleNew: {
namespace: [
{ required: true, message: "请输入工作区域名称", trigger: "blur" },
{ max: 16, message: "长度应小于16个字符", trigger: "blur" },
{ validator: checkName, trigger: "blur" },
],
workplace: [
{ required: true, message: "请输入中文名称", trigger: "blur" },
{ max: 16, message: "长度应小于16个字符", trigger: "blur" },
],
workplacedesc: [
{ required: true, message: "请输入描述信息", trigger: "blur" },
{ max: 100, message: "长度应小于100个字符", trigger: "blur" },
],
cpu: [{ required: true, message: "请选择CPU使用量", trigger: "blur" }],
memory: [
......@@ -1022,7 +1034,7 @@ export default {
docTemplate: [
{
title: "",
info: "工作区域申请文件标准模板.PDF",
info: "工作区域申请文件标准模板.xlsx",
url: "static/工作区域申请文件模板.xlsx",
type: "down",
},
......@@ -1185,8 +1197,40 @@ export default {
});
}
},
checkNamespace(namespace, cb) {
this.$http
.get("/apaas/service/v3/resource/apply/checkNs", {
params: { namespace },
})
.then(({ data }) => {
if (data.success === 1) {
if (data.data === 1) {
typeof cb === "function" && cb();
} else if (data.data === -1) {
this.$message({
message: `命名空间名称已存在`,
type: "error",
});
} else if (data.data === -1) {
this.$message({
message: `命名空间名称验证失败`,
type: "error",
});
}
}
})
.catch((error) => {
console.log(error);
this.$message({
message: `命名空间名称验证失败`,
type: "error",
});
});
},
determineSubmit() {
if (this.activeName == 0) {
this.checkNamespace(this.formNew.namespace, () => {
let query = {
resource_info: {
namespace: this.formNew.namespace,
......@@ -1231,6 +1275,7 @@ export default {
});
}
});
});
} else {
let query = {
resource_id: this.workSpaceId,
......
......@@ -57,7 +57,7 @@
@changeButton="changeServiceCellBtn"
class="block"
>
<Graph :data="graph_arr" />
<Graph v-if="JSON.stringify(graph_arr)!=='{}'" :data="graph_arr" />
</block-radius>
</el-col>
<el-col :span="24" class="in_block">
......@@ -155,7 +155,7 @@
:buttons_arr="['近14天', '近30天']"
@changeButton="changeAppTotalChangeBtn"
>
<line-chart class="block-radius-content" :data="line_data"></line-chart>
<line-chart v-if="JSON.stringify(line_data)!=='{}'" class="block-radius-content" :data="line_data"></line-chart>
</block-radius>
</el-col>
</el-row>
......@@ -261,6 +261,7 @@ export default {
now_app_used_area:1,
now_app_count:14,
now_app_deploy:1,
now_app_evalute:1,
mult_data: [],
text: "应用总数",
spIndicatorStyles1: false,
......@@ -288,12 +289,12 @@ export default {
up:-19.3
},
single_data: {
num: 60,
num: 0,
color: "#274fee",
text: "平台应用"
},
single_data1: {
num: 40,
num: 0,
color: "#e56600",
text: "开发者应用"
},
......@@ -304,103 +305,11 @@ export default {
toplistData: [], // 应用部署排名分析
toplistTargetValue: 150, // 应用部署排名分析 目标值
appInfoBtnIndex: 0,
commentlistData: [
{
add_time: "2020-07-14T16:35:40Z",
content: "1111111111111111",
id: 36,
picture_path:
"/apaas/static/docs/image/image/blob_cb30e7a3-3184-42dd-9e2f-7e6b69accb0c.blob",
score: 5,
service_id: 128,
user_name: "普通用户lxy"
},
{
add_time: "2020-07-14T16:35:40Z",
content: "1111111111111111",
id: 36,
picture_path:
"/apaas/static/docs/image/image/blob_cb30e7a3-3184-42dd-9e2f-7e6b69accb0c.blob",
score: 4,
service_id: 128,
user_name: "普通用户lxy"
},
{
add_time: "2020-07-14T16:35:40Z",
content: "1111111111111111",
id: 36,
picture_path:
"/apaas/static/docs/image/image/blob_cb30e7a3-3184-42dd-9e2f-7e6b69accb0c.blob",
score: 3,
service_id: 128,
user_name: "普通用户lxy"
},
{
add_time: "2020-07-14T16:35:40Z",
content: "1111111111111111",
id: 36,
picture_path:
"/apaas/static/docs/image/image/blob_cb30e7a3-3184-42dd-9e2f-7e6b69accb0c.blob",
score: 2,
service_id: 128,
user_name: "普通用户lxy"
}
], // 应用评价
starlistData: [
{
star: 5,
count: 5,
unit: ""
},
{
star: 4,
count: 4,
unit: ""
},
{
star: 3,
count: 3,
unit: ""
},
{
star: 2,
count: 2,
unit: ""
},
{
star: 1,
count: 1,
unit: ""
}
], // 应用评分
starlistTotal: 15,
commentlistData: [], // 应用评价
starlistData: [], // 应用评分
starlistTotal: 10,
hotSearchHeader: [], // 热门搜索 表头
hotSearchData: [
{
hotIndex: 1,
name: "mapvideos",
count: 29,
increases: 0.28
},
{
hotIndex: 2,
name: "语音识别",
count: 27,
increases: 0.24
},
{
hotIndex: 3,
name: "轨迹绘制",
count: 15,
increases: 0.12
},
{
hotIndex: 4,
name: "postgresql",
count: 12,
increases: -0.05
},
] // 热门搜索 数据
hotSearchData: [] // 热门搜索 数据
}),
mounted() {
this.getAppOverview()
......@@ -410,6 +319,9 @@ export default {
this.getAppUsedArea()
this.getAppCount()
this.getAppDeployRank()
this.getAppEvaluate()
this.getAppOnlineState()
this.getAppHot()
this.hotSearchHeader = [
{
label: "排名",
......@@ -514,8 +426,10 @@ export default {
service_name: e.name,
request_count: e.num,
cover:e.logo,
service_id:e.id,
data_service_type:e.type,
service_id:{
id:e.app_id,
source:e.source
},
data_service_type1:124
})
});
......@@ -523,8 +437,92 @@ export default {
}
})
},
getAppEvaluate(){
this.$api.dataAnalysis.getAppEvaluate({type:this.now_app_evalute}).then(response => {
if (response.data.success == 1) {
let data = response.data.data
if(this.now_app_evalute==1){
this.commentlistData = []
if(data&&data.length){
data.forEach(e => {
this.commentlistData.push({
add_time: e.add_time,
message: e.content,
picture_path: e.picture_path,
score: e.score,
user_name: e.picture_path,
})
});
}
}else{
this.starlistTotal = 10
this.starlistData = []
var temp = []
if(data&&data.length){
data.forEach(e => {
temp.push(e.num)
this.starlistData.push({
star: e.name,
count: e.num,
})
});
this.starlistTotal = Math.max(...temp)
}
}
}
})
},
getAppOnlineState(){
this.$api.dataAnalysis.getAppOnlineState().then(response =>{
if (response.data.success == 1) {
let data = response.data.data
this.single_data = {
num: data.platform,
color: "#274fee",
text: "平台应用"
}
this.single_data1= {
num: data.develop,
color: "#e56600",
text: "开发者应用"
}
}
})
},
getAppHot(){
this.$api.dataAnalysis.getAppHot().then(response =>{
if (response.data.success == 1) {
let data = response.data.data
let user = data.user||{}
let ave_search = data.ave_search||{}
let search_app = data.search_app||[]
this.sparkline1={
arr:user.line_chart?user.line_chart.series[0].data:[],
num:user.today_num?user.today_num:0,
up:user.ratio?parseFloat(user.ratio):0
}
this.sparkline2={
arr:ave_search.line_chart?ave_search.line_chart.series[0].data:[],
num:ave_search.today_num?ave_search.today_num:0,
up:ave_search.ratio?parseFloat(ave_search.ratio):0
}
this.hotSearchData = []
search_app.forEach((e,idx) => {
this.hotSearchData.push({
id:e.app_id,
source:e.source,
hotIndex:idx + 1,
name: e.name,
count: e.num,
increases: parseFloat(e.ratio)
})
});
}
})
},
detailHotSearch(item) {
console.log("查看热搜详情");
this.$router.push(`/yygl/0/0/detail/${item.id}?source=${item.source}`)
},
hotSearchSortChange(sortInfo) {
console.log("应用热门搜索: " + sortInfo);
......@@ -563,7 +561,8 @@ export default {
},
changeAppInfoBtn(index) {
this.appInfoBtnIndex = index;
this.now_app_evalute = index+1
this.getAppEvaluate()
console.log("应用评价及评分: " + index);
},
changeAppTotalChangeBtn(index) {
......
......@@ -97,9 +97,7 @@
</p>
<div class="full_content">
<div class="apaas_scroll">
<p class="item_content">
{{ templateDetail.contents }}
</p>
<p class="item_content" v-html="templateDetail.contents"></p>
</div>
</div>
</div>
......
......@@ -96,9 +96,7 @@
</p>
<div class="full_content">
<div class="apaas_scroll">
<p class="item_content">
{{ templateDetail.contents }}
</p>
<p class="item_content" v-html="templateDetail.contents"></p>
</div>
</div>
</div>
......@@ -278,7 +276,7 @@ export default {
},
detailAction(item) {
this.$http
.get(`//apaas/service/v3/push/alertmsg/view/${item.id}`)
.get(`/apaas/service/v3/push/alertmsg/view/${item.id}`)
.then(({ data }) => {
if (data.success == 1) {
let detail = data.data || {};
......@@ -327,4 +325,40 @@ export default {
.list_container {
height: 100%;
}
.detail_dialog {
display: flex;
flex-wrap: wrap;
text-align: left;
}
.detail_dialog .detail_item {
flex: 1 1 auto;
width: 50%;
margin-top: 20px;
}
.detail_dialog .detail_item.full_line {
width: 100%;
}
.detail_dialog .detail_item p {
padding: 0 15px;
font-size: 14px;
line-height: 22px;
color: #8890a7;
}
.detail_dialog .detail_item .item_content {
color: #000;
margin-top: 10px;
}
.detail_dialog .detail_item .full_content {
padding: 10px 0;
border-radius: 8px;
background-color: #f8f9fd;
margin-top: 5px;
}
.detail_dialog .detail_item .full_content > .apaas_scroll {
height: 176px;
overflow: auto;
}
.detail_dialog .detail_item .full_content .item_content {
margin: 0;
}
</style>
......@@ -443,11 +443,25 @@ export default {
align: "center",
type: "image-tooltip",
getImage(item) {
if (
(item.apply_type === 0 && item.approve_state === -1) ||
(item.apply_type === 1 && item.approve_update_state === -1)
) {
return require("@/assets/imgs/ic_cancel.png");
}
return item.state == 1
? require("@/assets/imgs/ic_true.png")
: require("@/assets/imgs/ic_failed.png");
},
getTooltip(item) {
if (
(item.apply_type === 0 && item.approve_state === -1) ||
(item.apply_type === 1 && item.approve_update_state === -1)
) {
return "审批未通过";
}
return item.state == 1 ? "运行中" : "该工作区域已被禁用";
},
},
......@@ -522,6 +536,12 @@ export default {
return item.state == 1 ? "禁用" : "启用";
},
callback: this.stateAction,
disabledRule(item) {
return (
(item.apply_type === 0 && item.approve_state === -1) ||
(item.apply_type === 1 && item.approve_update_state === -1)
);
},
},
{
label: "移除",
......
......@@ -60,6 +60,15 @@ const dataAnalysis = {
getAppDeployRank(params){
return axios.get(`/apaas/hubApi/analysis/deployRank?style=${params.type}`);
},
getAppEvaluate(params){
return axios.get(`/apaas/hubApi/analysis/commentScores?style=${params.type}`);
},
getAppOnlineState(){
return axios.get(`/apaas/hubApi/analysis/onlineAreas`);
},
getAppHot(){
return axios.get(`/apaas/hubApi/analysis/appSearch`);
},
}
export default dataAnalysis;
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