|
@@ -205,7 +205,8 @@ let addRules = ref({
|
|
|
* 详情数据
|
|
|
*/
|
|
|
let detailsDb = ref({
|
|
|
- name: '',
|
|
|
+ id: null,
|
|
|
+ name: null,
|
|
|
classIds: [],
|
|
|
});
|
|
|
|
|
@@ -505,13 +506,32 @@ const btnBatchDel = () => {
|
|
|
* @param res
|
|
|
*/
|
|
|
const btnDetail = (res) => {
|
|
|
+
|
|
|
console.log('弹出指定分页详情', res);
|
|
|
+
|
|
|
+ let submit = {
|
|
|
+ id : res.id,
|
|
|
+ };
|
|
|
|
|
|
- detailsDb.value = {
|
|
|
- name: res.name,
|
|
|
- }
|
|
|
+ courseDetail(submit)
|
|
|
+ .then(response => {
|
|
|
|
|
|
- state.value.showDetails = true;
|
|
|
+ let data = response?.data?.data;
|
|
|
+ // console.log(
|
|
|
+ // "courseDetailEvent response", response, data
|
|
|
+ // );
|
|
|
+
|
|
|
+ detailsDb.value = {
|
|
|
+ id: data.id,
|
|
|
+ name: data.name,
|
|
|
+ classIds: data.classIds,
|
|
|
+ }
|
|
|
+
|
|
|
+ state.value.showDetails = true;
|
|
|
+
|
|
|
+ }).catch(error => {
|
|
|
+
|
|
|
+ });
|
|
|
|
|
|
}
|
|
|
|
|
@@ -639,7 +659,7 @@ onMounted(function() {
|
|
|
<el-table-column prop="name" label="课程" />
|
|
|
<el-table-column label="操作">
|
|
|
<template #default="scope">
|
|
|
- <el-button link type="primary" @click="btnDetail(scope.row)">详情</el-button>
|
|
|
+ <el-button link type="primary" @click="btnDetail(scope.row)">编辑</el-button>
|
|
|
<el-popconfirm :title="`你确定删除${scope.row.name}吗?`" @confirm="btnDel(scope.row)">
|
|
|
<template #reference>
|
|
|
<el-button link type="danger" style="margin-left: 3rem">移除</el-button>
|
|
@@ -703,11 +723,31 @@ onMounted(function() {
|
|
|
<div class="dialog-title">课程详情</div>
|
|
|
</template>
|
|
|
<div class="dialogBody">
|
|
|
- <el-form :model="detailsDb">
|
|
|
+ <el-form ref="ruleFormRef" :model="detailsDb" :rules="addRules">
|
|
|
<el-form-item label="课程" prop="name">
|
|
|
- <el-input v-model="detailsDb.name" clearable disabled ></el-input>
|
|
|
+ <el-input v-model="detailsDb.name" clearable placeholder="请填写课程"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
+ <el-form ref="ruleFormRef" :model="detailsDb" :rules="addRules">
|
|
|
+ <el-form-item label="班级" prop="classIds">
|
|
|
+ <el-cascader v-model="detailsDb.classIds"
|
|
|
+ :options="options"
|
|
|
+ :props="{
|
|
|
+ children: 'children',
|
|
|
+ label: 'name',
|
|
|
+ value: 'id',
|
|
|
+ checkStrictly: false,
|
|
|
+ expandTrigger: 'hover',
|
|
|
+ emitPath: false,
|
|
|
+ multiple: true,
|
|
|
+ }"
|
|
|
+ clearable placeholder="请选择班级" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div class="dialogFoot">
|
|
|
+ <el-button color="#EAEAEA" @click="state.showDetails = false" style="margin-right: 0.6rem">取消</el-button>
|
|
|
+ <el-button color="#2C68FF" @click="submitForm(ruleFormRef)">更新</el-button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|