fix(项目报告(X-PACK)): 修复项目报告进入时403权限挡住的问题

修复项目报告进入时403权限挡住的问题
This commit is contained in:
song-tianyang 2021-11-22 18:48:58 +08:00 committed by song-tianyang
parent dc13c1c698
commit bbeb86976e
4 changed files with 161 additions and 156 deletions

@ -1 +1 @@
Subproject commit 563795dead1d056385eafd68e68e307dbf4e82e8 Subproject commit 4cbe39abad949c27aee0bf222da0d175550f2bcf

View File

@ -1,184 +1,189 @@
<template> <template>
<div <div
class="el-input-tag input-tag-wrapper" class="el-input-tag input-tag-wrapper"
:class="[size ? 'el-input-tag--' + size : '']" :class="[size ? 'el-input-tag--' + size : '']"
style="height: auto" style="height: auto"
@click="foucusTagInput"> @click="foucusTagInput">
<el-tag <el-tag
class="ms-top" class="ms-top"
v-for="(tag, idx) in innerTags" v-for="(tag, idx) in innerTags"
v-bind="$attrs" v-bind="$attrs"
type="info" type="info"
:key="tag" :key="tag"
:size="size" :size="size"
:closable="!readOnly" :closable="!readOnly"
:disable-transitions="false" :disable-transitions="false"
@close="remove(idx)"> @close="remove(idx)">
{{tag && tag.length>10? tag.substring(0,10)+"...":tag}} {{ tag && tag.length > 10 ? tag.substring(0, 10) + "..." : tag }}
</el-tag> </el-tag>
<input <input
:disabled="readOnly" :disabled="readOnly"
class="tag-input el-input" class="tag-input el-input"
v-model="newTag" v-model="newTag"
:placeholder=defaultPlaceHolder :placeholder=defaultPlaceHolder
@keydown.delete.stop="removeLastTag" @keydown.delete.stop="removeLastTag"
@keydown="addNew" @keydown="addNew"
@blur="addNew"/> @blur="addNew"/>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: 'MsInputTag', name: 'MsInputTag',
props: { props: {
currentScenario: {}, currentScenario: {},
placeholder: { placeholder: {
type: String, type: String,
}, },
addTagOnKeys: { errorInfor: String,
type: Array, addTagOnKeys: {
default: () => [13, 188, 9] type: Array,
}, default: () => [13, 188, 9]
readOnly: { },
type: Boolean, readOnly: {
default: false type: Boolean,
}, default: false
size: {type: String, default: "small"}, },
prop: { size: {type: String, default: "small"},
type: String, prop: {
default: "tags" type: String,
default: "tags"
}
},
created() {
if (!this.currentScenario[this.prop]) {
this.currentScenario[this.prop] = [];
}
if (this.placeholder) {
this.defaultPlaceHolder = this.placeholder;
}
},
data() {
return {
defaultPlaceHolder: this.$t('commons.tag_tip'),
newTag: '',
innerTags: this.currentScenario[this.prop] ? [...this.currentScenario[this.prop]] : []
}
},
watch: {
innerTags() {
this.currentScenario[this.prop] = this.innerTags;
}
},
methods: {
foucusTagInput() {
if (this.readOnly || !this.$el.querySelector('.tag-input')) {
console.log()
} else {
this.$el.querySelector('.tag-input').focus()
} }
}, },
created() { addNew(e) {
if (!this.currentScenario[this.prop]) { if (e && (!this.addTagOnKeys.includes(e.keyCode)) && (e.type !== 'blur')) {
this.currentScenario[this.prop] = []; return
} }
if(this.placeholder){ if (e) {
this.defaultPlaceHolder = this.placeholder; e.stopPropagation()
e.preventDefault()
} }
}, let addSuucess = false
data() { if (this.newTag.includes(',')) {
return { this.newTag.split(',').forEach(item => {
defaultPlaceHolder: this.$t('commons.tag_tip'), if (this.addTag(item.trim())) {
newTag: '',
innerTags: this.currentScenario[this.prop] ? [...this.currentScenario[this.prop]] : []
}
},
watch: {
innerTags() {
this.currentScenario[this.prop] = this.innerTags;
}
},
methods: {
foucusTagInput() {
if (this.readOnly || !this.$el.querySelector('.tag-input')) {
console.log()
} else {
this.$el.querySelector('.tag-input').focus()
}
},
addNew(e) {
if (e && (!this.addTagOnKeys.includes(e.keyCode)) && (e.type !== 'blur')) {
return
}
if (e) {
e.stopPropagation()
e.preventDefault()
}
let addSuucess = false
if (this.newTag.includes(',')) {
this.newTag.split(',').forEach(item => {
if (this.addTag(item.trim())) {
addSuucess = true
}
})
} else {
if (this.addTag(this.newTag.trim())) {
addSuucess = true addSuucess = true
} }
})
} else {
if (this.addTag(this.newTag.trim())) {
addSuucess = true
} }
if (addSuucess) {
this.tagChange()
this.newTag = ''
}
},
addTag(tag) {
tag = tag.trim()
if (tag && !this.innerTags.includes(tag)) {
this.innerTags.push(tag)
return true
}
return false
},
remove(index) {
this.innerTags.splice(index, 1)
this.tagChange()
},
removeLastTag() {
if (this.newTag) {
return
}
this.innerTags.pop()
this.tagChange()
},
tagChange() {
this.$emit('input', this.innerTags)
} }
if (addSuucess) {
this.tagChange()
this.newTag = ''
}
},
addTag(tag) {
tag = tag.trim()
if (tag && !this.innerTags.includes(tag)) {
this.innerTags.push(tag)
return true
} else {
if (tag !== "" && this.errorInfor) {
this.$error(this.errorInfor);
}
}
return false
},
remove(index) {
this.innerTags.splice(index, 1)
this.tagChange()
},
removeLastTag() {
if (this.newTag) {
return
}
this.innerTags.pop()
this.tagChange()
},
tagChange() {
this.$emit('input', this.innerTags)
} }
} }
}
</script> </script>
<style scoped> <style scoped>
.input-tag-wrapper { .input-tag-wrapper {
position: relative; position: relative;
font-size: 14px; font-size: 14px;
background-color: #fff; background-color: #fff;
background-image: none; background-image: none;
border-radius: 4px; border-radius: 4px;
border: 1px solid #dcdfe6; border: 1px solid #dcdfe6;
box-sizing: border-box; box-sizing: border-box;
color: #606266; color: #606266;
display: inline-block; display: inline-block;
outline: none; outline: none;
padding: 0 10px 0 5px; padding: 0 10px 0 5px;
transition: border-color .2s cubic-bezier(.645, .045, .355, 1); transition: border-color .2s cubic-bezier(.645, .045, .355, 1);
width: 100%; width: 100%;
} }
.el-tag { .el-tag {
margin-right: 4px; margin-right: 4px;
} }
.tag-input { .tag-input {
background: transparent; background: transparent;
border: 0; border: 0;
color: #303133; color: #303133;
font-size: 12px; font-size: 12px;
font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", Arial, sans-serif; font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
outline: none; outline: none;
padding-left: 0; padding-left: 0;
width: 100px; width: 100px;
} }
.el-input-tag { .el-input-tag {
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
} }
.el-input-tag--mini { .el-input-tag--mini {
height: 28px; height: 28px;
line-height: 28px; line-height: 28px;
font-size: 12px; font-size: 12px;
} }
.el-input-tag--small { .el-input-tag--small {
line-height: 30px; line-height: 30px;
} }
.el-input-tag--medium { .el-input-tag--medium {
height: 36px; height: 36px;
line-height: 36px; line-height: 36px;
} }
</style> </style>

View File

@ -3,7 +3,7 @@
<el-row> <el-row>
<el-col :span="4"> <el-col :span="4">
<el-card :body-style="{ padding: '0px' }" class="ms-col" @click.native="openCard('trackTestCase')"> <el-card :body-style="{ padding: '0px' }" class="ms-col" @click.native="openCard('trackTestCase')">
<img style="height: 214px" src="@/assets/test_case_analysis_png.png" class="image"> <img src="@/assets/test_case_analysis_png.png" class="image">
<div style="padding: 10px;"> <div style="padding: 10px;">
<span>{{ $t('commons.report_statistics.test_case_analysis') }}</span> <span>{{ $t('commons.report_statistics.test_case_analysis') }}</span>
<div class="bottom clearfix"> <div class="bottom clearfix">

@ -1 +1 @@
Subproject commit 3da00ab5e55cf0dffc26e6230fbd9db4bde1e47e Subproject commit 282f415db9d2b20b03a68a1fa3956fe9c2b0fe87