|
8 | 8 | test-id="open-import-suite-dialog">{{ t('button.import') }}</el-button> |
9 | 9 | <el-button type="primary" @click="loadStores" :icon="Refresh">{{ t('button.refresh') }}</el-button> |
10 | 10 | <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> |
15 | 14 | <el-tree v-loading="storesLoading" :data=data highlight-current :check-on-click-node="true" |
16 | 15 | :expand-on-click-node="false" :current-node-key="currentNodekey" ref="treeRef" node-key="id" |
17 | 16 | :filter-node-method="filterTestCases" @node-click="handleNodeClick" |
|
108 | 107 | import TestCase from '../../components/test/TestCase.vue' |
109 | 108 | import TestSuite from '../../components/test/TestSuite.vue' |
110 | 109 | import TemplateFunctions from '../../components/other/TemplateFunctions.vue' |
111 | | -import { reactive, ref, watch } from 'vue' |
| 110 | +import { reactive, ref, watch, onMounted } from 'vue' |
112 | 111 | import { ElTree, ElMessage } from 'element-plus' |
113 | 112 | import { Edit, Refresh } from '@element-plus/icons-vue' |
114 | 113 | import { Cache } from '../../utils/cache' |
@@ -172,6 +171,13 @@ const data = ref([] as Tree[]) |
172 | 171 | const treeRef = ref<InstanceType<typeof ElTree>>() |
173 | 172 | const currentNodekey = ref('') |
174 | 173 |
|
| 174 | +// page init runtime. |
| 175 | +onMounted(() => { |
| 176 | + // load save stores. |
| 177 | + loadStores() |
| 178 | +
|
| 179 | +}) |
| 180 | +
|
175 | 181 | const loadTestSuites = async (sn: string) => { |
176 | 182 | await LoadTestSuite(sn) |
177 | 183 | .then(DefaultResponseProcess) |
@@ -210,13 +216,12 @@ const storesLoading = ref(false) |
210 | 216 | const loadStores = async () => { |
211 | 217 | storesLoading.value = true |
212 | 218 | await GetStores() |
213 | | - .then(DefaultResponseProcess) |
214 | | - .then(async (d) => { |
215 | | - stores.value = d.data |
| 219 | + .then(async (res: any) => { |
| 220 | + stores.value = res.data |
216 | 221 | data.value = [] as Tree[] |
217 | | - Cache.SetStores(d.data) |
| 222 | + Cache.SetStores(res.data) |
218 | 223 |
|
219 | | - for (const item of d.data) { |
| 224 | + for (const item of res.data) { |
220 | 225 | if (item.ready && !item.disabled) { |
221 | 226 | await loadTestSuites(item.name) |
222 | 227 | } |
@@ -270,12 +275,8 @@ const loadStores = async () => { |
270 | 275 | }).finally(() => { |
271 | 276 | storesLoading.value = false |
272 | 277 | }) |
273 | | -
|
274 | 278 | } |
275 | 279 |
|
276 | | -// run loadStores. |
277 | | -loadStores() |
278 | | -
|
279 | 280 | const dialogVisible = ref(false) |
280 | 281 | const importDialogVisible = ref(false) |
281 | 282 | const suiteCreatingLoading = ref(false) |
@@ -401,10 +402,21 @@ const suiteKinds = [{ |
401 | 402 | } |
402 | 403 |
|
403 | 404 | .card { |
| 405 | + display: flex; |
404 | 406 | margin-top: 1%; |
405 | | - width: 100%; /* 使用百分比单位 */ |
406 | | - max-width: 1750px; /* 设置最大宽度 */ |
| 407 | + width: 100%; |
| 408 | + /* 使用百分比单位 */ |
| 409 | + max-width: 1750px; |
| 410 | + /* 设置最大宽度 */ |
407 | 411 | 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 | + } |
408 | 420 | } |
409 | 421 |
|
410 | 422 | header { |
|
0 commit comments