Skip to content

Commit 5fb6cda

Browse files
committed
optimize: optimize test pages
Signed-off-by: yuluo-yx <[email protected]>
1 parent e3202f9 commit 5fb6cda

File tree

2 files changed

+32
-20
lines changed

2 files changed

+32
-20
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,21 @@ export const CreateStore = (params: any) =>
2323
})
2424

2525
export const UpdateStore = (params: any) =>
26-
post('/api/server.Runner/UpdateStore', params, {
26+
post('/server.Runner/UpdateStore', params, {
2727
'X-Auth': getToken()
2828
})
2929

3030
export const GetStores = () =>
31-
post('/api/server.Runner/GetStores', null, {
31+
post('/server.Runner/GetStores', null, {
3232
'X-Auth': getToken()
3333
})
3434

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

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

console/atest-ui/src/views/test/TestingPanel.vue

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@
88
test-id="open-import-suite-dialog">{{ t('button.import') }}</el-button>
99
<el-button type="primary" @click="loadStores" :icon="Refresh">{{ t('button.refresh') }}</el-button>
1010
<TemplateFunctions />
11-
<br>
12-
<br>
13-
<el-input v-model="filterText" :placeholder="t('tip.filter')" test-id="search" style="padding: 5px;" />
14-
11+
<div class="filter-input">
12+
<el-input v-model="filterText" :placeholder="t('tip.filter')" test-id="search" />
13+
</div>
1514
<el-tree v-loading="storesLoading" :data=data highlight-current :check-on-click-node="true"
1615
:expand-on-click-node="false" :current-node-key="currentNodekey" ref="treeRef" node-key="id"
1716
:filter-node-method="filterTestCases" @node-click="handleNodeClick"
@@ -108,7 +107,7 @@
108107
import TestCase from '../../components/test/TestCase.vue'
109108
import TestSuite from '../../components/test/TestSuite.vue'
110109
import TemplateFunctions from '../../components/other/TemplateFunctions.vue'
111-
import { reactive, ref, watch } from 'vue'
110+
import { reactive, ref, watch, onMounted } from 'vue'
112111
import { ElTree, ElMessage } from 'element-plus'
113112
import { Edit, Refresh } from '@element-plus/icons-vue'
114113
import { Cache } from '../../utils/cache'
@@ -172,6 +171,13 @@ const data = ref([] as Tree[])
172171
const treeRef = ref<InstanceType<typeof ElTree>>()
173172
const currentNodekey = ref('')
174173
174+
// page init runtime.
175+
onMounted(() => {
176+
// load save stores.
177+
loadStores()
178+
179+
})
180+
175181
const loadTestSuites = async (sn: string) => {
176182
await LoadTestSuite(sn)
177183
.then(DefaultResponseProcess)
@@ -210,13 +216,12 @@ const storesLoading = ref(false)
210216
const loadStores = async () => {
211217
storesLoading.value = true
212218
await GetStores()
213-
.then(DefaultResponseProcess)
214-
.then(async (d) => {
215-
stores.value = d.data
219+
.then(async (res: any) => {
220+
stores.value = res.data
216221
data.value = [] as Tree[]
217-
Cache.SetStores(d.data)
222+
Cache.SetStores(res.data)
218223
219-
for (const item of d.data) {
224+
for (const item of res.data) {
220225
if (item.ready && !item.disabled) {
221226
await loadTestSuites(item.name)
222227
}
@@ -270,12 +275,8 @@ const loadStores = async () => {
270275
}).finally(() => {
271276
storesLoading.value = false
272277
})
273-
274278
}
275279
276-
// run loadStores.
277-
loadStores()
278-
279280
const dialogVisible = ref(false)
280281
const importDialogVisible = ref(false)
281282
const suiteCreatingLoading = ref(false)
@@ -401,10 +402,21 @@ const suiteKinds = [{
401402
}
402403
403404
.card {
405+
display: flex;
404406
margin-top: 1%;
405-
width: 100%; /* 使用百分比单位 */
406-
max-width: 1750px; /* 设置最大宽度 */
407+
width: 100%;
408+
/* 使用百分比单位 */
409+
max-width: 1750px;
410+
/* 设置最大宽度 */
407411
height: auto;
412+
vertical-align:middle;
413+
414+
.filter-input {
415+
vertical-align:middle;
416+
float: right;
417+
padding-left: 1vh;
418+
width: 50vh;
419+
}
408420
}
409421
410422
header {

0 commit comments

Comments
 (0)