|
@@ -1,516 +1,498 @@
|
|
|
<template>
|
|
|
- <section class="content">
|
|
|
- <div class="box box-info">
|
|
|
- <div
|
|
|
- v-loading.body="fileLoading"
|
|
|
- v-loading.fullscreen="loading"
|
|
|
- element-loading-text="请稍后..."
|
|
|
+ <section
|
|
|
+ v-loading.body="fileLoading"
|
|
|
+ v-loading.fullscreen="loading"
|
|
|
+ element-loading-text="请稍后..."
|
|
|
+ class="content"
|
|
|
+ >
|
|
|
+ <div class="part-box">
|
|
|
+ <h2 class="part-box-title">课程列表</h2>
|
|
|
+
|
|
|
+ <el-form
|
|
|
+ ref="primaryForm"
|
|
|
+ class="part-filter-form"
|
|
|
+ inline
|
|
|
+ :model="formSearch"
|
|
|
>
|
|
|
- <el-form
|
|
|
- ref="primaryForm"
|
|
|
- inline
|
|
|
- :model="formSearch"
|
|
|
- label-width="70px"
|
|
|
- >
|
|
|
- <el-form-item label="课程名称">
|
|
|
- <el-input
|
|
|
- v-model="formSearch.name"
|
|
|
- class="input_width_lg"
|
|
|
- placeholder="请输入课程名称"
|
|
|
+ <el-form-item label="课程名称">
|
|
|
+ <el-input
|
|
|
+ v-model="formSearch.name"
|
|
|
+ class="input_width_lg"
|
|
|
+ placeholder="请输入课程名称"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="课程代码">
|
|
|
+ <el-input
|
|
|
+ v-model="formSearch.code"
|
|
|
+ class="input_width_lg"
|
|
|
+ placeholder="请输入课程代码"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="课程状态">
|
|
|
+ <el-select
|
|
|
+ v-model="formSearch.enable"
|
|
|
+ class="input_width_lg"
|
|
|
+ placeholder="请选择"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in statusList"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="层次">
|
|
|
+ <el-select
|
|
|
+ v-model="formSearch.level"
|
|
|
+ class="input_width_lg"
|
|
|
+ placeholder="请选择"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in levelList"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
/>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="课程代码">
|
|
|
- <el-input
|
|
|
- v-model="formSearch.code"
|
|
|
- class="input_width_lg"
|
|
|
- placeholder="请输入课程代码"
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="专业" prop="specialtyId">
|
|
|
+ <el-select
|
|
|
+ v-model="formSearch.specialtyId"
|
|
|
+ class="input_width_lg"
|
|
|
+ remote
|
|
|
+ :remote-method="getSpecialtyList4Search"
|
|
|
+ :loading="specialtyLoading4Search"
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ placeholder="请选择"
|
|
|
+ @focus="(e) => getSpecialtyList4Search(e.target.value)"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in specialtyList4SearchWrapper"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
/>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="课程状态">
|
|
|
- <el-select
|
|
|
- v-model="formSearch.enable"
|
|
|
- class="input_width_lg"
|
|
|
- placeholder="请选择"
|
|
|
- clearable
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-search"
|
|
|
+ @click="handleSearchBtn"
|
|
|
+ >查询</el-button
|
|
|
+ >
|
|
|
+ <el-button icon="el-icon-refresh" @click="resetPrimaryForm">
|
|
|
+ 重置
|
|
|
+ </el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <div class="part-box-action">
|
|
|
+ <div>
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ :disabled="noBatchSelected"
|
|
|
+ icon="el-icon-check"
|
|
|
+ @click="enableByIds"
|
|
|
+ >
|
|
|
+ 启用
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ type="danger"
|
|
|
+ :disabled="noBatchSelected"
|
|
|
+ icon="el-icon-close"
|
|
|
+ @click="disableByIds"
|
|
|
+ >
|
|
|
+ 禁用
|
|
|
+ </el-button>
|
|
|
+ <el-button type="primary" icon="el-icon-upload2" @click="impCourse">
|
|
|
+ 导入
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-download"
|
|
|
+ @click="exportCourse"
|
|
|
+ >
|
|
|
+ 导出
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ <el-button type="primary" icon="el-icon-plus" @click="insertCourse"
|
|
|
+ >新增</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="part-box">
|
|
|
+ <!-- 页面列表 -->
|
|
|
+ <!-- FIXME: element-ui style bug https://github.com/ElemeFE/element/issues/16167 -->
|
|
|
+ <el-table :data="tableData" resizable @selection-change="selectChange">
|
|
|
+ <el-table-column type="selection" width="50" align="center" />
|
|
|
+ <el-table-column prop="id" label="课程ID" width="80" />
|
|
|
+ <el-table-column prop="name" label="课程名称" width="180" />
|
|
|
+ <el-table-column prop="code" label="课程代码" />
|
|
|
+ <el-table-column label="层次">
|
|
|
+ <span slot-scope="scope">{{ getLevel(scope.row.level) }}</span>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column width="50" label="状态">
|
|
|
+ <span slot-scope="scope">
|
|
|
+ <span v-if="scope.row.enable">
|
|
|
+ <el-tooltip
|
|
|
+ class="item"
|
|
|
+ effect="dark"
|
|
|
+ content="启用"
|
|
|
+ placement="left"
|
|
|
+ >
|
|
|
+ <i class="el-icon-success" style="color: #1fb46f"></i>
|
|
|
+ </el-tooltip>
|
|
|
+ </span>
|
|
|
+ <span v-else>
|
|
|
+ <el-tooltip
|
|
|
+ class="item"
|
|
|
+ effect="dark"
|
|
|
+ content="禁用"
|
|
|
+ placement="left"
|
|
|
+ >
|
|
|
+ <i class="el-icon-error" style="color: #ff7240"></i>
|
|
|
+ </el-tooltip>
|
|
|
+ </span>
|
|
|
+ </span>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ sortable
|
|
|
+ prop="updateTime"
|
|
|
+ label="更新时间"
|
|
|
+ width="170"
|
|
|
+ />
|
|
|
+ <el-table-column label="操作" width="200">
|
|
|
+ <div slot-scope="scope">
|
|
|
+ <!-- <el-button
|
|
|
+ size="mini"
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ icon="el-icon-share"
|
|
|
+ @click="relation(scope.row)"
|
|
|
+ >
|
|
|
+ 关联专业
|
|
|
+ </el-button> -->
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ @click="editCourse(scope.row)"
|
|
|
>
|
|
|
- <el-option
|
|
|
- v-for="item in statusList"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="层次">
|
|
|
- <el-select
|
|
|
- v-model="formSearch.level"
|
|
|
- class="input_width_lg"
|
|
|
- placeholder="请选择"
|
|
|
- clearable
|
|
|
+ <i class="el-icon-edit"></i> 编辑
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ v-if="!scope.row.enable"
|
|
|
+ size="mini"
|
|
|
+ plain
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-check"
|
|
|
+ @click="enableById(scope.row)"
|
|
|
>
|
|
|
- <el-option
|
|
|
- v-for="item in levelList"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="专业" prop="specialtyId">
|
|
|
- <el-select
|
|
|
- v-model="formSearch.specialtyId"
|
|
|
- class="input_width_lg"
|
|
|
- remote
|
|
|
- :remote-method="getSpecialtyList4Search"
|
|
|
- :loading="specialtyLoading4Search"
|
|
|
- filterable
|
|
|
- clearable
|
|
|
- placeholder="请选择"
|
|
|
- @focus="(e) => getSpecialtyList4Search(e.target.value)"
|
|
|
+ 启用
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ v-if="scope.row.enable"
|
|
|
+ size="mini"
|
|
|
+ type="danger"
|
|
|
+ icon="el-icon-close"
|
|
|
+ @click="disableById(scope.row)"
|
|
|
>
|
|
|
- <el-option
|
|
|
- v-for="item in specialtyList4SearchWrapper"
|
|
|
- :key="item.id"
|
|
|
- :label="item.name"
|
|
|
- :value="item.id"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
+ 禁用
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div class="part-page">
|
|
|
+ <el-pagination
|
|
|
+ :current-page="currentPage"
|
|
|
+ :page-size="10"
|
|
|
+ :page-sizes="[10, 20, 50, 100, 200, 300]"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ :total="total"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ >
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 添加或新增课程弹出框 -->
|
|
|
+ <el-dialog
|
|
|
+ title="课程"
|
|
|
+ width="420px"
|
|
|
+ :visible.sync="courseDialog"
|
|
|
+ :modal="false"
|
|
|
+ append-to-body
|
|
|
+ custom-class="side-dialog"
|
|
|
+ @close="dialogBeforeClose"
|
|
|
+ >
|
|
|
+ <el-form
|
|
|
+ ref="courseForm"
|
|
|
+ :inline="true"
|
|
|
+ inline-message
|
|
|
+ :model="courseForm"
|
|
|
+ :rules="rules"
|
|
|
+ label-width="90px"
|
|
|
+ >
|
|
|
+ <el-form-item label="课程代码" prop="code">
|
|
|
+ <el-input
|
|
|
+ v-model="courseForm.code"
|
|
|
+ :disabled="null != courseForm.id"
|
|
|
+ class="pull_length"
|
|
|
+ auto-complete="off"
|
|
|
+ placeholder="请输入课程代码"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="课程名称" prop="name">
|
|
|
+ <el-input
|
|
|
+ v-model="courseForm.name"
|
|
|
+ class="pull_length"
|
|
|
+ auto-complete="off"
|
|
|
+ placeholder="请输入课程名称"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="层次" prop="level">
|
|
|
+ <el-select
|
|
|
+ v-model="courseForm.level"
|
|
|
+ class="pull_length"
|
|
|
+ placeholder="请选择"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in levelList"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="课程状态" prop="enable">
|
|
|
+ <el-radio-group v-model="courseForm.enable" class="pull_length">
|
|
|
+ <el-radio label="true">启用</el-radio>
|
|
|
+ <el-radio label="false">禁用</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <div slot="footer">
|
|
|
+ <el-button type="primary" @click="submitForm">保 存</el-button>
|
|
|
+ <el-button @click="courseDialog = false">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
|
|
|
- <el-form-item class="d-block">
|
|
|
+ <!-- 导入弹窗 -->
|
|
|
+ <el-dialog
|
|
|
+ title="导入窗口"
|
|
|
+ width="520px"
|
|
|
+ :visible.sync="impDialog"
|
|
|
+ :modal="false"
|
|
|
+ append-to-body
|
|
|
+ custom-class="side-dialog"
|
|
|
+ >
|
|
|
+ <el-form>
|
|
|
+ <el-form-item style="margin-left: 20px">
|
|
|
+ <el-upload
|
|
|
+ ref="upload"
|
|
|
+ class="form_left"
|
|
|
+ accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
|
+ :action="uploadAction"
|
|
|
+ :headers="uploadHeaders"
|
|
|
+ :data="uploadData"
|
|
|
+ :before-upload="beforeUpload"
|
|
|
+ :on-progress="uploadProgress"
|
|
|
+ :on-success="uploadSuccess"
|
|
|
+ :on-error="uploadError"
|
|
|
+ :file-list="fileList"
|
|
|
+ :auto-upload="false"
|
|
|
+ :multiple="false"
|
|
|
+ >
|
|
|
<el-button
|
|
|
+ slot="trigger"
|
|
|
size="small"
|
|
|
type="primary"
|
|
|
icon="el-icon-search"
|
|
|
- @click="handleSearchBtn"
|
|
|
- >查询</el-button
|
|
|
>
|
|
|
+ 选择文件
|
|
|
+ </el-button>
|
|
|
+
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-check"
|
|
|
+ @click="submitUpload"
|
|
|
+ >
|
|
|
+ 确认上传
|
|
|
+ </el-button>
|
|
|
<el-button
|
|
|
size="small"
|
|
|
+ type="primary"
|
|
|
icon="el-icon-refresh"
|
|
|
- @click="resetPrimaryForm"
|
|
|
+ @click="removeFile"
|
|
|
>
|
|
|
- 重置
|
|
|
+ 清空文件
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
size="small"
|
|
|
type="primary"
|
|
|
- icon="el-icon-plus"
|
|
|
- @click="insertCourse"
|
|
|
- >新增</el-button
|
|
|
+ icon="el-icon-download"
|
|
|
+ @click="exportFile"
|
|
|
>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
-
|
|
|
- <div class="block-seperator"></div>
|
|
|
-
|
|
|
- <span>操作:</span>
|
|
|
- <el-button
|
|
|
- size="small"
|
|
|
- type="success"
|
|
|
- :disabled="noBatchSelected"
|
|
|
- icon="el-icon-check"
|
|
|
- @click="enableByIds"
|
|
|
- >
|
|
|
- 启用
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- size="small"
|
|
|
- type="danger"
|
|
|
- :disabled="noBatchSelected"
|
|
|
- icon="el-icon-close"
|
|
|
- @click="disableByIds"
|
|
|
- >
|
|
|
- 禁用
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- size="small"
|
|
|
- type="primary"
|
|
|
- icon="el-icon-upload2"
|
|
|
- @click="impCourse"
|
|
|
- >
|
|
|
- 导入
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- size="small"
|
|
|
- type="primary"
|
|
|
- icon="el-icon-download"
|
|
|
- @click="exportCourse"
|
|
|
- >
|
|
|
- 导出
|
|
|
- </el-button>
|
|
|
+ 下载模板
|
|
|
+ </el-button>
|
|
|
+ <div slot="tip" class="el-upload__tip">只能上传xlsx文件</div>
|
|
|
+ </el-upload>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </el-dialog>
|
|
|
|
|
|
- <div style="width: 100%; margin-bottom: 10px"></div>
|
|
|
+ <!-- 导入错误信息列表 -->
|
|
|
+ <el-dialog title="错误提示" :visible.sync="errDialog">
|
|
|
+ <div
|
|
|
+ v-for="errMessage in errMessages"
|
|
|
+ :key="errMessage.lineNum"
|
|
|
+ class="text-danger"
|
|
|
+ >
|
|
|
+ 第{{ errMessage.lineNum }}行:{{ errMessage.msg }}
|
|
|
+ </div>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="errDialog = false">确定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
|
|
|
- <!-- 添加或新增课程弹出框 -->
|
|
|
- <el-dialog
|
|
|
- title="课程"
|
|
|
- width="420px"
|
|
|
- :visible.sync="courseDialog"
|
|
|
- @close="dialogBeforeClose"
|
|
|
- >
|
|
|
- <el-form
|
|
|
- ref="courseForm"
|
|
|
- :inline="true"
|
|
|
- inline-message
|
|
|
- :model="courseForm"
|
|
|
- :rules="rules"
|
|
|
- label-width="90px"
|
|
|
+ <!-- 关联专业弹出框 -->
|
|
|
+ <el-dialog
|
|
|
+ :title="specialtyDialogTitle"
|
|
|
+ :visible.sync="specialtyDialog"
|
|
|
+ width="800px"
|
|
|
+ :modal="false"
|
|
|
+ append-to-body
|
|
|
+ custom-class="side-dialog"
|
|
|
+ >
|
|
|
+ <!-- 表单 -->
|
|
|
+ <el-form :inline="true" :model="specialtySearchForm">
|
|
|
+ <el-form-item label="专业名称">
|
|
|
+ <el-input
|
|
|
+ v-model="specialtySearchForm.name"
|
|
|
+ class="input_width_lg"
|
|
|
+ placeholder="请输入专业名称"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="专业代码">
|
|
|
+ <el-input
|
|
|
+ v-model="specialtySearchForm.code"
|
|
|
+ class="input_width_lg"
|
|
|
+ placeholder="请输入专业代码"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-search"
|
|
|
+ @click="searchSpecialtyPage"
|
|
|
>
|
|
|
- <el-row>
|
|
|
- <el-form-item label="课程代码" prop="code">
|
|
|
- <el-input
|
|
|
- v-model="courseForm.code"
|
|
|
- :disabled="null != courseForm.id"
|
|
|
- class="pull_length"
|
|
|
- auto-complete="off"
|
|
|
- placeholder="请输入课程代码"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-form-item label="课程名称" prop="name">
|
|
|
- <el-input
|
|
|
- v-model="courseForm.name"
|
|
|
- class="pull_length"
|
|
|
- auto-complete="off"
|
|
|
- placeholder="请输入课程名称"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-form-item label="层次" prop="level">
|
|
|
- <el-select
|
|
|
- v-model="courseForm.level"
|
|
|
- class="pull_length"
|
|
|
- placeholder="请选择"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in levelList"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-form-item label="课程状态" prop="enable">
|
|
|
- <el-radio-group v-model="courseForm.enable" class="pull_length">
|
|
|
- <el-radio label="true">启用</el-radio>
|
|
|
- <el-radio label="false">禁用</el-radio>
|
|
|
- </el-radio-group>
|
|
|
- </el-form-item>
|
|
|
- </el-row>
|
|
|
- <el-row class="pull-center">
|
|
|
- <el-button type="primary" @click="submitForm">保 存</el-button>
|
|
|
- <el-button @click="courseDialog = false">取 消</el-button>
|
|
|
- </el-row>
|
|
|
- </el-form>
|
|
|
- </el-dialog>
|
|
|
-
|
|
|
- <!-- 导入弹窗 -->
|
|
|
- <el-dialog title="导入窗口" width="520px" :visible.sync="impDialog">
|
|
|
- <el-form>
|
|
|
- <el-row>
|
|
|
- <el-form-item style="margin-left: 20px">
|
|
|
- <el-upload
|
|
|
- ref="upload"
|
|
|
- class="form_left"
|
|
|
- accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
|
- :action="uploadAction"
|
|
|
- :headers="uploadHeaders"
|
|
|
- :data="uploadData"
|
|
|
- :before-upload="beforeUpload"
|
|
|
- :on-progress="uploadProgress"
|
|
|
- :on-success="uploadSuccess"
|
|
|
- :on-error="uploadError"
|
|
|
- :file-list="fileList"
|
|
|
- :auto-upload="false"
|
|
|
- :multiple="false"
|
|
|
- >
|
|
|
- <el-button
|
|
|
- slot="trigger"
|
|
|
- size="small"
|
|
|
- type="primary"
|
|
|
- icon="el-icon-search"
|
|
|
- >
|
|
|
- 选择文件
|
|
|
- </el-button>
|
|
|
-
|
|
|
- <el-button
|
|
|
- size="small"
|
|
|
- type="primary"
|
|
|
- icon="el-icon-check"
|
|
|
- @click="submitUpload"
|
|
|
- >
|
|
|
- 确认上传
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- size="small"
|
|
|
- type="primary"
|
|
|
- icon="el-icon-refresh"
|
|
|
- @click="removeFile"
|
|
|
- >
|
|
|
- 清空文件
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- size="small"
|
|
|
- type="primary"
|
|
|
- icon="el-icon-download"
|
|
|
- @click="exportFile"
|
|
|
- >
|
|
|
- 下载模板
|
|
|
- </el-button>
|
|
|
- <div slot="tip" class="el-upload__tip">只能上传xlsx文件</div>
|
|
|
- </el-upload>
|
|
|
- </el-form-item>
|
|
|
- </el-row>
|
|
|
- </el-form>
|
|
|
- </el-dialog>
|
|
|
-
|
|
|
- <!-- 导入错误信息列表 -->
|
|
|
- <el-dialog title="错误提示" :visible.sync="errDialog">
|
|
|
- <div
|
|
|
- v-for="errMessage in errMessages"
|
|
|
- :key="errMessage.lineNum"
|
|
|
- class="text-danger"
|
|
|
+ 查询
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-plus"
|
|
|
+ @click="addRelation"
|
|
|
>
|
|
|
- 第{{ errMessage.lineNum }}行:{{ errMessage.msg }}
|
|
|
- </div>
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="errDialog = false">确定</el-button>
|
|
|
- </span>
|
|
|
- </el-dialog>
|
|
|
+ 新增
|
|
|
+ </el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
|
|
|
- <!-- 关联专业弹出框 -->
|
|
|
- <el-dialog
|
|
|
- :title="specialtyDialogTitle"
|
|
|
- :visible.sync="specialtyDialog"
|
|
|
- width="800px"
|
|
|
- >
|
|
|
- <!-- 表单 -->
|
|
|
- <el-form :inline="true" :model="specialtySearchForm">
|
|
|
- <el-form-item label="专业名称">
|
|
|
- <el-input
|
|
|
- v-model="specialtySearchForm.name"
|
|
|
- class="input_width_lg"
|
|
|
- placeholder="请输入专业名称"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="专业代码">
|
|
|
- <el-input
|
|
|
- v-model="specialtySearchForm.code"
|
|
|
- class="input_width_lg"
|
|
|
- placeholder="请输入专业代码"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button
|
|
|
- size="small"
|
|
|
- type="primary"
|
|
|
- icon="el-icon-search"
|
|
|
- @click="searchSpecialtyPage"
|
|
|
- >
|
|
|
- 查询
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- size="small"
|
|
|
- type="primary"
|
|
|
- icon="el-icon-plus"
|
|
|
- @click="addRelation"
|
|
|
- >
|
|
|
- 新增
|
|
|
- </el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
-
|
|
|
- <!-- 专业列表 -->
|
|
|
- <el-table :data="specialtyTableData" border>
|
|
|
- <el-table-column prop="id" label="ID" width="100" />
|
|
|
- <el-table-column prop="name" label="专业名称" width="250" />
|
|
|
- <el-table-column prop="code" label="专业代码" />
|
|
|
- <el-table-column
|
|
|
- sortable
|
|
|
- prop="updateTime"
|
|
|
- label="更新时间"
|
|
|
- width="170"
|
|
|
- />
|
|
|
- <el-table-column label="操作">
|
|
|
- <div slot-scope="scope">
|
|
|
- <span>
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="primary"
|
|
|
- icon="el-icon-edit"
|
|
|
- plain
|
|
|
- @click="deleteRelation(scope.row)"
|
|
|
- >
|
|
|
- 取消关联
|
|
|
- </el-button>
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <div class="page pull-right">
|
|
|
- <el-pagination
|
|
|
- :current-page="currentSpecialtyPage"
|
|
|
- :page-size="10"
|
|
|
- :total="specialtyTotal"
|
|
|
- @current-change="handleSpecialtyCurrentChange"
|
|
|
- />
|
|
|
- </div>
|
|
|
- <div style="margin-bottom: 20px"></div>
|
|
|
- </el-dialog>
|
|
|
-
|
|
|
- <!-- 添加关联 -->
|
|
|
- <el-dialog
|
|
|
- title="添加关联专业"
|
|
|
- :visible.sync="addRelationDialog"
|
|
|
- width="400px"
|
|
|
- @close="() => $refs.addRelationForm.clearValidate()"
|
|
|
- >
|
|
|
- <el-form
|
|
|
- ref="addRelationForm"
|
|
|
- :inline="true"
|
|
|
- inline-message
|
|
|
- :model="addRelationForm"
|
|
|
- :rules="addRelationRules"
|
|
|
- >
|
|
|
- <el-row>
|
|
|
- <el-form-item label="专业" prop="specialtyId">
|
|
|
- <el-select
|
|
|
- v-model="addRelationForm.specialtyId"
|
|
|
- class="input"
|
|
|
- style="width: 200px"
|
|
|
- remote
|
|
|
- :remote-method="getSpecialtyList4AddRelation"
|
|
|
- :loading="specialtyLoading4AddRelation"
|
|
|
- filterable
|
|
|
- clearable
|
|
|
- placeholder="请选择"
|
|
|
- @focus="(e) => getSpecialtyList4AddRelation(e.target.value)"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in specialtyList4AddRelationWrapper"
|
|
|
- :key="item.id"
|
|
|
- :label="item.name"
|
|
|
- :value="item.id"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-row>
|
|
|
- <el-row class="d-flex justify-content-center">
|
|
|
- <el-button type="primary" @click="submitAddRelationForm">
|
|
|
- 保 存
|
|
|
- </el-button>
|
|
|
- <el-button @click="addRelationDialog = false">取 消</el-button>
|
|
|
- </el-row>
|
|
|
- </el-form>
|
|
|
- </el-dialog>
|
|
|
-
|
|
|
- <!-- 页面列表 -->
|
|
|
- <!-- FIXME: element-ui style bug https://github.com/ElemeFE/element/issues/16167 -->
|
|
|
- <el-table
|
|
|
- :data="tableData"
|
|
|
- border
|
|
|
- resizable
|
|
|
- stripe
|
|
|
- style="width: 99.99% !important"
|
|
|
- @selection-change="selectChange"
|
|
|
- >
|
|
|
- <el-table-column type="selection" width="40" />
|
|
|
- <el-table-column prop="id" label="课程ID" width="80" />
|
|
|
- <el-table-column prop="name" label="课程名称" width="180" />
|
|
|
- <el-table-column prop="code" label="课程代码" />
|
|
|
- <el-table-column label="层次">
|
|
|
- <span slot-scope="scope">{{ getLevel(scope.row.level) }}</span>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column width="50" label="状态">
|
|
|
- <span slot-scope="scope">
|
|
|
- <span v-if="scope.row.enable">
|
|
|
- <el-tooltip
|
|
|
- class="item"
|
|
|
- effect="dark"
|
|
|
- content="启用"
|
|
|
- placement="left"
|
|
|
- >
|
|
|
- <i class="el-icon-success" style="color: green"></i>
|
|
|
- </el-tooltip>
|
|
|
- </span>
|
|
|
- <span v-else>
|
|
|
- <el-tooltip
|
|
|
- class="item"
|
|
|
- effect="dark"
|
|
|
- content="禁用"
|
|
|
- placement="left"
|
|
|
- >
|
|
|
- <i class="el-icon-error" style="color: red"></i>
|
|
|
- </el-tooltip>
|
|
|
- </span>
|
|
|
- </span>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- sortable
|
|
|
- prop="updateTime"
|
|
|
- label="更新时间"
|
|
|
- width="170"
|
|
|
- />
|
|
|
- <el-table-column label="操作" width="290">
|
|
|
- <div slot-scope="scope">
|
|
|
- <!-- <el-button
|
|
|
- size="mini"
|
|
|
- type="primary"
|
|
|
- plain
|
|
|
- icon="el-icon-share"
|
|
|
- @click="relation(scope.row)"
|
|
|
- >
|
|
|
- 关联专业
|
|
|
- </el-button> -->
|
|
|
+ <!-- 专业列表 -->
|
|
|
+ <el-table :data="specialtyTableData" border>
|
|
|
+ <el-table-column prop="id" label="ID" width="100" />
|
|
|
+ <el-table-column prop="name" label="专业名称" width="250" />
|
|
|
+ <el-table-column prop="code" label="专业代码" />
|
|
|
+ <el-table-column
|
|
|
+ sortable
|
|
|
+ prop="updateTime"
|
|
|
+ label="更新时间"
|
|
|
+ width="170"
|
|
|
+ />
|
|
|
+ <el-table-column label="操作">
|
|
|
+ <div slot-scope="scope">
|
|
|
+ <span>
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="primary"
|
|
|
+ icon="el-icon-edit"
|
|
|
plain
|
|
|
- @click="editCourse(scope.row)"
|
|
|
- >
|
|
|
- <i class="el-icon-edit"></i> 编辑
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- v-if="!scope.row.enable"
|
|
|
- size="mini"
|
|
|
- plain
|
|
|
- type="primary"
|
|
|
- icon="el-icon-check"
|
|
|
- @click="enableById(scope.row)"
|
|
|
- >
|
|
|
- 启用
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- v-if="scope.row.enable"
|
|
|
- size="mini"
|
|
|
- type="danger"
|
|
|
- icon="el-icon-close"
|
|
|
- @click="disableById(scope.row)"
|
|
|
+ @click="deleteRelation(scope.row)"
|
|
|
>
|
|
|
- 禁用
|
|
|
+ 取消关联
|
|
|
</el-button>
|
|
|
- </div>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <div class="page pull-right">
|
|
|
- <el-pagination
|
|
|
- :current-page="currentPage"
|
|
|
- :page-size="10"
|
|
|
- :page-sizes="[10, 20, 50, 100, 200, 300]"
|
|
|
- layout="total, sizes, prev, pager, next, jumper"
|
|
|
- :total="total"
|
|
|
- @current-change="handleCurrentChange"
|
|
|
- @size-change="handleSizeChange"
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div class="part-page">
|
|
|
+ <el-pagination
|
|
|
+ :current-page="currentSpecialtyPage"
|
|
|
+ :page-size="10"
|
|
|
+ :total="specialtyTotal"
|
|
|
+ @current-change="handleSpecialtyCurrentChange"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- 添加关联 -->
|
|
|
+ <el-dialog
|
|
|
+ title="添加关联专业"
|
|
|
+ :visible.sync="addRelationDialog"
|
|
|
+ width="400px"
|
|
|
+ :modal="false"
|
|
|
+ append-to-body
|
|
|
+ custom-class="side-dialog"
|
|
|
+ @close="() => $refs.addRelationForm.clearValidate()"
|
|
|
+ >
|
|
|
+ <el-form
|
|
|
+ ref="addRelationForm"
|
|
|
+ :inline="true"
|
|
|
+ inline-message
|
|
|
+ :model="addRelationForm"
|
|
|
+ :rules="addRelationRules"
|
|
|
+ >
|
|
|
+ <el-form-item label="专业" prop="specialtyId">
|
|
|
+ <el-select
|
|
|
+ v-model="addRelationForm.specialtyId"
|
|
|
+ class="input"
|
|
|
+ style="width: 200px"
|
|
|
+ remote
|
|
|
+ :remote-method="getSpecialtyList4AddRelation"
|
|
|
+ :loading="specialtyLoading4AddRelation"
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ placeholder="请选择"
|
|
|
+ @focus="(e) => getSpecialtyList4AddRelation(e.target.value)"
|
|
|
>
|
|
|
- </el-pagination>
|
|
|
- </div>
|
|
|
+ <el-option
|
|
|
+ v-for="item in specialtyList4AddRelationWrapper"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer">
|
|
|
+ <el-button type="primary" @click="submitAddRelationForm">
|
|
|
+ 保 存
|
|
|
+ </el-button>
|
|
|
+ <el-button @click="addRelationDialog = false">取 消</el-button>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </el-dialog>
|
|
|
</section>
|
|
|
</template>
|
|
|
|