<template>
  <div class="add">
    <el-dialog v-model="dialogVisible" title="测试工程详情" width="500">
      <el-form
        :label-position="labelPosition"
        label-width="auto"
        :model="formLabelAlign"
        style="max-width: 600px"
      >
        <el-form-item label="产品: " :label-position="itemLabelPosition">
          <span v-text="formLabelAlign.engineeringProductName" />
        </el-form-item>
        <el-form-item label="类型: " :label-position="itemLabelPosition">
          <span v-text="formLabelAlign.engineeringType" />
        </el-form-item>
        <el-form-item label="版本: " :label-position="itemLabelPosition">
          <span v-text="formLabelAlign.engineeringVersion" />
        </el-form-item>

        <el-form-item label="开发人员: " :label-position="itemLabelPosition">
          <span v-text="formLabelAlign.creator" />
        </el-form-item>
        <el-form-item label="创建时间: " :label-position="itemLabelPosition">
          <span v-text="formLabelAlign.created" />
        </el-form-item>
        <el-form-item label="修改时间: " :label-position="itemLabelPosition">
          <span v-text="formLabelAlign.updated" />
        </el-form-item>
        <el-form-item label="是否发布: " :label-position="itemLabelPosition">
          <span>{{ formLabelAlign.publishStatus ? "已发布" : "未发布" }}</span>
        </el-form-item>
      </el-form>
    </el-dialog>
  </div>
</template>

<script lang="ts" setup>
import { reactive, ref, watch } from "vue";

const dialogVisible = ref(false);

import type { FormItemProps, FormProps } from "element-plus";

const labelPosition = ref<FormProps["labelPosition"]>("right");
const itemLabelPosition = ref<FormItemProps["labelPosition"]>("");

interface VersionItem {
  id?: string; //	主键	string
  engineeringProductName?: string; //	产品名称	string
  engineeringType?: string; //	工程类型	string
  engineeringVersion?: string; //	工程版本	string
  creator?: string; //创建人	string 开发人员
  updated?: string; //	修改时间	string(date-time)
  created?: string; //	创建时间string(date-time)
  deleted?: string; //	删除标识;0-未删除；1-已删除	integer(int32)
  deptId?: string; //	部门ID	string
  orgId?: string; //	组织ID	string
  updator?: string; //	上次修改人	string
  publishStatus?: number; //发布状态：0-发布 1-未发布
}

const formLabelAlign = ref<VersionItem>({});

const openDialog = (isEdit: boolean, row: VersionItem) => {
  dialogVisible.value = true;
  formLabelAlign.value = row;
};

defineExpose({ openDialog });
</script>
<style scoped lang="scss">
// .add {
//   // position: fixed;
//   // width: 100%;
//   // height: 100%;
//   // z-index: 10;
//   // background-color: #000;
// }
span {
  font-size: 16px;
  font-weight: bold;
}
</style>
