<!--
@ 作者: 鲁智强
@ 时间: 2023-08-15 11:34:38
@ 备注: 
-->
<template>
	<el-dialog :model-value="true" :title="title" @close="handleClose">

	<el-table
      ref="multipleTableRef"
      border
      style="width: 100%"
      stripe
    >
      <el-table-column prop="asd" label="工号" />
      <el-table-column prop="name" label="姓名" />
      <el-table-column prop="sex" label="属性" width="300"/>
      <el-table-column prop="age" label="考试分数" />
      <el-table-column prop="num" label="状态"  />
	  <el-table-column prop="qwe" label="参加次数"  />
	  <el-table-column prop="zxc" label="查看详情">
		<el-button class="new_btn" type="primary" @click="handleNewed"
		>查看</el-button>
	  </el-table-column>
	  </el-table>
	</el-dialog>
	<Diaiop
		v-if="data.diaiopShow"
		v-model:data.diaiopShow="data.diaiopShow"
		:row-info="rowInfo"
		:title="title"
	  />
  </template>
  <script lang="ts" setup>
  import { reactive, toRefs, ref, onMounted} from "vue";
  import { Delete, Download, Plus, ZoomIn } from "@element-plus/icons-vue";
  import { ElMessage,UploadProps} from "element-plus";
  import "quill/dist/quill.snow.css"; 
  import type { UploadFile } from 'element-plus'
  import Diaiop from "./diaiop.vue"
  const childBorder = ref(false);
  const parentBorder = ref(false);
  const editContvalue = ref("");
const props=defineProps({
	  title: {
		type: String,
		default: "",
	  },
	  dialogShow: {
		type: Boolean,
		default: false,
	  },
	  rowInfo: {
		type: Object,
		default() {
		  return {};
		},
	  },
	  arrayNum: {
		type: Number,
		default: 0,
	  },
	})
const emit=defineEmits(['image-uploaded', 'update:dialogShow', 'editRow', 'addRow'])
	const data = reactive({
		  diaiopShow: false,
		  title:"",
          rowInfo:{},
          formData: {
		  id: props.arrayNum.toString(),
		  name: "",
		  sex: "",
		  num: "",
		  age:"",
		  qwe:"",
		  zxc:"",
		},
		studentInfoac:[
			{
				asd:"300946",
				name:"刘来",
				sex:"质检中心煤焦采制样操作工",
				age:"65",
				num:"及格",
				qwe:"55",
				zxc:""
			}
		],
	  });
	  		// 关闭弹窗
	const handleClose=()=> {
		  emit("update:dialogShow", false);
		}
		// 重置
	const resetForm=()=> {
		  data.formData = Object.assign({}, props.rowInfo);
		}
		// 提交表单内容
	const submitForm=()=> {
		  handleClose();
		  if (props.rowInfo.name) {
			// 修改
			const id = props.rowInfo;
			emit("editRow", data.formData);
		  } else {
			// 新增
			data.formData["id"] = (props.arrayNum + 1).toString();
			emit("addRow", data.formData);
		  }
		}
	const handleNewed=()=> {
		  data.title = "查看试卷";
		  data.rowInfo = {};
		  data.diaiopShow = true;
}
	const editorInstance = ref(null);
	  onMounted(() => {
		data.formData = Object.assign({}, props.rowInfo);
	  });
	  const handlePictureCardPreview = (file: UploadFile) => {};
	  const disabled = ref(false);
	  const handleRemove = (file: UploadFile) => {};
	  const handleDownload = (file: UploadFile) => {};
  </script>
  
  <style scoped>
  
  
  .avatar-uploader .avatar {
	display: block;
	width: 178px;
	height: 178px;
  }
  </style>
  
  <style lang="scss">
  .avatar-uploader .el-upload {
	position: relative;
	overflow: hidden;
	cursor: pointer;
	border: 1px dashed var(--el-border-color);
	border-radius: 6px;
	transition: var(--el-transition-duration-fast);
  }
  
  .avatar-uploader .el-upload:hover {
	border-color: var(--el-color-primary);
  }
  
  .el-icon.avatar-uploader-icon {
	width: 178px;
	height: 178px;
	font-size: 28px;
	color: #8c939d;
	text-align: center;
  }
  .el-dialog{
	  width:1200px;
  }
  </style>
  