【修改】隐藏字段

This commit is contained in:
YOHO\20373
2025-05-21 19:12:02 +08:00
parent 9ee266817a
commit c478114722
18 changed files with 65 additions and 36 deletions

View File

@@ -276,7 +276,9 @@ const dialogTitle = ref('') // 弹窗的标题
const formLoading = ref(false) // 表单的加载中1修改时的数据加载2提交的按钮禁用
const formType = ref('') // 表单的类型create - 新增update - 修改
const formData = ref({
content: '',
content: `---------------------------------------------------------------------
请在打开的窗口中,进行下列操作,完成所有操作后,请关闭窗口。
---------------------------------------------------------------------`,
specialtyName: '',
courseName: '',
quBankName: '',

View File

@@ -446,7 +446,10 @@ const submitForm = async () => {
/** 重置表单 */
const resetForm = () => {
formData.value = {
content: '',
content: `---------------------------------------------------------------------
请在打开的窗口中,进行下列操作,完成所有操作后,请关闭窗口。
---------------------------------------------------------------------`,
specialtyName: '',
courseName: '',
quBankName: '',

View File

@@ -317,8 +317,7 @@ const open = async (queryParams: any ,type: string, id?: number) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
// 修改时,设置数据
if (id) {
formLoading.value = true
@@ -331,6 +330,7 @@ const open = async (queryParams: any ,type: string, id?: number) => {
formLoading.value = false
}
} else {
resetForm()
formData.value.specialtyName = queryParams.specialtyName
formData.value.courseName = queryParams.courseName
formData.value.subjectName = queryParams.subjectName
@@ -339,6 +339,7 @@ const open = async (queryParams: any ,type: string, id?: number) => {
}
}
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
// 转换函数:将大写字母 A-Z 映射为 0-25
@@ -382,10 +383,18 @@ const submitForm = async () => {
}
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
content: '',
content: `---------------------------------------------------------------------------
注意事项:
请利用图形化管理界面或者MySQL命令行工具在指定的试题数据库中进行答题。
MySQL连接地址为localhost
MySQL登录用户名为root
MySQL端口号为6033或3306
MySQL密码为空
---------------------------------------------------------------------------`,
specialtyName: '',
courseName: '',
quBankName: '',
@@ -399,8 +408,23 @@ const resetForm = () => {
status: '',
resourceValue: ''
}
documentList .value =([
{
quId: '',
url: '',
fileType: '1',
fileName: ''
},
{
quId: '',
url: '',
fileType: '2',
fileName: ''
}
])
formRef.value?.resetFields()
documentList.value=[]
}
</script>
<style lang="scss" scoped>

View File

@@ -4,9 +4,9 @@
<Dialog v-model="visible" :title="'修改试卷'" width="460" @open="handleOpen" center>
<div style="margin-bottom: 16px">
<!-- <div style="margin-bottom: 16px">
<strong>试卷ID</strong>{{ paperId }}
</div>
</div> -->
<!-- 滚动区域 -->
<div style="max-height: 400px; overflow-y: auto;">

View File

@@ -3,11 +3,11 @@
<Dialog v-model="visible" :title="'查看试卷'" width="860" @open="handleOpen" center>
<!--
<div style="margin-bottom: 16px">
<strong>试卷ID</strong>
{{ paperId ? paperId : '未提供试卷ID' }}
</div>
</div> -->
<!-- 滚动区域 -->

View File

@@ -199,7 +199,7 @@ const fetchSpecialtyOptions = async () => {
};
/** 弹窗打开事件 */
const handleOpen = () => {
const open = () => {
if (props.data) {
assignFields(props.data);
isUpdate.value = true;
@@ -233,5 +233,5 @@ const fetchSpecialtyOptions = async () => {
onMounted(() => {
fetchSpecialtyOptions();
});
defineExpose({ handleOpen })
defineExpose({ open })
</script>

View File

@@ -4,10 +4,10 @@
<Dialog v-model="visible" :title="'修改试卷'" width="460" @open="handleOpen" center>
<div style="margin-bottom: 16px">
<!-- <div style="margin-bottom: 16px">
<strong>试卷ID</strong>{{ paperId }}
</div>
-->
<!-- 滚动区域 -->
<div style="max-height: 400px; overflow-y: auto;">
<!-- 分组展示题目 -->

View File

@@ -4,10 +4,10 @@
<Dialog v-model="visible" :title="'查看试卷'" width="860" @open="handleOpen" center>
<div style="margin-bottom: 16px">
<!-- <div style="margin-bottom: 16px">
<strong>试卷ID</strong>
{{ paperId ? paperId : '未提供试卷ID' }}
</div>
</div> -->
<!-- 滚动区域 -->

View File

@@ -4,10 +4,10 @@
<Dialog v-model="visible" :title="'修改试卷'" width="460" @open="handleOpen" center>
<div style="margin-bottom: 16px">
<!-- <div style="margin-bottom: 16px">
<strong>试卷ID</strong>{{ paperId }}
</div>
-->
<!-- 滚动区域 -->
<div style="max-height: 400px; overflow-y: auto;">
<!-- 分组展示题目 -->

View File

@@ -4,10 +4,10 @@
<Dialog v-model="visible" :title="'查看试卷'" width="860" @open="handleOpen" center>
<div style="margin-bottom: 16px">
<!-- <div style="margin-bottom: 16px">
<strong>试卷ID</strong>
{{ paperId ? paperId : '未提供试卷ID' }}
</div>
</div> -->
<!-- 滚动区域 -->

View File

@@ -4,9 +4,9 @@
<Dialog v-model="visible" :title="'修改试卷'" width="460" @open="handleOpen" center>
<div style="margin-bottom: 16px">
<!-- <div style="margin-bottom: 16px">
<strong>试卷ID</strong>{{ paperId }}
</div>
</div> -->
<!-- 滚动区域 -->
<div style="max-height: 400px; overflow-y: auto;">

View File

@@ -4,10 +4,10 @@
<Dialog v-model="visible" :title="'查看试卷'" width="860" @open="handleOpen" center>
<div style="margin-bottom: 16px">
<!-- <div style="margin-bottom: 16px">
<strong>试卷ID</strong>
{{ paperId ? paperId : '未提供试卷ID' }}
</div>
</div> -->
<!-- 滚动区域 -->

View File

@@ -4,9 +4,9 @@
<Dialog v-model="visible" :title="'修改试卷'" width="460" @open="handleOpen" center>
<div style="margin-bottom: 16px">
<!-- <div style="margin-bottom: 16px">
<strong>试卷ID</strong>{{ paperId }}
</div>
</div> -->
<!-- 滚动区域 -->
<div style="max-height: 400px; overflow-y: auto;">

View File

@@ -4,10 +4,10 @@
<Dialog v-model="visible" :title="'查看试卷'" width="860" @open="handleOpen" center>
<div style="margin-bottom: 16px">
<!-- <div style="margin-bottom: 16px">
<strong>试卷ID</strong>
{{ paperId ? paperId : '未提供试卷ID' }}
</div>
</div> -->
<!-- 滚动区域 -->

View File

@@ -4,9 +4,9 @@
<Dialog v-model="visible" :title="'修改试卷'" width="460" @open="handleOpen" center>
<div style="margin-bottom: 16px">
<!-- <div style="margin-bottom: 16px">
<strong>试卷ID</strong>{{ paperId }}
</div>
</div> -->
<!-- 滚动区域 -->
<div style="max-height: 400px; overflow-y: auto;">

View File

@@ -4,10 +4,10 @@
<Dialog v-model="visible" :title="'查看试卷'" width="860" @open="handleOpen" center>
<div style="margin-bottom: 16px">
<!-- <div style="margin-bottom: 16px">
<strong>试卷ID</strong>
{{ paperId ? paperId : '未提供试卷ID' }}
</div>
</div> -->
<!-- 滚动区域 -->

View File

@@ -4,9 +4,9 @@
<Dialog v-model="visible" :title="'修改试卷'" width="460" @open="handleOpen" center>
<div style="margin-bottom: 16px">
<!-- <div style="margin-bottom: 16px">
<strong>试卷ID</strong>{{ paperId }}
</div>
</div> -->
<!-- 滚动区域 -->
<div style="max-height: 400px; overflow-y: auto;">

View File

@@ -4,10 +4,10 @@
<Dialog v-model="visible" :title="'查看试卷'" width="860" @open="handleOpen" center>
<div style="margin-bottom: 16px">
<!-- <div style="margin-bottom: 16px">
<strong>试卷ID</strong>
{{ paperId ? paperId : '未提供试卷ID' }}
</div>
</div> -->
<!-- 滚动区域 -->