refactor: jar包管理优化
This commit is contained in:
parent
117571cd94
commit
937ce3f3c6
|
@ -2,19 +2,21 @@
|
|||
<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>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MsDialogFooter from "../../../../common/components/MsDialogFooter";
|
||||
import {listenGoBack, removeGoBackListener} from "../../../../../../common/js/utils";
|
||||
import MsJarConfigList from "./JarConfigList";
|
||||
import MsJarConfigFrom from "./JarConfigFrom";
|
||||
import MsJarSearchBar from "./JarSearchBar";
|
||||
export default {
|
||||
import MsDialogFooter from "../../../../common/components/MsDialogFooter";
|
||||
import {listenGoBack, removeGoBackListener} from "../../../../../../common/js/utils";
|
||||
import MsJarConfigList from "./JarConfigList";
|
||||
import MsJarConfigFrom from "./JarConfigFrom";
|
||||
import MsJarSearchBar from "./JarSearchBar";
|
||||
|
||||
export default {
|
||||
name: "MsJarConfig",
|
||||
components: {MsJarConfigFrom, MsJarSearchBar, MsJarConfigList, MsDialogFooter},
|
||||
data() {
|
||||
|
@ -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 = {};
|
||||
});
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue