|
@@ -45,9 +45,15 @@ function handleModifyClassify(data){
|
|
|
}
|
|
|
//添加编辑分类
|
|
|
async function modifyClassify(){
|
|
|
- //params对ParentId为-1的数据做处理,转为0
|
|
|
- await formRef.value?.validate()
|
|
|
+ try{
|
|
|
+ await formRef.value?.validate()
|
|
|
+ }catch(e){
|
|
|
+ console.log(e)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
let res = null
|
|
|
+ //params对ParentId为-1的数据做处理,转为0
|
|
|
if(currentClassify.value.ClassifyId){
|
|
|
res = await ClassifyInterface.editClassify({
|
|
|
ClassifyId:currentClassify.value.ClassifyId,
|
|
@@ -129,8 +135,8 @@ function deleteClassify(data){
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" align="center" width="400px">
|
|
|
<template #default="{row}">
|
|
|
- <el-button type="text" @click="handleModifyClassify(row)">编辑</el-button>
|
|
|
- <el-button type="text" @click="deleteClassify(row)">删除</el-button>
|
|
|
+ <el-link :underline="false" type="primary" style="margin-right: 20px;" @click="handleModifyClassify(row)">编辑</el-link>
|
|
|
+ <el-link :underline="false" type="danger" @click="deleteClassify(row)">删除</el-link>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -139,7 +145,7 @@ function deleteClassify(data){
|
|
|
<el-dialog :title="currentClassify.ClassifyId?'编辑分类':'添加分类'" v-model="isModifyDialogShow"
|
|
|
:close-on-click-modal="false" :modal-append-to-body="false" @close="isModifyDialogShow=false" width="589px" center>
|
|
|
<div class="dialog-container">
|
|
|
- <el-form :model="currentClassify" :rules="rules" ref="form" label-position="top">
|
|
|
+ <el-form :model="currentClassify" :rules="rules" ref="formRef" label-position="top">
|
|
|
<el-form-item label="上级分类" prop="ParentId">
|
|
|
<el-select v-model="currentClassify.ParentId" placeholder="请选择上级分类" style="width:100%;">
|
|
|
<el-option v-for="item in currentClassify.ClassifyId
|