From 246f7b6fd81cf2ba620b8f9bf7cf24b61d7cf521 Mon Sep 17 00:00:00 2001
From: zhouwx <1175765986@qq.com>
Date: Wed, 17 Jul 2024 16:38:54 +0800
Subject: [PATCH] bug修改
---
src/views/onlineEducation/systemManage/courseClassification/components/courseClassDialog.vue | 18 ++++++++++++++++--
1 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/src/views/onlineEducation/systemManage/courseClassification/components/courseClassDialog.vue b/src/views/onlineEducation/systemManage/courseClassification/components/courseClassDialog.vue
index 51901ac..6f12434 100644
--- a/src/views/onlineEducation/systemManage/courseClassification/components/courseClassDialog.vue
+++ b/src/views/onlineEducation/systemManage/courseClassification/components/courseClassDialog.vue
@@ -5,8 +5,13 @@
:title="title"
width="500px"
:before-close="handleClose"
+ :close-on-press-escape="false"
+ :close-on-click-modal="false"
>
<el-form :model="state.form" size="default" ref="busRef" :rules="state.formRules" label-width="150px" >
+ <el-form-item label="上级分类:" prop="name" v-if="!state.isFirst">
+ <el-input v-model.trim="state.form.parentName" disabled></el-input>
+ </el-form-item>
<el-form-item label="名称:" prop="name">
<el-input v-model.trim="state.form.name"></el-input>
</el-form-item>
@@ -76,6 +81,7 @@
form: {
id: '',
name: '',
+ parentName: '',
sort: 0,
parentId: null,
status: true
@@ -83,19 +89,26 @@
formRules:{
name: [{ required: true, trigger: "blur", validator: validateName }],
},
+ isFirst: true
})
-
const openDialog = async (type, value) => {
length.value = value.listLength
title.value = type === 'addFirst' || type === 'add' ? '新增' : type ==='edit' ? '编辑' : '' ;
if(type === 'edit') {
+ state.isFirst = true;
state.form = value;
state.form.status = value.status == 0;
state.form.sort = value.sort;
+ state.form.parentId = value.parentId;
+ state.form.parentName = value.name;
startUsername.value = value.username;
}else if(type === 'add' && value ){
- state.form.parentId = value.id
+ state.isFirst = false;
+ state.form.parentId = value.id;
+ state.form.parentName = value.name;
+ }else {
+ state.isFirst = true;
}
dialogVisible.value = true;
}
@@ -150,6 +163,7 @@
state.form = {
id: '',
name: '',
+ parentName: '',
sort: 0,
parentId: null,
status: true
--
Gitblit v1.9.2