refactor: jar包管理优化

This commit is contained in:
chenjianxing 2021-02-03 17:21:20 +08:00
parent 117571cd94
commit 937ce3f3c6
2 changed files with 33 additions and 34 deletions

View File

@ -2,7 +2,8 @@
<el-dialog width="50%" :close-on-click-modal="false" :title="$t('api_test.jar_config.title')" :visible.sync="visible" class="jar-import" @close="close">
<div v-loading="result.loading">
<ms-jar-config-from :config="currentConfig" :callback="saveConfig" ref="jarConfigFrom" :read-only="isReadOnly"/>
<ms-jar-search-bar @refresh="getJarConfigs" :table-data="configs" ref="jarSearchBar"/>
<ms-jar-search-bar v-if="(!isSearchBarQuery && configs.length > 0) || isSearchBarQuery" :condition="condition"
@search="getJarConfigs" :table-data="configs" ref="jarSearchBar"/>
<ms-jar-config-list @refresh="getJarConfigs" v-if="configs.length > 0" @rowSelect="rowSelect" :table-data="configs" ref="jarConfigList"/>
</div>
</el-dialog>
@ -14,6 +15,7 @@
import MsJarConfigList from "./JarConfigList";
import MsJarConfigFrom from "./JarConfigFrom";
import MsJarSearchBar from "./JarSearchBar";
export default {
name: "MsJarConfig",
components: {MsJarConfigFrom, MsJarSearchBar, MsJarConfigList, MsDialogFooter},
@ -22,7 +24,9 @@
visible: false,
result: {},
currentConfig: {},
configs: []
configs: [],
condition: {},
isSearchBarQuery: false
}
},
props: {
@ -34,6 +38,8 @@
methods: {
open() {
this.visible = true;
this.condition = {};
this.getJarConfigs();
listenGoBack(this.close);
},
@ -54,8 +60,11 @@
this.getJarConfigs();
});
},
getJarConfigs(condition) {
this.result = this.$post("/jar/list", {name: condition}, response => {
getJarConfigs(isSearchBarQuery) {
if (isSearchBarQuery) {
this.isSearchBarQuery = isSearchBarQuery;
}
this.result = this.$post("/jar/list", this.condition, response => {
this.configs = response.data;
this.currentConfig = {};
});

View File

@ -1,10 +1,10 @@
<template>
<el-input class="jar-header-search"
v-model="searchCondition"
v-model="condition.name"
type="text"
size="small"
prefix-icon="el-icon-search"
@keyup.enter.native="search"
@blur="search"
:placeholder="$t('project.search_by_name_jar')" clearable/>
</template>
@ -19,19 +19,9 @@
},
},
},
data() {
return {
searchCondition: this.condition
};
},
watch: {
inputCondition(value) {
this.searchCondition = value;
}
},
methods: {
search() {
this.$emit('refresh', this.searchCondition);
this.$emit('search', true);
}
},
}