<script setup>
const props = defineProps({
    title: [String],
    tableData: [Object],
})

const emit = defineEmits(['closed'])

const dialogVisible = ref(false)

onMounted(() => {
    dialogVisible.value = true
})

function closed() {
    emit('closed')
}

</script>

<template>
    <el-dialog align-center :title="title + '-子模块信息'" width="800px" v-model="dialogVisible" @closed="closed">
        <el-table :data="tableData" style="width: 100%" height="366" stripe>
            <el-table-column align="center" prop="ModuleLoopAddress" label="回路地址" />
            <el-table-column align="center" prop="DeviceAddress" label="设备地址" />
            <el-table-column align="center" prop="CurrentPWMDuty" label="电流PWM">
                <template #default="{ row }">
                    {{ row.CurrentPWMDuty && row.CurrentPWMDuty + '%' }}
                </template>
            </el-table-column>
            <el-table-column align="center" prop="VoltagePWMDuty" label="电压PWM">
                <template #default="{ row }">
                    {{ row.VoltagePWMDuty && row.VoltagePWMDuty + '%' }}
                </template>
            </el-table-column>
            <el-table-column align="center" prop="CurrentLimitPct" label="限流百分比">
                <template #default="{ row }">
                    {{ row.CurrentLimitPct && row.CurrentLimitPct + '%' }}
                </template>
            </el-table-column>
            <el-table-column align="center" prop="ModuleVersion" label="版本" />
        </el-table>
        <template #footer>
            <div class="dialog-footer">
                <el-button icon="Remove" @click="dialogVisible = false">
                    关闭
                </el-button>
                <!-- <el-button
          v-if="!isOnlyView"
          icon="CircleCheck"
          :loading="loading"
          type="primary"
          @click="submitForm"
        >
          确 定
        </el-button> -->
            </div>
        </template>
    </el-dialog>
</template>

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