Skip to content

Commit b467c86

Browse files
committed
fix: fix css style
Signed-off-by: yuluo-yx <[email protected]>
1 parent bc3cbda commit b467c86

File tree

10 files changed

+192
-154
lines changed

10 files changed

+192
-154
lines changed

console/atest-ui/src/api/store/store.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ export const GetStores = () =>
3232
'X-Auth': getToken()
3333
})
3434

35-
export const DeleteStore = (params: string) =>
35+
export const DeleteStore = (params: any) =>
3636
post('/server.Runner/DeleteStore', params, {
3737
'X-Auth': getToken()
3838
})
3939

40-
export const VerifyStore = (params: string) =>
40+
export const VerifyStore = (params: any) =>
4141
post('/server.Runner/VerifyStore', params, {
4242
'X-Auth': getToken()
4343
})

console/atest-ui/src/components/HeaderComponent.vue

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<template>
22
<div class="container">
3-
<div class="logo_container">
4-
<a href="#">
5-
<img src="../assets/logo/logo.png" alt="logo">
6-
&nbsp;&nbsp;
7-
<p>API Testing</p>
8-
</a>
9-
</div>
3+
<div class="logo_container">
4+
<a href="#">
5+
<img class="logo_container_img" src="../assets/logo/logo.png" alt="logo" />
6+
&nbsp;&nbsp;
7+
<p class="pro_name">API Testing</p>
8+
</a>
9+
</div>
1010
<div>
1111
<ui>
1212
<li>
@@ -18,8 +18,9 @@
1818
</a>
1919
</li>
2020
<li>
21-
<a href="https://github.com/linuxsuren/api-testing.git" target="_blank"><img class="github"
22-
src="../assets/github/github-mark.png" alt="github" /></a>
21+
<a href="https://github.com/linuxsuren/api-testing.git" target="_blank"
22+
><img class="github" src="../assets/github/github-mark.png" alt="github"
23+
/></a>
2324
</li>
2425
<!-- todo:主题样式显示有误。 -->
2526
<!-- <li>
@@ -42,7 +43,7 @@
4243
import { ref } from 'vue'
4344
// import { Sunny, Moon } from '@element-plus/icons-vue'
4445
import { setAsDarkTheme } from '../theme/theme'
45-
import LanguageSwitch from "@/components/LanguageSwitch.vue";
46+
import LanguageSwitch from '@/components/LanguageSwitch.vue'
4647
4748
const darkOpt = ref(false)
4849
@@ -60,22 +61,22 @@ const setTheme = () => {
6061
justify-content: space-between;
6162
flex-direction: row;
6263
align-items: center;
64+
}
6365
64-
.logo_container {
65-
display: flex;
66-
align-items: center;
66+
.logo_container {
67+
display: flex;
68+
align-items: center;
69+
}
6770
68-
p {
69-
display: inline-block;
70-
vertical-align: middle;
71-
}
71+
.logo_container_img {
72+
width: 100px;
73+
height: 50px;
74+
vertical-align: middle;
75+
}
7276
73-
img {
74-
width: 100px;
75-
height: 50px;
76-
vertical-align: middle;
77-
}
78-
}
77+
.pro_name {
78+
display: inline-block;
79+
vertical-align: middle;
7980
}
8081
8182
p,
@@ -87,13 +88,13 @@ a {
8788
ui {
8889
display: flex;
8990
list-style: none;
91+
}
9092
91-
li {
92-
display: flex;
93-
padding-right: 1em;
94-
vertical-align: middle;
95-
align-items: center;
96-
}
93+
li {
94+
display: flex;
95+
padding-right: 1em;
96+
vertical-align: middle;
97+
align-items: center;
9798
}
9899
99100
.el-switch {

console/atest-ui/src/components/other/APIInput.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
2-
import { NewSuggestedAPIsQuery } from './types'
3-
import type { TestCase } from './types'
2+
import { NewSuggestedAPIsQuery } from '../../types/types'
3+
import type { TestCase } from '../../api/common'
44
55
const props = defineProps({
66
suite: String,
@@ -33,4 +33,3 @@ const handleSelect = (item: TestCase) => {
3333
</template>
3434
</el-autocomplete>
3535
</template>
36-
../types/types../types/types
Lines changed: 55 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,73 @@
11
<template>
2-
<el-affix position="bottom" :offset="20" style="position: absolute; bottom: 5px;">
3-
<el-tooltip effect="dark" content="You can get some functions templates by click it." placement="top-start">
4-
<el-button type="primary" @click="dialogVisible = !dialogVisible"
5-
data-intro="You can search your desired template functions.">{{ t('button.toolbox') }}
6-
</el-button>
7-
</el-tooltip>
8-
</el-affix>
2+
<el-affix position="bottom" :offset="20" style="position: absolute; bottom: 5px">
3+
<el-tooltip
4+
effect="dark"
5+
content="You can get some functions templates by click it."
6+
placement="top-start"
7+
>
8+
<el-button
9+
type="primary"
10+
@click="dialogVisible = !dialogVisible"
11+
data-intro="You can search your desired template functions."
12+
>{{ t('button.toolbox') }}
13+
</el-button>
14+
</el-tooltip>
15+
</el-affix>
916

10-
<el-dialog v-model="dialogVisible" :title="t('title.templateQuery')" width="40%" draggable destroy-on-close>
11-
<template #footer>
12-
<el-input v-model="query" placeholder="Query after enter" v-on:keyup.enter="queryFuncs" />
13-
<span class="dialog-footer">
14-
<el-table :data="funcs" style="width: 100%">
15-
<el-table-column label="Key" width="250">
16-
<template #default="scope">
17-
<el-input v-model="scope.row.key" placeholder="Value" />
18-
</template>
19-
</el-table-column>
20-
<el-table-column label="Value">
21-
<template #default="scope">
22-
<div style="display: flex; align-items: center">
23-
<el-input v-model="scope.row.value" placeholder="Value" />
24-
</div>
25-
</template>
26-
</el-table-column>
27-
</el-table>
28-
</span>
29-
</template>
30-
</el-dialog>
17+
<el-dialog
18+
v-model="dialogVisible"
19+
:title="t('title.templateQuery')"
20+
width="40%"
21+
draggable
22+
destroy-on-close
23+
>
24+
<template #footer>
25+
<el-input v-model="query" placeholder="Query after enter" v-on:keyup.enter="queryFuncs" />
26+
<span class="dialog-footer">
27+
<el-table :data="funcs" style="width: 100%">
28+
<el-table-column label="Key" width="250">
29+
<template #default="scope">
30+
<el-input v-model="scope.row.key" placeholder="Value" />
31+
</template>
32+
</el-table-column>
33+
<el-table-column label="Value">
34+
<template #default="scope">
35+
<div style="display: flex; align-items: center">
36+
<el-input v-model="scope.row.value" placeholder="Value" />
37+
</div>
38+
</template>
39+
</el-table-column>
40+
</el-table>
41+
</span>
42+
</template>
43+
</el-dialog>
3144
</template>
3245

3346

3447
<script setup lang="ts">
3548
import { ref } from 'vue'
36-
import type { Pair } from './types'
49+
import type { Pair } from '../../types/types'
3750
import { useI18n } from 'vue-i18n'
51+
import { FunctionsQuery } from '@/api/cert/cert'
52+
import { ElMessage } from 'element-plus'
3853
3954
const { t } = useI18n()
4055
4156
const dialogVisible = ref(false)
4257
const query = ref('')
4358
const funcs = ref([] as Pair[])
4459
45-
function queryFuncs() {
46-
API.FunctionsQuery(query.value, (d) => {
47-
funcs.value = d.data
60+
const queryFuncs = () => {
61+
FunctionsQuery(query.value)
62+
.then((res: any) => {
63+
funcs.value = res.data
64+
})
65+
.catch((err: any) => {
66+
ElMessage({
67+
showClose: true,
68+
message: err.message,
69+
type: 'error'
70+
})
4871
})
4972
}
5073
</script>

console/atest-ui/src/components/test/TestCase.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,9 @@ const queryHeaderValues = (queryString: string, cb: (arg: any) => void) => {
961961
cb(results)
962962
}
963963
964-
load()
964+
onMounted(() => {
965+
load()
966+
})
965967
966968
watch(props, () => {
967969
load()

console/atest-ui/src/components/test/TestSuite.vue

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@
104104
>{{ t('button.newtestcase') }}</el-button
105105
>
106106
<el-button type="primary" @click="convert" test-id="convert">{{ t('button.export') }}</el-button>
107-
<el-button type="primary" @click="viewYaml" test-id="view-yaml">{{ t('button.viewYaml') }}</el-button>
107+
<el-button type="primary" @click="viewYaml" test-id="view-yaml">{{
108+
t('button.viewYaml')
109+
}}</el-button>
108110

109111
<!-- Create Test Case Dialog-->
110112
<el-dialog v-model="dialogVisible" :title="t('title.createTestCase')" width="40%" draggable>
@@ -169,12 +171,18 @@
169171
</template>
170172
</el-dialog>
171173

172-
<el-dialog v-model="yamlDialogVisible" :title="t('button.viewYaml')" :fullscreen="isFullScreen" width="40%" draggable>
173-
<el-button type="primary" @click="isFullScreen = !isFullScreen" style="margin-bottom: 10px;">
174+
<el-dialog
175+
v-model="yamlDialogVisible"
176+
:title="t('button.viewYaml')"
177+
:fullscreen="isFullScreen"
178+
width="40%"
179+
draggable
180+
>
181+
<el-button type="primary" @click="isFullScreen = !isFullScreen" style="margin-bottom: 10px">
174182
<p>{{ isFullScreen ? t('button.cancelFullScreen') : t('button.fullScreen') }}</p>
175183
</el-button>
176184
<el-scrollbar>
177-
<Codemirror v-model="yamlFormat"/>
185+
<Codemirror v-model="yamlFormat" />
178186
</el-scrollbar>
179187
</el-dialog>
180188

@@ -206,7 +214,7 @@ import {
206214
GetTestSuiteYaml
207215
} from '../../api/test/test'
208216
import { Codemirror } from 'vue-codemirror'
209-
import yaml from 'js-yaml';
217+
import yaml from 'js-yaml'
210218
211219
const { t } = useI18n()
212220
@@ -403,15 +411,15 @@ const paramChange = () => {
403411
}
404412
}
405413
406-
const yamlFormat = ref('');
414+
const yamlFormat = ref('')
407415
const yamlDialogVisible = ref(false)
408416
409417
const viewYaml = () => {
410418
yamlDialogVisible.value = true
411419
412-
GetTestSuiteYaml({ name: props.name },"local")
420+
GetTestSuiteYaml({ name: props.name }, 'local')
413421
.then((res: any) => {
414-
yamlFormat.value = yaml.dump(yaml.load(atob(res.data)));
422+
yamlFormat.value = yaml.dump(yaml.load(atob(res.data)))
415423
})
416424
.catch((e: any) => {
417425
ElMessage.error('Oops, ' + e)
@@ -423,24 +431,24 @@ const viewYaml = () => {
423431
.test-suite-container {
424432
display: flex;
425433
flex-shrink: 0;
434+
}
426435
427-
.item-1 {
428-
flex: 1;
429-
margin-right: 16px;
430-
}
436+
.item-1 {
437+
flex: 1;
438+
margin-right: 16px;
439+
}
431440
432-
.item-2 {
433-
margin-right: 0px;
434-
}
441+
.item-2 {
442+
margin-right: 0px;
435443
}
436444
437445
.button-container {
438-
display: flex;
439-
flex-wrap: wrap;
440-
gap: 10px;
446+
display: flex;
447+
flex-wrap: wrap;
448+
gap: 10px;
441449
}
442450
443451
.button-container > .el-button + .el-button {
444-
margin-left:0px;
452+
margin-left: 0px;
445453
}
446454
</style>

console/atest-ui/src/views/Index.vue

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
<Header></Header>
66
</el-header>
77
<el-container>
8-
<LeftSideBar/>
8+
<LeftSideBar />
99
<el-container>
10-
<el-main>
11-
<div class="mbx">
12-
<el-icon><Fold /></el-icon>
13-
<Mbx/>
14-
</div>
15-
<router-view/>
16-
</el-main>
10+
<el-main>
11+
<div class="mbx">
12+
<el-icon><Fold /></el-icon>
13+
<Mbx />
14+
</div>
15+
<router-view />
16+
</el-main>
1717
<el-footer>
18-
<Footer/>
18+
<Footer />
1919
</el-footer>
2020
</el-container>
2121
</el-container>
@@ -27,18 +27,18 @@
2727
import Header from '@/components/HeaderComponent.vue'
2828
import LeftSideBar from '@/components/LeftSideComponent.vue'
2929
import Footer from '@/components/FooterComponent.vue'
30-
import Mbx from "@/components/MianBaoXie.vue";
30+
import Mbx from '@/components/MianBaoXie.vue'
3131
import { Fold } from '@element-plus/icons-vue'
3232
</script>
3333

3434
<style>
3535
.mbx {
3636
display: flex;
37+
}
3738
38-
.el-icon {
39-
margin-right: 3px;
40-
cursor: pointer;
41-
}
39+
.el-icon {
40+
margin-right: 3px;
41+
cursor: pointer;
4242
}
4343
4444
.common-layout {

0 commit comments

Comments
 (0)