|
@@ -22,14 +22,16 @@
|
|
|
<h2 class="dialog-title">{{ title }}</h2>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="模块">
|
|
|
- <el-select v-model="filter.moduleId" placeholder="请选择模块">
|
|
|
- <el-option
|
|
|
- v-for="item in moduleList"
|
|
|
- :key="item.id"
|
|
|
- :label="item.name"
|
|
|
- :value="item.id"
|
|
|
- ></el-option>
|
|
|
- </el-select>
|
|
|
+ <module-select
|
|
|
+ ref="ModuleSelect"
|
|
|
+ v-model="filter.moduleId"
|
|
|
+ :app-id="filter.appId"
|
|
|
+ :clearable="false"
|
|
|
+ filter-type="nginx"
|
|
|
+ manual-fetch
|
|
|
+ select-default
|
|
|
+ show-all-label-option
|
|
|
+ ></module-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label-width="0px">
|
|
|
<el-button type="primary" icon="ios-search" @click="search"
|
|
@@ -60,7 +62,6 @@
|
|
|
|
|
|
<script>
|
|
|
import EditNginxContent from "./EditNginxContent.vue";
|
|
|
-import { appModuleList } from "../api";
|
|
|
|
|
|
export default {
|
|
|
name: "app-nginx-manange",
|
|
@@ -98,17 +99,19 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
async visibleChange(visible) {
|
|
|
- if (visible) {
|
|
|
- this.filter = {
|
|
|
- appId: this.app.id,
|
|
|
- moduleId: null,
|
|
|
- };
|
|
|
-
|
|
|
- await this.getModuleList();
|
|
|
- this.dataReady = true;
|
|
|
- } else {
|
|
|
+ if (!visible) {
|
|
|
this.dataReady = false;
|
|
|
+ return;
|
|
|
}
|
|
|
+
|
|
|
+ this.filter = {
|
|
|
+ appId: this.app.id,
|
|
|
+ moduleId: null,
|
|
|
+ };
|
|
|
+ this.$nextTick(async () => {
|
|
|
+ await this.$refs.ModuleSelect.search();
|
|
|
+ this.dataReady = true;
|
|
|
+ });
|
|
|
},
|
|
|
cancel() {
|
|
|
this.modalIsShow = false;
|
|
@@ -116,15 +119,6 @@ export default {
|
|
|
open() {
|
|
|
this.modalIsShow = true;
|
|
|
},
|
|
|
- async getModuleList() {
|
|
|
- if (!this.filter.appId) return;
|
|
|
-
|
|
|
- const res = await appModuleList({
|
|
|
- appId: this.filter.appId,
|
|
|
- });
|
|
|
- this.moduleList = res || [];
|
|
|
- this.moduleList.unshift({ id: null, name: "全部" });
|
|
|
- },
|
|
|
search() {
|
|
|
this.$refs.EditBaseNginxContent.initData();
|
|
|
this.$refs.EditCommonNginxContent.initData();
|