|
@@ -448,6 +448,60 @@ const submitForm = async (formEl) => {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * 更新
|
|
|
|
+ * @param formEl
|
|
|
|
+ */
|
|
|
|
+const updateForm = async (formEl) => {
|
|
|
|
+ if (!formEl) return
|
|
|
|
+ await formEl.validate((valid, fields) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+
|
|
|
|
+ console.log(
|
|
|
|
+ "detailsDb", detailsDb.value
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ // let submit = {
|
|
|
|
+ // // 通过 schoolItem 接口得到的 id 值,是什么就传什么
|
|
|
|
+ // "id" : detailsDb.value.id,
|
|
|
|
+ // // 名称
|
|
|
|
+ // "name": detailsDb.value.name,
|
|
|
|
+ // // 0 表示学校 1 表示学院 2表示专业,3 表示班级, 通过 schoolItem 接口得到的 type 值,是什么就传什么
|
|
|
|
+ // "type": detailsDb.value.type,
|
|
|
|
+ // // 备注
|
|
|
|
+ // "remark": detailsDb.value.remark,
|
|
|
|
+ // // 上级id,默认顶级是 0, 通过 schoolItem 接口得到的 parentId 值,是什么就传什么
|
|
|
|
+ // "parentId": detailsDb.value.parentId,
|
|
|
|
+ // // 新增时传入0即可,修改则传入原始值, 通过 schoolItem 接口得到的 schoolId 值,是什么就传什么
|
|
|
|
+ // "schoolId": detailsDb.value.schoolId,
|
|
|
|
+ // };
|
|
|
|
+
|
|
|
|
+ // schoolUpdate(submit)
|
|
|
|
+ // .then(response => {
|
|
|
|
+
|
|
|
|
+ // let data = response?.data?.data;
|
|
|
|
+ // // console.log(
|
|
|
|
+ // // "schoolUpdateEvent response", response, data
|
|
|
|
+ // // );
|
|
|
|
+
|
|
|
|
+ // // 重新查找分页数据
|
|
|
|
+ // pageUpdateEvent();
|
|
|
|
+
|
|
|
|
+ // // 接口请求完成,隐藏模态框
|
|
|
|
+ // state.value.showDetails = false;
|
|
|
|
+
|
|
|
|
+ // }).catch(error => {
|
|
|
|
+
|
|
|
|
+ // });
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ // console.log('error submit!', fields)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 删除选中分页的某个数据
|
|
* 删除选中分页的某个数据
|
|
* @param res
|
|
* @param res
|
|
@@ -746,7 +800,7 @@ onMounted(function() {
|
|
</el-form>
|
|
</el-form>
|
|
<div class="dialogFoot">
|
|
<div class="dialogFoot">
|
|
<el-button color="#EAEAEA" @click="state.showDetails = false" style="margin-right: 0.6rem">取消</el-button>
|
|
<el-button color="#EAEAEA" @click="state.showDetails = false" style="margin-right: 0.6rem">取消</el-button>
|
|
- <el-button color="#2C68FF" @click="submitForm(ruleFormRef)">更新</el-button>
|
|
|
|
|
|
+ <el-button color="#2C68FF" @click="updateForm(ruleFormRef)">更新</el-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|