mirror of
https://github.com/certd/certd.git
synced 2026-04-15 05:00:52 +08:00
perf: 当域名管理中没有域名时,创建流水线时不展开域名选择框
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
:options="optionsRef"
|
||||
:value="value"
|
||||
v-bind="attrs"
|
||||
:open="openProp"
|
||||
@click="onClick"
|
||||
@update:value="emit('update:value', $event)"
|
||||
>
|
||||
@@ -56,11 +57,11 @@
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { computed, defineComponent, ref, Ref, useAttrs } from "vue";
|
||||
import { request } from "/@/api/service";
|
||||
import { Dicts } from "../lib/dicts";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useDomainImport, useDomainImportManage } from "/@/views/certd/cert/domain/use";
|
||||
import { Dicts } from "../lib/dicts";
|
||||
import { request } from "/@/api/service";
|
||||
import { openRouteInNewWindow } from "/@/vben/utils";
|
||||
import { useDomainImportManage } from "/@/views/certd/cert/domain/use";
|
||||
|
||||
defineOptions({
|
||||
name: "DomainSelector",
|
||||
@@ -82,6 +83,7 @@ const props = defineProps<{
|
||||
search?: boolean;
|
||||
pager?: boolean;
|
||||
value?: any[];
|
||||
open?: boolean;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
@@ -90,6 +92,15 @@ const emit = defineEmits<{
|
||||
|
||||
const attrs = useAttrs();
|
||||
|
||||
const hasOptions: Ref = ref(null);
|
||||
|
||||
const openProp = computed(() => {
|
||||
if (hasOptions.value == null) {
|
||||
return false;
|
||||
}
|
||||
return hasOptions.value;
|
||||
});
|
||||
|
||||
const searchKeyRef = ref("");
|
||||
const optionsRef = ref([]);
|
||||
const message = ref("");
|
||||
@@ -143,6 +154,13 @@ const getOptions = async () => {
|
||||
}
|
||||
|
||||
optionsRef.value = options;
|
||||
if (hasOptions.value == null) {
|
||||
if (options.length > 0) {
|
||||
hasOptions.value = true;
|
||||
} else {
|
||||
hasOptions.value = false;
|
||||
}
|
||||
}
|
||||
pagerRef.value.total = list.length;
|
||||
if (props.pager) {
|
||||
if (res.total != null) {
|
||||
|
||||
Reference in New Issue
Block a user