Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
566cbc634b
|
@ -5,7 +5,7 @@
|
|||
text-color="#fff">
|
||||
<el-submenu index="1" popper-class="submenu"
|
||||
v-permission="['org_admin', 'test_manager', 'test_user', 'test_viewer']">
|
||||
<template v-slot:title>【{{$t('commons.organization')}}】{{currentOrganizationName}}</template>
|
||||
<template v-slot:title>{{$t('commons.organization')}}: {{currentOrganizationName}}</template>
|
||||
<label v-for="(item,index) in organizationList" :key="index">
|
||||
<el-menu-item @click="changeOrg(item)">{{item.name}}
|
||||
<i class="el-icon-check"
|
||||
|
@ -14,7 +14,7 @@
|
|||
</label>
|
||||
</el-submenu>
|
||||
<el-submenu index="2" popper-class="submenu" v-permission="['test_manager', 'test_user', 'test_viewer']">
|
||||
<template v-slot:title>【{{$t('commons.workspace')}}】{{currentWorkspaceName}}</template>
|
||||
<template v-slot:title>{{$t('commons.workspace')}}: {{currentWorkspaceName}}</template>
|
||||
<label v-for="(item,index) in workspaceList" :key="index">
|
||||
<el-menu-item @click="changeWs(item)">
|
||||
{{item.name}}
|
||||
|
@ -52,8 +52,8 @@
|
|||
currentUserInfo: {},
|
||||
currentUserId: getCurrentUser().id,
|
||||
workspaceIds: [],
|
||||
currentOrganizationName: this.$t('organization.select'),
|
||||
currentWorkspaceName: this.$t('workspace.select')
|
||||
currentOrganizationName: '',
|
||||
currentWorkspaceName: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
|
|
@ -10,21 +10,15 @@
|
|||
<font-awesome-icon class="icon global" :icon="['fas', 'globe']"/>
|
||||
<span>{{language}}</span>
|
||||
</template>
|
||||
<el-menu-item @click="changeLanguage('zh_CN')">
|
||||
简体中文<i class="el-icon-check" v-if="currentUserInfo.language==='zh_CN' || !currentUserInfo.language"/>
|
||||
</el-menu-item>
|
||||
<el-menu-item @click="changeLanguage('zh_TW')">
|
||||
繁體中文<i class="el-icon-check" v-if="currentUserInfo.language==='zh_TW'"/>
|
||||
</el-menu-item>
|
||||
<el-menu-item @click="changeLanguage('en_US')">
|
||||
English<i class="el-icon-check" v-if="currentUserInfo.language==='en_US'"/>
|
||||
<el-menu-item v-for="(value, key) in languageMap" :key="key" @click="changeLanguage(key)">
|
||||
{{value}} <i class="el-icon-check" v-if="language === value"/>
|
||||
</el-menu-item>
|
||||
</el-submenu>
|
||||
</el-menu>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {TokenKey, ZH_CN, ZH_TW, EN_US} from '../../../../common/js/constants';
|
||||
import {EN_US, TokenKey, ZH_CN, ZH_TW} from '../../../../common/js/constants';
|
||||
import {getCurrentUser} from "../../../../common/js/utils";
|
||||
|
||||
export default {
|
||||
|
@ -32,7 +26,12 @@
|
|||
data() {
|
||||
return {
|
||||
currentUserInfo: {},
|
||||
language: ''
|
||||
language: '',
|
||||
languageMap: {
|
||||
[ZH_CN]: '简体中文',
|
||||
[EN_US]: 'English',
|
||||
[ZH_TW]: '繁體中文',
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
@ -41,23 +40,26 @@
|
|||
if (!lang) {
|
||||
lang = 'zh_CN';
|
||||
}
|
||||
this.$setLang(lang);
|
||||
switch (lang) {
|
||||
case ZH_CN:
|
||||
this.language = '简体中文';
|
||||
break;
|
||||
case ZH_TW:
|
||||
this.language = '繁體中文';
|
||||
break;
|
||||
case EN_US:
|
||||
this.language = 'English';
|
||||
break;
|
||||
default:
|
||||
this.language = '简体中文';
|
||||
break;
|
||||
}
|
||||
this.checkLanguage(lang)
|
||||
},
|
||||
methods: {
|
||||
checkLanguage(lang) {
|
||||
this.$setLang(lang);
|
||||
switch (lang) {
|
||||
case ZH_CN:
|
||||
this.language = '简体中文';
|
||||
break;
|
||||
case ZH_TW:
|
||||
this.language = '繁體中文';
|
||||
break;
|
||||
case EN_US:
|
||||
this.language = 'English';
|
||||
break;
|
||||
default:
|
||||
this.language = '简体中文';
|
||||
break;
|
||||
}
|
||||
},
|
||||
currentUser: () => {
|
||||
return getCurrentUser();
|
||||
},
|
||||
|
@ -66,9 +68,9 @@
|
|||
id: this.currentUser().id,
|
||||
language: language
|
||||
};
|
||||
this.checkLanguage(language);
|
||||
this.result = this.$post("/user/update/current", user, response => {
|
||||
localStorage.setItem(TokenKey, JSON.stringify(response.data));
|
||||
window.location.reload();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,11 +3,13 @@
|
|||
<common-component>
|
||||
|
||||
<template v-slot:header>
|
||||
<el-input v-model="preview.title"></el-input>
|
||||
<el-input v-if="!isReportView" v-model="preview.title"></el-input>
|
||||
<span v-if="isReportView" class="title">{{preview.title}}</span>
|
||||
</template>
|
||||
|
||||
<template>
|
||||
<ckeditor :editor="editor" v-model="preview.content" :config="editorConfig"></ckeditor>
|
||||
<ckeditor v-if="!isReportView" :editor="editor" v-model="preview.content" :config="editorConfig"></ckeditor>
|
||||
<div v-if="isReportView" v-html="preview.content"></div>
|
||||
</template>
|
||||
|
||||
</common-component>
|
||||
|
@ -31,12 +33,19 @@
|
|||
}
|
||||
},
|
||||
props: {
|
||||
preview: Object,
|
||||
default() {
|
||||
return {
|
||||
title: '',
|
||||
content: '<p>Content of the editor.</p>'
|
||||
preview: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {
|
||||
title: '',
|
||||
content: '<p>Content of the editor.</p>'
|
||||
}
|
||||
}
|
||||
},
|
||||
isReportView:
|
||||
{
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<base-info-component :report-info="metric" v-if="preview.id == 1"/>
|
||||
<test-result-component :test-results="metric.moduleExecuteResult" v-if="preview.id == 2"/>
|
||||
<test-result-chart-component :execute-result="metric.executeResult" v-if="preview.id == 3"/>
|
||||
<rich-text-component :preview="preview" v-if="preview.type != 'system'"/>
|
||||
<rich-text-component :is-report-view="isReportView" :preview="preview" v-if="preview.type != 'system'"/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
@ -38,7 +38,11 @@
|
|||
isReport: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
isReportView: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
group="component">
|
||||
<transition-group>
|
||||
<div class="preview" v-for="item in previews" :key="item.id">
|
||||
<template-component :is-report="isReport" :metric="metric" :preview="item"/>
|
||||
<template-component :is-report-view="false" :is-report="isReport" :metric="metric" :preview="item"/>
|
||||
<i class="el-icon-error" @click="handleDelete(item)"/>
|
||||
</div>
|
||||
</transition-group>
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
<div class="container">
|
||||
<el-main>
|
||||
<div class="preview" v-for="item in previews" :key="item.id">
|
||||
<template-component :metric="metric" :preview="item"/>
|
||||
<template-component :isReportView="true" :metric="metric" :preview="item"/>
|
||||
</div>
|
||||
</el-main>
|
||||
</div>
|
||||
|
|
|
@ -40,8 +40,8 @@ export default {
|
|||
'personal_setting': 'Personal Setting',
|
||||
'test_resource_pool': 'Resource Pool',
|
||||
'system_setting': 'Settings',
|
||||
'api': 'Api test',
|
||||
'performance': 'Performance test',
|
||||
'api': 'Api',
|
||||
'performance': 'Performance',
|
||||
'functional': 'Functional test',
|
||||
'input_content': 'Please enter content',
|
||||
'create': 'Create',
|
||||
|
|
Loading…
Reference in New Issue