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