<template>
  <!-- 注册节点 -->
  <el-dialog v-model="visible" width="30%" :lock-scroll="false">
    <el-card class="box-card" style="margin-bottom: 10px">
      <template #header>
        <div class="card-header">
          <el-text class="mx-1" size="large">注册节点</el-text>
        </div>
      </template>
      <div v-loading="loading" v-for="(item, i) in registerArray" :key="i" class="text item">{{ i + 1 }}.{{ item }}</div>
    </el-card>
  </el-dialog>
</template>

<script setup="JobInfoRegisterJob" lang="ts">
import { queryRegister } from '@/api/xxljob/info';

const { proxy } = getCurrentInstance();
const visible = ref(false);
const registerArray = ref([]);
const loading = ref(false);

const show = async (row) => {
  visible.value = true;
  loading.value = true;
  await initShow(row);
};

const initShow = async (row) => {
  const res = await queryRegister(row.jobGroup);
  if (res.code == 200) {
    registerArray.value = res.data.registryList;
  }
  loading.value = false;
};

defineExpose({
  show
});
</script>

<style scoped lang="scss"></style>
