提交 64c6fa21 authored 作者: matian's avatar matian

修改上级分类显示问题

上级 6f31f0c1
...@@ -65,12 +65,13 @@ const getCheckedLabel = (val: any) => { ...@@ -65,12 +65,13 @@ const getCheckedLabel = (val: any) => {
console.log(val, '99991111') console.log(val, '99991111')
categoryName.value = val.checkedCategory.checkedLabel categoryName.value = val.checkedCategory.checkedLabel
categoryForm.parent_id = val.checkedCategory.checkedId categoryForm.parent_id = val.checkedCategory.checkedId
categoryForm.depth = val.checkedCategory.checkedLevel categoryForm.depth = parseInt(val.checkedCategory.checkedLevel) + 1
} }
// 关闭弹框 // 关闭弹框
const handleCancel = () => { const handleCancel = () => {
emit('update:dialogVisible', false) emit('update:dialogVisible', false)
console.log(formRef.value, 'formRef.value') console.log(formRef.value, 'formRef.value')
categoryName.value = ''
formRef.value.resetFields() formRef.value.resetFields()
} }
// 确认提交表单 // 确认提交表单
...@@ -86,7 +87,7 @@ const handleConfirm = () => { ...@@ -86,7 +87,7 @@ const handleConfirm = () => {
} }
onMounted(() => { onMounted(() => {
categoryName.value = props.editData.category_name console.log(props.prevCategoryName, 'props.prevCategoryName')
categoryForm.depth = parseInt(props.editData.depth) + 1 categoryForm.depth = parseInt(props.editData.depth) + 1
categoryForm.parent_id = props.editData.id categoryForm.parent_id = props.editData.id
categoryName.value = props.prevCategoryName categoryName.value = props.prevCategoryName
......
...@@ -64,6 +64,7 @@ const handleAddCategory = () => { ...@@ -64,6 +64,7 @@ const handleAddCategory = () => {
dialogVisible.value = true dialogVisible.value = true
title.value = '新增类别' title.value = '新增类别'
editData.value = tableData[0] editData.value = tableData[0]
prevCategoryName.value = ''
} }
// 获取上级类别 // 获取上级类别
const getParent = (node: string, tree: any) => { const getParent = (node: string, tree: any) => {
...@@ -96,8 +97,7 @@ const getParent = (node: string, tree: any) => { ...@@ -96,8 +97,7 @@ const getParent = (node: string, tree: any) => {
// console.log(data, 'data') // console.log(data, 'data')
// if (newIndex === oldIndex) return // if (newIndex === oldIndex) return
// // targetName.splice(newIndex, 0, targetName.splice(oldIndex, 1)) // targetName.splice(newIndex, 0, targetName.splice(oldIndex, 1))
// console.log(targetName, 'pppp')
// } // }
// }) // })
// } // }
......
...@@ -100,14 +100,14 @@ onMounted(() => { ...@@ -100,14 +100,14 @@ onMounted(() => {
<el-input v-model="ruleForm.office" :disabled="isEdit === '1'" /> <el-input v-model="ruleForm.office" :disabled="isEdit === '1'" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-form-item>
<el-button type="primary" v-if="isEdit !== '1'" @click="handleUpdate(ruleFormRef)">保存</el-button>
</el-form-item>
</el-row> </el-row>
<el-form-item label="讲师简介:" prop="summarize"> <el-form-item label="讲师简介:" prop="summarize">
<v-editor v-model="ruleForm.summarize" style="width: 70%" :disabled="isEdit === '1'"></v-editor> <v-editor v-model="ruleForm.summarize" style="width: 70%" :disabled="isEdit === '1'"></v-editor>
</el-form-item> </el-form-item>
<el-form-item>
<el-button type="primary" v-if="isEdit !== '1'" @click="handleUpdate(ruleFormRef)">保存</el-button>
</el-form-item>
</el-form> </el-form>
<el-card> <el-card>
<div class="form_title">讲授课程:</div> <div class="form_title">讲授课程:</div>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论